apikey estudios bíblicos
This commit is contained in:
parent
b12c31099c
commit
e882a41510
|
|
@ -17,6 +17,7 @@ interface ParagraphDoc {
|
|||
id?: string
|
||||
document_id: string
|
||||
text: string
|
||||
raw?: string
|
||||
number: number
|
||||
locale: string
|
||||
type: string
|
||||
|
|
@ -327,6 +328,7 @@ function normalize(s: string): string {
|
|||
// ---- Refs de estado ---------------------------------------------------------
|
||||
|
||||
const paragraphsContainer = ref<HTMLElement | null>(null)
|
||||
const scrollContainer = ref<HTMLElement | null>(null)
|
||||
|
||||
// 'typesense' = Estado 1 (server-driven), 'local' = Estado 2 (client-driven)
|
||||
type SearchMode = 'typesense' | 'local'
|
||||
|
|
@ -481,9 +483,11 @@ async function applyTypesenseHighlights() {
|
|||
matchElements.value = domMarks
|
||||
currentMatchIdx.value = 0
|
||||
|
||||
// Paso 4: scroll — solo cuando hay hits de Typesense que ubican el párrafo correcto.
|
||||
// Sin hits, los marks se muestran para que el usuario navegue, pero no se hace scroll.
|
||||
if (!hasMatchingHits) return
|
||||
// Paso 4: scroll — sin hits (browse mode) volver al inicio; con hits, ir al párrafo correcto.
|
||||
if (!hasMatchingHits) {
|
||||
if (scrollContainer.value) scrollContainer.value.scrollTop = 0
|
||||
return
|
||||
}
|
||||
|
||||
let targetMark: HTMLElement | null = snippetMarks[0] ?? null
|
||||
|
||||
|
|
@ -856,7 +860,7 @@ function highlightTextNodes(root: HTMLElement, terms: string[]): number {
|
|||
<div class="">
|
||||
<div
|
||||
class="paragraph-html text-sm leading-relaxed text-gray-800 dark:text-gray-200"
|
||||
v-html="hit.document.raw"
|
||||
v-html="hit.document.raw || hit.document.text"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ export default defineNuxtConfig({
|
|||
|
||||
typesense: {
|
||||
url: 'https://searchts.carpa.com', // Your Typesense server URL
|
||||
apiKey: 'a2lbIMTxh48KVteLLndpBfo4tuOIGiwD', // Your Typesense API key
|
||||
apiKey: 'ULcypm8VYP2vgQkN57CuUqSFypWaR6ox', // Your Typesense API key
|
||||
// Habilita los composables auto-importados en cliente
|
||||
// (useTypesenseDocuments, useTypesenseApi, etc.).
|
||||
// ⚠️ Solo usa una clave de búsqueda (search-only) aquí: queda expuesta al navegador.
|
||||
|
|
|
|||
Loading…
Reference in New Issue