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
package/dist/esm/index.mjs
CHANGED
|
@@ -1,13 +1,22 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t, installIntlayerEditor as n } from "./editor/installIntlayerEditor.mjs";
|
|
2
|
+
import { useEditorEnabled as r } from "./editor/editorEnabled.mjs";
|
|
3
|
+
import { useFocusDictionary as i } from "./editor/focusDictionary.mjs";
|
|
4
|
+
import { t as a } from "../ContentSelectorWrapper-B7p44V28.mjs";
|
|
5
|
+
import { useConfiguration as o } from "./editor/configuration.mjs";
|
|
6
|
+
import { useDictionariesRecord as s } from "./editor/dictionariesRecord.mjs";
|
|
7
|
+
import { useEditedContent as c } from "./editor/editedContent.mjs";
|
|
8
|
+
import { C as l, S as u, T as d, _ as f, a as p, b as m, c as h, d as g, f as _, g as v, h as y, i as b, l as x, m as S, n as C, o as w, p as T, r as E, s as D, t as O, u as k, v as A, w as j, x as M, y as N } from "../getDictionary-5DAguynf.mjs";
|
|
9
|
+
import { useLoadDynamic as P } from "./client/useLoadDynamic.mjs";
|
|
10
|
+
import { useCrossFrameMessageListener as F } from "./editor/useCrossFrameMessageListener.mjs";
|
|
11
|
+
import { useCrossFrameState as I } from "./editor/useCrossFrameState.mjs";
|
|
12
|
+
import { useIframeClickInterceptor as L, useIframeClickMerger as R } from "./editor/useIframeClickInterceptor.mjs";
|
|
13
|
+
import z, { createVueRuntime as B } from "./markdown/runtime.mjs";
|
|
14
|
+
import { RuleType as V, compile as H, compileMarkdown as U, compiler as W, sanitizer as G, slugify as K } from "./markdown/compiler.mjs";
|
|
15
|
+
import { INTLAYER_MARKDOWN_SYMBOL as q, createIntlayerMarkdownClient as J, installIntlayerMarkdown as Y, useMarkdown as X } from "./markdown/installIntlayerMarkdown.mjs";
|
|
16
|
+
import { useIntl as Z } from "./format/useIntl.mjs";
|
|
17
|
+
import { INTLAYER_HTML_SYMBOL as Q, createIntlayerHTMLClient as $, installIntlayerHTML as ee, useHTML as te } from "./html/installIntlayerHTML.mjs";
|
|
18
|
+
import { HTMLRenderer as ne, renderHTML as re, useHTMLRenderer as ie } from "./html/HTMLRenderer.mjs";
|
|
10
19
|
import "./html/index.mjs";
|
|
11
|
-
import { MarkdownRenderer as
|
|
20
|
+
import { MarkdownRenderer as ae, renderMarkdown as oe, useMarkdownRenderer as se } from "./markdown/MarkdownRenderer.mjs";
|
|
12
21
|
import "./markdown/index.mjs";
|
|
13
|
-
export {
|
|
22
|
+
export { a as ContentSelectorWrapper, ne as HTMLRenderer, e as INTLAYER_EDITOR_MANAGER_SYMBOL, Q as INTLAYER_HTML_SYMBOL, q as INTLAYER_MARKDOWN_SYMBOL, l as INTLAYER_SYMBOL, ae as MarkdownRenderer, V as RuleType, v as atPath, H as compile, U as compileMarkdown, W as compiler, j as createIntlayerClient, $ as createIntlayerHTMLClient, f as createIntlayerLeafProxy, J as createIntlayerMarkdownClient, B as createVueRuntime, O as getDictionary, t as getEditorStateManager, T as getIntlayer, C as getPlugins, E as htmlPlugin, b as insertionPlugin, d as installIntlayer, n as installIntlayerEditor, ee as installIntlayerHTML, Y as installIntlayerMarkdown, p as intlayerNodePlugins, A as isComponentLike, N as isIntlayerNode, m as isObjectLike, w as markdownPlugin, D as markdownStringPlugin, re as renderHTML, oe as renderMarkdown, G as sanitizer, K as slugify, M as toComponent, o as useConfiguration, F as useCrossFrameMessageListener, I as useCrossFrameState, s as useDictionariesRecord, u as useDictionary, y as useDictionaryAsync, S as useDictionaryDynamic, c as useEditedContent, h as useEditor, r as useEditorEnabled, x as useEditorLocale, i as useFocusDictionary, te as useHTML, ie as useHTMLRenderer, L as useIframeClickInterceptor, R as useIframeClickMerger, Z as useIntl, _ as useIntlayer, P as useLoadDynamic, g as useLocale, X as useMarkdown, se as useMarkdownRenderer, k as useRewriteURL, z as vueRuntime };
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as e, i as t, n, o as r, r as i, s as a } from "../getDictionary-
|
|
1
|
+
import { a as e, i as t, n, o as r, r as i, s as a } from "../getDictionary-5DAguynf.mjs";
|
|
2
2
|
export { n as getPlugins, i as htmlPlugin, t as insertionPlugin, e as intlayerNodePlugins, r as markdownPlugin, a as markdownStringPlugin };
|
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { useCommunicator as t } from "./esm/editor/communicator.mjs";
|
|
3
|
-
import { createSharedComposable as n } from "./esm/editor/createSharedComposable.mjs";
|
|
1
|
+
import { INTLAYER_EDITOR_MANAGER_SYMBOL as e, getEditorStateManager as t, installIntlayerEditor as n } from "./esm/editor/installIntlayerEditor.mjs";
|
|
4
2
|
import { useEditorEnabled as r } from "./esm/editor/editorEnabled.mjs";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
19
|
-
import { NodeType as g } from "@intlayer/types/nodeType";
|
|
20
|
-
import { Fragment as _, computed as v, createBlock as de, createElementBlock as fe, defineComponent as y, h as b, inject as x, isRef as S, markRaw as C, openBlock as w, readonly as pe, ref as T, renderSlot as E, shallowRef as D, toValue as O, unref as me, watch as k, withCtx as he } from "vue";
|
|
21
|
-
import { isSameKeyPath as ge } from "@intlayer/core/utils";
|
|
22
|
-
import { MessageKey as A } from "@intlayer/editor";
|
|
23
|
-
import { getRewritePath as _e } from "@intlayer/core/localization";
|
|
3
|
+
import { useFocusDictionary as i } from "./esm/editor/focusDictionary.mjs";
|
|
4
|
+
import { t as a } from "./ContentSelectorWrapper-B7p44V28.mjs";
|
|
5
|
+
import { useDictionariesRecord as o } from "./esm/editor/dictionariesRecord.mjs";
|
|
6
|
+
import { setLocaleInStorage as s } from "./esm/client/useLocaleStorage.mjs";
|
|
7
|
+
import { useIframeClickMerger as c } from "./esm/editor/useIframeClickInterceptor.mjs";
|
|
8
|
+
import { useMarkdown as l } from "./esm/markdown/installIntlayerMarkdown.mjs";
|
|
9
|
+
import { renderIntlayerNode as u } from "./esm/renderIntlayerNode.mjs";
|
|
10
|
+
import { conditionPlugin as d, enumerationPlugin as f, filePlugin as ee, genderPlugin as p, getDictionary as te, getHTML as m, getIntlayer as ne, nestedPlugin as re, splitInsertionTemplate as ie, translationPlugin as h } from "@intlayer/core/interpreter";
|
|
11
|
+
import g from "@intlayer/config/built";
|
|
12
|
+
import { getMarkdownMetadata as ae } from "@intlayer/core/markdown";
|
|
13
|
+
import { HTML_TAGS as oe } from "@intlayer/core/transpiler";
|
|
14
|
+
import { NodeType as _ } from "@intlayer/types/nodeType";
|
|
15
|
+
import { Fragment as v, computed as y, defineComponent as b, h as x, inject as S, isRef as C, markRaw as w, readonly as T, ref as E, shallowRef as D, toValue as O, watch as k } from "vue";
|
|
16
|
+
import { getRewritePath as A } from "@intlayer/core/localization";
|
|
24
17
|
//#region src/client/installIntlayer.ts
|
|
25
18
|
var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
26
19
|
if (M) return M;
|
|
27
|
-
let { defaultLocale: n } =
|
|
20
|
+
let { defaultLocale: n } = g.internationalization ?? {}, r = E(e ?? n);
|
|
28
21
|
return M = {
|
|
29
|
-
locale:
|
|
22
|
+
locale: T(r),
|
|
30
23
|
setLocale: (e) => {
|
|
31
24
|
r.value = e;
|
|
32
25
|
},
|
|
33
26
|
isCookieEnabled: t
|
|
34
27
|
}, M;
|
|
35
|
-
},
|
|
36
|
-
let
|
|
37
|
-
return e.provide(j,
|
|
38
|
-
}, P = (e, t) => t.reduce((e, t) => e?.[t], e), F = (e) => typeof e == "object" && !!e, I = (e) => typeof e == "function" || F(e) && ("render" in e || "setup" in e), L = (e) => typeof e == "object" && !!e && "__update" in e && "render" in e && "raw" in e, R = (e) =>
|
|
28
|
+
}, se = (e, t, r = !0) => {
|
|
29
|
+
let i = N(t, r);
|
|
30
|
+
return e.provide(j, i), n(e, i), e;
|
|
31
|
+
}, P = (e, t) => t.reduce((e, t) => e?.[t], e), F = (e) => typeof e == "object" && !!e, I = (e) => typeof e == "function" || F(e) && ("render" in e || "setup" in e), L = (e) => typeof e == "object" && !!e && "__update" in e && "render" in e && "raw" in e, R = (e) => w(b({
|
|
39
32
|
name: "IntlayerLeaf",
|
|
40
33
|
setup() {
|
|
41
34
|
return () => {
|
|
42
35
|
let t = e();
|
|
43
|
-
return t == null ? null : I(t) ?
|
|
36
|
+
return t == null ? null : I(t) ? x(t) : Array.isArray(t) ? x("span", t) : t;
|
|
44
37
|
};
|
|
45
38
|
}
|
|
46
39
|
})), z = (e) => new Proxy({}, {
|
|
@@ -66,7 +59,7 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
66
59
|
};
|
|
67
60
|
}
|
|
68
61
|
}), B = (e, t) => {
|
|
69
|
-
let n =
|
|
62
|
+
let n = S(j), r = C(n?.locale) ? n.locale : E(n?.locale ?? g.internationalization.defaultLocale), i = y(() => (t === void 0 ? void 0 : O(t)) ?? r.value), a = D({});
|
|
70
63
|
k([() => O(e), () => i.value], ([e, t]) => {
|
|
71
64
|
a.value = $(e, t);
|
|
72
65
|
}, {
|
|
@@ -76,7 +69,7 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
76
69
|
let o = (e) => new Proxy({}, {
|
|
77
70
|
get(t, n, r) {
|
|
78
71
|
if (n === "__v_isRef") return !0;
|
|
79
|
-
let i =
|
|
72
|
+
let i = y(() => P(a.value, e));
|
|
80
73
|
if (n === "value") return i.value ?? "";
|
|
81
74
|
if (n === "then") return;
|
|
82
75
|
if (n === "c" || n === "asComponent") return R(() => i.value);
|
|
@@ -84,8 +77,8 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
84
77
|
if (n === Symbol.toPrimitive) return () => i.value;
|
|
85
78
|
let s = e.concat(n), c = P(a.value, s);
|
|
86
79
|
if (c === void 0 || F(c) && !I(c)) return o(s);
|
|
87
|
-
if (L(c)) return z(
|
|
88
|
-
let l =
|
|
80
|
+
if (L(c)) return z(y(() => P(a.value, s)));
|
|
81
|
+
let l = y(() => P(a.value, s));
|
|
89
82
|
return new Proxy(l, { get(e, t, n) {
|
|
90
83
|
return t === "value" ? e.value ?? "" : Reflect.get(e, t, n);
|
|
91
84
|
} });
|
|
@@ -103,15 +96,15 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
103
96
|
});
|
|
104
97
|
return o([]);
|
|
105
98
|
}, V = async (e, t) => {
|
|
106
|
-
let n =
|
|
99
|
+
let n = S(j), r = y(() => t ?? n?.locale?.value ?? g?.internationalization.defaultLocale), i = E(await e[r.value]?.());
|
|
107
100
|
return k(() => r.value, async (t) => {
|
|
108
101
|
let n = await e[t]?.();
|
|
109
102
|
n && (i.value = n);
|
|
110
103
|
}), B(i, r);
|
|
111
|
-
},
|
|
112
|
-
let n =
|
|
104
|
+
}, H = async (e, t, n) => await V(e, n), U = (e, t) => ne(e, t, Q(t)), W = (e, t) => {
|
|
105
|
+
let n = S(j), r = C(n?.locale) ? n.locale : E(n?.locale ?? g.internationalization.defaultLocale), i = y(() => (t === void 0 ? void 0 : O(t)) ?? r.value), a = D({});
|
|
113
106
|
k([() => O(e), () => i.value], ([e, t]) => {
|
|
114
|
-
a.value =
|
|
107
|
+
a.value = U(e, t);
|
|
115
108
|
}, {
|
|
116
109
|
immediate: !0,
|
|
117
110
|
flush: "sync"
|
|
@@ -119,7 +112,7 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
119
112
|
let o = /* @__PURE__ */ new Map(), s = (e) => {
|
|
120
113
|
let t = e.join(".");
|
|
121
114
|
if (o.has(t)) return o.get(t);
|
|
122
|
-
let n =
|
|
115
|
+
let n = y(() => P(a.value, e)), r = new Proxy({}, {
|
|
123
116
|
get(t, r, i) {
|
|
124
117
|
if (typeof r == "symbol" || typeof r == "string" && (r.startsWith("__") || r.startsWith("$"))) return r === "__v_isRef" ? !0 : r === "then" ? void 0 : Reflect.get(t, r, i);
|
|
125
118
|
if (r === "value") return n.value ?? "";
|
|
@@ -128,8 +121,8 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
128
121
|
if (r === Symbol.toPrimitive) return () => String(n.value ?? "");
|
|
129
122
|
let o = e.concat(r), c = P(a.value, o);
|
|
130
123
|
if (c === void 0 || F(c) && !I(c)) return s(o);
|
|
131
|
-
if (L(c)) return z(
|
|
132
|
-
let l =
|
|
124
|
+
if (L(c)) return z(y(() => P(a.value, o)));
|
|
125
|
+
let l = y(() => P(a.value, o));
|
|
133
126
|
return new Proxy(l, { get(e, t, n) {
|
|
134
127
|
return t === "value" ? e.value ?? "" : t === "__v_isRef" ? !0 : Reflect.get(e, t, n);
|
|
135
128
|
} });
|
|
@@ -148,10 +141,10 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
148
141
|
return o.set(t, r), r;
|
|
149
142
|
};
|
|
150
143
|
return s([]);
|
|
151
|
-
},
|
|
152
|
-
let { defaultLocale: n, locales: r } =
|
|
144
|
+
}, G = ({ isCookieEnabled: e, onLocaleChange: t } = {}) => {
|
|
145
|
+
let { defaultLocale: n, locales: r } = g?.internationalization ?? {}, i = S(j);
|
|
153
146
|
return {
|
|
154
|
-
locale:
|
|
147
|
+
locale: y(() => i?.locale?.value ?? n),
|
|
155
148
|
defaultLocale: n,
|
|
156
149
|
availableLocales: r,
|
|
157
150
|
setLocale: (n) => {
|
|
@@ -159,100 +152,52 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
159
152
|
console.error(`Locale ${n} is not available`);
|
|
160
153
|
return;
|
|
161
154
|
}
|
|
162
|
-
i && i.setLocale(n),
|
|
155
|
+
i && i.setLocale(n), s(n, e ?? i?.isCookieEnabled ?? !0), t?.(n);
|
|
163
156
|
}
|
|
164
157
|
};
|
|
165
|
-
},
|
|
166
|
-
let { locale: e } =
|
|
158
|
+
}, ce = () => {
|
|
159
|
+
let { locale: e } = G(), t = g?.routing?.rewrite;
|
|
167
160
|
k(e, (e) => {
|
|
168
161
|
if (typeof window > "u" || !t) return;
|
|
169
|
-
let n = window.location.pathname, r =
|
|
162
|
+
let n = window.location.pathname, r = A(n, e, t);
|
|
170
163
|
r && r !== n && window.history.replaceState(window.history.state, "", r + window.location.search + window.location.hash);
|
|
171
164
|
}, { immediate: !0 });
|
|
172
|
-
},
|
|
173
|
-
let e =
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
}
|
|
180
|
-
o(), r(), a(), u(), l(), W(), s();
|
|
181
|
-
}), Se = {
|
|
182
|
-
key: 1,
|
|
183
|
-
style: { display: "contents" }
|
|
184
|
-
}, K = /* @__PURE__ */ y({
|
|
185
|
-
__name: "ContentSelectorWrapper",
|
|
186
|
-
props: {
|
|
187
|
-
dictionaryKey: {},
|
|
188
|
-
keyPath: {},
|
|
189
|
-
plugins: {},
|
|
190
|
-
locale: {},
|
|
191
|
-
dictionaryPath: {},
|
|
192
|
-
children: {}
|
|
193
|
-
},
|
|
194
|
-
setup(n) {
|
|
195
|
-
let i = n, o = a(), s = r(), c = t();
|
|
196
|
-
G();
|
|
197
|
-
let l = v(() => i.keyPath.filter((e) => e.type !== g.Translation)), u = v(() => o?.focusedContent.value?.dictionaryKey === i.dictionaryKey && (o?.focusedContent.value.keyPath?.length ?? 0) > 0 && ge(o?.focusedContent.value.keyPath ?? [], l.value)), d = () => {
|
|
198
|
-
o?.setFocusedContent({
|
|
199
|
-
dictionaryKey: i.dictionaryKey,
|
|
200
|
-
keyPath: l.value
|
|
201
|
-
});
|
|
202
|
-
}, f = () => {
|
|
203
|
-
c?.postMessage({
|
|
204
|
-
type: `${A.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,
|
|
205
|
-
data: {
|
|
206
|
-
dictionaryKey: i.dictionaryKey,
|
|
207
|
-
keyPath: l.value
|
|
208
|
-
}
|
|
209
|
-
});
|
|
210
|
-
}, p = () => {
|
|
211
|
-
c?.postMessage({
|
|
212
|
-
type: `${A.INTLAYER_HOVERED_CONTENT_CHANGED}/post`,
|
|
213
|
-
data: null
|
|
214
|
-
});
|
|
215
|
-
};
|
|
216
|
-
return (t, n) => me(s)?.enabled.value ? (w(), de(e, {
|
|
217
|
-
key: 0,
|
|
218
|
-
onPress: d,
|
|
219
|
-
isSelecting: u.value,
|
|
220
|
-
onHover: f,
|
|
221
|
-
onUnhover: p
|
|
222
|
-
}, {
|
|
223
|
-
default: he(() => [E(t.$slots, "default")]),
|
|
224
|
-
_: 3
|
|
225
|
-
}, 8, ["isSelecting"])) : (w(), fe("span", Se, [E(t.$slots, "default")]));
|
|
226
|
-
}
|
|
227
|
-
}), q = {
|
|
165
|
+
}, K = () => {
|
|
166
|
+
let n = S(e) ?? t(), r = S(j);
|
|
167
|
+
return r && k(r.locale, (e) => {
|
|
168
|
+
n?.currentLocale.set(e);
|
|
169
|
+
}, { immediate: !0 }), r;
|
|
170
|
+
}, le = () => {
|
|
171
|
+
r(), i(), c(), K(), o();
|
|
172
|
+
}, q = {
|
|
228
173
|
id: "intlayer-node-plugin",
|
|
229
174
|
canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
|
|
230
175
|
transform: (e, { children: t, ...n }) => {
|
|
231
|
-
let r = (e) =>
|
|
176
|
+
let r = (e) => u({
|
|
232
177
|
...n,
|
|
233
178
|
value: e,
|
|
234
|
-
children:
|
|
179
|
+
children: g?.editor.enabled ? () => x(a, {
|
|
235
180
|
dictionaryKey: n.dictionaryKey,
|
|
236
181
|
keyPath: n.keyPath
|
|
237
182
|
}, { default: () => typeof e == "function" ? e() : e }) : e
|
|
238
183
|
}), i = r(t);
|
|
239
184
|
if (typeof t != "function") return i;
|
|
240
|
-
let
|
|
241
|
-
Object.setPrototypeOf(
|
|
185
|
+
let o = (...e) => r(t(...e));
|
|
186
|
+
Object.setPrototypeOf(o, Object.getPrototypeOf(i));
|
|
242
187
|
for (let e of Object.getOwnPropertyNames(i)) {
|
|
243
188
|
let t = Object.getOwnPropertyDescriptor(i, e);
|
|
244
|
-
t && Object.defineProperty(
|
|
189
|
+
t && Object.defineProperty(o, e, t);
|
|
245
190
|
}
|
|
246
191
|
for (let e of Object.getOwnPropertySymbols(i)) {
|
|
247
192
|
let t = Object.getOwnPropertyDescriptor(i, e);
|
|
248
|
-
t && Object.defineProperty(
|
|
193
|
+
t && Object.defineProperty(o, e, t);
|
|
249
194
|
}
|
|
250
|
-
return
|
|
195
|
+
return w(o);
|
|
251
196
|
}
|
|
252
|
-
},
|
|
197
|
+
}, ue = (e, t) => {
|
|
253
198
|
let n = /* @__PURE__ */ new Map(), r = {};
|
|
254
199
|
for (let [e, i] of Object.entries(t)) typeof i == "string" || typeof i == "number" ? r[e] = i : (n.set(e, i), r[e] = `__VNODE_${e}__`);
|
|
255
|
-
let i =
|
|
200
|
+
let i = ie(e, r);
|
|
256
201
|
if (n.size > 0) {
|
|
257
202
|
let e = [];
|
|
258
203
|
if (i.isSimple) {
|
|
@@ -261,7 +206,7 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
261
206
|
let a = `__VNODE_${i}__`, o = t.indexOf(a);
|
|
262
207
|
o !== -1 && (o > r && e.push(t.substring(r, o)), e.push(n.get(i)), r = o + a.length);
|
|
263
208
|
}
|
|
264
|
-
return r < t.length && e.push(t.substring(r)),
|
|
209
|
+
return r < t.length && e.push(t.substring(r)), x(v, null, ...e);
|
|
265
210
|
} else return i.parts.forEach((t) => {
|
|
266
211
|
if (typeof t == "string") {
|
|
267
212
|
let r = t;
|
|
@@ -271,14 +216,14 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
271
216
|
}
|
|
272
217
|
r.length > 0 && e.push(r);
|
|
273
218
|
} else e.push(t);
|
|
274
|
-
}),
|
|
219
|
+
}), x(v, null, ...e);
|
|
275
220
|
}
|
|
276
|
-
return i.isSimple ? i.parts :
|
|
221
|
+
return i.isSimple ? i.parts : x(v, null, i.parts);
|
|
277
222
|
}, J = {
|
|
278
223
|
id: "insertion-plugin",
|
|
279
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
224
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === _.Insertion,
|
|
280
225
|
transform: (e, t, n) => {
|
|
281
|
-
let r = [...t.keyPath, { type:
|
|
226
|
+
let r = [...t.keyPath, { type: _.Insertion }], i = e[_.Insertion], a = {
|
|
282
227
|
id: "insertion-string-plugin",
|
|
283
228
|
canHandle: (e) => typeof e == "string",
|
|
284
229
|
transform: (e, n, r) => {
|
|
@@ -288,7 +233,7 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
288
233
|
plugins: [...(t.plugins ?? []).filter((e) => e.id !== "intlayer-node-plugin")]
|
|
289
234
|
});
|
|
290
235
|
return (e) => {
|
|
291
|
-
let a =
|
|
236
|
+
let a = ue(i, e);
|
|
292
237
|
return r(a, {
|
|
293
238
|
...n,
|
|
294
239
|
plugins: t.plugins,
|
|
@@ -308,11 +253,11 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
308
253
|
id: "markdown-string-plugin",
|
|
309
254
|
canHandle: (e) => typeof e == "string",
|
|
310
255
|
transform: (e, t, n) => {
|
|
311
|
-
let { plugins: r, ...i } = t,
|
|
256
|
+
let { plugins: r, ...i } = t, o = n(ae(e), {
|
|
312
257
|
plugins: [{
|
|
313
258
|
id: "markdown-metadata-plugin",
|
|
314
259
|
canHandle: (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || !e,
|
|
315
|
-
transform: (t, n) =>
|
|
260
|
+
transform: (t, n) => u({
|
|
316
261
|
...n,
|
|
317
262
|
value: t,
|
|
318
263
|
children: e
|
|
@@ -320,30 +265,30 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
320
265
|
}],
|
|
321
266
|
dictionaryKey: i.dictionaryKey,
|
|
322
267
|
keyPath: []
|
|
323
|
-
}),
|
|
268
|
+
}), s = (n) => u({
|
|
324
269
|
...t,
|
|
325
270
|
value: e,
|
|
326
|
-
children: () =>
|
|
271
|
+
children: () => x(a, {
|
|
327
272
|
dictionaryKey: i.dictionaryKey,
|
|
328
273
|
keyPath: i.keyPath
|
|
329
274
|
}, { default: () => {
|
|
330
|
-
let { renderMarkdown: t, components: r } =
|
|
275
|
+
let { renderMarkdown: t, components: r } = l();
|
|
331
276
|
return t(e, void 0, {
|
|
332
277
|
...r ?? {},
|
|
333
278
|
...n ?? {}
|
|
334
279
|
});
|
|
335
280
|
} }),
|
|
336
|
-
additionalProps: { metadata:
|
|
337
|
-
}),
|
|
338
|
-
return new Proxy(
|
|
339
|
-
return n === "value" ? e : n === "metadata" ?
|
|
281
|
+
additionalProps: { metadata: o }
|
|
282
|
+
}), c = s();
|
|
283
|
+
return new Proxy(c, { get(t, n, r) {
|
|
284
|
+
return n === "value" ? e : n === "metadata" ? o : n === "use" ? (e) => s(e) : Reflect.get(t, n, r);
|
|
340
285
|
} });
|
|
341
286
|
}
|
|
342
287
|
}, X = {
|
|
343
288
|
id: "markdown-plugin",
|
|
344
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
289
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === _.Markdown,
|
|
345
290
|
transform: (e, t, n) => {
|
|
346
|
-
let r = [...t.keyPath, { type:
|
|
291
|
+
let r = [...t.keyPath, { type: _.Markdown }], i = e[_.Markdown];
|
|
347
292
|
return n(i, {
|
|
348
293
|
...t,
|
|
349
294
|
children: i,
|
|
@@ -351,37 +296,37 @@ var j = Symbol("intlayer"), M = null, N = (e, t = !0) => {
|
|
|
351
296
|
plugins: [Y, ...t.plugins ?? []]
|
|
352
297
|
});
|
|
353
298
|
}
|
|
354
|
-
},
|
|
299
|
+
}, de = (() => {
|
|
355
300
|
let e = {};
|
|
356
|
-
for (let t of
|
|
301
|
+
for (let t of oe) e[t] = ({ children: e, ...n }) => x(t, n, e);
|
|
357
302
|
return e;
|
|
358
303
|
})(), Z = {
|
|
359
304
|
id: "html-plugin",
|
|
360
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
305
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === _.HTML,
|
|
361
306
|
transform: (e, t) => {
|
|
362
|
-
let n = e[
|
|
307
|
+
let n = e[_.HTML];
|
|
363
308
|
e.tags;
|
|
364
|
-
let r = (e) =>
|
|
365
|
-
...
|
|
309
|
+
let r = (e) => m(n, {
|
|
310
|
+
...de,
|
|
366
311
|
...e
|
|
367
312
|
});
|
|
368
|
-
return
|
|
313
|
+
return u({
|
|
369
314
|
...t,
|
|
370
315
|
value: n,
|
|
371
316
|
children: (e) => r(e)
|
|
372
317
|
});
|
|
373
318
|
}
|
|
374
319
|
}, Q = (e, t = !0) => [
|
|
375
|
-
|
|
320
|
+
h(e ?? g.internationalization.defaultLocale, t ? g.internationalization.defaultLocale : void 0),
|
|
321
|
+
f,
|
|
322
|
+
d,
|
|
323
|
+
re(e ?? g.internationalization.defaultLocale),
|
|
376
324
|
ee,
|
|
377
|
-
|
|
378
|
-
oe(e ?? h.internationalization.defaultLocale),
|
|
379
|
-
te,
|
|
380
|
-
ne,
|
|
325
|
+
p,
|
|
381
326
|
q,
|
|
382
327
|
J,
|
|
383
328
|
X,
|
|
384
329
|
Z
|
|
385
|
-
], $ = (e, t) =>
|
|
330
|
+
], $ = (e, t) => te(e, t, Q(t));
|
|
386
331
|
//#endregion
|
|
387
|
-
export {
|
|
332
|
+
export { j as C, B as S, se as T, z as _, q as a, F as b, le as c, G as d, W as f, P as g, V as h, J as i, K as l, H as m, Q as n, X as o, U as p, Z as r, Y as s, $ as t, ce as u, I as v, N as w, R as x, L as y };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const e=require(`./installIntlayerEditor-BpsBr4EN.js`),t=require(`./cjs/editor/editorEnabled.cjs`),n=require(`./cjs/editor/focusDictionary.cjs`),r=require(`./ContentSelectorWrapper-DpyRYcE8.js`),i=require(`./cjs/editor/dictionariesRecord.cjs`),a=require(`./cjs/client/useLocaleStorage.cjs`),o=require(`./cjs/editor/useIframeClickInterceptor.cjs`),s=require(`./cjs/markdown/installIntlayerMarkdown.cjs`),c=require(`./cjs/renderIntlayerNode.cjs`);let l=require(`@intlayer/core/interpreter`),u=require(`@intlayer/config/built`);u=e.i(u);let d=require(`@intlayer/core/markdown`),f=require(`@intlayer/core/transpiler`),p=require(`@intlayer/types/nodeType`),m=require(`vue`),h=require(`@intlayer/core/localization`);var g=Symbol(`intlayer`),_=null,v=(e,t=!0)=>{if(_)return _;let{defaultLocale:n}=u.default.internationalization??{},r=(0,m.ref)(e??n);return _={locale:(0,m.readonly)(r),setLocale:e=>{r.value=e},isCookieEnabled:t},_},y=(t,n,r=!0)=>{let i=v(n,r);return t.provide(g,i),e.r(t,i),t},b=(e,t)=>t.reduce((e,t)=>e?.[t],e),x=e=>typeof e==`object`&&!!e,S=e=>typeof e==`function`||x(e)&&(`render`in e||`setup`in e),C=e=>typeof e==`object`&&!!e&&`__update`in e&&`render`in e&&`raw`in e,w=e=>(0,m.markRaw)((0,m.defineComponent)({name:`IntlayerLeaf`,setup(){return()=>{let t=e();return t==null?null:S(t)?(0,m.h)(t):Array.isArray(t)?(0,m.h)(`span`,t):t}}})),T=e=>new Proxy({},{get(t,n){let r=e.value;if(n===`__v_isRef`)return!0;if(n===`value`)return r??``;if(n===`$raw`)return e;if(n===`__v_skip`)return!0;if(n===`c`||n===`asComponent`)return w(()=>e.value);if(r==null)return n===Symbol.toPrimitive||n===`toString`?()=>``:void 0;let i=r[n];return typeof i==`function`?i.bind(r):i},ownKeys(){let t=e.value;return typeof t==`object`&&t?Reflect.ownKeys(t):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}}),E=(e,t)=>{let n=(0,m.inject)(g),r=(0,m.isRef)(n?.locale)?n.locale:(0,m.ref)(n?.locale??u.default.internationalization.defaultLocale),i=(0,m.computed)(()=>(t===void 0?void 0:(0,m.toValue)(t))??r.value),a=(0,m.shallowRef)({});(0,m.watch)([()=>(0,m.toValue)(e),()=>i.value],([e,t])=>{a.value=U(e,t)},{immediate:!0,flush:`sync`});let o=e=>new Proxy({},{get(t,n,r){if(n===`__v_isRef`)return!0;let i=(0,m.computed)(()=>b(a.value,e));if(n===`value`)return i.value??``;if(n===`then`)return;if(n===`c`||n===`asComponent`)return w(()=>i.value);if(n===`$raw`)return i;if(n===Symbol.toPrimitive)return()=>i.value;let s=e.concat(n),c=b(a.value,s);if(c===void 0||x(c)&&!S(c))return o(s);if(C(c))return T((0,m.computed)(()=>b(a.value,s)));let l=(0,m.computed)(()=>b(a.value,s));return new Proxy(l,{get(e,t,n){return t===`value`?e.value??``:Reflect.get(e,t,n)}})},ownKeys(){let t=b(a.value,e);return x(t)?Reflect.ownKeys(t):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return o([])},D=async(e,t)=>{let n=(0,m.inject)(g),r=(0,m.computed)(()=>t??n?.locale?.value??u.default?.internationalization.defaultLocale),i=(0,m.ref)(await e[r.value]?.());return(0,m.watch)(()=>r.value,async t=>{let n=await e[t]?.();n&&(i.value=n)}),E(i,r)},O=async(e,t,n)=>await D(e,n),k=(e,t)=>(0,l.getIntlayer)(e,t,H(t)),A=(e,t)=>{let n=(0,m.inject)(g),r=(0,m.isRef)(n?.locale)?n.locale:(0,m.ref)(n?.locale??u.default.internationalization.defaultLocale),i=(0,m.computed)(()=>(t===void 0?void 0:(0,m.toValue)(t))??r.value),a=(0,m.shallowRef)({});(0,m.watch)([()=>(0,m.toValue)(e),()=>i.value],([e,t])=>{a.value=k(e,t)},{immediate:!0,flush:`sync`});let o=new Map,s=e=>{let t=e.join(`.`);if(o.has(t))return o.get(t);let n=(0,m.computed)(()=>b(a.value,e)),r=new Proxy({},{get(t,r,i){if(typeof r==`symbol`||typeof r==`string`&&(r.startsWith(`__`)||r.startsWith(`$`)))return r===`__v_isRef`?!0:r===`then`?void 0:Reflect.get(t,r,i);if(r===`value`)return n.value??``;if(r===`c`||r===`asComponent`)return w(()=>n.value);if(r===`$raw`)return n;if(r===Symbol.toPrimitive)return()=>String(n.value??``);let o=e.concat(r),c=b(a.value,o);if(c===void 0||x(c)&&!S(c))return s(o);if(C(c))return T((0,m.computed)(()=>b(a.value,o)));let l=(0,m.computed)(()=>b(a.value,o));return new Proxy(l,{get(e,t,n){return t===`value`?e.value??``:t===`__v_isRef`?!0:Reflect.get(e,t,n)}})},ownKeys(){let t=b(a.value,e);return x(t)?Reflect.ownKeys(t):[]},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}}});return o.set(t,r),r};return s([])},j=({isCookieEnabled:e,onLocaleChange:t}={})=>{let{defaultLocale:n,locales:r}=u.default?.internationalization??{},i=(0,m.inject)(g);return{locale:(0,m.computed)(()=>i?.locale?.value??n),defaultLocale:n,availableLocales:r,setLocale:n=>{if(!r?.map(String).includes(n)){console.error(`Locale ${n} is not available`);return}i&&i.setLocale(n),a.setLocaleInStorage(n,e??i?.isCookieEnabled??!0),t?.(n)}}},M=()=>{let{locale:e}=j(),t=u.default?.routing?.rewrite;(0,m.watch)(e,e=>{if(typeof window>`u`||!t)return;let n=window.location.pathname,r=(0,h.getRewritePath)(n,e,t);r&&r!==n&&window.history.replaceState(window.history.state,``,r+window.location.search+window.location.hash)},{immediate:!0})},N=()=>{let t=(0,m.inject)(e.t)??e.n(),n=(0,m.inject)(g);return n&&(0,m.watch)(n.locale,e=>{t?.currentLocale.set(e)},{immediate:!0}),n},P=()=>{t.useEditorEnabled(),n.useFocusDictionary(),o.useIframeClickMerger(),N(),i.useDictionariesRecord()},F={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{children:t,...n})=>{let i=e=>c.renderIntlayerNode({...n,value:e,children:u.default?.editor.enabled?()=>(0,m.h)(r.t,{dictionaryKey:n.dictionaryKey,keyPath:n.keyPath},{default:()=>typeof e==`function`?e():e}):e}),a=i(t);if(typeof t!=`function`)return a;let o=(...e)=>i(t(...e));Object.setPrototypeOf(o,Object.getPrototypeOf(a));for(let e of Object.getOwnPropertyNames(a)){let t=Object.getOwnPropertyDescriptor(a,e);t&&Object.defineProperty(o,e,t)}for(let e of Object.getOwnPropertySymbols(a)){let t=Object.getOwnPropertyDescriptor(a,e);t&&Object.defineProperty(o,e,t)}return(0,m.markRaw)(o)}},I=(e,t)=>{let n=new Map,r={};for(let[e,i]of Object.entries(t))typeof i==`string`||typeof i==`number`?r[e]=i:(n.set(e,i),r[e]=`__VNODE_${e}__`);let i=(0,l.splitInsertionTemplate)(e,r);if(n.size>0){let e=[];if(i.isSimple){let t=i.parts,r=0;for(let[i]of n){let a=`__VNODE_${i}__`,o=t.indexOf(a);o!==-1&&(o>r&&e.push(t.substring(r,o)),e.push(n.get(i)),r=o+a.length)}return r<t.length&&e.push(t.substring(r)),(0,m.h)(m.Fragment,null,...e)}else return i.parts.forEach(t=>{if(typeof t==`string`){let r=t;for(let[t]of n){let i=`__VNODE_${t}__`,a=r.indexOf(i);a!==-1&&(a>0&&e.push(r.substring(0,a)),e.push(n.get(t)),r=r.substring(a+i.length))}r.length>0&&e.push(r)}else e.push(t)}),(0,m.h)(m.Fragment,null,...e)}return i.isSimple?i.parts:(0,m.h)(m.Fragment,null,i.parts)},L={id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.NodeType.Insertion,transform:(e,t,n)=>{let r=[...t.keyPath,{type:p.NodeType.Insertion}],i=e[p.NodeType.Insertion],a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,n,r)=>{let i=r(e,{...n,children:e,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]});return e=>{let a=I(i,e);return r(a,{...n,plugins:t.plugins,children:a})}}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}},R={id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:i,...a}=t,o=n((0,d.getMarkdownMetadata)(e),{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>c.renderIntlayerNode({...n,value:t,children:e})}],dictionaryKey:a.dictionaryKey,keyPath:[]}),l=n=>c.renderIntlayerNode({...t,value:e,children:()=>(0,m.h)(r.t,{dictionaryKey:a.dictionaryKey,keyPath:a.keyPath},{default:()=>{let{renderMarkdown:t,components:r}=s.useMarkdown();return t(e,void 0,{...r??{},...n??{}})}}),additionalProps:{metadata:o}}),u=l();return new Proxy(u,{get(t,n,r){return n===`value`?e:n===`metadata`?o:n===`use`?e=>l(e):Reflect.get(t,n,r)}})}},z={id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.NodeType.Markdown,transform:(e,t,n)=>{let r=[...t.keyPath,{type:p.NodeType.Markdown}],i=e[p.NodeType.Markdown];return n(i,{...t,children:i,keyPath:r,plugins:[R,...t.plugins??[]]})}},B=(()=>{let e={};for(let t of f.HTML_TAGS)e[t]=({children:e,...n})=>(0,m.h)(t,n,e);return e})(),V={id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===p.NodeType.HTML,transform:(e,t)=>{let n=e[p.NodeType.HTML];e.tags;let r=e=>(0,l.getHTML)(n,{...B,...e});return c.renderIntlayerNode({...t,value:n,children:e=>r(e)})}},H=(e,t=!0)=>[(0,l.translationPlugin)(e??u.default.internationalization.defaultLocale,t?u.default.internationalization.defaultLocale:void 0),l.enumerationPlugin,l.conditionPlugin,(0,l.nestedPlugin)(e??u.default.internationalization.defaultLocale),l.filePlugin,l.genderPlugin,F,L,z,V],U=(e,t)=>(0,l.getDictionary)(e,t,H(t));Object.defineProperty(exports,`C`,{enumerable:!0,get:function(){return g}}),Object.defineProperty(exports,`S`,{enumerable:!0,get:function(){return E}}),Object.defineProperty(exports,`T`,{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,`_`,{enumerable:!0,get:function(){return T}}),Object.defineProperty(exports,`a`,{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,`b`,{enumerable:!0,get:function(){return x}}),Object.defineProperty(exports,`c`,{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,`d`,{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,`f`,{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,`g`,{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,`h`,{enumerable:!0,get:function(){return D}}),Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,`l`,{enumerable:!0,get:function(){return N}}),Object.defineProperty(exports,`m`,{enumerable:!0,get:function(){return O}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return H}}),Object.defineProperty(exports,`o`,{enumerable:!0,get:function(){return z}}),Object.defineProperty(exports,`p`,{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return V}}),Object.defineProperty(exports,`s`,{enumerable:!0,get:function(){return R}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return U}}),Object.defineProperty(exports,`u`,{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,`v`,{enumerable:!0,get:function(){return S}}),Object.defineProperty(exports,`w`,{enumerable:!0,get:function(){return v}}),Object.defineProperty(exports,`x`,{enumerable:!0,get:function(){return w}}),Object.defineProperty(exports,`y`,{enumerable:!0,get:function(){return C}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));let c=require(`@intlayer/config/built`);c=s(c);let l=require(`@intlayer/editor`);var{editor:u}=c.default??{},d=()=>({allowedOrigins:[u?.applicationURL,u?.editorURL,u?.cmsURL].filter(Boolean),postMessageFn:(e,t)=>{typeof window>`u`||window.self!==window.top&&(window.parent?.postMessage(e,t),window.postMessage(e,t))}}),f=Symbol(`INTLAYER_EDITOR_STATE_MANAGER`),p=null,m=e=>{let t=new l.EditorStateManager({mode:`client`,messenger:d(),configuration:c.default});e.provide(f,t),p=t,(0,l.defineIntlayerElements)(),t.start()},h=()=>p;Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return f}});
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
import { NodeProps } from '@intlayer/core/interpreter';
|
|
2
2
|
import { HTMLAttributes } from 'vue';
|
|
3
|
-
/**
|
|
4
|
-
* Combine your NodeProps (which include dictionaryKey & keyPath)
|
|
5
|
-
* with any other div‐like attributes (omitting Vue's `children`).
|
|
6
|
-
*/
|
|
7
3
|
type Props = NodeProps & /* @vue-ignore */ Omit<HTMLAttributes, 'children'>;
|
|
8
4
|
declare function __VLS_template(): {
|
|
9
5
|
attrs: Partial<{}>;
|
|
@@ -1,27 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
* Interface defining a cross-frame communicator
|
|
4
|
-
*/
|
|
5
|
-
export type Communicator = {
|
|
6
|
-
postMessage: typeof window.postMessage;
|
|
7
|
-
allowedOrigins?: string[];
|
|
1
|
+
export declare const useCommunicator: () => {
|
|
2
|
+
postMessage: (data: any) => void;
|
|
8
3
|
senderId: string;
|
|
9
|
-
};
|
|
10
|
-
/**
|
|
11
|
-
* Configuration options for the communicator
|
|
12
|
-
*/
|
|
13
|
-
export type CommunicatorOptions = Omit<Communicator, 'senderId'>;
|
|
14
|
-
/**
|
|
15
|
-
* Creates a communicator client
|
|
16
|
-
* @param options - Options for configuring the communicator
|
|
17
|
-
*/
|
|
18
|
-
export declare const createCommunicator: (options?: CommunicatorOptions) => Communicator;
|
|
19
|
-
/**
|
|
20
|
-
* Helper to install the Intlayer communicator into the app
|
|
21
|
-
*/
|
|
22
|
-
export declare const installCommunicator: (app: App, options?: CommunicatorOptions) => void;
|
|
23
|
-
/**
|
|
24
|
-
* Hook to access the communicator
|
|
25
|
-
* @returns The communicator instance
|
|
26
|
-
*/
|
|
27
|
-
export declare const useCommunicator: () => Communicator;
|
|
4
|
+
} | null;
|
|
@@ -1,16 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
settingEnabled: Ref<boolean>;
|
|
4
|
-
wrapperEnabled: Ref<boolean>;
|
|
5
|
-
isInIframe: Ref<boolean>;
|
|
6
|
-
enabled: Ref<boolean>;
|
|
1
|
+
export declare const useEditorEnabled: () => {
|
|
2
|
+
enabled: import('vue').Ref<boolean, boolean>;
|
|
7
3
|
};
|
|
8
|
-
/**
|
|
9
|
-
* Creates an editor wrapperEnabled client
|
|
10
|
-
*/
|
|
11
|
-
export declare const createEditorEnabledClient: () => EditorEnabledStateProps;
|
|
12
|
-
/**
|
|
13
|
-
* Helper to install the editor wrapperEnabled state into the app
|
|
14
|
-
*/
|
|
15
|
-
export declare const installEditorEnabled: (app: App) => void;
|
|
16
|
-
export declare const useEditorEnabled: () => EditorEnabledStateProps;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { IntlayerProvider } from '../client';
|
|
2
|
-
export declare const useEditorLocale: () => IntlayerProvider;
|
|
2
|
+
export declare const useEditorLocale: () => IntlayerProvider | undefined;
|