@vuepress/theme-default 2.0.0-rc.3 → 2.0.0-rc.31

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 (54) hide show
  1. package/lib/client/components/HomeHero.vue +2 -2
  2. package/lib/client/components/Navbar.vue +10 -9
  3. package/lib/client/components/NavbarBrand.vue +3 -2
  4. package/lib/client/components/NavbarDropdown.vue +4 -5
  5. package/lib/client/components/NavbarItems.vue +36 -37
  6. package/lib/client/components/PageMeta.vue +123 -27
  7. package/lib/client/components/PageNav.vue +133 -27
  8. package/lib/client/components/SidebarItem.vue +2 -3
  9. package/lib/client/components/SidebarItems.vue +1 -1
  10. package/lib/client/composables/index.d.ts +1 -0
  11. package/lib/client/composables/index.js +1 -0
  12. package/lib/client/composables/useNavigate.d.ts +1 -0
  13. package/lib/client/composables/useNavigate.js +25 -0
  14. package/lib/client/composables/useSidebarItems.d.ts +3 -4
  15. package/lib/client/composables/useSidebarItems.js +10 -12
  16. package/lib/client/composables/useUpdateDeviceStatus.js +5 -4
  17. package/lib/client/config.js +7 -11
  18. package/lib/client/index.d.ts +1 -1
  19. package/lib/client/index.js +0 -1
  20. package/lib/client/layouts/Layout.vue +10 -2
  21. package/lib/client/layouts/NotFound.vue +2 -2
  22. package/lib/client/shim.d.ts +3 -3
  23. package/lib/client/styles/arrow.scss +18 -24
  24. package/lib/client/styles/code.scss +105 -9
  25. package/lib/client/styles/custom-container.scss +4 -8
  26. package/lib/client/styles/external-link-icon.scss +33 -0
  27. package/lib/client/styles/index.scss +1 -0
  28. package/lib/client/styles/layout.scss +4 -0
  29. package/lib/client/styles/navbar-dropdown.scss +2 -2
  30. package/lib/client/styles/navbar.scss +4 -4
  31. package/lib/client/styles/normalize.scss +1 -1
  32. package/lib/client/styles/page.scss +0 -76
  33. package/lib/client/styles/sidebar.scss +1 -1
  34. package/lib/client/styles/vars-dark.scss +7 -0
  35. package/lib/client/styles/vars.scss +69 -14
  36. package/lib/client/utils/getNavLink.d.ts +3 -9
  37. package/lib/client/utils/getNavLink.js +10 -11
  38. package/lib/client/utils/index.d.ts +0 -1
  39. package/lib/client/utils/index.js +0 -1
  40. package/lib/client/utils/isActiveSidebarItem.d.ts +1 -1
  41. package/lib/client/utils/resolveEditLink.d.ts +1 -1
  42. package/lib/node/defaultTheme.js +31 -23
  43. package/lib/node/index.d.ts +2 -1
  44. package/lib/node/index.js +1 -1
  45. package/lib/node/utils/resolveContainerPluginOptions.d.ts +3 -3
  46. package/lib/node/utils/resolveContainerPluginOptions.js +2 -2
  47. package/lib/shared/nav.d.ts +3 -11
  48. package/lib/shared/options.d.ts +27 -5
  49. package/lib/shared/page.d.ts +5 -3
  50. package/package.json +21 -20
  51. package/templates/build.html +13 -10
  52. package/lib/client/components/AutoLink.vue +0 -113
  53. package/lib/client/utils/getResolveRouteWithRedirect.d.ts +0 -5
  54. package/lib/client/utils/getResolveRouteWithRedirect.js +0 -22
@@ -1,5 +1,4 @@
1
1
  @import '_mixins';
2
- @import '_variables';
3
2
 
4
3
  .page {
5
4
  padding-bottom: 2rem;
@@ -10,78 +9,3 @@
10
9
  padding-top: 0;
11
10
  }
12
11
  }
13
-
14
- .page-meta {
15
- @include content_wrapper;
16
- padding-top: 1rem;
17
- padding-bottom: 1rem;
18
- overflow: auto;
19
-
20
- .meta-item {
21
- cursor: default;
22
- margin-top: 0.8rem;
23
-
24
- .meta-item-label {
25
- font-weight: 500;
26
- color: var(--c-text-lighter);
27
- }
28
-
29
- .meta-item-info {
30
- font-weight: 400;
31
- color: var(--c-text-quote);
32
- }
33
- }
34
-
35
- .edit-link {
36
- display: inline-block;
37
- margin-right: 0.25rem;
38
-
39
- @media print {
40
- display: none;
41
- }
42
- }
43
-
44
- .last-updated {
45
- float: right;
46
- }
47
- }
48
-
49
- @media (max-width: $MQMobile) {
50
- .page-meta {
51
- .last-updated {
52
- font-size: 0.8em;
53
- float: none;
54
- }
55
-
56
- .contributors {
57
- font-size: 0.8em;
58
- }
59
- }
60
- }
61
-
62
- .page-nav {
63
- @include content_wrapper;
64
- padding-top: 1rem;
65
- padding-bottom: 0;
66
-
67
- .inner {
68
- min-height: 2rem;
69
- margin-top: 0;
70
- border-top: 1px solid var(--c-border);
71
- transition: border-color var(--t-color);
72
- padding-top: 1rem;
73
- overflow: auto;
74
- }
75
-
76
- .prev {
77
- a:before {
78
- content: '←';
79
- }
80
- }
81
- .next {
82
- float: right;
83
- a:after {
84
- content: '→';
85
- }
86
- }
87
- }
@@ -43,7 +43,7 @@
43
43
  .navbar-dropdown-wrapper
44
44
  .navbar-dropdown
45
45
  .navbar-dropdown-item
46
- a.router-link-active::after {
46
+ a.route-link-active::after {
47
47
  top: calc(1rem - 2px);
48
48
  }
49
49
  }
@@ -66,3 +66,10 @@ html.dark .DocSearch {
66
66
  --docsearch-footer-shadow: inset 0 1px 0 0 rgba(73, 76, 106, 0.5),
67
67
  0 -4px 8px 0 rgba(0, 0, 0, 0.2);
68
68
  }
69
+
70
+ // plugin-pwa
71
+ html.dark body {
72
+ --pwa-shadow-color: rgb(0 0 0 / 30%);
73
+ --pwa-content-color: #ccc;
74
+ --pwa-content-light-color: #999;
75
+ }
@@ -75,6 +75,12 @@
75
75
  // code blocks vars
76
76
  --code-bg-color: #282c34;
77
77
  --code-hl-bg-color: rgba(0, 0, 0, 0.66);
78
+ --code-hl-error-bg-color: rgba(244, 63, 94, 0.16);
79
+ --code-hl-warning-bg-color: rgba(255, 193, 7, 0.16);
80
+ --code-line-diff-remove-color: rgba(244, 63, 94, 0.16);
81
+ --code-line-diff-remove-symbol-color: #e0575b;
82
+ --code-line-diff-add-color: rgba(16, 185, 129, 0.16);
83
+ --code-line-diff-add-symbol-color: #298459;
78
84
  --code-ln-color: #9e9e9e;
79
85
  --code-ln-wrapper-width: 3.5rem;
80
86
 
@@ -91,12 +97,37 @@
91
97
  --sidebar-width-mobile: calc(var(--sidebar-width) * 0.82);
92
98
  --content-width: 740px;
93
99
  --homepage-width: 960px;
100
+
101
+ // external-link-icon
102
+ --external-link-icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");
103
+ --external-link-icon-color: var(--c-text-quote);
94
104
  }
95
105
 
96
106
  // plugin-back-to-top
97
- .back-to-top {
107
+ .vp-back-to-top-button {
98
108
  --back-to-top-color: var(--c-brand);
99
109
  --back-to-top-color-hover: var(--c-brand-light);
110
+ --back-to-top-bg-color: var(--c-bg);
111
+ }
112
+
113
+ // plugin-catalog
114
+ .vp-catalog-wrapper {
115
+ --catalog-bg-color: var(--c-bg);
116
+ --catalog-bg-secondary-color: var(--c-bg-dark);
117
+ --catalog-border-color: var(--c-border);
118
+ --catalog-active-color: var(--c-brand);
119
+ --catalog-hover-color: var(--c-brand-light);
120
+ }
121
+
122
+ // plugin-comment
123
+ .waline-wrapper {
124
+ --waline-bg-color: var(--c-bg);
125
+ --waline-bg-color-light: var(--c-bg-light);
126
+ --waline-text-color: var(--c-color);
127
+ --waline-border: 1px solid var(--c-border);
128
+ --waline-border-color: var(--c-border);
129
+ --waline-theme-color: var(--c-brand);
130
+ --waline-active-color: var(--c-brand-light);
100
131
  }
101
132
 
102
133
  // plugin-docsearch
@@ -117,30 +148,54 @@
117
148
  --docsearch-footer-background: var(--c-bg);
118
149
  }
119
150
 
120
- // plugin-external-link-icon
121
- .external-link-icon {
122
- --external-link-icon-color: var(--c-text-quote);
123
- }
124
-
125
151
  // plugin-medium-zoom
126
152
  .medium-zoom-overlay {
127
153
  --medium-zoom-bg-color: var(--c-bg);
128
154
  }
129
155
 
156
+ // plugin-notice
157
+ .vp-notice-wrapper {
158
+ --notice-color: var(--c-text);
159
+ --notice-bg-color: var(--c-bg);
160
+
161
+ --notice-primary-color: var(--c-brand);
162
+ --notice-primary-text-color: var(--c-bg);
163
+ --notice-primary-hover-color: var(--c-brand-light);
164
+
165
+ --notice-button-color: var(--c-bg-light);
166
+ --notice-button-hover-color: var(--c-bg-lighter);
167
+ }
168
+
130
169
  // plugin-nprogress
131
170
  #nprogress {
132
171
  --nprogress-color: var(--c-brand);
133
172
  }
134
173
 
174
+ // plugin-photo-swipe
175
+ body {
176
+ --photo-swipe-bullet: var(--c-bg);
177
+ --photo-swipe-bullet-active: var(--c-brand);
178
+ }
179
+
135
180
  // plugin-pwa-popup
136
- .pwa-popup {
137
- --pwa-popup-text-color: var(--c-text);
138
- --pwa-popup-bg-color: var(--c-bg);
139
- --pwa-popup-border-color: var(--c-brand);
140
- --pwa-popup-shadow: 0 4px 16px var(--c-brand);
141
- --pwa-popup-btn-text-color: var(--c-bg);
142
- --pwa-popup-btn-bg-color: var(--c-brand);
143
- --pwa-popup-btn-hover-bg-color: var(--c-brand-light);
181
+ body {
182
+ --pwa-text-color: var(--c-text);
183
+ --pwa-bg-color: var(--c-bg);
184
+ --pwa-border-color: var(--c-brand);
185
+ --pwa-btn-text-color: var(--c-bg);
186
+ --pwa-btn-bg-color: var(--c-brand);
187
+ --pwa-btn-hover-bg-color: var(--c-brand-light);
188
+ }
189
+
190
+ // plugin-redirect
191
+ .redirect-modal-mask {
192
+ --redirect-bg-color: var(--c-bg);
193
+ --redirect-bg-color-light: var(--c-bg-light);
194
+ --redirect-bg-color-lighter: var(--c-bg-lighter);
195
+ --redirect-text-color: var(--c-text);
196
+ --redirect-primary-color: var(--c-brand);
197
+ --redirect-primary-hover-color: var(--c-brand-light);
198
+ --redirect-primary-text-color: var(--c-bg);
144
199
  }
145
200
 
146
201
  // plugin-search
@@ -1,15 +1,9 @@
1
- import type { Router } from 'vue-router';
2
- import type { NavLink } from '../../shared/index.js';
3
- declare module 'vue-router' {
4
- interface RouteMeta {
5
- title?: string;
6
- }
7
- }
1
+ import type { AutoLinkConfig } from 'vuepress/client';
8
2
  /**
9
- * Resolve NavLink props from string
3
+ * Resolve AutoLink props from string
10
4
  *
11
5
  * @example
12
6
  * - Input: '/README.md'
13
7
  * - Output: { text: 'Home', link: '/' }
14
8
  */
15
- export declare const getNavLink: (router: Router, item: string) => NavLink;
9
+ export declare const getAutoLink: (config: string) => AutoLinkConfig;
@@ -1,18 +1,17 @@
1
- import { getResolveRouteWithRedirect } from './getResolveRouteWithRedirect.js';
1
+ import { resolveRoute } from 'vuepress/client';
2
2
  /**
3
- * Resolve NavLink props from string
3
+ * Resolve AutoLink props from string
4
4
  *
5
5
  * @example
6
6
  * - Input: '/README.md'
7
7
  * - Output: { text: 'Home', link: '/' }
8
8
  */
9
- export const getNavLink = (router, item) => {
10
- // the route path of vue-router is url-encoded, and we expect users are using
11
- // non-url-encoded string in theme config, so we need to url-encode it first to
12
- // resolve the route correctly
13
- const resolved = getResolveRouteWithRedirect(router, encodeURI(item));
14
- return {
15
- text: resolved.meta.title || item,
16
- link: resolved.name === '404' ? item : resolved.fullPath,
17
- };
9
+ export const getAutoLink = (config) => {
10
+ const { notFound, meta, path } = resolveRoute(config);
11
+ return notFound
12
+ ? { text: path, link: path }
13
+ : {
14
+ text: meta.title || path,
15
+ link: path,
16
+ };
18
17
  };
@@ -1,5 +1,4 @@
1
1
  export * from './getNavLink.js';
2
- export * from './getResolveRouteWithRedirect.js';
3
2
  export * from './isActiveSidebarItem.js';
4
3
  export * from './resolveEditLink.js';
5
4
  export * from './resolveRepoType.js';
@@ -1,5 +1,4 @@
1
1
  export * from './getNavLink.js';
2
- export * from './getResolveRouteWithRedirect.js';
3
2
  export * from './isActiveSidebarItem.js';
4
3
  export * from './resolveEditLink.js';
5
4
  export * from './resolveRepoType.js';
@@ -1,3 +1,3 @@
1
- import type { RouteLocationNormalizedLoaded } from 'vue-router';
1
+ import type { RouteLocationNormalizedLoaded } from 'vuepress/client';
2
2
  import type { ResolvedSidebarItem } from '../../shared/index.js';
3
3
  export declare const isActiveSidebarItem: (item: ResolvedSidebarItem, route: RouteLocationNormalizedLoaded) => boolean;
@@ -5,5 +5,5 @@ export declare const resolveEditLink: ({ docsRepo, docsBranch, docsDir, filePath
5
5
  docsBranch: string;
6
6
  docsDir: string;
7
7
  filePathRelative: string | null;
8
- editLinkPattern?: string | undefined;
8
+ editLinkPattern?: string;
9
9
  }) => string | null;
@@ -1,8 +1,9 @@
1
1
  import { activeHeaderLinksPlugin } from '@vuepress/plugin-active-header-links';
2
2
  import { backToTopPlugin } from '@vuepress/plugin-back-to-top';
3
- import { containerPlugin } from '@vuepress/plugin-container';
4
- import { externalLinkIconPlugin } from '@vuepress/plugin-external-link-icon';
3
+ import { copyCodePlugin } from '@vuepress/plugin-copy-code';
5
4
  import { gitPlugin } from '@vuepress/plugin-git';
5
+ import { linksCheckPlugin } from '@vuepress/plugin-links-check';
6
+ import { markdownContainerPlugin } from '@vuepress/plugin-markdown-container';
6
7
  import { mediumZoomPlugin } from '@vuepress/plugin-medium-zoom';
7
8
  import { nprogressPlugin } from '@vuepress/plugin-nprogress';
8
9
  import { palettePlugin } from '@vuepress/plugin-palette';
@@ -12,7 +13,7 @@ import { sitemapPlugin } from '@vuepress/plugin-sitemap';
12
13
  import { themeDataPlugin } from '@vuepress/plugin-theme-data';
13
14
  import { isPlainObject } from 'vuepress/shared';
14
15
  import { fs, getDirname, path } from 'vuepress/utils';
15
- import { assignDefaultLocaleOptions, resolveContainerPluginOptions, } from './utils/index.js';
16
+ import { assignDefaultLocaleOptions, resolveMarkdownContainerPluginOptions, } from './utils/index.js';
16
17
  const __dirname = getDirname(import.meta.url);
17
18
  export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } = {}) => {
18
19
  assignDefaultLocaleOptions(localeOptions);
@@ -47,49 +48,48 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
47
48
  })
48
49
  : [],
49
50
  // @vuepress/plugin-back-to-top
50
- themePlugins.backToTop !== false ? backToTopPlugin() : [],
51
- // @vuepress/plugin-container
51
+ themePlugins.backToTop !== false
52
+ ? backToTopPlugin(isPlainObject(themePlugins.backToTop) ? themePlugins.backToTop : {})
53
+ : [],
54
+ // @vuepress/plugin-copy-code
55
+ themePlugins.copyCode !== false
56
+ ? copyCodePlugin({
57
+ ...(isPlainObject(themePlugins.copyCode)
58
+ ? themePlugins.copyCode
59
+ : {}),
60
+ })
61
+ : [],
62
+ // @vuepress/plugin-markdown-container
52
63
  themePlugins.container?.tip !== false
53
- ? containerPlugin(resolveContainerPluginOptions(localeOptions, 'tip'))
64
+ ? markdownContainerPlugin(resolveMarkdownContainerPluginOptions(localeOptions, 'tip'))
54
65
  : [],
55
66
  themePlugins.container?.warning !== false
56
- ? containerPlugin(resolveContainerPluginOptions(localeOptions, 'warning'))
67
+ ? markdownContainerPlugin(resolveMarkdownContainerPluginOptions(localeOptions, 'warning'))
57
68
  : [],
58
69
  themePlugins.container?.danger !== false
59
- ? containerPlugin(resolveContainerPluginOptions(localeOptions, 'danger'))
70
+ ? markdownContainerPlugin(resolveMarkdownContainerPluginOptions(localeOptions, 'danger'))
60
71
  : [],
61
72
  themePlugins.container?.details !== false
62
- ? containerPlugin({
73
+ ? markdownContainerPlugin({
63
74
  type: 'details',
64
75
  before: (info) => `<details class="custom-container details">${info ? `<summary>${info}</summary>` : ''}\n`,
65
76
  after: () => '</details>\n',
66
77
  })
67
78
  : [],
68
79
  themePlugins.container?.codeGroup !== false
69
- ? containerPlugin({
80
+ ? markdownContainerPlugin({
70
81
  type: 'code-group',
71
82
  before: () => `<CodeGroup>\n`,
72
83
  after: () => '</CodeGroup>\n',
73
84
  })
74
85
  : [],
75
86
  themePlugins.container?.codeGroupItem !== false
76
- ? containerPlugin({
87
+ ? markdownContainerPlugin({
77
88
  type: 'code-group-item',
78
89
  before: (info) => `<CodeGroupItem title="${info}">\n`,
79
90
  after: () => '</CodeGroupItem>\n',
80
91
  })
81
92
  : [],
82
- // @vuepress/plugin-external-link-icon
83
- themePlugins.externalLinkIcon !== false
84
- ? externalLinkIconPlugin({
85
- locales: Object.entries(localeOptions.locales || {}).reduce((result, [key, value]) => {
86
- result[key] = {
87
- openInNewWindow: value.openInNewWindow ?? localeOptions.openInNewWindow,
88
- };
89
- return result;
90
- }, {}),
91
- })
92
- : [],
93
93
  // @vuepress/plugin-git
94
94
  themePlugins.git !== false
95
95
  ? gitPlugin({
@@ -98,6 +98,12 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
98
98
  contributors: localeOptions.contributors !== false,
99
99
  })
100
100
  : [],
101
+ // @vuepress/plugin-links-check
102
+ themePlugins.linksCheck !== false
103
+ ? linksCheckPlugin(isPlainObject(themePlugins.linksCheck)
104
+ ? themePlugins.linksCheck
105
+ : {})
106
+ : [],
101
107
  // @vuepress/plugin-medium-zoom
102
108
  themePlugins.mediumZoom !== false
103
109
  ? mediumZoomPlugin({
@@ -112,7 +118,9 @@ export const defaultTheme = ({ hostname, themePlugins = {}, ...localeOptions } =
112
118
  // @vuepress/plugin-palette
113
119
  palettePlugin({ preset: 'sass' }),
114
120
  // @vuepress/plugin-prismjs
115
- themePlugins.prismjs !== false ? prismjsPlugin() : [],
121
+ themePlugins.prismjs !== false
122
+ ? prismjsPlugin(isPlainObject(themePlugins.prismjs) ? themePlugins.prismjs : {})
123
+ : [],
116
124
  // @vuepress/plugin-seo
117
125
  hostname && themePlugins.seo !== false
118
126
  ? seoPlugin({
@@ -1,5 +1,6 @@
1
1
  import { defaultTheme } from './defaultTheme.js';
2
- export * from '../shared/index.js';
3
2
  export * from './defaultTheme.js';
4
3
  export * from './utils/index.js';
4
+ export type * from '../shared/index.js';
5
+ /** @deprecated Use named export instead */
5
6
  export default defaultTheme;
package/lib/node/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defaultTheme } from './defaultTheme.js';
2
- export * from '../shared/index.js';
3
2
  export * from './defaultTheme.js';
4
3
  export * from './utils/index.js';
4
+ /** @deprecated Use named export instead */
5
5
  export default defaultTheme;
@@ -1,8 +1,8 @@
1
- import type { ContainerPluginOptions } from '@vuepress/plugin-container';
1
+ import type { MarkdownContainerPluginOptions } from '@vuepress/plugin-markdown-container';
2
2
  import type { DefaultThemeData } from '../../shared/index.js';
3
3
  /**
4
- * Resolve options for @vuepress/plugin-container
4
+ * Resolve options for @vuepress/plugin-markdown-container
5
5
  *
6
6
  * For custom containers default title
7
7
  */
8
- export declare const resolveContainerPluginOptions: (localeOptions: DefaultThemeData, type: 'tip' | 'warning' | 'danger') => ContainerPluginOptions;
8
+ export declare const resolveMarkdownContainerPluginOptions: (localeOptions: DefaultThemeData, type: 'tip' | 'warning' | 'danger') => MarkdownContainerPluginOptions;
@@ -1,9 +1,9 @@
1
1
  /**
2
- * Resolve options for @vuepress/plugin-container
2
+ * Resolve options for @vuepress/plugin-markdown-container
3
3
  *
4
4
  * For custom containers default title
5
5
  */
6
- export const resolveContainerPluginOptions = (localeOptions, type) => {
6
+ export const resolveMarkdownContainerPluginOptions = (localeOptions, type) => {
7
7
  const locales = Object.entries(localeOptions.locales || {}).reduce((result, [key, value]) => {
8
8
  result[key] = {
9
9
  defaultInfo: value?.[type] ?? localeOptions[type],
@@ -1,3 +1,4 @@
1
+ import type { AutoLinkConfig } from 'vuepress/client';
1
2
  /**
2
3
  * Base nav item, displayed as text
3
4
  */
@@ -11,26 +12,17 @@ export interface NavItem {
11
12
  export interface NavGroup<T> extends NavItem {
12
13
  children: T[];
13
14
  }
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
15
  /**
24
16
  * Navbar types
25
17
  */
26
- export type NavbarItem = NavLink;
18
+ export type NavbarItem = AutoLinkConfig;
27
19
  export type NavbarGroup = NavGroup<NavbarGroup | NavbarItem | string>;
28
20
  export type NavbarConfig = (NavbarItem | NavbarGroup | string)[];
29
21
  export type ResolvedNavbarItem = NavbarItem | NavGroup<ResolvedNavbarItem>;
30
22
  /**
31
23
  * Sidebar types
32
24
  */
33
- export type SidebarItem = NavItem & Partial<NavLink>;
25
+ export type SidebarItem = NavItem & Partial<AutoLinkConfig>;
34
26
  export type SidebarGroup = SidebarItem & NavGroup<SidebarItem | SidebarGroup | string> & {
35
27
  collapsible?: boolean;
36
28
  };
@@ -1,3 +1,7 @@
1
+ import type { BackToTopPluginOptions } from '@vuepress/plugin-back-to-top';
2
+ import type { CopyCodePluginOptions } from '@vuepress/plugin-copy-code';
3
+ import type { LinksCheckPluginOptions } from '@vuepress/plugin-links-check';
4
+ import type { PrismjsPluginOptions } from '@vuepress/plugin-prismjs';
1
5
  import type { SeoPluginOptions } from '@vuepress/plugin-seo';
2
6
  import type { SitemapPluginOptions } from '@vuepress/plugin-sitemap';
3
7
  import type { ThemeData } from '@vuepress/plugin-theme-data';
@@ -11,9 +15,9 @@ export interface DefaultThemePluginsOptions {
11
15
  /**
12
16
  * Enable @vuepress/plugin-back-to-top or not
13
17
  */
14
- backToTop?: boolean;
18
+ backToTop?: BackToTopPluginOptions | boolean;
15
19
  /**
16
- * Enable @vuepress/plugin-container or not
20
+ * Enable @vuepress/plugin-markdown-container or not
17
21
  */
18
22
  container?: {
19
23
  tip?: boolean;
@@ -24,13 +28,17 @@ export interface DefaultThemePluginsOptions {
24
28
  codeGroupItem?: boolean;
25
29
  };
26
30
  /**
27
- * Enable @vuepress/plugin-external-link-icon or not
31
+ * Enable @vuepress/plugin-copy-code or not
28
32
  */
29
- externalLinkIcon?: boolean;
33
+ copyCode?: CopyCodePluginOptions | boolean;
30
34
  /**
31
35
  * Enable @vuepress/plugin-git or not
32
36
  */
33
37
  git?: boolean;
38
+ /**
39
+ * Enable @vuepress/plugin-links-check or not
40
+ */
41
+ linksCheck?: LinksCheckPluginOptions | boolean;
34
42
  /**
35
43
  * Enable @vuepress/plugin-medium-zoom or not
36
44
  */
@@ -42,7 +50,7 @@ export interface DefaultThemePluginsOptions {
42
50
  /**
43
51
  * Enable @vuepress/plugin-prismjs or not
44
52
  */
45
- prismjs?: boolean;
53
+ prismjs?: boolean | PrismjsPluginOptions;
46
54
  /**
47
55
  * Enable @vuepress/plugin-seo or not
48
56
  */
@@ -67,6 +75,12 @@ export interface DefaultThemeLocaleData extends LocaleData {
67
75
  * @default true
68
76
  */
69
77
  colorModeSwitch?: boolean;
78
+ /**
79
+ * Whether show external link icon
80
+ *
81
+ * @default true
82
+ */
83
+ externalLinkIcon?: boolean;
70
84
  /**
71
85
  * Home path of current locale
72
86
  *
@@ -265,4 +279,12 @@ export interface DefaultThemeLocaleData extends LocaleData {
265
279
  * A11y text for sidebar toggle button
266
280
  */
267
281
  toggleSidebar?: string;
282
+ /**
283
+ * text for prev link
284
+ */
285
+ prev?: string;
286
+ /**
287
+ * text for next link
288
+ */
289
+ next?: string;
268
290
  }
@@ -1,5 +1,6 @@
1
1
  import type { GitPluginPageData } from '@vuepress/plugin-git';
2
- import type { NavLink, SidebarConfig } from './nav.js';
2
+ import type { AutoLinkConfig } from 'vuepress/client';
3
+ import type { SidebarConfig } from './nav.js';
3
4
  export interface DefaultThemePageData extends GitPluginPageData {
4
5
  filePathRelative: string | null;
5
6
  }
@@ -7,6 +8,7 @@ export interface DefaultThemePageFrontmatter {
7
8
  home?: boolean;
8
9
  navbar?: boolean;
9
10
  pageClass?: string;
11
+ externalLinkIcon?: boolean;
10
12
  }
11
13
  export interface DefaultThemeHomePageFrontmatter extends DefaultThemePageFrontmatter {
12
14
  home: true;
@@ -36,6 +38,6 @@ export interface DefaultThemeNormalPageFrontmatter extends DefaultThemePageFront
36
38
  contributors?: boolean;
37
39
  sidebar?: 'auto' | false | SidebarConfig;
38
40
  sidebarDepth?: number;
39
- prev?: string | NavLink;
40
- next?: string | NavLink;
41
+ prev?: string | AutoLinkConfig;
42
+ next?: string | AutoLinkConfig;
41
43
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vuepress/theme-default",
3
- "version": "2.0.0-rc.3",
3
+ "version": "2.0.0-rc.31",
4
4
  "description": "Default theme of VuePress",
5
5
  "keywords": [
6
6
  "vuepress-theme",
@@ -8,7 +8,7 @@
8
8
  "theme",
9
9
  "default"
10
10
  ],
11
- "homepage": "https://github.com/vuepress",
11
+ "homepage": "https://ecosystem.vuejs.press/themes/default/",
12
12
  "bugs": {
13
13
  "url": "https://github.com/vuepress/ecosystem/issues"
14
14
  },
@@ -42,26 +42,27 @@
42
42
  "copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
43
43
  },
44
44
  "dependencies": {
45
- "@vuepress/plugin-active-header-links": "2.0.0-rc.3",
46
- "@vuepress/plugin-back-to-top": "2.0.0-rc.3",
47
- "@vuepress/plugin-container": "2.0.0-rc.3",
48
- "@vuepress/plugin-external-link-icon": "2.0.0-rc.3",
49
- "@vuepress/plugin-git": "2.0.0-rc.3",
50
- "@vuepress/plugin-medium-zoom": "2.0.0-rc.3",
51
- "@vuepress/plugin-nprogress": "2.0.0-rc.3",
52
- "@vuepress/plugin-palette": "2.0.0-rc.3",
53
- "@vuepress/plugin-prismjs": "2.0.0-rc.3",
54
- "@vuepress/plugin-seo": "2.0.0-rc.3",
55
- "@vuepress/plugin-sitemap": "2.0.0-rc.3",
56
- "@vuepress/plugin-theme-data": "2.0.0-rc.3",
57
- "@vueuse/core": "^10.7.2",
58
- "sass": "^1.70.0",
59
- "vue": "^3.4.15",
60
- "vue-router": "^4.2.5"
45
+ "@vuepress/helper": "~2.0.0-rc.31",
46
+ "@vuepress/plugin-active-header-links": "~2.0.0-rc.31",
47
+ "@vuepress/plugin-back-to-top": "~2.0.0-rc.31",
48
+ "@vuepress/plugin-copy-code": "~2.0.0-rc.31",
49
+ "@vuepress/plugin-git": "~2.0.0-rc.31",
50
+ "@vuepress/plugin-links-check": "~2.0.0-rc.31",
51
+ "@vuepress/plugin-markdown-container": "~2.0.0-rc.31",
52
+ "@vuepress/plugin-medium-zoom": "~2.0.0-rc.31",
53
+ "@vuepress/plugin-nprogress": "~2.0.0-rc.31",
54
+ "@vuepress/plugin-palette": "~2.0.0-rc.31",
55
+ "@vuepress/plugin-prismjs": "~2.0.0-rc.31",
56
+ "@vuepress/plugin-seo": "~2.0.0-rc.31",
57
+ "@vuepress/plugin-sitemap": "~2.0.0-rc.31",
58
+ "@vuepress/plugin-theme-data": "~2.0.0-rc.31",
59
+ "@vueuse/core": "^10.9.0",
60
+ "sass": "^1.77.2",
61
+ "vue": "^3.4.27"
61
62
  },
62
63
  "peerDependencies": {
63
64
  "sass-loader": "^14.0.0",
64
- "vuepress": "2.0.0-rc.2"
65
+ "vuepress": "2.0.0-rc.12"
65
66
  },
66
67
  "peerDependenciesMeta": {
67
68
  "sass-loader": {
@@ -71,5 +72,5 @@
71
72
  "publishConfig": {
72
73
  "access": "public"
73
74
  },
74
- "gitHead": "7247c765f50c3b2d5a622e0f7cf22bfb13a463c4"
75
+ "gitHead": "c3d22eb10914f5a6bbb9cfb039498761ca94b524"
75
76
  }