@vuepress/theme-default 2.0.0-beta.50-pre → 2.0.0-beta.51

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 (93) hide show
  1. package/lib/client/components/AutoLink.vue +114 -0
  2. package/lib/client/components/DropdownTransition.vue +21 -0
  3. package/lib/client/components/Home.vue +15 -0
  4. package/lib/client/components/HomeContent.vue +5 -0
  5. package/lib/client/components/HomeFeatures.vue +23 -0
  6. package/lib/client/components/HomeFooter.vue +17 -0
  7. package/lib/client/components/HomeHero.vue +97 -0
  8. package/lib/client/components/Navbar.vue +75 -0
  9. package/lib/client/components/NavbarBrand.vue +55 -0
  10. package/lib/client/components/NavbarDropdown.vue +126 -0
  11. package/lib/client/components/NavbarItems.vue +163 -0
  12. package/lib/client/components/Page.vue +24 -0
  13. package/lib/client/components/PageMeta.vue +124 -0
  14. package/lib/client/components/PageNav.vue +103 -0
  15. package/lib/client/components/Sidebar.vue +13 -0
  16. package/lib/client/components/SidebarItem.vue +87 -0
  17. package/lib/client/components/SidebarItems.vue +57 -0
  18. package/lib/client/components/ToggleColorModeButton.vue +57 -0
  19. package/lib/client/components/ToggleSidebarButton.vue +24 -0
  20. package/lib/client/components/global/Badge.vue +31 -0
  21. package/lib/client/components/global/CodeGroup.d.ts +4 -0
  22. package/lib/client/components/global/CodeGroup.js +106 -0
  23. package/lib/client/components/global/CodeGroupItem.vue +31 -0
  24. package/lib/client/components/global/index.d.ts +4 -0
  25. package/lib/client/components/global/index.js +4 -0
  26. package/lib/client/composables/index.d.ts +6 -0
  27. package/lib/client/composables/index.js +6 -0
  28. package/lib/client/composables/useDarkMode.d.ts +12 -0
  29. package/lib/client/composables/useDarkMode.js +57 -0
  30. package/lib/client/composables/useNavLink.d.ts +14 -0
  31. package/lib/client/composables/useNavLink.js +18 -0
  32. package/lib/client/composables/useResolveRouteWithRedirect.d.ts +5 -0
  33. package/lib/client/composables/useResolveRouteWithRedirect.js +24 -0
  34. package/lib/client/composables/useScrollPromise.d.ts +6 -0
  35. package/lib/client/composables/useScrollPromise.js +14 -0
  36. package/lib/client/composables/useSidebarItems.d.ts +36 -0
  37. package/lib/client/composables/useSidebarItems.js +118 -0
  38. package/lib/client/composables/useThemeData.d.ts +4 -0
  39. package/lib/client/composables/useThemeData.js +3 -0
  40. package/lib/client/config.d.ts +3 -0
  41. package/lib/client/config.js +44 -0
  42. package/lib/client/index.d.ts +3 -0
  43. package/lib/client/index.js +3 -0
  44. package/lib/client/layouts/Layout.vue +134 -0
  45. package/lib/client/layouts/NotFound.vue +27 -0
  46. package/lib/client/shim.d.ts +5 -0
  47. package/lib/client/styles/_mixins.scss +20 -0
  48. package/lib/client/styles/_variables.scss +11 -0
  49. package/lib/client/styles/arrow.scss +37 -0
  50. package/lib/client/styles/badge.scss +31 -0
  51. package/lib/client/styles/code-group.scss +69 -0
  52. package/lib/client/styles/code.scss +266 -0
  53. package/lib/client/styles/custom-container.scss +88 -0
  54. package/lib/client/styles/home.scss +168 -0
  55. package/lib/client/styles/index.scss +19 -0
  56. package/lib/client/styles/layout.scss +198 -0
  57. package/lib/client/styles/navbar-dropdown.scss +187 -0
  58. package/lib/client/styles/navbar.scss +177 -0
  59. package/lib/client/styles/normalize.scss +177 -0
  60. package/lib/client/styles/page.scss +83 -0
  61. package/lib/client/styles/sidebar.scss +134 -0
  62. package/lib/client/styles/toc.scss +5 -0
  63. package/lib/client/styles/transitions.scss +22 -0
  64. package/lib/client/styles/vars-dark.scss +46 -0
  65. package/lib/client/styles/vars.scss +133 -0
  66. package/lib/client/utils/index.d.ts +3 -0
  67. package/lib/client/utils/index.js +3 -0
  68. package/lib/client/utils/isActiveSidebarItem.d.ts +3 -0
  69. package/lib/client/utils/isActiveSidebarItem.js +20 -0
  70. package/lib/client/utils/resolveEditLink.d.ts +9 -0
  71. package/lib/client/utils/resolveEditLink.js +29 -0
  72. package/lib/client/utils/resolveRepoType.d.ts +2 -0
  73. package/lib/client/utils/resolveRepoType.js +12 -0
  74. package/lib/node/defaultTheme.d.ts +10 -0
  75. package/lib/node/defaultTheme.js +119 -0
  76. package/lib/node/index.d.ts +5 -0
  77. package/lib/node/index.js +5 -0
  78. package/lib/node/utils/assignDefaultLocaleOptions.d.ts +7 -0
  79. package/lib/node/utils/assignDefaultLocaleOptions.js +56 -0
  80. package/lib/node/utils/index.d.ts +2 -0
  81. package/lib/node/utils/index.js +2 -0
  82. package/lib/node/utils/resolveContainerPluginOptions.d.ts +8 -0
  83. package/lib/node/utils/resolveContainerPluginOptions.js +17 -0
  84. package/lib/shared/index.d.ts +3 -0
  85. package/lib/shared/index.js +3 -0
  86. package/lib/shared/nav.d.ts +43 -0
  87. package/lib/shared/nav.js +1 -0
  88. package/lib/shared/options.d.ts +243 -0
  89. package/lib/shared/options.js +1 -0
  90. package/lib/shared/page.d.ts +40 -0
  91. package/lib/shared/page.js +1 -0
  92. package/package.json +22 -20
  93. package/templates/build.html +33 -0
@@ -0,0 +1,243 @@
1
+ import type { ThemeData } from '@vuepress/plugin-theme-data';
2
+ import type { LocaleData } from '@vuepress/shared';
3
+ import type { NavbarConfig, SidebarConfig } from './nav.js';
4
+ export interface DefaultThemePluginsOptions {
5
+ /**
6
+ * Enable @vuepress/plugin-active-header-links or not
7
+ */
8
+ activeHeaderLinks?: boolean;
9
+ /**
10
+ * Enable @vuepress/plugin-back-to-top or not
11
+ */
12
+ backToTop?: boolean;
13
+ /**
14
+ * Enable @vuepress/plugin-container or not
15
+ */
16
+ container?: {
17
+ tip?: boolean;
18
+ warning?: boolean;
19
+ danger?: boolean;
20
+ details?: boolean;
21
+ codeGroup?: boolean;
22
+ codeGroupItem?: boolean;
23
+ };
24
+ /**
25
+ * Enable @vuepress/plugin-external-link-icon or not
26
+ */
27
+ externalLinkIcon?: boolean;
28
+ /**
29
+ * Enable @vuepress/plugin-git or not
30
+ */
31
+ git?: boolean;
32
+ /**
33
+ * Enable @vuepress/plugin-medium-zoom or not
34
+ */
35
+ mediumZoom?: boolean;
36
+ /**
37
+ * Enable @vuepress/plugin-nprogress or not
38
+ */
39
+ nprogress?: boolean;
40
+ /**
41
+ * Enable @vuepress/plugin-prismjs or not
42
+ */
43
+ prismjs?: boolean;
44
+ }
45
+ export declare type DefaultThemeLocaleOptions = DefaultThemeData;
46
+ export declare type DefaultThemeData = ThemeData<DefaultThemeLocaleData>;
47
+ export interface DefaultThemeLocaleData extends LocaleData {
48
+ /**
49
+ * Default color mode
50
+ *
51
+ * @default 'auto'
52
+ */
53
+ colorMode?: 'auto' | 'dark' | 'light';
54
+ /**
55
+ * Enable color mode switching and display a button in navbar or not
56
+ *
57
+ * @default true
58
+ */
59
+ colorModeSwitch?: boolean;
60
+ /**
61
+ * Home path of current locale
62
+ *
63
+ * Used as the link of back-to-home and navbar logo
64
+ */
65
+ home?: string;
66
+ /**
67
+ * Navbar config
68
+ *
69
+ * Set to `false` to disable navbar in current locale
70
+ */
71
+ navbar?: false | NavbarConfig;
72
+ /**
73
+ * Navbar logo config
74
+ *
75
+ * Logo to display in navbar
76
+ */
77
+ logo?: null | string;
78
+ /**
79
+ * Navbar logo config for dark mode
80
+ *
81
+ * Logo to display in navbar in dark mode
82
+ */
83
+ logoDark?: null | string;
84
+ /**
85
+ * Navbar repository config
86
+ *
87
+ * Used for the repository link of navbar
88
+ */
89
+ repo?: null | string;
90
+ /**
91
+ * Navbar repository config
92
+ *
93
+ * Used for the repository text of navbar
94
+ */
95
+ repoLabel?: string;
96
+ /**
97
+ * Navbar language selection config
98
+ *
99
+ * Text of the language selection dropdown
100
+ */
101
+ selectLanguageText?: string;
102
+ /**
103
+ * Navbar language selection config
104
+ *
105
+ * Aria label of of the language selection dropdown
106
+ */
107
+ selectLanguageAriaLabel?: string;
108
+ /**
109
+ * Navbar language selection config
110
+ *
111
+ * Language name of current locale
112
+ *
113
+ * Displayed inside the language selection dropdown
114
+ */
115
+ selectLanguageName?: string;
116
+ /**
117
+ * Sidebar config
118
+ *
119
+ * Set to `false` to disable sidebar in current locale
120
+ */
121
+ sidebar?: 'auto' | false | SidebarConfig;
122
+ /**
123
+ * Sidebar depth
124
+ *
125
+ * - Set to `0` to disable all levels
126
+ * - Set to `1` to include `<h2>`
127
+ * - Set to `2` to include `<h2>` and `<h3>`
128
+ * - ...
129
+ *
130
+ * The max value depends on which headers you have extracted
131
+ * via `markdown.headers.level`.
132
+ *
133
+ * The default value of `markdown.headers.level` is `[2, 3]`,
134
+ * so the default max value of `sidebarDepth` is `2`
135
+ */
136
+ sidebarDepth?: number;
137
+ /**
138
+ * Page meta - edit link config
139
+ *
140
+ * Whether to show "Edit this page" or not
141
+ */
142
+ editLink?: boolean;
143
+ /**
144
+ * Page meta - edit link config
145
+ *
146
+ * The text to replace the default "Edit this page"
147
+ */
148
+ editLinkText?: string;
149
+ /**
150
+ * Page meta - edit link config
151
+ *
152
+ * Pattern of edit link
153
+ *
154
+ * @example ':repo/edit/:branch/:path'
155
+ */
156
+ editLinkPattern?: string;
157
+ /**
158
+ * Page meta - edit link config
159
+ *
160
+ * Use `repo` config by default
161
+ *
162
+ * Set this config if your docs is placed in a different repo
163
+ */
164
+ docsRepo?: string;
165
+ /**
166
+ * Page meta - edit link config
167
+ *
168
+ * Set this config if the branch of your docs is not 'main'
169
+ */
170
+ docsBranch?: string;
171
+ /**
172
+ * Page meta - edit link config
173
+ *
174
+ * Set this config if your docs is placed in sub dir of your `docsRepo`
175
+ */
176
+ docsDir?: string;
177
+ /**
178
+ * Page meta - last updated config
179
+ *
180
+ * Whether to show "Last Updated" or not
181
+ */
182
+ lastUpdated?: boolean;
183
+ /**
184
+ * Page meta - last updated config
185
+ *
186
+ * The text to replace the default "Last Updated"
187
+ */
188
+ lastUpdatedText?: string;
189
+ /**
190
+ * Page meta - contributors config
191
+ *
192
+ * Whether to show "Contributors" or not
193
+ */
194
+ contributors?: boolean;
195
+ /**
196
+ * Page meta - contributors config
197
+ *
198
+ * The text to replace the default "Contributors"
199
+ */
200
+ contributorsText?: string;
201
+ /**
202
+ * Custom block config
203
+ *
204
+ * Default title of TIP custom block
205
+ */
206
+ tip?: string;
207
+ /**
208
+ * Custom block config
209
+ *
210
+ * Default title of WARNING custom block
211
+ */
212
+ warning?: string;
213
+ /**
214
+ * Custom block config
215
+ *
216
+ * Default title of DANGER custom block
217
+ */
218
+ danger?: string;
219
+ /**
220
+ * 404 page config
221
+ *
222
+ * Not Found messages for 404 page
223
+ */
224
+ notFound?: string[];
225
+ /**
226
+ * 404 page config
227
+ *
228
+ * Text of back-to-home link in 404 page
229
+ */
230
+ backToHome?: string;
231
+ /**
232
+ * A11y text for external link icon
233
+ */
234
+ openInNewWindow?: string;
235
+ /**
236
+ * A11y text for color mode toggle button
237
+ */
238
+ toggleColorMode?: string;
239
+ /**
240
+ * A11y text for sidebar toggle button
241
+ */
242
+ toggleSidebar?: string;
243
+ }
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,40 @@
1
+ import type { GitPluginPageData } from '@vuepress/plugin-git';
2
+ import type { NavLink, SidebarConfig } from './nav.js';
3
+ export interface DefaultThemePageData extends GitPluginPageData {
4
+ filePathRelative: string | null;
5
+ }
6
+ export interface DefaultThemePageFrontmatter {
7
+ home?: boolean;
8
+ navbar?: boolean;
9
+ pageClass?: string;
10
+ }
11
+ export interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontmatter {
12
+ home: true;
13
+ heroImage?: string;
14
+ heroImageDark?: string;
15
+ heroAlt?: string;
16
+ heroText?: string | null;
17
+ tagline?: string | null;
18
+ actions?: {
19
+ text: string;
20
+ link: string;
21
+ type?: 'primary' | 'secondary';
22
+ }[];
23
+ features?: {
24
+ title: string;
25
+ details: string;
26
+ }[];
27
+ footer?: string;
28
+ footerHtml?: boolean;
29
+ }
30
+ export interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter {
31
+ home?: false;
32
+ editLink?: boolean;
33
+ editLinkPattern?: string;
34
+ lastUpdated?: boolean;
35
+ contributors?: boolean;
36
+ sidebar?: 'auto' | false | SidebarConfig;
37
+ sidebarDepth?: number;
38
+ prev?: string | NavLink;
39
+ next?: string | NavLink;
40
+ }
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-beta.50-pre",
3
+ "version": "2.0.0-beta.51",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -22,37 +22,39 @@
22
22
  "exports": {
23
23
  ".": "./lib/node/index.js",
24
24
  "./client": "./lib/client/index.js",
25
+ "./components/*": "./lib/client/components/*",
26
+ "./layouts/*": "./lib/client/layouts/*",
25
27
  "./templates/*": "./templates/*",
26
28
  "./package.json": "./package.json"
27
29
  },
28
30
  "main": "./lib/node/index.js",
29
31
  "types": "./lib/node/index.d.ts",
30
32
  "files": [
31
- "./lib",
32
- "./templates"
33
+ "lib",
34
+ "templates"
33
35
  ],
34
36
  "dependencies": {
35
- "@vuepress/client": "2.0.0-beta.50-pre",
36
- "@vuepress/core": "2.0.0-beta.50-pre",
37
- "@vuepress/plugin-active-header-links": "2.0.0-beta.50-pre",
38
- "@vuepress/plugin-back-to-top": "2.0.0-beta.50-pre",
39
- "@vuepress/plugin-container": "2.0.0-beta.50-pre",
40
- "@vuepress/plugin-external-link-icon": "2.0.0-beta.50-pre",
41
- "@vuepress/plugin-git": "2.0.0-beta.50-pre",
42
- "@vuepress/plugin-medium-zoom": "2.0.0-beta.50-pre",
43
- "@vuepress/plugin-nprogress": "2.0.0-beta.50-pre",
44
- "@vuepress/plugin-palette": "2.0.0-beta.50-pre",
45
- "@vuepress/plugin-prismjs": "2.0.0-beta.50-pre",
46
- "@vuepress/plugin-theme-data": "2.0.0-beta.50-pre",
47
- "@vuepress/shared": "2.0.0-beta.50-pre",
48
- "@vuepress/utils": "2.0.0-beta.50-pre",
37
+ "@vuepress/client": "2.0.0-beta.51",
38
+ "@vuepress/core": "2.0.0-beta.51",
39
+ "@vuepress/plugin-active-header-links": "2.0.0-beta.51",
40
+ "@vuepress/plugin-back-to-top": "2.0.0-beta.51",
41
+ "@vuepress/plugin-container": "2.0.0-beta.51",
42
+ "@vuepress/plugin-external-link-icon": "2.0.0-beta.51",
43
+ "@vuepress/plugin-git": "2.0.0-beta.51",
44
+ "@vuepress/plugin-medium-zoom": "2.0.0-beta.51",
45
+ "@vuepress/plugin-nprogress": "2.0.0-beta.51",
46
+ "@vuepress/plugin-palette": "2.0.0-beta.51",
47
+ "@vuepress/plugin-prismjs": "2.0.0-beta.51",
48
+ "@vuepress/plugin-theme-data": "2.0.0-beta.51",
49
+ "@vuepress/shared": "2.0.0-beta.51",
50
+ "@vuepress/utils": "2.0.0-beta.51",
49
51
  "@vueuse/core": "^9.1.0",
50
- "sass": "^1.54.4",
52
+ "sass": "^1.54.5",
51
53
  "vue": "^3.2.37",
52
- "vue-router": "^4.1.3"
54
+ "vue-router": "^4.1.4"
53
55
  },
54
56
  "peerDependencies": {
55
- "sass-loader": "^13.0.0"
57
+ "sass-loader": "^13.0.2"
56
58
  },
57
59
  "peerDependenciesMeta": {
58
60
  "sass-loader": {
@@ -0,0 +1,33 @@
1
+ <!DOCTYPE html>
2
+ <html lang="{{ lang }}">
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <meta name="generator" content="VuePress {{ version }}">
7
+ <style>
8
+ :root {
9
+ --c-bg: #fff;
10
+ }
11
+ html.dark {
12
+ --c-bg: #22272e;
13
+ }
14
+ html, body {
15
+ background-color: var(--c-bg);
16
+ }
17
+ </style>
18
+ <script>
19
+ const userMode = localStorage.getItem('vuepress-color-scheme');
20
+ const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
21
+ if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
22
+ document.documentElement.classList.toggle('dark', true);
23
+ }
24
+ </script>
25
+ <!--vuepress-ssr-head-->
26
+ <!--vuepress-ssr-resources-->
27
+ <!--vuepress-ssr-styles-->
28
+ </head>
29
+ <body>
30
+ <div id="app"><!--vuepress-ssr-app--></div>
31
+ <!--vuepress-ssr-scripts-->
32
+ </body>
33
+ </html>