vue-intlayer 8.3.1 → 8.3.2
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/ContentSelector-BaMG67_z.js +1 -0
- package/dist/ContentSelector-D9fc9D1G.mjs +76 -0
- package/dist/EditedContentRenderer-CXoF8k9R.mjs +25 -0
- package/dist/EditedContentRenderer-S0zWbUak.js +1 -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/index.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/index.cjs +1 -1
- package/dist/cjs/html/installIntlayerHTML.cjs +1 -1
- package/dist/cjs/html/types.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/communicator-1rnoOTtT.js +1 -0
- package/dist/esm/UI/ContentSelector.mjs +2 -4
- package/dist/esm/client/index.mjs +3 -26
- package/dist/esm/client/installIntlayer.mjs +2 -16
- package/dist/esm/client/useDictionary.mjs +2 -100
- package/dist/esm/client/useDictionaryAsync.mjs +2 -21
- package/dist/esm/client/useDictionaryDynamic.mjs +2 -5
- package/dist/esm/client/useIntlayer.mjs +2 -59
- package/dist/esm/client/useLoadDynamic.mjs +14 -16
- package/dist/esm/client/useLocale.mjs +2 -34
- package/dist/esm/client/useLocaleStorage.mjs +24 -29
- package/dist/esm/client/useRewriteURL.mjs +2 -23
- package/dist/esm/editor/ContentSelectorWrapper.mjs +2 -4
- package/dist/esm/editor/EditedContentRenderer.mjs +2 -4
- package/dist/esm/editor/EditorSelectorRenderer.mjs +43 -38
- package/dist/esm/editor/communicator.mjs +26 -32
- package/dist/esm/editor/configuration.mjs +10 -10
- package/dist/esm/editor/createSharedComposable.mjs +9 -11
- package/dist/esm/editor/dictionariesRecord.mjs +35 -52
- package/dist/esm/editor/editedContent.mjs +41 -63
- package/dist/esm/editor/editorEnabled.mjs +37 -55
- package/dist/esm/editor/editorLocale.mjs +2 -12
- package/dist/esm/editor/focusDictionary.mjs +33 -38
- package/dist/esm/editor/index.mjs +3 -7
- package/dist/esm/editor/installIntlayerEditor.mjs +20 -16
- package/dist/esm/editor/useCrossFrameMessageListener.mjs +28 -28
- package/dist/esm/editor/useCrossFrameState.mjs +51 -43
- package/dist/esm/editor/useCrossURLPathState.mjs +20 -25
- package/dist/esm/editor/useEditedContentRenderer.mjs +9 -17
- package/dist/esm/editor/useEditor.mjs +2 -11
- package/dist/esm/editor/useIframeClickInterceptor.mjs +14 -22
- package/dist/esm/format/index.mjs +10 -20
- package/dist/esm/format/useCompact.mjs +15 -15
- package/dist/esm/format/useCurrency.mjs +15 -15
- package/dist/esm/format/useDate.mjs +15 -15
- package/dist/esm/format/useIntl.mjs +9 -12
- package/dist/esm/format/useList.mjs +15 -15
- package/dist/esm/format/useNumber.mjs +15 -15
- package/dist/esm/format/usePercentage.mjs +14 -14
- package/dist/esm/format/useRelativeTime.mjs +15 -15
- package/dist/esm/format/useUnit.mjs +15 -15
- package/dist/esm/getDictionary.mjs +2 -15
- package/dist/esm/getIntlayer.mjs +2 -15
- package/dist/esm/html/HTMLRenderer.mjs +25 -31
- package/dist/esm/html/index.mjs +3 -11
- package/dist/esm/html/installIntlayerHTML.mjs +23 -33
- package/dist/esm/html/types.mjs +0 -1
- package/dist/esm/index.mjs +12 -69
- package/dist/esm/markdown/MarkdownRenderer.mjs +105 -131
- package/dist/esm/markdown/compiler.mjs +6 -12
- package/dist/esm/markdown/index.mjs +5 -22
- package/dist/esm/markdown/installIntlayerMarkdown.mjs +47 -80
- package/dist/esm/markdown/runtime.mjs +19 -54
- package/dist/esm/plugins.mjs +2 -21
- package/dist/esm/renderIntlayerNode.mjs +33 -47
- package/dist/getDictionary-BE4ZLuzI.mjs +387 -0
- package/dist/getDictionary-DMdOvXMh.js +1 -0
- package/dist/types/getDictionary.d.ts +1 -2
- package/dist/types/getIntlayer.d.ts +1 -2
- package/dist/types/plugins.d.ts +5 -0
- package/package.json +13 -13
- package/dist/ContentSelector.vue_vue_type_script_setup_true_lang-87sjUiJI.js +0 -1
- package/dist/ContentSelector.vue_vue_type_script_setup_true_lang-CR8kSRs9.mjs +0 -73
- package/dist/EditedContentRenderer.vue_vue_type_script_setup_true_lang-BlN498QG.mjs +0 -36
- package/dist/EditedContentRenderer.vue_vue_type_script_setup_true_lang-DYN7KHa_.js +0 -1
- package/dist/plugins-Bzptc2vR.js +0 -1
- package/dist/plugins-rixQm8YE.mjs +0 -293
|
@@ -1,53 +1,36 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
);
|
|
35
|
-
if (!e)
|
|
36
|
-
throw new Error("DictionariesRecord state not found");
|
|
37
|
-
const [i, t] = u(
|
|
38
|
-
s.INTLAYER_LOCALE_DICTIONARIES_CHANGED,
|
|
39
|
-
void 0
|
|
40
|
-
);
|
|
41
|
-
D(
|
|
42
|
-
e.localeDictionaries,
|
|
43
|
-
(r) => {
|
|
44
|
-
t(r);
|
|
45
|
-
},
|
|
46
|
-
{ immediate: !0 }
|
|
47
|
-
);
|
|
1
|
+
import { createSharedComposable as e } from "./createSharedComposable.mjs";
|
|
2
|
+
import { useCrossFrameState as t } from "./useCrossFrameState.mjs";
|
|
3
|
+
import { inject as n, readonly as r, ref as i, watch as a } from "vue";
|
|
4
|
+
import { MessageKey as o } from "@intlayer/editor";
|
|
5
|
+
//#region src/editor/dictionariesRecord.ts
|
|
6
|
+
var s = null, c = Symbol("intlayerDictionariesRecord"), l = () => {
|
|
7
|
+
if (s) return s;
|
|
8
|
+
let e = i(void 0);
|
|
9
|
+
return s = {
|
|
10
|
+
localeDictionaries: r(e),
|
|
11
|
+
setLocaleDictionaries: (t) => {
|
|
12
|
+
e.value = t ?? {};
|
|
13
|
+
},
|
|
14
|
+
setLocaleDictionary(t) {
|
|
15
|
+
e.value = {
|
|
16
|
+
...e.value,
|
|
17
|
+
[t.localId]: t
|
|
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 });
|
|
48
34
|
});
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
C as installDictionariesRecord,
|
|
52
|
-
v as useDictionariesRecord
|
|
53
|
-
};
|
|
35
|
+
//#endregion
|
|
36
|
+
export { l as createDictionaryRecordClient, u as installDictionariesRecord, d as useDictionariesRecord };
|
|
@@ -1,64 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { NodeType as
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
n.value = t;
|
|
41
|
-
}
|
|
42
|
-
}, d;
|
|
43
|
-
}, A = (e, n) => {
|
|
44
|
-
const t = D(n);
|
|
45
|
-
e.provide(f, t);
|
|
46
|
-
}, R = _(() => {
|
|
47
|
-
const e = h(f);
|
|
48
|
-
if (!e)
|
|
49
|
-
throw new Error("EditedContent state not found");
|
|
50
|
-
const [n, t] = y(
|
|
51
|
-
N.INTLAYER_EDITED_CONTENT_CHANGED,
|
|
52
|
-
{}
|
|
53
|
-
);
|
|
54
|
-
return C(n, (r) => {
|
|
55
|
-
e.editedContent.value = r ?? {};
|
|
56
|
-
}), C(e, (r) => {
|
|
57
|
-
t(r.editedContent.value);
|
|
58
|
-
}), e;
|
|
1
|
+
import { createSharedComposable as e } from "./createSharedComposable.mjs";
|
|
2
|
+
import { useCrossFrameState as t } from "./useCrossFrameState.mjs";
|
|
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";
|
|
7
|
+
//#region src/editor/editedContent.ts
|
|
8
|
+
var l = null, u = Symbol("EditedContent"), d = (e) => {
|
|
9
|
+
if (l) return l;
|
|
10
|
+
let t = a({});
|
|
11
|
+
return l = {
|
|
12
|
+
editedContent: i(t),
|
|
13
|
+
getEditedContentValue: (r, i) => {
|
|
14
|
+
let a = t.value;
|
|
15
|
+
if (!a) return;
|
|
16
|
+
let o = i.filter((e) => e.type !== n.Translation), s = r.includes(":local:") || r.includes(":remote:"), l = e?.locale.value;
|
|
17
|
+
if (s) return c(a?.[r]?.content ?? {}, o, l);
|
|
18
|
+
let u = Object.keys(a).filter((e) => e.startsWith(`${r}:`));
|
|
19
|
+
for (let e of u) {
|
|
20
|
+
let t = c(a?.[e]?.content ?? {}, o, l);
|
|
21
|
+
if (t) return t;
|
|
22
|
+
}
|
|
23
|
+
},
|
|
24
|
+
setEditedContent: (e) => {
|
|
25
|
+
t.value = e;
|
|
26
|
+
}
|
|
27
|
+
}, l;
|
|
28
|
+
}, f = (e, t) => {
|
|
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;
|
|
59
40
|
});
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
A as installEditedContent,
|
|
63
|
-
R as useEditedContent
|
|
64
|
-
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { d as createEditedContentClient, f as installEditedContent, p as useEditedContent };
|
|
@@ -1,56 +1,38 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
e.wrapperEnabled.value = t;
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
return c(
|
|
40
|
-
() => e.isInIframe.value && e.settingEnabled.value,
|
|
41
|
-
(t) => {
|
|
42
|
-
n();
|
|
43
|
-
},
|
|
44
|
-
{ immediate: !0 }
|
|
45
|
-
), m(() => {
|
|
46
|
-
p(() => {
|
|
47
|
-
const t = l();
|
|
48
|
-
e.isInIframe.value = t;
|
|
49
|
-
});
|
|
50
|
-
}), e;
|
|
1
|
+
import { createSharedComposable as e } from "./createSharedComposable.mjs";
|
|
2
|
+
import { useCrossFrameMessageListener as t } from "./useCrossFrameMessageListener.mjs";
|
|
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";
|
|
6
|
+
//#region src/editor/editorEnabled.ts
|
|
7
|
+
var u = null, d = Symbol("EditorEnabled"), f = () => typeof window > "u" ? !1 : window.self !== window.top, p = () => {
|
|
8
|
+
if (u) return u;
|
|
9
|
+
let e = s(n.editor.enabled), t = s(!1), i = s(!1);
|
|
10
|
+
return u = {
|
|
11
|
+
settingEnabled: e,
|
|
12
|
+
wrapperEnabled: t,
|
|
13
|
+
isInIframe: i,
|
|
14
|
+
enabled: r(() => e.value && t.value && i.value)
|
|
15
|
+
}, u;
|
|
16
|
+
}, m = (e) => {
|
|
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;
|
|
51
36
|
});
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
T as installEditorEnabled,
|
|
55
|
-
A as useEditorEnabled
|
|
56
|
-
};
|
|
37
|
+
//#endregion
|
|
38
|
+
export { p as createEditorEnabledClient, m as installEditorEnabled, h as useEditorEnabled };
|
|
@@ -1,12 +1,2 @@
|
|
|
1
|
-
import "
|
|
2
|
-
|
|
3
|
-
import { e as d } from "../../plugins-rixQm8YE.mjs";
|
|
4
|
-
import "@intlayer/config/built";
|
|
5
|
-
import "@intlayer/core/interpreter";
|
|
6
|
-
import "../client/useLocaleStorage.mjs";
|
|
7
|
-
import "@intlayer/core/localization";
|
|
8
|
-
import "./createSharedComposable.mjs";
|
|
9
|
-
import "./useCrossFrameState.mjs";
|
|
10
|
-
export {
|
|
11
|
-
d as useEditorLocale
|
|
12
|
-
};
|
|
1
|
+
import { u as e } from "../../getDictionary-BE4ZLuzI.mjs";
|
|
2
|
+
export { e as useEditorLocale };
|
|
@@ -1,39 +1,34 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
JSON.stringify(o) !== JSON.stringify(t.focusedContent.value) && t.setFocusedContent(o ?? null);
|
|
33
|
-
}), t;
|
|
1
|
+
import { createSharedComposable as e } from "./createSharedComposable.mjs";
|
|
2
|
+
import { useCrossFrameState as t } from "./useCrossFrameState.mjs";
|
|
3
|
+
import { inject as n, readonly as r, ref as i, watch as a } from "vue";
|
|
4
|
+
import { MessageKey as o } from "@intlayer/editor";
|
|
5
|
+
//#region src/editor/focusDictionary.ts
|
|
6
|
+
var s = null, c = Symbol("FocusDictionary"), l = () => {
|
|
7
|
+
if (s) return s;
|
|
8
|
+
let e = i(null), t = (t) => {
|
|
9
|
+
e.value = t;
|
|
10
|
+
};
|
|
11
|
+
return s = {
|
|
12
|
+
focusedContent: r(e),
|
|
13
|
+
setFocusedContent: t,
|
|
14
|
+
setFocusedContentKeyPath: (n) => {
|
|
15
|
+
e.value && t({
|
|
16
|
+
...e.value,
|
|
17
|
+
keyPath: n
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
}, s;
|
|
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;
|
|
34
32
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
S as installFocusDictionary,
|
|
38
|
-
O as useFocusDictionary
|
|
39
|
-
};
|
|
33
|
+
//#endregion
|
|
34
|
+
export { l as createFocusDictionaryClient, u as installFocusDictionary, d as useFocusDictionary };
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { installIntlayerEditor as
|
|
3
|
-
export {
|
|
4
|
-
e as ContentSelectorWrapper,
|
|
5
|
-
l as installIntlayerEditor,
|
|
6
|
-
o as useEditor
|
|
7
|
-
};
|
|
1
|
+
import { c as e, l as t } from "../../getDictionary-BE4ZLuzI.mjs";
|
|
2
|
+
import { installIntlayerEditor as n } from "./installIntlayerEditor.mjs";
|
|
3
|
+
export { e as ContentSelectorWrapper, n as installIntlayerEditor, t as useEditor };
|
|
@@ -1,17 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
1
|
+
import { installCommunicator as e } from "./communicator.mjs";
|
|
2
|
+
import { installEditorEnabled as t } from "./editorEnabled.mjs";
|
|
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";
|
|
7
|
+
//#region src/editor/installIntlayerEditor.ts
|
|
8
|
+
var { editor: o } = a, { applicationURL: s, editorURL: c, cmsURL: l } = o ?? {}, u = (e) => {
|
|
9
|
+
typeof window > "u" || window.self !== window.top && (o.applicationURL.length > 0 && window.postMessage(e, o.applicationURL), o.editorURL.length > 0 && window.parent.postMessage(e, o.editorURL), o.cmsURL.length > 0 && window.parent.postMessage(e, o.cmsURL));
|
|
10
|
+
}, d = (a, o) => {
|
|
11
|
+
e(a, {
|
|
12
|
+
postMessage: u,
|
|
13
|
+
allowedOrigins: [
|
|
14
|
+
s,
|
|
15
|
+
c,
|
|
16
|
+
l
|
|
17
|
+
]
|
|
18
|
+
}), t(a), r(a), i(a, o), n(a);
|
|
17
19
|
};
|
|
20
|
+
//#endregion
|
|
21
|
+
export { d as installIntlayerEditor };
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
};
|
|
27
|
-
export {
|
|
28
|
-
L as useCrossFrameMessageListener
|
|
1
|
+
import { useCommunicator as e } from "./communicator.mjs";
|
|
2
|
+
import { getCurrentInstance as t, onScopeDispose as n } from "vue";
|
|
3
|
+
import { compareUrls as r } from "@intlayer/editor";
|
|
4
|
+
//#region src/editor/useCrossFrameMessageListener.ts
|
|
5
|
+
var i = /* @__PURE__ */ new Map(), a = !1, o = (e, t) => {
|
|
6
|
+
let n = i.get(e);
|
|
7
|
+
n || (n = /* @__PURE__ */ new Set(), i.set(e, n)), n.add(t);
|
|
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
|
+
};
|
|
29
27
|
};
|
|
28
|
+
//#endregion
|
|
29
|
+
export { l as useCrossFrameMessageListener };
|
|
@@ -1,44 +1,52 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
1
|
+
import { useCommunicator as e } from "./communicator.mjs";
|
|
2
|
+
import { useCrossFrameMessageListener as t } from "./useCrossFrameMessageListener.mjs";
|
|
3
|
+
import { getCurrentInstance as n, ref as r } from "vue";
|
|
4
|
+
//#region src/editor/useCrossFrameState.ts
|
|
5
|
+
var i = /* @__PURE__ */ new Map(), a = (e, t) => typeof e == "function" ? e(t) : e, o = (e) => e == null ? e : JSON.parse(JSON.stringify(e)), s = (s, c, l = {
|
|
6
|
+
emit: !0,
|
|
7
|
+
receive: !0
|
|
8
|
+
}) => {
|
|
9
|
+
if (i.has(s)) {
|
|
10
|
+
let { state: e, setState: t, postState: n } = i.get(s);
|
|
11
|
+
return [
|
|
12
|
+
e,
|
|
13
|
+
t,
|
|
14
|
+
n
|
|
15
|
+
];
|
|
16
|
+
}
|
|
17
|
+
n() || console.warn("useCrossFrameState called outside a component setup function - reactivity may be limited");
|
|
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
|
+
}), [
|
|
46
|
+
f,
|
|
47
|
+
g,
|
|
48
|
+
_
|
|
49
|
+
];
|
|
44
50
|
};
|
|
51
|
+
//#endregion
|
|
52
|
+
export { s as useCrossFrameState };
|