vue-intlayer 7.1.8 → 7.1.9

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.
Files changed (28) hide show
  1. package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B4fMFrZy.js +1 -0
  2. package/dist/{ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B3aaeQtq.mjs → ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs} +7 -4
  3. package/dist/cjs/client/installIntlayer.cjs +1 -1
  4. package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
  5. package/dist/cjs/editor/EditorSelectorRenderer.cjs +1 -1
  6. package/dist/cjs/editor/communicator.cjs +1 -1
  7. package/dist/cjs/editor/createSharedComposable.cjs +1 -1
  8. package/dist/cjs/editor/editorLocale.cjs +1 -1
  9. package/dist/cjs/editor/index.cjs +1 -1
  10. package/dist/cjs/editor/useCrossFrameMessageListener.cjs +1 -1
  11. package/dist/cjs/index.cjs +1 -1
  12. package/dist/cjs/plugins.cjs +1 -1
  13. package/dist/esm/client/installIntlayer.mjs +13 -11
  14. package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
  15. package/dist/esm/editor/EditorSelectorRenderer.mjs +1 -1
  16. package/dist/esm/editor/communicator.mjs +17 -20
  17. package/dist/esm/editor/createSharedComposable.mjs +3 -6
  18. package/dist/esm/editor/editorLocale.mjs +3 -2
  19. package/dist/esm/editor/index.mjs +6 -4
  20. package/dist/esm/editor/useCrossFrameMessageListener.mjs +13 -14
  21. package/dist/esm/index.mjs +28 -22
  22. package/dist/esm/plugins.mjs +48 -43
  23. package/dist/types/editor/createSharedComposable.d.ts +1 -1
  24. package/dist/types/editor/index.d.ts +1 -0
  25. package/dist/types/editor/installIntlayerEditor.d.ts +2 -1
  26. package/dist/types/index.d.ts +1 -0
  27. package/package.json +8 -8
  28. package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CJxI24VF.js +0 -1
@@ -0,0 +1 @@
1
+ "use strict";const e=require("vue"),_=require("@intlayer/core"),c=require("@intlayer/editor"),p=require("@intlayer/types"),h=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),E=require("./cjs/editor/communicator.cjs"),f=require("./cjs/editor/editorEnabled.cjs"),v=require("./cjs/editor/focusDictionary.cjs"),m=require("./cjs/editor/useEditor.cjs"),C=e.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(i){const t=i,o=v.useFocusDictionary(),a=f.useEditorEnabled(),s=E.useCommunicator();m.useEditor();const r=e.computed(()=>t.keyPath.filter(n=>n.type!==p.NodeType.Translation)),u=e.computed(()=>o?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(o?.focusedContent.value.keyPath?.length??0)>0&&_.isSameKeyPath(o?.focusedContent.value.keyPath??[],r.value)),d=()=>{o?.setFocusedContent({dictionaryKey:t.dictionaryKey,keyPath:r.value})},l=()=>{s?.postMessage({type:`${c.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:{dictionaryKey:t.dictionaryKey,keyPath:r.value}})},y=()=>{s?.postMessage({type:`${c.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:null})};return(n,K)=>e.unref(a)?.enabled.value?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,onPress:d,isSelecting:u.value,onHover:l,onUnhover:y},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},8,["isSelecting"])):e.renderSlot(n.$slots,"default",{key:1})}});exports._sfc_main=C;
@@ -6,7 +6,8 @@ import { _ as k } from "./ContentSelector.vue_vue_type_script_setup_true_lang-pC
6
6
  import { useCommunicator as K } from "./esm/editor/communicator.mjs";
7
7
  import { useEditorEnabled as P } from "./esm/editor/editorEnabled.mjs";
8
8
  import { useFocusDictionary as N } from "./esm/editor/focusDictionary.mjs";
9
- const b = /* @__PURE__ */ m({
9
+ import { useEditor as T } from "./esm/editor/useEditor.mjs";
10
+ const B = /* @__PURE__ */ m({
10
11
  __name: "ContentSelectorWrapper",
11
12
  props: {
12
13
  dictionaryKey: {},
@@ -17,7 +18,9 @@ const b = /* @__PURE__ */ m({
17
18
  children: {}
18
19
  },
19
20
  setup(c) {
20
- const e = c, t = N(), l = P(), a = K(), n = r(
21
+ const e = c, t = N(), l = P(), a = K();
22
+ T();
23
+ const n = r(
21
24
  () => e.keyPath.filter((o) => o.type !== C.Translation)
22
25
  ), d = r(
23
26
  () => t?.focusedContent.value?.dictionaryKey === e.dictionaryKey && (t?.focusedContent.value.keyPath?.length ?? 0) > 0 && v(
@@ -43,7 +46,7 @@ const b = /* @__PURE__ */ m({
43
46
  data: null
44
47
  });
45
48
  };
46
- return (o, T) => h(l)?.enabled.value ? (_(), f(k, {
49
+ return (o, g) => h(l)?.enabled.value ? (_(), f(k, {
47
50
  key: 0,
48
51
  onPress: y,
49
52
  isSelecting: d.value,
@@ -58,5 +61,5 @@ const b = /* @__PURE__ */ m({
58
61
  }
59
62
  });
60
63
  export {
61
- b as _
64
+ B as _
62
65
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@intlayer/config/built"),i=require("vue");require("@intlayer/core");require("@intlayer/editor");require("@intlayer/types");require("../editor/communicator.cjs");const y=require("../editor/installIntlayerEditor.cjs"),o=Symbol("intlayer");let r=null;const a=(t,n=!0)=>{if(r)return r;const{defaultLocale:l}=s.internationalization??{},e=i.ref(t??l),c=u=>{e.value=u};return r={locale:i.readonly(e),setLocale:c,isCookieEnabled:n},r},d=(t,n,l=!0)=>{const e=a(n,l);t.provide(o,e),y.installIntlayerEditor(t,e)};exports.INTLAYER_SYMBOL=o;exports.createIntlayerClient=a;exports.installIntlayer=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("@intlayer/config/built"),i=require("vue");require("@intlayer/core");require("@intlayer/editor");require("@intlayer/types");require("../editor/communicator.cjs");require("@intlayer/unmerged-dictionaries-entry");require("./useLocaleStorage.cjs");const y=require("../editor/installIntlayerEditor.cjs"),o=Symbol("intlayer");let r=null;const a=(t,n=!0)=>{if(r)return r;const{defaultLocale:l}=s.internationalization??{},e=i.ref(t??l),c=u=>{e.value=u};return r={locale:i.readonly(e),setLocale:c,isCookieEnabled:n},r},q=(t,n,l=!0)=>{const e=a(n,l);t.provide(o,e),y.installIntlayerEditor(t,e)};exports.INTLAYER_SYMBOL=o;exports.createIntlayerClient=a;exports.installIntlayer=q;
@@ -1 +1 @@
1
- "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CJxI24VF.js");exports.default=e._sfc_main;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B4fMFrZy.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"),a=require("../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CJxI24VF.js"),u=require("../../EditedContentRenderer.vue_vue_type_script_setup_true_lang-CilQuo_6.js"),d=e.defineComponent({__name:"EditorSelectorRenderer",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(i){const c=i,{keyPath:t,children:r,dictionaryKey:n}=c;return(o,_)=>(e.openBlock(),e.createBlock(a._sfc_main,{dictionaryKey:e.unref(n),keyPath:e.unref(t),children:e.unref(r)},{default:e.withCtx(()=>[e.createVNode(u._sfc_main,{dictionaryKey:e.unref(n),keyPath:e.unref(t),children:e.unref(r)},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["dictionaryKey","keyPath","children"])]),_:3},8,["dictionaryKey","keyPath","children"]))}});exports.default=d;
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),a=require("../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B4fMFrZy.js"),u=require("../../EditedContentRenderer.vue_vue_type_script_setup_true_lang-CilQuo_6.js"),d=e.defineComponent({__name:"EditorSelectorRenderer",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(i){const c=i,{keyPath:t,children:r,dictionaryKey:n}=c;return(o,_)=>(e.openBlock(),e.createBlock(a._sfc_main,{dictionaryKey:e.unref(n),keyPath:e.unref(t),children:e.unref(r)},{default:e.withCtx(()=>[e.createVNode(u._sfc_main,{dictionaryKey:e.unref(n),keyPath:e.unref(t),children:e.unref(r)},{default:e.withCtx(()=>[e.renderSlot(o.$slots,"default")]),_:3},8,["dictionaryKey","keyPath","children"])]),_:3},8,["dictionaryKey","keyPath","children"]))}});exports.default=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@intlayer/config/built"),o=require("vue"),l=()=>Math.random().toString(36).slice(2),{editor:n}=u,r={postMessage:()=>null,allowedOrigins:[n?.applicationURL,n?.editorURL,n?.cmsURL],senderId:""};let t=null;const s=Symbol("Communicator"),c=(e={postMessage:()=>null})=>t||(t=o.reactive({...r,...e,senderId:l()}),t),m=(e,i={postMessage:()=>null})=>{const a=c(i);e.provide(s,a)},d=()=>{try{return o.inject(s,r)}catch{return console.warn("useCommunicator: inject can only be used in setup(). Returning default communicator."),{postMessage:()=>null,senderId:""}}};exports.createCommunicator=c;exports.installCommunicator=m;exports.useCommunicator=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("@intlayer/config/built"),r=require("vue"),l=()=>Math.random().toString(36).slice(2),{editor:n}=u,o={postMessage:()=>null,allowedOrigins:[n?.applicationURL,n?.editorURL,n?.cmsURL],senderId:""};let e=null;const c=Symbol("Communicator"),i=(t={postMessage:()=>null})=>e||(e=r.reactive({...o,...t,senderId:l()}),e),m=(t,s={postMessage:()=>null})=>{const a=i(s);t.provide(c,a)},d=()=>{try{return r.inject(c,o)}catch{return console.warn("useCommunicator: inject can only be used in setup(). Returning default communicator."),o}};exports.createCommunicator=i;exports.installCommunicator=m;exports.useCommunicator=d;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue");function c(t){return s.getCurrentScope()?(s.onScopeDispose(t),!0):!1}const u=t=>{let r=0,o,e;const n=()=>{r-=1,e&&r<=0&&(e.stop(),o=void 0,e=void 0)};return(...i)=>(r+=1,e||(e=s.effectScope(!0),o=e.run(()=>t(...i))),c(n),o)};exports.createSharedComposable=u;exports.tryOnScopeDispose=c;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("vue"),c=t=>s.getCurrentScope()?(s.onScopeDispose(t),!0):!1,p=t=>{let r=0,o,e;const n=()=>{r-=1,e&&r<=0&&(e.stop(),o=void 0,e=void 0)};return(...i)=>(r+=1,e||(e=s.effectScope(!0),o=e.run(()=>t(...i))),c(n),o)};exports.createSharedComposable=p;exports.tryOnScopeDispose=c;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/editor"),r=require("vue"),a=require("../client/installIntlayer.cjs");require("@intlayer/core");require("@intlayer/types");require("./communicator.cjs");require("@intlayer/config/built");const s=require("./createSharedComposable.cjs"),u=require("./useCrossFrameState.cjs");require("./installIntlayerEditor.cjs");require("../client/useLocaleStorage.cjs");const n=s.createSharedComposable(()=>{const e=r.inject(a.INTLAYER_SYMBOL);if(!e)throw new Error("IntlayerEditor state not found");const[c,t]=u.useCrossFrameState(i.MessageKey.INTLAYER_CURRENT_LOCALE);return r.watch(e.locale,o=>{t(o)},{immediate:!0}),e});exports.useEditorLocale=n;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/editor"),r=require("vue"),a=require("../client/installIntlayer.cjs");require("@intlayer/core");require("@intlayer/types");require("./communicator.cjs");require("@intlayer/config/built");const s=require("./createSharedComposable.cjs"),u=require("./useCrossFrameState.cjs");require("@intlayer/unmerged-dictionaries-entry");require("./installIntlayerEditor.cjs");require("../client/useLocaleStorage.cjs");const n=s.createSharedComposable(()=>{const e=r.inject(a.INTLAYER_SYMBOL);if(!e)throw new Error("IntlayerEditor state not found");const[c,t]=u.useCrossFrameState(i.MessageKey.INTLAYER_CURRENT_LOCALE);return r.watch(e.locale,o=>{t(o)},{immediate:!0}),e});exports.useEditorLocale=n;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CJxI24VF.js"),t=require("./installIntlayerEditor.cjs");exports.ContentSelectorWrapper=e._sfc_main;exports.installIntlayerEditor=t.installIntlayerEditor;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B4fMFrZy.js"),t=require("./installIntlayerEditor.cjs"),r=require("./useEditor.cjs");exports.ContentSelectorWrapper=e._sfc_main;exports.installIntlayerEditor=t.installIntlayerEditor;exports.useEditor=r.useEditor;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@intlayer/editor"),c=require("vue"),f=require("./communicator.cjs"),n=new Map;let u=!1;function l(e,t){let s=n.get(e);s||(s=new Set,n.set(e,s)),s.add(t)}function p(e,t){const s=n.get(e);s&&(s.delete(t),s.size===0&&n.delete(e))}function m(e,t){u||window&&(window.addEventListener("message",s=>{const{type:o,data:i,senderId:a}=s.data??{};o&&a!==t&&(!e||e.includes("*")||e.some(r=>d.compareUrls(r,s.origin)))&&n.get(o)?.forEach(r=>r(i))}),u=!0)}const b=(e,t)=>{const{allowedOrigins:s,postMessage:o,senderId:i}=f.useCommunicator();return m(s,i),t?(l(e,t),c.onScopeDispose(()=>p(e,t))):c.getCurrentInstance()||console.warn("useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."),r=>{o({type:e,data:r,senderId:i})}};exports.useCrossFrameMessageListener=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@intlayer/editor"),c=require("vue"),l=require("./communicator.cjs"),o=new Map;let u=!1;const p=(e,t)=>{let s=o.get(e);s||(s=new Set,o.set(e,s)),s.add(t)},f=(e,t)=>{const s=o.get(e);s&&(s.delete(t),s.size===0&&o.delete(e))},m=(e,t)=>{u||window&&(window.addEventListener("message",s=>{const{type:n,data:i,senderId:a}=s.data??{};n&&a!==t&&(!e||e.includes("*")||e.some(r=>d.compareUrls(r,s.origin)))&&o.get(n)?.forEach(r=>{r(i)})}),u=!0)},b=(e,t)=>{const{allowedOrigins:s,postMessage:n,senderId:i}=l.useCommunicator()??{};return m(s,i),t?(p(e,t),c.onScopeDispose(()=>f(e,t))):c.getCurrentInstance()||console.warn("useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."),r=>{n({type:e,data:r,senderId:i})}};exports.useCrossFrameMessageListener=b;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./client/installIntlayer.cjs"),r=require("./client/useDictionary.cjs"),a=require("./client/useDictionaryAsync.cjs"),o=require("./client/useDictionaryDynamic.cjs"),e=require("./client/useIntlayer.cjs"),l=require("./client/useLoadDynamic.cjs"),c=require("./client/useLocale.cjs"),s=require("./getDictionary.cjs"),u=require("./getIntlayer.cjs"),n=require("./markdown/installIntlayerMarkdown.cjs"),i=require("./plugins.cjs");exports.INTLAYER_SYMBOL=t.INTLAYER_SYMBOL;exports.createIntlayerClient=t.createIntlayerClient;exports.installIntlayer=t.installIntlayer;exports.useDictionary=r.useDictionary;exports.useDictionaryAsync=a.useDictionaryAsync;exports.useDictionaryDynamic=o.useDictionaryDynamic;exports.atPath=e.atPath;exports.isComponentLike=e.isComponentLike;exports.isObjectLike=e.isObjectLike;exports.toComponent=e.toComponent;exports.useIntlayer=e.useIntlayer;exports.useLoadDynamic=l.useLoadDynamic;exports.useLocale=c.useLocale;exports.getDictionary=s.getDictionary;exports.getIntlayer=u.getIntlayer;exports.INTLAYER_MARKDOWN_SYMBOL=n.INTLAYER_MARKDOWN_SYMBOL;exports.createIntlayerMarkdownClient=n.createIntlayerMarkdownClient;exports.installIntlayerMarkdown=n.installIntlayerMarkdown;exports.useMarkdown=n.useMarkdown;exports.intlayerNodePlugins=i.intlayerNodePlugins;exports.markdownPlugin=i.markdownPlugin;exports.markdownStringPlugin=i.markdownStringPlugin;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const n=require("./client/installIntlayer.cjs"),i=require("./client/useDictionary.cjs"),a=require("./client/useDictionaryAsync.cjs"),o=require("./client/useDictionaryDynamic.cjs"),e=require("./client/useIntlayer.cjs"),l=require("./client/useLoadDynamic.cjs"),s=require("./client/useLocale.cjs"),c=require("../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B4fMFrZy.js"),u=require("./editor/installIntlayerEditor.cjs"),y=require("./editor/useEditor.cjs"),d=require("./getDictionary.cjs"),_=require("./getIntlayer.cjs"),t=require("./markdown/installIntlayerMarkdown.cjs"),r=require("./plugins.cjs");exports.INTLAYER_SYMBOL=n.INTLAYER_SYMBOL;exports.createIntlayerClient=n.createIntlayerClient;exports.installIntlayer=n.installIntlayer;exports.useDictionary=i.useDictionary;exports.useDictionaryAsync=a.useDictionaryAsync;exports.useDictionaryDynamic=o.useDictionaryDynamic;exports.atPath=e.atPath;exports.isComponentLike=e.isComponentLike;exports.isObjectLike=e.isObjectLike;exports.toComponent=e.toComponent;exports.useIntlayer=e.useIntlayer;exports.useLoadDynamic=l.useLoadDynamic;exports.useLocale=s.useLocale;exports.ContentSelectorWrapper=c._sfc_main;exports.installIntlayerEditor=u.installIntlayerEditor;exports.useEditor=y.useEditor;exports.getDictionary=d.getDictionary;exports.getIntlayer=_.getIntlayer;exports.INTLAYER_MARKDOWN_SYMBOL=t.INTLAYER_MARKDOWN_SYMBOL;exports.createIntlayerMarkdownClient=t.createIntlayerMarkdownClient;exports.installIntlayerMarkdown=t.installIntlayerMarkdown;exports.useMarkdown=t.useMarkdown;exports.intlayerNodePlugins=r.intlayerNodePlugins;exports.markdownPlugin=r.markdownPlugin;exports.markdownStringPlugin=r.markdownStringPlugin;
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@intlayer/core"),i=require("@intlayer/types"),l=require("vue"),y=require("../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CJxI24VF.js");require("./editor/installIntlayerEditor.cjs");const k=require("./markdown/installIntlayerMarkdown.cjs"),o=require("./renderIntlayerNode.cjs"),m={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{children:n,...r})=>o.renderIntlayerNode({...r,value:n,children:()=>l.h(y._sfc_main,{dictionaryKey:r.dictionaryKey,keyPath:r.keyPath},{default:()=>n})})},u={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,n,r)=>{const{plugins:d,...a}=n,s=p.getMarkdownMetadata(e),c=r(s,{plugins:[{id:"markdown-metadata-plugin",canHandle:t=>typeof t=="string"||typeof t=="number"||typeof t=="boolean"||!t,transform:(t,g)=>o.renderIntlayerNode({...g,value:t,children:e})}],dictionaryKey:a.dictionaryKey,keyPath:[]});return o.renderIntlayerNode({...n,value:e,children:()=>l.h(y._sfc_main,{dictionaryKey:a.dictionaryKey,keyPath:a.keyPath},{default:()=>{const{renderMarkdown:t}=k.useMarkdown();return t(e)}}),additionalProps:{metadata:c}})}},P={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===i.NodeType.Markdown,transform:(e,n,r)=>{const d=[...n.keyPath,{type:i.NodeType.Markdown}],a=e[i.NodeType.Markdown];return r(a,{...n,children:a,keyPath:d,plugins:[u,...n.plugins??[]]})}};exports.intlayerNodePlugins=m;exports.markdownPlugin=P;exports.markdownStringPlugin=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const p=require("@intlayer/core"),i=require("@intlayer/types"),u=require("vue"),l=require("../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B4fMFrZy.js");require("./editor/installIntlayerEditor.cjs");require("@intlayer/config/built");require("@intlayer/editor");require("./editor/communicator.cjs");require("@intlayer/unmerged-dictionaries-entry");require("./client/useLocaleStorage.cjs");const k=require("./markdown/installIntlayerMarkdown.cjs"),o=require("./renderIntlayerNode.cjs"),m={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{children:n,...t})=>o.renderIntlayerNode({...t,value:n,children:()=>u.h(l._sfc_main,{dictionaryKey:t.dictionaryKey,keyPath:t.keyPath},{default:()=>n})})},y={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,n,t)=>{const{plugins:d,...a}=n,s=p.getMarkdownMetadata(e),c=t(s,{plugins:[{id:"markdown-metadata-plugin",canHandle:r=>typeof r=="string"||typeof r=="number"||typeof r=="boolean"||!r,transform:(r,g)=>o.renderIntlayerNode({...g,value:r,children:e})}],dictionaryKey:a.dictionaryKey,keyPath:[]});return o.renderIntlayerNode({...n,value:e,children:()=>u.h(l._sfc_main,{dictionaryKey:a.dictionaryKey,keyPath:a.keyPath},{default:()=>{const{renderMarkdown:r}=k.useMarkdown();return r(e)}}),additionalProps:{metadata:c}})}},P={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===i.NodeType.Markdown,transform:(e,n,t)=>{const d=[...n.keyPath,{type:i.NodeType.Markdown}],a=e[i.NodeType.Markdown];return t(a,{...n,children:a,keyPath:d,plugins:[y,...n.plugins??[]]})}};exports.intlayerNodePlugins=m;exports.markdownPlugin=P;exports.markdownStringPlugin=y;
@@ -4,25 +4,27 @@ import "@intlayer/core";
4
4
  import "@intlayer/editor";
5
5
  import "@intlayer/types";
6
6
  import "../editor/communicator.mjs";
7
+ import "@intlayer/unmerged-dictionaries-entry";
8
+ import "./useLocaleStorage.mjs";
7
9
  import { installIntlayerEditor as s } from "../editor/installIntlayerEditor.mjs";
8
- const u = Symbol("intlayer");
10
+ const p = Symbol("intlayer");
9
11
  let r = null;
10
- const f = (o, e = !0) => {
12
+ const u = (o, e = !0) => {
11
13
  if (r) return r;
12
- const { defaultLocale: n } = a.internationalization ?? {}, t = c(o ?? n), l = (i) => {
13
- t.value = i;
14
+ const { defaultLocale: n } = a.internationalization ?? {}, t = c(o ?? n), i = (l) => {
15
+ t.value = l;
14
16
  };
15
17
  return r = {
16
18
  locale: m(t),
17
- setLocale: l,
19
+ setLocale: i,
18
20
  isCookieEnabled: e
19
21
  }, r;
20
- }, E = (o, e, n = !0) => {
21
- const t = f(e, n);
22
- o.provide(u, t), s(o, t);
22
+ }, Y = (o, e, n = !0) => {
23
+ const t = u(e, n);
24
+ o.provide(p, t), s(o, t);
23
25
  };
24
26
  export {
25
- u as INTLAYER_SYMBOL,
26
- f as createIntlayerClient,
27
- E as installIntlayer
27
+ p as INTLAYER_SYMBOL,
28
+ u as createIntlayerClient,
29
+ Y as installIntlayer
28
30
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B3aaeQtq.mjs";
1
+ import { _ as f } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs";
2
2
  export {
3
3
  f as default
4
4
  };
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as d, createBlock as y, openBlock as l, unref as e, withCtx as n, createVNode as h, renderSlot as s } from "vue";
2
- import { _ } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B3aaeQtq.mjs";
2
+ import { _ } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs";
3
3
  import { _ as f } from "../../EditedContentRenderer.vue_vue_type_script_setup_true_lang-GmacOkG4.mjs";
4
4
  const P = /* @__PURE__ */ d({
5
5
  __name: "EditorSelectorRenderer",
@@ -1,36 +1,33 @@
1
1
  import i from "@intlayer/config/built";
2
- import { inject as a, reactive as l } from "vue";
3
- const u = () => Math.random().toString(36).slice(2), { editor: e } = i, o = {
2
+ import { inject as a, reactive as u } from "vue";
3
+ const l = () => Math.random().toString(36).slice(2), { editor: o } = i, e = {
4
4
  postMessage: () => null,
5
5
  allowedOrigins: [
6
- e?.applicationURL,
7
- e?.editorURL,
8
- e?.cmsURL
6
+ o?.applicationURL,
7
+ o?.editorURL,
8
+ o?.cmsURL
9
9
  ],
10
10
  senderId: ""
11
11
  };
12
- let t = null;
13
- const r = Symbol("Communicator"), m = (n = { postMessage: () => null }) => t || (t = l({
14
- ...o,
15
- ...n,
16
- senderId: u()
17
- }), t), g = (n, s = { postMessage: () => null }) => {
18
- const c = m(s);
19
- n.provide(r, c);
20
- }, M = () => {
12
+ let n = null;
13
+ const r = Symbol("Communicator"), m = (t = { postMessage: () => null }) => n || (n = u({
14
+ ...e,
15
+ ...t,
16
+ senderId: l()
17
+ }), n), g = (t, c = { postMessage: () => null }) => {
18
+ const s = m(c);
19
+ t.provide(r, s);
20
+ }, C = () => {
21
21
  try {
22
- return a(r, o);
22
+ return a(r, e);
23
23
  } catch {
24
24
  return console.warn(
25
25
  "useCommunicator: inject can only be used in setup(). Returning default communicator."
26
- ), {
27
- postMessage: () => null,
28
- senderId: ""
29
- };
26
+ ), e;
30
27
  }
31
28
  };
32
29
  export {
33
30
  m as createCommunicator,
34
31
  g as installCommunicator,
35
- M as useCommunicator
32
+ C as useCommunicator
36
33
  };
@@ -1,13 +1,10 @@
1
- import { effectScope as p, getCurrentScope as c, onScopeDispose as i } from "vue";
2
- function u(t) {
3
- return c() ? (i(t), !0) : !1;
4
- }
5
- const a = (t) => {
1
+ import { effectScope as c, getCurrentScope as n, onScopeDispose as i } from "vue";
2
+ const u = (t) => n() ? (i(t), !0) : !1, a = (t) => {
6
3
  let r = 0, o, e;
7
4
  const s = () => {
8
5
  r -= 1, e && r <= 0 && (e.stop(), o = void 0, e = void 0);
9
6
  };
10
- return (...n) => (r += 1, e || (e = p(!0), o = e.run(() => t(...n))), u(s), o);
7
+ return (...p) => (r += 1, e || (e = c(!0), o = e.run(() => t(...p))), u(s), o);
11
8
  };
12
9
  export {
13
10
  a as createSharedComposable,
@@ -7,9 +7,10 @@ import "./communicator.mjs";
7
7
  import "@intlayer/config/built";
8
8
  import { createSharedComposable as p } from "./createSharedComposable.mjs";
9
9
  import { useCrossFrameState as s } from "./useCrossFrameState.mjs";
10
+ import "@intlayer/unmerged-dictionaries-entry";
10
11
  import "./installIntlayerEditor.mjs";
11
12
  import "../client/useLocaleStorage.mjs";
12
- const w = p(() => {
13
+ const A = p(() => {
13
14
  const t = m(a);
14
15
  if (!t)
15
16
  throw new Error("IntlayerEditor state not found");
@@ -25,5 +26,5 @@ const w = p(() => {
25
26
  ), t;
26
27
  });
27
28
  export {
28
- w as useEditorLocale
29
+ A as useEditorLocale
29
30
  };
@@ -1,6 +1,8 @@
1
- import { _ as e } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B3aaeQtq.mjs";
2
- import { installIntlayerEditor as a } from "./installIntlayerEditor.mjs";
1
+ import { _ as t } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs";
2
+ import { installIntlayerEditor as p } from "./installIntlayerEditor.mjs";
3
+ import { useEditor as l } from "./useEditor.mjs";
3
4
  export {
4
- e as ContentSelectorWrapper,
5
- a as installIntlayerEditor
5
+ t as ContentSelectorWrapper,
6
+ p as installIntlayerEditor,
7
+ l as useEditor
6
8
  };
@@ -1,28 +1,27 @@
1
1
  import { compareUrls as u } from "@intlayer/editor";
2
- import { onScopeDispose as f, getCurrentInstance as d } from "vue";
3
- import { useCommunicator as p } from "./communicator.mjs";
2
+ import { onScopeDispose as d, getCurrentInstance as p } from "vue";
3
+ import { useCommunicator as f } from "./communicator.mjs";
4
4
  const o = /* @__PURE__ */ new Map();
5
5
  let c = !1;
6
- function m(e, t) {
6
+ const m = (e, t) => {
7
7
  let s = o.get(e);
8
8
  s || (s = /* @__PURE__ */ new Set(), o.set(e, s)), s.add(t);
9
- }
10
- function l(e, t) {
9
+ }, l = (e, t) => {
11
10
  const s = o.get(e);
12
11
  s && (s.delete(t), s.size === 0 && o.delete(e));
13
- }
14
- function w(e, t) {
12
+ }, w = (e, t) => {
15
13
  c || window && (window.addEventListener("message", (s) => {
16
- const { type: n, data: i, senderId: a } = s.data ?? {};
17
- n && a !== t && (!e || e.includes("*") || e.some((r) => u(r, s.origin))) && o.get(n)?.forEach((r) => r(i));
14
+ const { type: n, data: a, senderId: i } = s.data ?? {};
15
+ n && i !== t && (!e || e.includes("*") || e.some((r) => u(r, s.origin))) && o.get(n)?.forEach((r) => {
16
+ r(a);
17
+ });
18
18
  }), c = !0);
19
- }
20
- const L = (e, t) => {
21
- const { allowedOrigins: s, postMessage: n, senderId: i } = p();
22
- return w(s, i), t ? (m(e, t), f(() => l(e, t))) : d() || console.warn(
19
+ }, L = (e, t) => {
20
+ const { allowedOrigins: s, postMessage: n, senderId: a } = f() ?? {};
21
+ return w(s, a), t ? (m(e, t), d(() => l(e, t))) : p() || console.warn(
23
22
  "useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."
24
23
  ), (r) => {
25
- n({ type: e, data: r, senderId: i });
24
+ n({ type: e, data: r, senderId: a });
26
25
  };
27
26
  };
28
27
  export {
@@ -1,35 +1,41 @@
1
1
  import { INTLAYER_SYMBOL as o, createIntlayerClient as t, installIntlayer as n } from "./client/installIntlayer.mjs";
2
2
  import { useDictionary as i } from "./client/useDictionary.mjs";
3
3
  import { useDictionaryAsync as m } from "./client/useDictionaryAsync.mjs";
4
- import { useDictionaryDynamic as p } from "./client/useDictionaryDynamic.mjs";
5
- import { atPath as c, isComponentLike as f, isObjectLike as x, toComponent as u, useIntlayer as I } from "./client/useIntlayer.mjs";
6
- import { useLoadDynamic as d } from "./client/useLoadDynamic.mjs";
4
+ import { useDictionaryDynamic as s } from "./client/useDictionaryDynamic.mjs";
5
+ import { atPath as f, isComponentLike as x, isObjectLike as c, toComponent as u, useIntlayer as d } from "./client/useIntlayer.mjs";
6
+ import { useLoadDynamic as L } from "./client/useLoadDynamic.mjs";
7
7
  import { useLocale as D } from "./client/useLocale.mjs";
8
- import { getDictionary as M } from "./getDictionary.mjs";
9
- import { getIntlayer as A } from "./getIntlayer.mjs";
10
- import { INTLAYER_MARKDOWN_SYMBOL as N, createIntlayerMarkdownClient as O, installIntlayerMarkdown as P, useMarkdown as Y } from "./markdown/installIntlayerMarkdown.mjs";
11
- import { intlayerNodePlugins as S, markdownPlugin as _, markdownStringPlugin as B } from "./plugins.mjs";
8
+ import { _ as M } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs";
9
+ import { installIntlayerEditor as C } from "./editor/installIntlayerEditor.mjs";
10
+ import { useEditor as E } from "./editor/useEditor.mjs";
11
+ import { getDictionary as O } from "./getDictionary.mjs";
12
+ import { getIntlayer as S } from "./getIntlayer.mjs";
13
+ import { INTLAYER_MARKDOWN_SYMBOL as _, createIntlayerMarkdownClient as R, installIntlayerMarkdown as B, useMarkdown as T } from "./markdown/installIntlayerMarkdown.mjs";
14
+ import { intlayerNodePlugins as b, markdownPlugin as h, markdownStringPlugin as j } from "./plugins.mjs";
12
15
  export {
13
- N as INTLAYER_MARKDOWN_SYMBOL,
16
+ M as ContentSelectorWrapper,
17
+ _ as INTLAYER_MARKDOWN_SYMBOL,
14
18
  o as INTLAYER_SYMBOL,
15
- c as atPath,
19
+ f as atPath,
16
20
  t as createIntlayerClient,
17
- O as createIntlayerMarkdownClient,
18
- M as getDictionary,
19
- A as getIntlayer,
21
+ R as createIntlayerMarkdownClient,
22
+ O as getDictionary,
23
+ S as getIntlayer,
20
24
  n as installIntlayer,
21
- P as installIntlayerMarkdown,
22
- S as intlayerNodePlugins,
23
- f as isComponentLike,
24
- x as isObjectLike,
25
- _ as markdownPlugin,
26
- B as markdownStringPlugin,
25
+ C as installIntlayerEditor,
26
+ B as installIntlayerMarkdown,
27
+ b as intlayerNodePlugins,
28
+ x as isComponentLike,
29
+ c as isObjectLike,
30
+ h as markdownPlugin,
31
+ j as markdownStringPlugin,
27
32
  u as toComponent,
28
33
  i as useDictionary,
29
34
  m as useDictionaryAsync,
30
- p as useDictionaryDynamic,
31
- I as useIntlayer,
32
- d as useLoadDynamic,
35
+ s as useDictionaryDynamic,
36
+ E as useEditor,
37
+ d as useIntlayer,
38
+ L as useLoadDynamic,
33
39
  D as useLocale,
34
- Y as useMarkdown
40
+ T as useMarkdown
35
41
  };
@@ -1,91 +1,96 @@
1
- import { getMarkdownMetadata as u } from "@intlayer/core";
2
- import { NodeType as o } from "@intlayer/types";
1
+ import { getMarkdownMetadata as c } from "@intlayer/core";
2
+ import { NodeType as e } from "@intlayer/types";
3
3
  import { h as y } from "vue";
4
- import { _ as l } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-B3aaeQtq.mjs";
4
+ import { _ as m } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-HcQvp9bv.mjs";
5
5
  import "./editor/installIntlayerEditor.mjs";
6
- import { useMarkdown as p } from "./markdown/installIntlayerMarkdown.mjs";
6
+ import "@intlayer/config/built";
7
+ import "@intlayer/editor";
8
+ import "./editor/communicator.mjs";
9
+ import "@intlayer/unmerged-dictionaries-entry";
10
+ import "./client/useLocaleStorage.mjs";
11
+ import { useMarkdown as u } from "./markdown/installIntlayerMarkdown.mjs";
7
12
  import { renderIntlayerNode as i } from "./renderIntlayerNode.mjs";
8
- const H = {
13
+ const x = {
9
14
  id: "intlayer-node-plugin",
10
- canHandle: (n) => typeof n == "bigint" || typeof n == "string" || typeof n == "number",
11
- transform: (n, { children: t, ...r }) => i({
12
- ...r,
13
- value: t,
15
+ canHandle: (t) => typeof t == "bigint" || typeof t == "string" || typeof t == "number",
16
+ transform: (t, { children: n, ...a }) => i({
17
+ ...a,
18
+ value: n,
14
19
  children: () => y(
15
20
  // EditorSelectorRenderer, // Maximum stack size exceeded
16
- l,
21
+ m,
17
22
  {
18
- dictionaryKey: r.dictionaryKey,
19
- keyPath: r.keyPath
23
+ dictionaryKey: a.dictionaryKey,
24
+ keyPath: a.keyPath
20
25
  },
21
26
  {
22
- default: () => t
27
+ default: () => n
23
28
  }
24
29
  )
25
30
  })
26
31
  }, f = {
27
32
  id: "markdown-string-plugin",
28
- canHandle: (n) => typeof n == "string",
29
- transform: (n, t, r) => {
33
+ canHandle: (t) => typeof t == "string",
34
+ transform: (t, n, a) => {
30
35
  const {
31
36
  plugins: d,
32
37
  // Removed to avoid next error - Functions cannot be passed directly to Client Components
33
- ...e
34
- } = t, m = u(n), s = r(m, {
38
+ ...o
39
+ } = n, l = c(t), p = a(l, {
35
40
  plugins: [{
36
41
  id: "markdown-metadata-plugin",
37
- canHandle: (a) => typeof a == "string" || typeof a == "number" || typeof a == "boolean" || !a,
38
- transform: (a, c) => i({
39
- ...c,
40
- value: a,
41
- children: n
42
+ canHandle: (r) => typeof r == "string" || typeof r == "number" || typeof r == "boolean" || !r,
43
+ transform: (r, s) => i({
44
+ ...s,
45
+ value: r,
46
+ children: t
42
47
  })
43
48
  }],
44
- dictionaryKey: e.dictionaryKey,
49
+ dictionaryKey: o.dictionaryKey,
45
50
  keyPath: []
46
51
  });
47
52
  return i({
48
- ...t,
49
- value: n,
53
+ ...n,
54
+ value: t,
50
55
  children: () => y(
51
56
  // EditorSelectorRenderer, // Maximum stack size exceeded
52
- l,
57
+ m,
53
58
  {
54
- dictionaryKey: e.dictionaryKey,
55
- keyPath: e.keyPath
59
+ dictionaryKey: o.dictionaryKey,
60
+ keyPath: o.keyPath
56
61
  },
57
62
  {
58
63
  default: () => {
59
- const { renderMarkdown: a } = p();
60
- return a(n);
64
+ const { renderMarkdown: r } = u();
65
+ return r(t);
61
66
  }
62
67
  }
63
68
  ),
64
69
  additionalProps: {
65
- metadata: s
70
+ metadata: p
66
71
  }
67
72
  });
68
73
  }
69
- }, _ = {
74
+ }, I = {
70
75
  id: "markdown-plugin",
71
- canHandle: (n) => typeof n == "object" && n?.nodeType === o.Markdown,
72
- transform: (n, t, r) => {
76
+ canHandle: (t) => typeof t == "object" && t?.nodeType === e.Markdown,
77
+ transform: (t, n, a) => {
73
78
  const d = [
74
- ...t.keyPath,
79
+ ...n.keyPath,
75
80
  {
76
- type: o.Markdown
81
+ type: e.Markdown
77
82
  }
78
- ], e = n[o.Markdown];
79
- return r(e, {
80
- ...t,
81
- children: e,
83
+ ], o = t[e.Markdown];
84
+ return a(o, {
85
+ ...n,
86
+ children: o,
82
87
  keyPath: d,
83
- plugins: [f, ...t.plugins ?? []]
88
+ plugins: [f, ...n.plugins ?? []]
84
89
  });
85
90
  }
86
91
  };
87
92
  export {
88
- H as intlayerNodePlugins,
89
- _ as markdownPlugin,
93
+ x as intlayerNodePlugins,
94
+ I as markdownPlugin,
90
95
  f as markdownStringPlugin
91
96
  };
@@ -4,7 +4,7 @@ export type SharedComposableReturn<T extends AnyFn = AnyFn> = T;
4
4
  * Call onScopeDispose() if it's inside an effect scope lifecycle, if not, do nothing
5
5
  *
6
6
  */
7
- export declare function tryOnScopeDispose(fn: () => void): boolean;
7
+ export declare const tryOnScopeDispose: (fn: () => void) => boolean;
8
8
  /**
9
9
  * Make a composable function usable with multiple Vue instances.
10
10
  */
@@ -1,2 +1,3 @@
1
1
  export { default as ContentSelectorWrapper } from './ContentSelectorWrapper.vue';
2
2
  export * from './installIntlayerEditor';
3
+ export * from './useEditor';
@@ -1,4 +1,5 @@
1
1
  import { App } from 'vue';
2
+ import { IntlayerProvider } from '../client';
2
3
  /**
3
4
  * Vue-side replacement for the former <IntlayerEditorProvider> React component.
4
5
  *
@@ -11,4 +12,4 @@ import { App } from 'vue';
11
12
  * </script>
12
13
  * ```
13
14
  */
14
- export declare const installIntlayerEditor: (app: App, localeProvider?: import('../client').IntlayerProvider) => void;
15
+ export declare const installIntlayerEditor: (app: App, localeProvider?: IntlayerProvider) => void;
@@ -4,6 +4,7 @@ declare module '@intlayer/core' {
4
4
  }
5
5
  }
6
6
  export * from './client';
7
+ export * from './editor';
7
8
  export * from './getDictionary';
8
9
  export * from './getIntlayer';
9
10
  export * from './markdown';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vue-intlayer",
3
- "version": "7.1.8",
3
+ "version": "7.1.9",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -86,12 +86,12 @@
86
86
  "typecheck": "vue-tsc --noEmit --project tsconfig.types.json"
87
87
  },
88
88
  "dependencies": {
89
- "@intlayer/api": "7.1.8",
90
- "@intlayer/config": "7.1.8",
91
- "@intlayer/core": "7.1.8",
92
- "@intlayer/editor": "7.1.8",
93
- "@intlayer/types": "7.1.8",
94
- "@intlayer/unmerged-dictionaries-entry": "7.1.8"
89
+ "@intlayer/api": "7.1.9",
90
+ "@intlayer/config": "7.1.9",
91
+ "@intlayer/core": "7.1.9",
92
+ "@intlayer/editor": "7.1.9",
93
+ "@intlayer/types": "7.1.9",
94
+ "@intlayer/unmerged-dictionaries-entry": "7.1.9"
95
95
  },
96
96
  "devDependencies": {
97
97
  "@types/node": "24.10.1",
@@ -110,7 +110,7 @@
110
110
  "vue-tsc": "3.1.1"
111
111
  },
112
112
  "peerDependencies": {
113
- "intlayer": "7.1.8",
113
+ "intlayer": "7.1.9",
114
114
  "vue": ">=3.0.0"
115
115
  },
116
116
  "peerDependenciesMeta": {
@@ -1 +0,0 @@
1
- "use strict";const e=require("vue"),_=require("@intlayer/core"),a=require("@intlayer/editor"),p=require("@intlayer/types"),h=require("./ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js"),f=require("./cjs/editor/communicator.cjs"),v=require("./cjs/editor/editorEnabled.cjs"),m=require("./cjs/editor/focusDictionary.cjs"),E=e.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(c){const t=c,o=m.useFocusDictionary(),i=v.useEditorEnabled(),s=f.useCommunicator(),r=e.computed(()=>t.keyPath.filter(n=>n.type!==p.NodeType.Translation)),u=e.computed(()=>o?.focusedContent.value?.dictionaryKey===t.dictionaryKey&&(o?.focusedContent.value.keyPath?.length??0)>0&&_.isSameKeyPath(o?.focusedContent.value.keyPath??[],r.value)),l=()=>{o?.setFocusedContent({dictionaryKey:t.dictionaryKey,keyPath:r.value})},d=()=>{s?.postMessage({type:`${a.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:{dictionaryKey:t.dictionaryKey,keyPath:r.value}})},y=()=>{s?.postMessage({type:`${a.MessageKey.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,data:null})};return(n,C)=>e.unref(i)?.enabled.value?(e.openBlock(),e.createBlock(h._sfc_main,{key:0,onPress:l,isSelecting:u.value,onHover:d,onUnhover:y},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3},8,["isSelecting"])):e.renderSlot(n.$slots,"default",{key:1})}});exports._sfc_main=E;