vue-intlayer 7.3.11 → 7.3.13

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 t=require("./installIntlayer.cjs"),n=require("./useDictionary.cjs"),i=require("./useDictionaryAsync.cjs"),c=require("./useDictionaryDynamic.cjs"),e=require("./useIntlayer.cjs"),a=require("./useLoadDynamic.cjs"),r=require("./useLocale.cjs");exports.INTLAYER_SYMBOL=t.INTLAYER_SYMBOL;exports.createIntlayerClient=t.createIntlayerClient;exports.installIntlayer=t.installIntlayer;exports.useDictionary=n.useDictionary;exports.useDictionaryAsync=i.useDictionaryAsync;exports.useDictionaryDynamic=c.useDictionaryDynamic;exports.atPath=e.atPath;exports.isComponentLike=e.isComponentLike;exports.isObjectLike=e.isObjectLike;exports.toComponent=e.toComponent;exports.useIntlayer=e.useIntlayer;exports.useLoadDynamic=a.useLoadDynamic;exports.useLocale=r.useLocale;
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 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
+ "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 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
+ "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 p=(e,t)=>{let s=o.get(e);s||(s=new Set,o.set(e,s)),s.add(t)},f=(e,t)=>{const s=o.get(e);s&&(s.delete(t),s.size===0&&o.delete(e))},m=(e,t)=>{u||window&&(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?(p(e,t),c.onScopeDispose(()=>f(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;
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;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./client/installIntlayer.cjs"),i=require("./client/useDictionary.cjs"),a=require("./client/useDictionaryAsync.cjs"),o=require("./client/useDictionaryDynamic.cjs"),e=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"),_=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.useDictionary=i.useDictionary;exports.useDictionaryAsync=a.useDictionaryAsync;exports.useDictionaryDynamic=o.useDictionaryDynamic;exports.atPath=e.atPath;exports.isComponentLike=e.isComponentLike;exports.isObjectLike=e.isObjectLike;exports.toComponent=e.toComponent;exports.useIntlayer=e.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=_.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
+ "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 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
+ "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 t, createIntlayerClient as r, installIntlayer as n } from "./installIntlayer.mjs";
2
- import { useDictionary as i } from "./useDictionary.mjs";
3
- import { useDictionaryAsync as s } from "./useDictionaryAsync.mjs";
4
- import { useDictionaryDynamic as p } from "./useDictionaryDynamic.mjs";
5
- import { atPath as f, isComponentLike as l, isObjectLike as x, toComponent as u, useIntlayer as L } from "./useIntlayer.mjs";
6
- import { useLoadDynamic as I } from "./useLoadDynamic.mjs";
7
- import { useLocale as k } from "./useLocale.mjs";
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
- t as INTLAYER_SYMBOL,
10
- f as atPath,
11
- r as createIntlayerClient,
12
- n as installIntlayer,
13
- l as isComponentLike,
14
- x as isObjectLike,
15
- u as toComponent,
16
- i as useDictionary,
17
- s as useDictionaryAsync,
18
- p as useDictionaryDynamic,
19
- L as useIntlayer,
20
- I as useLoadDynamic,
21
- k as useLocale
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 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);
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 s = (r) => {
16
- const t = u(
17
- () => c(n.value, r)
18
- ), w = {
19
- get(i, e, O) {
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 C(() => t.value);
25
- if (e === "$raw") return t;
26
- if (e === Symbol.toPrimitive)
27
- return () => t.value;
28
- const a = r.concat(e), f = c(n.value, a);
29
- return v(f) && !D(f) ? s(a) : u(() => c(n.value, a));
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 i = t.value;
34
- return v(i) ? Reflect.ownKeys(i) : [];
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({}, w);
77
+ return new Proxy({}, h);
41
78
  };
42
- return s([]);
79
+ return d([]);
43
80
  };
44
81
  export {
45
- p as useDictionary
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 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";
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 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);
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 v = (u) => {
25
- const r = s(
26
- () => f(i.value, u)
27
- ), R = {
28
- get(l, n, O) {
29
- if (n === "__v_isRef") return !0;
30
- if (n === "value") return r.value;
31
- if (n === "then") return;
32
- if (n === "c" || n === "asComponent")
33
- return A(() => r.value);
34
- if (n === "$raw") return r;
35
- if (n === Symbol.toPrimitive)
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));
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 l = r.value;
43
- return m(l) ? Reflect.ownKeys(l) : [];
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({}, R);
42
+ return new Proxy({}, w);
50
43
  };
51
- return v([]);
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 u } from "@intlayer/editor";
2
- import { onScopeDispose as d, getCurrentInstance as p } from "vue";
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 && (window.addEventListener("message", (s) => {
14
- const { type: n, data: a, senderId: i } = s.data ?? {};
15
- n && i !== t && (!e || e.includes("*") || e.some((r) => u(r, s.origin))) && o.get(n)?.forEach((r) => {
16
- r(a);
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: a } = f() ?? {};
21
- return w(s, a), t ? (m(e, t), d(() => l(e, t))) : p() || console.warn(
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: a });
24
+ n({ type: e, data: r, senderId: i });
25
25
  };
26
26
  };
27
27
  export {
@@ -1,41 +1,43 @@
1
1
  import { INTLAYER_SYMBOL as o, createIntlayerClient as t, installIntlayer as n } from "./client/installIntlayer.mjs";
2
- import { useDictionary as i } from "./client/useDictionary.mjs";
3
- import { useDictionaryAsync as m } from "./client/useDictionaryAsync.mjs";
4
- import { useDictionaryDynamic as s } from "./client/useDictionaryDynamic.mjs";
5
- import { atPath as f, isComponentLike as x, isObjectLike as c, toComponent as u, useIntlayer as d } from "./client/useIntlayer.mjs";
6
- import { useLoadDynamic as L } from "./client/useLoadDynamic.mjs";
7
- import { useLocale as D } from "./client/useLocale.mjs";
8
- import { _ as M } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs";
9
- import { installIntlayerEditor as C } from "./editor/installIntlayerEditor.mjs";
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 O } from "./getDictionary.mjs";
12
- import { getIntlayer as S } from "./getIntlayer.mjs";
13
- import { INTLAYER_MARKDOWN_SYMBOL as _, createIntlayerMarkdownClient as R, installIntlayerMarkdown as B, useMarkdown as T } from "./markdown/installIntlayerMarkdown.mjs";
14
- import { intlayerNodePlugins as b, markdownPlugin as h, markdownStringPlugin as j } from "./plugins.mjs";
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
- M as ContentSelectorWrapper,
17
- _ as INTLAYER_MARKDOWN_SYMBOL,
16
+ C as ContentSelectorWrapper,
17
+ B as INTLAYER_MARKDOWN_SYMBOL,
18
18
  o as INTLAYER_SYMBOL,
19
- f as atPath,
19
+ i as atPath,
20
20
  t as createIntlayerClient,
21
- R as createIntlayerMarkdownClient,
22
- O as getDictionary,
23
- S as getIntlayer,
21
+ l as createIntlayerLeafProxy,
22
+ T as createIntlayerMarkdownClient,
23
+ S as getDictionary,
24
+ _ as getIntlayer,
24
25
  n as installIntlayer,
25
- C as installIntlayerEditor,
26
- B as installIntlayerMarkdown,
27
- b as intlayerNodePlugins,
28
- x as isComponentLike,
29
- c as isObjectLike,
30
- h as markdownPlugin,
31
- j as markdownStringPlugin,
32
- u as toComponent,
33
- i as useDictionary,
34
- m as useDictionaryAsync,
35
- s as useDictionaryDynamic,
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
- d as useIntlayer,
38
- L as useLoadDynamic,
39
- D as useLocale,
40
- T as useMarkdown
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 s = ({
3
- value: n,
4
- children: a,
2
+ const c = ({
3
+ value: o,
4
+ children: t,
5
5
  additionalProps: u = {}
6
6
  }) => {
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
- return Object.assign(r, {
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(t) {
25
- e.value = t;
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(t) {
31
- o = t.render, this.raw = t.raw;
32
+ __update(r) {
33
+ a = r.render, this.raw = r.raw;
32
34
  },
33
35
  ...u
34
- }), r.value = r, i(r);
36
+ }), i(n);
35
37
  };
36
38
  export {
37
- s as renderIntlayerNode
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.11",
3
+ "version": "7.3.13",
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.11",
91
- "@intlayer/config": "7.3.11",
92
- "@intlayer/core": "7.3.11",
93
- "@intlayer/editor": "7.3.11",
94
- "@intlayer/types": "7.3.11",
95
- "@intlayer/unmerged-dictionaries-entry": "7.3.11"
90
+ "@intlayer/api": "7.3.13",
91
+ "@intlayer/config": "7.3.13",
92
+ "@intlayer/core": "7.3.13",
93
+ "@intlayer/editor": "7.3.13",
94
+ "@intlayer/types": "7.3.13",
95
+ "@intlayer/unmerged-dictionaries-entry": "7.3.13"
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.11",
114
+ "intlayer": "7.3.13",
115
115
  "vue": ">=3.0.0"
116
116
  },
117
117
  "peerDependenciesMeta": {