vitepress 2.0.0-alpha.20 → 2.0.0-alpha.21

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.
Files changed (121) hide show
  1. package/README.md +27 -7
  2. package/THIRD-PARTY-NOTICES.md +2 -2
  3. package/dist/client/app/components/ClientOnly.d.ts +2 -3
  4. package/dist/client/app/components/Content.d.ts +2 -3
  5. package/dist/client/app/composables/codeGroups.d.ts +2 -3
  6. package/dist/client/app/composables/copyCode.d.ts +2 -3
  7. package/dist/client/app/composables/copyCode.js +1 -1
  8. package/dist/client/app/composables/head.d.ts +2 -3
  9. package/dist/client/app/composables/icon.d.ts +2 -3
  10. package/dist/client/app/composables/preFetch.d.ts +2 -3
  11. package/dist/client/app/composables/preFetch.js +29 -28
  12. package/dist/client/app/data.d.ts +5 -5
  13. package/dist/client/app/devtools.d.ts +2 -3
  14. package/dist/client/app/index.d.ts +2 -3
  15. package/dist/client/app/index.js +4 -6
  16. package/dist/client/app/router.d.ts +13 -8
  17. package/dist/client/app/router.js +16 -7
  18. package/dist/client/app/ssr.d.ts +2 -3
  19. package/dist/client/app/theme.d.ts +3 -4
  20. package/dist/client/app/utils.d.ts +9 -9
  21. package/dist/client/app/utils.js +10 -5
  22. package/dist/client/shared.d.ts +48 -27
  23. package/dist/client/shared.js +35 -2
  24. package/dist/client/theme-default/NotFound.vue +6 -4
  25. package/dist/client/theme-default/components/VPBackdrop.vue +1 -6
  26. package/dist/client/theme-default/components/VPBadge.vue +4 -3
  27. package/dist/client/theme-default/components/VPButton.d.vue.ts +4 -4
  28. package/dist/client/theme-default/components/VPButton.vue +5 -3
  29. package/dist/client/theme-default/components/VPContent.vue +3 -3
  30. package/dist/client/theme-default/components/VPDoc.vue +4 -3
  31. package/dist/client/theme-default/components/VPDocAsideOutline.vue +3 -3
  32. package/dist/client/theme-default/components/VPDocFooter.vue +5 -5
  33. package/dist/client/theme-default/components/VPDocFooterLastUpdated.vue +2 -2
  34. package/dist/client/theme-default/components/VPDocOutlineItem.vue +3 -4
  35. package/dist/client/theme-default/components/VPFeature.vue +6 -6
  36. package/dist/client/theme-default/components/VPFlyout.vue +5 -5
  37. package/dist/client/theme-default/components/VPFooter.vue +6 -10
  38. package/dist/client/theme-default/components/VPHero.d.vue.ts +3 -3
  39. package/dist/client/theme-default/components/VPHero.vue +6 -10
  40. package/dist/client/theme-default/components/VPHomeContent.vue +1 -2
  41. package/dist/client/theme-default/components/VPHomeHero.d.vue.ts +7 -7
  42. package/dist/client/theme-default/components/VPImage.vue +2 -2
  43. package/dist/client/theme-default/components/VPLink.d.vue.ts +2 -2
  44. package/dist/client/theme-default/components/VPLink.vue +6 -0
  45. package/dist/client/theme-default/components/VPLocalNav.vue +4 -5
  46. package/dist/client/theme-default/components/VPLocalNavOutlineDropdown.vue +4 -7
  47. package/dist/client/theme-default/components/VPLocalSearchBox.vue +7 -26
  48. package/dist/client/theme-default/components/VPMenuGroup.vue +4 -3
  49. package/dist/client/theme-default/components/VPMenuLink.vue +3 -3
  50. package/dist/client/theme-default/components/VPNav.vue +1 -2
  51. package/dist/client/theme-default/components/VPNavAppearance.vue +2 -1
  52. package/dist/client/theme-default/components/VPNavBar.vue +15 -20
  53. package/dist/client/theme-default/components/VPNavBarExtra.vue +1 -1
  54. package/dist/client/theme-default/components/VPNavBarHamburger.vue +8 -6
  55. package/dist/client/theme-default/components/VPNavBarSearch.vue +2 -2
  56. package/dist/client/theme-default/components/VPNavBarSearchButton.vue +2 -0
  57. package/dist/client/theme-default/components/VPNavBarTitle.vue +2 -2
  58. package/dist/client/theme-default/components/VPNavMenu.vue +1 -1
  59. package/dist/client/theme-default/components/VPNavMenuGroup.vue +3 -3
  60. package/dist/client/theme-default/components/VPNavMenuLink.vue +1 -1
  61. package/dist/client/theme-default/components/VPNavScreen.vue +1 -6
  62. package/dist/client/theme-default/components/VPNavTranslations.vue +7 -5
  63. package/dist/client/theme-default/components/VPSidebar.vue +5 -6
  64. package/dist/client/theme-default/components/VPSidebarItem.vue +7 -8
  65. package/dist/client/theme-default/components/VPSkipLink.vue +2 -2
  66. package/dist/client/theme-default/components/VPSponsors.d.vue.ts +1 -1
  67. package/dist/client/theme-default/components/VPSwitch.vue +5 -6
  68. package/dist/client/theme-default/components/VPSwitchAppearance.vue +1 -2
  69. package/dist/client/theme-default/components/VPTeamMembersItem.vue +5 -5
  70. package/dist/client/theme-default/components/VPTeamPageSection.vue +3 -4
  71. package/dist/client/theme-default/components/VPTeamPageTitle.vue +2 -2
  72. package/dist/client/theme-default/composables/data.d.ts +2 -3
  73. package/dist/client/theme-default/composables/edit-link.d.ts +2 -3
  74. package/dist/client/theme-default/composables/flyout.d.ts +3 -4
  75. package/dist/client/theme-default/composables/langs.d.ts +4 -5
  76. package/dist/client/theme-default/composables/layout.d.ts +5 -6
  77. package/dist/client/theme-default/composables/nav-overflow.d.ts +9 -10
  78. package/dist/client/theme-default/composables/nav.d.ts +7 -8
  79. package/dist/client/theme-default/composables/outline.d.ts +5 -6
  80. package/dist/client/theme-default/composables/prev-next.d.ts +2 -3
  81. package/dist/client/theme-default/composables/scroll-lock.d.ts +2 -11
  82. package/dist/client/theme-default/composables/scroll-lock.js +5 -12
  83. package/dist/client/theme-default/composables/sidebar.d.ts +4 -5
  84. package/dist/client/theme-default/composables/sponsor-grid.d.ts +5 -6
  85. package/dist/client/theme-default/fonts/inter-italic-cyrillic-ext.woff2 +0 -0
  86. package/dist/client/theme-default/fonts/inter-italic-cyrillic.woff2 +0 -0
  87. package/dist/client/theme-default/fonts/inter-italic-greek-ext.woff2 +0 -0
  88. package/dist/client/theme-default/fonts/inter-italic-greek.woff2 +0 -0
  89. package/dist/client/theme-default/fonts/inter-italic-latin-ext.woff2 +0 -0
  90. package/dist/client/theme-default/fonts/inter-italic-latin.woff2 +0 -0
  91. package/dist/client/theme-default/fonts/inter-italic-symbols.woff2 +0 -0
  92. package/dist/client/theme-default/fonts/inter-italic-vietnamese.woff2 +0 -0
  93. package/dist/client/theme-default/fonts/inter-roman-cyrillic-ext.woff2 +0 -0
  94. package/dist/client/theme-default/fonts/inter-roman-cyrillic.woff2 +0 -0
  95. package/dist/client/theme-default/fonts/inter-roman-greek-ext.woff2 +0 -0
  96. package/dist/client/theme-default/fonts/inter-roman-greek.woff2 +0 -0
  97. package/dist/client/theme-default/fonts/inter-roman-latin-ext.woff2 +0 -0
  98. package/dist/client/theme-default/fonts/inter-roman-latin.woff2 +0 -0
  99. package/dist/client/theme-default/fonts/inter-roman-symbols.woff2 +0 -0
  100. package/dist/client/theme-default/fonts/inter-roman-vietnamese.woff2 +0 -0
  101. package/dist/client/theme-default/styles/components/vp-code-group.css +5 -8
  102. package/dist/client/theme-default/styles/components/vp-doc.css +49 -45
  103. package/dist/client/theme-default/styles/docsearch.css +3 -2
  104. package/dist/client/theme-default/styles/fonts.css +22 -9
  105. package/dist/client/theme-default/styles/icons.css +22 -8
  106. package/dist/client/theme-default/styles/vars.css +15 -0
  107. package/dist/client/theme-default/support/docsearch.d.ts +14 -15
  108. package/dist/client/theme-default/support/local-search.d.ts +9 -0
  109. package/dist/client/theme-default/support/local-search.js +31 -0
  110. package/dist/client/theme-default/support/lru.d.ts +2 -3
  111. package/dist/client/theme-default/support/reactivity.d.ts +2 -3
  112. package/dist/client/theme-default/support/sidebar.d.ts +6 -7
  113. package/dist/client/theme-default/support/translation.d.ts +2 -3
  114. package/dist/client/theme-default/support/utils.d.ts +6 -7
  115. package/dist/node/{chunk-BYTgXTwz.js → chunk-BjrVv9r8.js} +17133 -17242
  116. package/dist/node/cli.js +3 -6
  117. package/dist/node/index.d.ts +64 -50
  118. package/dist/node/index.js +1 -2
  119. package/dist/web-types.json +1 -1
  120. package/package.json +56 -57
  121. package/types/shared.d.ts +3 -3
@@ -72,8 +72,8 @@
72
72
  .vp-doc .header-anchor {
73
73
  position: absolute;
74
74
  top: 0;
75
- left: 0;
76
- margin-left: -0.87em;
75
+ inset-inline-start: 0;
76
+ margin-inline-start: -0.87em;
77
77
  font-weight: 500;
78
78
  user-select: none;
79
79
  opacity: 0;
@@ -130,8 +130,8 @@
130
130
 
131
131
  .vp-doc blockquote {
132
132
  margin: 1rem 0;
133
- border-left: 2px solid var(--vp-c-divider);
134
- padding-left: 1rem;
133
+ border-inline-start: 2px solid var(--vp-c-divider);
134
+ padding-inline-start: 1rem;
135
135
  transition: border-color 0.5s;
136
136
  color: var(--vp-c-text-2);
137
137
  }
@@ -166,7 +166,7 @@
166
166
 
167
167
  .vp-doc ul,
168
168
  .vp-doc ol {
169
- padding-left: 1.25rem;
169
+ padding-inline-start: 1.25rem;
170
170
  margin: 1rem 0;
171
171
  }
172
172
 
@@ -200,7 +200,8 @@
200
200
  }
201
201
 
202
202
  .vp-doc .task-list-item-checkbox {
203
- margin: 0 0.25rem 0.125rem -1.25rem;
203
+ margin-block: 0 0.125rem;
204
+ margin-inline: -1.25rem 0.25rem;
204
205
  vertical-align: middle;
205
206
  accent-color: var(--vp-c-brand-1);
206
207
  }
@@ -209,6 +210,11 @@
209
210
  * Footnotes
210
211
  * -------------------------------------------------------------------------- */
211
212
 
213
+ .vp-doc sup.footnote-ref {
214
+ -webkit-user-select: none;
215
+ user-select: none;
216
+ }
217
+
212
218
  .vp-doc .footnote-ref a,
213
219
  .vp-doc .footnote-backref {
214
220
  text-decoration: none;
@@ -246,7 +252,7 @@
246
252
  }
247
253
 
248
254
  .vp-doc th {
249
- text-align: left;
255
+ text-align: start;
250
256
  font-size: 0.875rem;
251
257
  font-weight: 600;
252
258
  color: var(--vp-c-text-2);
@@ -323,6 +329,8 @@
323
329
  border-radius: 0.25rem;
324
330
  padding: 0.1875rem 0.375rem;
325
331
  background-color: var(--vp-code-bg);
332
+ /* keep the written order of identifiers and punctuation inside rtl prose */
333
+ unicode-bidi: plaintext;
326
334
  transition:
327
335
  color 0.25s,
328
336
  background-color 0.5s;
@@ -343,6 +351,9 @@
343
351
  font-size: 0.9em;
344
352
  }
345
353
 
354
+ /* code-block wrappers carry dir="ltr" (see preWrapper.ts), so code, its
355
+ gutter and its controls keep their physical layout on rtl pages; the
356
+ logical properties in this section resolve to left/right there */
346
357
  .vp-doc div[class*='language-'],
347
358
  .vp-block {
348
359
  position: relative;
@@ -362,7 +373,9 @@
362
373
 
363
374
  @media not all and (min-width: 40rem) {
364
375
  .vp-doc li div[class*='language-'] {
365
- border-radius: 0.5rem 0 0 0.5rem;
376
+ border-radius: 0;
377
+ border-start-start-radius: 0.5rem;
378
+ border-end-start-radius: 0.5rem;
366
379
  }
367
380
  }
368
381
 
@@ -386,8 +399,7 @@
386
399
  padding: 1.25rem 0;
387
400
  background: transparent;
388
401
  overflow-x: auto;
389
- /*rtl:ignore*/
390
- text-align: left;
402
+ text-align: start;
391
403
  }
392
404
 
393
405
  .vp-doc [class*='language-'] code {
@@ -428,10 +440,11 @@
428
440
 
429
441
  .vp-doc [class*='language-'] code .diff::before {
430
442
  position: absolute;
431
- left: 0.625rem;
443
+ inset-inline-start: 0.625rem;
432
444
  }
433
445
 
434
446
  .vp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus) {
447
+ will-change: filter;
435
448
  filter: blur(0.095rem);
436
449
  opacity: 0.4;
437
450
  transition:
@@ -471,19 +484,16 @@
471
484
  }
472
485
 
473
486
  .vp-doc div[class*='language-'].line-numbers-mode {
474
- /*rtl:ignore*/
475
- padding-left: 2rem;
487
+ padding-inline-start: 2rem;
476
488
  }
477
489
 
478
490
  .vp-doc .line-numbers-wrapper {
479
491
  position: absolute;
480
492
  top: 0;
481
493
  bottom: 0;
482
- /*rtl:ignore*/
483
- left: 0;
494
+ inset-inline-start: 0;
484
495
  z-index: 3;
485
- /*rtl:ignore*/
486
- border-right: 1px solid var(--vp-code-block-divider-color);
496
+ border-inline-end: 1px solid var(--vp-code-block-divider-color);
487
497
  padding-top: 1.25rem;
488
498
  width: 2rem;
489
499
  text-align: center;
@@ -497,12 +507,9 @@
497
507
  }
498
508
 
499
509
  .vp-doc [class*='language-'] > button.copy {
500
- /*rtl:ignore*/
501
- direction: ltr;
502
510
  position: absolute;
503
511
  top: 0.75rem;
504
- /*rtl:ignore*/
505
- right: 0.75rem;
512
+ inset-inline-end: 0.75rem;
506
513
  z-index: 3;
507
514
  border: 1px solid var(--vp-code-copy-code-border-color);
508
515
  border-radius: 0.25rem;
@@ -534,8 +541,8 @@
534
541
 
535
542
  .vp-doc [class*='language-'] > button.copy.copied,
536
543
  .vp-doc [class*='language-'] > button.copy:hover.copied {
537
- /*rtl:ignore*/
538
- border-radius: 0 0.25rem 0.25rem 0;
544
+ border-start-start-radius: 0;
545
+ border-end-start-radius: 0;
539
546
  background-color: var(--vp-code-copy-code-hover-bg);
540
547
  background-image: var(--vp-icon-copied);
541
548
  }
@@ -544,16 +551,14 @@
544
551
  .vp-doc [class*='language-'] > button.copy:hover.copied::before {
545
552
  position: relative;
546
553
  top: -1px;
547
- /*rtl:ignore*/
548
554
  transform: translateX(calc(-100% - 1px));
549
555
  display: flex;
550
556
  justify-content: center;
551
557
  align-items: center;
552
558
  border: 1px solid var(--vp-code-copy-code-hover-border-color);
553
- /*rtl:ignore*/
554
- border-right: 0;
555
- /*rtl:ignore*/
556
- border-radius: 0.25rem 0 0 0.25rem;
559
+ border-inline-end: 0;
560
+ border-start-start-radius: 0.25rem;
561
+ border-end-start-radius: 0.25rem;
557
562
  padding: 0 0.625rem;
558
563
  width: fit-content;
559
564
  height: 2.5rem;
@@ -563,14 +568,15 @@
563
568
  color: var(--vp-code-copy-code-active-text);
564
569
  background-color: var(--vp-code-copy-code-hover-bg);
565
570
  white-space: nowrap;
571
+ /* the wrapper is ltr; let the translated label pick its own direction */
572
+ unicode-bidi: plaintext;
566
573
  content: attr(data-copied);
567
574
  }
568
575
 
569
576
  .vp-doc [class*='language-'] > span.lang {
570
577
  position: absolute;
571
578
  top: 0.125rem;
572
- /*rtl:ignore*/
573
- right: 0.5rem;
579
+ inset-inline-end: 0.5rem;
574
580
  z-index: 2;
575
581
  font-size: 0.75rem;
576
582
  font-weight: 500;
@@ -591,14 +597,17 @@
591
597
  * -------------------------------------------------------------------------- */
592
598
 
593
599
  /* prettier-ignore */
594
- :is(.vp-external-link-icon, .vp-doc a[href*='://'], .vp-doc a[target='_blank']):not(:is(.no-icon, svg a, :has(img, svg)))::after {
600
+ :where(
601
+ .vp-external-link-icon,
602
+ .vp-doc a:is([href*='://'], [target='_blank'])
603
+ ):not(.no-icon, svg a, :has(img, svg))::after {
595
604
  display: inline;
596
- margin-left: 0.25rem;
597
- padding-left: 0.6875rem;
605
+ margin-inline-start: 0.25rem;
606
+ padding-inline-start: 0.6875rem;
598
607
  background: currentColor;
599
- color: var(--vp-c-text-3);
608
+ color: currentColor;
600
609
  flex-shrink: 0;
601
- --icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");
610
+ --icon: var(--vp-icon-external-link);
602
611
  -webkit-mask-image: var(--icon);
603
612
  mask-image: var(--icon);
604
613
  -webkit-mask-position: center;
@@ -607,17 +616,12 @@
607
616
  mask-repeat: no-repeat;
608
617
  -webkit-mask-size: 100% 100%;
609
618
  mask-size: 100% 100%;
610
- /*rtl:raw:transform: scaleX(-1);*/
611
- vertical-align: middle;
612
- font-size: 0.5625rem;
613
- }
614
-
615
- .vp-external-link-icon::after {
616
- content: '\2060';
617
619
  }
618
620
 
619
621
  /* prettier-ignore */
620
- .external-link-icon-enabled :is(.vp-doc a[href*='://'], .vp-doc a[target='_blank']):not(:is(.no-icon, svg a, :has(img, svg)))::after {
621
- content: '\2060';
622
- color: currentColor;
622
+ :where(
623
+ .vp-external-link-icon,
624
+ .external-link-icon-enabled :is(.vp-doc a:is([href*='://'], [target='_blank']))
625
+ ):not(.no-icon, svg a, :has(img, svg))::after {
626
+ content: var(--vp-direction-mark) '\2060';
623
627
  }
@@ -59,7 +59,8 @@
59
59
  }
60
60
 
61
61
  .DocSearch-AskAiScreen-RelatedSources-Item-Link {
62
- padding: 0.5rem 0.75rem 0.5rem 0.625rem;
62
+ padding-block: 0.5rem;
63
+ padding-inline: 0.625rem 0.75rem;
63
64
  }
64
65
 
65
66
  .DocSearch-AskAiScreen-RelatedSources-Item-Link svg {
@@ -73,7 +74,7 @@
73
74
  }
74
75
 
75
76
  .DocSearch-Clear {
76
- padding-right: 0.375rem;
77
+ padding-inline-end: 0.375rem;
77
78
  }
78
79
 
79
80
  .DocSearch-Commands-Key {
@@ -154,9 +154,6 @@
154
154
  unicode-range: U+02CD, U+02D8-02D9, U+02DB, U+0302, U+0306-0307, U+030A, U+030C, U+030F, U+0313, U+0315, U+031B, U+0326-0328, U+032C, U+0337-0338, U+0342-0343, U+0346-036F, U+0E3F, U+1DC0-1DF5, U+1DFC-1DFF, U+2070-2071, U+2074-208E, U+2090-209C, U+20DB-20DE, U+20E8, U+20F0, U+2100-2101, U+2103, U+2105-2106, U+2109, U+2117, U+211E-2121, U+2126, U+212A-212B, U+212E, U+2132, U+213B, U+214D, U+2150-217F, U+2183-2186, U+2189, U+2190, U+2192, U+2194-2199, U+21AA, U+21B0-21B1, U+21B3-21B5, U+21BA-21BB, U+21D0, U+21D2, U+21D4, U+21DE-21DF, U+21E4-21E5, U+21E7, U+21EA, U+2202, U+2205-2206, U+220F, U+2211, U+221A, U+221E, U+222B, U+2236, U+2248, U+2260, U+2264-2265, U+2295-2298, U+2303-2305, U+2325-2327, U+232B, U+2380, U+2387, U+238B, U+23CE-23CF, U+2423, U+2460-2468, U+24B6-24CF, U+24EA, U+25A0-25A2, U+25AA, U+25B2-25B3, U+25B6-25B7, U+25BA-25BD, U+25C0-25C1, U+25C4-25C7, U+25CA-25CB, U+25CF, U+25E6, U+25EF, U+2600, U+2605-2606, U+263C, U+2661, U+2665, U+266A-266B, U+26A0, U+2713, U+2717, U+2756, U+2764, U+2780-2788, U+27EF, U+27F5-27FA, U+2913, U+2A38, U+2B06, U+2B12-2B13, U+2B1C, U+2B24, U+2E18, U+A92E, U+1F12F-1F149, U+1F16A-1F16B, U+1F850, U+1F852;
155
155
  }
156
156
 
157
- /* 'Inter Core' reuses the files above, but leaves out characters that should
158
- be rendered by CJK fonts in CJK documents - see scripts/subsetFonts.py */
159
-
160
157
  @font-face {
161
158
  font-family: 'Inter Core';
162
159
  font-style: italic;
@@ -301,6 +298,22 @@
301
298
  unicode-range: U+0302, U+0306-0307, U+030A, U+030C, U+030F, U+0313, U+0315, U+031B, U+0326-0328, U+032C, U+0337-0338, U+0342-0343, U+0346-036F, U+0E3F, U+1DC0-1DF5, U+1DFC-1DFF, U+2070-2071, U+2075-207E, U+2080, U+2085-208E, U+2090-209C, U+20DB-20DE, U+20E8, U+20F0, U+2100-2101, U+2106, U+2117, U+211E-2120, U+212A, U+212E, U+2132, U+213B, U+214D, U+2150-2152, U+2155-215A, U+215F, U+216C-216F, U+217A-217F, U+2183-2186, U+21AA, U+21B0-21B1, U+21B3-21B5, U+21BA-21BB, U+21D0, U+21DE-21DF, U+21E4-21E5, U+21EA, U+2205-2206, U+2296-2298, U+2303-2305, U+2325-2327, U+232B, U+2380, U+2387, U+238B, U+23CE-23CF, U+2423, U+24EA, U+25A2, U+25AA, U+25BA-25BB, U+25C4-25C5, U+25CA, U+25E6, U+2600, U+263C, U+266B, U+26A0, U+2713, U+2717, U+2756, U+2764, U+2780-2788, U+27EF, U+27F5-27FA, U+2913, U+2A38, U+2B06, U+2B12-2B13, U+2B24, U+2E18, U+A92E, U+1F12F, U+1F16A-1F16B, U+1F850, U+1F852;
302
299
  }
303
300
 
301
+ @font-face {
302
+ font-family: 'Inter Core';
303
+ font-style: normal;
304
+ font-weight: 100 900;
305
+ src: local(-apple-system);
306
+ unicode-range: U+10FFFF;
307
+ }
308
+
309
+ @font-face {
310
+ font-family: 'Inter Core';
311
+ font-style: italic;
312
+ font-weight: 100 900;
313
+ src: local(-apple-system);
314
+ unicode-range: U+10FFFF;
315
+ }
316
+
304
317
  :root {
305
318
  --vp-font-family-base:
306
319
  'Inter', -apple-system, BlinkMacSystemFont, sans-serif, 'Apple Color Emoji',
@@ -310,20 +323,20 @@
310
323
  [lang]:where(:lang(zh)) {
311
324
  --vp-font-family-base:
312
325
  'Inter Core', 'PingFang SC', 'Microsoft YaHei', 'Noto Sans CJK SC',
313
- -apple-system, BlinkMacSystemFont, sans-serif, 'Apple Color Emoji',
314
- 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
326
+ BlinkMacSystemFont, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
327
+ 'Segoe UI Symbol', 'Noto Color Emoji';
315
328
  }
316
329
 
317
330
  [lang]:where(:lang(ja)) {
318
331
  --vp-font-family-base:
319
332
  'Inter Core', 'Hiragino Sans', 'Meiryo', 'Yu Gothic', 'Noto Sans CJK JP',
320
- -apple-system, BlinkMacSystemFont, sans-serif, 'Apple Color Emoji',
321
- 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
333
+ BlinkMacSystemFont, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
334
+ 'Segoe UI Symbol', 'Noto Color Emoji';
322
335
  }
323
336
 
324
337
  [lang]:where(:lang(ko)) {
325
338
  --vp-font-family-base:
326
339
  'Inter Core', 'Apple SD Gothic Neo', 'Malgun Gothic', 'Noto Sans CJK KR',
327
- -apple-system, BlinkMacSystemFont, sans-serif, 'Apple Color Emoji',
328
- 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji';
340
+ BlinkMacSystemFont, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji',
341
+ 'Segoe UI Symbol', 'Noto Color Emoji';
329
342
  }
@@ -25,8 +25,8 @@
25
25
  }
26
26
 
27
27
  /* internal icons - used under ISC from https://lucide.dev/ */
28
- .vpi-align-left {
29
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M15 12H3m14 6H3M21 6H3'/%3E%3C/svg%3E");
28
+ .vpi-text-align-start {
29
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M21 5H3m12 7H3m14 7H3'/%3E%3C/svg%3E");
30
30
  }
31
31
  .vpi-arrow-right,
32
32
  .vpi-arrow-down,
@@ -42,19 +42,25 @@
42
42
  }
43
43
  .vpi-chevron-down,
44
44
  .vpi-arrow-down {
45
- /*rtl:ignore*/
46
45
  transform: rotate(90deg);
47
46
  }
48
47
  .vpi-chevron-left,
49
48
  .vpi-arrow-left {
50
- /*rtl:ignore*/
51
49
  transform: rotate(180deg);
52
50
  }
53
51
  .vpi-chevron-up,
54
52
  .vpi-arrow-up {
55
- /*rtl:ignore*/
56
53
  transform: rotate(-90deg);
57
54
  }
55
+ /* these point along the reading direction ("right" means forward), so they
56
+ mirror in rtl; the vertical variants and the key glyphs stay put */
57
+ .vpi-text-align-start,
58
+ .vpi-arrow-left,
59
+ .vpi-arrow-right,
60
+ .vpi-chevron-left,
61
+ .vpi-chevron-right {
62
+ scale: var(--vp-direction-multiplier) 1;
63
+ }
58
64
  .vpi-square-pen {
59
65
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7'/%3E%3Cpath d='M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z'/%3E%3C/g%3E%3C/svg%3E");
60
66
  }
@@ -65,16 +71,16 @@
65
71
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='4'/%3E%3Cpath d='M12 2v2m0 16v2M4.93 4.93l1.41 1.41m11.32 11.32l1.41 1.41M2 12h2m16 0h2M6.34 17.66l-1.41 1.41M19.07 4.93l-1.41 1.41'/%3E%3C/g%3E%3C/svg%3E");
66
72
  }
67
73
  .vpi-moon {
68
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M12 3a6 6 0 0 0 9 9a9 9 0 1 1-9-9'/%3E%3C/svg%3E");
74
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401'/%3E%3C/svg%3E");
69
75
  }
70
- .vpi-more-horizontal {
76
+ .vpi-ellipsis {
71
77
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Ccircle cx='12' cy='12' r='1'/%3E%3Ccircle cx='19' cy='12' r='1'/%3E%3Ccircle cx='5' cy='12' r='1'/%3E%3C/g%3E%3C/svg%3E");
72
78
  }
73
79
  .vpi-languages {
74
80
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m5 8l6 6m-7 0l6-6l2-3M2 5h12M7 2h1m14 20l-5-10l-5 10m2-4h6'/%3E%3C/svg%3E");
75
81
  }
76
82
  .vpi-heart {
77
- --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 14c1.49-1.46 3-3.21 3-5.5A5.5 5.5 0 0 0 16.5 3c-1.76 0-3 .5-4.5 2c-1.5-1.5-2.74-2-4.5-2A5.5 5.5 0 0 0 2 8.5c0 2.3 1.5 4.05 3 5.5l7 7Z'/%3E%3C/svg%3E");
83
+ --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 9.5a5.5 5.5 0 0 1 9.591-3.676a.56.56 0 0 0 .818 0A5.49 5.49 0 0 1 22 9.5c0 2.29-1.5 4-3 5.5l-5.492 5.313a2 2 0 0 1-3 .019L5 15c-1.5-1.5-3-3.2-3-5.5'/%3E%3C/svg%3E");
78
84
  }
79
85
  .vpi-search {
80
86
  --icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Cpath d='m21 21l-4.34-4.34'/%3E%3Ccircle cx='11' cy='11' r='8'/%3E%3C/g%3E%3C/svg%3E");
@@ -97,3 +103,11 @@
97
103
  /* clipboard-check */
98
104
  --vp-icon-copied: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg fill='none' stroke='rgba(128,128,128,1)' stroke-linecap='round' stroke-linejoin='round' stroke-width='2'%3E%3Crect width='8' height='4' x='8' y='2' rx='1' ry='1'/%3E%3Cpath d='M16 4h2a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2V6a2 2 0 0 1 2-2h2'/%3E%3Cpath d='m9 14l2 2l4-4'/%3E%3C/g%3E%3C/svg%3E");
99
105
  }
106
+
107
+ :root,
108
+ [dir='ltr'] {
109
+ --vp-icon-external-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M9 5h10v10M19 5 5 19'/%3E%3C/svg%3E");
110
+ }
111
+ [dir='rtl'] {
112
+ --vp-icon-external-link: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath fill='none' stroke='black' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M5 15V5h10M5 5l14 14'/%3E%3C/svg%3E");
113
+ }
@@ -336,6 +336,21 @@
336
336
  }
337
337
  }
338
338
 
339
+ /**
340
+ * Direction
341
+ * -------------------------------------------------------------------------- */
342
+
343
+ :root,
344
+ [dir='ltr'] {
345
+ --vp-direction-multiplier: 1;
346
+ --vp-direction-mark: '\200E';
347
+ }
348
+
349
+ [dir='rtl'] {
350
+ --vp-direction-multiplier: -1;
351
+ --vp-direction-mark: '\200F';
352
+ }
353
+
339
354
  /**
340
355
  * Layouts
341
356
  * -------------------------------------------------------------------------- */
@@ -2,20 +2,20 @@ import { DefaultTheme } from "vitepress/theme";
2
2
  import { SidepanelProps } from "@docsearch/sidepanel-js";
3
3
  import { DocSearchAskAi } from "../../../../types/docsearch.js";
4
4
  //#region src/client/theme-default/support/docsearch.d.ts
5
- type FacetFilter = string | string[] | FacetFilter[];
6
- interface ValidatedCredentials {
5
+ export type FacetFilter = string | string[] | FacetFilter[];
6
+ export interface ValidatedCredentials {
7
7
  valid: boolean;
8
8
  appId?: string;
9
9
  apiKey?: string;
10
10
  indexName?: string;
11
11
  }
12
- type DocSearchMode = 'auto' | 'sidePanel' | 'hybrid' | 'modal';
13
- interface ResolvedMode {
12
+ export type DocSearchMode = 'auto' | 'sidePanel' | 'hybrid' | 'modal';
13
+ export interface ResolvedMode {
14
14
  mode: DocSearchMode;
15
15
  showKeywordSearch: boolean;
16
16
  useSidePanel: boolean;
17
17
  }
18
- type ResolvedSidePanelProps = SidepanelProps & {
18
+ export type ResolvedSidePanelProps = SidepanelProps & {
19
19
  agentStudio?: boolean;
20
20
  searchParameters?: DocSearchAskAi['searchParameters'];
21
21
  suggestedQuestions?: boolean;
@@ -29,30 +29,29 @@ type ResolvedSidePanelProps = SidepanelProps & {
29
29
  * - 'hybrid': force hybrid (error if keyword search is not configured)
30
30
  * - 'modal': force modal even if sidePanel is configured
31
31
  */
32
- declare function resolveMode(options: Pick<DefaultTheme.AlgoliaSearchOptions, 'appId' | 'apiKey' | 'indexName' | 'askAi' | 'mode'>): ResolvedMode;
33
- declare function hasKeywordSearch(options: Pick<DefaultTheme.AlgoliaSearchOptions, 'appId' | 'apiKey' | 'indexName'>): boolean;
34
- declare function hasAskAi(askAi: DefaultTheme.AlgoliaSearchOptions['askAi']): boolean;
32
+ export declare function resolveMode(options: Pick<DefaultTheme.AlgoliaSearchOptions, 'appId' | 'apiKey' | 'indexName' | 'askAi' | 'mode'>): ResolvedMode;
33
+ export declare function hasKeywordSearch(options: Pick<DefaultTheme.AlgoliaSearchOptions, 'appId' | 'apiKey' | 'indexName'>): boolean;
34
+ export declare function hasAskAi(askAi: DefaultTheme.AlgoliaSearchOptions['askAi']): boolean;
35
35
  /**
36
36
  * Removes existing `lang:` filters and appends `lang:${lang}`.
37
37
  * Handles both flat arrays and nested arrays (for OR conditions).
38
38
  */
39
- declare function mergeLangFacetFilters(rawFacetFilters: FacetFilter | FacetFilter[] | undefined, lang: string): FacetFilter[];
39
+ export declare function mergeLangFacetFilters(rawFacetFilters: FacetFilter | FacetFilter[] | undefined, lang: string): FacetFilter[];
40
40
  /**
41
41
  * Validates that required Algolia credentials are present.
42
42
  */
43
- declare function validateCredentials(options: Pick<DefaultTheme.AlgoliaSearchOptions, 'appId' | 'apiKey' | 'indexName'>): ValidatedCredentials;
43
+ export declare function validateCredentials(options: Pick<DefaultTheme.AlgoliaSearchOptions, 'appId' | 'apiKey' | 'indexName'>): ValidatedCredentials;
44
44
  /**
45
45
  * Builds Ask AI configuration from various input formats.
46
46
  */
47
- declare function buildAskAiConfig(askAiProp: NonNullable<DefaultTheme.AlgoliaSearchOptions['askAi']>, options: DefaultTheme.AlgoliaSearchOptions, lang: string): DocSearchAskAi;
47
+ export declare function buildAskAiConfig(askAiProp: NonNullable<DefaultTheme.AlgoliaSearchOptions['askAi']>, options: DefaultTheme.AlgoliaSearchOptions, lang: string): DocSearchAskAi;
48
48
  /**
49
49
  * Builds the DocSearch side panel config from the resolved Ask AI options.
50
50
  */
51
- declare function buildSidePanelProps(askAi: DocSearchAskAi, options: DefaultTheme.AlgoliaSearchOptions): ResolvedSidePanelProps;
51
+ export declare function buildSidePanelProps(askAi: DocSearchAskAi, options: DefaultTheme.AlgoliaSearchOptions): ResolvedSidePanelProps;
52
52
  /**
53
53
  * Resolves Algolia search options for the given language,
54
54
  * merging in locale-specific overrides and language facet filters.
55
55
  */
56
- declare function resolveOptionsForLanguage(options: DefaultTheme.AlgoliaSearchOptions, localeIndex: string, lang: string): DefaultTheme.AlgoliaSearchOptions;
57
- //#endregion
58
- export { DocSearchMode, FacetFilter, ResolvedMode, ResolvedSidePanelProps, ValidatedCredentials, buildAskAiConfig, buildSidePanelProps, hasAskAi, hasKeywordSearch, mergeLangFacetFilters, resolveMode, resolveOptionsForLanguage, validateCredentials };
56
+ export declare function resolveOptionsForLanguage(options: DefaultTheme.AlgoliaSearchOptions, localeIndex: string, lang: string): DefaultTheme.AlgoliaSearchOptions;
57
+ //#endregion
@@ -0,0 +1,9 @@
1
+ import MiniSearch from "minisearch";
2
+ import { DefaultTheme } from "vitepress/theme";
3
+ //#region src/client/theme-default/support/local-search.d.ts
4
+ /**
5
+ * Loads a serialized local search index with the same options that were used
6
+ * to build it (functions are not serialized) plus the default search options.
7
+ */
8
+ export declare function loadLocalSearchIndex<T = Record<string, any>>(json: string, miniSearch?: DefaultTheme.MiniSearchOptions): MiniSearch<T>;
9
+ //#endregion
@@ -0,0 +1,31 @@
1
+ import { tokenizeSearchText } from "../../shared.js";
2
+ import MiniSearch from "minisearch";
3
+ //#region src/client/theme-default/support/local-search.ts
4
+ /**
5
+ * Loads a serialized local search index with the same options that were used
6
+ * to build it (functions are not serialized) plus the default search options.
7
+ */
8
+ function loadLocalSearchIndex(json, miniSearch) {
9
+ return MiniSearch.loadJSON(json, {
10
+ fields: [
11
+ "title",
12
+ "titles",
13
+ "text"
14
+ ],
15
+ storeFields: ["title", "titles"],
16
+ tokenize: tokenizeSearchText,
17
+ searchOptions: {
18
+ fuzzy: .2,
19
+ prefix: true,
20
+ boost: {
21
+ title: 4,
22
+ text: 2,
23
+ titles: 1
24
+ },
25
+ ...miniSearch?.searchOptions
26
+ },
27
+ ...miniSearch?.options
28
+ });
29
+ }
30
+ //#endregion
31
+ export { loadLocalSearchIndex };
@@ -1,5 +1,5 @@
1
1
  //#region src/client/theme-default/support/lru.d.ts
2
- declare class LRUCache<K, V> {
2
+ export declare class LRUCache<K, V> {
3
3
  private max;
4
4
  private cache;
5
5
  constructor(max?: number);
@@ -8,5 +8,4 @@ declare class LRUCache<K, V> {
8
8
  first(): K | undefined;
9
9
  clear(): void;
10
10
  }
11
- //#endregion
12
- export { LRUCache };
11
+ //#endregion
@@ -1,5 +1,4 @@
1
1
  import { ComputedRef } from "vue";
2
2
  //#region src/client/theme-default/support/reactivity.d.ts
3
- declare function smartComputed<T>(getter: () => T, comparator?: (newValue: T, oldValue: T) => boolean): ComputedRef<T>;
4
- //#endregion
5
- export { smartComputed };
3
+ export declare function smartComputed<T>(getter: () => T, comparator?: (newValue: T, oldValue: T) => boolean): ComputedRef<T>;
4
+ //#endregion
@@ -1,6 +1,6 @@
1
1
  import { DefaultTheme } from "vitepress/theme";
2
2
  //#region src/client/theme-default/support/sidebar.d.ts
3
- interface SidebarLink {
3
+ export interface SidebarLink {
4
4
  text: string;
5
5
  link: string;
6
6
  docFooterText?: string;
@@ -14,15 +14,14 @@ type SidebarItem = DefaultTheme.SidebarItem;
14
14
  * as matching `guide/` and `/guide/`. If no matching config was found, it will
15
15
  * return empty array.
16
16
  */
17
- declare function getSidebar(_sidebar: DefaultTheme.Sidebar | undefined, path: string): SidebarItem[];
17
+ export declare function getSidebar(_sidebar: DefaultTheme.Sidebar | undefined, path: string): SidebarItem[];
18
18
  /**
19
19
  * Get or generate sidebar group from the given sidebar items.
20
20
  */
21
- declare function getSidebarGroups(sidebar: SidebarItem[]): SidebarItem[];
22
- declare function getFlatSideBarLinks(sidebar: SidebarItem[]): SidebarLink[];
21
+ export declare function getSidebarGroups(sidebar: SidebarItem[]): SidebarItem[];
22
+ export declare function getFlatSideBarLinks(sidebar: SidebarItem[]): SidebarLink[];
23
23
  /**
24
24
  * Check if the given sidebar item contains any active link.
25
25
  */
26
- declare function hasActiveLink(path: string, hash: string, items: SidebarItem | SidebarItem[], skipHashCheck?: boolean): boolean;
27
- //#endregion
28
- export { SidebarLink, getFlatSideBarLinks, getSidebar, getSidebarGroups, hasActiveLink };
26
+ export declare function hasActiveLink(path: string, hash: string, items: SidebarItem | SidebarItem[], skipHashCheck?: boolean): boolean;
27
+ //#endregion
@@ -2,6 +2,5 @@
2
2
  /**
3
3
  * @param themeObject Can be an object with `translations` and `locales` properties
4
4
  */
5
- declare function createSearchTranslate(defaultTranslations: Record<string, any>): (key: string) => string;
6
- //#endregion
7
- export { createSearchTranslate };
5
+ export declare function createSearchTranslate(defaultTranslations: Record<string, any>): (key: string) => string;
6
+ //#endregion
@@ -1,8 +1,7 @@
1
1
  //#region src/client/theme-default/support/utils.d.ts
2
- declare function throttleAndDebounce(fn: () => void, delay: number): () => void;
3
- declare function ensureStartingSlash(path: string): string;
4
- declare function isLinkExternal(href?: string, target?: string, external?: boolean): boolean;
5
- declare function normalizeLink(url: string): string;
6
- declare function uniqBy<T>(array: T[], keyFn: (item: T) => any): T[];
7
- //#endregion
8
- export { ensureStartingSlash, isLinkExternal, normalizeLink, throttleAndDebounce, uniqBy };
2
+ export declare function throttleAndDebounce(fn: () => void, delay: number): () => void;
3
+ export declare function ensureStartingSlash(path: string): string;
4
+ export declare function isLinkExternal(href?: string, target?: string, external?: boolean): boolean;
5
+ export declare function normalizeLink(url: string): string;
6
+ export declare function uniqBy<T>(array: T[], keyFn: (item: T) => any): T[];
7
+ //#endregion