@vuepress/theme-default 2.0.0-rc.128 → 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/VPAutoLink.vue +1 -3
- package/dist/client/components/VPNavbar.vue +1 -0
- package/dist/client/components/VPNavbarDropdown.vue +4 -5
- package/dist/client/components/VPSidebarItem.vue +3 -7
- package/dist/client/components/global/Badge.vue +3 -9
- 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/useHeaders.js.map +1 -1
- 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 -21
- package/dist/client/index.js +1 -1
- package/dist/client/styles/index.scss +0 -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/{page-FWcDnzJp.d.ts → index-ur5YvkCJ.d.ts} +73 -34
- package/dist/isActiveSidebarItem-BQHhsM53.js +2 -0
- package/dist/isActiveSidebarItem-BQHhsM53.js.map +1 -0
- package/dist/{isActiveSidebarItem-aythFTeC.d.ts → isActiveSidebarItem-K6rOnBw4.d.ts} +2 -2
- package/dist/node/index.d.ts +16 -47
- package/dist/node/index.js +1 -1
- package/dist/node/index.js.map +1 -1
- package/dist/{resolveAutoLink-BR2Z05MD.d.ts → resolveAutoLink-DBXc0Cd3.d.ts} +6 -6
- package/dist/resolveAutoLink-XUJwl3Kb.js +2 -0
- package/dist/resolveAutoLink-XUJwl3Kb.js.map +1 -0
- package/dist/{resolveEditLink-DazcWeGf.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-BN9K9RA5.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-Wcj35_rs.d.ts → resolveRepoType-DEy0Gvc4.d.ts} +1 -1
- package/dist/{typings-NbQSzbOn.d.ts → typings-CiGFIZqG.d.ts} +2 -3
- package/dist/useDarkMode-BfKvIN6K.js +2 -0
- package/dist/useDarkMode-BfKvIN6K.js.map +1 -0
- package/dist/{useDarkMode-DLor2cV7.d.ts → useDarkMode-uRSRwA8U.d.ts} +2 -4
- package/dist/{useData-JDen_Bxm.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-DPCTvXmM.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-C19TGFg7.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-DxhSIAFq.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-4GkrPvc2.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-lH4xyHOV.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-ChTW2RRU.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-BAl732Uv.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-CdpB96Ta.d.ts → useSidebarItems-aGO1YtUp.d.ts} +33 -37
- package/dist/{useUpdateDeviceStatus-SBnOZx8J.d.ts → useUpdateDeviceStatus-CsrJ_Qqv.d.ts} +4 -3
- 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 +23 -23
- 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
- package/dist/nav-DikslSJ_.d.ts +0 -36
- package/dist/sidebar-CF1YPYLN.d.ts +0 -53
|
@@ -1,9 +1,62 @@
|
|
|
1
|
-
import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
|
|
2
|
-
import { o as SidebarOptions, t as SidebarArrayOptions, u as NavbarOptions } from "./sidebar-CF1YPYLN.js";
|
|
3
1
|
import { GitPluginPageData } from "@vuepress/plugin-git";
|
|
4
2
|
import { ThemeData } from "@vuepress/plugin-theme-data";
|
|
5
3
|
import { LocaleData, PageFrontmatter } from "vuepress/shared";
|
|
6
4
|
|
|
5
|
+
//#region src/shared/nav.d.ts
|
|
6
|
+
/** Base nav item, displayed as text */
|
|
7
|
+
interface NavItemOptions {
|
|
8
|
+
text: string;
|
|
9
|
+
ariaLabel?: string;
|
|
10
|
+
}
|
|
11
|
+
/** Options for `<AutoLink>` */
|
|
12
|
+
interface AutoLinkOptions extends NavItemOptions {
|
|
13
|
+
/** Link of item */
|
|
14
|
+
link: string;
|
|
15
|
+
/** Rel of `<a>` tag */
|
|
16
|
+
rel?: string;
|
|
17
|
+
/** Target of `<a>` tag */
|
|
18
|
+
target?: string;
|
|
19
|
+
/** Regexp mode to be active */
|
|
20
|
+
activeMatch?: string;
|
|
21
|
+
/** Whether it's active only when exact match */
|
|
22
|
+
exact?: boolean;
|
|
23
|
+
}
|
|
24
|
+
//#endregion
|
|
25
|
+
//#region src/shared/navbar.d.ts
|
|
26
|
+
/** Base nav group, has nav items children */
|
|
27
|
+
interface NavGroup<T> extends NavItemOptions {
|
|
28
|
+
/** Link prefix of current group */
|
|
29
|
+
prefix?: string;
|
|
30
|
+
/** Link of current group */
|
|
31
|
+
link?: string;
|
|
32
|
+
/** Children of current group */
|
|
33
|
+
children: T[];
|
|
34
|
+
}
|
|
35
|
+
type NavbarLinkOptions = AutoLinkOptions | string;
|
|
36
|
+
type NavbarGroupOptions = NavGroup<NavbarLinkOptions | NavGroup<NavbarLinkOptions>>;
|
|
37
|
+
type NavbarOptions = (NavbarGroupOptions | NavbarLinkOptions)[] | false;
|
|
38
|
+
//#endregion
|
|
39
|
+
//#region src/shared/sidebar.d.ts
|
|
40
|
+
type SidebarLinkOptions = AutoLinkOptions;
|
|
41
|
+
interface SidebarGroupOptions extends NavItemOptions {
|
|
42
|
+
/** Link prefix of current group */
|
|
43
|
+
prefix?: string;
|
|
44
|
+
/** Link of current group */
|
|
45
|
+
link?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Whether current group is collapsible
|
|
48
|
+
*
|
|
49
|
+
* @default false
|
|
50
|
+
*/
|
|
51
|
+
collapsible?: boolean;
|
|
52
|
+
/** Children of current group */
|
|
53
|
+
children: SidebarItemOptions[];
|
|
54
|
+
}
|
|
55
|
+
type SidebarItemOptions = SidebarGroupOptions | SidebarLinkOptions | string;
|
|
56
|
+
type SidebarArrayOptions = SidebarItemOptions[];
|
|
57
|
+
type SidebarObjectOptions = Record<string, SidebarArrayOptions | 'heading' | false>;
|
|
58
|
+
type SidebarOptions = SidebarArrayOptions | SidebarObjectOptions | 'heading';
|
|
59
|
+
//#endregion
|
|
7
60
|
//#region src/shared/options.d.ts
|
|
8
61
|
type DefaultThemeLocaleOptions = DefaultThemeData;
|
|
9
62
|
type DefaultThemeData = ThemeData<DefaultThemeLocaleData>;
|
|
@@ -38,13 +91,9 @@ interface DefaultThemeLocaleData extends LocaleData {
|
|
|
38
91
|
* Set to `false` to disable navbar in current locale
|
|
39
92
|
*/
|
|
40
93
|
navbar?: NavbarOptions;
|
|
41
|
-
/**
|
|
42
|
-
* Navbar label used for screen readers using the `aria-label` attribute
|
|
43
|
-
*/
|
|
94
|
+
/** Navbar label used for screen readers using the `aria-label` attribute */
|
|
44
95
|
navbarLabel?: string | null;
|
|
45
|
-
/**
|
|
46
|
-
* Page navbar label used for screen readers using the `aria-label` attribute
|
|
47
|
-
*/
|
|
96
|
+
/** Page navbar label used for screen readers using the `aria-label` attribute */
|
|
48
97
|
pageNavbarLabel?: string | null;
|
|
49
98
|
/**
|
|
50
99
|
* Navbar logo config
|
|
@@ -59,10 +108,9 @@ interface DefaultThemeLocaleData extends LocaleData {
|
|
|
59
108
|
*/
|
|
60
109
|
logoDark?: string | null;
|
|
61
110
|
/**
|
|
62
|
-
* The alt text of navbar logo.
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
* hidden from screen readers to avoid duplication.
|
|
111
|
+
* The alt text of navbar logo. Defaults to the site title if not specified.
|
|
112
|
+
* If the value is the same as the site title, the site title rendered in the
|
|
113
|
+
* navbar will be hidden from screen readers to avoid duplication.
|
|
66
114
|
*/
|
|
67
115
|
logoAlt?: string | null;
|
|
68
116
|
/**
|
|
@@ -111,11 +159,11 @@ interface DefaultThemeLocaleData extends LocaleData {
|
|
|
111
159
|
* - Set to `2` to include `<h2>` and `<h3>`
|
|
112
160
|
* - ...
|
|
113
161
|
*
|
|
114
|
-
* The max value depends on which headers you have extracted
|
|
115
|
-
*
|
|
162
|
+
* The max value depends on which headers you have extracted via
|
|
163
|
+
* `markdown.headers.level`.
|
|
116
164
|
*
|
|
117
|
-
* The default value of `markdown.headers.level` is `[2, 3]`,
|
|
118
|
-
*
|
|
165
|
+
* The default value of `markdown.headers.level` is `[2, 3]`, so the default
|
|
166
|
+
* max value of `sidebarDepth` is `2`
|
|
119
167
|
*/
|
|
120
168
|
sidebarDepth?: number;
|
|
121
169
|
/**
|
|
@@ -135,7 +183,8 @@ interface DefaultThemeLocaleData extends LocaleData {
|
|
|
135
183
|
*
|
|
136
184
|
* Pattern of edit link
|
|
137
185
|
*
|
|
138
|
-
* @example
|
|
186
|
+
* @example
|
|
187
|
+
* ':repo/edit/:branch/:path'
|
|
139
188
|
*/
|
|
140
189
|
editLinkPattern?: string;
|
|
141
190
|
/**
|
|
@@ -224,25 +273,15 @@ interface DefaultThemeLocaleData extends LocaleData {
|
|
|
224
273
|
* Text of back-to-home link in 404 page
|
|
225
274
|
*/
|
|
226
275
|
backToHome?: string;
|
|
227
|
-
/**
|
|
228
|
-
* A11y text for external link icon
|
|
229
|
-
*/
|
|
276
|
+
/** A11y text for external link icon */
|
|
230
277
|
openInNewWindow?: string;
|
|
231
|
-
/**
|
|
232
|
-
* A11y text for color mode toggle button
|
|
233
|
-
*/
|
|
278
|
+
/** A11y text for color mode toggle button */
|
|
234
279
|
toggleColorMode?: string;
|
|
235
|
-
/**
|
|
236
|
-
* A11y text for sidebar toggle button
|
|
237
|
-
*/
|
|
280
|
+
/** A11y text for sidebar toggle button */
|
|
238
281
|
toggleSidebar?: string;
|
|
239
|
-
/**
|
|
240
|
-
* text for prev link
|
|
241
|
-
*/
|
|
282
|
+
/** Text for prev link */
|
|
242
283
|
prev?: string | false;
|
|
243
|
-
/**
|
|
244
|
-
* text for next link
|
|
245
|
-
*/
|
|
284
|
+
/** Text for next link */
|
|
246
285
|
next?: string | false;
|
|
247
286
|
}
|
|
248
287
|
//#endregion
|
|
@@ -288,5 +327,5 @@ interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter
|
|
|
288
327
|
next?: AutoLinkOptions | string;
|
|
289
328
|
}
|
|
290
329
|
//#endregion
|
|
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=
|
|
330
|
+
export { NavbarOptions as _, DefaultThemeData as a, SidebarArrayOptions as c, SidebarLinkOptions as d, SidebarObjectOptions as f, NavbarLinkOptions as g, NavbarGroupOptions as h, DefaultThemePageFrontmatter as i, SidebarGroupOptions as l, NavGroup as m, DefaultThemeNormalPageFrontmatter as n, DefaultThemeLocaleData as o, SidebarOptions as p, DefaultThemePageData as r, DefaultThemeLocaleOptions as s, DefaultThemeHomePageFrontmatter as t, SidebarItemOptions as u, AutoLinkOptions as v, NavItemOptions as y };
|
|
331
|
+
//# sourceMappingURL=index-ur5YvkCJ.d.ts.map
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{normalizePath as e}from"@vuepress/helper/client";const t=(t,n)=>n.hash===t?!0:e(decodeURI(n.path),!0)===e(decodeURI(t),!0),n=(e,r)=>e.link&&t(e.link,r)?!0:`children`in e?e.children.some(e=>n(e,r)):!1;export{n as t};
|
|
2
|
+
//# sourceMappingURL=isActiveSidebarItem-BQHhsM53.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"isActiveSidebarItem-BQHhsM53.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,8 +1,8 @@
|
|
|
1
|
-
import { i as SidebarItem } from "./typings-
|
|
1
|
+
import { i as SidebarItem } from "./typings-CiGFIZqG.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
7
|
export { isActiveSidebarItem as t };
|
|
8
|
-
//# sourceMappingURL=isActiveSidebarItem-
|
|
8
|
+
//# sourceMappingURL=isActiveSidebarItem-K6rOnBw4.d.ts.map
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { n as
|
|
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";
|
|
1
|
+
import { _ as NavbarOptions, a as DefaultThemeData, c as SidebarArrayOptions, d as SidebarLinkOptions, f as SidebarObjectOptions, g as NavbarLinkOptions, h as NavbarGroupOptions, i as DefaultThemePageFrontmatter, l as SidebarGroupOptions, m as NavGroup, n as DefaultThemeNormalPageFrontmatter, o as DefaultThemeLocaleData, p as SidebarOptions, r as DefaultThemePageData, s as DefaultThemeLocaleOptions, t as DefaultThemeHomePageFrontmatter, u as SidebarItemOptions, v as AutoLinkOptions, y as NavItemOptions } from "../index-ur5YvkCJ.js";
|
|
4
2
|
import { BackToTopPluginOptions } from "@vuepress/plugin-back-to-top";
|
|
5
3
|
import { CopyCodePluginOptions } from "@vuepress/plugin-copy-code";
|
|
6
4
|
import { GitPluginOptions } from "@vuepress/plugin-git";
|
|
@@ -15,66 +13,37 @@ import { Theme } from "vuepress/core";
|
|
|
15
13
|
|
|
16
14
|
//#region src/node/typings.d.ts
|
|
17
15
|
interface DefaultThemePluginsOptions {
|
|
18
|
-
/**
|
|
19
|
-
* Enable `@vuepress/plugin-active-header-links` or not
|
|
20
|
-
*/
|
|
16
|
+
/** Enable `@vuepress/plugin-active-header-links` or not */
|
|
21
17
|
activeHeaderLinks?: boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Enable `@vuepress/plugin-back-to-top` or not
|
|
24
|
-
*/
|
|
18
|
+
/** Enable `@vuepress/plugin-back-to-top` or not */
|
|
25
19
|
backToTop?: BackToTopPluginOptions | boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Enable `@vuepress/plugin-copy-code` or not
|
|
28
|
-
*/
|
|
20
|
+
/** Enable `@vuepress/plugin-copy-code` or not */
|
|
29
21
|
copyCode?: CopyCodePluginOptions | boolean;
|
|
30
|
-
/**
|
|
31
|
-
* Enable `@vuepress/plugin-git` or not
|
|
32
|
-
*/
|
|
22
|
+
/** Enable `@vuepress/plugin-git` or not */
|
|
33
23
|
git?: GitPluginOptions | boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Enable `@vuepress/plugin-markdown-hint` or not
|
|
36
|
-
*/
|
|
24
|
+
/** Enable `@vuepress/plugin-markdown-hint` or not */
|
|
37
25
|
hint?: MarkdownHintPluginOptions | boolean;
|
|
38
|
-
/**
|
|
39
|
-
* Enable `@vuepress/plugin-links-check` or not
|
|
40
|
-
*/
|
|
26
|
+
/** Enable `@vuepress/plugin-links-check` or not */
|
|
41
27
|
linksCheck?: LinksCheckPluginOptions | boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Enable `@vuepress/plugin-medium-zoom` or not
|
|
44
|
-
*/
|
|
28
|
+
/** Enable `@vuepress/plugin-medium-zoom` or not */
|
|
45
29
|
mediumZoom?: boolean;
|
|
46
|
-
/**
|
|
47
|
-
* Enable `@vuepress/plugin-nprogress` or not
|
|
48
|
-
*/
|
|
30
|
+
/** Enable `@vuepress/plugin-nprogress` or not */
|
|
49
31
|
nprogress?: boolean;
|
|
50
|
-
/**
|
|
51
|
-
* Enable `@vuepress/plugin-prismjs` or not
|
|
52
|
-
*/
|
|
32
|
+
/** Enable `@vuepress/plugin-prismjs` or not */
|
|
53
33
|
prismjs?: PrismjsPluginOptions | boolean;
|
|
54
|
-
/**
|
|
55
|
-
* Enable `@vuepress/plugin-seo` or not
|
|
56
|
-
*/
|
|
34
|
+
/** Enable `@vuepress/plugin-seo` or not */
|
|
57
35
|
seo?: Partial<SeoPluginOptions> | boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Enable `@vuepress/plugin-sitemap` or not
|
|
60
|
-
*/
|
|
36
|
+
/** Enable `@vuepress/plugin-sitemap` or not */
|
|
61
37
|
sitemap?: Partial<SitemapPluginOptions> | boolean;
|
|
62
|
-
/**
|
|
63
|
-
* Enable `@vuepress/plugin-markdown-tab` or not
|
|
64
|
-
*/
|
|
38
|
+
/** Enable `@vuepress/plugin-markdown-tab` or not */
|
|
65
39
|
tab?: MarkdownTabPluginOptions | boolean;
|
|
66
40
|
}
|
|
67
41
|
//#endregion
|
|
68
42
|
//#region src/node/defaultTheme.d.ts
|
|
69
43
|
interface DefaultThemeOptions extends DefaultThemeLocaleOptions {
|
|
70
|
-
/**
|
|
71
|
-
* deployed hostname
|
|
72
|
-
*/
|
|
44
|
+
/** Deployed hostname */
|
|
73
45
|
hostname?: string;
|
|
74
|
-
/**
|
|
75
|
-
* To avoid confusion with the root `plugins` option,
|
|
76
|
-
* we use `themePlugins`
|
|
77
|
-
*/
|
|
46
|
+
/** To avoid confusion with the root `plugins` option, we use `themePlugins` */
|
|
78
47
|
themePlugins?: DefaultThemePluginsOptions;
|
|
79
48
|
}
|
|
80
49
|
declare const defaultTheme: ({
|
|
@@ -104,5 +73,5 @@ declare const assignDefaultLocaleOptions: (localeOptions: DefaultThemeLocaleOpti
|
|
|
104
73
|
*/
|
|
105
74
|
declare const resolveMarkdownHintLocales: (localeOptions: DefaultThemeData) => LocaleConfig<MarkdownHintPluginLocaleData>;
|
|
106
75
|
//#endregion
|
|
107
|
-
export { AutoLinkOptions, DEFAULT_LOCALE_DATA, DEFAULT_LOCALE_OPTIONS, DefaultThemeData, DefaultThemeHomePageFrontmatter, DefaultThemeLocaleData, DefaultThemeLocaleOptions, DefaultThemeNormalPageFrontmatter, DefaultThemeOptions, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemePluginsOptions, NavGroup, NavItemOptions, NavbarGroupOptions, NavbarLinkOptions, NavbarOptions, SidebarArrayOptions, SidebarGroupOptions, SidebarItemOptions, SidebarLinkOptions, SidebarObjectOptions, SidebarOptions, assignDefaultLocaleOptions, defaultTheme, resolveMarkdownHintLocales };
|
|
76
|
+
export { type AutoLinkOptions, DEFAULT_LOCALE_DATA, DEFAULT_LOCALE_OPTIONS, type DefaultThemeData, type DefaultThemeHomePageFrontmatter, type DefaultThemeLocaleData, type DefaultThemeLocaleOptions, type DefaultThemeNormalPageFrontmatter, DefaultThemeOptions, type DefaultThemePageData, type DefaultThemePageFrontmatter, type DefaultThemePluginsOptions, type NavGroup, type NavItemOptions, type NavbarGroupOptions, type NavbarLinkOptions, type NavbarOptions, type SidebarArrayOptions, type SidebarGroupOptions, type SidebarItemOptions, type SidebarLinkOptions, type SidebarObjectOptions, type SidebarOptions, assignDefaultLocaleOptions, defaultTheme, resolveMarkdownHintLocales };
|
|
108
77
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{addViteOptimizeDepsExclude as e}from"@vuepress/helper";import{activeHeaderLinksPlugin as t}from"@vuepress/plugin-active-header-links";import{backToTopPlugin as n}from"@vuepress/plugin-back-to-top";import{copyCodePlugin as r}from"@vuepress/plugin-copy-code";import{gitPlugin as i}from"@vuepress/plugin-git";import{linksCheckPlugin as a}from"@vuepress/plugin-links-check";import{markdownHintPlugin as o}from"@vuepress/plugin-markdown-hint";import{markdownTabPlugin as s}from"@vuepress/plugin-markdown-tab";import{mediumZoomPlugin as c}from"@vuepress/plugin-medium-zoom";import{nprogressPlugin as l}from"@vuepress/plugin-nprogress";import{palettePlugin as u}from"@vuepress/plugin-palette";import{prismjsPlugin as d}from"@vuepress/plugin-prismjs";import{seoPlugin as f}from"@vuepress/plugin-seo";import{sitemapPlugin as p}from"@vuepress/plugin-sitemap";import{themeDataPlugin as m}from"@vuepress/plugin-theme-data";import{isPlainObject as h}from"vuepress/shared";import{fs as g,getDirname as _,path as v}from"vuepress/utils";const y={colorMode:`auto`,colorModeSwitch:!0,navbar:[],logo:null,repo:null,selectLanguageText:`Languages`,selectLanguageAriaLabel:`Select language`,sidebar:`heading`,sidebarDepth:2,editLink:!0,editLinkText:`Edit this page`,lastUpdated:!0,contributors:!0,contributorsText:`Contributors`,notFound:[`There's nothing here.`,`How did we get here?`,`That's a Four-Oh-Four.`,`Looks like we've got some broken links.`],backToHome:`Take me home`,openInNewWindow:`open in new window`,toggleColorMode:`toggle color mode`,toggleSidebar:`toggle sidebar`},b={selectLanguageName:`English`},x=e=>{e.locales??={},Object.assign(e,{...y,...e}),e.locales[`/`]??={},Object.assign(e.locales[`/`],{...b,...e.locales[`/`]})},S=e=>Object.entries(e.locales??{}).reduce((e,[t,n])=>(e[t]={},n.tip&&(e[t].tip=n.tip),n.warning&&(e[t].warning=n.warning),n.danger&&(e[t].caution=n.danger),n.important&&(e[t].important=n.important),n.note&&(e[t].note=n.note),e),{}),C=import.meta.dirname||_(import.meta.url),w=({hostname:
|
|
1
|
+
import{addViteOptimizeDepsExclude as e}from"@vuepress/helper";import{activeHeaderLinksPlugin as t}from"@vuepress/plugin-active-header-links";import{backToTopPlugin as n}from"@vuepress/plugin-back-to-top";import{copyCodePlugin as r}from"@vuepress/plugin-copy-code";import{gitPlugin as i}from"@vuepress/plugin-git";import{linksCheckPlugin as a}from"@vuepress/plugin-links-check";import{markdownHintPlugin as o}from"@vuepress/plugin-markdown-hint";import{markdownTabPlugin as s}from"@vuepress/plugin-markdown-tab";import{mediumZoomPlugin as c}from"@vuepress/plugin-medium-zoom";import{nprogressPlugin as l}from"@vuepress/plugin-nprogress";import{palettePlugin as u}from"@vuepress/plugin-palette";import{prismjsPlugin as d}from"@vuepress/plugin-prismjs";import{seoPlugin as f}from"@vuepress/plugin-seo";import{sitemapPlugin as p}from"@vuepress/plugin-sitemap";import{themeDataPlugin as m}from"@vuepress/plugin-theme-data";import{isPlainObject as h}from"vuepress/shared";import{fs as g,getDirname as _,path as v}from"vuepress/utils";const y={colorMode:`auto`,colorModeSwitch:!0,navbar:[],logo:null,repo:null,selectLanguageText:`Languages`,selectLanguageAriaLabel:`Select language`,sidebar:`heading`,sidebarDepth:2,editLink:!0,editLinkText:`Edit this page`,lastUpdated:!0,contributors:!0,contributorsText:`Contributors`,notFound:[`There's nothing here.`,`How did we get here?`,`That's a Four-Oh-Four.`,`Looks like we've got some broken links.`],backToHome:`Take me home`,openInNewWindow:`open in new window`,toggleColorMode:`toggle color mode`,toggleSidebar:`toggle sidebar`},b={selectLanguageName:`English`},x=e=>{e.locales??={},Object.assign(e,{...y,...e}),e.locales[`/`]??={},Object.assign(e.locales[`/`],{...b,...e.locales[`/`]})},S=e=>Object.entries(e.locales??{}).reduce((e,[t,n])=>(e[t]={},n.tip&&(e[t].tip=n.tip),n.warning&&(e[t].warning=n.warning),n.danger&&(e[t].caution=n.danger),n.important&&(e[t].important=n.important),n.note&&(e[t].note=n.note),e),{}),C=import.meta.dirname||_(import.meta.url),[w,T,E]=await Promise.all([g.readdir(v.resolve(C,`../client/components`)),g.readdir(v.resolve(C,`../client/composables`)),g.readdir(v.resolve(C,`../client/utils`))]),D=({hostname:g,themePlugins:_={},...y}={})=>(x(y),{name:`@vuepress/theme-default`,userStyle:`.vuepress/styles/index.scss`,templateBuild:v.resolve(C,`../../templates/build.html`),alias:{...Object.fromEntries(w.filter(e=>e.endsWith(`.vue`)).map(e=>[`@theme/${e}`,v.resolve(C,`../client/components`,e)])),...Object.fromEntries(T.filter(e=>e.endsWith(`.js`)).map(e=>[`@theme/${e.slice(0,-3)}`,v.resolve(C,`../client/composables`,e)])),...Object.fromEntries(E.filter(e=>e.endsWith(`.js`)).map(e=>[`@theme/${e.slice(0,-3)}`,v.resolve(C,`../client/utils`,e)]))},clientConfigFile:v.resolve(C,`../client/config.js`),extendsBundlerOptions:(t,n)=>{e(t,n,`@theme`)},extendsPage:e=>{e.data.filePathRelative=e.filePathRelative,e.routeMeta.title=e.title},plugins:[_.activeHeaderLinks??!0?t({delay:300}):[],_.backToTop??!0?n(h(_.backToTop)?_.backToTop:{}):[],_.copyCode??!0?r({...h(_.copyCode)?_.copyCode:{}}):[],_.hint??!0?o({locales:S(y),...h(_.hint)?_.hint:{}}):[],_.git??!0?i({createdTime:!1,updatedTime:y.lastUpdated??!0,changelog:{repoUrl:y.repo||``},...h(_.git)?_.git:{}}):[],_.linksCheck??!0?a(h(_.linksCheck)?_.linksCheck:{}):[],_.mediumZoom??!0?c():[],_.nprogress??!0?l():[],u({preset:`sass`}),_.prismjs??!0?d(h(_.prismjs)?_.prismjs:{}):[],g&&(_.seo??!0)?f({hostname:g,...h(_.seo)?_.seo:{}}):[],g&&(_.sitemap??!0)?p({hostname:g,...h(_.sitemap)?_.sitemap:{}}):[],_.tab??!0?s(h(_.tab)?_.tab:{codeTabs:!0,tabs:!0}):[],m({themeData:y})]});export{b as DEFAULT_LOCALE_DATA,y as DEFAULT_LOCALE_OPTIONS,x as assignDefaultLocaleOptions,D as defaultTheme,S as resolveMarkdownHintLocales};
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
package/dist/node/index.js.map
CHANGED
|
@@ -1 +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":"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"}
|
|
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 { DefaultThemeLocaleOptions } 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\nconst [componentFiles, composableFiles, utilFiles] = await Promise.all([\n fs.readdir(path.resolve(__dirname, '../client/components')),\n fs.readdir(path.resolve(__dirname, '../client/composables')),\n fs.readdir(path.resolve(__dirname, '../client/utils')),\n])\n\nexport interface DefaultThemeOptions extends DefaultThemeLocaleOptions {\n /** Deployed hostname */\n hostname?: string\n\n /** To avoid confusion with the root `plugins` option, we use `themePlugins` */\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 userStyle: '.vuepress/styles/index.scss',\n\n templateBuild: path.resolve(__dirname, '../../templates/build.html'),\n\n alias: {\n // use alias to make all components replaceable\n ...Object.fromEntries(\n componentFiles\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 composableFiles\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 utilFiles\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) => {\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":"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"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { v as AutoLinkOptions } from "./index-ur5YvkCJ.js";
|
|
2
2
|
|
|
3
3
|
//#region src/client/utils/resolveAutoLink.d.ts
|
|
4
4
|
/**
|
|
@@ -6,15 +6,15 @@ import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
|
|
|
6
6
|
*
|
|
7
7
|
* 从字符串解析 AutoLink 属性
|
|
8
8
|
*
|
|
9
|
+
* @example
|
|
10
|
+
* - Input: '/README.md'
|
|
11
|
+
* - Output: { text: 'Home', link: '/' }
|
|
12
|
+
*
|
|
9
13
|
* @param config - The string to resolve / 要解析的字符串
|
|
10
14
|
* @param currentPath - The current route path / 当前路由路径
|
|
11
15
|
* @returns Resolved AutoLink options / 解析后的 AutoLink 选项
|
|
12
|
-
*
|
|
13
|
-
* @example
|
|
14
|
-
* - Input: '/README.md'
|
|
15
|
-
* - Output: { text: 'Home', link: '/' }
|
|
16
16
|
*/
|
|
17
17
|
declare const resolveAutoLink: (config: string, currentPath?: string) => AutoLinkOptions;
|
|
18
18
|
//#endregion
|
|
19
19
|
export { resolveAutoLink as t };
|
|
20
|
-
//# sourceMappingURL=resolveAutoLink-
|
|
20
|
+
//# sourceMappingURL=resolveAutoLink-DBXc0Cd3.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveAutoLink-XUJwl3Kb.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"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{isLinkHttp as e,removeEndingSlash as t,removeLeadingSlash as n}from"vuepress/shared";import{resolveRepoType as r}from"@theme/resolveRepoType";const i={GitHub:`:repo/edit/:branch/:path`,GitLab:`:repo/-/edit/:branch/:path`,Gitee:`:repo/edit/:branch/:path`,Bitbucket:`:repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default`},a=({docsRepo:e,editLinkPattern:t})=>{if(t)return t;let n=r(e);return n==null?null:i[n]},o=({docsRepo:r,docsBranch:i,docsDir:o,filePathRelative:s,editLinkPattern:c})=>{if(!s)return null;let l=a({docsRepo:r,editLinkPattern:c});return l?l.replace(/:repo/u,e(r)?r:`https://github.com/${r}`).replace(/:branch/u,i).replace(/:path/u,n(`${t(o)}/${s}`)):null};export{o as n,i as t};
|
|
2
|
+
//# sourceMappingURL=resolveEditLink-lteF0-Mv.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolveEditLink-lteF0-Mv.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,CAAC,CACA,QAAQ,WAAY,CAAU,CAAC,CAC/B,QACC,SACA,EAAmB,GAAG,EAAkB,CAAO,EAAE,GAAG,GAAkB,CACxE,EAXmB,IAYvB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resolvePrefix-CQnTmTk4.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"}
|
|
@@ -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,5 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { i as SidebarLinkOptions, n as SidebarGroupOptions, s as NavGroup } from "./sidebar-CF1YPYLN.js";
|
|
1
|
+
import { d as SidebarLinkOptions, l as SidebarGroupOptions, m as NavGroup, v as AutoLinkOptions } from "./index-ur5YvkCJ.js";
|
|
3
2
|
|
|
4
3
|
//#region src/client/typings.d.ts
|
|
5
4
|
type NavbarItem = AutoLinkOptions | NavGroup<NavbarItem>;
|
|
@@ -16,4 +15,4 @@ interface SidebarGroupItem extends SidebarGroupOptions {
|
|
|
16
15
|
type SidebarItem = SidebarGroupItem | SidebarLinkItem;
|
|
17
16
|
//#endregion
|
|
18
17
|
export { SidebarLinkItem as a, SidebarItem as i, SidebarGroupItem as n, SidebarHeaderItem as r, NavbarItem as t };
|
|
19
|
-
//# 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"}
|
|
@@ -10,10 +10,8 @@ type DarkModeRef = WritableComputedRef<boolean>;
|
|
|
10
10
|
* @returns Dark mode ref / 暗色模式引用
|
|
11
11
|
*/
|
|
12
12
|
declare const useDarkMode: () => DarkModeRef;
|
|
13
|
-
/**
|
|
14
|
-
* Create dark mode ref and provide as global computed in setup
|
|
15
|
-
*/
|
|
13
|
+
/** Create dark mode ref and provide as global computed in setup */
|
|
16
14
|
declare const setupDarkMode: () => void;
|
|
17
15
|
//#endregion
|
|
18
16
|
export { setupDarkMode as n, useDarkMode as r, DarkModeRef as t };
|
|
19
|
-
//# 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 "./
|
|
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
|