valaxy 0.20.5 → 0.20.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/client/components/ValaxyApp.vue +10 -10
- package/client/components/ValaxyDecrypt.vue +1 -0
- package/client/components/ValaxyGalleryDecrypt.vue +1 -0
- package/client/components/ValaxyMd.vue +3 -3
- package/client/components/builtin/ValaxyMermaid.vue +40 -41
- package/client/composables/app/useValaxyHead.ts +3 -3
- 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 +1 -1
- 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 +1 -1
- package/client/stores/app.ts +1 -1
- package/client/stores/site.ts +2 -2
- package/client/types/index.ts +1 -1
- package/client/utils/index.ts +3 -3
- package/client/utils/time.ts +3 -4
- package/dist/chunk-BQRH2D76.mjs +162 -0
- package/dist/chunk-F3UFLKIV.cjs +161 -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.d.cts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/package.json +11 -11
- package/shims.d.ts +2 -2
- package/types/config.ts +1 -1
- package/types/index.ts +3 -3
- package/dist/chunk-5CL433IL.mjs +0 -162
- package/dist/chunk-VDCJKFCV.cjs +0 -161
- 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,24 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
|
|
3
|
-
import { computed } from 'vue'
|
|
2
|
+
import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
|
|
4
3
|
// import { useHead, useSeoMeta } from '@unhead/vue'
|
|
5
4
|
import { useSeoMeta } from '@unhead/vue'
|
|
6
5
|
|
|
7
|
-
//
|
|
8
|
-
import
|
|
9
|
-
// @ts-expect-error virtual module
|
|
10
|
-
import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
|
|
11
|
-
|
|
6
|
+
// TODO: add docs to override ValaxyApp
|
|
7
|
+
import { computed } from 'vue'
|
|
12
8
|
import { useI18n } from 'vue-i18n'
|
|
13
|
-
|
|
9
|
+
|
|
10
|
+
import { useFrontmatter, useValaxyHead } from '../composables'
|
|
11
|
+
import { useTimezone } from '../composables/global'
|
|
14
12
|
|
|
15
13
|
// https://github.com/vueuse/head
|
|
16
14
|
// you can use this to manipulate the document head in any components,
|
|
17
15
|
// they will be rendered correctly in the html results with vite-ssg
|
|
18
16
|
import { useSiteConfig } from '../config'
|
|
19
|
-
import { useFrontmatter, useValaxyHead } from '../composables'
|
|
20
|
-
import { useTimezone } from '../composables/global'
|
|
21
17
|
import ValaxyAddons from './ValaxyAddons.vue'
|
|
18
|
+
// @ts-expect-error virtual module
|
|
19
|
+
import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
|
|
20
|
+
// @ts-expect-error virtual module
|
|
21
|
+
import ValaxyUserApp from '/@valaxyjs/UserAppVue'
|
|
22
22
|
|
|
23
23
|
// <link rel="apple-touch-icon" href="/pwa-192x192.png">
|
|
24
24
|
// <link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00aba9">
|
|
@@ -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,10 +1,10 @@
|
|
|
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()
|
|
@@ -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
|
|
|
@@ -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)
|
package/client/modules/pinia.ts
CHANGED
package/client/modules/valaxy.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
|
|
2
2
|
|
|
3
3
|
/*
|
|
4
4
|
* All i18n resources specified in the plugin `include` option can be loaded
|
|
@@ -8,14 +8,14 @@ import { createI18n } from 'vue-i18n'
|
|
|
8
8
|
*/
|
|
9
9
|
// import messages from '@intlify/unplugin-vue-i18n/messages'
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import type { ViteSSGContext } from 'vite-ssg'
|
|
12
12
|
|
|
13
|
-
import type { Router } from 'vue-router'
|
|
14
|
-
import { ensureSuffix } from '@antfu/utils'
|
|
15
13
|
import type { ComputedRef } from 'vue'
|
|
16
|
-
import type {
|
|
17
|
-
import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
|
|
14
|
+
import type { Router } from 'vue-router'
|
|
18
15
|
import type { PageDataPayload } from '../../types'
|
|
16
|
+
import { ensureSuffix } from '@antfu/utils'
|
|
17
|
+
import { useStorage } from '@vueuse/core'
|
|
18
|
+
import { createI18n } from 'vue-i18n'
|
|
19
19
|
|
|
20
20
|
// @ts-expect-error virtual
|
|
21
21
|
import valaxyMessages from '/@valaxyjs/locales'
|
package/client/setup/main.ts
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
/* __imports__ */
|
|
2
|
-
import type { ViteSSGContext } from 'vite-ssg'
|
|
3
|
-
import type { ComputedRef } from 'vue'
|
|
4
|
-
|
|
5
1
|
// import type { RouteMeta } from 'vue-router'
|
|
6
2
|
// fix build caused by pnpm
|
|
7
3
|
// This is likely not portable. A type annotation is necessary.
|
|
8
4
|
// https://github.com/microsoft/TypeScript/issues/42873
|
|
9
5
|
import type { DefaultTheme, ValaxyConfig } from 'valaxy/types'
|
|
6
|
+
/* __imports__ */
|
|
7
|
+
import type { ViteSSGContext } from 'vite-ssg'
|
|
8
|
+
|
|
9
|
+
import type { ComputedRef } from 'vue'
|
|
10
10
|
|
|
11
11
|
import consola from 'consola'
|
|
12
|
-
import { install as
|
|
13
|
-
import { install as installPinia } from '../modules/pinia'
|
|
12
|
+
import { install as installFloatingVue } from '../modules/floating-vue'
|
|
14
13
|
import { install as installNprogress } from '../modules/nprogress'
|
|
14
|
+
import { install as installPinia } from '../modules/pinia'
|
|
15
15
|
import { install as installSchema } from '../modules/schemaOrg'
|
|
16
|
-
import { install as
|
|
16
|
+
import { install as installValaxy } from '../modules/valaxy'
|
|
17
17
|
|
|
18
18
|
export default function setupMain(ctx: ViteSSGContext, config: ComputedRef<ValaxyConfig<DefaultTheme.Config>>) {
|
|
19
19
|
// @ts-expect-error inject in runtime
|
package/client/setup/mermaid.ts
CHANGED
package/client/setups.ts
CHANGED
package/client/stores/app.ts
CHANGED
package/client/stores/site.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { PageDataPayload } from '../../types'
|
|
2
2
|
import { acceptHMRUpdate, defineStore } from 'pinia'
|
|
3
|
+
import { computed, ref } from 'vue'
|
|
3
4
|
import { usePostList, useRouterStore } from '..'
|
|
4
|
-
import type { PageDataPayload } from '../../types'
|
|
5
5
|
import { setWindowValaxyProp } from '../utils/dev'
|
|
6
6
|
|
|
7
7
|
/**
|