@vuepress/theme-default 2.0.0-beta.48 → 2.0.0-beta.50-pre
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/package.json +30 -23
- package/lib/client/components/AutoLink.vue +0 -114
- package/lib/client/components/DropdownTransition.vue +0 -21
- package/lib/client/components/Home.vue +0 -15
- package/lib/client/components/HomeContent.vue +0 -5
- package/lib/client/components/HomeFeatures.vue +0 -23
- package/lib/client/components/HomeFooter.vue +0 -17
- package/lib/client/components/HomeHero.vue +0 -97
- package/lib/client/components/Navbar.vue +0 -75
- package/lib/client/components/NavbarBrand.vue +0 -55
- package/lib/client/components/NavbarDropdown.vue +0 -126
- package/lib/client/components/NavbarItems.vue +0 -154
- package/lib/client/components/Page.vue +0 -24
- package/lib/client/components/PageMeta.vue +0 -124
- package/lib/client/components/PageNav.vue +0 -103
- package/lib/client/components/Sidebar.vue +0 -13
- package/lib/client/components/SidebarItem.vue +0 -80
- package/lib/client/components/SidebarItems.vue +0 -57
- package/lib/client/components/ToggleColorModeButton.vue +0 -57
- package/lib/client/components/ToggleSidebarButton.vue +0 -24
- package/lib/client/components/global/Badge.vue +0 -31
- package/lib/client/components/global/CodeGroup.d.ts +0 -4
- package/lib/client/components/global/CodeGroup.js +0 -106
- package/lib/client/components/global/CodeGroupItem.vue +0 -31
- package/lib/client/components/global/index.d.ts +0 -4
- package/lib/client/components/global/index.js +0 -4
- package/lib/client/composables/index.d.ts +0 -6
- package/lib/client/composables/index.js +0 -6
- package/lib/client/composables/useDarkMode.d.ts +0 -12
- package/lib/client/composables/useDarkMode.js +0 -57
- package/lib/client/composables/useNavLink.d.ts +0 -14
- package/lib/client/composables/useNavLink.js +0 -18
- package/lib/client/composables/useResolveRouteWithRedirect.d.ts +0 -5
- package/lib/client/composables/useResolveRouteWithRedirect.js +0 -24
- package/lib/client/composables/useScrollPromise.d.ts +0 -6
- package/lib/client/composables/useScrollPromise.js +0 -14
- package/lib/client/composables/useSidebarItems.d.ts +0 -36
- package/lib/client/composables/useSidebarItems.js +0 -117
- package/lib/client/composables/useThemeData.d.ts +0 -4
- package/lib/client/composables/useThemeData.js +0 -3
- package/lib/client/config.d.ts +0 -3
- package/lib/client/config.js +0 -38
- package/lib/client/index.d.ts +0 -4
- package/lib/client/index.js +0 -2
- package/lib/client/layouts/404.vue +0 -25
- package/lib/client/layouts/Layout.vue +0 -134
- package/lib/client/shim.d.ts +0 -5
- package/lib/client/styles/_mixins.scss +0 -20
- package/lib/client/styles/_variables.scss +0 -11
- package/lib/client/styles/arrow.scss +0 -37
- package/lib/client/styles/badge.scss +0 -31
- package/lib/client/styles/code-group.scss +0 -69
- package/lib/client/styles/code.scss +0 -266
- package/lib/client/styles/custom-container.scss +0 -88
- package/lib/client/styles/home.scss +0 -168
- package/lib/client/styles/index.scss +0 -19
- package/lib/client/styles/layout.scss +0 -198
- package/lib/client/styles/navbar-dropdown.scss +0 -187
- package/lib/client/styles/navbar.scss +0 -177
- package/lib/client/styles/normalize.scss +0 -176
- package/lib/client/styles/page.scss +0 -83
- package/lib/client/styles/sidebar.scss +0 -134
- package/lib/client/styles/toc.scss +0 -5
- package/lib/client/styles/transitions.scss +0 -22
- package/lib/client/styles/vars-dark.scss +0 -46
- package/lib/client/styles/vars.scss +0 -133
- package/lib/client/utils/index.d.ts +0 -3
- package/lib/client/utils/index.js +0 -3
- package/lib/client/utils/isActiveSidebarItem.d.ts +0 -3
- package/lib/client/utils/isActiveSidebarItem.js +0 -20
- package/lib/client/utils/resolveEditLink.d.ts +0 -9
- package/lib/client/utils/resolveEditLink.js +0 -29
- package/lib/client/utils/resolveRepoType.d.ts +0 -2
- package/lib/client/utils/resolveRepoType.js +0 -12
- package/lib/node/defaultTheme.d.ts +0 -10
- package/lib/node/defaultTheme.js +0 -119
- package/lib/node/index.d.ts +0 -5
- package/lib/node/index.js +0 -21
- package/lib/node/utils/assignDefaultLocaleOptions.d.ts +0 -7
- package/lib/node/utils/assignDefaultLocaleOptions.js +0 -60
- package/lib/node/utils/index.d.ts +0 -2
- package/lib/node/utils/index.js +0 -18
- package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
- package/lib/node/utils/resolveContainerPluginOptions.js +0 -21
- package/lib/shared/index.d.ts +0 -3
- package/lib/shared/index.js +0 -19
- package/lib/shared/nav.d.ts +0 -43
- package/lib/shared/nav.js +0 -2
- package/lib/shared/options.d.ts +0 -243
- package/lib/shared/options.js +0 -2
- package/lib/shared/page.d.ts +0 -40
- package/lib/shared/page.js +0 -2
- package/templates/build.html +0 -33
|
@@ -1,133 +0,0 @@
|
|
|
1
|
-
:root {
|
|
2
|
-
// brand colors
|
|
3
|
-
--c-brand: #3eaf7c;
|
|
4
|
-
--c-brand-light: #4abf8a;
|
|
5
|
-
|
|
6
|
-
// background colors
|
|
7
|
-
--c-bg: #ffffff;
|
|
8
|
-
--c-bg-light: #f3f4f5;
|
|
9
|
-
--c-bg-lighter: #eeeeee;
|
|
10
|
-
--c-bg-navbar: var(--c-bg);
|
|
11
|
-
--c-bg-sidebar: var(--c-bg);
|
|
12
|
-
--c-bg-arrow: #cccccc;
|
|
13
|
-
|
|
14
|
-
// text colors
|
|
15
|
-
--c-text: #2c3e50;
|
|
16
|
-
--c-text-accent: var(--c-brand);
|
|
17
|
-
--c-text-light: #3a5169;
|
|
18
|
-
--c-text-lighter: #4e6e8e;
|
|
19
|
-
--c-text-lightest: #6a8bad;
|
|
20
|
-
--c-text-quote: #999999;
|
|
21
|
-
|
|
22
|
-
// border colors
|
|
23
|
-
--c-border: #eaecef;
|
|
24
|
-
--c-border-dark: #dfe2e5;
|
|
25
|
-
|
|
26
|
-
// custom container colors
|
|
27
|
-
--c-tip: #42b983;
|
|
28
|
-
--c-tip-bg: var(--c-bg-light);
|
|
29
|
-
--c-tip-title: var(--c-text);
|
|
30
|
-
--c-tip-text: var(--c-text);
|
|
31
|
-
--c-tip-text-accent: var(--c-text-accent);
|
|
32
|
-
--c-warning: #e7c000;
|
|
33
|
-
--c-warning-bg: #fffae3;
|
|
34
|
-
--c-warning-title: #ad9000;
|
|
35
|
-
--c-warning-text: #746000;
|
|
36
|
-
--c-warning-text-accent: var(--c-text);
|
|
37
|
-
--c-danger: #cc0000;
|
|
38
|
-
--c-danger-bg: #ffe0e0;
|
|
39
|
-
--c-danger-title: #990000;
|
|
40
|
-
--c-danger-text: #660000;
|
|
41
|
-
--c-danger-text-accent: var(--c-text);
|
|
42
|
-
--c-details-bg: #eeeeee;
|
|
43
|
-
|
|
44
|
-
// badge component colors
|
|
45
|
-
--c-badge-tip: var(--c-tip);
|
|
46
|
-
--c-badge-warning: var(--c-warning);
|
|
47
|
-
--c-badge-danger: var(--c-danger);
|
|
48
|
-
|
|
49
|
-
// transition vars
|
|
50
|
-
--t-color: 0.3s ease;
|
|
51
|
-
--t-transform: 0.3s ease;
|
|
52
|
-
|
|
53
|
-
// code blocks vars
|
|
54
|
-
--code-bg-color: #282c34;
|
|
55
|
-
--code-hl-bg-color: rgba(0, 0, 0, 0.66);
|
|
56
|
-
--code-ln-color: #9e9e9e;
|
|
57
|
-
--code-ln-wrapper-width: 3.5rem;
|
|
58
|
-
|
|
59
|
-
// font vars
|
|
60
|
-
--font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen,
|
|
61
|
-
Ubuntu, Cantarell, 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
|
|
62
|
-
--font-family-code: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
|
|
63
|
-
|
|
64
|
-
// layout vars
|
|
65
|
-
--navbar-height: 3.6rem;
|
|
66
|
-
--navbar-padding-v: 0.7rem;
|
|
67
|
-
--navbar-padding-h: 1.5rem;
|
|
68
|
-
--sidebar-width: 20rem;
|
|
69
|
-
--sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
|
|
70
|
-
--content-width: 740px;
|
|
71
|
-
--homepage-width: 960px;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
// plugin-back-to-top
|
|
75
|
-
.back-to-top {
|
|
76
|
-
--back-to-top-color: var(--c-brand);
|
|
77
|
-
--back-to-top-color-hover: var(--c-brand-light);
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
// plugin-docsearch
|
|
81
|
-
.DocSearch {
|
|
82
|
-
--docsearch-primary-color: var(--c-brand);
|
|
83
|
-
--docsearch-text-color: var(--c-text);
|
|
84
|
-
--docsearch-highlight-color: var(--c-brand);
|
|
85
|
-
--docsearch-muted-color: var(--c-text-quote);
|
|
86
|
-
--docsearch-container-background: rgba(9, 10, 17, 0.8);
|
|
87
|
-
--docsearch-modal-background: var(--c-bg-light);
|
|
88
|
-
--docsearch-searchbox-background: var(--c-bg-lighter);
|
|
89
|
-
--docsearch-searchbox-focus-background: var(--c-bg);
|
|
90
|
-
--docsearch-searchbox-shadow: inset 0 0 0 2px var(--c-brand);
|
|
91
|
-
--docsearch-hit-color: var(--c-text-light);
|
|
92
|
-
--docsearch-hit-active-color: var(--c-bg);
|
|
93
|
-
--docsearch-hit-background: var(--c-bg);
|
|
94
|
-
--docsearch-hit-shadow: 0 1px 3px 0 var(--c-border-dark);
|
|
95
|
-
--docsearch-footer-background: var(--c-bg);
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// plugin-external-link-icon
|
|
99
|
-
.external-link-icon {
|
|
100
|
-
--external-link-icon-color: var(--c-text-quote);
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
// plugin-medium-zoom
|
|
104
|
-
.medium-zoom-overlay {
|
|
105
|
-
--medium-zoom-bg-color: var(--c-bg);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
// plugin-nprogress
|
|
109
|
-
#nprogress {
|
|
110
|
-
--nprogress-color: var(--c-brand);
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
// plugin-pwa-popup
|
|
114
|
-
.pwa-popup {
|
|
115
|
-
--pwa-popup-text-color: var(--c-text);
|
|
116
|
-
--pwa-popup-bg-color: var(--c-bg);
|
|
117
|
-
--pwa-popup-border-color: var(--c-brand);
|
|
118
|
-
--pwa-popup-shadow: 0 4px 16px var(--c-brand);
|
|
119
|
-
--pwa-popup-btn-text-color: var(--c-bg);
|
|
120
|
-
--pwa-popup-btn-bg-color: var(--c-brand);
|
|
121
|
-
--pwa-popup-btn-hover-bg-color: var(--c-brand-light);
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
// plugin-search
|
|
125
|
-
.search-box {
|
|
126
|
-
--search-bg-color: var(--c-bg);
|
|
127
|
-
--search-accent-color: var(--c-brand);
|
|
128
|
-
--search-text-color: var(--c-text);
|
|
129
|
-
--search-border-color: var(--c-border);
|
|
130
|
-
|
|
131
|
-
--search-item-text-color: var(--c-text-lighter);
|
|
132
|
-
--search-item-focus-bg-color: var(--c-bg-light);
|
|
133
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
const normalizePath = (path) => decodeURI(path)
|
|
2
|
-
.replace(/#.*$/, '')
|
|
3
|
-
.replace(/(index)?\.(md|html)$/, '');
|
|
4
|
-
const isActiveLink = (link, route) => {
|
|
5
|
-
if (route.hash === link) {
|
|
6
|
-
return true;
|
|
7
|
-
}
|
|
8
|
-
const currentPath = normalizePath(route.path);
|
|
9
|
-
const targetPath = normalizePath(link);
|
|
10
|
-
return currentPath === targetPath;
|
|
11
|
-
};
|
|
12
|
-
export const isActiveSidebarItem = (item, route) => {
|
|
13
|
-
if (item.link && isActiveLink(item.link, route)) {
|
|
14
|
-
return true;
|
|
15
|
-
}
|
|
16
|
-
if (item.children) {
|
|
17
|
-
return item.children.some((child) => isActiveSidebarItem(child, route));
|
|
18
|
-
}
|
|
19
|
-
return false;
|
|
20
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { RepoType } from './resolveRepoType';
|
|
2
|
-
export declare const editLinkPatterns: Record<Exclude<RepoType, null>, string>;
|
|
3
|
-
export declare const resolveEditLink: ({ docsRepo, docsBranch, docsDir, filePathRelative, editLinkPattern, }: {
|
|
4
|
-
docsRepo: string;
|
|
5
|
-
docsBranch: string;
|
|
6
|
-
docsDir: string;
|
|
7
|
-
filePathRelative: string | null;
|
|
8
|
-
editLinkPattern?: string | undefined;
|
|
9
|
-
}) => string | null;
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { isLinkHttp, removeEndingSlash, removeLeadingSlash, } from '@vuepress/shared';
|
|
2
|
-
import { resolveRepoType } from './resolveRepoType';
|
|
3
|
-
export const editLinkPatterns = {
|
|
4
|
-
GitHub: ':repo/edit/:branch/:path',
|
|
5
|
-
GitLab: ':repo/-/edit/:branch/:path',
|
|
6
|
-
Gitee: ':repo/edit/:branch/:path',
|
|
7
|
-
Bitbucket: ':repo/src/:branch/:path?mode=edit&spa=0&at=:branch&fileviewer=file-view-default',
|
|
8
|
-
};
|
|
9
|
-
const resolveEditLinkPatterns = ({ docsRepo, editLinkPattern, }) => {
|
|
10
|
-
if (editLinkPattern) {
|
|
11
|
-
return editLinkPattern;
|
|
12
|
-
}
|
|
13
|
-
const repoType = resolveRepoType(docsRepo);
|
|
14
|
-
if (repoType !== null) {
|
|
15
|
-
return editLinkPatterns[repoType];
|
|
16
|
-
}
|
|
17
|
-
return null;
|
|
18
|
-
};
|
|
19
|
-
export const resolveEditLink = ({ docsRepo, docsBranch, docsDir, filePathRelative, editLinkPattern, }) => {
|
|
20
|
-
if (!filePathRelative)
|
|
21
|
-
return null;
|
|
22
|
-
const pattern = resolveEditLinkPatterns({ docsRepo, editLinkPattern });
|
|
23
|
-
if (!pattern)
|
|
24
|
-
return null;
|
|
25
|
-
return pattern
|
|
26
|
-
.replace(/:repo/, isLinkHttp(docsRepo) ? docsRepo : `https://github.com/${docsRepo}`)
|
|
27
|
-
.replace(/:branch/, docsBranch)
|
|
28
|
-
.replace(/:path/, removeLeadingSlash(`${removeEndingSlash(docsDir)}/${filePathRelative}`));
|
|
29
|
-
};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { isLinkHttp } from '@vuepress/shared';
|
|
2
|
-
export const resolveRepoType = (repo) => {
|
|
3
|
-
if (!isLinkHttp(repo) || /github\.com/.test(repo))
|
|
4
|
-
return 'GitHub';
|
|
5
|
-
if (/bitbucket\.org/.test(repo))
|
|
6
|
-
return 'Bitbucket';
|
|
7
|
-
if (/gitlab\.com/.test(repo))
|
|
8
|
-
return 'GitLab';
|
|
9
|
-
if (/gitee\.com/.test(repo))
|
|
10
|
-
return 'Gitee';
|
|
11
|
-
return null;
|
|
12
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import type { Theme } from '@vuepress/core';
|
|
2
|
-
import type { DefaultThemeLocaleOptions, DefaultThemePluginsOptions } from '../shared';
|
|
3
|
-
export interface DefaultThemeOptions extends DefaultThemeLocaleOptions {
|
|
4
|
-
/**
|
|
5
|
-
* To avoid confusion with the root `plugins` option,
|
|
6
|
-
* we use `themePlugins`
|
|
7
|
-
*/
|
|
8
|
-
themePlugins?: DefaultThemePluginsOptions;
|
|
9
|
-
}
|
|
10
|
-
export declare const defaultTheme: ({ themePlugins, ...localeOptions }?: DefaultThemeOptions) => Theme;
|
package/lib/node/defaultTheme.js
DELETED
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.defaultTheme = void 0;
|
|
4
|
-
const plugin_active_header_links_1 = require("@vuepress/plugin-active-header-links");
|
|
5
|
-
const plugin_back_to_top_1 = require("@vuepress/plugin-back-to-top");
|
|
6
|
-
const plugin_container_1 = require("@vuepress/plugin-container");
|
|
7
|
-
const plugin_external_link_icon_1 = require("@vuepress/plugin-external-link-icon");
|
|
8
|
-
const plugin_git_1 = require("@vuepress/plugin-git");
|
|
9
|
-
const plugin_medium_zoom_1 = require("@vuepress/plugin-medium-zoom");
|
|
10
|
-
const plugin_nprogress_1 = require("@vuepress/plugin-nprogress");
|
|
11
|
-
const plugin_palette_1 = require("@vuepress/plugin-palette");
|
|
12
|
-
const plugin_prismjs_1 = require("@vuepress/plugin-prismjs");
|
|
13
|
-
const plugin_theme_data_1 = require("@vuepress/plugin-theme-data");
|
|
14
|
-
const utils_1 = require("@vuepress/utils");
|
|
15
|
-
const utils_2 = require("./utils");
|
|
16
|
-
const defaultTheme = ({ themePlugins = {}, ...localeOptions } = {}) => {
|
|
17
|
-
(0, utils_2.assignDefaultLocaleOptions)(localeOptions);
|
|
18
|
-
return {
|
|
19
|
-
name: '@vuepress/theme-default',
|
|
20
|
-
layouts: utils_1.path.resolve(__dirname, '../client/layouts'),
|
|
21
|
-
templateBuild: utils_1.path.resolve(__dirname, '../../templates/build.html'),
|
|
22
|
-
// use alias to make all components replaceable
|
|
23
|
-
alias: Object.fromEntries(utils_1.fs
|
|
24
|
-
.readdirSync(utils_1.path.resolve(__dirname, '../client/components'))
|
|
25
|
-
.filter((file) => file.endsWith('.vue'))
|
|
26
|
-
.map((file) => [
|
|
27
|
-
`@theme/${file}`,
|
|
28
|
-
utils_1.path.resolve(__dirname, '../client/components', file),
|
|
29
|
-
])),
|
|
30
|
-
clientConfigFile: utils_1.path.resolve(__dirname, '../client/config.js'),
|
|
31
|
-
extendsPage: (page) => {
|
|
32
|
-
// save relative file path into page data to generate edit link
|
|
33
|
-
page.data.filePathRelative = page.filePathRelative;
|
|
34
|
-
// save title into route meta to generate navbar and sidebar
|
|
35
|
-
page.routeMeta.title = page.title;
|
|
36
|
-
},
|
|
37
|
-
plugins: [
|
|
38
|
-
// @vuepress/plugin-active-header-link
|
|
39
|
-
themePlugins.activeHeaderLinks !== false
|
|
40
|
-
? (0, plugin_active_header_links_1.activeHeaderLinksPlugin)({
|
|
41
|
-
headerLinkSelector: 'a.sidebar-item',
|
|
42
|
-
headerAnchorSelector: '.header-anchor',
|
|
43
|
-
// should greater than page transition duration
|
|
44
|
-
delay: 300,
|
|
45
|
-
})
|
|
46
|
-
: [],
|
|
47
|
-
// @vuepress/plugin-back-to-top
|
|
48
|
-
themePlugins.backToTop !== false ? (0, plugin_back_to_top_1.backToTopPlugin)() : [],
|
|
49
|
-
// @vuepress/plugin-container
|
|
50
|
-
themePlugins.container?.tip !== false
|
|
51
|
-
? (0, plugin_container_1.containerPlugin)((0, utils_2.resolveContainerPluginOptions)(localeOptions, 'tip'))
|
|
52
|
-
: [],
|
|
53
|
-
themePlugins.container?.warning !== false
|
|
54
|
-
? (0, plugin_container_1.containerPlugin)((0, utils_2.resolveContainerPluginOptions)(localeOptions, 'warning'))
|
|
55
|
-
: [],
|
|
56
|
-
themePlugins.container?.danger !== false
|
|
57
|
-
? (0, plugin_container_1.containerPlugin)((0, utils_2.resolveContainerPluginOptions)(localeOptions, 'danger'))
|
|
58
|
-
: [],
|
|
59
|
-
themePlugins.container?.details !== false
|
|
60
|
-
? (0, plugin_container_1.containerPlugin)({
|
|
61
|
-
type: 'details',
|
|
62
|
-
before: (info) => `<details class="custom-container details">${info ? `<summary>${info}</summary>` : ''}\n`,
|
|
63
|
-
after: () => '</details>\n',
|
|
64
|
-
})
|
|
65
|
-
: [],
|
|
66
|
-
themePlugins.container?.codeGroup !== false
|
|
67
|
-
? (0, plugin_container_1.containerPlugin)({
|
|
68
|
-
type: 'code-group',
|
|
69
|
-
before: () => `<CodeGroup>\n`,
|
|
70
|
-
after: () => '</CodeGroup>\n',
|
|
71
|
-
})
|
|
72
|
-
: [],
|
|
73
|
-
themePlugins.container?.codeGroupItem !== false
|
|
74
|
-
? (0, plugin_container_1.containerPlugin)({
|
|
75
|
-
type: 'code-group-item',
|
|
76
|
-
before: (info) => `<CodeGroupItem title="${info}">\n`,
|
|
77
|
-
after: () => '</CodeGroupItem>\n',
|
|
78
|
-
})
|
|
79
|
-
: [],
|
|
80
|
-
// @vuepress/plugin-external-link-icon
|
|
81
|
-
themePlugins.externalLinkIcon !== false
|
|
82
|
-
? (0, plugin_external_link_icon_1.externalLinkIconPlugin)({
|
|
83
|
-
locales: Object.entries(localeOptions.locales || {}).reduce((result, [key, value]) => {
|
|
84
|
-
result[key] = {
|
|
85
|
-
openInNewWindow: value.openInNewWindow ?? localeOptions.openInNewWindow,
|
|
86
|
-
};
|
|
87
|
-
return result;
|
|
88
|
-
}, {}),
|
|
89
|
-
})
|
|
90
|
-
: [],
|
|
91
|
-
// @vuepress/plugin-git
|
|
92
|
-
themePlugins.git !== false
|
|
93
|
-
? (0, plugin_git_1.gitPlugin)({
|
|
94
|
-
createdTime: false,
|
|
95
|
-
updatedTime: localeOptions.lastUpdated !== false,
|
|
96
|
-
contributors: localeOptions.contributors !== false,
|
|
97
|
-
})
|
|
98
|
-
: [],
|
|
99
|
-
// @vuepress/plugin-medium-zoom
|
|
100
|
-
themePlugins.mediumZoom !== false
|
|
101
|
-
? (0, plugin_medium_zoom_1.mediumZoomPlugin)({
|
|
102
|
-
selector: '.theme-default-content > img, .theme-default-content :not(a) > img',
|
|
103
|
-
zoomOptions: {},
|
|
104
|
-
// should greater than page transition duration
|
|
105
|
-
delay: 300,
|
|
106
|
-
})
|
|
107
|
-
: [],
|
|
108
|
-
// @vuepress/plugin-nprogress
|
|
109
|
-
themePlugins.nprogress !== false ? (0, plugin_nprogress_1.nprogressPlugin)() : [],
|
|
110
|
-
// @vuepress/plugin-palette
|
|
111
|
-
(0, plugin_palette_1.palettePlugin)({ preset: 'sass' }),
|
|
112
|
-
// @vuepress/plugin-prismjs
|
|
113
|
-
themePlugins.prismjs !== false ? (0, plugin_prismjs_1.prismjsPlugin)() : [],
|
|
114
|
-
// @vuepress/plugin-theme-data
|
|
115
|
-
(0, plugin_theme_data_1.themeDataPlugin)({ themeData: localeOptions }),
|
|
116
|
-
],
|
|
117
|
-
};
|
|
118
|
-
};
|
|
119
|
-
exports.defaultTheme = defaultTheme;
|
package/lib/node/index.d.ts
DELETED
package/lib/node/index.js
DELETED
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
const defaultTheme_1 = require("./defaultTheme");
|
|
18
|
-
__exportStar(require("../shared"), exports);
|
|
19
|
-
__exportStar(require("./defaultTheme"), exports);
|
|
20
|
-
__exportStar(require("./utils"), exports);
|
|
21
|
-
exports.default = defaultTheme_1.defaultTheme;
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import type { DefaultThemeLocaleData, DefaultThemeLocaleOptions } from '../../shared';
|
|
2
|
-
export declare const DEFAULT_LOCALE_OPTIONS: DefaultThemeLocaleOptions;
|
|
3
|
-
export declare const DEFAULT_LOCALE_DATA: DefaultThemeLocaleData;
|
|
4
|
-
/**
|
|
5
|
-
* Assign default options
|
|
6
|
-
*/
|
|
7
|
-
export declare const assignDefaultLocaleOptions: (localeOptions: DefaultThemeLocaleOptions) => void;
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.assignDefaultLocaleOptions = exports.DEFAULT_LOCALE_DATA = exports.DEFAULT_LOCALE_OPTIONS = void 0;
|
|
4
|
-
exports.DEFAULT_LOCALE_OPTIONS = {
|
|
5
|
-
// color mode
|
|
6
|
-
colorMode: 'auto',
|
|
7
|
-
colorModeSwitch: true,
|
|
8
|
-
// navbar
|
|
9
|
-
navbar: [],
|
|
10
|
-
logo: null,
|
|
11
|
-
repo: null,
|
|
12
|
-
selectLanguageText: 'Languages',
|
|
13
|
-
selectLanguageAriaLabel: 'Select language',
|
|
14
|
-
// sidebar
|
|
15
|
-
sidebar: 'auto',
|
|
16
|
-
sidebarDepth: 2,
|
|
17
|
-
// page meta
|
|
18
|
-
editLink: true,
|
|
19
|
-
editLinkText: 'Edit this page',
|
|
20
|
-
lastUpdated: true,
|
|
21
|
-
lastUpdatedText: 'Last Updated',
|
|
22
|
-
contributors: true,
|
|
23
|
-
contributorsText: 'Contributors',
|
|
24
|
-
// 404 page messages
|
|
25
|
-
notFound: [
|
|
26
|
-
`There's nothing here.`,
|
|
27
|
-
`How did we get here?`,
|
|
28
|
-
`That's a Four-Oh-Four.`,
|
|
29
|
-
`Looks like we've got some broken links.`,
|
|
30
|
-
],
|
|
31
|
-
backToHome: 'Take me home',
|
|
32
|
-
// a11y
|
|
33
|
-
openInNewWindow: 'open in new window',
|
|
34
|
-
toggleColorMode: 'toggle color mode',
|
|
35
|
-
toggleSidebar: 'toggle sidebar',
|
|
36
|
-
};
|
|
37
|
-
exports.DEFAULT_LOCALE_DATA = {
|
|
38
|
-
// navbar
|
|
39
|
-
selectLanguageName: 'English',
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Assign default options
|
|
43
|
-
*/
|
|
44
|
-
const assignDefaultLocaleOptions = (localeOptions) => {
|
|
45
|
-
if (!localeOptions.locales) {
|
|
46
|
-
localeOptions.locales = {};
|
|
47
|
-
}
|
|
48
|
-
if (!localeOptions.locales['/']) {
|
|
49
|
-
localeOptions.locales['/'] = {};
|
|
50
|
-
}
|
|
51
|
-
Object.assign(localeOptions, {
|
|
52
|
-
...exports.DEFAULT_LOCALE_OPTIONS,
|
|
53
|
-
...localeOptions,
|
|
54
|
-
});
|
|
55
|
-
Object.assign(localeOptions.locales['/'], {
|
|
56
|
-
...exports.DEFAULT_LOCALE_DATA,
|
|
57
|
-
...localeOptions.locales['/'],
|
|
58
|
-
});
|
|
59
|
-
};
|
|
60
|
-
exports.assignDefaultLocaleOptions = assignDefaultLocaleOptions;
|
package/lib/node/utils/index.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./assignDefaultLocaleOptions"), exports);
|
|
18
|
-
__exportStar(require("./resolveContainerPluginOptions"), exports);
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ContainerPluginOptions } from '@vuepress/plugin-container';
|
|
2
|
-
import type { DefaultThemeData } from '../../shared';
|
|
3
|
-
/**
|
|
4
|
-
* Resolve options for @vuepress/plugin-container
|
|
5
|
-
*
|
|
6
|
-
* For custom containers default title
|
|
7
|
-
*/
|
|
8
|
-
export declare const resolveContainerPluginOptions: (localeOptions: DefaultThemeData, type: 'tip' | 'warning' | 'danger') => ContainerPluginOptions;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.resolveContainerPluginOptions = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Resolve options for @vuepress/plugin-container
|
|
6
|
-
*
|
|
7
|
-
* For custom containers default title
|
|
8
|
-
*/
|
|
9
|
-
const resolveContainerPluginOptions = (localeOptions, type) => {
|
|
10
|
-
const locales = Object.entries(localeOptions.locales || {}).reduce((result, [key, value]) => {
|
|
11
|
-
result[key] = {
|
|
12
|
-
defaultInfo: value?.[type] ?? localeOptions[type],
|
|
13
|
-
};
|
|
14
|
-
return result;
|
|
15
|
-
}, {});
|
|
16
|
-
return {
|
|
17
|
-
type,
|
|
18
|
-
locales,
|
|
19
|
-
};
|
|
20
|
-
};
|
|
21
|
-
exports.resolveContainerPluginOptions = resolveContainerPluginOptions;
|
package/lib/shared/index.d.ts
DELETED
package/lib/shared/index.js
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./nav"), exports);
|
|
18
|
-
__exportStar(require("./options"), exports);
|
|
19
|
-
__exportStar(require("./page"), exports);
|
package/lib/shared/nav.d.ts
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Base nav item, displayed as text
|
|
3
|
-
*/
|
|
4
|
-
export interface NavItem {
|
|
5
|
-
text: string;
|
|
6
|
-
ariaLabel?: string;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Base nav group, has nav items children
|
|
10
|
-
*/
|
|
11
|
-
export interface NavGroup<T> extends NavItem {
|
|
12
|
-
children: T[];
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Props for `<AutoLink>`
|
|
16
|
-
*/
|
|
17
|
-
export interface NavLink extends NavItem {
|
|
18
|
-
link: string;
|
|
19
|
-
rel?: string;
|
|
20
|
-
target?: string;
|
|
21
|
-
activeMatch?: string;
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* Navbar types
|
|
25
|
-
*/
|
|
26
|
-
export declare type NavbarItem = NavLink;
|
|
27
|
-
export declare type NavbarGroup = NavGroup<NavbarGroup | NavbarItem | string>;
|
|
28
|
-
export declare type NavbarConfig = (NavbarItem | NavbarGroup | string)[];
|
|
29
|
-
export declare type ResolvedNavbarItem = NavbarItem | NavGroup<ResolvedNavbarItem>;
|
|
30
|
-
/**
|
|
31
|
-
* Sidebar types
|
|
32
|
-
*/
|
|
33
|
-
export declare type SidebarItem = NavItem & Partial<NavLink>;
|
|
34
|
-
export declare type SidebarGroup = SidebarItem & NavGroup<SidebarItem | SidebarGroup | string>;
|
|
35
|
-
export declare type SidebarGroupCollapsible = SidebarGroup & {
|
|
36
|
-
collapsible?: boolean;
|
|
37
|
-
};
|
|
38
|
-
export declare type SidebarConfigArray = (SidebarItem | SidebarGroupCollapsible | string)[];
|
|
39
|
-
export declare type SidebarConfigObject = Record<string, SidebarConfigArray>;
|
|
40
|
-
export declare type SidebarConfig = SidebarConfigArray | SidebarConfigObject;
|
|
41
|
-
export declare type ResolvedSidebarItem = SidebarItem & Partial<NavGroup<ResolvedSidebarItem>> & {
|
|
42
|
-
collapsible?: boolean;
|
|
43
|
-
};
|
package/lib/shared/nav.js
DELETED