vue-intlayer 5.4.0-canary.0 → 5.4.1
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@intlayer/config/built"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("@intlayer/config/built"),i=require("vue"),u=require("./installIntlayer.cjs"),n=require("./useLocaleCookie.cjs"),a=({onLocaleChange:s}={})=>{const{defaultLocale:l,locales:o}=(c==null?void 0:c.internationalization)??{},t=i.inject(u.INTLAYER_SYMBOL),{setLocaleCookie:r}=n.useLocaleCookie();return{locale:i.computed(()=>{var e;return((e=t==null?void 0:t.locale)==null?void 0:e.value)??l}),defaultLocale:l,availableLocales:o,setLocale:e=>{if(!(o!=null&&o.map(String).includes(e))){console.error(`Locale ${e} is not available`);return}t&&t.setLocale(e),r(e),s==null||s(e)}}};exports.useLocale=a;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import l from "@intlayer/config/built";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
const v = ({ onLocaleChange: i } = {}) => {
|
|
2
|
+
import { inject as m, computed as u } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as f } from "./installIntlayer.mjs";
|
|
4
|
+
import { useLocaleCookie as p } from "./useLocaleCookie.mjs";
|
|
5
|
+
const j = ({ onLocaleChange: i } = {}) => {
|
|
7
6
|
var c;
|
|
8
|
-
const { defaultLocale: s, locales: r } = ((c = l) == null ? void 0 : c.internationalization) ?? {}, t = f
|
|
7
|
+
const { defaultLocale: s, locales: r } = ((c = l) == null ? void 0 : c.internationalization) ?? {}, t = m(f), { setLocaleCookie: e } = p();
|
|
9
8
|
return {
|
|
10
9
|
locale: u(() => {
|
|
11
10
|
var o;
|
|
@@ -16,8 +15,6 @@ const v = ({ onLocaleChange: i } = {}) => {
|
|
|
16
15
|
// Principal locale defined in config
|
|
17
16
|
availableLocales: r,
|
|
18
17
|
// List of the available locales defined in config
|
|
19
|
-
localeList: m,
|
|
20
|
-
// List of all available locales
|
|
21
18
|
setLocale: (o) => {
|
|
22
19
|
if (!(r != null && r.map(String).includes(o))) {
|
|
23
20
|
console.error(`Locale ${o} is not available`);
|
|
@@ -29,5 +26,5 @@ const v = ({ onLocaleChange: i } = {}) => {
|
|
|
29
26
|
};
|
|
30
27
|
};
|
|
31
28
|
export {
|
|
32
|
-
|
|
29
|
+
j as useLocale
|
|
33
30
|
};
|
|
@@ -9,7 +9,6 @@ export declare const useLocale: ({ onLocaleChange }?: useLocaleProps) => {
|
|
|
9
9
|
locale: import('vue').ComputedRef<import('intlayer').Locales>;
|
|
10
10
|
defaultLocale: import('intlayer').Locales;
|
|
11
11
|
availableLocales: import('intlayer').Locales[];
|
|
12
|
-
localeList: import('intlayer').Locales[];
|
|
13
12
|
setLocale: (newLocale: LocalesValues) => void;
|
|
14
13
|
};
|
|
15
14
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../../src/client/useLocale.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"useLocale.d.ts","sourceRoot":"","sources":["../../../src/client/useLocale.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAK7D,KAAK,cAAc,GAAG;IACpB,cAAc,CAAC,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;CAClD,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,SAAS,GAAI,qBAAoB,cAAmB;;;;2BASjC,aAAa;CAmB5C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "5.4.
|
|
3
|
+
"version": "5.4.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"js-cookie": "^3.0.5",
|
|
72
72
|
"uuid": "^11.1.0",
|
|
73
|
-
"@intlayer/
|
|
74
|
-
"@intlayer/
|
|
75
|
-
"@intlayer/
|
|
76
|
-
"@intlayer/
|
|
77
|
-
"@intlayer/editor": "5.4.
|
|
73
|
+
"@intlayer/config": "5.4.1",
|
|
74
|
+
"@intlayer/core": "5.4.1",
|
|
75
|
+
"@intlayer/api": "5.4.1",
|
|
76
|
+
"@intlayer/dictionaries-entry": "5.4.1",
|
|
77
|
+
"@intlayer/editor": "5.4.1"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@types/js-cookie": "^3.0.6",
|
|
@@ -91,17 +91,17 @@
|
|
|
91
91
|
"vite-plugin-dts": "^4.5.3",
|
|
92
92
|
"@utils/eslint-config": "1.0.4",
|
|
93
93
|
"@utils/ts-config": "1.0.4",
|
|
94
|
-
"@
|
|
94
|
+
"@utils/tsup-config": "1.0.4",
|
|
95
95
|
"@utils/ts-config-types": "1.0.4",
|
|
96
|
-
"@
|
|
96
|
+
"@intlayer/backend": "5.4.1"
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"vue": "^3.5.13",
|
|
100
|
-
"@intlayer/
|
|
101
|
-
"@intlayer/config": "5.4.
|
|
102
|
-
"@intlayer/
|
|
103
|
-
"@intlayer/
|
|
104
|
-
"intlayer": "5.4.
|
|
100
|
+
"@intlayer/api": "5.4.1",
|
|
101
|
+
"@intlayer/config": "5.4.1",
|
|
102
|
+
"@intlayer/dictionaries-entry": "5.4.1",
|
|
103
|
+
"@intlayer/core": "5.4.1",
|
|
104
|
+
"intlayer": "5.4.1"
|
|
105
105
|
},
|
|
106
106
|
"engines": {
|
|
107
107
|
"node": ">=14.18"
|