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.
@@ -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(false)
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="disableMouseOver = false"
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
- <template v-if="theme.siteTitle"><span>{{ theme.siteTitle }}</span></template>
43
- <template v-else-if="theme.siteTitle === undefined"><span>{{ site.title }}</span></template>
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>
@@ -514,6 +514,7 @@
514
514
  z-index: 2;
515
515
  font-size: 12px;
516
516
  font-weight: 500;
517
+ user-select: none;
517
518
  color: var(--vp-code-lang-color);
518
519
  transition:
519
520
  color 0.4s,
@@ -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
- 'PingFang SC', 'Noto Sans CJK SC', 'Noto Sans SC', 'Heiti SC',
274
- 'Microsoft YaHei', 'DengXian', sans-serif, 'Apple Color Emoji',
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
  /**