tecitheme 1.3.0 → 1.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -190,6 +190,7 @@
|
|
|
190
190
|
const mapped = buildOffsetMap(tokens);
|
|
191
191
|
return applyHighlights(mapped, matches);
|
|
192
192
|
}
|
|
193
|
+
|
|
193
194
|
</script>
|
|
194
195
|
|
|
195
196
|
<svelte:window on:keydown={(e) => handleKeyPress(e)} />
|
|
@@ -264,82 +265,96 @@
|
|
|
264
265
|
</Panel>
|
|
265
266
|
{/if}
|
|
266
267
|
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
<!-- Left Rail Buttons -->
|
|
278
|
-
<button
|
|
279
|
-
on:click={() => {navigateToSelection(hit)}}
|
|
280
|
-
on:mouseenter={() => {state.update(_ => hit)}}
|
|
281
|
-
on:focus={() => {state.update(_ => hit)}}
|
|
282
|
-
class="hitButton flex flex-row items-center w-full text-start px-2 py-2 pt-4 {$state.__position == hit.__position ? "bg-teci-blue-light/50" : "bg-white"}"
|
|
268
|
+
{#if $stats.nbHits > 0}
|
|
269
|
+
<!-- List of hits -->
|
|
270
|
+
<Hits
|
|
271
|
+
let:hit
|
|
272
|
+
classes={{
|
|
273
|
+
root: "flex-grow border-r md:w-full overflow-y-auto overscroll-contain",
|
|
274
|
+
emptyRoot: "",
|
|
275
|
+
list: "flex flex-col",
|
|
276
|
+
item: "w-full border-b"
|
|
277
|
+
}}
|
|
283
278
|
>
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
279
|
+
<!-- Left Rail Buttons -->
|
|
280
|
+
<button
|
|
281
|
+
on:click={() => {navigateToSelection(hit)}}
|
|
282
|
+
on:mouseenter={() => {state.update(_ => hit)}}
|
|
283
|
+
on:focus={() => {state.update(_ => hit)}}
|
|
284
|
+
class="hitButton flex flex-row items-center w-full text-start px-2 py-2 pt-4 {$state.__position == hit.__position ? "bg-teci-blue-light/50" : "bg-white"}"
|
|
285
|
+
>
|
|
286
|
+
<div class="flex flex-col items-start">
|
|
287
|
+
<p class="my-0 text-xs">{hit.breadcrumb}</p>
|
|
288
|
+
<h3 class="text-lg font-bold text-black no-underline"><Highlight {hit} attribute="title" /></h3>
|
|
289
|
+
</div>
|
|
290
290
|
|
|
291
|
-
|
|
292
|
-
<path stroke-linecap="round" stroke-linejoin="round" d="m7.49 12-3.75 3.75m0 0 3.75 3.75m-3.75-3.75h16.5V4.499" />
|
|
293
|
-
</svg>
|
|
294
|
-
</button>
|
|
291
|
+
<div class="flex-grow min-w-[10%]"></div>
|
|
295
292
|
|
|
296
|
-
|
|
297
|
-
|
|
293
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6 mr-1 p-1 flex-shrink-0 bg-white shadow">
|
|
294
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="m7.49 12-3.75 3.75m0 0 3.75 3.75m-3.75-3.75h16.5V4.499" />
|
|
295
|
+
</svg>
|
|
296
|
+
</button>
|
|
298
297
|
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
<!-- Heading -->
|
|
302
|
-
<div class="flex flex-col">
|
|
303
|
-
<p class="my-0 text-xs text-center pt-4"><Highlight {hit} attribute="breadcrumb" /></p>
|
|
304
|
-
<h2 class="text-2xl font-bold text-black no-underline text-center pt-2"><Highlight {hit} attribute="title" /></h2>
|
|
305
|
-
<p class="mb-4 py-4 border-b text-center"><Highlight {hit} attribute="summary" /></p>
|
|
306
|
-
</div>
|
|
298
|
+
<!-- Hidden Links to navigate to pages -->
|
|
299
|
+
<a id="{hit.id}Link" rel="external" href="{hit.href}" class="hitLink hidden w-0 h-0">{hit.title}</a>
|
|
307
300
|
|
|
308
|
-
<!--
|
|
309
|
-
<div
|
|
310
|
-
|
|
311
|
-
<
|
|
312
|
-
|
|
301
|
+
<!-- Pre-rendered hit previews -->
|
|
302
|
+
<div id="{hit.id}Preview" class="hidden">
|
|
303
|
+
<!-- Heading -->
|
|
304
|
+
<div class="flex flex-col">
|
|
305
|
+
<p class="my-0 text-xs text-center pt-4"><Highlight {hit} attribute="breadcrumb" /></p>
|
|
306
|
+
<h2 class="text-2xl font-bold text-black no-underline text-center pt-2"><Highlight {hit} attribute="title" /></h2>
|
|
307
|
+
<p class="mb-4 py-4 border-b text-center"><Highlight {hit} attribute="summary" /></p>
|
|
308
|
+
</div>
|
|
313
309
|
|
|
314
|
-
|
|
315
|
-
{#if hit.toc.length > 0}
|
|
310
|
+
<!-- Content Preview -->
|
|
316
311
|
<div class="flex flex-col">
|
|
317
|
-
<h4 class="font-bold text-black uppercase">
|
|
318
|
-
|
|
319
|
-
<ol class="flex flex-col space-y-2 pl-2 pt-2">
|
|
320
|
-
{#each hit.toc as heading}
|
|
321
|
-
<li class="
|
|
322
|
-
border-b
|
|
323
|
-
{heading.level == 3 ? "ml-8" : ""}
|
|
324
|
-
{heading.level == 4 ? "ml-12" : ""}
|
|
325
|
-
{heading.level == 5 ? "ml-16" : ""}
|
|
326
|
-
">
|
|
327
|
-
<a
|
|
328
|
-
href="{hit.href}{heading.tagRef}"
|
|
329
|
-
rel="external"
|
|
330
|
-
class="hover:text-teci-blue-light"
|
|
331
|
-
>
|
|
332
|
-
{heading.text}
|
|
333
|
-
</a>
|
|
334
|
-
</li>
|
|
335
|
-
{/each}
|
|
336
|
-
</ol>
|
|
312
|
+
<h4 class="text-lg font-bold text-black uppercase">Preview</h4>
|
|
313
|
+
<p class="highlightedSearchContent line-clamp-4 mb-4">{@html highlightHTMLWithMatches(hit.content, hit._matchesPosition.content)}</p>
|
|
337
314
|
</div>
|
|
338
315
|
|
|
339
|
-
|
|
316
|
+
<!-- On This Page headings -->
|
|
317
|
+
{#if hit.toc.length > 0}
|
|
318
|
+
<div class="flex flex-col">
|
|
319
|
+
<h4 class="font-bold text-black uppercase">On This Page</h4>
|
|
320
|
+
|
|
321
|
+
<ol class="flex flex-col space-y-2 pl-2 pt-2">
|
|
322
|
+
{#each hit.toc as heading}
|
|
323
|
+
<li class="
|
|
324
|
+
border-b
|
|
325
|
+
{heading.level == 3 ? "ml-8" : ""}
|
|
326
|
+
{heading.level == 4 ? "ml-12" : ""}
|
|
327
|
+
{heading.level == 5 ? "ml-16" : ""}
|
|
328
|
+
">
|
|
329
|
+
<a
|
|
330
|
+
href="{hit.href}{heading.tagRef}"
|
|
331
|
+
rel="external"
|
|
332
|
+
class="hover:text-teci-blue-light"
|
|
333
|
+
>
|
|
334
|
+
{heading.text}
|
|
335
|
+
</a>
|
|
336
|
+
</li>
|
|
337
|
+
{/each}
|
|
338
|
+
</ol>
|
|
339
|
+
</div>
|
|
340
|
+
|
|
341
|
+
{/if}
|
|
342
|
+
</div>
|
|
343
|
+
|
|
344
|
+
</Hits>
|
|
345
|
+
{:else}
|
|
346
|
+
<div class="flex-grow border-r md:w-full overflow-y-auto overscroll-contain text-center flex flex-col">
|
|
347
|
+
<p class="flex flex-row items-center justify-center text-lg font-semibold px-4 pt-4">
|
|
348
|
+
<svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="size-6 -ml-2 mr-2">
|
|
349
|
+
<path stroke-linecap="round" stroke-linejoin="round" d="m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607ZM13.5 10.5h-6" />
|
|
350
|
+
</svg>
|
|
351
|
+
No Results found
|
|
352
|
+
</p>
|
|
353
|
+
<p>
|
|
354
|
+
Please try adjusting your search terms
|
|
355
|
+
</p>
|
|
340
356
|
</div>
|
|
341
|
-
|
|
342
|
-
</Hits>
|
|
357
|
+
{/if}
|
|
343
358
|
|
|
344
359
|
<footer class="teciSearchHitsFooter flex flex-row bg-gray-100 p-2">
|
|
345
360
|
<ul class="flex flex-row space-x-2">
|