Commit fed41716e9

fed41716e986110a48bae226973b713fc775cefb

parent: 84e618beb3

Unsigned

Duck <57977673+woducku@users.noreply.github.com> · 2026-07-29 12:28 UTC

list

Layout: unified · split

docs/.vitepress/configs/constants.ts +1 −1
@@ -141,7 +141,7 @@ export const homeCards: HomeCard[] = [
141 }, 141 },
142 { 142 {
143 id: 'faq', 143 id: 'faq',
144 icon: ':lucide-message-circle-question-mark:', 144 icon: ':lucide-message-circle-question:',
145 title: 'FAQs', 145 title: 'FAQs',
146 details: 'Frequently asked questions about manga and anime', 146 details: 'Frequently asked questions about manga and anime',
147 link: '/faq' 147 link: '/faq'
docs/.vitepress/theme/components/search/Search.vue +2
@@ -48,6 +48,7 @@ import { applyFavicons, useFavicons } from '../../composables/useFavicons'
48import { registerGlobalComponents } from '../../globalComponents' 48import { registerGlobalComponents } from '../../globalComponents'
49import { 49import {
50 excerptPreload, 50 excerptPreload,
51 ribbonStyle,
51 saveHistoryEnabled, 52 saveHistoryEnabled,
52 searchHistory, 53 searchHistory,
53 searchMode, 54 searchMode,
@@ -1284,6 +1285,7 @@ function onMouseMove(e: MouseEvent) {
1284 <AnimatePresence> 1285 <AnimatePresence>
1285 <SearchRibbon 1286 <SearchRibbon
1286 ref="ribbonRef" 1287 ref="ribbonRef"
1288 :ribbon-style="ribbonStyle"
1287 :search-motion-div="searchMotionDiv" 1289 :search-motion-div="searchMotionDiv"
1288 :ribbon-motion="ribbonMotion" 1290 :ribbon-motion="ribbonMotion"
1289 :search-animations-enabled="searchAnimationsEnabled" 1291 :search-animations-enabled="searchAnimationsEnabled"
docs/.vitepress/theme/components/search/SearchRibbon.vue +480 −5
@@ -1,7 +1,9 @@
1<script setup lang="ts"> 1<script setup lang="ts">
2import { ChevronRight } from 'lucide-vue-next' 2import { ChevronRight, Menu } from 'lucide-vue-next'
3import { nextTick, onBeforeUnmount, ref, shallowRef, watch } from 'vue' 3import { computed, nextTick, onBeforeUnmount, ref, shallowRef, watch } from 'vue'
4import { useEventListener } from '@vueuse/core' 4import { onClickOutside, useEventListener } from '@vueuse/core'
5import { homeCards } from '../../../configs/constants'
6import type { HomeCard } from '../../../configs/constants'
5 7
6interface PageGroup { 8interface PageGroup {
7 key: string 9 key: string
@@ -9,7 +11,48 @@ interface PageGroup {
9 count: number 11 count: number
10} 12}
11 13
14interface GroupedPage {
15 key: string
16 label: string
17 count: number
18 card: HomeCard | null
19 iconClass: string
20}
21
22interface FolderGroup {
23 section: string
24 parentCard: HomeCard | null
25 iconClass: string
26 pages: GroupedPage[]
27}
28
29type MenuEntry =
30 | { type: 'page'; page: GroupedPage }
31 | { type: 'folder'; folder: FolderGroup }
32
33function getPageCard(path: string): HomeCard | null {
34 let best: HomeCard | null = null
35 let bestLen = 0
36 for (const card of homeCards) {
37 if ((path === card.link || path.startsWith(card.link + '/')) && card.link.length > bestLen) {
38 best = card
39 bestLen = card.link.length
40 }
41 }
42 return best
43}
44
45function cardIconToClass(icon: string): string {
46 const m = icon.match(/^:(.+):$/)
47 if (!m) return 'i-lucide:file-text'
48 const name = m[1]
49 const dash = name.indexOf('-')
50 if (dash === -1) return 'i-lucide:file-text'
51 return `i-${name.slice(0, dash)}:${name.slice(dash + 1)}`
52}
53
12const props = defineProps<{ 54const props = defineProps<{
55 ribbonStyle: 'tabs' | 'list'
13 searchMotionDiv: string | object 56 searchMotionDiv: string | object
14 ribbonMotion: Record<string, unknown> 57 ribbonMotion: Record<string, unknown>
15 searchAnimationsEnabled: boolean 58 searchAnimationsEnabled: boolean
@@ -27,6 +70,12 @@ const emit = defineEmits<{
27 selectPage: [key: string | null] 70 selectPage: [key: string | null]
28}>() 71}>()
29 72
73// List ribbon state
74const showListMenu = ref(false)
75const listMenuButtonRef = ref<HTMLElement>()
76const listMenuRef = ref<HTMLElement>()
77
78// Tabs ribbon state
30const ribbonTrack = shallowRef<HTMLElement>() 79const ribbonTrack = shallowRef<HTMLElement>()
31const ribbonCanScrollLeft = ref(false) 80const ribbonCanScrollLeft = ref(false)
32const ribbonCanScrollRight = ref(false) 81const ribbonCanScrollRight = ref(false)
@@ -39,6 +88,10 @@ let touchStartX = 0
39let touchStartScrollLeft = 0 88let touchStartScrollLeft = 0
40let touchDragMoved = false 89let touchDragMoved = false
41 90
91onClickOutside(listMenuRef, () => {
92 showListMenu.value = false
93}, { ignore: [listMenuButtonRef] })
94
42function onDragStart(e: MouseEvent) { 95function onDragStart(e: MouseEvent) {
43 // Only respond to primary (left) button 96 // Only respond to primary (left) button
44 if (e.button !== 0) return 97 if (e.button !== 0) return
@@ -146,6 +199,7 @@ function getRibbonTrack(): HTMLElement | null {
146} 199}
147 200
148function scrollActivePagePillIntoView(direction = 0) { 201function scrollActivePagePillIntoView(direction = 0) {
202 if (props.ribbonStyle === 'list') return
149 nextTick(() => { 203 nextTick(() => {
150 const track = getRibbonTrack() 204 const track = getRibbonTrack()
151 if (!track) return 205 if (!track) return
@@ -218,23 +272,211 @@ onBeforeUnmount(() => {
218 272
219defineExpose({ scrollActivePagePillIntoView }) 273defineExpose({ scrollActivePagePillIntoView })
220 274
275const groupedMenuEntries = computed((): MenuEntry[] => {
276 const groups = props.urlSearchMode ? props.urlPageGroups : props.pageGroups
277 if (!groups.length) return []
278
279 // Wrap each group with card info
280 const withCards: GroupedPage[] = groups.map((g) => {
281 const card = getPageCard(g.key)
282 return {
283 key: g.key,
284 label: g.label,
285 count: g.count,
286 card,
287 iconClass: card ? cardIconToClass(card.icon) : 'i-lucide:file-text'
288 }
289 })
290
291 // Separate into top-level (no section) and folder (has section)
292 const topPages: GroupedPage[] = []
293 const folderMap = new Map<string, GroupedPage[]>()
294
295 for (const p of withCards) {
296 if (p.card?.section) {
297 if (!folderMap.has(p.card.section)) folderMap.set(p.card.section, [])
298 folderMap.get(p.card.section)!.push(p)
299 } else {
300 topPages.push(p)
301 }
302 }
303
304 // Build folder entries
305 const folderEntries: FolderGroup[] = [...folderMap.entries()]
306 .map(([section, pages]) => {
307 const parentCard = homeCards.find((c) => c.title === section && !c.section) ?? null
308 return {
309 section,
310 parentCard,
311 iconClass: parentCard ? cardIconToClass(parentCard.icon) : 'i-lucide:folder',
312 pages
313 }
314 })
315
316 // Merge: top-level pages first, then folder groups
317 const entries: MenuEntry[] = [
318 ...topPages.map((p) => ({ type: 'page' as const, page: p })),
319 ...folderEntries.map((f) => ({ type: 'folder' as const, folder: f }))
320 ]
321
322 return entries
323})
324
221function setUrlPageFilter(key: string | null) { 325function setUrlPageFilter(key: string | null) {
222 emit('selectUrlPage', key) 326 emit('selectUrlPage', key)
327 showListMenu.value = false
223 nextTick(updateRibbonOverflow) 328 nextTick(updateRibbonOverflow)
224} 329}
225 330
226function setPageFilter(key: string | null) { 331function setPageFilter(key: string | null) {
227 emit('selectPage', key) 332 emit('selectPage', key)
333 showListMenu.value = false
228 nextTick(updateRibbonOverflow) 334 nextTick(updateRibbonOverflow)
229} 335}
336
337const activePageData = computed(() => {
338 const findInEntries = (key: string, fallbackCount: number) => {
339 for (const entry of groupedMenuEntries.value) {
340 if (entry.type === 'page' && entry.page.key === key) {
341 return { label: entry.page.label, iconClass: entry.page.iconClass, count: entry.page.count }
342 }
343 if (entry.type === 'folder') {
344 const found = entry.folder.pages.find((p) => p.key === key)
345 if (found) {
346 return { label: found.label, iconClass: entry.folder.iconClass, count: found.count }
347 }
348 }
349 }
350 return null
351 }
352
353 if (props.urlSearchMode) {
354 if (props.urlActivePageFilter === null) {
355 return { label: 'All', iconClass: 'i-lucide:text-search', count: props.urlMatchesLength }
356 }
357 const result = findInEntries(props.urlActivePageFilter, props.urlMatchesLength)
358 return result ?? { label: 'All', iconClass: 'i-lucide:text-search', count: props.urlMatchesLength }
359 }
360
361 if (props.activePageFilter === null) {
362 return { label: 'All', iconClass: 'i-lucide:text-search', count: props.resultsLength }
363 }
364 const result = findInEntries(props.activePageFilter, props.resultsLength)
365 return result ?? { label: 'All', iconClass: 'i-lucide:text-search', count: props.resultsLength }
366})
367
368function toggleListMenu() {
369 showListMenu.value = !showListMenu.value
370}
230</script> 371</script>
231 372
232<template> 373<template>
374 <!-- List ribbon style -->
375 <component
376 :is="searchMotionDiv"
377 v-if="ribbonStyle === 'list' && (urlSearchMode
378 ? urlPageGroups.length > 1
379 : pageGroups.length > 1)"
380 class="page-ribbon page-ribbon-list"
381 v-bind="ribbonMotion"
382 >
383 <div class="page-ribbon-list-label">
384 <span :class="activePageData.iconClass" class="page-ribbon-list-icon" />
385 <span class="page-ribbon-list-name">{{ activePageData.label }}</span>
386 <span class="page-ribbon-list-badge">{{ activePageData.count }}</span>
387 </div>
388
389 <button
390 ref="listMenuButtonRef"
391 type="button"
392 class="ribbon-menu-btn"
393 :class="{ active: showListMenu }"
394 title="Filter by page"
395 @click.stop="toggleListMenu"
396 >
397 <Menu :size="18" stroke-width="2" />
398 </button>
399
400 <!-- List menu dropdown -->
401 <Transition name="ribbon-menu-popup">
402 <div
403 v-if="showListMenu"
404 ref="listMenuRef"
405 class="page-ribbon-list-menu"
406 >
407 <!-- "All" item -->
408 <button
409 type="button"
410 class="ribbon-menu-item all-item"
411 :class="{ active: urlSearchMode
412 ? urlActivePageFilter === null
413 : activePageFilter === null }"
414 @click="urlSearchMode
415 ? setUrlPageFilter(null)
416 : setPageFilter(null)"
417 >
418 <span class="i-lucide:text-search ribbon-menu-item-icon" />
419 <span class="ribbon-menu-item-label">All</span>
420 <span class="ribbon-menu-item-count">{{ urlSearchMode ? urlMatchesLength : resultsLength }}</span>
421 </button>
422
423 <div class="ribbon-menu-divider" />
424
425 <!-- Grouped pages -->
426 <template v-for="entry in groupedMenuEntries" :key="entry.type === 'page' ? entry.page.key : entry.folder.section">
427 <!-- Top-level page -->
428 <div v-if="entry.type === 'page'" class="ribbon-menu-group">
429 <button
430 type="button"
431 class="ribbon-menu-item"
432 :class="{ active: urlSearchMode
433 ? urlActivePageFilter === entry.page.key
434 : activePageFilter === entry.page.key }"
435 @click="urlSearchMode
436 ? setUrlPageFilter(entry.page.key)
437 : setPageFilter(entry.page.key)"
438 >
439 <span :class="entry.page.iconClass" class="ribbon-menu-item-icon" />
440 <span class="ribbon-menu-item-label">{{ entry.page.label }}</span>
441 <span class="ribbon-menu-item-count">{{ entry.page.count }}</span>
442 </button>
443 </div>
444
445 <!-- Folder group -->
446 <div v-else class="ribbon-menu-group">
447 <h4 class="ribbon-menu-group-title">
448 <span :class="entry.folder.iconClass" class="ribbon-menu-group-icon" />
449 <span class="ribbon-menu-group-text">{{ entry.folder.section }}</span>
450 </h4>
451 <div class="ribbon-menu-sub-items">
452 <button
453 v-for="page in entry.folder.pages"
454 :key="page.key"
455 type="button"
456 class="ribbon-menu-item"
457 :class="{ active: urlSearchMode
458 ? urlActivePageFilter === page.key
459 : activePageFilter === page.key }"
460 @click="urlSearchMode
461 ? setUrlPageFilter(page.key)
462 : setPageFilter(page.key)"
463 >
464 <span class="ribbon-menu-item-label">{{ page.label }}</span>
465 <span class="ribbon-menu-item-count">{{ page.count }}</span>
466 </button>
467 </div>
468 </div>
469 </template>
470 </div>
471 </Transition>
472 </component>
473
474 <!-- Tabs ribbon style (original) -->
233 <component 475 <component
234 :is="searchMotionDiv" 476 :is="searchMotionDiv"
235 v-if="urlSearchMode 477 v-if="ribbonStyle !== 'list' && (urlSearchMode
236 ? urlPageGroups.length > 1 478 ? urlPageGroups.length > 1
237 : pageGroups.length > 1" 479 : pageGroups.length > 1)"
238 class="page-ribbon" 480 class="page-ribbon"
239 :class="{ 481 :class="{
240 'can-scroll-left': ribbonCanScrollLeft, 482 'can-scroll-left': ribbonCanScrollLeft,
@@ -482,4 +724,237 @@ function setPageFilter(key: string | null) {
482 font-size: 0.8rem; 724 font-size: 0.8rem;
483 } 725 }
484} 726}
727
728/* List ribbon style */
729.page-ribbon-list {
730 justify-content: space-between;
731 padding: 6px 12px 4px;
732 overflow: visible;
733}
734
735.page-ribbon-list-label {
736 display: flex;
737 align-items: center;
738 gap: 6px;
739 font-size: 0.9rem;
740 font-weight: 500;
741 color: var(--vp-c-text-2);
742 font-variant-numeric: tabular-nums;
743 line-height: 1;
744 min-width: 0;
745}
746
747.page-ribbon-list-icon {
748 flex: none;
749 font-size: 16px;
750 width: 1em;
751 height: 1em;
752 color: var(--vp-c-text-1);
753}
754
755.page-ribbon-list-name {
756 overflow: hidden;
757 text-overflow: ellipsis;
758 white-space: nowrap;
759 min-width: 0;
760 color: var(--vp-c-text-1);
761 font-weight: 600;
762}
763
764.page-ribbon-list-badge {
765 flex-shrink: 0;
766 font-variant-numeric: tabular-nums;
767 font-size: 0.72rem;
768 padding: 1px 7px;
769 border-radius: 4px;
770 background: rgba(128, 128, 128, 0.15);
771 color: var(--vp-c-text-1);
772 line-height: 1.5;
773 font-weight: 600;
774}
775
776.ribbon-menu-btn {
777 display: flex;
778 align-items: center;
779 justify-content: center;
780 border: none;
781 background: transparent;
782 color: var(--vp-c-text-1);
783 opacity: 0.55;
784 padding: 8px 4px;
785 cursor: pointer;
786 transition:
787 opacity 0.25s,
788 transform 0.2s cubic-bezier(0.16, 1, 0.3, 1);
789 border-radius: 0;
790 line-height: 1;
791}
792
793.ribbon-menu-btn:hover,
794.ribbon-menu-btn.active {
795 color: var(--vp-c-text-1);
796 opacity: 1;
797 background: transparent;
798}
799
800.ribbon-menu-btn:active {
801 transform: scale(0.94);
802}
803
804html.effects-disabled .ribbon-menu-btn {
805 transition: none;
806}
807
808html.effects-disabled .ribbon-menu-btn:active {
809 transform: none;
810}
811
812.page-ribbon-list-menu {
813 position: absolute;
814 top: 100%;
815 right: 4px;
816 z-index: 50;
817 width: 228px;
818 max-height: 320px;
819 overflow-y: auto;
820 overflow-x: hidden;
821 background: var(--vp-c-bg-elv);
822 border: 1px solid var(--vp-c-divider);
823 border-radius: 12px;
824 box-shadow: var(--vp-shadow-3);
825 padding: 8px;
826 overscroll-behavior: contain;
827 scrollbar-width: none;
828 -ms-overflow-style: none;
829}
830
831.page-ribbon-list-menu::-webkit-scrollbar {
832 display: none;
833}
834
835.ribbon-menu-divider {
836 height: 1px;
837 background: var(--vp-c-divider);
838 margin: 4px 0;
839}
840
841.ribbon-menu-item {
842 display: flex;
843 align-items: center;
844 gap: 8px;
845 padding: 6px 8px;
846 border: none;
847 background: transparent;
848 border-radius: 6px;
849 color: var(--vp-c-text-2);
850 font-size: 0.82rem;
851 font-weight: 500;
852 cursor: pointer;
853 transition: background-color 0.15s, color 0.15s;
854 text-align: left;
855 width: 100%;
856}
857
858.ribbon-menu-item:hover {
859 background: var(--vp-c-default-soft);
860 color: var(--vp-c-text-1);
861}
862
863.ribbon-menu-item.active {
864 color: var(--vp-c-brand-1);
865 background: color-mix(in srgb, var(--vp-c-brand-1) 10%, transparent);
866 font-weight: 600;
867}
868
869.ribbon-menu-item-icon {
870 flex: none;
871 font-size: 15px;
872 color: var(--vp-c-text-1);
873 width: 1em;
874 height: 1em;
875}
876
877.ribbon-menu-item-label {
878 flex: 1;
879 overflow: hidden;
880 text-overflow: ellipsis;
881 white-space: nowrap;
882 min-width: 0;
883}
884
885.all-item {
886 font-weight: 600;
887 font-size: 0.85rem;
888}
889
890.ribbon-menu-item-count {
891 flex-shrink: 0;
892 font-variant-numeric: tabular-nums;
893 font-size: 0.68rem;
894 padding: 1px 6px;
895 border-radius: 3px;
896 background: rgba(128, 128, 128, 0.12);
897 color: var(--vp-c-text-3);
898 line-height: 1.4;
899 margin-left: auto;
900}
901
902.ribbon-menu-item.active .ribbon-menu-item-count {
903 color: var(--vp-c-text-2);
904 background: rgba(128, 128, 128, 0.18);
905}
906
907.ribbon-menu-group + .ribbon-menu-group {
908 margin-top: 2px;
909}
910
911.ribbon-menu-group-title {
912 display: flex;
913 align-items: center;
914 gap: 6px;
915 font-size: 11px;
916 font-weight: 700;
917 letter-spacing: 0.02em;
918 color: var(--vp-c-text-1);
919 margin: 8px 0 2px;
920 padding: 0 8px 4px;
921 user-select: none;
922 border-bottom: 1px solid var(--vp-c-divider);
923}
924
925.ribbon-menu-group-icon {
926 font-size: 13px;
927 flex: none;
928 width: 1em;
929 height: 1em;
930 color: var(--vp-c-text-1);
931}
932
933.ribbon-menu-group-text {
934 flex: 1;
935 min-width: 0;
936 overflow: hidden;
937 white-space: nowrap;
938 text-overflow: ellipsis;
939 text-transform: uppercase;
940 letter-spacing: 0.06em;
941}
942
943.ribbon-menu-sub-items {
944 display: flex;
945 flex-direction: column;
946 gap: 1px;
947}
948
949.ribbon-menu-popup-enter-active,
950.ribbon-menu-popup-leave-active {
951 transition: opacity 0.12s ease, transform 0.12s ease;
952 transform-origin: top right;
953}
954
955.ribbon-menu-popup-enter-from,
956.ribbon-menu-popup-leave-to {
957 opacity: 0;
958 transform: scale(0.92) translateY(-4px);
959}
485</style> 960</style>
docs/.vitepress/theme/components/search/SearchSettings.vue +62 −1
@@ -8,6 +8,7 @@ import {
8 LayoutList, 8 LayoutList,
9 List, 9 List,
10 LocateOff, 10 LocateOff,
11 Menu,
11 Regex, 12 Regex,
12 Search, 13 Search,
13 TextAlignStart 14 TextAlignStart
@@ -15,6 +16,7 @@ import {
15import { computed, nextTick, ref, watch } from 'vue' 16import { computed, nextTick, ref, watch } from 'vue'
16import { 17import {
17 excerptPreload, 18 excerptPreload,
19 ribbonStyle,
18 saveHistoryEnabled, 20 saveHistoryEnabled,
19 searchMode, 21 searchMode,
20 searchResultHighlightMode, 22 searchResultHighlightMode,
@@ -34,7 +36,7 @@ const emit = defineEmits<{
34const settingsPopupRef = ref<HTMLDivElement>() 36const settingsPopupRef = ref<HTMLDivElement>()
35const settingsBounding = useElementBounding(() => props.settingsButtonRef) 37const settingsBounding = useElementBounding(() => props.settingsButtonRef)
36 38
37type HelpSection = 'search' | 'view' | 'preload' | 'highlight' | 'history' 39type HelpSection = 'search' | 'view' | 'ribbon' | 'preload' | 'highlight' | 'history'
38const activeHelpSection = ref<HelpSection | null>(null) 40const activeHelpSection = ref<HelpSection | null>(null)
39const helpPopupEl = ref<HTMLDivElement>() 41const helpPopupEl = ref<HTMLDivElement>()
40const helpPopupPos = ref({ top: -9999, left: -9999 }) 42const helpPopupPos = ref({ top: -9999, left: -9999 })
@@ -224,6 +226,48 @@ function setSearchMode(mode: string) {
224 </div> 226 </div>
225 </div> 227 </div>
226 228
229 <!-- Ribbon -->
230 <div class="settings-section">
231 <div class="settings-section-header">
232 <div class="settings-section-label">
233 <Menu :size="14" stroke-width="1.75" />
234 Ribbon
235 </div>
236 <button
237 type="button"
238 class="settings-help-btn"
239 :class="{ active: activeHelpSection === 'ribbon' }"
240 aria-label="Ribbon style help"
241 @click.stop="toggleHelpSection('ribbon', $event)"
242 @mouseenter="onHelpEnter('ribbon', $event)"
243 @mouseleave="onHelpLeave"
244 >
245 <span class="i-carbon:help-filled settings-help-icon" />
246 </button>
247 </div>
248 <div
249 class="settings-options"
250 :class="{ 'is-highlighted': activeHelpSection === 'ribbon' }"
251 >
252 <button
253 type="button"
254 class="settings-option"
255 :class="{ active: ribbonStyle === 'tabs' }"
256 @click="ribbonStyle = 'tabs'"
257 >
258 <span>Tabs</span>
259 </button>
260 <button
261 type="button"
262 class="settings-option"
263 :class="{ active: ribbonStyle === 'list' }"
264 @click="ribbonStyle = 'list'"
265 >
266 <span>List</span>
267 </button>
268 </div>
269 </div>
270
227 <!-- Preload --> 271 <!-- Preload -->
228 <div 272 <div
229 v-if="searchMode !== 'url' && showDetailedList" 273 v-if="searchMode !== 'url' && showDetailedList"
@@ -455,6 +499,23 @@ function setSearchMode(mode: string) {
455 </div> 499 </div>
456 </div> 500 </div>
457 </template> 501 </template>
502 <template v-else-if="activeHelpSection === 'ribbon'">
503 <h4 class="sh-title">
504 <Menu :size="16" stroke-width="1.75" class="sh-title-icon" />
505 Page Ribbon
506 </h4>
507 <p class="sh-desc">How result pages are displayed in the search bar.</p>
508 <div class="sh-options">
509 <div class="sh-option">
510 <strong>Tabs</strong>
511 <span>Horizontal page list.</span>
512 </div>
513 <div class="sh-option">
514 <strong>List</strong>
515 <span>Vertical page list.</span>
516 </div>
517 </div>
518 </template>
458 <template v-else-if="activeHelpSection === 'history'"> 519 <template v-else-if="activeHelpSection === 'history'">
459 <h4 class="sh-title"> 520 <h4 class="sh-title">
460 <Clock :size="16" stroke-width="1.75" class="sh-title-icon" /> 521 <Clock :size="16" stroke-width="1.75" class="sh-title-icon" />
docs/.vitepress/theme/searchState.ts +7
@@ -47,6 +47,13 @@ export const searchHistory = useLocalStorage<SearchHistoryEntry[]>(
47 [] 47 []
48) 48)
49 49
50export type RibbonStyle = 'tabs' | 'list'
51
52export const ribbonStyle = useLocalStorage<RibbonStyle>(
53 'vitepress:local-search-ribbon-style',
54 'list'
55)
56
50export function openSearch() { 57export function openSearch() {
51 searchOpen.value = true 58 searchOpen.value = true
52}\ No newline at end of file 59}\ No newline at end of file