vitepress 0.22.2 → 1.0.0-draft.1
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 +4 -4
- package/client.d.ts +2 -3
- package/dist/client/app/components/ClientOnly.js +1 -1
- package/dist/client/app/index.js +5 -7
- package/dist/client/app/router.js +11 -5
- package/dist/client/theme-default/Layout.vue +25 -183
- package/dist/client/theme-default/NotFound.vue +9 -8
- package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +127 -0
- package/dist/client/theme-default/components/VPBackdrop.vue +39 -0
- package/dist/client/theme-default/components/VPContent.vue +44 -0
- package/dist/client/theme-default/components/VPContentDoc.vue +173 -0
- package/dist/client/theme-default/components/VPContentDocFooter.vue +140 -0
- package/dist/client/theme-default/components/VPContentDocOutline.vue +108 -0
- package/dist/client/theme-default/components/VPFlyout.vue +149 -0
- package/dist/client/theme-default/components/VPLink.vue +37 -0
- package/dist/client/theme-default/components/VPLocalNav.vue +106 -0
- package/dist/client/theme-default/components/VPMenu.vue +79 -0
- package/dist/client/theme-default/components/VPMenuGroup.vue +35 -0
- package/dist/client/theme-default/components/VPMenuLink.vue +30 -0
- package/dist/client/theme-default/components/VPNav.vue +33 -0
- package/dist/client/theme-default/components/VPNavBar.vue +109 -0
- package/dist/client/theme-default/components/VPNavBarAppearance.vue +22 -0
- package/dist/client/theme-default/components/VPNavBarExtra.vue +107 -0
- package/dist/client/theme-default/components/VPNavBarHamburger.vue +79 -0
- package/dist/client/theme-default/components/VPNavBarMenu.vue +29 -0
- package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +18 -0
- package/dist/client/theme-default/components/VPNavBarMenuLink.vue +56 -0
- package/dist/client/theme-default/components/VPNavBarSearch.vue +269 -0
- package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +27 -0
- package/dist/client/theme-default/components/VPNavBarTitle.vue +44 -0
- package/dist/client/theme-default/components/VPNavBarTranslations.vue +74 -0
- package/dist/client/theme-default/components/VPNavScreen.vue +100 -0
- package/dist/client/theme-default/components/VPNavScreenAppearance.vue +30 -0
- package/dist/client/theme-default/components/VPNavScreenMenu.vue +24 -0
- package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +118 -0
- package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +33 -0
- package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +35 -0
- package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +34 -0
- package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +14 -0
- package/dist/client/theme-default/components/VPNavScreenTranslations.vue +73 -0
- package/dist/client/theme-default/components/VPSidebar.vue +118 -0
- package/dist/client/theme-default/components/VPSidebarGroup.vue +44 -0
- package/dist/client/theme-default/components/VPSidebarLink.vue +57 -0
- package/dist/client/theme-default/components/VPSkipLink.vue +72 -0
- package/dist/client/theme-default/components/VPSocialLink.vue +63 -0
- package/dist/client/theme-default/components/VPSocialLinks.vue +27 -0
- package/dist/client/theme-default/components/VPSwitch.vue +66 -0
- package/dist/client/theme-default/components/VPSwitchAppearance.vue +74 -0
- package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +8 -0
- package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +8 -0
- package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +8 -0
- package/dist/client/theme-default/components/icons/{ArrowLeft.vue → VPIconArrowLeft.vue} +0 -0
- package/dist/client/theme-default/components/icons/{ArrowRight.vue → VPIconArrowRight.vue} +0 -0
- package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconDiscord.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconEdit.vue +6 -0
- package/dist/client/theme-default/components/icons/VPIconExternalLink.vue +13 -0
- package/dist/client/theme-default/components/icons/VPIconFacebook.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconGitHub.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconInstagram.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconLanguages.vue +9 -0
- package/dist/client/theme-default/components/icons/VPIconLinkedIn.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconMoon.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +7 -0
- package/dist/client/theme-default/components/icons/VPIconPlus.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconSlack.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconSun.vue +13 -0
- package/dist/client/theme-default/components/icons/VPIconTwitter.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconYouTube.vue +5 -0
- package/dist/client/theme-default/composables/edit-link.js +22 -0
- package/dist/client/theme-default/composables/flyout.js +40 -0
- package/dist/client/theme-default/composables/nav.js +27 -1
- package/dist/client/theme-default/composables/outline.js +130 -0
- package/dist/client/theme-default/composables/prev-next.js +18 -0
- package/dist/client/theme-default/composables/sidebar.js +57 -0
- package/dist/client/theme-default/fonts/inter-cyrillic-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-cyrillic.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-greek-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-greek.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-latin-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-latin.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-vietnamese.woff2 +0 -0
- package/dist/client/theme-default/index.js +4 -4
- package/dist/client/theme-default/styles/base.css +200 -0
- package/dist/client/theme-default/styles/fonts.css +67 -0
- package/dist/client/theme-default/styles/utils.css +9 -0
- package/dist/client/theme-default/styles/vars.css +206 -66
- package/dist/client/theme-default/styles/vp-doc.css +419 -0
- package/dist/client/theme-default/support/sidebar.js +29 -0
- package/dist/client/theme-default/support/utils.js +43 -0
- package/dist/node/cli.js +1 -1
- package/dist/node/index.d.ts +106 -81
- package/dist/node/index.js +1 -1
- package/dist/node/{serve-cf4b2162.js → serve-428d4610.js} +27 -10
- package/package.json +31 -27
- package/types/default-theme.d.ts +105 -80
- package/dist/client/theme-default/components/AlgoliaSearchBox.vue +0 -195
- package/dist/client/theme-default/components/BuySellAds.vue +0 -152
- package/dist/client/theme-default/components/CarbonAds.vue +0 -99
- package/dist/client/theme-default/components/EditLink.vue +0 -38
- package/dist/client/theme-default/components/Home.vue +0 -31
- package/dist/client/theme-default/components/HomeFeatures.vue +0 -143
- package/dist/client/theme-default/components/HomeFooter.vue +0 -50
- package/dist/client/theme-default/components/HomeHero.vue +0 -161
- package/dist/client/theme-default/components/LastUpdated.vue +0 -60
- package/dist/client/theme-default/components/NavBar.vue +0 -60
- package/dist/client/theme-default/components/NavBarTitle.vue +0 -41
- package/dist/client/theme-default/components/NavDropdownLink.vue +0 -135
- package/dist/client/theme-default/components/NavDropdownLinkItem.vue +0 -76
- package/dist/client/theme-default/components/NavLink.vue +0 -61
- package/dist/client/theme-default/components/NavLinks.vue +0 -52
- package/dist/client/theme-default/components/NextAndPrevLinks.vue +0 -88
- package/dist/client/theme-default/components/Page.vue +0 -53
- package/dist/client/theme-default/components/PageFooter.vue +0 -44
- package/dist/client/theme-default/components/SideBar.vue +0 -60
- package/dist/client/theme-default/components/SideBarLink.js +0 -68
- package/dist/client/theme-default/components/SideBarLinks.vue +0 -12
- package/dist/client/theme-default/components/ToggleSideBarButton.vue +0 -46
- package/dist/client/theme-default/components/icons/OutboundLink.vue +0 -31
- package/dist/client/theme-default/composables/activeSidebarLink.js +0 -99
- package/dist/client/theme-default/composables/editLink.js +0 -49
- package/dist/client/theme-default/composables/navLink.js +0 -42
- package/dist/client/theme-default/composables/nextAndPrevLinks.js +0 -37
- package/dist/client/theme-default/composables/repo.js +0 -38
- package/dist/client/theme-default/composables/sideBar.js +0 -57
- package/dist/client/theme-default/styles/code.css +0 -299
- package/dist/client/theme-default/styles/custom-blocks.css +0 -76
- package/dist/client/theme-default/styles/layout.css +0 -236
- package/dist/client/theme-default/styles/sidebar-links.css +0 -107
- package/dist/client/theme-default/support/sideBar.js +0 -46
- package/dist/client/theme-default/utils.js +0 -63
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import VPMenuLink from './VPMenuLink.vue'
|
|
3
|
+
import VPMenuGroup from './VPMenuGroup.vue'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
items?: any[]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="VPMenu">
|
|
12
|
+
<div v-if="items" class="items">
|
|
13
|
+
<template v-for="item in items" :key="item.text">
|
|
14
|
+
<VPMenuLink v-if="'link' in item" :item="item" />
|
|
15
|
+
<VPMenuGroup v-else :text="item.text" :items="item.items" />
|
|
16
|
+
</template>
|
|
17
|
+
</div>
|
|
18
|
+
|
|
19
|
+
<slot />
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<style scoped>
|
|
24
|
+
.VPMenu {
|
|
25
|
+
border-radius: 8px;
|
|
26
|
+
padding: 12px 0;
|
|
27
|
+
min-width: 192px;
|
|
28
|
+
border: 1px solid transparent;
|
|
29
|
+
background: var(--vp-c-bg);
|
|
30
|
+
box-shadow: var(--vp-shadow-3);
|
|
31
|
+
transition: background-color 0.5s;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.dark .VPMenu {
|
|
35
|
+
background: var(--vp-c-bg);
|
|
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;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.VPMenu :deep(.group) {
|
|
45
|
+
padding: 0 0 12px;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.VPMenu :deep(.group + .group) {
|
|
49
|
+
border-top: 1px solid var(--vp-c-divider-light);
|
|
50
|
+
padding: 11px 0 12px;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.VPMenu :deep(.group:last-child) {
|
|
54
|
+
padding-bottom: 0;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
.VPMenu :deep(.group + .item) {
|
|
58
|
+
border-top: 1px solid var(--vp-c-divider-light);
|
|
59
|
+
padding: 11px 16px 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.VPMenu :deep(.item) {
|
|
63
|
+
padding: 0 16px;
|
|
64
|
+
white-space: nowrap;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.VPMenu :deep(.label) {
|
|
68
|
+
flex-grow: 1;
|
|
69
|
+
line-height: 28px;
|
|
70
|
+
font-size: 12px;
|
|
71
|
+
font-weight: 500;
|
|
72
|
+
color: var(--vp-c-text-2);
|
|
73
|
+
transition: color .5s;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.VPMenu :deep(.action) {
|
|
77
|
+
padding-left: 24px;
|
|
78
|
+
}
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import VPMenuLink from './VPMenuLink.vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
text?: string
|
|
6
|
+
items: any[]
|
|
7
|
+
}>()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<div class="VPMenuGroup">
|
|
12
|
+
<p v-if="text" class="title">{{ text }}</p>
|
|
13
|
+
|
|
14
|
+
<template v-for="item in items">
|
|
15
|
+
<VPMenuLink v-if="'link' in item" :item="item" />
|
|
16
|
+
</template>
|
|
17
|
+
</div>
|
|
18
|
+
</template>
|
|
19
|
+
|
|
20
|
+
<style scoped>
|
|
21
|
+
.VPMenuGroup + .VPMenuGroup {
|
|
22
|
+
margin-top: 8px;
|
|
23
|
+
border-top: 1px solid var(--vp-c-divider-light);
|
|
24
|
+
padding-top: 8px;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.title {
|
|
28
|
+
padding: 0 16px;
|
|
29
|
+
line-height: 28px;
|
|
30
|
+
font-size: 13px;
|
|
31
|
+
font-weight: 600;
|
|
32
|
+
color: var(--vp-c-text-2);
|
|
33
|
+
transition: color 0.25s;
|
|
34
|
+
}
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import VPLink from './VPLink.vue'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
item: any
|
|
6
|
+
}>()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<VPLink class="VPMenuLink" :href="item.link">
|
|
11
|
+
{{ item.text }}
|
|
12
|
+
</VPLink>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style scoped>
|
|
16
|
+
.VPMenuLink {
|
|
17
|
+
display: block;
|
|
18
|
+
padding: 0 16px;
|
|
19
|
+
line-height: 28px;
|
|
20
|
+
font-size: 13px;
|
|
21
|
+
font-weight: 500;
|
|
22
|
+
color: var(--vp-c-text-1);
|
|
23
|
+
white-space: nowrap;
|
|
24
|
+
transition: color 0.25s;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.VPMenuLink:hover {
|
|
28
|
+
color: var(--vp-c-brand);
|
|
29
|
+
}
|
|
30
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { provide } from 'vue'
|
|
3
|
+
import { useNav } from '../composables/nav'
|
|
4
|
+
import VPNavBar from './VPNavBar.vue'
|
|
5
|
+
import VPNavScreen from './VPNavScreen.vue'
|
|
6
|
+
|
|
7
|
+
const { isScreenOpen, closeScreen, toggleScreen } = useNav()
|
|
8
|
+
|
|
9
|
+
provide('close-screen', closeScreen)
|
|
10
|
+
</script>
|
|
11
|
+
|
|
12
|
+
<template>
|
|
13
|
+
<header class="VPNav">
|
|
14
|
+
<VPNavBar :is-screen-open="isScreenOpen" @toggle-screen="toggleScreen" />
|
|
15
|
+
<VPNavScreen :open="isScreenOpen" />
|
|
16
|
+
</header>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<style scoped>
|
|
20
|
+
.VPNav {
|
|
21
|
+
position: relative;
|
|
22
|
+
top: 0;
|
|
23
|
+
left: 0;
|
|
24
|
+
z-index: var(--vp-z-index-nav);
|
|
25
|
+
width: 100%;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
@media (min-width: 960px) {
|
|
29
|
+
.VPNav {
|
|
30
|
+
position: fixed;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import VPNavBarTitle from './VPNavBarTitle.vue'
|
|
3
|
+
import VPNavBarSearch from './VPNavBarSearch.vue'
|
|
4
|
+
import VPNavBarMenu from './VPNavBarMenu.vue'
|
|
5
|
+
import VPNavBarTranslations from './VPNavBarTranslations.vue'
|
|
6
|
+
import VPNavBarAppearance from './VPNavBarAppearance.vue'
|
|
7
|
+
import VPNavBarSocialLinks from './VPNavBarSocialLinks.vue'
|
|
8
|
+
import VPNavBarExtra from './VPNavBarExtra.vue'
|
|
9
|
+
import VPNavBarHamburger from './VPNavBarHamburger.vue'
|
|
10
|
+
|
|
11
|
+
defineProps<{
|
|
12
|
+
isScreenOpen: boolean
|
|
13
|
+
}>()
|
|
14
|
+
|
|
15
|
+
defineEmits<{
|
|
16
|
+
(e: 'toggle-screen'): void
|
|
17
|
+
}>()
|
|
18
|
+
</script>
|
|
19
|
+
|
|
20
|
+
<template>
|
|
21
|
+
<div class="VPNavBar">
|
|
22
|
+
<div class="container">
|
|
23
|
+
<VPNavBarTitle />
|
|
24
|
+
|
|
25
|
+
<div class="content">
|
|
26
|
+
<VPNavBarSearch class="search" />
|
|
27
|
+
<VPNavBarMenu class="menu" />
|
|
28
|
+
<VPNavBarTranslations class="translations" />
|
|
29
|
+
<VPNavBarAppearance class="appearance" />
|
|
30
|
+
<VPNavBarSocialLinks class="social-links" />
|
|
31
|
+
<VPNavBarExtra class="extra" />
|
|
32
|
+
<VPNavBarHamburger
|
|
33
|
+
class="hamburger"
|
|
34
|
+
:active="isScreenOpen"
|
|
35
|
+
@click="$emit('toggle-screen')"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</template>
|
|
41
|
+
|
|
42
|
+
<style scoped>
|
|
43
|
+
.VPNavBar {
|
|
44
|
+
position: relative;
|
|
45
|
+
border-bottom: 1px solid var(--vp-c-divider-light);
|
|
46
|
+
padding: 0 8px 0 24px;
|
|
47
|
+
height: var(--vp-nav-height-mobile);
|
|
48
|
+
background-color: var(--vt-c-bg);
|
|
49
|
+
transition: border-color 0.5s, background-color 0.5s;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media (min-width: 768px) {
|
|
53
|
+
.VPNavBar {
|
|
54
|
+
padding: 0 32px;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
@media (min-width: 960px) {
|
|
59
|
+
.VPNavBar {
|
|
60
|
+
height: var(--vp-nav-height-desktop);
|
|
61
|
+
border-bottom: 0;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.container {
|
|
66
|
+
display: flex;
|
|
67
|
+
justify-content: space-between;
|
|
68
|
+
margin: 0 auto;
|
|
69
|
+
max-width: var(--vp-layout-max-width);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.content {
|
|
73
|
+
display: flex;
|
|
74
|
+
justify-content: flex-end;
|
|
75
|
+
align-items: center;
|
|
76
|
+
flex-grow: 1;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
@media (min-width: 960px) {
|
|
80
|
+
.content {
|
|
81
|
+
backdrop-filter: saturate(50%) blur(8px);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.menu + .translations::before,
|
|
86
|
+
.menu + .appearance::before,
|
|
87
|
+
.translations + .appearance::before,
|
|
88
|
+
.appearance + .social-links::before {
|
|
89
|
+
margin-right: 8px;
|
|
90
|
+
margin-left: 8px;
|
|
91
|
+
width: 1px;
|
|
92
|
+
height: 24px;
|
|
93
|
+
background-color: var(--vp-c-divider-light);
|
|
94
|
+
content: "";
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.menu + .appearance::before,
|
|
98
|
+
.translations + .appearance::before {
|
|
99
|
+
margin-right: 16px;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
.appearance + .social-links::before {
|
|
103
|
+
margin-left: 16px;
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
.social-links {
|
|
107
|
+
margin-right: -8px;
|
|
108
|
+
}
|
|
109
|
+
</style>
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import VPSwitchAppearance from './VPSwitchAppearance.vue'
|
|
3
|
+
</script>
|
|
4
|
+
|
|
5
|
+
<template>
|
|
6
|
+
<div class="VPNavBarAppearance">
|
|
7
|
+
<VPSwitchAppearance />
|
|
8
|
+
</div>
|
|
9
|
+
</template>
|
|
10
|
+
|
|
11
|
+
<style scoped>
|
|
12
|
+
.VPNavBarAppearance {
|
|
13
|
+
display: none;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
@media (min-width: 1280px) {
|
|
17
|
+
.VPNavBarAppearance {
|
|
18
|
+
display: flex;
|
|
19
|
+
align-items: center;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
</style>
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import VPFlyout from './VPFlyout.vue'
|
|
4
|
+
import VPSwitchAppearance from './VPSwitchAppearance.vue'
|
|
5
|
+
import VPSocialLinks from './VPSocialLinks.vue'
|
|
6
|
+
|
|
7
|
+
const { theme } = useData()
|
|
8
|
+
</script>
|
|
9
|
+
|
|
10
|
+
<template>
|
|
11
|
+
<VPFlyout class="VPNavBarExtra" label="extra navigation">
|
|
12
|
+
<div v-if="theme.localeLinks" class="group">
|
|
13
|
+
<div class="trans">
|
|
14
|
+
<p class="trans-title">
|
|
15
|
+
{{ theme.localeLinks.text }}
|
|
16
|
+
</p>
|
|
17
|
+
|
|
18
|
+
<ul class="trans-list">
|
|
19
|
+
<li v-for="locale in theme.localeLinks.items" :key="locale.link" class="trans-item">
|
|
20
|
+
<a class="trans-link" :href="locale.link">{{ locale.text }}</a>
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
</div>
|
|
24
|
+
</div>
|
|
25
|
+
|
|
26
|
+
<div class="group">
|
|
27
|
+
<div class="item">
|
|
28
|
+
<p class="label">Appearance</p>
|
|
29
|
+
<div class="appearance-action">
|
|
30
|
+
<VPSwitchAppearance />
|
|
31
|
+
</div>
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
|
|
35
|
+
<div v-if="theme.socialLinks" class="group">
|
|
36
|
+
<div class="item">
|
|
37
|
+
<VPSocialLinks class="social-links" :links="theme.socialLinks" />
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
</VPFlyout>
|
|
41
|
+
</template>
|
|
42
|
+
|
|
43
|
+
<style scoped>
|
|
44
|
+
.VPNavBarExtra {
|
|
45
|
+
display: none;
|
|
46
|
+
margin-right: -12px;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
@media (min-width: 768px) {
|
|
50
|
+
.VPNavBarExtra {
|
|
51
|
+
display: block;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
@media (min-width: 1280px) {
|
|
56
|
+
.VPNavBarExtra {
|
|
57
|
+
display: none;
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
.trans {
|
|
62
|
+
padding: 2px 16px 0;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.trans-title {
|
|
66
|
+
display: flex;
|
|
67
|
+
align-items: center;
|
|
68
|
+
font-size: 13px;
|
|
69
|
+
font-weight: 600;
|
|
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;
|
|
87
|
+
color: var(--vp-c-text-1);
|
|
88
|
+
transition: color 0.25s;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.trans-link:hover {
|
|
92
|
+
color: var(--vp-c-brand);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
.item {
|
|
96
|
+
display: flex;
|
|
97
|
+
align-items: center;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
.appearance-action {
|
|
101
|
+
margin-right: -2px;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
.social-links {
|
|
105
|
+
margin: -4px -8px;
|
|
106
|
+
}
|
|
107
|
+
</style>
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
defineProps<{
|
|
3
|
+
active: boolean
|
|
4
|
+
}>()
|
|
5
|
+
|
|
6
|
+
defineEmits<{
|
|
7
|
+
(e: 'click'): void
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<button
|
|
13
|
+
type="button"
|
|
14
|
+
class="VPNavBarHamburger"
|
|
15
|
+
:class="{ active }"
|
|
16
|
+
aria-label="mobile navigation"
|
|
17
|
+
:aria-expanded="active"
|
|
18
|
+
aria-controls="VPNavScreen"
|
|
19
|
+
@click="$emit('click')"
|
|
20
|
+
>
|
|
21
|
+
<span class="container">
|
|
22
|
+
<span class="top" />
|
|
23
|
+
<span class="middle" />
|
|
24
|
+
<span class="bottom" />
|
|
25
|
+
</span>
|
|
26
|
+
</button>
|
|
27
|
+
</template>
|
|
28
|
+
|
|
29
|
+
<style scoped>
|
|
30
|
+
.VPNavBarHamburger {
|
|
31
|
+
display: flex;
|
|
32
|
+
justify-content: center;
|
|
33
|
+
align-items: center;
|
|
34
|
+
width: 48px;
|
|
35
|
+
height: var(--vp-nav-height);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
@media (min-width: 768px) {
|
|
39
|
+
.VPNavBarHamburger {
|
|
40
|
+
display: none;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
.container {
|
|
45
|
+
position: relative;
|
|
46
|
+
width: 16px;
|
|
47
|
+
height: 14px;
|
|
48
|
+
overflow: hidden;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
.container:hover .top { top: 0; left: 0; transform: translateX(4px); }
|
|
52
|
+
.container:hover .middle { top: 6; left: 0; transform: translateX(0); }
|
|
53
|
+
.container:hover .bottom { top: 12px; left: 0; transform: translateX(8px); }
|
|
54
|
+
|
|
55
|
+
.container.active .top { top: 6px; transform: translateX(0) rotate(225deg); }
|
|
56
|
+
.container.active .middle { top: 6px; transform: translateX(16px); }
|
|
57
|
+
.container.active .bottom { top: 6px; transform: translateX(0) rotate(135deg); }
|
|
58
|
+
|
|
59
|
+
.container.active:hover .top,
|
|
60
|
+
.container.active:hover .middle,
|
|
61
|
+
.container.active:hover .bottom {
|
|
62
|
+
background-color: var(--vt-c-text-2);
|
|
63
|
+
transition: top .25s, background-color .25s, transform .25s;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
.top,
|
|
67
|
+
.middle,
|
|
68
|
+
.bottom {
|
|
69
|
+
position: absolute;
|
|
70
|
+
width: 16px;
|
|
71
|
+
height: 2px;
|
|
72
|
+
background-color: var(--vp-c-text-1);
|
|
73
|
+
transition: top .25s, background-color .5s, transform .25s;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.top { top: 0; left: 0; transform: translateX(0); }
|
|
77
|
+
.middle { top: 6px; left: 0; transform: translateX(8px); }
|
|
78
|
+
.bottom { top: 12px; left: 0; transform: translateX(4px); }
|
|
79
|
+
</style>
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import VPNavBarMenuLink from './VPNavBarMenuLink.vue'
|
|
4
|
+
import VPNavBarMenuGroup from './VPNavBarMenuGroup.vue'
|
|
5
|
+
|
|
6
|
+
const { theme } = useData()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<nav v-if="theme.nav" aria-labelledby="main-nav-aria-label" class="VPNavBarMenu">
|
|
11
|
+
<span id="main-nav-aria-label" class="visually-hidden">Main Navigation</span>
|
|
12
|
+
<template v-for="item in theme.nav" :key="item.text">
|
|
13
|
+
<VPNavBarMenuLink v-if="'link' in item" :item="item" />
|
|
14
|
+
<VPNavBarMenuGroup v-else :item="item" />
|
|
15
|
+
</template>
|
|
16
|
+
</nav>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<style scoped>
|
|
20
|
+
.VPNavBarMenu {
|
|
21
|
+
display: none;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
@media (min-width: 768px) {
|
|
25
|
+
.VPNavBarMenu {
|
|
26
|
+
display: flex;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { DefaultTheme, useData } from 'vitepress'
|
|
3
|
+
import { isActive } from '../support/utils'
|
|
4
|
+
import VPFlyout from './VPFlyout.vue'
|
|
5
|
+
|
|
6
|
+
defineProps<{
|
|
7
|
+
item: DefaultTheme.NavItemWithChildren
|
|
8
|
+
}>()
|
|
9
|
+
|
|
10
|
+
const { page } = useData()
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<VPFlyout
|
|
15
|
+
:button="item.text"
|
|
16
|
+
:items="item.items"
|
|
17
|
+
/>
|
|
18
|
+
</template>
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { DefaultTheme, useData } from 'vitepress'
|
|
3
|
+
import { isActive } from '../support/utils'
|
|
4
|
+
import { NavItemWithLink } from '../config'
|
|
5
|
+
import VPLink from './VPLink.vue'
|
|
6
|
+
|
|
7
|
+
defineProps<{
|
|
8
|
+
item: DefaultTheme.NavItemWithLink
|
|
9
|
+
}>()
|
|
10
|
+
|
|
11
|
+
const { page } = useData()
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template>
|
|
15
|
+
<VPLink
|
|
16
|
+
:class="{
|
|
17
|
+
VPNavBarMenuLink: true,
|
|
18
|
+
active: isActive(
|
|
19
|
+
page.relativePath,
|
|
20
|
+
item.activeMatch || item.link,
|
|
21
|
+
!!item.activeMatch
|
|
22
|
+
)
|
|
23
|
+
}"
|
|
24
|
+
:href="item.link"
|
|
25
|
+
:noIcon="true"
|
|
26
|
+
>
|
|
27
|
+
{{ item.text }}
|
|
28
|
+
</VPLink>
|
|
29
|
+
</template>
|
|
30
|
+
|
|
31
|
+
<style scoped>
|
|
32
|
+
.VPNavBarMenuLink {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
padding: 0 12px;
|
|
36
|
+
line-height: var(--vp-nav-height-mobile);
|
|
37
|
+
font-size: 13px;
|
|
38
|
+
font-weight: 500;
|
|
39
|
+
color: var(--vp-c-text-1);
|
|
40
|
+
transition: color 0.25s;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.VPNavBarMenuLink.active {
|
|
44
|
+
color: var(--vp-c-brand);
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.VPNavBarMenuLink:hover {
|
|
48
|
+
color: var(--vp-c-brand);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
@media (min-width: 1280px) {
|
|
52
|
+
.VPNavBarMenuLink {
|
|
53
|
+
line-height: var(--vp-nav-height-desktop);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
</style>
|