@vuepress/theme-default 2.0.0-beta.50-pre → 2.0.0-beta.50-pre.1
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/lib/client/components/AutoLink.vue +114 -0
- package/lib/client/components/DropdownTransition.vue +21 -0
- package/lib/client/components/Home.vue +15 -0
- package/lib/client/components/HomeContent.vue +5 -0
- package/lib/client/components/HomeFeatures.vue +23 -0
- package/lib/client/components/HomeFooter.vue +17 -0
- package/lib/client/components/HomeHero.vue +97 -0
- package/lib/client/components/Navbar.vue +75 -0
- package/lib/client/components/NavbarBrand.vue +55 -0
- package/lib/client/components/NavbarDropdown.vue +126 -0
- package/lib/client/components/NavbarItems.vue +163 -0
- package/lib/client/components/Page.vue +24 -0
- package/lib/client/components/PageMeta.vue +124 -0
- package/lib/client/components/PageNav.vue +103 -0
- package/lib/client/components/Sidebar.vue +13 -0
- package/lib/client/components/SidebarItem.vue +87 -0
- package/lib/client/components/SidebarItems.vue +57 -0
- package/lib/client/components/ToggleColorModeButton.vue +57 -0
- package/lib/client/components/ToggleSidebarButton.vue +24 -0
- package/lib/client/components/global/Badge.vue +31 -0
- package/lib/client/components/global/CodeGroup.d.ts +4 -0
- package/lib/client/components/global/CodeGroup.js +106 -0
- package/lib/client/components/global/CodeGroupItem.vue +31 -0
- package/lib/client/components/global/index.d.ts +4 -0
- package/lib/client/components/global/index.js +4 -0
- package/lib/client/composables/index.d.ts +6 -0
- package/lib/client/composables/index.js +6 -0
- package/lib/client/composables/useDarkMode.d.ts +12 -0
- package/lib/client/composables/useDarkMode.js +57 -0
- package/lib/client/composables/useNavLink.d.ts +14 -0
- package/lib/client/composables/useNavLink.js +18 -0
- package/lib/client/composables/useResolveRouteWithRedirect.d.ts +5 -0
- package/lib/client/composables/useResolveRouteWithRedirect.js +24 -0
- package/lib/client/composables/useScrollPromise.d.ts +6 -0
- package/lib/client/composables/useScrollPromise.js +14 -0
- package/lib/client/composables/useSidebarItems.d.ts +36 -0
- package/lib/client/composables/useSidebarItems.js +118 -0
- package/lib/client/composables/useThemeData.d.ts +4 -0
- package/lib/client/composables/useThemeData.js +3 -0
- package/lib/client/config.d.ts +3 -0
- package/lib/client/config.js +38 -0
- package/lib/client/index.d.ts +3 -0
- package/lib/client/index.js +3 -0
- package/lib/client/layouts/404.vue +27 -0
- package/lib/client/layouts/Layout.vue +134 -0
- package/lib/client/shim.d.ts +5 -0
- package/lib/client/styles/_mixins.scss +20 -0
- package/lib/client/styles/_variables.scss +11 -0
- package/lib/client/styles/arrow.scss +37 -0
- package/lib/client/styles/badge.scss +31 -0
- package/lib/client/styles/code-group.scss +69 -0
- package/lib/client/styles/code.scss +266 -0
- package/lib/client/styles/custom-container.scss +88 -0
- package/lib/client/styles/home.scss +168 -0
- package/lib/client/styles/index.scss +19 -0
- package/lib/client/styles/layout.scss +198 -0
- package/lib/client/styles/navbar-dropdown.scss +187 -0
- package/lib/client/styles/navbar.scss +177 -0
- package/lib/client/styles/normalize.scss +177 -0
- package/lib/client/styles/page.scss +83 -0
- package/lib/client/styles/sidebar.scss +134 -0
- package/lib/client/styles/toc.scss +5 -0
- package/lib/client/styles/transitions.scss +22 -0
- package/lib/client/styles/vars-dark.scss +46 -0
- package/lib/client/styles/vars.scss +133 -0
- package/lib/client/utils/index.d.ts +3 -0
- package/lib/client/utils/index.js +3 -0
- package/lib/client/utils/isActiveSidebarItem.d.ts +3 -0
- package/lib/client/utils/isActiveSidebarItem.js +20 -0
- package/lib/client/utils/resolveEditLink.d.ts +9 -0
- package/lib/client/utils/resolveEditLink.js +29 -0
- package/lib/client/utils/resolveRepoType.d.ts +2 -0
- package/lib/client/utils/resolveRepoType.js +12 -0
- package/lib/node/defaultTheme.d.ts +10 -0
- package/lib/node/defaultTheme.js +116 -0
- package/lib/node/index.d.ts +5 -0
- package/lib/node/index.js +5 -0
- package/lib/node/utils/assignDefaultLocaleOptions.d.ts +7 -0
- package/lib/node/utils/assignDefaultLocaleOptions.js +56 -0
- package/lib/node/utils/index.d.ts +2 -0
- package/lib/node/utils/index.js +2 -0
- package/lib/node/utils/resolveContainerPluginOptions.d.ts +8 -0
- package/lib/node/utils/resolveContainerPluginOptions.js +17 -0
- package/lib/shared/index.d.ts +3 -0
- package/lib/shared/index.js +3 -0
- package/lib/shared/nav.d.ts +43 -0
- package/lib/shared/nav.js +1 -0
- package/lib/shared/options.d.ts +243 -0
- package/lib/shared/options.js +1 -0
- package/lib/shared/page.d.ts +40 -0
- package/lib/shared/page.js +1 -0
- package/package.json +17 -17
- 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.50-pre.1",
|
|
4
4
|
"description": "Default theme of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-theme",
|
|
@@ -28,24 +28,24 @@
|
|
|
28
28
|
"main": "./lib/node/index.js",
|
|
29
29
|
"types": "./lib/node/index.d.ts",
|
|
30
30
|
"files": [
|
|
31
|
-
"
|
|
32
|
-
"
|
|
31
|
+
"lib",
|
|
32
|
+
"templates"
|
|
33
33
|
],
|
|
34
34
|
"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",
|
|
35
|
+
"@vuepress/client": "2.0.0-beta.50-pre.1",
|
|
36
|
+
"@vuepress/core": "2.0.0-beta.50-pre.1",
|
|
37
|
+
"@vuepress/plugin-active-header-links": "2.0.0-beta.50-pre.1",
|
|
38
|
+
"@vuepress/plugin-back-to-top": "2.0.0-beta.50-pre.1",
|
|
39
|
+
"@vuepress/plugin-container": "2.0.0-beta.50-pre.1",
|
|
40
|
+
"@vuepress/plugin-external-link-icon": "2.0.0-beta.50-pre.1",
|
|
41
|
+
"@vuepress/plugin-git": "2.0.0-beta.50-pre.1",
|
|
42
|
+
"@vuepress/plugin-medium-zoom": "2.0.0-beta.50-pre.1",
|
|
43
|
+
"@vuepress/plugin-nprogress": "2.0.0-beta.50-pre.1",
|
|
44
|
+
"@vuepress/plugin-palette": "2.0.0-beta.50-pre.1",
|
|
45
|
+
"@vuepress/plugin-prismjs": "2.0.0-beta.50-pre.1",
|
|
46
|
+
"@vuepress/plugin-theme-data": "2.0.0-beta.50-pre.1",
|
|
47
|
+
"@vuepress/shared": "2.0.0-beta.50-pre.1",
|
|
48
|
+
"@vuepress/utils": "2.0.0-beta.50-pre.1",
|
|
49
49
|
"@vueuse/core": "^9.1.0",
|
|
50
50
|
"sass": "^1.54.4",
|
|
51
51
|
"vue": "^3.2.37",
|
|
@@ -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>
|