vitepress 1.0.0-beta.4 → 1.0.0-beta.6
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/dist/client/app/composables/head.js +8 -3
- package/dist/client/app/utils.js +1 -1
- package/dist/client/theme-default/Layout.vue +1 -2
- package/dist/client/theme-default/components/VPContent.vue +1 -1
- package/dist/client/theme-default/components/VPDoc.vue +3 -2
- package/dist/client/theme-default/components/VPDocFooter.vue +7 -22
- package/dist/client/theme-default/components/VPFeature.vue +1 -1
- package/dist/client/theme-default/components/VPFooter.vue +3 -3
- package/dist/client/theme-default/components/VPHero.vue +3 -3
- package/dist/client/theme-default/components/VPLink.vue +5 -1
- package/dist/client/theme-default/components/VPLocalNav.vue +14 -5
- package/dist/client/theme-default/components/VPLocalNavOutlineDropdown.vue +3 -2
- package/dist/client/theme-default/components/VPLocalSearchBox.vue +26 -8
- package/dist/client/theme-default/components/VPNavBar.vue +1 -1
- package/dist/client/theme-default/components/VPNavBarTitle.vue +2 -2
- package/dist/client/theme-default/components/VPNavScreen.vue +1 -1
- package/dist/client/theme-default/components/VPSidebar.vue +1 -1
- package/dist/client/theme-default/components/VPSidebarItem.vue +1 -0
- package/dist/client/theme-default/components/VPSocialLink.vue +1 -1
- package/dist/client/theme-default/composables/aside.js +1 -1
- package/dist/client/theme-default/styles/components/vp-doc.css +31 -12
- package/dist/client/theme-default/styles/vars.css +1 -0
- package/dist/node/cli.js +6 -4
- package/dist/node/index.d.ts +10 -1
- package/dist/node/index.js +6 -4
- package/dist/node/{serve-d0f912b9.js → serve-98a6c925.js} +1131 -745
- package/dist/node-cjs/cli.cjs +6 -4
- package/dist/node-cjs/index.cjs +5 -3
- package/dist/node-cjs/{serve-3371ae61.cjs → serve-387bb3cc.cjs} +1136 -750
- package/package.json +18 -15
- package/theme-without-fonts.d.ts +1 -0
- package/theme.d.ts +1 -1
- package/types/default-theme.d.ts +22 -1
|
@@ -25,9 +25,14 @@ export function useUpdateHead(route, siteDataByRouteRef) {
|
|
|
25
25
|
const frontmatterHead = (pageData && pageData.frontmatter.head) || [];
|
|
26
26
|
// update title and description
|
|
27
27
|
document.title = createTitle(siteData, pageData);
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
28
|
+
const description = pageDescription || siteData.description;
|
|
29
|
+
let metaDescriptionElement = document.querySelector(`meta[name=description]`);
|
|
30
|
+
if (metaDescriptionElement) {
|
|
31
|
+
metaDescriptionElement.setAttribute('content', description);
|
|
32
|
+
}
|
|
33
|
+
else {
|
|
34
|
+
createHeadElement(['meta', { name: 'description', content: description }]);
|
|
35
|
+
}
|
|
31
36
|
updateHeadTags(mergeHead(siteData.head, filterOutHeadDescription(frontmatterHead)));
|
|
32
37
|
});
|
|
33
38
|
}
|
package/dist/client/app/utils.js
CHANGED
|
@@ -43,7 +43,7 @@ export function pathToFile(path) {
|
|
|
43
43
|
}
|
|
44
44
|
if (!pageHash)
|
|
45
45
|
return null;
|
|
46
|
-
pagePath = `${base}
|
|
46
|
+
pagePath = `${base}${__ASSETS_DIR__.replace(/"(.+)"/, '$1')}/${pagePath}.${pageHash}.js`;
|
|
47
47
|
}
|
|
48
48
|
else {
|
|
49
49
|
// ssr build uses much simpler name mapping
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useRoute } from 'vitepress'
|
|
3
|
-
import { useSidebar } from 'vitepress/theme'
|
|
4
3
|
import { computed, provide, useSlots, watch } from 'vue'
|
|
5
4
|
import VPBackdrop from './components/VPBackdrop.vue'
|
|
6
5
|
import VPContent from './components/VPContent.vue'
|
|
@@ -10,7 +9,7 @@ import VPNav from './components/VPNav.vue'
|
|
|
10
9
|
import VPSidebar from './components/VPSidebar.vue'
|
|
11
10
|
import VPSkipLink from './components/VPSkipLink.vue'
|
|
12
11
|
import { useData } from './composables/data'
|
|
13
|
-
import { useCloseSidebarOnEscape } from './composables/sidebar'
|
|
12
|
+
import { useCloseSidebarOnEscape, useSidebar } from './composables/sidebar'
|
|
14
13
|
|
|
15
14
|
const {
|
|
16
15
|
isOpen: isSidebarOpen,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useSidebar } from 'vitepress/theme'
|
|
3
2
|
import NotFound from '../NotFound.vue'
|
|
4
3
|
import { useData } from '../composables/data'
|
|
4
|
+
import { useSidebar } from '../composables/sidebar'
|
|
5
5
|
import VPDoc from './VPDoc.vue'
|
|
6
6
|
import VPHome from './VPHome.vue'
|
|
7
7
|
import VPPage from './VPPage.vue'
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { useRoute } from 'vitepress'
|
|
3
|
-
import { useSidebar } from 'vitepress/theme'
|
|
4
3
|
import { computed } from 'vue'
|
|
5
4
|
import { useData } from '../composables/data'
|
|
5
|
+
import { useSidebar } from '../composables/sidebar'
|
|
6
6
|
import VPDocAside from './VPDocAside.vue'
|
|
7
7
|
import VPDocFooter from './VPDocFooter.vue'
|
|
8
8
|
import VPDocOutlineDropdown from './VPDocOutlineDropdown.vue'
|
|
@@ -74,7 +74,7 @@ const pageName = computed(() =>
|
|
|
74
74
|
display: none;
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
@media (min-width: 960px) and (max-width:
|
|
77
|
+
@media (min-width: 960px) and (max-width: 1279px) {
|
|
78
78
|
.VPDoc .VPDocOutlineDropdown {
|
|
79
79
|
display: block;
|
|
80
80
|
}
|
|
@@ -205,5 +205,6 @@ const pageName = computed(() =>
|
|
|
205
205
|
|
|
206
206
|
.external-link-icon-enabled :is(.vp-doc a[href*='://'], .vp-doc a[target='_blank'])::after {
|
|
207
207
|
content: '';
|
|
208
|
+
color: currentColor;
|
|
208
209
|
}
|
|
209
210
|
</style>
|
|
@@ -41,20 +41,20 @@ const showFooter = computed(() => {
|
|
|
41
41
|
</div>
|
|
42
42
|
</div>
|
|
43
43
|
|
|
44
|
-
<
|
|
44
|
+
<nav v-if="control.prev?.link || control.next?.link" class="prev-next">
|
|
45
45
|
<div class="pager">
|
|
46
46
|
<a v-if="control.prev?.link" class="pager-link prev" :href="normalizeLink(control.prev.link)">
|
|
47
47
|
<span class="desc" v-html="theme.docFooter?.prev || 'Previous page'"></span>
|
|
48
48
|
<span class="title" v-html="control.prev.text"></span>
|
|
49
49
|
</a>
|
|
50
50
|
</div>
|
|
51
|
-
<div class="pager"
|
|
51
|
+
<div class="pager">
|
|
52
52
|
<a v-if="control.next?.link" class="pager-link next" :href="normalizeLink(control.next.link)">
|
|
53
53
|
<span class="desc" v-html="theme.docFooter?.next || 'Next page'"></span>
|
|
54
54
|
<span class="title" v-html="control.next.text"></span>
|
|
55
55
|
</a>
|
|
56
56
|
</div>
|
|
57
|
-
</
|
|
57
|
+
</nav>
|
|
58
58
|
</footer>
|
|
59
59
|
</template>
|
|
60
60
|
|
|
@@ -101,29 +101,14 @@ const showFooter = computed(() => {
|
|
|
101
101
|
.prev-next {
|
|
102
102
|
border-top: 1px solid var(--vp-c-divider);
|
|
103
103
|
padding-top: 24px;
|
|
104
|
+
display: grid;
|
|
105
|
+
grid-row-gap: 8px;
|
|
104
106
|
}
|
|
105
107
|
|
|
106
108
|
@media (min-width: 640px) {
|
|
107
109
|
.prev-next {
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
.pager.has-prev {
|
|
113
|
-
padding-top: 8px;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
@media (min-width: 640px) {
|
|
117
|
-
.pager {
|
|
118
|
-
display: flex;
|
|
119
|
-
flex-direction: column;
|
|
120
|
-
flex-shrink: 0;
|
|
121
|
-
width: 50%;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
.pager.has-prev {
|
|
125
|
-
padding-top: 0;
|
|
126
|
-
padding-left: 16px;
|
|
110
|
+
grid-template-columns: repeat(2, 1fr);
|
|
111
|
+
grid-column-gap: 16px;
|
|
127
112
|
}
|
|
128
113
|
}
|
|
129
114
|
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useSidebar } from 'vitepress/theme'
|
|
3
2
|
import { useData } from '../composables/data'
|
|
3
|
+
import { useSidebar } from '../composables/sidebar'
|
|
4
4
|
|
|
5
|
-
const { theme } = useData()
|
|
5
|
+
const { theme, frontmatter } = useData()
|
|
6
6
|
const { hasSidebar } = useSidebar()
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<template>
|
|
10
|
-
<footer v-if="theme.footer" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
|
|
10
|
+
<footer v-if="theme.footer && frontmatter.footer !== false" class="VPFooter" :class="{ 'has-sidebar': hasSidebar }">
|
|
11
11
|
<div class="container">
|
|
12
12
|
<p v-if="theme.footer.message" class="message" v-html="theme.footer.message"></p>
|
|
13
13
|
<p v-if="theme.footer.copyright" class="copyright" v-html="theme.footer.copyright"></p>
|
|
@@ -27,10 +27,10 @@ const heroImageSlotExists = inject('hero-image-slot-exists') as Ref<boolean>
|
|
|
27
27
|
<div class="main">
|
|
28
28
|
<slot name="home-hero-info">
|
|
29
29
|
<h1 v-if="name" class="name">
|
|
30
|
-
<span class="clip"
|
|
30
|
+
<span v-html="name" class="clip"></span>
|
|
31
31
|
</h1>
|
|
32
|
-
<p v-if="text"
|
|
33
|
-
<p v-if="tagline"
|
|
32
|
+
<p v-if="text" v-html="text" class="text"></p>
|
|
33
|
+
<p v-if="tagline" v-html="tagline" class="tagline"></p>
|
|
34
34
|
</slot>
|
|
35
35
|
|
|
36
36
|
<div v-if="actions" class="actions">
|
|
@@ -19,7 +19,11 @@ const isExternal = computed(() => props.href && EXTERNAL_URL_RE.test(props.href)
|
|
|
19
19
|
<component
|
|
20
20
|
:is="tag"
|
|
21
21
|
class="VPLink"
|
|
22
|
-
:class="{
|
|
22
|
+
:class="{
|
|
23
|
+
link: href,
|
|
24
|
+
'vp-external-link-icon': isExternal,
|
|
25
|
+
'no-icon': noIcon
|
|
26
|
+
}"
|
|
23
27
|
:href="href ? normalizeLink(href) : undefined"
|
|
24
28
|
:target="target || (isExternal ? '_blank' : undefined)"
|
|
25
29
|
:rel="rel || (isExternal ? 'noreferrer' : undefined)"
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { useWindowScroll } from '@vueuse/core'
|
|
3
3
|
import { onContentUpdated } from 'vitepress'
|
|
4
|
-
import {
|
|
5
|
-
import { computed, shallowRef } from 'vue'
|
|
4
|
+
import { computed, shallowRef, ref, onMounted } from 'vue'
|
|
6
5
|
import { useData } from '../composables/data'
|
|
6
|
+
import { useSidebar } from '../composables/sidebar'
|
|
7
7
|
import { getHeaders, type MenuItem } from '../composables/outline'
|
|
8
8
|
import VPLocalNavOutlineDropdown from './VPLocalNavOutlineDropdown.vue'
|
|
9
9
|
import VPIconAlignLeft from './icons/VPIconAlignLeft.vue'
|
|
@@ -21,6 +21,15 @@ const { hasSidebar } = useSidebar()
|
|
|
21
21
|
const { y } = useWindowScroll()
|
|
22
22
|
|
|
23
23
|
const headers = shallowRef<MenuItem[]>([])
|
|
24
|
+
const navHeight = ref(0)
|
|
25
|
+
|
|
26
|
+
onMounted(() => {
|
|
27
|
+
navHeight.value = parseInt(
|
|
28
|
+
getComputedStyle(document.documentElement).getPropertyValue(
|
|
29
|
+
'--vp-nav-height'
|
|
30
|
+
)
|
|
31
|
+
)
|
|
32
|
+
})
|
|
24
33
|
|
|
25
34
|
onContentUpdated(() => {
|
|
26
35
|
headers.value = getHeaders(frontmatter.value.outline ?? theme.value.outline)
|
|
@@ -34,14 +43,14 @@ const classes = computed(() => {
|
|
|
34
43
|
return {
|
|
35
44
|
VPLocalNav: true,
|
|
36
45
|
fixed: empty.value,
|
|
37
|
-
'reached-top': y.value >=
|
|
46
|
+
'reached-top': y.value >= navHeight.value
|
|
38
47
|
}
|
|
39
48
|
})
|
|
40
49
|
</script>
|
|
41
50
|
|
|
42
51
|
<template>
|
|
43
52
|
<div
|
|
44
|
-
v-if="frontmatter.layout !== 'home' && (!empty || y >=
|
|
53
|
+
v-if="frontmatter.layout !== 'home' && (!empty || y >= navHeight)"
|
|
45
54
|
:class="classes"
|
|
46
55
|
>
|
|
47
56
|
<button
|
|
@@ -57,7 +66,7 @@ const classes = computed(() => {
|
|
|
57
66
|
</span>
|
|
58
67
|
</button>
|
|
59
68
|
|
|
60
|
-
<VPLocalNavOutlineDropdown :headers="headers" />
|
|
69
|
+
<VPLocalNavOutlineDropdown :headers="headers" :navHeight="navHeight" />
|
|
61
70
|
</div>
|
|
62
71
|
</template>
|
|
63
72
|
|
|
@@ -6,8 +6,9 @@ import { resolveTitle, type MenuItem } from '../composables/outline'
|
|
|
6
6
|
import VPDocOutlineItem from './VPDocOutlineItem.vue'
|
|
7
7
|
import VPIconChevronRight from './icons/VPIconChevronRight.vue'
|
|
8
8
|
|
|
9
|
-
defineProps<{
|
|
9
|
+
const props = defineProps<{
|
|
10
10
|
headers: MenuItem[]
|
|
11
|
+
navHeight: number
|
|
11
12
|
}>()
|
|
12
13
|
|
|
13
14
|
const { theme } = useData()
|
|
@@ -21,7 +22,7 @@ onContentUpdated(() => {
|
|
|
21
22
|
|
|
22
23
|
function toggle() {
|
|
23
24
|
open.value = !open.value
|
|
24
|
-
vh.value = window.innerHeight + Math.min(window.scrollY -
|
|
25
|
+
vh.value = window.innerHeight + Math.min(window.scrollY - props.navHeight, 0)
|
|
25
26
|
}
|
|
26
27
|
|
|
27
28
|
function onItemClick(e: Event) {
|
|
@@ -80,8 +80,12 @@ const searchIndex = computedAsync(async () =>
|
|
|
80
80
|
searchOptions: {
|
|
81
81
|
fuzzy: 0.2,
|
|
82
82
|
prefix: true,
|
|
83
|
-
boost: { title: 4, text: 2, titles: 1 }
|
|
84
|
-
|
|
83
|
+
boost: { title: 4, text: 2, titles: 1 },
|
|
84
|
+
...(theme.value.search?.provider === 'local' &&
|
|
85
|
+
theme.value.search.options?.miniSearch?.searchOptions)
|
|
86
|
+
},
|
|
87
|
+
...(theme.value.search?.provider === 'local' &&
|
|
88
|
+
theme.value.search.options?.miniSearch?.options)
|
|
85
89
|
}
|
|
86
90
|
)
|
|
87
91
|
)
|
|
@@ -396,8 +400,16 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
396
400
|
<div class="backdrop" @click="$emit('close')" />
|
|
397
401
|
|
|
398
402
|
<div class="shell">
|
|
399
|
-
<form
|
|
400
|
-
|
|
403
|
+
<form
|
|
404
|
+
class="search-bar"
|
|
405
|
+
@pointerup="onSearchBarClick($event)"
|
|
406
|
+
@submit.prevent=""
|
|
407
|
+
>
|
|
408
|
+
<label
|
|
409
|
+
:title="placeholder"
|
|
410
|
+
id="localsearch-label"
|
|
411
|
+
for="localsearch-input"
|
|
412
|
+
>
|
|
401
413
|
<svg
|
|
402
414
|
class="search-icon"
|
|
403
415
|
width="18"
|
|
@@ -454,7 +466,9 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
454
466
|
class="toggle-layout-button"
|
|
455
467
|
:class="{ 'detailed-list': showDetailedList }"
|
|
456
468
|
:title="$t('modal.displayDetails')"
|
|
457
|
-
@click="
|
|
469
|
+
@click="
|
|
470
|
+
selectedIndex > -1 && (showDetailedList = !showDetailedList)
|
|
471
|
+
"
|
|
458
472
|
>
|
|
459
473
|
<svg
|
|
460
474
|
width="18"
|
|
@@ -527,7 +541,11 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
527
541
|
<div>
|
|
528
542
|
<div class="titles">
|
|
529
543
|
<span class="title-icon">#</span>
|
|
530
|
-
<span
|
|
544
|
+
<span
|
|
545
|
+
v-for="(t, index) in p.titles"
|
|
546
|
+
:key="index"
|
|
547
|
+
class="title"
|
|
548
|
+
>
|
|
531
549
|
<span class="text" v-html="t" />
|
|
532
550
|
<svg width="18" height="18" viewBox="0 0 24 24">
|
|
533
551
|
<path
|
|
@@ -547,7 +565,7 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
547
565
|
|
|
548
566
|
<div v-if="showDetailedList" class="excerpt-wrapper">
|
|
549
567
|
<div v-if="p.text" class="excerpt" inert>
|
|
550
|
-
<div class="vp-doc" v-html="p.text"
|
|
568
|
+
<div class="vp-doc" v-html="p.text" />
|
|
551
569
|
</div>
|
|
552
570
|
<div class="excerpt-gradient-bottom" />
|
|
553
571
|
<div class="excerpt-gradient-top" />
|
|
@@ -726,7 +744,7 @@ function formMarkRegex(terms: Set<string>) {
|
|
|
726
744
|
}
|
|
727
745
|
|
|
728
746
|
.search-actions button.clear-button:disabled {
|
|
729
|
-
|
|
747
|
+
opacity: 0.37;
|
|
730
748
|
}
|
|
731
749
|
|
|
732
750
|
.search-keyboard-shortcuts {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { useWindowScroll } from '@vueuse/core'
|
|
3
|
-
import { useSidebar } from 'vitepress/theme'
|
|
4
3
|
import { computed } from 'vue'
|
|
4
|
+
import { useSidebar } from '../composables/sidebar'
|
|
5
5
|
import VPNavBarAppearance from './VPNavBarAppearance.vue'
|
|
6
6
|
import VPNavBarExtra from './VPNavBarExtra.vue'
|
|
7
7
|
import VPNavBarHamburger from './VPNavBarHamburger.vue'
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { useSidebar } from 'vitepress/theme'
|
|
3
2
|
import { useData } from '../composables/data'
|
|
4
3
|
import { useLangs } from '../composables/langs'
|
|
4
|
+
import { useSidebar } from '../composables/sidebar'
|
|
5
5
|
import { normalizeLink } from '../support/utils'
|
|
6
6
|
import VPImage from './VPImage.vue'
|
|
7
7
|
|
|
@@ -47,6 +47,6 @@ const { currentLang } = useLangs()
|
|
|
47
47
|
|
|
48
48
|
:deep(.logo) {
|
|
49
49
|
margin-right: 8px;
|
|
50
|
-
height:
|
|
50
|
+
height: var(--vp-nav-logo-height);
|
|
51
51
|
}
|
|
52
52
|
</style>
|
|
@@ -27,7 +27,7 @@ function unlockBodyScroll() {
|
|
|
27
27
|
@enter="lockBodyScroll"
|
|
28
28
|
@after-leave="unlockBodyScroll"
|
|
29
29
|
>
|
|
30
|
-
<div v-if="open" class="VPNavScreen" ref="screen">
|
|
30
|
+
<div v-if="open" class="VPNavScreen" ref="screen" id="VPNavScreen">
|
|
31
31
|
<div class="container">
|
|
32
32
|
<slot name="nav-screen-content-before" />
|
|
33
33
|
<VPNavScreenMenu class="menu" />
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { clearAllBodyScrollLocks, disableBodyScroll } from 'body-scroll-lock'
|
|
3
|
-
import { useSidebar } from 'vitepress/theme'
|
|
4
3
|
import { ref, watchPostEffect } from 'vue'
|
|
4
|
+
import { useSidebar } from '../composables/sidebar'
|
|
5
5
|
import VPSidebarItem from './VPSidebarItem.vue'
|
|
6
6
|
|
|
7
7
|
const { sidebarGroups, hasSidebar } = useSidebar()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { useMediaQuery } from '@vueuse/core';
|
|
2
|
-
import { useSidebar } from 'vitepress/theme';
|
|
3
2
|
import { computed } from 'vue';
|
|
3
|
+
import { useSidebar } from './sidebar';
|
|
4
4
|
export function useAside() {
|
|
5
5
|
const { hasSidebar } = useSidebar();
|
|
6
6
|
const is960 = useMediaQuery('(min-width: 960px)');
|
|
@@ -42,7 +42,9 @@
|
|
|
42
42
|
font-weight: 500;
|
|
43
43
|
user-select: none;
|
|
44
44
|
opacity: 0;
|
|
45
|
-
transition:
|
|
45
|
+
transition:
|
|
46
|
+
color 0.25s,
|
|
47
|
+
opacity 0.25s;
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
.vp-doc .header-anchor:before {
|
|
@@ -224,6 +226,7 @@
|
|
|
224
226
|
|
|
225
227
|
.vp-doc .custom-block div[class*='language-'] {
|
|
226
228
|
margin: 8px 0;
|
|
229
|
+
border-radius: 8px;
|
|
227
230
|
}
|
|
228
231
|
|
|
229
232
|
.vp-doc .custom-block div[class*='language-'] code {
|
|
@@ -231,6 +234,11 @@
|
|
|
231
234
|
background-color: transparent;
|
|
232
235
|
}
|
|
233
236
|
|
|
237
|
+
.vp-doc .custom-block .vp-code-group .tabs {
|
|
238
|
+
margin: 0;
|
|
239
|
+
border-radius: 8px 8px 0 0;
|
|
240
|
+
}
|
|
241
|
+
|
|
234
242
|
/**
|
|
235
243
|
* Code
|
|
236
244
|
* -------------------------------------------------------------------------- */
|
|
@@ -245,7 +253,9 @@
|
|
|
245
253
|
padding: 3px 6px;
|
|
246
254
|
color: var(--vp-c-text-code);
|
|
247
255
|
background-color: var(--vp-c-mute);
|
|
248
|
-
transition:
|
|
256
|
+
transition:
|
|
257
|
+
color 0.5s,
|
|
258
|
+
background-color 0.5s;
|
|
249
259
|
}
|
|
250
260
|
|
|
251
261
|
.vp-doc h1 > code,
|
|
@@ -362,12 +372,16 @@
|
|
|
362
372
|
.vp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus) {
|
|
363
373
|
filter: blur(0.095rem);
|
|
364
374
|
opacity: 0.4;
|
|
365
|
-
transition:
|
|
375
|
+
transition:
|
|
376
|
+
filter 0.35s,
|
|
377
|
+
opacity 0.35s;
|
|
366
378
|
}
|
|
367
379
|
|
|
368
380
|
.vp-doc [class*='language-'] .has-focused-lines .line:not(.has-focus) {
|
|
369
381
|
opacity: 0.7;
|
|
370
|
-
transition:
|
|
382
|
+
transition:
|
|
383
|
+
filter 0.35s,
|
|
384
|
+
opacity 0.35s;
|
|
371
385
|
}
|
|
372
386
|
|
|
373
387
|
.vp-doc [class*='language-']:hover .has-focused-lines .line:not(.has-focus) {
|
|
@@ -415,7 +429,9 @@
|
|
|
415
429
|
line-height: var(--vp-code-line-height);
|
|
416
430
|
font-size: var(--vp-code-font-size);
|
|
417
431
|
color: var(--vp-code-line-number-color);
|
|
418
|
-
transition:
|
|
432
|
+
transition:
|
|
433
|
+
border-color 0.5s,
|
|
434
|
+
color 0.5s;
|
|
419
435
|
}
|
|
420
436
|
|
|
421
437
|
.vp-doc [class*='language-'] > button.copy {
|
|
@@ -437,7 +453,10 @@
|
|
|
437
453
|
background-position: 50%;
|
|
438
454
|
background-size: 20px;
|
|
439
455
|
background-repeat: no-repeat;
|
|
440
|
-
transition:
|
|
456
|
+
transition:
|
|
457
|
+
border-color 0.25s,
|
|
458
|
+
background-color 0.25s,
|
|
459
|
+
opacity 0.25s;
|
|
441
460
|
}
|
|
442
461
|
|
|
443
462
|
.vp-doc [class*='language-']:hover > button.copy,
|
|
@@ -492,7 +511,9 @@
|
|
|
492
511
|
font-size: 12px;
|
|
493
512
|
font-weight: 500;
|
|
494
513
|
color: var(--vp-c-code-dimm);
|
|
495
|
-
transition:
|
|
514
|
+
transition:
|
|
515
|
+
color 0.4s,
|
|
516
|
+
opacity 0.4s;
|
|
496
517
|
}
|
|
497
518
|
|
|
498
519
|
.vp-doc [class*='language-']:hover > button.copy + span.lang,
|
|
@@ -523,17 +544,15 @@
|
|
|
523
544
|
max-width: calc((100% - 24px) / 2) !important;
|
|
524
545
|
}
|
|
525
546
|
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
.vp-doc a[href*='://'],
|
|
529
|
-
.vp-doc a[target='_blank']
|
|
530
|
-
)::after {
|
|
547
|
+
/* prettier-ignore */
|
|
548
|
+
:is(.vp-external-link-icon, .vp-doc a[href*='://'], .vp-doc a[target='_blank']):not(.no-icon)::after {
|
|
531
549
|
display: inline-block;
|
|
532
550
|
margin-top: -1px;
|
|
533
551
|
margin-left: 4px;
|
|
534
552
|
width: 11px;
|
|
535
553
|
height: 11px;
|
|
536
554
|
background: currentColor;
|
|
555
|
+
color: var(--vp-c-text-3);
|
|
537
556
|
flex-shrink: 0;
|
|
538
557
|
--icon: url("data:image/svg+xml, %3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' %3E%3Cpath d='M0 0h24v24H0V0z' fill='none' /%3E%3Cpath d='M9 5v2h6.59L4 18.59 5.41 20 17 8.41V15h2V5H9z' /%3E%3C/svg%3E");
|
|
539
558
|
-webkit-mask-image: var(--icon);
|
package/dist/node/cli.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { o as getDefaultExportFromCjs, p as c, q as clearCache, k as build, s as serve, l as init, j as createServer } from './serve-
|
|
1
|
+
import { o as getDefaultExportFromCjs, p as c, q as clearCache, k as build, s as serve, l as init, j as createServer } from './serve-98a6c925.js';
|
|
2
2
|
import { createLogger } from 'vite';
|
|
3
3
|
import 'url';
|
|
4
4
|
import 'path';
|
|
5
5
|
import 'dns';
|
|
6
|
+
import 'crypto';
|
|
6
7
|
import 'module';
|
|
7
8
|
import 'node:process';
|
|
8
9
|
import 'assert';
|
|
@@ -16,9 +17,10 @@ import 'node:fs';
|
|
|
16
17
|
import 'util';
|
|
17
18
|
import 'fs';
|
|
18
19
|
import 'fs/promises';
|
|
19
|
-
import '
|
|
20
|
+
import 'node:events';
|
|
21
|
+
import 'node:stream';
|
|
22
|
+
import 'node:string_decoder';
|
|
20
23
|
import 'os';
|
|
21
|
-
import 'crypto';
|
|
22
24
|
import 'shiki';
|
|
23
25
|
import 'child_process';
|
|
24
26
|
import 'minisearch';
|
|
@@ -294,7 +296,7 @@ var minimist = function (args, opts) {
|
|
|
294
296
|
|
|
295
297
|
var minimist$1 = /*@__PURE__*/getDefaultExportFromCjs(minimist);
|
|
296
298
|
|
|
297
|
-
var version = "1.0.0-beta.
|
|
299
|
+
var version = "1.0.0-beta.6";
|
|
298
300
|
|
|
299
301
|
function bindShortcuts(server, createDevServer) {
|
|
300
302
|
if (!server.httpServer || !process.stdin.isTTY || process.env.CI) {
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1378,6 +1378,7 @@ interface MarkdownEnv {
|
|
|
1378
1378
|
relativePath: string;
|
|
1379
1379
|
cleanUrls: boolean;
|
|
1380
1380
|
links?: string[];
|
|
1381
|
+
includes?: string[];
|
|
1381
1382
|
}
|
|
1382
1383
|
|
|
1383
1384
|
/**
|
|
@@ -1772,6 +1773,7 @@ interface MarkdownOptions extends MarkdownIt.Options {
|
|
|
1772
1773
|
languages?: ILanguageRegistration[];
|
|
1773
1774
|
toc?: TocPluginOptions;
|
|
1774
1775
|
externalLinks?: Record<string, string>;
|
|
1776
|
+
cache?: boolean;
|
|
1775
1777
|
}
|
|
1776
1778
|
type MarkdownRenderer = MarkdownIt;
|
|
1777
1779
|
declare const createMarkdownRenderer: (srcDir: string, options?: MarkdownOptions, base?: string, logger?: Pick<Logger, 'warn'>) => Promise<MarkdownRenderer>;
|
|
@@ -1815,6 +1817,7 @@ interface UserConfig<ThemeConfig = any> extends LocaleSpecificConfig<ThemeConfig
|
|
|
1815
1817
|
srcDir?: string;
|
|
1816
1818
|
srcExclude?: string[];
|
|
1817
1819
|
outDir?: string;
|
|
1820
|
+
assetsDir?: string;
|
|
1818
1821
|
cacheDir?: string;
|
|
1819
1822
|
shouldPreload?: (link: string, page: string) => boolean;
|
|
1820
1823
|
locales?: LocaleConfig<ThemeConfig>;
|
|
@@ -1846,6 +1849,11 @@ interface UserConfig<ThemeConfig = any> extends LocaleSpecificConfig<ThemeConfig
|
|
|
1846
1849
|
* @experimental
|
|
1847
1850
|
*/
|
|
1848
1851
|
mpa?: boolean;
|
|
1852
|
+
/**
|
|
1853
|
+
* Extracts metadata to a separate chunk.
|
|
1854
|
+
* @experimental
|
|
1855
|
+
*/
|
|
1856
|
+
metaChunk?: boolean;
|
|
1849
1857
|
/**
|
|
1850
1858
|
* Don't fail builds due to dead links.
|
|
1851
1859
|
*
|
|
@@ -1899,7 +1907,7 @@ interface UserConfig<ThemeConfig = any> extends LocaleSpecificConfig<ThemeConfig
|
|
|
1899
1907
|
[key: string]: any;
|
|
1900
1908
|
} | void>;
|
|
1901
1909
|
}
|
|
1902
|
-
interface SiteConfig<ThemeConfig = any> extends Pick<UserConfig, 'markdown' | 'vue' | 'vite' | 'shouldPreload' | 'mpa' | 'lastUpdated' | 'ignoreDeadLinks' | 'cleanUrls' | 'useWebFonts' | 'postRender' | 'buildEnd' | 'transformHead' | 'transformHtml' | 'transformPageData'> {
|
|
1910
|
+
interface SiteConfig<ThemeConfig = any> extends Pick<UserConfig, 'markdown' | 'vue' | 'vite' | 'shouldPreload' | 'mpa' | 'metaChunk' | 'lastUpdated' | 'ignoreDeadLinks' | 'cleanUrls' | 'useWebFonts' | 'postRender' | 'buildEnd' | 'transformHead' | 'transformHtml' | 'transformPageData'> {
|
|
1903
1911
|
root: string;
|
|
1904
1912
|
srcDir: string;
|
|
1905
1913
|
site: SiteData<ThemeConfig>;
|
|
@@ -1907,6 +1915,7 @@ interface SiteConfig<ThemeConfig = any> extends Pick<UserConfig, 'markdown' | 'v
|
|
|
1907
1915
|
configDeps: string[];
|
|
1908
1916
|
themeDir: string;
|
|
1909
1917
|
outDir: string;
|
|
1918
|
+
assetsDir: string;
|
|
1910
1919
|
cacheDir: string;
|
|
1911
1920
|
tempDir: string;
|
|
1912
1921
|
pages: string[];
|
package/dist/node/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter } from './serve-
|
|
2
|
-
export { S as ScaffoldThemeType, k as build, j as createServer, a as defineConfig, b as defineConfigWithTheme, d as defineLoader, l as init, r as resolveConfig, i as resolvePages, h as resolveSiteData, e as resolveUserConfig, n as scaffold, s as serve } from './serve-
|
|
1
|
+
import { g as glob, c as createMarkdownRenderer, f as fs, m as matter } from './serve-98a6c925.js';
|
|
2
|
+
export { S as ScaffoldThemeType, k as build, j as createServer, a as defineConfig, b as defineConfigWithTheme, d as defineLoader, l as init, r as resolveConfig, i as resolvePages, h as resolveSiteData, e as resolveUserConfig, n as scaffold, s as serve } from './serve-98a6c925.js';
|
|
3
3
|
import path from 'path';
|
|
4
4
|
import { normalizePath } from 'vite';
|
|
5
5
|
export { loadEnv } from 'vite';
|
|
6
6
|
import 'dns';
|
|
7
|
+
import 'crypto';
|
|
7
8
|
import 'module';
|
|
8
9
|
import 'node:process';
|
|
9
10
|
import 'assert';
|
|
@@ -18,9 +19,10 @@ import 'util';
|
|
|
18
19
|
import 'url';
|
|
19
20
|
import 'fs';
|
|
20
21
|
import 'fs/promises';
|
|
21
|
-
import '
|
|
22
|
+
import 'node:events';
|
|
23
|
+
import 'node:stream';
|
|
24
|
+
import 'node:string_decoder';
|
|
22
25
|
import 'os';
|
|
23
|
-
import 'crypto';
|
|
24
26
|
import 'shiki';
|
|
25
27
|
import 'child_process';
|
|
26
28
|
import 'minisearch';
|