vue-intlayer 8.3.0-canary.3 → 8.3.0
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/installIntlayer.cjs +1 -1
- package/dist/cjs/client/useDictionary.cjs +1 -1
- package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/EditorSelectorRenderer.cjs +1 -1
- package/dist/cjs/editor/editorLocale.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/format/useCompact.cjs +1 -1
- package/dist/cjs/format/useCurrency.cjs +1 -1
- package/dist/cjs/format/useDate.cjs +1 -1
- package/dist/cjs/format/useIntl.cjs +1 -1
- package/dist/cjs/format/useList.cjs +1 -1
- package/dist/cjs/format/useNumber.cjs +1 -1
- package/dist/cjs/format/usePercentage.cjs +1 -1
- package/dist/cjs/format/useRelativeTime.cjs +1 -1
- package/dist/cjs/format/useUnit.cjs +1 -1
- package/dist/cjs/getDictionary.cjs +1 -1
- package/dist/cjs/getIntlayer.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/client/installIntlayer.mjs +1 -1
- package/dist/esm/client/useDictionary.mjs +1 -1
- package/dist/esm/client/useDictionaryAsync.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
- package/dist/esm/editor/EditorSelectorRenderer.mjs +1 -1
- package/dist/esm/editor/editorLocale.mjs +1 -1
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/editor/useEditor.mjs +1 -1
- package/dist/esm/format/useCompact.mjs +1 -1
- package/dist/esm/format/useCurrency.mjs +1 -1
- package/dist/esm/format/useDate.mjs +1 -1
- package/dist/esm/format/useIntl.mjs +1 -1
- package/dist/esm/format/useList.mjs +1 -1
- package/dist/esm/format/useNumber.mjs +1 -1
- package/dist/esm/format/usePercentage.mjs +1 -1
- package/dist/esm/format/useRelativeTime.mjs +1 -1
- package/dist/esm/format/useUnit.mjs +1 -1
- package/dist/esm/getDictionary.mjs +1 -1
- package/dist/esm/getIntlayer.mjs +1 -1
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/plugins.mjs +1 -1
- package/dist/{plugins-BchIImyr.js → plugins-Bzptc2vR.js} +1 -1
- package/dist/{plugins-XQmqLnnZ.mjs → plugins-rixQm8YE.mjs} +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +4 -4
- package/dist/types/format/useCompact.d.ts +1 -1
- package/dist/types/format/useCurrency.d.ts +1 -1
- package/dist/types/format/useDate.d.ts +1 -1
- package/dist/types/format/useList.d.ts +1 -1
- package/dist/types/format/useNumber.d.ts +1 -1
- package/dist/types/format/usePercentage.d.ts +1 -1
- package/dist/types/format/useRelativeTime.d.ts +1 -1
- package/dist/types/format/useUnit.d.ts +1 -1
- package/dist/types/plugins.d.ts +2 -2
- package/dist/types/renderIntlayerNode.d.ts +7 -2
- package/package.json +8 -8
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../plugins-Bzptc2vR.js"),e=require("./useDictionary.cjs"),i=require("./useDictionaryAsync.cjs"),n=require("./useDictionaryDynamic.cjs"),r=require("./useIntlayer.cjs"),a=require("./useLoadDynamic.cjs"),c=require("./useLocale.cjs"),s=require("./useRewriteURL.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=i.useDictionaryAsync;exports.useDictionaryDynamic=n.useDictionaryDynamic;exports.useIntlayer=r.useIntlayer;exports.useLoadDynamic=a.useLoadDynamic;exports.useLocale=c.useLocale;exports.useRewriteURL=s.useRewriteURL;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/config/built");require("vue");require("@intlayer/core/utils");require("@intlayer/editor");require("@intlayer/types/nodeType");require("../editor/communicator.cjs");const e=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/config/built");require("vue");require("@intlayer/core/utils");require("@intlayer/editor");require("@intlayer/types/nodeType");require("../editor/communicator.cjs");const e=require("../../plugins-Bzptc2vR.js");require("@intlayer/core/interpreter");require("./useLocaleStorage.cjs");require("@intlayer/core/localization");require("../editor/installIntlayerEditor.cjs");exports.INTLAYER_SYMBOL=e.INTLAYER_SYMBOL;exports.createIntlayerClient=e.createIntlayerClient;exports.installIntlayer=e.installIntlayer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("@intlayer/config/built"),t=require("vue"),k=require("../getDictionary.cjs"),C=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const j=require("@intlayer/config/built"),t=require("vue"),k=require("../getDictionary.cjs"),C=require("../../plugins-Bzptc2vR.js"),c=(e,n)=>n.reduce((o,r)=>o?.[r],e),d=e=>e!=null&&typeof e=="object",_=e=>typeof e=="function"||d(e)&&("render"in e||"setup"in e),L=e=>e!=null&&typeof e=="object"&&"__update"in e&&"render"in e&&"raw"in e,w=e=>t.markRaw(t.defineComponent({name:"IntlayerLeaf",setup(){return()=>{const n=e();return n==null?null:_(n)?t.h(n):Array.isArray(n)?t.h("span",n):n}}})),h=e=>{const n={get(o,r){const a=e.value;if(r==="__v_isRef")return!0;if(r==="value")return a??"";if(r==="$raw")return e;if(r==="__v_skip")return!0;if(r==="c"||r==="asComponent")return w(()=>e.value);if(a==null)return r===Symbol.toPrimitive||r==="toString"?()=>"":void 0;const u=a[r];return typeof u=="function"?u.bind(a):u},ownKeys(){const o=e.value;return o!=null&&typeof o=="object"?Reflect.ownKeys(o):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}};return new Proxy({},n)},I=(e,n)=>{const o=t.inject(C.INTLAYER_SYMBOL),r=t.isRef(o?.locale)?o.locale:t.ref(o?.locale??j.internationalization.defaultLocale),a=t.computed(()=>(n!==void 0?t.toValue(n):void 0)??r.value),u=t.shallowRef({});t.watch([()=>t.toValue(e),()=>a.value],([l,v])=>{u.value=k.getDictionary(l,v)},{immediate:!0,flush:"sync"});const b=l=>{const v={get(m,i,D){if(i==="__v_isRef")return!0;const s=t.computed(()=>c(u.value,l));if(i==="value")return s.value??"";if(i==="then")return;if(i==="c"||i==="asComponent")return w(()=>s.value);if(i==="$raw")return s;if(i===Symbol.toPrimitive)return()=>s.value;const f=l.concat(i),y=c(u.value,f);if(y===void 0||d(y)&&!_(y))return b(f);if(L(y))return h(t.computed(()=>c(u.value,f)));const x=t.computed(()=>c(u.value,f));return new Proxy(x,{get(g,P,R){return P==="value"?g.value??"":Reflect.get(g,P,R)}})},ownKeys(){const m=c(u.value,l);return d(m)?Reflect.ownKeys(m):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}};return new Proxy({},v)};return b([])};exports.atPath=c;exports.createIntlayerLeafProxy=h;exports.isComponentLike=_;exports.isIntlayerNode=L;exports.isObjectLike=d;exports.toComponent=w;exports.useDictionary=I;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/config/built"),e=require("vue"),u=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/config/built"),e=require("vue"),u=require("../../plugins-Bzptc2vR.js"),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 I=require("@intlayer/config/built"),t=require("vue"),b=require("../getIntlayer.cjs"),j=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const I=require("@intlayer/config/built"),t=require("vue"),b=require("../getIntlayer.cjs"),j=require("../../plugins-Bzptc2vR.js"),n=require("./useDictionary.cjs"),q=(h,v)=>{const s=t.inject(j.INTLAYER_SYMBOL),P=t.isRef(s?.locale)?s.locale:t.ref(s?.locale??I.internationalization.defaultLocale),_=t.computed(()=>(v!==void 0?t.toValue(v):void 0)??P.value),a=t.shallowRef({});t.watch([()=>t.toValue(h),()=>_.value],([r,i])=>{a.value=b.getIntlayer(r,i)},{immediate:!0,flush:"sync"});const f=new Map,d=r=>{const i=r.join(".");if(f.has(i))return f.get(i);const o=t.computed(()=>n.atPath(a.value,r)),R={get(u,e,w){if(typeof e=="symbol"||typeof e=="string"&&(e.startsWith("__")||e.startsWith("$")))return e==="__v_isRef"?!0:e==="then"?void 0:Reflect.get(u,e,w);if(e==="value")return o.value??"";if(e==="c"||e==="asComponent")return n.toComponent(()=>o.value);if(e==="$raw")return o;if(e===Symbol.toPrimitive)return()=>String(o.value??"");const l=r.concat(e),c=n.atPath(a.value,l);if(c===void 0||n.isObjectLike(c)&&!n.isComponentLike(c))return d(l);if(n.isIntlayerNode(c))return n.createIntlayerLeafProxy(t.computed(()=>n.atPath(a.value,l)));const x=t.computed(()=>n.atPath(a.value,l));return new Proxy(x,{get(g,y,L){return y==="value"?g.value??"":y==="__v_isRef"?!0:Reflect.get(g,y,L)}})},ownKeys(){const u=n.atPath(a.value,r);return n.isObjectLike(u)?Reflect.ownKeys(u):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}},m=new Proxy({},R);return f.set(i,m),m};return d([])};exports.useIntlayer=q;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/config/built"),a=require("vue"),r=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/config/built"),a=require("vue"),r=require("../../plugins-Bzptc2vR.js"),s=require("./useLocaleStorage.cjs"),u=({isCookieEnabled:c,onLocaleChange:i}={})=>{const{defaultLocale:o,locales:l}=n?.internationalization??{},t=a.inject(r.INTLAYER_SYMBOL);return{locale:a.computed(()=>t?.locale?.value??o),defaultLocale:o,availableLocales:l,setLocale:e=>{if(!l?.map(String).includes(e)){console.error(`Locale ${e} is not available`);return}t&&t.setLocale(e),s.setLocaleInStorage(e,c??t?.isCookieEnabled??!0),i?.(e)}}};exports.useLocale=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../plugins-Bzptc2vR.js");exports.default=e._sfc_main;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),o=require("../../plugins-Bzptc2vR.js"),d=require("../../EditedContentRenderer.vue_vue_type_script_setup_true_lang-DYN7KHa_.js"),l=e.defineComponent({__name:"EditorSelectorRenderer",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(i){const c=i,{keyPath:t,children:r,dictionaryKey:n}=c;return(a,u)=>(e.openBlock(),e.createBlock(o._sfc_main,{dictionaryKey:e.unref(n),keyPath:e.unref(t),children:e.unref(r)},{default:e.withCtx(()=>[e.createVNode(d._sfc_main,{dictionaryKey:e.unref(n),keyPath:e.unref(t),children:e.unref(r)},{default:e.withCtx(()=>[e.renderSlot(a.$slots,"default")]),_:3},8,["dictionaryKey","keyPath","children"])]),_:3},8,["dictionaryKey","keyPath","children"]))}});exports.default=l;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/editor");require("vue");const e=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/editor");require("vue");const e=require("../../plugins-Bzptc2vR.js");require("@intlayer/config/built");require("@intlayer/core/interpreter");require("../client/useLocaleStorage.cjs");require("@intlayer/core/localization");require("./createSharedComposable.cjs");require("./useCrossFrameState.cjs");exports.useEditorLocale=e.useEditorLocale;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("../../plugins-Bzptc2vR.js"),e=require("./installIntlayerEditor.cjs");exports.ContentSelectorWrapper=t._sfc_main;exports.useEditor=t.useEditor;exports.installIntlayerEditor=e.installIntlayerEditor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./configuration.cjs");require("./createSharedComposable.cjs");require("./dictionariesRecord.cjs");require("./editorEnabled.cjs");const e=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./configuration.cjs");require("./createSharedComposable.cjs");require("./dictionariesRecord.cjs");require("./editorEnabled.cjs");const e=require("../../plugins-Bzptc2vR.js");require("./focusDictionary.cjs");require("./useCrossURLPathState.cjs");require("./useIframeClickInterceptor.cjs");exports.useEditor=e.useEditor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/formatters"),t=require("vue"),r=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/formatters"),t=require("vue"),r=require("../../plugins-Bzptc2vR.js"),n=()=>{const c=t.inject(r.INTLAYER_SYMBOL);return t.computed(()=>{const o=c.locale.value;return(...e)=>l.compact(e[0],{...e[1],locale:e[1]?.locale??o})})};exports.useCompact=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/core/formatters"),r=require("vue"),l=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/core/formatters"),r=require("vue"),l=require("../../plugins-Bzptc2vR.js"),o=()=>{const t=r.inject(l.INTLAYER_SYMBOL);return r.computed(()=>{const c=t.locale.value;return(...e)=>n.currency(e[0],{...e[1],locale:e[1]?.locale??c})})};exports.useCurrency=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@intlayer/core/formatters"),t=require("vue"),c=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@intlayer/core/formatters"),t=require("vue"),c=require("../../plugins-Bzptc2vR.js"),n=()=>{const l=t.inject(c.INTLAYER_SYMBOL);return t.computed(()=>{const o=l.locale.value;return(...e)=>r.date(e[0],{...e[1],locale:e[1]?.locale??o})})};exports.useDate=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/utils"),e=require("vue"),u=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/utils"),e=require("vue"),u=require("../../plugins-Bzptc2vR.js"),c=t=>{const n=e.inject(u.INTLAYER_SYMBOL);return e.computed(()=>{const r=t??n.locale.value;return l.bindIntl(r)})};exports.useIntl=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@intlayer/core/formatters"),t=require("vue"),c=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@intlayer/core/formatters"),t=require("vue"),c=require("../../plugins-Bzptc2vR.js"),n=()=>{const l=t.inject(c.INTLAYER_SYMBOL);return t.computed(()=>{const o=l.locale.value;return(...e)=>r.list(e[0],{...e[1],locale:e[1]?.locale??o})})};exports.useList=n;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/core/formatters"),t=require("vue"),o=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/core/formatters"),t=require("vue"),o=require("../../plugins-Bzptc2vR.js"),u=()=>{const r=t.inject(o.INTLAYER_SYMBOL);return t.computed(()=>{const l=r.locale.value;return(...e)=>n.number(e[0],{...e[1],locale:e[1]?.locale??l})})};exports.useNumber=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/core/formatters"),t=require("vue"),l=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("@intlayer/core/formatters"),t=require("vue"),l=require("../../plugins-Bzptc2vR.js"),o=()=>{const r=t.inject(l.INTLAYER_SYMBOL);return t.computed(()=>{const c=r.locale.value;return(...e)=>n.percentage(e[0],{...e[1],locale:e[1]?.locale??c})})};exports.usePercentage=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core/formatters"),t=require("vue"),r=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core/formatters"),t=require("vue"),r=require("../../plugins-Bzptc2vR.js"),c=()=>{const l=t.inject(r.INTLAYER_SYMBOL);return t.computed(()=>{const i=l.locale.value;return(...e)=>o.relativeTime(e[0],e[1],{...e[2],locale:e[2]?.locale??i})})};exports.useRelativeTime=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core/formatters"),t=require("vue"),r=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core/formatters"),t=require("vue"),r=require("../../plugins-Bzptc2vR.js"),c=()=>{const n=t.inject(r.INTLAYER_SYMBOL);return t.computed(()=>{const l=n.locale.value;return(...e)=>o.units(e[0],{...e[1],locale:e[1]?.locale??l})})};exports.useUnit=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/interpreter"),t=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/interpreter"),t=require("../plugins-Bzptc2vR.js"),o=(e,n,i)=>{const r=[t.intlayerNodePlugins,t.insertionPlugin,t.markdownPlugin,t.htmlPlugin,...i??[]];return l.getDictionary(e,n,r)};exports.getDictionary=o;
|
package/dist/cjs/getIntlayer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/core/interpreter"),e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/core/interpreter"),e=require("../plugins-Bzptc2vR.js"),o=(t,n,r)=>{const l=[e.intlayerNodePlugins,e.insertionPlugin,e.markdownPlugin,e.htmlPlugin,...r??[]];return i.getIntlayer(t,n,l)};exports.getIntlayer=o;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../plugins-Bzptc2vR.js"),r=require("./client/useDictionary.cjs"),u=require("./client/useDictionaryAsync.cjs"),c=require("./client/useDictionaryDynamic.cjs"),y=require("./client/useIntlayer.cjs"),d=require("./client/useLoadDynamic.cjs"),L=require("./client/useLocale.cjs"),M=require("./client/useRewriteURL.cjs"),m=require("./editor/installIntlayerEditor.cjs"),I=require("./format/useIntl.cjs"),k=require("./getDictionary.cjs"),R=require("./getIntlayer.cjs"),i=require("./html/HTMLRenderer.cjs"),n=require("./html/installIntlayerHTML.cjs"),a=require("./markdown/compiler.cjs"),t=require("./markdown/installIntlayerMarkdown.cjs"),l=require("./markdown/MarkdownRenderer.cjs"),s=require("./markdown/runtime.cjs"),o=require("@intlayer/core/markdown");exports.ContentSelectorWrapper=e._sfc_main;exports.INTLAYER_SYMBOL=e.INTLAYER_SYMBOL;exports.createIntlayerClient=e.createIntlayerClient;exports.htmlPlugin=e.htmlPlugin;exports.insertionPlugin=e.insertionPlugin;exports.installIntlayer=e.installIntlayer;exports.intlayerNodePlugins=e.intlayerNodePlugins;exports.markdownPlugin=e.markdownPlugin;exports.markdownStringPlugin=e.markdownStringPlugin;exports.useEditor=e.useEditor;exports.atPath=r.atPath;exports.createIntlayerLeafProxy=r.createIntlayerLeafProxy;exports.isComponentLike=r.isComponentLike;exports.isIntlayerNode=r.isIntlayerNode;exports.isObjectLike=r.isObjectLike;exports.toComponent=r.toComponent;exports.useDictionary=r.useDictionary;exports.useDictionaryAsync=u.useDictionaryAsync;exports.useDictionaryDynamic=c.useDictionaryDynamic;exports.useIntlayer=y.useIntlayer;exports.useLoadDynamic=d.useLoadDynamic;exports.useLocale=L.useLocale;exports.useRewriteURL=M.useRewriteURL;exports.installIntlayerEditor=m.installIntlayerEditor;exports.useIntl=I.useIntl;exports.getDictionary=k.getDictionary;exports.getIntlayer=R.getIntlayer;exports.HTMLRenderer=i.HTMLRenderer;exports.renderHTML=i.renderHTML;exports.useHTMLRenderer=i.useHTMLRenderer;exports.INTLAYER_HTML_SYMBOL=n.INTLAYER_HTML_SYMBOL;exports.createIntlayerHTMLClient=n.createIntlayerHTMLClient;exports.installIntlayerHTML=n.installIntlayerHTML;exports.useHTML=n.useHTML;exports.compile=a.compile;exports.compileMarkdown=a.compileMarkdown;exports.compiler=a.compiler;exports.INTLAYER_MARKDOWN_SYMBOL=t.INTLAYER_MARKDOWN_SYMBOL;exports.createIntlayerMarkdownClient=t.createIntlayerMarkdownClient;exports.installIntlayerMarkdown=t.installIntlayerMarkdown;exports.useMarkdown=t.useMarkdown;exports.MarkdownRenderer=l.MarkdownRenderer;exports.renderMarkdown=l.renderMarkdown;exports.useMarkdownRenderer=l.useMarkdownRenderer;exports.createVueRuntime=s.createVueRuntime;exports.vueRuntime=s.default;Object.defineProperty(exports,"RuleType",{enumerable:!0,get:()=>o.RuleType});Object.defineProperty(exports,"sanitizer",{enumerable:!0,get:()=>o.sanitizer});Object.defineProperty(exports,"slugify",{enumerable:!0,get:()=>o.slugify});
|
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/config/built");require("@intlayer/core/interpreter");require("@intlayer/core/markdown");require("@intlayer/core/transpiler");require("@intlayer/types/nodeType");require("vue");const e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/config/built");require("@intlayer/core/interpreter");require("@intlayer/core/markdown");require("@intlayer/core/transpiler");require("@intlayer/types/nodeType");require("vue");const e=require("../plugins-Bzptc2vR.js");require("./editor/installIntlayerEditor.cjs");require("@intlayer/editor");require("./editor/communicator.cjs");require("./client/useLocaleStorage.cjs");require("@intlayer/core/localization");require("./markdown/installIntlayerMarkdown.cjs");require("./renderIntlayerNode.cjs");exports.htmlPlugin=e.htmlPlugin;exports.insertionPlugin=e.insertionPlugin;exports.intlayerNodePlugins=e.intlayerNodePlugins;exports.markdownPlugin=e.markdownPlugin;exports.markdownStringPlugin=e.markdownStringPlugin;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { I as r, c as t, a } from "../../plugins-
|
|
1
|
+
import { I as r, c as t, a } from "../../plugins-rixQm8YE.mjs";
|
|
2
2
|
import { atPath as i, createIntlayerLeafProxy as s, isComponentLike as m, isIntlayerNode as y, isObjectLike as c, toComponent as p, useDictionary as f } from "./useDictionary.mjs";
|
|
3
3
|
import { useDictionaryAsync as x } from "./useDictionaryAsync.mjs";
|
|
4
4
|
import { useDictionaryDynamic as u } from "./useDictionaryDynamic.mjs";
|
|
@@ -4,7 +4,7 @@ import "@intlayer/core/utils";
|
|
|
4
4
|
import "@intlayer/editor";
|
|
5
5
|
import "@intlayer/types/nodeType";
|
|
6
6
|
import "../editor/communicator.mjs";
|
|
7
|
-
import { I as c, c as y, a as L } from "../../plugins-
|
|
7
|
+
import { I as c, c as y, a as L } from "../../plugins-rixQm8YE.mjs";
|
|
8
8
|
import "@intlayer/core/interpreter";
|
|
9
9
|
import "./useLocaleStorage.mjs";
|
|
10
10
|
import "@intlayer/core/localization";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import j from "@intlayer/config/built";
|
|
2
2
|
import { markRaw as k, defineComponent as C, h as g, inject as I, isRef as D, ref as K, computed as y, toValue as P, shallowRef as O, watch as S } from "vue";
|
|
3
3
|
import { getDictionary as A } from "../getDictionary.mjs";
|
|
4
|
-
import { I as N } from "../../plugins-
|
|
4
|
+
import { I as N } from "../../plugins-rixQm8YE.mjs";
|
|
5
5
|
const l = (e, t) => t.reduce((r, n) => r?.[n], e), d = (e) => e != null && typeof e == "object", x = (e) => typeof e == "function" || d(e) && ("render" in e || "setup" in e), T = (e) => e != null && typeof e == "object" && "__update" in e && "render" in e && "raw" in e, L = (e) => k(
|
|
6
6
|
C({
|
|
7
7
|
name: "IntlayerLeaf",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import r from "@intlayer/config/built";
|
|
2
2
|
import { inject as l, computed as s, ref as u, watch as f } from "vue";
|
|
3
|
-
import { I as m } from "../../plugins-
|
|
3
|
+
import { I as m } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
import { useDictionary as y } from "./useDictionary.mjs";
|
|
5
5
|
const L = async (a, i) => {
|
|
6
6
|
const c = l(m), t = s(
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import C from "@intlayer/config/built";
|
|
2
2
|
import { inject as j, isRef as k, ref as K, computed as s, toValue as h, shallowRef as O, watch as S } from "vue";
|
|
3
3
|
import { getIntlayer as M } from "../getIntlayer.mjs";
|
|
4
|
-
import { I as N } from "../../plugins-
|
|
4
|
+
import { I as N } from "../../plugins-rixQm8YE.mjs";
|
|
5
5
|
import { atPath as o, isObjectLike as x, toComponent as T, isComponentLike as W, isIntlayerNode as Y, createIntlayerLeafProxy as $ } from "./useDictionary.mjs";
|
|
6
6
|
const V = (R, m) => {
|
|
7
7
|
const c = j(N), w = k(c?.locale) ? c.locale : K(c?.locale ?? C.internationalization.defaultLocale), _ = s(() => (m !== void 0 ? h(m) : void 0) ?? w.value), r = O({});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import i from "@intlayer/config/built";
|
|
2
2
|
import { inject as c, computed as n } from "vue";
|
|
3
|
-
import { I as s } from "../../plugins-
|
|
3
|
+
import { I as s } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
import { setLocaleInStorage as m } from "./useLocaleStorage.mjs";
|
|
5
5
|
const g = ({
|
|
6
6
|
isCookieEnabled: l,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent as d, openBlock as y, createBlock as l, unref as e, withCtx as n, createVNode as h, renderSlot as s } from "vue";
|
|
2
|
-
import { _ } from "../../plugins-
|
|
2
|
+
import { _ } from "../../plugins-rixQm8YE.mjs";
|
|
3
3
|
import { _ as f } from "../../EditedContentRenderer.vue_vue_type_script_setup_true_lang-BlN498QG.mjs";
|
|
4
4
|
const P = /* @__PURE__ */ d({
|
|
5
5
|
__name: "EditorSelectorRenderer",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import "@intlayer/editor";
|
|
2
2
|
import "vue";
|
|
3
|
-
import { e as d } from "../../plugins-
|
|
3
|
+
import { e as d } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
import "@intlayer/config/built";
|
|
5
5
|
import "@intlayer/core/interpreter";
|
|
6
6
|
import "../client/useLocaleStorage.mjs";
|
|
@@ -2,7 +2,7 @@ import "./configuration.mjs";
|
|
|
2
2
|
import "./createSharedComposable.mjs";
|
|
3
3
|
import "./dictionariesRecord.mjs";
|
|
4
4
|
import "./editorEnabled.mjs";
|
|
5
|
-
import { u as a } from "../../plugins-
|
|
5
|
+
import { u as a } from "../../plugins-rixQm8YE.mjs";
|
|
6
6
|
import "./focusDictionary.mjs";
|
|
7
7
|
import "./useCrossURLPathState.mjs";
|
|
8
8
|
import "./useIframeClickInterceptor.mjs";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { compact as e } from "@intlayer/core/formatters";
|
|
2
2
|
import { inject as l, computed as r } from "vue";
|
|
3
|
-
import { I as m } from "../../plugins-
|
|
3
|
+
import { I as m } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const i = () => {
|
|
5
5
|
const t = l(m);
|
|
6
6
|
return r(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { currency as c } from "@intlayer/core/formatters";
|
|
2
2
|
import { inject as t, computed as l } from "vue";
|
|
3
|
-
import { I as n } from "../../plugins-
|
|
3
|
+
import { I as n } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const i = () => {
|
|
5
5
|
const e = t(n);
|
|
6
6
|
return l(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { date as l } from "@intlayer/core/formatters";
|
|
2
2
|
import { inject as r, computed as c } from "vue";
|
|
3
|
-
import { I as a } from "../../plugins-
|
|
3
|
+
import { I as a } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const p = () => {
|
|
5
5
|
const e = r(a);
|
|
6
6
|
return c(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { bindIntl as e } from "@intlayer/core/utils";
|
|
2
2
|
import { inject as n, computed as c } from "vue";
|
|
3
|
-
import { I as l } from "../../plugins-
|
|
3
|
+
import { I as l } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const a = (t) => {
|
|
5
5
|
const r = n(l);
|
|
6
6
|
return c(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { list as l } from "@intlayer/core/formatters";
|
|
2
2
|
import { inject as r, computed as c } from "vue";
|
|
3
|
-
import { I as i } from "../../plugins-
|
|
3
|
+
import { I as i } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const p = () => {
|
|
5
5
|
const t = r(i);
|
|
6
6
|
return c(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { number as t } from "@intlayer/core/formatters";
|
|
2
2
|
import { inject as l, computed as c } from "vue";
|
|
3
|
-
import { I as m } from "../../plugins-
|
|
3
|
+
import { I as m } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const i = () => {
|
|
5
5
|
const e = l(m);
|
|
6
6
|
return c(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { percentage as r } from "@intlayer/core/formatters";
|
|
2
2
|
import { inject as c, computed as l } from "vue";
|
|
3
|
-
import { I as n } from "../../plugins-
|
|
3
|
+
import { I as n } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const i = () => {
|
|
5
5
|
const o = c(n);
|
|
6
6
|
return l(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { relativeTime as l } from "@intlayer/core/formatters";
|
|
2
2
|
import { inject as r, computed as c } from "vue";
|
|
3
|
-
import { I as i } from "../../plugins-
|
|
3
|
+
import { I as i } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const p = () => {
|
|
5
5
|
const o = r(i);
|
|
6
6
|
return c(() => {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { units as l } from "@intlayer/core/formatters";
|
|
2
2
|
import { inject as r, computed as c } from "vue";
|
|
3
|
-
import { I as n } from "../../plugins-
|
|
3
|
+
import { I as n } from "../../plugins-rixQm8YE.mjs";
|
|
4
4
|
const a = () => {
|
|
5
5
|
const t = r(n);
|
|
6
6
|
return c(() => {
|
package/dist/esm/getIntlayer.mjs
CHANGED
package/dist/esm/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as o, I as t, c as n, h as a, i, a as l, b as s, m, d as p, u } from "../plugins-
|
|
1
|
+
import { _ as o, I as t, c as n, h as a, i, a as l, b as s, m, d as p, u } from "../plugins-rixQm8YE.mjs";
|
|
2
2
|
import { atPath as f, createIntlayerLeafProxy as y, isComponentLike as x, isIntlayerNode as c, isObjectLike as L, toComponent as M, useDictionary as I } from "./client/useDictionary.mjs";
|
|
3
3
|
import { useDictionaryAsync as k } from "./client/useDictionaryAsync.mjs";
|
|
4
4
|
import { useDictionaryDynamic as w } from "./client/useDictionaryDynamic.mjs";
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -4,7 +4,7 @@ import "@intlayer/core/markdown";
|
|
|
4
4
|
import "@intlayer/core/transpiler";
|
|
5
5
|
import "@intlayer/types/nodeType";
|
|
6
6
|
import "vue";
|
|
7
|
-
import { h, i as k, b as w, m as b, d as f } from "../plugins-
|
|
7
|
+
import { h, i as k, b as w, m as b, d as f } from "../plugins-rixQm8YE.mjs";
|
|
8
8
|
import "./editor/installIntlayerEditor.mjs";
|
|
9
9
|
import "@intlayer/editor";
|
|
10
10
|
import "./editor/communicator.mjs";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const k=require("@intlayer/config/built"),C=require("@intlayer/core/interpreter"),v=require("@intlayer/core/markdown"),L=require("@intlayer/core/transpiler"),d=require("@intlayer/types/nodeType"),a=require("vue"),M=require("@intlayer/core/utils"),h=require("@intlayer/editor"),O=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),K=require("./cjs/editor/communicator.cjs"),T=require("./cjs/editor/editorEnabled.cjs"),E=require("./cjs/editor/focusDictionary.cjs"),H=require("./cjs/editor/configuration.cjs"),w=require("./cjs/editor/createSharedComposable.cjs"),R=require("./cjs/editor/dictionariesRecord.cjs"),D=require("./cjs/editor/installIntlayerEditor.cjs");require("./cjs/client/useLocaleStorage.cjs");require("@intlayer/core/localization");const j=require("./cjs/markdown/installIntlayerMarkdown.cjs"),g=require("./cjs/renderIntlayerNode.cjs"),A=require("./cjs/editor/useCrossFrameState.cjs"),Y=require("./cjs/editor/useCrossURLPathState.cjs"),B=require("./cjs/editor/useIframeClickInterceptor.cjs"),P=Symbol("intlayer");let f=null;const I=(e,t=!0)=>{if(f)return f;const{defaultLocale:n}=k.internationalization??{},o=a.ref(e??n),r=c=>{o.value=c};return f={locale:a.readonly(o),setLocale:r,isCookieEnabled:t},f},F=(e,t,n=!0)=>{const o=I(t,n);return e.provide(P,o),D.installIntlayerEditor(e,o),e},N=w.createSharedComposable(()=>{const e=a.inject(P);if(!e)throw new Error("IntlayerEditor state not found");const[t,n]=A.useCrossFrameState(h.MessageKey.INTLAYER_CURRENT_LOCALE);return a.watch(e.locale,o=>{n(o)},{immediate:!0}),e}),S=w.createSharedComposable(()=>{H.useConfiguration(),T.useEditorEnabled(),E.useFocusDictionary(),B.useIframeClickMerger(),Y.useCrossURLPathSetter(),N(),R.useDictionariesRecord()}),U={key:1,style:{display:"contents"}},_=a.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(e){const t=e,n=E.useFocusDictionary(),o=T.useEditorEnabled(),r=K.useCommunicator();S();const c=a.computed(()=>t.keyPath.filter(s=>s.type!==d.NodeType.Translation)),i=a.computed(()=>n?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(n?.focusedContent.value.keyPath?.length??0)>0&&M.isSameKeyPath(n?.focusedContent.value.keyPath??[],c.value)),l=()=>{n?.setFocusedContent({dictionaryKey:t.dictionaryKey,keyPath:c.value})},y=()=>{r?.postMessage({type:`${h.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:{dictionaryKey:t.dictionaryKey,keyPath:c.value}})},p=()=>{r?.postMessage({type:`${h.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:null})};return(s,u)=>a.unref(o)?.enabled.value?(a.openBlock(),a.createBlock(O._sfc_main,{key:0,onPress:l,isSelecting:i.value,onHover:y,onUnhover:p},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},8,["isSelecting"])):(a.openBlock(),a.createElementBlock("span",U,[a.renderSlot(s.$slots,"default")]))}}),$={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{children:t,...n})=>{const o=i=>g.renderIntlayerNode({...n,value:i,children:k
|
|
1
|
+
"use strict";const k=require("@intlayer/config/built"),C=require("@intlayer/core/interpreter"),v=require("@intlayer/core/markdown"),L=require("@intlayer/core/transpiler"),d=require("@intlayer/types/nodeType"),a=require("vue"),M=require("@intlayer/core/utils"),h=require("@intlayer/editor"),O=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),K=require("./cjs/editor/communicator.cjs"),T=require("./cjs/editor/editorEnabled.cjs"),E=require("./cjs/editor/focusDictionary.cjs"),H=require("./cjs/editor/configuration.cjs"),w=require("./cjs/editor/createSharedComposable.cjs"),R=require("./cjs/editor/dictionariesRecord.cjs"),D=require("./cjs/editor/installIntlayerEditor.cjs");require("./cjs/client/useLocaleStorage.cjs");require("@intlayer/core/localization");const j=require("./cjs/markdown/installIntlayerMarkdown.cjs"),g=require("./cjs/renderIntlayerNode.cjs"),A=require("./cjs/editor/useCrossFrameState.cjs"),Y=require("./cjs/editor/useCrossURLPathState.cjs"),B=require("./cjs/editor/useIframeClickInterceptor.cjs"),P=Symbol("intlayer");let f=null;const I=(e,t=!0)=>{if(f)return f;const{defaultLocale:n}=k.internationalization??{},o=a.ref(e??n),r=c=>{o.value=c};return f={locale:a.readonly(o),setLocale:r,isCookieEnabled:t},f},F=(e,t,n=!0)=>{const o=I(t,n);return e.provide(P,o),D.installIntlayerEditor(e,o),e},N=w.createSharedComposable(()=>{const e=a.inject(P);if(!e)throw new Error("IntlayerEditor state not found");const[t,n]=A.useCrossFrameState(h.MessageKey.INTLAYER_CURRENT_LOCALE);return a.watch(e.locale,o=>{n(o)},{immediate:!0}),e}),S=w.createSharedComposable(()=>{H.useConfiguration(),T.useEditorEnabled(),E.useFocusDictionary(),B.useIframeClickMerger(),Y.useCrossURLPathSetter(),N(),R.useDictionariesRecord()}),U={key:1,style:{display:"contents"}},_=a.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(e){const t=e,n=E.useFocusDictionary(),o=T.useEditorEnabled(),r=K.useCommunicator();S();const c=a.computed(()=>t.keyPath.filter(s=>s.type!==d.NodeType.Translation)),i=a.computed(()=>n?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(n?.focusedContent.value.keyPath?.length??0)>0&&M.isSameKeyPath(n?.focusedContent.value.keyPath??[],c.value)),l=()=>{n?.setFocusedContent({dictionaryKey:t.dictionaryKey,keyPath:c.value})},y=()=>{r?.postMessage({type:`${h.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:{dictionaryKey:t.dictionaryKey,keyPath:c.value}})},p=()=>{r?.postMessage({type:`${h.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:null})};return(s,u)=>a.unref(o)?.enabled.value?(a.openBlock(),a.createBlock(O._sfc_main,{key:0,onPress:l,isSelecting:i.value,onHover:y,onUnhover:p},{default:a.withCtx(()=>[a.renderSlot(s.$slots,"default")]),_:3},8,["isSelecting"])):(a.openBlock(),a.createElementBlock("span",U,[a.renderSlot(s.$slots,"default")]))}}),$={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{children:t,...n})=>{const o=i=>g.renderIntlayerNode({...n,value:i,children:k?.editor.enabled?()=>a.h(_,{dictionaryKey:n.dictionaryKey,keyPath:n.keyPath},{default:()=>typeof i=="function"?i():i}):i}),r=o(t);if(typeof t!="function")return r;const c=(...i)=>{const l=t(...i);return o(l)};Object.setPrototypeOf(c,Object.getPrototypeOf(r));for(const i of Object.getOwnPropertyNames(r)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(c,i,l)}for(const i of Object.getOwnPropertySymbols(r)){const l=Object.getOwnPropertyDescriptor(r,i);l&&Object.defineProperty(c,i,l)}return a.markRaw(c)}},G=(e,t)=>{const n=C.splitInsertionTemplate(e,t);return n.isSimple?n.parts:a.h(a.Fragment,null,n.parts)},x={id:"insertion-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Insertion,transform:(e,t,n)=>{const o=[...t.keyPath,{type:d.NodeType.Insertion}],r=e[d.NodeType.Insertion];return n(r,{...t,children:r,keyPath:o,plugins:[{id:"insertion-string-plugin",canHandle:i=>typeof i=="string",transform:(i,l,y)=>{const p=y(i,{...l,children:i,plugins:[...(t.plugins??[]).filter(s=>s.id!=="intlayer-node-plugin")]});return s=>{const u=G(p,s);return y(u,{...l,plugins:t.plugins,children:u})}}},...t.plugins??[]]})}},b={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,t,n)=>{const{plugins:o,...r}=t,c=v.getMarkdownMetadata(e),l=n(c,{plugins:[{id:"markdown-metadata-plugin",canHandle:s=>typeof s=="string"||typeof s=="number"||typeof s=="boolean"||!s,transform:(s,u)=>g.renderIntlayerNode({...u,value:s,children:e})}],dictionaryKey:r.dictionaryKey,keyPath:[]}),y=s=>g.renderIntlayerNode({...t,value:e,children:()=>a.h(_,{dictionaryKey:r.dictionaryKey,keyPath:r.keyPath},{default:()=>{const{renderMarkdown:u,components:m}=j.useMarkdown();return u(e,void 0,{...m??{},...s??{}})}}),additionalProps:{metadata:l}}),p=y();return new Proxy(p,{get(s,u,m){return u==="value"?e:u==="metadata"?l:u==="use"?q=>y(q):Reflect.get(s,u,m)}})}},V={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Markdown,transform:(e,t,n)=>{const o=[...t.keyPath,{type:d.NodeType.Markdown}],r=e[d.NodeType.Markdown];return n(r,{...t,children:r,keyPath:o,plugins:[b,...t.plugins??[]]})}},z=()=>{const e={};for(const t of L.HTML_TAGS)e[t]=({children:n,...o})=>a.h(t,o,n);return e},J=z(),W={id:"html-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.HTML,transform:(e,t)=>{const n=e[d.NodeType.HTML];e.tags;const o=r=>{const c={...J,...r};return C.getHTML(n,c)};return g.renderIntlayerNode({...t,value:n,children:r=>o(r)})}};exports.INTLAYER_SYMBOL=P;exports._sfc_main=_;exports.createIntlayerClient=I;exports.htmlPlugin=W;exports.insertionPlugin=x;exports.installIntlayer=F;exports.intlayerNodePlugins=$;exports.markdownPlugin=V;exports.markdownStringPlugin=b;exports.useEditor=S;exports.useEditorLocale=N;
|
|
@@ -2,13 +2,13 @@ import { LocalesValues } from '@intlayer/types/module_augmentation';
|
|
|
2
2
|
/**
|
|
3
3
|
* Get the locale cookie
|
|
4
4
|
*/
|
|
5
|
-
export declare const localeInStorage: import('
|
|
5
|
+
export declare const localeInStorage: import('intlayer').Locale | undefined;
|
|
6
6
|
/**
|
|
7
7
|
* @deprecated Use localeInStorage instead
|
|
8
8
|
*
|
|
9
9
|
* Get the locale cookie
|
|
10
10
|
*/
|
|
11
|
-
export declare const localeCookie: import('
|
|
11
|
+
export declare const localeCookie: import('intlayer').Locale | undefined;
|
|
12
12
|
/**
|
|
13
13
|
* Set the locale cookie
|
|
14
14
|
*/
|
|
@@ -23,7 +23,7 @@ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled: b
|
|
|
23
23
|
* Composable that provides the locale storage and a function to set it
|
|
24
24
|
*/
|
|
25
25
|
export declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
26
|
-
localeStorage: import('vue').ComputedRef<import('
|
|
26
|
+
localeStorage: import('vue').ComputedRef<import('intlayer').Locale>;
|
|
27
27
|
setLocaleStorage: (locale: LocalesValues) => void;
|
|
28
28
|
};
|
|
29
29
|
/**
|
|
@@ -34,6 +34,6 @@ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => {
|
|
|
34
34
|
* Composable that provides the locale cookie and a function to set it
|
|
35
35
|
*/
|
|
36
36
|
export declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
|
|
37
|
-
localeCookie: import('vue').ComputedRef<import('
|
|
37
|
+
localeCookie: import('vue').ComputedRef<import('intlayer').Locale>;
|
|
38
38
|
setLocaleCookie: (locale: LocalesValues) => void;
|
|
39
39
|
};
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* ```
|
|
10
10
|
*/
|
|
11
11
|
export declare const useCompact: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
12
|
-
locale?: import('
|
|
12
|
+
locale?: import('intlayer').LocalesValues;
|
|
13
13
|
}) | undefined) => string>;
|
|
@@ -20,5 +20,5 @@
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
export declare const useCurrency: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
23
|
-
locale?: import('
|
|
23
|
+
locale?: import('intlayer').LocalesValues;
|
|
24
24
|
}) | undefined) => string>;
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export declare const useDate: () => import('vue').ComputedRef<(date: string | number | Date, options?: (Intl.DateTimeFormatOptions & {
|
|
21
|
-
locale?: import('
|
|
21
|
+
locale?: import('intlayer').LocalesValues;
|
|
22
22
|
}) | undefined) => string>;
|
|
@@ -17,5 +17,5 @@
|
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
export declare const useList: () => import('vue').ComputedRef<(values: (string | number)[], options?: (Intl.ListFormatOptions & {
|
|
20
|
-
locale?: import('
|
|
20
|
+
locale?: import('intlayer').LocalesValues;
|
|
21
21
|
}) | undefined) => string>;
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
* ```
|
|
19
19
|
*/
|
|
20
20
|
export declare const useNumber: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
21
|
-
locale?: import('
|
|
21
|
+
locale?: import('intlayer').LocalesValues;
|
|
22
22
|
}) | undefined) => string>;
|
|
@@ -12,5 +12,5 @@
|
|
|
12
12
|
* ```
|
|
13
13
|
*/
|
|
14
14
|
export declare const usePercentage: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
15
|
-
locale?: import('
|
|
15
|
+
locale?: import('intlayer').LocalesValues;
|
|
16
16
|
}) | undefined) => string>;
|
|
@@ -15,6 +15,6 @@
|
|
|
15
15
|
* ```
|
|
16
16
|
*/
|
|
17
17
|
export declare const useRelativeTime: () => import('vue').ComputedRef<(from: string | number | Date, to?: string | number | Date | undefined, options?: (Intl.RelativeTimeFormatOptions & {
|
|
18
|
-
locale?: import('
|
|
18
|
+
locale?: import('intlayer').LocalesValues;
|
|
19
19
|
unit?: Intl.RelativeTimeFormatUnit;
|
|
20
20
|
}) | undefined) => string>;
|
|
@@ -14,5 +14,5 @@
|
|
|
14
14
|
* ```
|
|
15
15
|
*/
|
|
16
16
|
export declare const useUnit: () => import('vue').ComputedRef<(value: string | number, options?: (Intl.NumberFormatOptions & {
|
|
17
|
-
locale?: import('
|
|
17
|
+
locale?: import('intlayer').LocalesValues;
|
|
18
18
|
}) | undefined) => string>;
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepTransformContent as DeepTransformContentCore, IInterpreterPluginState as IInterpreterPluginStateCore, Plugins } from '@intlayer/core/interpreter';
|
|
2
|
-
import { DeclaredLocales, LocalesValues
|
|
2
|
+
import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
3
3
|
import { NodeType } from '@intlayer/types/nodeType';
|
|
4
4
|
import { VNode } from 'vue';
|
|
5
5
|
import { HTMLComponents } from './html/types';
|
|
@@ -7,7 +7,7 @@ import { IntlayerNode as IntlayerNodeCore } from './renderIntlayerNode';
|
|
|
7
7
|
/** ---------------------------------------------
|
|
8
8
|
* INTLAYER NODE PLUGIN
|
|
9
9
|
* --------------------------------------------- */
|
|
10
|
-
export type IntlayerNodeCond<T> = T extends number | string ?
|
|
10
|
+
export type IntlayerNodeCond<T> = T extends number | string ? IntlayerNode<T> : never;
|
|
11
11
|
export type IntlayerNode<T, P = {}> = IntlayerNodeCore<T> & P;
|
|
12
12
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
13
13
|
export declare const intlayerNodePlugins: Plugins;
|
|
@@ -1,12 +1,17 @@
|
|
|
1
|
+
import { ResolvedEditor } from '@intlayer/types/module_augmentation';
|
|
1
2
|
import { VNodeChild } from 'vue';
|
|
2
|
-
export type IntlayerNode<T = string> = {
|
|
3
|
+
export type IntlayerNode<T = string> = ResolvedEditor<T & {
|
|
4
|
+
raw: T;
|
|
5
|
+
render: (props?: any) => VNodeChild;
|
|
6
|
+
value: T;
|
|
7
|
+
}, VNodeChild & {
|
|
3
8
|
raw: T;
|
|
4
9
|
render: (props?: any) => VNodeChild;
|
|
5
10
|
toString: () => string;
|
|
6
11
|
value: T;
|
|
7
12
|
use: (props?: any) => IntlayerNode<T>;
|
|
8
13
|
__update: (next: IntlayerNode<T>) => void;
|
|
9
|
-
}
|
|
14
|
+
}>;
|
|
10
15
|
export declare const renderIntlayerNode: <T extends string | number | boolean | null | undefined>({ value, children, additionalProps, }: {
|
|
11
16
|
value: T;
|
|
12
17
|
children: VNodeChild | ((props?: any) => VNodeChild);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "8.3.0
|
|
3
|
+
"version": "8.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -94,12 +94,12 @@
|
|
|
94
94
|
"typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@intlayer/api": "8.3.0
|
|
98
|
-
"@intlayer/config": "8.3.0
|
|
99
|
-
"@intlayer/core": "8.3.0
|
|
100
|
-
"@intlayer/editor": "8.3.0
|
|
101
|
-
"@intlayer/types": "8.3.0
|
|
102
|
-
"@intlayer/unmerged-dictionaries-entry": "8.3.0
|
|
97
|
+
"@intlayer/api": "8.3.0",
|
|
98
|
+
"@intlayer/config": "8.3.0",
|
|
99
|
+
"@intlayer/core": "8.3.0",
|
|
100
|
+
"@intlayer/editor": "8.3.0",
|
|
101
|
+
"@intlayer/types": "8.3.0",
|
|
102
|
+
"@intlayer/unmerged-dictionaries-entry": "8.3.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@types/node": "25.4.0",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"vue-tsc": "3.1.5"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
|
-
"intlayer": "8.3.0
|
|
121
|
+
"intlayer": "8.3.0",
|
|
122
122
|
"vue": ">=3.0.0"
|
|
123
123
|
},
|
|
124
124
|
"peerDependenciesMeta": {
|