@vuepress/theme-default 2.0.0-beta.26 → 2.0.0-beta.30
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/clientAppEnhance.js +4 -5
- package/lib/client/components/DropdownLink.vue +51 -51
- package/lib/client/components/DropdownTransition.vue +11 -11
- package/lib/client/components/Home.vue +12 -107
- 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/NavLink.vue +33 -33
- package/lib/client/components/Navbar.vue +23 -54
- package/lib/client/components/NavbarBrand.vue +55 -0
- package/lib/client/components/NavbarLinks.vue +16 -11
- package/lib/client/components/Page.vue +5 -5
- package/lib/client/components/PageMeta.vue +34 -31
- package/lib/client/components/PageNav.vue +14 -16
- package/lib/client/components/Sidebar.vue +8 -8
- package/lib/client/components/ToggleDarkModeButton.vue +11 -11
- package/lib/client/components/ToggleSidebarButton.vue +8 -8
- package/lib/client/components/global/Badge.vue +12 -12
- package/lib/client/components/global/CodeGroup.d.ts +1 -1
- package/lib/client/components/global/CodeGroupItem.vue +10 -10
- package/lib/client/components/global/{OutboundLink.vue → ExternalLinkIcon.vue} +7 -10
- package/lib/client/composables/useSidebarItems.d.ts +1 -1
- package/lib/client/index.d.ts +1 -1
- package/lib/client/layouts/404.vue +12 -12
- package/lib/client/layouts/Layout.vue +54 -54
- package/lib/client/styles/code.scss +1 -0
- package/lib/client/styles/home.scss +7 -4
- package/lib/client/styles/normalize.scss +1 -0
- package/lib/client/styles/page.scss +8 -0
- package/lib/client/styles/vars.scss +5 -0
- package/lib/client/utils/resolveEditLink.d.ts +1 -1
- package/lib/client/utils/resolveEditLink.js +12 -7
- package/lib/node/defaultTheme.js +28 -13
- package/lib/node/utils/assignDefaultLocaleOptions.d.ts +3 -1
- package/lib/node/utils/assignDefaultLocaleOptions.js +5 -5
- package/lib/node/utils/resolveContainerPluginOptions.d.ts +1 -1
- package/lib/node/utils/resolveGitPluginOptions.d.ts +1 -1
- package/lib/shared/options.d.ts +5 -1
- package/lib/shared/page.d.ts +3 -1
- package/package.json +21 -20
package/lib/node/defaultTheme.js
CHANGED
|
@@ -3,47 +3,62 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.defaultTheme = void 0;
|
|
4
4
|
const utils_1 = require("@vuepress/utils");
|
|
5
5
|
const utils_2 = require("./utils");
|
|
6
|
-
const defaultTheme = ({ themePlugins = {}, ...localeOptions }) => {
|
|
7
|
-
|
|
6
|
+
const defaultTheme = ({ themePlugins = {}, ...localeOptions }, app) => {
|
|
7
|
+
if (app.options.bundler.endsWith('vite')) {
|
|
8
|
+
// eslint-disable-next-line import/no-extraneous-dependencies
|
|
9
|
+
app.options.bundlerConfig.viteOptions = require('vite').mergeConfig(app.options.bundlerConfig.viteOptions, {
|
|
10
|
+
css: {
|
|
11
|
+
preprocessorOptions: {
|
|
12
|
+
scss: { charset: false },
|
|
13
|
+
},
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
(0, utils_2.assignDefaultLocaleOptions)(localeOptions);
|
|
8
18
|
return {
|
|
9
19
|
name: '@vuepress/theme-default',
|
|
10
20
|
layouts: utils_1.path.resolve(__dirname, '../client/layouts'),
|
|
11
21
|
clientAppEnhanceFiles: utils_1.path.resolve(__dirname, '../client/clientAppEnhance.js'),
|
|
12
22
|
clientAppSetupFiles: utils_1.path.resolve(__dirname, '../client/clientAppSetup.js'),
|
|
13
|
-
|
|
14
|
-
|
|
23
|
+
extendsPage: (page) => {
|
|
24
|
+
// save relative file path into page data to generate edit link
|
|
25
|
+
page.data.filePathRelative = page.filePathRelative;
|
|
26
|
+
// save title into route meta to generate navbar and sidebar
|
|
27
|
+
page.routeMeta.title = page.title;
|
|
28
|
+
},
|
|
15
29
|
plugins: [
|
|
16
30
|
[
|
|
17
31
|
'@vuepress/active-header-links',
|
|
18
|
-
utils_2.resolveActiveHeaderLinksPluginOptions(themePlugins),
|
|
32
|
+
(0, utils_2.resolveActiveHeaderLinksPluginOptions)(themePlugins),
|
|
19
33
|
],
|
|
20
34
|
['@vuepress/back-to-top', themePlugins.backToTop !== false],
|
|
21
35
|
[
|
|
22
36
|
'@vuepress/container',
|
|
23
|
-
utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'tip'),
|
|
37
|
+
(0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'tip'),
|
|
24
38
|
],
|
|
25
39
|
[
|
|
26
40
|
'@vuepress/container',
|
|
27
|
-
utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'warning'),
|
|
41
|
+
(0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'warning'),
|
|
28
42
|
],
|
|
29
43
|
[
|
|
30
44
|
'@vuepress/container',
|
|
31
|
-
utils_2.resolveContainerPluginOptions(themePlugins, localeOptions, 'danger'),
|
|
45
|
+
(0, utils_2.resolveContainerPluginOptions)(themePlugins, localeOptions, 'danger'),
|
|
32
46
|
],
|
|
33
47
|
[
|
|
34
48
|
'@vuepress/container',
|
|
35
|
-
utils_2.resolveContainerPluginOptionsForDetails(themePlugins),
|
|
49
|
+
(0, utils_2.resolveContainerPluginOptionsForDetails)(themePlugins),
|
|
36
50
|
],
|
|
37
51
|
[
|
|
38
52
|
'@vuepress/container',
|
|
39
|
-
utils_2.resolveContainerPluginOptionsForCodeGroup(themePlugins),
|
|
53
|
+
(0, utils_2.resolveContainerPluginOptionsForCodeGroup)(themePlugins),
|
|
40
54
|
],
|
|
41
55
|
[
|
|
42
56
|
'@vuepress/container',
|
|
43
|
-
utils_2.resolveContainerPluginOptionsForCodeGroupItem(themePlugins),
|
|
57
|
+
(0, utils_2.resolveContainerPluginOptionsForCodeGroupItem)(themePlugins),
|
|
44
58
|
],
|
|
45
|
-
['@vuepress/
|
|
46
|
-
['@vuepress/
|
|
59
|
+
['@vuepress/external-link-icon', themePlugins.externalLinkIcon !== false],
|
|
60
|
+
['@vuepress/git', (0, utils_2.resolveGitPluginOptions)(themePlugins, localeOptions)],
|
|
61
|
+
['@vuepress/medium-zoom', (0, utils_2.resolveMediumZoomPluginOptions)(themePlugins)],
|
|
47
62
|
['@vuepress/nprogress', themePlugins.nprogress !== false],
|
|
48
63
|
['@vuepress/palette', { preset: 'sass' }],
|
|
49
64
|
['@vuepress/prismjs', themePlugins.prismjs !== false],
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import type { DefaultThemeLocaleOptions } from '../../shared';
|
|
1
|
+
import type { DefaultThemeLocaleData, DefaultThemeLocaleOptions } from '../../shared';
|
|
2
|
+
export declare const DEFAULT_LOCALE_OPTIONS: DefaultThemeLocaleOptions;
|
|
3
|
+
export declare const DEFAULT_LOCALE_DATA: DefaultThemeLocaleData;
|
|
2
4
|
/**
|
|
3
5
|
* Assign default options to `themeConfig`
|
|
4
6
|
*/
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assignDefaultLocaleOptions = void 0;
|
|
4
|
-
|
|
3
|
+
exports.assignDefaultLocaleOptions = exports.DEFAULT_LOCALE_DATA = exports.DEFAULT_LOCALE_OPTIONS = void 0;
|
|
4
|
+
exports.DEFAULT_LOCALE_OPTIONS = {
|
|
5
5
|
// navbar
|
|
6
6
|
navbar: [],
|
|
7
7
|
logo: null,
|
|
@@ -32,7 +32,7 @@ const defaultLocaleOptions = {
|
|
|
32
32
|
toggleDarkMode: 'toggle dark mode',
|
|
33
33
|
toggleSidebar: 'toggle sidebar',
|
|
34
34
|
};
|
|
35
|
-
|
|
35
|
+
exports.DEFAULT_LOCALE_DATA = {
|
|
36
36
|
// navbar
|
|
37
37
|
selectLanguageName: 'English',
|
|
38
38
|
};
|
|
@@ -47,11 +47,11 @@ const assignDefaultLocaleOptions = (localeOptions) => {
|
|
|
47
47
|
localeOptions.locales['/'] = {};
|
|
48
48
|
}
|
|
49
49
|
Object.assign(localeOptions, {
|
|
50
|
-
...
|
|
50
|
+
...exports.DEFAULT_LOCALE_OPTIONS,
|
|
51
51
|
...localeOptions,
|
|
52
52
|
});
|
|
53
53
|
Object.assign(localeOptions.locales['/'], {
|
|
54
|
-
...
|
|
54
|
+
...exports.DEFAULT_LOCALE_DATA,
|
|
55
55
|
...localeOptions.locales['/'],
|
|
56
56
|
});
|
|
57
57
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ContainerPluginOptions } from '@vuepress/plugin-container';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DefaultThemeData, DefaultThemePluginsOptions } from '../../shared';
|
|
3
3
|
/**
|
|
4
4
|
* Resolve options for @vuepress/plugin-container
|
|
5
5
|
*
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { GitPluginOptions } from '@vuepress/plugin-git';
|
|
2
|
-
import type {
|
|
2
|
+
import type { DefaultThemeLocaleOptions, DefaultThemePluginsOptions } from '../../shared';
|
|
3
3
|
/**
|
|
4
4
|
* Resolve options for @vuepress/plugin-git
|
|
5
5
|
*/
|
package/lib/shared/options.d.ts
CHANGED
|
@@ -21,6 +21,10 @@ export interface DefaultThemePluginsOptions {
|
|
|
21
21
|
codeGroup?: boolean;
|
|
22
22
|
codeGroupItem?: boolean;
|
|
23
23
|
};
|
|
24
|
+
/**
|
|
25
|
+
* Enable @vuepress/plugin-external-link-icon or not
|
|
26
|
+
*/
|
|
27
|
+
externalLinkIcon?: boolean;
|
|
24
28
|
/**
|
|
25
29
|
* Enable @vuepress/plugin-git or not
|
|
26
30
|
*/
|
|
@@ -219,7 +223,7 @@ export interface DefaultThemeLocaleData extends LocaleData {
|
|
|
219
223
|
*/
|
|
220
224
|
backToHome?: string;
|
|
221
225
|
/**
|
|
222
|
-
* A11y text for
|
|
226
|
+
* A11y text for external link icon
|
|
223
227
|
*/
|
|
224
228
|
openInNewWindow?: string;
|
|
225
229
|
/**
|
package/lib/shared/page.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GitPluginPageData } from '@vuepress/plugin-git';
|
|
2
2
|
import type { NavLink, SidebarConfig } from './nav';
|
|
3
3
|
export interface DefaultThemePageData extends GitPluginPageData {
|
|
4
|
-
filePathRelative: string;
|
|
4
|
+
filePathRelative: string | null;
|
|
5
5
|
}
|
|
6
6
|
export interface DefaultThemePageFrontmatter {
|
|
7
7
|
home?: boolean;
|
|
@@ -11,6 +11,7 @@ export interface DefaultThemePageFrontmatter {
|
|
|
11
11
|
export interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontmatter {
|
|
12
12
|
home: true;
|
|
13
13
|
heroImage?: string;
|
|
14
|
+
heroImageDark?: string;
|
|
14
15
|
heroAlt?: string;
|
|
15
16
|
heroText?: string | null;
|
|
16
17
|
tagline?: string | null;
|
|
@@ -29,6 +30,7 @@ export interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontma
|
|
|
29
30
|
export interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFrontmatter {
|
|
30
31
|
home?: false;
|
|
31
32
|
editLink?: boolean;
|
|
33
|
+
editLinkPattern?: string;
|
|
32
34
|
lastUpdated?: boolean;
|
|
33
35
|
contributors?: boolean;
|
|
34
36
|
sidebar?: 'auto' | false | SidebarConfig;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/theme-default",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.30",
|
|
4
4
|
"description": "Default theme of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-theme",
|
|
@@ -29,27 +29,28 @@
|
|
|
29
29
|
"copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
-
"@vuepress/client": "2.0.0-beta.
|
|
33
|
-
"@vuepress/core": "2.0.0-beta.
|
|
34
|
-
"@vuepress/plugin-active-header-links": "2.0.0-beta.
|
|
35
|
-
"@vuepress/plugin-back-to-top": "2.0.0-beta.
|
|
36
|
-
"@vuepress/plugin-container": "2.0.0-beta.
|
|
37
|
-
"@vuepress/plugin-
|
|
38
|
-
"@vuepress/plugin-
|
|
39
|
-
"@vuepress/plugin-
|
|
40
|
-
"@vuepress/plugin-
|
|
41
|
-
"@vuepress/plugin-
|
|
42
|
-
"@vuepress/plugin-
|
|
43
|
-
"@vuepress/
|
|
44
|
-
"@vuepress/
|
|
45
|
-
"@
|
|
46
|
-
"
|
|
47
|
-
"sass
|
|
48
|
-
"
|
|
49
|
-
"vue
|
|
32
|
+
"@vuepress/client": "2.0.0-beta.29",
|
|
33
|
+
"@vuepress/core": "2.0.0-beta.29",
|
|
34
|
+
"@vuepress/plugin-active-header-links": "2.0.0-beta.29",
|
|
35
|
+
"@vuepress/plugin-back-to-top": "2.0.0-beta.30",
|
|
36
|
+
"@vuepress/plugin-container": "2.0.0-beta.29",
|
|
37
|
+
"@vuepress/plugin-external-link-icon": "2.0.0-beta.29",
|
|
38
|
+
"@vuepress/plugin-git": "2.0.0-beta.29",
|
|
39
|
+
"@vuepress/plugin-medium-zoom": "2.0.0-beta.29",
|
|
40
|
+
"@vuepress/plugin-nprogress": "2.0.0-beta.29",
|
|
41
|
+
"@vuepress/plugin-palette": "2.0.0-beta.29",
|
|
42
|
+
"@vuepress/plugin-prismjs": "2.0.0-beta.29",
|
|
43
|
+
"@vuepress/plugin-theme-data": "2.0.0-beta.29",
|
|
44
|
+
"@vuepress/shared": "2.0.0-beta.28",
|
|
45
|
+
"@vuepress/utils": "2.0.0-beta.28",
|
|
46
|
+
"@vueuse/core": "^7.1.2",
|
|
47
|
+
"sass": "^1.44.0",
|
|
48
|
+
"sass-loader": "^12.4.0",
|
|
49
|
+
"vue": "^3.2.24",
|
|
50
|
+
"vue-router": "^4.0.12"
|
|
50
51
|
},
|
|
51
52
|
"publishConfig": {
|
|
52
53
|
"access": "public"
|
|
53
54
|
},
|
|
54
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "b39bb4b791c95d5c40c64198b3931f80005475ef"
|
|
55
56
|
}
|