vue-intlayer 7.3.6 → 7.3.8
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/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/editor/createSharedComposable.cjs +1 -1
- package/dist/cjs/editor/editorLocale.cjs +1 -1
- package/dist/cjs/renderIntlayerNode.cjs +1 -1
- package/dist/esm/client/useDictionary.mjs +24 -26
- package/dist/esm/client/useDictionaryAsync.mjs +17 -9
- package/dist/esm/client/useDictionaryDynamic.mjs +3 -15
- package/dist/esm/client/useIntlayer.mjs +35 -35
- package/dist/esm/editor/createSharedComposable.mjs +1 -1
- package/dist/esm/editor/editorLocale.mjs +1 -1
- package/dist/esm/renderIntlayerNode.mjs +7 -5
- package/dist/types/client/useDictionary.d.ts +2 -1
- package/dist/types/client/useDictionaryAsync.d.ts +2 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +2 -1
- package/dist/types/client/useIntlayer.d.ts +1 -1
- package/package.json +12 -12
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const g=require("@intlayer/config/built"),e=require("vue"),h=require("../getDictionary.cjs"),P=require("./installIntlayer.cjs"),r=require("./useIntlayer.cjs"),_=(f,l)=>{const a=e.inject(P.INTLAYER_SYMBOL),y=e.isRef(a?.locale)?a.locale:e.ref(a?.locale??g.internationalization.defaultLocale),m=e.computed(()=>(l!==void 0?e.toValue(l):void 0)??y.value),o=e.shallowRef({});e.watch([()=>e.toValue(f),()=>m.value],([i,n])=>{o.value=h.getDictionary(i,n)},{immediate:!0,flush:"sync"});const s=i=>{const n=e.computed(()=>r.atPath(o.value,i)),d={get(u,t,b){if(t==="__v_isRef")return!0;if(t==="value")return n.value;if(t==="then")return;if(t==="c"||t==="asComponent")return r.toComponent(()=>n.value);if(t==="$raw")return n;if(t===Symbol.toPrimitive)return()=>n.value;const c=i.concat(t),v=r.atPath(o.value,c);return r.isObjectLike(v)&&!r.isComponentLike(v)?s(c):e.computed(()=>r.atPath(o.value,c))},ownKeys(){const u=n.value;return r.isObjectLike(u)?Reflect.ownKeys(u):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}};return new Proxy({},d)};return s([])};exports.useDictionary=_;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/config/built"),e=require("vue"),u=require("./installIntlayer.cjs"),s=require("./useDictionary.cjs"),y=async(n,c)=>{const o=e.inject(u.INTLAYER_SYMBOL),t=e.computed(()=>c??o?.locale?.value??l?.internationalization.defaultLocale),a=e.ref(await n[t.value]?.());return e.watch(()=>t.value,async r=>{const i=await n[r]?.();i&&(a.value=i)}),s.useDictionary(a,t)};exports.useDictionaryAsync=y;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./useDictionaryAsync.cjs"),n=async(i,t,e)=>await c.useDictionaryAsync(i,e);exports.useDictionaryDynamic=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const b=require("@intlayer/config/built"),e=require("vue"),w=require("../getIntlayer.cjs"),P=require("./installIntlayer.cjs"),l=(t,n)=>n.reduce((u,s)=>u?.[s],t),c=t=>t!=null&&typeof t=="object",m=t=>typeof t=="function"||c(t)&&("render"in t||"setup"in t),h=t=>e.markRaw(e.defineComponent({name:"IntlayerLeaf",setup(){return()=>{const n=t();return n==null?null:m(n)?e.h(n):Array.isArray(n)?e.h("span",n):n}}})),I=(t,n)=>{const u=e.inject(P.INTLAYER_SYMBOL),s=e.isRef(u?.locale)?u.locale:e.ref(u?.locale??b.internationalization.defaultLocale),g=e.computed(()=>(n!==void 0?e.toValue(n):void 0)??s.value),a=e.shallowRef({});e.watch([()=>e.toValue(t),()=>g.value],([i,o])=>{a.value=w.getIntlayer(i,o)},{immediate:!0,flush:"sync"});const v=i=>{const o=e.computed(()=>l(a.value,i)),L={get(f,r,R){if(r==="__v_isRef")return!0;if(r==="value")return o.value;if(r==="then")return;if(r==="c"||r==="asComponent")return h(()=>o.value);if(r==="$raw")return o;if(r===Symbol.toPrimitive)return()=>o.value;const y=i.concat(r),d=l(a.value,y);return c(d)&&!m(d)?v(y):e.computed(()=>l(a.value,y))},ownKeys(){const f=o.value;return c(f)?Reflect.ownKeys(f):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}};return new Proxy({},L)};return v([])};exports.atPath=l;exports.isComponentLike=m;exports.isObjectLike=c;exports.toComponent=h;exports.useIntlayer=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),c=t=>s.getCurrentScope()?(s.onScopeDispose(t),!0):!1,p=t=>{let r=0,o,e;const n=()=>{r-=1,e&&r<=0&&(e.stop(),o=void 0,e=void 0)};return(...i)=>(r+=1,e||(e=s.effectScope(!0),o=e.run(()=>t(...i))),c(n),o)};exports.createSharedComposable=p;exports.tryOnScopeDispose=c;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),c=t=>s.getCurrentScope()?(s.onScopeDispose(t),!0):!1,p=t=>{let r=0,o,e;const n=()=>{r-=1,e&&r<=0&&(e.stop(),o=void 0,e=void 0)};return((...i)=>(r+=1,e||(e=s.effectScope(!0),o=e.run(()=>t(...i))),c(n),o))};exports.createSharedComposable=p;exports.tryOnScopeDispose=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/editor"),r=require("vue"),a=require("../client/installIntlayer.cjs");require("@intlayer/core");require("@intlayer/types");require("./communicator.cjs");
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/editor"),r=require("vue"),a=require("../client/installIntlayer.cjs");require("@intlayer/config/built");require("@intlayer/core");require("@intlayer/types");require("./communicator.cjs");const s=require("./createSharedComposable.cjs"),u=require("./useCrossFrameState.cjs");require("./installIntlayerEditor.cjs");require("../client/useLocaleStorage.cjs");const n=s.createSharedComposable(()=>{const e=r.inject(a.INTLAYER_SYMBOL);if(!e)throw new Error("IntlayerEditor state not found");const[c,t]=u.useCrossFrameState(i.MessageKey.INTLAYER_CURRENT_LOCALE);return r.watch(e.locale,o=>{t(o)},{immediate:!0}),e});exports.useEditorLocale=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),d=({value:u,children:a,additionalProps:l={}})=>{const e=o.ref(u);let n=typeof a=="function"?()=>a():()=>a;const v=()=>(e.value,n()),r=Object.create(String.prototype);return Object.assign(r,{render:v,toString:()=>e.value,valueOf:()=>e.value,[Symbol.toPrimitive]:()=>e.value,get raw(){return e.value},set raw(t){e.value=t},value:void 0,__update(t){n=t.render,this.raw=t.raw},...l}),r.value=r,o.markRaw(r)};exports.renderIntlayerNode=d;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),d=({value:u,children:a,additionalProps:l={}})=>{const e=o.ref(u);let n=typeof a=="function"?()=>a():()=>a;const v=()=>(e.value,n()),r=Object.create(String.prototype);return Object.assign(r,{render:v,toString:()=>e.value,valueOf:()=>e.value,[Symbol.toPrimitive]:()=>e.value,toJSON:()=>e.value,get raw(){return e.value},set raw(t){e.value=t},value:void 0,__update(t){n=t.render,this.raw=t.raw},...l}),r.value=r,o.markRaw(r)};exports.renderIntlayerNode=d;
|
|
@@ -1,48 +1,46 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
([o, t]) => {
|
|
13
|
-
n.value = g(l, t);
|
|
1
|
+
import g from "@intlayer/config/built";
|
|
2
|
+
import { inject as x, isRef as L, ref as P, computed as u, toValue as m, shallowRef as R, watch as _ } from "vue";
|
|
3
|
+
import { getDictionary as b } from "../getDictionary.mjs";
|
|
4
|
+
import { INTLAYER_SYMBOL as k } from "./installIntlayer.mjs";
|
|
5
|
+
import { atPath as c, isObjectLike as v, toComponent as C, isComponentLike as D } from "./useIntlayer.mjs";
|
|
6
|
+
const p = (y, l) => {
|
|
7
|
+
const o = x(k), d = L(o?.locale) ? o.locale : P(o?.locale ?? g.internationalization.defaultLocale), h = u(() => (l !== void 0 ? m(l) : void 0) ?? d.value), n = R({});
|
|
8
|
+
_(
|
|
9
|
+
[() => m(y), () => h.value],
|
|
10
|
+
([r, t]) => {
|
|
11
|
+
n.value = b(r, t);
|
|
14
12
|
},
|
|
15
13
|
{ immediate: !0, flush: "sync" }
|
|
16
14
|
);
|
|
17
|
-
const
|
|
18
|
-
const t =
|
|
19
|
-
() => c(n.value,
|
|
20
|
-
),
|
|
21
|
-
get(
|
|
15
|
+
const s = (r) => {
|
|
16
|
+
const t = u(
|
|
17
|
+
() => c(n.value, r)
|
|
18
|
+
), w = {
|
|
19
|
+
get(i, e, O) {
|
|
22
20
|
if (e === "__v_isRef") return !0;
|
|
23
21
|
if (e === "value") return t.value;
|
|
24
22
|
if (e === "then") return;
|
|
25
23
|
if (e === "c" || e === "asComponent")
|
|
26
|
-
return
|
|
24
|
+
return C(() => t.value);
|
|
27
25
|
if (e === "$raw") return t;
|
|
28
26
|
if (e === Symbol.toPrimitive)
|
|
29
27
|
return () => t.value;
|
|
30
|
-
const
|
|
31
|
-
return
|
|
28
|
+
const a = r.concat(e), f = c(n.value, a);
|
|
29
|
+
return v(f) && !D(f) ? s(a) : u(() => c(n.value, a));
|
|
32
30
|
},
|
|
33
31
|
// Make Object.keys(), for...in, v-for on object keys work
|
|
34
32
|
ownKeys() {
|
|
35
|
-
const
|
|
36
|
-
return
|
|
33
|
+
const i = t.value;
|
|
34
|
+
return v(i) ? Reflect.ownKeys(i) : [];
|
|
37
35
|
},
|
|
38
36
|
getOwnPropertyDescriptor() {
|
|
39
37
|
return { enumerable: !0, configurable: !0 };
|
|
40
38
|
}
|
|
41
39
|
};
|
|
42
|
-
return new Proxy({},
|
|
40
|
+
return new Proxy({}, w);
|
|
43
41
|
};
|
|
44
|
-
return
|
|
42
|
+
return s([]);
|
|
45
43
|
};
|
|
46
44
|
export {
|
|
47
|
-
|
|
45
|
+
p as useDictionary
|
|
48
46
|
};
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import r from "@intlayer/config/built";
|
|
2
|
-
import { inject as
|
|
3
|
-
import { INTLAYER_SYMBOL as
|
|
4
|
-
import { useDictionary as
|
|
5
|
-
const
|
|
6
|
-
const
|
|
7
|
-
() => i ??
|
|
8
|
-
),
|
|
9
|
-
|
|
2
|
+
import { inject as l, computed as u, ref as s, watch as f } from "vue";
|
|
3
|
+
import { INTLAYER_SYMBOL as m } from "./installIntlayer.mjs";
|
|
4
|
+
import { useDictionary as y } from "./useDictionary.mjs";
|
|
5
|
+
const L = async (a, i) => {
|
|
6
|
+
const c = l(m), t = u(
|
|
7
|
+
() => i ?? c?.locale?.value ?? r?.internationalization.defaultLocale
|
|
8
|
+
), o = s(
|
|
9
|
+
await a[t.value]?.()
|
|
10
|
+
);
|
|
11
|
+
return f(
|
|
12
|
+
() => t.value,
|
|
13
|
+
async (e) => {
|
|
14
|
+
const n = await a[e]?.();
|
|
15
|
+
n && (o.value = n);
|
|
16
|
+
}
|
|
17
|
+
), y(o, t);
|
|
10
18
|
};
|
|
11
19
|
export {
|
|
12
|
-
|
|
20
|
+
L as useDictionaryAsync
|
|
13
21
|
};
|
|
@@ -1,17 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import { INTLAYER_SYMBOL as l } from "./installIntlayer.mjs";
|
|
4
|
-
import { useDictionary as u } from "./useDictionary.mjs";
|
|
5
|
-
import { useLoadDynamic as f } from "./useLoadDynamic.mjs";
|
|
6
|
-
const L = (t, i, r) => {
|
|
7
|
-
const a = c(l), o = m(
|
|
8
|
-
() => r ?? a?.locale?.value ?? e?.internationalization.defaultLocale
|
|
9
|
-
), n = f(
|
|
10
|
-
`${String(i)}.${o.value}`,
|
|
11
|
-
t[o.value]?.()
|
|
12
|
-
);
|
|
13
|
-
return u(n, o);
|
|
14
|
-
};
|
|
1
|
+
import { useDictionaryAsync as c } from "./useDictionaryAsync.mjs";
|
|
2
|
+
const t = async (i, n, a) => await c(i, a);
|
|
15
3
|
export {
|
|
16
|
-
|
|
4
|
+
t as useDictionaryDynamic
|
|
17
5
|
};
|
|
@@ -1,59 +1,59 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
return
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
[() =>
|
|
19
|
-
([u,
|
|
20
|
-
i.value =
|
|
1
|
+
import g from "@intlayer/config/built";
|
|
2
|
+
import { markRaw as p, defineComponent as x, h as d, inject as P, isRef as _, ref as b, computed as s, toValue as h, shallowRef as k, watch as C } from "vue";
|
|
3
|
+
import { getIntlayer as I } from "../getIntlayer.mjs";
|
|
4
|
+
import { INTLAYER_SYMBOL as j } from "./installIntlayer.mjs";
|
|
5
|
+
const f = (e, t) => t.reduce((o, a) => o?.[a], e), m = (e) => e != null && typeof e == "object", w = (e) => typeof e == "function" || m(e) && ("render" in e || "setup" in e), A = (e) => p(
|
|
6
|
+
x({
|
|
7
|
+
name: "IntlayerLeaf",
|
|
8
|
+
setup() {
|
|
9
|
+
return () => {
|
|
10
|
+
const t = e();
|
|
11
|
+
return t == null ? null : w(t) ? d(t) : Array.isArray(t) ? d("span", t) : t;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
), z = (e, t) => {
|
|
16
|
+
const o = P(j), a = _(o?.locale) ? o.locale : b(o?.locale ?? g.internationalization.defaultLocale), L = s(() => (t !== void 0 ? h(t) : void 0) ?? a.value), i = k({});
|
|
17
|
+
C(
|
|
18
|
+
[() => h(e), () => L.value],
|
|
19
|
+
([u, r]) => {
|
|
20
|
+
i.value = I(u, r);
|
|
21
21
|
},
|
|
22
22
|
{ immediate: !0, flush: "sync" }
|
|
23
23
|
);
|
|
24
24
|
const v = (u) => {
|
|
25
|
-
const
|
|
25
|
+
const r = s(
|
|
26
26
|
() => f(i.value, u)
|
|
27
|
-
),
|
|
28
|
-
get(
|
|
27
|
+
), R = {
|
|
28
|
+
get(l, n, O) {
|
|
29
29
|
if (n === "__v_isRef") return !0;
|
|
30
|
-
if (n === "value") return
|
|
30
|
+
if (n === "value") return r.value;
|
|
31
31
|
if (n === "then") return;
|
|
32
32
|
if (n === "c" || n === "asComponent")
|
|
33
|
-
return
|
|
34
|
-
if (n === "$raw") return
|
|
33
|
+
return A(() => r.value);
|
|
34
|
+
if (n === "$raw") return r;
|
|
35
35
|
if (n === Symbol.toPrimitive)
|
|
36
|
-
return () =>
|
|
37
|
-
const
|
|
38
|
-
return m(y) && !
|
|
36
|
+
return () => r.value;
|
|
37
|
+
const c = u.concat(n), y = f(i.value, c);
|
|
38
|
+
return m(y) && !w(y) ? v(c) : s(() => f(i.value, c));
|
|
39
39
|
},
|
|
40
40
|
// Make Object.keys(), for...in, v-for on object keys work
|
|
41
41
|
ownKeys() {
|
|
42
|
-
const
|
|
43
|
-
return m(
|
|
42
|
+
const l = r.value;
|
|
43
|
+
return m(l) ? Reflect.ownKeys(l) : [];
|
|
44
44
|
},
|
|
45
45
|
getOwnPropertyDescriptor() {
|
|
46
46
|
return { enumerable: !0, configurable: !0 };
|
|
47
47
|
}
|
|
48
48
|
};
|
|
49
|
-
return new Proxy({},
|
|
49
|
+
return new Proxy({}, R);
|
|
50
50
|
};
|
|
51
51
|
return v([]);
|
|
52
52
|
};
|
|
53
53
|
export {
|
|
54
54
|
f as atPath,
|
|
55
|
-
|
|
55
|
+
w as isComponentLike,
|
|
56
56
|
m as isObjectLike,
|
|
57
|
-
|
|
58
|
-
|
|
57
|
+
A as toComponent,
|
|
58
|
+
z as useIntlayer
|
|
59
59
|
};
|
|
@@ -4,7 +4,7 @@ const u = (t) => n() ? (i(t), !0) : !1, a = (t) => {
|
|
|
4
4
|
const s = () => {
|
|
5
5
|
r -= 1, e && r <= 0 && (e.stop(), o = void 0, e = void 0);
|
|
6
6
|
};
|
|
7
|
-
return (...p) => (r += 1, e || (e = c(!0), o = e.run(() => t(...p))), u(s), o);
|
|
7
|
+
return ((...p) => (r += 1, e || (e = c(!0), o = e.run(() => t(...p))), u(s), o));
|
|
8
8
|
};
|
|
9
9
|
export {
|
|
10
10
|
a as createSharedComposable,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { MessageKey as e } from "@intlayer/editor";
|
|
2
2
|
import { inject as m, watch as i } from "vue";
|
|
3
3
|
import { INTLAYER_SYMBOL as a } from "../client/installIntlayer.mjs";
|
|
4
|
+
import "@intlayer/config/built";
|
|
4
5
|
import "@intlayer/core";
|
|
5
6
|
import "@intlayer/types";
|
|
6
7
|
import "./communicator.mjs";
|
|
7
|
-
import "@intlayer/config/built";
|
|
8
8
|
import { createSharedComposable as p } from "./createSharedComposable.mjs";
|
|
9
9
|
import { useCrossFrameState as s } from "./useCrossFrameState.mjs";
|
|
10
10
|
import "./installIntlayerEditor.mjs";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { ref as l, markRaw as i } from "vue";
|
|
2
2
|
const s = ({
|
|
3
|
-
value:
|
|
3
|
+
value: n,
|
|
4
4
|
children: a,
|
|
5
5
|
additionalProps: u = {}
|
|
6
6
|
}) => {
|
|
7
|
-
const e = l(
|
|
8
|
-
let
|
|
9
|
-
const v = () => (e.value,
|
|
7
|
+
const e = l(n);
|
|
8
|
+
let o = typeof a == "function" ? () => a() : () => a;
|
|
9
|
+
const v = () => (e.value, o()), r = Object.create(String.prototype);
|
|
10
10
|
return Object.assign(r, {
|
|
11
11
|
/* component renderer */
|
|
12
12
|
render: v,
|
|
@@ -15,6 +15,8 @@ const s = ({
|
|
|
15
15
|
/* primitive coercion helpers */
|
|
16
16
|
valueOf: () => e.value,
|
|
17
17
|
[Symbol.toPrimitive]: () => e.value,
|
|
18
|
+
/* JSON serialization - prevents circular reference errors */
|
|
19
|
+
toJSON: () => e.value,
|
|
18
20
|
/* reactive getter/setter for the primitive value */
|
|
19
21
|
get raw() {
|
|
20
22
|
return e.value;
|
|
@@ -26,7 +28,7 @@ const s = ({
|
|
|
26
28
|
value: void 0,
|
|
27
29
|
/* called by useIntlayer when the dictionary entry changes */
|
|
28
30
|
__update(t) {
|
|
29
|
-
|
|
31
|
+
o = t.render, this.raw = t.raw;
|
|
30
32
|
},
|
|
31
33
|
...u
|
|
32
34
|
}), r.value = r, i(r);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { DeclaredLocales, Dictionary, LocalesValues } from '@intlayer/types';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
3
|
import { DeepTransformContent } from '../plugins';
|
|
3
|
-
export declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T
|
|
4
|
+
export declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: MaybeRefOrGetter<T>, locale?: MaybeRefOrGetter<L>) => DeepTransformContent<T["content"], L>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Dictionary, LocalesValues, StrictModeLocaleMap } from '@intlayer/types';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
3
|
/**
|
|
3
4
|
* On the server side, Hook that transform a dictionary and return the content
|
|
4
5
|
*
|
|
5
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
6
7
|
*/
|
|
7
|
-
export declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: LocalesValues) => Promise<any>;
|
|
8
|
+
export declare const useDictionaryAsync: <T extends Dictionary>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, locale?: MaybeRefOrGetter<LocalesValues>) => Promise<any>;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Dictionary, DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/types';
|
|
2
|
+
import { MaybeRefOrGetter } from 'vue';
|
|
2
3
|
/**
|
|
3
4
|
* On the server side, Hook that transform a dictionary and return the content
|
|
4
5
|
*
|
|
5
6
|
* If the locale is not provided, it will use the locale from the client context
|
|
6
7
|
*/
|
|
7
|
-
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>,
|
|
8
|
+
export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, _key: K, locale?: MaybeRefOrGetter<LocalesValues>) => Promise<any>;
|
|
@@ -5,5 +5,5 @@ export declare const atPath: (obj: any, path: (string | number)[]) => any;
|
|
|
5
5
|
export declare const isObjectLike: (v: any) => boolean;
|
|
6
6
|
export declare const isComponentLike: (v: any) => boolean;
|
|
7
7
|
/** Wrap a getter into a lightweight functional component */
|
|
8
|
-
export declare const toComponent: (getter: () => any) => import('vue').DefineComponent<{}, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any
|
|
8
|
+
export declare const toComponent: (getter: () => any) => import('vue').Raw<import('vue').DefineComponent<{}, () => any, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<{}> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>>;
|
|
9
9
|
export declare const useIntlayer: <T extends DictionaryKeys>(key: T, locale?: MaybeRefOrGetter<LocalesValues | null | undefined>) => DeepTransformContent<DictionaryRegistryContent<T>>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "7.3.
|
|
3
|
+
"version": "7.3.8",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -87,31 +87,31 @@
|
|
|
87
87
|
"typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
|
|
88
88
|
},
|
|
89
89
|
"dependencies": {
|
|
90
|
-
"@intlayer/api": "7.3.
|
|
91
|
-
"@intlayer/config": "7.3.
|
|
92
|
-
"@intlayer/core": "7.3.
|
|
93
|
-
"@intlayer/editor": "7.3.
|
|
94
|
-
"@intlayer/types": "7.3.
|
|
95
|
-
"@intlayer/unmerged-dictionaries-entry": "7.3.
|
|
90
|
+
"@intlayer/api": "7.3.8",
|
|
91
|
+
"@intlayer/config": "7.3.8",
|
|
92
|
+
"@intlayer/core": "7.3.8",
|
|
93
|
+
"@intlayer/editor": "7.3.8",
|
|
94
|
+
"@intlayer/types": "7.3.8",
|
|
95
|
+
"@intlayer/unmerged-dictionaries-entry": "7.3.8"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@types/node": "24.10.1",
|
|
99
99
|
"@utils/ts-config": "1.0.4",
|
|
100
100
|
"@utils/ts-config-types": "1.0.4",
|
|
101
101
|
"@utils/tsdown-config": "1.0.4",
|
|
102
|
-
"@vitejs/plugin-vue": "6.0.
|
|
102
|
+
"@vitejs/plugin-vue": "6.0.2",
|
|
103
103
|
"ajv": "^8.17.1",
|
|
104
104
|
"fast-glob": "3.3.3",
|
|
105
105
|
"rimraf": "6.1.2",
|
|
106
106
|
"tsdown": "0.16.8",
|
|
107
107
|
"typescript": "5.9.3",
|
|
108
|
-
"vite": "7.2.
|
|
108
|
+
"vite": "7.2.6",
|
|
109
109
|
"vite-plugin-dts": "4.5.4",
|
|
110
|
-
"vitest": "4.0.
|
|
111
|
-
"vue-tsc": "3.1.
|
|
110
|
+
"vitest": "4.0.15",
|
|
111
|
+
"vue-tsc": "3.1.5"
|
|
112
112
|
},
|
|
113
113
|
"peerDependencies": {
|
|
114
|
-
"intlayer": "7.3.
|
|
114
|
+
"intlayer": "7.3.8",
|
|
115
115
|
"vue": ">=3.0.0"
|
|
116
116
|
},
|
|
117
117
|
"peerDependenciesMeta": {
|