@inzombieland/nuxt-common 1.18.35 → 1.18.36
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/module.json +1 -1
- package/dist/module.mjs +1 -1
- package/dist/runtime/packages/core/composables/index.d.ts +0 -1
- package/dist/runtime/packages/core/composables/index.mjs +0 -1
- package/dist/runtime/packages/core/init-application.mjs +10 -39
- package/dist/runtime/packages/core/package.json +1 -2
- package/package.json +1 -2
- package/dist/runtime/packages/core/composables/use-dayjs.d.ts +0 -2
- package/dist/runtime/packages/core/composables/use-dayjs.mjs +0 -4
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -2,7 +2,7 @@ import { fileURLToPath } from 'node:url';
|
|
|
2
2
|
import { defineNuxtModule, createResolver, addServerHandler, addImportsDir, addPlugin, addComponent } from '@nuxt/kit';
|
|
3
3
|
|
|
4
4
|
const name = "@inzombieland/nuxt-common";
|
|
5
|
-
const version = "1.18.
|
|
5
|
+
const version = "1.18.36";
|
|
6
6
|
|
|
7
7
|
const module = defineNuxtModule({
|
|
8
8
|
meta: {
|
|
@@ -3,7 +3,6 @@ export { useActiveSessions } from "./use-active-sessions";
|
|
|
3
3
|
export { useApiActions } from "./use-api-actions";
|
|
4
4
|
export { useAppLocale } from "./use-app-locale";
|
|
5
5
|
export { useCookies } from "./use-cookies";
|
|
6
|
-
export { useDayjs } from "./use-dayjs";
|
|
7
6
|
export { useSubscribe } from "./use-subscribe";
|
|
8
7
|
export { useThemeMode } from "./use-theme-mode";
|
|
9
8
|
export { useUser } from "./use-user";
|
|
@@ -3,7 +3,6 @@ export { useActiveSessions } from "./use-active-sessions.mjs";
|
|
|
3
3
|
export { useApiActions } from "./use-api-actions.mjs";
|
|
4
4
|
export { useAppLocale } from "./use-app-locale.mjs";
|
|
5
5
|
export { useCookies } from "./use-cookies.mjs";
|
|
6
|
-
export { useDayjs } from "./use-dayjs.mjs";
|
|
7
6
|
export { useSubscribe } from "./use-subscribe.mjs";
|
|
8
7
|
export { useThemeMode } from "./use-theme-mode.mjs";
|
|
9
8
|
export { useUser } from "./use-user.mjs";
|
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import { StyleProvider, Themes, Locale as VarletLocale } from "@varlet/ui";
|
|
2
|
-
import dayjs from "dayjs";
|
|
3
|
-
import localizedFormat from "dayjs/plugin/localizedFormat";
|
|
4
|
-
import relativeTime from "dayjs/plugin/relativeTime";
|
|
5
2
|
import { setNotifyDefaultOptions, Locale as VantLocale } from "vant";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
3
|
+
import enUS from "vant/es/locale/lang/en-US";
|
|
4
|
+
import ruRU from "vant/es/locale/lang/ru-RU";
|
|
8
5
|
import { watch } from "vue";
|
|
9
6
|
import { useI18n } from "vue-i18n";
|
|
10
7
|
import { useRouter } from "vue-router";
|
|
@@ -57,7 +54,14 @@ function initApplication() {
|
|
|
57
54
|
if ("setLocale" in i18n && typeof i18n.setLocale === "function") {
|
|
58
55
|
i18n.setLocale(locale2?.value);
|
|
59
56
|
}
|
|
60
|
-
|
|
57
|
+
if (locale2?.value === "en") {
|
|
58
|
+
VantLocale.use("en-US", enUS);
|
|
59
|
+
VarletLocale.add("en-US", VarletLocale.enUS);
|
|
60
|
+
}
|
|
61
|
+
if (locale2?.value === "ru") {
|
|
62
|
+
VantLocale.use("ru-RU", ruRU);
|
|
63
|
+
VarletLocale.add("en-US", VarletLocale.enUS);
|
|
64
|
+
}
|
|
61
65
|
const localeCookie = useCookies("locale", { maxAge: 60 * 60 * 24 * 365 });
|
|
62
66
|
localeCookie.value = locale2?.value;
|
|
63
67
|
},
|
|
@@ -91,39 +95,6 @@ function initApplication() {
|
|
|
91
95
|
}
|
|
92
96
|
});
|
|
93
97
|
}
|
|
94
|
-
function loadThirdPartyLocales(locale) {
|
|
95
|
-
loadVantLocale(locale);
|
|
96
|
-
loadVarletLocale(locale);
|
|
97
|
-
loadDayjsLocale(locale);
|
|
98
|
-
}
|
|
99
|
-
function loadVantLocale(locale) {
|
|
100
|
-
if (locale === "en") {
|
|
101
|
-
VantLocale.use("en-US", VantLocaleEnUS);
|
|
102
|
-
}
|
|
103
|
-
if (locale === "ru") {
|
|
104
|
-
VantLocale.use("ru-RU", VantLocaleRuRU);
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
function loadVarletLocale(locale) {
|
|
108
|
-
if (locale === "en") {
|
|
109
|
-
VarletLocale.add("en-US", VarletLocale.enUS);
|
|
110
|
-
}
|
|
111
|
-
if (locale === "ru") {
|
|
112
|
-
VarletLocale.add("en-US", VarletLocale.enUS);
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
async function loadDayjsLocale(lang) {
|
|
116
|
-
let locale;
|
|
117
|
-
if (lang === "en") {
|
|
118
|
-
locale = await import("dayjs/locale/en");
|
|
119
|
-
}
|
|
120
|
-
if (lang === "ru") {
|
|
121
|
-
locale = await import("dayjs/locale/ru");
|
|
122
|
-
}
|
|
123
|
-
dayjs.locale(locale);
|
|
124
|
-
dayjs.extend(localizedFormat);
|
|
125
|
-
dayjs.extend(relativeTime);
|
|
126
|
-
}
|
|
127
98
|
export const createInitApplication = once(() => {
|
|
128
99
|
return () => initApplication();
|
|
129
100
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inzombieland/core",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.36",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"license": "ISC",
|
|
6
6
|
"main": "./index.mjs",
|
|
@@ -15,7 +15,6 @@
|
|
|
15
15
|
"@vueuse/core": "^12.8.2",
|
|
16
16
|
"centrifuge": "^5.3.4",
|
|
17
17
|
"cookie-es": "^2.0.0",
|
|
18
|
-
"dayjs": "^1.11.13",
|
|
19
18
|
"destr": "^2.0.5",
|
|
20
19
|
"klona": "^2.0.6",
|
|
21
20
|
"ofetch": "^1.4.1",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inzombieland/nuxt-common",
|
|
3
|
-
"version": "1.18.
|
|
3
|
+
"version": "1.18.36",
|
|
4
4
|
"license": "ISC",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
39
|
"centrifuge": "^5.3.4",
|
|
40
|
-
"dayjs": "^1.11.13",
|
|
41
40
|
"rxjs": "^7.8.2",
|
|
42
41
|
"ultrahtml": "^1.5.2"
|
|
43
42
|
},
|