@voidzero-dev/vitepress-theme 1.1.60 → 1.1.61

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 (270) hide show
  1. package/dist/index111.js +4 -4
  2. package/dist/index113.js +3 -3
  3. package/dist/index115.js +8 -8
  4. package/dist/index119.js +10 -10
  5. package/dist/index121.js +3 -3
  6. package/dist/index123.js +7 -7
  7. package/dist/index128.js +4 -4
  8. package/dist/index135.js +1 -1
  9. package/dist/index140.js +2 -2
  10. package/dist/index142.js +21 -21
  11. package/dist/index145.js +17 -17
  12. package/dist/index148.js +1 -1
  13. package/dist/index157.js +4 -4
  14. package/dist/index167.js +4 -4
  15. package/dist/index173.js +5 -5
  16. package/dist/index185.js +2 -2
  17. package/dist/index187.js +1 -1
  18. package/dist/index197.js +1 -1
  19. package/dist/index198.js +26 -28
  20. package/dist/index199.js +29 -41
  21. package/dist/index200.js +15 -15
  22. package/dist/index201.js +17 -21
  23. package/dist/index202.js +16 -16
  24. package/dist/index203.js +13 -13
  25. package/dist/index204.js +123 -24
  26. package/dist/index205.js +28 -26
  27. package/dist/index206.js +41 -124
  28. package/dist/index207.js +38 -2
  29. package/dist/index208.js +5 -2
  30. package/dist/index209.js +2 -2
  31. package/dist/index210.js +4 -0
  32. package/dist/index211.js +2 -108
  33. package/dist/index212.js +4 -0
  34. package/dist/index214.js +108 -2
  35. package/dist/index216.js +2 -2
  36. package/dist/index217.js +2 -2
  37. package/dist/index218.js +2 -2
  38. package/dist/index219.js +34 -2
  39. package/dist/index220.js +1 -1
  40. package/dist/index221.js +2 -2
  41. package/dist/index222.js +2 -2
  42. package/dist/index223.js +2 -2
  43. package/dist/index224.js +2 -2
  44. package/dist/index225.js +2 -34
  45. package/dist/index226.js +2 -2
  46. package/dist/index227.js +2 -2
  47. package/dist/index228.js +2 -2
  48. package/dist/index229.js +2 -2
  49. package/dist/index23.js +7 -7
  50. package/dist/index230.js +1 -1
  51. package/dist/index231.js +1 -1
  52. package/dist/index232.js +1 -1
  53. package/dist/index233.js +2 -5
  54. package/dist/index234.js +2 -3
  55. package/dist/index235.js +103 -5
  56. package/dist/index236.js +2 -2
  57. package/dist/index237.js +2 -5
  58. package/dist/index238.js +1 -1
  59. package/dist/index239.js +2 -2
  60. package/dist/index240.js +2 -2
  61. package/dist/index241.js +2 -2
  62. package/dist/index242.js +2 -2
  63. package/dist/index243.js +2 -2
  64. package/dist/index244.js +2 -2
  65. package/dist/index245.js +2 -2
  66. package/dist/index246.js +1 -1
  67. package/dist/index247.js +2 -103
  68. package/dist/index248.js +1 -1
  69. package/dist/index249.js +1 -1
  70. package/dist/index250.js +2 -2
  71. package/dist/index251.js +2 -2
  72. package/dist/index252.js +2 -2
  73. package/dist/index253.js +2 -2
  74. package/dist/index254.js +2 -2
  75. package/dist/index255.js +2 -2
  76. package/dist/index256.js +1 -1
  77. package/dist/index257.js +2 -2
  78. package/dist/index258.js +2 -2
  79. package/dist/index259.js +2 -2
  80. package/dist/index260.js +47 -2
  81. package/dist/index261.js +1 -1
  82. package/dist/index262.js +2 -52
  83. package/dist/index263.js +3 -44
  84. package/dist/index264.js +2 -2587
  85. package/dist/index265.js +5 -2
  86. package/dist/index266.js +5 -2
  87. package/dist/index267.js +96 -2
  88. package/dist/index268.js +2 -2
  89. package/dist/index269.js +2 -2
  90. package/dist/index270.js +2 -2
  91. package/dist/index271.js +2 -20
  92. package/dist/index272.js +3 -92
  93. package/dist/index273.js +7 -0
  94. package/dist/index274.js +52 -5
  95. package/dist/index275.js +44 -6
  96. package/dist/index276.js +2587 -5
  97. package/dist/index277.js +2 -5
  98. package/dist/index278.js +2 -5
  99. package/dist/index279.js +2 -5
  100. package/dist/index28.js +1 -1
  101. package/dist/index280.js +2 -32
  102. package/dist/index281.js +2 -2
  103. package/dist/index282.js +9 -2
  104. package/dist/index283.js +1 -1
  105. package/dist/index284.js +2 -2
  106. package/dist/index285.js +20 -2
  107. package/dist/index286.js +92 -2
  108. package/dist/index288.js +5 -2
  109. package/dist/index289.js +5 -2
  110. package/dist/index290.js +5 -2
  111. package/dist/index291.js +5 -2
  112. package/dist/index292.js +5 -2
  113. package/dist/index293.js +5 -96
  114. package/dist/index294.js +32 -2
  115. package/dist/index295.js +2 -98146
  116. package/dist/index296.js +2 -2
  117. package/dist/index297.js +2 -2
  118. package/dist/index298.js +2 -9
  119. package/dist/index299.js +2 -2
  120. package/dist/index300.js +2 -2
  121. package/dist/index301.js +2 -2
  122. package/dist/index302.js +2 -47
  123. package/dist/index303.js +2 -2
  124. package/dist/index304.js +2 -2
  125. package/dist/index305.js +2 -2
  126. package/dist/index306.js +1 -1
  127. package/dist/index307.js +2 -2
  128. package/dist/index309.js +1 -1
  129. package/dist/index310.js +2 -5
  130. package/dist/index311.js +98146 -2
  131. package/dist/index312.js +1 -1
  132. package/dist/index313.js +1 -1
  133. package/dist/index314.js +83 -2
  134. package/dist/index316.js +71 -2
  135. package/dist/index318.js +1 -1
  136. package/dist/index319.js +1 -1
  137. package/dist/index320.js +1 -1
  138. package/dist/index321.js +2 -82
  139. package/dist/index322.js +4 -0
  140. package/dist/index323.js +2 -83
  141. package/dist/index324.js +4 -0
  142. package/dist/index325.js +1 -1
  143. package/dist/index326.js +1 -1
  144. package/dist/index327.js +7207 -2
  145. package/dist/index328.js +1626 -7098
  146. package/dist/index329.js +2 -1735
  147. package/dist/index330.js +129 -2
  148. package/dist/index332.js +3 -71
  149. package/dist/index333.js +4 -0
  150. package/dist/index334.js +82 -3
  151. package/dist/index336.js +4 -0
  152. package/dist/index337.js +3 -16
  153. package/dist/{index335.js → index338.js} +3 -3
  154. package/dist/index340.js +18 -0
  155. package/dist/{index339.js → index342.js} +4 -4
  156. package/dist/{index341.js → index344.js} +1 -1
  157. package/dist/{index343.js → index346.js} +5 -5
  158. package/dist/{index345.js → index348.js} +2 -2
  159. package/dist/index350.js +46 -5
  160. package/dist/index351.js +5 -46
  161. package/dist/index352.js +5 -70
  162. package/dist/index353.js +5 -47
  163. package/dist/index354.js +5 -112
  164. package/dist/index355.js +5 -62
  165. package/dist/index356.js +4 -4
  166. package/dist/index357.js +62 -2
  167. package/dist/index358.js +5 -29
  168. package/dist/index359.js +24 -0
  169. package/dist/index360.js +5 -8
  170. package/dist/index361.js +3 -3
  171. package/dist/index362.js +30 -5
  172. package/dist/index363.js +26 -22
  173. package/dist/index364.js +5 -30
  174. package/dist/index365.js +2 -26
  175. package/dist/index366.js +28 -314
  176. package/dist/index368.js +8 -5
  177. package/dist/index369.js +70 -5
  178. package/dist/index370.js +47 -5
  179. package/dist/index371.js +112 -5
  180. package/dist/index372.js +19 -5
  181. package/dist/index374.js +94 -446
  182. package/dist/index376.js +29 -0
  183. package/dist/{index388.js → index378.js} +3 -3
  184. package/dist/index380.js +55 -2
  185. package/dist/index382.js +19 -17
  186. package/dist/index385.js +4 -0
  187. package/dist/index386.js +2 -27
  188. package/dist/{index375.js → index387.js} +2 -2
  189. package/dist/{index377.js → index389.js} +1 -1
  190. package/dist/{index394.js → index391.js} +1 -1
  191. package/dist/index392.js +2 -21
  192. package/dist/index393.js +456 -0
  193. package/dist/index395.js +87 -2
  194. package/dist/index396.js +309 -448
  195. package/dist/index398.js +443 -84
  196. package/dist/index399.js +5 -10
  197. package/dist/index400.js +5 -4
  198. package/dist/index401.js +5 -28
  199. package/dist/index402.js +13 -5
  200. package/dist/index403.js +5 -23
  201. package/dist/index404.js +5 -21
  202. package/dist/index405.js +28 -5
  203. package/dist/index406.js +3 -3
  204. package/dist/index407.js +10 -5
  205. package/dist/index408.js +4 -5
  206. package/dist/index409.js +22 -12
  207. package/dist/index410.js +17 -5
  208. package/dist/index411.js +18 -16
  209. package/dist/index412.js +19 -17
  210. package/dist/index413.js +21 -32
  211. package/dist/index415.js +70 -76
  212. package/dist/index417.js +48 -22
  213. package/dist/index419.js +76 -70
  214. package/dist/index42.js +4 -4
  215. package/dist/index421.js +26 -48
  216. package/dist/index423.js +30 -23
  217. package/dist/index425.js +3 -3
  218. package/dist/index426.js +2 -2
  219. package/dist/index427.js +2 -2
  220. package/dist/index428.js +2 -2
  221. package/dist/index429.js +5 -26
  222. package/dist/index430.js +27 -0
  223. package/dist/index432.js +93 -93
  224. package/dist/index434.js +27 -23
  225. package/dist/index436.js +93 -93
  226. package/dist/index438.js +21 -24
  227. package/dist/index440.js +5 -11
  228. package/dist/index441.js +14 -28
  229. package/dist/index442.js +11 -5
  230. package/dist/index443.js +28 -5
  231. package/dist/index444.js +4 -13
  232. package/dist/index445.js +37 -27
  233. package/dist/index447.js +2 -39
  234. package/dist/index448.js +31 -0
  235. package/dist/index451.js +2 -2
  236. package/dist/index46.js +1 -1
  237. package/dist/index49.js +3 -3
  238. package/dist/index51.js +4 -4
  239. package/dist/index52.js +1 -1
  240. package/dist/index54.js +1 -1
  241. package/dist/index58.js +6 -6
  242. package/dist/index6.js +1 -1
  243. package/dist/index62.js +1 -1
  244. package/dist/index65.js +1 -1
  245. package/dist/index7.js +2 -2
  246. package/dist/index75.js +1 -1
  247. package/dist/index77.js +2 -2
  248. package/dist/index8.js +2 -2
  249. package/dist/index81.js +2 -2
  250. package/dist/index9.js +1 -1
  251. package/dist/index93.js +1 -1
  252. package/dist/vitepress/components/vitepress-default/VPDocAsideSponsors.vue.d.ts +2 -1
  253. package/dist/vitepress/index.d.ts +2 -0
  254. package/dist/vitepress/types/theme-config.d.ts +68 -0
  255. package/package.json +1 -1
  256. package/dist/index213.js +0 -40
  257. package/dist/index215.js +0 -4
  258. package/dist/index287.js +0 -4
  259. package/dist/index315.js +0 -4
  260. package/dist/index317.js +0 -4
  261. package/dist/index331.js +0 -5
  262. package/dist/index347.js +0 -131
  263. package/dist/index349.js +0 -4
  264. package/dist/index373.js +0 -7
  265. package/dist/index381.js +0 -4
  266. package/dist/index384.js +0 -96
  267. package/dist/index390.js +0 -57
  268. package/dist/index431.js +0 -7
  269. package/dist/index449.js +0 -4
  270. /package/dist/{index367.js → index397.js} +0 -0
package/dist/index382.js CHANGED
@@ -1,21 +1,23 @@
1
- import { defineComponent as t, createBlock as a, openBlock as e, Transition as n, withCtx as c, createElementBlock as r, createCommentVNode as s } from "vue";
2
- const p = {
3
- key: 0,
4
- class: "VPBackdrop"
5
- }, i = /* @__PURE__ */ t({
6
- __name: "VPBackdrop",
7
- props: {
8
- show: { type: Boolean }
9
- },
10
- setup(o) {
11
- return (d, m) => (e(), a(n, { name: "fade" }, {
12
- default: c(() => [
13
- o.show ? (e(), r("div", p)) : s("", !0)
14
- ]),
15
- _: 1
16
- }));
1
+ import { defineComponent as a, ref as r, watch as c, createElementBlock as s, openBlock as p, Fragment as i, createElementVNode as t, toDisplayString as l, unref as u } from "vue";
2
+ import { useRoute as m } from "vitepress";
3
+ import { useData as f } from "./index272.js";
4
+ const k = {
5
+ href: "#VPContent",
6
+ class: "VPSkipLink visually-hidden"
7
+ }, V = /* @__PURE__ */ a({
8
+ __name: "VPSkipLink",
9
+ setup(_) {
10
+ const { theme: o } = f(), n = m(), e = r();
11
+ return c(() => n.path, () => e.value.focus()), (d, h) => (p(), s(i, null, [
12
+ t("span", {
13
+ ref_key: "backToTop",
14
+ ref: e,
15
+ tabindex: "-1"
16
+ }, null, 512),
17
+ t("a", k, l(u(o).skipToContentLabel || "Skip to content"), 1)
18
+ ], 64));
17
19
  }
18
20
  });
19
21
  export {
20
- i as default
22
+ V as default
21
23
  };
@@ -0,0 +1,4 @@
1
+ import f from "./index362.js";
2
+ export {
3
+ f as default
4
+ };
package/dist/index386.js CHANGED
@@ -1,29 +1,4 @@
1
- import { defineComponent as c, createElementBlock as t, createCommentVNode as r, unref as e, openBlock as s, normalizeClass as i, createElementVNode as m } from "vue";
2
- import { useData as f } from "./index234.js";
3
- import { useLayout as l } from "./index351.js";
4
- const p = { class: "container" }, _ = ["innerHTML"], u = ["innerHTML"], H = /* @__PURE__ */ c({
5
- __name: "VPFooter",
6
- setup(d) {
7
- const { theme: o, frontmatter: n } = f(), { hasSidebar: a } = l();
8
- return (h, y) => e(o).footer && e(n).footer !== !1 ? (s(), t("footer", {
9
- key: 0,
10
- class: i(["VPFooter", { "has-sidebar": e(a) }])
11
- }, [
12
- m("div", p, [
13
- e(o).footer.message ? (s(), t("p", {
14
- key: 0,
15
- class: "message",
16
- innerHTML: e(o).footer.message
17
- }, null, 8, _)) : r("", !0),
18
- e(o).footer.copyright ? (s(), t("p", {
19
- key: 1,
20
- class: "copyright",
21
- innerHTML: e(o).footer.copyright
22
- }, null, 8, u)) : r("", !0)
23
- ])
24
- ], 2)) : r("", !0);
25
- }
26
- });
1
+ import f from "./index363.js";
27
2
  export {
28
- H as default
3
+ f as default
29
4
  };
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as c, ref as r, createElementBlock as o, openBlock as l, createElementVNode as s, createCommentVNode as u, normalizeClass as f, createVNode as v, withCtx as p, renderSlot as x } from "vue";
2
- import { useFlyout as y } from "./index401.js";
3
- import b from "./index402.js";
2
+ import { useFlyout as y } from "./index405.js";
3
+ import b from "./index406.js";
4
4
  const k = ["aria-expanded", "aria-label"], h = {
5
5
  key: 0,
6
6
  class: "flex items-center gap-1 leading-normal overflow-hidden"
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as r, computed as a, createElementBlock as s, openBlock as c, createVNode as m, mergeProps as l, withCtx as f, createElementVNode as p } from "vue";
2
- import { useData as u } from "./index234.js";
2
+ import { useData as u } from "./index272.js";
3
3
  import d from "./index8.js";
4
4
  const h = { class: "VPMenuLink" }, x = ["innerHTML"], v = /* @__PURE__ */ r({
5
5
  inheritAttrs: !1,
@@ -1,4 +1,4 @@
1
- import o from "./index358.js";
1
+ import o from "./index366.js";
2
2
  /* empty css */
3
3
  export {
4
4
  o as default
package/dist/index392.js CHANGED
@@ -1,23 +1,4 @@
1
- import { defineComponent as a, ref as r, watch as c, createElementBlock as s, openBlock as p, Fragment as i, createElementVNode as t, toDisplayString as l, unref as u } from "vue";
2
- import { useRoute as m } from "vitepress";
3
- import { useData as f } from "./index234.js";
4
- const k = {
5
- href: "#VPContent",
6
- class: "VPSkipLink visually-hidden"
7
- }, V = /* @__PURE__ */ a({
8
- __name: "VPSkipLink",
9
- setup(_) {
10
- const { theme: o } = f(), n = m(), e = r();
11
- return c(() => n.path, () => e.value.focus()), (d, h) => (p(), s(i, null, [
12
- t("span", {
13
- ref_key: "backToTop",
14
- ref: e,
15
- tabindex: "-1"
16
- }, null, 512),
17
- t("a", k, l(u(o).skipToContentLabel || "Skip to content"), 1)
18
- ], 64));
19
- }
20
- });
1
+ import f from "./index368.js";
21
2
  export {
22
- V as default
3
+ f as default
23
4
  };
@@ -0,0 +1,456 @@
1
+ import { defineComponent as we, shallowRef as R, ref as m, onMounted as B, watch as j, nextTick as y, onBeforeUnmount as oe, markRaw as se, computed as V, watchEffect as xe, createApp as Te, createBlock as Se, openBlock as u, Teleport as Le, createElementVNode as l, createElementBlock as d, Fragment as z, withModifiers as Ee, withDirectives as Me, unref as s, isRef as De, vModelText as $e, createCommentVNode as P, normalizeClass as ne, renderList as re, createTextVNode as S, toDisplayString as L } from "vue";
2
+ import { computedAsync as ie, useSessionStorage as Ce, useLocalStorage as Ae, debouncedWatch as Ie, onKeyStroke as H, useEventListener as Re, useScrollLock as Be } from "@vueuse/core";
3
+ import { useFocusTrap as Ve } from "@vueuse/integrations/useFocusTrap";
4
+ import Pe from "mark.js/src/vanilla.js";
5
+ import He from "minisearch";
6
+ import { dataSymbol as _e, useRouter as Ke, inBrowser as Oe } from "vitepress";
7
+ import { pathToFile as Ne } from "./index410.js";
8
+ import { escapeRegExp as Fe } from "./index206.js";
9
+ import { useData as Ue } from "./index272.js";
10
+ import { LRUCache as qe } from "./index411.js";
11
+ import { createSearchTranslate as je } from "./index412.js";
12
+ const ze = ["aria-owns"], Qe = { class: "shell" }, We = {
13
+ key: 0,
14
+ class: "search-loading"
15
+ }, Je = {
16
+ key: 1,
17
+ class: "search-error"
18
+ }, Ge = ["title"], Xe = { class: "search-actions before" }, Ye = ["title"], Ze = ["aria-activedescendant", "aria-controls", "placeholder"], et = { class: "search-actions" }, tt = ["title"], lt = ["disabled", "title"], at = ["id", "role", "aria-labelledby"], ot = ["id", "aria-selected"], st = ["href", "aria-label", "onMouseenter", "onFocusin", "data-index"], nt = { class: "titles" }, rt = ["innerHTML"], it = { class: "title main" }, ut = ["innerHTML"], ct = {
19
+ key: 0,
20
+ class: "excerpt-wrapper"
21
+ }, dt = {
22
+ key: 0,
23
+ class: "excerpt",
24
+ inert: ""
25
+ }, vt = ["innerHTML"], pt = {
26
+ key: 0,
27
+ class: "no-results"
28
+ }, ft = { class: "search-keyboard-shortcuts" }, mt = ["aria-label"], ht = ["aria-label"], bt = ["aria-label"], gt = ["aria-label"], Bt = /* @__PURE__ */ we({
29
+ __name: "VPLocalSearchBox",
30
+ emits: ["close"],
31
+ setup(yt, { emit: ue }) {
32
+ const _ = ue, E = R(), M = R(), K = R(null), D = m(!0), O = m(!1);
33
+ B(async () => {
34
+ try {
35
+ const t = await import("@localSearchIndex");
36
+ K.value = t.default, D.value = !1;
37
+ } catch {
38
+ O.value = !0, D.value = !1, console.debug("[VPLocalSearchBox] Search index not available - this is normal during theme development");
39
+ }
40
+ });
41
+ const $ = Ue(), { activate: Q, deactivate: ce } = Ve(E, {
42
+ immediate: !1,
43
+ // Don't activate immediately - wait until search form is visible
44
+ allowOutsideClick: !0,
45
+ clickOutsideDeactivates: !0,
46
+ escapeDeactivates: !0,
47
+ fallbackFocus: () => E.value
48
+ // Fallback to container if no tabbable elements
49
+ });
50
+ j([() => D.value, () => O.value], ([t, e]) => {
51
+ !t && !e && y(() => {
52
+ Q();
53
+ });
54
+ }, { immediate: !0 }), oe(() => {
55
+ ce();
56
+ });
57
+ const { localeIndex: W, theme: r } = $, de = ie(async () => {
58
+ if (!K.value) return null;
59
+ const t = await K.value[W.value]?.();
60
+ return t?.default ? se(
61
+ He.loadJSON(
62
+ t.default,
63
+ {
64
+ fields: ["title", "titles", "text"],
65
+ storeFields: ["title", "titles"],
66
+ searchOptions: {
67
+ fuzzy: 0.2,
68
+ prefix: !0,
69
+ boost: { title: 4, text: 2, titles: 1 },
70
+ ...r.value.search?.provider === "local" && r.value.search.options?.miniSearch?.searchOptions
71
+ },
72
+ ...r.value.search?.provider === "local" && r.value.search.options?.miniSearch?.options
73
+ }
74
+ )
75
+ ) : null;
76
+ }), v = V(() => r.value.search?.provider === "local" && r.value.search.options?.disableQueryPersistence === !0).value ? m("") : Ce("vitepress:local-search-filter", ""), h = Ae(
77
+ "vitepress:local-search-detailed-list",
78
+ r.value.search?.provider === "local" && r.value.search.options?.detailedView === !0
79
+ ), J = V(() => r.value.search?.provider === "local" && (r.value.search.options?.disableDetailedView === !0 || r.value.search.options?.detailedView === !1)), G = V(() => {
80
+ const t = r.value.search?.options ?? r.value.algolia;
81
+ return t?.locales?.[W.value]?.translations?.button?.buttonText || t?.translations?.button?.buttonText || "Search";
82
+ });
83
+ xe(() => {
84
+ J.value && (h.value = !1);
85
+ });
86
+ const n = R([]), N = m(!1);
87
+ j(v, () => {
88
+ N.value = !1;
89
+ });
90
+ const X = ie(async () => {
91
+ if (M.value)
92
+ return se(new Pe(M.value));
93
+ }, null), C = new qe(16);
94
+ Ie(
95
+ () => [de.value, v.value, h.value],
96
+ async ([t, e, a], p, b) => {
97
+ p?.[0] !== t && C.clear();
98
+ let g = !1;
99
+ if (b(() => {
100
+ g = !0;
101
+ }), !t) return;
102
+ n.value = t.search(e).slice(0, 16), N.value = !0;
103
+ const ye = a ? await Promise.all(n.value.map((i) => ve(i.id))) : [];
104
+ if (g) return;
105
+ for (const { id: i, mod: A } of ye) {
106
+ const I = i.slice(0, i.indexOf("#"));
107
+ let w = C.get(I);
108
+ if (w) continue;
109
+ w = /* @__PURE__ */ new Map(), C.set(I, w);
110
+ const x = A.default ?? A;
111
+ if (x?.render || x?.setup) {
112
+ const f = Te(x);
113
+ f.config.warnHandler = () => {
114
+ }, f.provide(_e, $), Object.defineProperties(f.config.globalProperties, {
115
+ $frontmatter: {
116
+ get() {
117
+ return $.frontmatter.value;
118
+ }
119
+ },
120
+ $params: {
121
+ get() {
122
+ return $.page.value.params;
123
+ }
124
+ }
125
+ });
126
+ const ee = document.createElement("div");
127
+ f.mount(ee), ee.querySelectorAll("h1, h2, h3, h4, h5, h6").forEach((T) => {
128
+ const te = T.querySelector("a")?.getAttribute("href"), le = te?.startsWith("#") && te.slice(1);
129
+ if (!le) return;
130
+ let ae = "";
131
+ for (; (T = T.nextElementSibling) && !/^h[1-6]$/i.test(T.tagName); )
132
+ ae += T.outerHTML;
133
+ w.set(le, ae);
134
+ }), f.unmount();
135
+ }
136
+ if (g) return;
137
+ }
138
+ const Z = /* @__PURE__ */ new Set();
139
+ if (n.value = n.value.map((i) => {
140
+ const [A, I] = i.id.split("#"), x = C.get(A)?.get(I) ?? "";
141
+ for (const f in i.match)
142
+ Z.add(f);
143
+ return { ...i, text: x };
144
+ }), await y(), g) return;
145
+ await new Promise((i) => {
146
+ X.value?.unmark({
147
+ done: () => {
148
+ X.value?.markRegExp(be(Z), { done: i });
149
+ }
150
+ });
151
+ });
152
+ const ke = E.value?.querySelectorAll(".result .excerpt") ?? [];
153
+ for (const i of ke)
154
+ i.querySelector('mark[data-markjs="true"]')?.scrollIntoView({ block: "center" });
155
+ M.value?.firstElementChild?.scrollIntoView({ block: "start" });
156
+ },
157
+ { debounce: 200, immediate: !0 }
158
+ );
159
+ async function ve(t) {
160
+ const e = Ne(t.slice(0, t.indexOf("#")));
161
+ try {
162
+ if (!e) throw new Error(`Cannot find file for id: ${t}`);
163
+ return { id: t, mod: await import(
164
+ /*@vite-ignore*/
165
+ e
166
+ ) };
167
+ } catch (a) {
168
+ return console.error(a), { id: t, mod: {} };
169
+ }
170
+ }
171
+ const F = m(), pe = V(() => v.value?.length <= 0);
172
+ function U(t = !0) {
173
+ F.value?.focus(), t && F.value?.select();
174
+ }
175
+ B(() => {
176
+ U();
177
+ });
178
+ function fe(t) {
179
+ t.pointerType === "mouse" && U();
180
+ }
181
+ const o = m(-1), k = m(!0);
182
+ j(n, (t) => {
183
+ o.value = t.length ? 0 : -1, q();
184
+ });
185
+ function q() {
186
+ y(() => {
187
+ document.querySelector(".result.selected")?.scrollIntoView({ block: "nearest" });
188
+ });
189
+ }
190
+ H("ArrowUp", (t) => {
191
+ t.preventDefault(), o.value--, o.value < 0 && (o.value = n.value.length - 1), k.value = !0, q();
192
+ }), H("ArrowDown", (t) => {
193
+ t.preventDefault(), o.value++, o.value >= n.value.length && (o.value = 0), k.value = !0, q();
194
+ });
195
+ const me = Ke();
196
+ H("Enter", (t) => {
197
+ if (t.isComposing || t.target instanceof HTMLButtonElement && t.target.type !== "submit")
198
+ return;
199
+ const e = n.value[o.value];
200
+ if (t.target instanceof HTMLInputElement && !e) {
201
+ t.preventDefault();
202
+ return;
203
+ }
204
+ e && (me.go(e.id), _("close"));
205
+ }), H("Escape", () => {
206
+ _("close");
207
+ });
208
+ const c = je({
209
+ modal: {
210
+ displayDetails: "Display detailed list",
211
+ resetButtonTitle: "Reset search",
212
+ backButtonTitle: "Close search",
213
+ noResultsText: "No results for",
214
+ footer: {
215
+ selectText: "to select",
216
+ selectKeyAriaLabel: "enter",
217
+ navigateText: "to navigate",
218
+ navigateUpKeyAriaLabel: "up arrow",
219
+ navigateDownKeyAriaLabel: "down arrow",
220
+ closeText: "to close",
221
+ closeKeyAriaLabel: "escape"
222
+ }
223
+ }
224
+ });
225
+ B(() => {
226
+ window.history.pushState(null, "", null);
227
+ }), Re("popstate", (t) => {
228
+ t.preventDefault(), _("close");
229
+ });
230
+ const Y = Be(Oe ? document.body : null);
231
+ B(() => {
232
+ y(() => {
233
+ Y.value = !0, y().then(() => Q());
234
+ });
235
+ }), oe(() => {
236
+ Y.value = !1;
237
+ });
238
+ function he() {
239
+ v.value = "", y().then(() => U(!1));
240
+ }
241
+ function be(t) {
242
+ return new RegExp(
243
+ [...t].sort((e, a) => a.length - e.length).map((e) => `(${Fe(e)})`).join("|"),
244
+ "gi"
245
+ );
246
+ }
247
+ function ge(t) {
248
+ if (!k.value) return;
249
+ const e = t.target?.closest(".result"), a = Number.parseInt(e?.dataset.index);
250
+ a >= 0 && a !== o.value && (o.value = a), k.value = !1;
251
+ }
252
+ return (t, e) => (u(), Se(Le, { to: "body" }, [
253
+ l("div", {
254
+ ref_key: "el",
255
+ ref: E,
256
+ role: "button",
257
+ "aria-owns": n.value?.length ? "localsearch-list" : void 0,
258
+ "aria-expanded": "true",
259
+ "aria-haspopup": "listbox",
260
+ "aria-labelledby": "localsearch-label",
261
+ class: "VPLocalSearchBox"
262
+ }, [
263
+ l("div", {
264
+ class: "backdrop",
265
+ onClick: e[0] || (e[0] = (a) => t.$emit("close"))
266
+ }),
267
+ l("div", Qe, [
268
+ D.value ? (u(), d("div", We, [
269
+ e[10] || (e[10] = l("span", null, "Loading search index...", -1)),
270
+ l("button", {
271
+ type: "button",
272
+ class: "search-loading-close",
273
+ onClick: e[1] || (e[1] = (a) => t.$emit("close"))
274
+ }, [...e[9] || (e[9] = [
275
+ l("span", { class: "vpi-close local-search-icon" }, null, -1)
276
+ ])])
277
+ ])) : O.value ? (u(), d("div", Je, [
278
+ e[12] || (e[12] = l("span", null, "Search is not available in theme development mode.", -1)),
279
+ l("button", {
280
+ type: "button",
281
+ class: "search-error-close",
282
+ onClick: e[2] || (e[2] = (a) => t.$emit("close"))
283
+ }, [...e[11] || (e[11] = [
284
+ l("span", { class: "vpi-close local-search-icon" }, null, -1)
285
+ ])])
286
+ ])) : (u(), d(z, { key: 2 }, [
287
+ l("form", {
288
+ class: "search-bar",
289
+ onPointerup: e[6] || (e[6] = (a) => fe(a)),
290
+ onSubmit: e[7] || (e[7] = Ee(() => {
291
+ }, ["prevent"]))
292
+ }, [
293
+ l("label", {
294
+ title: G.value,
295
+ id: "localsearch-label",
296
+ for: "localsearch-input"
297
+ }, [...e[13] || (e[13] = [
298
+ l("span", {
299
+ "aria-hidden": "true",
300
+ class: "vpi-search search-icon local-search-icon"
301
+ }, null, -1)
302
+ ])], 8, Ge),
303
+ l("div", Xe, [
304
+ l("button", {
305
+ class: "back-button",
306
+ title: s(c)("modal.backButtonTitle"),
307
+ onClick: e[3] || (e[3] = (a) => t.$emit("close"))
308
+ }, [...e[14] || (e[14] = [
309
+ l("span", { class: "vpi-arrow-left local-search-icon" }, null, -1)
310
+ ])], 8, Ye)
311
+ ]),
312
+ Me(l("input", {
313
+ ref_key: "searchInput",
314
+ ref: F,
315
+ "onUpdate:modelValue": e[4] || (e[4] = (a) => De(v) ? v.value = a : null),
316
+ "aria-activedescendant": o.value > -1 ? "localsearch-item-" + o.value : void 0,
317
+ "aria-autocomplete": "both",
318
+ "aria-controls": n.value?.length ? "localsearch-list" : void 0,
319
+ "aria-labelledby": "localsearch-label",
320
+ autocapitalize: "off",
321
+ autocomplete: "off",
322
+ autocorrect: "off",
323
+ class: "search-input",
324
+ id: "localsearch-input",
325
+ enterkeyhint: "go",
326
+ maxlength: "64",
327
+ placeholder: G.value,
328
+ spellcheck: "false",
329
+ type: "search"
330
+ }, null, 8, Ze), [
331
+ [$e, s(v)]
332
+ ]),
333
+ l("div", et, [
334
+ J.value ? P("", !0) : (u(), d("button", {
335
+ key: 0,
336
+ class: ne(["toggle-layout-button", { "detailed-list": s(h) }]),
337
+ type: "button",
338
+ title: s(c)("modal.displayDetails"),
339
+ onClick: e[5] || (e[5] = (a) => o.value > -1 && (h.value = !s(h)))
340
+ }, [...e[15] || (e[15] = [
341
+ l("span", { class: "vpi-layout-list local-search-icon" }, null, -1)
342
+ ])], 10, tt)),
343
+ l("button", {
344
+ class: "clear-button",
345
+ type: "reset",
346
+ disabled: pe.value,
347
+ title: s(c)("modal.resetButtonTitle"),
348
+ onClick: he
349
+ }, [...e[16] || (e[16] = [
350
+ l("span", { class: "vpi-delete local-search-icon" }, null, -1)
351
+ ])], 8, lt)
352
+ ])
353
+ ], 32),
354
+ l("ul", {
355
+ ref_key: "resultsEl",
356
+ ref: M,
357
+ id: n.value?.length ? "localsearch-list" : void 0,
358
+ role: n.value?.length ? "listbox" : void 0,
359
+ "aria-labelledby": n.value?.length ? "localsearch-label" : void 0,
360
+ class: "results",
361
+ onMousemove: ge
362
+ }, [
363
+ (u(!0), d(z, null, re(n.value, (a, p) => (u(), d("li", {
364
+ key: a.id,
365
+ id: "localsearch-item-" + p,
366
+ "aria-selected": o.value === p ? "true" : "false",
367
+ role: "option"
368
+ }, [
369
+ l("a", {
370
+ href: a.id,
371
+ class: ne(["result", {
372
+ selected: o.value === p
373
+ }]),
374
+ "aria-label": [...a.titles, a.title].join(" > "),
375
+ onMouseenter: (b) => !k.value && (o.value = p),
376
+ onFocusin: (b) => o.value = p,
377
+ onClick: e[8] || (e[8] = (b) => t.$emit("close")),
378
+ "data-index": p
379
+ }, [
380
+ l("div", null, [
381
+ l("div", nt, [
382
+ e[18] || (e[18] = l("span", { class: "title-icon" }, "#", -1)),
383
+ (u(!0), d(z, null, re(a.titles, (b, g) => (u(), d("span", {
384
+ key: g,
385
+ class: "title"
386
+ }, [
387
+ l("span", {
388
+ class: "text",
389
+ innerHTML: b
390
+ }, null, 8, rt),
391
+ e[17] || (e[17] = l("span", { class: "vpi-chevron-right local-search-icon" }, null, -1))
392
+ ]))), 128)),
393
+ l("span", it, [
394
+ l("span", {
395
+ class: "text",
396
+ innerHTML: a.title
397
+ }, null, 8, ut)
398
+ ])
399
+ ]),
400
+ s(h) ? (u(), d("div", ct, [
401
+ a.text ? (u(), d("div", dt, [
402
+ l("div", {
403
+ class: "vp-doc",
404
+ innerHTML: a.text
405
+ }, null, 8, vt)
406
+ ])) : P("", !0),
407
+ e[19] || (e[19] = l("div", { class: "excerpt-gradient-bottom" }, null, -1)),
408
+ e[20] || (e[20] = l("div", { class: "excerpt-gradient-top" }, null, -1))
409
+ ])) : P("", !0)
410
+ ])
411
+ ], 42, st)
412
+ ], 8, ot))), 128)),
413
+ s(v) && !n.value.length && N.value ? (u(), d("li", pt, [
414
+ S(L(s(c)("modal.noResultsText")) + ' "', 1),
415
+ l("strong", null, L(s(v)), 1),
416
+ e[21] || (e[21] = S('" ', -1))
417
+ ])) : P("", !0)
418
+ ], 40, at),
419
+ l("div", ft, [
420
+ l("span", null, [
421
+ l("kbd", {
422
+ "aria-label": s(c)("modal.footer.navigateUpKeyAriaLabel")
423
+ }, [...e[22] || (e[22] = [
424
+ l("span", { class: "vpi-arrow-up navigate-icon" }, null, -1)
425
+ ])], 8, mt),
426
+ l("kbd", {
427
+ "aria-label": s(c)("modal.footer.navigateDownKeyAriaLabel")
428
+ }, [...e[23] || (e[23] = [
429
+ l("span", { class: "vpi-arrow-down navigate-icon" }, null, -1)
430
+ ])], 8, ht),
431
+ S(" " + L(s(c)("modal.footer.navigateText")), 1)
432
+ ]),
433
+ l("span", null, [
434
+ l("kbd", {
435
+ "aria-label": s(c)("modal.footer.selectKeyAriaLabel")
436
+ }, [...e[24] || (e[24] = [
437
+ l("span", { class: "vpi-corner-down-left navigate-icon" }, null, -1)
438
+ ])], 8, bt),
439
+ S(" " + L(s(c)("modal.footer.selectText")), 1)
440
+ ]),
441
+ l("span", null, [
442
+ l("kbd", {
443
+ "aria-label": s(c)("modal.footer.closeKeyAriaLabel")
444
+ }, "esc", 8, gt),
445
+ S(" " + L(s(c)("modal.footer.closeText")), 1)
446
+ ])
447
+ ])
448
+ ], 64))
449
+ ])
450
+ ], 8, ze)
451
+ ]));
452
+ }
453
+ });
454
+ export {
455
+ Bt as default
456
+ };
package/dist/index395.js CHANGED
@@ -1,4 +1,89 @@
1
- import f from "./index360.js";
1
+ import { defineComponent as S, ref as d, onMounted as k, watch as x, nextTick as A, createElementBlock as _, createCommentVNode as I, openBlock as w } from "vue";
2
+ import { useRouter as F } from "vitepress";
3
+ import { useData as D } from "./index272.js";
4
+ import { loadDocSearchCSS as L, loadDocSearchJS as N } from "./index409.js";
5
+ const V = {
6
+ key: 0,
7
+ id: "docsearch"
8
+ }, T = /* @__PURE__ */ S({
9
+ __name: "VPAlgoliaSearchBox",
10
+ props: {
11
+ algolia: {}
12
+ },
13
+ setup(m) {
14
+ const c = m, p = F(), { site: h, localeIndex: l, lang: f } = D(), n = d(!0), o = d(!1);
15
+ let s = null;
16
+ k(async () => {
17
+ if (!await L()) {
18
+ o.value = !0, n.value = !1;
19
+ return;
20
+ }
21
+ if (s = await N(), !s) {
22
+ o.value = !0, n.value = !1;
23
+ return;
24
+ }
25
+ n.value = !1, u();
26
+ }), x(l, () => {
27
+ !n.value && !o.value && u();
28
+ });
29
+ async function u() {
30
+ if (!s) return;
31
+ await A();
32
+ const e = {
33
+ ...c.algolia,
34
+ ...c.algolia.locales?.[l.value]
35
+ }, a = e.searchParameters?.facetFilters ?? [], r = [
36
+ ...(Array.isArray(a) ? a : [a]).filter((P) => !P.startsWith("lang:")),
37
+ `lang:${f.value}`
38
+ ], t = e.askAi, i = typeof t == "string", y = t ? {
39
+ indexName: i ? e.indexName : t.indexName,
40
+ apiKey: i ? e.apiKey : t.apiKey,
41
+ appId: i ? e.appId : t.appId,
42
+ assistantId: i ? t : t.assistantId,
43
+ // Re-use the merged facetFilters from the search parameters so that
44
+ // Ask AI uses the same language filtering as the regular search.
45
+ searchParameters: r.length ? { facetFilters: r } : void 0
46
+ } : void 0;
47
+ g({
48
+ ...e,
49
+ searchParameters: {
50
+ ...e.searchParameters,
51
+ facetFilters: r
52
+ },
53
+ askAi: y
54
+ });
55
+ }
56
+ function g(e) {
57
+ if (!s) {
58
+ console.error("[VitePress Theme] DocSearch not loaded");
59
+ return;
60
+ }
61
+ try {
62
+ const a = Object.assign({}, e, {
63
+ container: "#docsearch",
64
+ navigator: {
65
+ navigate(r) {
66
+ p.go(r.itemUrl);
67
+ }
68
+ },
69
+ transformItems(r) {
70
+ return r.map((t) => Object.assign({}, t, {
71
+ url: v(t.url)
72
+ }));
73
+ }
74
+ });
75
+ s(a);
76
+ } catch (a) {
77
+ console.error("[VitePress Theme] Failed to initialize DocSearch:", a), o.value = !0;
78
+ }
79
+ }
80
+ function v(e) {
81
+ const { pathname: a, hash: r } = new URL(e, location.origin);
82
+ return a.replace(/\.html$/, h.value.cleanUrls ? "" : ".html") + r;
83
+ }
84
+ return (e, a) => o.value ? I("", !0) : (w(), _("div", V));
85
+ }
86
+ });
2
87
  export {
3
- f as default
88
+ T as default
4
89
  };