solid-intlayer 8.3.0 → 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/chunk-C91j1N6u.js +1 -0
- package/dist/cjs/IntlayerNode.cjs +1 -1
- package/dist/cjs/UI/ContentSelector.cjs +1 -1
- package/dist/cjs/client/IntlayerProvider.cjs +1 -1
- package/dist/cjs/client/format/useIntl.cjs +1 -1
- package/dist/cjs/client/getBrowserLocale.cjs +1 -1
- package/dist/cjs/client/index.cjs +1 -1
- package/dist/cjs/client/t.cjs +1 -1
- package/dist/cjs/client/useContent.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/useLocaleBase.cjs +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/client/useTraduction.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/IntlayerEditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/CommunicatorContext.cjs +1 -1
- package/dist/cjs/editor/contexts/ConfigurationContext.cjs +1 -1
- package/dist/cjs/editor/contexts/DictionariesRecordContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditorEnabledContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/FocusDictionaryContext.cjs +1 -1
- package/dist/cjs/editor/contexts/index.cjs +1 -1
- package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +1 -1
- package/dist/cjs/editor/contexts/useCrossFrameState.cjs +1 -1
- package/dist/cjs/editor/contexts/useCrossURLPathState.cjs +1 -1
- package/dist/cjs/editor/contexts/useIframeClickInterceptor.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -1
- package/dist/cjs/getDictionary.cjs +1 -1
- package/dist/cjs/getIntlayer.cjs +1 -1
- package/dist/cjs/html/HTMLProvider.cjs +1 -1
- package/dist/cjs/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/html/index.cjs +1 -1
- package/dist/cjs/html/types.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/markdown/MarkdownProvider.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/runtime.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/solidElement/renderSolidElement.cjs +1 -1
- package/dist/esm/IntlayerNode.mjs +9 -17
- package/dist/esm/UI/ContentSelector.mjs +57 -56
- package/dist/esm/client/IntlayerProvider.mjs +56 -66
- package/dist/esm/client/format/useIntl.mjs +8 -11
- package/dist/esm/client/getBrowserLocale.mjs +79 -95
- package/dist/esm/client/index.mjs +11 -36
- package/dist/esm/client/t.mjs +9 -9
- package/dist/esm/client/useContent.mjs +12 -12
- package/dist/esm/client/useDictionary.mjs +2 -13
- package/dist/esm/client/useDictionaryAsync.mjs +2 -11
- package/dist/esm/client/useDictionaryDynamic.mjs +2 -15
- package/dist/esm/client/useIntlayer.mjs +2 -13
- package/dist/esm/client/useLoadDynamic.mjs +15 -21
- package/dist/esm/client/useLocale.mjs +23 -36
- package/dist/esm/client/useLocaleBase.mjs +14 -18
- package/dist/esm/client/useLocaleStorage.mjs +18 -25
- package/dist/esm/client/useRewriteURL.mjs +14 -18
- package/dist/esm/client/useTraduction.mjs +9 -12
- package/dist/esm/editor/ContentSelectorWrapper.mjs +2 -24
- package/dist/esm/editor/IntlayerEditorProvider.mjs +36 -58
- package/dist/esm/editor/contexts/CommunicatorContext.mjs +29 -28
- package/dist/esm/editor/contexts/ConfigurationContext.mjs +18 -20
- package/dist/esm/editor/contexts/DictionariesRecordContext.mjs +39 -44
- package/dist/esm/editor/contexts/EditedContentContext.mjs +135 -154
- package/dist/esm/editor/contexts/EditorEnabledContext.mjs +19 -27
- package/dist/esm/editor/contexts/EditorProvider.mjs +68 -80
- package/dist/esm/editor/contexts/FocusDictionaryContext.mjs +41 -47
- package/dist/esm/editor/contexts/index.mjs +11 -38
- package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +30 -34
- package/dist/esm/editor/contexts/useCrossFrameState.mjs +44 -56
- package/dist/esm/editor/contexts/useCrossURLPathState.mjs +23 -24
- package/dist/esm/editor/contexts/useIframeClickInterceptor.mjs +17 -18
- package/dist/esm/editor/index.mjs +2 -4
- package/dist/esm/editor/useEditedContentRenderer.mjs +15 -28
- package/dist/esm/getDictionary.mjs +2 -16
- package/dist/esm/getIntlayer.mjs +2 -16
- package/dist/esm/html/HTMLProvider.mjs +12 -15
- package/dist/esm/html/HTMLRenderer.mjs +28 -51
- package/dist/esm/html/index.mjs +3 -10
- package/dist/esm/html/types.mjs +0 -1
- package/dist/esm/index.mjs +17 -54
- package/dist/esm/markdown/MarkdownProvider.mjs +33 -41
- package/dist/esm/markdown/MarkdownRenderer.mjs +36 -41
- package/dist/esm/markdown/compiler.mjs +6 -8
- package/dist/esm/markdown/index.mjs +5 -17
- package/dist/esm/markdown/runtime.mjs +21 -40
- package/dist/esm/plugins.mjs +2 -20
- package/dist/esm/solidElement/renderSolidElement.mjs +32 -29
- package/dist/getDictionary-DKdSGWHu.mjs +188 -0
- package/dist/getDictionary-DxYuk0_0.js +1 -0
- package/dist/types/IntlayerNode.d.ts +1 -2
- package/dist/types/client/useDictionary.d.ts +1 -1
- package/dist/types/getDictionary.d.ts +1 -2
- package/dist/types/getIntlayer.d.ts +1 -2
- package/dist/types/plugins.d.ts +15 -10
- package/package.json +11 -11
- package/dist/plugins-FXnYVZH5.mjs +0 -229
- package/dist/plugins-lDhO98Wy.js +0 -1
|
@@ -1,155 +1,136 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
get children() {
|
|
135
|
-
return u.children;
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
});
|
|
140
|
-
}, Y = () => p(A), K = () => {
|
|
141
|
-
const u = Y(), a = p(x);
|
|
142
|
-
if (!a)
|
|
143
|
-
throw new Error("useEditedContent must be used within a EditedContentProvider");
|
|
144
|
-
return {
|
|
145
|
-
...a,
|
|
146
|
-
...u
|
|
147
|
-
};
|
|
148
|
-
};
|
|
149
|
-
export {
|
|
150
|
-
Z as EditedContentProvider,
|
|
151
|
-
K as useEditedContent,
|
|
152
|
-
Y as useEditedContentActions,
|
|
153
|
-
X as useGetEditedContentState,
|
|
154
|
-
U as usePostEditedContentState
|
|
1
|
+
import { useCrossFrameMessageListener as e } from "./useCrossFrameMessageListener.mjs";
|
|
2
|
+
import { useCrossFrameState as t } from "./useCrossFrameState.mjs";
|
|
3
|
+
import { useDictionariesRecord as n } from "./DictionariesRecordContext.mjs";
|
|
4
|
+
import { createComponent as r } from "solid-js/web";
|
|
5
|
+
import { NodeType as i } from "@intlayer/types/nodeType";
|
|
6
|
+
import { createContext as a, useContext as o } from "solid-js";
|
|
7
|
+
import { MessageKey as s } from "@intlayer/editor";
|
|
8
|
+
import { editDictionaryByKeyPath as c, getContentNodeByKeyPath as l, renameContentNodeByKeyPath as u } from "@intlayer/core/dictionaryManipulator";
|
|
9
|
+
//#region src/editor/contexts/EditedContentContext.tsx
|
|
10
|
+
var d = a(void 0), f = (t) => e(`${s.INTLAYER_EDITED_CONTENT_CHANGED}/post`, t), p = (t) => e(`${s.INTLAYER_EDITED_CONTENT_CHANGED}/get`, t), m = a(void 0), h = (e) => {
|
|
11
|
+
let { localeDictionaries: a } = n(), [o, f] = t(s.INTLAYER_EDITED_CONTENT_CHANGED), p = (e) => {
|
|
12
|
+
if (typeof e == "function") f((t) => {
|
|
13
|
+
let n = t?.[Object.keys(t || {})[0]], r = e(n);
|
|
14
|
+
return {
|
|
15
|
+
...t,
|
|
16
|
+
[r.key]: r
|
|
17
|
+
};
|
|
18
|
+
});
|
|
19
|
+
else {
|
|
20
|
+
let t = e;
|
|
21
|
+
f((e) => ({
|
|
22
|
+
...e,
|
|
23
|
+
[t.key]: t
|
|
24
|
+
}));
|
|
25
|
+
}
|
|
26
|
+
}, h = (e, t) => {
|
|
27
|
+
f((n) => ({
|
|
28
|
+
...n,
|
|
29
|
+
[e]: {
|
|
30
|
+
...n?.[e],
|
|
31
|
+
content: t
|
|
32
|
+
}
|
|
33
|
+
}));
|
|
34
|
+
}, g = (e, t, n = [], r = !0) => {
|
|
35
|
+
f((i) => {
|
|
36
|
+
let o = a[e]?.content, s = structuredClone(i?.[e]?.content ?? o), u = n;
|
|
37
|
+
if (!r) {
|
|
38
|
+
let e = 0, t = n.slice(0, -1), r = n[n.length - 1], i = r.key;
|
|
39
|
+
for (; l(s, u) !== void 0;) e++, i = e === 0 ? r.key : `${r.key} (${e})`, u = [...t, {
|
|
40
|
+
...r,
|
|
41
|
+
key: i
|
|
42
|
+
}];
|
|
43
|
+
}
|
|
44
|
+
let d = c(s, u, t);
|
|
45
|
+
return {
|
|
46
|
+
...i,
|
|
47
|
+
[e]: {
|
|
48
|
+
...i?.[e],
|
|
49
|
+
content: d
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}, _ = (e, t, n = []) => {
|
|
54
|
+
f((r) => {
|
|
55
|
+
let i = a[e]?.content, o = u(structuredClone(r?.[e]?.content ?? i), t, n);
|
|
56
|
+
return {
|
|
57
|
+
...r,
|
|
58
|
+
[e]: {
|
|
59
|
+
...r?.[e],
|
|
60
|
+
content: o
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
});
|
|
64
|
+
}, v = (e, t) => {
|
|
65
|
+
f((n) => {
|
|
66
|
+
let r = a[e]?.content, o = structuredClone(n?.[e]?.content ?? r), s = structuredClone(o), c = t.slice(0, -1), u = t[t.length - 1]?.key;
|
|
67
|
+
if (u) {
|
|
68
|
+
let e = l(s, c.filter((e) => e.type !== i.Translation));
|
|
69
|
+
e && typeof e == "object" && u in e && delete e[u];
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
...n,
|
|
73
|
+
[e]: {
|
|
74
|
+
...n?.[e],
|
|
75
|
+
content: s
|
|
76
|
+
}
|
|
77
|
+
};
|
|
78
|
+
});
|
|
79
|
+
}, y = (e) => {
|
|
80
|
+
f((t) => {
|
|
81
|
+
let n = { ...t };
|
|
82
|
+
return delete n[e], n;
|
|
83
|
+
});
|
|
84
|
+
}, b = (e) => {
|
|
85
|
+
f((t) => ({
|
|
86
|
+
...t,
|
|
87
|
+
[e]: {
|
|
88
|
+
...t?.[e],
|
|
89
|
+
content: {}
|
|
90
|
+
}
|
|
91
|
+
}));
|
|
92
|
+
}, x = () => {
|
|
93
|
+
f({});
|
|
94
|
+
}, S = (e, t) => {
|
|
95
|
+
let n = o();
|
|
96
|
+
if (!n) return;
|
|
97
|
+
let r = t.filter((e) => e.type !== i.Translation);
|
|
98
|
+
if (e.includes(":local:") || e.includes(":remote:")) return l(n?.[e]?.content ?? {}, r);
|
|
99
|
+
let a = Object.keys(n).filter((t) => t.startsWith(`${e}:`));
|
|
100
|
+
for (let e of a) {
|
|
101
|
+
let t = l(n?.[e]?.content ?? {}, r);
|
|
102
|
+
if (t) return t;
|
|
103
|
+
}
|
|
104
|
+
}, C = { editedContent: o() }, w = {
|
|
105
|
+
setEditedContentState: f,
|
|
106
|
+
setEditedDictionary: p,
|
|
107
|
+
setEditedContent: h,
|
|
108
|
+
addEditedContent: g,
|
|
109
|
+
renameEditedContent: _,
|
|
110
|
+
removeEditedContent: v,
|
|
111
|
+
restoreEditedContent: y,
|
|
112
|
+
clearEditedDictionaryContent: b,
|
|
113
|
+
clearEditedContent: x,
|
|
114
|
+
getEditedContentValue: S
|
|
115
|
+
};
|
|
116
|
+
return r(d.Provider, {
|
|
117
|
+
value: C,
|
|
118
|
+
get children() {
|
|
119
|
+
return r(m.Provider, {
|
|
120
|
+
value: w,
|
|
121
|
+
get children() {
|
|
122
|
+
return e.children;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}, g = () => o(m), _ = () => {
|
|
128
|
+
let e = g(), t = o(d);
|
|
129
|
+
if (!t) throw Error("useEditedContent must be used within a EditedContentProvider");
|
|
130
|
+
return {
|
|
131
|
+
...t,
|
|
132
|
+
...e
|
|
133
|
+
};
|
|
155
134
|
};
|
|
135
|
+
//#endregion
|
|
136
|
+
export { h as EditedContentProvider, _ as useEditedContent, g as useEditedContentActions, p as useGetEditedContentState, f as usePostEditedContentState };
|
|
@@ -1,28 +1,20 @@
|
|
|
1
|
+
import { useCrossFrameMessageListener as e } from "./useCrossFrameMessageListener.mjs";
|
|
2
|
+
import { useCrossFrameState as t } from "./useCrossFrameState.mjs";
|
|
1
3
|
import { createComponent as n } from "solid-js/web";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
}, A = () => a(o);
|
|
22
|
-
export {
|
|
23
|
-
L as EditorEnabledProvider,
|
|
24
|
-
A as useEditorEnabled,
|
|
25
|
-
i as useEditorEnabledState,
|
|
26
|
-
p as useGetEditorEnabledState,
|
|
27
|
-
f as usePostEditorEnabledState
|
|
28
|
-
};
|
|
4
|
+
import { createContext as r, useContext as i } from "solid-js";
|
|
5
|
+
import { MessageKey as a } from "@intlayer/editor";
|
|
6
|
+
//#region src/editor/contexts/EditorEnabledContext.tsx
|
|
7
|
+
var o = r({ enabled: () => !1 }), s = (e) => t(a.INTLAYER_EDITOR_ENABLED, !1, e), c = (t) => e(`${a.INTLAYER_EDITOR_ENABLED}/post`, t), l = (t) => e(`${a.INTLAYER_EDITOR_ENABLED}/get`, t), u = (e) => {
|
|
8
|
+
let [t] = s({
|
|
9
|
+
emit: !1,
|
|
10
|
+
receive: !0
|
|
11
|
+
});
|
|
12
|
+
return n(o.Provider, {
|
|
13
|
+
value: { enabled: t },
|
|
14
|
+
get children() {
|
|
15
|
+
return e.children;
|
|
16
|
+
}
|
|
17
|
+
});
|
|
18
|
+
}, d = () => i(o);
|
|
19
|
+
//#endregion
|
|
20
|
+
export { u as EditorEnabledProvider, d as useEditorEnabled, s as useEditorEnabledState, l as useGetEditorEnabledState, c as usePostEditorEnabledState };
|
|
@@ -1,80 +1,68 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
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
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
});
|
|
70
|
-
}
|
|
71
|
-
});
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
export {
|
|
79
|
-
G as EditorProvider
|
|
80
|
-
};
|
|
1
|
+
import { CommunicatorProvider as e } from "./CommunicatorContext.mjs";
|
|
2
|
+
import { ConfigurationProvider as t } from "./ConfigurationContext.mjs";
|
|
3
|
+
import { DictionariesRecordProvider as n } from "./DictionariesRecordContext.mjs";
|
|
4
|
+
import { EditedContentProvider as r, useGetEditedContentState as i } from "./EditedContentContext.mjs";
|
|
5
|
+
import { EditorEnabledProvider as a, useEditorEnabled as o, useGetEditorEnabledState as s } from "./EditorEnabledContext.mjs";
|
|
6
|
+
import { FocusDictionaryProvider as c } from "./FocusDictionaryContext.mjs";
|
|
7
|
+
import { createComponent as l, memo as u } from "solid-js/web";
|
|
8
|
+
import { createEffect as d, createSignal as f } from "solid-js";
|
|
9
|
+
//#region src/editor/contexts/EditorProvider.tsx
|
|
10
|
+
var p = (e) => {
|
|
11
|
+
let t = i();
|
|
12
|
+
return d(() => {
|
|
13
|
+
t();
|
|
14
|
+
}), l(n, { get children() {
|
|
15
|
+
return l(r, { get children() {
|
|
16
|
+
return l(c, { get children() {
|
|
17
|
+
return e.children;
|
|
18
|
+
} });
|
|
19
|
+
} });
|
|
20
|
+
} });
|
|
21
|
+
}, m = (e) => {
|
|
22
|
+
let t = s(), { enabled: n } = o();
|
|
23
|
+
return d(() => {
|
|
24
|
+
n() || t();
|
|
25
|
+
}), u(() => u(() => !!n())() ? e.children : e.fallback);
|
|
26
|
+
}, h = (e) => {
|
|
27
|
+
let [t, n] = f(!1);
|
|
28
|
+
return d(() => {
|
|
29
|
+
n(window.self !== window.top);
|
|
30
|
+
}), u(() => u(() => !!t())() ? e.children : e.fallback);
|
|
31
|
+
}, g = (n) => l(a, { get children() {
|
|
32
|
+
return l(t, {
|
|
33
|
+
get configuration() {
|
|
34
|
+
return n.configuration;
|
|
35
|
+
},
|
|
36
|
+
get children() {
|
|
37
|
+
return l(h, {
|
|
38
|
+
get fallback() {
|
|
39
|
+
return n.children;
|
|
40
|
+
},
|
|
41
|
+
get children() {
|
|
42
|
+
return l(e, {
|
|
43
|
+
get postMessage() {
|
|
44
|
+
return n.postMessage;
|
|
45
|
+
},
|
|
46
|
+
get allowedOrigins() {
|
|
47
|
+
return n.allowedOrigins;
|
|
48
|
+
},
|
|
49
|
+
get children() {
|
|
50
|
+
return l(m, {
|
|
51
|
+
get fallback() {
|
|
52
|
+
return n.children;
|
|
53
|
+
},
|
|
54
|
+
get children() {
|
|
55
|
+
return l(p, { get children() {
|
|
56
|
+
return n.children;
|
|
57
|
+
} });
|
|
58
|
+
}
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
} });
|
|
67
|
+
//#endregion
|
|
68
|
+
export { g as EditorProvider };
|
|
@@ -1,48 +1,42 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import { createContext as
|
|
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
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
...o,
|
|
41
|
-
...t
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export {
|
|
45
|
-
h as FocusDictionaryProvider,
|
|
46
|
-
x as useFocusDictionary,
|
|
47
|
-
m as useFocusDictionaryActions
|
|
1
|
+
import { useCrossFrameState as e } from "./useCrossFrameState.mjs";
|
|
2
|
+
import { createComponent as t } from "solid-js/web";
|
|
3
|
+
import { createContext as n, useContext as r } from "solid-js";
|
|
4
|
+
import { MessageKey as i } from "@intlayer/editor";
|
|
5
|
+
//#region src/editor/contexts/FocusDictionaryContext.tsx
|
|
6
|
+
var a = n(void 0), o = n(void 0), s = (n) => {
|
|
7
|
+
let [r, s] = e(i.INTLAYER_FOCUSED_CONTENT_CHANGED, null), c = (e) => {
|
|
8
|
+
s((t) => t && {
|
|
9
|
+
...t,
|
|
10
|
+
keyPath: e
|
|
11
|
+
});
|
|
12
|
+
};
|
|
13
|
+
return t(a.Provider, {
|
|
14
|
+
get value() {
|
|
15
|
+
return { focusedContent: r() };
|
|
16
|
+
},
|
|
17
|
+
get children() {
|
|
18
|
+
return t(o.Provider, {
|
|
19
|
+
value: {
|
|
20
|
+
setFocusedContent: s,
|
|
21
|
+
setFocusedContentKeyPath: c
|
|
22
|
+
},
|
|
23
|
+
get children() {
|
|
24
|
+
return n.children;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
}, c = () => {
|
|
30
|
+
let e = r(o);
|
|
31
|
+
if (e === void 0) throw Error("useFocusDictionaryActions must be used within a FocusDictionaryProvider");
|
|
32
|
+
return e;
|
|
33
|
+
}, l = () => {
|
|
34
|
+
let e = c(), t = r(a);
|
|
35
|
+
if (t === void 0) throw Error("useFocusDictionaryState must be used within a FocusDictionaryProvider");
|
|
36
|
+
return {
|
|
37
|
+
...t,
|
|
38
|
+
...e
|
|
39
|
+
};
|
|
48
40
|
};
|
|
41
|
+
//#endregion
|
|
42
|
+
export { s as FocusDictionaryProvider, l as useFocusDictionary, c as useFocusDictionaryActions };
|
|
@@ -1,39 +1,12 @@
|
|
|
1
|
+
import { useCrossFrameMessageListener as e } from "./useCrossFrameMessageListener.mjs";
|
|
2
|
+
import { useCrossFrameState as t } from "./useCrossFrameState.mjs";
|
|
3
|
+
import { ConfigurationProvider as n, useConfiguration as r, useConfigurationState as i } from "./ConfigurationContext.mjs";
|
|
4
|
+
import { DictionariesRecordProvider as a, useDictionariesRecord as o, useDictionariesRecordActions as s } from "./DictionariesRecordContext.mjs";
|
|
5
|
+
import { EditedContentProvider as c, useEditedContent as l, useEditedContentActions as u, useGetEditedContentState as d, usePostEditedContentState as f } from "./EditedContentContext.mjs";
|
|
6
|
+
import { EditorEnabledProvider as p, useEditorEnabled as m, useEditorEnabledState as h, useGetEditorEnabledState as g, usePostEditorEnabledState as _ } from "./EditorEnabledContext.mjs";
|
|
7
|
+
import { FocusDictionaryProvider as v, useFocusDictionary as y, useFocusDictionaryActions as b } from "./FocusDictionaryContext.mjs";
|
|
8
|
+
import { EditorProvider as x } from "./EditorProvider.mjs";
|
|
9
|
+
import { useCrossURLPathSetter as S, useCrossURLPathState as C } from "./useCrossURLPathState.mjs";
|
|
10
|
+
import { useIframeClickInterceptor as w, useIframeClickMerger as T } from "./useIframeClickInterceptor.mjs";
|
|
1
11
|
export * from "@intlayer/editor";
|
|
2
|
-
|
|
3
|
-
import { DictionariesRecordProvider as d, useDictionariesRecord as a, useDictionariesRecordActions as u } from "./DictionariesRecordContext.mjs";
|
|
4
|
-
import { EditedContentProvider as f, useEditedContent as E, useEditedContentActions as m, useGetEditedContentState as C, usePostEditedContentState as p } from "./EditedContentContext.mjs";
|
|
5
|
-
import { EditorEnabledProvider as P, useEditorEnabled as S, useEditorEnabledState as l, useGetEditorEnabledState as v, usePostEditorEnabledState as D } from "./EditorEnabledContext.mjs";
|
|
6
|
-
import { EditorProvider as g } from "./EditorProvider.mjs";
|
|
7
|
-
import { FocusDictionaryProvider as R, useFocusDictionary as y, useFocusDictionaryActions as A } from "./FocusDictionaryContext.mjs";
|
|
8
|
-
import { useCrossFrameMessageListener as L } from "./useCrossFrameMessageListener.mjs";
|
|
9
|
-
import { useCrossFrameState as k } from "./useCrossFrameState.mjs";
|
|
10
|
-
import { useCrossURLPathSetter as M, useCrossURLPathState as U } from "./useCrossURLPathState.mjs";
|
|
11
|
-
import { useIframeClickInterceptor as q, useIframeClickMerger as w } from "./useIframeClickInterceptor.mjs";
|
|
12
|
-
export {
|
|
13
|
-
r as ConfigurationProvider,
|
|
14
|
-
d as DictionariesRecordProvider,
|
|
15
|
-
f as EditedContentProvider,
|
|
16
|
-
P as EditorEnabledProvider,
|
|
17
|
-
g as EditorProvider,
|
|
18
|
-
R as FocusDictionaryProvider,
|
|
19
|
-
i as useConfiguration,
|
|
20
|
-
s as useConfigurationState,
|
|
21
|
-
L as useCrossFrameMessageListener,
|
|
22
|
-
k as useCrossFrameState,
|
|
23
|
-
M as useCrossURLPathSetter,
|
|
24
|
-
U as useCrossURLPathState,
|
|
25
|
-
a as useDictionariesRecord,
|
|
26
|
-
u as useDictionariesRecordActions,
|
|
27
|
-
E as useEditedContent,
|
|
28
|
-
m as useEditedContentActions,
|
|
29
|
-
S as useEditorEnabled,
|
|
30
|
-
l as useEditorEnabledState,
|
|
31
|
-
y as useFocusDictionary,
|
|
32
|
-
A as useFocusDictionaryActions,
|
|
33
|
-
C as useGetEditedContentState,
|
|
34
|
-
v as useGetEditorEnabledState,
|
|
35
|
-
q as useIframeClickInterceptor,
|
|
36
|
-
w as useIframeClickMerger,
|
|
37
|
-
p as usePostEditedContentState,
|
|
38
|
-
D as usePostEditorEnabledState
|
|
39
|
-
};
|
|
12
|
+
export { n as ConfigurationProvider, a as DictionariesRecordProvider, c as EditedContentProvider, p as EditorEnabledProvider, x as EditorProvider, v as FocusDictionaryProvider, r as useConfiguration, i as useConfigurationState, e as useCrossFrameMessageListener, t as useCrossFrameState, S as useCrossURLPathSetter, C as useCrossURLPathState, o as useDictionariesRecord, s as useDictionariesRecordActions, l as useEditedContent, u as useEditedContentActions, m as useEditorEnabled, h as useEditorEnabledState, y as useFocusDictionary, b as useFocusDictionaryActions, d as useGetEditedContentState, g as useGetEditorEnabledState, w as useIframeClickInterceptor, T as useIframeClickMerger, f as usePostEditedContentState, _ as usePostEditorEnabledState };
|