@vuepress/theme-default 2.0.0-rc.9 → 2.0.0-rc.90
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/VPAutoLink.vue +32 -0
- package/lib/client/components/VPDarkIcon.vue +8 -0
- package/lib/client/components/VPDropdownTransition.vue +43 -0
- package/lib/client/components/VPEditIcon.vue +12 -0
- package/lib/client/components/VPFadeSlideYTransition.vue +43 -0
- package/lib/client/components/VPHome.vue +37 -0
- package/lib/client/components/VPHomeFeatures.vue +65 -0
- package/lib/client/components/{HomeFooter.vue → VPHomeFooter.vue} +16 -3
- package/lib/client/components/VPHomeHero.vue +185 -0
- package/lib/client/components/VPLightIcon.vue +28 -0
- package/lib/client/components/VPNavbar.vue +134 -0
- package/lib/client/components/{NavbarBrand.vue → VPNavbarBrand.vue} +41 -16
- package/lib/client/components/VPNavbarDropdown.vue +328 -0
- package/lib/client/components/VPNavbarItems.vue +111 -0
- package/lib/client/components/VPPage.vue +69 -0
- package/lib/client/components/VPPageMeta.vue +139 -0
- package/lib/client/components/VPPageNav.vue +123 -0
- package/lib/client/components/VPSidebar.vue +120 -0
- package/lib/client/components/VPSidebarItem.vue +189 -0
- package/lib/client/components/{SidebarItems.vue → VPSidebarItems.vue} +27 -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 +7 -1
- package/lib/client/composables/index.js +7 -1
- package/lib/client/composables/useDarkMode.d.ts +0 -1
- package/lib/client/composables/useDarkMode.js +19 -16
- package/lib/client/composables/useData.d.ts +13 -0
- package/lib/client/composables/useData.js +15 -0
- package/lib/client/composables/useEditLink.d.ts +3 -0
- package/lib/client/composables/useEditLink.js +28 -0
- package/lib/client/composables/useHeaders.d.ts +9 -0
- package/lib/client/composables/useHeaders.js +38 -0
- package/lib/client/composables/useNavbarConfig.d.ts +3 -0
- package/lib/client/composables/useNavbarConfig.js +29 -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 +55 -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 +90 -0
- package/lib/client/composables/useScrollPromise.js +3 -1
- package/lib/client/composables/useSidebarItems.d.ts +21 -21
- package/lib/client/composables/useSidebarItems.js +96 -86
- 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 +8 -23
- package/lib/client/index.d.ts +2 -1
- package/lib/client/index.js +0 -1
- package/lib/client/layouts/Layout.vue +128 -56
- package/lib/client/layouts/NotFound.vue +25 -11
- package/lib/client/shim.d.ts +6 -5
- package/lib/client/styles/_mixins.scss +4 -4
- package/lib/client/styles/_variables.module.scss +1 -1
- package/lib/client/styles/_variables.scss +2 -1
- package/lib/client/styles/arrow.scss +24 -22
- package/lib/client/styles/code-group.scss +34 -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 +36 -0
- package/lib/client/styles/index.scss +3 -13
- package/lib/client/styles/layout.scss +5 -197
- 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 +54 -130
- package/lib/client/typings.d.ts +13 -0
- package/lib/client/typings.js +1 -0
- package/lib/client/utils/index.d.ts +2 -2
- package/lib/client/utils/index.js +2 -2
- package/lib/client/utils/isActiveSidebarItem.d.ts +3 -3
- package/lib/client/utils/isActiveSidebarItem.js +1 -1
- package/lib/client/utils/resolveAutoLink.d.ts +9 -0
- package/lib/client/utils/resolveAutoLink.js +17 -0
- package/lib/client/utils/resolveEditLink.d.ts +3 -3
- package/lib/client/utils/resolveEditLink.js +3 -3
- 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 +57 -64
- package/lib/node/index.d.ts +2 -3
- package/lib/node/index.js +0 -3
- package/lib/node/typings.d.ts +59 -0
- package/lib/node/typings.js +1 -0
- package/lib/node/utils/assignDefaultLocaleOptions.js +3 -8
- 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 -66
- 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 +29 -27
- package/templates/build.html +16 -10
- 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/HomeHero.vue +0 -97
- 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/composables/useThemeData.d.ts +0 -4
- package/lib/client/composables/useThemeData.js +0 -3
- 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,40 +1,37 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
useThemeLocaleData,
|
|
14
|
-
} from '../composables/index.js'
|
|
2
|
+
import VPFadeSlideYTransition from '@theme/VPFadeSlideYTransition.vue'
|
|
3
|
+
import VPHome from '@theme/VPHome.vue'
|
|
4
|
+
import VPNavbar from '@theme/VPNavbar.vue'
|
|
5
|
+
import VPPage from '@theme/VPPage.vue'
|
|
6
|
+
import VPSidebar from '@theme/VPSidebar.vue'
|
|
7
|
+
import { useData } from '@theme/useData'
|
|
8
|
+
import { useScrollPromise } from '@theme/useScrollPromise'
|
|
9
|
+
import { useSidebarItems } from '@theme/useSidebarItems'
|
|
10
|
+
import type { VNode } from 'vue'
|
|
11
|
+
import { computed, ref } from 'vue'
|
|
12
|
+
import { onContentUpdated } from 'vuepress/client'
|
|
15
13
|
|
|
16
14
|
defineSlots<{
|
|
17
|
-
'navbar'?: (props: Record<never, never>) =>
|
|
18
|
-
'navbar-before'?: (props: Record<never, never>) =>
|
|
19
|
-
'navbar-after'?: (props: Record<never, never>) =>
|
|
20
|
-
'sidebar'?: (props: Record<never, never>) =>
|
|
21
|
-
'sidebar-top'?: (props: Record<never, never>) =>
|
|
22
|
-
'sidebar-bottom'?: (props: Record<never, never>) =>
|
|
23
|
-
'page'?: (props: Record<never, never>) =>
|
|
24
|
-
'page-top'?: (props: Record<never, never>) =>
|
|
25
|
-
'page-bottom'?: (props: Record<never, never>) =>
|
|
26
|
-
'page-content-top'?: (props: Record<never, never>) =>
|
|
27
|
-
'page-content-bottom'?: (
|
|
15
|
+
'navbar'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
16
|
+
'navbar-before'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
17
|
+
'navbar-after'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
18
|
+
'sidebar'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
19
|
+
'sidebar-top'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
20
|
+
'sidebar-bottom'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
21
|
+
'page'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
22
|
+
'page-top'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
23
|
+
'page-bottom'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
24
|
+
'page-content-top'?: (props: Record<never, never>) => VNode | VNode[] | null
|
|
25
|
+
'page-content-bottom'?: (
|
|
26
|
+
props: Record<never, never>,
|
|
27
|
+
) => VNode | VNode[] | null
|
|
28
28
|
}>()
|
|
29
29
|
|
|
30
|
-
const page =
|
|
31
|
-
const frontmatter = usePageFrontmatter<DefaultThemePageFrontmatter>()
|
|
32
|
-
const themeLocale = useThemeLocaleData()
|
|
30
|
+
const { frontmatter, page, themeLocale } = useData()
|
|
33
31
|
|
|
34
32
|
// navbar
|
|
35
33
|
const shouldShowNavbar = computed(
|
|
36
|
-
() =>
|
|
37
|
-
frontmatter.value.navbar !== false && themeLocale.value.navbar !== false,
|
|
34
|
+
() => frontmatter.value.navbar ?? themeLocale.value.navbar ?? true,
|
|
38
35
|
)
|
|
39
36
|
|
|
40
37
|
// sidebar
|
|
@@ -44,11 +41,11 @@ const toggleSidebar = (to?: boolean): void => {
|
|
|
44
41
|
isSidebarOpen.value = typeof to === 'boolean' ? to : !isSidebarOpen.value
|
|
45
42
|
}
|
|
46
43
|
const touchStart = { x: 0, y: 0 }
|
|
47
|
-
const onTouchStart = (e): void => {
|
|
44
|
+
const onTouchStart = (e: TouchEvent): void => {
|
|
48
45
|
touchStart.x = e.changedTouches[0].clientX
|
|
49
46
|
touchStart.y = e.changedTouches[0].clientY
|
|
50
47
|
}
|
|
51
|
-
const onTouchEnd = (e): void => {
|
|
48
|
+
const onTouchEnd = (e: TouchEvent): void => {
|
|
52
49
|
const dx = e.changedTouches[0].clientX - touchStart.x
|
|
53
50
|
const dy = e.changedTouches[0].clientY - touchStart.y
|
|
54
51
|
if (Math.abs(dx) > Math.abs(dy) && Math.abs(dx) > 40) {
|
|
@@ -60,26 +57,28 @@ const onTouchEnd = (e): void => {
|
|
|
60
57
|
}
|
|
61
58
|
}
|
|
62
59
|
|
|
60
|
+
// external-link-icon
|
|
61
|
+
const enableExternalLinkIcon = computed(
|
|
62
|
+
() =>
|
|
63
|
+
frontmatter.value.externalLinkIcon ??
|
|
64
|
+
themeLocale.value.externalLinkIcon ??
|
|
65
|
+
true,
|
|
66
|
+
)
|
|
67
|
+
|
|
63
68
|
// classes
|
|
64
69
|
const containerClass = computed(() => [
|
|
65
70
|
{
|
|
66
71
|
'no-navbar': !shouldShowNavbar.value,
|
|
67
72
|
'no-sidebar': !sidebarItems.value.length,
|
|
68
73
|
'sidebar-open': isSidebarOpen.value,
|
|
74
|
+
'external-link-icon': enableExternalLinkIcon.value,
|
|
69
75
|
},
|
|
70
76
|
frontmatter.value.pageClass,
|
|
71
77
|
])
|
|
72
78
|
|
|
73
|
-
// close sidebar
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
const router = useRouter()
|
|
77
|
-
unregisterRouterHook = router.afterEach(() => {
|
|
78
|
-
toggleSidebar(false)
|
|
79
|
-
})
|
|
80
|
-
})
|
|
81
|
-
onUnmounted(() => {
|
|
82
|
-
unregisterRouterHook()
|
|
79
|
+
// close sidebar when content changes
|
|
80
|
+
onContentUpdated(() => {
|
|
81
|
+
toggleSidebar(false)
|
|
83
82
|
})
|
|
84
83
|
|
|
85
84
|
// handle scrollBehavior with transition
|
|
@@ -90,46 +89,43 @@ const onBeforeLeave = scrollPromise.pending
|
|
|
90
89
|
|
|
91
90
|
<template>
|
|
92
91
|
<div
|
|
93
|
-
class="theme-container"
|
|
92
|
+
class="vp-theme-container"
|
|
94
93
|
:class="containerClass"
|
|
94
|
+
vp-container
|
|
95
95
|
@touchstart="onTouchStart"
|
|
96
96
|
@touchend="onTouchEnd"
|
|
97
97
|
>
|
|
98
98
|
<slot name="navbar">
|
|
99
|
-
<
|
|
99
|
+
<VPNavbar v-if="shouldShowNavbar" @toggle-sidebar="toggleSidebar">
|
|
100
100
|
<template #before>
|
|
101
101
|
<slot name="navbar-before" />
|
|
102
102
|
</template>
|
|
103
103
|
<template #after>
|
|
104
104
|
<slot name="navbar-after" />
|
|
105
105
|
</template>
|
|
106
|
-
</
|
|
106
|
+
</VPNavbar>
|
|
107
107
|
</slot>
|
|
108
108
|
|
|
109
|
-
<div class="sidebar-mask" @click="toggleSidebar(false)" />
|
|
109
|
+
<div class="vp-sidebar-mask" @click="toggleSidebar(false)" />
|
|
110
110
|
|
|
111
111
|
<slot name="sidebar">
|
|
112
|
-
<
|
|
112
|
+
<VPSidebar>
|
|
113
113
|
<template #top>
|
|
114
114
|
<slot name="sidebar-top" />
|
|
115
115
|
</template>
|
|
116
116
|
<template #bottom>
|
|
117
117
|
<slot name="sidebar-bottom" />
|
|
118
118
|
</template>
|
|
119
|
-
</
|
|
119
|
+
</VPSidebar>
|
|
120
120
|
</slot>
|
|
121
121
|
|
|
122
122
|
<slot name="page">
|
|
123
|
-
<
|
|
124
|
-
|
|
125
|
-
<Transition
|
|
126
|
-
v-else
|
|
127
|
-
name="fade-slide-y"
|
|
128
|
-
mode="out-in"
|
|
123
|
+
<VPFadeSlideYTransition
|
|
129
124
|
@before-enter="onBeforeEnter"
|
|
130
125
|
@before-leave="onBeforeLeave"
|
|
131
126
|
>
|
|
132
|
-
<
|
|
127
|
+
<VPHome v-if="frontmatter.home" />
|
|
128
|
+
<VPPage v-else :key="page.path">
|
|
133
129
|
<template #top>
|
|
134
130
|
<slot name="page-top" />
|
|
135
131
|
</template>
|
|
@@ -142,8 +138,84 @@ const onBeforeLeave = scrollPromise.pending
|
|
|
142
138
|
<template #bottom>
|
|
143
139
|
<slot name="page-bottom" />
|
|
144
140
|
</template>
|
|
145
|
-
</
|
|
146
|
-
</
|
|
141
|
+
</VPPage>
|
|
142
|
+
</VPFadeSlideYTransition>
|
|
147
143
|
</slot>
|
|
148
144
|
</div>
|
|
149
145
|
</template>
|
|
146
|
+
|
|
147
|
+
<style lang="scss">
|
|
148
|
+
@use '../styles/variables' as *;
|
|
149
|
+
|
|
150
|
+
.vp-sidebar-mask {
|
|
151
|
+
position: fixed;
|
|
152
|
+
top: 0;
|
|
153
|
+
left: 0;
|
|
154
|
+
z-index: 9;
|
|
155
|
+
|
|
156
|
+
display: none;
|
|
157
|
+
|
|
158
|
+
width: 100vw;
|
|
159
|
+
height: 100vh;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
.vp-theme-container {
|
|
163
|
+
// navbar is disabled
|
|
164
|
+
&.no-navbar {
|
|
165
|
+
.vp-sidebar {
|
|
166
|
+
top: 0;
|
|
167
|
+
|
|
168
|
+
@media (max-width: $MQMobile) {
|
|
169
|
+
padding-top: 0;
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.vp-page {
|
|
174
|
+
padding-top: 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// adjust heading margin and padding;
|
|
178
|
+
[vp-content] {
|
|
179
|
+
h1,
|
|
180
|
+
h2,
|
|
181
|
+
h3,
|
|
182
|
+
h4,
|
|
183
|
+
h5,
|
|
184
|
+
h6 {
|
|
185
|
+
margin-top: 1.5rem;
|
|
186
|
+
padding-top: 0;
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
&.no-sidebar {
|
|
192
|
+
// hide sidebar
|
|
193
|
+
.vp-sidebar {
|
|
194
|
+
display: none;
|
|
195
|
+
|
|
196
|
+
// show sidebar on mobile because it has navbar links
|
|
197
|
+
@media (max-width: $MQMobile) {
|
|
198
|
+
display: block;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
.vp-page {
|
|
203
|
+
padding-inline-start: 0;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
&.sidebar-open {
|
|
208
|
+
@media (max-width: $MQMobile) {
|
|
209
|
+
// show sidebar
|
|
210
|
+
.vp-sidebar {
|
|
211
|
+
transform: translateX(0);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// show sidebar mask
|
|
215
|
+
.vp-sidebar-mask {
|
|
216
|
+
display: block;
|
|
217
|
+
}
|
|
218
|
+
}
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
</style>
|
|
@@ -1,27 +1,41 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import { useData } from '@theme/useData'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import { RouteLink } from 'vuepress/client'
|
|
4
5
|
|
|
5
|
-
const routeLocale =
|
|
6
|
-
|
|
6
|
+
const { routeLocale, themeLocale } = useData()
|
|
7
|
+
|
|
8
|
+
const messages = computed(() => themeLocale.value.notFound ?? ['Not Found'])
|
|
7
9
|
|
|
8
|
-
const messages = themeLocale.value.notFound ?? ['Not Found']
|
|
9
10
|
const getMsg = (): string =>
|
|
10
|
-
messages[Math.floor(Math.random() * messages.length)]
|
|
11
|
-
|
|
12
|
-
const
|
|
11
|
+
messages.value[Math.floor(Math.random() * messages.value.length)]
|
|
12
|
+
|
|
13
|
+
const homeLink = computed(() => themeLocale.value.home ?? routeLocale.value)
|
|
14
|
+
const homeText = computed(() => themeLocale.value.backToHome ?? 'Back to home')
|
|
13
15
|
</script>
|
|
14
16
|
|
|
15
17
|
<template>
|
|
16
|
-
<div class="theme-container">
|
|
18
|
+
<div class="vp-theme-container" vp-container>
|
|
17
19
|
<main class="page">
|
|
18
|
-
<div
|
|
20
|
+
<div vp-content>
|
|
19
21
|
<h1>404</h1>
|
|
20
22
|
|
|
21
23
|
<blockquote>{{ getMsg() }}</blockquote>
|
|
22
24
|
|
|
23
|
-
<
|
|
25
|
+
<RouteLink :to="homeLink">{{ homeText }}</RouteLink>
|
|
24
26
|
</div>
|
|
25
27
|
</main>
|
|
26
28
|
</div>
|
|
27
29
|
</template>
|
|
30
|
+
|
|
31
|
+
<style scoped lang="scss">
|
|
32
|
+
.vp-theme-container {
|
|
33
|
+
max-width: 740px;
|
|
34
|
+
margin: 0 auto;
|
|
35
|
+
padding: 2rem 2.5rem;
|
|
36
|
+
|
|
37
|
+
@media (max-width: 959px) {
|
|
38
|
+
padding: 2rem;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
</style>
|
package/lib/client/shim.d.ts
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
declare module '*.vue' {
|
|
2
2
|
import type { ComponentOptions } from 'vue'
|
|
3
|
-
|
|
4
|
-
|
|
3
|
+
|
|
4
|
+
const component: ComponentOptions
|
|
5
|
+
export default component
|
|
5
6
|
}
|
|
6
7
|
|
|
7
|
-
declare module '
|
|
8
|
-
const
|
|
9
|
-
export default
|
|
8
|
+
declare module '*/styles/_variables.module.scss' {
|
|
9
|
+
const cSSVariables: Record<string, string>
|
|
10
|
+
export default cSSVariables
|
|
10
11
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use 'variables' as *;
|
|
2
2
|
|
|
3
|
-
@mixin
|
|
3
|
+
@mixin content-wrapper {
|
|
4
4
|
max-width: var(--content-width);
|
|
5
5
|
margin: 0 auto;
|
|
6
6
|
padding: 2rem 2.5rem;
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
}
|
|
15
15
|
}
|
|
16
16
|
|
|
17
|
-
@mixin
|
|
18
|
-
transition: height 0.1s ease-out;
|
|
17
|
+
@mixin dropdown-wrapper {
|
|
19
18
|
overflow: hidden;
|
|
19
|
+
transition: height 0.1s ease-out;
|
|
20
20
|
}
|
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
.arrow {
|
|
2
2
|
display: inline-block;
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
3
|
+
vertical-align: middle;
|
|
4
|
+
|
|
5
|
+
width: 1em;
|
|
6
|
+
height: 1em;
|
|
7
|
+
|
|
8
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(0,0,0,0.5)' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z'/%3E%3C/svg%3E");
|
|
9
|
+
background-position: center;
|
|
10
|
+
background-repeat: no-repeat;
|
|
11
|
+
|
|
12
|
+
line-height: normal;
|
|
13
|
+
|
|
14
|
+
transition: all 0.3s;
|
|
15
|
+
|
|
16
|
+
[data-theme='dark'] & {
|
|
17
|
+
background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='rgba(255,255,255,0.5)' d='M7.41 15.41L12 10.83l4.59 4.58L18 14l-6-6-6 6z'/%3E%3C/svg%3E");
|
|
12
18
|
}
|
|
13
19
|
|
|
14
20
|
&.down {
|
|
15
|
-
|
|
16
|
-
left: 4px solid transparent;
|
|
17
|
-
right: 4px solid transparent;
|
|
18
|
-
top: 6px solid var(--c-bg-arrow);
|
|
19
|
-
}
|
|
21
|
+
transform: rotate(180deg);
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
&.right {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
25
|
+
transform: rotate(90deg);
|
|
26
|
+
|
|
27
|
+
[dir='rtl'] & {
|
|
28
|
+
transform: rotate(-90deg);
|
|
27
29
|
}
|
|
28
30
|
}
|
|
29
31
|
|
|
30
32
|
&.left {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
transform: rotate(-90deg);
|
|
34
|
+
|
|
35
|
+
[dir='rtl'] & {
|
|
36
|
+
transform: rotate(90deg);
|
|
35
37
|
}
|
|
36
38
|
}
|
|
37
39
|
}
|
|
@@ -1,48 +1,52 @@
|
|
|
1
|
-
@
|
|
1
|
+
@use 'variables' as *;
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* code-group
|
|
5
5
|
*/
|
|
6
|
-
.code-
|
|
6
|
+
.code-group-nav {
|
|
7
7
|
margin-top: 0.85rem;
|
|
8
|
+
|
|
8
9
|
// 2 * margin + border-radius of <pre> tag
|
|
9
10
|
margin-bottom: calc(-1.7rem - 6px);
|
|
11
|
+
padding-top: 10px;
|
|
10
12
|
padding-bottom: calc(1.7rem - 6px);
|
|
11
13
|
padding-left: 10px;
|
|
12
|
-
padding-top: 10px;
|
|
13
14
|
border-top-left-radius: 6px;
|
|
14
15
|
border-top-right-radius: 6px;
|
|
15
|
-
|
|
16
|
+
|
|
17
|
+
background-color: var(--vp-c-code-tab-bg);
|
|
18
|
+
|
|
19
|
+
transition: background-color var(--vp-t-color);
|
|
20
|
+
|
|
21
|
+
@media (max-width: $MQMobileNarrow) {
|
|
22
|
+
margin-inline: -1.5rem;
|
|
23
|
+
border-radius: 0;
|
|
24
|
+
}
|
|
16
25
|
}
|
|
17
26
|
|
|
18
|
-
.code-
|
|
19
|
-
border: 0;
|
|
27
|
+
.code-group-nav-tab {
|
|
20
28
|
padding: 5px;
|
|
21
|
-
|
|
29
|
+
border: 0;
|
|
30
|
+
|
|
22
31
|
background-color: transparent;
|
|
32
|
+
color: var(--vp-c-code-tab-title);
|
|
33
|
+
|
|
34
|
+
font-weight: 600;
|
|
23
35
|
font-size: 0.85em;
|
|
24
36
|
line-height: 1.4;
|
|
25
|
-
color: var(--c-code-group-tab-title);
|
|
26
|
-
font-weight: 600;
|
|
27
|
-
}
|
|
28
37
|
|
|
29
|
-
|
|
30
|
-
outline: none;
|
|
31
|
-
}
|
|
38
|
+
cursor: pointer;
|
|
32
39
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
40
|
+
&:focus {
|
|
41
|
+
outline: none;
|
|
42
|
+
}
|
|
36
43
|
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}
|
|
44
|
+
&:focus-visible {
|
|
45
|
+
outline: 1px solid;
|
|
46
|
+
}
|
|
40
47
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
margin-left: -1.5rem;
|
|
44
|
-
margin-right: -1.5rem;
|
|
45
|
-
border-radius: 0;
|
|
48
|
+
&.active {
|
|
49
|
+
border-bottom: var(--vp-c-code-tab-active) 1px solid;
|
|
46
50
|
}
|
|
47
51
|
}
|
|
48
52
|
|
|
@@ -51,12 +55,12 @@
|
|
|
51
55
|
*/
|
|
52
56
|
.code-group-item {
|
|
53
57
|
display: none;
|
|
54
|
-
}
|
|
55
58
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
}
|
|
59
|
+
&.active {
|
|
60
|
+
display: block;
|
|
61
|
+
}
|
|
59
62
|
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
> pre {
|
|
64
|
+
background-color: #ffa500;
|
|
65
|
+
}
|
|
62
66
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
@use '../variables' as *;
|
|
2
|
+
|
|
3
|
+
// code block additional styles
|
|
4
|
+
div[class*='language-'] {
|
|
5
|
+
margin: 0.75rem 0;
|
|
6
|
+
transition:
|
|
7
|
+
background-color var(--vp-t-color),
|
|
8
|
+
color var(--vp-t-color);
|
|
9
|
+
|
|
10
|
+
@media (max-width: $MQMobileNarrow) {
|
|
11
|
+
--code-border-radius: 0;
|
|
12
|
+
|
|
13
|
+
margin: 0.75rem -1.5rem;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
// transitions for code notation highlighting
|
|
17
|
+
.line {
|
|
18
|
+
&.diff,
|
|
19
|
+
&.highlighted {
|
|
20
|
+
transition: background-color var(--vp-t-color);
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
@use '../variables' as *;
|
|
2
|
+
|
|
3
|
+
[vp-content] {
|
|
4
|
+
h1,
|
|
5
|
+
h2,
|
|
6
|
+
h3,
|
|
7
|
+
h4,
|
|
8
|
+
h5,
|
|
9
|
+
h6 {
|
|
10
|
+
margin-top: calc(0.5rem - var(--header-offset));
|
|
11
|
+
margin-bottom: 0;
|
|
12
|
+
padding-top: calc(1rem + var(--header-offset));
|
|
13
|
+
|
|
14
|
+
&:first-child {
|
|
15
|
+
margin-bottom: 1rem;
|
|
16
|
+
|
|
17
|
+
+ p,
|
|
18
|
+
+ pre,
|
|
19
|
+
+ .custom-container {
|
|
20
|
+
margin-top: 2rem;
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
h1 {
|
|
26
|
+
// narrow mobile
|
|
27
|
+
@media (max-width: $MQMobileNarrow) {
|
|
28
|
+
font-size: 1.9rem;
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
a:not(.header-anchor) {
|
|
33
|
+
text-decoration: underline;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
img {
|
|
37
|
+
max-width: 100%;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
@mixin external-link-icon {
|
|
2
|
+
&::after {
|
|
3
|
+
content: '';
|
|
4
|
+
|
|
5
|
+
display: inline-block;
|
|
6
|
+
flex-shrink: 0;
|
|
7
|
+
|
|
8
|
+
width: 11px;
|
|
9
|
+
height: 11px;
|
|
10
|
+
margin-top: -1px;
|
|
11
|
+
margin-inline-start: 4px;
|
|
12
|
+
|
|
13
|
+
background: var(--external-link-c-icon);
|
|
14
|
+
|
|
15
|
+
mask-image: var(--external-link-icon);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
.vp-external-link-icon {
|
|
20
|
+
@include external-link-icon;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
.external-link-icon {
|
|
24
|
+
.external-link {
|
|
25
|
+
@include external-link-icon;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
[vp-content] {
|
|
29
|
+
a[href*="://"],
|
|
30
|
+
a[target=_blank] {
|
|
31
|
+
&:not(.no-external-link-icon) {
|
|
32
|
+
@include external-link-icon;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -1,19 +1,9 @@
|
|
|
1
1
|
@use 'vars';
|
|
2
2
|
@use 'vars-dark';
|
|
3
3
|
@use 'normalize';
|
|
4
|
-
|
|
4
|
+
@use 'content';
|
|
5
5
|
@use 'arrow';
|
|
6
|
-
@use '
|
|
7
|
-
@use 'code';
|
|
8
|
-
@use 'code-group';
|
|
9
|
-
@use 'custom-container';
|
|
10
|
-
@use 'home';
|
|
6
|
+
@use 'external-link-icon';
|
|
11
7
|
@use 'layout';
|
|
12
|
-
@use '
|
|
13
|
-
@use 'navbar-dropdown';
|
|
14
|
-
@use 'page';
|
|
15
|
-
@use 'sidebar';
|
|
16
|
-
@use 'toc';
|
|
17
|
-
@use 'transitions';
|
|
18
|
-
|
|
8
|
+
@use 'plugins';
|
|
19
9
|
@use '@vuepress/plugin-palette/style';
|