vue-intlayer 8.3.2 → 8.3.4
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/ContentSelectorWrapper-B7p44V28.mjs +52 -0
- package/dist/ContentSelectorWrapper-DpyRYcE8.js +1 -0
- package/dist/EditedContentRenderer-BFVoITDN.js +1 -0
- package/dist/EditedContentRenderer-DNBqpZpl.mjs +28 -0
- package/dist/cjs/UI/ContentSelector.cjs +1 -1
- 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/useDictionaryDynamic.cjs +1 -1
- package/dist/cjs/client/useIntlayer.cjs +1 -1
- package/dist/cjs/client/useLoadDynamic.cjs +1 -1
- package/dist/cjs/client/useLocale.cjs +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/EditedContentRenderer.cjs +1 -1
- package/dist/cjs/editor/EditorSelectorRenderer.cjs +1 -1
- package/dist/cjs/editor/communicator.cjs +1 -1
- package/dist/cjs/editor/configuration.cjs +1 -1
- package/dist/cjs/editor/createSharedComposable.cjs +1 -1
- package/dist/cjs/editor/dictionariesRecord.cjs +1 -1
- package/dist/cjs/editor/editedContent.cjs +1 -1
- package/dist/cjs/editor/editorEnabled.cjs +1 -1
- package/dist/cjs/editor/editorLocale.cjs +1 -1
- package/dist/cjs/editor/focusDictionary.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/installIntlayerEditor.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/editor/useCrossFrameState.cjs +1 -1
- package/dist/cjs/editor/useCrossURLPathState.cjs +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -1
- package/dist/cjs/editor/useEditor.cjs +1 -1
- package/dist/cjs/editor/useIframeClickInterceptor.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/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/html/installIntlayerHTML.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
- package/dist/cjs/markdown/compiler.cjs +1 -1
- package/dist/cjs/markdown/index.cjs +1 -1
- package/dist/cjs/markdown/installIntlayerMarkdown.cjs +1 -1
- package/dist/cjs/markdown/runtime.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/renderIntlayerNode.cjs +1 -1
- package/dist/esm/UI/ContentSelector.mjs +76 -2
- package/dist/esm/client/index.mjs +2 -2
- package/dist/esm/client/installIntlayer.mjs +2 -2
- package/dist/esm/client/useDictionary.mjs +2 -2
- package/dist/esm/client/useDictionaryAsync.mjs +1 -1
- package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
- package/dist/esm/client/useIntlayer.mjs +1 -1
- package/dist/esm/client/useLocale.mjs +1 -1
- package/dist/esm/client/useRewriteURL.mjs +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
- package/dist/esm/editor/EditedContentRenderer.mjs +1 -1
- package/dist/esm/editor/EditorSelectorRenderer.mjs +2 -2
- package/dist/esm/editor/communicator.mjs +9 -24
- package/dist/esm/editor/configuration.mjs +12 -10
- package/dist/esm/editor/dictionariesRecord.mjs +17 -34
- package/dist/esm/editor/editedContent.mjs +24 -40
- package/dist/esm/editor/editorEnabled.mjs +13 -36
- package/dist/esm/editor/editorLocale.mjs +1 -1
- package/dist/esm/editor/focusDictionary.mjs +16 -31
- package/dist/esm/editor/index.mjs +12 -3
- package/dist/esm/editor/installIntlayerEditor.mjs +20 -19
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +6 -26
- package/dist/esm/editor/useCrossFrameState.mjs +29 -42
- package/dist/esm/editor/useCrossURLPathState.mjs +5 -18
- package/dist/esm/editor/useEditor.mjs +1 -1
- package/dist/esm/editor/useIframeClickInterceptor.mjs +8 -13
- 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 +20 -11
- package/dist/esm/plugins.mjs +1 -1
- package/dist/{getDictionary-BE4ZLuzI.mjs → getDictionary-5DAguynf.mjs} +88 -143
- package/dist/getDictionary-yKxg53ez.js +1 -0
- package/dist/installIntlayerEditor-BpsBr4EN.js +1 -0
- package/dist/types/editor/ContentSelectorWrapper.vue.d.ts +0 -4
- package/dist/types/editor/communicator.d.ts +3 -26
- package/dist/types/editor/editorEnabled.d.ts +2 -15
- package/dist/types/editor/editorLocale.d.ts +1 -1
- package/dist/types/editor/focusDictionary.d.ts +86 -21
- package/dist/types/editor/index.d.ts +9 -0
- package/dist/types/editor/installIntlayerEditor.d.ts +4 -14
- package/dist/types/editor/useCrossFrameMessageListener.d.ts +1 -9
- package/dist/types/editor/useCrossFrameState.d.ts +1 -17
- package/dist/types/editor/useCrossURLPathState.d.ts +1 -15
- package/dist/types/editor/useIframeClickInterceptor.d.ts +0 -8
- package/dist/types/html/HTMLRenderer.d.ts +40 -40
- package/dist/types/markdown/MarkdownRenderer.d.ts +40 -40
- package/package.json +8 -9
- package/dist/ContentSelector-BaMG67_z.js +0 -1
- package/dist/ContentSelector-D9fc9D1G.mjs +0 -76
- package/dist/EditedContentRenderer-CXoF8k9R.mjs +0 -25
- package/dist/EditedContentRenderer-S0zWbUak.js +0 -1
- package/dist/communicator-1rnoOTtT.js +0 -1
- package/dist/getDictionary-DMdOvXMh.js +0 -1
- package/dist/types/UI/ContentSelector.vue.d.ts +0 -36
- package/dist/types/editor/configuration.d.ts +0 -1
- package/dist/types/editor/dictionariesRecord.d.ts +0 -15
- package/dist/types/editor/editedContent.d.ts +0 -20
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../../EditedContentRenderer-
|
|
1
|
+
import { t as e } from "../../EditedContentRenderer-DNBqpZpl.mjs";
|
|
2
2
|
export { e as default };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { t } from "../../EditedContentRenderer-
|
|
1
|
+
import { t as e } from "../../ContentSelectorWrapper-B7p44V28.mjs";
|
|
2
|
+
import { t } from "../../EditedContentRenderer-DNBqpZpl.mjs";
|
|
3
3
|
import { createBlock as n, createVNode as r, defineComponent as i, openBlock as a, renderSlot as o, unref as s, withCtx as c } from "vue";
|
|
4
4
|
//#endregion
|
|
5
5
|
//#region src/editor/EditorSelectorRenderer.vue
|
|
@@ -1,27 +1,12 @@
|
|
|
1
|
-
import e from "
|
|
2
|
-
import { inject as
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n } from "vue";
|
|
3
3
|
//#region src/editor/communicator.ts
|
|
4
|
-
var r = () =>
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
],
|
|
11
|
-
senderId: ""
|
|
12
|
-
}, o = null, s = Symbol("Communicator"), c = (e = { postMessage: () => null }) => o || (o = n({
|
|
13
|
-
...a,
|
|
14
|
-
...e,
|
|
15
|
-
senderId: r()
|
|
16
|
-
}), o), l = (e, t = { postMessage: () => null }) => {
|
|
17
|
-
let n = c(t);
|
|
18
|
-
e.provide(s, n);
|
|
19
|
-
}, u = () => {
|
|
20
|
-
try {
|
|
21
|
-
return t(s, a);
|
|
22
|
-
} catch {
|
|
23
|
-
return console.warn("useCommunicator: inject can only be used in setup(). Returning default communicator."), a;
|
|
24
|
-
}
|
|
4
|
+
var r = () => {
|
|
5
|
+
let r = n(e) ?? t();
|
|
6
|
+
return r ? {
|
|
7
|
+
postMessage: (e) => r.messenger.send(e.type, e.data),
|
|
8
|
+
senderId: r.messenger.senderId
|
|
9
|
+
} : null;
|
|
25
10
|
};
|
|
26
11
|
//#endregion
|
|
27
|
-
export {
|
|
12
|
+
export { r as useCommunicator };
|
|
@@ -1,13 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import { onMounted as n } from "vue";
|
|
4
|
-
import { MessageKey as r } from "@intlayer/editor";
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n, onBeforeUnmount as r, onMounted as i, ref as a } from "vue";
|
|
5
3
|
//#region src/editor/configuration.ts
|
|
6
|
-
var
|
|
7
|
-
let
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
var o = () => {
|
|
5
|
+
let o = n(e) ?? t(), s = a(o?.configuration.value), c = (e) => {
|
|
6
|
+
s.value = e.detail;
|
|
7
|
+
};
|
|
8
|
+
return i(() => {
|
|
9
|
+
o?.configuration.addEventListener("change", c);
|
|
10
|
+
}), r(() => {
|
|
11
|
+
o?.configuration.removeEventListener("change", c);
|
|
12
|
+
}), s;
|
|
11
13
|
};
|
|
12
14
|
//#endregion
|
|
13
|
-
export {
|
|
15
|
+
export { o as useConfiguration };
|
|
@@ -1,36 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { inject as n, readonly as r, ref as i, watch as a } from "vue";
|
|
4
|
-
import { MessageKey as o } from "@intlayer/editor";
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n, onBeforeUnmount as r, onMounted as i, readonly as a, ref as o } from "vue";
|
|
5
3
|
//#region src/editor/dictionariesRecord.ts
|
|
6
|
-
var s =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}, s;
|
|
21
|
-
}, u = (e) => {
|
|
22
|
-
let t = l();
|
|
23
|
-
import("@intlayer/unmerged-dictionaries-entry").then((e) => {
|
|
24
|
-
let n = e.getUnmergedDictionaries(), r = Object.fromEntries(Object.values(n).flat().map((e) => [e.localId, e]));
|
|
25
|
-
t.setLocaleDictionaries(r);
|
|
26
|
-
}), e.provide(c, t);
|
|
27
|
-
}, d = e(() => {
|
|
28
|
-
let e = n(c);
|
|
29
|
-
if (!e) throw Error("DictionariesRecord state not found");
|
|
30
|
-
let [r, i] = t(o.INTLAYER_LOCALE_DICTIONARIES_CHANGED, void 0);
|
|
31
|
-
a(e.localeDictionaries, (e) => {
|
|
32
|
-
i(e);
|
|
33
|
-
}, { immediate: !0 });
|
|
34
|
-
});
|
|
4
|
+
var s = () => {
|
|
5
|
+
let s = n(e) ?? t(), c = o(s?.localeDictionaries.value ?? {}), l = (e) => {
|
|
6
|
+
c.value = e.detail ?? {};
|
|
7
|
+
};
|
|
8
|
+
return i(() => {
|
|
9
|
+
s?.localeDictionaries.addEventListener("change", l);
|
|
10
|
+
}), r(() => {
|
|
11
|
+
s?.localeDictionaries.removeEventListener("change", l);
|
|
12
|
+
}), {
|
|
13
|
+
localeDictionaries: a(c),
|
|
14
|
+
setLocaleDictionaries: (e) => s?.localeDictionaries.set(e),
|
|
15
|
+
setLocaleDictionary: (e) => s?.setLocaleDictionary(e)
|
|
16
|
+
};
|
|
17
|
+
};
|
|
35
18
|
//#endregion
|
|
36
|
-
export {
|
|
19
|
+
export { s as useDictionariesRecord };
|
|
@@ -1,42 +1,26 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { NodeType as n } from "@intlayer/types/nodeType";
|
|
4
|
-
import { inject as r, readonly as i, ref as a, watch as o } from "vue";
|
|
5
|
-
import { MessageKey as s } from "@intlayer/editor";
|
|
6
|
-
import { getContentNodeByKeyPath as c } from "@intlayer/core/dictionaryManipulator";
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n, onBeforeUnmount as r, onMounted as i, readonly as a, ref as o } from "vue";
|
|
7
3
|
//#region src/editor/editedContent.ts
|
|
8
|
-
var
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
let n = d(t);
|
|
30
|
-
e.provide(u, n);
|
|
31
|
-
}, p = e(() => {
|
|
32
|
-
let e = r(u);
|
|
33
|
-
if (!e) throw Error("EditedContent state not found");
|
|
34
|
-
let [n, i] = t(s.INTLAYER_EDITED_CONTENT_CHANGED, {});
|
|
35
|
-
return o(n, (t) => {
|
|
36
|
-
e.editedContent.value = t ?? {};
|
|
37
|
-
}), o(e, (e) => {
|
|
38
|
-
i(e.editedContent.value);
|
|
39
|
-
}), e;
|
|
40
|
-
});
|
|
4
|
+
var s = () => {
|
|
5
|
+
let s = n(e) ?? t(), c = o(s?.editedContent.value ?? {}), l = (e) => {
|
|
6
|
+
c.value = e.detail ?? {};
|
|
7
|
+
};
|
|
8
|
+
return i(() => {
|
|
9
|
+
s?.editedContent.addEventListener("change", l);
|
|
10
|
+
}), r(() => {
|
|
11
|
+
s?.editedContent.removeEventListener("change", l);
|
|
12
|
+
}), {
|
|
13
|
+
editedContent: a(c),
|
|
14
|
+
setEditedContent: (e, t) => s?.setEditedContent(e, t),
|
|
15
|
+
setEditedDictionary: (e) => s?.setEditedDictionary(e),
|
|
16
|
+
addEditedContent: (e, t, n, r) => s?.addContent(e, t, n, r),
|
|
17
|
+
renameEditedContent: (e, t, n) => s?.renameContent(e, t, n),
|
|
18
|
+
removeEditedContent: (e, t) => s?.removeContent(e, t),
|
|
19
|
+
restoreEditedContent: (e) => s?.restoreContent(e),
|
|
20
|
+
clearEditedDictionaryContent: (e) => s?.clearContent(e),
|
|
21
|
+
clearEditedContent: () => s?.clearAllContent(),
|
|
22
|
+
getEditedContentValue: (e, t) => s?.getContentValue(e, t)
|
|
23
|
+
};
|
|
24
|
+
};
|
|
41
25
|
//#endregion
|
|
42
|
-
export {
|
|
26
|
+
export { s as useEditedContent };
|
|
@@ -1,38 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import n from "@intlayer/config/built";
|
|
4
|
-
import { computed as r, inject as i, nextTick as a, onMounted as o, ref as s, watch as c } from "vue";
|
|
5
|
-
import { MessageKey as l } from "@intlayer/editor";
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n, onBeforeUnmount as r, onMounted as i, ref as a } from "vue";
|
|
6
3
|
//#region src/editor/editorEnabled.ts
|
|
7
|
-
var
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
},
|
|
16
|
-
}
|
|
17
|
-
let t = p();
|
|
18
|
-
typeof window < "u" && (t.isInIframe.value = f()), e.provide(d, t);
|
|
19
|
-
}, h = e(() => {
|
|
20
|
-
let e = i(d);
|
|
21
|
-
if (!e) throw Error("EditorEnabled state not found");
|
|
22
|
-
t(`${l.INTLAYER_EDITOR_ENABLED}/post`, (t) => {
|
|
23
|
-
e.wrapperEnabled.value = t;
|
|
24
|
-
});
|
|
25
|
-
let n = t(`${l.INTLAYER_EDITOR_ENABLED}/get`, (t) => {
|
|
26
|
-
e.wrapperEnabled.value = t;
|
|
27
|
-
});
|
|
28
|
-
return c(() => e.isInIframe.value && e.settingEnabled.value, (e) => {
|
|
29
|
-
n();
|
|
30
|
-
}, { immediate: !0 }), o(() => {
|
|
31
|
-
a(() => {
|
|
32
|
-
let t = f();
|
|
33
|
-
e.isInIframe.value = t;
|
|
34
|
-
});
|
|
35
|
-
}), e;
|
|
36
|
-
});
|
|
4
|
+
var o = () => {
|
|
5
|
+
let o = n(e) ?? t(), s = a(o?.editorEnabled.value ?? !1), c = (e) => {
|
|
6
|
+
s.value = e.detail;
|
|
7
|
+
};
|
|
8
|
+
return i(() => {
|
|
9
|
+
o?.editorEnabled.addEventListener("change", c);
|
|
10
|
+
}), r(() => {
|
|
11
|
+
o?.editorEnabled.removeEventListener("change", c);
|
|
12
|
+
}), { enabled: s };
|
|
13
|
+
};
|
|
37
14
|
//#endregion
|
|
38
|
-
export {
|
|
15
|
+
export { o as useEditorEnabled };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { l as e } from "../../getDictionary-5DAguynf.mjs";
|
|
2
2
|
export { e as useEditorLocale };
|
|
@@ -1,34 +1,19 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { inject as n, readonly as r, ref as i, watch as a } from "vue";
|
|
4
|
-
import { MessageKey as o } from "@intlayer/editor";
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n, onBeforeUnmount as r, onMounted as i, readonly as a, ref as o } from "vue";
|
|
5
3
|
//#region src/editor/focusDictionary.ts
|
|
6
|
-
var s =
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
e.value = t;
|
|
4
|
+
var s = () => {
|
|
5
|
+
let s = n(e) ?? t(), c = o(s?.focusedContent.value ?? null), l = (e) => {
|
|
6
|
+
c.value = e.detail;
|
|
10
7
|
};
|
|
11
|
-
return
|
|
12
|
-
focusedContent
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
}, u = (e) => {
|
|
22
|
-
let t = l();
|
|
23
|
-
e.provide(c, t);
|
|
24
|
-
}, d = e(() => {
|
|
25
|
-
let e = n(c), [r, i] = t(o.INTLAYER_FOCUSED_CONTENT_CHANGED);
|
|
26
|
-
if (!e) throw Error("FocusDictionary state not found");
|
|
27
|
-
return a(e.focusedContent, (e) => {
|
|
28
|
-
JSON.stringify(e) !== JSON.stringify(r.value) && i(e);
|
|
29
|
-
}), a(r, (t) => {
|
|
30
|
-
JSON.stringify(t) !== JSON.stringify(e.focusedContent.value) && e.setFocusedContent(t ?? null);
|
|
31
|
-
}), e;
|
|
32
|
-
});
|
|
8
|
+
return i(() => {
|
|
9
|
+
s?.focusedContent.addEventListener("change", l);
|
|
10
|
+
}), r(() => {
|
|
11
|
+
s?.focusedContent.removeEventListener("change", l);
|
|
12
|
+
}), {
|
|
13
|
+
focusedContent: a(c),
|
|
14
|
+
setFocusedContent: (e) => s?.focusedContent.set(e),
|
|
15
|
+
setFocusedContentKeyPath: (e) => s?.setFocusedContentKeyPath(e)
|
|
16
|
+
};
|
|
17
|
+
};
|
|
33
18
|
//#endregion
|
|
34
|
-
export {
|
|
19
|
+
export { s as useFocusDictionary };
|
|
@@ -1,3 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t, installIntlayerEditor as n } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { useEditorEnabled as r } from "./editorEnabled.mjs";
|
|
3
|
+
import { useFocusDictionary as i } from "./focusDictionary.mjs";
|
|
4
|
+
import { t as a } from "../../ContentSelectorWrapper-B7p44V28.mjs";
|
|
5
|
+
import { useConfiguration as o } from "./configuration.mjs";
|
|
6
|
+
import { useDictionariesRecord as s } from "./dictionariesRecord.mjs";
|
|
7
|
+
import { useEditedContent as c } from "./editedContent.mjs";
|
|
8
|
+
import { c as l, l as u } from "../../getDictionary-5DAguynf.mjs";
|
|
9
|
+
import { useCrossFrameMessageListener as d } from "./useCrossFrameMessageListener.mjs";
|
|
10
|
+
import { useCrossFrameState as f } from "./useCrossFrameState.mjs";
|
|
11
|
+
import { useIframeClickInterceptor as p, useIframeClickMerger as m } from "./useIframeClickInterceptor.mjs";
|
|
12
|
+
export { a as ContentSelectorWrapper, e as INTLAYER_EDITOR_MANAGER_SYMBOL, t as getEditorStateManager, n as installIntlayerEditor, o as useConfiguration, d as useCrossFrameMessageListener, f as useCrossFrameState, s as useDictionariesRecord, c as useEditedContent, l as useEditor, r as useEditorEnabled, u as useEditorLocale, i as useFocusDictionary, p as useIframeClickInterceptor, m as useIframeClickMerger };
|
|
@@ -1,21 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import { installFocusDictionary as n } from "./focusDictionary.mjs";
|
|
4
|
-
import { installDictionariesRecord as r } from "./dictionariesRecord.mjs";
|
|
5
|
-
import { installEditedContent as i } from "./editedContent.mjs";
|
|
6
|
-
import a from "@intlayer/config/built";
|
|
1
|
+
import e from "@intlayer/config/built";
|
|
2
|
+
import { EditorStateManager as t, defineIntlayerElements as n } from "@intlayer/editor";
|
|
7
3
|
//#region src/editor/installIntlayerEditor.ts
|
|
8
|
-
var { editor:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
4
|
+
var { editor: r } = e ?? {}, i = () => ({
|
|
5
|
+
allowedOrigins: [
|
|
6
|
+
r?.applicationURL,
|
|
7
|
+
r?.editorURL,
|
|
8
|
+
r?.cmsURL
|
|
9
|
+
].filter(Boolean),
|
|
10
|
+
postMessageFn: (e, t) => {
|
|
11
|
+
typeof window > "u" || window.self !== window.top && (window.parent?.postMessage(e, t), window.postMessage(e, t));
|
|
12
|
+
}
|
|
13
|
+
}), a = Symbol("INTLAYER_EDITOR_STATE_MANAGER"), o = null, s = (r) => {
|
|
14
|
+
let s = new t({
|
|
15
|
+
mode: "client",
|
|
16
|
+
messenger: i(),
|
|
17
|
+
configuration: e
|
|
18
|
+
});
|
|
19
|
+
r.provide(a, s), o = s, n(), s.start();
|
|
20
|
+
}, c = () => o;
|
|
20
21
|
//#endregion
|
|
21
|
-
export {
|
|
22
|
+
export { a as INTLAYER_EDITOR_MANAGER_SYMBOL, c as getEditorStateManager, s as installIntlayerEditor };
|
|
@@ -1,29 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { compareUrls as r } from "@intlayer/editor";
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n, onScopeDispose as r } from "vue";
|
|
4
3
|
//#region src/editor/useCrossFrameMessageListener.ts
|
|
5
|
-
var i =
|
|
6
|
-
let
|
|
7
|
-
|
|
8
|
-
}, s = (e, t) => {
|
|
9
|
-
let n = i.get(e);
|
|
10
|
-
n && (n.delete(t), n.size === 0 && i.delete(e));
|
|
11
|
-
}, c = (e, t) => {
|
|
12
|
-
a || typeof window > "u" || (window.addEventListener("message", (n) => {
|
|
13
|
-
let { type: a, data: o, senderId: s } = n.data ?? {};
|
|
14
|
-
a && s !== t && (!e || e.includes("*") || e.some((e) => r(e, n.origin))) && i.get(a)?.forEach((e) => {
|
|
15
|
-
e(o);
|
|
16
|
-
});
|
|
17
|
-
}), a = !0);
|
|
18
|
-
}, l = (r, i) => {
|
|
19
|
-
let { allowedOrigins: a, postMessage: l, senderId: u } = e() ?? {};
|
|
20
|
-
return c(a, u), i ? (o(r, i), n(() => s(r, i))) : t() || console.warn("useCrossFrameMessageListener called outside a component without a callback; nothing to listen for."), (e) => {
|
|
21
|
-
l({
|
|
22
|
-
type: r,
|
|
23
|
-
data: e,
|
|
24
|
-
senderId: u
|
|
25
|
-
});
|
|
26
|
-
};
|
|
4
|
+
var i = (i, a) => {
|
|
5
|
+
let o = n(e) ?? t();
|
|
6
|
+
return a && o && r(o.messenger.subscribe(i, a)), (e) => o?.messenger.send(i, e);
|
|
27
7
|
};
|
|
28
8
|
//#endregion
|
|
29
|
-
export {
|
|
9
|
+
export { i as useCrossFrameMessageListener };
|
|
@@ -1,52 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n, onScopeDispose as r, ref as i } from "vue";
|
|
3
|
+
import { CrossFrameStateManager as a } from "@intlayer/editor";
|
|
4
4
|
//#region src/editor/useCrossFrameState.ts
|
|
5
|
-
var
|
|
5
|
+
var o = (o, s, c = {
|
|
6
6
|
emit: !0,
|
|
7
7
|
receive: !0
|
|
8
8
|
}) => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
let l = n(e) ?? t(), { emit: u = !0, receive: d = !0 } = c, f = i(s);
|
|
10
|
+
if (l) {
|
|
11
|
+
let e = new a(o, l.messenger, {
|
|
12
|
+
emit: u,
|
|
13
|
+
receive: d,
|
|
14
|
+
initialValue: s
|
|
15
|
+
});
|
|
16
|
+
e.start();
|
|
17
|
+
let t = (e) => {
|
|
18
|
+
f.value = e.detail;
|
|
19
|
+
};
|
|
20
|
+
return e.addEventListener("change", t), r(() => {
|
|
21
|
+
e.removeEventListener("change", t), e.stop();
|
|
22
|
+
}), [
|
|
23
|
+
f,
|
|
24
|
+
(t) => {
|
|
25
|
+
e.set(t);
|
|
26
|
+
},
|
|
27
|
+
() => e.postCurrentValue()
|
|
15
28
|
];
|
|
16
29
|
}
|
|
17
|
-
|
|
18
|
-
let { emit: u = !0, receive: d = !0 } = l, f = r(a(c)), { postMessage: p, senderId: m } = e() ?? {}, h = (e) => {
|
|
19
|
-
!u || typeof p != "function" || e === void 0 || p({
|
|
20
|
-
type: `${s}/post`,
|
|
21
|
-
data: e,
|
|
22
|
-
senderId: m
|
|
23
|
-
});
|
|
24
|
-
}, g = (e) => {
|
|
25
|
-
let t = o(a(e, f.value));
|
|
26
|
-
f.value = t, h(t);
|
|
27
|
-
}, _ = () => {
|
|
28
|
-
typeof p == "function" && p({
|
|
29
|
-
type: `${s}/post`,
|
|
30
|
-
data: f.value,
|
|
31
|
-
senderId: m
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
return h(f.value), d && typeof p == "function" && f.value === void 0 && p({
|
|
35
|
-
type: `${s}/get`,
|
|
36
|
-
senderId: m
|
|
37
|
-
}), t(`${s}/post`, d ? (e) => {
|
|
38
|
-
f.value = e;
|
|
39
|
-
} : void 0), t(`${s}/get`, u ? (e, t) => {
|
|
40
|
-
u && t !== m && h(f.value);
|
|
41
|
-
} : void 0), i.set(s, {
|
|
42
|
-
state: f,
|
|
43
|
-
setState: g,
|
|
44
|
-
postState: _
|
|
45
|
-
}), [
|
|
30
|
+
return [
|
|
46
31
|
f,
|
|
47
|
-
|
|
48
|
-
|
|
32
|
+
(e) => {
|
|
33
|
+
f.value = e;
|
|
34
|
+
},
|
|
35
|
+
() => {}
|
|
49
36
|
];
|
|
50
37
|
};
|
|
51
38
|
//#endregion
|
|
52
|
-
export {
|
|
39
|
+
export { o as useCrossFrameState };
|
|
@@ -1,21 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { MessageKey as i } from "@intlayer/editor";
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t } from "./installIntlayerEditor.mjs";
|
|
2
|
+
import { inject as n } from "vue";
|
|
4
3
|
//#region src/editor/useCrossURLPathState.ts
|
|
5
|
-
var
|
|
6
|
-
|
|
7
|
-
emit: !0,
|
|
8
|
-
receive: !1
|
|
9
|
-
}), s = t(), c, l, u = () => o(window.location.pathname);
|
|
10
|
-
return s ? (r(() => {
|
|
11
|
-
c = history.pushState, l = history.replaceState;
|
|
12
|
-
let e = (e) => (...t) => {
|
|
13
|
-
e.apply(history, t), window.dispatchEvent(new Event("locationchange"));
|
|
14
|
-
};
|
|
15
|
-
history.pushState = e(c), history.replaceState = e(l), window.addEventListener("locationchange", u), window.addEventListener("popstate", u), window.addEventListener("hashchange", u), u();
|
|
16
|
-
}), n(() => {
|
|
17
|
-
window.removeEventListener("locationchange", u), window.removeEventListener("popstate", u), window.removeEventListener("hashchange", u), c && (history.pushState = c), l && (history.replaceState = l);
|
|
18
|
-
})) : console.warn("useCrossURLPathSetter must be called within a component setup function"), [i, o];
|
|
4
|
+
var r = () => {
|
|
5
|
+
n(e) ?? t();
|
|
19
6
|
};
|
|
20
7
|
//#endregion
|
|
21
|
-
export {
|
|
8
|
+
export { r as useCrossURLPathSetter };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { c as e } from "../../getDictionary-5DAguynf.mjs";
|
|
2
2
|
export { e as useEditor };
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { getCurrentInstance as n, onBeforeUnmount as r, onMounted as i } from "vue";
|
|
4
|
-
import { MessageKey as a, mergeIframeClick as o } from "@intlayer/editor";
|
|
1
|
+
import { useCrossFrameMessageListener as e } from "./useCrossFrameMessageListener.mjs";
|
|
2
|
+
import { MessageKey as t, mergeIframeClick as n } from "@intlayer/editor";
|
|
5
3
|
//#region src/editor/useIframeClickInterceptor.ts
|
|
6
|
-
var
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}), c = e(() => {
|
|
12
|
-
s(), t(a.INTLAYER_IFRAME_CLICKED, o);
|
|
13
|
-
});
|
|
4
|
+
var r = () => {
|
|
5
|
+
e(t.INTLAYER_IFRAME_CLICKED);
|
|
6
|
+
}, i = () => {
|
|
7
|
+
e(t.INTLAYER_IFRAME_CLICKED, n);
|
|
8
|
+
};
|
|
14
9
|
//#endregion
|
|
15
|
-
export {
|
|
10
|
+
export { r as useIframeClickInterceptor, i as useIframeClickMerger };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as e } from "../../getDictionary-5DAguynf.mjs";
|
|
2
2
|
import { computed as t, inject as n } from "vue";
|
|
3
3
|
import { percentage as r } from "@intlayer/core/formatters";
|
|
4
4
|
//#region src/format/usePercentage.ts
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as e } from "../../getDictionary-5DAguynf.mjs";
|
|
2
2
|
import { computed as t, inject as n } from "vue";
|
|
3
3
|
import { relativeTime as r } from "@intlayer/core/formatters";
|
|
4
4
|
//#region src/format/useRelativeTime.ts
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../getDictionary-
|
|
1
|
+
import { t as e } from "../getDictionary-5DAguynf.mjs";
|
|
2
2
|
export { e as getDictionary };
|
package/dist/esm/getIntlayer.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { p as e } from "../getDictionary-5DAguynf.mjs";
|
|
2
2
|
export { e as getIntlayer };
|