vue-intlayer 5.5.9 → 5.5.10
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/README.md +42 -9
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DjJnMLJE.js +1 -0
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DqR_ETSJ.mjs +51 -0
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/EditorSelectorRenderer.cjs +1 -1
- package/dist/cjs/editor/editorEnabled.cjs +1 -1
- package/dist/cjs/editor/editorLocale.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/renderIntlayerNode.cjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +12 -12
- package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
- package/dist/esm/editor/EditorSelectorRenderer.mjs +1 -1
- package/dist/esm/editor/editorEnabled.mjs +45 -25
- package/dist/esm/editor/editorLocale.mjs +1 -1
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +5 -5
- package/dist/esm/plugins.mjs +1 -1
- package/dist/esm/renderIntlayerNode.mjs +18 -15
- package/dist/types/editor/ContentSelectorWrapper.vue.d.ts.map +1 -1
- package/dist/types/editor/editorEnabled.d.ts +1 -0
- package/dist/types/editor/editorEnabled.d.ts.map +1 -1
- package/dist/types/editor/useCrossFrameMessageListener.d.ts.map +1 -1
- package/dist/types/plugins.d.ts.map +1 -1
- package/dist/types/renderIntlayerNode.d.ts +1 -1
- package/dist/types/renderIntlayerNode.d.ts.map +1 -1
- package/package.json +13 -13
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-BML9iRiS.mjs +0 -45
- package/dist/ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-CE_1sBPk.js +0 -1
package/README.md
CHANGED
|
@@ -5,15 +5,48 @@
|
|
|
5
5
|
</div>
|
|
6
6
|
|
|
7
7
|
<div align="center">
|
|
8
|
-
<a href="https://www.npmjs.com/package/vue-intlayer"
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
8
|
+
<a href="https://www.npmjs.com/package/vue-intlayer" target="blank"><img
|
|
9
|
+
align="center"
|
|
10
|
+
alt="npm"
|
|
11
|
+
src="https://img.shields.io/npm/v/vue-intlayer.svg?labelColor=49516F&color=8994BC&style=for-the-badge"
|
|
12
|
+
height="30" /></a>
|
|
13
|
+
<a href="https://npmjs.org/package/vue-intlayer" target="blank"><img
|
|
14
|
+
align="center"
|
|
15
|
+
src="https://img.shields.io/npm/dm/vue-intlayer?labelColor=49516F&color=8994BC&style=for-the-badge"
|
|
16
|
+
alt="monthly downloads"
|
|
17
|
+
height="30"
|
|
18
|
+
/></a>
|
|
19
|
+
<a href="https://npmjs.org/package/vue-intlayer" target="blank"><img
|
|
20
|
+
align="center"
|
|
21
|
+
src="https://img.shields.io/npm/types/vue-intlayer?label=types%20included&labelColor=49516F&color=8994BC&style=for-the-badge"
|
|
22
|
+
alt="types included"
|
|
23
|
+
height="30"
|
|
24
|
+
/></a>
|
|
25
|
+
</div>
|
|
26
|
+
|
|
27
|
+
<div>
|
|
28
|
+
<br/>
|
|
29
|
+
<p align="center">
|
|
30
|
+
<a href="https://www.linkedin.com/company/intlayerorg" target="blank"><img align="center"
|
|
31
|
+
src="https://img.shields.io/badge/linkedin-%231DA1F2.svg?style=for-the-badge&logo=linkedin&logoColor=white"
|
|
32
|
+
alt="Intlayer LinkedIn" height="30"/></a>
|
|
33
|
+
<a href="https://www.facebook.com/intlayer" target="blank"><img align="center"
|
|
34
|
+
src="https://img.shields.io/badge/facebook-4267B2.svg?style=for-the-badge&logo=facebook&logoColor=white"
|
|
35
|
+
alt="Intlayer Facebook" height="30"/></a>
|
|
36
|
+
<a href="https://www.instagram.com/intlayer_org/" target="blank"><img align="center"
|
|
37
|
+
src="https://img.shields.io/badge/instagram-%23E4405F.svg?style=for-the-badge&logo=Instagram&logoColor=white"
|
|
38
|
+
alt="Intlayer Instagram" height="30"/></a>
|
|
39
|
+
<a href="https://x.com/Intlayer183096" target="blank"><img align="center"
|
|
40
|
+
src="https://img.shields.io/badge/x-1DA1F2.svg?style=for-the-badge&logo=x&logoColor=white"
|
|
41
|
+
alt="Intlayer X" height="30"/></a>
|
|
42
|
+
<a href="https://www.youtube.com/@intlayer" target="blank"><img align="center"
|
|
43
|
+
src="https://img.shields.io/badge/youtube-FF0000.svg?style=for-the-badge&logo=youtube&logoColor=white"
|
|
44
|
+
alt="Intlayer YouTube" height="30"/></a>
|
|
45
|
+
<a href="https://www.tiktok.com/@intlayer" target="blank"><img align="center"
|
|
46
|
+
src="https://img.shields.io/badge/tiktok-000000.svg?style=for-the-badge&logo=tiktok&logoColor=white"
|
|
47
|
+
alt="Intlayer TikTok" height="30"/></a>
|
|
48
|
+
<br>
|
|
49
|
+
</p>
|
|
17
50
|
</div>
|
|
18
51
|
|
|
19
52
|
> This package is in development.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("vue"),l=require("@intlayer/core"),u=require("./ContentSelector.vue_vue_type_script_setup_true_lang-OSRmjq5b.js"),_=require("./cjs/editor/editorEnabled.cjs"),y=require("./cjs/editor/focusDictionary.cjs"),p=require("./cjs/editor/useEditor.cjs"),h=t.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(a){const o=a,e=y.useFocusDictionary(),d=_.useEditorEnabled();p.useEditor();const c=t.computed(()=>{var n,r;return((n=e==null?void 0:e.focusedContent.value)==null?void 0:n.dictionaryKey)===o.dictionaryKey&&(((r=e==null?void 0:e.focusedContent.value.keyPath)==null?void 0:r.length)??0)>0&&l.isSameKeyPath((e==null?void 0:e.focusedContent.value.keyPath)??[],o.keyPath)}),i=()=>{e==null||e.setFocusedContent({dictionaryKey:o.dictionaryKey,keyPath:o.keyPath})};return(n,r)=>{var s;return(s=t.unref(d))!=null&&s.enabled.value?(t.openBlock(),t.createBlock(u._sfc_main,{key:0,onPress:i,isSelecting:c.value},{default:t.withCtx(()=>[t.renderSlot(n.$slots,"default")]),_:3},8,["isSelecting"])):t.renderSlot(n.$slots,"default",{key:1})}}});exports._sfc_main=h;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { defineComponent as c, computed as m, createBlock as p, renderSlot as a, unref as u, openBlock as y, withCtx as h } from "vue";
|
|
2
|
+
import { isSameKeyPath as k } from "@intlayer/core";
|
|
3
|
+
import { _ as f } from "./ContentSelector.vue_vue_type_script_setup_true_lang-Dfu1ALQx.mjs";
|
|
4
|
+
import { useEditorEnabled as P } from "./esm/editor/editorEnabled.mjs";
|
|
5
|
+
import { useFocusDictionary as _ } from "./esm/editor/focusDictionary.mjs";
|
|
6
|
+
import { useEditor as C } from "./esm/editor/useEditor.mjs";
|
|
7
|
+
const $ = /* @__PURE__ */ c({
|
|
8
|
+
__name: "ContentSelectorWrapper",
|
|
9
|
+
props: {
|
|
10
|
+
dictionaryKey: {},
|
|
11
|
+
keyPath: {},
|
|
12
|
+
plugins: {},
|
|
13
|
+
locale: {},
|
|
14
|
+
dictionaryPath: {},
|
|
15
|
+
children: {}
|
|
16
|
+
},
|
|
17
|
+
setup(l) {
|
|
18
|
+
const o = l, e = _(), s = P();
|
|
19
|
+
C();
|
|
20
|
+
const d = m(
|
|
21
|
+
() => {
|
|
22
|
+
var t, n;
|
|
23
|
+
return ((t = e == null ? void 0 : e.focusedContent.value) == null ? void 0 : t.dictionaryKey) === o.dictionaryKey && (((n = e == null ? void 0 : e.focusedContent.value.keyPath) == null ? void 0 : n.length) ?? 0) > 0 && k(
|
|
24
|
+
(e == null ? void 0 : e.focusedContent.value.keyPath) ?? [],
|
|
25
|
+
o.keyPath
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
), i = () => {
|
|
29
|
+
e == null || e.setFocusedContent({
|
|
30
|
+
dictionaryKey: o.dictionaryKey,
|
|
31
|
+
keyPath: o.keyPath
|
|
32
|
+
});
|
|
33
|
+
};
|
|
34
|
+
return (t, n) => {
|
|
35
|
+
var r;
|
|
36
|
+
return (r = u(s)) != null && r.enabled.value ? (y(), p(f, {
|
|
37
|
+
key: 0,
|
|
38
|
+
onPress: i,
|
|
39
|
+
isSelecting: d.value
|
|
40
|
+
}, {
|
|
41
|
+
default: h(() => [
|
|
42
|
+
a(t.$slots, "default")
|
|
43
|
+
]),
|
|
44
|
+
_: 3
|
|
45
|
+
}, 8, ["isSelecting"])) : a(t.$slots, "default", { key: 1 });
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
export {
|
|
50
|
+
$ as _
|
|
51
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),p=require("../getIntlayer.cjs"),d=require("./installIntlayer.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),p=require("../getIntlayer.cjs"),d=require("./installIntlayer.cjs"),a=n=>!!n&&typeof n=="object"&&typeof n.__update=="function",f=(n,l)=>{const c=o.inject(d.INTLAYER_SYMBOL),u=o.computed(()=>l??(c==null?void 0:c.locale.value)),t=o.reactive({});return o.watchEffect(()=>{const r=p.getIntlayer(n,u.value);for(const e in r){const s=t[e],i=r[e];e in t&&a(s)?s.__update(i):t[e]=i}for(const e in t)e in r||delete t[e]}),t};exports.isUpdatableNode=a;exports.useIntlayer=f;
|
|
@@ -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-
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DjJnMLJE.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-
|
|
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-DjJnMLJE.js"),u=require("../../EditedContentRenderer.vue_vue_type_script_setup_true_lang-Yqrgst_y.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
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const E=require("@intlayer/config/built"),s=require("@intlayer/editor"),n=require("vue"),c=require("./createSharedComposable.cjs"),o=require("./useCrossFrameMessageListener.cjs");let a=null;const i=Symbol("EditorEnabled"),d=()=>typeof window>"u"?!1:window.self!==window.top,l=()=>{if(a)return a;const e=n.ref(E.editor.enabled),r=n.ref(!1),t=n.ref(!1),u=n.computed(()=>e.value&&r.value&&t.value);return a={settingEnabled:e,wrapperEnabled:r,isInIframe:t,enabled:u},a},f=e=>{const r=l();typeof window<"u"&&(r.isInIframe.value=d()),e.provide(i,r)},b=c.createSharedComposable(()=>{const e=n.inject(i);if(!e)throw new Error("EditorEnabled state not found");o.useCrossFrameMessageListener(`${s.MessageKey.INTLAYER_EDITOR_ENABLED}/post`,t=>{e.wrapperEnabled.value=t});const r=o.useCrossFrameMessageListener(`${s.MessageKey.INTLAYER_EDITOR_ENABLED}/get`,t=>{e.wrapperEnabled.value=t});return n.watch(()=>e.isInIframe.value&&e.settingEnabled.value,t=>{r()},{immediate:!0}),n.onMounted(()=>{n.nextTick(()=>{const t=d();e.isInIframe.value=t})}),e});exports.createEditorEnabledClient=l;exports.installEditorEnabled=f;exports.useEditorEnabled=b;
|
|
@@ -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");const s=require("./createSharedComposable.cjs");require("./communicator.cjs");const u=require("./useCrossFrameState.cjs");require("@intlayer/
|
|
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/config/built");const s=require("./createSharedComposable.cjs");require("./communicator.cjs");const u=require("./useCrossFrameState.cjs");require("@intlayer/dictionaries-entry");require("./installIntlayerEditor.cjs");require("../client/useLocaleCookie.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-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DjJnMLJE.js"),t=require("./installIntlayerEditor.cjs");exports.ContentSelectorWrapper=e._sfc_main;exports.installIntlayerEditor=t.installIntlayerEditor;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("@intlayer/editor"),u=require("vue"),l=require("./communicator.cjs"),r=new Map;let d=!1;function p(e,t){let s=r.get(e);s||(s=new Set,r.set(e,s)),s.add(t)}function m(e,t){const s=r.get(e);s&&(s.delete(t),s.size===0&&r.delete(e))}function b(e,t){d||window&&(window.addEventListener("message",s=>{var i;const{type:n,data:o,senderId:c}=s.data??{};n&&c!==t&&(!e||e.includes("*")||e.some(a=>f.compareUrls(a,s.origin)))&&((i=r.get(n))==null||i.forEach(a=>a(o)))}),d=!0)}const g=(e,t)=>{const{allowedOrigins:s,postMessage:n,senderId:o}=l.useCommunicator();return b(s,o),t?(p(e,t),u.onScopeDispose(()=>m(e,t))):u.getCurrentInstance()||console.warn("useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."),i=>{n({type:e,data:i,senderId:o})}};exports.useCrossFrameMessageListener=g;
|
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/core"),l=require("vue"),y=require("../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/core"),l=require("vue"),y=require("../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DjJnMLJE.js");require("./editor/installIntlayerEditor.cjs");const k=require("./markdown/installIntlayerMarkdown.cjs"),o=require("./renderIntlayerNode.cjs"),p={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=i.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}})}},m={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&(e==null?void 0: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=p;exports.markdownPlugin=m;exports.markdownStringPlugin=u;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("vue"),d=({value:u,children:a,additionalProps:l={}})=>{const e=o.ref(u);let n=typeof a=="function"?()=>a():()=>a;const v=()=>(e.value,n()),r=Object.create(String.prototype);return Object.assign(r,{render:v,toString:()=>e.value,valueOf:()=>e.value,[Symbol.toPrimitive]:()=>e.value,get raw(){return e.value},set raw(t){e.value=t},value:void 0,__update(t){n=t.render,this.raw=t.raw},...l}),r.value=r,o.markRaw(r)};exports.renderIntlayerNode=d;
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { inject as
|
|
1
|
+
import { inject as f, computed as a, reactive as u, watchEffect as l } from "vue";
|
|
2
2
|
import { getIntlayer as m } from "../getIntlayer.mjs";
|
|
3
3
|
import { INTLAYER_SYMBOL as d } from "./installIntlayer.mjs";
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
return
|
|
7
|
-
const
|
|
8
|
-
for (const t in
|
|
9
|
-
const
|
|
10
|
-
t in
|
|
4
|
+
const _ = (e) => !!e && typeof e == "object" && typeof e.__update == "function", b = (e, p) => {
|
|
5
|
+
const n = f(d), s = a(() => p ?? (n == null ? void 0 : n.locale.value)), o = u({});
|
|
6
|
+
return l(() => {
|
|
7
|
+
const c = m(e, s.value);
|
|
8
|
+
for (const t in c) {
|
|
9
|
+
const r = o[t], i = c[t];
|
|
10
|
+
t in o && _(r) ? r.__update(i) : o[t] = i;
|
|
11
11
|
}
|
|
12
|
-
for (const t in
|
|
13
|
-
t in
|
|
14
|
-
}),
|
|
12
|
+
for (const t in o)
|
|
13
|
+
t in c || delete o[t];
|
|
14
|
+
}), o;
|
|
15
15
|
};
|
|
16
16
|
export {
|
|
17
|
-
|
|
17
|
+
_ as isUpdatableNode,
|
|
18
18
|
b as useIntlayer
|
|
19
19
|
};
|
|
@@ -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-
|
|
2
|
+
import { _ } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DqR_ETSJ.mjs";
|
|
3
3
|
import { _ as f } from "../../EditedContentRenderer.vue_vue_type_script_setup_true_lang-CvPgk7Z3.mjs";
|
|
4
4
|
const P = /* @__PURE__ */ d({
|
|
5
5
|
__name: "EditorSelectorRenderer",
|
|
@@ -1,36 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import E from "@intlayer/config/built";
|
|
2
|
+
import { MessageKey as a } from "@intlayer/editor";
|
|
3
|
+
import { inject as f, watch as u, onMounted as c, nextTick as m, ref as o, computed as p } from "vue";
|
|
4
|
+
import { createSharedComposable as I } from "./createSharedComposable.mjs";
|
|
5
|
+
import { useCrossFrameMessageListener as i } from "./useCrossFrameMessageListener.mjs";
|
|
6
|
+
let r = null;
|
|
7
|
+
const s = Symbol("EditorEnabled"), l = () => typeof window > "u" ? !1 : window.self !== window.top, b = () => {
|
|
8
|
+
if (r) return r;
|
|
9
|
+
const e = o(E.editor.enabled), n = o(!1), t = o(!1), d = p(
|
|
10
|
+
() => e.value && n.value && t.value
|
|
11
|
+
);
|
|
12
|
+
return r = {
|
|
13
|
+
settingEnabled: e,
|
|
14
|
+
wrapperEnabled: n,
|
|
11
15
|
isInIframe: t,
|
|
12
|
-
enabled:
|
|
13
|
-
},
|
|
14
|
-
},
|
|
15
|
-
const
|
|
16
|
-
e.provide(
|
|
17
|
-
},
|
|
18
|
-
const e =
|
|
19
|
-
|
|
16
|
+
enabled: d
|
|
17
|
+
}, r;
|
|
18
|
+
}, _ = (e) => {
|
|
19
|
+
const n = b();
|
|
20
|
+
typeof window < "u" && (n.isInIframe.value = l()), e.provide(s, n);
|
|
21
|
+
}, A = I(() => {
|
|
22
|
+
const e = f(
|
|
23
|
+
s
|
|
20
24
|
);
|
|
21
25
|
if (!e)
|
|
22
26
|
throw new Error("EditorEnabled state not found");
|
|
23
|
-
|
|
24
|
-
`${
|
|
27
|
+
i(
|
|
28
|
+
`${a.INTLAYER_EDITOR_ENABLED}/post`,
|
|
25
29
|
(t) => {
|
|
26
30
|
e.wrapperEnabled.value = t;
|
|
27
31
|
}
|
|
28
|
-
)
|
|
29
|
-
|
|
32
|
+
);
|
|
33
|
+
const n = i(
|
|
34
|
+
`${a.INTLAYER_EDITOR_ENABLED}/get`,
|
|
35
|
+
(t) => {
|
|
36
|
+
e.wrapperEnabled.value = t;
|
|
37
|
+
}
|
|
38
|
+
);
|
|
39
|
+
return u(
|
|
40
|
+
() => e.isInIframe.value && e.settingEnabled.value,
|
|
41
|
+
(t) => {
|
|
42
|
+
n();
|
|
43
|
+
},
|
|
44
|
+
{ immediate: !0 }
|
|
45
|
+
), c(() => {
|
|
46
|
+
m(() => {
|
|
47
|
+
const t = l();
|
|
48
|
+
e.isInIframe.value = t;
|
|
49
|
+
});
|
|
30
50
|
}), e;
|
|
31
51
|
});
|
|
32
52
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
53
|
+
b as createEditorEnabledClient,
|
|
54
|
+
_ as installEditorEnabled,
|
|
55
|
+
A as useEditorEnabled
|
|
36
56
|
};
|
|
@@ -2,10 +2,10 @@ import { MessageKey as e } from "@intlayer/editor";
|
|
|
2
2
|
import { inject as m, watch as i } from "vue";
|
|
3
3
|
import { INTLAYER_SYMBOL as a } from "../client/installIntlayer.mjs";
|
|
4
4
|
import "@intlayer/core";
|
|
5
|
+
import "@intlayer/config/built";
|
|
5
6
|
import { createSharedComposable as p } from "./createSharedComposable.mjs";
|
|
6
7
|
import "./communicator.mjs";
|
|
7
8
|
import { useCrossFrameState as s } from "./useCrossFrameState.mjs";
|
|
8
|
-
import "@intlayer/config/built";
|
|
9
9
|
import "@intlayer/dictionaries-entry";
|
|
10
10
|
import "./installIntlayerEditor.mjs";
|
|
11
11
|
import "../client/useLocaleCookie.mjs";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { _ as e } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-
|
|
1
|
+
import { _ as e } from "../../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DqR_ETSJ.mjs";
|
|
2
2
|
import { installIntlayerEditor as a } from "./installIntlayerEditor.mjs";
|
|
3
3
|
export {
|
|
4
4
|
e as ContentSelectorWrapper,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { compareUrls as f } from "@intlayer/editor";
|
|
2
|
-
import { onScopeDispose as
|
|
2
|
+
import { onScopeDispose as d, getCurrentInstance as p } from "vue";
|
|
3
3
|
import { useCommunicator as m } from "./communicator.mjs";
|
|
4
4
|
const r = /* @__PURE__ */ new Map();
|
|
5
5
|
let u = !1;
|
|
@@ -7,12 +7,12 @@ function l(e, t) {
|
|
|
7
7
|
let s = r.get(e);
|
|
8
8
|
s || (s = /* @__PURE__ */ new Set(), r.set(e, s)), s.add(t);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function w(e, t) {
|
|
11
11
|
const s = r.get(e);
|
|
12
12
|
s && (s.delete(t), s.size === 0 && r.delete(e));
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
u || (window.addEventListener("message", (s) => {
|
|
14
|
+
function b(e, t) {
|
|
15
|
+
u || window && (window.addEventListener("message", (s) => {
|
|
16
16
|
var i;
|
|
17
17
|
const { type: o, data: n, senderId: c } = s.data ?? {};
|
|
18
18
|
o && c !== t && (!e || e.includes("*") || e.some((a) => f(a, s.origin))) && ((i = r.get(o)) == null || i.forEach((a) => a(n)));
|
|
@@ -20,7 +20,7 @@ function g(e, t) {
|
|
|
20
20
|
}
|
|
21
21
|
const h = (e, t) => {
|
|
22
22
|
const { allowedOrigins: s, postMessage: o, senderId: n } = m();
|
|
23
|
-
return
|
|
23
|
+
return b(s, n), t ? (l(e, t), d(() => w(e, t))) : p() || console.warn(
|
|
24
24
|
"useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."
|
|
25
25
|
), (i) => {
|
|
26
26
|
o({ type: e, data: i, senderId: n });
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { getMarkdownMetadata as u, NodeType as i } from "@intlayer/core";
|
|
2
2
|
import { h as d } from "vue";
|
|
3
|
-
import { _ as l } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-
|
|
3
|
+
import { _ as l } from "../ContentSelectorWrapper.vue_vue_type_script_setup_true_lang-DqR_ETSJ.mjs";
|
|
4
4
|
import "./editor/installIntlayerEditor.mjs";
|
|
5
5
|
import { useMarkdown as p } from "./markdown/installIntlayerMarkdown.mjs";
|
|
6
6
|
import { renderIntlayerNode as o } from "./renderIntlayerNode.mjs";
|
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
import { ref as
|
|
2
|
-
const
|
|
1
|
+
import { ref as l, markRaw as i } from "vue";
|
|
2
|
+
const s = ({
|
|
3
3
|
value: o,
|
|
4
|
-
children:
|
|
4
|
+
children: a,
|
|
5
5
|
additionalProps: u = {}
|
|
6
6
|
}) => {
|
|
7
|
-
const e =
|
|
8
|
-
let
|
|
9
|
-
const n =
|
|
7
|
+
const e = l(o);
|
|
8
|
+
let n = typeof a == "function" ? () => a() : () => a;
|
|
9
|
+
const v = () => (e.value, n()), r = Object.create(String.prototype);
|
|
10
|
+
return Object.assign(r, {
|
|
10
11
|
/* component renderer */
|
|
11
|
-
render:
|
|
12
|
+
render: v,
|
|
12
13
|
/* string interpolation */
|
|
13
14
|
toString: () => e.value,
|
|
15
|
+
/* primitive coercion helpers */
|
|
16
|
+
valueOf: () => e.value,
|
|
17
|
+
[Symbol.toPrimitive]: () => e.value,
|
|
14
18
|
/* reactive getter/setter for the primitive value */
|
|
15
19
|
get raw() {
|
|
16
20
|
return e.value;
|
|
17
21
|
},
|
|
18
|
-
set raw(
|
|
19
|
-
e.value =
|
|
22
|
+
set raw(t) {
|
|
23
|
+
e.value = t;
|
|
20
24
|
},
|
|
21
|
-
/* circular ref for the
|
|
25
|
+
/* circular ref for the ".value" trick */
|
|
22
26
|
value: void 0,
|
|
23
27
|
/* called by useIntlayer when the dictionary entry changes */
|
|
24
|
-
__update(
|
|
25
|
-
|
|
28
|
+
__update(t) {
|
|
29
|
+
n = t.render, this.raw = t.raw;
|
|
26
30
|
},
|
|
27
31
|
...u
|
|
28
|
-
};
|
|
29
|
-
return n.value = n, v(n);
|
|
32
|
+
}), r.value = r, i(r);
|
|
30
33
|
};
|
|
31
34
|
export {
|
|
32
|
-
|
|
35
|
+
s as renderIntlayerNode
|
|
33
36
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentSelectorWrapper.vue.d.ts","sourceRoot":"","sources":["../../../src/editor/ContentSelectorWrapper.vue"],"names":[],"mappings":"AAUA;
|
|
1
|
+
{"version":3,"file":"ContentSelectorWrapper.vue.d.ts","sourceRoot":"","sources":["../../../src/editor/ContentSelectorWrapper.vue"],"names":[],"mappings":"AAUA;AAsDA,OAAO,EAAY,KAAK,cAAc,EAAE,MAAM,KAAK,CAAC;AACpD,OAAO,EAAiB,KAAK,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAM/D;;;GAGG;AACH,KAAK,KAAK,GAAG,SAAS,GAAG,iBAAiB,CAAC,IAAI,CAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAgC5E,iBAAS,cAAc;WA6CT,OAAO,IAA6B;;yBAXrB,GAAG;yBACH,GAAG;;;;EAe/B;AAYD,KAAK,oBAAoB,GAAG,UAAU,CAAC,OAAO,cAAc,CAAC,CAAC;AAC9D,QAAA,MAAM,eAAe,sRAMnB,CAAC;wBACkB,uBAAuB,CAAC,OAAO,eAAe,EAAE,oBAAoB,CAAC,OAAO,CAAC,CAAC;AAAnG,wBAAoG;AAQpG,KAAK,uBAAuB,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IACxC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"editorEnabled.d.ts","sourceRoot":"","sources":["../../../src/editor/editorEnabled.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"editorEnabled.d.ts","sourceRoot":"","sources":["../../../src/editor/editorEnabled.ts"],"names":[],"mappings":"AAEA,OAAO,EACL,GAAG,EAMH,GAAG,EAEJ,MAAM,KAAK,CAAC;AAOb,MAAM,MAAM,uBAAuB,GAAG;IACpC,cAAc,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,cAAc,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IAC7B,UAAU,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,OAAO,EAAE,GAAG,CAAC,OAAO,CAAC,CAAC;CACvB,CAAC;AAiBF;;GAEG;AACH,eAAO,MAAM,yBAAyB,+BAmBrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,GAAG,SAS5C,CAAC;AAEF,eAAO,MAAM,gBAAgB,+BA0C3B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useCrossFrameMessageListener.d.ts","sourceRoot":"","sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"useCrossFrameMessageListener.d.ts","sourceRoot":"","sources":["../../../src/editor/useCrossFrameMessageListener.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,UAAU,EAAe,MAAM,kBAAkB,CAAC;AA4DhE;;;;;;;GAOG;AACH,eAAO,MAAM,4BAA4B,GAAI,CAAC,EAC5C,KAAK,GAAG,UAAU,EAAE,GAAG,GAAG,UAAU,OAAO,GAAG,GAAG,UAAU,MAAM,EACjE,mBAAmB,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,aAyBD,CAAC,SAKrC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.
|
|
1
|
+
{"version":3,"file":"plugins.d.ts","sourceRoot":"","sources":["../../src/plugins.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EACR,KAAK,oBAAoB,IAAI,wBAAwB,EACrD,KAAK,uBAAuB,IAAI,2BAA2B,EAC3D,KAAK,OAAO,EACb,MAAM,gBAAgB,CAAC;AAMxB;;oDAEoD;AAEpD,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG,MAAM,GACvD,YAAY,CAAC,CAAC,CAAC,GACf,KAAK,CAAC;AAEV,MAAM,WAAW,YAAY,CAAC,CAAC,EAAE,CAAC,GAAG,EAAE;IACrC,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,CAAC,EAAE,GAAG,CAAC;IACf,eAAe,CAAC,EAAE,CAAC,CAAC;CACrB;AAED,wFAAwF;AACxF,eAAO,MAAM,mBAAmB,EAAE,OAuBjC,CAAC;AAEF;;GAEG;AAEH,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAChD,YAAY,CAAC,MAAM,EAAE;IAAE,QAAQ,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;CAAE,CAAC,GAChE,KAAK,CAAC;AAEV,8FAA8F;AAC9F,eAAO,MAAM,oBAAoB,EAAE,OAwDlC,CAAC;AAEF,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,SAAS;IACtC,QAAQ,EAAE,QAAQ,GAAG,MAAM,CAAC;IAC5B,CAAC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;IAC7B,QAAQ,CAAC,EAAE,MAAM,CAAC,CAAC;CACpB,GACG,YAAY,CAAC,oBAAoB,CAAC,CAAC,CAAC,EAAE;IAAE,QAAQ,EAAE,oBAAoB,CAAC,CAAC,CAAC,CAAA;CAAE,CAAC,GAC5E,KAAK,CAAC;AAEV,eAAO,MAAM,cAAc,EAAE,OAqB5B,CAAC;AAEF;;oDAEoD;AAEpD,MAAM,WAAW,qBAAqB,CAAC,CAAC;IACtC,YAAY,EAAE,gBAAgB,CAAC,CAAC,CAAC,CAAC;IAClC,QAAQ,EAAE,YAAY,CAAC,CAAC,CAAC,CAAC;CAC3B;AAED;;;;GAIG;AACH,MAAM,MAAM,uBAAuB,GAAG,2BAA2B,GAAG;IAClE,YAAY,EAAE,IAAI,CAAC;IACnB,QAAQ,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF,MAAM,MAAM,oBAAoB,CAAC,CAAC,IAAI,wBAAwB,CAC5D,CAAC,EACD,uBAAuB,CACxB,CAAC"}
|
|
@@ -3,7 +3,7 @@ export type IntlayerNode<T = string> = {
|
|
|
3
3
|
raw: T;
|
|
4
4
|
render: () => VNode;
|
|
5
5
|
toString: () => T;
|
|
6
|
-
value:
|
|
6
|
+
value: T;
|
|
7
7
|
__update: (next: IntlayerNode<T>) => void;
|
|
8
8
|
};
|
|
9
9
|
export declare const renderIntlayerNode: <T extends string | number | boolean | null | undefined>({ value, children, additionalProps, }: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"renderIntlayerNode.d.ts","sourceRoot":"","sources":["../../src/renderIntlayerNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAEhE,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,MAAM,IAAI;IACrC,GAAG,EAAE,CAAC,CAAC;IACP,MAAM,EAAE,MAAM,KAAK,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClB,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"renderIntlayerNode.d.ts","sourceRoot":"","sources":["../../src/renderIntlayerNode.ts"],"names":[],"mappings":"AAAA,OAAO,EAAgB,KAAK,KAAK,EAAE,KAAK,UAAU,EAAE,MAAM,KAAK,CAAC;AAEhE,MAAM,MAAM,YAAY,CAAC,CAAC,GAAG,MAAM,IAAI;IACrC,GAAG,EAAE,CAAC,CAAC;IACP,MAAM,EAAE,MAAM,KAAK,CAAC;IACpB,QAAQ,EAAE,MAAM,CAAC,CAAC;IAClB,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,CAAC,IAAI,EAAE,YAAY,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC;CAC3C,CAAC;AAEF,eAAO,MAAM,kBAAkB,GAC7B,CAAC,SAAS,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,IAAI,GAAG,SAAS,EACtD,uCAIC;IACD,KAAK,EAAE,CAAC,CAAC;IACT,QAAQ,EAAE,UAAU,GAAG,CAAC,MAAM,UAAU,CAAC,CAAC;IAC1C,eAAe,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAC3C,KAAG,YAAY,CAAC,CAAC,CAwEjB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "vue-intlayer",
|
|
3
|
-
"version": "5.5.
|
|
3
|
+
"version": "5.5.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Vue applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -70,11 +70,11 @@
|
|
|
70
70
|
"dependencies": {
|
|
71
71
|
"js-cookie": "^3.0.5",
|
|
72
72
|
"uuid": "^11.1.0",
|
|
73
|
-
"@intlayer/api": "5.5.
|
|
74
|
-
"@intlayer/
|
|
75
|
-
"@intlayer/
|
|
76
|
-
"@intlayer/dictionaries-entry": "5.5.
|
|
77
|
-
"@intlayer/editor": "5.5.
|
|
73
|
+
"@intlayer/api": "5.5.10",
|
|
74
|
+
"@intlayer/config": "5.5.10",
|
|
75
|
+
"@intlayer/core": "5.5.10",
|
|
76
|
+
"@intlayer/dictionaries-entry": "5.5.10",
|
|
77
|
+
"@intlayer/editor": "5.5.10"
|
|
78
78
|
},
|
|
79
79
|
"devDependencies": {
|
|
80
80
|
"@types/js-cookie": "^3.0.6",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"typescript": "^5.8.3",
|
|
90
90
|
"vite": "^6.3.5",
|
|
91
91
|
"vite-plugin-dts": "^4.5.3",
|
|
92
|
-
"@intlayer/backend": "5.5.
|
|
92
|
+
"@intlayer/backend": "5.5.10",
|
|
93
93
|
"@utils/eslint-config": "1.0.4",
|
|
94
94
|
"@utils/ts-config": "1.0.4",
|
|
95
95
|
"@utils/ts-config-types": "1.0.4",
|
|
@@ -97,12 +97,12 @@
|
|
|
97
97
|
},
|
|
98
98
|
"peerDependencies": {
|
|
99
99
|
"vue": "^3.5.13",
|
|
100
|
-
"@intlayer/api": "5.5.
|
|
101
|
-
"@intlayer/config": "5.5.
|
|
102
|
-
"@intlayer/
|
|
103
|
-
"@intlayer/dictionaries-entry": "5.5.
|
|
104
|
-
"@intlayer/
|
|
105
|
-
"intlayer": "5.5.
|
|
100
|
+
"@intlayer/api": "5.5.10",
|
|
101
|
+
"@intlayer/config": "5.5.10",
|
|
102
|
+
"@intlayer/editor": "5.5.10",
|
|
103
|
+
"@intlayer/dictionaries-entry": "5.5.10",
|
|
104
|
+
"@intlayer/core": "5.5.10",
|
|
105
|
+
"intlayer": "5.5.10"
|
|
106
106
|
},
|
|
107
107
|
"engines": {
|
|
108
108
|
"node": ">=14.18"
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { defineComponent as d, computed as y, createBlock as u, renderSlot as r, unref as m, openBlock as p, withCtx as f } from "vue";
|
|
2
|
-
import { isSameKeyPath as h } from "@intlayer/core";
|
|
3
|
-
import { _ as k } from "./ContentSelector.vue_vue_type_script_setup_true_lang-Dfu1ALQx.mjs";
|
|
4
|
-
import { useEditorEnabled as P } from "./esm/editor/editorEnabled.mjs";
|
|
5
|
-
import { useFocusDictionary as _ } from "./esm/editor/focusDictionary.mjs";
|
|
6
|
-
import { useEditor as S } from "./esm/editor/useEditor.mjs";
|
|
7
|
-
const b = /* @__PURE__ */ d({
|
|
8
|
-
__name: "ContentSelectorWrapper",
|
|
9
|
-
props: {
|
|
10
|
-
dictionaryKey: {},
|
|
11
|
-
keyPath: {},
|
|
12
|
-
plugins: {},
|
|
13
|
-
locale: {},
|
|
14
|
-
dictionaryPath: {},
|
|
15
|
-
children: {}
|
|
16
|
-
},
|
|
17
|
-
setup(a) {
|
|
18
|
-
const t = a, { focusedContent: o, setFocusedContent: i } = _(), { enabled: s } = P();
|
|
19
|
-
S();
|
|
20
|
-
const c = y(
|
|
21
|
-
() => {
|
|
22
|
-
var e, n;
|
|
23
|
-
return ((e = o.value) == null ? void 0 : e.dictionaryKey) === t.dictionaryKey && (((n = o.value.keyPath) == null ? void 0 : n.length) ?? 0) > 0 && h(o.value.keyPath ?? [], t.keyPath);
|
|
24
|
-
}
|
|
25
|
-
), l = () => {
|
|
26
|
-
i({
|
|
27
|
-
dictionaryKey: t.dictionaryKey,
|
|
28
|
-
keyPath: t.keyPath
|
|
29
|
-
});
|
|
30
|
-
};
|
|
31
|
-
return (e, n) => m(s) ? (p(), u(k, {
|
|
32
|
-
key: 0,
|
|
33
|
-
onPress: l,
|
|
34
|
-
isSelecting: c.value
|
|
35
|
-
}, {
|
|
36
|
-
default: f(() => [
|
|
37
|
-
r(e.$slots, "default")
|
|
38
|
-
]),
|
|
39
|
-
_: 3
|
|
40
|
-
}, 8, ["isSelecting"])) : r(e.$slots, "default", { key: 1 });
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
export {
|
|
44
|
-
b as _
|
|
45
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const e=require("vue"),l=require("@intlayer/core"),d=require("./ContentSelector.vue_vue_type_script_setup_true_lang-OSRmjq5b.js"),y=require("./cjs/editor/editorEnabled.cjs"),_=require("./cjs/editor/focusDictionary.cjs"),p=require("./cjs/editor/useEditor.cjs"),h=e.defineComponent({__name:"ContentSelectorWrapper",props:{dictionaryKey:{},keyPath:{},plugins:{},locale:{},dictionaryPath:{},children:{}},setup(i){const n=i,{focusedContent:o,setFocusedContent:c}=_.useFocusDictionary(),{enabled:s}=y.useEditorEnabled();p.useEditor();const a=e.computed(()=>{var t,r;return((t=o.value)==null?void 0:t.dictionaryKey)===n.dictionaryKey&&(((r=o.value.keyPath)==null?void 0:r.length)??0)>0&&l.isSameKeyPath(o.value.keyPath??[],n.keyPath)}),u=()=>{c({dictionaryKey:n.dictionaryKey,keyPath:n.keyPath})};return(t,r)=>e.unref(s)?(e.openBlock(),e.createBlock(d._sfc_main,{key:0,onPress:u,isSelecting:a.value},{default:e.withCtx(()=>[e.renderSlot(t.$slots,"default")]),_:3},8,["isSelecting"])):e.renderSlot(t.$slots,"default",{key:1})}});exports._sfc_main=h;
|