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