vitepress 0.22.3 → 1.0.0-draft.2
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/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/index.d.ts +5 -0
- package/dist/client/shared.js +1 -0
- package/dist/client/theme-default/Layout.vue +39 -180
- 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/VPBox.vue +59 -0
- package/dist/client/theme-default/components/VPButton.vue +123 -0
- package/dist/client/theme-default/components/VPContent.vue +74 -0
- package/dist/client/theme-default/components/VPDoc.vue +173 -0
- package/dist/client/theme-default/components/VPDocFooter.vue +141 -0
- package/dist/client/theme-default/components/VPDocOutline.vue +108 -0
- package/dist/client/theme-default/components/VPFlyout.vue +149 -0
- package/dist/client/theme-default/components/VPFooter.vue +53 -0
- package/dist/client/theme-default/components/VPHero.vue +144 -0
- package/dist/client/theme-default/components/VPHome.vue +33 -0
- package/dist/client/theme-default/components/VPHomeFeatures.vue +96 -0
- package/dist/client/theme-default/components/VPHomeHero.vue +17 -0
- package/dist/client/theme-default/components/VPHomeSponsors.vue +97 -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 +110 -0
- package/dist/client/theme-default/components/VPNavBarAppearance.vue +25 -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 +57 -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 +33 -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/VPPage.vue +5 -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/VPSponsors.vue +77 -0
- package/dist/client/theme-default/components/VPSponsorsGrid.vue +32 -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/VPIconHeart.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 +112 -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/composables/sponsor-grid.js +92 -0
- package/dist/client/theme-default/composables/sponsor.js +87 -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 +8 -4
- package/dist/client/theme-default/styles/base.css +203 -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 +291 -66
- package/dist/client/theme-default/styles/vp-doc.css +425 -0
- package/dist/client/theme-default/styles/vp-sponsor.css +86 -0
- package/dist/client/theme-default/support/sidebar.js +29 -0
- package/dist/client/theme-default/support/utils.js +62 -0
- package/dist/node/alias.js +60 -0
- package/dist/node/alias.js.map +1 -0
- package/dist/node/build/build.js +57 -0
- package/dist/node/build/build.js.map +1 -0
- package/dist/node/build/buildMPAClient.js +44 -0
- package/dist/node/build/buildMPAClient.js.map +1 -0
- package/dist/node/build/bundle.js +163 -0
- package/dist/node/build/bundle.js.map +1 -0
- package/dist/node/build/render.js +185 -0
- package/dist/node/build/render.js.map +1 -0
- package/dist/node/cli.js +37 -294
- package/dist/node/cli.js.map +1 -0
- package/dist/node/config.js +176 -0
- package/dist/node/config.js.map +1 -0
- package/dist/node/index.d.ts +122 -79
- package/dist/node/index.js +22 -37
- package/dist/node/index.js.map +1 -0
- package/dist/node/markdown/markdown.js +75 -0
- package/dist/node/markdown/markdown.js.map +1 -0
- package/dist/node/markdown/plugins/component.js +86 -0
- package/dist/node/markdown/plugins/component.js.map +1 -0
- package/dist/node/markdown/plugins/containers.js +41 -0
- package/dist/node/markdown/plugins/containers.js.map +1 -0
- package/dist/node/markdown/plugins/headings.js +25 -0
- package/dist/node/markdown/plugins/headings.js.map +1 -0
- package/dist/node/markdown/plugins/highlight.js +53 -0
- package/dist/node/markdown/plugins/highlight.js.map +1 -0
- package/dist/node/markdown/plugins/highlightLines.js +48 -0
- package/dist/node/markdown/plugins/highlightLines.js.map +1 -0
- package/dist/node/markdown/plugins/hoist.js +22 -0
- package/dist/node/markdown/plugins/hoist.js.map +1 -0
- package/dist/node/markdown/plugins/image.js +17 -0
- package/dist/node/markdown/plugins/image.js.map +1 -0
- package/dist/node/markdown/plugins/lineNumbers.js +23 -0
- package/dist/node/markdown/plugins/lineNumbers.js.map +1 -0
- package/dist/node/markdown/plugins/link.js +85 -0
- package/dist/node/markdown/plugins/link.js.map +1 -0
- package/dist/node/markdown/plugins/preWrapper.js +22 -0
- package/dist/node/markdown/plugins/preWrapper.js.map +1 -0
- package/dist/node/markdown/plugins/slugify.js +26 -0
- package/dist/node/markdown/plugins/slugify.js.map +1 -0
- package/dist/node/markdown/plugins/snippet.js +146 -0
- package/dist/node/markdown/plugins/snippet.js.map +1 -0
- package/dist/node/markdownToVue.js +166 -0
- package/dist/node/markdownToVue.js.map +1 -0
- package/dist/node/plugin.js +227 -0
- package/dist/node/plugin.js.map +1 -0
- package/dist/node/serve/serve.js +59 -0
- package/dist/node/serve/serve.js.map +1 -0
- package/dist/node/{serve-777539c0.js → serve-b5dc02b2.js} +27 -2
- package/dist/node/server.js +18 -0
- package/dist/node/server.js.map +1 -0
- package/dist/node/shared.js +72 -0
- package/dist/node/shared.js.map +1 -0
- package/dist/node/staticDataPlugin.js +99 -0
- package/dist/node/staticDataPlugin.js.map +1 -0
- package/dist/node/utils/getGitTimestamp.js +17 -0
- package/dist/node/utils/getGitTimestamp.js.map +1 -0
- package/dist/node/utils/parseHeader.js +57 -0
- package/dist/node/utils/parseHeader.js.map +1 -0
- package/dist/node/utils/slash.js +8 -0
- package/dist/node/utils/slash.js.map +1 -0
- package/package.json +31 -25
- package/types/default-theme.d.ts +115 -78
- package/types/shared.d.ts +11 -6
- package/dist/client/theme-default/components/AlgoliaSearchBox.vue +0 -188
- 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,27 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import VPSocialLinks from './VPSocialLinks.vue'
|
|
4
|
+
|
|
5
|
+
const { theme } = useData()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<VPSocialLinks
|
|
10
|
+
v-if="theme.socialLinks"
|
|
11
|
+
class="VPNavBarSocialLinks"
|
|
12
|
+
:links="theme.socialLinks"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
15
|
+
|
|
16
|
+
<style scoped>
|
|
17
|
+
.VPNavBarSocialLinks {
|
|
18
|
+
display: none;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
@media (min-width: 1280px) {
|
|
22
|
+
.VPNavBarSocialLinks {
|
|
23
|
+
display: flex;
|
|
24
|
+
align-items: center;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
</style>
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import { useSidebar } from '../composables/sidebar'
|
|
4
|
+
|
|
5
|
+
const { site, theme } = useData()
|
|
6
|
+
const { hasSidebar } = useSidebar()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<div class="VPNavBarTitle" :class="{ 'has-sidebar': hasSidebar }">
|
|
11
|
+
<a class="title" href="/">
|
|
12
|
+
<img v-if="theme.logo" class="logo" :src="theme.logo" :alt="site.title">
|
|
13
|
+
{{ site.title }}
|
|
14
|
+
</a>
|
|
15
|
+
</div>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<style scoped>
|
|
19
|
+
.VPNavBarTitle {
|
|
20
|
+
flex-shrink: 0;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
@media (min-width: 960px) {
|
|
24
|
+
.VPNavBarTitle.has-sidebar {
|
|
25
|
+
margin-right: 32px;
|
|
26
|
+
width: calc(var(--vp-sidebar-width) - 64px);
|
|
27
|
+
border-bottom: 1px solid var(--vp-c-divider-light);
|
|
28
|
+
background-color: var(--vp-c-bg-sidebar);
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
.title {
|
|
33
|
+
display: flex;
|
|
34
|
+
align-items: center;
|
|
35
|
+
width: 100%;
|
|
36
|
+
height: var(--vp-nav-height);
|
|
37
|
+
font-size: 16px;
|
|
38
|
+
font-weight: 600;
|
|
39
|
+
color: var(--vp-c-text-1);
|
|
40
|
+
transition: opacity 0.25s;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.title:hover {
|
|
44
|
+
opacity: 0.6;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
@media (min-width: 960px) {
|
|
48
|
+
.title {
|
|
49
|
+
flex-shrink: 0;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.logo {
|
|
54
|
+
margin-right: 8px;
|
|
55
|
+
height: 24px;
|
|
56
|
+
}
|
|
57
|
+
</style>
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { useData } from 'vitepress'
|
|
4
|
+
import VPIconLanguages from './icons/VPIconLanguages.vue'
|
|
5
|
+
import VPFlyout from './VPFlyout.vue'
|
|
6
|
+
|
|
7
|
+
const { theme } = useData()
|
|
8
|
+
|
|
9
|
+
const isOpen = ref(false)
|
|
10
|
+
|
|
11
|
+
function toggle() {
|
|
12
|
+
isOpen.value = !isOpen.value
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<VPFlyout
|
|
18
|
+
v-if="theme.localeLinks"
|
|
19
|
+
class="VPNavBarTranslations"
|
|
20
|
+
:icon="VPIconLanguages"
|
|
21
|
+
>
|
|
22
|
+
<div class="container">
|
|
23
|
+
<p class="title">
|
|
24
|
+
{{ theme.localeLinks.text }}
|
|
25
|
+
</p>
|
|
26
|
+
|
|
27
|
+
<ul class="list">
|
|
28
|
+
<li v-for="locale in theme.localeLinks.items" :key="locale.link" class="lang">
|
|
29
|
+
<a class="link" :href="locale.link">{{ locale.text }}</a>
|
|
30
|
+
</li>
|
|
31
|
+
</ul>
|
|
32
|
+
</div>
|
|
33
|
+
</VPFlyout>
|
|
34
|
+
</template>
|
|
35
|
+
|
|
36
|
+
<style scoped>
|
|
37
|
+
.VPNavBarTranslations {
|
|
38
|
+
display: none;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (min-width: 1280px) {
|
|
42
|
+
.VPNavBarTranslations {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.container {
|
|
49
|
+
padding: 0 16px;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
.title {
|
|
53
|
+
display: flex;
|
|
54
|
+
align-items: center;
|
|
55
|
+
font-size: 13px;
|
|
56
|
+
font-weight: 600;
|
|
57
|
+
color: var(--vp-c-text-1);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.lang {
|
|
61
|
+
padding: 4px 0 0 0;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.link {
|
|
65
|
+
line-height: 28px;
|
|
66
|
+
font-size: 13px;
|
|
67
|
+
color: var(--vp-c-text-1);
|
|
68
|
+
transition: color 0.25s;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
.link:hover {
|
|
72
|
+
color: var(--vp-c-brand);
|
|
73
|
+
}
|
|
74
|
+
</style>
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { disableBodyScroll, clearAllBodyScrollLocks } from 'body-scroll-lock'
|
|
4
|
+
import VPNavScreenMenu from './VPNavScreenMenu.vue'
|
|
5
|
+
import VPNavScreenAppearance from './VPNavScreenAppearance.vue'
|
|
6
|
+
import VPNavScreenTranslations from './VPNavScreenTranslations.vue'
|
|
7
|
+
import VPNavScreenSocialLinks from './VPNavScreenSocialLinks.vue'
|
|
8
|
+
|
|
9
|
+
defineProps<{
|
|
10
|
+
open: boolean
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const screen = ref<HTMLElement | null>(null)
|
|
14
|
+
|
|
15
|
+
function lockBodyScroll() {
|
|
16
|
+
disableBodyScroll(screen.value!, { reserveScrollBarGap: true })
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
function unlockBodyScroll() {
|
|
20
|
+
clearAllBodyScrollLocks()
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<transition
|
|
26
|
+
name="fade"
|
|
27
|
+
@enter="lockBodyScroll"
|
|
28
|
+
@after-leave="unlockBodyScroll"
|
|
29
|
+
>
|
|
30
|
+
<div v-if="open" class="VPNavScreen" ref="screen">
|
|
31
|
+
<div class="container">
|
|
32
|
+
<VPNavScreenMenu class="menu" />
|
|
33
|
+
<VPNavScreenTranslations class="translations" />
|
|
34
|
+
<VPNavScreenAppearance class="appearance" />
|
|
35
|
+
<VPNavScreenSocialLinks class="social-links" />
|
|
36
|
+
</div>
|
|
37
|
+
</div>
|
|
38
|
+
</transition>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<style scoped>
|
|
42
|
+
.VPNavScreen {
|
|
43
|
+
position: fixed;
|
|
44
|
+
top: var(--vp-nav-height-mobile);
|
|
45
|
+
right: 0;
|
|
46
|
+
bottom: 0;
|
|
47
|
+
left: 0;
|
|
48
|
+
padding: 0 32px;
|
|
49
|
+
width: 100%;
|
|
50
|
+
background-color: var(--vp-c-bg);
|
|
51
|
+
overflow-y: auto;
|
|
52
|
+
transition: background-color 0.5s;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
.VPNavScreen.fade-enter-active,
|
|
56
|
+
.VPNavScreen.fade-leave-active {
|
|
57
|
+
transition: opacity 0.25s;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.VPNavScreen.fade-enter-active .container,
|
|
61
|
+
.VPNavScreen.fade-leave-active .container {
|
|
62
|
+
transition: transform 0.25s ease;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.VPNavScreen.fade-enter-from,
|
|
66
|
+
.VPNavScreen.fade-leave-to {
|
|
67
|
+
opacity: 0;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
.VPNavScreen.fade-enter-from .container,
|
|
71
|
+
.VPNavScreen.fade-leave-to .container {
|
|
72
|
+
transform: translateY(-8px);
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
@media (min-width: 768px) {
|
|
76
|
+
.VPNavScreen {
|
|
77
|
+
display: none;
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.container {
|
|
82
|
+
margin: 0 auto;
|
|
83
|
+
padding: 24px 0 96px;
|
|
84
|
+
max-width: 288px;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
.menu + .translations,
|
|
88
|
+
.menu + .appearance,
|
|
89
|
+
.translations + .appearance {
|
|
90
|
+
margin-top: 24px;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.menu + .social-links {
|
|
94
|
+
margin-top: 16px;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
.appearance + .social-links {
|
|
98
|
+
margin-top: 16px;
|
|
99
|
+
}
|
|
100
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import VPSwitchAppearance from './VPSwitchAppearance.vue'
|
|
4
|
+
|
|
5
|
+
const { site } = useData()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<div v-if="site.appearance" class="VPNavScreenAppearance">
|
|
10
|
+
<p class="text">Appearance</p>
|
|
11
|
+
<VPSwitchAppearance />
|
|
12
|
+
</div>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<style scoped>
|
|
16
|
+
.VPNavScreenAppearance {
|
|
17
|
+
display: flex;
|
|
18
|
+
justify-content: space-between;
|
|
19
|
+
align-items: center;
|
|
20
|
+
border-radius: 8px;
|
|
21
|
+
padding: 12px 14px 12px 16px;
|
|
22
|
+
background-color: var(--vp-c-bg-soft);
|
|
23
|
+
transition: background-color 0.5s;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.text {
|
|
27
|
+
line-height: 24px;
|
|
28
|
+
font-size: 12px;
|
|
29
|
+
font-weight: 500;
|
|
30
|
+
color: var(--vp-c-text-2);
|
|
31
|
+
transition: color 0.5s;
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import VPNavScreenMenuLink from './VPNavScreenMenuLink.vue'
|
|
4
|
+
import VPNavScreenMenuGroup from './VPNavScreenMenuGroup.vue'
|
|
5
|
+
|
|
6
|
+
const { theme } = useData()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<nav v-if="theme.nav" class="VPNavScreenMenu">
|
|
11
|
+
<template v-for="item in theme.nav" :key="item.text">
|
|
12
|
+
<VPNavScreenMenuLink
|
|
13
|
+
v-if="'link' in item"
|
|
14
|
+
:text="item.text"
|
|
15
|
+
:link="item.link"
|
|
16
|
+
/>
|
|
17
|
+
<VPNavScreenMenuGroup
|
|
18
|
+
v-else
|
|
19
|
+
:text="item.text || ''"
|
|
20
|
+
:items="item.items"
|
|
21
|
+
/>
|
|
22
|
+
</template>
|
|
23
|
+
</nav>
|
|
24
|
+
</template>
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { computed, ref } from 'vue'
|
|
3
|
+
import { DefaultTheme } from 'vitepress'
|
|
4
|
+
import VPIconPlus from './icons/VPIconPlus.vue'
|
|
5
|
+
import VPNavScreenMenuGroupLink from './VPNavScreenMenuGroupLink.vue'
|
|
6
|
+
import VPNavScreenMenuGroupSection from './VPNavScreenMenuGroupSection.vue'
|
|
7
|
+
|
|
8
|
+
const props = defineProps<{
|
|
9
|
+
text: string
|
|
10
|
+
items: DefaultTheme.NavItemChild[]
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const isOpen = ref(false)
|
|
14
|
+
|
|
15
|
+
const groupId = computed(() =>
|
|
16
|
+
`NavScreenGroup-${props.text.replace(' ', '-').toLowerCase()}`
|
|
17
|
+
)
|
|
18
|
+
|
|
19
|
+
function toggle() {
|
|
20
|
+
isOpen.value = !isOpen.value
|
|
21
|
+
}
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<template>
|
|
25
|
+
<div class="VPNavScreenMenuGroup" :class="{ open: isOpen }">
|
|
26
|
+
<button
|
|
27
|
+
class="button"
|
|
28
|
+
:aria-controls="groupId"
|
|
29
|
+
:aria-expanded="isOpen"
|
|
30
|
+
@click="toggle"
|
|
31
|
+
>
|
|
32
|
+
<span class="button-text">{{ text }}</span>
|
|
33
|
+
<VPIconPlus class="button-icon" />
|
|
34
|
+
</button>
|
|
35
|
+
|
|
36
|
+
<div :id="groupId" class="items">
|
|
37
|
+
<template v-for="item in items" :key="item.text">
|
|
38
|
+
<div v-if="'link' in item" :key="item.text" class="item">
|
|
39
|
+
<VPNavScreenMenuGroupLink
|
|
40
|
+
:text="item.text"
|
|
41
|
+
:link="item.link"
|
|
42
|
+
/>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<div v-else class="group">
|
|
46
|
+
<VPNavScreenMenuGroupSection
|
|
47
|
+
:text="item.text"
|
|
48
|
+
:items="item.items"
|
|
49
|
+
/>
|
|
50
|
+
</div>
|
|
51
|
+
</template>
|
|
52
|
+
</div>
|
|
53
|
+
</div>
|
|
54
|
+
</template>
|
|
55
|
+
|
|
56
|
+
<style scoped>
|
|
57
|
+
.VPNavScreenMenuGroup {
|
|
58
|
+
border-bottom: 1px solid var(--vp-c-divider-light);
|
|
59
|
+
height: 48px;
|
|
60
|
+
overflow: hidden;
|
|
61
|
+
transition: border-color 0.5s;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.VPNavScreenMenuGroup .items {
|
|
65
|
+
visibility: hidden;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.VPNavScreenMenuGroup.open .items {
|
|
69
|
+
visibility: visible;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.VPNavScreenMenuGroup.open {
|
|
73
|
+
padding-bottom: 10px;
|
|
74
|
+
height: auto;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.VPNavScreenMenuGroup.open .button {
|
|
78
|
+
padding-bottom: 6px;
|
|
79
|
+
color: var(--vp-c-brand);
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.VPNavScreenMenuGroup.open .button-icon {
|
|
83
|
+
transform: rotate(45deg);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.button {
|
|
87
|
+
display: flex;
|
|
88
|
+
justify-content: space-between;
|
|
89
|
+
align-items: center;
|
|
90
|
+
padding: 12px 4px 11px 0;
|
|
91
|
+
width: 100%;
|
|
92
|
+
line-height: 24px;
|
|
93
|
+
font-size: 14px;
|
|
94
|
+
font-weight: 500;
|
|
95
|
+
color: var(--vp-c-text-1);
|
|
96
|
+
transition: color 0.25s;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.button:hover {
|
|
100
|
+
color: var(--vp-c-brand);
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.button-icon {
|
|
104
|
+
width: 14px;
|
|
105
|
+
height: 14px;
|
|
106
|
+
fill: var(--vp-c-text-2);
|
|
107
|
+
transition: fill 0.5s, transform 0.25s;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.group:first-child {
|
|
111
|
+
padding-top: 0px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
.group + .group,
|
|
115
|
+
.group + .item {
|
|
116
|
+
padding-top: 4px;
|
|
117
|
+
}
|
|
118
|
+
</style>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
import VPLink from './VPLink.vue'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
text: string
|
|
7
|
+
link: string
|
|
8
|
+
}>()
|
|
9
|
+
|
|
10
|
+
const closeScreen = inject('close-screen') as () => void
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<VPLink class="VPNavScreenMenuGroupLink" :href="link" @click="closeScreen">
|
|
15
|
+
{{ text }}
|
|
16
|
+
</VPLink>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<style scoped>
|
|
20
|
+
.VPNavScreenMenuGroupLink {
|
|
21
|
+
display: block;
|
|
22
|
+
line-height: 32px;
|
|
23
|
+
font-size: 13px;
|
|
24
|
+
font-weight: 400;
|
|
25
|
+
color: var(--vp-c-text-1);
|
|
26
|
+
transition: color 0.25s;
|
|
27
|
+
margin-left: 12px;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
.VPNavScreenMenuGroupLink:hover {
|
|
31
|
+
color: var(--vp-c-brand);
|
|
32
|
+
}
|
|
33
|
+
</style>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { DefaultTheme } from 'vitepress'
|
|
3
|
+
import VPNavScreenMenuGroupLink from './VPNavScreenMenuGroupLink.vue'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
text?: string
|
|
7
|
+
items: DefaultTheme.NavItemWithLink[]
|
|
8
|
+
}>()
|
|
9
|
+
</script>
|
|
10
|
+
|
|
11
|
+
<template>
|
|
12
|
+
<div class="VPNavScreenMenuGroupSection">
|
|
13
|
+
<p v-if="text" class="title">{{ text }}</p>
|
|
14
|
+
<VPNavScreenMenuGroupLink
|
|
15
|
+
v-for="item in items"
|
|
16
|
+
:key="item.text"
|
|
17
|
+
:text="item.text"
|
|
18
|
+
:link="item.link"
|
|
19
|
+
/>
|
|
20
|
+
</div>
|
|
21
|
+
</template>
|
|
22
|
+
|
|
23
|
+
<style scoped>
|
|
24
|
+
.VPNavScreenMenuGroupSection {
|
|
25
|
+
display: block;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.title {
|
|
29
|
+
line-height: 32px;
|
|
30
|
+
font-size: 13px;
|
|
31
|
+
font-weight: 700;
|
|
32
|
+
color: var(--vp-c-text-2);
|
|
33
|
+
transition: color 0.25s;
|
|
34
|
+
}
|
|
35
|
+
</style>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { inject } from 'vue'
|
|
3
|
+
import VPLink from './VPLink.vue'
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
text: string
|
|
7
|
+
link: string
|
|
8
|
+
}>()
|
|
9
|
+
|
|
10
|
+
const closeScreen = inject('close-screen') as () => void
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<template>
|
|
14
|
+
<VPLink class="VPNavScreenMenuLink" :href="link" @click="closeScreen">
|
|
15
|
+
{{ text }}
|
|
16
|
+
</VPLink>
|
|
17
|
+
</template>
|
|
18
|
+
|
|
19
|
+
<style scoped>
|
|
20
|
+
.VPNavScreenMenuLink {
|
|
21
|
+
display: block;
|
|
22
|
+
border-bottom: 1px solid var(--vp-c-divider-light);
|
|
23
|
+
padding: 12px 0 11px;
|
|
24
|
+
line-height: 24px;
|
|
25
|
+
font-size: 14px;
|
|
26
|
+
font-weight: 500;
|
|
27
|
+
color: var(--vp-c-text-1);
|
|
28
|
+
transition: border-color 0.5s, color 0.25s;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.VPNavScreenMenuLink:hover {
|
|
32
|
+
color: var(--vp-c-brand);
|
|
33
|
+
}
|
|
34
|
+
</style>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { useData } from 'vitepress'
|
|
3
|
+
import VPSocialLinks from './VPSocialLinks.vue'
|
|
4
|
+
|
|
5
|
+
const { theme } = useData()
|
|
6
|
+
</script>
|
|
7
|
+
|
|
8
|
+
<template>
|
|
9
|
+
<VPSocialLinks
|
|
10
|
+
v-if="theme.socialLinks"
|
|
11
|
+
class="VPNavScreenSocialLinks"
|
|
12
|
+
:links="theme.socialLinks"
|
|
13
|
+
/>
|
|
14
|
+
</template>
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { useData } from 'vitepress'
|
|
4
|
+
import VPIconChevronDown from './icons/VPIconChevronDown.vue'
|
|
5
|
+
import VPIconLanguages from './icons/VPIconLanguages.vue'
|
|
6
|
+
|
|
7
|
+
const { theme } = useData()
|
|
8
|
+
|
|
9
|
+
const isOpen = ref(false)
|
|
10
|
+
|
|
11
|
+
function toggle() {
|
|
12
|
+
isOpen.value = !isOpen.value
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<div v-if="theme.localeLinks" class="VPNavScreenTranslations" :class="{ open: isOpen }">
|
|
18
|
+
<button class="title" @click="toggle">
|
|
19
|
+
<VPIconLanguages class="icon lang" />
|
|
20
|
+
{{ theme.localeLinks.text }}
|
|
21
|
+
<VPIconChevronDown class="icon chevron" />
|
|
22
|
+
</button>
|
|
23
|
+
|
|
24
|
+
<ul class="list">
|
|
25
|
+
<li v-for="locale in theme.localeLinks.items" :key="locale.link" class="item">
|
|
26
|
+
<a class="link" :href="locale.link">{{ locale.text }}</a>
|
|
27
|
+
</li>
|
|
28
|
+
</ul>
|
|
29
|
+
</div>
|
|
30
|
+
</template>
|
|
31
|
+
|
|
32
|
+
<style scoped>
|
|
33
|
+
.VPNavScreenTranslations {
|
|
34
|
+
height: 24px;
|
|
35
|
+
overflow: hidden;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.VPNavScreenTranslations.open {
|
|
39
|
+
height: auto;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
.title {
|
|
43
|
+
display: flex;
|
|
44
|
+
align-items: center;
|
|
45
|
+
font-size: 14px;
|
|
46
|
+
font-weight: 500;
|
|
47
|
+
color: var(--vp-c-text-1);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.icon {
|
|
51
|
+
width: 16px;
|
|
52
|
+
height: 16px;
|
|
53
|
+
fill: currentColor;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.icon.lang {
|
|
57
|
+
margin-right: 8px;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.icon.chevron {
|
|
61
|
+
margin-left: 4px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.list {
|
|
65
|
+
padding: 4px 0 0 24px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.link {
|
|
69
|
+
line-height: 32px;
|
|
70
|
+
font-size: 13px;
|
|
71
|
+
color: var(--vp-c-text-1);
|
|
72
|
+
}
|
|
73
|
+
</style>
|