vitepress 1.4.1 → 1.4.3
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.
- package/dist/client/theme-default/components/VPLocalSearchBox.vue +13 -2
- package/dist/client/theme-default/components/VPNavBarTitle.vue +2 -2
- package/dist/client/theme-default/styles/components/vp-doc.css +1 -0
- package/dist/client/theme-default/styles/vars.css +2 -3
- package/dist/node/{serve-4DnZ8_Si.js → chunk-BGE1nmDJ.js} +243 -216
- package/dist/node/chunk-DQlKmeN_.js +470 -0
- package/dist/node/cli.js +7 -3
- package/dist/node/index.d.ts +7 -3
- package/dist/node/index.js +7 -5
- package/dist/node/worker_shikiResolveLang.js +13 -0
- package/package.json +18 -17
- package/theme.d.ts +3 -0
|
@@ -281,7 +281,7 @@ function onSearchBarClick(event: PointerEvent) {
|
|
|
281
281
|
/* Search keyboard selection */
|
|
282
282
|
|
|
283
283
|
const selectedIndex = ref(-1)
|
|
284
|
-
const disableMouseOver = ref(
|
|
284
|
+
const disableMouseOver = ref(true)
|
|
285
285
|
|
|
286
286
|
watch(results, (r) => {
|
|
287
287
|
selectedIndex.value = r.length ? 0 : -1
|
|
@@ -400,6 +400,16 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
400
400
|
'gi'
|
|
401
401
|
)
|
|
402
402
|
}
|
|
403
|
+
|
|
404
|
+
function onMouseMove(e: MouseEvent) {
|
|
405
|
+
if (!disableMouseOver.value) return
|
|
406
|
+
const el = (e.target as HTMLElement)?.closest<HTMLAnchorElement>('.result')
|
|
407
|
+
const index = Number.parseInt(el?.dataset.index!)
|
|
408
|
+
if (index >= 0 && index !== selectedIndex.value) {
|
|
409
|
+
selectedIndex.value = index
|
|
410
|
+
}
|
|
411
|
+
disableMouseOver.value = false
|
|
412
|
+
}
|
|
403
413
|
</script>
|
|
404
414
|
|
|
405
415
|
<template>
|
|
@@ -487,7 +497,7 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
487
497
|
:role="results?.length ? 'listbox' : undefined"
|
|
488
498
|
:aria-labelledby="results?.length ? 'localsearch-label' : undefined"
|
|
489
499
|
class="results"
|
|
490
|
-
@mousemove="
|
|
500
|
+
@mousemove="onMouseMove"
|
|
491
501
|
>
|
|
492
502
|
<li
|
|
493
503
|
v-for="(p, index) in results"
|
|
@@ -506,6 +516,7 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
506
516
|
@mouseenter="!disableMouseOver && (selectedIndex = index)"
|
|
507
517
|
@focusin="selectedIndex = index"
|
|
508
518
|
@click="$emit('close')"
|
|
519
|
+
:data-index="index"
|
|
509
520
|
>
|
|
510
521
|
<div>
|
|
511
522
|
<div class="titles">
|
|
@@ -39,8 +39,8 @@ const target = computed(() =>
|
|
|
39
39
|
>
|
|
40
40
|
<slot name="nav-bar-title-before" />
|
|
41
41
|
<VPImage v-if="theme.logo" class="logo" :image="theme.logo" />
|
|
42
|
-
<
|
|
43
|
-
<
|
|
42
|
+
<span v-if="theme.siteTitle" v-html="theme.siteTitle"></span>
|
|
43
|
+
<span v-else-if="theme.siteTitle === undefined">{{ site.title }}</span>
|
|
44
44
|
<slot name="nav-bar-title-after" />
|
|
45
45
|
</a>
|
|
46
46
|
</div>
|
|
@@ -270,9 +270,8 @@
|
|
|
270
270
|
|
|
271
271
|
:root:where(:lang(zh)) {
|
|
272
272
|
--vp-font-family-base: 'Punctuation SC', 'Inter', ui-sans-serif, system-ui,
|
|
273
|
-
|
|
274
|
-
'
|
|
275
|
-
'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
|
|
273
|
+
sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol',
|
|
274
|
+
'Noto Color Emoji';
|
|
276
275
|
}
|
|
277
276
|
|
|
278
277
|
/**
|