@vuepress/theme-default 2.0.0-beta.33 → 2.0.0-beta.34
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 +0 -4
- package/lib/client/components/SidebarItem.vue +7 -1
- package/lib/client/styles/index.scss +0 -1
- package/lib/client/styles/navbar.scss +4 -0
- package/lib/client/styles/normalize.scss +6 -2
- package/lib/client/styles/sidebar.scss +17 -10
- package/lib/node/defaultTheme.js +4 -1
- package/lib/node/utils/index.d.ts +1 -0
- package/lib/node/utils/index.js +1 -0
- package/lib/node/utils/resolveExternalLinkIconPluginOptions.d.ts +6 -0
- package/lib/node/utils/resolveExternalLinkIconPluginOptions.js +21 -0
- package/package.json +14 -14
- package/lib/client/components/global/ExternalLinkIcon.vue +0 -12
- package/lib/client/styles/sr-only.scss +0 -12
|
@@ -3,16 +3,12 @@ import { h } from 'vue';
|
|
|
3
3
|
import Badge from './components/global/Badge.vue';
|
|
4
4
|
import CodeGroup from './components/global/CodeGroup';
|
|
5
5
|
import CodeGroupItem from './components/global/CodeGroupItem.vue';
|
|
6
|
-
import ExternalLinkIcon from './components/global/ExternalLinkIcon.vue';
|
|
7
6
|
import { useScrollPromise } from './composables';
|
|
8
7
|
import './styles/index.scss';
|
|
9
8
|
export default defineClientAppEnhance(({ app, router }) => {
|
|
10
9
|
app.component('Badge', Badge);
|
|
11
10
|
app.component('CodeGroup', CodeGroup);
|
|
12
11
|
app.component('CodeGroupItem', CodeGroupItem);
|
|
13
|
-
// override the `<ExternalLinkIcon>` provided by @vuepress/plugin-external-link-icon
|
|
14
|
-
delete app._context.components.ExternalLinkIcon;
|
|
15
|
-
app.component('ExternalLinkIcon', ExternalLinkIcon);
|
|
16
12
|
// compat with @vuepress/plugin-docsearch and @vuepress/plugin-search
|
|
17
13
|
app.component('NavbarSearch', () => {
|
|
18
14
|
const SearchComponent = app.component('Docsearch') || app.component('SearchBox');
|
|
@@ -51,7 +51,13 @@ if (item.value.collapsible) {
|
|
|
51
51
|
<template>
|
|
52
52
|
<li>
|
|
53
53
|
<AutoLink v-if="item.link" :class="itemClass" :item="item" />
|
|
54
|
-
<p
|
|
54
|
+
<p
|
|
55
|
+
v-else
|
|
56
|
+
tabindex="0"
|
|
57
|
+
:class="itemClass"
|
|
58
|
+
@click="onClick"
|
|
59
|
+
@keydown.enter="onClick"
|
|
60
|
+
>
|
|
55
61
|
{{ item.text }}
|
|
56
62
|
<span
|
|
57
63
|
v-if="item.collapsible"
|
|
@@ -49,7 +49,7 @@ code {
|
|
|
49
49
|
background-color: var(--c-bg-light);
|
|
50
50
|
border-radius: 3px;
|
|
51
51
|
overflow-wrap: break-word;
|
|
52
|
-
transition: background-color var(--t-color)
|
|
52
|
+
transition: background-color var(--t-color);
|
|
53
53
|
}
|
|
54
54
|
|
|
55
55
|
blockquote {
|
|
@@ -151,18 +151,22 @@ table {
|
|
|
151
151
|
margin: 1rem 0;
|
|
152
152
|
display: block;
|
|
153
153
|
overflow-x: auto;
|
|
154
|
+
transition: border-color var(--t-color);
|
|
154
155
|
}
|
|
155
156
|
|
|
156
157
|
tr {
|
|
157
158
|
border-top: 1px solid var(--c-border-dark);
|
|
159
|
+
transition: border-color var(--t-color);
|
|
158
160
|
|
|
159
161
|
&:nth-child(2n) {
|
|
160
162
|
background-color: var(--c-bg-light);
|
|
163
|
+
transition: background-color var(--t-color);
|
|
161
164
|
}
|
|
162
165
|
}
|
|
163
166
|
|
|
164
167
|
th,
|
|
165
168
|
td {
|
|
166
|
-
border: 1px solid var(--c-border-dark);
|
|
167
169
|
padding: 0.6em 1em;
|
|
170
|
+
border: 1px solid var(--c-border-dark);
|
|
171
|
+
transition: border-color var(--t-color);
|
|
168
172
|
}
|
|
@@ -56,9 +56,21 @@
|
|
|
56
56
|
|
|
57
57
|
.sidebar-item {
|
|
58
58
|
cursor: default;
|
|
59
|
+
border-left: 0.25rem solid transparent;
|
|
60
|
+
color: var(--c-text);
|
|
61
|
+
|
|
62
|
+
&:focus-visible {
|
|
63
|
+
outline-width: 1px;
|
|
64
|
+
outline-offset: -1px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
&.active:not(p.sidebar-heading) {
|
|
68
|
+
font-weight: 600;
|
|
69
|
+
color: var(--c-text-accent);
|
|
70
|
+
border-left-color: var(--c-text-accent);
|
|
71
|
+
}
|
|
59
72
|
|
|
60
73
|
&.sidebar-heading {
|
|
61
|
-
color: var(--c-text);
|
|
62
74
|
transition: color 0.15s ease;
|
|
63
75
|
font-size: 1.1em;
|
|
64
76
|
font-weight: bold;
|
|
@@ -66,7 +78,6 @@
|
|
|
66
78
|
width: 100%;
|
|
67
79
|
box-sizing: border-box;
|
|
68
80
|
margin: 0;
|
|
69
|
-
border-left: 0.25rem solid transparent;
|
|
70
81
|
|
|
71
82
|
&.collapsible {
|
|
72
83
|
cursor: pointer;
|
|
@@ -88,20 +99,12 @@
|
|
|
88
99
|
font-size: 1em;
|
|
89
100
|
font-weight: 400;
|
|
90
101
|
display: inline-block;
|
|
91
|
-
color: var(--c-text);
|
|
92
|
-
border-left: 0.25rem solid transparent;
|
|
93
102
|
margin: 0;
|
|
94
103
|
padding: 0.35rem 1rem 0.35rem 2rem;
|
|
95
104
|
line-height: 1.4;
|
|
96
105
|
width: 100%;
|
|
97
106
|
box-sizing: border-box;
|
|
98
107
|
|
|
99
|
-
&.active {
|
|
100
|
-
font-weight: 600;
|
|
101
|
-
color: var(--c-text-accent);
|
|
102
|
-
border-left-color: var(--c-text-accent);
|
|
103
|
-
}
|
|
104
|
-
|
|
105
108
|
& + .sidebar-item-children {
|
|
106
109
|
padding-left: 1rem;
|
|
107
110
|
font-size: 0.95em;
|
|
@@ -115,6 +118,10 @@
|
|
|
115
118
|
border-left-color: transparent;
|
|
116
119
|
}
|
|
117
120
|
}
|
|
121
|
+
|
|
122
|
+
a.sidebar-heading + .sidebar-item-children &.active {
|
|
123
|
+
border-left-color: transparent;
|
|
124
|
+
}
|
|
118
125
|
}
|
|
119
126
|
}
|
|
120
127
|
|
package/lib/node/defaultTheme.js
CHANGED
|
@@ -65,7 +65,10 @@ const defaultTheme = ({ themePlugins = {}, ...localeOptions }, app) => {
|
|
|
65
65
|
'@vuepress/container',
|
|
66
66
|
(0, utils_2.resolveContainerPluginOptionsForCodeGroupItem)(themePlugins),
|
|
67
67
|
],
|
|
68
|
-
[
|
|
68
|
+
[
|
|
69
|
+
'@vuepress/external-link-icon',
|
|
70
|
+
(0, utils_2.resolveExternalLinkIconPluginOptions)(themePlugins, localeOptions),
|
|
71
|
+
],
|
|
69
72
|
['@vuepress/git', (0, utils_2.resolveGitPluginOptions)(themePlugins, localeOptions)],
|
|
70
73
|
['@vuepress/medium-zoom', (0, utils_2.resolveMediumZoomPluginOptions)(themePlugins)],
|
|
71
74
|
['@vuepress/nprogress', themePlugins.nprogress !== false],
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * from './assignDefaultLocaleOptions';
|
|
2
2
|
export * from './resolveActiveHeaderLinksPluginOptions';
|
|
3
3
|
export * from './resolveContainerPluginOptions';
|
|
4
|
+
export * from './resolveExternalLinkIconPluginOptions';
|
|
4
5
|
export * from './resolveGitPluginOptions';
|
|
5
6
|
export * from './resolveMediumZoomPluginOptions';
|
package/lib/node/utils/index.js
CHANGED
|
@@ -13,5 +13,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
13
|
__exportStar(require("./assignDefaultLocaleOptions"), exports);
|
|
14
14
|
__exportStar(require("./resolveActiveHeaderLinksPluginOptions"), exports);
|
|
15
15
|
__exportStar(require("./resolveContainerPluginOptions"), exports);
|
|
16
|
+
__exportStar(require("./resolveExternalLinkIconPluginOptions"), exports);
|
|
16
17
|
__exportStar(require("./resolveGitPluginOptions"), exports);
|
|
17
18
|
__exportStar(require("./resolveMediumZoomPluginOptions"), exports);
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { ExternalLinkIconPluginOptions } from '@vuepress/plugin-external-link-icon';
|
|
2
|
+
import type { DefaultThemeData, DefaultThemePluginsOptions } from '../../shared';
|
|
3
|
+
/**
|
|
4
|
+
* Resolve options for @vuepress/plugin-external-link-icon
|
|
5
|
+
*/
|
|
6
|
+
export declare const resolveExternalLinkIconPluginOptions: (themePlugins: DefaultThemePluginsOptions, localeOptions: DefaultThemeData) => ExternalLinkIconPluginOptions | boolean;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.resolveExternalLinkIconPluginOptions = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Resolve options for @vuepress/plugin-external-link-icon
|
|
6
|
+
*/
|
|
7
|
+
const resolveExternalLinkIconPluginOptions = (themePlugins, localeOptions) => {
|
|
8
|
+
if ((themePlugins === null || themePlugins === void 0 ? void 0 : themePlugins.externalLinkIcon) === false) {
|
|
9
|
+
return false;
|
|
10
|
+
}
|
|
11
|
+
return {
|
|
12
|
+
locales: Object.entries(localeOptions.locales || {}).reduce((result, [key, value]) => {
|
|
13
|
+
var _a;
|
|
14
|
+
result[key] = {
|
|
15
|
+
openInNewWindow: (_a = value.openInNewWindow) !== null && _a !== void 0 ? _a : localeOptions.openInNewWindow,
|
|
16
|
+
};
|
|
17
|
+
return result;
|
|
18
|
+
}, {}),
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
exports.resolveExternalLinkIconPluginOptions = resolveExternalLinkIconPluginOptions;
|
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.34",
|
|
4
4
|
"description": "Default theme of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-theme",
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
"copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@vuepress/client": "2.0.0-beta.
|
|
34
|
-
"@vuepress/core": "2.0.0-beta.
|
|
35
|
-
"@vuepress/plugin-active-header-links": "2.0.0-beta.
|
|
36
|
-
"@vuepress/plugin-back-to-top": "2.0.0-beta.
|
|
37
|
-
"@vuepress/plugin-container": "2.0.0-beta.
|
|
38
|
-
"@vuepress/plugin-external-link-icon": "2.0.0-beta.
|
|
39
|
-
"@vuepress/plugin-git": "2.0.0-beta.
|
|
40
|
-
"@vuepress/plugin-medium-zoom": "2.0.0-beta.
|
|
41
|
-
"@vuepress/plugin-nprogress": "2.0.0-beta.
|
|
42
|
-
"@vuepress/plugin-palette": "2.0.0-beta.
|
|
43
|
-
"@vuepress/plugin-prismjs": "2.0.0-beta.
|
|
44
|
-
"@vuepress/plugin-theme-data": "2.0.0-beta.
|
|
33
|
+
"@vuepress/client": "2.0.0-beta.34",
|
|
34
|
+
"@vuepress/core": "2.0.0-beta.34",
|
|
35
|
+
"@vuepress/plugin-active-header-links": "2.0.0-beta.34",
|
|
36
|
+
"@vuepress/plugin-back-to-top": "2.0.0-beta.34",
|
|
37
|
+
"@vuepress/plugin-container": "2.0.0-beta.34",
|
|
38
|
+
"@vuepress/plugin-external-link-icon": "2.0.0-beta.34",
|
|
39
|
+
"@vuepress/plugin-git": "2.0.0-beta.34",
|
|
40
|
+
"@vuepress/plugin-medium-zoom": "2.0.0-beta.34",
|
|
41
|
+
"@vuepress/plugin-nprogress": "2.0.0-beta.34",
|
|
42
|
+
"@vuepress/plugin-palette": "2.0.0-beta.34",
|
|
43
|
+
"@vuepress/plugin-prismjs": "2.0.0-beta.34",
|
|
44
|
+
"@vuepress/plugin-theme-data": "2.0.0-beta.34",
|
|
45
45
|
"@vuepress/shared": "2.0.0-beta.33",
|
|
46
46
|
"@vuepress/utils": "2.0.0-beta.33",
|
|
47
47
|
"@vueuse/core": "^7.5.3",
|
|
@@ -53,5 +53,5 @@
|
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "aba907994697f4d0a691f2e3668dad4bea388f20"
|
|
57
57
|
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
<script setup lang="ts">
|
|
2
|
-
import { ExternalLinkIcon as RawExternalLinkIcon } from '@vuepress/plugin-external-link-icon/lib/client'
|
|
3
|
-
import { useThemeLocaleData } from '../../composables'
|
|
4
|
-
|
|
5
|
-
const themeLocale = useThemeLocaleData()
|
|
6
|
-
</script>
|
|
7
|
-
|
|
8
|
-
<template>
|
|
9
|
-
<RawExternalLinkIcon>
|
|
10
|
-
<span class="sr-only">{{ themeLocale.openInNewWindow }}</span>
|
|
11
|
-
</RawExternalLinkIcon>
|
|
12
|
-
</template>
|