@vuepress/theme-default 2.0.0-rc.5 → 2.0.0-rc.54
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/VPDarkIcon.vue +8 -0
- package/lib/client/components/VPDropdownTransition.vue +36 -0
- package/lib/client/components/VPEditIcon.vue +12 -0
- package/lib/client/components/VPHome.vue +38 -0
- package/lib/client/components/VPHomeFeatures.vue +66 -0
- package/lib/client/components/{HomeFooter.vue → VPHomeFooter.vue} +17 -2
- package/lib/client/components/{HomeHero.vue → VPHomeHero.vue} +113 -19
- package/lib/client/components/VPLightIcon.vue +28 -0
- package/lib/client/components/VPNavbar.vue +134 -0
- package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +40 -7
- package/lib/client/components/VPNavbarDropdown.vue +320 -0
- package/lib/client/components/VPNavbarItems.vue +111 -0
- package/lib/client/components/VPPage.vue +70 -0
- package/lib/client/components/VPPageMeta.vue +132 -0
- package/lib/client/components/VPPageNav.vue +118 -0
- package/lib/client/components/VPSidebar.vue +113 -0
- package/lib/client/components/VPSidebarItem.vue +174 -0
- package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +32 -7
- package/lib/client/components/VPToggleColorModeButton.vue +55 -0
- package/lib/client/components/VPToggleSidebarButton.vue +92 -0
- package/lib/client/components/global/Badge.vue +84 -18
- package/lib/client/components/global/index.d.ts +1 -3
- package/lib/client/components/global/index.js +1 -3
- package/lib/client/composables/index.d.ts +8 -0
- package/lib/client/composables/index.js +8 -0
- package/lib/client/composables/useContributors.d.ts +3 -0
- package/lib/client/composables/useContributors.js +14 -0
- package/lib/client/composables/useDarkMode.d.ts +0 -1
- package/lib/client/composables/useDarkMode.js +16 -13
- package/lib/client/composables/useEditLink.d.ts +3 -0
- package/lib/client/composables/useEditLink.js +31 -0
- package/lib/client/composables/useLastUpdated.d.ts +2 -0
- package/lib/client/composables/useLastUpdated.js +17 -0
- package/lib/client/composables/useNavbarConfig.d.ts +3 -0
- package/lib/client/composables/useNavbarConfig.js +27 -0
- package/lib/client/composables/useNavbarRepo.d.ts +6 -0
- package/lib/client/composables/useNavbarRepo.js +38 -0
- package/lib/client/composables/useNavbarSelectLanguage.d.ts +6 -0
- package/lib/client/composables/useNavbarSelectLanguage.js +59 -0
- package/lib/client/composables/useNavigate.d.ts +1 -0
- package/lib/client/composables/useNavigate.js +22 -0
- package/lib/client/composables/useRelatedLinks.d.ts +8 -0
- package/lib/client/composables/useRelatedLinks.js +91 -0
- package/lib/client/composables/useScrollPromise.js +3 -1
- package/lib/client/composables/useSidebarItems.d.ts +28 -23
- package/lib/client/composables/useSidebarItems.js +120 -84
- package/lib/client/composables/useUpdateDeviceStatus.d.ts +1 -1
- package/lib/client/composables/useUpdateDeviceStatus.js +10 -5
- package/lib/client/config.d.ts +3 -2
- package/lib/client/config.js +9 -22
- package/lib/client/index.d.ts +2 -1
- package/lib/client/index.js +0 -1
- package/lib/client/layouts/Layout.vue +139 -34
- package/lib/client/layouts/NotFound.vue +17 -5
- package/lib/client/shim.d.ts +12 -3
- package/lib/client/styles/_mixins.scss +4 -4
- package/lib/client/styles/_variables.module.scss +1 -1
- package/lib/client/styles/_variables.scss +1 -0
- package/lib/client/styles/arrow.scss +18 -24
- package/lib/client/styles/code-group.scss +35 -30
- package/lib/client/styles/content/code.scss +23 -0
- package/lib/client/styles/content/index.scss +3 -0
- package/lib/client/styles/content/normalize.scss +39 -0
- package/lib/client/styles/{toc.scss → content/toc.scss} +1 -1
- package/lib/client/styles/external-link-icon.scss +37 -0
- package/lib/client/styles/index.scss +3 -13
- package/lib/client/styles/layout.scss +3 -199
- package/lib/client/styles/normalize.scss +1 -194
- package/lib/client/styles/plugins.scss +28 -0
- package/lib/client/styles/vars-dark.scss +20 -58
- package/lib/client/styles/vars.scss +53 -129
- package/lib/client/typings.d.ts +13 -0
- package/lib/client/typings.js +1 -0
- package/lib/client/utils/getAutoLink.d.ts +9 -0
- package/lib/client/utils/getAutoLink.js +17 -0
- package/lib/client/utils/index.d.ts +3 -2
- package/lib/client/utils/index.js +3 -2
- package/lib/client/utils/isActiveSidebarItem.d.ts +3 -3
- package/lib/client/utils/isActiveSidebarItem.js +3 -3
- package/lib/client/utils/isLinkInternal.d.ts +1 -0
- package/lib/client/utils/isLinkInternal.js +2 -0
- package/lib/client/utils/resolveEditLink.d.ts +1 -1
- package/lib/client/utils/resolvePrefix.d.ts +1 -0
- package/lib/client/utils/resolvePrefix.js +4 -0
- package/lib/client/utils/resolveRepoType.d.ts +1 -1
- package/lib/client/utils/resolveRepoType.js +4 -4
- package/lib/node/defaultTheme.d.ts +2 -1
- package/lib/node/defaultTheme.js +72 -46
- package/lib/node/index.d.ts +2 -3
- package/lib/node/index.js +0 -3
- package/lib/node/typings.d.ts +58 -0
- package/lib/node/typings.js +1 -0
- package/lib/node/utils/assignDefaultLocaleOptions.js +3 -7
- 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/index.d.ts +5 -3
- package/lib/shared/index.js +1 -3
- package/lib/shared/nav.d.ts +19 -30
- package/lib/shared/navbar.d.ts +21 -0
- package/lib/shared/navbar.js +1 -0
- package/lib/shared/options.d.ts +36 -60
- package/lib/shared/page.d.ts +9 -6
- package/lib/shared/sidebar.d.ts +26 -0
- package/lib/shared/sidebar.js +1 -0
- package/package.json +30 -26
- package/templates/build.html +23 -14
- package/lib/client/components/AutoLink.vue +0 -113
- package/lib/client/components/DropdownTransition.vue +0 -25
- package/lib/client/components/Home.vue +0 -15
- package/lib/client/components/HomeContent.vue +0 -5
- package/lib/client/components/HomeFeatures.vue +0 -22
- package/lib/client/components/Navbar.vue +0 -79
- package/lib/client/components/NavbarDropdown.vue +0 -126
- package/lib/client/components/NavbarItems.vue +0 -199
- package/lib/client/components/Page.vue +0 -31
- package/lib/client/components/PageMeta.vue +0 -124
- package/lib/client/components/PageNav.vue +0 -122
- package/lib/client/components/Sidebar.vue +0 -18
- package/lib/client/components/SidebarItem.vue +0 -87
- package/lib/client/components/ToggleColorModeButton.vue +0 -57
- package/lib/client/components/ToggleSidebarButton.vue +0 -24
- package/lib/client/components/global/CodeGroup.d.ts +0 -6
- package/lib/client/components/global/CodeGroup.js +0 -120
- package/lib/client/components/global/CodeGroupItem.vue +0 -27
- package/lib/client/styles/badge.scss +0 -36
- package/lib/client/styles/code.scss +0 -263
- package/lib/client/styles/custom-container.scss +0 -142
- package/lib/client/styles/home.scss +0 -168
- package/lib/client/styles/navbar-dropdown.scss +0 -183
- package/lib/client/styles/navbar.scss +0 -197
- package/lib/client/styles/page.scss +0 -87
- package/lib/client/styles/sidebar.scss +0 -134
- package/lib/client/styles/transitions.scss +0 -22
- package/lib/client/utils/getNavLink.d.ts +0 -15
- package/lib/client/utils/getNavLink.js +0 -18
- package/lib/client/utils/getResolveRouteWithRedirect.d.ts +0 -5
- package/lib/client/utils/getResolveRouteWithRedirect.js +0 -22
- package/lib/node/utils/resolveContainerPluginOptions.d.ts +0 -8
- package/lib/node/utils/resolveContainerPluginOptions.js +0 -17
|
@@ -1,134 +0,0 @@
|
|
|
1
|
-
@import '_mixins';
|
|
2
|
-
@import '_variables';
|
|
3
|
-
|
|
4
|
-
.sidebar {
|
|
5
|
-
ul {
|
|
6
|
-
padding: 0;
|
|
7
|
-
margin: 0;
|
|
8
|
-
list-style-type: none;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
a {
|
|
12
|
-
display: inline-block;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.navbar-items {
|
|
16
|
-
display: none;
|
|
17
|
-
border-bottom: 1px solid var(--c-border);
|
|
18
|
-
transition: border-color var(--t-color);
|
|
19
|
-
padding: 0.5rem 0 0.75rem 0;
|
|
20
|
-
|
|
21
|
-
a {
|
|
22
|
-
font-weight: 600;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
.navbar-item {
|
|
26
|
-
display: block;
|
|
27
|
-
line-height: 1.25rem;
|
|
28
|
-
font-size: 1.1em;
|
|
29
|
-
padding: 0.5rem 0 0.5rem 1.5rem;
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
.sidebar-items {
|
|
34
|
-
padding: 1.5rem 0;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
@media (max-width: $MQMobile) {
|
|
39
|
-
.sidebar {
|
|
40
|
-
.navbar-items {
|
|
41
|
-
display: block;
|
|
42
|
-
|
|
43
|
-
.navbar-dropdown-wrapper
|
|
44
|
-
.navbar-dropdown
|
|
45
|
-
.navbar-dropdown-item
|
|
46
|
-
a.router-link-active::after {
|
|
47
|
-
top: calc(1rem - 2px);
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.sidebar-items {
|
|
52
|
-
padding: 1rem 0;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
.sidebar-item {
|
|
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
|
-
}
|
|
72
|
-
|
|
73
|
-
&.sidebar-heading {
|
|
74
|
-
transition: color 0.15s ease;
|
|
75
|
-
font-size: 1.1em;
|
|
76
|
-
font-weight: bold;
|
|
77
|
-
padding: 0.35rem 1.5rem 0.35rem 1.25rem;
|
|
78
|
-
width: 100%;
|
|
79
|
-
box-sizing: border-box;
|
|
80
|
-
margin: 0;
|
|
81
|
-
|
|
82
|
-
+ .sidebar-item-children {
|
|
83
|
-
@include dropdown_wrapper;
|
|
84
|
-
margin-bottom: 0.75rem;
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
&.collapsible {
|
|
89
|
-
cursor: pointer;
|
|
90
|
-
|
|
91
|
-
.arrow {
|
|
92
|
-
position: relative;
|
|
93
|
-
top: -0.12em;
|
|
94
|
-
left: 0.5em;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
&:not(.sidebar-heading) {
|
|
99
|
-
font-size: 1em;
|
|
100
|
-
font-weight: 400;
|
|
101
|
-
display: inline-block;
|
|
102
|
-
margin: 0;
|
|
103
|
-
padding: 0.35rem 1rem 0.35rem 2rem;
|
|
104
|
-
line-height: 1.4;
|
|
105
|
-
width: 100%;
|
|
106
|
-
box-sizing: border-box;
|
|
107
|
-
|
|
108
|
-
& + .sidebar-item-children {
|
|
109
|
-
padding-left: 1rem;
|
|
110
|
-
font-size: 0.95em;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
.sidebar-item-children .sidebar-item-children & {
|
|
114
|
-
padding: 0.25rem 1rem 0.25rem 1.75rem;
|
|
115
|
-
|
|
116
|
-
&.active {
|
|
117
|
-
font-weight: 500;
|
|
118
|
-
border-left-color: transparent;
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
a.sidebar-heading + .sidebar-item-children &.active {
|
|
123
|
-
border-left-color: transparent;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
a.sidebar-item {
|
|
129
|
-
cursor: pointer;
|
|
130
|
-
|
|
131
|
-
&:hover {
|
|
132
|
-
color: var(--c-text-accent);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* dropdown
|
|
3
|
-
*/
|
|
4
|
-
.dropdown-enter-from,
|
|
5
|
-
.dropdown-leave-to {
|
|
6
|
-
height: 0 !important;
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* fade-slide-y
|
|
11
|
-
*/
|
|
12
|
-
.fade-slide-y-enter-active {
|
|
13
|
-
transition: all 0.2s ease;
|
|
14
|
-
}
|
|
15
|
-
.fade-slide-y-leave-active {
|
|
16
|
-
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
|
|
17
|
-
}
|
|
18
|
-
.fade-slide-y-enter-from,
|
|
19
|
-
.fade-slide-y-leave-to {
|
|
20
|
-
transform: translateY(10px);
|
|
21
|
-
opacity: 0;
|
|
22
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
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
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Resolve NavLink props from string
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* - Input: '/README.md'
|
|
13
|
-
* - Output: { text: 'Home', link: '/' }
|
|
14
|
-
*/
|
|
15
|
-
export declare const getNavLink: (router: Router, item: string) => NavLink;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { getResolveRouteWithRedirect } from './getResolveRouteWithRedirect.js';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve NavLink props from string
|
|
4
|
-
*
|
|
5
|
-
* @example
|
|
6
|
-
* - Input: '/README.md'
|
|
7
|
-
* - Output: { text: 'Home', link: '/' }
|
|
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
|
-
};
|
|
18
|
-
};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { Router } from 'vue-router';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve a route with redirection
|
|
4
|
-
*/
|
|
5
|
-
export declare const getResolveRouteWithRedirect: (router: Router, to: import("vue-router").RouteLocationRaw, currentLocation?: import("vue-router").RouteLocationNormalizedLoaded | undefined) => ReturnType<Router['resolve']>;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { isFunction, isString } from 'vuepress/shared';
|
|
2
|
-
/**
|
|
3
|
-
* Resolve a route with redirection
|
|
4
|
-
*/
|
|
5
|
-
export const getResolveRouteWithRedirect = (router, ...args) => {
|
|
6
|
-
const route = router.resolve(...args);
|
|
7
|
-
const lastMatched = route.matched[route.matched.length - 1];
|
|
8
|
-
if (!lastMatched?.redirect) {
|
|
9
|
-
return route;
|
|
10
|
-
}
|
|
11
|
-
const { redirect } = lastMatched;
|
|
12
|
-
const resolvedRedirect = isFunction(redirect) ? redirect(route) : redirect;
|
|
13
|
-
const resolvedRedirectObj = isString(resolvedRedirect)
|
|
14
|
-
? { path: resolvedRedirect }
|
|
15
|
-
: resolvedRedirect;
|
|
16
|
-
return getResolveRouteWithRedirect(router, {
|
|
17
|
-
hash: route.hash,
|
|
18
|
-
query: route.query,
|
|
19
|
-
params: route.params,
|
|
20
|
-
...resolvedRedirectObj,
|
|
21
|
-
});
|
|
22
|
-
};
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { ContainerPluginOptions } from '@vuepress/plugin-container';
|
|
2
|
-
import type { DefaultThemeData } from '../../shared/index.js';
|
|
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,17 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Resolve options for @vuepress/plugin-container
|
|
3
|
-
*
|
|
4
|
-
* For custom containers default title
|
|
5
|
-
*/
|
|
6
|
-
export const resolveContainerPluginOptions = (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
|
-
};
|