valaxy 0.7.4 → 0.7.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/App.vue +0 -6
- package/client/composables/index.ts +1 -0
- package/client/composables/locale.ts +24 -0
- package/client/config.ts +2 -2
- package/client/index.ts +2 -3
- package/client/main.ts +0 -3
- package/client/setup/main.ts +7 -1
- package/client/shims.d.ts +2 -2
- package/dist/{chunk-QJZSJAAI.js → chunk-BTP4CLJN.js} +218 -218
- package/dist/{chunk-OFRGQSXQ.mjs → chunk-HP2UOVSL.mjs} +219 -219
- package/dist/{index-df0324e3.d.ts → index-df14d281.d.ts} +7 -2
- package/dist/node/cli.js +7 -7
- package/dist/node/cli.mjs +3 -3
- package/dist/node/index.d.ts +12 -5
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +1 -1
- package/index.d.ts +5 -1
- package/package.json +4 -5
- package/dist/chunk-CGQACM7C.mjs +0 -1
- package/dist/chunk-YRJYFU6Y.js +0 -1
- package/dist/client/index.d.ts +0 -183
- package/dist/client/index.js +0 -1
- package/dist/client/index.mjs +0 -1
- package/dist/index-8b96b699.d.ts +0 -14
- package/shared/index.ts +0 -21
package/client/App.vue
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import { computed } from 'vue'
|
|
3
3
|
import { useHead } from '@vueuse/head'
|
|
4
|
-
import { useCssVar } from '@vueuse/core'
|
|
5
4
|
import { isDark } from './composables'
|
|
6
5
|
|
|
7
6
|
// https://github.com/vueuse/head
|
|
@@ -27,11 +26,6 @@ useHead({
|
|
|
27
26
|
},
|
|
28
27
|
],
|
|
29
28
|
})
|
|
30
|
-
|
|
31
|
-
const bgImg = useCssVar('--yun-bg-img')
|
|
32
|
-
const bgImgUrl = computed(() => config.value.themeConfig.bg_image.url)
|
|
33
|
-
if (bgImgUrl.value)
|
|
34
|
-
bgImg.value = config.value.themeConfig.bg_image.url
|
|
35
29
|
</script>
|
|
36
30
|
|
|
37
31
|
<template>
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { isClient, useStorage } from '@vueuse/core'
|
|
2
|
+
import { useI18n } from 'vue-i18n'
|
|
3
|
+
|
|
4
|
+
export const useLocale = () => {
|
|
5
|
+
const { availableLocales, locale } = useI18n()
|
|
6
|
+
const lang = useStorage('valaxy-locale', locale.value)
|
|
7
|
+
|
|
8
|
+
const toggleLocales = () => {
|
|
9
|
+
// change to some real logic
|
|
10
|
+
const locales = availableLocales
|
|
11
|
+
|
|
12
|
+
locale.value = locales[(locales.indexOf(locale.value) + 1) % locales.length]
|
|
13
|
+
// for localStorage
|
|
14
|
+
lang.value = locale.value
|
|
15
|
+
|
|
16
|
+
if (isClient)
|
|
17
|
+
document.documentElement.setAttribute('lang', locale.value)
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
lang,
|
|
22
|
+
toggleLocales,
|
|
23
|
+
}
|
|
24
|
+
}
|
package/client/config.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// @ts-expect-error virtual module @valaxyjs/config
|
|
2
|
-
import valaxyConfig from '
|
|
2
|
+
import valaxyConfig from '/@valaxyjs/config'
|
|
3
3
|
// @ts-expect-error virtual module @valaxyjs/context
|
|
4
|
-
import valaxyContext from '
|
|
4
|
+
import valaxyContext from '/@valaxyjs/context'
|
|
5
5
|
import type { ComputedRef, InjectionKey, Ref } from 'vue'
|
|
6
6
|
import { computed, inject, readonly, shallowRef } from 'vue'
|
|
7
7
|
// import type { RouteMeta } from 'vue-router'
|
package/client/index.ts
CHANGED
package/client/main.ts
CHANGED
package/client/setup/main.ts
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
/* __imports__ */
|
|
2
|
-
|
|
3
2
|
import type { ViteSSGContext } from 'vite-ssg'
|
|
3
|
+
import { install as installValaxy } from '../modules/valaxy'
|
|
4
|
+
import { install as installPinia } from '../modules/pinia'
|
|
5
|
+
import { install as installNprogress } from '../modules/nprogress'
|
|
4
6
|
|
|
5
7
|
export default function setupMain(ctx: ViteSSGContext) {
|
|
6
8
|
// @ts-expect-error inject in runtime
|
|
7
9
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
10
|
const injection_arg = ctx
|
|
9
11
|
|
|
12
|
+
installValaxy(ctx)
|
|
13
|
+
installPinia(ctx)
|
|
14
|
+
installNprogress(ctx)
|
|
15
|
+
|
|
10
16
|
/* __injections__ */
|
|
11
17
|
}
|
package/client/shims.d.ts
CHANGED
|
@@ -17,13 +17,13 @@ declare module '*.vue' {
|
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
// vite hmr data
|
|
20
|
-
declare module '
|
|
20
|
+
declare module '/@valaxyjs/config' {
|
|
21
21
|
// import type { ValaxyConfig } from 'valaxy'
|
|
22
22
|
const config: string
|
|
23
23
|
export default config
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
declare module '
|
|
26
|
+
declare module '/@valaxyjs/context' {
|
|
27
27
|
const ctx: string
|
|
28
28
|
export default ctx
|
|
29
29
|
}
|