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

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 (105) hide show
  1. package/lib/client/components/VPHomeHero.vue +9 -14
  2. package/lib/client/components/VPNavbar.vue +8 -11
  3. package/lib/client/components/VPNavbarBrand.vue +4 -5
  4. package/lib/client/components/VPNavbarDropdown.vue +4 -2
  5. package/lib/client/components/VPNavbarItems.vue +3 -3
  6. package/lib/client/components/VPPageNav.vue +3 -5
  7. package/lib/client/components/VPSidebarItem.vue +3 -3
  8. package/lib/client/composables/index.d.ts +12 -11
  9. package/lib/client/composables/index.js +1 -11
  10. package/lib/client/composables/useDarkMode.d.ts +13 -4
  11. package/lib/client/composables/useDarkMode.js +2 -60
  12. package/lib/client/composables/useDarkMode.js.map +1 -0
  13. package/lib/client/composables/useData.d.ts +12 -7
  14. package/lib/client/composables/useData.js +2 -7
  15. package/lib/client/composables/useData.js.map +1 -0
  16. package/lib/client/composables/useEditLink.d.ts +8 -3
  17. package/lib/client/composables/useEditLink.js +2 -28
  18. package/lib/client/composables/useEditLink.js.map +1 -0
  19. package/lib/client/composables/useHeaders.d.ts +15 -6
  20. package/lib/client/composables/useHeaders.js +2 -38
  21. package/lib/client/composables/useHeaders.js.map +1 -0
  22. package/lib/client/composables/useNavbarConfig.d.ts +8 -3
  23. package/lib/client/composables/useNavbarConfig.js +2 -29
  24. package/lib/client/composables/useNavbarConfig.js.map +1 -0
  25. package/lib/client/composables/useNavbarRepo.d.ts +11 -4
  26. package/lib/client/composables/useNavbarRepo.js +2 -38
  27. package/lib/client/composables/useNavbarRepo.js.map +1 -0
  28. package/lib/client/composables/useNavbarSelectLanguage.d.ts +10 -3
  29. package/lib/client/composables/useNavbarSelectLanguage.js +2 -59
  30. package/lib/client/composables/useNavbarSelectLanguage.js.map +1 -0
  31. package/lib/client/composables/useNavigate.d.ts +5 -1
  32. package/lib/client/composables/useNavigate.js +2 -22
  33. package/lib/client/composables/useNavigate.js.map +1 -0
  34. package/lib/client/composables/useRelatedLinks.d.ts +10 -6
  35. package/lib/client/composables/useRelatedLinks.js +2 -90
  36. package/lib/client/composables/useRelatedLinks.js.map +1 -0
  37. package/lib/client/composables/useScrollPromise.d.ts +9 -5
  38. package/lib/client/composables/useScrollPromise.js +2 -16
  39. package/lib/client/composables/useScrollPromise.js.map +1 -0
  40. package/lib/client/composables/useSidebarItems.d.ts +57 -14
  41. package/lib/client/composables/useSidebarItems.js +2 -127
  42. package/lib/client/composables/useSidebarItems.js.map +1 -0
  43. package/lib/client/composables/useUpdateDeviceStatus.d.ts +10 -3
  44. package/lib/client/composables/useUpdateDeviceStatus.js +2 -30
  45. package/lib/client/composables/useUpdateDeviceStatus.js.map +1 -0
  46. package/lib/client/config.d.ts +10 -5
  47. package/lib/client/config.js +2 -33
  48. package/lib/client/config.js.map +1 -0
  49. package/lib/client/index.d.ts +21 -4
  50. package/lib/client/index.js +1 -2
  51. package/lib/client/layouts/Layout.vue +9 -12
  52. package/lib/client/layouts/NotFound.vue +1 -2
  53. package/lib/client/styles/arrow.scss +1 -2
  54. package/lib/client/styles/vars.scss +1 -2
  55. package/lib/client/utils/index.d.ts +6 -5
  56. package/lib/client/utils/index.js +1 -5
  57. package/lib/client/utils/isActiveSidebarItem.d.ts +8 -3
  58. package/lib/client/utils/isActiveSidebarItem.js +2 -20
  59. package/lib/client/utils/isActiveSidebarItem.js.map +1 -0
  60. package/lib/client/utils/resolveAutoLink.d.ts +13 -2
  61. package/lib/client/utils/resolveAutoLink.js +2 -17
  62. package/lib/client/utils/resolveAutoLink.js.map +1 -0
  63. package/lib/client/utils/resolveEditLink.d.ts +19 -8
  64. package/lib/client/utils/resolveEditLink.js +2 -29
  65. package/lib/client/utils/resolveEditLink.js.map +1 -0
  66. package/lib/client/utils/resolvePrefix.d.ts +5 -1
  67. package/lib/client/utils/resolvePrefix.js +2 -4
  68. package/lib/client/utils/resolvePrefix.js.map +1 -0
  69. package/lib/client/utils/resolveRepoType.d.ts +6 -2
  70. package/lib/client/utils/resolveRepoType.js +2 -12
  71. package/lib/client/utils/resolveRepoType.js.map +1 -0
  72. package/lib/nav-DikslSJ_.d.ts +36 -0
  73. package/lib/node/index.d.ts +106 -4
  74. package/lib/node/index.js +2 -2
  75. package/lib/node/index.js.map +1 -0
  76. package/lib/page-F2gyvsdE.d.ts +292 -0
  77. package/lib/sidebar-FqrQ3PGy.d.ts +53 -0
  78. package/lib/typings-jKn48KwS.d.ts +19 -0
  79. package/package.json +47 -38
  80. package/lib/client/components/global/index.d.ts +0 -2
  81. package/lib/client/components/global/index.js +0 -2
  82. package/lib/client/typings.d.ts +0 -13
  83. package/lib/client/typings.js +0 -1
  84. package/lib/node/defaultTheme.d.ts +0 -15
  85. package/lib/node/defaultTheme.js +0 -140
  86. package/lib/node/typings.d.ts +0 -59
  87. package/lib/node/typings.js +0 -1
  88. package/lib/node/utils/assignDefaultLocaleOptions.d.ts +0 -7
  89. package/lib/node/utils/assignDefaultLocaleOptions.js +0 -51
  90. package/lib/node/utils/index.d.ts +0 -2
  91. package/lib/node/utils/index.js +0 -2
  92. package/lib/node/utils/resolveMarkdownHintLocales.d.ts +0 -9
  93. package/lib/node/utils/resolveMarkdownHintLocales.js +0 -19
  94. package/lib/shared/index.d.ts +0 -5
  95. package/lib/shared/index.js +0 -1
  96. package/lib/shared/nav.d.ts +0 -32
  97. package/lib/shared/nav.js +0 -1
  98. package/lib/shared/navbar.d.ts +0 -21
  99. package/lib/shared/navbar.js +0 -1
  100. package/lib/shared/options.d.ts +0 -244
  101. package/lib/shared/options.js +0 -1
  102. package/lib/shared/page.d.ts +0 -44
  103. package/lib/shared/page.js +0 -1
  104. package/lib/shared/sidebar.d.ts +0 -26
  105. package/lib/shared/sidebar.js +0 -1
@@ -0,0 +1,292 @@
1
+ import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
2
+ import { o as SidebarOptions, t as SidebarArrayOptions, u as NavbarOptions } from "./sidebar-FqrQ3PGy.js";
3
+ import { GitPluginPageData } from "@vuepress/plugin-git";
4
+ import { ThemeData } from "@vuepress/plugin-theme-data";
5
+ import { LocaleData, PageFrontmatter } from "vuepress/shared";
6
+
7
+ //#region src/shared/options.d.ts
8
+ type DefaultThemeLocaleOptions = DefaultThemeData;
9
+ type DefaultThemeData = ThemeData<DefaultThemeLocaleData>;
10
+ interface DefaultThemeLocaleData extends LocaleData {
11
+ /**
12
+ * Default color mode
13
+ *
14
+ * @default 'auto'
15
+ */
16
+ colorMode?: 'auto' | 'dark' | 'light';
17
+ /**
18
+ * Enable color mode switching and display a button in navbar or not
19
+ *
20
+ * @default true
21
+ */
22
+ colorModeSwitch?: boolean;
23
+ /**
24
+ * Whether show external link icon
25
+ *
26
+ * @default true
27
+ */
28
+ externalLinkIcon?: boolean;
29
+ /**
30
+ * Home path of current locale
31
+ *
32
+ * Used as the link of back-to-home and navbar logo
33
+ */
34
+ home?: string;
35
+ /**
36
+ * Navbar config
37
+ *
38
+ * Set to `false` to disable navbar in current locale
39
+ */
40
+ navbar?: NavbarOptions;
41
+ /**
42
+ * Navbar label used for screen readers using the `aria-label` attribute
43
+ */
44
+ navbarLabel?: string | null;
45
+ /**
46
+ * Page navbar label used for screen readers using the `aria-label` attribute
47
+ */
48
+ pageNavbarLabel?: string | null;
49
+ /**
50
+ * Navbar logo config
51
+ *
52
+ * Logo to display in navbar
53
+ */
54
+ logo?: string | null;
55
+ /**
56
+ * Navbar logo config for dark mode
57
+ *
58
+ * Logo to display in navbar in dark mode
59
+ */
60
+ logoDark?: string | null;
61
+ /**
62
+ * The alt text of navbar logo.
63
+ * Defaults to the site title if not specified.
64
+ * If the value is the same as the site title, the site title rendered in the navbar will be
65
+ * hidden from screen readers to avoid duplication.
66
+ */
67
+ logoAlt?: string | null;
68
+ /**
69
+ * Navbar repository config
70
+ *
71
+ * Used for the repository link of navbar
72
+ */
73
+ repo?: string | null;
74
+ /**
75
+ * Navbar repository config
76
+ *
77
+ * Used for the repository text of navbar
78
+ */
79
+ repoLabel?: string;
80
+ /**
81
+ * Navbar language selection config
82
+ *
83
+ * Text of the language selection dropdown
84
+ */
85
+ selectLanguageText?: string;
86
+ /**
87
+ * Navbar language selection config
88
+ *
89
+ * Aria label of of the language selection dropdown
90
+ */
91
+ selectLanguageAriaLabel?: string;
92
+ /**
93
+ * Navbar language selection config
94
+ *
95
+ * Language name of current locale
96
+ *
97
+ * Displayed inside the language selection dropdown
98
+ */
99
+ selectLanguageName?: string;
100
+ /**
101
+ * Sidebar config
102
+ *
103
+ * Set to `false` to disable sidebar in current locale
104
+ */
105
+ sidebar?: SidebarOptions | false;
106
+ /**
107
+ * Sidebar depth
108
+ *
109
+ * - Set to `0` to disable all levels
110
+ * - Set to `1` to include `<h2>`
111
+ * - Set to `2` to include `<h2>` and `<h3>`
112
+ * - ...
113
+ *
114
+ * The max value depends on which headers you have extracted
115
+ * via `markdown.headers.level`.
116
+ *
117
+ * The default value of `markdown.headers.level` is `[2, 3]`,
118
+ * so the default max value of `sidebarDepth` is `2`
119
+ */
120
+ sidebarDepth?: number;
121
+ /**
122
+ * Page meta - edit link config
123
+ *
124
+ * Whether to show "Edit this page" or not
125
+ */
126
+ editLink?: boolean;
127
+ /**
128
+ * Page meta - edit link config
129
+ *
130
+ * The text to replace the default "Edit this page"
131
+ */
132
+ editLinkText?: string;
133
+ /**
134
+ * Page meta - edit link config
135
+ *
136
+ * Pattern of edit link
137
+ *
138
+ * @example ':repo/edit/:branch/:path'
139
+ */
140
+ editLinkPattern?: string;
141
+ /**
142
+ * Page meta - edit link config
143
+ *
144
+ * Use `repo` config by default
145
+ *
146
+ * Set this config if your docs is placed in a different repo
147
+ */
148
+ docsRepo?: string;
149
+ /**
150
+ * Page meta - edit link config
151
+ *
152
+ * Set this config if the branch of your docs is not 'main'
153
+ */
154
+ docsBranch?: string;
155
+ /**
156
+ * Page meta - edit link config
157
+ *
158
+ * Set this config if your docs is placed in sub dir of your `docsRepo`
159
+ */
160
+ docsDir?: string;
161
+ /**
162
+ * Page meta - last updated config
163
+ *
164
+ * Whether to show "Last Updated" or not
165
+ */
166
+ lastUpdated?: boolean;
167
+ /**
168
+ * Page meta - last updated config
169
+ *
170
+ * The text to replace the default "Last Updated"
171
+ */
172
+ lastUpdatedText?: string;
173
+ /**
174
+ * Page meta - contributors config
175
+ *
176
+ * Whether to show "Contributors" or not
177
+ */
178
+ contributors?: boolean;
179
+ /**
180
+ * Page meta - contributors config
181
+ *
182
+ * The text to replace the default "Contributors"
183
+ */
184
+ contributorsText?: string;
185
+ /**
186
+ * Custom block config
187
+ *
188
+ * Default title of TIP custom block
189
+ */
190
+ tip?: string;
191
+ /**
192
+ * Custom block config
193
+ *
194
+ * Default title of WARNING custom block
195
+ */
196
+ warning?: string;
197
+ /**
198
+ * Custom block config
199
+ *
200
+ * Default title of DANGER custom block
201
+ */
202
+ danger?: string;
203
+ /**
204
+ * Custom block config
205
+ *
206
+ * Default title of IMPORTANT custom block
207
+ */
208
+ important?: string;
209
+ /**
210
+ * Custom block config
211
+ *
212
+ * Default title of NOTE custom block
213
+ */
214
+ note?: string;
215
+ /**
216
+ * 404 page config
217
+ *
218
+ * Not Found messages for 404 page
219
+ */
220
+ notFound?: string[];
221
+ /**
222
+ * 404 page config
223
+ *
224
+ * Text of back-to-home link in 404 page
225
+ */
226
+ backToHome?: string;
227
+ /**
228
+ * A11y text for external link icon
229
+ */
230
+ openInNewWindow?: string;
231
+ /**
232
+ * A11y text for color mode toggle button
233
+ */
234
+ toggleColorMode?: string;
235
+ /**
236
+ * A11y text for sidebar toggle button
237
+ */
238
+ toggleSidebar?: string;
239
+ /**
240
+ * text for prev link
241
+ */
242
+ prev?: string | false;
243
+ /**
244
+ * text for next link
245
+ */
246
+ next?: string | false;
247
+ }
248
+ //#endregion
249
+ //#region src/shared/page.d.ts
250
+ interface DefaultThemePageData extends Partial<GitPluginPageData> {
251
+ filePathRelative: string | null;
252
+ }
253
+ interface DefaultThemePageFrontmatter extends PageFrontmatter {
254
+ home?: boolean;
255
+ navbar?: boolean;
256
+ pageClass?: string;
257
+ externalLinkIcon?: boolean;
258
+ }
259
+ interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontmatter {
260
+ home: true;
261
+ heroImage?: string;
262
+ heroImageDark?: string;
263
+ heroAlt?: string;
264
+ heroHeight?: number;
265
+ heroText?: string | null;
266
+ tagline?: string | null;
267
+ actions?: {
268
+ text: string;
269
+ link: string;
270
+ type?: 'primary' | 'secondary';
271
+ }[];
272
+ features?: {
273
+ title: string;
274
+ details: string;
275
+ }[];
276
+ footer?: string;
277
+ footerHtml?: boolean;
278
+ }
279
+ interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter {
280
+ home?: false;
281
+ editLink?: boolean;
282
+ editLinkPattern?: string;
283
+ lastUpdated?: boolean;
284
+ contributors?: boolean;
285
+ sidebar?: SidebarArrayOptions | 'heading' | false;
286
+ sidebarDepth?: number;
287
+ prev?: AutoLinkOptions | string;
288
+ next?: AutoLinkOptions | string;
289
+ }
290
+ //#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=page-F2gyvsdE.d.ts.map
@@ -0,0 +1,53 @@
1
+ import { n as NavItemOptions, t as AutoLinkOptions } from "./nav-DikslSJ_.js";
2
+
3
+ //#region src/shared/navbar.d.ts
4
+ /**
5
+ * Base nav group, has nav items children
6
+ */
7
+ interface NavGroup<T> extends NavItemOptions {
8
+ /**
9
+ * Link prefix of current group
10
+ */
11
+ prefix?: string;
12
+ /**
13
+ * Link of current group
14
+ */
15
+ link?: string;
16
+ /**
17
+ * Children of current group
18
+ */
19
+ children: T[];
20
+ }
21
+ type NavbarLinkOptions = AutoLinkOptions | string;
22
+ type NavbarGroupOptions = NavGroup<NavbarLinkOptions | NavGroup<NavbarLinkOptions>>;
23
+ type NavbarOptions = (NavbarGroupOptions | NavbarLinkOptions)[] | false;
24
+ //#endregion
25
+ //#region src/shared/sidebar.d.ts
26
+ type SidebarLinkOptions = AutoLinkOptions;
27
+ interface SidebarGroupOptions extends NavItemOptions {
28
+ /**
29
+ * Link prefix of current group
30
+ */
31
+ prefix?: string;
32
+ /**
33
+ * Link of current group
34
+ */
35
+ link?: string;
36
+ /**
37
+ * Whether current group is collapsible
38
+ *
39
+ * @default false
40
+ */
41
+ collapsible?: boolean;
42
+ /**
43
+ * Children of current group
44
+ */
45
+ children: SidebarItemOptions[];
46
+ }
47
+ type SidebarItemOptions = SidebarGroupOptions | SidebarLinkOptions | string;
48
+ type SidebarArrayOptions = SidebarItemOptions[];
49
+ type SidebarObjectOptions = Record<string, SidebarArrayOptions | 'heading' | false>;
50
+ type SidebarOptions = SidebarArrayOptions | SidebarObjectOptions | 'heading';
51
+ //#endregion
52
+ export { SidebarObjectOptions as a, NavbarGroupOptions as c, SidebarLinkOptions as i, NavbarLinkOptions as l, SidebarGroupOptions as n, SidebarOptions as o, SidebarItemOptions as r, NavGroup as s, SidebarArrayOptions as t, NavbarOptions as u };
53
+ //# sourceMappingURL=sidebar-FqrQ3PGy.d.ts.map
@@ -0,0 +1,19 @@
1
+ import { t as AutoLinkOptions } from "./nav-DikslSJ_.js";
2
+ import { i as SidebarLinkOptions, n as SidebarGroupOptions, s as NavGroup } from "./sidebar-FqrQ3PGy.js";
3
+
4
+ //#region src/client/typings.d.ts
5
+ type NavbarItem = AutoLinkOptions | NavGroup<NavbarItem>;
6
+ type SidebarLinkItem = SidebarLinkOptions;
7
+ interface SidebarHeaderItem {
8
+ text: string;
9
+ link: string;
10
+ children?: SidebarHeaderItem[];
11
+ }
12
+ interface SidebarGroupItem extends SidebarGroupOptions {
13
+ prefix?: string;
14
+ children: (SidebarHeaderItem | SidebarItem)[];
15
+ }
16
+ type SidebarItem = SidebarGroupItem | SidebarLinkItem;
17
+ //#endregion
18
+ export { SidebarLinkItem as a, SidebarItem as i, SidebarGroupItem as n, SidebarHeaderItem as r, NavbarItem as t };
19
+ //# sourceMappingURL=typings-jKn48KwS.d.ts.map
package/package.json CHANGED
@@ -1,69 +1,81 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-rc.122",
3
+ "version": "2.0.0-rc.124",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
- "vuepress-theme",
7
- "vuepress",
6
+ "default",
8
7
  "theme",
9
- "default"
8
+ "vuepress",
9
+ "vuepress-theme"
10
10
  ],
11
11
  "homepage": "https://ecosystem.vuejs.press/themes/default/",
12
12
  "bugs": {
13
13
  "url": "https://github.com/vuepress/ecosystem/issues"
14
14
  },
15
+ "license": "MIT",
16
+ "author": "meteorlxy",
15
17
  "repository": {
16
18
  "type": "git",
17
19
  "url": "git+https://github.com/vuepress/ecosystem.git",
18
20
  "directory": "themes/theme-default"
19
21
  },
20
- "license": "MIT",
21
- "author": "meteorlxy",
22
+ "files": [
23
+ "lib",
24
+ "templates"
25
+ ],
26
+ "type": "module",
22
27
  "sideEffects": [
23
28
  "./lib/client/components/**/*.vue",
24
29
  "./lib/client/layouts/*.vue",
25
30
  "./lib/client/styles/*.scss"
26
31
  ],
27
- "type": "module",
32
+ "main": "./lib/node/index.js",
33
+ "types": "./lib/node/index.d.ts",
28
34
  "exports": {
29
- ".": "./lib/node/index.js",
30
- "./client": "./lib/client/index.js",
35
+ ".": {
36
+ "types": "./lib/node/index.d.ts",
37
+ "default": "./lib/node/index.js"
38
+ },
39
+ "./client": {
40
+ "types": "./lib/client/index.d.ts",
41
+ "default": "./lib/client/index.js"
42
+ },
31
43
  "./components/*": "./lib/client/components/*",
32
44
  "./layouts/*": "./lib/client/layouts/*",
33
- "./styles/*": "./lib/client/styles/*",
45
+ "./styles/*": {
46
+ "sass": "./lib/client/styles/*.scss",
47
+ "default": "./lib/client/styles/*"
48
+ },
34
49
  "./templates/*": "./templates/*",
35
50
  "./lib/*": "./lib/*",
36
51
  "./package.json": "./package.json"
37
52
  },
38
- "main": "./lib/node/index.js",
39
- "types": "./lib/node/index.d.ts",
40
- "files": [
41
- "lib",
42
- "templates"
43
- ],
53
+ "publishConfig": {
54
+ "access": "public"
55
+ },
44
56
  "dependencies": {
45
- "@vuepress/helper": "2.0.0-rc.122",
46
- "@vuepress/plugin-active-header-links": "2.0.0-rc.122",
47
- "@vuepress/plugin-back-to-top": "2.0.0-rc.122",
48
- "@vuepress/plugin-copy-code": "2.0.0-rc.122",
49
- "@vuepress/plugin-git": "2.0.0-rc.122",
50
- "@vuepress/plugin-links-check": "2.0.0-rc.122",
51
- "@vuepress/plugin-markdown-hint": "2.0.0-rc.122",
52
- "@vuepress/plugin-markdown-tab": "2.0.0-rc.122",
53
- "@vuepress/plugin-medium-zoom": "2.0.0-rc.122",
54
- "@vuepress/plugin-nprogress": "2.0.0-rc.122",
55
- "@vuepress/plugin-palette": "2.0.0-rc.122",
56
- "@vuepress/plugin-prismjs": "2.0.0-rc.122",
57
- "@vuepress/plugin-seo": "2.0.0-rc.122",
58
- "@vuepress/plugin-sitemap": "2.0.0-rc.122",
59
- "@vuepress/plugin-theme-data": "2.0.0-rc.122",
60
- "@vueuse/core": "^14.2.0",
61
- "vue": "^3.5.27"
57
+ "@vuepress/helper": "2.0.0-rc.124",
58
+ "@vuepress/plugin-active-header-links": "2.0.0-rc.124",
59
+ "@vuepress/plugin-back-to-top": "2.0.0-rc.124",
60
+ "@vuepress/plugin-copy-code": "2.0.0-rc.124",
61
+ "@vuepress/plugin-git": "2.0.0-rc.124",
62
+ "@vuepress/plugin-links-check": "2.0.0-rc.124",
63
+ "@vuepress/plugin-markdown-hint": "2.0.0-rc.124",
64
+ "@vuepress/plugin-markdown-tab": "2.0.0-rc.124",
65
+ "@vuepress/plugin-medium-zoom": "2.0.0-rc.124",
66
+ "@vuepress/plugin-nprogress": "2.0.0-rc.124",
67
+ "@vuepress/plugin-palette": "2.0.0-rc.124",
68
+ "@vuepress/plugin-prismjs": "2.0.0-rc.124",
69
+ "@vuepress/plugin-seo": "2.0.0-rc.124",
70
+ "@vuepress/plugin-sitemap": "2.0.0-rc.124",
71
+ "@vuepress/plugin-theme-data": "2.0.0-rc.124",
72
+ "@vueuse/core": "^14.2.1",
73
+ "vue": "^3.5.29"
62
74
  },
63
75
  "peerDependencies": {
64
76
  "sass": "^1.97.3",
65
77
  "sass-embedded": "^1.97.3",
66
- "sass-loader": "^16.0.6",
78
+ "sass-loader": "^16.0.7",
67
79
  "vuepress": "2.0.0-rc.26"
68
80
  },
69
81
  "peerDependenciesMeta": {
@@ -77,8 +89,5 @@
77
89
  "optional": true
78
90
  }
79
91
  },
80
- "publishConfig": {
81
- "access": "public"
82
- },
83
- "gitHead": "5dfd2d24f8335f718182701995420907b0a00905"
92
+ "gitHead": "f17e7479b1ef3c06814b6107df9188ba351702da"
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,13 +0,0 @@
1
- import type { AutoLinkOptions, NavGroup, SidebarGroupOptions, SidebarLinkOptions } from '../shared/index.js';
2
- export type NavbarItem = AutoLinkOptions | NavGroup<NavbarItem>;
3
- export type SidebarLinkItem = SidebarLinkOptions;
4
- export interface SidebarHeaderItem {
5
- text: string;
6
- link: string;
7
- children?: SidebarHeaderItem[];
8
- }
9
- export interface SidebarGroupItem extends SidebarGroupOptions {
10
- prefix?: string;
11
- children: (SidebarHeaderItem | SidebarItem)[];
12
- }
13
- export type SidebarItem = SidebarGroupItem | SidebarLinkItem;
@@ -1 +0,0 @@
1
- export {};
@@ -1,15 +0,0 @@
1
- import type { Theme } from 'vuepress/core';
2
- import type { DefaultThemeLocaleOptions } from '../shared/index.js';
3
- import type { DefaultThemePluginsOptions } from './typings.js';
4
- export interface DefaultThemeOptions extends DefaultThemeLocaleOptions {
5
- /**
6
- * deployed hostname
7
- */
8
- hostname?: string;
9
- /**
10
- * To avoid confusion with the root `plugins` option,
11
- * we use `themePlugins`
12
- */
13
- themePlugins?: DefaultThemePluginsOptions;
14
- }
15
- export declare const defaultTheme: ({ hostname, themePlugins, ...localeOptions }?: DefaultThemeOptions) => Theme;
@@ -1,140 +0,0 @@
1
- import { addViteOptimizeDepsExclude } from '@vuepress/helper';
2
- import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links';
3
- import { backToTopPlugin } from '@vuepress/plugin-back-to-top';
4
- import { copyCodePlugin } from '@vuepress/plugin-copy-code';
5
- import { gitPlugin } from '@vuepress/plugin-git';
6
- import { linksCheckPlugin } from '@vuepress/plugin-links-check';
7
- import { markdownHintPlugin } from '@vuepress/plugin-markdown-hint';
8
- import { markdownTabPlugin } from '@vuepress/plugin-markdown-tab';
9
- import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom';
10
- import { nprogressPlugin } from '@vuepress/plugin-nprogress';
11
- import { palettePlugin } from '@vuepress/plugin-palette';
12
- import { prismjsPlugin } from '@vuepress/plugin-prismjs';
13
- import { seoPlugin } from '@vuepress/plugin-seo';
14
- import { sitemapPlugin } from '@vuepress/plugin-sitemap';
15
- import { themeDataPlugin } from '@vuepress/plugin-theme-data';
16
- import { isPlainObject } from 'vuepress/shared';
17
- import { fs, getDirname, path } from 'vuepress/utils';
18
- import { assignDefaultLocaleOptions, resolveMarkdownHintLocales, } from './utils/index.js';
19
- const __dirname = import.meta.dirname || getDirname(import.meta.url);
20
- export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } = {}) => {
21
- assignDefaultLocaleOptions(localeOptions);
22
- return {
23
- name: '@vuepress/theme-default',
24
- templateBuild: path.resolve(__dirname, '../../templates/build.html'),
25
- alias: {
26
- // use alias to make all components replaceable
27
- ...Object.fromEntries(fs
28
- .readdirSync(path.resolve(__dirname, '../client/components'))
29
- .filter((file) => file.endsWith('.vue'))
30
- .map((file) => [
31
- `@theme/${file}`,
32
- path.resolve(__dirname, '../client/components', file),
33
- ])),
34
- // use alias to make all composables replaceable
35
- ...Object.fromEntries(fs
36
- .readdirSync(path.resolve(__dirname, '../client/composables'))
37
- .filter((file) => file.endsWith('.js'))
38
- .map((file) => [
39
- `@theme/${file.slice(0, -3)}`,
40
- path.resolve(__dirname, '../client/composables', file),
41
- ])),
42
- // use alias to make all utils replaceable
43
- ...Object.fromEntries(fs
44
- .readdirSync(path.resolve(__dirname, '../client/utils'))
45
- .filter((file) => file.endsWith('.js'))
46
- .map((file) => [
47
- `@theme/${file.slice(0, -3)}`,
48
- path.resolve(__dirname, '../client/utils', file),
49
- ])),
50
- },
51
- clientConfigFile: path.resolve(__dirname, '../client/config.js'),
52
- extendsBundlerOptions: (bundlerOptions, app) => {
53
- // ensure theme alias is not optimized by Vite
54
- addViteOptimizeDepsExclude(bundlerOptions, app, '@theme');
55
- },
56
- extendsPage: (page) => {
57
- // save relative file path into page data to generate edit link
58
- page.data.filePathRelative = page.filePathRelative;
59
- // save title into route meta to generate navbar and sidebar
60
- page.routeMeta.title = page.title;
61
- },
62
- plugins: [
63
- // @vuepress/plugin-active-header-link
64
- (themePlugins.activeHeaderLinks ?? true)
65
- ? activeHeaderLinksPlugin({
66
- // should greater than page transition duration
67
- delay: 300,
68
- })
69
- : [],
70
- // @vuepress/plugin-back-to-top
71
- (themePlugins.backToTop ?? true)
72
- ? backToTopPlugin(isPlainObject(themePlugins.backToTop) ? themePlugins.backToTop : {})
73
- : [],
74
- // @vuepress/plugin-copy-code
75
- (themePlugins.copyCode ?? true)
76
- ? copyCodePlugin({
77
- ...(isPlainObject(themePlugins.copyCode)
78
- ? themePlugins.copyCode
79
- : {}),
80
- })
81
- : [],
82
- // @vuepress/plugin-markdown-container
83
- (themePlugins.hint ?? true)
84
- ? markdownHintPlugin({
85
- locales: resolveMarkdownHintLocales(localeOptions),
86
- ...(isPlainObject(themePlugins.hint) ? themePlugins.hint : {}),
87
- })
88
- : [],
89
- // @vuepress/plugin-git
90
- (themePlugins.git ?? true)
91
- ? gitPlugin({
92
- createdTime: false,
93
- updatedTime: localeOptions.lastUpdated ?? true,
94
- changelog: { repoUrl: localeOptions.repo || '' },
95
- ...(isPlainObject(themePlugins.git) ? themePlugins.git : {}),
96
- })
97
- : [],
98
- // @vuepress/plugin-links-check
99
- (themePlugins.linksCheck ?? true)
100
- ? linksCheckPlugin(isPlainObject(themePlugins.linksCheck)
101
- ? themePlugins.linksCheck
102
- : {})
103
- : [],
104
- // @vuepress/plugin-medium-zoom
105
- (themePlugins.mediumZoom ?? true) ? mediumZoomPlugin() : [],
106
- // @vuepress/plugin-nprogress
107
- (themePlugins.nprogress ?? true) ? nprogressPlugin() : [],
108
- // @vuepress/plugin-palette
109
- palettePlugin({ preset: 'sass' }),
110
- // @vuepress/plugin-prismjs
111
- (themePlugins.prismjs ?? true)
112
- ? prismjsPlugin(isPlainObject(themePlugins.prismjs) ? themePlugins.prismjs : {})
113
- : [],
114
- // @vuepress/plugin-seo
115
- hostname && (themePlugins.seo ?? true)
116
- ? seoPlugin({
117
- hostname,
118
- ...(isPlainObject(themePlugins.seo) ? themePlugins.seo : {}),
119
- })
120
- : [],
121
- // @vuepress/plugin-sitemap
122
- hostname && (themePlugins.sitemap ?? true)
123
- ? sitemapPlugin({
124
- hostname,
125
- ...(isPlainObject(themePlugins.sitemap)
126
- ? themePlugins.sitemap
127
- : {}),
128
- })
129
- : [],
130
- // @vuepress/plugin-markdown-tab
131
- (themePlugins.tab ?? true)
132
- ? markdownTabPlugin(isPlainObject(themePlugins.tab)
133
- ? themePlugins.tab
134
- : { codeTabs: true, tabs: true })
135
- : [],
136
- // @vuepress/plugin-theme-data
137
- themeDataPlugin({ themeData: localeOptions }),
138
- ],
139
- };
140
- };