valaxy 0.18.6 → 0.18.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 +1 -7
- package/client/composables/index.ts +0 -1
- package/client/composables/locale.ts +6 -5
- package/client/locales/zh-CN.yml +1 -1
- package/client/setup/main.ts +0 -11
- package/client/styles/palette.scss +2 -2
- package/client/utils/time.ts +4 -8
- package/dist/chunk-RVJR5LVN.mjs +149 -0
- package/dist/chunk-Z7ZWNIK2.cjs +148 -0
- package/dist/{config-BqkMQ-w8.d.cts → config-Kdq8Mya1.d.cts} +14 -1
- package/dist/{config-BqkMQ-w8.d.ts → config-Kdq8Mya1.d.ts} +14 -1
- 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 +9 -5
- package/dist/node/index.d.ts +9 -5
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.cjs +1 -1
- package/dist/types/index.d.cts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.mjs +1 -1
- package/package.json +27 -26
- package/types/config.ts +14 -1
- package/client/composables/body-scroll-lock.ts +0 -17
- package/dist/chunk-VQ75V4CX.mjs +0 -149
- package/dist/chunk-Z6VKLD6E.cjs +0 -148
- /package/dist/{chunk-NC2VW3FJ.mjs → chunk-A5LNZCPK.mjs} +0 -0
- /package/dist/{chunk-TA326ETE.cjs → chunk-TEJFRXY5.cjs} +0 -0
package/client/App.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { computed
|
|
2
|
+
import { computed } from 'vue'
|
|
3
3
|
import { useHead, useSeoMeta } from '@unhead/vue'
|
|
4
4
|
|
|
5
5
|
// @ts-expect-error virtual module
|
|
@@ -10,7 +10,6 @@ import ValaxyThemeApp from '/@valaxyjs/ThemeAppVue'
|
|
|
10
10
|
import pkg from 'valaxy/package.json'
|
|
11
11
|
import { useI18n } from 'vue-i18n'
|
|
12
12
|
import { definePerson, defineWebPage, defineWebSite, useSchemaOrg } from '@unhead/schema-org'
|
|
13
|
-
import dayjs from 'dayjs'
|
|
14
13
|
|
|
15
14
|
// https://github.com/vueuse/head
|
|
16
15
|
// you can use this to manipulate the document head in any components,
|
|
@@ -97,11 +96,6 @@ useSchemaOrg([
|
|
|
97
96
|
}),
|
|
98
97
|
defineWebPage(),
|
|
99
98
|
])
|
|
100
|
-
|
|
101
|
-
onBeforeMount(() => {
|
|
102
|
-
if (siteConfig.value.timezone)
|
|
103
|
-
dayjs.tz.setDefault(siteConfig.value.timezone)
|
|
104
|
-
})
|
|
105
99
|
</script>
|
|
106
100
|
|
|
107
101
|
<template>
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { isClient, useStorage } from '@vueuse/core'
|
|
2
2
|
import { useI18n } from 'vue-i18n'
|
|
3
|
-
import
|
|
4
|
-
import '
|
|
3
|
+
import { setDefaultOptions } from 'date-fns'
|
|
4
|
+
import { enUS, zhCN } from 'date-fns/locale'
|
|
5
5
|
|
|
6
6
|
export function useLocale() {
|
|
7
7
|
const { availableLocales, locale } = useI18n()
|
|
8
8
|
const lang = useStorage('valaxy-locale', locale.value)
|
|
9
|
-
|
|
9
|
+
// set date locale
|
|
10
|
+
setDefaultOptions({ locale: locale.value === 'zh-CN' ? zhCN : enUS })
|
|
10
11
|
|
|
11
12
|
const toggleLocales = () => {
|
|
12
13
|
// change to some real logic
|
|
@@ -16,8 +17,8 @@ export function useLocale() {
|
|
|
16
17
|
// for localStorage
|
|
17
18
|
lang.value = locale.value
|
|
18
19
|
|
|
19
|
-
// set
|
|
20
|
-
|
|
20
|
+
// set date locale
|
|
21
|
+
setDefaultOptions({ locale: locale.value === 'zh-CN' ? zhCN : enUS })
|
|
21
22
|
|
|
22
23
|
if (isClient)
|
|
23
24
|
document.documentElement.setAttribute('lang', locale.value)
|
package/client/locales/zh-CN.yml
CHANGED
package/client/setup/main.ts
CHANGED
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
/* __imports__ */
|
|
2
2
|
import type { ViteSSGContext } from 'vite-ssg'
|
|
3
|
-
|
|
4
|
-
import dayjs from 'dayjs'
|
|
5
|
-
import relativeTime from 'dayjs/plugin/relativeTime'
|
|
6
|
-
import utc from 'dayjs/plugin/utc'
|
|
7
|
-
import timezone from 'dayjs/plugin/timezone'
|
|
8
|
-
|
|
9
3
|
import type { ComputedRef } from 'vue'
|
|
10
4
|
|
|
11
5
|
// import type { RouteMeta } from 'vue-router'
|
|
@@ -32,11 +26,6 @@ export default function setupMain(ctx: ViteSSGContext, config: ComputedRef<Valax
|
|
|
32
26
|
installPinia(ctx)
|
|
33
27
|
installNprogress(ctx)
|
|
34
28
|
|
|
35
|
-
// dayjs
|
|
36
|
-
dayjs.extend(relativeTime)
|
|
37
|
-
dayjs.extend(utc)
|
|
38
|
-
dayjs.extend(timezone)
|
|
39
|
-
|
|
40
29
|
if (import.meta.env.DEV && ctx.isClient) {
|
|
41
30
|
import('../modules/devtools').then(({ install: installDevtools }) => {
|
|
42
31
|
setTimeout(() => {
|
|
@@ -33,8 +33,8 @@ $colors: map.merge(
|
|
|
33
33
|
$c-primary: map.get($colors, "primary") !default;
|
|
34
34
|
$colors: map.merge(
|
|
35
35
|
(
|
|
36
|
-
"primary-light": color.adjust($c-primary, $lightness:
|
|
37
|
-
"primary-lighter": color.adjust($c-primary, $lightness:
|
|
36
|
+
"primary-light": color.adjust($c-primary, $lightness: 10%),
|
|
37
|
+
"primary-lighter": color.adjust($c-primary, $lightness: 20%),
|
|
38
38
|
"primary-dark": color.adjust($c-primary, $lightness: -5%),
|
|
39
39
|
),
|
|
40
40
|
$colors
|
package/client/utils/time.ts
CHANGED
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import timezone from 'dayjs/plugin/timezone'
|
|
1
|
+
import { format } from 'date-fns'
|
|
3
2
|
import type { Post } from '../../types'
|
|
4
3
|
|
|
5
|
-
dayjs.extend(timezone)
|
|
6
|
-
|
|
7
4
|
/**
|
|
8
|
-
*
|
|
5
|
+
* date-fns format date
|
|
9
6
|
* @param date
|
|
10
7
|
* @param template
|
|
11
8
|
*/
|
|
12
|
-
export function formatDate(date: string | number | Date, template = '
|
|
13
|
-
|
|
14
|
-
return today.format(template)
|
|
9
|
+
export function formatDate(date: string | number | Date, template = 'yyyy-MM-dd') {
|
|
10
|
+
return format(date, template)
|
|
15
11
|
}
|
|
16
12
|
|
|
17
13
|
/**
|