valaxy 0.20.5 → 0.20.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/client/components/ValaxyApp.vue +10 -11
- package/client/components/ValaxyDecrypt.vue +9 -7
- package/client/components/ValaxyGalleryDecrypt.vue +1 -0
- package/client/components/ValaxyLogo.vue +5 -1
- package/client/components/ValaxyMd.vue +3 -3
- package/client/components/builtin/ValaxyMermaid.vue +40 -41
- package/client/composables/app/useValaxyHead.ts +13 -6
- package/client/composables/categories.ts +1 -1
- package/client/composables/codeGroups.ts +1 -1
- package/client/composables/collections.ts +1 -1
- package/client/composables/common.ts +3 -3
- package/client/composables/features/collapse-code.ts +1 -1
- package/client/composables/features/copy-code.ts +1 -0
- package/client/composables/features/index.ts +1 -1
- package/client/composables/helper/useInvisibleElement.ts +1 -1
- package/client/composables/index.ts +10 -10
- package/client/composables/locale.ts +4 -3
- package/client/composables/outline/anchor.ts +9 -8
- package/client/composables/outline/headers.ts +3 -3
- package/client/composables/outline/index.ts +1 -1
- package/client/composables/post/index.ts +3 -3
- package/client/composables/search/useFuseSearch.ts +4 -4
- package/client/composables/tags.ts +1 -1
- package/client/composables/widgets/aplayer.ts +1 -1
- package/client/config.ts +8 -8
- package/client/index.ts +5 -5
- package/client/main.ts +15 -15
- package/client/modules/devtools.ts +1 -1
- package/client/modules/floating-vue.ts +3 -3
- package/client/modules/mermaid.ts +3 -3
- package/client/modules/nprogress.ts +1 -1
- package/client/modules/pinia.ts +1 -1
- package/client/modules/schemaOrg.ts +1 -1
- package/client/modules/valaxy.ts +6 -6
- package/client/setup/main.ts +7 -7
- package/client/setup/mermaid.ts +1 -1
- package/client/setups.ts +2 -2
- package/client/stores/app.ts +1 -1
- package/client/stores/site.ts +2 -2
- package/client/styles/common/markdown.scss +4 -4
- package/client/styles/index.scss +0 -1
- package/client/types/index.ts +1 -1
- package/client/utils/index.ts +3 -3
- package/client/utils/time.ts +3 -4
- package/dist/chunk-JOSLTXIR.cjs +161 -0
- package/dist/chunk-LB5BBIUM.mjs +162 -0
- package/dist/node/cli/index.cjs +1 -1
- package/dist/node/cli/index.mjs +1 -1
- package/dist/node/index.cjs +1 -1
- package/dist/node/index.d.cts +86 -86
- package/dist/node/index.d.ts +86 -86
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.mjs +1 -1
- package/package.json +23 -23
- package/shims.d.ts +2 -2
- package/types/config.ts +1 -1
- package/types/index.ts +3 -3
- package/client/styles/common/scrollbar.scss +0 -30
- package/dist/chunk-5CL433IL.mjs +0 -162
- package/dist/chunk-VDCJKFCV.cjs +0 -161
- package/dist/{chunk-6GE64PZD.cjs → chunk-BJ22GQI6.cjs} +0 -0
- package/dist/{chunk-WE2LNW3F.mjs → chunk-XKANGEKW.mjs} +0 -0
- package/dist/{config-DfXD9Gt_.d.cts → config-Dxu7i2Zs.d.cts} +1 -1
- package/dist/{config-DfXD9Gt_.d.ts → config-Dxu7i2Zs.d.ts} +1 -1
|
@@ -1,24 +1,23 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
import { computed } from 'vue'
|
|
4
|
-
// import { useHead, useSeoMeta } from '@unhead/vue'
|
|
2
|
+
import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
|
|
5
3
|
import { useSeoMeta } from '@unhead/vue'
|
|
6
4
|
|
|
7
|
-
//
|
|
8
|
-
import
|
|
9
|
-
// @ts-expect-error virtual module
|
|
10
|
-
import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
|
|
11
|
-
|
|
5
|
+
// TODO: add docs to override ValaxyApp
|
|
6
|
+
import { computed } from 'vue'
|
|
12
7
|
import { useI18n } from 'vue-i18n'
|
|
13
|
-
|
|
8
|
+
|
|
9
|
+
import { useFrontmatter, useValaxyHead } from '../composables'
|
|
10
|
+
import { useTimezone } from '../composables/global'
|
|
14
11
|
|
|
15
12
|
// https://github.com/vueuse/head
|
|
16
13
|
// you can use this to manipulate the document head in any components,
|
|
17
14
|
// they will be rendered correctly in the html results with vite-ssg
|
|
18
15
|
import { useSiteConfig } from '../config'
|
|
19
|
-
import { useFrontmatter, useValaxyHead } from '../composables'
|
|
20
|
-
import { useTimezone } from '../composables/global'
|
|
21
16
|
import ValaxyAddons from './ValaxyAddons.vue'
|
|
17
|
+
// @ts-expect-error virtual module
|
|
18
|
+
import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
|
|
19
|
+
// @ts-expect-error virtual module
|
|
20
|
+
import ValaxyUserApp from '/@valaxyjs/UserAppVue'
|
|
22
21
|
|
|
23
22
|
// <link rel="apple-touch-icon" href="/pwa-192x192.png">
|
|
24
23
|
// <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00aba9">
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
2
|
import { runContentUpdated, useDecrypt, useFrontmatter } from 'valaxy'
|
|
3
|
-
import { defineComponent, h,
|
|
3
|
+
import { computed, defineComponent, h, ref } from 'vue'
|
|
4
4
|
|
|
5
5
|
const props = defineProps<{
|
|
6
6
|
encryptedContent: string
|
|
7
|
+
hint?: string
|
|
7
8
|
}>()
|
|
8
9
|
|
|
9
10
|
const password = ref('')
|
|
@@ -26,6 +27,7 @@ async function decryptContent() {
|
|
|
26
27
|
}
|
|
27
28
|
catch (e) {
|
|
28
29
|
hasError.value = true
|
|
30
|
+
console.error(e)
|
|
29
31
|
}
|
|
30
32
|
}
|
|
31
33
|
|
|
@@ -57,11 +59,7 @@ const ValaxyDeprecatedContent = defineComponent({
|
|
|
57
59
|
},
|
|
58
60
|
})
|
|
59
61
|
|
|
60
|
-
const hasWarning =
|
|
61
|
-
onMounted(() => {
|
|
62
|
-
if (location.protocol !== 'https:')
|
|
63
|
-
hasWarning.value = true
|
|
64
|
-
})
|
|
62
|
+
const hasWarning = computed(() => location.protocol !== 'https:')
|
|
65
63
|
</script>
|
|
66
64
|
|
|
67
65
|
<template>
|
|
@@ -82,13 +80,17 @@ onMounted(() => {
|
|
|
82
80
|
@keyup.enter="decryptContent"
|
|
83
81
|
>
|
|
84
82
|
<div
|
|
83
|
+
class="text-gray/70 hover:text-gray transition"
|
|
85
84
|
cursor-pointer
|
|
86
85
|
absolute text-2xl
|
|
87
86
|
i-ri-arrow-right-circle-line right-3
|
|
88
|
-
text-gray hover:text-black
|
|
89
87
|
@click="decryptContent"
|
|
90
88
|
/>
|
|
91
89
|
|
|
90
|
+
<div v-if="hint" class="-top-6" absolute text-xs op="50">
|
|
91
|
+
<div v-html="hint" />
|
|
92
|
+
</div>
|
|
93
|
+
|
|
92
94
|
<div v-if="hasWarning" class="-bottom-6" absolute text-xs op="50">
|
|
93
95
|
<a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Crypto_API" target="_blank">
|
|
94
96
|
<span>Web Crypto API</span>
|
|
@@ -5,7 +5,11 @@ import valaxyLogoPng from '../assets/images/valaxy-logo.png'
|
|
|
5
5
|
<template>
|
|
6
6
|
<div class="valaxy-logo-container" relative inline-flex justify="center" items="center">
|
|
7
7
|
<div class="absolute bg-img" />
|
|
8
|
-
<img
|
|
8
|
+
<img
|
|
9
|
+
class="fly-animation h-50"
|
|
10
|
+
aspect="420/386" m="auto"
|
|
11
|
+
:src="valaxyLogoPng" alt="Valaxy Logo" z="1"
|
|
12
|
+
>
|
|
9
13
|
</div>
|
|
10
14
|
</template>
|
|
11
15
|
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
+
import type { Post } from 'valaxy'
|
|
3
|
+
import { onContentUpdated, runContentUpdated, useAplayer, useCodePen, useCollapseCode, useCopyCode, useMediumZoom, wrapTable } from 'valaxy'
|
|
2
4
|
import { onMounted, onUpdated, ref } from 'vue'
|
|
3
5
|
import { useI18n } from 'vue-i18n'
|
|
4
|
-
import { onContentUpdated, runContentUpdated, useAplayer, useCodePen, useCollapseCode, useCopyCode, useMediumZoom, wrapTable } from 'valaxy'
|
|
5
|
-
import type { Post } from 'valaxy'
|
|
6
|
-
import { useVanillaLazyLoad } from '../composables/features/vanilla-lazyload'
|
|
7
6
|
import { useCodeGroups } from '../composables/codeGroups'
|
|
7
|
+
import { useVanillaLazyLoad } from '../composables/features/vanilla-lazyload'
|
|
8
8
|
|
|
9
9
|
const props = defineProps<{
|
|
10
10
|
frontmatter: Post
|
|
@@ -13,10 +13,10 @@ pie
|
|
|
13
13
|
-->
|
|
14
14
|
|
|
15
15
|
<script setup lang="ts">
|
|
16
|
-
import { getCurrentInstance, ref, watch, watchEffect } from 'vue'
|
|
17
|
-
|
|
18
16
|
import { isClient } from '@vueuse/core'
|
|
17
|
+
|
|
19
18
|
import { useAppStore } from 'valaxy'
|
|
19
|
+
import { getCurrentInstance, ref, watch, watchEffect } from 'vue'
|
|
20
20
|
import { renderMermaid } from '../../modules/mermaid'
|
|
21
21
|
import ShadowRoot from '../internals/ShadowRoot.vue'
|
|
22
22
|
|
|
@@ -34,51 +34,50 @@ const appStore = useAppStore()
|
|
|
34
34
|
|
|
35
35
|
if (isClient) {
|
|
36
36
|
// dynamic import to reduce initial bundle size
|
|
37
|
-
import('mermaid').then(m => m.default)
|
|
38
|
-
.
|
|
39
|
-
|
|
40
|
-
mermaid.initialize({ startOnLoad: false })
|
|
37
|
+
import('mermaid').then(m => m.default).then((mermaid) => {
|
|
38
|
+
mermaid.startOnLoad = false
|
|
39
|
+
mermaid.initialize({ startOnLoad: false })
|
|
41
40
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
})
|
|
47
|
-
const svg = await renderMermaid(
|
|
48
|
-
mermaid,
|
|
49
|
-
props.code || '',
|
|
50
|
-
{
|
|
51
|
-
theme: props.theme || (appStore.isDark ? 'dark' : undefined),
|
|
52
|
-
...vm!.attrs,
|
|
53
|
-
},
|
|
54
|
-
)
|
|
55
|
-
if (!disposed)
|
|
56
|
-
html.value = svg
|
|
41
|
+
watchEffect(async (onCleanup) => {
|
|
42
|
+
let disposed = false
|
|
43
|
+
onCleanup(() => {
|
|
44
|
+
disposed = true
|
|
57
45
|
})
|
|
46
|
+
const svg = await renderMermaid(
|
|
47
|
+
mermaid,
|
|
48
|
+
props.code || '',
|
|
49
|
+
{
|
|
50
|
+
theme: props.theme || (appStore.isDark ? 'dark' : undefined),
|
|
51
|
+
...vm!.attrs,
|
|
52
|
+
},
|
|
53
|
+
)
|
|
54
|
+
if (!disposed)
|
|
55
|
+
html.value = svg
|
|
56
|
+
})
|
|
58
57
|
|
|
59
|
-
|
|
58
|
+
const actualHeight = ref<number>()
|
|
60
59
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
watch(html, () => {
|
|
61
|
+
actualHeight.value = undefined
|
|
62
|
+
})
|
|
64
63
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
64
|
+
watchEffect(() => {
|
|
65
|
+
const svgEl = el.value?.children?.[0] as SVGElement | undefined
|
|
66
|
+
if (svgEl && svgEl.hasAttribute('viewBox') && actualHeight.value == null) {
|
|
67
|
+
const v = Number.parseFloat(svgEl.getAttribute('viewBox')?.split(' ')[3] || '')
|
|
68
|
+
actualHeight.value = Number.isNaN(v) ? undefined : v
|
|
69
|
+
}
|
|
70
|
+
}, { flush: 'post' })
|
|
72
71
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
72
|
+
watchEffect(() => {
|
|
73
|
+
const svgEl = el.value?.children?.[0] as SVGElement | undefined
|
|
74
|
+
if (svgEl != null && props.scale != null && actualHeight.value != null) {
|
|
75
|
+
svgEl.setAttribute('height', `${actualHeight.value * props.scale}`)
|
|
76
|
+
svgEl.removeAttribute('width')
|
|
77
|
+
svgEl.removeAttribute('style')
|
|
78
|
+
}
|
|
79
|
+
}, { flush: 'post' })
|
|
80
|
+
})
|
|
82
81
|
}
|
|
83
82
|
</script>
|
|
84
83
|
|
|
@@ -1,20 +1,22 @@
|
|
|
1
|
-
import { computed } from 'vue'
|
|
2
|
-
import pkg from 'valaxy/package.json'
|
|
3
1
|
import { useHead } from '@unhead/vue'
|
|
2
|
+
import pkg from 'valaxy/package.json'
|
|
3
|
+
import { computed } from 'vue'
|
|
4
4
|
import { useI18n } from 'vue-i18n'
|
|
5
5
|
|
|
6
|
-
import { useSiteConfig } from '../../config'
|
|
7
6
|
import { useFrontmatter } from '../../composables'
|
|
7
|
+
import { useSiteConfig } from '../../config'
|
|
8
8
|
|
|
9
9
|
export function useValaxyHead() {
|
|
10
10
|
const { locale } = useI18n()
|
|
11
11
|
|
|
12
12
|
const fm = useFrontmatter()
|
|
13
13
|
const siteConfig = useSiteConfig()
|
|
14
|
-
const title = computed(() => fm.value[`title_${locale.value}`] || fm.value.title)
|
|
14
|
+
const title = computed<string>(() => fm.value[`title_${locale.value}`] || fm.value.title)
|
|
15
15
|
useHead({
|
|
16
16
|
title,
|
|
17
|
-
titleTemplate:
|
|
17
|
+
titleTemplate: (title) => {
|
|
18
|
+
return fm.value.titleTemplate || (title ? `${title} - ${siteConfig.value.title}` : siteConfig.value.title)
|
|
19
|
+
},
|
|
18
20
|
link: [
|
|
19
21
|
{
|
|
20
22
|
rel: 'icon',
|
|
@@ -23,7 +25,12 @@ export function useValaxyHead() {
|
|
|
23
25
|
},
|
|
24
26
|
],
|
|
25
27
|
meta: [
|
|
26
|
-
|
|
28
|
+
computed(() => {
|
|
29
|
+
return {
|
|
30
|
+
name: 'description',
|
|
31
|
+
content: fm.value.description || siteConfig.value.description,
|
|
32
|
+
}
|
|
33
|
+
}),
|
|
27
34
|
{
|
|
28
35
|
name: 'generator',
|
|
29
36
|
content: `Valaxy ${pkg.version}`,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { computed, inject } from 'vue'
|
|
1
|
+
import type { PageData, PostFrontMatter } from 'valaxy/types'
|
|
3
2
|
import { isClient } from '@vueuse/core'
|
|
3
|
+
import { computed, inject } from 'vue'
|
|
4
4
|
|
|
5
|
-
import
|
|
5
|
+
import { useRoute } from 'vue-router'
|
|
6
6
|
import { useSiteConfig } from '../config'
|
|
7
7
|
|
|
8
8
|
/**
|
|
@@ -1,25 +1,25 @@
|
|
|
1
|
+
// app
|
|
2
|
+
export * from './app'
|
|
3
|
+
// utils
|
|
4
|
+
export * from './back'
|
|
1
5
|
// for classify
|
|
2
6
|
export * from './categories'
|
|
3
|
-
export * from './post'
|
|
4
|
-
export * from './tags'
|
|
5
7
|
export * from './collections'
|
|
6
8
|
|
|
7
9
|
// common
|
|
8
10
|
export * from './common'
|
|
11
|
+
export * from './dark'
|
|
12
|
+
export * from './decrypt'
|
|
9
13
|
export * from './features'
|
|
10
14
|
export * from './helper'
|
|
11
|
-
export * from './dark'
|
|
12
15
|
export * from './layout'
|
|
13
|
-
export * from './widgets'
|
|
14
16
|
export * from './locale'
|
|
15
17
|
|
|
16
|
-
export * from './sidebar'
|
|
17
18
|
export * from './outline'
|
|
19
|
+
export * from './post'
|
|
18
20
|
|
|
19
|
-
// utils
|
|
20
|
-
export * from './back'
|
|
21
|
-
export * from './decrypt'
|
|
22
21
|
export * from './search'
|
|
22
|
+
export * from './sidebar'
|
|
23
|
+
export * from './tags'
|
|
23
24
|
|
|
24
|
-
|
|
25
|
-
export * from './app'
|
|
25
|
+
export * from './widgets'
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { isClient, useStorage } from '@vueuse/core'
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { zhCN } from 'date-fns/locale/zh-CN'
|
|
2
|
+
import { setDefaultOptions } from 'date-fns'
|
|
3
|
+
// not optimize deps all locales
|
|
5
4
|
import { enUS } from 'date-fns/locale/en-US'
|
|
5
|
+
import { zhCN } from 'date-fns/locale/zh-CN'
|
|
6
|
+
import { useI18n } from 'vue-i18n'
|
|
6
7
|
|
|
7
8
|
export function useLocale() {
|
|
8
9
|
const { availableLocales, locale } = useI18n()
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Ref } from 'vue'
|
|
2
|
-
import { onMounted, onUnmounted, onUpdated } from 'vue'
|
|
3
2
|
import { resolvedHeaders } from '@valaxyjs/utils'
|
|
3
|
+
import { onMounted, onUnmounted, onUpdated } from 'vue'
|
|
4
4
|
import { throttleAndDebounce } from '../../utils'
|
|
5
5
|
import { useAside } from '../aside'
|
|
6
6
|
|
|
@@ -47,6 +47,10 @@ export function useActiveAnchor(
|
|
|
47
47
|
window.removeEventListener('scroll', onScroll)
|
|
48
48
|
})
|
|
49
49
|
|
|
50
|
+
/**
|
|
51
|
+
* 长目录自动滚动
|
|
52
|
+
* @TODO add e2e test
|
|
53
|
+
*/
|
|
50
54
|
const checkActiveLinkInViewport = () => {
|
|
51
55
|
const activeLink = prevActiveLink
|
|
52
56
|
if (!activeLink) {
|
|
@@ -54,15 +58,12 @@ export function useActiveAnchor(
|
|
|
54
58
|
return
|
|
55
59
|
}
|
|
56
60
|
|
|
57
|
-
const top = activeLink.getBoundingClientRect().top
|
|
58
|
-
const bottom = activeLink.getBoundingClientRect().bottom
|
|
59
|
-
|
|
60
61
|
const parentEl = document.querySelector('.yun-aside') as HTMLElement
|
|
61
62
|
if (parentEl) {
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
if (
|
|
65
|
-
parentEl.scrollTo({ top
|
|
63
|
+
// 超出
|
|
64
|
+
const top = activeLink.offsetTop + topOffset + 60
|
|
65
|
+
if (top < parentEl.scrollTop || (top > parentEl.offsetHeight + parentEl.scrollTop))
|
|
66
|
+
parentEl.scrollTo({ top, behavior: 'smooth' })
|
|
66
67
|
}
|
|
67
68
|
}
|
|
68
69
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { computed, shallowRef } from 'vue'
|
|
2
|
-
import type { DefaultTheme } from 'valaxy/types'
|
|
3
1
|
import type { MenuItem } from '@valaxyjs/utils'
|
|
2
|
+
import type { DefaultTheme } from 'valaxy/types'
|
|
4
3
|
import { getHeaders } from '@valaxyjs/utils'
|
|
5
|
-
import {
|
|
4
|
+
import { computed, shallowRef } from 'vue'
|
|
6
5
|
import { useFrontmatter, useThemeConfig } from '../..'
|
|
6
|
+
import { onContentUpdated } from '../../utils'
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* export headers & handleClick to generate outline
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
+
import type { Post } from 'valaxy'
|
|
1
2
|
import type { ComputedRef } from 'vue'
|
|
2
3
|
import { computed } from 'vue'
|
|
3
4
|
import { useI18n } from 'vue-i18n'
|
|
4
|
-
import type { Post } from 'valaxy'
|
|
5
|
-
import { sortByDate } from '../../utils'
|
|
6
5
|
import { useRouterStore } from '../../stores'
|
|
6
|
+
import { sortByDate } from '../../utils'
|
|
7
7
|
|
|
8
|
-
export * from './usePrevNext'
|
|
9
8
|
export * from './usePagination'
|
|
9
|
+
export * from './usePrevNext'
|
|
10
10
|
|
|
11
11
|
export function usePostTitle(post: ComputedRef<Post>) {
|
|
12
12
|
const { locale } = useI18n()
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { computed, shallowRef } from 'vue'
|
|
2
|
-
import { useSiteConfig } from 'valaxy'
|
|
3
|
-
import type { MaybeRefOrGetter } from '@vueuse/shared'
|
|
4
1
|
import type { UseFuseOptions } from '@vueuse/integrations/useFuse'
|
|
5
|
-
import {
|
|
2
|
+
import type { MaybeRefOrGetter } from '@vueuse/shared'
|
|
6
3
|
import type { FuseListItem } from 'valaxy/types'
|
|
4
|
+
import { useFuse } from '@vueuse/integrations/useFuse'
|
|
5
|
+
import { useSiteConfig } from 'valaxy'
|
|
6
|
+
import { computed, shallowRef } from 'vue'
|
|
7
7
|
|
|
8
8
|
export function useFuseSearch<T extends FuseListItem = FuseListItem>(
|
|
9
9
|
search: MaybeRefOrGetter<string>,
|
package/client/config.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
// @ts-expect-error virtual module @valaxyjs/config
|
|
2
|
-
import valaxyConfig from '/@valaxyjs/config'
|
|
3
|
-
|
|
4
|
-
// @ts-expect-error virtual module @valaxyjs/context
|
|
5
|
-
import valaxyContext from '/@valaxyjs/context'
|
|
6
|
-
import type { ComputedRef, InjectionKey } from 'vue'
|
|
7
|
-
import { computed, inject, readonly, shallowRef } from 'vue'
|
|
8
|
-
|
|
9
1
|
// import type { RouteMeta } from 'vue-router'
|
|
10
2
|
// fix build caused by pnpm
|
|
11
3
|
// This is likely not portable. A type annotation is necessary.
|
|
12
4
|
// https://github.com/microsoft/TypeScript/issues/42873
|
|
13
5
|
import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
|
|
14
6
|
|
|
7
|
+
import type { ComputedRef, InjectionKey } from 'vue'
|
|
8
|
+
import { computed, inject, readonly, shallowRef } from 'vue'
|
|
9
|
+
// @ts-expect-error virtual module @valaxyjs/config
|
|
10
|
+
import valaxyConfig from '/@valaxyjs/config'
|
|
11
|
+
|
|
12
|
+
// @ts-expect-error virtual module @valaxyjs/context
|
|
13
|
+
import valaxyContext from '/@valaxyjs/context'
|
|
14
|
+
|
|
15
15
|
/**
|
|
16
16
|
* parse valaxy config
|
|
17
17
|
* @param data
|
package/client/index.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export * from './addons'
|
|
2
|
+
export * from './composables'
|
|
3
|
+
|
|
2
4
|
export * from './config'
|
|
3
5
|
|
|
4
6
|
// extend define
|
|
5
7
|
export * from './define'
|
|
8
|
+
export * from './setups'
|
|
6
9
|
|
|
7
|
-
export * from './composables'
|
|
8
10
|
export * from './stores'
|
|
9
11
|
|
|
10
|
-
export * from './utils'
|
|
11
|
-
|
|
12
|
-
export * from './setups'
|
|
13
|
-
|
|
14
12
|
export * from './types'
|
|
15
13
|
|
|
14
|
+
export * from './utils'
|
|
15
|
+
|
|
16
16
|
// child packages
|
|
17
17
|
export * from '@valaxyjs/utils'
|
package/client/main.ts
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
import type { ViteSSGContext } from 'vite-ssg'
|
|
2
|
+
import { initValaxyConfig, valaxyConfigSymbol } from 'valaxy'
|
|
3
|
+
import { setupLayouts } from 'virtual:generated-layouts'
|
|
4
|
+
import { ViteSSG } from 'vite-ssg'
|
|
5
|
+
import { routes } from 'vue-router/auto-routes'
|
|
6
|
+
|
|
7
|
+
// import App from '/@valaxyjs/App.vue'
|
|
8
|
+
import App from './App.vue'
|
|
9
|
+
import AppLink from './components/AppLink.vue'
|
|
10
|
+
|
|
11
|
+
import setupMain from './setup/main'
|
|
12
|
+
import { setupValaxyDevTools } from './utils/dev'
|
|
13
|
+
|
|
1
14
|
// reset styles, load css before app
|
|
2
15
|
// import '@unocss/reset/tailwind.css'
|
|
3
16
|
// https://unocss.dev/guide/style-reset#tailwind-compat
|
|
@@ -5,26 +18,13 @@
|
|
|
5
18
|
import '@unocss/reset/tailwind-compat.css'
|
|
6
19
|
// css
|
|
7
20
|
import './styles/css/css-vars.css'
|
|
21
|
+
|
|
8
22
|
import './styles/css/main.css'
|
|
23
|
+
|
|
9
24
|
// generate user styles
|
|
10
25
|
import '/@valaxyjs/styles'
|
|
11
26
|
import 'uno.css'
|
|
12
27
|
|
|
13
|
-
import type { ViteSSGContext } from 'vite-ssg'
|
|
14
|
-
import { ViteSSG } from 'vite-ssg'
|
|
15
|
-
|
|
16
|
-
import { routes } from 'vue-router/auto-routes'
|
|
17
|
-
import { setupLayouts } from 'virtual:generated-layouts'
|
|
18
|
-
|
|
19
|
-
import { initValaxyConfig, valaxyConfigSymbol } from 'valaxy'
|
|
20
|
-
import AppLink from './components/AppLink.vue'
|
|
21
|
-
|
|
22
|
-
// import App from '/@valaxyjs/App.vue'
|
|
23
|
-
import App from './App.vue'
|
|
24
|
-
|
|
25
|
-
import setupMain from './setup/main'
|
|
26
|
-
import { setupValaxyDevTools } from './utils/dev'
|
|
27
|
-
|
|
28
28
|
const valaxyConfig = initValaxyConfig()
|
|
29
29
|
|
|
30
30
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { UserModule } from '../types'
|
|
2
2
|
|
|
3
|
-
import valaxyLogo from '../assets/images/valaxy-logo.png'
|
|
4
3
|
import pkg from '../../package.json'
|
|
4
|
+
import valaxyLogo from '../assets/images/valaxy-logo.png'
|
|
5
5
|
|
|
6
6
|
// import {addCustomCommand, addCustomTab } from '@vue/devtools-api'
|
|
7
7
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import
|
|
1
|
+
import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
|
|
2
2
|
import type { ViteSSGContext } from 'vite-ssg'
|
|
3
3
|
|
|
4
|
-
import 'floating-vue/dist/style.css'
|
|
5
|
-
import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
|
|
6
4
|
import type { ComputedRef } from 'vue'
|
|
5
|
+
import FloatingVue from 'floating-vue'
|
|
6
|
+
import 'floating-vue/dist/style.css'
|
|
7
7
|
|
|
8
8
|
export async function install({ app }: ViteSSGContext, config: ComputedRef<ValaxyConfig<DefaultTheme.Config>>) {
|
|
9
9
|
// @see https://floating-vue.starpad.dev/guide/config#default-values
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { customAlphabet } from 'nanoid'
|
|
2
|
-
import { decode } from 'js-base64'
|
|
3
|
-
import { clearUndefined } from '@antfu/utils'
|
|
4
1
|
import type { Mermaid } from 'mermaid'
|
|
2
|
+
import { clearUndefined } from '@antfu/utils'
|
|
3
|
+
import { decode } from 'js-base64'
|
|
4
|
+
import { customAlphabet } from 'nanoid'
|
|
5
5
|
import setupMermaid from '../setup/mermaid'
|
|
6
6
|
|
|
7
7
|
const nanoid = customAlphabet('abcedfghicklmn', 10)
|