@vuepress/theme-default 2.0.0-rc.124 → 2.0.0-rc.126

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 (150) hide show
  1. package/{lib → dist}/client/components/VPFadeSlideYTransition.vue +1 -0
  2. package/{lib → dist}/client/components/VPHome.vue +2 -1
  3. package/{lib → dist}/client/components/VPHomeFeatures.vue +3 -1
  4. package/{lib → dist}/client/components/VPHomeFooter.vue +1 -0
  5. package/{lib → dist}/client/components/VPHomeHero.vue +5 -3
  6. package/{lib → dist}/client/components/VPNavbar.vue +6 -5
  7. package/{lib → dist}/client/components/VPNavbarBrand.vue +3 -2
  8. package/{lib → dist}/client/components/VPNavbarDropdown.vue +3 -1
  9. package/{lib → dist}/client/components/VPNavbarItems.vue +4 -3
  10. package/{lib → dist}/client/components/VPPage.vue +3 -2
  11. package/{lib → dist}/client/components/VPPageMeta.vue +4 -3
  12. package/{lib → dist}/client/components/VPPageNav.vue +4 -3
  13. package/{lib → dist}/client/components/VPSidebar.vue +2 -1
  14. package/{lib → dist}/client/components/VPSidebarItem.vue +5 -3
  15. package/{lib → dist}/client/components/VPSidebarItems.vue +3 -2
  16. package/dist/client/composables/index.d.ts +12 -0
  17. package/dist/client/composables/useDarkMode.d.ts +2 -0
  18. package/dist/client/composables/useDarkMode.js +2 -0
  19. package/dist/client/composables/useDarkMode.js.map +1 -0
  20. package/dist/client/composables/useData.d.ts +2 -0
  21. package/dist/client/composables/useData.js.map +1 -0
  22. package/dist/client/composables/useEditLink.d.ts +2 -0
  23. package/{lib → dist}/client/composables/useEditLink.js +1 -1
  24. package/dist/client/composables/useEditLink.js.map +1 -0
  25. package/dist/client/composables/useHeaders.js +2 -0
  26. package/dist/client/composables/useHeaders.js.map +1 -0
  27. package/dist/client/composables/useNavbarConfig.d.ts +2 -0
  28. package/{lib → dist}/client/composables/useNavbarConfig.js +1 -1
  29. package/dist/client/composables/useNavbarConfig.js.map +1 -0
  30. package/dist/client/composables/useNavbarRepo.d.ts +2 -0
  31. package/dist/client/composables/useNavbarRepo.js +2 -0
  32. package/dist/client/composables/useNavbarRepo.js.map +1 -0
  33. package/dist/client/composables/useNavbarSelectLanguage.d.ts +2 -0
  34. package/{lib → dist}/client/composables/useNavbarSelectLanguage.js +1 -1
  35. package/dist/client/composables/useNavbarSelectLanguage.js.map +1 -0
  36. package/dist/client/composables/useNavigate.d.ts +2 -0
  37. package/dist/client/composables/useRelatedLinks.d.ts +2 -0
  38. package/dist/client/composables/useRelatedLinks.js +2 -0
  39. package/dist/client/composables/useRelatedLinks.js.map +1 -0
  40. package/dist/client/composables/useScrollPromise.d.ts +2 -0
  41. package/dist/client/composables/useSidebarItems.d.ts +2 -0
  42. package/dist/client/composables/useSidebarItems.js +2 -0
  43. package/dist/client/composables/useSidebarItems.js.map +1 -0
  44. package/dist/client/composables/useUpdateDeviceStatus.d.ts +2 -0
  45. package/dist/client/composables/useUpdateDeviceStatus.js.map +1 -0
  46. package/{lib → dist}/client/config.d.ts +0 -4
  47. package/dist/client/config.js +2 -0
  48. package/dist/client/config.js.map +1 -0
  49. package/{lib → dist}/client/index.d.ts +19 -19
  50. package/dist/client/index.js +1 -0
  51. package/{lib → dist}/client/layouts/Layout.vue +7 -6
  52. package/{lib → dist}/client/layouts/NotFound.vue +2 -1
  53. package/{lib → dist}/client/styles/arrow.scss +3 -3
  54. package/{lib → dist}/client/styles/vars.scss +2 -2
  55. package/dist/client/utils/index.d.ts +6 -0
  56. package/dist/client/utils/isActiveSidebarItem.d.ts +2 -0
  57. package/dist/client/utils/isActiveSidebarItem.js.map +1 -0
  58. package/dist/client/utils/resolveAutoLink.d.ts +2 -0
  59. package/dist/client/utils/resolveAutoLink.js.map +1 -0
  60. package/dist/client/utils/resolveEditLink.d.ts +2 -0
  61. package/dist/client/utils/resolveEditLink.js.map +1 -0
  62. package/dist/client/utils/resolvePrefix.d.ts +2 -0
  63. package/dist/client/utils/resolveRepoType.d.ts +2 -0
  64. package/{lib/client/utils/isActiveSidebarItem.d.ts → dist/isActiveSidebarItem-aythFTeC.d.ts} +3 -3
  65. package/{lib → dist}/node/index.d.ts +4 -2
  66. package/dist/node/index.js.map +1 -0
  67. package/{lib/page-F2gyvsdE.d.ts → dist/page-FWcDnzJp.d.ts} +2 -2
  68. package/{lib/client/utils/resolveAutoLink.d.ts → dist/resolveAutoLink-BR2Z05MD.d.ts} +3 -3
  69. package/{lib/client/utils/resolveEditLink.d.ts → dist/resolveEditLink-DazcWeGf.d.ts} +2 -2
  70. package/{lib/client/utils/resolvePrefix.d.ts → dist/resolvePrefix-BN9K9RA5.d.ts} +2 -2
  71. package/{lib/client/utils/resolveRepoType.d.ts → dist/resolveRepoType-Wcj35_rs.d.ts} +2 -2
  72. package/{lib/sidebar-FqrQ3PGy.d.ts → dist/sidebar-CF1YPYLN.d.ts} +1 -1
  73. package/{lib/typings-jKn48KwS.d.ts → dist/typings-NbQSzbOn.d.ts} +2 -2
  74. package/{lib/client/composables/useDarkMode.d.ts → dist/useDarkMode-DLor2cV7.d.ts} +2 -2
  75. package/{lib/client/composables/useData.d.ts → dist/useData-JDen_Bxm.d.ts} +4 -4
  76. package/{lib/client/composables/useEditLink.d.ts → dist/useEditLink-DPCTvXmM.d.ts} +2 -2
  77. package/{lib/client/composables/useNavbarConfig.d.ts → dist/useNavbarConfig-C19TGFg7.d.ts} +3 -3
  78. package/{lib/client/composables/useNavbarRepo.d.ts → dist/useNavbarRepo-DxhSIAFq.d.ts} +3 -3
  79. package/{lib/client/composables/useNavbarSelectLanguage.d.ts → dist/useNavbarSelectLanguage-4GkrPvc2.d.ts} +3 -3
  80. package/{lib/client/composables/useNavigate.d.ts → dist/useNavigate-lH4xyHOV.d.ts} +2 -2
  81. package/{lib/client/composables/useRelatedLinks.d.ts → dist/useRelatedLinks-ChTW2RRU.d.ts} +3 -3
  82. package/{lib/client/composables/useScrollPromise.d.ts → dist/useScrollPromise-BAl732Uv.d.ts} +2 -2
  83. package/{lib/client/composables/useSidebarItems.d.ts → dist/useSidebarItems-CdpB96Ta.d.ts} +4 -4
  84. package/{lib/client/composables/useUpdateDeviceStatus.d.ts → dist/useUpdateDeviceStatus-SBnOZx8J.d.ts} +2 -2
  85. package/package.json +36 -36
  86. package/lib/client/composables/index.d.ts +0 -12
  87. package/lib/client/composables/useDarkMode.js +0 -2
  88. package/lib/client/composables/useDarkMode.js.map +0 -1
  89. package/lib/client/composables/useData.js.map +0 -1
  90. package/lib/client/composables/useEditLink.js.map +0 -1
  91. package/lib/client/composables/useHeaders.js +0 -2
  92. package/lib/client/composables/useHeaders.js.map +0 -1
  93. package/lib/client/composables/useNavbarConfig.js.map +0 -1
  94. package/lib/client/composables/useNavbarRepo.js +0 -2
  95. package/lib/client/composables/useNavbarRepo.js.map +0 -1
  96. package/lib/client/composables/useNavbarSelectLanguage.js.map +0 -1
  97. package/lib/client/composables/useRelatedLinks.js +0 -2
  98. package/lib/client/composables/useRelatedLinks.js.map +0 -1
  99. package/lib/client/composables/useSidebarItems.js +0 -2
  100. package/lib/client/composables/useSidebarItems.js.map +0 -1
  101. package/lib/client/composables/useUpdateDeviceStatus.js.map +0 -1
  102. package/lib/client/config.js +0 -2
  103. package/lib/client/config.js.map +0 -1
  104. package/lib/client/index.js +0 -1
  105. package/lib/client/shim.d.ts +0 -11
  106. package/lib/client/utils/index.d.ts +0 -6
  107. package/lib/client/utils/isActiveSidebarItem.js.map +0 -1
  108. package/lib/client/utils/resolveAutoLink.js.map +0 -1
  109. package/lib/client/utils/resolveEditLink.js.map +0 -1
  110. package/lib/node/index.js.map +0 -1
  111. package/{lib → dist}/client/components/VPAutoLink.vue +0 -0
  112. package/{lib → dist}/client/components/VPDarkIcon.vue +0 -0
  113. package/{lib → dist}/client/components/VPDropdownTransition.vue +0 -0
  114. package/{lib → dist}/client/components/VPEditIcon.vue +0 -0
  115. package/{lib → dist}/client/components/VPLightIcon.vue +0 -0
  116. package/{lib → dist}/client/components/VPToggleColorModeButton.vue +2 -2
  117. /package/{lib → dist}/client/components/VPToggleSidebarButton.vue +0 -0
  118. /package/{lib → dist}/client/components/global/Badge.vue +0 -0
  119. /package/{lib → dist}/client/composables/index.js +0 -0
  120. /package/{lib → dist}/client/composables/useData.js +0 -0
  121. /package/{lib → dist}/client/composables/useHeaders.d.ts +0 -0
  122. /package/{lib → dist}/client/composables/useNavigate.js +0 -0
  123. /package/{lib → dist}/client/composables/useNavigate.js.map +0 -0
  124. /package/{lib → dist}/client/composables/useScrollPromise.js +0 -0
  125. /package/{lib → dist}/client/composables/useScrollPromise.js.map +0 -0
  126. /package/{lib → dist}/client/composables/useUpdateDeviceStatus.js +0 -0
  127. /package/{lib → dist}/client/styles/_mixins.scss +0 -0
  128. /package/{lib → dist}/client/styles/_variables.module.scss +0 -0
  129. /package/{lib → dist}/client/styles/_variables.scss +0 -0
  130. /package/{lib → dist}/client/styles/code-group.scss +0 -0
  131. /package/{lib → dist}/client/styles/content/code.scss +0 -0
  132. /package/{lib → dist}/client/styles/content/index.scss +0 -0
  133. /package/{lib → dist}/client/styles/content/normalize.scss +0 -0
  134. /package/{lib → dist}/client/styles/content/toc.scss +0 -0
  135. /package/{lib → dist}/client/styles/external-link-icon.scss +0 -0
  136. /package/{lib → dist}/client/styles/index.scss +0 -0
  137. /package/{lib → dist}/client/styles/layout.scss +0 -0
  138. /package/{lib → dist}/client/styles/normalize.scss +0 -0
  139. /package/{lib → dist}/client/styles/plugins.scss +0 -0
  140. /package/{lib → dist}/client/styles/vars-dark.scss +0 -0
  141. /package/{lib → dist}/client/utils/index.js +0 -0
  142. /package/{lib → dist}/client/utils/isActiveSidebarItem.js +0 -0
  143. /package/{lib → dist}/client/utils/resolveAutoLink.js +0 -0
  144. /package/{lib → dist}/client/utils/resolveEditLink.js +0 -0
  145. /package/{lib → dist}/client/utils/resolvePrefix.js +0 -0
  146. /package/{lib → dist}/client/utils/resolvePrefix.js.map +0 -0
  147. /package/{lib → dist}/client/utils/resolveRepoType.js +0 -0
  148. /package/{lib → dist}/client/utils/resolveRepoType.js.map +0 -0
  149. /package/{lib → dist}/nav-DikslSJ_.d.ts +0 -0
  150. /package/{lib → dist}/node/index.js +0 -0
@@ -0,0 +1,6 @@
1
+ import { t as isActiveSidebarItem } from "../../isActiveSidebarItem-aythFTeC.js";
2
+ import { t as resolveAutoLink } from "../../resolveAutoLink-BR2Z05MD.js";
3
+ import { n as resolveEditLink, t as EDIT_LINK_PATTERNS } from "../../resolveEditLink-DazcWeGf.js";
4
+ import { t as resolvePrefix } from "../../resolvePrefix-BN9K9RA5.js";
5
+ import { n as resolveRepoType, t as RepoType } from "../../resolveRepoType-Wcj35_rs.js";
6
+ export { EDIT_LINK_PATTERNS, RepoType, isActiveSidebarItem, resolveAutoLink, resolveEditLink, resolvePrefix, resolveRepoType };
@@ -0,0 +1,2 @@
1
+ import { t as isActiveSidebarItem } from "../../isActiveSidebarItem-aythFTeC.js";
2
+ export { isActiveSidebarItem };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"isActiveSidebarItem.js","names":[],"sources":["../../../src/client/utils/isActiveSidebarItem.ts"],"sourcesContent":["import type { RouteLocationNormalizedLoaded } from 'vuepress/client'\n\nimport type { SidebarItem } from '../typings.js'\n\nconst normalizePath = (path: string): string =>\n decodeURI(path)\n .replace(/#.*$/, '')\n .replace(/(index)?\\.(md|html)$/, '')\n\nconst isActiveLink = (\n link: string,\n route: RouteLocationNormalizedLoaded,\n): boolean => {\n if (route.hash === link) return true\n\n const currentPath = normalizePath(route.path)\n const targetPath = normalizePath(link)\n return currentPath === targetPath\n}\n\nexport const isActiveSidebarItem = (\n item: SidebarItem,\n route: RouteLocationNormalizedLoaded,\n): boolean => {\n if (item.link && isActiveLink(item.link, route)) return true\n\n if ('children' in item)\n return item.children.some((child) => isActiveSidebarItem(child, route))\n\n return false\n}\n"],"mappings":"AAIA,MAAM,EAAiB,GACrB,UAAU,EAAK,CACZ,QAAQ,OAAQ,GAAG,CACnB,QAAQ,uBAAwB,GAAG,CAElC,GACJ,EACA,IAEI,EAAM,OAAS,EAAa,GAEZ,EAAc,EAAM,KAAK,GAC1B,EAAc,EAAK,CAI3B,GACX,EACA,IAEI,EAAK,MAAQ,EAAa,EAAK,KAAM,EAAM,CAAS,GAEpD,aAAc,EACT,EAAK,SAAS,KAAM,GAAU,EAAoB,EAAO,EAAM,CAAC,CAElE"}
@@ -0,0 +1,2 @@
1
+ import { t as resolveAutoLink } from "../../resolveAutoLink-BR2Z05MD.js";
2
+ export { resolveAutoLink };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveAutoLink.js","names":[],"sources":["../../../src/client/utils/resolveAutoLink.ts"],"sourcesContent":["import { resolveRoute } from 'vuepress/client'\n\nimport type { AutoLinkOptions } from '../../shared/index.js'\n\n/**\n * Resolve AutoLink props from string\n *\n * 从字符串解析 AutoLink 属性\n *\n * @param config - The string to resolve / 要解析的字符串\n * @param currentPath - The current route path / 当前路由路径\n * @returns Resolved AutoLink options / 解析后的 AutoLink 选项\n *\n * @example\n * - Input: '/README.md'\n * - Output: { text: 'Home', link: '/' }\n */\nexport const resolveAutoLink = (\n config: string,\n currentPath?: string,\n): AutoLinkOptions => {\n const { notFound, meta, path } = resolveRoute<{\n title?: string\n }>(config, currentPath)\n\n return notFound\n ? { text: path, link: path }\n : {\n text: meta.title || path,\n link: path,\n }\n}\n"],"mappings":"+CAiBA,MAAa,GACX,EACA,IACoB,CACpB,GAAM,CAAE,WAAU,OAAM,QAAS,EAE9B,EAAQ,EAAY,CAEvB,OAAO,EACH,CAAE,KAAM,EAAM,KAAM,EAAM,CAC1B,CACE,KAAM,EAAK,OAAS,EACpB,KAAM,EACP"}
@@ -0,0 +1,2 @@
1
+ import { n as resolveEditLink, t as EDIT_LINK_PATTERNS } from "../../resolveEditLink-DazcWeGf.js";
2
+ export { EDIT_LINK_PATTERNS, resolveEditLink };
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveEditLink.js","names":[],"sources":["../../../src/client/utils/resolveEditLink.ts"],"sourcesContent":["import {\n isLinkHttp,\n removeEndingSlash,\n removeLeadingSlash,\n} from 'vuepress/shared'\n\nimport type { RepoType } from '@theme/resolveRepoType'\nimport { resolveRepoType } from '@theme/resolveRepoType'\n\nexport const EDIT_LINK_PATTERNS: Record<Exclude<RepoType, null>, string> = {\n GitHub: ':repo/edit/:branch/:path',\n GitLab: ':repo/-/edit/:branch/:path',\n Gitee: ':repo/edit/:branch/:path',\n Bitbucket:\n ':repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default',\n}\n\nconst resolveEditLinkPatterns = ({\n docsRepo,\n editLinkPattern,\n}: {\n docsRepo: string\n editLinkPattern?: string\n}): string | null => {\n if (editLinkPattern) return editLinkPattern\n\n const repoType = resolveRepoType(docsRepo)\n if (repoType != null) return EDIT_LINK_PATTERNS[repoType]\n\n return null\n}\n\nexport const resolveEditLink = ({\n docsRepo,\n docsBranch,\n docsDir,\n filePathRelative,\n editLinkPattern,\n}: {\n docsRepo: string\n docsBranch: string\n docsDir: string\n filePathRelative: string | null\n editLinkPattern?: string\n}): string | null => {\n if (!filePathRelative) return null\n\n const pattern = resolveEditLinkPatterns({ docsRepo, editLinkPattern })\n if (!pattern) return null\n\n return pattern\n .replace(\n /:repo/,\n isLinkHttp(docsRepo) ? docsRepo : `https://github.com/${docsRepo}`,\n )\n .replace(/:branch/, docsBranch)\n .replace(\n /:path/,\n removeLeadingSlash(`${removeEndingSlash(docsDir)}/${filePathRelative}`),\n )\n}\n"],"mappings":"qJASA,MAAa,EAA8D,CACzE,OAAQ,2BACR,OAAQ,6BACR,MAAO,2BACP,UACE,kFACH,CAEK,GAA2B,CAC/B,WACA,qBAImB,CACnB,GAAI,EAAiB,OAAO,EAE5B,IAAM,EAAW,EAAgB,EAAS,CAG1C,OAFI,GAAY,KAET,KAFsB,EAAmB,IAKrC,GAAmB,CAC9B,WACA,aACA,UACA,mBACA,qBAOmB,CACnB,GAAI,CAAC,EAAkB,OAAO,KAE9B,IAAM,EAAU,EAAwB,CAAE,WAAU,kBAAiB,CAAC,CAGtE,OAFK,EAEE,EACJ,QACC,QACA,EAAW,EAAS,CAAG,EAAW,sBAAsB,IACzD,CACA,QAAQ,UAAW,EAAW,CAC9B,QACC,QACA,EAAmB,GAAG,EAAkB,EAAQ,CAAC,GAAG,IAAmB,CACxE,CAXkB"}
@@ -0,0 +1,2 @@
1
+ import { t as resolvePrefix } from "../../resolvePrefix-BN9K9RA5.js";
2
+ export { resolvePrefix };
@@ -0,0 +1,2 @@
1
+ import { n as resolveRepoType, t as RepoType } from "../../resolveRepoType-Wcj35_rs.js";
2
+ export { RepoType, resolveRepoType };
@@ -1,8 +1,8 @@
1
- import { i as SidebarItem } from "../../typings-jKn48KwS.js";
1
+ import { i as SidebarItem } from "./typings-NbQSzbOn.js";
2
2
  import { RouteLocationNormalizedLoaded } from "vuepress/client";
3
3
 
4
4
  //#region src/client/utils/isActiveSidebarItem.d.ts
5
5
  declare const isActiveSidebarItem: (item: SidebarItem, route: RouteLocationNormalizedLoaded) => boolean;
6
6
  //#endregion
7
- export { isActiveSidebarItem };
8
- //# sourceMappingURL=isActiveSidebarItem.d.ts.map
7
+ export { isActiveSidebarItem as t };
8
+ //# sourceMappingURL=isActiveSidebarItem-aythFTeC.d.ts.map
@@ -1,6 +1,6 @@
1
1
  import { n as NavItemOptions, t as AutoLinkOptions } from "../nav-DikslSJ_.js";
2
- import { a as SidebarObjectOptions, c as NavbarGroupOptions, i as SidebarLinkOptions, l as NavbarLinkOptions, n as SidebarGroupOptions, o as SidebarOptions, r as SidebarItemOptions, s as NavGroup, t as SidebarArrayOptions, u as NavbarOptions } from "../sidebar-FqrQ3PGy.js";
3
- import { a as DefaultThemeData, i as DefaultThemePageFrontmatter, n as DefaultThemeNormalPageFrontmatter, o as DefaultThemeLocaleData, r as DefaultThemePageData, s as DefaultThemeLocaleOptions, t as DefaultThemeHomePageFrontmatter } from "../page-F2gyvsdE.js";
2
+ import { a as SidebarObjectOptions, c as NavbarGroupOptions, i as SidebarLinkOptions, l as NavbarLinkOptions, n as SidebarGroupOptions, o as SidebarOptions, r as SidebarItemOptions, s as NavGroup, t as SidebarArrayOptions, u as NavbarOptions } from "../sidebar-CF1YPYLN.js";
3
+ import { a as DefaultThemeData, i as DefaultThemePageFrontmatter, n as DefaultThemeNormalPageFrontmatter, o as DefaultThemeLocaleData, r as DefaultThemePageData, s as DefaultThemeLocaleOptions, t as DefaultThemeHomePageFrontmatter } from "../page-FWcDnzJp.js";
4
4
  import { BackToTopPluginOptions } from "@vuepress/plugin-back-to-top";
5
5
  import { CopyCodePluginOptions } from "@vuepress/plugin-copy-code";
6
6
  import { GitPluginOptions } from "@vuepress/plugin-git";
@@ -88,6 +88,8 @@ declare const DEFAULT_LOCALE_OPTIONS: DefaultThemeLocaleOptions;
88
88
  declare const DEFAULT_LOCALE_DATA: DefaultThemeLocaleData;
89
89
  /**
90
90
  * Assign default options
91
+ *
92
+ * @param localeOptions - Locale options to assign default options
91
93
  */
92
94
  declare const assignDefaultLocaleOptions: (localeOptions: DefaultThemeLocaleOptions) => void;
93
95
  //#endregion
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/node/utils/assignDefaultLocaleOptions.ts","../../src/node/utils/resolveMarkdownHintLocales.ts","../../src/node/defaultTheme.ts"],"sourcesContent":["import type {\n DefaultThemeLocaleData,\n DefaultThemeLocaleOptions,\n} from '../../shared/index.js'\n\nexport const DEFAULT_LOCALE_OPTIONS: DefaultThemeLocaleOptions = {\n // color mode\n colorMode: 'auto',\n colorModeSwitch: true,\n\n // navbar\n navbar: [],\n logo: null,\n repo: null,\n selectLanguageText: 'Languages',\n selectLanguageAriaLabel: 'Select language',\n\n // sidebar\n sidebar: 'heading',\n sidebarDepth: 2,\n\n // page meta\n editLink: true,\n editLinkText: 'Edit this page',\n lastUpdated: true,\n contributors: true,\n contributorsText: 'Contributors',\n\n // 404 page messages\n notFound: [\n `There's nothing here.`,\n `How did we get here?`,\n `That's a Four-Oh-Four.`,\n `Looks like we've got some broken links.`,\n ],\n backToHome: 'Take me home',\n\n // a11y\n openInNewWindow: 'open in new window',\n toggleColorMode: 'toggle color mode',\n toggleSidebar: 'toggle sidebar',\n}\n\nexport const DEFAULT_LOCALE_DATA: DefaultThemeLocaleData = {\n // navbar\n selectLanguageName: 'English',\n}\n\n/**\n * Assign default options\n *\n * @param localeOptions - Locale options to assign default options\n */\nexport const assignDefaultLocaleOptions = (\n localeOptions: DefaultThemeLocaleOptions,\n): void => {\n localeOptions.locales ??= {}\n Object.assign(localeOptions, {\n ...DEFAULT_LOCALE_OPTIONS,\n ...localeOptions,\n })\n localeOptions.locales['/'] ??= {}\n Object.assign(localeOptions.locales['/'], {\n ...DEFAULT_LOCALE_DATA,\n ...localeOptions.locales['/'],\n })\n}\n","import type { MarkdownHintPluginLocaleData } from '@vuepress/plugin-markdown-hint'\nimport type { LocaleConfig } from 'vuepress/shared'\n\nimport type { DefaultThemeData } from '../../shared/index.js'\n\n/**\n * Resolve options for `@vuepress/plugin-markdown-container`\n *\n * For custom containers default title\n *\n * @param localeOptions - Locales config from theme options\n * @returns Locales config for `@vuepress/plugin-markdown-container`\n */\nexport const resolveMarkdownHintLocales = (\n localeOptions: DefaultThemeData,\n): LocaleConfig<MarkdownHintPluginLocaleData> =>\n Object.entries(localeOptions.locales ?? {}).reduce<\n LocaleConfig<MarkdownHintPluginLocaleData>\n >((result, [key, value]) => {\n result[key] = {}\n\n if (value.tip) result[key].tip = value.tip\n if (value.warning) result[key].warning = value.warning\n if (value.danger) result[key].caution = value.danger\n if (value.important) result[key].important = value.important\n if (value.note) result[key].note = value.note\n\n return result\n }, {})\n","import { addViteOptimizeDepsExclude } from '@vuepress/helper'\nimport { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links'\nimport { backToTopPlugin } from '@vuepress/plugin-back-to-top'\nimport { copyCodePlugin } from '@vuepress/plugin-copy-code'\nimport { gitPlugin } from '@vuepress/plugin-git'\nimport { linksCheckPlugin } from '@vuepress/plugin-links-check'\nimport { markdownHintPlugin } from '@vuepress/plugin-markdown-hint'\nimport { markdownTabPlugin } from '@vuepress/plugin-markdown-tab'\nimport { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom'\nimport { nprogressPlugin } from '@vuepress/plugin-nprogress'\nimport { palettePlugin } from '@vuepress/plugin-palette'\nimport { prismjsPlugin } from '@vuepress/plugin-prismjs'\nimport { seoPlugin } from '@vuepress/plugin-seo'\nimport { sitemapPlugin } from '@vuepress/plugin-sitemap'\nimport { themeDataPlugin } from '@vuepress/plugin-theme-data'\nimport type { Page, Theme } from 'vuepress/core'\nimport { isPlainObject } from 'vuepress/shared'\nimport { fs, getDirname, path } from 'vuepress/utils'\n\nimport type {\n DefaultThemeLocaleOptions,\n DefaultThemePageData,\n} from '../shared/index.js'\nimport type { DefaultThemePluginsOptions } from './typings.js'\nimport {\n assignDefaultLocaleOptions,\n resolveMarkdownHintLocales,\n} from './utils/index.js'\n\nconst __dirname = import.meta.dirname || getDirname(import.meta.url)\n\nexport interface DefaultThemeOptions extends DefaultThemeLocaleOptions {\n /**\n * deployed hostname\n */\n hostname?: string\n\n /**\n * To avoid confusion with the root `plugins` option,\n * we use `themePlugins`\n */\n themePlugins?: DefaultThemePluginsOptions\n}\n\nexport const defaultTheme = ({\n hostname,\n themePlugins = {},\n ...localeOptions\n}: DefaultThemeOptions = {}): Theme => {\n assignDefaultLocaleOptions(localeOptions)\n\n return {\n name: '@vuepress/theme-default',\n\n templateBuild: path.resolve(__dirname, '../../templates/build.html'),\n\n alias: {\n // use alias to make all components replaceable\n ...Object.fromEntries(\n fs\n .readdirSync(path.resolve(__dirname, '../client/components'))\n .filter((file) => file.endsWith('.vue'))\n .map((file) => [\n `@theme/${file}`,\n path.resolve(__dirname, '../client/components', file),\n ]),\n ),\n // use alias to make all composables replaceable\n ...Object.fromEntries(\n fs\n .readdirSync(path.resolve(__dirname, '../client/composables'))\n .filter((file) => file.endsWith('.js'))\n .map((file) => [\n `@theme/${file.slice(0, -3)}`,\n path.resolve(__dirname, '../client/composables', file),\n ]),\n ),\n // use alias to make all utils replaceable\n ...Object.fromEntries(\n fs\n .readdirSync(path.resolve(__dirname, '../client/utils'))\n .filter((file) => file.endsWith('.js'))\n .map((file) => [\n `@theme/${file.slice(0, -3)}`,\n path.resolve(__dirname, '../client/utils', file),\n ]),\n ),\n },\n\n clientConfigFile: path.resolve(__dirname, '../client/config.js'),\n\n extendsBundlerOptions: (bundlerOptions, app) => {\n // ensure theme alias is not optimized by Vite\n addViteOptimizeDepsExclude(bundlerOptions, app, '@theme')\n },\n\n extendsPage: (page: Page<Partial<DefaultThemePageData>>) => {\n // save relative file path into page data to generate edit link\n page.data.filePathRelative = page.filePathRelative\n // save title into route meta to generate navbar and sidebar\n page.routeMeta.title = page.title\n },\n\n plugins: [\n // @vuepress/plugin-active-header-link\n (themePlugins.activeHeaderLinks ?? true)\n ? activeHeaderLinksPlugin({\n // should greater than page transition duration\n delay: 300,\n })\n : [],\n\n // @vuepress/plugin-back-to-top\n (themePlugins.backToTop ?? true)\n ? backToTopPlugin(\n isPlainObject(themePlugins.backToTop) ? themePlugins.backToTop : {},\n )\n : [],\n\n // @vuepress/plugin-copy-code\n (themePlugins.copyCode ?? true)\n ? copyCodePlugin({\n ...(isPlainObject(themePlugins.copyCode)\n ? themePlugins.copyCode\n : {}),\n })\n : [],\n\n // @vuepress/plugin-markdown-container\n (themePlugins.hint ?? true)\n ? markdownHintPlugin({\n locales: resolveMarkdownHintLocales(localeOptions),\n ...(isPlainObject(themePlugins.hint) ? themePlugins.hint : {}),\n })\n : [],\n\n // @vuepress/plugin-git\n (themePlugins.git ?? true)\n ? gitPlugin({\n createdTime: false,\n updatedTime: localeOptions.lastUpdated ?? true,\n changelog: { repoUrl: localeOptions.repo || '' },\n ...(isPlainObject(themePlugins.git) ? themePlugins.git : {}),\n })\n : [],\n\n // @vuepress/plugin-links-check\n (themePlugins.linksCheck ?? true)\n ? linksCheckPlugin(\n isPlainObject(themePlugins.linksCheck)\n ? themePlugins.linksCheck\n : {},\n )\n : [],\n\n // @vuepress/plugin-medium-zoom\n (themePlugins.mediumZoom ?? true) ? mediumZoomPlugin() : [],\n\n // @vuepress/plugin-nprogress\n (themePlugins.nprogress ?? true) ? nprogressPlugin() : [],\n\n // @vuepress/plugin-palette\n palettePlugin({ preset: 'sass' }),\n\n // @vuepress/plugin-prismjs\n (themePlugins.prismjs ?? true)\n ? prismjsPlugin(\n isPlainObject(themePlugins.prismjs) ? themePlugins.prismjs : {},\n )\n : [],\n\n // @vuepress/plugin-seo\n hostname && (themePlugins.seo ?? true)\n ? seoPlugin({\n hostname,\n ...(isPlainObject(themePlugins.seo) ? themePlugins.seo : {}),\n })\n : [],\n\n // @vuepress/plugin-sitemap\n hostname && (themePlugins.sitemap ?? true)\n ? sitemapPlugin({\n hostname,\n ...(isPlainObject(themePlugins.sitemap)\n ? themePlugins.sitemap\n : {}),\n })\n : [],\n\n // @vuepress/plugin-markdown-tab\n (themePlugins.tab ?? true)\n ? markdownTabPlugin(\n isPlainObject(themePlugins.tab)\n ? themePlugins.tab\n : { codeTabs: true, tabs: true },\n )\n : [],\n\n // @vuepress/plugin-theme-data\n themeDataPlugin({ themeData: localeOptions }),\n ],\n }\n}\n"],"mappings":"ogCAKA,MAAa,EAAoD,CAE/D,UAAW,OACX,gBAAiB,GAGjB,OAAQ,EAAE,CACV,KAAM,KACN,KAAM,KACN,mBAAoB,YACpB,wBAAyB,kBAGzB,QAAS,UACT,aAAc,EAGd,SAAU,GACV,aAAc,iBACd,YAAa,GACb,aAAc,GACd,iBAAkB,eAGlB,SAAU,CACR,wBACA,uBACA,yBACA,0CACD,CACD,WAAY,eAGZ,gBAAiB,qBACjB,gBAAiB,oBACjB,cAAe,iBAChB,CAEY,EAA8C,CAEzD,mBAAoB,UACrB,CAOY,EACX,GACS,CACT,EAAc,UAAY,EAAE,CAC5B,OAAO,OAAO,EAAe,CAC3B,GAAG,EACH,GAAG,EACJ,CAAC,CACF,EAAc,QAAQ,OAAS,EAAE,CACjC,OAAO,OAAO,EAAc,QAAQ,KAAM,CACxC,GAAG,EACH,GAAG,EAAc,QAAQ,KAC1B,CAAC,ECpDS,EACX,GAEA,OAAO,QAAQ,EAAc,SAAW,EAAE,CAAC,CAAC,QAEzC,EAAQ,CAAC,EAAK,MACf,EAAO,GAAO,EAAE,CAEZ,EAAM,MAAK,EAAO,GAAK,IAAM,EAAM,KACnC,EAAM,UAAS,EAAO,GAAK,QAAU,EAAM,SAC3C,EAAM,SAAQ,EAAO,GAAK,QAAU,EAAM,QAC1C,EAAM,YAAW,EAAO,GAAK,UAAY,EAAM,WAC/C,EAAM,OAAM,EAAO,GAAK,KAAO,EAAM,MAElC,GACN,EAAE,CAAC,CCCF,EAAY,OAAO,KAAK,SAAW,EAAW,OAAO,KAAK,IAAI,CAevD,GAAgB,CAC3B,WACA,eAAe,EAAE,CACjB,GAAG,GACoB,EAAE,IACzB,EAA2B,EAAc,CAElC,CACL,KAAM,0BAEN,cAAe,EAAK,QAAQ,EAAW,6BAA6B,CAEpE,MAAO,CAEL,GAAG,OAAO,YACR,EACG,YAAY,EAAK,QAAQ,EAAW,uBAAuB,CAAC,CAC5D,OAAQ,GAAS,EAAK,SAAS,OAAO,CAAC,CACvC,IAAK,GAAS,CACb,UAAU,IACV,EAAK,QAAQ,EAAW,uBAAwB,EAAK,CACtD,CAAC,CACL,CAED,GAAG,OAAO,YACR,EACG,YAAY,EAAK,QAAQ,EAAW,wBAAwB,CAAC,CAC7D,OAAQ,GAAS,EAAK,SAAS,MAAM,CAAC,CACtC,IAAK,GAAS,CACb,UAAU,EAAK,MAAM,EAAG,GAAG,GAC3B,EAAK,QAAQ,EAAW,wBAAyB,EAAK,CACvD,CAAC,CACL,CAED,GAAG,OAAO,YACR,EACG,YAAY,EAAK,QAAQ,EAAW,kBAAkB,CAAC,CACvD,OAAQ,GAAS,EAAK,SAAS,MAAM,CAAC,CACtC,IAAK,GAAS,CACb,UAAU,EAAK,MAAM,EAAG,GAAG,GAC3B,EAAK,QAAQ,EAAW,kBAAmB,EAAK,CACjD,CAAC,CACL,CACF,CAED,iBAAkB,EAAK,QAAQ,EAAW,sBAAsB,CAEhE,uBAAwB,EAAgB,IAAQ,CAE9C,EAA2B,EAAgB,EAAK,SAAS,EAG3D,YAAc,GAA8C,CAE1D,EAAK,KAAK,iBAAmB,EAAK,iBAElC,EAAK,UAAU,MAAQ,EAAK,OAG9B,QAAS,CAEN,EAAa,mBAAqB,GAC/B,EAAwB,CAEtB,MAAO,IACR,CAAC,CACF,EAAE,CAGL,EAAa,WAAa,GACvB,EACE,EAAc,EAAa,UAAU,CAAG,EAAa,UAAY,EAAE,CACpE,CACD,EAAE,CAGL,EAAa,UAAY,GACtB,EAAe,CACb,GAAI,EAAc,EAAa,SAAS,CACpC,EAAa,SACb,EAAE,CACP,CAAC,CACF,EAAE,CAGL,EAAa,MAAQ,GAClB,EAAmB,CACjB,QAAS,EAA2B,EAAc,CAClD,GAAI,EAAc,EAAa,KAAK,CAAG,EAAa,KAAO,EAAE,CAC9D,CAAC,CACF,EAAE,CAGL,EAAa,KAAO,GACjB,EAAU,CACR,YAAa,GACb,YAAa,EAAc,aAAe,GAC1C,UAAW,CAAE,QAAS,EAAc,MAAQ,GAAI,CAChD,GAAI,EAAc,EAAa,IAAI,CAAG,EAAa,IAAM,EAAE,CAC5D,CAAC,CACF,EAAE,CAGL,EAAa,YAAc,GACxB,EACE,EAAc,EAAa,WAAW,CAClC,EAAa,WACb,EAAE,CACP,CACD,EAAE,CAGL,EAAa,YAAc,GAAQ,GAAkB,CAAG,EAAE,CAG1D,EAAa,WAAa,GAAQ,GAAiB,CAAG,EAAE,CAGzD,EAAc,CAAE,OAAQ,OAAQ,CAAC,CAGhC,EAAa,SAAW,GACrB,EACE,EAAc,EAAa,QAAQ,CAAG,EAAa,QAAU,EAAE,CAChE,CACD,EAAE,CAGN,IAAa,EAAa,KAAO,IAC7B,EAAU,CACR,WACA,GAAI,EAAc,EAAa,IAAI,CAAG,EAAa,IAAM,EAAE,CAC5D,CAAC,CACF,EAAE,CAGN,IAAa,EAAa,SAAW,IACjC,EAAc,CACZ,WACA,GAAI,EAAc,EAAa,QAAQ,CACnC,EAAa,QACb,EAAE,CACP,CAAC,CACF,EAAE,CAGL,EAAa,KAAO,GACjB,EACE,EAAc,EAAa,IAAI,CAC3B,EAAa,IACb,CAAE,SAAU,GAAM,KAAM,GAAM,CACnC,CACD,EAAE,CAGN,EAAgB,CAAE,UAAW,EAAe,CAAC,CAC9C,CACF"}
@@ -1,5 +1,5 @@
1
1
  import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
2
- import { o as SidebarOptions, t as SidebarArrayOptions, u as NavbarOptions } from "./sidebar-FqrQ3PGy.js";
2
+ import { o as SidebarOptions, t as SidebarArrayOptions, u as NavbarOptions } from "./sidebar-CF1YPYLN.js";
3
3
  import { GitPluginPageData } from "@vuepress/plugin-git";
4
4
  import { ThemeData } from "@vuepress/plugin-theme-data";
5
5
  import { LocaleData, PageFrontmatter } from "vuepress/shared";
@@ -289,4 +289,4 @@ interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter
289
289
  }
290
290
  //#endregion
291
291
  export { DefaultThemeData as a, DefaultThemePageFrontmatter as i, DefaultThemeNormalPageFrontmatter as n, DefaultThemeLocaleData as o, DefaultThemePageData as r, DefaultThemeLocaleOptions as s, DefaultThemeHomePageFrontmatter as t };
292
- //# sourceMappingURL=page-F2gyvsdE.d.ts.map
292
+ //# sourceMappingURL=page-FWcDnzJp.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as AutoLinkOptions } from "../../nav-DikslSJ_.js";
1
+ import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
2
2
 
3
3
  //#region src/client/utils/resolveAutoLink.d.ts
4
4
  /**
@@ -16,5 +16,5 @@ import { t as AutoLinkOptions } from "../../nav-DikslSJ_.js";
16
16
  */
17
17
  declare const resolveAutoLink: (config: string, currentPath?: string) => AutoLinkOptions;
18
18
  //#endregion
19
- export { resolveAutoLink };
20
- //# sourceMappingURL=resolveAutoLink.d.ts.map
19
+ export { resolveAutoLink as t };
20
+ //# sourceMappingURL=resolveAutoLink-BR2Z05MD.d.ts.map
@@ -16,5 +16,5 @@ declare const resolveEditLink: ({
16
16
  editLinkPattern?: string;
17
17
  }) => string | null;
18
18
  //#endregion
19
- export { EDIT_LINK_PATTERNS, resolveEditLink };
20
- //# sourceMappingURL=resolveEditLink.d.ts.map
19
+ export { resolveEditLink as n, EDIT_LINK_PATTERNS as t };
20
+ //# sourceMappingURL=resolveEditLink-DazcWeGf.d.ts.map
@@ -1,5 +1,5 @@
1
1
  //#region src/client/utils/resolvePrefix.d.ts
2
2
  declare const resolvePrefix: (prefix?: string, path?: string) => string;
3
3
  //#endregion
4
- export { resolvePrefix };
5
- //# sourceMappingURL=resolvePrefix.d.ts.map
4
+ export { resolvePrefix as t };
5
+ //# sourceMappingURL=resolvePrefix-BN9K9RA5.d.ts.map
@@ -2,5 +2,5 @@
2
2
  type RepoType = 'Bitbucket' | 'Gitee' | 'GitHub' | 'GitLab' | null;
3
3
  declare const resolveRepoType: (repo: string) => RepoType;
4
4
  //#endregion
5
- export { RepoType, resolveRepoType };
6
- //# sourceMappingURL=resolveRepoType.d.ts.map
5
+ export { resolveRepoType as n, RepoType as t };
6
+ //# sourceMappingURL=resolveRepoType-Wcj35_rs.d.ts.map
@@ -50,4 +50,4 @@ type SidebarObjectOptions = Record<string, SidebarArrayOptions | 'heading' | fal
50
50
  type SidebarOptions = SidebarArrayOptions | SidebarObjectOptions | 'heading';
51
51
  //#endregion
52
52
  export { SidebarObjectOptions as a, NavbarGroupOptions as c, SidebarLinkOptions as i, NavbarLinkOptions as l, SidebarGroupOptions as n, SidebarOptions as o, SidebarItemOptions as r, NavGroup as s, SidebarArrayOptions as t, NavbarOptions as u };
53
- //# sourceMappingURL=sidebar-FqrQ3PGy.d.ts.map
53
+ //# sourceMappingURL=sidebar-CF1YPYLN.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
2
- import { i as SidebarLinkOptions, n as SidebarGroupOptions, s as NavGroup } from "./sidebar-FqrQ3PGy.js";
2
+ import { i as SidebarLinkOptions, n as SidebarGroupOptions, s as NavGroup } from "./sidebar-CF1YPYLN.js";
3
3
 
4
4
  //#region src/client/typings.d.ts
5
5
  type NavbarItem = AutoLinkOptions | NavGroup<NavbarItem>;
@@ -16,4 +16,4 @@ interface SidebarGroupItem extends SidebarGroupOptions {
16
16
  type SidebarItem = SidebarGroupItem | SidebarLinkItem;
17
17
  //#endregion
18
18
  export { SidebarLinkItem as a, SidebarItem as i, SidebarGroupItem as n, SidebarHeaderItem as r, NavbarItem as t };
19
- //# sourceMappingURL=typings-jKn48KwS.d.ts.map
19
+ //# sourceMappingURL=typings-NbQSzbOn.d.ts.map
@@ -15,5 +15,5 @@ declare const useDarkMode: () => DarkModeRef;
15
15
  */
16
16
  declare const setupDarkMode: () => void;
17
17
  //#endregion
18
- export { DarkModeRef, setupDarkMode, useDarkMode };
19
- //# sourceMappingURL=useDarkMode.d.ts.map
18
+ export { setupDarkMode as n, useDarkMode as r, DarkModeRef as t };
19
+ //# sourceMappingURL=useDarkMode-DLor2cV7.d.ts.map
@@ -1,4 +1,4 @@
1
- import { a as DefaultThemeData, n as DefaultThemeNormalPageFrontmatter, r as DefaultThemePageData } from "../../page-F2gyvsdE.js";
1
+ import { a as DefaultThemeData, n as DefaultThemeNormalPageFrontmatter, r as DefaultThemePageData } from "./page-FWcDnzJp.js";
2
2
  import { ClientData } from "vuepress/client";
3
3
  import { ThemeDataRef, ThemeLocaleDataRef } from "@vuepress/plugin-theme-data/client";
4
4
 
@@ -7,7 +7,7 @@ interface Data<PageFrontmatter extends Record<string, unknown> = DefaultThemeNor
7
7
  theme: ThemeDataRef<DefaultThemeData>;
8
8
  themeLocale: ThemeLocaleDataRef<DefaultThemeData>;
9
9
  }
10
- declare const useData: <PageFrontmatter extends Record<string, unknown> = DefaultThemeNormalPageFrontmatter, PageData extends Record<string, unknown> = DefaultThemePageData>() => Data<PageFrontmatter, PageData>;
10
+ declare const useData$1: <PageFrontmatter extends Record<string, unknown> = DefaultThemeNormalPageFrontmatter, PageData extends Record<string, unknown> = DefaultThemePageData>() => Data<PageFrontmatter, PageData>;
11
11
  //#endregion
12
- export { Data, useData };
13
- //# sourceMappingURL=useData.d.ts.map
12
+ export { useData$1 as n, Data as t };
13
+ //# sourceMappingURL=useData-JDen_Bxm.d.ts.map
@@ -4,5 +4,5 @@ import { ComputedRef } from "vue";
4
4
  //#region src/client/composables/useEditLink.d.ts
5
5
  declare const useEditLink: () => ComputedRef<AutoLinkConfig | null>;
6
6
  //#endregion
7
- export { useEditLink };
8
- //# sourceMappingURL=useEditLink.d.ts.map
7
+ export { useEditLink as t };
8
+ //# sourceMappingURL=useEditLink-DPCTvXmM.d.ts.map
@@ -1,8 +1,8 @@
1
- import { t as NavbarItem } from "../../typings-jKn48KwS.js";
1
+ import { t as NavbarItem } from "./typings-NbQSzbOn.js";
2
2
  import { ComputedRef } from "vue";
3
3
 
4
4
  //#region src/client/composables/useNavbarConfig.d.ts
5
5
  declare const useNavbarConfig: () => ComputedRef<NavbarItem[]>;
6
6
  //#endregion
7
- export { useNavbarConfig };
8
- //# sourceMappingURL=useNavbarConfig.d.ts.map
7
+ export { useNavbarConfig as t };
8
+ //# sourceMappingURL=useNavbarConfig-C19TGFg7.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as NavbarItem } from "../../typings-jKn48KwS.js";
1
+ import { t as NavbarItem } from "./typings-NbQSzbOn.js";
2
2
  import { ComputedRef } from "vue";
3
3
 
4
4
  //#region src/client/composables/useNavbarRepo.d.ts
@@ -9,5 +9,5 @@ import { ComputedRef } from "vue";
9
9
  */
10
10
  declare const useNavbarRepo: () => ComputedRef<NavbarItem[]>;
11
11
  //#endregion
12
- export { useNavbarRepo };
13
- //# sourceMappingURL=useNavbarRepo.d.ts.map
12
+ export { useNavbarRepo as t };
13
+ //# sourceMappingURL=useNavbarRepo-DxhSIAFq.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as NavbarItem } from "../../typings-jKn48KwS.js";
1
+ import { t as NavbarItem } from "./typings-NbQSzbOn.js";
2
2
  import { ComputedRef } from "vue";
3
3
 
4
4
  //#region src/client/composables/useNavbarSelectLanguage.d.ts
@@ -9,5 +9,5 @@ import { ComputedRef } from "vue";
9
9
  */
10
10
  declare const useNavbarSelectLanguage: () => ComputedRef<NavbarItem[]>;
11
11
  //#endregion
12
- export { useNavbarSelectLanguage };
13
- //# sourceMappingURL=useNavbarSelectLanguage.d.ts.map
12
+ export { useNavbarSelectLanguage as t };
13
+ //# sourceMappingURL=useNavbarSelectLanguage-4GkrPvc2.d.ts.map
@@ -1,5 +1,5 @@
1
1
  //#region src/client/composables/useNavigate.d.ts
2
2
  declare const useNavigate: () => ((url: string) => void);
3
3
  //#endregion
4
- export { useNavigate };
5
- //# sourceMappingURL=useNavigate.d.ts.map
4
+ export { useNavigate as t };
5
+ //# sourceMappingURL=useNavigate-lH4xyHOV.d.ts.map
@@ -1,4 +1,4 @@
1
- import { t as AutoLinkOptions } from "../../nav-DikslSJ_.js";
1
+ import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
2
2
  import { ComputedRef } from "vue";
3
3
 
4
4
  //#region src/client/composables/useRelatedLinks.d.ts
@@ -8,5 +8,5 @@ interface RelatedLinks {
8
8
  }
9
9
  declare const useRelatedLinks: () => RelatedLinks;
10
10
  //#endregion
11
- export { useRelatedLinks };
12
- //# sourceMappingURL=useRelatedLinks.d.ts.map
11
+ export { useRelatedLinks as t };
12
+ //# sourceMappingURL=useRelatedLinks-ChTW2RRU.d.ts.map
@@ -6,5 +6,5 @@ interface ScrollPromise {
6
6
  }
7
7
  declare const useScrollPromise: () => ScrollPromise;
8
8
  //#endregion
9
- export { ScrollPromise, useScrollPromise };
10
- //# sourceMappingURL=useScrollPromise.d.ts.map
9
+ export { useScrollPromise as n, ScrollPromise as t };
10
+ //# sourceMappingURL=useScrollPromise-BAl732Uv.d.ts.map
@@ -1,5 +1,5 @@
1
- import { a as SidebarObjectOptions, o as SidebarOptions, t as SidebarArrayOptions } from "../../sidebar-FqrQ3PGy.js";
2
- import { i as SidebarItem, r as SidebarHeaderItem } from "../../typings-jKn48KwS.js";
1
+ import { a as SidebarObjectOptions, o as SidebarOptions, t as SidebarArrayOptions } from "./sidebar-CF1YPYLN.js";
2
+ import { i as SidebarItem, r as SidebarHeaderItem } from "./typings-NbQSzbOn.js";
3
3
  import { PageData, PageHeader } from "vuepress/client";
4
4
  import { ComputedRef, InjectionKey } from "vue";
5
5
 
@@ -76,5 +76,5 @@ declare const resolveSidebarItems: (sidebarConfig: SidebarOptions | false, page:
76
76
  */
77
77
  declare const setupSidebarItems: () => void;
78
78
  //#endregion
79
- export { SidebarItemsRef, resolveArraySidebarItems, resolveMultiSidebarItems, resolveSidebarHeadingItem, resolveSidebarItems, resolveSidebarPageHeader, resolveSidebarPageHeaders, setupSidebarItems, sidebarItemsSymbol, useSidebarItems };
80
- //# sourceMappingURL=useSidebarItems.d.ts.map
79
+ export { resolveSidebarItems as a, setupSidebarItems as c, resolveSidebarHeadingItem as i, sidebarItemsSymbol as l, resolveArraySidebarItems as n, resolveSidebarPageHeader as o, resolveMultiSidebarItems as r, resolveSidebarPageHeaders as s, SidebarItemsRef as t, useSidebarItems as u };
80
+ //# sourceMappingURL=useSidebarItems-CdpB96Ta.d.ts.map
@@ -10,5 +10,5 @@ declare enum DeviceType {
10
10
  */
11
11
  declare const useUpdateDeviceStatus: (deviceType: DeviceType, callback: (width: number) => void) => void;
12
12
  //#endregion
13
- export { DeviceType, useUpdateDeviceStatus };
14
- //# sourceMappingURL=useUpdateDeviceStatus.d.ts.map
13
+ export { useUpdateDeviceStatus as n, DeviceType as t };
14
+ //# sourceMappingURL=useUpdateDeviceStatus-SBnOZx8J.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-rc.124",
3
+ "version": "2.0.0-rc.126",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "default",
@@ -20,63 +20,63 @@
20
20
  "directory": "themes/theme-default"
21
21
  },
22
22
  "files": [
23
- "lib",
23
+ "dist",
24
24
  "templates"
25
25
  ],
26
26
  "type": "module",
27
27
  "sideEffects": [
28
- "./lib/client/components/**/*.vue",
29
- "./lib/client/layouts/*.vue",
30
- "./lib/client/styles/*.scss"
28
+ "./dist/client/components/**/*.vue",
29
+ "./dist/client/layouts/*.vue",
30
+ "./dist/client/styles/*.scss"
31
31
  ],
32
- "main": "./lib/node/index.js",
33
- "types": "./lib/node/index.d.ts",
32
+ "main": "./dist/node/index.js",
33
+ "types": "./dist/node/index.d.ts",
34
34
  "exports": {
35
35
  ".": {
36
- "types": "./lib/node/index.d.ts",
37
- "default": "./lib/node/index.js"
36
+ "types": "./dist/node/index.d.ts",
37
+ "default": "./dist/node/index.js"
38
38
  },
39
39
  "./client": {
40
- "types": "./lib/client/index.d.ts",
41
- "default": "./lib/client/index.js"
40
+ "types": "./dist/client/index.d.ts",
41
+ "default": "./dist/client/index.js"
42
42
  },
43
- "./components/*": "./lib/client/components/*",
44
- "./layouts/*": "./lib/client/layouts/*",
43
+ "./components/*": "./dist/client/components/*",
44
+ "./layouts/*": "./dist/client/layouts/*",
45
+ "./styles/*.scss": "./dist/client/styles/*.scss",
45
46
  "./styles/*": {
46
- "sass": "./lib/client/styles/*.scss",
47
- "default": "./lib/client/styles/*"
47
+ "sass": "./dist/client/styles/*.scss"
48
48
  },
49
49
  "./templates/*": "./templates/*",
50
- "./lib/*": "./lib/*",
50
+ "./dist/*": "./dist/*",
51
51
  "./package.json": "./package.json"
52
52
  },
53
53
  "publishConfig": {
54
54
  "access": "public"
55
55
  },
56
56
  "dependencies": {
57
- "@vuepress/helper": "2.0.0-rc.124",
58
- "@vuepress/plugin-active-header-links": "2.0.0-rc.124",
59
- "@vuepress/plugin-back-to-top": "2.0.0-rc.124",
60
- "@vuepress/plugin-copy-code": "2.0.0-rc.124",
61
- "@vuepress/plugin-git": "2.0.0-rc.124",
62
- "@vuepress/plugin-links-check": "2.0.0-rc.124",
63
- "@vuepress/plugin-markdown-hint": "2.0.0-rc.124",
64
- "@vuepress/plugin-markdown-tab": "2.0.0-rc.124",
65
- "@vuepress/plugin-medium-zoom": "2.0.0-rc.124",
66
- "@vuepress/plugin-nprogress": "2.0.0-rc.124",
67
- "@vuepress/plugin-palette": "2.0.0-rc.124",
68
- "@vuepress/plugin-prismjs": "2.0.0-rc.124",
69
- "@vuepress/plugin-seo": "2.0.0-rc.124",
70
- "@vuepress/plugin-sitemap": "2.0.0-rc.124",
71
- "@vuepress/plugin-theme-data": "2.0.0-rc.124",
57
+ "@vuepress/helper": "2.0.0-rc.126",
58
+ "@vuepress/plugin-active-header-links": "2.0.0-rc.126",
59
+ "@vuepress/plugin-back-to-top": "2.0.0-rc.126",
60
+ "@vuepress/plugin-copy-code": "2.0.0-rc.126",
61
+ "@vuepress/plugin-git": "2.0.0-rc.126",
62
+ "@vuepress/plugin-links-check": "2.0.0-rc.126",
63
+ "@vuepress/plugin-markdown-hint": "2.0.0-rc.126",
64
+ "@vuepress/plugin-markdown-tab": "2.0.0-rc.126",
65
+ "@vuepress/plugin-medium-zoom": "2.0.0-rc.126",
66
+ "@vuepress/plugin-nprogress": "2.0.0-rc.126",
67
+ "@vuepress/plugin-palette": "2.0.0-rc.126",
68
+ "@vuepress/plugin-prismjs": "2.0.0-rc.126",
69
+ "@vuepress/plugin-seo": "2.0.0-rc.126",
70
+ "@vuepress/plugin-sitemap": "2.0.0-rc.126",
71
+ "@vuepress/plugin-theme-data": "2.0.0-rc.126",
72
72
  "@vueuse/core": "^14.2.1",
73
- "vue": "^3.5.29"
73
+ "vue": "^3.5.31"
74
74
  },
75
75
  "peerDependencies": {
76
- "sass": "^1.97.3",
77
- "sass-embedded": "^1.97.3",
76
+ "sass": "^1.98.0",
77
+ "sass-embedded": "^1.98.0",
78
78
  "sass-loader": "^16.0.7",
79
- "vuepress": "2.0.0-rc.26"
79
+ "vuepress": "2.0.0-rc.27"
80
80
  },
81
81
  "peerDependenciesMeta": {
82
82
  "sass": {
@@ -89,5 +89,5 @@
89
89
  "optional": true
90
90
  }
91
91
  },
92
- "gitHead": "f17e7479b1ef3c06814b6107df9188ba351702da"
92
+ "gitHead": "3ff37676288f188ca791287db55a55b57ec062d0"
93
93
  }
@@ -1,12 +0,0 @@
1
- import { DarkModeRef, setupDarkMode, useDarkMode } from "./useDarkMode.js";
2
- import { Data, useData } from "./useData.js";
3
- import { useEditLink } from "./useEditLink.js";
4
- import { useNavigate } from "./useNavigate.js";
5
- import { useNavbarConfig } from "./useNavbarConfig.js";
6
- import { useNavbarRepo } from "./useNavbarRepo.js";
7
- import { useNavbarSelectLanguage } from "./useNavbarSelectLanguage.js";
8
- import { useRelatedLinks } from "./useRelatedLinks.js";
9
- import { ScrollPromise, useScrollPromise } from "./useScrollPromise.js";
10
- import { SidebarItemsRef, resolveArraySidebarItems, resolveMultiSidebarItems, resolveSidebarHeadingItem, resolveSidebarItems, resolveSidebarPageHeader, resolveSidebarPageHeaders, setupSidebarItems, sidebarItemsSymbol, useSidebarItems } from "./useSidebarItems.js";
11
- import { DeviceType, useUpdateDeviceStatus } from "./useUpdateDeviceStatus.js";
12
- export { DarkModeRef, Data, DeviceType, ScrollPromise, SidebarItemsRef, resolveArraySidebarItems, resolveMultiSidebarItems, resolveSidebarHeadingItem, resolveSidebarItems, resolveSidebarPageHeader, resolveSidebarPageHeaders, setupDarkMode, setupSidebarItems, sidebarItemsSymbol, useDarkMode, useData, useEditLink, useNavbarConfig, useNavbarRepo, useNavbarSelectLanguage, useNavigate, useRelatedLinks, useScrollPromise, useSidebarItems, useUpdateDeviceStatus };
@@ -1,2 +0,0 @@
1
- import{darkModeSymbol as e}from"@vuepress/helper/client";import{useData as t}from"@theme/useData";import{usePreferredDark as n,useStorage as r,watchImmediate as i}from"@vueuse/core";import{computed as a,inject as o,onMounted as s,onUnmounted as c,provide as l}from"vue";const u=e=>{let t=globalThis.document.documentElement;t.dataset.theme=e?`dark`:`light`},d=e=>{s(()=>{i(e,u)}),c(()=>{u(e.value)})},f=()=>{let t=o(e);if(!t)throw Error(`useDarkMode() is called without provider.`);return t},p=()=>{let{themeLocale:i}=t(),o=n(),s=r(`vuepress-color-scheme`,i.value.colorMode),c=a({get(){return i.value.colorModeSwitch?s.value===`auto`?o.value:s.value===`dark`:i.value.colorMode===`dark`},set(e){e===o.value?s.value=`auto`:s.value=e?`dark`:`light`}});l(e,c),d(c)};export{p as setupDarkMode,f as useDarkMode};
2
- //# sourceMappingURL=useDarkMode.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useDarkMode.js","names":[],"sources":["../../../src/client/composables/useDarkMode.ts"],"sourcesContent":["import { useData } from '@theme/useData'\nimport { darkModeSymbol } from '@vuepress/helper/client'\nimport { usePreferredDark, useStorage, watchImmediate } from '@vueuse/core'\nimport type { WritableComputedRef } from 'vue'\nimport { computed, inject, onMounted, onUnmounted, provide } from 'vue'\n\nexport type DarkModeRef = WritableComputedRef<boolean>\n\nconst update = (value: boolean): void => {\n // set `class=\"dark\"` on `<html>` element\n const el = globalThis.document.documentElement\n\n // set `data-theme=\"light|dark\"` on `<html>` element\n el.dataset.theme = value ? 'dark' : 'light'\n}\n\nconst applyDarkModeToHTML = (isDarkMode: DarkModeRef): void => {\n onMounted(() => {\n watchImmediate(isDarkMode, update)\n })\n\n onUnmounted(() => {\n update(isDarkMode.value)\n })\n}\n\n/**\n * Inject dark mode global computed\n *\n * 注入暗色模式全局计算属性\n *\n * @returns Dark mode ref / 暗色模式引用\n */\nexport const useDarkMode = (): DarkModeRef => {\n const isDarkMode = inject<WritableComputedRef<boolean>>(darkModeSymbol)\n if (!isDarkMode) throw new Error('useDarkMode() is called without provider.')\n\n return isDarkMode\n}\n\n/**\n * Create dark mode ref and provide as global computed in setup\n */\nexport const setupDarkMode = (): void => {\n const { themeLocale } = useData()\n const isDarkPreferred = usePreferredDark()\n const darkStorage = useStorage(\n 'vuepress-color-scheme',\n themeLocale.value.colorMode,\n )\n\n const isDarkMode = computed<boolean>({\n get() {\n // disable color mode switching\n if (!themeLocale.value.colorModeSwitch)\n return themeLocale.value.colorMode === 'dark'\n\n // auto detected from prefers-color-scheme\n if (darkStorage.value === 'auto') return isDarkPreferred.value\n\n // storage value\n return darkStorage.value === 'dark'\n },\n set(val) {\n if (val === isDarkPreferred.value) darkStorage.value = 'auto'\n else darkStorage.value = val ? 'dark' : 'light'\n },\n })\n provide(darkModeSymbol, isDarkMode)\n\n applyDarkModeToHTML(isDarkMode)\n}\n"],"mappings":"8QAQA,MAAM,EAAU,GAAyB,CAEvC,IAAM,EAAK,WAAW,SAAS,gBAG/B,EAAG,QAAQ,MAAQ,EAAQ,OAAS,SAGhC,EAAuB,GAAkC,CAC7D,MAAgB,CACd,EAAe,EAAY,EAAO,EAClC,CAEF,MAAkB,CAChB,EAAO,EAAW,MAAM,EACxB,EAUS,MAAiC,CAC5C,IAAM,EAAa,EAAqC,EAAe,CACvE,GAAI,CAAC,EAAY,MAAU,MAAM,4CAA4C,CAE7E,OAAO,GAMI,MAA4B,CACvC,GAAM,CAAE,eAAgB,GAAS,CAC3B,EAAkB,GAAkB,CACpC,EAAc,EAClB,wBACA,EAAY,MAAM,UACnB,CAEK,EAAa,EAAkB,CACnC,KAAM,CASJ,OAPK,EAAY,MAAM,gBAInB,EAAY,QAAU,OAAe,EAAgB,MAGlD,EAAY,QAAU,OANpB,EAAY,MAAM,YAAc,QAQ3C,IAAI,EAAK,CACH,IAAQ,EAAgB,MAAO,EAAY,MAAQ,OAClD,EAAY,MAAQ,EAAM,OAAS,SAE3C,CAAC,CACF,EAAQ,EAAgB,EAAW,CAEnC,EAAoB,EAAW"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useData.js","names":["_useData"],"sources":["../../../src/client/composables/useData.ts"],"sourcesContent":["import type {\n ThemeDataRef,\n ThemeLocaleDataRef,\n} from '@vuepress/plugin-theme-data/client'\nimport {\n useThemeData,\n useThemeLocaleData,\n} from '@vuepress/plugin-theme-data/client'\nimport type { ClientData } from 'vuepress/client'\nimport { useData as _useData } from 'vuepress/client'\nimport type {\n DefaultThemeData,\n DefaultThemeNormalPageFrontmatter,\n DefaultThemePageData,\n} from '../../shared/index.js'\n\nexport interface Data<\n PageFrontmatter extends Record<string, unknown> =\n DefaultThemeNormalPageFrontmatter,\n PageData extends Record<string, unknown> = DefaultThemePageData,\n> extends Pick<\n ClientData<PageFrontmatter, PageData>,\n | 'frontmatter'\n | 'head'\n | 'headTitle'\n | 'lang'\n | 'layouts'\n | 'page'\n | 'pageComponent'\n | 'pageLayout'\n | 'redirects'\n | 'routeLocale'\n | 'routePath'\n | 'routes'\n | 'site'\n | 'siteLocale'\n> {\n theme: ThemeDataRef<DefaultThemeData>\n themeLocale: ThemeLocaleDataRef<DefaultThemeData>\n}\n\nexport const useData = <\n PageFrontmatter extends Record<string, unknown> =\n DefaultThemeNormalPageFrontmatter,\n PageData extends Record<string, unknown> = DefaultThemePageData,\n>(): Data<PageFrontmatter, PageData> => ({\n ..._useData<PageFrontmatter, PageData>(),\n theme: useThemeData<DefaultThemeData>(),\n themeLocale: useThemeLocaleData<DefaultThemeData>(),\n})\n"],"mappings":"oIAyCA,MAAa,OAI4B,CACvC,GAAGA,GAAqC,CACxC,MAAO,GAAgC,CACvC,YAAa,GAAsC,CACpD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useEditLink.js","names":[],"sources":["../../../src/client/composables/useEditLink.ts"],"sourcesContent":["import { resolveEditLink } from '@theme/resolveEditLink'\nimport { useData } from '@theme/useData'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport type { AutoLinkConfig } from 'vuepress/client'\n\nexport const useEditLink = (): ComputedRef<AutoLinkConfig | null> => {\n const { frontmatter, page, themeLocale } = useData()\n\n return computed(() => {\n const showEditLink =\n frontmatter.value.editLink ?? themeLocale.value.editLink ?? true\n if (!showEditLink) return null\n\n const {\n repo,\n docsRepo = repo,\n docsBranch = 'main',\n docsDir = '',\n editLinkText,\n } = themeLocale.value\n\n if (!docsRepo) return null\n\n const editLink = resolveEditLink({\n docsRepo,\n docsBranch,\n docsDir,\n filePathRelative: page.value.filePathRelative,\n editLinkPattern:\n frontmatter.value.editLinkPattern ?? themeLocale.value.editLinkPattern,\n })\n\n if (!editLink) return null\n\n return {\n text: editLinkText ?? 'Edit this page',\n link: editLink,\n }\n })\n}\n"],"mappings":"iIAMA,MAAa,MAAwD,CACnE,GAAM,CAAE,cAAa,OAAM,eAAgB,GAAS,CAEpD,OAAO,MAAe,CAGpB,GAAI,EADF,EAAY,MAAM,UAAY,EAAY,MAAM,UAAY,IAC3C,OAAO,KAE1B,GAAM,CACJ,OACA,WAAW,EACX,aAAa,OACb,UAAU,GACV,gBACE,EAAY,MAEhB,GAAI,CAAC,EAAU,OAAO,KAEtB,IAAM,EAAW,EAAgB,CAC/B,WACA,aACA,UACA,iBAAkB,EAAK,MAAM,iBAC7B,gBACE,EAAY,MAAM,iBAAmB,EAAY,MAAM,gBAC1D,CAAC,CAIF,OAFK,EAEE,CACL,KAAM,GAAgB,iBACtB,KAAM,EACP,CALqB,MAMtB"}
@@ -1,2 +0,0 @@
1
- import{getHeaders as e}from"@vuepress/helper/client";import{onContentUpdated as t}from"vuepress/client";import{useData as n}from"@theme/useData";import{injectLocal as r,provideLocal as i}from"@vueuse/core";import{computed as a,ref as o}from"vue";const s=Symbol(`headers`),c=()=>{let e=r(s);if(!e)throw Error(`useHeaders() is called without provider.`);return e},l=()=>{let{frontmatter:r,themeLocale:c}=n(),l=o([]),u=a(()=>r.value.sidebarDepth??c.value.sidebarDepth??2),d=()=>{if(u.value<=0){l.value=[];return}l.value=e({levels:[2,u.value+1],ignore:[`.vp-badge`]})};i(s,l),t(e=>{e===`beforeUnmount`?l.value=[]:d()})};export{s as headersSymbol,l as setupHeaders,c as useHeaders};
2
- //# sourceMappingURL=useHeaders.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useHeaders.js","names":["useData"],"sources":["../../../src/client/composables/useHeaders.ts"],"sourcesContent":["import { useData } from '@theme/useData'\nimport type { HeaderItem } from '@vuepress/helper/client'\nimport { getHeaders } from '@vuepress/helper/client'\nimport { injectLocal, provideLocal } from '@vueuse/core'\nimport type { InjectionKey, Ref } from 'vue'\nimport { computed, ref } from 'vue'\nimport { onContentUpdated } from 'vuepress/client'\n\nexport type HeadersRef = Ref<HeaderItem[]>\n\nexport const headersSymbol: InjectionKey<HeadersRef> = Symbol('headers')\n\n/**\n * Inject headers\n *\n * 注入标题\n *\n * @returns Headers ref / 标题引用\n */\nexport const useHeaders = (): HeadersRef => {\n const headers = injectLocal(headersSymbol)\n\n if (!headers) throw new Error('useHeaders() is called without provider.')\n\n return headers\n}\n\nexport const setupHeaders = (): void => {\n const { frontmatter, themeLocale } = useData()\n\n const headersRef: HeadersRef = ref([])\n const levels = computed(\n () => frontmatter.value.sidebarDepth ?? themeLocale.value.sidebarDepth ?? 2,\n )\n\n const updateHeaders = (): void => {\n if (levels.value <= 0) {\n headersRef.value = []\n return\n }\n\n headersRef.value = getHeaders({\n levels: [2, levels.value + 1],\n ignore: ['.vp-badge'],\n })\n }\n\n provideLocal(headersSymbol, headersRef)\n\n onContentUpdated((reason) => {\n if (reason === 'beforeUnmount') headersRef.value = []\n else updateHeaders()\n })\n}\n"],"mappings":"sPAUA,MAAa,EAA0C,OAAO,UAAU,CAS3D,MAA+B,CAC1C,IAAM,EAAU,EAAY,EAAc,CAE1C,GAAI,CAAC,EAAS,MAAU,MAAM,2CAA2C,CAEzE,OAAO,GAGI,MAA2B,CACtC,GAAM,CAAE,cAAa,eAAgBA,GAAS,CAExC,EAAyB,EAAI,EAAE,CAAC,CAChC,EAAS,MACP,EAAY,MAAM,cAAgB,EAAY,MAAM,cAAgB,EAC3E,CAEK,MAA4B,CAChC,GAAI,EAAO,OAAS,EAAG,CACrB,EAAW,MAAQ,EAAE,CACrB,OAGF,EAAW,MAAQ,EAAW,CAC5B,OAAQ,CAAC,EAAG,EAAO,MAAQ,EAAE,CAC7B,OAAQ,CAAC,YAAY,CACtB,CAAC,EAGJ,EAAa,EAAe,EAAW,CAEvC,EAAkB,GAAW,CACvB,IAAW,gBAAiB,EAAW,MAAQ,EAAE,CAChD,GAAe,EACpB"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNavbarConfig.js","names":[],"sources":["../../../src/client/composables/useNavbarConfig.ts"],"sourcesContent":["import { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { resolvePrefix } from '@theme/resolvePrefix'\nimport { useData } from '@theme/useData'\nimport { isLinkRelative } from '@vuepress/helper/client'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { isString } from 'vuepress/shared'\nimport type {\n NavbarGroupOptions,\n NavbarLinkOptions,\n} from '../../shared/navbar.js'\nimport type { NavbarItem } from '../typings.js'\n\nconst resolveNavbarItem = (\n item: NavbarGroupOptions | NavbarLinkOptions,\n prefix = '',\n): NavbarItem => {\n if (isString(item)) return resolveAutoLink(resolvePrefix(prefix, item))\n\n if ('children' in item) {\n return {\n ...item,\n children: item.children.map((child) =>\n resolveNavbarItem(child, resolvePrefix(prefix, item.prefix)),\n ),\n }\n }\n\n return {\n ...item,\n link: isLinkRelative(item.link)\n ? resolveAutoLink(resolvePrefix(prefix, item.link)).link\n : item.link,\n }\n}\n\nexport const useNavbarConfig = (): ComputedRef<NavbarItem[]> => {\n const { themeLocale } = useData()\n\n return computed(() =>\n (themeLocale.value.navbar || []).map((item) => resolveNavbarItem(item)),\n )\n}\n"],"mappings":"0RAaA,MAAM,GACJ,EACA,EAAS,KAEL,EAAS,EAAK,CAAS,EAAgB,EAAc,EAAQ,EAAK,CAAC,CAEnE,aAAc,EACT,CACL,GAAG,EACH,SAAU,EAAK,SAAS,IAAK,GAC3B,EAAkB,EAAO,EAAc,EAAQ,EAAK,OAAO,CAAC,CAC7D,CACF,CAGI,CACL,GAAG,EACH,KAAM,EAAe,EAAK,KAAK,CAC3B,EAAgB,EAAc,EAAQ,EAAK,KAAK,CAAC,CAAC,KAClD,EAAK,KACV,CAGU,MAAmD,CAC9D,GAAM,CAAE,eAAgB,GAAS,CAEjC,OAAO,OACJ,EAAY,MAAM,QAAU,EAAE,EAAE,IAAK,GAAS,EAAkB,EAAK,CAAC,CACxE"}
@@ -1,2 +0,0 @@
1
- import{isLinkHttp as e}from"vuepress/shared";import{useData as t}from"@theme/useData";import{computed as n}from"vue";import{resolveRepoType as r}from"@theme/resolveRepoType";const i=()=>{let{themeLocale:i}=t(),a=n(()=>i.value.repo),o=n(()=>a.value?r(a.value):null),s=n(()=>a.value&&!e(a.value)?`https://github.com/${a.value}`:a.value),c=n(()=>s.value?i.value.repoLabel?i.value.repoLabel:o.value==null?`Source`:o.value:null);return n(()=>!s.value||!c.value?[]:[{text:c.value,link:s.value}])};export{i as useNavbarRepo};
2
- //# sourceMappingURL=useNavbarRepo.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNavbarRepo.js","names":[],"sources":["../../../src/client/composables/useNavbarRepo.ts"],"sourcesContent":["import { resolveRepoType } from '@theme/resolveRepoType'\nimport { useData } from '@theme/useData'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { isLinkHttp } from 'vuepress/shared'\nimport type { NavbarItem } from '../typings.js'\n\n/**\n * Repository link in navbar\n *\n * @returns Navbar config of repository link / 仓库链接的导航栏配置\n */\nexport const useNavbarRepo = (): ComputedRef<NavbarItem[]> => {\n const { themeLocale } = useData()\n\n const repo = computed(() => themeLocale.value.repo)\n const repoType = computed(() =>\n repo.value ? resolveRepoType(repo.value) : null,\n )\n\n const repoLink = computed(() => {\n if (repo.value && !isLinkHttp(repo.value))\n return `https://github.com/${repo.value}`\n\n return repo.value\n })\n\n const repoLabel = computed(() => {\n if (!repoLink.value) return null\n if (themeLocale.value.repoLabel) return themeLocale.value.repoLabel\n if (repoType.value == null) return 'Source'\n return repoType.value\n })\n\n return computed(() => {\n if (!repoLink.value || !repoLabel.value) return []\n\n return [\n {\n text: repoLabel.value,\n link: repoLink.value,\n },\n ]\n })\n}\n"],"mappings":"8KAYA,MAAa,MAAiD,CAC5D,GAAM,CAAE,eAAgB,GAAS,CAE3B,EAAO,MAAe,EAAY,MAAM,KAAK,CAC7C,EAAW,MACf,EAAK,MAAQ,EAAgB,EAAK,MAAM,CAAG,KAC5C,CAEK,EAAW,MACX,EAAK,OAAS,CAAC,EAAW,EAAK,MAAM,CAChC,sBAAsB,EAAK,QAE7B,EAAK,MACZ,CAEI,EAAY,MACX,EAAS,MACV,EAAY,MAAM,UAAkB,EAAY,MAAM,UACtD,EAAS,OAAS,KAAa,SAC5B,EAAS,MAHY,KAI5B,CAEF,OAAO,MACD,CAAC,EAAS,OAAS,CAAC,EAAU,MAAc,EAAE,CAE3C,CACL,CACE,KAAM,EAAU,MAChB,KAAM,EAAS,MAChB,CACF,CACD"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"useNavbarSelectLanguage.js","names":["useData"],"sources":["../../../src/client/composables/useNavbarSelectLanguage.ts"],"sourcesContent":["import { useData } from '@theme/useData'\nimport { useRoutePaths } from '@vuepress/helper/client'\nimport { useMounted } from '@vueuse/core'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { useRoute } from 'vuepress/client'\nimport type { NavbarItem } from '../typings.js'\n\n/**\n * Get navbar config of select language dropdown\n *\n * @returns Navbar config of select language dropdown\n */\nexport const useNavbarSelectLanguage = (): ComputedRef<NavbarItem[]> => {\n const route = useRoute()\n const routePaths = useRoutePaths()\n const { routeLocale, site, siteLocale, theme, themeLocale } = useData()\n\n const isMounted = useMounted()\n\n return computed<NavbarItem[]>(() => {\n const localePaths = Object.keys(site.value.locales)\n // do not display language selection dropdown if there is only one language\n if (localePaths.length < 2) return []\n\n const currentPath = route.path\n const currentFullPath = route.fullPath\n\n const languageDropdown: NavbarItem = {\n text: `${themeLocale.value.selectLanguageText}`,\n ariaLabel: `${\n themeLocale.value.selectLanguageAriaLabel ??\n themeLocale.value.selectLanguageText\n }`,\n children: localePaths.map((targetLocalePath) => {\n // target locale config of this language link\n const targetSiteLocale = site.value.locales?.[targetLocalePath] ?? {}\n const targetThemeLocale = theme.value.locales?.[targetLocalePath] ?? {}\n const targetLang = `${targetSiteLocale.lang}`\n\n const text = targetThemeLocale.selectLanguageName ?? targetLang\n\n // if the target language is current language\n // stay at current link\n if (targetLang === siteLocale.value.lang) {\n return {\n text,\n activeMatch: '.',\n link: isMounted.value ? currentFullPath : currentPath,\n }\n }\n\n // if the target language is not current language\n // try to link to the corresponding page of current page\n // or fallback to homepage\n const targetLocalePage = currentPath.replace(\n routeLocale.value,\n targetLocalePath,\n )\n\n return {\n text,\n // try to keep current hash and params across languages\n link: routePaths.value.some((item) => item === targetLocalePage)\n ? isMounted.value\n ? currentFullPath.replace(currentPath, targetLocalePage)\n : targetLocalePage\n : (targetThemeLocale.home ?? targetLocalePath),\n }\n }),\n }\n\n return [languageDropdown]\n })\n}\n"],"mappings":"qNAaA,MAAa,MAA2D,CACtE,IAAM,EAAQ,GAAU,CAClB,EAAa,GAAe,CAC5B,CAAE,cAAa,OAAM,aAAY,QAAO,eAAgBA,GAAS,CAEjE,EAAY,GAAY,CAE9B,OAAO,MAA6B,CAClC,IAAM,EAAc,OAAO,KAAK,EAAK,MAAM,QAAQ,CAEnD,GAAI,EAAY,OAAS,EAAG,MAAO,EAAE,CAErC,IAAM,EAAc,EAAM,KACpB,EAAkB,EAAM,SA8C9B,MAAO,CA5C8B,CACnC,KAAM,GAAG,EAAY,MAAM,qBAC3B,UAAW,GACT,EAAY,MAAM,yBAClB,EAAY,MAAM,qBAEpB,SAAU,EAAY,IAAK,GAAqB,CAE9C,IAAM,EAAmB,EAAK,MAAM,UAAU,IAAqB,EAAE,CAC/D,EAAoB,EAAM,MAAM,UAAU,IAAqB,EAAE,CACjE,EAAa,GAAG,EAAiB,OAEjC,EAAO,EAAkB,oBAAsB,EAIrD,GAAI,IAAe,EAAW,MAAM,KAClC,MAAO,CACL,OACA,YAAa,IACb,KAAM,EAAU,MAAQ,EAAkB,EAC3C,CAMH,IAAM,EAAmB,EAAY,QACnC,EAAY,MACZ,EACD,CAED,MAAO,CACL,OAEA,KAAM,EAAW,MAAM,KAAM,GAAS,IAAS,EAAiB,CAC5D,EAAU,MACR,EAAgB,QAAQ,EAAa,EAAiB,CACtD,EACD,EAAkB,MAAQ,EAChC,EACD,CACH,CAEwB,EACzB"}
@@ -1,2 +0,0 @@
1
- import{isPlainObject as e,isString as t}from"vuepress/shared";import{useSidebarItems as n}from"@theme/useSidebarItems";import{resolveRoute as r,useRoutePath as i}from"vuepress/client";import{useData as a}from"@theme/useData";import{computed as o}from"vue";import{resolveAutoLink as s}from"@theme/resolveAutoLink";const c=(n,r)=>n===!1?!1:t(n)?s(n,r):e(n)?{...n,link:s(n.link,r).link}:null,l=(e,t,n)=>{let i=e.findIndex(e=>e.link===t);if(i!==-1){let t=e[i+n];return t?t.link?t:`prefix`in t&&!r(t.prefix).notFound?{...t,link:t.prefix}:null:null}for(let r of e)if(`children`in r){let e=l(r.children,t,n);if(e)return e}let a=e.findIndex(e=>`prefix`in e&&e.prefix===t);if(a!==-1){let t=e[a+n];return t?t.link?t:`prefix`in t&&!r(t.prefix).notFound?{...t,link:t.prefix}:null:null}return null},u=()=>{let{frontmatter:e,themeLocale:t}=a(),r=n(),s=i();return{prevLink:o(()=>{let n=c(e.value.prev,s.value);return n===!1?null:n??(t.value.prev===!1?null:l(r.value,s.value,-1))}),nextLink:o(()=>{let n=c(e.value.next,s.value);return n===!1?null:n??(t.value.next===!1?null:l(r.value,s.value,1))})}};export{u as useRelatedLinks};
2
- //# sourceMappingURL=useRelatedLinks.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useRelatedLinks.js","names":["useData"],"sources":["../../../src/client/composables/useRelatedLinks.ts"],"sourcesContent":["import { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { useData } from '@theme/useData'\nimport { useSidebarItems } from '@theme/useSidebarItems'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { resolveRoute, useRoutePath } from 'vuepress/client'\nimport { isPlainObject, isString } from 'vuepress/shared'\nimport type { AutoLinkOptions } from '../../shared/index.js'\nimport type { SidebarItem } from '../typings.js'\n\nconst resolveFromFrontmatterConfig = (\n config: AutoLinkOptions | string | false | undefined,\n currentPath: string,\n): AutoLinkOptions | false | null => {\n if (config === false) return false\n\n if (isString(config)) return resolveAutoLink(config, currentPath)\n\n if (isPlainObject(config)) {\n return {\n ...config,\n link: resolveAutoLink(config.link, currentPath).link,\n }\n }\n\n return null\n}\n/**\n * Resolve `prev` or `next` config from sidebar items\n *\n * @param sidebarItems - Sidebar items / 侧边栏配置项\n * @param currentPath - Current route path / 当前路由路径\n * @param offset - The offset to find the target link, -1 for `prev` and 1 for `next` / 查找目标链接的偏移量,-1 表示查找 `prev`,1 表示查找 `next`\n * @returns Resolved link or null if not found\n */\nconst resolveFromSidebarItems = (\n sidebarItems: SidebarItem[],\n currentPath: string,\n offset: number,\n): AutoLinkOptions | null => {\n const linkIndex = sidebarItems.findIndex((item) => item.link === currentPath)\n\n if (linkIndex !== -1) {\n const targetItem = sidebarItems[linkIndex + offset] as\n | SidebarItem\n | undefined\n\n if (!targetItem) return null\n\n if (targetItem.link) return targetItem as AutoLinkOptions\n\n if ('prefix' in targetItem && !resolveRoute(targetItem.prefix!).notFound) {\n return {\n ...targetItem,\n link: targetItem.prefix!,\n }\n }\n\n return null\n }\n\n for (const item of sidebarItems) {\n if ('children' in item) {\n const childResult = resolveFromSidebarItems(\n item.children,\n currentPath,\n offset,\n )\n\n if (childResult) return childResult\n }\n }\n\n const prefixIndex = sidebarItems.findIndex(\n (item) => 'prefix' in item && item.prefix === currentPath,\n )\n\n if (prefixIndex !== -1) {\n const targetItem = sidebarItems[prefixIndex + offset] as\n | SidebarItem\n | undefined\n\n if (!targetItem) return null\n\n if (targetItem.link) return targetItem as AutoLinkOptions\n\n if ('prefix' in targetItem && !resolveRoute(targetItem.prefix!).notFound) {\n return {\n ...targetItem,\n link: targetItem.prefix!,\n }\n }\n\n return null\n }\n\n return null\n}\n\ninterface RelatedLinks {\n prevLink: ComputedRef<AutoLinkOptions | null>\n nextLink: ComputedRef<AutoLinkOptions | null>\n}\n\nexport const useRelatedLinks = (): RelatedLinks => {\n const { frontmatter, themeLocale } = useData()\n const sidebarItems = useSidebarItems()\n const routePath = useRoutePath()\n\n const prevLink = computed(() => {\n const prevConfig = resolveFromFrontmatterConfig(\n frontmatter.value.prev,\n routePath.value,\n )\n\n return prevConfig === false\n ? null\n : (prevConfig ??\n (themeLocale.value.prev === false\n ? null\n : resolveFromSidebarItems(sidebarItems.value, routePath.value, -1)))\n })\n\n const nextLink = computed(() => {\n const nextConfig = resolveFromFrontmatterConfig(\n frontmatter.value.next,\n routePath.value,\n )\n\n return nextConfig === false\n ? null\n : (nextConfig ??\n (themeLocale.value.next === false\n ? null\n : resolveFromSidebarItems(sidebarItems.value, routePath.value, 1)))\n })\n\n return {\n prevLink,\n nextLink,\n }\n}\n"],"mappings":"yTAUA,MAAM,GACJ,EACA,IAEI,IAAW,GAAc,GAEzB,EAAS,EAAO,CAAS,EAAgB,EAAQ,EAAY,CAE7D,EAAc,EAAO,CAChB,CACL,GAAG,EACH,KAAM,EAAgB,EAAO,KAAM,EAAY,CAAC,KACjD,CAGI,KAUH,GACJ,EACA,EACA,IAC2B,CAC3B,IAAM,EAAY,EAAa,UAAW,GAAS,EAAK,OAAS,EAAY,CAE7E,GAAI,IAAc,GAAI,CACpB,IAAM,EAAa,EAAa,EAAY,GAe5C,OAXK,EAED,EAAW,KAAa,EAExB,WAAY,GAAc,CAAC,EAAa,EAAW,OAAQ,CAAC,SACvD,CACL,GAAG,EACH,KAAM,EAAW,OAClB,CAGI,KAXiB,KAc1B,IAAK,IAAM,KAAQ,EACjB,GAAI,aAAc,EAAM,CACtB,IAAM,EAAc,EAClB,EAAK,SACL,EACA,EACD,CAED,GAAI,EAAa,OAAO,EAI5B,IAAM,EAAc,EAAa,UAC9B,GAAS,WAAY,GAAQ,EAAK,SAAW,EAC/C,CAED,GAAI,IAAgB,GAAI,CACtB,IAAM,EAAa,EAAa,EAAc,GAe9C,OAXK,EAED,EAAW,KAAa,EAExB,WAAY,GAAc,CAAC,EAAa,EAAW,OAAQ,CAAC,SACvD,CACL,GAAG,EACH,KAAM,EAAW,OAClB,CAGI,KAXiB,KAc1B,OAAO,MAQI,MAAsC,CACjD,GAAM,CAAE,cAAa,eAAgBA,GAAS,CACxC,EAAe,GAAiB,CAChC,EAAY,GAAc,CA8BhC,MAAO,CACL,SA7Be,MAAe,CAC9B,IAAM,EAAa,EACjB,EAAY,MAAM,KAClB,EAAU,MACX,CAED,OAAO,IAAe,GAClB,KACC,IACE,EAAY,MAAM,OAAS,GACxB,KACA,EAAwB,EAAa,MAAO,EAAU,MAAO,GAAG,GAC1E,CAkBA,SAhBe,MAAe,CAC9B,IAAM,EAAa,EACjB,EAAY,MAAM,KAClB,EAAU,MACX,CAED,OAAO,IAAe,GAClB,KACC,IACE,EAAY,MAAM,OAAS,GACxB,KACA,EAAwB,EAAa,MAAO,EAAU,MAAO,EAAE,GACzE,CAKD"}
@@ -1,2 +0,0 @@
1
- import{isPlainObject as e,isString as t}from"vuepress/shared";import{useHeaders as n}from"@theme/useHeaders";import{isLinkRelative as r,keys as i,startsWith as a}from"@vuepress/helper/client";import{useRoutePath as o}from"vuepress/client";import{useData as s}from"@theme/useData";import{computed as c,inject as l,provide as u}from"vue";import{resolveAutoLink as d}from"@theme/resolveAutoLink";import{resolvePrefix as f}from"@theme/resolvePrefix";const p=e=>({text:e.title,link:e.link,children:m(e.children)}),m=e=>e?e.map(e=>p(e)):[],h=(e,t)=>[{text:e.title,children:m(t)}],g=(e,n,i,a=``)=>{let o=(e,a)=>{let s=t(e)?d(f(a,e)):t(e.link)?{...e,link:r(e.link)?d(f(a,e.link)).link:e.link}:e;if(`children`in s)return{...s,children:s.children.map(e=>o(e,f(a,s.prefix)))};if(s.link===i){let e=n[0]?.level===1?n[0].children:n;return{...s,children:m(e)}}return s};return e.map(e=>o(e,a))},_=(e,t,n,r)=>{let o=i(e).sort((e,t)=>t.length-e.length);for(let i of o)if(a(decodeURI(r),i)){let a=e[i];return a===!1?[]:a===`heading`?h(t,n):g(a,n,r,i)}return console.warn(`${decodeURI(r)} is missing sidebar config.`),[]},v=Symbol(`sidebarItems`),y=()=>{let e=l(v);if(!e)throw Error(`useSidebarItems() is called without provider.`);return e},b=(t,n,r,i,a)=>t===!1?[]:t===`heading`?h(n,a):Array.isArray(t)?g(t,a,r,i):e(t)?_(t,n,a,r):[],x=()=>{let{frontmatter:e,page:t,routeLocale:r,themeLocale:i}=s(),a=n(),l=o(),d=c(()=>!e.value.home&&(e.value.sidebar??i.value.sidebar??`heading`));u(v,c(()=>b(d.value,t.value,l.value,r.value,a.value)))};export{g as resolveArraySidebarItems,_ as resolveMultiSidebarItems,h as resolveSidebarHeadingItem,b as resolveSidebarItems,p as resolveSidebarPageHeader,m as resolveSidebarPageHeaders,x as setupSidebarItems,v as sidebarItemsSymbol,y as useSidebarItems};
2
- //# sourceMappingURL=useSidebarItems.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"useSidebarItems.js","names":["useData"],"sources":["../../../src/client/composables/useSidebarItems.ts"],"sourcesContent":["import { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { resolvePrefix } from '@theme/resolvePrefix'\nimport { useData } from '@theme/useData'\nimport { useHeaders } from '@theme/useHeaders'\nimport { isLinkRelative, keys, startsWith } from '@vuepress/helper/client'\nimport type { ComputedRef, InjectionKey } from 'vue'\nimport { computed, inject, provide } from 'vue'\nimport type { PageData, PageHeader } from 'vuepress/client'\nimport { useRoutePath } from 'vuepress/client'\nimport { isPlainObject, isString } from 'vuepress/shared'\nimport type {\n DefaultThemeHomePageFrontmatter,\n DefaultThemeNormalPageFrontmatter,\n SidebarArrayOptions,\n SidebarItemOptions,\n SidebarObjectOptions,\n SidebarOptions,\n} from '../../shared/index.js'\nimport type { SidebarHeaderItem, SidebarItem } from '../typings.js'\n\n/**\n * Util to transform page header to sidebar item\n *\n * @param header page header\n * @returns sidebar item from header\n */\nexport const resolveSidebarPageHeader = (\n header: PageHeader,\n): SidebarHeaderItem => ({\n text: header.title,\n link: header.link,\n // oxlint-disable-next-line no-use-before-define\n children: resolveSidebarPageHeaders(header.children),\n})\n\n/**\n * get sidebar header items from page headers\n *\n * @param headers page headers\n * @returns sidebar header items\n */\nexport const resolveSidebarPageHeaders = (\n headers?: PageHeader[],\n): SidebarHeaderItem[] =>\n headers ? headers.map((header) => resolveSidebarPageHeader(header)) : []\n\n/**\n * Resolve current page and its header to sidebar items if the config is `heading`\n *\n * @param page current page data\n * @param headers current page headers\n *\n * @returns sidebar items\n */\nexport const resolveSidebarHeadingItem = (\n page: PageData,\n headers: PageHeader[],\n): SidebarItem[] => [\n {\n text: page.title,\n children: resolveSidebarPageHeaders(headers),\n },\n]\n\n/**\n * Resolve sidebar items if the config is an array\n *\n * @param sidebarConfig sidebar config array\n * @param headers current page headers\n * @param path current page path\n * @param prefix path prefix\n *\n * @returns resolved sidebar items\n */\nexport const resolveArraySidebarItems = (\n sidebarConfig: SidebarArrayOptions,\n headers: PageHeader[],\n path: string,\n prefix = '',\n): SidebarItem[] => {\n const handleChildItem = (\n item: SidebarItemOptions,\n pathPrefix: string,\n ): SidebarItem => {\n const childItem: SidebarItemOptions = isString(item)\n ? resolveAutoLink(resolvePrefix(pathPrefix, item))\n : isString(item.link)\n ? {\n ...item,\n link: isLinkRelative(item.link)\n ? resolveAutoLink(resolvePrefix(pathPrefix, item.link)).link\n : item.link,\n }\n : item\n\n if ('children' in childItem) {\n return {\n ...childItem,\n children: childItem.children.map((child) =>\n handleChildItem(child, resolvePrefix(pathPrefix, childItem.prefix)),\n ),\n }\n }\n\n // if the sidebar item is current page and children is not set\n // use headers of current page as children\n if (childItem.link === path) {\n // skip h1 header\n const currentHeaders =\n headers[0]?.level === 1 ? headers[0].children : headers\n\n return {\n ...childItem,\n children: resolveSidebarPageHeaders(currentHeaders),\n }\n }\n\n return childItem\n }\n\n return sidebarConfig.map((item) => handleChildItem(item, prefix))\n}\n\n/**\n * Resolve sidebar items if the config is a key -> value (path-prefix -> array) object\n *\n * @param sidebarConfig sidebar config object\n * @param page current page data\n * @param headers current page headers\n * @param path current page path\n *\n * @returns resolved sidebar items\n */\nexport const resolveMultiSidebarItems = (\n sidebarConfig: SidebarObjectOptions,\n page: PageData,\n headers: PageHeader[],\n path: string,\n): SidebarItem[] => {\n const sidebarRoutes = keys(sidebarConfig).sort((a, b) => b.length - a.length)\n\n // Find matching config\n for (const base of sidebarRoutes) {\n if (startsWith(decodeURI(path), base)) {\n const matched = sidebarConfig[base]\n\n return matched === false\n ? []\n : matched === 'heading'\n ? resolveSidebarHeadingItem(page, headers)\n : resolveArraySidebarItems(matched, headers, path, base)\n }\n }\n\n // eslint-disable-next-line no-console\n console.warn(`${decodeURI(path)} is missing sidebar config.`)\n\n return []\n}\n\nexport type SidebarItemsRef = ComputedRef<SidebarItem[]>\n\nexport const sidebarItemsSymbol: InjectionKey<SidebarItemsRef> =\n Symbol('sidebarItems')\n\n/**\n * Inject sidebar items global computed\n *\n * @returns sidebar items global computed\n */\nexport const useSidebarItems = (): SidebarItemsRef => {\n const sidebarItems = inject(sidebarItemsSymbol)\n if (!sidebarItems)\n throw new Error('useSidebarItems() is called without provider.')\n\n return sidebarItems\n}\n\n/**\n * Resolve sidebar items global computed\n *\n * It should only be resolved and provided once\n *\n * @param sidebarConfig sidebar config\n * @param page current page data\n * @param path current page path\n * @param routeLocale current route locale\n * @param headers current page headers\n *\n * @returns resolved sidebar items\n */\n\nexport const resolveSidebarItems = (\n sidebarConfig: SidebarOptions | false,\n page: PageData,\n path: string,\n routeLocale: string,\n headers: PageHeader[],\n): SidebarItem[] => {\n // resolve sidebar items according to the config\n if (sidebarConfig === false) return []\n\n if (sidebarConfig === 'heading')\n return resolveSidebarHeadingItem(page, headers)\n\n if (Array.isArray(sidebarConfig))\n return resolveArraySidebarItems(sidebarConfig, headers, path, routeLocale)\n\n if (isPlainObject(sidebarConfig))\n return resolveMultiSidebarItems(sidebarConfig, page, headers, path)\n\n return []\n}\n\n/**\n * Create sidebar items ref and provide as global computed in setup\n */\nexport const setupSidebarItems = (): void => {\n const { frontmatter, page, routeLocale, themeLocale } = useData<\n DefaultThemeHomePageFrontmatter | DefaultThemeNormalPageFrontmatter\n >()\n const headers = useHeaders()\n const routePath = useRoutePath()\n\n const sidebarConfig = computed<SidebarOptions | false>(\n () =>\n !frontmatter.value.home &&\n ((frontmatter.value as DefaultThemeNormalPageFrontmatter).sidebar ??\n themeLocale.value.sidebar ??\n 'heading'),\n )\n\n const sidebarItems = computed(() =>\n resolveSidebarItems(\n sidebarConfig.value,\n page.value,\n routePath.value,\n routeLocale.value,\n headers.value,\n ),\n )\n provide(sidebarItemsSymbol, sidebarItems)\n}\n"],"mappings":"8bA0BA,MAAa,EACX,IACuB,CACvB,KAAM,EAAO,MACb,KAAM,EAAO,KAEb,SAAU,EAA0B,EAAO,SAAS,CACrD,EAQY,EACX,GAEA,EAAU,EAAQ,IAAK,GAAW,EAAyB,EAAO,CAAC,CAAG,EAAE,CAU7D,GACX,EACA,IACkB,CAClB,CACE,KAAM,EAAK,MACX,SAAU,EAA0B,EAAQ,CAC7C,CACF,CAYY,GACX,EACA,EACA,EACA,EAAS,KACS,CAClB,IAAM,GACJ,EACA,IACgB,CAChB,IAAM,EAAgC,EAAS,EAAK,CAChD,EAAgB,EAAc,EAAY,EAAK,CAAC,CAChD,EAAS,EAAK,KAAK,CACjB,CACE,GAAG,EACH,KAAM,EAAe,EAAK,KAAK,CAC3B,EAAgB,EAAc,EAAY,EAAK,KAAK,CAAC,CAAC,KACtD,EAAK,KACV,CACD,EAEN,GAAI,aAAc,EAChB,MAAO,CACL,GAAG,EACH,SAAU,EAAU,SAAS,IAAK,GAChC,EAAgB,EAAO,EAAc,EAAY,EAAU,OAAO,CAAC,CACpE,CACF,CAKH,GAAI,EAAU,OAAS,EAAM,CAE3B,IAAM,EACJ,EAAQ,IAAI,QAAU,EAAI,EAAQ,GAAG,SAAW,EAElD,MAAO,CACL,GAAG,EACH,SAAU,EAA0B,EAAe,CACpD,CAGH,OAAO,GAGT,OAAO,EAAc,IAAK,GAAS,EAAgB,EAAM,EAAO,CAAC,EAatD,GACX,EACA,EACA,EACA,IACkB,CAClB,IAAM,EAAgB,EAAK,EAAc,CAAC,MAAM,EAAG,IAAM,EAAE,OAAS,EAAE,OAAO,CAG7E,IAAK,IAAM,KAAQ,EACjB,GAAI,EAAW,UAAU,EAAK,CAAE,EAAK,CAAE,CACrC,IAAM,EAAU,EAAc,GAE9B,OAAO,IAAY,GACf,EAAE,CACF,IAAY,UACV,EAA0B,EAAM,EAAQ,CACxC,EAAyB,EAAS,EAAS,EAAM,EAAK,CAOhE,OAFA,QAAQ,KAAK,GAAG,UAAU,EAAK,CAAC,6BAA6B,CAEtD,EAAE,EAKE,EACX,OAAO,eAAe,CAOX,MAAyC,CACpD,IAAM,EAAe,EAAO,EAAmB,CAC/C,GAAI,CAAC,EACH,MAAU,MAAM,gDAAgD,CAElE,OAAO,GAiBI,GACX,EACA,EACA,EACA,EACA,IAGI,IAAkB,GAAc,EAAE,CAElC,IAAkB,UACb,EAA0B,EAAM,EAAQ,CAE7C,MAAM,QAAQ,EAAc,CACvB,EAAyB,EAAe,EAAS,EAAM,EAAY,CAExE,EAAc,EAAc,CACvB,EAAyB,EAAe,EAAM,EAAS,EAAK,CAE9D,EAAE,CAME,MAAgC,CAC3C,GAAM,CAAE,cAAa,OAAM,cAAa,eAAgBA,GAErD,CACG,EAAU,GAAY,CACtB,EAAY,GAAc,CAE1B,EAAgB,MAElB,CAAC,EAAY,MAAM,OACjB,EAAY,MAA4C,SACxD,EAAY,MAAM,SAClB,WACL,CAWD,EAAQ,EATa,MACnB,EACE,EAAc,MACd,EAAK,MACL,EAAU,MACV,EAAY,MACZ,EAAQ,MACT,CACF,CACwC"}