@vuepress/theme-default 2.0.0-rc.130 → 2.0.0-rc.131
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/components/VPNavbar.vue +1 -0
- package/dist/client/components/VPSidebarItem.vue +1 -1
- package/dist/client/composables/index.d.ts +11 -11
- package/dist/client/composables/index.js +1 -1
- package/dist/client/composables/useDarkMode.d.ts +1 -1
- package/dist/client/composables/useDarkMode.js +1 -2
- package/dist/client/composables/useData.d.ts +1 -1
- package/dist/client/composables/useData.js +1 -2
- package/dist/client/composables/useEditLink.d.ts +1 -1
- package/dist/client/composables/useEditLink.js +1 -2
- package/dist/client/composables/useNavbarConfig.d.ts +1 -1
- package/dist/client/composables/useNavbarConfig.js +1 -2
- package/dist/client/composables/useNavbarRepo.d.ts +1 -1
- package/dist/client/composables/useNavbarRepo.js +1 -2
- package/dist/client/composables/useNavbarSelectLanguage.d.ts +1 -1
- package/dist/client/composables/useNavbarSelectLanguage.js +1 -2
- package/dist/client/composables/useNavigate.d.ts +1 -1
- package/dist/client/composables/useNavigate.js +1 -2
- package/dist/client/composables/useRelatedLinks.d.ts +1 -1
- package/dist/client/composables/useRelatedLinks.js +1 -2
- package/dist/client/composables/useScrollPromise.d.ts +1 -1
- package/dist/client/composables/useScrollPromise.js +1 -2
- package/dist/client/composables/useSidebarItems.d.ts +1 -1
- package/dist/client/composables/useSidebarItems.js +1 -2
- package/dist/client/composables/useUpdateDeviceStatus.d.ts +1 -1
- package/dist/client/composables/useUpdateDeviceStatus.js +1 -2
- package/dist/client/config.d.ts +1 -2
- package/dist/client/config.js.map +1 -1
- package/dist/client/index.d.ts +19 -19
- package/dist/client/index.js +1 -1
- package/dist/client/utils/index.d.ts +5 -5
- package/dist/client/utils/index.js +1 -1
- package/dist/client/utils/isActiveSidebarItem.d.ts +1 -1
- package/dist/client/utils/isActiveSidebarItem.js +1 -2
- package/dist/client/utils/resolveAutoLink.d.ts +1 -1
- package/dist/client/utils/resolveAutoLink.js +1 -2
- package/dist/client/utils/resolveEditLink.d.ts +1 -1
- package/dist/client/utils/resolveEditLink.js +1 -2
- package/dist/client/utils/resolvePrefix.d.ts +1 -1
- package/dist/client/utils/resolvePrefix.js +1 -2
- package/dist/client/utils/resolveRepoType.d.ts +1 -1
- package/dist/client/utils/resolveRepoType.js +1 -2
- package/dist/composables-CAISgiXf.js +1 -0
- package/dist/index-BKZ67WMa.d.ts +1 -0
- package/dist/index-BVVgDSdq.d.ts +1 -0
- package/dist/{index-BNjRb2Mr.d.ts → index-ur5YvkCJ.d.ts} +1 -1
- package/dist/isActiveSidebarItem-BQHhsM53.js +2 -0
- package/dist/isActiveSidebarItem-BQHhsM53.js.map +1 -0
- package/dist/{isActiveSidebarItem-DE0Ymo1m.d.ts → isActiveSidebarItem-K6rOnBw4.d.ts} +2 -2
- package/dist/node/index.d.ts +2 -2
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/{resolveAutoLink-bQLxrWMd.d.ts → resolveAutoLink-DBXc0Cd3.d.ts} +2 -2
- package/dist/resolveAutoLink-XUJwl3Kb.js +2 -0
- package/dist/resolveAutoLink-XUJwl3Kb.js.map +1 -0
- package/dist/{resolveEditLink-DRtLIWXz.d.ts → resolveEditLink-BRZu2eno.d.ts} +1 -1
- package/dist/resolveEditLink-lteF0-Mv.js +2 -0
- package/dist/resolveEditLink-lteF0-Mv.js.map +1 -0
- package/dist/{resolvePrefix-DEl0CDB0.d.ts → resolvePrefix-BXZhEIJn.d.ts} +1 -1
- package/dist/resolvePrefix-CQnTmTk4.js +2 -0
- package/dist/resolvePrefix-CQnTmTk4.js.map +1 -0
- package/dist/resolveRepoType-BfcHRhpi.js +2 -0
- package/dist/resolveRepoType-BfcHRhpi.js.map +1 -0
- package/dist/{resolveRepoType-DefRTDOt.d.ts → resolveRepoType-DEy0Gvc4.d.ts} +1 -1
- package/dist/{typings-D-rXvaET.d.ts → typings-CiGFIZqG.d.ts} +2 -2
- package/dist/useDarkMode-BfKvIN6K.js +2 -0
- package/dist/useDarkMode-BfKvIN6K.js.map +1 -0
- package/dist/{useDarkMode-Zrmg4e6i.d.ts → useDarkMode-uRSRwA8U.d.ts} +1 -1
- package/dist/{useData-BFB4h32K.d.ts → useData-DwmcO8iz.d.ts} +2 -2
- package/dist/useData-nv4hwlgW.js +2 -0
- package/dist/useData-nv4hwlgW.js.map +1 -0
- package/dist/useEditLink-BmoW42FE.js +2 -0
- package/dist/useEditLink-BmoW42FE.js.map +1 -0
- package/dist/{useEditLink-m723nvlZ.d.ts → useEditLink-COgJktiW.d.ts} +1 -1
- package/dist/useNavbarConfig-CxVplYul.js +2 -0
- package/dist/useNavbarConfig-CxVplYul.js.map +1 -0
- package/dist/{useNavbarConfig-BnkOLDyM.d.ts → useNavbarConfig-fLxvBobP.d.ts} +2 -2
- package/dist/useNavbarRepo-BScd94be.js +2 -0
- package/dist/useNavbarRepo-BScd94be.js.map +1 -0
- package/dist/{useNavbarRepo-BT8z2mBp.d.ts → useNavbarRepo-DndxHxeK.d.ts} +2 -2
- package/dist/useNavbarSelectLanguage-FHyzHFEW.js +2 -0
- package/dist/useNavbarSelectLanguage-FHyzHFEW.js.map +1 -0
- package/dist/{useNavbarSelectLanguage-DMcyeLfA.d.ts → useNavbarSelectLanguage-a9ZpUKwM.d.ts} +2 -2
- package/dist/useNavigate-mlFey3ew.js +2 -0
- package/dist/useNavigate-mlFey3ew.js.map +1 -0
- package/dist/{useNavigate-D__eeZa2.d.ts → useNavigate-zqYnxkd_.d.ts} +1 -1
- package/dist/useRelatedLinks-BwsPumn1.js +2 -0
- package/dist/useRelatedLinks-BwsPumn1.js.map +1 -0
- package/dist/{useRelatedLinks-CoqxjiuJ.d.ts → useRelatedLinks-DxkE-gdP.d.ts} +2 -2
- package/dist/useScrollPromise-CB6ZLciv.js +2 -0
- package/dist/useScrollPromise-CB6ZLciv.js.map +1 -0
- package/dist/{useScrollPromise-DtXkT3fi.d.ts → useScrollPromise-TwtWBE3d.d.ts} +2 -2
- package/dist/useSidebarItems-CL0nJ7E8.js +2 -0
- package/dist/useSidebarItems-CL0nJ7E8.js.map +1 -0
- package/dist/{useSidebarItems-nMm3AAZ3.d.ts → useSidebarItems-aGO1YtUp.d.ts} +3 -3
- package/dist/{useUpdateDeviceStatus-B3bXVdPs.d.ts → useUpdateDeviceStatus-CsrJ_Qqv.d.ts} +1 -1
- package/dist/useUpdateDeviceStatus-DMKiVB3W.js +2 -0
- package/dist/useUpdateDeviceStatus-DMKiVB3W.js.map +1 -0
- package/dist/utils-CAISgiXf.js +1 -0
- package/package.json +21 -21
- package/dist/client/composables/useDarkMode.js.map +0 -1
- package/dist/client/composables/useData.js.map +0 -1
- package/dist/client/composables/useEditLink.js.map +0 -1
- package/dist/client/composables/useNavbarConfig.js.map +0 -1
- package/dist/client/composables/useNavbarRepo.js.map +0 -1
- package/dist/client/composables/useNavbarSelectLanguage.js.map +0 -1
- package/dist/client/composables/useNavigate.js.map +0 -1
- package/dist/client/composables/useRelatedLinks.js.map +0 -1
- package/dist/client/composables/useScrollPromise.js.map +0 -1
- package/dist/client/composables/useSidebarItems.js.map +0 -1
- package/dist/client/composables/useUpdateDeviceStatus.js.map +0 -1
- package/dist/client/utils/isActiveSidebarItem.js.map +0 -1
- package/dist/client/utils/resolveAutoLink.js.map +0 -1
- package/dist/client/utils/resolveEditLink.js.map +0 -1
- package/dist/client/utils/resolvePrefix.js.map +0 -1
- package/dist/client/utils/resolveRepoType.js.map +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isLinkHttp as e}from"vuepress/shared";const t=t=>!e(t)||/^(?:https?:)?\/\/github\.com\//u.test(t)?`GitHub`:/^(?:https?:)?\/\/bitbucket\.org\//u.test(t)?`Bitbucket`:/^(?:https?:)?\/\/gitlab\.com\//u.test(t)?`GitLab`:/^(?:https?:)?\/\/gitee\.com\//u.test(t)?`Gitee`:null;export{t};
|
|
2
|
+
//# sourceMappingURL=resolveRepoType-BfcHRhpi.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveRepoType-BfcHRhpi.js","names":[],"sources":["../src/client/utils/resolveRepoType.ts"],"sourcesContent":["import { isLinkHttp } from 'vuepress/shared'\n\nexport type RepoType = 'Bitbucket' | 'Gitee' | 'GitHub' | 'GitLab' | null\n\nexport const resolveRepoType = (repo: string): RepoType => {\n if (!isLinkHttp(repo) || /^(?:https?:)?\\/\\/github\\.com\\//u.test(repo))\n return 'GitHub'\n\n if (/^(?:https?:)?\\/\\/bitbucket\\.org\\//u.test(repo)) return 'Bitbucket'\n if (/^(?:https?:)?\\/\\/gitlab\\.com\\//u.test(repo)) return 'GitLab'\n if (/^(?:https?:)?\\/\\/gitee\\.com\\//u.test(repo)) return 'Gitee'\n\n return null\n}\n"],"mappings":"6CAIA,MAAa,EAAmB,GAC1B,CAAC,EAAW,CAAI,GAAK,kCAAkC,KAAK,CAAI,EAC3D,SAEL,qCAAqC,KAAK,CAAI,EAAU,YACxD,kCAAkC,KAAK,CAAI,EAAU,SACrD,iCAAiC,KAAK,CAAI,EAAU,QAEjD"}
|
|
@@ -3,4 +3,4 @@ type RepoType = 'Bitbucket' | 'Gitee' | 'GitHub' | 'GitLab' | null;
|
|
|
3
3
|
declare const resolveRepoType: (repo: string) => RepoType;
|
|
4
4
|
//#endregion
|
|
5
5
|
export { resolveRepoType as n, RepoType as t };
|
|
6
|
-
//# sourceMappingURL=resolveRepoType-
|
|
6
|
+
//# sourceMappingURL=resolveRepoType-DEy0Gvc4.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as SidebarLinkOptions, l as SidebarGroupOptions, m as NavGroup, v as AutoLinkOptions } from "./index-
|
|
1
|
+
import { d as SidebarLinkOptions, l as SidebarGroupOptions, m as NavGroup, v as AutoLinkOptions } from "./index-ur5YvkCJ.js";
|
|
2
2
|
|
|
3
3
|
//#region src/client/typings.d.ts
|
|
4
4
|
type NavbarItem = AutoLinkOptions | NavGroup<NavbarItem>;
|
|
@@ -15,4 +15,4 @@ interface SidebarGroupItem extends SidebarGroupOptions {
|
|
|
15
15
|
type SidebarItem = SidebarGroupItem | SidebarLinkItem;
|
|
16
16
|
//#endregion
|
|
17
17
|
export { SidebarLinkItem as a, SidebarItem as i, SidebarGroupItem as n, SidebarHeaderItem as r, NavbarItem as t };
|
|
18
|
-
//# sourceMappingURL=typings-
|
|
18
|
+
//# sourceMappingURL=typings-CiGFIZqG.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{darkModeSymbol as e}from"@vuepress/helper/client";import{usePreferredDark as t,useStorage as n,watchImmediate as r}from"@vueuse/core";import{computed as i,inject as a,onMounted as o,onUnmounted as s,provide as c}from"vue";import{useData as l}from"@theme/useData";const u=e=>{let t=globalThis.document.documentElement;t.dataset.theme=e?`dark`:`light`},d=e=>{o(()=>{r(e,u)}),s(()=>{u(e.value)})},f=()=>{let t=a(e);if(!t)throw Error(`useDarkMode() is called without provider.`);return t},p=()=>{let{themeLocale:r}=l(),a=t(),o=n(`vuepress-color-scheme`,r.value.colorMode),s=i({get(){return r.value.colorModeSwitch?o.value===`auto`?a.value:o.value===`dark`:r.value.colorMode===`dark`},set(e){e===a.value?o.value=`auto`:o.value=e?`dark`:`light`}});c(e,s),d(s)};export{f as n,p as t};
|
|
2
|
+
//# sourceMappingURL=useDarkMode-BfKvIN6K.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useDarkMode-BfKvIN6K.js","names":[],"sources":["../src/client/composables/useDarkMode.ts"],"sourcesContent":["import { 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\nimport { useData } from '@theme/useData'\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/** Create dark mode ref and provide as global computed in setup */\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":"8QASA,MAAM,EAAU,GAAyB,CAEvC,IAAM,EAAK,WAAW,SAAS,gBAG/B,EAAG,QAAQ,MAAQ,EAAQ,OAAS,OACtC,EAEM,EAAuB,GAAkC,CAC7D,MAAgB,CACd,EAAe,EAAY,CAAM,CACnC,CAAC,EAED,MAAkB,CAChB,EAAO,EAAW,KAAK,CACzB,CAAC,CACH,EASa,MAAiC,CAC5C,IAAM,EAAa,EAAqC,CAAc,EACtE,GAAI,CAAC,EAAY,MAAU,MAAM,2CAA2C,EAE5E,OAAO,CACT,EAGa,MAA4B,CACvC,GAAM,CAAE,eAAgB,EAAQ,EAC1B,EAAkB,EAAiB,EACnC,EAAc,EAClB,wBACA,EAAY,MAAM,SACpB,EAEM,EAAa,EAAkB,CACnC,KAAM,CASJ,OAPK,EAAY,MAAM,gBAInB,EAAY,QAAU,OAAe,EAAgB,MAGlD,EAAY,QAAU,OANpB,EAAY,MAAM,YAAc,MAO3C,EACA,IAAI,EAAK,CACH,IAAQ,EAAgB,MAAO,EAAY,MAAQ,OAClD,EAAY,MAAQ,EAAM,OAAS,OAC1C,CACF,CAAC,EACD,EAAQ,EAAgB,CAAU,EAElC,EAAoB,CAAU,CAChC"}
|
|
@@ -14,4 +14,4 @@ declare const useDarkMode: () => DarkModeRef;
|
|
|
14
14
|
declare const setupDarkMode: () => void;
|
|
15
15
|
//#endregion
|
|
16
16
|
export { setupDarkMode as n, useDarkMode as r, DarkModeRef as t };
|
|
17
|
-
//# sourceMappingURL=useDarkMode-
|
|
17
|
+
//# sourceMappingURL=useDarkMode-uRSRwA8U.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as DefaultThemeData, n as DefaultThemeNormalPageFrontmatter, r as DefaultThemePageData } from "./index-
|
|
1
|
+
import { a as DefaultThemeData, n as DefaultThemeNormalPageFrontmatter, r as DefaultThemePageData } from "./index-ur5YvkCJ.js";
|
|
2
2
|
import { ClientData } from "vuepress/client";
|
|
3
3
|
import { ThemeDataRef, ThemeLocaleDataRef } from "@vuepress/plugin-theme-data/client";
|
|
4
4
|
|
|
@@ -10,4 +10,4 @@ interface Data<PageFrontmatter extends Record<string, unknown> = DefaultThemeNor
|
|
|
10
10
|
declare const useData$1: <PageFrontmatter extends Record<string, unknown> = DefaultThemeNormalPageFrontmatter, PageData extends Record<string, unknown> = DefaultThemePageData>() => Data<PageFrontmatter, PageData>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useData$1 as n, Data as t };
|
|
13
|
-
//# sourceMappingURL=useData-
|
|
13
|
+
//# sourceMappingURL=useData-DwmcO8iz.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useData-nv4hwlgW.js","names":["useData","_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'\n\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":"oIA0CA,MAAaA,OAI4B,CACvC,GAAGC,EAAoC,EACvC,MAAO,EAA+B,EACtC,YAAa,EAAqC,CACpD"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{computed as e}from"vue";import{useData as t}from"@theme/useData";import{resolveEditLink as n}from"@theme/resolveEditLink";const r=()=>{let{frontmatter:r,page:i,themeLocale:a}=t();return e(()=>{if(!(r.value.editLink??a.value.editLink??!0))return null;let{repo:e,docsRepo:t=e,docsBranch:o=`main`,docsDir:s=``,editLinkText:c}=a.value;if(!t)return null;let l=n({docsRepo:t,docsBranch:o,docsDir:s,filePathRelative:i.value.filePathRelative,editLinkPattern:r.value.editLinkPattern??a.value.editLinkPattern});return l?{text:c??`Edit this page`,link:l}:null})};export{r as t};
|
|
2
|
+
//# sourceMappingURL=useEditLink-BmoW42FE.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useEditLink-BmoW42FE.js","names":[],"sources":["../src/client/composables/useEditLink.ts"],"sourcesContent":["import type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport type { AutoLinkConfig } from 'vuepress/client'\n\nimport { resolveEditLink } from '@theme/resolveEditLink'\nimport { useData } from '@theme/useData'\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":"iIAOA,MAAa,MAAwD,CACnE,GAAM,CAAE,cAAa,OAAM,eAAgB,EAAQ,EAEnD,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,eAC3D,CAAC,EAID,OAFK,EAEE,CACL,KAAM,GAAgB,iBACtB,KAAM,CACR,EALsB,IAMxB,CAAC,CACH"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isString as e}from"vuepress/shared";import{isLinkRelative as t}from"@vuepress/helper/client";import{computed as n}from"vue";import{useData as r}from"@theme/useData";import{resolveAutoLink as i}from"@theme/resolveAutoLink";import{resolvePrefix as a}from"@theme/resolvePrefix";const o=(n,r=``)=>e(n)?i(a(r,n)):`children`in n?{...n,children:n.children.map(e=>o(e,a(r,n.prefix)))}:{...n,link:t(n.link)?i(a(r,n.link)).link:n.link},s=()=>{let{themeLocale:e}=r();return n(()=>(e.value.navbar||[]).map(e=>o(e)))};export{s as t};
|
|
2
|
+
//# sourceMappingURL=useNavbarConfig-CxVplYul.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNavbarConfig-CxVplYul.js","names":[],"sources":["../src/client/composables/useNavbarConfig.ts"],"sourcesContent":["import { isLinkRelative } from '@vuepress/helper/client'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { isString } from 'vuepress/shared'\n\nimport { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { resolvePrefix } from '@theme/resolvePrefix'\nimport { useData } from '@theme/useData'\n\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":"0RAeA,MAAM,GACJ,EACA,EAAS,KAEL,EAAS,CAAI,EAAU,EAAgB,EAAc,EAAQ,CAAI,CAAC,EAElE,aAAc,EACT,CACL,GAAG,EACH,SAAU,EAAK,SAAS,IAAK,GAC3B,EAAkB,EAAO,EAAc,EAAQ,EAAK,MAAM,CAAC,CAC7D,CACF,EAGK,CACL,GAAG,EACH,KAAM,EAAe,EAAK,IAAI,EAC1B,EAAgB,EAAc,EAAQ,EAAK,IAAI,CAAC,CAAC,CAAC,KAClD,EAAK,IACX,EAGW,MAAmD,CAC9D,GAAM,CAAE,eAAgB,EAAQ,EAEhC,OAAO,OACJ,EAAY,MAAM,QAAU,CAAC,EAAA,CAAG,IAAK,GAAS,EAAkB,CAAI,CAAC,CACxE,CACF"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as NavbarItem } from "./typings-
|
|
1
|
+
import { t as NavbarItem } from "./typings-CiGFIZqG.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
7
|
export { useNavbarConfig as t };
|
|
8
|
-
//# sourceMappingURL=useNavbarConfig-
|
|
8
|
+
//# sourceMappingURL=useNavbarConfig-fLxvBobP.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isLinkHttp as e}from"vuepress/shared";import{computed as t}from"vue";import{useData as n}from"@theme/useData";import{resolveRepoType as r}from"@theme/resolveRepoType";const i=()=>{let{themeLocale:i}=n(),a=t(()=>i.value.repo),o=t(()=>a.value?r(a.value):null),s=t(()=>a.value&&!e(a.value)?`https://github.com/${a.value}`:a.value),c=t(()=>s.value?i.value.repoLabel?i.value.repoLabel:o.value==null?`Source`:o.value:null);return t(()=>!s.value||!c.value?[]:[{text:c.value,link:s.value}])};export{i as t};
|
|
2
|
+
//# sourceMappingURL=useNavbarRepo-BScd94be.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNavbarRepo-BScd94be.js","names":[],"sources":["../src/client/composables/useNavbarRepo.ts"],"sourcesContent":["import type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { isLinkHttp } from 'vuepress/shared'\n\nimport { resolveRepoType } from '@theme/resolveRepoType'\nimport { useData } from '@theme/useData'\n\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":"8KAcA,MAAa,MAAiD,CAC5D,GAAM,CAAE,eAAgB,EAAQ,EAE1B,EAAO,MAAe,EAAY,MAAM,IAAI,EAC5C,EAAW,MACf,EAAK,MAAQ,EAAgB,EAAK,KAAK,EAAI,IAC7C,EAEM,EAAW,MACX,EAAK,OAAS,CAAC,EAAW,EAAK,KAAK,EAC/B,sBAAsB,EAAK,QAE7B,EAAK,KACb,EAEK,EAAY,MACX,EAAS,MACV,EAAY,MAAM,UAAkB,EAAY,MAAM,UACtD,EAAS,OAAS,KAAa,SAC5B,EAAS,MAHY,IAI7B,EAED,OAAO,MACD,CAAC,EAAS,OAAS,CAAC,EAAU,MAAc,CAAC,EAE1C,CACL,CACE,KAAM,EAAU,MAChB,KAAM,EAAS,KACjB,CACF,CACD,CACH"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as NavbarItem } from "./typings-
|
|
1
|
+
import { t as NavbarItem } from "./typings-CiGFIZqG.js";
|
|
2
2
|
import { ComputedRef } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/client/composables/useNavbarRepo.d.ts
|
|
@@ -10,4 +10,4 @@ import { ComputedRef } from "vue";
|
|
|
10
10
|
declare const useNavbarRepo: () => ComputedRef<NavbarItem[]>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useNavbarRepo as t };
|
|
13
|
-
//# sourceMappingURL=useNavbarRepo-
|
|
13
|
+
//# sourceMappingURL=useNavbarRepo-DndxHxeK.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useRoutePaths as e}from"@vuepress/helper/client";import{useRoute as t}from"vuepress/client";import{useMounted as n}from"@vueuse/core";import{computed as r}from"vue";import{useData as i}from"@theme/useData";const a=()=>{let a=t(),o=e(),{routeLocale:s,site:c,siteLocale:l,theme:u,themeLocale:d}=i(),f=n();return r(()=>{let e=Object.keys(c.value.locales);if(e.length<2)return[];let t=a.path,n=a.fullPath;return[{text:`${d.value.selectLanguageText}`,ariaLabel:`${d.value.selectLanguageAriaLabel??d.value.selectLanguageText}`,children:e.map(e=>{let r=c.value.locales?.[e]??{},i=u.value.locales?.[e]??{},a=`${r.lang}`,d=i.selectLanguageName??a;if(a===l.value.lang)return{text:d,activeMatch:`.`,link:f.value?n:t};let p=t.replace(s.value,e);return{text:d,link:o.value.some(e=>e===p)?f.value?n.replace(t,p):p:i.home??e}})}]})};export{a as t};
|
|
2
|
+
//# sourceMappingURL=useNavbarSelectLanguage-FHyzHFEW.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNavbarSelectLanguage-FHyzHFEW.js","names":["useData"],"sources":["../src/client/composables/useNavbarSelectLanguage.ts"],"sourcesContent":["import { useRoutePaths } from '@vuepress/helper/client'\nimport { useMounted } from '@vueuse/core'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { useRoute } from 'vuepress/client'\n\nimport { useData } from '@theme/useData'\n\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":"qNAeA,MAAa,MAA2D,CACtE,IAAM,EAAQ,EAAS,EACjB,EAAa,EAAc,EAC3B,CAAE,cAAa,OAAM,aAAY,QAAO,eAAgBA,EAAQ,EAEhE,EAAY,EAAW,EAE7B,OAAO,MAA6B,CAClC,IAAM,EAAc,OAAO,KAAK,EAAK,MAAM,OAAO,EAElD,GAAI,EAAY,OAAS,EAAG,MAAO,CAAC,EAEpC,IAAM,EAAc,EAAM,KACpB,EAAkB,EAAM,SA8C9B,MAAO,CAAC,CA3CN,KAAM,GAAG,EAAY,MAAM,qBAC3B,UAAW,GACT,EAAY,MAAM,yBAClB,EAAY,MAAM,qBAEpB,SAAU,EAAY,IAAK,GAAqB,CAE9C,IAAM,EAAmB,EAAK,MAAM,UAAU,IAAqB,CAAC,EAC9D,EAAoB,EAAM,MAAM,UAAU,IAAqB,CAAC,EAChE,EAAa,GAAG,EAAiB,OAEjC,EAAO,EAAkB,oBAAsB,EAIrD,GAAI,IAAe,EAAW,MAAM,KAClC,MAAO,CACL,OACA,YAAa,IACb,KAAM,EAAU,MAAQ,EAAkB,CAC5C,EAMF,IAAM,EAAmB,EAAY,QACnC,EAAY,MACZ,CACF,EAEA,MAAO,CACL,OAEA,KAAM,EAAW,MAAM,KAAM,GAAS,IAAS,CAAgB,EAC3D,EAAU,MACR,EAAgB,QAAQ,EAAa,CAAgB,EACrD,EACD,EAAkB,MAAQ,CACjC,CACF,CAAC,CAGoB,CAAC,CAC1B,CAAC,CACH"}
|
package/dist/{useNavbarSelectLanguage-DMcyeLfA.d.ts → useNavbarSelectLanguage-a9ZpUKwM.d.ts}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { t as NavbarItem } from "./typings-
|
|
1
|
+
import { t as NavbarItem } from "./typings-CiGFIZqG.js";
|
|
2
2
|
import { ComputedRef } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/client/composables/useNavbarSelectLanguage.d.ts
|
|
@@ -10,4 +10,4 @@ import { ComputedRef } from "vue";
|
|
|
10
10
|
declare const useNavbarSelectLanguage: () => ComputedRef<NavbarItem[]>;
|
|
11
11
|
//#endregion
|
|
12
12
|
export { useNavbarSelectLanguage as t };
|
|
13
|
-
//# sourceMappingURL=useNavbarSelectLanguage-
|
|
13
|
+
//# sourceMappingURL=useNavbarSelectLanguage-a9ZpUKwM.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isLinkAbsolute as e,isLinkWithProtocol as t}from"@vuepress/helper/client";import{useRoute as n,useRouter as r}from"vuepress/client";const i=()=>{let i=r(),a=n();return n=>{n&&(e(n)?a.fullPath!==n&&i.push(n):t(n)?window.open(n):i.push(encodeURI(n)))}};export{i as t};
|
|
2
|
+
//# sourceMappingURL=useNavigate-mlFey3ew.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useNavigate-mlFey3ew.js","names":[],"sources":["../src/client/composables/useNavigate.ts"],"sourcesContent":["import { isLinkAbsolute, isLinkWithProtocol } from '@vuepress/helper/client'\nimport { useRoute, useRouter } from 'vuepress/client'\n\nexport const useNavigate = (): ((url: string) => void) => {\n const router = useRouter()\n const route = useRoute()\n\n return (url) => {\n if (url) {\n if (isLinkAbsolute(url)) {\n // Inner absolute path\n if (route.fullPath !== url) void router.push(url)\n } else if (isLinkWithProtocol(url)) {\n // external url\n window.open(url)\n } else {\n // relative url\n void router.push(encodeURI(url))\n }\n }\n }\n}\n"],"mappings":"2IAGA,MAAa,MAA6C,CACxD,IAAM,EAAS,EAAU,EACnB,EAAQ,EAAS,EAEvB,MAAQ,IAAQ,CACV,IACE,EAAe,CAAG,EAEhB,EAAM,WAAa,GAAK,EAAY,KAAK,CAAG,EACvC,EAAmB,CAAG,EAE/B,OAAO,KAAK,CAAG,EAGf,EAAY,KAAK,UAAU,CAAG,CAAC,EAGrC,CACF"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isPlainObject as e,isString as t}from"vuepress/shared";import{resolveRoute as n,useRoutePath as r}from"vuepress/client";import{useSidebarItems as i}from"@theme/useSidebarItems";import{computed as a}from"vue";import{useData as o}from"@theme/useData";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,r)=>{let i=e.findIndex(e=>e.link===t);if(i!==-1){let t=e[i+r];return t?t.link?t:`prefix`in t&&!n(t.prefix).notFound?{...t,link:t.prefix}:null:null}for(let n of e)if(`children`in n){let e=l(n.children,t,r);if(e)return e}let a=e.findIndex(e=>`prefix`in e&&e.prefix===t);if(a!==-1){let t=e[a+r];return t?t.link?t:`prefix`in t&&!n(t.prefix).notFound?{...t,link:t.prefix}:null:null}return null},u=()=>{let{frontmatter:e,themeLocale:t}=o(),n=i(),s=r();return{prevLink:a(()=>{let r=c(e.value.prev,s.value);return r===!1?null:r??(t.value.prev===!1?null:l(n.value,s.value,-1))}),nextLink:a(()=>{let r=c(e.value.next,s.value);return r===!1?null:r??(t.value.next===!1?null:l(n.value,s.value,1))})}};export{u as t};
|
|
2
|
+
//# sourceMappingURL=useRelatedLinks-BwsPumn1.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useRelatedLinks-BwsPumn1.js","names":["useData"],"sources":["../src/client/composables/useRelatedLinks.ts"],"sourcesContent":["import type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { resolveRoute, useRoutePath } from 'vuepress/client'\nimport { isPlainObject, isString } from 'vuepress/shared'\n\nimport { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { useData } from '@theme/useData'\nimport { useSidebarItems } from '@theme/useSidebarItems'\n\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\n * `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":"yTAYA,MAAM,GACJ,EACA,IAEI,IAAW,GAAc,GAEzB,EAAS,CAAM,EAAU,EAAgB,EAAQ,CAAW,EAE5D,EAAc,CAAM,EACf,CACL,GAAG,EACH,KAAM,EAAgB,EAAO,KAAM,CAAW,CAAC,CAAC,IAClD,EAGK,KAWH,GACJ,EACA,EACA,IAC2B,CAC3B,IAAM,EAAY,EAAa,UAAW,GAAS,EAAK,OAAS,CAAW,EAE5E,GAAI,IAAc,GAAI,CACpB,IAAM,EAAa,EAAa,EAAY,GAe5C,OAXK,EAED,EAAW,KAAa,EAExB,WAAY,GAAc,CAAC,EAAa,EAAW,MAAO,CAAC,CAAC,SACvD,CACL,GAAG,EACH,KAAM,EAAW,MACnB,EAGK,KAXiB,IAY1B,CAEA,IAAK,IAAM,KAAQ,EACjB,GAAI,aAAc,EAAM,CACtB,IAAM,EAAc,EAClB,EAAK,SACL,EACA,CACF,EAEA,GAAI,EAAa,OAAO,CAC1B,CAGF,IAAM,EAAc,EAAa,UAC9B,GAAS,WAAY,GAAQ,EAAK,SAAW,CAChD,EAEA,GAAI,IAAgB,GAAI,CACtB,IAAM,EAAa,EAAa,EAAc,GAe9C,OAXK,EAED,EAAW,KAAa,EAExB,WAAY,GAAc,CAAC,EAAa,EAAW,MAAO,CAAC,CAAC,SACvD,CACL,GAAG,EACH,KAAM,EAAW,MACnB,EAGK,KAXiB,IAY1B,CAEA,OAAO,IACT,EAOa,MAAsC,CACjD,GAAM,CAAE,cAAa,eAAgBA,EAAQ,EACvC,EAAe,EAAgB,EAC/B,EAAY,EAAa,EA8B/B,MAAO,CACL,SA7Be,MAAe,CAC9B,IAAM,EAAa,EACjB,EAAY,MAAM,KAClB,EAAU,KACZ,EAEA,OAAO,IAAe,GAClB,KACC,IACE,EAAY,MAAM,OAAS,GACxB,KACA,EAAwB,EAAa,MAAO,EAAU,MAAO,EAAE,EAC3E,CAiBS,EACP,SAhBe,MAAe,CAC9B,IAAM,EAAa,EACjB,EAAY,MAAM,KAClB,EAAU,KACZ,EAEA,OAAO,IAAe,GAClB,KACC,IACE,EAAY,MAAM,OAAS,GACxB,KACA,EAAwB,EAAa,MAAO,EAAU,MAAO,CAAC,EAC1E,CAIS,CACT,CACF"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as AutoLinkOptions } from "./index-
|
|
1
|
+
import { v as AutoLinkOptions } from "./index-ur5YvkCJ.js";
|
|
2
2
|
import { ComputedRef } from "vue";
|
|
3
3
|
|
|
4
4
|
//#region src/client/composables/useRelatedLinks.d.ts
|
|
@@ -9,4 +9,4 @@ interface RelatedLinks {
|
|
|
9
9
|
declare const useRelatedLinks: () => RelatedLinks;
|
|
10
10
|
//#endregion
|
|
11
11
|
export { useRelatedLinks as t };
|
|
12
|
-
//# sourceMappingURL=useRelatedLinks-
|
|
12
|
+
//# sourceMappingURL=useRelatedLinks-DxkE-gdP.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useScrollPromise-CB6ZLciv.js","names":[],"sources":["../src/client/composables/useScrollPromise.ts"],"sourcesContent":["export interface ScrollPromise {\n wait: () => Promise<void> | null\n pending: () => void\n resolve: () => void\n}\n\nlet promise: Promise<void> | null = null\nlet promiseResolve: (() => void) | null = null\n\nconst scrollPromise: ScrollPromise = {\n wait: () => promise,\n pending: () => {\n promise = new Promise((resolve) => {\n promiseResolve = resolve\n })\n },\n resolve: () => {\n promiseResolve?.()\n promise = null\n promiseResolve = null\n },\n}\n\nexport const useScrollPromise = (): ScrollPromise => scrollPromise\n"],"mappings":"AAMA,IAAI,EAAgC,KAChC,EAAsC,KAE1C,MAAM,EAA+B,CACnC,SAAY,EACZ,YAAe,CACb,EAAU,IAAI,QAAS,GAAY,CACjC,EAAiB,CACnB,CAAC,CACH,EACA,YAAe,CACb,IAAiB,EACjB,EAAU,KACV,EAAiB,IACnB,CACF,EAEa,MAAwC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
//#region src/client/composables/useScrollPromise.d.ts
|
|
2
2
|
interface ScrollPromise {
|
|
3
|
-
wait()
|
|
3
|
+
wait: () => Promise<void> | null;
|
|
4
4
|
pending: () => void;
|
|
5
5
|
resolve: () => void;
|
|
6
6
|
}
|
|
7
7
|
declare const useScrollPromise: () => ScrollPromise;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { useScrollPromise as n, ScrollPromise as t };
|
|
10
|
-
//# sourceMappingURL=useScrollPromise-
|
|
10
|
+
//# sourceMappingURL=useScrollPromise-TwtWBE3d.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isPlainObject as e,isString as t}from"vuepress/shared";import{isLinkRelative as n,keys as r,startsWith as i}from"@vuepress/helper/client";import{useRoutePath as a}from"vuepress/client";import{useHeaders as o}from"@theme/useHeaders";import{computed as s,inject as c,provide as l}from"vue";import{useData as u}from"@theme/useData";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,r,i,a=``)=>{let o=(e,a)=>{let s=t(e)?d(f(a,e)):t(e.link)?{...e,link:n(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=r[0]?.level===1?r[0].children:r;return{...s,children:m(e)}}return s};return e.map(e=>o(e,a))},_=(e,t,n,a)=>{let o=r(e).sort((e,t)=>t.length-e.length);for(let r of o)if(i(decodeURI(a),r)){let i=e[r];return i===!1?[]:i===`heading`?h(t,n):g(i,n,a,r)}return console.warn(`${decodeURI(a)} is missing sidebar config.`),[]},v=Symbol(`sidebarItems`),y=()=>{let e=c(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:n,themeLocale:r}=u(),i=o(),c=a(),d=s(()=>!e.value.home&&(e.value.sidebar??r.value.sidebar??`heading`));l(v,s(()=>b(d.value,t.value,c.value,n.value,i.value)))};export{p as a,v as c,b as i,y as l,_ as n,m as o,h as r,x as s,g as t};
|
|
2
|
+
//# sourceMappingURL=useSidebarItems-CL0nJ7E8.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useSidebarItems-CL0nJ7E8.js","names":["useData"],"sources":["../src/client/composables/useSidebarItems.ts"],"sourcesContent":["import { 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'\n\nimport { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { resolvePrefix } from '@theme/resolvePrefix'\nimport { useData } from '@theme/useData'\nimport { useHeaders } from '@theme/useHeaders'\n\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\n * `heading`\n *\n * @param page Current page data\n * @param headers Current page headers\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 * @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)\n * 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 * @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 // oxlint-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 * @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/** Create sidebar items ref and provide as global computed in setup */\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":"8bA4BA,MAAa,EACX,IACuB,CACvB,KAAM,EAAO,MACb,KAAM,EAAO,KAEb,SAAU,EAA0B,EAAO,QAAQ,CACrD,GAQa,EACX,GAEA,EAAU,EAAQ,IAAK,GAAW,EAAyB,CAAM,CAAC,EAAI,CAAC,EAU5D,GACX,EACA,IACkB,CAClB,CACE,KAAM,EAAK,MACX,SAAU,EAA0B,CAAO,CAC7C,CACF,EAWa,GACX,EACA,EACA,EACA,EAAS,KACS,CAClB,IAAM,GACJ,EACA,IACgB,CAChB,IAAM,EAAgC,EAAS,CAAI,EAC/C,EAAgB,EAAc,EAAY,CAAI,CAAC,EAC/C,EAAS,EAAK,IAAI,EAChB,CACE,GAAG,EACH,KAAM,EAAe,EAAK,IAAI,EAC1B,EAAgB,EAAc,EAAY,EAAK,IAAI,CAAC,CAAC,CAAC,KACtD,EAAK,IACX,EACA,EAEN,GAAI,aAAc,EAChB,MAAO,CACL,GAAG,EACH,SAAU,EAAU,SAAS,IAAK,GAChC,EAAgB,EAAO,EAAc,EAAY,EAAU,MAAM,CAAC,CACpE,CACF,EAKF,GAAI,EAAU,OAAS,EAAM,CAE3B,IAAM,EACJ,EAAQ,EAAE,EAAE,QAAU,EAAI,EAAQ,EAAE,CAAC,SAAW,EAElD,MAAO,CACL,GAAG,EACH,SAAU,EAA0B,CAAc,CACpD,CACF,CAEA,OAAO,CACT,EAEA,OAAO,EAAc,IAAK,GAAS,EAAgB,EAAM,CAAM,CAAC,CAClE,EAYa,GACX,EACA,EACA,EACA,IACkB,CAClB,IAAM,EAAgB,EAAK,CAAa,CAAC,CAAC,MAAM,EAAG,IAAM,EAAE,OAAS,EAAE,MAAM,EAG5E,IAAK,IAAM,KAAQ,EACjB,GAAI,EAAW,UAAU,CAAI,EAAG,CAAI,EAAG,CACrC,IAAM,EAAU,EAAc,GAE9B,OAAO,IAAY,GACf,CAAC,EACD,IAAY,UACV,EAA0B,EAAM,CAAO,EACvC,EAAyB,EAAS,EAAS,EAAM,CAAI,CAC7D,CAMF,OAFA,QAAQ,KAAK,GAAG,UAAU,CAAI,EAAE,4BAA4B,EAErD,CAAC,CACV,EAIa,EACX,OAAO,cAAc,EAOV,MAAyC,CACpD,IAAM,EAAe,EAAO,CAAkB,EAC9C,GAAI,CAAC,EACH,MAAU,MAAM,+CAA+C,EAEjE,OAAO,CACT,EAea,GACX,EACA,EACA,EACA,EACA,IAGI,IAAkB,GAAc,CAAC,EAEjC,IAAkB,UACb,EAA0B,EAAM,CAAO,EAE5C,MAAM,QAAQ,CAAa,EACtB,EAAyB,EAAe,EAAS,EAAM,CAAW,EAEvE,EAAc,CAAa,EACtB,EAAyB,EAAe,EAAM,EAAS,CAAI,EAE7D,CAAC,EAIG,MAAgC,CAC3C,GAAM,CAAE,cAAa,OAAM,cAAa,eAAgBA,EAEtD,EACI,EAAU,EAAW,EACrB,EAAY,EAAa,EAEzB,EAAgB,MAElB,CAAC,EAAY,MAAM,OACjB,EAAY,MAA4C,SACxD,EAAY,MAAM,SAClB,UACN,EAWA,EAAQ,EATa,MACnB,EACE,EAAc,MACd,EAAK,MACL,EAAU,MACV,EAAY,MACZ,EAAQ,KACV,CAEqC,CAAC,CAC1C"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { c as SidebarArrayOptions, f as SidebarObjectOptions, p as SidebarOptions } from "./index-
|
|
2
|
-
import { i as SidebarItem, r as SidebarHeaderItem } from "./typings-
|
|
1
|
+
import { c as SidebarArrayOptions, f as SidebarObjectOptions, p as SidebarOptions } from "./index-ur5YvkCJ.js";
|
|
2
|
+
import { i as SidebarItem, r as SidebarHeaderItem } from "./typings-CiGFIZqG.js";
|
|
3
3
|
import { PageData, PageHeader } from "vuepress/client";
|
|
4
4
|
import { ComputedRef, InjectionKey } from "vue";
|
|
5
5
|
|
|
@@ -73,4 +73,4 @@ declare const resolveSidebarItems: (sidebarConfig: SidebarOptions | false, page:
|
|
|
73
73
|
declare const setupSidebarItems: () => void;
|
|
74
74
|
//#endregion
|
|
75
75
|
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 };
|
|
76
|
-
//# sourceMappingURL=useSidebarItems-
|
|
76
|
+
//# sourceMappingURL=useSidebarItems-aGO1YtUp.d.ts.map
|
|
@@ -12,4 +12,4 @@ declare enum DeviceType {
|
|
|
12
12
|
declare const useUpdateDeviceStatus: (deviceType: DeviceType, callback: (width: number) => void) => void;
|
|
13
13
|
//#endregion
|
|
14
14
|
export { useUpdateDeviceStatus as n, DeviceType as t };
|
|
15
|
-
//# sourceMappingURL=useUpdateDeviceStatus-
|
|
15
|
+
//# sourceMappingURL=useUpdateDeviceStatus-CsrJ_Qqv.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{useEventListener as e}from"@vueuse/core";import{onMounted as t}from"vue";import n from"./client/styles/_variables.module.scss";let r=function(e){return e.Mobile=`mobile`,e}({});const i={mobile:Number(n.mobile.replace(`px`,``))},a=(n,r)=>{let a=i[n];if(!Number.isInteger(a)){if(__VUEPRESS_DEV__)throw Error(`device width must be a integer`);return}e(`orientationchange`,()=>{r(a)}),e(`resize`,()=>{r(a)}),t(()=>{r(a)})};export{a as n,r as t};
|
|
2
|
+
//# sourceMappingURL=useUpdateDeviceStatus-DMKiVB3W.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useUpdateDeviceStatus-DMKiVB3W.js","names":[],"sources":["../src/client/composables/useUpdateDeviceStatus.ts"],"sourcesContent":["// oxlint-disable promise/prefer-await-to-callbacks\nimport { useEventListener } from '@vueuse/core'\nimport { onMounted } from 'vue'\n\nimport cssVariables from '../styles/_variables.module.scss'\n\nexport enum DeviceType {\n Mobile = 'mobile',\n}\n\nconst DeviceTypeMap = {\n [DeviceType.Mobile]: Number(cssVariables.mobile.replace('px', '')),\n}\n\n/**\n * Add listener to detect screen though device type\n *\n * @param deviceType - Device type to detect / 要检测的设备类型\n * @param callback - Callback function to call when device status changes /\n * 设备状态改变时调用的回调函数\n */\nexport const useUpdateDeviceStatus = (\n deviceType: DeviceType,\n callback: (width: number) => void,\n): void => {\n const width = DeviceTypeMap[deviceType]\n if (!Number.isInteger(width)) {\n if (__VUEPRESS_DEV__) throw new Error('device width must be a integer')\n return\n }\n\n useEventListener('orientationchange', () => {\n callback(width)\n })\n useEventListener('resize', () => {\n callback(width)\n })\n\n onMounted(() => {\n callback(width)\n })\n}\n"],"mappings":"sIAMA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,OAAA,UACF,EAAA,CAAA,CAAA,EAEA,MAAM,EAAgB,CAAA,OACC,OAAO,EAAa,OAAO,QAAQ,KAAM,EAAE,CAAC,CACnE,EASa,GACX,EACA,IACS,CACT,IAAM,EAAQ,EAAc,GAC5B,GAAI,CAAC,OAAO,UAAU,CAAK,EAAG,CAC5B,GAAI,iBAAkB,MAAU,MAAM,gCAAgC,EACtE,MACF,CAEA,EAAiB,wBAA2B,CAC1C,EAAS,CAAK,CAChB,CAAC,EACD,EAAiB,aAAgB,CAC/B,EAAS,CAAK,CAChB,CAAC,EAED,MAAgB,CACd,EAAS,CAAK,CAChB,CAAC,CACH"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export{};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/theme-default",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.131",
|
|
4
4
|
"description": "Default theme of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"default",
|
|
@@ -54,28 +54,28 @@
|
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
56
|
"dependencies": {
|
|
57
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
58
|
-
"@vuepress/plugin-active-header-links": "2.0.0-rc.
|
|
59
|
-
"@vuepress/plugin-back-to-top": "2.0.0-rc.
|
|
60
|
-
"@vuepress/plugin-copy-code": "2.0.0-rc.
|
|
61
|
-
"@vuepress/plugin-git": "2.0.0-rc.
|
|
62
|
-
"@vuepress/plugin-links-check": "2.0.0-rc.
|
|
63
|
-
"@vuepress/plugin-markdown-hint": "2.0.0-rc.
|
|
64
|
-
"@vuepress/plugin-markdown-tab": "2.0.0-rc.
|
|
65
|
-
"@vuepress/plugin-medium-zoom": "2.0.0-rc.
|
|
66
|
-
"@vuepress/plugin-nprogress": "2.0.0-rc.
|
|
67
|
-
"@vuepress/plugin-palette": "2.0.0-rc.
|
|
68
|
-
"@vuepress/plugin-prismjs": "2.0.0-rc.
|
|
69
|
-
"@vuepress/plugin-seo": "2.0.0-rc.
|
|
70
|
-
"@vuepress/plugin-sitemap": "2.0.0-rc.
|
|
71
|
-
"@vuepress/plugin-theme-data": "2.0.0-rc.
|
|
57
|
+
"@vuepress/helper": "2.0.0-rc.131",
|
|
58
|
+
"@vuepress/plugin-active-header-links": "2.0.0-rc.131",
|
|
59
|
+
"@vuepress/plugin-back-to-top": "2.0.0-rc.131",
|
|
60
|
+
"@vuepress/plugin-copy-code": "2.0.0-rc.131",
|
|
61
|
+
"@vuepress/plugin-git": "2.0.0-rc.131",
|
|
62
|
+
"@vuepress/plugin-links-check": "2.0.0-rc.131",
|
|
63
|
+
"@vuepress/plugin-markdown-hint": "2.0.0-rc.131",
|
|
64
|
+
"@vuepress/plugin-markdown-tab": "2.0.0-rc.131",
|
|
65
|
+
"@vuepress/plugin-medium-zoom": "2.0.0-rc.131",
|
|
66
|
+
"@vuepress/plugin-nprogress": "2.0.0-rc.131",
|
|
67
|
+
"@vuepress/plugin-palette": "2.0.0-rc.131",
|
|
68
|
+
"@vuepress/plugin-prismjs": "2.0.0-rc.131",
|
|
69
|
+
"@vuepress/plugin-seo": "2.0.0-rc.131",
|
|
70
|
+
"@vuepress/plugin-sitemap": "2.0.0-rc.131",
|
|
71
|
+
"@vuepress/plugin-theme-data": "2.0.0-rc.131",
|
|
72
72
|
"@vueuse/core": "^14.3.0",
|
|
73
|
-
"vue": "^3.5.
|
|
73
|
+
"vue": "^3.5.39"
|
|
74
74
|
},
|
|
75
75
|
"peerDependencies": {
|
|
76
|
-
"sass": "^1.
|
|
77
|
-
"sass-embedded": "^1.
|
|
78
|
-
"sass-loader": "^
|
|
76
|
+
"sass": "^1.101.0",
|
|
77
|
+
"sass-embedded": "^1.100.0",
|
|
78
|
+
"sass-loader": "^17.0.0",
|
|
79
79
|
"vuepress": "2.0.0-rc.30"
|
|
80
80
|
},
|
|
81
81
|
"peerDependenciesMeta": {
|
|
@@ -89,5 +89,5 @@
|
|
|
89
89
|
"optional": true
|
|
90
90
|
}
|
|
91
91
|
},
|
|
92
|
-
"gitHead": "
|
|
92
|
+
"gitHead": "57a09d0808e424fe729d29ef8352d8cff9f30b16"
|
|
93
93
|
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useDarkMode.js","names":[],"sources":["../../../src/client/composables/useDarkMode.ts"],"sourcesContent":["import { 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\nimport { useData } from '@theme/useData'\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/** Create dark mode ref and provide as global computed in setup */\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":"8QASA,MAAM,EAAU,GAAyB,CAEvC,IAAM,EAAK,WAAW,SAAS,gBAG/B,EAAG,QAAQ,MAAQ,EAAQ,OAAS,OACtC,EAEM,EAAuB,GAAkC,CAC7D,MAAgB,CACd,EAAe,EAAY,CAAM,CACnC,CAAC,EAED,MAAkB,CAChB,EAAO,EAAW,KAAK,CACzB,CAAC,CACH,EASa,MAAiC,CAC5C,IAAM,EAAa,EAAqC,CAAc,EACtE,GAAI,CAAC,EAAY,MAAU,MAAM,2CAA2C,EAE5E,OAAO,CACT,EAGa,MAA4B,CACvC,GAAM,CAAE,eAAgB,EAAQ,EAC1B,EAAkB,EAAiB,EACnC,EAAc,EAClB,wBACA,EAAY,MAAM,SACpB,EAEM,EAAa,EAAkB,CACnC,KAAM,CASJ,OAPK,EAAY,MAAM,gBAInB,EAAY,QAAU,OAAe,EAAgB,MAGlD,EAAY,QAAU,OANpB,EAAY,MAAM,YAAc,MAO3C,EACA,IAAI,EAAK,CACH,IAAQ,EAAgB,MAAO,EAAY,MAAQ,OAClD,EAAY,MAAQ,EAAM,OAAS,OAC1C,CACF,CAAC,EACD,EAAQ,EAAgB,CAAU,EAElC,EAAoB,CAAU,CAChC"}
|
|
@@ -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'\n\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":"oIA0CA,MAAa,OAI4B,CACvC,GAAGA,EAAoC,EACvC,MAAO,EAA+B,EACtC,YAAa,EAAqC,CACpD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useEditLink.js","names":[],"sources":["../../../src/client/composables/useEditLink.ts"],"sourcesContent":["import type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport type { AutoLinkConfig } from 'vuepress/client'\n\nimport { resolveEditLink } from '@theme/resolveEditLink'\nimport { useData } from '@theme/useData'\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":"iIAOA,MAAa,MAAwD,CACnE,GAAM,CAAE,cAAa,OAAM,eAAgB,EAAQ,EAEnD,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,eAC3D,CAAC,EAID,OAFK,EAEE,CACL,KAAM,GAAgB,iBACtB,KAAM,CACR,EALsB,IAMxB,CAAC,CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useNavbarConfig.js","names":[],"sources":["../../../src/client/composables/useNavbarConfig.ts"],"sourcesContent":["import { isLinkRelative } from '@vuepress/helper/client'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { isString } from 'vuepress/shared'\n\nimport { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { resolvePrefix } from '@theme/resolvePrefix'\nimport { useData } from '@theme/useData'\n\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":"0RAeA,MAAM,GACJ,EACA,EAAS,KAEL,EAAS,CAAI,EAAU,EAAgB,EAAc,EAAQ,CAAI,CAAC,EAElE,aAAc,EACT,CACL,GAAG,EACH,SAAU,EAAK,SAAS,IAAK,GAC3B,EAAkB,EAAO,EAAc,EAAQ,EAAK,MAAM,CAAC,CAC7D,CACF,EAGK,CACL,GAAG,EACH,KAAM,EAAe,EAAK,IAAI,EAC1B,EAAgB,EAAc,EAAQ,EAAK,IAAI,CAAC,EAAE,KAClD,EAAK,IACX,EAGW,MAAmD,CAC9D,GAAM,CAAE,eAAgB,EAAQ,EAEhC,OAAO,OACJ,EAAY,MAAM,QAAU,CAAC,GAAG,IAAK,GAAS,EAAkB,CAAI,CAAC,CACxE,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useNavbarRepo.js","names":[],"sources":["../../../src/client/composables/useNavbarRepo.ts"],"sourcesContent":["import type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { isLinkHttp } from 'vuepress/shared'\n\nimport { resolveRepoType } from '@theme/resolveRepoType'\nimport { useData } from '@theme/useData'\n\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":"8KAcA,MAAa,MAAiD,CAC5D,GAAM,CAAE,eAAgB,EAAQ,EAE1B,EAAO,MAAe,EAAY,MAAM,IAAI,EAC5C,EAAW,MACf,EAAK,MAAQ,EAAgB,EAAK,KAAK,EAAI,IAC7C,EAEM,EAAW,MACX,EAAK,OAAS,CAAC,EAAW,EAAK,KAAK,EAC/B,sBAAsB,EAAK,QAE7B,EAAK,KACb,EAEK,EAAY,MACX,EAAS,MACV,EAAY,MAAM,UAAkB,EAAY,MAAM,UACtD,EAAS,OAAS,KAAa,SAC5B,EAAS,MAHY,IAI7B,EAED,OAAO,MACD,CAAC,EAAS,OAAS,CAAC,EAAU,MAAc,CAAC,EAE1C,CACL,CACE,KAAM,EAAU,MAChB,KAAM,EAAS,KACjB,CACF,CACD,CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useNavbarSelectLanguage.js","names":["useData"],"sources":["../../../src/client/composables/useNavbarSelectLanguage.ts"],"sourcesContent":["import { useRoutePaths } from '@vuepress/helper/client'\nimport { useMounted } from '@vueuse/core'\nimport type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { useRoute } from 'vuepress/client'\n\nimport { useData } from '@theme/useData'\n\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":"qNAeA,MAAa,MAA2D,CACtE,IAAM,EAAQ,EAAS,EACjB,EAAa,EAAc,EAC3B,CAAE,cAAa,OAAM,aAAY,QAAO,eAAgBA,EAAQ,EAEhE,EAAY,EAAW,EAE7B,OAAO,MAA6B,CAClC,IAAM,EAAc,OAAO,KAAK,EAAK,MAAM,OAAO,EAElD,GAAI,EAAY,OAAS,EAAG,MAAO,CAAC,EAEpC,IAAM,EAAc,EAAM,KACpB,EAAkB,EAAM,SA8C9B,MAAO,CAAC,CA3CN,KAAM,GAAG,EAAY,MAAM,qBAC3B,UAAW,GACT,EAAY,MAAM,yBAClB,EAAY,MAAM,qBAEpB,SAAU,EAAY,IAAK,GAAqB,CAE9C,IAAM,EAAmB,EAAK,MAAM,UAAU,IAAqB,CAAC,EAC9D,EAAoB,EAAM,MAAM,UAAU,IAAqB,CAAC,EAChE,EAAa,GAAG,EAAiB,OAEjC,EAAO,EAAkB,oBAAsB,EAIrD,GAAI,IAAe,EAAW,MAAM,KAClC,MAAO,CACL,OACA,YAAa,IACb,KAAM,EAAU,MAAQ,EAAkB,CAC5C,EAMF,IAAM,EAAmB,EAAY,QACnC,EAAY,MACZ,CACF,EAEA,MAAO,CACL,OAEA,KAAM,EAAW,MAAM,KAAM,GAAS,IAAS,CAAgB,EAC3D,EAAU,MACR,EAAgB,QAAQ,EAAa,CAAgB,EACrD,EACD,EAAkB,MAAQ,CACjC,CACF,CAAC,CAGoB,CAAC,CAC1B,CAAC,CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useNavigate.js","names":[],"sources":["../../../src/client/composables/useNavigate.ts"],"sourcesContent":["import { isLinkAbsolute, isLinkWithProtocol } from '@vuepress/helper/client'\nimport { useRoute, useRouter } from 'vuepress/client'\n\nexport const useNavigate = (): ((url: string) => void) => {\n const router = useRouter()\n const route = useRoute()\n\n return (url) => {\n if (url) {\n if (isLinkAbsolute(url)) {\n // Inner absolute path\n if (route.fullPath !== url) void router.push(url)\n } else if (isLinkWithProtocol(url)) {\n // external url\n window.open(url)\n } else {\n // relative url\n void router.push(encodeURI(url))\n }\n }\n }\n}\n"],"mappings":"2IAGA,MAAa,MAA6C,CACxD,IAAM,EAAS,EAAU,EACnB,EAAQ,EAAS,EAEvB,MAAQ,IAAQ,CACV,IACE,EAAe,CAAG,EAEhB,EAAM,WAAa,GAAK,EAAY,KAAK,CAAG,EACvC,EAAmB,CAAG,EAE/B,OAAO,KAAK,CAAG,EAGf,EAAY,KAAK,UAAU,CAAG,CAAC,EAGrC,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useRelatedLinks.js","names":["useData"],"sources":["../../../src/client/composables/useRelatedLinks.ts"],"sourcesContent":["import type { ComputedRef } from 'vue'\nimport { computed } from 'vue'\nimport { resolveRoute, useRoutePath } from 'vuepress/client'\nimport { isPlainObject, isString } from 'vuepress/shared'\n\nimport { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { useData } from '@theme/useData'\nimport { useSidebarItems } from '@theme/useSidebarItems'\n\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\n * `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":"yTAYA,MAAM,GACJ,EACA,IAEI,IAAW,GAAc,GAEzB,EAAS,CAAM,EAAU,EAAgB,EAAQ,CAAW,EAE5D,EAAc,CAAM,EACf,CACL,GAAG,EACH,KAAM,EAAgB,EAAO,KAAM,CAAW,EAAE,IAClD,EAGK,KAWH,GACJ,EACA,EACA,IAC2B,CAC3B,IAAM,EAAY,EAAa,UAAW,GAAS,EAAK,OAAS,CAAW,EAE5E,GAAI,IAAc,GAAI,CACpB,IAAM,EAAa,EAAa,EAAY,GAe5C,OAXK,EAED,EAAW,KAAa,EAExB,WAAY,GAAc,CAAC,EAAa,EAAW,MAAO,EAAE,SACvD,CACL,GAAG,EACH,KAAM,EAAW,MACnB,EAGK,KAXiB,IAY1B,CAEA,IAAK,IAAM,KAAQ,EACjB,GAAI,aAAc,EAAM,CACtB,IAAM,EAAc,EAClB,EAAK,SACL,EACA,CACF,EAEA,GAAI,EAAa,OAAO,CAC1B,CAGF,IAAM,EAAc,EAAa,UAC9B,GAAS,WAAY,GAAQ,EAAK,SAAW,CAChD,EAEA,GAAI,IAAgB,GAAI,CACtB,IAAM,EAAa,EAAa,EAAc,GAe9C,OAXK,EAED,EAAW,KAAa,EAExB,WAAY,GAAc,CAAC,EAAa,EAAW,MAAO,EAAE,SACvD,CACL,GAAG,EACH,KAAM,EAAW,MACnB,EAGK,KAXiB,IAY1B,CAEA,OAAO,IACT,EAOa,MAAsC,CACjD,GAAM,CAAE,cAAa,eAAgBA,EAAQ,EACvC,EAAe,EAAgB,EAC/B,EAAY,EAAa,EA8B/B,MAAO,CACL,SA7Be,MAAe,CAC9B,IAAM,EAAa,EACjB,EAAY,MAAM,KAClB,EAAU,KACZ,EAEA,OAAO,IAAe,GAClB,KACC,IACE,EAAY,MAAM,OAAS,GACxB,KACA,EAAwB,EAAa,MAAO,EAAU,MAAO,EAAE,EAC3E,CAiBS,EACP,SAhBe,MAAe,CAC9B,IAAM,EAAa,EACjB,EAAY,MAAM,KAClB,EAAU,KACZ,EAEA,OAAO,IAAe,GAClB,KACC,IACE,EAAY,MAAM,OAAS,GACxB,KACA,EAAwB,EAAa,MAAO,EAAU,MAAO,CAAC,EAC1E,CAIS,CACT,CACF"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useScrollPromise.js","names":[],"sources":["../../../src/client/composables/useScrollPromise.ts"],"sourcesContent":["export interface ScrollPromise {\n wait(): Promise<void> | null\n pending: () => void\n resolve: () => void\n}\n\nlet promise: Promise<void> | null = null\nlet promiseResolve: (() => void) | null = null\n\nconst scrollPromise: ScrollPromise = {\n wait: () => promise,\n pending: () => {\n promise = new Promise((resolve) => {\n promiseResolve = resolve\n })\n },\n resolve: () => {\n promiseResolve?.()\n promise = null\n promiseResolve = null\n },\n}\n\nexport const useScrollPromise = (): ScrollPromise => scrollPromise\n"],"mappings":"AAMA,IAAI,EAAgC,KAChC,EAAsC,KAE1C,MAAM,EAA+B,CACnC,SAAY,EACZ,YAAe,CACb,EAAU,IAAI,QAAS,GAAY,CACjC,EAAiB,CACnB,CAAC,CACH,EACA,YAAe,CACb,IAAiB,EACjB,EAAU,KACV,EAAiB,IACnB,CACF,EAEa,MAAwC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useSidebarItems.js","names":["useData"],"sources":["../../../src/client/composables/useSidebarItems.ts"],"sourcesContent":["import { 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'\n\nimport { resolveAutoLink } from '@theme/resolveAutoLink'\nimport { resolvePrefix } from '@theme/resolvePrefix'\nimport { useData } from '@theme/useData'\nimport { useHeaders } from '@theme/useHeaders'\n\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\n * `heading`\n *\n * @param page Current page data\n * @param headers Current page headers\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 * @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)\n * 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 * @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 // oxlint-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 * @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/** Create sidebar items ref and provide as global computed in setup */\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":"8bA4BA,MAAa,EACX,IACuB,CACvB,KAAM,EAAO,MACb,KAAM,EAAO,KAEb,SAAU,EAA0B,EAAO,QAAQ,CACrD,GAQa,EACX,GAEA,EAAU,EAAQ,IAAK,GAAW,EAAyB,CAAM,CAAC,EAAI,CAAC,EAU5D,GACX,EACA,IACkB,CAClB,CACE,KAAM,EAAK,MACX,SAAU,EAA0B,CAAO,CAC7C,CACF,EAWa,GACX,EACA,EACA,EACA,EAAS,KACS,CAClB,IAAM,GACJ,EACA,IACgB,CAChB,IAAM,EAAgC,EAAS,CAAI,EAC/C,EAAgB,EAAc,EAAY,CAAI,CAAC,EAC/C,EAAS,EAAK,IAAI,EAChB,CACE,GAAG,EACH,KAAM,EAAe,EAAK,IAAI,EAC1B,EAAgB,EAAc,EAAY,EAAK,IAAI,CAAC,EAAE,KACtD,EAAK,IACX,EACA,EAEN,GAAI,aAAc,EAChB,MAAO,CACL,GAAG,EACH,SAAU,EAAU,SAAS,IAAK,GAChC,EAAgB,EAAO,EAAc,EAAY,EAAU,MAAM,CAAC,CACpE,CACF,EAKF,GAAI,EAAU,OAAS,EAAM,CAE3B,IAAM,EACJ,EAAQ,IAAI,QAAU,EAAI,EAAQ,GAAG,SAAW,EAElD,MAAO,CACL,GAAG,EACH,SAAU,EAA0B,CAAc,CACpD,CACF,CAEA,OAAO,CACT,EAEA,OAAO,EAAc,IAAK,GAAS,EAAgB,EAAM,CAAM,CAAC,CAClE,EAYa,GACX,EACA,EACA,EACA,IACkB,CAClB,IAAM,EAAgB,EAAK,CAAa,EAAE,MAAM,EAAG,IAAM,EAAE,OAAS,EAAE,MAAM,EAG5E,IAAK,IAAM,KAAQ,EACjB,GAAI,EAAW,UAAU,CAAI,EAAG,CAAI,EAAG,CACrC,IAAM,EAAU,EAAc,GAE9B,OAAO,IAAY,GACf,CAAC,EACD,IAAY,UACV,EAA0B,EAAM,CAAO,EACvC,EAAyB,EAAS,EAAS,EAAM,CAAI,CAC7D,CAMF,OAFA,QAAQ,KAAK,GAAG,UAAU,CAAI,EAAE,4BAA4B,EAErD,CAAC,CACV,EAIa,EACX,OAAO,cAAc,EAOV,MAAyC,CACpD,IAAM,EAAe,EAAO,CAAkB,EAC9C,GAAI,CAAC,EACH,MAAU,MAAM,+CAA+C,EAEjE,OAAO,CACT,EAea,GACX,EACA,EACA,EACA,EACA,IAGI,IAAkB,GAAc,CAAC,EAEjC,IAAkB,UACb,EAA0B,EAAM,CAAO,EAE5C,MAAM,QAAQ,CAAa,EACtB,EAAyB,EAAe,EAAS,EAAM,CAAW,EAEvE,EAAc,CAAa,EACtB,EAAyB,EAAe,EAAM,EAAS,CAAI,EAE7D,CAAC,EAIG,MAAgC,CAC3C,GAAM,CAAE,cAAa,OAAM,cAAa,eAAgBA,EAEtD,EACI,EAAU,EAAW,EACrB,EAAY,EAAa,EAEzB,EAAgB,MAElB,CAAC,EAAY,MAAM,OACjB,EAAY,MAA4C,SACxD,EAAY,MAAM,SAClB,UACN,EAWA,EAAQ,EATa,MACnB,EACE,EAAc,MACd,EAAK,MACL,EAAU,MACV,EAAY,MACZ,EAAQ,KACV,CAEqC,CAAC,CAC1C"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useUpdateDeviceStatus.js","names":[],"sources":["../../../src/client/composables/useUpdateDeviceStatus.ts"],"sourcesContent":["// oxlint-disable promise/prefer-await-to-callbacks\nimport { useEventListener } from '@vueuse/core'\nimport { onMounted } from 'vue'\n\nimport cssVariables from '../styles/_variables.module.scss'\n\nexport enum DeviceType {\n Mobile = 'mobile',\n}\n\nconst DeviceTypeMap = {\n [DeviceType.Mobile]: Number.parseInt(\n cssVariables.mobile.replace('px', ''),\n 10,\n ),\n}\n\n/**\n * Add listener to detect screen though device type\n *\n * @param deviceType - Device type to detect / 要检测的设备类型\n * @param callback - Callback function to call when device status changes /\n * 设备状态改变时调用的回调函数\n */\nexport const useUpdateDeviceStatus = (\n deviceType: DeviceType,\n callback: (width: number) => void,\n): void => {\n const width = DeviceTypeMap[deviceType]\n if (!Number.isInteger(width)) {\n if (__VUEPRESS_DEV__) throw new Error('device width must be a integer')\n return\n }\n\n useEventListener('orientationchange', () => {\n callback(width)\n })\n useEventListener('resize', () => {\n callback(width)\n })\n\n onMounted(() => {\n callback(width)\n })\n}\n"],"mappings":"gIAMA,IAAY,EAAL,SAAA,EAAA,OACL,GAAA,OAAA,UACF,EAAA,CAAA,CAAA,EAEA,MAAM,EAAgB,CAAA,OACC,OAAO,SAC1B,EAAa,OAAO,QAAQ,KAAM,EAAE,EACpC,EACF,CACF,EASa,GACX,EACA,IACS,CACT,IAAM,EAAQ,EAAc,GAC5B,GAAI,CAAC,OAAO,UAAU,CAAK,EAAG,CAC5B,GAAI,iBAAkB,MAAU,MAAM,gCAAgC,EACtE,MACF,CAEA,EAAiB,wBAA2B,CAC1C,EAAS,CAAK,CAChB,CAAC,EACD,EAAiB,aAAgB,CAC/B,EAAS,CAAK,CAChB,CAAC,EAED,MAAgB,CACd,EAAS,CAAK,CAChB,CAAC,CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"isActiveSidebarItem.js","names":[],"sources":["../../../src/client/utils/isActiveSidebarItem.ts"],"sourcesContent":["import { normalizePath } from '@vuepress/helper/client'\nimport type { RouteLocationNormalizedLoaded } from 'vuepress/client'\n\nimport type { SidebarItem } from '../typings.js'\n\nconst isActiveLink = (\n link: string,\n route: RouteLocationNormalizedLoaded,\n): boolean => {\n if (route.hash === link) return true\n\n const currentPath = normalizePath(decodeURI(route.path), true)\n const targetPath = normalizePath(decodeURI(link), true)\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":"wDAKA,MAAM,GACJ,EACA,IAEI,EAAM,OAAS,EAAa,GAEZ,EAAc,UAAU,EAAM,IAAI,EAAG,EAExC,IADE,EAAc,UAAU,CAAI,EAAG,EAClB,EAGrB,GACX,EACA,IAEI,EAAK,MAAQ,EAAa,EAAK,KAAM,CAAK,EAAU,GAEpD,aAAc,EACT,EAAK,SAAS,KAAM,GAAU,EAAoB,EAAO,CAAK,CAAC,EAEjE"}
|
|
@@ -1 +0,0 @@
|
|
|
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 * @example\n * - Input: '/README.md'\n * - Output: { text: 'Home', link: '/' }\n *\n * @param config - The string to resolve / 要解析的字符串\n * @param currentPath - The current route path / 当前路由路径\n * @returns Resolved AutoLink options / 解析后的 AutoLink 选项\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,CAAW,EAEtB,OAAO,EACH,CAAE,KAAM,EAAM,KAAM,CAAK,EACzB,CACE,KAAM,EAAK,OAAS,EACpB,KAAM,CACR,CACN"}
|
|
@@ -1 +0,0 @@
|
|
|
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/u,\n isLinkHttp(docsRepo) ? docsRepo : `https://github.com/${docsRepo}`,\n )\n .replace(/:branch/u, docsBranch)\n .replace(\n /:path/u,\n removeLeadingSlash(`${removeEndingSlash(docsDir)}/${filePathRelative}`),\n )\n}\n"],"mappings":"qJASA,MAAa,EAA8D,CACzE,OAAQ,2BACR,OAAQ,6BACR,MAAO,2BACP,UACE,iFACJ,EAEM,GAA2B,CAC/B,WACA,qBAImB,CACnB,GAAI,EAAiB,OAAO,EAE5B,IAAM,EAAW,EAAgB,CAAQ,EAGzC,OAFI,GAAY,KAET,KAFsB,EAAmB,EAGlD,EAEa,GAAmB,CAC9B,WACA,aACA,UACA,mBACA,qBAOmB,CACnB,GAAI,CAAC,EAAkB,OAAO,KAE9B,IAAM,EAAU,EAAwB,CAAE,WAAU,iBAAgB,CAAC,EAGrE,OAFK,EAEE,EACJ,QACC,SACA,EAAW,CAAQ,EAAI,EAAW,sBAAsB,GAC1D,EACC,QAAQ,WAAY,CAAU,EAC9B,QACC,SACA,EAAmB,GAAG,EAAkB,CAAO,EAAE,GAAG,GAAkB,CACxE,EAXmB,IAYvB"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolvePrefix.js","names":[],"sources":["../../../src/client/utils/resolvePrefix.ts"],"sourcesContent":["import {\n ensureEndingSlash,\n isLinkAbsolute,\n isLinkWithProtocol,\n} from '@vuepress/helper/client'\n\nexport const resolvePrefix = (prefix = '', path = ''): string =>\n isLinkAbsolute(path) || isLinkWithProtocol(path)\n ? path\n : `${ensureEndingSlash(prefix)}${path}`\n"],"mappings":"wGAMA,MAAa,GAAiB,EAAS,GAAI,EAAO,KAChD,EAAe,CAAI,GAAK,EAAmB,CAAI,EAC3C,EACA,GAAG,EAAkB,CAAM,IAAI"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"resolveRepoType.js","names":[],"sources":["../../../src/client/utils/resolveRepoType.ts"],"sourcesContent":["import { isLinkHttp } from 'vuepress/shared'\n\nexport type RepoType = 'Bitbucket' | 'Gitee' | 'GitHub' | 'GitLab' | null\n\nexport const resolveRepoType = (repo: string): RepoType => {\n if (!isLinkHttp(repo) || /^(https?:)?\\/\\/github\\.com\\//u.test(repo))\n return 'GitHub'\n\n if (/^(https?:)?\\/\\/bitbucket\\.org\\//u.test(repo)) return 'Bitbucket'\n if (/^(https?:)?\\/\\/gitlab\\.com\\//u.test(repo)) return 'GitLab'\n if (/^(https?:)?\\/\\/gitee\\.com\\//u.test(repo)) return 'Gitee'\n\n return null\n}\n"],"mappings":"6CAIA,MAAa,EAAmB,GAC1B,CAAC,EAAW,CAAI,GAAK,gCAAgC,KAAK,CAAI,EACzD,SAEL,mCAAmC,KAAK,CAAI,EAAU,YACtD,gCAAgC,KAAK,CAAI,EAAU,SACnD,+BAA+B,KAAK,CAAI,EAAU,QAE/C"}
|