vitepress 1.0.0-draft.4 → 1.0.0-draft.5
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/README.md +3 -1
- package/bin/vitepress.js +1 -1
- package/dist/client/app/index.js +1 -5
- package/dist/client/index.d.ts +123 -137
- package/dist/client/index.js +1 -2
- package/dist/client/theme-default/Layout.vue +7 -0
- package/dist/client/theme-default/NotFound.vue +74 -14
- package/dist/client/theme-default/components/VPBox.vue +1 -5
- package/dist/client/theme-default/components/VPCarbonAds.vue +90 -0
- package/dist/client/theme-default/components/VPContent.vue +11 -1
- package/dist/client/theme-default/components/VPDoc.vue +25 -34
- package/dist/client/theme-default/components/VPDocAside.vue +34 -0
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +13 -0
- package/dist/client/theme-default/components/{VPDocOutline.vue → VPDocAsideOutline.vue} +3 -3
- package/dist/client/theme-default/components/VPDocAsideSponsors.vue +32 -0
- package/dist/client/theme-default/components/VPDocFooter.vue +1 -1
- package/dist/client/theme-default/components/VPFlyout.vue +2 -3
- package/dist/client/theme-default/components/VPFooter.vue +1 -1
- package/dist/client/theme-default/components/VPHero.vue +3 -3
- package/dist/client/theme-default/components/VPHomeSponsors.vue +3 -3
- package/dist/client/theme-default/components/VPLink.vue +2 -1
- package/dist/client/theme-default/components/VPLocalNav.vue +1 -1
- package/dist/client/theme-default/components/VPMenu.vue +8 -13
- package/dist/client/theme-default/components/VPMenuLink.vue +10 -4
- package/dist/client/theme-default/components/VPNav.vue +18 -1
- package/dist/client/theme-default/components/VPNavBar.vue +19 -7
- package/dist/client/theme-default/components/VPNavBarExtra.vue +20 -41
- package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +2 -8
- package/dist/client/theme-default/components/VPNavBarMenuLink.vue +3 -3
- package/dist/client/theme-default/components/VPNavBarSearch.vue +6 -6
- package/dist/client/theme-default/components/VPNavBarTitle.vue +4 -2
- package/dist/client/theme-default/components/VPNavBarTranslations.vue +10 -39
- package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +1 -2
- package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +1 -1
- package/dist/client/theme-default/components/VPSidebar.vue +10 -4
- package/dist/client/theme-default/components/VPSidebarGroup.vue +80 -17
- package/dist/client/theme-default/components/VPSidebarLink.vue +2 -9
- package/dist/client/theme-default/components/VPSocialLink.vue +2 -2
- package/dist/client/theme-default/components/VPSocialLinks.vue +1 -1
- package/dist/client/theme-default/components/VPSponsors.vue +15 -40
- package/dist/client/theme-default/components/VPSponsorsGrid.vue +2 -2
- package/dist/client/theme-default/components/icons/VPIconMinus.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +6 -0
- package/dist/client/theme-default/components/icons/VPIconPlusSquare.vue +6 -0
- package/dist/client/theme-default/composables/aside.js +17 -0
- package/dist/client/theme-default/composables/copy-code.js +33 -0
- package/dist/client/theme-default/composables/outline.js +3 -3
- package/dist/client/theme-default/composables/sponsor-grid.js +8 -6
- package/dist/client/theme-default/index.js +1 -0
- package/dist/client/theme-default/styles/base.css +9 -1
- package/dist/client/theme-default/styles/components/custom-block.css +2 -2
- package/dist/client/theme-default/styles/components/vp-doc.css +98 -107
- package/dist/client/theme-default/styles/components/vp-sponsor.css +51 -7
- package/dist/client/theme-default/styles/vars.css +42 -27
- package/dist/node/cli.js +32 -31
- package/dist/node/index.d.ts +371 -364
- package/dist/node/index.js +22 -37
- package/dist/node/serve-f7c10936.js +64795 -0
- package/dist/node-cjs/cli.cjs +304 -0
- package/dist/node-cjs/index.cjs +38 -0
- package/dist/{node/serve-b3182d88.js → node-cjs/serve-c220f0a8.cjs} +27417 -28632
- package/package.json +46 -38
- package/theme.d.ts +7 -2
- package/types/default-theme.d.ts +15 -2
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { useData } from 'vitepress'
|
|
4
4
|
import { useSidebar } from '../composables/sidebar'
|
|
5
|
-
import
|
|
5
|
+
import VPDocAside from './VPDocAside.vue'
|
|
6
6
|
import VPDocFooter from './VPDocFooter.vue'
|
|
7
7
|
|
|
8
8
|
const { page } = useData()
|
|
@@ -17,10 +17,17 @@ const pageName = computed(() => {
|
|
|
17
17
|
<div class="VPDoc" :class="{ 'has-sidebar': hasSidebar }">
|
|
18
18
|
<div class="container">
|
|
19
19
|
<div class="aside">
|
|
20
|
+
<div class="aside-curtain" />
|
|
20
21
|
<div class="aside-container">
|
|
21
|
-
<div class="aside-curtain" />
|
|
22
22
|
<div class="aside-content">
|
|
23
|
-
<
|
|
23
|
+
<VPDocAside>
|
|
24
|
+
<template #aside-top><slot name="aside-top" /></template>
|
|
25
|
+
<template #aside-bottom><slot name="aside-bottom" /></template>
|
|
26
|
+
<template #aside-outline-before><slot name="aside-outline-before" /></template>
|
|
27
|
+
<template #aside-outline-after><slot name="aside-outline-after" /></template>
|
|
28
|
+
<template #aside-ads-before><slot name="aside-ads-before" /></template>
|
|
29
|
+
<template #aside-ads-after><slot name="aside-ads-after" /></template>
|
|
30
|
+
</VPDocAside>
|
|
24
31
|
</div>
|
|
25
32
|
</div>
|
|
26
33
|
</div>
|
|
@@ -52,7 +59,7 @@ const pageName = computed(() => {
|
|
|
52
59
|
|
|
53
60
|
@media (min-width: 960px) {
|
|
54
61
|
.VPDoc {
|
|
55
|
-
padding: 32px 32px
|
|
62
|
+
padding: 32px 32px 32px;
|
|
56
63
|
}
|
|
57
64
|
|
|
58
65
|
.VPDoc:not(.has-sidebar) .container {
|
|
@@ -101,44 +108,33 @@ const pageName = computed(() => {
|
|
|
101
108
|
display: none;
|
|
102
109
|
order: 2;
|
|
103
110
|
flex-grow: 1;
|
|
104
|
-
flex-shrink: 0;
|
|
105
111
|
padding-left: 32px;
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
@media (min-width: 1440px) {
|
|
110
|
-
.aside {
|
|
111
|
-
padding-left: 64px;
|
|
112
|
-
}
|
|
112
|
+
width: 100%;
|
|
113
|
+
max-width: 256px;
|
|
113
114
|
}
|
|
114
115
|
|
|
115
116
|
.aside-container {
|
|
116
|
-
position:
|
|
117
|
-
top:
|
|
118
|
-
|
|
119
|
-
padding-top: 32px;
|
|
120
|
-
|
|
117
|
+
position: sticky;
|
|
118
|
+
top: 0;
|
|
119
|
+
margin-top: calc(var(--vp-nav-height-desktop) * -1 - 32px);
|
|
120
|
+
padding-top: calc(var(--vp-nav-height-desktop) + 32px);
|
|
121
|
+
max-height: 100vh;
|
|
121
122
|
overflow-x: hidden;
|
|
122
123
|
overflow-y: auto;
|
|
124
|
+
scrollbar-width: none;
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
.aside-container::-webkit-scrollbar {
|
|
126
128
|
display: none;
|
|
127
129
|
}
|
|
128
130
|
|
|
129
|
-
@media (min-width: 1440px) {
|
|
130
|
-
.aside-container {
|
|
131
|
-
width: 256px;
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
|
|
135
131
|
.aside-curtain {
|
|
136
132
|
position: fixed;
|
|
137
|
-
|
|
133
|
+
bottom: 0;
|
|
138
134
|
z-index: 10;
|
|
139
|
-
width:
|
|
140
|
-
height:
|
|
141
|
-
background: linear-gradient(var(--vp-c-bg
|
|
135
|
+
width: 224px;
|
|
136
|
+
height: 88px;
|
|
137
|
+
background: linear-gradient(transparent, var(--vp-c-bg) 70%);
|
|
142
138
|
}
|
|
143
139
|
|
|
144
140
|
.aside-content {
|
|
@@ -148,11 +144,12 @@ const pageName = computed(() => {
|
|
|
148
144
|
.content {
|
|
149
145
|
position: relative;
|
|
150
146
|
margin: 0 auto;
|
|
147
|
+
width: 100%;
|
|
151
148
|
}
|
|
152
149
|
|
|
153
150
|
@media (min-width: 960px) {
|
|
154
151
|
.content {
|
|
155
|
-
padding: 0 32px;
|
|
152
|
+
padding: 0 32px 96px;
|
|
156
153
|
}
|
|
157
154
|
}
|
|
158
155
|
|
|
@@ -164,12 +161,6 @@ const pageName = computed(() => {
|
|
|
164
161
|
}
|
|
165
162
|
}
|
|
166
163
|
|
|
167
|
-
@media (min-width: 1440px) {
|
|
168
|
-
.content {
|
|
169
|
-
padding-left: 64px;
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
|
|
173
164
|
.content-container {
|
|
174
165
|
margin: 0 auto;
|
|
175
166
|
max-width: 688px;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import VPDocAsideOutline from './VPDocAsideOutline.vue'
|
|
4
|
+
import VPDocAsideCarbonAds from './VPDocAsideCarbonAds.vue'
|
|
5
|
+
|
|
6
|
+
const { page, theme } = useData()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="VPDocAside">
|
|
11
|
+
<slot name="aside-top" />
|
|
12
|
+
|
|
13
|
+
<slot name="aside-outline-before" />
|
|
14
|
+
<VPDocAsideOutline v-if="page.headers.length" />
|
|
15
|
+
<slot name="aside-outline-after" />
|
|
16
|
+
|
|
17
|
+
<slot name="aside-ads-before" />
|
|
18
|
+
<VPDocAsideCarbonAds v-if="theme.carbonAds" />
|
|
19
|
+
<slot name="aside-ads-after" />
|
|
20
|
+
|
|
21
|
+
<slot name="aside-bottom" />
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<style scoped>
|
|
26
|
+
.VPDocAside :deep(.VPDocAsideOutline + .VPDocAsideSponsors),
|
|
27
|
+
.VPDocAside :deep(.VPDocAsideOutline + .VPDocAsideCarbonAds) {
|
|
28
|
+
margin-top: 24px;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.VPDocAside :deep(.VPDocAsideSponsors + .VPDocAsideCarbonAds) {
|
|
32
|
+
margin-top: 16px;
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { defineAsyncComponent } from 'vue'
|
|
3
|
+
|
|
4
|
+
const VPCarbonAds = __ALGOLIA__
|
|
5
|
+
? defineAsyncComponent(() => import('./VPCarbonAds.vue'))
|
|
6
|
+
: () => null
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="VPDocAsideCarbonAds">
|
|
11
|
+
<VPCarbonAds />
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
@@ -28,7 +28,7 @@ function handleClick({ target: el }: Event) {
|
|
|
28
28
|
</script>
|
|
29
29
|
|
|
30
30
|
<template>
|
|
31
|
-
<div class="
|
|
31
|
+
<div class="VPDocAsideOutline" :class="{ 'has-outline': hasOutline }" ref="container">
|
|
32
32
|
<div class="outline-marker" ref="marker" />
|
|
33
33
|
|
|
34
34
|
<div class="outline-title">On this page</div>
|
|
@@ -60,7 +60,7 @@ function handleClick({ target: el }: Event) {
|
|
|
60
60
|
</template>
|
|
61
61
|
|
|
62
62
|
<style scoped>
|
|
63
|
-
.
|
|
63
|
+
.VPDocAsideOutline {
|
|
64
64
|
position: relative;
|
|
65
65
|
display: none;
|
|
66
66
|
border-left: 1px solid var(--vp-c-divider-light);
|
|
@@ -69,7 +69,7 @@ function handleClick({ target: el }: Event) {
|
|
|
69
69
|
font-weight: 500;
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
-
.
|
|
72
|
+
.VPDocAsideOutline.has-outline {
|
|
73
73
|
display: block;
|
|
74
74
|
}
|
|
75
75
|
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import VPSponsors from './VPSponsors.vue'
|
|
3
|
+
|
|
4
|
+
export interface Sponsors {
|
|
5
|
+
tier?: string
|
|
6
|
+
size?: 'xmini' | 'mini' | 'small'
|
|
7
|
+
items: Sponsor[]
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface Sponsor {
|
|
11
|
+
name: string
|
|
12
|
+
img: string
|
|
13
|
+
url: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
defineProps<{
|
|
17
|
+
tier?: string
|
|
18
|
+
size?: 'xmini' | 'mini' | 'small'
|
|
19
|
+
data: Sponsors[] | Sponsor[]
|
|
20
|
+
}>()
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div class="VPDocAsideSponsors">
|
|
25
|
+
<VPSponsors
|
|
26
|
+
mode="aside"
|
|
27
|
+
:tier="tier"
|
|
28
|
+
:size="size"
|
|
29
|
+
:data="data"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
</template>
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { ref } from 'vue'
|
|
3
|
-
import { DefaultTheme } from 'vitepress'
|
|
4
3
|
import { useFlyout } from '../composables/flyout'
|
|
5
4
|
import VPIconChevronDown from './icons/VPIconChevronDown.vue'
|
|
6
5
|
import VPIconMoreHorizontal from './icons/VPIconMoreHorizontal.vue'
|
|
7
6
|
import VPMenu from './VPMenu.vue'
|
|
8
7
|
|
|
9
|
-
|
|
8
|
+
defineProps<{
|
|
10
9
|
icon?: any
|
|
11
10
|
button?: string
|
|
12
11
|
label?: string
|
|
@@ -141,7 +140,7 @@ function onBlur() {
|
|
|
141
140
|
transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
|
|
142
141
|
}
|
|
143
142
|
|
|
144
|
-
@media (min-width:
|
|
143
|
+
@media (min-width: 960px) {
|
|
145
144
|
.menu {
|
|
146
145
|
top: calc(var(--vp-nav-height-desktop) / 2 + 20px);
|
|
147
146
|
}
|
|
@@ -21,7 +21,7 @@ const { hasSidebar } = useSidebar()
|
|
|
21
21
|
z-index: var(--vp-z-index-footer);
|
|
22
22
|
border-top: 1px solid var(--vp-c-divider-light);
|
|
23
23
|
padding: 32px 24px;
|
|
24
|
-
background-color: var(--vp-c-bg
|
|
24
|
+
background-color: var(--vp-c-bg);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
.VPFooter.has-sidebar {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import VPButton from './VPButton.vue'
|
|
3
3
|
|
|
4
|
-
interface HeroAction {
|
|
4
|
+
export interface HeroAction {
|
|
5
5
|
theme?: 'brand' | 'alt'
|
|
6
6
|
text: string
|
|
7
7
|
link: string
|
|
@@ -56,8 +56,8 @@ defineProps<{
|
|
|
56
56
|
|
|
57
57
|
.name,
|
|
58
58
|
.text {
|
|
59
|
-
line-height:
|
|
60
|
-
font-size:
|
|
59
|
+
line-height: 48px;
|
|
60
|
+
font-size: 40px;
|
|
61
61
|
font-weight: 700;
|
|
62
62
|
}
|
|
63
63
|
|
|
@@ -3,13 +3,13 @@ import VPIconHeart from './icons/VPIconHeart.vue'
|
|
|
3
3
|
import VPButton from './VPButton.vue'
|
|
4
4
|
import VPSponsors from './VPSponsors.vue'
|
|
5
5
|
|
|
6
|
-
interface Sponsors {
|
|
6
|
+
export interface Sponsors {
|
|
7
7
|
tier: string
|
|
8
8
|
size?: 'medium' | 'big'
|
|
9
9
|
items: Sponsor[]
|
|
10
10
|
}
|
|
11
11
|
|
|
12
|
-
interface Sponsor {
|
|
12
|
+
export interface Sponsor {
|
|
13
13
|
name: string
|
|
14
14
|
img: string
|
|
15
15
|
url: string
|
|
@@ -50,7 +50,7 @@ defineProps<{
|
|
|
50
50
|
.VPHomeSponsors {
|
|
51
51
|
border-top: 1px solid var(--vp-c-divider-light);
|
|
52
52
|
padding: 88px 24px 96px;
|
|
53
|
-
background-color: var(--vp-c-bg
|
|
53
|
+
background-color: var(--vp-c-bg);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
.container {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { computed } from 'vue'
|
|
3
|
+
import { normalizeLink } from '../support/utils'
|
|
3
4
|
import VPIconExternalLink from './icons/VPIconExternalLink.vue'
|
|
4
5
|
|
|
5
6
|
const props = defineProps<{
|
|
@@ -15,7 +16,7 @@ const isExternal = computed(() => props.href && /^[a-z]+:/i.test(props.href))
|
|
|
15
16
|
:is="href ? 'a' : 'span'"
|
|
16
17
|
class="VPLink"
|
|
17
18
|
:class="{ link: href }"
|
|
18
|
-
:href="href"
|
|
19
|
+
:href="href ? normalizeLink(href) : undefined"
|
|
19
20
|
:target="isExternal ? '_blank' : undefined"
|
|
20
21
|
:rel="isExternal ? 'noopener noreferrer' : undefined"
|
|
21
22
|
>
|
|
@@ -45,7 +45,7 @@ function scrollToTop() {
|
|
|
45
45
|
justify-content: space-between;
|
|
46
46
|
border-bottom: 1px solid var(--vp-c-divider-light);
|
|
47
47
|
width: 100%;
|
|
48
|
-
background-color: var(--vp-c-bg
|
|
48
|
+
background-color: var(--vp-c-bg);
|
|
49
49
|
transition: border-color 0.5s, background-color 0.5s;
|
|
50
50
|
}
|
|
51
51
|
|
|
@@ -22,27 +22,22 @@ defineProps<{
|
|
|
22
22
|
|
|
23
23
|
<style scoped>
|
|
24
24
|
.VPMenu {
|
|
25
|
-
border-radius:
|
|
26
|
-
padding: 12px
|
|
27
|
-
min-width:
|
|
28
|
-
border: 1px solid
|
|
29
|
-
background: var(--vp-c-bg);
|
|
25
|
+
border-radius: 12px;
|
|
26
|
+
padding: 12px;
|
|
27
|
+
min-width: 128px;
|
|
28
|
+
border: 1px solid var(--vp-c-divider-light);
|
|
29
|
+
background-color: var(--vp-c-bg);
|
|
30
30
|
box-shadow: var(--vp-shadow-3);
|
|
31
31
|
transition: background-color 0.5s;
|
|
32
32
|
}
|
|
33
33
|
|
|
34
34
|
.dark .VPMenu {
|
|
35
|
-
|
|
36
|
-
box-shadow: var(--vp-shadow-1);
|
|
37
|
-
border: 1px solid var(--vp-c-divider-light);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
.VPMenu :deep(.items) {
|
|
41
|
-
transition: border-color .5s;
|
|
35
|
+
box-shadow: var(--vp-shadow-2);
|
|
42
36
|
}
|
|
43
37
|
|
|
44
38
|
.VPMenu :deep(.group) {
|
|
45
|
-
|
|
39
|
+
margin: 0 -12px;
|
|
40
|
+
padding: 0 12px 12px;
|
|
46
41
|
}
|
|
47
42
|
|
|
48
43
|
.VPMenu :deep(.group + .group) {
|
|
@@ -15,16 +15,22 @@ defineProps<{
|
|
|
15
15
|
<style scoped>
|
|
16
16
|
.VPMenuLink {
|
|
17
17
|
display: block;
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
18
|
+
border-radius: 6px;
|
|
19
|
+
padding: 0 12px;
|
|
20
|
+
line-height: 32px;
|
|
21
|
+
font-size: 14px;
|
|
21
22
|
font-weight: 500;
|
|
22
23
|
color: var(--vp-c-text-1);
|
|
23
24
|
white-space: nowrap;
|
|
24
|
-
transition: color 0.25s;
|
|
25
|
+
transition: background-color 0.25s, color 0.25s;
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
.VPMenuLink:hover {
|
|
28
29
|
color: var(--vp-c-brand);
|
|
30
|
+
background-color: var(--vp-c-bg-mute);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.dark .VPMenuLink:hover {
|
|
34
|
+
background-color: var(--vp-c-bg-soft);
|
|
29
35
|
}
|
|
30
36
|
</style>
|
|
@@ -1,16 +1,18 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { provide } from 'vue'
|
|
3
3
|
import { useNav } from '../composables/nav'
|
|
4
|
+
import { useSidebar } from '../composables/sidebar'
|
|
4
5
|
import VPNavBar from './VPNavBar.vue'
|
|
5
6
|
import VPNavScreen from './VPNavScreen.vue'
|
|
6
7
|
|
|
7
8
|
const { isScreenOpen, closeScreen, toggleScreen } = useNav()
|
|
9
|
+
const { hasSidebar } = useSidebar()
|
|
8
10
|
|
|
9
11
|
provide('close-screen', closeScreen)
|
|
10
12
|
</script>
|
|
11
13
|
|
|
12
14
|
<template>
|
|
13
|
-
<header class="VPNav">
|
|
15
|
+
<header class="VPNav" :class="{ 'no-sidebar' : !hasSidebar }">
|
|
14
16
|
<VPNavBar :is-screen-open="isScreenOpen" @toggle-screen="toggleScreen" />
|
|
15
17
|
<VPNavScreen :open="isScreenOpen" />
|
|
16
18
|
</header>
|
|
@@ -29,5 +31,20 @@ provide('close-screen', closeScreen)
|
|
|
29
31
|
.VPNav {
|
|
30
32
|
position: fixed;
|
|
31
33
|
}
|
|
34
|
+
|
|
35
|
+
.VPNav.no-sidebar {
|
|
36
|
+
backdrop-filter: saturate(50%) blur(8px);
|
|
37
|
+
-webkit-backdrop-filter: saturate(50%) blur(8px);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
@supports not (backdrop-filter: saturate(50%) blur(8px)) {
|
|
41
|
+
.VPNav.no-sidebar {
|
|
42
|
+
background: rgba(255, 255, 255, 0.95);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
.dark .VPNav.no-sidebar {
|
|
46
|
+
background: rgba(36, 36, 36, 0.95);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
32
49
|
}
|
|
33
50
|
</style>
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
+
import { useSidebar } from '../composables/sidebar'
|
|
2
3
|
import VPNavBarTitle from './VPNavBarTitle.vue'
|
|
3
4
|
import VPNavBarSearch from './VPNavBarSearch.vue'
|
|
4
5
|
import VPNavBarMenu from './VPNavBarMenu.vue'
|
|
@@ -15,10 +16,12 @@ defineProps<{
|
|
|
15
16
|
defineEmits<{
|
|
16
17
|
(e: 'toggle-screen'): void
|
|
17
18
|
}>()
|
|
19
|
+
|
|
20
|
+
const { hasSidebar } = useSidebar()
|
|
18
21
|
</script>
|
|
19
22
|
|
|
20
23
|
<template>
|
|
21
|
-
<div class="VPNavBar">
|
|
24
|
+
<div class="VPNavBar" :class="{ 'has-sidebar' : hasSidebar }">
|
|
22
25
|
<div class="container">
|
|
23
26
|
<VPNavBarTitle />
|
|
24
27
|
|
|
@@ -60,6 +63,21 @@ defineEmits<{
|
|
|
60
63
|
height: var(--vp-nav-height-desktop);
|
|
61
64
|
border-bottom: 0;
|
|
62
65
|
}
|
|
66
|
+
|
|
67
|
+
.VPNavBar.has-sidebar .content {
|
|
68
|
+
backdrop-filter: saturate(50%) blur(8px);
|
|
69
|
+
-webkit-backdrop-filter: saturate(50%) blur(8px);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
@supports not (backdrop-filter: saturate(50%) blur(8px)) {
|
|
73
|
+
.VPNavBar.has-sidebar.content {
|
|
74
|
+
background: rgba(255, 255, 255, 0.95);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.dark .VPNavBar.has-sidebar .content {
|
|
78
|
+
background: rgba(36, 36, 36, 0.95);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
63
81
|
}
|
|
64
82
|
|
|
65
83
|
.container {
|
|
@@ -76,12 +94,6 @@ defineEmits<{
|
|
|
76
94
|
flex-grow: 1;
|
|
77
95
|
}
|
|
78
96
|
|
|
79
|
-
@media (min-width: 960px) {
|
|
80
|
-
.content {
|
|
81
|
-
backdrop-filter: saturate(50%) blur(8px);
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
97
|
.menu + .translations::before,
|
|
86
98
|
.menu + .appearance::before,
|
|
87
99
|
.menu + .social-links::before,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { useData } from 'vitepress'
|
|
3
3
|
import VPFlyout from './VPFlyout.vue'
|
|
4
|
+
import VPMenuLink from './VPMenuLink.vue'
|
|
4
5
|
import VPSwitchAppearance from './VPSwitchAppearance.vue'
|
|
5
6
|
import VPSocialLinks from './VPSocialLinks.vue'
|
|
6
7
|
|
|
@@ -10,21 +11,15 @@ const { site, theme } = useData()
|
|
|
10
11
|
<template>
|
|
11
12
|
<VPFlyout class="VPNavBarExtra" label="extra navigation">
|
|
12
13
|
<div v-if="theme.localeLinks" class="group">
|
|
13
|
-
<
|
|
14
|
-
<p class="trans-title">
|
|
15
|
-
{{ theme.localeLinks.text }}
|
|
16
|
-
</p>
|
|
14
|
+
<p class="trans-title">{{ theme.localeLinks.text }}</p>
|
|
17
15
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</li>
|
|
22
|
-
</ul>
|
|
23
|
-
</div>
|
|
16
|
+
<template v-for="locale in theme.localeLinks.items" :key="locale.link">
|
|
17
|
+
<VPMenuLink :item="locale" />
|
|
18
|
+
</template>
|
|
24
19
|
</div>
|
|
25
20
|
|
|
26
21
|
<div v-if="site.appearance" class="group">
|
|
27
|
-
<div class="item">
|
|
22
|
+
<div class="item appearance">
|
|
28
23
|
<p class="label">Appearance</p>
|
|
29
24
|
<div class="appearance-action">
|
|
30
25
|
<VPSwitchAppearance />
|
|
@@ -33,8 +28,8 @@ const { site, theme } = useData()
|
|
|
33
28
|
</div>
|
|
34
29
|
|
|
35
30
|
<div v-if="theme.socialLinks" class="group">
|
|
36
|
-
<div class="item">
|
|
37
|
-
<VPSocialLinks class="social-links" :links="theme.socialLinks" />
|
|
31
|
+
<div class="item social-links">
|
|
32
|
+
<VPSocialLinks class="social-links-list" :links="theme.socialLinks" />
|
|
38
33
|
</div>
|
|
39
34
|
</div>
|
|
40
35
|
</VPFlyout>
|
|
@@ -63,45 +58,29 @@ const { site, theme } = useData()
|
|
|
63
58
|
}
|
|
64
59
|
|
|
65
60
|
.trans-title {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
font-size:
|
|
69
|
-
font-weight:
|
|
70
|
-
color: var(--vp-c-text-1);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
.trans-icon {
|
|
74
|
-
margin-right: 12px;
|
|
75
|
-
width: 16px;
|
|
76
|
-
height: 16px;
|
|
77
|
-
fill: currentColor;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
.trans-list {
|
|
81
|
-
padding: 2px 0 0 0;
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
.trans-link {
|
|
85
|
-
line-height: 28px;
|
|
86
|
-
font-size: 13px;
|
|
61
|
+
padding: 0 24px 0 12px;
|
|
62
|
+
line-height: 32px;
|
|
63
|
+
font-size: 14px;
|
|
64
|
+
font-weight: 700;
|
|
87
65
|
color: var(--vp-c-text-1);
|
|
88
|
-
transition: color 0.25s;
|
|
89
66
|
}
|
|
90
67
|
|
|
91
|
-
.
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
.item {
|
|
68
|
+
.item.appearance,
|
|
69
|
+
.item.social-links {
|
|
96
70
|
display: flex;
|
|
97
71
|
align-items: center;
|
|
72
|
+
padding: 0 24px;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
.item.appearance {
|
|
76
|
+
min-width: 176px;
|
|
98
77
|
}
|
|
99
78
|
|
|
100
79
|
.appearance-action {
|
|
101
80
|
margin-right: -2px;
|
|
102
81
|
}
|
|
103
82
|
|
|
104
|
-
.social-links {
|
|
83
|
+
.social-links-list {
|
|
105
84
|
margin: -4px -8px;
|
|
106
85
|
}
|
|
107
86
|
</style>
|
|
@@ -1,18 +1,12 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import { DefaultTheme
|
|
3
|
-
import { isActive } from '../support/utils'
|
|
2
|
+
import { DefaultTheme } from '../config'
|
|
4
3
|
import VPFlyout from './VPFlyout.vue'
|
|
5
4
|
|
|
6
5
|
defineProps<{
|
|
7
6
|
item: DefaultTheme.NavItemWithChildren
|
|
8
7
|
}>()
|
|
9
|
-
|
|
10
|
-
const { page } = useData()
|
|
11
8
|
</script>
|
|
12
9
|
|
|
13
10
|
<template>
|
|
14
|
-
<VPFlyout
|
|
15
|
-
:button="item.text"
|
|
16
|
-
:items="item.items"
|
|
17
|
-
/>
|
|
11
|
+
<VPFlyout :button="item.text" :items="item.items" />
|
|
18
12
|
</template>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
import {
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
3
|
import { isActive } from '../support/utils'
|
|
4
|
-
import {
|
|
4
|
+
import { DefaultTheme } from '../config'
|
|
5
5
|
import VPLink from './VPLink.vue'
|
|
6
6
|
|
|
7
7
|
defineProps<{
|
|
@@ -34,7 +34,7 @@ const { page } = useData()
|
|
|
34
34
|
align-items: center;
|
|
35
35
|
padding: 0 12px;
|
|
36
36
|
line-height: var(--vp-nav-height-mobile);
|
|
37
|
-
font-size:
|
|
37
|
+
font-size: 14px;
|
|
38
38
|
font-weight: 500;
|
|
39
39
|
color: var(--vp-c-text-1);
|
|
40
40
|
transition: color 0.25s;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import '@docsearch/css'
|
|
3
|
-
import { useData } from 'vitepress'
|
|
4
3
|
import { defineAsyncComponent, ref, onMounted, onUnmounted } from 'vue'
|
|
4
|
+
import { useData } from 'vitepress'
|
|
5
5
|
|
|
6
|
-
const VPAlgoliaSearchBox =
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
const VPAlgoliaSearchBox = __ALGOLIA__
|
|
7
|
+
? defineAsyncComponent(() => import('./VPAlgoliaSearchBox.vue'))
|
|
8
|
+
: () => null
|
|
9
9
|
|
|
10
10
|
const { theme } = useData()
|
|
11
11
|
|
|
@@ -161,12 +161,12 @@ function load() {
|
|
|
161
161
|
padding: 0 10px 0 12px;
|
|
162
162
|
width: 100%;
|
|
163
163
|
height: 40px;
|
|
164
|
-
background-color: var(--vp-c-bg-
|
|
164
|
+
background-color: var(--vp-c-bg-alt);
|
|
165
165
|
}
|
|
166
166
|
|
|
167
167
|
.DocSearch-Button:hover {
|
|
168
168
|
border-color: var(--vp-c-brand);
|
|
169
|
-
background: var(--vp-c-bg-
|
|
169
|
+
background: var(--vp-c-bg-alt);
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
172
|
|