@vuepress/theme-default 2.0.0-beta.31 → 2.0.0-beta.35
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/{NavLink.vue → AutoLink.vue} +1 -2
- package/lib/client/components/Home.vue +4 -4
- package/lib/client/components/HomeHero.vue +2 -2
- package/lib/client/components/Navbar.vue +6 -6
- package/lib/client/components/{DropdownLink.vue → NavbarDropdown.vue} +17 -17
- package/lib/client/components/{NavbarLinks.vue → NavbarItems.vue} +8 -14
- package/lib/client/components/Page.vue +2 -2
- package/lib/client/components/PageMeta.vue +4 -5
- package/lib/client/components/PageNav.vue +8 -8
- package/lib/client/components/Sidebar.vue +3 -3
- package/lib/client/components/SidebarItem.vue +29 -18
- package/lib/client/components/SidebarItems.vue +1 -1
- package/lib/client/components/global/CodeGroup.d.ts +1 -1
- package/lib/client/composables/useNavLink.d.ts +5 -0
- package/lib/client/index.d.ts +2 -2
- package/lib/client/layouts/Layout.vue +4 -4
- package/lib/client/styles/index.scss +1 -2
- package/lib/client/styles/{dropdown.scss → navbar-dropdown.scss} +23 -31
- package/lib/client/styles/navbar.scss +12 -8
- package/lib/client/styles/normalize.scss +6 -2
- package/lib/client/styles/sidebar.scss +23 -16
- package/lib/client/styles/transitions.scss +13 -4
- package/lib/node/defaultTheme.js +13 -1
- package/lib/node/utils/index.d.ts +1 -0
- package/lib/node/utils/index.js +1 -0
- package/lib/node/utils/resolveActiveHeaderLinksPluginOptions.js +2 -0
- package/lib/node/utils/resolveExternalLinkIconPluginOptions.d.ts +6 -0
- package/lib/node/utils/resolveExternalLinkIconPluginOptions.js +21 -0
- package/lib/node/utils/resolveMediumZoomPluginOptions.js +1 -1
- package/lib/shared/nav.d.ts +1 -1
- package/package.json +21 -20
- package/templates/index.build.html +33 -0
- 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');
|
|
@@ -87,7 +87,6 @@ const isActive = computed(() => {
|
|
|
87
87
|
<template>
|
|
88
88
|
<RouterLink
|
|
89
89
|
v-if="isRouterLink"
|
|
90
|
-
class="nav-link"
|
|
91
90
|
:class="{ 'router-link-active': isActive }"
|
|
92
91
|
:to="item.link"
|
|
93
92
|
:aria-label="linkAriaLabel"
|
|
@@ -99,7 +98,7 @@ const isActive = computed(() => {
|
|
|
99
98
|
</RouterLink>
|
|
100
99
|
<a
|
|
101
100
|
v-else
|
|
102
|
-
class="
|
|
101
|
+
class="external-link"
|
|
103
102
|
:href="item.link"
|
|
104
103
|
:rel="linkRel"
|
|
105
104
|
:target="linkTarget"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import HomeContent from '
|
|
3
|
-
import HomeFeatures from '
|
|
4
|
-
import HomeFooter from '
|
|
5
|
-
import HomeHero from '
|
|
2
|
+
import HomeContent from '@theme/HomeContent.vue'
|
|
3
|
+
import HomeFeatures from '@theme/HomeFeatures.vue'
|
|
4
|
+
import HomeFooter from '@theme/HomeFooter.vue'
|
|
5
|
+
import HomeHero from '@theme/HomeHero.vue'
|
|
6
6
|
</script>
|
|
7
7
|
|
|
8
8
|
<template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import AutoLink from '@theme/AutoLink.vue'
|
|
2
3
|
import {
|
|
3
4
|
ClientOnly,
|
|
4
5
|
usePageFrontmatter,
|
|
@@ -10,7 +11,6 @@ import type { FunctionalComponent } from 'vue'
|
|
|
10
11
|
import { computed, h } from 'vue'
|
|
11
12
|
import type { DefaultThemeHomePageFrontmatter } from '../../shared'
|
|
12
13
|
import { useDarkMode } from '../composables'
|
|
13
|
-
import NavLink from './NavLink.vue'
|
|
14
14
|
|
|
15
15
|
const frontmatter = usePageFrontmatter<DefaultThemeHomePageFrontmatter>()
|
|
16
16
|
const siteLocale = useSiteLocaleData()
|
|
@@ -85,7 +85,7 @@ const HomeHeroImage: FunctionalComponent = () => {
|
|
|
85
85
|
</p>
|
|
86
86
|
|
|
87
87
|
<p v-if="actions.length" class="actions">
|
|
88
|
-
<
|
|
88
|
+
<AutoLink
|
|
89
89
|
v-for="action in actions"
|
|
90
90
|
:key="action.text"
|
|
91
91
|
class="action-button"
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import NavbarBrand from '@theme/NavbarBrand.vue'
|
|
3
|
+
import NavbarItems from '@theme/NavbarItems.vue'
|
|
4
|
+
import ToggleDarkModeButton from '@theme/ToggleDarkModeButton.vue'
|
|
5
|
+
import ToggleSidebarButton from '@theme/ToggleSidebarButton.vue'
|
|
2
6
|
import { computed, onMounted, ref } from 'vue'
|
|
3
7
|
import { useThemeLocaleData } from '../composables'
|
|
4
|
-
import NavbarBrand from './NavbarBrand.vue'
|
|
5
|
-
import NavbarLinks from './NavbarLinks.vue'
|
|
6
|
-
import ToggleDarkModeButton from './ToggleDarkModeButton.vue'
|
|
7
|
-
import ToggleSidebarButton from './ToggleSidebarButton.vue'
|
|
8
8
|
|
|
9
9
|
defineEmits(['toggle-sidebar'])
|
|
10
10
|
|
|
@@ -65,9 +65,9 @@ function getCssValue(el: HTMLElement | null, property: string): number {
|
|
|
65
65
|
<NavbarBrand />
|
|
66
66
|
</span>
|
|
67
67
|
|
|
68
|
-
<div class="navbar-
|
|
68
|
+
<div class="navbar-items-wrapper" :style="linksWrapperStyle">
|
|
69
69
|
<slot name="before" />
|
|
70
|
-
<
|
|
70
|
+
<NavbarItems class="can-hide" />
|
|
71
71
|
<slot name="after" />
|
|
72
72
|
<ToggleDarkModeButton v-if="enableDarkMode" />
|
|
73
73
|
<NavbarSearch />
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import AutoLink from '@theme/AutoLink.vue'
|
|
3
|
+
import DropdownTransition from '@theme/DropdownTransition.vue'
|
|
2
4
|
import { computed, ref, toRefs, watch } from 'vue'
|
|
3
5
|
import type { PropType } from 'vue'
|
|
4
6
|
import { useRoute } from 'vue-router'
|
|
5
|
-
import type {
|
|
6
|
-
import DropdownTransition from './DropdownTransition.vue'
|
|
7
|
-
import NavLink from './NavLink.vue'
|
|
7
|
+
import type { NavbarItem, ResolvedNavbarItem } from '../../shared'
|
|
8
8
|
|
|
9
9
|
const props = defineProps({
|
|
10
10
|
item: {
|
|
11
|
-
type: Object as PropType<
|
|
11
|
+
type: Object as PropType<Exclude<ResolvedNavbarItem, NavbarItem>>,
|
|
12
12
|
required: true,
|
|
13
13
|
},
|
|
14
14
|
})
|
|
@@ -50,9 +50,9 @@ const isLastItemOfArray = (item: unknown, arr: unknown[]): boolean =>
|
|
|
50
50
|
</script>
|
|
51
51
|
|
|
52
52
|
<template>
|
|
53
|
-
<div class="dropdown-wrapper" :class="{ open }">
|
|
53
|
+
<div class="navbar-dropdown-wrapper" :class="{ open }">
|
|
54
54
|
<button
|
|
55
|
-
class="dropdown-title"
|
|
55
|
+
class="navbar-dropdown-title"
|
|
56
56
|
type="button"
|
|
57
57
|
:aria-label="dropdownAriaLabel"
|
|
58
58
|
@click="handleDropdown"
|
|
@@ -62,7 +62,7 @@ const isLastItemOfArray = (item: unknown, arr: unknown[]): boolean =>
|
|
|
62
62
|
</button>
|
|
63
63
|
|
|
64
64
|
<button
|
|
65
|
-
class="
|
|
65
|
+
class="navbar-dropdown-title-mobile"
|
|
66
66
|
type="button"
|
|
67
67
|
:aria-label="dropdownAriaLabel"
|
|
68
68
|
@click="open = !open"
|
|
@@ -72,15 +72,15 @@ const isLastItemOfArray = (item: unknown, arr: unknown[]): boolean =>
|
|
|
72
72
|
</button>
|
|
73
73
|
|
|
74
74
|
<DropdownTransition>
|
|
75
|
-
<ul v-show="open" class="
|
|
75
|
+
<ul v-show="open" class="navbar-dropdown">
|
|
76
76
|
<li
|
|
77
|
-
v-for="
|
|
78
|
-
:key="child.
|
|
79
|
-
class="dropdown-item"
|
|
77
|
+
v-for="child in item.children"
|
|
78
|
+
:key="child.text"
|
|
79
|
+
class="navbar-dropdown-item"
|
|
80
80
|
>
|
|
81
81
|
<template v-if="child.children">
|
|
82
|
-
<h4 class="dropdown-subtitle">
|
|
83
|
-
<
|
|
82
|
+
<h4 class="navbar-dropdown-subtitle">
|
|
83
|
+
<AutoLink
|
|
84
84
|
v-if="child.link"
|
|
85
85
|
:item="child"
|
|
86
86
|
@focusout="
|
|
@@ -93,13 +93,13 @@ const isLastItemOfArray = (item: unknown, arr: unknown[]): boolean =>
|
|
|
93
93
|
<span v-else>{{ child.text }}</span>
|
|
94
94
|
</h4>
|
|
95
95
|
|
|
96
|
-
<ul class="dropdown-subitem-wrapper">
|
|
96
|
+
<ul class="navbar-dropdown-subitem-wrapper">
|
|
97
97
|
<li
|
|
98
98
|
v-for="grandchild in child.children"
|
|
99
99
|
:key="grandchild.link"
|
|
100
|
-
class="dropdown-subitem"
|
|
100
|
+
class="navbar-dropdown-subitem"
|
|
101
101
|
>
|
|
102
|
-
<
|
|
102
|
+
<AutoLink
|
|
103
103
|
:item="grandchild"
|
|
104
104
|
@focusout="
|
|
105
105
|
isLastItemOfArray(grandchild, child.children) &&
|
|
@@ -112,7 +112,7 @@ const isLastItemOfArray = (item: unknown, arr: unknown[]): boolean =>
|
|
|
112
112
|
</template>
|
|
113
113
|
|
|
114
114
|
<template v-else>
|
|
115
|
-
<
|
|
115
|
+
<AutoLink
|
|
116
116
|
:item="child"
|
|
117
117
|
@focusout="
|
|
118
118
|
isLastItemOfArray(child, item.children) && (open = false)
|
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import AutoLink from '@theme/AutoLink.vue'
|
|
3
|
+
import NavbarDropdown from '@theme/NavbarDropdown.vue'
|
|
2
4
|
import { useRouteLocale, useSiteLocaleData } from '@vuepress/client'
|
|
3
5
|
import { isLinkHttp, isString } from '@vuepress/shared'
|
|
4
6
|
import { computed } from 'vue'
|
|
5
7
|
import type { ComputedRef } from 'vue'
|
|
6
8
|
import { useRouter } from 'vue-router'
|
|
7
|
-
import type {
|
|
8
|
-
NavbarGroup,
|
|
9
|
-
NavbarItem,
|
|
10
|
-
NavGroup,
|
|
11
|
-
NavLink as NavLinkType,
|
|
12
|
-
ResolvedNavbarItem,
|
|
13
|
-
} from '../../shared'
|
|
9
|
+
import type { NavbarGroup, NavbarItem, ResolvedNavbarItem } from '../../shared'
|
|
14
10
|
import { useNavLink, useThemeLocaleData } from '../composables'
|
|
15
11
|
import { resolveRepoType } from '../utils'
|
|
16
|
-
import DropdownLink from './DropdownLink.vue'
|
|
17
|
-
import NavLink from './NavLink.vue'
|
|
18
12
|
|
|
19
13
|
/**
|
|
20
14
|
* Get navbar config of select language dropdown
|
|
@@ -35,7 +29,7 @@ const useNavbarSelectLanguage = (): ComputedRef<ResolvedNavbarItem[]> => {
|
|
|
35
29
|
const currentFullPath = router.currentRoute.value.fullPath
|
|
36
30
|
|
|
37
31
|
const languageDropdown: ResolvedNavbarItem = {
|
|
38
|
-
text: themeLocale.value.selectLanguageText ?? '
|
|
32
|
+
text: themeLocale.value.selectLanguageText ?? 'unknown language',
|
|
39
33
|
ariaLabel: themeLocale.value.selectLanguageAriaLabel ?? 'unkown language',
|
|
40
34
|
children: localePaths.map((targetLocalePath) => {
|
|
41
35
|
// target locale config of this langauge link
|
|
@@ -151,10 +145,10 @@ const navbarLinks = computed(() => [
|
|
|
151
145
|
</script>
|
|
152
146
|
|
|
153
147
|
<template>
|
|
154
|
-
<nav v-if="navbarLinks.length" class="navbar-
|
|
155
|
-
<div v-for="item in navbarLinks" :key="item.text" class="navbar-
|
|
156
|
-
<
|
|
157
|
-
<
|
|
148
|
+
<nav v-if="navbarLinks.length" class="navbar-items">
|
|
149
|
+
<div v-for="item in navbarLinks" :key="item.text" class="navbar-item">
|
|
150
|
+
<NavbarDropdown v-if="item.children" :item="item" />
|
|
151
|
+
<AutoLink v-else :item="item" />
|
|
158
152
|
</div>
|
|
159
153
|
</nav>
|
|
160
154
|
</template>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import AutoLink from '@theme/AutoLink.vue'
|
|
2
3
|
import {
|
|
3
4
|
usePageData,
|
|
4
5
|
usePageFrontmatter,
|
|
@@ -9,13 +10,12 @@ import type { ComputedRef } from 'vue'
|
|
|
9
10
|
import type {
|
|
10
11
|
DefaultThemeNormalPageFrontmatter,
|
|
11
12
|
DefaultThemePageData,
|
|
12
|
-
NavLink
|
|
13
|
+
NavLink,
|
|
13
14
|
} from '../../shared'
|
|
14
15
|
import { useThemeLocaleData } from '../composables'
|
|
15
16
|
import { resolveEditLink } from '../utils'
|
|
16
|
-
import NavLink from './NavLink.vue'
|
|
17
17
|
|
|
18
|
-
const useEditNavLink = (): ComputedRef<null |
|
|
18
|
+
const useEditNavLink = (): ComputedRef<null | NavLink> => {
|
|
19
19
|
const themeLocale = useThemeLocaleData()
|
|
20
20
|
const page = usePageData<DefaultThemePageData>()
|
|
21
21
|
const frontmatter = usePageFrontmatter<DefaultThemeNormalPageFrontmatter>()
|
|
@@ -56,7 +56,6 @@ const useEditNavLink = (): ComputedRef<null | NavLinkType> => {
|
|
|
56
56
|
}
|
|
57
57
|
|
|
58
58
|
const useLastUpdated = (): ComputedRef<null | string> => {
|
|
59
|
-
const siteLocale = useSiteLocaleData()
|
|
60
59
|
const themeLocale = useThemeLocaleData()
|
|
61
60
|
const page = usePageData<DefaultThemePageData>()
|
|
62
61
|
const frontmatter = usePageFrontmatter<DefaultThemeNormalPageFrontmatter>()
|
|
@@ -101,7 +100,7 @@ const contributors = useContributors()
|
|
|
101
100
|
<template>
|
|
102
101
|
<footer class="page-meta">
|
|
103
102
|
<div v-if="editNavLink" class="meta-item edit-link">
|
|
104
|
-
<
|
|
103
|
+
<AutoLink class="meta-item-label" :item="editNavLink" />
|
|
105
104
|
</div>
|
|
106
105
|
|
|
107
106
|
<div v-if="lastUpdated" class="meta-item last-updated">
|
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import AutoLink from '@theme/AutoLink.vue'
|
|
2
3
|
import { usePageFrontmatter } from '@vuepress/client'
|
|
3
4
|
import { isPlainObject, isString } from '@vuepress/shared'
|
|
4
5
|
import { computed } from 'vue'
|
|
5
6
|
import { useRoute } from 'vue-router'
|
|
6
7
|
import type {
|
|
7
8
|
DefaultThemeNormalPageFrontmatter,
|
|
8
|
-
NavLink
|
|
9
|
+
NavLink,
|
|
9
10
|
ResolvedSidebarItem,
|
|
10
11
|
} from '../../shared'
|
|
11
12
|
import { useNavLink, useSidebarItems } from '../composables'
|
|
12
|
-
import NavLink from './NavLink.vue'
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Resolve `prev` or `next` config from frontmatter
|
|
16
16
|
*/
|
|
17
17
|
const resolveFromFrontmatterConfig = (
|
|
18
18
|
conf: unknown
|
|
19
|
-
): null | false |
|
|
19
|
+
): null | false | NavLink => {
|
|
20
20
|
if (conf === false) {
|
|
21
21
|
return null
|
|
22
22
|
}
|
|
@@ -25,7 +25,7 @@ const resolveFromFrontmatterConfig = (
|
|
|
25
25
|
return useNavLink(conf)
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
if (isPlainObject<
|
|
28
|
+
if (isPlainObject<NavLink>(conf)) {
|
|
29
29
|
return conf
|
|
30
30
|
}
|
|
31
31
|
|
|
@@ -39,14 +39,14 @@ const resolveFromSidebarItems = (
|
|
|
39
39
|
sidebarItems: ResolvedSidebarItem[],
|
|
40
40
|
currentPath: string,
|
|
41
41
|
offset: number
|
|
42
|
-
): null |
|
|
42
|
+
): null | NavLink => {
|
|
43
43
|
const index = sidebarItems.findIndex((item) => item.link === currentPath)
|
|
44
44
|
if (index !== -1) {
|
|
45
45
|
const targetItem = sidebarItems[index + offset]
|
|
46
46
|
if (!targetItem?.link) {
|
|
47
47
|
return null
|
|
48
48
|
}
|
|
49
|
-
return targetItem as
|
|
49
|
+
return targetItem as NavLink
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
for (const item of sidebarItems) {
|
|
@@ -92,11 +92,11 @@ const nextNavLink = computed(() => {
|
|
|
92
92
|
<nav v-if="prevNavLink || nextNavLink" class="page-nav">
|
|
93
93
|
<p class="inner">
|
|
94
94
|
<span v-if="prevNavLink" class="prev">
|
|
95
|
-
<
|
|
95
|
+
<AutoLink :item="prevNavLink" />
|
|
96
96
|
</span>
|
|
97
97
|
|
|
98
98
|
<span v-if="nextNavLink" class="next">
|
|
99
|
-
<
|
|
99
|
+
<AutoLink :item="nextNavLink" />
|
|
100
100
|
</span>
|
|
101
101
|
</p>
|
|
102
102
|
</nav>
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import SidebarItems from '
|
|
2
|
+
import NavbarItems from '@theme/NavbarItems.vue'
|
|
3
|
+
import SidebarItems from '@theme/SidebarItems.vue'
|
|
4
4
|
</script>
|
|
5
5
|
|
|
6
6
|
<template>
|
|
7
7
|
<aside class="sidebar">
|
|
8
|
-
<
|
|
8
|
+
<NavbarItems />
|
|
9
9
|
<slot name="top" />
|
|
10
10
|
<SidebarItems />
|
|
11
11
|
<slot name="bottom" />
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import AutoLink from '@theme/AutoLink.vue'
|
|
3
|
+
import DropdownTransition from '@theme/DropdownTransition.vue'
|
|
2
4
|
import { computed, ref, toRefs } from 'vue'
|
|
3
5
|
import type { PropType } from 'vue'
|
|
4
6
|
import { useRoute, useRouter } from 'vue-router'
|
|
5
7
|
import type { ResolvedSidebarItem } from '../../shared'
|
|
6
8
|
import { isActiveSidebarItem } from '../utils'
|
|
7
|
-
import DropdownTransition from './DropdownTransition.vue'
|
|
8
|
-
import NavLink from './NavLink.vue'
|
|
9
9
|
|
|
10
10
|
const props = defineProps({
|
|
11
11
|
item: {
|
|
@@ -49,21 +49,32 @@ if (item.value.collapsible) {
|
|
|
49
49
|
</script>
|
|
50
50
|
|
|
51
51
|
<template>
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
class="
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
52
|
+
<li>
|
|
53
|
+
<AutoLink v-if="item.link" :class="itemClass" :item="item" />
|
|
54
|
+
<p
|
|
55
|
+
v-else
|
|
56
|
+
tabindex="0"
|
|
57
|
+
:class="itemClass"
|
|
58
|
+
@click="onClick"
|
|
59
|
+
@keydown.enter="onClick"
|
|
60
|
+
>
|
|
61
|
+
{{ item.text }}
|
|
62
|
+
<span
|
|
63
|
+
v-if="item.collapsible"
|
|
64
|
+
class="arrow"
|
|
65
|
+
:class="isOpen ? 'down' : 'right'"
|
|
66
|
+
/>
|
|
67
|
+
</p>
|
|
61
68
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
+
<DropdownTransition v-if="item.children?.length">
|
|
70
|
+
<ul v-show="isOpen" class="sidebar-item-children">
|
|
71
|
+
<SidebarItem
|
|
72
|
+
v-for="child in item.children"
|
|
73
|
+
:key="`${depth}${child.text}${child.link}`"
|
|
74
|
+
:item="child"
|
|
75
|
+
:depth="depth + 1"
|
|
76
|
+
/>
|
|
77
|
+
</ul>
|
|
78
|
+
</DropdownTransition>
|
|
79
|
+
</li>
|
|
69
80
|
</template>
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { VNode } from 'vue';
|
|
2
2
|
declare const _default: import("vue").DefineComponent<{}, () => VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
3
3
|
[key: string]: any;
|
|
4
|
-
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<{}
|
|
4
|
+
}> | null, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, import("vue").EmitsOptions, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{}>>, {}>;
|
|
5
5
|
export default _default;
|
package/lib/client/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DefaultThemeData, DefaultThemeHomePageFrontmatter, DefaultThemeLocaleData, DefaultThemeLocaleOptions, DefaultThemeNormalPageFrontmatter, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemePluginsOptions, NavbarConfig, NavbarGroup, NavbarItem, NavGroup, NavItem, NavLink, ResolvedNavbarItem, ResolvedSidebarItem, SidebarConfig, SidebarConfigArray, SidebarConfigObject, SidebarItem } from '../shared';
|
|
2
|
-
export type {
|
|
1
|
+
import type { DefaultThemeData, DefaultThemeHomePageFrontmatter, DefaultThemeLocaleData, DefaultThemeLocaleOptions, DefaultThemeNormalPageFrontmatter, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemePluginsOptions, NavbarConfig, NavbarGroup, NavbarItem, NavGroup, NavItem, NavLink, ResolvedNavbarItem, ResolvedSidebarItem, SidebarConfig, SidebarConfigArray, SidebarConfigObject, SidebarGroup, SidebarGroupCollapsible, SidebarItem } from '../shared';
|
|
2
|
+
export type { DefaultThemeData, DefaultThemeHomePageFrontmatter, DefaultThemeLocaleData, DefaultThemeLocaleOptions, DefaultThemeNormalPageFrontmatter, DefaultThemePageData, DefaultThemePageFrontmatter, DefaultThemePluginsOptions, NavbarConfig, NavbarGroup, NavbarItem, NavGroup, NavItem, NavLink, ResolvedNavbarItem, ResolvedSidebarItem, SidebarConfig, SidebarConfigArray, SidebarConfigObject, SidebarGroup, SidebarGroupCollapsible, SidebarItem, };
|
|
3
3
|
export * from './composables';
|
|
4
4
|
export * from './utils';
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
+
import Home from '@theme/Home.vue'
|
|
3
|
+
import Navbar from '@theme/Navbar.vue'
|
|
4
|
+
import Page from '@theme/Page.vue'
|
|
5
|
+
import Sidebar from '@theme/Sidebar.vue'
|
|
2
6
|
import { usePageData, usePageFrontmatter } from '@vuepress/client'
|
|
3
7
|
import { computed, onMounted, onUnmounted, ref, Transition } from 'vue'
|
|
4
8
|
import { useRouter } from 'vue-router'
|
|
5
9
|
import type { DefaultThemePageFrontmatter } from '../../shared'
|
|
6
|
-
import Home from '../components/Home.vue'
|
|
7
|
-
import Navbar from '../components/Navbar.vue'
|
|
8
|
-
import Page from '../components/Page.vue'
|
|
9
|
-
import Sidebar from '../components/Sidebar.vue'
|
|
10
10
|
import {
|
|
11
11
|
useScrollPromise,
|
|
12
12
|
useSidebarItems,
|
|
@@ -7,13 +7,12 @@
|
|
|
7
7
|
@use 'code';
|
|
8
8
|
@use 'code-group';
|
|
9
9
|
@use 'custom-container';
|
|
10
|
-
@use 'dropdown';
|
|
11
10
|
@use 'home';
|
|
12
11
|
@use 'layout';
|
|
13
12
|
@use 'navbar';
|
|
13
|
+
@use 'navbar-dropdown';
|
|
14
14
|
@use 'page';
|
|
15
15
|
@use 'sidebar';
|
|
16
|
-
@use 'sr-only';
|
|
17
16
|
@use 'toc';
|
|
18
17
|
@use 'transitions';
|
|
19
18
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
@import '_mixins';
|
|
2
2
|
@import '_variables';
|
|
3
3
|
|
|
4
|
-
.dropdown-wrapper {
|
|
4
|
+
.navbar-dropdown-wrapper {
|
|
5
5
|
cursor: pointer;
|
|
6
6
|
|
|
7
|
-
.dropdown-title {
|
|
7
|
+
.navbar-dropdown-title {
|
|
8
8
|
display: block;
|
|
9
9
|
font-size: 0.9rem;
|
|
10
10
|
font-family: inherit;
|
|
@@ -27,8 +27,8 @@
|
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
-
.
|
|
31
|
-
@extend .dropdown-title;
|
|
30
|
+
.navbar-dropdown-title-mobile {
|
|
31
|
+
@extend .navbar-dropdown-title;
|
|
32
32
|
display: none;
|
|
33
33
|
font-weight: 600;
|
|
34
34
|
font-size: inherit;
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
}
|
|
38
38
|
}
|
|
39
39
|
|
|
40
|
-
.
|
|
41
|
-
.dropdown-item {
|
|
40
|
+
.navbar-dropdown {
|
|
41
|
+
.navbar-dropdown-item {
|
|
42
42
|
color: inherit;
|
|
43
43
|
line-height: 1.7rem;
|
|
44
44
|
|
|
45
|
-
.dropdown-subtitle {
|
|
45
|
+
.navbar-dropdown-subtitle {
|
|
46
46
|
margin: 0.45rem 0 0;
|
|
47
47
|
border-top: 1px solid var(--c-border);
|
|
48
48
|
padding: 1rem 0 0.45rem 0;
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
}
|
|
63
63
|
}
|
|
64
64
|
|
|
65
|
-
.dropdown-subitem-wrapper {
|
|
65
|
+
.navbar-dropdown-subitem-wrapper {
|
|
66
66
|
padding: 0;
|
|
67
67
|
list-style: none;
|
|
68
68
|
|
|
69
|
-
.dropdown-subitem {
|
|
69
|
+
.navbar-dropdown-subitem {
|
|
70
70
|
font-size: 0.9em;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
&:first-child .dropdown-subtitle {
|
|
104
|
+
&:first-child .navbar-dropdown-subtitle {
|
|
105
105
|
margin-top: 0;
|
|
106
106
|
padding-top: 0;
|
|
107
107
|
border-top: 0;
|
|
@@ -111,37 +111,37 @@
|
|
|
111
111
|
}
|
|
112
112
|
|
|
113
113
|
@media (max-width: $MQMobile) {
|
|
114
|
-
.dropdown-wrapper {
|
|
115
|
-
&.open .dropdown-title {
|
|
114
|
+
.navbar-dropdown-wrapper {
|
|
115
|
+
&.open .navbar-dropdown-title {
|
|
116
116
|
margin-bottom: 0.5rem;
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
-
.dropdown-title {
|
|
119
|
+
.navbar-dropdown-title {
|
|
120
120
|
display: none;
|
|
121
121
|
}
|
|
122
122
|
|
|
123
|
-
.
|
|
123
|
+
.navbar-dropdown-title-mobile {
|
|
124
124
|
display: block;
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
.
|
|
127
|
+
.navbar-dropdown {
|
|
128
128
|
@include dropdown_wrapper;
|
|
129
129
|
|
|
130
|
-
.dropdown-item {
|
|
131
|
-
.dropdown-subtitle {
|
|
130
|
+
.navbar-dropdown-item {
|
|
131
|
+
.navbar-dropdown-subtitle {
|
|
132
132
|
border-top: 0;
|
|
133
133
|
margin-top: 0;
|
|
134
134
|
padding-top: 0;
|
|
135
135
|
padding-bottom: 0;
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
-
.dropdown-subtitle,
|
|
138
|
+
.navbar-dropdown-subtitle,
|
|
139
139
|
& > a {
|
|
140
140
|
font-size: 15px;
|
|
141
141
|
line-height: 2rem;
|
|
142
142
|
}
|
|
143
143
|
|
|
144
|
-
.dropdown-subitem {
|
|
144
|
+
.navbar-dropdown-subitem {
|
|
145
145
|
font-size: 14px;
|
|
146
146
|
padding-left: 1rem;
|
|
147
147
|
}
|
|
@@ -151,11 +151,11 @@
|
|
|
151
151
|
}
|
|
152
152
|
|
|
153
153
|
@media (min-width: ($MQMobile + 1)) {
|
|
154
|
-
.dropdown-wrapper {
|
|
154
|
+
.navbar-dropdown-wrapper {
|
|
155
155
|
height: 1.8rem;
|
|
156
156
|
|
|
157
|
-
&:hover .
|
|
158
|
-
&.open .
|
|
157
|
+
&:hover .navbar-dropdown,
|
|
158
|
+
&.open .navbar-dropdown {
|
|
159
159
|
// override the inline style.
|
|
160
160
|
display: block !important;
|
|
161
161
|
}
|
|
@@ -164,7 +164,7 @@
|
|
|
164
164
|
display: none;
|
|
165
165
|
}
|
|
166
166
|
|
|
167
|
-
.
|
|
167
|
+
.navbar-dropdown {
|
|
168
168
|
display: none;
|
|
169
169
|
// Avoid height shaked by clicking
|
|
170
170
|
height: auto !important;
|
|
@@ -185,11 +185,3 @@
|
|
|
185
185
|
}
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
|
|
189
|
-
/**
|
|
190
|
-
* transition
|
|
191
|
-
*/
|
|
192
|
-
.dropdown-enter-from,
|
|
193
|
-
.dropdown-leave-to {
|
|
194
|
-
height: 0 !important;
|
|
195
|
-
}
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
position: relative;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
|
-
.navbar-
|
|
24
|
+
.navbar-items-wrapper {
|
|
25
25
|
display: flex;
|
|
26
26
|
position: absolute;
|
|
27
27
|
box-sizing: border-box;
|
|
@@ -57,9 +57,9 @@
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* navbar-
|
|
60
|
+
* navbar-items
|
|
61
61
|
*/
|
|
62
|
-
.navbar-
|
|
62
|
+
.navbar-items {
|
|
63
63
|
display: inline-block;
|
|
64
64
|
|
|
65
65
|
a {
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
|
|
76
|
-
.navbar-
|
|
76
|
+
.navbar-item {
|
|
77
77
|
position: relative;
|
|
78
78
|
display: inline-block;
|
|
79
79
|
margin-left: 1.5rem;
|
|
@@ -86,22 +86,22 @@
|
|
|
86
86
|
}
|
|
87
87
|
|
|
88
88
|
@media (max-width: $MQMobile) {
|
|
89
|
-
.navbar-
|
|
90
|
-
.navbar-
|
|
89
|
+
.navbar-items {
|
|
90
|
+
.navbar-item {
|
|
91
91
|
margin-left: 0;
|
|
92
92
|
}
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
95
|
|
|
96
96
|
@media (min-width: $MQMobile) {
|
|
97
|
-
.navbar-
|
|
97
|
+
.navbar-items a {
|
|
98
98
|
&:hover,
|
|
99
99
|
&.router-link-active {
|
|
100
100
|
color: var(--c-text);
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
.navbar-
|
|
104
|
+
.navbar-item > a {
|
|
105
105
|
&:hover,
|
|
106
106
|
&.router-link-active {
|
|
107
107
|
margin-bottom: -2px;
|
|
@@ -171,3 +171,7 @@
|
|
|
171
171
|
height: 1.25rem;
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
|
+
|
|
175
|
+
.DocSearch {
|
|
176
|
+
transition: background-color var(--t-color);
|
|
177
|
+
}
|
|
@@ -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
|
}
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
display: inline-block;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
.navbar-
|
|
15
|
+
.navbar-items {
|
|
16
16
|
display: none;
|
|
17
17
|
border-bottom: 1px solid var(--c-border);
|
|
18
18
|
transition: border-color var(--t-color);
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
font-weight: 600;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
.navbar-
|
|
25
|
+
.navbar-item {
|
|
26
26
|
display: block;
|
|
27
27
|
line-height: 1.25rem;
|
|
28
28
|
font-size: 1.1em;
|
|
@@ -37,12 +37,12 @@
|
|
|
37
37
|
|
|
38
38
|
@media (max-width: $MQMobile) {
|
|
39
39
|
.sidebar {
|
|
40
|
-
.navbar-
|
|
40
|
+
.navbar-items {
|
|
41
41
|
display: block;
|
|
42
42
|
|
|
43
|
-
.dropdown-wrapper
|
|
44
|
-
.
|
|
45
|
-
.dropdown-item
|
|
43
|
+
.navbar-dropdown-wrapper
|
|
44
|
+
.navbar-dropdown
|
|
45
|
+
.navbar-dropdown-item
|
|
46
46
|
a.router-link-active::after {
|
|
47
47
|
top: calc(1rem - 2px);
|
|
48
48
|
}
|
|
@@ -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
|
|
|
@@ -1,11 +1,20 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* dropdown
|
|
3
|
+
*/
|
|
4
|
+
.dropdown-enter-from,
|
|
5
|
+
.dropdown-leave-to {
|
|
6
|
+
height: 0 !important;
|
|
3
7
|
}
|
|
4
8
|
|
|
9
|
+
/**
|
|
10
|
+
* fade-slide-y
|
|
11
|
+
*/
|
|
12
|
+
.fade-slide-y-enter-active {
|
|
13
|
+
transition: all 0.2s ease;
|
|
14
|
+
}
|
|
5
15
|
.fade-slide-y-leave-active {
|
|
6
|
-
transition: all 0.
|
|
16
|
+
transition: all 0.2s cubic-bezier(1, 0.5, 0.8, 1);
|
|
7
17
|
}
|
|
8
|
-
|
|
9
18
|
.fade-slide-y-enter-from,
|
|
10
19
|
.fade-slide-y-leave-to {
|
|
11
20
|
transform: translateY(10px);
|
package/lib/node/defaultTheme.js
CHANGED
|
@@ -18,6 +18,15 @@ const defaultTheme = ({ themePlugins = {}, ...localeOptions }, app) => {
|
|
|
18
18
|
return {
|
|
19
19
|
name: '@vuepress/theme-default',
|
|
20
20
|
layouts: utils_1.path.resolve(__dirname, '../client/layouts'),
|
|
21
|
+
templateBuild: utils_1.path.resolve(__dirname, '../../templates/index.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
|
+
])),
|
|
21
30
|
clientAppEnhanceFiles: utils_1.path.resolve(__dirname, '../client/clientAppEnhance.js'),
|
|
22
31
|
clientAppSetupFiles: utils_1.path.resolve(__dirname, '../client/clientAppSetup.js'),
|
|
23
32
|
extendsPage: (page) => {
|
|
@@ -56,7 +65,10 @@ const defaultTheme = ({ themePlugins = {}, ...localeOptions }, app) => {
|
|
|
56
65
|
'@vuepress/container',
|
|
57
66
|
(0, utils_2.resolveContainerPluginOptionsForCodeGroupItem)(themePlugins),
|
|
58
67
|
],
|
|
59
|
-
[
|
|
68
|
+
[
|
|
69
|
+
'@vuepress/external-link-icon',
|
|
70
|
+
(0, utils_2.resolveExternalLinkIconPluginOptions)(themePlugins, localeOptions),
|
|
71
|
+
],
|
|
60
72
|
['@vuepress/git', (0, utils_2.resolveGitPluginOptions)(themePlugins, localeOptions)],
|
|
61
73
|
['@vuepress/medium-zoom', (0, utils_2.resolveMediumZoomPluginOptions)(themePlugins)],
|
|
62
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);
|
|
@@ -11,6 +11,8 @@ const resolveActiveHeaderLinksPluginOptions = (themePlugins) => {
|
|
|
11
11
|
return {
|
|
12
12
|
headerLinkSelector: 'a.sidebar-item',
|
|
13
13
|
headerAnchorSelector: '.header-anchor',
|
|
14
|
+
// should greater than page transition duration
|
|
15
|
+
delay: 300,
|
|
14
16
|
};
|
|
15
17
|
};
|
|
16
18
|
exports.resolveActiveHeaderLinksPluginOptions = resolveActiveHeaderLinksPluginOptions;
|
|
@@ -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;
|
|
@@ -12,7 +12,7 @@ const resolveMediumZoomPluginOptions = (themePlugins) => {
|
|
|
12
12
|
selector: '.theme-default-content > img, .theme-default-content :not(a) > img',
|
|
13
13
|
zoomOptions: {},
|
|
14
14
|
// should greater than page transition duration
|
|
15
|
-
delay:
|
|
15
|
+
delay: 300,
|
|
16
16
|
};
|
|
17
17
|
};
|
|
18
18
|
exports.resolveMediumZoomPluginOptions = resolveMediumZoomPluginOptions;
|
package/lib/shared/nav.d.ts
CHANGED
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.35",
|
|
4
4
|
"description": "Default theme of VuePress",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"vuepress-theme",
|
|
@@ -21,7 +21,8 @@
|
|
|
21
21
|
"main": "lib/node/index.js",
|
|
22
22
|
"types": "lib/node/index.d.ts",
|
|
23
23
|
"files": [
|
|
24
|
-
"lib"
|
|
24
|
+
"lib",
|
|
25
|
+
"templates"
|
|
25
26
|
],
|
|
26
27
|
"scripts": {
|
|
27
28
|
"build": "tsc -b tsconfig.build.json",
|
|
@@ -29,28 +30,28 @@
|
|
|
29
30
|
"copy": "cpx \"src/**/*.{d.ts,vue,scss}\" lib"
|
|
30
31
|
},
|
|
31
32
|
"dependencies": {
|
|
32
|
-
"@vuepress/client": "2.0.0-beta.
|
|
33
|
-
"@vuepress/core": "2.0.0-beta.
|
|
34
|
-
"@vuepress/plugin-active-header-links": "2.0.0-beta.
|
|
35
|
-
"@vuepress/plugin-back-to-top": "2.0.0-beta.
|
|
36
|
-
"@vuepress/plugin-container": "2.0.0-beta.
|
|
37
|
-
"@vuepress/plugin-external-link-icon": "2.0.0-beta.
|
|
38
|
-
"@vuepress/plugin-git": "2.0.0-beta.
|
|
39
|
-
"@vuepress/plugin-medium-zoom": "2.0.0-beta.
|
|
40
|
-
"@vuepress/plugin-nprogress": "2.0.0-beta.
|
|
41
|
-
"@vuepress/plugin-palette": "2.0.0-beta.
|
|
42
|
-
"@vuepress/plugin-prismjs": "2.0.0-beta.
|
|
43
|
-
"@vuepress/plugin-theme-data": "2.0.0-beta.
|
|
44
|
-
"@vuepress/shared": "2.0.0-beta.
|
|
45
|
-
"@vuepress/utils": "2.0.0-beta.
|
|
46
|
-
"@vueuse/core": "^7.
|
|
47
|
-
"sass": "^1.
|
|
33
|
+
"@vuepress/client": "2.0.0-beta.35",
|
|
34
|
+
"@vuepress/core": "2.0.0-beta.35",
|
|
35
|
+
"@vuepress/plugin-active-header-links": "2.0.0-beta.35",
|
|
36
|
+
"@vuepress/plugin-back-to-top": "2.0.0-beta.35",
|
|
37
|
+
"@vuepress/plugin-container": "2.0.0-beta.35",
|
|
38
|
+
"@vuepress/plugin-external-link-icon": "2.0.0-beta.35",
|
|
39
|
+
"@vuepress/plugin-git": "2.0.0-beta.35",
|
|
40
|
+
"@vuepress/plugin-medium-zoom": "2.0.0-beta.35",
|
|
41
|
+
"@vuepress/plugin-nprogress": "2.0.0-beta.35",
|
|
42
|
+
"@vuepress/plugin-palette": "2.0.0-beta.35",
|
|
43
|
+
"@vuepress/plugin-prismjs": "2.0.0-beta.35",
|
|
44
|
+
"@vuepress/plugin-theme-data": "2.0.0-beta.35",
|
|
45
|
+
"@vuepress/shared": "2.0.0-beta.35",
|
|
46
|
+
"@vuepress/utils": "2.0.0-beta.35",
|
|
47
|
+
"@vueuse/core": "^7.5.4",
|
|
48
|
+
"sass": "^1.49.0",
|
|
48
49
|
"sass-loader": "^12.4.0",
|
|
49
|
-
"vue": "^3.2.
|
|
50
|
+
"vue": "^3.2.28",
|
|
50
51
|
"vue-router": "^4.0.12"
|
|
51
52
|
},
|
|
52
53
|
"publishConfig": {
|
|
53
54
|
"access": "public"
|
|
54
55
|
},
|
|
55
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "4bf1c55b6fb863c9251aa80178d5bc6475f5b315"
|
|
56
57
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html lang="{{ lang }}">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="utf-8">
|
|
5
|
+
<meta name="viewport" content="width=device-width,initial-scale=1">
|
|
6
|
+
<meta name="generator" content="VuePress {{ version }}">
|
|
7
|
+
<style>
|
|
8
|
+
:root {
|
|
9
|
+
--c-bg: #fff;
|
|
10
|
+
}
|
|
11
|
+
html.dark {
|
|
12
|
+
--c-bg: #22272e;
|
|
13
|
+
}
|
|
14
|
+
html, body {
|
|
15
|
+
background-color: var(--c-bg);
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
18
|
+
<script>
|
|
19
|
+
const userMode = localStorage.getItem('vuepress-color-scheme');
|
|
20
|
+
const systemDarkMode = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches;
|
|
21
|
+
if (userMode === 'dark' || (userMode !== 'light' && systemDarkMode)) {
|
|
22
|
+
document.documentElement.classList.toggle('dark', true);
|
|
23
|
+
}
|
|
24
|
+
</script>
|
|
25
|
+
<!--vuepress-ssr-head-->
|
|
26
|
+
<!--vuepress-ssr-resources-->
|
|
27
|
+
<!--vuepress-ssr-styles-->
|
|
28
|
+
</head>
|
|
29
|
+
<body>
|
|
30
|
+
<div id="app"><!--vuepress-ssr-app--></div>
|
|
31
|
+
<!--vuepress-ssr-scripts-->
|
|
32
|
+
</body>
|
|
33
|
+
</html>
|
|
@@ -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>
|