themekit-js 1.1.0
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/LICENSE +21 -0
- package/README.md +27 -0
- package/bin/themekit.js +2 -0
- package/client.d.ts +5 -0
- package/dist/client/app/components/ClientOnly.js +10 -0
- package/dist/client/app/components/Content.js +23 -0
- package/dist/client/app/composables/codeGroups.js +40 -0
- package/dist/client/app/composables/copyCode.js +73 -0
- package/dist/client/app/composables/head.js +81 -0
- package/dist/client/app/composables/preFetch.js +99 -0
- package/dist/client/app/data.js +59 -0
- package/dist/client/app/devtools.js +29 -0
- package/dist/client/app/index.js +140 -0
- package/dist/client/app/router.js +233 -0
- package/dist/client/app/ssr.js +10 -0
- package/dist/client/app/theme.js +1 -0
- package/dist/client/app/utils.js +119 -0
- package/dist/client/index.d.ts +1446 -0
- package/dist/client/index.js +9 -0
- package/dist/client/shared.js +139 -0
- package/dist/client/theme-default/Layout.vue +94 -0
- package/dist/client/theme-default/NotFound.vue +109 -0
- package/dist/client/theme-default/components/VPAlgoliaSearchBox.vue +99 -0
- package/dist/client/theme-default/components/VPBackdrop.vue +41 -0
- package/dist/client/theme-default/components/VPBadge.vue +86 -0
- package/dist/client/theme-default/components/VPButton.vue +123 -0
- package/dist/client/theme-default/components/VPCarbonAds.vue +109 -0
- package/dist/client/theme-default/components/VPContent.vue +98 -0
- package/dist/client/theme-default/components/VPDoc.vue +193 -0
- package/dist/client/theme-default/components/VPDocAside.vue +46 -0
- package/dist/client/theme-default/components/VPDocAsideCarbonAds.vue +18 -0
- package/dist/client/theme-default/components/VPDocAsideOutline.vue +87 -0
- package/dist/client/theme-default/components/VPDocAsideSponsors.vue +17 -0
- package/dist/client/theme-default/components/VPDocFooter.vue +145 -0
- package/dist/client/theme-default/components/VPDocFooterLastUpdated.vue +50 -0
- package/dist/client/theme-default/components/VPDocOutlineItem.vue +59 -0
- package/dist/client/theme-default/components/VPFeature.vue +123 -0
- package/dist/client/theme-default/components/VPFeatures.vue +121 -0
- package/dist/client/theme-default/components/VPFlyout.vue +136 -0
- package/dist/client/theme-default/components/VPFooter.vue +60 -0
- package/dist/client/theme-default/components/VPHero.vue +336 -0
- package/dist/client/theme-default/components/VPHome.vue +43 -0
- package/dist/client/theme-default/components/VPHomeContent.vue +52 -0
- package/dist/client/theme-default/components/VPHomeFeatures.vue +14 -0
- package/dist/client/theme-default/components/VPHomeHero.vue +24 -0
- package/dist/client/theme-default/components/VPHomeSponsors.vue +116 -0
- package/dist/client/theme-default/components/VPImage.vue +46 -0
- package/dist/client/theme-default/components/VPLink.vue +33 -0
- package/dist/client/theme-default/components/VPLocalNav.vue +171 -0
- package/dist/client/theme-default/components/VPLocalNavOutlineDropdown.vue +190 -0
- package/dist/client/theme-default/components/VPLocalSearchBox.vue +856 -0
- package/dist/client/theme-default/components/VPMenu.vue +72 -0
- package/dist/client/theme-default/components/VPMenuGroup.vue +47 -0
- package/dist/client/theme-default/components/VPMenuLink.vue +54 -0
- package/dist/client/theme-default/components/VPNav.vue +57 -0
- package/dist/client/theme-default/components/VPNavBar.vue +267 -0
- package/dist/client/theme-default/components/VPNavBarAppearance.vue +25 -0
- package/dist/client/theme-default/components/VPNavBarExtra.vue +94 -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 +42 -0
- package/dist/client/theme-default/components/VPNavBarMenuLink.vue +53 -0
- package/dist/client/theme-default/components/VPNavBarSearch.vue +194 -0
- package/dist/client/theme-default/components/VPNavBarSearchButton.vue +208 -0
- package/dist/client/theme-default/components/VPNavBarSocialLinks.vue +27 -0
- package/dist/client/theme-default/components/VPNavBarTitle.vue +76 -0
- package/dist/client/theme-default/components/VPNavBarTranslations.vue +47 -0
- package/dist/client/theme-default/components/VPNavScreen.vue +99 -0
- package/dist/client/theme-default/components/VPNavScreenAppearance.vue +33 -0
- package/dist/client/theme-default/components/VPNavScreenMenu.vue +23 -0
- package/dist/client/theme-default/components/VPNavScreenMenuGroup.vue +111 -0
- package/dist/client/theme-default/components/VPNavScreenMenuGroupLink.vue +39 -0
- package/dist/client/theme-default/components/VPNavScreenMenuGroupSection.vue +34 -0
- package/dist/client/theme-default/components/VPNavScreenMenuLink.vue +39 -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 +7 -0
- package/dist/client/theme-default/components/VPSidebar.vue +137 -0
- package/dist/client/theme-default/components/VPSidebarItem.vue +250 -0
- package/dist/client/theme-default/components/VPSkipLink.vue +68 -0
- package/dist/client/theme-default/components/VPSocialLink.vue +50 -0
- package/dist/client/theme-default/components/VPSocialLinks.vue +27 -0
- package/dist/client/theme-default/components/VPSponsors.vue +48 -0
- package/dist/client/theme-default/components/VPSponsorsGrid.vue +48 -0
- package/dist/client/theme-default/components/VPSwitch.vue +63 -0
- package/dist/client/theme-default/components/VPSwitchAppearance.vue +52 -0
- package/dist/client/theme-default/components/VPTeamMembers.vue +66 -0
- package/dist/client/theme-default/components/VPTeamMembersItem.vue +225 -0
- package/dist/client/theme-default/components/VPTeamPage.vue +58 -0
- package/dist/client/theme-default/components/VPTeamPageSection.vue +77 -0
- package/dist/client/theme-default/components/VPTeamPageTitle.vue +63 -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/VPIconArrowLeft.vue +7 -0
- package/dist/client/theme-default/components/icons/VPIconArrowRight.vue +7 -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/VPIconEdit.vue +6 -0
- package/dist/client/theme-default/components/icons/VPIconHeart.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconLanguages.vue +9 -0
- package/dist/client/theme-default/components/icons/VPIconMinus.vue +5 -0
- package/dist/client/theme-default/components/icons/VPIconMinusSquare.vue +6 -0
- package/dist/client/theme-default/components/icons/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/VPIconPlusSquare.vue +6 -0
- package/dist/client/theme-default/components/icons/VPIconSun.vue +13 -0
- package/dist/client/theme-default/composables/aside.js +17 -0
- package/dist/client/theme-default/composables/data.js +2 -0
- package/dist/client/theme-default/composables/edit-link.js +16 -0
- package/dist/client/theme-default/composables/flyout.js +41 -0
- package/dist/client/theme-default/composables/langs.js +26 -0
- package/dist/client/theme-default/composables/local-nav.js +18 -0
- package/dist/client/theme-default/composables/nav.js +30 -0
- package/dist/client/theme-default/composables/outline.js +178 -0
- package/dist/client/theme-default/composables/prev-next.js +57 -0
- package/dist/client/theme-default/composables/sidebar.js +136 -0
- package/dist/client/theme-default/composables/sponsor-grid.js +94 -0
- 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-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-vietnamese.woff2 +0 -0
- package/dist/client/theme-default/index.js +3 -0
- package/dist/client/theme-default/styles/base.css +252 -0
- package/dist/client/theme-default/styles/components/custom-block.css +208 -0
- package/dist/client/theme-default/styles/components/vp-code-group.css +85 -0
- package/dist/client/theme-default/styles/components/vp-code.css +7 -0
- package/dist/client/theme-default/styles/components/vp-doc.css +570 -0
- package/dist/client/theme-default/styles/components/vp-sponsor.css +155 -0
- package/dist/client/theme-default/styles/fonts.css +157 -0
- package/dist/client/theme-default/styles/icons.css +123 -0
- package/dist/client/theme-default/styles/utils.css +9 -0
- package/dist/client/theme-default/styles/vars.css +563 -0
- package/dist/client/theme-default/support/lru.js +33 -0
- package/dist/client/theme-default/support/sidebar.js +89 -0
- package/dist/client/theme-default/support/translation.js +49 -0
- package/dist/client/theme-default/support/utils.js +33 -0
- package/dist/client/theme-default/without-fonts.js +32 -0
- package/dist/node/cli.js +444 -0
- package/dist/node/index.d.ts +4588 -0
- package/dist/node/index.js +198 -0
- package/dist/node/serve-BjvG349_.js +50301 -0
- package/lib/vue-demi.mjs +34 -0
- package/package.json +223 -0
- package/template/.vitepress/config.js +28 -0
- package/template/.vitepress/theme/Layout.vue +21 -0
- package/template/.vitepress/theme/index.js +29 -0
- package/template/.vitepress/theme/style.css +143 -0
- package/template/api-examples.md +49 -0
- package/template/index.md +28 -0
- package/template/markdown-examples.md +85 -0
- package/theme-without-fonts.d.ts +2 -0
- package/theme.d.ts +30 -0
- package/types/default-theme.d.ts +533 -0
- package/types/docsearch.d.ts +144 -0
- package/types/index.d.ts +3 -0
- package/types/local-search.d.ts +33 -0
- package/types/shared.d.ts +199 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { computed } from 'vue'
|
|
3
|
+
import { useData } from '../composables/data'
|
|
4
|
+
import { useEditLink } from '../composables/edit-link'
|
|
5
|
+
import { usePrevNext } from '../composables/prev-next'
|
|
6
|
+
import VPLink from './VPLink.vue'
|
|
7
|
+
import VPDocFooterLastUpdated from './VPDocFooterLastUpdated.vue'
|
|
8
|
+
|
|
9
|
+
const { theme, page, frontmatter } = useData()
|
|
10
|
+
|
|
11
|
+
const editLink = useEditLink()
|
|
12
|
+
const control = usePrevNext()
|
|
13
|
+
|
|
14
|
+
const hasEditLink = computed(() => {
|
|
15
|
+
return theme.value.editLink && frontmatter.value.editLink !== false
|
|
16
|
+
})
|
|
17
|
+
const hasLastUpdated = computed(() => {
|
|
18
|
+
return page.value.lastUpdated && frontmatter.value.lastUpdated !== false
|
|
19
|
+
})
|
|
20
|
+
const showFooter = computed(() => {
|
|
21
|
+
return hasEditLink.value || hasLastUpdated.value || control.value.prev || control.value.next
|
|
22
|
+
})
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template>
|
|
26
|
+
<footer v-if="showFooter" class="VPDocFooter">
|
|
27
|
+
<slot name="doc-footer-before" />
|
|
28
|
+
|
|
29
|
+
<div v-if="hasEditLink || hasLastUpdated" class="edit-info">
|
|
30
|
+
<div v-if="hasEditLink" class="edit-link">
|
|
31
|
+
<VPLink class="edit-link-button" :href="editLink.url" :no-icon="true">
|
|
32
|
+
<span class="vpi-square-pen edit-link-icon" />
|
|
33
|
+
{{ editLink.text }}
|
|
34
|
+
</VPLink>
|
|
35
|
+
</div>
|
|
36
|
+
|
|
37
|
+
<div v-if="hasLastUpdated" class="last-updated">
|
|
38
|
+
<VPDocFooterLastUpdated />
|
|
39
|
+
</div>
|
|
40
|
+
</div>
|
|
41
|
+
|
|
42
|
+
<nav v-if="control.prev?.link || control.next?.link" class="prev-next">
|
|
43
|
+
<div class="pager">
|
|
44
|
+
<VPLink v-if="control.prev?.link" class="pager-link prev" :href="control.prev.link">
|
|
45
|
+
<span class="desc" v-html="theme.docFooter?.prev || 'Previous page'"></span>
|
|
46
|
+
<span class="title" v-html="control.prev.text"></span>
|
|
47
|
+
</VPLink>
|
|
48
|
+
</div>
|
|
49
|
+
<div class="pager">
|
|
50
|
+
<VPLink v-if="control.next?.link" class="pager-link next" :href="control.next.link">
|
|
51
|
+
<span class="desc" v-html="theme.docFooter?.next || 'Next page'"></span>
|
|
52
|
+
<span class="title" v-html="control.next.text"></span>
|
|
53
|
+
</VPLink>
|
|
54
|
+
</div>
|
|
55
|
+
</nav>
|
|
56
|
+
</footer>
|
|
57
|
+
</template>
|
|
58
|
+
|
|
59
|
+
<style scoped>
|
|
60
|
+
.VPDocFooter {
|
|
61
|
+
margin-top: 64px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.edit-info {
|
|
65
|
+
padding-bottom: 18px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@media (min-width: 640px) {
|
|
69
|
+
.edit-info {
|
|
70
|
+
display: flex;
|
|
71
|
+
justify-content: space-between;
|
|
72
|
+
align-items: center;
|
|
73
|
+
padding-bottom: 14px;
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.edit-link-button {
|
|
78
|
+
display: flex;
|
|
79
|
+
align-items: center;
|
|
80
|
+
border: 0;
|
|
81
|
+
line-height: 32px;
|
|
82
|
+
font-size: 14px;
|
|
83
|
+
font-weight: 500;
|
|
84
|
+
color: var(--vp-c-brand-1);
|
|
85
|
+
transition: color 0.25s;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.edit-link-button:hover {
|
|
89
|
+
color: var(--vp-c-brand-2);
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.edit-link-icon {
|
|
93
|
+
margin-right: 8px;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
.prev-next {
|
|
97
|
+
border-top: 1px solid var(--vp-c-divider);
|
|
98
|
+
padding-top: 24px;
|
|
99
|
+
display: grid;
|
|
100
|
+
grid-row-gap: 8px;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
@media (min-width: 640px) {
|
|
104
|
+
.prev-next {
|
|
105
|
+
grid-template-columns: repeat(2, 1fr);
|
|
106
|
+
grid-column-gap: 16px;
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.pager-link {
|
|
111
|
+
display: block;
|
|
112
|
+
border: 1px solid var(--vp-c-divider);
|
|
113
|
+
border-radius: 8px;
|
|
114
|
+
padding: 11px 16px 13px;
|
|
115
|
+
width: 100%;
|
|
116
|
+
height: 100%;
|
|
117
|
+
transition: border-color 0.25s;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.pager-link:hover {
|
|
121
|
+
border-color: var(--vp-c-brand-1);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
.pager-link.next {
|
|
125
|
+
margin-left: auto;
|
|
126
|
+
text-align: right;
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
.desc {
|
|
130
|
+
display: block;
|
|
131
|
+
line-height: 20px;
|
|
132
|
+
font-size: 12px;
|
|
133
|
+
font-weight: 500;
|
|
134
|
+
color: var(--vp-c-text-2);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
.title {
|
|
138
|
+
display: block;
|
|
139
|
+
line-height: 20px;
|
|
140
|
+
font-size: 14px;
|
|
141
|
+
font-weight: 500;
|
|
142
|
+
color: var(--vp-c-brand-1);
|
|
143
|
+
transition: color 0.25s;
|
|
144
|
+
}
|
|
145
|
+
</style>
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { ref, computed, watchEffect, onMounted } from 'vue'
|
|
3
|
+
import { useData } from '../composables/data'
|
|
4
|
+
|
|
5
|
+
const { theme, page, frontmatter, lang } = useData()
|
|
6
|
+
|
|
7
|
+
const date = computed(
|
|
8
|
+
() => new Date(frontmatter.value.lastUpdated ?? page.value.lastUpdated)
|
|
9
|
+
)
|
|
10
|
+
const isoDatetime = computed(() => date.value.toISOString())
|
|
11
|
+
const datetime = ref('')
|
|
12
|
+
|
|
13
|
+
// set time on mounted hook to avoid hydration mismatch due to
|
|
14
|
+
// potential differences in timezones of the server and clients
|
|
15
|
+
onMounted(() => {
|
|
16
|
+
watchEffect(() => {
|
|
17
|
+
datetime.value = new Intl.DateTimeFormat(
|
|
18
|
+
theme.value.lastUpdated?.formatOptions?.forceLocale ? lang.value : undefined,
|
|
19
|
+
theme.value.lastUpdated?.formatOptions ?? {
|
|
20
|
+
dateStyle: 'short',
|
|
21
|
+
timeStyle: 'short'
|
|
22
|
+
}
|
|
23
|
+
).format(date.value)
|
|
24
|
+
})
|
|
25
|
+
})
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template>
|
|
29
|
+
<p class="VPLastUpdated">
|
|
30
|
+
{{ theme.lastUpdated?.text || theme.lastUpdatedText || 'Last updated' }}:
|
|
31
|
+
<time :datetime="isoDatetime">{{ datetime }}</time>
|
|
32
|
+
</p>
|
|
33
|
+
</template>
|
|
34
|
+
|
|
35
|
+
<style scoped>
|
|
36
|
+
.VPLastUpdated {
|
|
37
|
+
line-height: 24px;
|
|
38
|
+
font-size: 14px;
|
|
39
|
+
font-weight: 500;
|
|
40
|
+
color: var(--vp-c-text-2);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
@media (min-width: 640px) {
|
|
44
|
+
.VPLastUpdated {
|
|
45
|
+
line-height: 32px;
|
|
46
|
+
font-size: 14px;
|
|
47
|
+
font-weight: 500;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
</style>
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { MenuItem } from '../composables/outline'
|
|
3
|
+
|
|
4
|
+
defineProps<{
|
|
5
|
+
headers: MenuItem[]
|
|
6
|
+
root?: boolean
|
|
7
|
+
}>()
|
|
8
|
+
|
|
9
|
+
function onClick({ target: el }: Event) {
|
|
10
|
+
const id = (el as HTMLAnchorElement).href!.split('#')[1]
|
|
11
|
+
const heading = document.getElementById(decodeURIComponent(id))
|
|
12
|
+
heading?.focus({ preventScroll: true })
|
|
13
|
+
}
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<ul class="VPDocOutlineItem" :class="root ? 'root' : 'nested'">
|
|
18
|
+
<li v-for="{ children, link, title } in headers">
|
|
19
|
+
<a class="outline-link" :href="link" @click="onClick" :title="title">{{ title }}</a>
|
|
20
|
+
<template v-if="children?.length">
|
|
21
|
+
<VPDocOutlineItem :headers="children" />
|
|
22
|
+
</template>
|
|
23
|
+
</li>
|
|
24
|
+
</ul>
|
|
25
|
+
</template>
|
|
26
|
+
|
|
27
|
+
<style scoped>
|
|
28
|
+
.root {
|
|
29
|
+
position: relative;
|
|
30
|
+
z-index: 1;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
.nested {
|
|
34
|
+
padding-right: 16px;
|
|
35
|
+
padding-left: 16px;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
.outline-link {
|
|
39
|
+
display: block;
|
|
40
|
+
line-height: 32px;
|
|
41
|
+
font-size: 14px;
|
|
42
|
+
font-weight: 400;
|
|
43
|
+
color: var(--vp-c-text-2);
|
|
44
|
+
white-space: nowrap;
|
|
45
|
+
overflow: hidden;
|
|
46
|
+
text-overflow: ellipsis;
|
|
47
|
+
transition: color 0.5s;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
.outline-link:hover,
|
|
51
|
+
.outline-link.active {
|
|
52
|
+
color: var(--vp-c-text-1);
|
|
53
|
+
transition: color 0.25s;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.outline-link.nested {
|
|
57
|
+
padding-left: 13px;
|
|
58
|
+
}
|
|
59
|
+
</style>
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DefaultTheme } from 'vitepress/theme'
|
|
3
|
+
import VPImage from './VPImage.vue'
|
|
4
|
+
import VPLink from './VPLink.vue'
|
|
5
|
+
|
|
6
|
+
defineProps<{
|
|
7
|
+
icon?: DefaultTheme.FeatureIcon
|
|
8
|
+
title: string
|
|
9
|
+
details?: string
|
|
10
|
+
link?: string
|
|
11
|
+
linkText?: string
|
|
12
|
+
rel?: string
|
|
13
|
+
target?: string
|
|
14
|
+
}>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<template>
|
|
18
|
+
<VPLink
|
|
19
|
+
class="VPFeature"
|
|
20
|
+
:href="link"
|
|
21
|
+
:rel="rel"
|
|
22
|
+
:target="target"
|
|
23
|
+
:no-icon="true"
|
|
24
|
+
:tag="link ? 'a' : 'div'"
|
|
25
|
+
>
|
|
26
|
+
<article class="box">
|
|
27
|
+
<div v-if="typeof icon === 'object' && icon.wrap" class="icon">
|
|
28
|
+
<VPImage
|
|
29
|
+
:image="icon"
|
|
30
|
+
:alt="icon.alt"
|
|
31
|
+
:height="icon.height || 48"
|
|
32
|
+
:width="icon.width || 48"
|
|
33
|
+
/>
|
|
34
|
+
</div>
|
|
35
|
+
<VPImage
|
|
36
|
+
v-else-if="typeof icon === 'object'"
|
|
37
|
+
:image="icon"
|
|
38
|
+
:alt="icon.alt"
|
|
39
|
+
:height="icon.height || 48"
|
|
40
|
+
:width="icon.width || 48"
|
|
41
|
+
/>
|
|
42
|
+
<div v-else-if="icon" class="icon" v-html="icon"></div>
|
|
43
|
+
<h2 class="title" v-html="title"></h2>
|
|
44
|
+
<p v-if="details" class="details" v-html="details"></p>
|
|
45
|
+
|
|
46
|
+
<div v-if="linkText" class="link-text">
|
|
47
|
+
<p class="link-text-value">
|
|
48
|
+
{{ linkText }} <span class="vpi-arrow-right link-text-icon" />
|
|
49
|
+
</p>
|
|
50
|
+
</div>
|
|
51
|
+
</article>
|
|
52
|
+
</VPLink>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<style scoped>
|
|
56
|
+
.VPFeature {
|
|
57
|
+
display: block;
|
|
58
|
+
border: 1px solid var(--vp-c-bg-soft);
|
|
59
|
+
border-radius: 12px;
|
|
60
|
+
height: 100%;
|
|
61
|
+
background-color: var(--vp-c-bg-soft);
|
|
62
|
+
transition: border-color 0.25s, background-color 0.25s;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.VPFeature.link:hover {
|
|
66
|
+
border-color: var(--vp-c-brand-1);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.box {
|
|
70
|
+
display: flex;
|
|
71
|
+
flex-direction: column;
|
|
72
|
+
padding: 24px;
|
|
73
|
+
height: 100%;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.box > :deep(.VPImage) {
|
|
77
|
+
margin-bottom: 20px;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.icon {
|
|
81
|
+
display: flex;
|
|
82
|
+
justify-content: center;
|
|
83
|
+
align-items: center;
|
|
84
|
+
margin-bottom: 20px;
|
|
85
|
+
border-radius: 6px;
|
|
86
|
+
background-color: var(--vp-c-default-soft);
|
|
87
|
+
width: 48px;
|
|
88
|
+
height: 48px;
|
|
89
|
+
font-size: 24px;
|
|
90
|
+
transition: background-color 0.25s;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
.title {
|
|
94
|
+
line-height: 24px;
|
|
95
|
+
font-size: 16px;
|
|
96
|
+
font-weight: 600;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
.details {
|
|
100
|
+
flex-grow: 1;
|
|
101
|
+
padding-top: 8px;
|
|
102
|
+
line-height: 24px;
|
|
103
|
+
font-size: 14px;
|
|
104
|
+
font-weight: 500;
|
|
105
|
+
color: var(--vp-c-text-2);
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
.link-text {
|
|
109
|
+
padding-top: 8px;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
.link-text-value {
|
|
113
|
+
display: flex;
|
|
114
|
+
align-items: center;
|
|
115
|
+
font-size: 14px;
|
|
116
|
+
font-weight: 500;
|
|
117
|
+
color: var(--vp-c-brand-1);
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
.link-text-icon {
|
|
121
|
+
margin-left: 6px;
|
|
122
|
+
}
|
|
123
|
+
</style>
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import type { DefaultTheme } from 'vitepress/theme'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
|
+
import VPFeature from './VPFeature.vue'
|
|
5
|
+
|
|
6
|
+
export interface Feature {
|
|
7
|
+
icon?: DefaultTheme.FeatureIcon
|
|
8
|
+
title: string
|
|
9
|
+
details: string
|
|
10
|
+
link?: string
|
|
11
|
+
linkText?: string
|
|
12
|
+
rel?: string
|
|
13
|
+
target?: string
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
features: Feature[]
|
|
18
|
+
}>()
|
|
19
|
+
|
|
20
|
+
const grid = computed(() => {
|
|
21
|
+
const length = props.features.length
|
|
22
|
+
|
|
23
|
+
if (!length) {
|
|
24
|
+
return
|
|
25
|
+
} else if (length === 2) {
|
|
26
|
+
return 'grid-2'
|
|
27
|
+
} else if (length === 3) {
|
|
28
|
+
return 'grid-3'
|
|
29
|
+
} else if (length % 3 === 0) {
|
|
30
|
+
return 'grid-6'
|
|
31
|
+
} else if (length > 3) {
|
|
32
|
+
return 'grid-4'
|
|
33
|
+
}
|
|
34
|
+
})
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template>
|
|
38
|
+
<div v-if="features" class="VPFeatures">
|
|
39
|
+
<div class="container">
|
|
40
|
+
<div class="items">
|
|
41
|
+
<div
|
|
42
|
+
v-for="feature in features"
|
|
43
|
+
:key="feature.title"
|
|
44
|
+
class="item"
|
|
45
|
+
:class="[grid]"
|
|
46
|
+
>
|
|
47
|
+
<VPFeature
|
|
48
|
+
:icon="feature.icon"
|
|
49
|
+
:title="feature.title"
|
|
50
|
+
:details="feature.details"
|
|
51
|
+
:link="feature.link"
|
|
52
|
+
:link-text="feature.linkText"
|
|
53
|
+
:rel="feature.rel"
|
|
54
|
+
:target="feature.target"
|
|
55
|
+
/>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
</div>
|
|
59
|
+
</div>
|
|
60
|
+
</template>
|
|
61
|
+
|
|
62
|
+
<style scoped>
|
|
63
|
+
.VPFeatures {
|
|
64
|
+
position: relative;
|
|
65
|
+
padding: 0 24px;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
@media (min-width: 640px) {
|
|
69
|
+
.VPFeatures {
|
|
70
|
+
padding: 0 48px;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
@media (min-width: 960px) {
|
|
75
|
+
.VPFeatures {
|
|
76
|
+
padding: 0 64px;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.container {
|
|
81
|
+
margin: 0 auto;
|
|
82
|
+
max-width: 1152px;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
.items {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-wrap: wrap;
|
|
88
|
+
margin: -8px;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
.item {
|
|
92
|
+
padding: 8px;
|
|
93
|
+
width: 100%;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (min-width: 640px) {
|
|
97
|
+
.item.grid-2,
|
|
98
|
+
.item.grid-4,
|
|
99
|
+
.item.grid-6 {
|
|
100
|
+
width: calc(100% / 2);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
@media (min-width: 768px) {
|
|
105
|
+
.item.grid-2,
|
|
106
|
+
.item.grid-4 {
|
|
107
|
+
width: calc(100% / 2);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
.item.grid-3,
|
|
111
|
+
.item.grid-6 {
|
|
112
|
+
width: calc(100% / 3);
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
@media (min-width: 960px) {
|
|
117
|
+
.item.grid-4 {
|
|
118
|
+
width: calc(100% / 4);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
</style>
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
<script lang="ts" setup>
|
|
2
|
+
import { ref } from 'vue'
|
|
3
|
+
import { useFlyout } from '../composables/flyout'
|
|
4
|
+
import VPMenu from './VPMenu.vue'
|
|
5
|
+
|
|
6
|
+
defineProps<{
|
|
7
|
+
icon?: string
|
|
8
|
+
button?: string
|
|
9
|
+
label?: string
|
|
10
|
+
items?: any[]
|
|
11
|
+
}>()
|
|
12
|
+
|
|
13
|
+
const open = ref(false)
|
|
14
|
+
const el = ref<HTMLElement>()
|
|
15
|
+
|
|
16
|
+
useFlyout({ el, onBlur })
|
|
17
|
+
|
|
18
|
+
function onBlur() {
|
|
19
|
+
open.value = false
|
|
20
|
+
}
|
|
21
|
+
</script>
|
|
22
|
+
|
|
23
|
+
<template>
|
|
24
|
+
<div
|
|
25
|
+
class="VPFlyout"
|
|
26
|
+
ref="el"
|
|
27
|
+
@mouseenter="open = true"
|
|
28
|
+
@mouseleave="open = false"
|
|
29
|
+
>
|
|
30
|
+
<button
|
|
31
|
+
type="button"
|
|
32
|
+
class="button"
|
|
33
|
+
aria-haspopup="true"
|
|
34
|
+
:aria-expanded="open"
|
|
35
|
+
:aria-label="label"
|
|
36
|
+
@click="open = !open"
|
|
37
|
+
>
|
|
38
|
+
<span v-if="button || icon" class="text">
|
|
39
|
+
<span v-if="icon" :class="[icon, 'option-icon']" />
|
|
40
|
+
<span v-if="button" v-html="button"></span>
|
|
41
|
+
<span class="vpi-chevron-down text-icon" />
|
|
42
|
+
</span>
|
|
43
|
+
|
|
44
|
+
<span v-else class="vpi-more-horizontal icon" />
|
|
45
|
+
</button>
|
|
46
|
+
|
|
47
|
+
<div class="menu">
|
|
48
|
+
<VPMenu :items="items">
|
|
49
|
+
<slot />
|
|
50
|
+
</VPMenu>
|
|
51
|
+
</div>
|
|
52
|
+
</div>
|
|
53
|
+
</template>
|
|
54
|
+
|
|
55
|
+
<style scoped>
|
|
56
|
+
.VPFlyout {
|
|
57
|
+
position: relative;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
.VPFlyout:hover {
|
|
61
|
+
color: var(--vp-c-brand-1);
|
|
62
|
+
transition: color 0.25s;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.VPFlyout:hover .text {
|
|
66
|
+
color: var(--vp-c-text-2);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
.VPFlyout:hover .icon {
|
|
70
|
+
fill: var(--vp-c-text-2);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
.VPFlyout.active .text {
|
|
74
|
+
color: var(--vp-c-brand-1);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
.VPFlyout.active:hover .text {
|
|
78
|
+
color: var(--vp-c-brand-2);
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
.VPFlyout:hover .menu,
|
|
82
|
+
.button[aria-expanded="true"] + .menu {
|
|
83
|
+
opacity: 1;
|
|
84
|
+
visibility: visible;
|
|
85
|
+
transform: translateY(0);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
.button[aria-expanded="false"] + .menu {
|
|
89
|
+
opacity: 0;
|
|
90
|
+
visibility: hidden;
|
|
91
|
+
transform: translateY(0);
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.button {
|
|
95
|
+
display: flex;
|
|
96
|
+
align-items: center;
|
|
97
|
+
padding: 0 12px;
|
|
98
|
+
height: var(--vp-nav-height);
|
|
99
|
+
color: var(--vp-c-text-1);
|
|
100
|
+
transition: color 0.5s;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
.text {
|
|
104
|
+
display: flex;
|
|
105
|
+
align-items: center;
|
|
106
|
+
line-height: var(--vp-nav-height);
|
|
107
|
+
font-size: 14px;
|
|
108
|
+
font-weight: 500;
|
|
109
|
+
color: var(--vp-c-text-1);
|
|
110
|
+
transition: color 0.25s;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.option-icon {
|
|
114
|
+
margin-right: 0px;
|
|
115
|
+
font-size: 16px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
.text-icon {
|
|
119
|
+
margin-left: 4px;
|
|
120
|
+
font-size: 14px;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
.icon {
|
|
124
|
+
font-size: 20px;
|
|
125
|
+
transition: fill 0.25s;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
.menu {
|
|
129
|
+
position: absolute;
|
|
130
|
+
top: calc(var(--vp-nav-height) / 2 + 20px);
|
|
131
|
+
right: 0;
|
|
132
|
+
opacity: 0;
|
|
133
|
+
visibility: hidden;
|
|
134
|
+
transition: opacity 0.25s, visibility 0.25s, transform 0.25s;
|
|
135
|
+
}
|
|
136
|
+
</style>
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { useData } from '../composables/data'
|
|
3
|
+
import { useSidebar } from '../composables/sidebar'
|
|
4
|
+
|
|
5
|
+
const { theme, frontmatter } = useData()
|
|
6
|
+
const { hasSidebar } = useSidebar()
|
|
7
|
+
</script>
|
|
8
|
+
|
|
9
|
+
<template>
|
|
10
|
+
<footer v-if="theme.footer && frontmatter.footer !== false" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
|
|
11
|
+
<div class="container">
|
|
12
|
+
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
|
|
13
|
+
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
|
|
14
|
+
</div>
|
|
15
|
+
</footer>
|
|
16
|
+
</template>
|
|
17
|
+
|
|
18
|
+
<style scoped>
|
|
19
|
+
.VPFooter {
|
|
20
|
+
position: relative;
|
|
21
|
+
z-index: var(--vp-z-index-footer);
|
|
22
|
+
border-top: 1px solid var(--vp-c-gutter);
|
|
23
|
+
padding: 32px 24px;
|
|
24
|
+
background-color: var(--vp-c-bg);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
.VPFooter.has-sidebar {
|
|
28
|
+
display: none;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
.VPFooter :deep(a) {
|
|
32
|
+
text-decoration-line: underline;
|
|
33
|
+
text-underline-offset: 2px;
|
|
34
|
+
transition: color 0.25s;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
.VPFooter :deep(a:hover) {
|
|
38
|
+
color: var(--vp-c-text-1);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
@media (min-width: 768px) {
|
|
42
|
+
.VPFooter {
|
|
43
|
+
padding: 32px;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
.container {
|
|
48
|
+
margin: 0 auto;
|
|
49
|
+
max-width: var(--vp-layout-max-width);
|
|
50
|
+
text-align: center;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
.message,
|
|
54
|
+
.copyright {
|
|
55
|
+
line-height: 24px;
|
|
56
|
+
font-size: 14px;
|
|
57
|
+
font-weight: 500;
|
|
58
|
+
color: var(--vp-c-text-2);
|
|
59
|
+
}
|
|
60
|
+
</style>
|