vitepress 2.0.0-alpha.2 → 2.0.0-alpha.21
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 +34 -2
- package/THIRD-PARTY-NOTICES.md +1736 -0
- package/bin/vitepress.js +14 -0
- package/client.d.ts +9 -0
- package/dist/client/app/components/ClientOnly.d.ts +5 -0
- package/dist/client/app/components/ClientOnly.js +11 -10
- package/dist/client/app/components/Content.d.ts +17 -0
- package/dist/client/app/components/Content.js +25 -22
- package/dist/client/app/composables/codeGroups.d.ts +3 -0
- package/dist/client/app/composables/codeGroups.js +36 -39
- package/dist/client/app/composables/copyCode.d.ts +3 -0
- package/dist/client/app/composables/copyCode.js +59 -70
- package/dist/client/app/composables/head.d.ts +5 -0
- package/dist/client/app/composables/head.js +56 -74
- package/dist/client/app/composables/icon.d.ts +12 -0
- package/dist/client/app/composables/icon.js +56 -0
- package/dist/client/app/composables/preFetch.d.ts +3 -0
- package/dist/client/app/composables/preFetch.js +64 -96
- package/dist/client/app/data.d.ts +9 -0
- package/dist/client/app/data.js +34 -59
- package/dist/client/app/devtools.d.ts +7 -0
- package/dist/client/app/devtools.js +29 -28
- package/dist/client/app/index.d.ts +11 -0
- package/dist/client/app/index.js +106 -131
- package/dist/client/app/router.d.ts +49 -0
- package/dist/client/app/router.js +198 -239
- package/dist/client/app/ssr.d.ts +4 -0
- package/dist/client/app/ssr.js +14 -9
- package/dist/client/app/theme.d.ts +24 -0
- package/dist/client/app/theme.js +0 -1
- package/dist/client/app/utils.d.ts +35 -0
- package/dist/client/app/utils.js +77 -110
- package/dist/client/index.d.ts +21 -137
- package/dist/client/index.js +8 -9
- package/dist/client/shared.d.ts +88 -0
- package/dist/client/shared.js +265 -141
- package/dist/client/theme-default/Layout.d.vue.ts +79 -0
- package/dist/client/theme-default/Layout.vue +33 -36
- package/dist/client/theme-default/NotFound.d.vue.ts +3 -0
- package/dist/client/theme-default/NotFound.vue +33 -35
- package/dist/client/theme-default/components/VPAlgoliaSearchBox.d.vue.ts +11 -0
- package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +202 -70
- package/dist/client/theme-default/components/VPBackdrop.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPBackdrop.vue +8 -12
- package/dist/client/theme-default/components/VPBadge.d.vue.ts +19 -0
- package/dist/client/theme-default/components/VPBadge.vue +49 -26
- package/dist/client/theme-default/components/VPButton.d.vue.ts +25 -0
- package/dist/client/theme-default/components/VPButton.vue +53 -36
- package/dist/client/theme-default/components/VPCarbonAds.d.vue.ts +7 -0
- package/dist/client/theme-default/components/VPCarbonAds.vue +51 -52
- package/dist/client/theme-default/components/VPContent.d.vue.ts +59 -0
- package/dist/client/theme-default/components/VPContent.vue +27 -26
- package/dist/client/theme-default/components/VPDoc.d.vue.ts +33 -0
- package/dist/client/theme-default/components/VPDoc.vue +52 -48
- package/dist/client/theme-default/components/VPDocAside.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPDocAside.vue +7 -8
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.d.vue.ts +7 -0
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +7 -11
- package/dist/client/theme-default/components/VPDocAsideOutline.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPDocAsideOutline.vue +22 -38
- package/dist/client/theme-default/components/VPDocAsideSponsors.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPDocAsideSponsors.vue +17 -11
- package/dist/client/theme-default/components/VPDocFooter.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPDocFooter.vue +38 -45
- package/dist/client/theme-default/components/VPDocFooterLastUpdated.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPDocFooterLastUpdated.vue +30 -29
- package/dist/client/theme-default/components/VPDocOutlineItem.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPDocOutlineItem.vue +20 -19
- package/dist/client/theme-default/components/VPFeature.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPFeature.vue +62 -36
- package/dist/client/theme-default/components/VPFeatures.d.vue.ts +16 -0
- package/dist/client/theme-default/components/VPFeatures.vue +35 -48
- package/dist/client/theme-default/components/VPFlyout.d.vue.ts +26 -0
- package/dist/client/theme-default/components/VPFlyout.vue +111 -47
- package/dist/client/theme-default/components/VPFooter.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPFooter.vue +22 -15
- package/dist/client/theme-default/components/VPHero.d.vue.ts +38 -0
- package/dist/client/theme-default/components/VPHero.vue +109 -99
- package/dist/client/theme-default/components/VPHome.d.vue.ts +31 -0
- package/dist/client/theme-default/components/VPHome.vue +15 -15
- package/dist/client/theme-default/components/VPHomeContent.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPHomeContent.vue +9 -27
- package/dist/client/theme-default/components/VPHomeFeatures.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPHomeFeatures.vue +4 -5
- package/dist/client/theme-default/components/VPHomeHero.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPHomeHero.vue +5 -5
- package/dist/client/theme-default/components/VPHomeSponsors.d.vue.ts +21 -0
- package/dist/client/theme-default/components/VPHomeSponsors.vue +42 -43
- package/dist/client/theme-default/components/VPIcon.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPIcon.vue +29 -0
- package/dist/client/theme-default/components/VPImage.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPImage.vue +20 -14
- package/dist/client/theme-default/components/VPLink.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPLink.vue +42 -23
- package/dist/client/theme-default/components/VPLocalNav.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPLocalNav.vue +69 -86
- package/dist/client/theme-default/components/VPLocalNavOutlineDropdown.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPLocalNavOutlineDropdown.vue +98 -96
- package/dist/client/theme-default/components/VPLocalSearchBox.d.vue.ts +7 -0
- package/dist/client/theme-default/components/VPLocalSearchBox.vue +391 -454
- package/dist/client/theme-default/components/VPMenu.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPMenu.vue +19 -31
- package/dist/client/theme-default/components/VPMenuGroup.d.vue.ts +22 -0
- package/dist/client/theme-default/components/VPMenuGroup.vue +72 -18
- package/dist/client/theme-default/components/VPMenuLink.d.vue.ts +22 -0
- package/dist/client/theme-default/components/VPMenuLink.vue +65 -31
- package/dist/client/theme-default/components/VPNav.d.vue.ts +23 -0
- package/dist/client/theme-default/components/VPNav.vue +18 -24
- package/dist/client/theme-default/components/VPNavAppearance.d.vue.ts +9 -0
- package/dist/client/theme-default/components/VPNavAppearance.vue +88 -0
- package/dist/client/theme-default/components/VPNavBar.d.vue.ts +26 -0
- package/dist/client/theme-default/components/VPNavBar.vue +170 -142
- package/dist/client/theme-default/components/VPNavBarAskAiButton.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPNavBarAskAiButton.vue +31 -0
- package/dist/client/theme-default/components/VPNavBarExtra.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPNavBarExtra.vue +51 -73
- package/dist/client/theme-default/components/VPNavBarHamburger.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPNavBarHamburger.vue +38 -28
- package/dist/client/theme-default/components/VPNavBarSearch.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPNavBarSearch.vue +129 -160
- package/dist/client/theme-default/components/VPNavBarSearchButton.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPNavBarSearchButton.vue +48 -182
- package/dist/client/theme-default/components/VPNavBarTitle.d.vue.ts +15 -0
- package/dist/client/theme-default/components/VPNavBarTitle.vue +39 -38
- package/dist/client/theme-default/components/VPNavMenu.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPNavMenu.vue +76 -0
- package/dist/client/theme-default/components/VPNavMenuGroup.d.vue.ts +11 -0
- package/dist/client/theme-default/components/VPNavMenuGroup.vue +140 -0
- package/dist/client/theme-default/components/VPNavMenuLink.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPNavMenuLink.vue +69 -0
- package/dist/client/theme-default/components/VPNavScreen.d.vue.ts +18 -0
- package/dist/client/theme-default/components/VPNavScreen.vue +36 -34
- package/dist/client/theme-default/components/VPNavSocialLinks.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPNavSocialLinks.vue +36 -0
- package/dist/client/theme-default/components/VPNavTranslations.d.vue.ts +9 -0
- package/dist/client/theme-default/components/VPNavTranslations.vue +170 -0
- package/dist/client/theme-default/components/VPPage.d.vue.ts +15 -0
- package/dist/client/theme-default/components/VPSidebar.d.vue.ts +18 -0
- package/dist/client/theme-default/components/VPSidebar.vue +40 -53
- package/dist/client/theme-default/components/VPSidebarGroup.d.vue.ts +7 -0
- package/dist/client/theme-default/components/VPSidebarGroup.vue +24 -29
- package/dist/client/theme-default/components/VPSidebarItem.d.vue.ts +8 -0
- package/dist/client/theme-default/components/VPSidebarItem.vue +60 -93
- package/dist/client/theme-default/components/VPSkipLink.d.vue.ts +6 -0
- package/dist/client/theme-default/components/VPSkipLink.vue +23 -42
- package/dist/client/theme-default/components/VPSocialLink.d.vue.ts +11 -0
- package/dist/client/theme-default/components/VPSocialLink.vue +42 -49
- package/dist/client/theme-default/components/VPSocialLinks.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPSocialLinks.vue +26 -16
- package/dist/client/theme-default/components/VPSponsors.d.vue.ts +18 -0
- package/dist/client/theme-default/components/VPSponsors.vue +34 -33
- package/dist/client/theme-default/components/VPSponsorsGrid.d.vue.ts +15 -0
- package/dist/client/theme-default/components/VPSponsorsGrid.vue +23 -26
- package/dist/client/theme-default/components/VPSwitch.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPSwitch.vue +12 -13
- package/dist/client/theme-default/components/VPSwitchAppearance.d.vue.ts +3 -0
- package/dist/client/theme-default/components/VPSwitchAppearance.vue +16 -21
- package/dist/client/theme-default/components/VPTeamMembers.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPTeamMembers.vue +59 -32
- package/dist/client/theme-default/components/VPTeamMembersItem.d.vue.ts +10 -0
- package/dist/client/theme-default/components/VPTeamMembersItem.vue +62 -58
- package/dist/client/theme-default/components/VPTeamPage.d.vue.ts +13 -0
- package/dist/client/theme-default/components/VPTeamPage.vue +14 -14
- package/dist/client/theme-default/components/VPTeamPageSection.d.vue.ts +17 -0
- package/dist/client/theme-default/components/VPTeamPageSection.vue +20 -19
- package/dist/client/theme-default/components/VPTeamPageTitle.d.vue.ts +15 -0
- package/dist/client/theme-default/components/VPTeamPageTitle.vue +22 -22
- package/dist/client/theme-default/composables/data.d.ts +5 -0
- package/dist/client/theme-default/composables/data.js +5 -2
- package/dist/client/theme-default/composables/edit-link.d.ts +6 -0
- package/dist/client/theme-default/composables/edit-link.js +17 -15
- package/dist/client/theme-default/composables/flyout.d.ts +10 -0
- package/dist/client/theme-default/composables/flyout.js +33 -32
- package/dist/client/theme-default/composables/langs.d.ts +44 -0
- package/dist/client/theme-default/composables/langs.js +48 -24
- package/dist/client/theme-default/composables/layout.d.ts +13 -0
- package/dist/client/theme-default/composables/layout.js +68 -0
- package/dist/client/theme-default/composables/nav-overflow.d.ts +54 -0
- package/dist/client/theme-default/composables/nav-overflow.js +179 -0
- package/dist/client/theme-default/composables/nav.d.ts +25 -0
- package/dist/client/theme-default/composables/nav.js +58 -29
- package/dist/client/theme-default/composables/outline.d.ts +8 -0
- package/dist/client/theme-default/composables/outline.js +144 -166
- package/dist/client/theme-default/composables/prev-next.d.ts +16 -0
- package/dist/client/theme-default/composables/prev-next.js +34 -56
- package/dist/client/theme-default/composables/scroll-lock.d.ts +4 -0
- package/dist/client/theme-default/composables/scroll-lock.js +95 -0
- package/dist/client/theme-default/composables/sidebar.d.ts +25 -0
- package/dist/client/theme-default/composables/sidebar.js +96 -133
- package/dist/client/theme-default/composables/sponsor-grid.d.ts +10 -0
- package/dist/client/theme-default/composables/sponsor-grid.js +69 -76
- package/dist/client/theme-default/fonts/inter-italic-cyrillic-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-cyrillic.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-greek-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-greek.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-latin-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-latin.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-symbols.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-italic-vietnamese.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-cyrillic-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-cyrillic.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-greek-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-greek.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-latin-ext.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-latin.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-symbols.woff2 +0 -0
- package/dist/client/theme-default/fonts/inter-roman-vietnamese.woff2 +0 -0
- package/dist/client/theme-default/index.d.ts +3 -0
- package/dist/client/theme-default/index.js +4 -3
- package/dist/client/theme-default/styles/base.css +279 -211
- package/dist/client/theme-default/styles/components/custom-block.css +12 -7
- package/dist/client/theme-default/styles/components/vp-code-group.css +13 -16
- package/dist/client/theme-default/styles/components/vp-code.css +10 -2
- package/dist/client/theme-default/styles/components/vp-doc.css +188 -142
- package/dist/client/theme-default/styles/components/vp-sponsor.css +48 -37
- package/dist/client/theme-default/styles/docsearch.css +138 -0
- package/dist/client/theme-default/styles/fonts.css +216 -55
- package/dist/client/theme-default/styles/icons.css +42 -22
- package/dist/client/theme-default/styles/vars.css +111 -46
- package/dist/client/theme-default/support/docsearch.d.ts +57 -0
- package/dist/client/theme-default/support/docsearch.js +145 -0
- package/dist/client/theme-default/support/local-search.d.ts +9 -0
- package/dist/client/theme-default/support/local-search.js +31 -0
- package/dist/client/theme-default/support/lru.d.ts +11 -0
- package/dist/client/theme-default/support/lru.js +30 -33
- package/dist/client/theme-default/support/reactivity.d.ts +4 -0
- package/dist/client/theme-default/support/reactivity.js +10 -0
- package/dist/client/theme-default/support/sidebar.d.ts +27 -0
- package/dist/client/theme-default/support/sidebar.js +69 -80
- package/dist/client/theme-default/support/translation.d.ts +6 -0
- package/dist/client/theme-default/support/translation.js +33 -47
- package/dist/client/theme-default/support/utils.d.ts +7 -0
- package/dist/client/theme-default/support/utils.js +39 -30
- package/dist/client/theme-default/without-fonts.d.ts +25 -0
- package/dist/client/theme-default/without-fonts.js +37 -36
- package/dist/node/chunk-BjrVv9r8.js +28627 -0
- package/dist/node/cli.d.ts +1 -0
- package/dist/node/cli.js +160 -423
- package/dist/node/index.d.ts +1761 -2476
- package/dist/node/index.js +1 -121
- package/dist/web-types.json +75 -0
- package/package.json +89 -98
- package/template/.vitepress/config.js +3 -1
- package/template/.vitepress/theme/style.css +3 -11
- package/theme.d.ts +30 -23
- package/types/default-theme.d.ts +109 -113
- package/types/docsearch.d.ts +61 -142
- package/types/shared.d.ts +469 -50
- package/dist/client/theme-default/components/VPNavBarAppearance.vue +0 -32
- package/dist/client/theme-default/components/VPNavBarMenu.vue +0 -40
- package/dist/client/theme-default/components/VPNavBarMenuGroup.vue +0 -42
- package/dist/client/theme-default/components/VPNavBarMenuLink.vue +0 -53
- package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +0 -27
- package/dist/client/theme-default/components/VPNavBarTranslations.vue +0 -47
- package/dist/client/theme-default/components/VPNavScreenAppearance.vue +0 -40
- package/dist/client/theme-default/components/VPNavScreenMenu.vue +0 -26
- package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +0 -112
- package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +0 -40
- package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +0 -34
- package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +0 -43
- package/dist/client/theme-default/components/VPNavScreenSocialLinks.vue +0 -14
- package/dist/client/theme-default/components/VPNavScreenTranslations.vue +0 -73
- package/dist/client/theme-default/components/icons/VPIconAlignJustify.vue +0 -8
- package/dist/client/theme-default/components/icons/VPIconAlignLeft.vue +0 -8
- package/dist/client/theme-default/components/icons/VPIconAlignRight.vue +0 -8
- package/dist/client/theme-default/components/icons/VPIconArrowLeft.vue +0 -7
- package/dist/client/theme-default/components/icons/VPIconArrowRight.vue +0 -7
- package/dist/client/theme-default/components/icons/VPIconChevronDown.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconChevronLeft.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconChevronRight.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconChevronUp.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconEdit.vue +0 -6
- package/dist/client/theme-default/components/icons/VPIconHeart.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconLanguages.vue +0 -9
- package/dist/client/theme-default/components/icons/VPIconMinus.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +0 -6
- package/dist/client/theme-default/components/icons/VPIconMoon.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconMoreHorizontal.vue +0 -7
- package/dist/client/theme-default/components/icons/VPIconPlus.vue +0 -5
- package/dist/client/theme-default/components/icons/VPIconPlusSquare.vue +0 -6
- package/dist/client/theme-default/components/icons/VPIconSun.vue +0 -13
- package/dist/client/theme-default/composables/aside.js +0 -17
- package/dist/client/theme-default/composables/local-nav.js +0 -18
- package/dist/node/chunk-C-d2RJOW.js +0 -470
- package/dist/node/chunk-CxQfvv8o.js +0 -49065
- package/dist/node/worker_shikiResolveLang.js +0 -13
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { inject } from "vue";
|
|
3
|
+
import { navInjectionKey, useNavItemLink } from "../composables/nav";
|
|
4
|
+
import VPLink from "./VPLink.vue";
|
|
5
|
+
const props = defineProps({
|
|
6
|
+
item: {
|
|
7
|
+
type: Object,
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
screen: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
required: false
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
const { href, isActiveLink, isCurrentLink } = useNavItemLink(() => props.item);
|
|
16
|
+
const nav = inject(navInjectionKey, null);
|
|
17
|
+
function onClick() {
|
|
18
|
+
if (props.screen) nav?.closeScreen();
|
|
19
|
+
}
|
|
20
|
+
</script>
|
|
21
|
+
|
|
22
|
+
<template>
|
|
23
|
+
<VPLink
|
|
24
|
+
class="VPNavMenuLink"
|
|
25
|
+
:class="{
|
|
26
|
+
VPNavBarMenuLink: !screen,
|
|
27
|
+
VPNavScreenMenuLink: screen,
|
|
28
|
+
active: isActiveLink
|
|
29
|
+
}"
|
|
30
|
+
:aria-current="isCurrentLink ? 'page' : undefined"
|
|
31
|
+
:href
|
|
32
|
+
:target="item.target"
|
|
33
|
+
:rel="item.rel"
|
|
34
|
+
:no-icon="item.noIcon"
|
|
35
|
+
@click="onClick"
|
|
36
|
+
>
|
|
37
|
+
<span dir="auto" v-html="item.text"></span>
|
|
38
|
+
</VPLink>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<style scoped>
|
|
42
|
+
.VPNavMenuLink {
|
|
43
|
+
color: var(--vp-c-text-1);
|
|
44
|
+
font-size: 0.875rem;
|
|
45
|
+
font-weight: 500;
|
|
46
|
+
transition: color 0.25s;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
.VPNavMenuLink:hover,
|
|
50
|
+
.VPNavMenuLink.active {
|
|
51
|
+
color: var(--vp-c-brand-1);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.VPNavBarMenuLink {
|
|
55
|
+
display: flex;
|
|
56
|
+
align-items: center;
|
|
57
|
+
min-height: var(--vp-nav-height);
|
|
58
|
+
padding: 0 0.75rem;
|
|
59
|
+
line-height: 1.5;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
.VPNavScreenMenuLink {
|
|
63
|
+
display: block;
|
|
64
|
+
border-bottom: 1px solid var(--vp-c-divider);
|
|
65
|
+
padding: 0.75rem 0 0.6875rem;
|
|
66
|
+
line-height: 1.7142857;
|
|
67
|
+
transition: border-color 0.25s, color 0.25s;
|
|
68
|
+
}
|
|
69
|
+
</style>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_10: {}, __VLS_32: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
'nav-screen-content-before'?: (props: typeof __VLS_10) => any;
|
|
7
|
+
} & {
|
|
8
|
+
'nav-screen-content-after'?: (props: typeof __VLS_32) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -1,18 +1,24 @@
|
|
|
1
|
-
<script setup
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
|
|
10
|
-
defineProps
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
const
|
|
15
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { onKeyStroke } from "@vueuse/core";
|
|
3
|
+
import { provide } from "vue";
|
|
4
|
+
import { navScreenInjectionKey, useNav } from "../composables/nav";
|
|
5
|
+
import { useBodyScrollLock } from "../composables/scroll-lock";
|
|
6
|
+
import VPNavAppearance from "./VPNavAppearance.vue";
|
|
7
|
+
import VPNavMenu from "./VPNavMenu.vue";
|
|
8
|
+
import VPNavSocialLinks from "./VPNavSocialLinks.vue";
|
|
9
|
+
import VPNavTranslations from "./VPNavTranslations.vue";
|
|
10
|
+
const props = defineProps({ open: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
required: true
|
|
13
|
+
} });
|
|
14
|
+
const isLocked = useBodyScrollLock();
|
|
15
|
+
provide(navScreenInjectionKey, true);
|
|
16
|
+
const { closeScreen, screenTriggerEl } = useNav();
|
|
17
|
+
onKeyStroke("Escape", () => {
|
|
18
|
+
if (!props.open) return;
|
|
19
|
+
closeScreen();
|
|
20
|
+
screenTriggerEl.value?.focus();
|
|
21
|
+
});
|
|
16
22
|
</script>
|
|
17
23
|
|
|
18
24
|
<template>
|
|
@@ -21,13 +27,13 @@ const isLocked = useScrollLock(inBrowser ? document.body : null)
|
|
|
21
27
|
@enter="isLocked = true"
|
|
22
28
|
@after-leave="isLocked = false"
|
|
23
29
|
>
|
|
24
|
-
<div v-if="open" class="VPNavScreen"
|
|
30
|
+
<div v-if="open" class="VPNavScreen" id="VPNavScreen">
|
|
25
31
|
<div class="container">
|
|
26
32
|
<slot name="nav-screen-content-before" />
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
<
|
|
33
|
+
<VPNavMenu screen class="menu" />
|
|
34
|
+
<VPNavTranslations screen class="translations" />
|
|
35
|
+
<VPNavAppearance row screen class="appearance" />
|
|
36
|
+
<VPNavSocialLinks screen class="social-links" />
|
|
31
37
|
<slot name="nav-screen-content-after" />
|
|
32
38
|
</div>
|
|
33
39
|
</div>
|
|
@@ -37,16 +43,12 @@ const isLocked = useScrollLock(inBrowser ? document.body : null)
|
|
|
37
43
|
<style scoped>
|
|
38
44
|
.VPNavScreen {
|
|
39
45
|
position: fixed;
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
right: 0;
|
|
43
|
-
bottom: 0;
|
|
44
|
-
/*rtl:ignore*/
|
|
45
|
-
left: 0;
|
|
46
|
-
padding: 0 32px;
|
|
46
|
+
inset: 0;
|
|
47
|
+
padding: calc(var(--vp-nav-height) + var(--vp-layout-top-height, 0px) + 1px) 2rem 0;
|
|
47
48
|
width: 100%;
|
|
48
49
|
background-color: var(--vp-nav-screen-bg-color);
|
|
49
50
|
overflow-y: auto;
|
|
51
|
+
overscroll-behavior: contain;
|
|
50
52
|
transition: background-color 0.25s;
|
|
51
53
|
pointer-events: auto;
|
|
52
54
|
}
|
|
@@ -68,10 +70,10 @@ const isLocked = useScrollLock(inBrowser ? document.body : null)
|
|
|
68
70
|
|
|
69
71
|
.VPNavScreen.fade-enter-from .container,
|
|
70
72
|
.VPNavScreen.fade-leave-to .container {
|
|
71
|
-
transform: translateY(-
|
|
73
|
+
transform: translateY(-0.5rem);
|
|
72
74
|
}
|
|
73
75
|
|
|
74
|
-
@media (min-width:
|
|
76
|
+
@media (min-width: 48rem) {
|
|
75
77
|
.VPNavScreen {
|
|
76
78
|
display: none;
|
|
77
79
|
}
|
|
@@ -79,21 +81,21 @@ const isLocked = useScrollLock(inBrowser ? document.body : null)
|
|
|
79
81
|
|
|
80
82
|
.container {
|
|
81
83
|
margin: 0 auto;
|
|
82
|
-
padding:
|
|
83
|
-
max-width:
|
|
84
|
+
padding: 1.5rem 0 6rem;
|
|
85
|
+
max-width: 18rem;
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
.menu + .translations,
|
|
87
89
|
.menu + .appearance,
|
|
88
90
|
.translations + .appearance {
|
|
89
|
-
margin-top:
|
|
91
|
+
margin-top: 1.5rem;
|
|
90
92
|
}
|
|
91
93
|
|
|
92
94
|
.menu + .social-links {
|
|
93
|
-
margin-top:
|
|
95
|
+
margin-top: 1rem;
|
|
94
96
|
}
|
|
95
97
|
|
|
96
98
|
.appearance + .social-links {
|
|
97
|
-
margin-top:
|
|
99
|
+
margin-top: 1rem;
|
|
98
100
|
}
|
|
99
101
|
</style>
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
screen?: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
5
|
+
declare const _default: typeof __VLS_export;
|
|
6
|
+
export default _default;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed } from "vue";
|
|
3
|
+
import { useData } from "../composables/data";
|
|
4
|
+
import { useNavOverflow } from "../composables/nav-overflow";
|
|
5
|
+
import VPSocialLinks from "./VPSocialLinks.vue";
|
|
6
|
+
const props = defineProps({ screen: {
|
|
7
|
+
type: Boolean,
|
|
8
|
+
required: false
|
|
9
|
+
} });
|
|
10
|
+
const { theme } = useData();
|
|
11
|
+
const overflow = props.screen ? null : useNavOverflow();
|
|
12
|
+
const isCollapsed = computed(() => !!overflow && !overflow.state.socialLinks);
|
|
13
|
+
</script>
|
|
14
|
+
|
|
15
|
+
<template>
|
|
16
|
+
<VPSocialLinks
|
|
17
|
+
v-if="theme.socialLinks"
|
|
18
|
+
class="VPNavSocialLinks"
|
|
19
|
+
:class="[screen ? 'VPNavScreenSocialLinks' : 'VPNavBarSocialLinks', { collapsed: isCollapsed }]"
|
|
20
|
+
:links="theme.socialLinks"
|
|
21
|
+
:ref="(inst) => overflow?.setClusterEl('socialLinks', inst?.$el ?? null)"
|
|
22
|
+
/>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<style scoped>
|
|
26
|
+
.VPNavBarSocialLinks {
|
|
27
|
+
display: none;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
@media (min-width: 48rem) {
|
|
31
|
+
.VPNavBarSocialLinks {
|
|
32
|
+
display: flex;
|
|
33
|
+
align-items: center;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
</style>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
/** accordion inside the nav screen */
|
|
3
|
+
screen?: boolean;
|
|
4
|
+
/** titled group inside the `⋯` menu */
|
|
5
|
+
menu?: boolean;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
declare const _default: typeof __VLS_export;
|
|
9
|
+
export default _default;
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
<script setup>
|
|
2
|
+
import { computed, ref, useId } from "vue";
|
|
3
|
+
import { useData } from "../composables/data";
|
|
4
|
+
import { useLangs } from "../composables/langs";
|
|
5
|
+
import { useNavOverflow } from "../composables/nav-overflow";
|
|
6
|
+
import VPFlyout from "./VPFlyout.vue";
|
|
7
|
+
import VPLink from "./VPLink.vue";
|
|
8
|
+
import VPMenuLink from "./VPMenuLink.vue";
|
|
9
|
+
const props = defineProps({
|
|
10
|
+
screen: {
|
|
11
|
+
type: Boolean,
|
|
12
|
+
required: false
|
|
13
|
+
},
|
|
14
|
+
menu: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
required: false
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
const { theme } = useData();
|
|
20
|
+
const { localeLinks, currentLang } = useLangs({ linkToCorrespondingPage: true });
|
|
21
|
+
const show = computed(() => !!(localeLinks.value.length && currentLang.value.label));
|
|
22
|
+
// only the inline bar flyout participates in the overflow engine
|
|
23
|
+
const overflow = props.screen || props.menu ? null : useNavOverflow();
|
|
24
|
+
const isCollapsed = computed(() => !!overflow && !overflow.state.translations);
|
|
25
|
+
const isOpen = ref(false);
|
|
26
|
+
const listId = useId();
|
|
27
|
+
function toggle() {
|
|
28
|
+
isOpen.value = !isOpen.value;
|
|
29
|
+
}
|
|
30
|
+
const localeProps = (locale) => ({
|
|
31
|
+
lang: locale.lang,
|
|
32
|
+
hreflang: locale.lang,
|
|
33
|
+
rel: "alternate",
|
|
34
|
+
dir: locale.dir,
|
|
35
|
+
"data-allow-mismatch": "attribute"
|
|
36
|
+
});
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<!-- accordion inside the nav screen -->
|
|
41
|
+
<div
|
|
42
|
+
v-if="screen && show"
|
|
43
|
+
class="VPNavTranslations VPNavScreenTranslations"
|
|
44
|
+
:class="{ open: isOpen }"
|
|
45
|
+
>
|
|
46
|
+
<button
|
|
47
|
+
type="button"
|
|
48
|
+
class="title"
|
|
49
|
+
:aria-expanded="isOpen"
|
|
50
|
+
:aria-controls="listId"
|
|
51
|
+
@click="toggle"
|
|
52
|
+
>
|
|
53
|
+
<span class="vpi-languages icon lang" aria-hidden="true" />
|
|
54
|
+
{{ currentLang.label }}
|
|
55
|
+
<span class="vpi-chevron-down icon chevron" aria-hidden="true" />
|
|
56
|
+
</button>
|
|
57
|
+
|
|
58
|
+
<ul v-show="isOpen" :id="listId" class="list">
|
|
59
|
+
<li v-for="locale in localeLinks" :key="locale.link" class="item">
|
|
60
|
+
<VPLink
|
|
61
|
+
class="link"
|
|
62
|
+
:href="locale.link"
|
|
63
|
+
:external="false"
|
|
64
|
+
v-bind="localeProps(locale)"
|
|
65
|
+
>
|
|
66
|
+
{{ locale.text }}
|
|
67
|
+
</VPLink>
|
|
68
|
+
</li>
|
|
69
|
+
</ul>
|
|
70
|
+
</div>
|
|
71
|
+
|
|
72
|
+
<!-- titled group inside the `⋯` menu -->
|
|
73
|
+
<div v-else-if="menu && show" class="VPNavTranslations group translations">
|
|
74
|
+
<p class="title">{{ currentLang.label }}</p>
|
|
75
|
+
|
|
76
|
+
<ul>
|
|
77
|
+
<template v-for="locale in localeLinks" :key="locale.link">
|
|
78
|
+
<VPMenuLink :item="locale" :external="false" v-bind="localeProps(locale)" />
|
|
79
|
+
</template>
|
|
80
|
+
</ul>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
|
+
<!-- inline flyout in the navbar -->
|
|
84
|
+
<VPFlyout
|
|
85
|
+
v-else-if="!menu && show"
|
|
86
|
+
class="VPNavTranslations VPNavBarTranslations"
|
|
87
|
+
:class="{ collapsed: isCollapsed }"
|
|
88
|
+
icon="vpi-languages"
|
|
89
|
+
:label="theme.langMenuLabel || 'Change language'"
|
|
90
|
+
:ref="(inst) => overflow?.setClusterEl('translations', inst?.$el ?? null)"
|
|
91
|
+
>
|
|
92
|
+
<p class="title">{{ currentLang.label }}</p>
|
|
93
|
+
|
|
94
|
+
<ul class="items">
|
|
95
|
+
<template v-for="locale in localeLinks" :key="locale.link">
|
|
96
|
+
<VPMenuLink :item="locale" :external="false" v-bind="localeProps(locale)" />
|
|
97
|
+
</template>
|
|
98
|
+
</ul>
|
|
99
|
+
</VPFlyout>
|
|
100
|
+
</template>
|
|
101
|
+
|
|
102
|
+
<style scoped>
|
|
103
|
+
/* flyout variant */
|
|
104
|
+
.VPNavBarTranslations {
|
|
105
|
+
display: none;
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
@media (min-width: 48rem) {
|
|
109
|
+
.VPNavBarTranslations {
|
|
110
|
+
display: flex;
|
|
111
|
+
align-items: center;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
.VPNavBarTranslations .title {
|
|
116
|
+
padding-block: 0;
|
|
117
|
+
padding-inline: 0.75rem 1.5rem;
|
|
118
|
+
line-height: 2.2857143;
|
|
119
|
+
font-size: 0.875rem;
|
|
120
|
+
font-weight: 700;
|
|
121
|
+
color: var(--vp-c-text-1);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
/* menu-group variant (inside the `⋯` menu) — matches the menu group
|
|
125
|
+
titles */
|
|
126
|
+
.group > .title {
|
|
127
|
+
padding: 0 0.75rem;
|
|
128
|
+
line-height: 2.2857143;
|
|
129
|
+
font-size: 0.875rem;
|
|
130
|
+
font-weight: 600;
|
|
131
|
+
color: var(--vp-c-text-2);
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
/* accordion variant (inside the nav screen) */
|
|
135
|
+
.VPNavScreenTranslations .title {
|
|
136
|
+
display: flex;
|
|
137
|
+
align-items: center;
|
|
138
|
+
font-size: 0.875rem;
|
|
139
|
+
font-weight: 500;
|
|
140
|
+
color: var(--vp-c-text-1);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.VPNavScreenTranslations .icon {
|
|
144
|
+
font-size: 1rem;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
.VPNavScreenTranslations .icon.lang {
|
|
148
|
+
margin-inline-end: 0.5rem;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.VPNavScreenTranslations .icon.chevron {
|
|
152
|
+
margin-inline-start: 0.25rem;
|
|
153
|
+
transition: transform 0.25s;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
.VPNavScreenTranslations.open .icon.chevron {
|
|
157
|
+
transform: rotate(-90deg);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
.VPNavScreenTranslations .list {
|
|
161
|
+
padding-block: 0.25rem 0;
|
|
162
|
+
padding-inline: 1.5rem 0;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
.VPNavScreenTranslations .link {
|
|
166
|
+
line-height: 2.4615385;
|
|
167
|
+
font-size: 0.8125rem;
|
|
168
|
+
color: var(--vp-c-text-1);
|
|
169
|
+
}
|
|
170
|
+
</style>
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
declare var __VLS_1: {}, __VLS_8: {};
|
|
2
|
+
type __VLS_Slots = {} & {
|
|
3
|
+
'page-top'?: (props: typeof __VLS_1) => any;
|
|
4
|
+
} & {
|
|
5
|
+
'page-bottom'?: (props: typeof __VLS_8) => any;
|
|
6
|
+
};
|
|
7
|
+
declare const __VLS_base: import("vue").DefineComponent<{}, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, true, {}, any>;
|
|
8
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
9
|
+
declare const _default: typeof __VLS_export;
|
|
10
|
+
export default _default;
|
|
11
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
12
|
+
new (): {
|
|
13
|
+
$slots: S;
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
type __VLS_Props = {
|
|
2
|
+
open: boolean;
|
|
3
|
+
};
|
|
4
|
+
declare var __VLS_1: {}, __VLS_8: {};
|
|
5
|
+
type __VLS_Slots = {} & {
|
|
6
|
+
'sidebar-nav-before'?: (props: typeof __VLS_1) => any;
|
|
7
|
+
} & {
|
|
8
|
+
'sidebar-nav-after'?: (props: typeof __VLS_8) => any;
|
|
9
|
+
};
|
|
10
|
+
declare const __VLS_base: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
11
|
+
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
12
|
+
declare const _default: typeof __VLS_export;
|
|
13
|
+
export default _default;
|
|
14
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
15
|
+
new (): {
|
|
16
|
+
$slots: S;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
@@ -1,40 +1,29 @@
|
|
|
1
|
-
<script
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
open: boolean
|
|
12
|
-
}>()
|
|
13
|
-
|
|
1
|
+
<script setup>
|
|
2
|
+
import { ref, useTemplateRef, watch } from "vue";
|
|
3
|
+
import { useLayout } from "../composables/layout";
|
|
4
|
+
import { useBodyScrollLock } from "../composables/scroll-lock";
|
|
5
|
+
import VPSidebarGroup from "./VPSidebarGroup.vue";
|
|
6
|
+
const { sidebarGroups, hasSidebar } = useLayout();
|
|
7
|
+
const props = defineProps({ open: {
|
|
8
|
+
type: Boolean,
|
|
9
|
+
required: true
|
|
10
|
+
} });
|
|
14
11
|
// a11y: focus Nav element when menu has opened
|
|
15
|
-
const navEl =
|
|
16
|
-
const isLocked =
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
)
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
watch(
|
|
32
|
-
sidebarGroups,
|
|
33
|
-
() => {
|
|
34
|
-
key.value += 1
|
|
35
|
-
},
|
|
36
|
-
{ deep: true }
|
|
37
|
-
)
|
|
12
|
+
const navEl = useTemplateRef("navEl");
|
|
13
|
+
const isLocked = useBodyScrollLock();
|
|
14
|
+
watch([() => props.open, navEl], () => {
|
|
15
|
+
if (props.open) {
|
|
16
|
+
isLocked.value = true;
|
|
17
|
+
navEl.value?.focus();
|
|
18
|
+
} else isLocked.value = false;
|
|
19
|
+
}, {
|
|
20
|
+
immediate: true,
|
|
21
|
+
flush: "post"
|
|
22
|
+
});
|
|
23
|
+
const key = ref(0);
|
|
24
|
+
watch(sidebarGroups, () => {
|
|
25
|
+
key.value += 1;
|
|
26
|
+
}, { deep: true });
|
|
38
27
|
</script>
|
|
39
28
|
|
|
40
29
|
<template>
|
|
@@ -58,7 +47,7 @@ watch(
|
|
|
58
47
|
</span>
|
|
59
48
|
|
|
60
49
|
<slot name="sidebar-nav-before" />
|
|
61
|
-
<VPSidebarGroup :items="sidebarGroups" :key
|
|
50
|
+
<VPSidebarGroup :items="sidebarGroups" :key />
|
|
62
51
|
<slot name="sidebar-nav-after" />
|
|
63
52
|
</nav>
|
|
64
53
|
</aside>
|
|
@@ -69,17 +58,17 @@ watch(
|
|
|
69
58
|
position: fixed;
|
|
70
59
|
top: var(--vp-layout-top-height, 0px);
|
|
71
60
|
bottom: 0;
|
|
72
|
-
|
|
61
|
+
inset-inline-start: 0;
|
|
73
62
|
z-index: var(--vp-z-index-sidebar);
|
|
74
|
-
padding:
|
|
75
|
-
width: calc(100vw -
|
|
76
|
-
max-width:
|
|
63
|
+
padding: 2rem 2rem 6rem;
|
|
64
|
+
width: calc(100vw - 4rem);
|
|
65
|
+
max-width: 20rem;
|
|
77
66
|
background-color: var(--vp-sidebar-bg-color);
|
|
78
67
|
opacity: 0;
|
|
79
68
|
box-shadow: var(--vp-c-shadow-3);
|
|
80
69
|
overflow-x: hidden;
|
|
81
70
|
overflow-y: auto;
|
|
82
|
-
transform: translateX(-100%);
|
|
71
|
+
transform: translateX(calc(-100% * var(--vp-direction-multiplier)));
|
|
83
72
|
transition: opacity 0.5s, transform 0.25s ease;
|
|
84
73
|
overscroll-behavior: contain;
|
|
85
74
|
}
|
|
@@ -88,15 +77,14 @@ watch(
|
|
|
88
77
|
opacity: 1;
|
|
89
78
|
visibility: visible;
|
|
90
79
|
transform: translateX(0);
|
|
91
|
-
transition: opacity 0.25s,
|
|
92
|
-
transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
|
80
|
+
transition: opacity 0.25s, transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
|
|
93
81
|
}
|
|
94
82
|
|
|
95
83
|
.dark .VPSidebar {
|
|
96
84
|
box-shadow: var(--vp-shadow-1);
|
|
97
85
|
}
|
|
98
86
|
|
|
99
|
-
@media (min-width:
|
|
87
|
+
@media (min-width: 60rem) {
|
|
100
88
|
.VPSidebar {
|
|
101
89
|
padding-top: var(--vp-nav-height);
|
|
102
90
|
width: var(--vp-sidebar-width);
|
|
@@ -109,22 +97,21 @@ watch(
|
|
|
109
97
|
}
|
|
110
98
|
}
|
|
111
99
|
|
|
112
|
-
@media (min-width:
|
|
100
|
+
@media (min-width: 90rem) {
|
|
113
101
|
.VPSidebar {
|
|
114
|
-
padding-
|
|
115
|
-
width: calc((100% - (var(--vp-layout-max-width) -
|
|
102
|
+
padding-inline-start: max(2rem, calc((100% - (var(--vp-layout-max-width) - 4rem)) / 2));
|
|
103
|
+
width: calc((100% - (var(--vp-layout-max-width) - 4rem)) / 2 + var(--vp-sidebar-width) - 2rem);
|
|
116
104
|
}
|
|
117
105
|
}
|
|
118
106
|
|
|
119
|
-
@media (min-width:
|
|
107
|
+
@media (min-width: 60rem) {
|
|
120
108
|
.curtain {
|
|
121
109
|
position: sticky;
|
|
122
|
-
top: -
|
|
123
|
-
|
|
110
|
+
top: calc(var(--vp-nav-height) * -1);
|
|
111
|
+
inset-inline-start: 0;
|
|
124
112
|
z-index: 1;
|
|
125
113
|
margin-top: calc(var(--vp-nav-height) * -1);
|
|
126
|
-
margin-
|
|
127
|
-
margin-left: -32px;
|
|
114
|
+
margin-inline: -2rem;
|
|
128
115
|
height: var(--vp-nav-height);
|
|
129
116
|
background-color: var(--vp-sidebar-bg-color);
|
|
130
117
|
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { DefaultTheme } from 'vitepress/theme';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
items: DefaultTheme.SidebarItem[];
|
|
4
|
+
};
|
|
5
|
+
declare const __VLS_export: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
6
|
+
declare const _default: typeof __VLS_export;
|
|
7
|
+
export default _default;
|