@vuepress/theme-default 2.0.0-rc.40 → 2.0.0-rc.42
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/VPDropdownTransition.vue +7 -5
- package/lib/client/components/VPHome.vue +1 -1
- package/lib/client/components/VPHomeFeatures.vue +4 -6
- package/lib/client/components/VPHomeFooter.vue +6 -5
- package/lib/client/components/VPHomeHero.vue +21 -23
- package/lib/client/components/VPNavbar.vue +21 -17
- package/lib/client/components/VPNavbarBrand.vue +2 -2
- package/lib/client/components/VPNavbarDropdown.vue +13 -13
- package/lib/client/components/VPNavbarItems.vue +6 -5
- package/lib/client/components/VPPage.vue +6 -5
- package/lib/client/components/VPPageMeta.vue +3 -3
- package/lib/client/components/VPPageNav.vue +9 -9
- package/lib/client/components/VPSidebar.vue +14 -13
- package/lib/client/components/VPSidebarItem.vue +13 -6
- package/lib/client/components/VPSidebarItems.vue +2 -1
- package/lib/client/components/VPToggleColorModeButton.vue +4 -3
- package/lib/client/components/VPToggleSidebarButton.vue +3 -3
- package/lib/client/components/global/Badge.vue +13 -4
- package/lib/client/components/global/CodeGroup.d.ts +1 -1
- package/lib/client/components/global/CodeGroup.js +32 -9
- package/lib/client/components/global/CodeGroupItem.vue +13 -0
- package/lib/client/composables/useContributors.d.ts +1 -1
- package/lib/client/composables/useDarkMode.js +4 -2
- package/lib/client/composables/useEditLink.d.ts +1 -1
- package/lib/client/composables/useLastUpdated.d.ts +1 -1
- package/lib/client/composables/useLastUpdated.js +1 -1
- package/lib/client/composables/useNavbarConfig.js +3 -1
- package/lib/client/composables/useNavbarSelectLanguage.js +1 -0
- package/lib/client/composables/useNavigate.js +1 -1
- package/lib/client/composables/useScrollPromise.js +3 -1
- package/lib/client/composables/useSidebarItems.d.ts +16 -16
- package/lib/client/composables/useSidebarItems.js +53 -52
- package/lib/client/composables/useUpdateDeviceStatus.d.ts +1 -1
- package/lib/client/composables/useUpdateDeviceStatus.js +8 -4
- package/lib/client/config.d.ts +1 -0
- package/lib/client/config.js +2 -1
- package/lib/client/layouts/Layout.vue +21 -17
- package/lib/client/layouts/NotFound.vue +3 -5
- package/lib/client/shim.d.ts +1 -0
- package/lib/client/styles/arrow.scss +1 -1
- package/lib/client/styles/code-group.scss +6 -4
- package/lib/client/styles/content/code.scss +3 -3
- package/lib/client/styles/content/index.scss +0 -1
- package/lib/client/styles/external-link-icon.scss +1 -1
- package/lib/client/styles/normalize.scss +25 -24
- package/lib/client/styles/plugins.scss +2 -2
- package/lib/client/styles/vars-dark.scss +21 -47
- package/lib/client/styles/vars.scss +54 -154
- package/lib/client/typings.d.ts +3 -3
- package/lib/client/utils/resolveRepoType.d.ts +1 -1
- package/lib/client/utils/resolveRepoType.js +4 -4
- package/lib/node/defaultTheme.js +10 -18
- package/lib/node/utils/assignDefaultLocaleOptions.js +2 -6
- package/lib/node/utils/index.d.ts +1 -1
- package/lib/node/utils/index.js +1 -1
- package/lib/node/utils/resolveMarkdownHintLocales.d.ts +9 -0
- package/lib/node/utils/resolveMarkdownHintLocales.js +19 -0
- package/lib/shared/navbar.d.ts +1 -1
- package/lib/shared/options.d.ts +23 -13
- package/lib/shared/page.d.ts +4 -4
- package/lib/shared/sidebar.d.ts +1 -1
- package/package.json +21 -20
- package/templates/build.html +7 -7
- package/lib/client/styles/content/custom-container.scss +0 -142
- package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
- package/lib/node/utils/resolveContainerPluginOptions.js +0 -17
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { isLinkHttp } from 'vuepress/shared';
|
|
2
2
|
export const resolveRepoType = (repo) => {
|
|
3
|
-
if (!isLinkHttp(repo) ||
|
|
3
|
+
if (!isLinkHttp(repo) || repo.includes('github.com'))
|
|
4
4
|
return 'GitHub';
|
|
5
|
-
if (
|
|
5
|
+
if (repo.includes('bitbucket.org'))
|
|
6
6
|
return 'Bitbucket';
|
|
7
|
-
if (
|
|
7
|
+
if (repo.includes('gitlab.com'))
|
|
8
8
|
return 'GitLab';
|
|
9
|
-
if (
|
|
9
|
+
if (repo.includes('gitee.com'))
|
|
10
10
|
return 'Gitee';
|
|
11
11
|
return null;
|
|
12
12
|
};
|
package/lib/node/defaultTheme.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint-disable no-console */
|
|
1
2
|
import { addViteConfig, addViteOptimizeDepsExclude, chainWebpack, } from '@vuepress/helper';
|
|
2
3
|
import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links';
|
|
3
4
|
import { backToTopPlugin } from '@vuepress/plugin-back-to-top';
|
|
@@ -5,6 +6,7 @@ import { copyCodePlugin } from '@vuepress/plugin-copy-code';
|
|
|
5
6
|
import { gitPlugin } from '@vuepress/plugin-git';
|
|
6
7
|
import { linksCheckPlugin } from '@vuepress/plugin-links-check';
|
|
7
8
|
import { markdownContainerPlugin } from '@vuepress/plugin-markdown-container';
|
|
9
|
+
import { markdownHintPlugin } from '@vuepress/plugin-markdown-hint';
|
|
8
10
|
import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom';
|
|
9
11
|
import { nprogressPlugin } from '@vuepress/plugin-nprogress';
|
|
10
12
|
import { palettePlugin } from '@vuepress/plugin-palette';
|
|
@@ -14,7 +16,7 @@ import { sitemapPlugin } from '@vuepress/plugin-sitemap';
|
|
|
14
16
|
import { themeDataPlugin } from '@vuepress/plugin-theme-data';
|
|
15
17
|
import { isPlainObject } from 'vuepress/shared';
|
|
16
18
|
import { fs, getDirname, path } from 'vuepress/utils';
|
|
17
|
-
import { assignDefaultLocaleOptions,
|
|
19
|
+
import { assignDefaultLocaleOptions, resolveMarkdownHintLocales, } from './utils/index.js';
|
|
18
20
|
const __dirname = getDirname(import.meta.url);
|
|
19
21
|
export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } = {}) => {
|
|
20
22
|
assignDefaultLocaleOptions(localeOptions);
|
|
@@ -48,6 +50,7 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
|
|
|
48
50
|
sass: {
|
|
49
51
|
logger: {
|
|
50
52
|
warn: (message, { deprecation, deprecationType }) => {
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
51
54
|
if (deprecation && deprecationType.id === 'mixed-decls')
|
|
52
55
|
return;
|
|
53
56
|
console.warn(message);
|
|
@@ -57,6 +60,7 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
|
|
|
57
60
|
scss: {
|
|
58
61
|
logger: {
|
|
59
62
|
warn: (message, { deprecation, deprecationType }) => {
|
|
63
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
|
60
64
|
if (deprecation && deprecationType.id === 'mixed-decls')
|
|
61
65
|
return;
|
|
62
66
|
console.warn(message);
|
|
@@ -71,8 +75,8 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
|
|
|
71
75
|
.rule('scss')
|
|
72
76
|
.use('sass-loader')
|
|
73
77
|
.tap((options) => ({
|
|
74
|
-
api: 'modern-compiler',
|
|
75
78
|
...options,
|
|
79
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
|
|
76
80
|
sassOptions: {
|
|
77
81
|
silenceDeprecations: ['mixed-decls'],
|
|
78
82
|
...options.sassOptions,
|
|
@@ -111,20 +115,10 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
|
|
|
111
115
|
})
|
|
112
116
|
: [],
|
|
113
117
|
// @vuepress/plugin-markdown-container
|
|
114
|
-
themePlugins.
|
|
115
|
-
?
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
? markdownContainerPlugin(resolveMarkdownContainerPluginOptions(localeOptions, 'warning'))
|
|
119
|
-
: [],
|
|
120
|
-
themePlugins.container?.danger !== false
|
|
121
|
-
? markdownContainerPlugin(resolveMarkdownContainerPluginOptions(localeOptions, 'danger'))
|
|
122
|
-
: [],
|
|
123
|
-
themePlugins.container?.details !== false
|
|
124
|
-
? markdownContainerPlugin({
|
|
125
|
-
type: 'details',
|
|
126
|
-
before: (info) => `<details class="custom-container details">${info ? `<summary>${info}</summary>` : ''}\n`,
|
|
127
|
-
after: () => '</details>\n',
|
|
118
|
+
themePlugins.hint !== false
|
|
119
|
+
? markdownHintPlugin({
|
|
120
|
+
locales: resolveMarkdownHintLocales(localeOptions),
|
|
121
|
+
...(isPlainObject(themePlugins.hint) ? themePlugins.hint : {}),
|
|
128
122
|
})
|
|
129
123
|
: [],
|
|
130
124
|
themePlugins.container?.codeGroup !== false
|
|
@@ -158,8 +152,6 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
|
|
|
158
152
|
// @vuepress/plugin-medium-zoom
|
|
159
153
|
themePlugins.mediumZoom !== false
|
|
160
154
|
? mediumZoomPlugin({
|
|
161
|
-
selector: '.theme-default-content > img, .theme-default-content :not(a) > img',
|
|
162
|
-
zoomOptions: {},
|
|
163
155
|
// should greater than page transition duration
|
|
164
156
|
delay: 300,
|
|
165
157
|
})
|
|
@@ -39,16 +39,12 @@ export const DEFAULT_LOCALE_DATA = {
|
|
|
39
39
|
* Assign default options
|
|
40
40
|
*/
|
|
41
41
|
export const assignDefaultLocaleOptions = (localeOptions) => {
|
|
42
|
-
|
|
43
|
-
localeOptions.locales = {};
|
|
44
|
-
}
|
|
45
|
-
if (!localeOptions.locales['/']) {
|
|
46
|
-
localeOptions.locales['/'] = {};
|
|
47
|
-
}
|
|
42
|
+
localeOptions.locales ??= {};
|
|
48
43
|
Object.assign(localeOptions, {
|
|
49
44
|
...DEFAULT_LOCALE_OPTIONS,
|
|
50
45
|
...localeOptions,
|
|
51
46
|
});
|
|
47
|
+
localeOptions.locales['/'] ??= {};
|
|
52
48
|
Object.assign(localeOptions.locales['/'], {
|
|
53
49
|
...DEFAULT_LOCALE_DATA,
|
|
54
50
|
...localeOptions.locales['/'],
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './assignDefaultLocaleOptions.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './resolveMarkdownHintLocales.js';
|
package/lib/node/utils/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './assignDefaultLocaleOptions.js';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './resolveMarkdownHintLocales.js';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { MarkdownHintPluginLocaleData } from '@vuepress/plugin-markdown-hint';
|
|
2
|
+
import type { LocaleConfig } from 'vuepress/shared';
|
|
3
|
+
import type { DefaultThemeData } from '../../shared/index.js';
|
|
4
|
+
/**
|
|
5
|
+
* Resolve options for @vuepress/plugin-markdown-container
|
|
6
|
+
*
|
|
7
|
+
* For custom containers default title
|
|
8
|
+
*/
|
|
9
|
+
export declare const resolveMarkdownHintLocales: (localeOptions: DefaultThemeData) => LocaleConfig<MarkdownHintPluginLocaleData>;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve options for @vuepress/plugin-markdown-container
|
|
3
|
+
*
|
|
4
|
+
* For custom containers default title
|
|
5
|
+
*/
|
|
6
|
+
export const resolveMarkdownHintLocales = (localeOptions) => Object.entries(localeOptions.locales ?? {}).reduce((result, [key, value]) => {
|
|
7
|
+
result[key] = {};
|
|
8
|
+
if (value.tip)
|
|
9
|
+
result[key].tip = value.tip;
|
|
10
|
+
if (value.warning)
|
|
11
|
+
result[key].warning = value.warning;
|
|
12
|
+
if (value.danger)
|
|
13
|
+
result[key].caution = value.danger;
|
|
14
|
+
if (value.important)
|
|
15
|
+
result[key].important = value.important;
|
|
16
|
+
if (value.note)
|
|
17
|
+
result[key].note = value.note;
|
|
18
|
+
return result;
|
|
19
|
+
}, {});
|
package/lib/shared/navbar.d.ts
CHANGED
|
@@ -18,4 +18,4 @@ export interface NavGroup<T> extends NavItemOptions {
|
|
|
18
18
|
}
|
|
19
19
|
export type NavbarLinkOptions = AutoLinkOptions;
|
|
20
20
|
export type NavbarGroupOptions = NavGroup<NavbarLinkOptions | NavGroup<NavbarLinkOptions> | string>;
|
|
21
|
-
export type NavbarOptions = (
|
|
21
|
+
export type NavbarOptions = (NavbarGroupOptions | NavbarLinkOptions | string)[] | false;
|
package/lib/shared/options.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { BackToTopPluginOptions } from '@vuepress/plugin-back-to-top';
|
|
2
2
|
import type { CopyCodePluginOptions } from '@vuepress/plugin-copy-code';
|
|
3
3
|
import type { LinksCheckPluginOptions } from '@vuepress/plugin-links-check';
|
|
4
|
+
import type { MarkdownHintPluginOptions } from '@vuepress/plugin-markdown-hint';
|
|
4
5
|
import type { PrismjsPluginOptions } from '@vuepress/plugin-prismjs';
|
|
5
6
|
import type { SeoPluginOptions } from '@vuepress/plugin-seo';
|
|
6
7
|
import type { SitemapPluginOptions } from '@vuepress/plugin-sitemap';
|
|
@@ -21,10 +22,6 @@ export interface DefaultThemePluginsOptions {
|
|
|
21
22
|
* Enable @vuepress/plugin-markdown-container or not
|
|
22
23
|
*/
|
|
23
24
|
container?: {
|
|
24
|
-
tip?: boolean;
|
|
25
|
-
warning?: boolean;
|
|
26
|
-
danger?: boolean;
|
|
27
|
-
details?: boolean;
|
|
28
25
|
codeGroup?: boolean;
|
|
29
26
|
codeGroupItem?: boolean;
|
|
30
27
|
};
|
|
@@ -36,6 +33,7 @@ export interface DefaultThemePluginsOptions {
|
|
|
36
33
|
* Enable @vuepress/plugin-git or not
|
|
37
34
|
*/
|
|
38
35
|
git?: boolean;
|
|
36
|
+
hint?: MarkdownHintPluginOptions | boolean;
|
|
39
37
|
/**
|
|
40
38
|
* Enable @vuepress/plugin-links-check or not
|
|
41
39
|
*/
|
|
@@ -51,7 +49,7 @@ export interface DefaultThemePluginsOptions {
|
|
|
51
49
|
/**
|
|
52
50
|
* Enable @vuepress/plugin-prismjs or not
|
|
53
51
|
*/
|
|
54
|
-
prismjs?:
|
|
52
|
+
prismjs?: PrismjsPluginOptions | boolean;
|
|
55
53
|
/**
|
|
56
54
|
* Enable @vuepress/plugin-seo or not
|
|
57
55
|
*/
|
|
@@ -93,40 +91,40 @@ export interface DefaultThemeLocaleData extends LocaleData {
|
|
|
93
91
|
*
|
|
94
92
|
* Set to `false` to disable navbar in current locale
|
|
95
93
|
*/
|
|
96
|
-
navbar?:
|
|
94
|
+
navbar?: NavbarOptions | false;
|
|
97
95
|
/**
|
|
98
96
|
* Navbar label used for screen readers using the `aria-label` attribute
|
|
99
97
|
*/
|
|
100
|
-
navbarLabel?:
|
|
98
|
+
navbarLabel?: string | null;
|
|
101
99
|
/**
|
|
102
100
|
* Page navbar label used for screen readers using the `aria-label` attribute
|
|
103
101
|
*/
|
|
104
|
-
pageNavbarLabel?:
|
|
102
|
+
pageNavbarLabel?: string | null;
|
|
105
103
|
/**
|
|
106
104
|
* Navbar logo config
|
|
107
105
|
*
|
|
108
106
|
* Logo to display in navbar
|
|
109
107
|
*/
|
|
110
|
-
logo?:
|
|
108
|
+
logo?: string | null;
|
|
111
109
|
/**
|
|
112
110
|
* Navbar logo config for dark mode
|
|
113
111
|
*
|
|
114
112
|
* Logo to display in navbar in dark mode
|
|
115
113
|
*/
|
|
116
|
-
logoDark?:
|
|
114
|
+
logoDark?: string | null;
|
|
117
115
|
/**
|
|
118
116
|
* The alt text of navbar logo.
|
|
119
117
|
* Defaults to the site title if not specified.
|
|
120
118
|
* If the value is the same as the site title, the site title rendered in the navbar will be
|
|
121
119
|
* hidden from screen readers to avoid duplication.
|
|
122
120
|
*/
|
|
123
|
-
logoAlt?:
|
|
121
|
+
logoAlt?: string | null;
|
|
124
122
|
/**
|
|
125
123
|
* Navbar repository config
|
|
126
124
|
*
|
|
127
125
|
* Used for the repository link of navbar
|
|
128
126
|
*/
|
|
129
|
-
repo?:
|
|
127
|
+
repo?: string | null;
|
|
130
128
|
/**
|
|
131
129
|
* Navbar repository config
|
|
132
130
|
*
|
|
@@ -158,7 +156,7 @@ export interface DefaultThemeLocaleData extends LocaleData {
|
|
|
158
156
|
*
|
|
159
157
|
* Set to `false` to disable sidebar in current locale
|
|
160
158
|
*/
|
|
161
|
-
sidebar?:
|
|
159
|
+
sidebar?: SidebarOptions | false;
|
|
162
160
|
/**
|
|
163
161
|
* Sidebar depth
|
|
164
162
|
*
|
|
@@ -256,6 +254,18 @@ export interface DefaultThemeLocaleData extends LocaleData {
|
|
|
256
254
|
* Default title of DANGER custom block
|
|
257
255
|
*/
|
|
258
256
|
danger?: string;
|
|
257
|
+
/**
|
|
258
|
+
* Custom block config
|
|
259
|
+
*
|
|
260
|
+
* Default title of IMPORTANT custom block
|
|
261
|
+
*/
|
|
262
|
+
important?: string;
|
|
263
|
+
/**
|
|
264
|
+
* Custom block config
|
|
265
|
+
*
|
|
266
|
+
* Default title of NOTE custom block
|
|
267
|
+
*/
|
|
268
|
+
note?: string;
|
|
259
269
|
/**
|
|
260
270
|
* 404 page config
|
|
261
271
|
*
|
package/lib/shared/page.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { GitPluginPageData } from '@vuepress/plugin-git';
|
|
2
2
|
import type { AutoLinkConfig } from 'vuepress/client';
|
|
3
3
|
import type { SidebarArrayOptions } from './sidebar.js';
|
|
4
|
-
export interface DefaultThemePageData extends GitPluginPageData {
|
|
4
|
+
export interface DefaultThemePageData extends Partial<GitPluginPageData> {
|
|
5
5
|
filePathRelative: string | null;
|
|
6
6
|
}
|
|
7
7
|
export interface DefaultThemePageFrontmatter {
|
|
@@ -36,8 +36,8 @@ export interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFront
|
|
|
36
36
|
editLinkPattern?: string;
|
|
37
37
|
lastUpdated?: boolean;
|
|
38
38
|
contributors?: boolean;
|
|
39
|
-
sidebar?:
|
|
39
|
+
sidebar?: SidebarArrayOptions | 'heading' | false;
|
|
40
40
|
sidebarDepth?: number;
|
|
41
|
-
prev?:
|
|
42
|
-
next?:
|
|
41
|
+
prev?: AutoLinkConfig | string;
|
|
42
|
+
next?: AutoLinkConfig | string;
|
|
43
43
|
}
|
package/lib/shared/sidebar.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export interface SidebarGroupOptions extends NavItemOptions {
|
|
|
20
20
|
*/
|
|
21
21
|
children: SidebarItemOptions[];
|
|
22
22
|
}
|
|
23
|
-
export type SidebarItemOptions =
|
|
23
|
+
export type SidebarItemOptions = SidebarGroupOptions | SidebarLinkOptions | string;
|
|
24
24
|
export type SidebarArrayOptions = SidebarItemOptions[];
|
|
25
25
|
export type SidebarObjectOptions = Record<string, SidebarArrayOptions | 'heading' | false>;
|
|
26
26
|
export type SidebarOptions = SidebarArrayOptions | SidebarObjectOptions | 'heading';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vuepress/theme-default",
|
|
3
|
-
"version": "2.0.0-rc.
|
|
3
|
+
"version": "2.0.0-rc.42",
|
|
4
4
|
"description": "Default theme of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-theme",
|
|
@@ -37,27 +37,28 @@
|
|
|
37
37
|
"templates"
|
|
38
38
|
],
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@vuepress/helper": "2.0.0-rc.
|
|
41
|
-
"@vuepress/plugin-active-header-links": "2.0.0-rc.
|
|
42
|
-
"@vuepress/plugin-back-to-top": "2.0.0-rc.
|
|
43
|
-
"@vuepress/plugin-copy-code": "2.0.0-rc.
|
|
44
|
-
"@vuepress/plugin-git": "2.0.0-rc.
|
|
45
|
-
"@vuepress/plugin-links-check": "2.0.0-rc.
|
|
46
|
-
"@vuepress/plugin-markdown-container": "2.0.0-rc.
|
|
47
|
-
"@vuepress/plugin-
|
|
48
|
-
"@vuepress/plugin-
|
|
49
|
-
"@vuepress/plugin-
|
|
50
|
-
"@vuepress/plugin-
|
|
51
|
-
"@vuepress/plugin-
|
|
52
|
-
"@vuepress/plugin-
|
|
53
|
-
"@vuepress/plugin-
|
|
54
|
-
"@
|
|
40
|
+
"@vuepress/helper": "2.0.0-rc.42",
|
|
41
|
+
"@vuepress/plugin-active-header-links": "2.0.0-rc.42",
|
|
42
|
+
"@vuepress/plugin-back-to-top": "2.0.0-rc.42",
|
|
43
|
+
"@vuepress/plugin-copy-code": "2.0.0-rc.42",
|
|
44
|
+
"@vuepress/plugin-git": "2.0.0-rc.42",
|
|
45
|
+
"@vuepress/plugin-links-check": "2.0.0-rc.42",
|
|
46
|
+
"@vuepress/plugin-markdown-container": "2.0.0-rc.42",
|
|
47
|
+
"@vuepress/plugin-markdown-hint": "2.0.0-rc.42",
|
|
48
|
+
"@vuepress/plugin-medium-zoom": "2.0.0-rc.42",
|
|
49
|
+
"@vuepress/plugin-nprogress": "2.0.0-rc.42",
|
|
50
|
+
"@vuepress/plugin-palette": "2.0.0-rc.42",
|
|
51
|
+
"@vuepress/plugin-prismjs": "2.0.0-rc.42",
|
|
52
|
+
"@vuepress/plugin-seo": "2.0.0-rc.42",
|
|
53
|
+
"@vuepress/plugin-sitemap": "2.0.0-rc.42",
|
|
54
|
+
"@vuepress/plugin-theme-data": "2.0.0-rc.42",
|
|
55
|
+
"@vueuse/core": "^11.0.1",
|
|
55
56
|
"sass": "^1.77.8",
|
|
56
|
-
"vue": "^3.4.
|
|
57
|
+
"vue": "^3.4.38"
|
|
57
58
|
},
|
|
58
59
|
"peerDependencies": {
|
|
59
|
-
"sass-loader": "^
|
|
60
|
-
"vuepress": "2.0.0-rc.
|
|
60
|
+
"sass-loader": "^16.0.0",
|
|
61
|
+
"vuepress": "2.0.0-rc.15"
|
|
61
62
|
},
|
|
62
63
|
"peerDependenciesMeta": {
|
|
63
64
|
"sass-loader": {
|
|
@@ -67,5 +68,5 @@
|
|
|
67
68
|
"publishConfig": {
|
|
68
69
|
"access": "public"
|
|
69
70
|
},
|
|
70
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "66e494405a7fbb02f6d46d7be670ec69605b7606"
|
|
71
72
|
}
|
package/templates/build.html
CHANGED
|
@@ -6,28 +6,28 @@
|
|
|
6
6
|
<meta name="generator" content="VuePress {{ version }}" />
|
|
7
7
|
<style>
|
|
8
8
|
:root {
|
|
9
|
-
--c-bg: #fff;
|
|
9
|
+
--vp-c-bg: #fff;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
--c-bg: #22272e;
|
|
12
|
+
[data-theme='dark'] {
|
|
13
|
+
--vp-c-bg: #22272e;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
html,
|
|
17
17
|
body {
|
|
18
|
-
background-color: var(--c-bg);
|
|
18
|
+
background-color: var(--vp-c-bg);
|
|
19
19
|
}
|
|
20
20
|
</style>
|
|
21
21
|
<script>
|
|
22
22
|
const userMode = localStorage.getItem('vuepress-color-scheme')
|
|
23
23
|
const systemDarkMode =
|
|
24
|
-
|
|
25
|
-
|
|
24
|
+
'matchMedia' in window
|
|
25
|
+
? window.matchMedia('(prefers-color-scheme: dark)').matches
|
|
26
|
+
: false
|
|
26
27
|
|
|
27
28
|
if (userMode === 'light') {
|
|
28
29
|
document.documentElement.dataset.theme = 'light'
|
|
29
30
|
} else if (userMode === 'dark' || systemDarkMode) {
|
|
30
|
-
document.documentElement.classList.toggle('dark', true)
|
|
31
31
|
document.documentElement.dataset.theme = 'dark'
|
|
32
32
|
}
|
|
33
33
|
</script>
|
|
@@ -1,142 +0,0 @@
|
|
|
1
|
-
.custom-container {
|
|
2
|
-
transition:
|
|
3
|
-
color var(--t-color),
|
|
4
|
-
border-color var(--t-color),
|
|
5
|
-
background-color var(--t-color);
|
|
6
|
-
|
|
7
|
-
.custom-container-title {
|
|
8
|
-
font-weight: 600;
|
|
9
|
-
|
|
10
|
-
&:not(:only-child) {
|
|
11
|
-
margin-bottom: -0.4rem;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
&.tip,
|
|
16
|
-
&.warning,
|
|
17
|
-
&.danger {
|
|
18
|
-
margin: 1rem 0;
|
|
19
|
-
padding: 0.1rem 1.5rem;
|
|
20
|
-
border-left-width: 0.5rem;
|
|
21
|
-
border-left-style: solid;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
&.tip {
|
|
25
|
-
border-color: var(--c-tip);
|
|
26
|
-
background-color: var(--c-tip-bg);
|
|
27
|
-
color: var(--c-tip-text);
|
|
28
|
-
|
|
29
|
-
.custom-container-title {
|
|
30
|
-
color: var(--c-tip-title);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
a {
|
|
34
|
-
color: var(--c-tip-text-accent);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
code {
|
|
38
|
-
background-color: var(--c-bg-dark);
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
&.warning {
|
|
43
|
-
--external-link-icon-color: var(--c-warning-text-quote);
|
|
44
|
-
|
|
45
|
-
border-color: var(--c-warning);
|
|
46
|
-
background-color: var(--c-warning-bg);
|
|
47
|
-
color: var(--c-warning-text);
|
|
48
|
-
|
|
49
|
-
.custom-container-title {
|
|
50
|
-
color: var(--c-warning-title);
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
a {
|
|
54
|
-
color: var(--c-warning-text-accent);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
blockquote {
|
|
58
|
-
border-left-color: var(--c-warning-border-dark);
|
|
59
|
-
color: var(--c-warning-text-quote);
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
code {
|
|
63
|
-
background-color: var(--c-warning-bg-light);
|
|
64
|
-
color: var(--c-warning-text-light);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
details {
|
|
68
|
-
background-color: var(--c-warning-details-bg);
|
|
69
|
-
|
|
70
|
-
code {
|
|
71
|
-
background-color: var(--c-warning-bg-lighter);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
&.danger {
|
|
77
|
-
--external-link-icon-color: var(--c-danger-text-quote);
|
|
78
|
-
|
|
79
|
-
border-color: var(--c-danger);
|
|
80
|
-
background-color: var(--c-danger-bg);
|
|
81
|
-
color: var(--c-danger-text);
|
|
82
|
-
|
|
83
|
-
.custom-container-title {
|
|
84
|
-
color: var(--c-danger-title);
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
a {
|
|
88
|
-
color: var(--c-danger-text-accent);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
blockquote {
|
|
92
|
-
border-left-color: var(--c-danger-border-dark);
|
|
93
|
-
color: var(--c-danger-text-quote);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
code {
|
|
97
|
-
background-color: var(--c-danger-bg-light);
|
|
98
|
-
color: var(--c-danger-text-light);
|
|
99
|
-
}
|
|
100
|
-
|
|
101
|
-
details {
|
|
102
|
-
background-color: var(--c-danger-details-bg);
|
|
103
|
-
|
|
104
|
-
code {
|
|
105
|
-
background-color: var(--c-danger-bg-lighter);
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
&.details {
|
|
111
|
-
position: relative;
|
|
112
|
-
|
|
113
|
-
display: block;
|
|
114
|
-
|
|
115
|
-
margin: 1.6em 0;
|
|
116
|
-
padding: 1.6em;
|
|
117
|
-
border-radius: 2px;
|
|
118
|
-
|
|
119
|
-
background-color: var(--c-details-bg);
|
|
120
|
-
|
|
121
|
-
code {
|
|
122
|
-
background-color: var(--c-bg-darker);
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
h4 {
|
|
126
|
-
margin-top: 0;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
figure,
|
|
130
|
-
p {
|
|
131
|
-
&:last-child {
|
|
132
|
-
margin-bottom: 0;
|
|
133
|
-
padding-bottom: 0;
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
summary {
|
|
138
|
-
outline: none;
|
|
139
|
-
cursor: pointer;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { MarkdownContainerPluginOptions } from '@vuepress/plugin-markdown-container';
|
|
2
|
-
import type { DefaultThemeData } from '../../shared/index.js';
|
|
3
|
-
/**
|
|
4
|
-
* Resolve options for @vuepress/plugin-markdown-container
|
|
5
|
-
*
|
|
6
|
-
* For custom containers default title
|
|
7
|
-
*/
|
|
8
|
-
export declare const resolveMarkdownContainerPluginOptions: (localeOptions: DefaultThemeData, type: "tip" | "warning" | "danger") => MarkdownContainerPluginOptions;
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve options for @vuepress/plugin-markdown-container
|
|
3
|
-
*
|
|
4
|
-
* For custom containers default title
|
|
5
|
-
*/
|
|
6
|
-
export const resolveMarkdownContainerPluginOptions = (localeOptions, type) => {
|
|
7
|
-
const locales = Object.entries(localeOptions.locales || {}).reduce((result, [key, value]) => {
|
|
8
|
-
result[key] = {
|
|
9
|
-
defaultInfo: value?.[type] ?? localeOptions[type],
|
|
10
|
-
};
|
|
11
|
-
return result;
|
|
12
|
-
}, {});
|
|
13
|
-
return {
|
|
14
|
-
type,
|
|
15
|
-
locales,
|
|
16
|
-
};
|
|
17
|
-
};
|