@vuepress/theme-default 2.0.0-rc.123 → 2.0.0-rc.125

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (195) hide show
  1. package/{lib → dist}/client/components/VPHomeHero.vue +7 -14
  2. package/{lib → dist}/client/components/VPNavbar.vue +8 -11
  3. package/{lib → dist}/client/components/VPNavbarBrand.vue +4 -5
  4. package/dist/client/composables/index.d.ts +12 -0
  5. package/dist/client/composables/index.js +1 -0
  6. package/dist/client/composables/useDarkMode.d.ts +2 -0
  7. package/dist/client/composables/useDarkMode.js +2 -0
  8. package/dist/client/composables/useDarkMode.js.map +1 -0
  9. package/dist/client/composables/useData.d.ts +2 -0
  10. package/dist/client/composables/useData.js +2 -0
  11. package/dist/client/composables/useData.js.map +1 -0
  12. package/dist/client/composables/useEditLink.d.ts +2 -0
  13. package/dist/client/composables/useEditLink.js +2 -0
  14. package/dist/client/composables/useEditLink.js.map +1 -0
  15. package/dist/client/composables/useHeaders.d.ts +18 -0
  16. package/dist/client/composables/useHeaders.js +2 -0
  17. package/dist/client/composables/useHeaders.js.map +1 -0
  18. package/dist/client/composables/useNavbarConfig.d.ts +2 -0
  19. package/dist/client/composables/useNavbarConfig.js +2 -0
  20. package/dist/client/composables/useNavbarConfig.js.map +1 -0
  21. package/dist/client/composables/useNavbarRepo.d.ts +2 -0
  22. package/dist/client/composables/useNavbarRepo.js +2 -0
  23. package/dist/client/composables/useNavbarRepo.js.map +1 -0
  24. package/dist/client/composables/useNavbarSelectLanguage.d.ts +2 -0
  25. package/dist/client/composables/useNavbarSelectLanguage.js +2 -0
  26. package/dist/client/composables/useNavbarSelectLanguage.js.map +1 -0
  27. package/dist/client/composables/useNavigate.d.ts +2 -0
  28. package/dist/client/composables/useNavigate.js +2 -0
  29. package/dist/client/composables/useNavigate.js.map +1 -0
  30. package/dist/client/composables/useRelatedLinks.d.ts +2 -0
  31. package/dist/client/composables/useRelatedLinks.js +2 -0
  32. package/dist/client/composables/useRelatedLinks.js.map +1 -0
  33. package/dist/client/composables/useScrollPromise.d.ts +2 -0
  34. package/dist/client/composables/useScrollPromise.js +2 -0
  35. package/dist/client/composables/useScrollPromise.js.map +1 -0
  36. package/dist/client/composables/useSidebarItems.d.ts +2 -0
  37. package/dist/client/composables/useSidebarItems.js +2 -0
  38. package/dist/client/composables/useSidebarItems.js.map +1 -0
  39. package/dist/client/composables/useUpdateDeviceStatus.d.ts +2 -0
  40. package/dist/client/composables/useUpdateDeviceStatus.js +2 -0
  41. package/dist/client/composables/useUpdateDeviceStatus.js.map +1 -0
  42. package/dist/client/config.d.ts +6 -0
  43. package/dist/client/config.js +2 -0
  44. package/dist/client/config.js.map +1 -0
  45. package/dist/client/index.d.ts +21 -0
  46. package/dist/client/index.js +1 -0
  47. package/{lib → dist}/client/layouts/Layout.vue +2 -5
  48. package/{lib → dist}/client/layouts/NotFound.vue +1 -2
  49. package/{lib → dist}/client/styles/arrow.scss +1 -2
  50. package/{lib → dist}/client/styles/vars.scss +1 -2
  51. package/dist/client/utils/index.d.ts +6 -0
  52. package/dist/client/utils/index.js +1 -0
  53. package/dist/client/utils/isActiveSidebarItem.d.ts +2 -0
  54. package/dist/client/utils/isActiveSidebarItem.js +2 -0
  55. package/dist/client/utils/isActiveSidebarItem.js.map +1 -0
  56. package/dist/client/utils/resolveAutoLink.d.ts +2 -0
  57. package/dist/client/utils/resolveAutoLink.js +2 -0
  58. package/dist/client/utils/resolveAutoLink.js.map +1 -0
  59. package/dist/client/utils/resolveEditLink.d.ts +2 -0
  60. package/dist/client/utils/resolveEditLink.js +2 -0
  61. package/dist/client/utils/resolveEditLink.js.map +1 -0
  62. package/dist/client/utils/resolvePrefix.d.ts +2 -0
  63. package/dist/client/utils/resolvePrefix.js +2 -0
  64. package/dist/client/utils/resolvePrefix.js.map +1 -0
  65. package/dist/client/utils/resolveRepoType.d.ts +2 -0
  66. package/dist/client/utils/resolveRepoType.js +2 -0
  67. package/dist/client/utils/resolveRepoType.js.map +1 -0
  68. package/dist/isActiveSidebarItem-aythFTeC.d.ts +8 -0
  69. package/dist/nav-DikslSJ_.d.ts +36 -0
  70. package/dist/node/index.d.ts +108 -0
  71. package/dist/node/index.js +2 -0
  72. package/dist/node/index.js.map +1 -0
  73. package/dist/page-FWcDnzJp.d.ts +292 -0
  74. package/{lib/client/utils/resolveAutoLink.d.ts → dist/resolveAutoLink-BR2Z05MD.d.ts} +7 -2
  75. package/dist/resolveEditLink-DazcWeGf.d.ts +20 -0
  76. package/dist/resolvePrefix-BN9K9RA5.d.ts +5 -0
  77. package/dist/resolveRepoType-Wcj35_rs.d.ts +6 -0
  78. package/dist/sidebar-CF1YPYLN.d.ts +53 -0
  79. package/dist/typings-NbQSzbOn.d.ts +19 -0
  80. package/dist/useDarkMode-DLor2cV7.d.ts +19 -0
  81. package/dist/useData-JDen_Bxm.d.ts +13 -0
  82. package/dist/useEditLink-DPCTvXmM.d.ts +8 -0
  83. package/dist/useNavbarConfig-C19TGFg7.d.ts +8 -0
  84. package/dist/useNavbarRepo-DxhSIAFq.d.ts +13 -0
  85. package/dist/useNavbarSelectLanguage-4GkrPvc2.d.ts +13 -0
  86. package/dist/useNavigate-lH4xyHOV.d.ts +5 -0
  87. package/dist/useRelatedLinks-ChTW2RRU.d.ts +12 -0
  88. package/dist/useScrollPromise-BAl732Uv.d.ts +10 -0
  89. package/dist/useSidebarItems-CdpB96Ta.d.ts +80 -0
  90. package/dist/useUpdateDeviceStatus-SBnOZx8J.d.ts +14 -0
  91. package/package.json +39 -30
  92. package/lib/client/components/global/index.d.ts +0 -2
  93. package/lib/client/components/global/index.js +0 -2
  94. package/lib/client/composables/index.d.ts +0 -11
  95. package/lib/client/composables/index.js +0 -11
  96. package/lib/client/composables/useDarkMode.d.ts +0 -14
  97. package/lib/client/composables/useDarkMode.js +0 -64
  98. package/lib/client/composables/useData.d.ts +0 -8
  99. package/lib/client/composables/useData.js +0 -7
  100. package/lib/client/composables/useEditLink.d.ts +0 -3
  101. package/lib/client/composables/useEditLink.js +0 -28
  102. package/lib/client/composables/useHeaders.d.ts +0 -13
  103. package/lib/client/composables/useHeaders.js +0 -42
  104. package/lib/client/composables/useNavbarConfig.d.ts +0 -3
  105. package/lib/client/composables/useNavbarConfig.js +0 -27
  106. package/lib/client/composables/useNavbarRepo.d.ts +0 -8
  107. package/lib/client/composables/useNavbarRepo.js +0 -40
  108. package/lib/client/composables/useNavbarSelectLanguage.d.ts +0 -8
  109. package/lib/client/composables/useNavbarSelectLanguage.js +0 -60
  110. package/lib/client/composables/useNavigate.d.ts +0 -1
  111. package/lib/client/composables/useNavigate.js +0 -22
  112. package/lib/client/composables/useRelatedLinks.d.ts +0 -8
  113. package/lib/client/composables/useRelatedLinks.js +0 -95
  114. package/lib/client/composables/useScrollPromise.d.ts +0 -6
  115. package/lib/client/composables/useScrollPromise.js +0 -16
  116. package/lib/client/composables/useSidebarItems.d.ts +0 -75
  117. package/lib/client/composables/useSidebarItems.js +0 -164
  118. package/lib/client/composables/useUpdateDeviceStatus.d.ts +0 -10
  119. package/lib/client/composables/useUpdateDeviceStatus.js +0 -34
  120. package/lib/client/config.d.ts +0 -5
  121. package/lib/client/config.js +0 -35
  122. package/lib/client/index.d.ts +0 -4
  123. package/lib/client/index.js +0 -2
  124. package/lib/client/typings.d.ts +0 -13
  125. package/lib/client/typings.js +0 -1
  126. package/lib/client/utils/index.d.ts +0 -5
  127. package/lib/client/utils/index.js +0 -5
  128. package/lib/client/utils/isActiveSidebarItem.d.ts +0 -3
  129. package/lib/client/utils/isActiveSidebarItem.js +0 -20
  130. package/lib/client/utils/resolveAutoLink.js +0 -23
  131. package/lib/client/utils/resolveEditLink.d.ts +0 -9
  132. package/lib/client/utils/resolveEditLink.js +0 -29
  133. package/lib/client/utils/resolvePrefix.d.ts +0 -1
  134. package/lib/client/utils/resolvePrefix.js +0 -4
  135. package/lib/client/utils/resolveRepoType.d.ts +0 -2
  136. package/lib/client/utils/resolveRepoType.js +0 -12
  137. package/lib/node/defaultTheme.d.ts +0 -15
  138. package/lib/node/defaultTheme.js +0 -140
  139. package/lib/node/index.d.ts +0 -4
  140. package/lib/node/index.js +0 -2
  141. package/lib/node/typings.d.ts +0 -59
  142. package/lib/node/typings.js +0 -1
  143. package/lib/node/utils/assignDefaultLocaleOptions.d.ts +0 -7
  144. package/lib/node/utils/assignDefaultLocaleOptions.js +0 -51
  145. package/lib/node/utils/index.d.ts +0 -2
  146. package/lib/node/utils/index.js +0 -2
  147. package/lib/node/utils/resolveMarkdownHintLocales.d.ts +0 -12
  148. package/lib/node/utils/resolveMarkdownHintLocales.js +0 -22
  149. package/lib/shared/index.d.ts +0 -5
  150. package/lib/shared/index.js +0 -1
  151. package/lib/shared/nav.d.ts +0 -32
  152. package/lib/shared/nav.js +0 -1
  153. package/lib/shared/navbar.d.ts +0 -21
  154. package/lib/shared/navbar.js +0 -1
  155. package/lib/shared/options.d.ts +0 -244
  156. package/lib/shared/options.js +0 -1
  157. package/lib/shared/page.d.ts +0 -44
  158. package/lib/shared/page.js +0 -1
  159. package/lib/shared/sidebar.d.ts +0 -26
  160. package/lib/shared/sidebar.js +0 -1
  161. /package/{lib → dist}/client/components/VPAutoLink.vue +0 -0
  162. /package/{lib → dist}/client/components/VPDarkIcon.vue +0 -0
  163. /package/{lib → dist}/client/components/VPDropdownTransition.vue +0 -0
  164. /package/{lib → dist}/client/components/VPEditIcon.vue +0 -0
  165. /package/{lib → dist}/client/components/VPFadeSlideYTransition.vue +0 -0
  166. /package/{lib → dist}/client/components/VPHome.vue +0 -0
  167. /package/{lib → dist}/client/components/VPHomeFeatures.vue +0 -0
  168. /package/{lib → dist}/client/components/VPHomeFooter.vue +0 -0
  169. /package/{lib → dist}/client/components/VPLightIcon.vue +0 -0
  170. /package/{lib → dist}/client/components/VPNavbarDropdown.vue +0 -0
  171. /package/{lib → dist}/client/components/VPNavbarItems.vue +0 -0
  172. /package/{lib → dist}/client/components/VPPage.vue +0 -0
  173. /package/{lib → dist}/client/components/VPPageMeta.vue +0 -0
  174. /package/{lib → dist}/client/components/VPPageNav.vue +0 -0
  175. /package/{lib → dist}/client/components/VPSidebar.vue +0 -0
  176. /package/{lib → dist}/client/components/VPSidebarItem.vue +0 -0
  177. /package/{lib → dist}/client/components/VPSidebarItems.vue +0 -0
  178. /package/{lib → dist}/client/components/VPToggleColorModeButton.vue +0 -0
  179. /package/{lib → dist}/client/components/VPToggleSidebarButton.vue +0 -0
  180. /package/{lib → dist}/client/components/global/Badge.vue +0 -0
  181. /package/{lib → dist}/client/shim.d.ts +0 -0
  182. /package/{lib → dist}/client/styles/_mixins.scss +0 -0
  183. /package/{lib → dist}/client/styles/_variables.module.scss +0 -0
  184. /package/{lib → dist}/client/styles/_variables.scss +0 -0
  185. /package/{lib → dist}/client/styles/code-group.scss +0 -0
  186. /package/{lib → dist}/client/styles/content/code.scss +0 -0
  187. /package/{lib → dist}/client/styles/content/index.scss +0 -0
  188. /package/{lib → dist}/client/styles/content/normalize.scss +0 -0
  189. /package/{lib → dist}/client/styles/content/toc.scss +0 -0
  190. /package/{lib → dist}/client/styles/external-link-icon.scss +0 -0
  191. /package/{lib → dist}/client/styles/index.scss +0 -0
  192. /package/{lib → dist}/client/styles/layout.scss +0 -0
  193. /package/{lib → dist}/client/styles/normalize.scss +0 -0
  194. /package/{lib → dist}/client/styles/plugins.scss +0 -0
  195. /package/{lib → dist}/client/styles/vars-dark.scss +0 -0
@@ -0,0 +1,13 @@
1
+ import { t as NavbarItem } from "./typings-NbQSzbOn.js";
2
+ import { ComputedRef } from "vue";
3
+
4
+ //#region src/client/composables/useNavbarSelectLanguage.d.ts
5
+ /**
6
+ * Get navbar config of select language dropdown
7
+ *
8
+ * @returns Navbar config of select language dropdown
9
+ */
10
+ declare const useNavbarSelectLanguage: () => ComputedRef<NavbarItem[]>;
11
+ //#endregion
12
+ export { useNavbarSelectLanguage as t };
13
+ //# sourceMappingURL=useNavbarSelectLanguage-4GkrPvc2.d.ts.map
@@ -0,0 +1,5 @@
1
+ //#region src/client/composables/useNavigate.d.ts
2
+ declare const useNavigate: () => ((url: string) => void);
3
+ //#endregion
4
+ export { useNavigate as t };
5
+ //# sourceMappingURL=useNavigate-lH4xyHOV.d.ts.map
@@ -0,0 +1,12 @@
1
+ import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
2
+ import { ComputedRef } from "vue";
3
+
4
+ //#region src/client/composables/useRelatedLinks.d.ts
5
+ interface RelatedLinks {
6
+ prevLink: ComputedRef<AutoLinkOptions | null>;
7
+ nextLink: ComputedRef<AutoLinkOptions | null>;
8
+ }
9
+ declare const useRelatedLinks: () => RelatedLinks;
10
+ //#endregion
11
+ export { useRelatedLinks as t };
12
+ //# sourceMappingURL=useRelatedLinks-ChTW2RRU.d.ts.map
@@ -0,0 +1,10 @@
1
+ //#region src/client/composables/useScrollPromise.d.ts
2
+ interface ScrollPromise {
3
+ wait(): Promise<void> | null;
4
+ pending: () => void;
5
+ resolve: () => void;
6
+ }
7
+ declare const useScrollPromise: () => ScrollPromise;
8
+ //#endregion
9
+ export { useScrollPromise as n, ScrollPromise as t };
10
+ //# sourceMappingURL=useScrollPromise-BAl732Uv.d.ts.map
@@ -0,0 +1,80 @@
1
+ import { a as SidebarObjectOptions, o as SidebarOptions, t as SidebarArrayOptions } from "./sidebar-CF1YPYLN.js";
2
+ import { i as SidebarItem, r as SidebarHeaderItem } from "./typings-NbQSzbOn.js";
3
+ import { PageData, PageHeader } from "vuepress/client";
4
+ import { ComputedRef, InjectionKey } from "vue";
5
+
6
+ //#region src/client/composables/useSidebarItems.d.ts
7
+ /**
8
+ * Util to transform page header to sidebar item
9
+ *
10
+ * @param header page header
11
+ * @returns sidebar item from header
12
+ */
13
+ declare const resolveSidebarPageHeader: (header: PageHeader) => SidebarHeaderItem;
14
+ /**
15
+ * get sidebar header items from page headers
16
+ *
17
+ * @param headers page headers
18
+ * @returns sidebar header items
19
+ */
20
+ declare const resolveSidebarPageHeaders: (headers?: PageHeader[]) => SidebarHeaderItem[];
21
+ /**
22
+ * Resolve current page and its header to sidebar items if the config is `heading`
23
+ *
24
+ * @param page current page data
25
+ * @param headers current page headers
26
+ *
27
+ * @returns sidebar items
28
+ */
29
+ declare const resolveSidebarHeadingItem: (page: PageData, headers: PageHeader[]) => SidebarItem[];
30
+ /**
31
+ * Resolve sidebar items if the config is an array
32
+ *
33
+ * @param sidebarConfig sidebar config array
34
+ * @param headers current page headers
35
+ * @param path current page path
36
+ * @param prefix path prefix
37
+ *
38
+ * @returns resolved sidebar items
39
+ */
40
+ declare const resolveArraySidebarItems: (sidebarConfig: SidebarArrayOptions, headers: PageHeader[], path: string, prefix?: string) => SidebarItem[];
41
+ /**
42
+ * Resolve sidebar items if the config is a key -> value (path-prefix -> array) object
43
+ *
44
+ * @param sidebarConfig sidebar config object
45
+ * @param page current page data
46
+ * @param headers current page headers
47
+ * @param path current page path
48
+ *
49
+ * @returns resolved sidebar items
50
+ */
51
+ declare const resolveMultiSidebarItems: (sidebarConfig: SidebarObjectOptions, page: PageData, headers: PageHeader[], path: string) => SidebarItem[];
52
+ type SidebarItemsRef = ComputedRef<SidebarItem[]>;
53
+ declare const sidebarItemsSymbol: InjectionKey<SidebarItemsRef>;
54
+ /**
55
+ * Inject sidebar items global computed
56
+ *
57
+ * @returns sidebar items global computed
58
+ */
59
+ declare const useSidebarItems: () => SidebarItemsRef;
60
+ /**
61
+ * Resolve sidebar items global computed
62
+ *
63
+ * It should only be resolved and provided once
64
+ *
65
+ * @param sidebarConfig sidebar config
66
+ * @param page current page data
67
+ * @param path current page path
68
+ * @param routeLocale current route locale
69
+ * @param headers current page headers
70
+ *
71
+ * @returns resolved sidebar items
72
+ */
73
+ declare const resolveSidebarItems: (sidebarConfig: SidebarOptions | false, page: PageData, path: string, routeLocale: string, headers: PageHeader[]) => SidebarItem[];
74
+ /**
75
+ * Create sidebar items ref and provide as global computed in setup
76
+ */
77
+ declare const setupSidebarItems: () => void;
78
+ //#endregion
79
+ export { resolveSidebarItems as a, setupSidebarItems as c, resolveSidebarHeadingItem as i, sidebarItemsSymbol as l, resolveArraySidebarItems as n, resolveSidebarPageHeader as o, resolveMultiSidebarItems as r, resolveSidebarPageHeaders as s, SidebarItemsRef as t, useSidebarItems as u };
80
+ //# sourceMappingURL=useSidebarItems-CdpB96Ta.d.ts.map
@@ -0,0 +1,14 @@
1
+ //#region src/client/composables/useUpdateDeviceStatus.d.ts
2
+ declare enum DeviceType {
3
+ Mobile = "mobile"
4
+ }
5
+ /**
6
+ * add listener to detect screen though device type
7
+ *
8
+ * @param deviceType - Device type to detect / 要检测的设备类型
9
+ * @param callback - Callback function to call when device status changes / 设备状态改变时调用的回调函数
10
+ */
11
+ declare const useUpdateDeviceStatus: (deviceType: DeviceType, callback: (width: number) => void) => void;
12
+ //#endregion
13
+ export { useUpdateDeviceStatus as n, DeviceType as t };
14
+ //# sourceMappingURL=useUpdateDeviceStatus-SBnOZx8J.d.ts.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-rc.123",
3
+ "version": "2.0.0-rc.125",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "default",
@@ -20,48 +20,57 @@
20
20
  "directory": "themes/theme-default"
21
21
  },
22
22
  "files": [
23
- "lib",
23
+ "dist",
24
24
  "templates"
25
25
  ],
26
26
  "type": "module",
27
27
  "sideEffects": [
28
- "./lib/client/components/**/*.vue",
29
- "./lib/client/layouts/*.vue",
30
- "./lib/client/styles/*.scss"
28
+ "./dist/client/components/**/*.vue",
29
+ "./dist/client/layouts/*.vue",
30
+ "./dist/client/styles/*.scss"
31
31
  ],
32
- "main": "./lib/node/index.js",
33
- "types": "./lib/node/index.d.ts",
32
+ "main": "./dist/node/index.js",
33
+ "types": "./dist/node/index.d.ts",
34
34
  "exports": {
35
- ".": "./lib/node/index.js",
36
- "./client": "./lib/client/index.js",
37
- "./components/*": "./lib/client/components/*",
38
- "./layouts/*": "./lib/client/layouts/*",
39
- "./styles/*": "./lib/client/styles/*",
35
+ ".": {
36
+ "types": "./dist/node/index.d.ts",
37
+ "default": "./dist/node/index.js"
38
+ },
39
+ "./client": {
40
+ "types": "./dist/client/index.d.ts",
41
+ "default": "./dist/client/index.js"
42
+ },
43
+ "./components/*": "./dist/client/components/*",
44
+ "./layouts/*": "./dist/client/layouts/*",
45
+ "./styles/*.scss": "./dist/client/styles/*.scss",
46
+ "./styles/*": {
47
+ "sass": "./dist/client/styles/*.scss"
48
+ },
40
49
  "./templates/*": "./templates/*",
41
- "./lib/*": "./lib/*",
50
+ "./dist/*": "./dist/*",
42
51
  "./package.json": "./package.json"
43
52
  },
44
53
  "publishConfig": {
45
54
  "access": "public"
46
55
  },
47
56
  "dependencies": {
48
- "@vuepress/helper": "2.0.0-rc.123",
49
- "@vuepress/plugin-active-header-links": "2.0.0-rc.123",
50
- "@vuepress/plugin-back-to-top": "2.0.0-rc.123",
51
- "@vuepress/plugin-copy-code": "2.0.0-rc.123",
52
- "@vuepress/plugin-git": "2.0.0-rc.123",
53
- "@vuepress/plugin-links-check": "2.0.0-rc.123",
54
- "@vuepress/plugin-markdown-hint": "2.0.0-rc.123",
55
- "@vuepress/plugin-markdown-tab": "2.0.0-rc.123",
56
- "@vuepress/plugin-medium-zoom": "2.0.0-rc.123",
57
- "@vuepress/plugin-nprogress": "2.0.0-rc.123",
58
- "@vuepress/plugin-palette": "2.0.0-rc.123",
59
- "@vuepress/plugin-prismjs": "2.0.0-rc.123",
60
- "@vuepress/plugin-seo": "2.0.0-rc.123",
61
- "@vuepress/plugin-sitemap": "2.0.0-rc.123",
62
- "@vuepress/plugin-theme-data": "2.0.0-rc.123",
57
+ "@vuepress/helper": "2.0.0-rc.125",
58
+ "@vuepress/plugin-active-header-links": "2.0.0-rc.125",
59
+ "@vuepress/plugin-back-to-top": "2.0.0-rc.125",
60
+ "@vuepress/plugin-copy-code": "2.0.0-rc.125",
61
+ "@vuepress/plugin-git": "2.0.0-rc.125",
62
+ "@vuepress/plugin-links-check": "2.0.0-rc.125",
63
+ "@vuepress/plugin-markdown-hint": "2.0.0-rc.125",
64
+ "@vuepress/plugin-markdown-tab": "2.0.0-rc.125",
65
+ "@vuepress/plugin-medium-zoom": "2.0.0-rc.125",
66
+ "@vuepress/plugin-nprogress": "2.0.0-rc.125",
67
+ "@vuepress/plugin-palette": "2.0.0-rc.125",
68
+ "@vuepress/plugin-prismjs": "2.0.0-rc.125",
69
+ "@vuepress/plugin-seo": "2.0.0-rc.125",
70
+ "@vuepress/plugin-sitemap": "2.0.0-rc.125",
71
+ "@vuepress/plugin-theme-data": "2.0.0-rc.125",
63
72
  "@vueuse/core": "^14.2.1",
64
- "vue": "^3.5.28"
73
+ "vue": "^3.5.29"
65
74
  },
66
75
  "peerDependencies": {
67
76
  "sass": "^1.97.3",
@@ -80,5 +89,5 @@
80
89
  "optional": true
81
90
  }
82
91
  },
83
- "gitHead": "4d944d5826c6ed0487caa973516f9db0194dc934"
92
+ "gitHead": "58e660bb7138f1883e5440a08903d09cdbabcdc8"
84
93
  }
@@ -1,2 +0,0 @@
1
- import Badge from './Badge.vue';
2
- export { Badge };
@@ -1,2 +0,0 @@
1
- import Badge from './Badge.vue';
2
- export { Badge };
@@ -1,11 +0,0 @@
1
- export * from './useDarkMode.js';
2
- export * from './useData.js';
3
- export * from './useEditLink.js';
4
- export * from './useNavigate.js';
5
- export * from './useNavbarConfig.js';
6
- export * from './useNavbarRepo.js';
7
- export * from './useNavbarSelectLanguage.js';
8
- export * from './useRelatedLinks.js';
9
- export * from './useScrollPromise.js';
10
- export * from './useSidebarItems.js';
11
- export * from './useUpdateDeviceStatus.js';
@@ -1,11 +0,0 @@
1
- export * from './useDarkMode.js';
2
- export * from './useData.js';
3
- export * from './useEditLink.js';
4
- export * from './useNavigate.js';
5
- export * from './useNavbarConfig.js';
6
- export * from './useNavbarRepo.js';
7
- export * from './useNavbarSelectLanguage.js';
8
- export * from './useRelatedLinks.js';
9
- export * from './useScrollPromise.js';
10
- export * from './useSidebarItems.js';
11
- export * from './useUpdateDeviceStatus.js';
@@ -1,14 +0,0 @@
1
- import type { WritableComputedRef } from 'vue';
2
- export type DarkModeRef = WritableComputedRef<boolean>;
3
- /**
4
- * Inject dark mode global computed
5
- *
6
- * 注入暗色模式全局计算属性
7
- *
8
- * @returns Dark mode ref / 暗色模式引用
9
- */
10
- export declare const useDarkMode: () => DarkModeRef;
11
- /**
12
- * Create dark mode ref and provide as global computed in setup
13
- */
14
- export declare const setupDarkMode: () => void;
@@ -1,64 +0,0 @@
1
- import { useData } from '@theme/useData';
2
- import { darkModeSymbol } from '@vuepress/helper/client';
3
- import { usePreferredDark, useStorage, watchImmediate } from '@vueuse/core';
4
- import { computed, inject, onMounted, onUnmounted, provide } from 'vue';
5
- const update = (value) => {
6
- // set `class="dark"` on `<html>` element
7
- const el = globalThis.document.documentElement;
8
- // set `data-theme="light|dark"` on `<html>` element
9
- el.dataset.theme = value ? 'dark' : 'light';
10
- };
11
- const applyDarkModeToHTML = (isDarkMode) => {
12
- onMounted(() => {
13
- watchImmediate(isDarkMode, update);
14
- });
15
- onUnmounted(() => {
16
- update(isDarkMode.value);
17
- });
18
- };
19
- /**
20
- * Inject dark mode global computed
21
- *
22
- * 注入暗色模式全局计算属性
23
- *
24
- * @returns Dark mode ref / 暗色模式引用
25
- */
26
- export const useDarkMode = () => {
27
- const isDarkMode = inject(darkModeSymbol);
28
- if (!isDarkMode) {
29
- throw new Error('useDarkMode() is called without provider.');
30
- }
31
- return isDarkMode;
32
- };
33
- /**
34
- * Create dark mode ref and provide as global computed in setup
35
- */
36
- export const setupDarkMode = () => {
37
- const { themeLocale } = useData();
38
- const isDarkPreferred = usePreferredDark();
39
- const darkStorage = useStorage('vuepress-color-scheme', themeLocale.value.colorMode);
40
- const isDarkMode = computed({
41
- get() {
42
- // disable color mode switching
43
- if (!themeLocale.value.colorModeSwitch) {
44
- return themeLocale.value.colorMode === 'dark';
45
- }
46
- // auto detected from prefers-color-scheme
47
- if (darkStorage.value === 'auto') {
48
- return isDarkPreferred.value;
49
- }
50
- // storage value
51
- return darkStorage.value === 'dark';
52
- },
53
- set(val) {
54
- if (val === isDarkPreferred.value) {
55
- darkStorage.value = 'auto';
56
- }
57
- else {
58
- darkStorage.value = val ? 'dark' : 'light';
59
- }
60
- },
61
- });
62
- provide(darkModeSymbol, isDarkMode);
63
- applyDarkModeToHTML(isDarkMode);
64
- };
@@ -1,8 +0,0 @@
1
- import type { ThemeDataRef, ThemeLocaleDataRef } from '@vuepress/plugin-theme-data/client';
2
- import type { ClientData } from 'vuepress/client';
3
- import type { DefaultThemeData, DefaultThemeNormalPageFrontmatter, DefaultThemePageData } from '../../shared/index.js';
4
- export interface Data<PageFrontmatter extends Record<string, unknown> = DefaultThemeNormalPageFrontmatter, PageData extends Record<string, unknown> = DefaultThemePageData> extends Pick<ClientData<PageFrontmatter, PageData>, 'frontmatter' | 'head' | 'headTitle' | 'lang' | 'layouts' | 'page' | 'pageComponent' | 'pageLayout' | 'redirects' | 'routeLocale' | 'routePath' | 'routes' | 'site' | 'siteLocale'> {
5
- theme: ThemeDataRef<DefaultThemeData>;
6
- themeLocale: ThemeLocaleDataRef<DefaultThemeData>;
7
- }
8
- export declare const useData: <PageFrontmatter extends Record<string, unknown> = DefaultThemeNormalPageFrontmatter, PageData extends Record<string, unknown> = DefaultThemePageData>() => Data<PageFrontmatter, PageData>;
@@ -1,7 +0,0 @@
1
- import { useThemeData, useThemeLocaleData, } from '@vuepress/plugin-theme-data/client';
2
- import { useData as _useData } from 'vuepress/client';
3
- export const useData = () => ({
4
- ..._useData(),
5
- theme: useThemeData(),
6
- themeLocale: useThemeLocaleData(),
7
- });
@@ -1,3 +0,0 @@
1
- import type { ComputedRef } from 'vue';
2
- import type { AutoLinkConfig } from 'vuepress/client';
3
- export declare const useEditLink: () => ComputedRef<AutoLinkConfig | null>;
@@ -1,28 +0,0 @@
1
- import { resolveEditLink } from '@theme/resolveEditLink';
2
- import { useData } from '@theme/useData';
3
- import { computed } from 'vue';
4
- export const useEditLink = () => {
5
- const { frontmatter, page, themeLocale } = useData();
6
- return computed(() => {
7
- const showEditLink = frontmatter.value.editLink ?? themeLocale.value.editLink ?? true;
8
- if (!showEditLink) {
9
- return null;
10
- }
11
- const { repo, docsRepo = repo, docsBranch = 'main', docsDir = '', editLinkText, } = themeLocale.value;
12
- if (!docsRepo)
13
- return null;
14
- const editLink = resolveEditLink({
15
- docsRepo,
16
- docsBranch,
17
- docsDir,
18
- filePathRelative: page.value.filePathRelative,
19
- editLinkPattern: frontmatter.value.editLinkPattern ?? themeLocale.value.editLinkPattern,
20
- });
21
- if (!editLink)
22
- return null;
23
- return {
24
- text: editLinkText ?? 'Edit this page',
25
- link: editLink,
26
- };
27
- });
28
- };
@@ -1,13 +0,0 @@
1
- import type { HeaderItem } from '@vuepress/helper/client';
2
- import type { InjectionKey, Ref } from 'vue';
3
- export type HeadersRef = Ref<HeaderItem[]>;
4
- export declare const headersSymbol: InjectionKey<HeadersRef>;
5
- /**
6
- * Inject headers
7
- *
8
- * 注入标题
9
- *
10
- * @returns Headers ref / 标题引用
11
- */
12
- export declare const useHeaders: () => HeadersRef;
13
- export declare const setupHeaders: () => void;
@@ -1,42 +0,0 @@
1
- import { useData } from '@theme/useData';
2
- import { getHeaders } from '@vuepress/helper/client';
3
- import { injectLocal, provideLocal } from '@vueuse/core';
4
- import { computed, ref } from 'vue';
5
- import { onContentUpdated } from 'vuepress/client';
6
- export const headersSymbol = Symbol('headers');
7
- /**
8
- * Inject headers
9
- *
10
- * 注入标题
11
- *
12
- * @returns Headers ref / 标题引用
13
- */
14
- export const useHeaders = () => {
15
- const headers = injectLocal(headersSymbol);
16
- if (!headers) {
17
- throw new Error('useHeaders() is called without provider.');
18
- }
19
- return headers;
20
- };
21
- export const setupHeaders = () => {
22
- const { frontmatter, themeLocale } = useData();
23
- const headersRef = ref([]);
24
- const levels = computed(() => frontmatter.value.sidebarDepth ?? themeLocale.value.sidebarDepth ?? 2);
25
- const updateHeaders = () => {
26
- if (levels.value <= 0) {
27
- headersRef.value = [];
28
- return;
29
- }
30
- headersRef.value = getHeaders({
31
- levels: [2, levels.value + 1],
32
- ignore: ['.vp-badge'],
33
- });
34
- };
35
- provideLocal(headersSymbol, headersRef);
36
- onContentUpdated((reason) => {
37
- if (reason === 'beforeUnmount')
38
- headersRef.value = [];
39
- else
40
- updateHeaders();
41
- });
42
- };
@@ -1,3 +0,0 @@
1
- import type { ComputedRef } from 'vue';
2
- import type { NavbarItem } from '../typings.js';
3
- export declare const useNavbarConfig: () => ComputedRef<NavbarItem[]>;
@@ -1,27 +0,0 @@
1
- import { resolveAutoLink } from '@theme/resolveAutoLink';
2
- import { resolvePrefix } from '@theme/resolvePrefix';
3
- import { useData } from '@theme/useData';
4
- import { isLinkRelative } from '@vuepress/helper/client';
5
- import { computed } from 'vue';
6
- import { isString } from 'vuepress/shared';
7
- const resolveNavbarItem = (item, prefix = '') => {
8
- if (isString(item)) {
9
- return resolveAutoLink(resolvePrefix(prefix, item));
10
- }
11
- if ('children' in item) {
12
- return {
13
- ...item,
14
- children: item.children.map((child) => resolveNavbarItem(child, resolvePrefix(prefix, item.prefix))),
15
- };
16
- }
17
- return {
18
- ...item,
19
- link: isLinkRelative(item.link)
20
- ? resolveAutoLink(resolvePrefix(prefix, item.link)).link
21
- : item.link,
22
- };
23
- };
24
- export const useNavbarConfig = () => {
25
- const { themeLocale } = useData();
26
- return computed(() => (themeLocale.value.navbar || []).map((item) => resolveNavbarItem(item)));
27
- };
@@ -1,8 +0,0 @@
1
- import type { ComputedRef } from 'vue';
2
- import type { NavbarItem } from '../typings.js';
3
- /**
4
- * Repository link in navbar
5
- *
6
- * @returns Navbar config of repository link / 仓库链接的导航栏配置
7
- */
8
- export declare const useNavbarRepo: () => ComputedRef<NavbarItem[]>;
@@ -1,40 +0,0 @@
1
- import { resolveRepoType } from '@theme/resolveRepoType';
2
- import { useData } from '@theme/useData';
3
- import { computed } from 'vue';
4
- import { isLinkHttp } from 'vuepress/shared';
5
- /**
6
- * Repository link in navbar
7
- *
8
- * @returns Navbar config of repository link / 仓库链接的导航栏配置
9
- */
10
- export const useNavbarRepo = () => {
11
- const { themeLocale } = useData();
12
- const repo = computed(() => themeLocale.value.repo);
13
- const repoType = computed(() => repo.value ? resolveRepoType(repo.value) : null);
14
- const repoLink = computed(() => {
15
- if (repo.value && !isLinkHttp(repo.value)) {
16
- return `https://github.com/${repo.value}`;
17
- }
18
- return repo.value;
19
- });
20
- const repoLabel = computed(() => {
21
- if (!repoLink.value)
22
- return null;
23
- if (themeLocale.value.repoLabel)
24
- return themeLocale.value.repoLabel;
25
- if (repoType.value == null)
26
- return 'Source';
27
- return repoType.value;
28
- });
29
- return computed(() => {
30
- if (!repoLink.value || !repoLabel.value) {
31
- return [];
32
- }
33
- return [
34
- {
35
- text: repoLabel.value,
36
- link: repoLink.value,
37
- },
38
- ];
39
- });
40
- };
@@ -1,8 +0,0 @@
1
- import type { ComputedRef } from 'vue';
2
- import type { NavbarItem } from '../typings.js';
3
- /**
4
- * Get navbar config of select language dropdown
5
- *
6
- * @returns Navbar config of select language dropdown
7
- */
8
- export declare const useNavbarSelectLanguage: () => ComputedRef<NavbarItem[]>;
@@ -1,60 +0,0 @@
1
- import { useData } from '@theme/useData';
2
- import { useRoutePaths } from '@vuepress/helper/client';
3
- import { useMounted } from '@vueuse/core';
4
- import { computed } from 'vue';
5
- import { useRoute } from 'vuepress/client';
6
- /**
7
- * Get navbar config of select language dropdown
8
- *
9
- * @returns Navbar config of select language dropdown
10
- */
11
- export const useNavbarSelectLanguage = () => {
12
- const route = useRoute();
13
- const routePaths = useRoutePaths();
14
- const { routeLocale, site, siteLocale, theme, themeLocale } = useData();
15
- const isMounted = useMounted();
16
- return computed(() => {
17
- const localePaths = Object.keys(site.value.locales);
18
- // do not display language selection dropdown if there is only one language
19
- if (localePaths.length < 2) {
20
- return [];
21
- }
22
- const currentPath = route.path;
23
- const currentFullPath = route.fullPath;
24
- const languageDropdown = {
25
- text: `${themeLocale.value.selectLanguageText}`,
26
- ariaLabel: `${themeLocale.value.selectLanguageAriaLabel ??
27
- themeLocale.value.selectLanguageText}`,
28
- children: localePaths.map((targetLocalePath) => {
29
- // target locale config of this language link
30
- const targetSiteLocale = site.value.locales?.[targetLocalePath] ?? {};
31
- const targetThemeLocale = theme.value.locales?.[targetLocalePath] ?? {};
32
- const targetLang = `${targetSiteLocale.lang}`;
33
- const text = targetThemeLocale.selectLanguageName ?? targetLang;
34
- // if the target language is current language
35
- // stay at current link
36
- if (targetLang === siteLocale.value.lang) {
37
- return {
38
- text,
39
- activeMatch: '.',
40
- link: isMounted.value ? currentFullPath : currentPath,
41
- };
42
- }
43
- // if the target language is not current language
44
- // try to link to the corresponding page of current page
45
- // or fallback to homepage
46
- const targetLocalePage = currentPath.replace(routeLocale.value, targetLocalePath);
47
- return {
48
- text,
49
- // try to keep current hash and params across languages
50
- link: routePaths.value.some((item) => item === targetLocalePage)
51
- ? isMounted.value
52
- ? currentFullPath.replace(currentPath, targetLocalePage)
53
- : targetLocalePage
54
- : (targetThemeLocale.home ?? targetLocalePath),
55
- };
56
- }),
57
- };
58
- return [languageDropdown];
59
- });
60
- };
@@ -1 +0,0 @@
1
- export declare const useNavigate: () => ((url: string) => void);
@@ -1,22 +0,0 @@
1
- import { isLinkAbsolute, isLinkWithProtocol } from '@vuepress/helper/client';
2
- import { useRoute, useRouter } from 'vuepress/client';
3
- export const useNavigate = () => {
4
- const router = useRouter();
5
- const route = useRoute();
6
- return (url) => {
7
- if (url)
8
- if (isLinkAbsolute(url)) {
9
- // Inner absolute path
10
- if (route.fullPath !== url)
11
- void router.push(url);
12
- }
13
- else if (isLinkWithProtocol(url)) {
14
- // external url
15
- window.open(url);
16
- }
17
- else {
18
- // relative url
19
- void router.push(encodeURI(url));
20
- }
21
- };
22
- };