vue-intlayer 7.3.10 → 7.3.12
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/index.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/renderIntlayerNode.cjs +1 -1
- package/dist/esm/client/index.mjs +22 -20
- package/dist/esm/client/useDictionary.mjs +74 -31
- package/dist/esm/client/useIntlayer.mjs +31 -42
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +9 -9
- package/dist/esm/index.mjs +35 -33
- package/dist/esm/renderIntlayerNode.mjs +17 -15
- package/dist/types/client/useDictionary.d.ts +16 -1
- package/dist/types/client/useIntlayer.d.ts +0 -5
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./installIntlayer.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./installIntlayer.cjs"),e=require("./useDictionary.cjs"),n=require("./useDictionaryAsync.cjs"),i=require("./useDictionaryDynamic.cjs"),a=require("./useIntlayer.cjs"),r=require("./useLoadDynamic.cjs"),c=require("./useLocale.cjs");exports.INTLAYER_SYMBOL=t.INTLAYER_SYMBOL;exports.createIntlayerClient=t.createIntlayerClient;exports.installIntlayer=t.installIntlayer;exports.atPath=e.atPath;exports.createIntlayerLeafProxy=e.createIntlayerLeafProxy;exports.isComponentLike=e.isComponentLike;exports.isIntlayerNode=e.isIntlayerNode;exports.isObjectLike=e.isObjectLike;exports.toComponent=e.toComponent;exports.useDictionary=e.useDictionary;exports.useDictionaryAsync=n.useDictionaryAsync;exports.useDictionaryDynamic=i.useDictionaryDynamic;exports.useIntlayer=a.useIntlayer;exports.useLoadDynamic=r.useLoadDynamic;exports.useLocale=c.useLocale;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const h=require("@intlayer/config/built"),t=require("vue"),L=require("../getDictionary.cjs"),x=require("./installIntlayer.cjs"),s=(e,n)=>n.reduce((r,o)=>r?.[o],e),y=e=>e!=null&&typeof e=="object",m=e=>typeof e=="function"||y(e)&&("render"in e||"setup"in e),b=e=>e!=null&&typeof e=="object"&&"__update"in e&&"render"in e&&"raw"in e,_=e=>t.markRaw(t.defineComponent({name:"IntlayerLeaf",setup(){return()=>{const n=e();return n==null?null:m(n)?t.h(n):Array.isArray(n)?t.h("span",n):n}}})),g=e=>{const n={get(r,o){const c=e.value;if(o==="__v_isRef")return!0;if(o==="value")return c;if(o==="$raw")return e;if(o==="__v_skip")return!0;if(o==="c"||o==="asComponent")return _(()=>e.value);if(c==null)return;const u=c[o];return typeof u=="function"?u.bind(c):u},ownKeys(){const r=e.value;return r!=null&&typeof r=="object"?Reflect.ownKeys(r):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}};return new Proxy({},n)},j=(e,n)=>{const r=t.inject(x.INTLAYER_SYMBOL),o=t.isRef(r?.locale)?r.locale:t.ref(r?.locale??h.internationalization.defaultLocale),c=t.computed(()=>(n!==void 0?t.toValue(n):void 0)??o.value),u=t.shallowRef({});t.watch([()=>t.toValue(e),()=>c.value],([l,a])=>{u.value=L.getDictionary(l,a)},{immediate:!0,flush:"sync"});const w=l=>{const a=t.computed(()=>s(u.value,l)),P={get(d,i,k){if(i==="__v_isRef")return!0;if(i==="value")return a.value;if(i==="then")return;if(i==="c"||i==="asComponent")return _(()=>a.value);if(i==="$raw")return a;if(i===Symbol.toPrimitive)return()=>a.value;const f=l.concat(i),v=s(u.value,f);return y(v)&&!m(v)?w(f):b(v)?g(t.computed(()=>s(u.value,f))):t.computed(()=>s(u.value,f))},ownKeys(){const d=a.value;return y(d)?Reflect.ownKeys(d):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}};return new Proxy({},P)};return w([])};exports.atPath=s;exports.createIntlayerLeafProxy=g;exports.isComponentLike=m;exports.isIntlayerNode=b;exports.isObjectLike=y;exports.toComponent=_;exports.useDictionary=j;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const P=require("@intlayer/config/built"),e=require("vue"),h=require("../getIntlayer.cjs"),g=require("./installIntlayer.cjs"),t=require("./useDictionary.cjs"),I=(v,s)=>{const i=e.inject(g.INTLAYER_SYMBOL),y=e.isRef(i?.locale)?i.locale:e.ref(i?.locale??P.internationalization.defaultLocale),d=e.computed(()=>(s!==void 0?e.toValue(s):void 0)??y.value),a=e.shallowRef({});e.watch([()=>e.toValue(v),()=>d.value],([o,r])=>{a.value=h.getIntlayer(o,r)},{immediate:!0,flush:"sync"});const f=o=>{const r=e.computed(()=>t.atPath(a.value,o)),m={get(l,n,L){if(n==="__v_isRef")return!0;if(n==="value")return r.value;if(n==="then")return;if(n==="c"||n==="asComponent")return t.toComponent(()=>r.value);if(n==="$raw")return r;if(n===Symbol.toPrimitive)return()=>r.value;const u=o.concat(n),c=t.atPath(a.value,u);return t.isObjectLike(c)&&!t.isComponentLike(c)?f(u):t.isIntlayerNode(c)?t.createIntlayerLeafProxy(e.computed(()=>t.atPath(a.value,u))):e.computed(()=>t.atPath(a.value,u))},ownKeys(){const l=r.value;return t.isObjectLike(l)?Reflect.ownKeys(l):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}};return new Proxy({},m)};return f([])};exports.useIntlayer=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@intlayer/editor"),c=require("vue"),l=require("./communicator.cjs"),o=new Map;let u=!1;const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@intlayer/editor"),c=require("vue"),l=require("./communicator.cjs"),o=new Map;let u=!1;const f=(e,t)=>{let s=o.get(e);s||(s=new Set,o.set(e,s)),s.add(t)},p=(e,t)=>{const s=o.get(e);s&&(s.delete(t),s.size===0&&o.delete(e))},m=(e,t)=>{u||typeof window>"u"||(window.addEventListener("message",s=>{const{type:n,data:i,senderId:a}=s.data??{};n&&a!==t&&(!e||e.includes("*")||e.some(r=>d.compareUrls(r,s.origin)))&&o.get(n)?.forEach(r=>{r(i)})}),u=!0)},b=(e,t)=>{const{allowedOrigins:s,postMessage:n,senderId:i}=l.useCommunicator()??{};return m(s,i),t?(f(e,t),c.onScopeDispose(()=>p(e,t))):c.getCurrentInstance()||console.warn("useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."),r=>{n({type:e,data:r,senderId:i})}};exports.useCrossFrameMessageListener=b;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./client/installIntlayer.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./client/installIntlayer.cjs"),e=require("./client/useDictionary.cjs"),i=require("./client/useDictionaryAsync.cjs"),a=require("./client/useDictionaryDynamic.cjs"),o=require("./client/useIntlayer.cjs"),l=require("./client/useLoadDynamic.cjs"),s=require("./client/useLocale.cjs"),c=require("../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B4fMFrZy.js"),u=require("./editor/installIntlayerEditor.cjs"),y=require("./editor/useEditor.cjs"),d=require("./getDictionary.cjs"),I=require("./getIntlayer.cjs"),t=require("./markdown/installIntlayerMarkdown.cjs"),r=require("./plugins.cjs");exports.INTLAYER_SYMBOL=n.INTLAYER_SYMBOL;exports.createIntlayerClient=n.createIntlayerClient;exports.installIntlayer=n.installIntlayer;exports.atPath=e.atPath;exports.createIntlayerLeafProxy=e.createIntlayerLeafProxy;exports.isComponentLike=e.isComponentLike;exports.isIntlayerNode=e.isIntlayerNode;exports.isObjectLike=e.isObjectLike;exports.toComponent=e.toComponent;exports.useDictionary=e.useDictionary;exports.useDictionaryAsync=i.useDictionaryAsync;exports.useDictionaryDynamic=a.useDictionaryDynamic;exports.useIntlayer=o.useIntlayer;exports.useLoadDynamic=l.useLoadDynamic;exports.useLocale=s.useLocale;exports.ContentSelectorWrapper=c._sfc_main;exports.installIntlayerEditor=u.installIntlayerEditor;exports.useEditor=y.useEditor;exports.getDictionary=d.getDictionary;exports.getIntlayer=I.getIntlayer;exports.INTLAYER_MARKDOWN_SYMBOL=t.INTLAYER_MARKDOWN_SYMBOL;exports.createIntlayerMarkdownClient=t.createIntlayerMarkdownClient;exports.installIntlayerMarkdown=t.installIntlayerMarkdown;exports.useMarkdown=t.useMarkdown;exports.intlayerNodePlugins=r.intlayerNodePlugins;exports.markdownPlugin=r.markdownPlugin;exports.markdownStringPlugin=r.markdownStringPlugin;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("vue"),d=({value:o,children:t,additionalProps:l={}})=>{const e=u.ref(o);let a=typeof t=="function"?()=>t():()=>t;const v=()=>(e.value,a()),n=Object.create(String.prototype);return Object.assign(n,{render:v,toString:()=>e.value,valueOf:()=>e.value,[Symbol.toPrimitive]:()=>e.value,toJSON:()=>e.value,get raw(){return e.value},set raw(r){e.value=r},get value(){return e.value},__update(r){a=r.render,this.raw=r.raw},...l}),u.markRaw(n)};exports.renderIntlayerNode=d;
|
|
@@ -1,22 +1,24 @@
|
|
|
1
|
-
import { INTLAYER_SYMBOL as
|
|
2
|
-
import {
|
|
3
|
-
import { useDictionaryAsync as
|
|
4
|
-
import { useDictionaryDynamic as
|
|
5
|
-
import {
|
|
6
|
-
import { useLoadDynamic as
|
|
7
|
-
import { useLocale as
|
|
1
|
+
import { INTLAYER_SYMBOL as r, createIntlayerClient as t, installIntlayer as a } from "./installIntlayer.mjs";
|
|
2
|
+
import { atPath as i, createIntlayerLeafProxy as y, isComponentLike as m, isIntlayerNode as s, isObjectLike as c, toComponent as l, useDictionary as p } from "./useDictionary.mjs";
|
|
3
|
+
import { useDictionaryAsync as x } from "./useDictionaryAsync.mjs";
|
|
4
|
+
import { useDictionaryDynamic as u } from "./useDictionaryDynamic.mjs";
|
|
5
|
+
import { useIntlayer as D } from "./useIntlayer.mjs";
|
|
6
|
+
import { useLoadDynamic as d } from "./useLoadDynamic.mjs";
|
|
7
|
+
import { useLocale as A } from "./useLocale.mjs";
|
|
8
8
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
p as
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
r as INTLAYER_SYMBOL,
|
|
10
|
+
i as atPath,
|
|
11
|
+
t as createIntlayerClient,
|
|
12
|
+
y as createIntlayerLeafProxy,
|
|
13
|
+
a as installIntlayer,
|
|
14
|
+
m as isComponentLike,
|
|
15
|
+
s as isIntlayerNode,
|
|
16
|
+
c as isObjectLike,
|
|
17
|
+
l as toComponent,
|
|
18
|
+
p as useDictionary,
|
|
19
|
+
x as useDictionaryAsync,
|
|
20
|
+
u as useDictionaryDynamic,
|
|
21
|
+
D as useIntlayer,
|
|
22
|
+
d as useLoadDynamic,
|
|
23
|
+
A as useLocale
|
|
22
24
|
};
|
|
@@ -1,46 +1,89 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { getDictionary as
|
|
4
|
-
import { INTLAYER_SYMBOL as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
1
|
+
import P from "@intlayer/config/built";
|
|
2
|
+
import { markRaw as x, defineComponent as L, h as _, inject as R, isRef as j, ref as k, computed as s, toValue as w, shallowRef as C, watch as D } from "vue";
|
|
3
|
+
import { getDictionary as I } from "../getDictionary.mjs";
|
|
4
|
+
import { INTLAYER_SYMBOL as K } from "./installIntlayer.mjs";
|
|
5
|
+
const f = (e, t) => t.reduce((n, r) => n?.[r], e), v = (e) => e != null && typeof e == "object", b = (e) => typeof e == "function" || v(e) && ("render" in e || "setup" in e), O = (e) => e != null && typeof e == "object" && "__update" in e && "render" in e && "raw" in e, g = (e) => x(
|
|
6
|
+
L({
|
|
7
|
+
name: "IntlayerLeaf",
|
|
8
|
+
setup() {
|
|
9
|
+
return () => {
|
|
10
|
+
const t = e();
|
|
11
|
+
return t == null ? null : b(t) ? _(t) : Array.isArray(t) ? _("span", t) : t;
|
|
12
|
+
};
|
|
13
|
+
}
|
|
14
|
+
})
|
|
15
|
+
), A = (e) => {
|
|
16
|
+
const t = {
|
|
17
|
+
get(n, r) {
|
|
18
|
+
const a = e.value;
|
|
19
|
+
if (r === "__v_isRef") return !0;
|
|
20
|
+
if (r === "value")
|
|
21
|
+
return a;
|
|
22
|
+
if (r === "$raw")
|
|
23
|
+
return e;
|
|
24
|
+
if (r === "__v_skip") return !0;
|
|
25
|
+
if (r === "c" || r === "asComponent")
|
|
26
|
+
return g(() => e.value);
|
|
27
|
+
if (a == null) return;
|
|
28
|
+
const o = a[r];
|
|
29
|
+
return typeof o == "function" ? o.bind(a) : o;
|
|
30
|
+
},
|
|
31
|
+
// Make Object.keys() work
|
|
32
|
+
ownKeys() {
|
|
33
|
+
const n = e.value;
|
|
34
|
+
return n != null && typeof n == "object" ? Reflect.ownKeys(n) : [];
|
|
35
|
+
},
|
|
36
|
+
getOwnPropertyDescriptor() {
|
|
37
|
+
return { enumerable: !0, configurable: !0 };
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
return new Proxy({}, t);
|
|
41
|
+
}, $ = (e, t) => {
|
|
42
|
+
const n = R(K), r = j(n?.locale) ? n.locale : k(n?.locale ?? P.internationalization.defaultLocale), a = s(() => (t !== void 0 ? w(t) : void 0) ?? r.value), o = C({});
|
|
43
|
+
D(
|
|
44
|
+
[() => w(e), () => a.value],
|
|
45
|
+
([l, i]) => {
|
|
46
|
+
o.value = I(l, i);
|
|
12
47
|
},
|
|
13
48
|
{ immediate: !0, flush: "sync" }
|
|
14
49
|
);
|
|
15
|
-
const
|
|
16
|
-
const
|
|
17
|
-
() =>
|
|
18
|
-
),
|
|
19
|
-
get(
|
|
20
|
-
if (
|
|
21
|
-
if (
|
|
22
|
-
if (
|
|
23
|
-
if (
|
|
24
|
-
return
|
|
25
|
-
if (
|
|
26
|
-
if (
|
|
27
|
-
return () =>
|
|
28
|
-
const
|
|
29
|
-
return v(
|
|
50
|
+
const d = (l) => {
|
|
51
|
+
const i = s(
|
|
52
|
+
() => f(o.value, l)
|
|
53
|
+
), h = {
|
|
54
|
+
get(y, u, p) {
|
|
55
|
+
if (u === "__v_isRef") return !0;
|
|
56
|
+
if (u === "value") return i.value;
|
|
57
|
+
if (u === "then") return;
|
|
58
|
+
if (u === "c" || u === "asComponent")
|
|
59
|
+
return g(() => i.value);
|
|
60
|
+
if (u === "$raw") return i;
|
|
61
|
+
if (u === Symbol.toPrimitive)
|
|
62
|
+
return () => i.value;
|
|
63
|
+
const c = l.concat(u), m = f(o.value, c);
|
|
64
|
+
return v(m) && !b(m) ? d(c) : O(m) ? A(
|
|
65
|
+
s(() => f(o.value, c))
|
|
66
|
+
) : s(() => f(o.value, c));
|
|
30
67
|
},
|
|
31
68
|
// Make Object.keys(), for...in, v-for on object keys work
|
|
32
69
|
ownKeys() {
|
|
33
|
-
const
|
|
34
|
-
return v(
|
|
70
|
+
const y = i.value;
|
|
71
|
+
return v(y) ? Reflect.ownKeys(y) : [];
|
|
35
72
|
},
|
|
36
73
|
getOwnPropertyDescriptor() {
|
|
37
74
|
return { enumerable: !0, configurable: !0 };
|
|
38
75
|
}
|
|
39
76
|
};
|
|
40
|
-
return new Proxy({},
|
|
77
|
+
return new Proxy({}, h);
|
|
41
78
|
};
|
|
42
|
-
return
|
|
79
|
+
return d([]);
|
|
43
80
|
};
|
|
44
81
|
export {
|
|
45
|
-
|
|
82
|
+
f as atPath,
|
|
83
|
+
A as createIntlayerLeafProxy,
|
|
84
|
+
b as isComponentLike,
|
|
85
|
+
O as isIntlayerNode,
|
|
86
|
+
v as isObjectLike,
|
|
87
|
+
g as toComponent,
|
|
88
|
+
$ as useDictionary
|
|
46
89
|
};
|
|
@@ -1,59 +1,48 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import x from "@intlayer/config/built";
|
|
2
|
+
import { inject as L, isRef as P, ref as g, computed as a, toValue as m, shallowRef as R, watch as _ } from "vue";
|
|
3
3
|
import { getIntlayer as I } from "../getIntlayer.mjs";
|
|
4
|
-
import { INTLAYER_SYMBOL as
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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);
|
|
4
|
+
import { INTLAYER_SYMBOL as b } from "./installIntlayer.mjs";
|
|
5
|
+
import { atPath as i, isObjectLike as v, toComponent as k, isComponentLike as C, isIntlayerNode as O, createIntlayerLeafProxy as j } from "./useDictionary.mjs";
|
|
6
|
+
const z = (y, s) => {
|
|
7
|
+
const l = L(b), d = P(l?.locale) ? l.locale : g(l?.locale ?? x.internationalization.defaultLocale), h = a(() => (s !== void 0 ? m(s) : void 0) ?? d.value), r = R({});
|
|
8
|
+
_(
|
|
9
|
+
[() => m(y), () => h.value],
|
|
10
|
+
([n, t]) => {
|
|
11
|
+
r.value = I(n, t);
|
|
21
12
|
},
|
|
22
13
|
{ immediate: !0, flush: "sync" }
|
|
23
14
|
);
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
() =>
|
|
27
|
-
),
|
|
28
|
-
get(
|
|
29
|
-
if (
|
|
30
|
-
if (
|
|
31
|
-
if (
|
|
32
|
-
if (
|
|
33
|
-
return
|
|
34
|
-
if (
|
|
35
|
-
if (
|
|
36
|
-
return () =>
|
|
37
|
-
const
|
|
38
|
-
return
|
|
15
|
+
const f = (n) => {
|
|
16
|
+
const t = a(
|
|
17
|
+
() => i(r.value, n)
|
|
18
|
+
), w = {
|
|
19
|
+
get(u, e, K) {
|
|
20
|
+
if (e === "__v_isRef") return !0;
|
|
21
|
+
if (e === "value") return t.value;
|
|
22
|
+
if (e === "then") return;
|
|
23
|
+
if (e === "c" || e === "asComponent")
|
|
24
|
+
return k(() => t.value);
|
|
25
|
+
if (e === "$raw") return t;
|
|
26
|
+
if (e === Symbol.toPrimitive)
|
|
27
|
+
return () => t.value;
|
|
28
|
+
const o = n.concat(e), c = i(r.value, o);
|
|
29
|
+
return v(c) && !C(c) ? f(o) : O(c) ? j(
|
|
30
|
+
a(() => i(r.value, o))
|
|
31
|
+
) : a(() => i(r.value, o));
|
|
39
32
|
},
|
|
40
33
|
// Make Object.keys(), for...in, v-for on object keys work
|
|
41
34
|
ownKeys() {
|
|
42
|
-
const
|
|
43
|
-
return
|
|
35
|
+
const u = t.value;
|
|
36
|
+
return v(u) ? Reflect.ownKeys(u) : [];
|
|
44
37
|
},
|
|
45
38
|
getOwnPropertyDescriptor() {
|
|
46
39
|
return { enumerable: !0, configurable: !0 };
|
|
47
40
|
}
|
|
48
41
|
};
|
|
49
|
-
return new Proxy({},
|
|
42
|
+
return new Proxy({}, w);
|
|
50
43
|
};
|
|
51
|
-
return
|
|
44
|
+
return f([]);
|
|
52
45
|
};
|
|
53
46
|
export {
|
|
54
|
-
f as atPath,
|
|
55
|
-
w as isComponentLike,
|
|
56
|
-
m as isObjectLike,
|
|
57
|
-
A as toComponent,
|
|
58
47
|
z as useIntlayer
|
|
59
48
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { compareUrls as
|
|
2
|
-
import { onScopeDispose as
|
|
1
|
+
import { compareUrls as d } from "@intlayer/editor";
|
|
2
|
+
import { onScopeDispose as u, getCurrentInstance as p } from "vue";
|
|
3
3
|
import { useCommunicator as f } from "./communicator.mjs";
|
|
4
4
|
const o = /* @__PURE__ */ new Map();
|
|
5
5
|
let c = !1;
|
|
@@ -10,18 +10,18 @@ const m = (e, t) => {
|
|
|
10
10
|
const s = o.get(e);
|
|
11
11
|
s && (s.delete(t), s.size === 0 && o.delete(e));
|
|
12
12
|
}, w = (e, t) => {
|
|
13
|
-
c || window
|
|
14
|
-
const { type: n, data:
|
|
15
|
-
n &&
|
|
16
|
-
r(
|
|
13
|
+
c || typeof window > "u" || (window.addEventListener("message", (s) => {
|
|
14
|
+
const { type: n, data: i, senderId: a } = s.data ?? {};
|
|
15
|
+
n && a !== t && (!e || e.includes("*") || e.some((r) => d(r, s.origin))) && o.get(n)?.forEach((r) => {
|
|
16
|
+
r(i);
|
|
17
17
|
});
|
|
18
18
|
}), c = !0);
|
|
19
19
|
}, L = (e, t) => {
|
|
20
|
-
const { allowedOrigins: s, postMessage: n, senderId:
|
|
21
|
-
return w(s,
|
|
20
|
+
const { allowedOrigins: s, postMessage: n, senderId: i } = f() ?? {};
|
|
21
|
+
return w(s, i), t ? (m(e, t), u(() => l(e, t))) : p() || console.warn(
|
|
22
22
|
"useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."
|
|
23
23
|
), (r) => {
|
|
24
|
-
n({ type: e, data: r, senderId:
|
|
24
|
+
n({ type: e, data: r, senderId: i });
|
|
25
25
|
};
|
|
26
26
|
};
|
|
27
27
|
export {
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,41 +1,43 @@
|
|
|
1
1
|
import { INTLAYER_SYMBOL as o, createIntlayerClient as t, installIntlayer as n } from "./client/installIntlayer.mjs";
|
|
2
|
-
import {
|
|
3
|
-
import { useDictionaryAsync as
|
|
4
|
-
import { useDictionaryDynamic as
|
|
5
|
-
import {
|
|
6
|
-
import { useLoadDynamic as
|
|
7
|
-
import { useLocale as
|
|
8
|
-
import { _ as
|
|
9
|
-
import { installIntlayerEditor as
|
|
2
|
+
import { atPath as i, createIntlayerLeafProxy as l, isComponentLike as m, isIntlayerNode as p, isObjectLike as y, toComponent as s, useDictionary as f } from "./client/useDictionary.mjs";
|
|
3
|
+
import { useDictionaryAsync as c } from "./client/useDictionaryAsync.mjs";
|
|
4
|
+
import { useDictionaryDynamic as I } from "./client/useDictionaryDynamic.mjs";
|
|
5
|
+
import { useIntlayer as L } from "./client/useIntlayer.mjs";
|
|
6
|
+
import { useLoadDynamic as D } from "./client/useLoadDynamic.mjs";
|
|
7
|
+
import { useLocale as M } from "./client/useLocale.mjs";
|
|
8
|
+
import { _ as C } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs";
|
|
9
|
+
import { installIntlayerEditor as P } from "./editor/installIntlayerEditor.mjs";
|
|
10
10
|
import { useEditor as E } from "./editor/useEditor.mjs";
|
|
11
|
-
import { getDictionary as
|
|
12
|
-
import { getIntlayer as
|
|
13
|
-
import { INTLAYER_MARKDOWN_SYMBOL as
|
|
14
|
-
import { intlayerNodePlugins as
|
|
11
|
+
import { getDictionary as S } from "./getDictionary.mjs";
|
|
12
|
+
import { getIntlayer as _ } from "./getIntlayer.mjs";
|
|
13
|
+
import { INTLAYER_MARKDOWN_SYMBOL as B, createIntlayerMarkdownClient as T, installIntlayerMarkdown as W, useMarkdown as b } from "./markdown/installIntlayerMarkdown.mjs";
|
|
14
|
+
import { intlayerNodePlugins as j, markdownPlugin as K, markdownStringPlugin as q } from "./plugins.mjs";
|
|
15
15
|
export {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
C as ContentSelectorWrapper,
|
|
17
|
+
B as INTLAYER_MARKDOWN_SYMBOL,
|
|
18
18
|
o as INTLAYER_SYMBOL,
|
|
19
|
-
|
|
19
|
+
i as atPath,
|
|
20
20
|
t as createIntlayerClient,
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
S as
|
|
21
|
+
l as createIntlayerLeafProxy,
|
|
22
|
+
T as createIntlayerMarkdownClient,
|
|
23
|
+
S as getDictionary,
|
|
24
|
+
_ as getIntlayer,
|
|
24
25
|
n as installIntlayer,
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
26
|
+
P as installIntlayerEditor,
|
|
27
|
+
W as installIntlayerMarkdown,
|
|
28
|
+
j as intlayerNodePlugins,
|
|
29
|
+
m as isComponentLike,
|
|
30
|
+
p as isIntlayerNode,
|
|
31
|
+
y as isObjectLike,
|
|
32
|
+
K as markdownPlugin,
|
|
33
|
+
q as markdownStringPlugin,
|
|
34
|
+
s as toComponent,
|
|
35
|
+
f as useDictionary,
|
|
36
|
+
c as useDictionaryAsync,
|
|
37
|
+
I as useDictionaryDynamic,
|
|
36
38
|
E as useEditor,
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
39
|
+
L as useIntlayer,
|
|
40
|
+
D as useLoadDynamic,
|
|
41
|
+
M as useLocale,
|
|
42
|
+
b as useMarkdown
|
|
41
43
|
};
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ref as l, markRaw as i } from "vue";
|
|
2
|
-
const
|
|
3
|
-
value:
|
|
4
|
-
children:
|
|
2
|
+
const c = ({
|
|
3
|
+
value: o,
|
|
4
|
+
children: t,
|
|
5
5
|
additionalProps: u = {}
|
|
6
6
|
}) => {
|
|
7
|
-
const e = l(
|
|
8
|
-
let
|
|
9
|
-
const v = () => (e.value,
|
|
10
|
-
return Object.assign(
|
|
7
|
+
const e = l(o);
|
|
8
|
+
let a = typeof t == "function" ? () => t() : () => t;
|
|
9
|
+
const v = () => (e.value, a()), n = Object.create(String.prototype);
|
|
10
|
+
return Object.assign(n, {
|
|
11
11
|
/* component renderer */
|
|
12
12
|
render: v,
|
|
13
13
|
/* string interpolation */
|
|
@@ -21,18 +21,20 @@ const s = ({
|
|
|
21
21
|
get raw() {
|
|
22
22
|
return e.value;
|
|
23
23
|
},
|
|
24
|
-
set raw(
|
|
25
|
-
e.value =
|
|
24
|
+
set raw(r) {
|
|
25
|
+
e.value = r;
|
|
26
|
+
},
|
|
27
|
+
/* .value returns the primitive value */
|
|
28
|
+
get value() {
|
|
29
|
+
return e.value;
|
|
26
30
|
},
|
|
27
|
-
/* circular ref for the ".value" trick */
|
|
28
|
-
value: void 0,
|
|
29
31
|
/* called by useIntlayer when the dictionary entry changes */
|
|
30
|
-
__update(
|
|
31
|
-
|
|
32
|
+
__update(r) {
|
|
33
|
+
a = r.render, this.raw = r.raw;
|
|
32
34
|
},
|
|
33
35
|
...u
|
|
34
|
-
}),
|
|
36
|
+
}), i(n);
|
|
35
37
|
};
|
|
36
38
|
export {
|
|
37
|
-
|
|
39
|
+
c as renderIntlayerNode
|
|
38
40
|
};
|
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
import { DeclaredLocales, Dictionary, LocalesValues } from '@intlayer/types';
|
|
2
|
-
import { MaybeRefOrGetter } from 'vue';
|
|
2
|
+
import { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
3
3
|
import { DeepTransformContent } from '../plugins';
|
|
4
|
+
export declare const atPath: (obj: any, path: (string | number)[]) => any;
|
|
5
|
+
export declare const isObjectLike: (v: any) => boolean;
|
|
6
|
+
export declare const isComponentLike: (v: any) => boolean;
|
|
7
|
+
/** Check if value is an IntlayerNode */
|
|
8
|
+
export declare const isIntlayerNode: (v: any) => boolean;
|
|
9
|
+
/** Wrap a getter into a lightweight functional component */
|
|
10
|
+
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>>;
|
|
11
|
+
/**
|
|
12
|
+
* Create a proxy for IntlayerNode leaves that:
|
|
13
|
+
* - Is ref-like (__v_isRef) so Vue tracks reactivity and unwraps in templates
|
|
14
|
+
* - .value returns the IntlayerNode (for Vue's component :is="..." and ref unwrapping)
|
|
15
|
+
* - .raw returns the primitive string (for script access)
|
|
16
|
+
* - Passes through other IntlayerNode properties (render, toString, etc.)
|
|
17
|
+
*/
|
|
18
|
+
export declare const createIntlayerLeafProxy: (leafRef: ComputedRef<any>) => any;
|
|
4
19
|
export declare const useDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: MaybeRefOrGetter<T>, locale?: MaybeRefOrGetter<L>) => DeepTransformContent<T["content"], L>;
|
|
@@ -1,9 +1,4 @@
|
|
|
1
1
|
import { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
|
|
2
2
|
import { MaybeRefOrGetter } from 'vue';
|
|
3
3
|
import { DeepTransformContent } from '../plugins';
|
|
4
|
-
export declare const atPath: (obj: any, path: (string | number)[]) => any;
|
|
5
|
-
export declare const isObjectLike: (v: any) => boolean;
|
|
6
|
-
export declare const isComponentLike: (v: any) => boolean;
|
|
7
|
-
/** Wrap a getter into a lightweight functional component */
|
|
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
4
|
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.12",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -87,12 +87,12 @@
|
|
|
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.12",
|
|
91
|
+
"@intlayer/config": "7.3.12",
|
|
92
|
+
"@intlayer/core": "7.3.12",
|
|
93
|
+
"@intlayer/editor": "7.3.12",
|
|
94
|
+
"@intlayer/types": "7.3.12",
|
|
95
|
+
"@intlayer/unmerged-dictionaries-entry": "7.3.12"
|
|
96
96
|
},
|
|
97
97
|
"devDependencies": {
|
|
98
98
|
"@types/node": "24.10.1",
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
"vue-tsc": "3.1.5"
|
|
112
112
|
},
|
|
113
113
|
"peerDependencies": {
|
|
114
|
-
"intlayer": "7.3.
|
|
114
|
+
"intlayer": "7.3.12",
|
|
115
115
|
"vue": ">=3.0.0"
|
|
116
116
|
},
|
|
117
117
|
"peerDependenciesMeta": {
|