vue-intlayer 8.2.4 → 8.3.0-canary.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/editedContent.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 +2 -2
- 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/editedContent.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 +2 -2
- package/dist/{plugins-DzWUv12j.mjs → plugins-C5O6mfkQ.mjs} +1 -1
- package/dist/plugins-Clwptar-.js +1 -0
- package/dist/types/client/installIntlayer.d.ts +2 -1
- package/dist/types/client/useDictionary.d.ts +2 -1
- package/dist/types/client/useDictionaryAsync.d.ts +2 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +2 -1
- package/dist/types/client/useIntlayer.d.ts +1 -1
- package/dist/types/client/useLocale.d.ts +1 -1
- package/dist/types/client/useLocaleStorage.d.ts +5 -5
- package/dist/types/editor/dictionariesRecord.d.ts +1 -1
- package/dist/types/editor/editedContent.d.ts +2 -1
- package/dist/types/editor/focusDictionary.d.ts +1 -1
- package/dist/types/editor/useEditedContentRenderer.d.ts +1 -1
- 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/useIntl.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/getDictionary.d.ts +2 -1
- package/dist/types/getIntlayer.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/plugins.d.ts +2 -1
- package/package.json +16 -16
- package/dist/plugins-JE2C_MXR.js +0 -1
|
@@ -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-Clwptar-.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");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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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"});const C=require("@intlayer/core/dictionaryManipulator"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const C=require("@intlayer/core/dictionaryManipulator"),y=require("@intlayer/editor"),v=require("@intlayer/types/nodeType"),d=require("vue"),h=require("./createSharedComposable.cjs"),p=require("./useCrossFrameState.cjs");let s=null;const E=Symbol("EditedContent"),f=t=>{if(s)return s;const n=d.ref({});return s={editedContent:d.readonly(n),getEditedContentValue:(e,r)=>{const i=n.value;if(!i)return;const c=r.filter(o=>o.type!==v.NodeType.Translation),N=e.includes(":local:")||e.includes(":remote:"),a=t?.locale.value;if(N){const o=i?.[e]?.content??{};return C.getContentNodeByKeyPath(o,c,a)}const T=Object.keys(i).filter(o=>o.startsWith(`${e}:`));for(const o of T){const u=i?.[o]?.content??{},l=C.getContentNodeByKeyPath(u,c,a);if(l)return l}},setEditedContent:e=>{n.value=e}},s},S=(t,n)=>{const e=f(n);t.provide(E,e)},_=h.createSharedComposable(()=>{const t=d.inject(E);if(!t)throw new Error("EditedContent state not found");const[n,e]=p.useCrossFrameState(y.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED,{});return d.watch(n,r=>{t.editedContent.value=r??{}}),d.watch(t,r=>{e(r.editedContent.value)}),t});exports.createEditedContentClient=f;exports.installEditedContent=S;exports.useEditedContent=_;
|
|
@@ -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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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-Clwptar-.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/core/interpreter");require("@intlayer/core/markdown");require("@intlayer/core/transpiler");require("@intlayer/types");require("vue");const e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/core/interpreter");require("@intlayer/core/markdown");require("@intlayer/core/transpiler");require("@intlayer/types/nodeType");require("vue");const e=require("../plugins-Clwptar-.js");require("./editor/installIntlayerEditor.cjs");require("@intlayer/config/built");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-C5O6mfkQ.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";
|
|
@@ -2,9 +2,9 @@ import "@intlayer/config/built";
|
|
|
2
2
|
import "vue";
|
|
3
3
|
import "@intlayer/core/utils";
|
|
4
4
|
import "@intlayer/editor";
|
|
5
|
-
import "@intlayer/types";
|
|
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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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 { getContentNodeByKeyPath as u } from "@intlayer/core/dictionaryManipulator";
|
|
2
2
|
import { MessageKey as N } from "@intlayer/editor";
|
|
3
|
-
import { NodeType as p } from "@intlayer/types";
|
|
3
|
+
import { NodeType as p } from "@intlayer/types/nodeType";
|
|
4
4
|
import { ref as T, readonly as v, inject as h, watch as C } from "vue";
|
|
5
5
|
import { createSharedComposable as _ } from "./createSharedComposable.mjs";
|
|
6
6
|
import { useCrossFrameState as y } from "./useCrossFrameState.mjs";
|
|
@@ -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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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-C5O6mfkQ.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
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "@intlayer/core/interpreter";
|
|
2
2
|
import "@intlayer/core/markdown";
|
|
3
3
|
import "@intlayer/core/transpiler";
|
|
4
|
-
import "@intlayer/types";
|
|
4
|
+
import "@intlayer/types/nodeType";
|
|
5
5
|
import "vue";
|
|
6
|
-
import { h, i as k, b as w, m as b, d as f } from "../plugins-
|
|
6
|
+
import { h, i as k, b as w, m as b, d as f } from "../plugins-C5O6mfkQ.mjs";
|
|
7
7
|
import "./editor/installIntlayerEditor.mjs";
|
|
8
8
|
import "@intlayer/config/built";
|
|
9
9
|
import "@intlayer/editor";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { splitInsertionTemplate as O, getHTML as H } from "@intlayer/core/interpreter";
|
|
2
2
|
import { getMarkdownMetadata as K } from "@intlayer/core/markdown";
|
|
3
3
|
import { HTML_TAGS as L } from "@intlayer/core/transpiler";
|
|
4
|
-
import { NodeType as u } from "@intlayer/types";
|
|
4
|
+
import { NodeType as u } from "@intlayer/types/nodeType";
|
|
5
5
|
import { ref as M, readonly as S, inject as I, watch as R, defineComponent as j, computed as P, unref as N, openBlock as k, createBlock as D, withCtx as A, renderSlot as C, createElementBlock as Y, markRaw as $, h as p, Fragment as B } from "vue";
|
|
6
6
|
import { isSameKeyPath as F } from "@intlayer/core/utils";
|
|
7
7
|
import { MessageKey as h } from "@intlayer/editor";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const k=require("@intlayer/core/interpreter"),q=require("@intlayer/core/markdown"),v=require("@intlayer/core/transpiler"),d=require("@intlayer/types/nodeType"),i=require("vue"),L=require("@intlayer/core/utils"),h=require("@intlayer/editor"),M=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),O=require("./cjs/editor/communicator.cjs"),C=require("./cjs/editor/editorEnabled.cjs"),T=require("./cjs/editor/focusDictionary.cjs"),K=require("./cjs/editor/configuration.cjs"),E=require("./cjs/editor/createSharedComposable.cjs"),H=require("./cjs/editor/dictionariesRecord.cjs"),R=require("@intlayer/config/built"),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 w=(e,t=!0)=>{if(f)return f;const{defaultLocale:n}=R.internationalization??{},o=i.ref(e??n),r=c=>{o.value=c};return f={locale:i.readonly(o),setLocale:r,isCookieEnabled:t},f},F=(e,t,n=!0)=>{const o=w(t,n);return e.provide(P,o),D.installIntlayerEditor(e,o),e},I=E.createSharedComposable(()=>{const e=i.inject(P);if(!e)throw new Error("IntlayerEditor state not found");const[t,n]=A.useCrossFrameState(h.MessageKey.INTLAYER_CURRENT_LOCALE);return i.watch(e.locale,o=>{n(o)},{immediate:!0}),e}),N=E.createSharedComposable(()=>{K.useConfiguration(),C.useEditorEnabled(),T.useFocusDictionary(),B.useIframeClickMerger(),Y.useCrossURLPathSetter(),I(),H.useDictionariesRecord()}),U={key:1,style:{display:"contents"}},_=i.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(e){const t=e,n=T.useFocusDictionary(),o=C.useEditorEnabled(),r=O.useCommunicator();N();const c=i.computed(()=>t.keyPath.filter(s=>s.type!==d.NodeType.Translation)),a=i.computed(()=>n?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(n?.focusedContent.value.keyPath?.length??0)>0&&L.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)=>i.unref(o)?.enabled.value?(i.openBlock(),i.createBlock(M._sfc_main,{key:0,onPress:l,isSelecting:a.value,onHover:y,onUnhover:p},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},8,["isSelecting"])):(i.openBlock(),i.createElementBlock("span",U,[i.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=a=>g.renderIntlayerNode({...n,value:a,children:()=>i.h(_,{dictionaryKey:n.dictionaryKey,keyPath:n.keyPath},{default:()=>typeof a=="function"?a():a})}),r=o(t);if(typeof t!="function")return r;const c=(...a)=>{const l=t(...a);return o(l)};Object.setPrototypeOf(c,Object.getPrototypeOf(r));for(const a of Object.getOwnPropertyNames(r)){const l=Object.getOwnPropertyDescriptor(r,a);l&&Object.defineProperty(c,a,l)}for(const a of Object.getOwnPropertySymbols(r)){const l=Object.getOwnPropertyDescriptor(r,a);l&&Object.defineProperty(c,a,l)}return i.markRaw(c)}},G=(e,t)=>{const n=k.splitInsertionTemplate(e,t);return n.isSimple?n.parts:i.h(i.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:a=>typeof a=="string",transform:(a,l,y)=>{const p=y(a,{...l,children:a,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??[]]})}},S={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,t,n)=>{const{plugins:o,...r}=t,c=q.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:()=>i.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"?b=>y(b):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:[S,...t.plugins??[]]})}},z=()=>{const e={};for(const t of v.HTML_TAGS)e[t]=({children:n,...o})=>i.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 k.getHTML(n,c)};return g.renderIntlayerNode({...t,value:n,children:r=>o(r)})}};exports.INTLAYER_SYMBOL=P;exports._sfc_main=_;exports.createIntlayerClient=w;exports.htmlPlugin=W;exports.insertionPlugin=x;exports.installIntlayer=F;exports.intlayerNodePlugins=$;exports.markdownPlugin=V;exports.markdownStringPlugin=S;exports.useEditor=N;exports.useEditorLocale=I;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { LocalesValues } from '@intlayer/types/module_augmentation';
|
|
2
|
+
import { Locale } from '@intlayer/types/allLocales';
|
|
2
3
|
import { App, Ref } from 'vue';
|
|
3
4
|
export declare const INTLAYER_SYMBOL: unique symbol;
|
|
4
5
|
export type IntlayerProvider = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { DeclaredLocales,
|
|
1
|
+
import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
2
|
+
import { Dictionary } from '@intlayer/types/dictionary';
|
|
2
3
|
import { ComputedRef, MaybeRefOrGetter } from 'vue';
|
|
3
4
|
import { DeepTransformContent } from '../plugins';
|
|
4
5
|
export declare const atPath: (obj: any, path: (string | number)[]) => any;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Dictionary
|
|
1
|
+
import { Dictionary } from '@intlayer/types/dictionary';
|
|
2
|
+
import { LocalesValues, StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
|
|
2
3
|
import { MaybeRefOrGetter } from 'vue';
|
|
3
4
|
/**
|
|
4
5
|
* On the server side, Hook that transform a dictionary and return the content
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { Dictionary
|
|
1
|
+
import { Dictionary } from '@intlayer/types/dictionary';
|
|
2
|
+
import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
|
|
2
3
|
import { MaybeRefOrGetter } from 'vue';
|
|
3
4
|
/**
|
|
4
5
|
* On the server side, Hook that transform a dictionary and return the content
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
|
|
1
|
+
import { DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
2
2
|
import { MaybeRefOrGetter } from 'vue';
|
|
3
3
|
import { DeepTransformContent } from '../plugins';
|
|
4
4
|
/**
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import { LocalesValues } from '@intlayer/types';
|
|
1
|
+
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
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Dictionary, LocalDictionaryId } from '@intlayer/types';
|
|
1
|
+
import { Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';
|
|
2
2
|
import { App, Ref } from 'vue';
|
|
3
3
|
export type DictionaryContent = Record<LocalDictionaryId, Dictionary>;
|
|
4
4
|
type DictionariesRecordClient = {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ContentNode, Dictionary,
|
|
1
|
+
import { ContentNode, Dictionary, LocalDictionaryId } from '@intlayer/types/dictionary';
|
|
2
|
+
import { KeyPath } from '@intlayer/types/keyPath';
|
|
2
3
|
import { App, Ref } from 'vue';
|
|
3
4
|
import { IntlayerProvider } from '../client';
|
|
4
5
|
export type EditedContent = Record<Dictionary['key'], Dictionary>;
|
|
@@ -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>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Plugins } from '@intlayer/core/interpreter';
|
|
2
|
-
import {
|
|
2
|
+
import { Dictionary } from '@intlayer/types/dictionary';
|
|
3
|
+
import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
3
4
|
import { DeepTransformContent } from './plugins';
|
|
4
5
|
export declare const getDictionary: <T extends Dictionary, L extends LocalesValues = DeclaredLocales>(dictionary: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<T["content"], L>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Plugins } from '@intlayer/core/interpreter';
|
|
2
|
-
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types';
|
|
2
|
+
import { DeclaredLocales, DictionaryKeys, DictionaryRegistryContent, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
3
3
|
import { DeepTransformContent } from './plugins';
|
|
4
4
|
export declare const getIntlayer: <T extends DictionaryKeys, L extends LocalesValues = DeclaredLocales>(key: T, locale?: L, additionalPlugins?: Plugins[]) => DeepTransformContent<DictionaryRegistryContent<T>, L>;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LocalesValues } from '@intlayer/types';
|
|
1
|
+
import { LocalesValues } from '@intlayer/types/module_augmentation';
|
|
2
2
|
import { IInterpreterPluginVue } from './plugins';
|
|
3
3
|
declare module '@intlayer/core/interpreter' {
|
|
4
4
|
interface IInterpreterPlugin<T, S, L extends LocalesValues> extends IInterpreterPluginVue<T, S, L> {
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
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
|
+
import { NodeType } from '@intlayer/types/nodeType';
|
|
3
4
|
import { VNode } from 'vue';
|
|
4
5
|
import { HTMLComponents } from './html/types';
|
|
5
6
|
import { IntlayerNode as IntlayerNodeCore } from './renderIntlayerNode';
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.3.0-canary.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -79,27 +79,27 @@
|
|
|
79
79
|
"scripts": {
|
|
80
80
|
"build": "vite build",
|
|
81
81
|
"build:ci": "vite build",
|
|
82
|
-
"clean": "rimraf ./dist .turbo",
|
|
82
|
+
"clean": "bun --bun rimraf ./dist .turbo",
|
|
83
83
|
"dev": "vite build --watch",
|
|
84
|
-
"format": "biome format . --check",
|
|
85
|
-
"format:fix": "biome format --write .",
|
|
86
|
-
"lint": "biome lint .",
|
|
87
|
-
"lint:fix": "biome lint --write .",
|
|
84
|
+
"format": "bun --bun biome format . --check",
|
|
85
|
+
"format:fix": "bun --bun biome format --write .",
|
|
86
|
+
"lint": "bun --bun biome lint .",
|
|
87
|
+
"lint:fix": "bun --bun biome lint --write .",
|
|
88
88
|
"prepublish": "cp -f ../../README.md ./README.md",
|
|
89
89
|
"publish": "bun publish || true",
|
|
90
90
|
"publish:canary": "bun publish --access public --tag canary || true",
|
|
91
91
|
"publish:latest": "bun publish --access public --tag latest || true",
|
|
92
|
-
"test": "vitest run",
|
|
93
|
-
"test:watch": "vitest",
|
|
92
|
+
"test": "bun --bun vitest run",
|
|
93
|
+
"test:watch": "bun --bun vitest",
|
|
94
94
|
"typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
|
|
95
95
|
},
|
|
96
96
|
"dependencies": {
|
|
97
|
-
"@intlayer/api": "8.
|
|
98
|
-
"@intlayer/config": "8.
|
|
99
|
-
"@intlayer/core": "8.
|
|
100
|
-
"@intlayer/editor": "8.
|
|
101
|
-
"@intlayer/types": "8.
|
|
102
|
-
"@intlayer/unmerged-dictionaries-entry": "8.
|
|
97
|
+
"@intlayer/api": "8.3.0-canary.0",
|
|
98
|
+
"@intlayer/config": "8.3.0-canary.0",
|
|
99
|
+
"@intlayer/core": "8.3.0-canary.0",
|
|
100
|
+
"@intlayer/editor": "8.3.0-canary.0",
|
|
101
|
+
"@intlayer/types": "8.3.0-canary.0",
|
|
102
|
+
"@intlayer/unmerged-dictionaries-entry": "8.3.0-canary.0"
|
|
103
103
|
},
|
|
104
104
|
"devDependencies": {
|
|
105
105
|
"@types/node": "25.3.5",
|
|
@@ -110,7 +110,7 @@
|
|
|
110
110
|
"ajv": "8.17.1",
|
|
111
111
|
"fast-glob": "3.3.3",
|
|
112
112
|
"rimraf": "6.1.3",
|
|
113
|
-
"tsdown": "0.21.
|
|
113
|
+
"tsdown": "0.21.1",
|
|
114
114
|
"typescript": "5.9.3",
|
|
115
115
|
"vite": "7.3.1",
|
|
116
116
|
"vite-plugin-dts": "4.5.4",
|
|
@@ -118,7 +118,7 @@
|
|
|
118
118
|
"vue-tsc": "3.1.5"
|
|
119
119
|
},
|
|
120
120
|
"peerDependencies": {
|
|
121
|
-
"intlayer": "8.
|
|
121
|
+
"intlayer": "8.3.0-canary.0",
|
|
122
122
|
"vue": ">=3.0.0"
|
|
123
123
|
},
|
|
124
124
|
"peerDependenciesMeta": {
|
package/dist/plugins-JE2C_MXR.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const k=require("@intlayer/core/interpreter"),q=require("@intlayer/core/markdown"),v=require("@intlayer/core/transpiler"),d=require("@intlayer/types"),i=require("vue"),L=require("@intlayer/core/utils"),h=require("@intlayer/editor"),M=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),O=require("./cjs/editor/communicator.cjs"),C=require("./cjs/editor/editorEnabled.cjs"),E=require("./cjs/editor/focusDictionary.cjs"),K=require("./cjs/editor/configuration.cjs"),T=require("./cjs/editor/createSharedComposable.cjs"),H=require("./cjs/editor/dictionariesRecord.cjs"),R=require("@intlayer/config/built"),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 w=(e,t=!0)=>{if(f)return f;const{defaultLocale:n}=R.internationalization??{},o=i.ref(e??n),r=c=>{o.value=c};return f={locale:i.readonly(o),setLocale:r,isCookieEnabled:t},f},F=(e,t,n=!0)=>{const o=w(t,n);return e.provide(P,o),D.installIntlayerEditor(e,o),e},I=T.createSharedComposable(()=>{const e=i.inject(P);if(!e)throw new Error("IntlayerEditor state not found");const[t,n]=A.useCrossFrameState(h.MessageKey.INTLAYER_CURRENT_LOCALE);return i.watch(e.locale,o=>{n(o)},{immediate:!0}),e}),N=T.createSharedComposable(()=>{K.useConfiguration(),C.useEditorEnabled(),E.useFocusDictionary(),B.useIframeClickMerger(),Y.useCrossURLPathSetter(),I(),H.useDictionariesRecord()}),U={key:1,style:{display:"contents"}},_=i.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(e){const t=e,n=E.useFocusDictionary(),o=C.useEditorEnabled(),r=O.useCommunicator();N();const c=i.computed(()=>t.keyPath.filter(s=>s.type!==d.NodeType.Translation)),a=i.computed(()=>n?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(n?.focusedContent.value.keyPath?.length??0)>0&&L.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)=>i.unref(o)?.enabled.value?(i.openBlock(),i.createBlock(M._sfc_main,{key:0,onPress:l,isSelecting:a.value,onHover:y,onUnhover:p},{default:i.withCtx(()=>[i.renderSlot(s.$slots,"default")]),_:3},8,["isSelecting"])):(i.openBlock(),i.createElementBlock("span",U,[i.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=a=>g.renderIntlayerNode({...n,value:a,children:()=>i.h(_,{dictionaryKey:n.dictionaryKey,keyPath:n.keyPath},{default:()=>typeof a=="function"?a():a})}),r=o(t);if(typeof t!="function")return r;const c=(...a)=>{const l=t(...a);return o(l)};Object.setPrototypeOf(c,Object.getPrototypeOf(r));for(const a of Object.getOwnPropertyNames(r)){const l=Object.getOwnPropertyDescriptor(r,a);l&&Object.defineProperty(c,a,l)}for(const a of Object.getOwnPropertySymbols(r)){const l=Object.getOwnPropertyDescriptor(r,a);l&&Object.defineProperty(c,a,l)}return i.markRaw(c)}},G=(e,t)=>{const n=k.splitInsertionTemplate(e,t);return n.isSimple?n.parts:i.h(i.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:a=>typeof a=="string",transform:(a,l,y)=>{const p=y(a,{...l,children:a,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??[]]})}},S={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,t,n)=>{const{plugins:o,...r}=t,c=q.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:()=>i.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"?b=>y(b):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:[S,...t.plugins??[]]})}},z=()=>{const e={};for(const t of v.HTML_TAGS)e[t]=({children:n,...o})=>i.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 k.getHTML(n,c)};return g.renderIntlayerNode({...t,value:n,children:r=>o(r)})}};exports.INTLAYER_SYMBOL=P;exports._sfc_main=_;exports.createIntlayerClient=w;exports.htmlPlugin=W;exports.insertionPlugin=x;exports.installIntlayer=F;exports.intlayerNodePlugins=$;exports.markdownPlugin=V;exports.markdownStringPlugin=S;exports.useEditor=N;exports.useEditorLocale=I;
|