solid-intlayer 5.7.7 → 5.8.0-canary.0

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 (40) hide show
  1. package/README.md +1 -1
  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/getBrowserLocale.cjs +1 -1
  6. package/dist/cjs/client/useDictionary.cjs +1 -1
  7. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  8. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  9. package/dist/cjs/client/useIntlayer.cjs +1 -1
  10. package/dist/cjs/client/useLocale.cjs +1 -1
  11. package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
  12. package/dist/cjs/editor/IntlayerEditorProvider.cjs +1 -1
  13. package/dist/cjs/editor/contexts/CommunicatorContext.cjs +1 -1
  14. package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -1
  15. package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -1
  16. package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +1 -1
  17. package/dist/cjs/plugins.cjs +1 -1
  18. package/dist/cjs/solidElement/renderSolidElement.cjs +1 -1
  19. package/dist/esm/IntlayerNode.mjs +9 -9
  20. package/dist/esm/UI/ContentSelector.mjs +30 -32
  21. package/dist/esm/client/IntlayerProvider.mjs +38 -42
  22. package/dist/esm/client/getBrowserLocale.mjs +41 -42
  23. package/dist/esm/client/useDictionary.mjs +9 -10
  24. package/dist/esm/client/useDictionaryAsync.mjs +8 -9
  25. package/dist/esm/client/useDictionaryDynamic.mjs +11 -12
  26. package/dist/esm/client/useIntlayer.mjs +8 -8
  27. package/dist/esm/client/useLocale.mjs +18 -19
  28. package/dist/esm/editor/ContentSelectorWrapper.mjs +22 -25
  29. package/dist/esm/editor/IntlayerEditorProvider.mjs +19 -20
  30. package/dist/esm/editor/contexts/CommunicatorContext.mjs +16 -16
  31. package/dist/esm/editor/contexts/EditedContentContext.mjs +81 -85
  32. package/dist/esm/editor/contexts/EditorProvider.mjs +7 -7
  33. package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +16 -16
  34. package/dist/esm/plugins.mjs +9 -9
  35. package/dist/esm/solidElement/renderSolidElement.mjs +13 -14
  36. package/dist/web-Ch-xTpJg.js +1 -0
  37. package/dist/web-mv0y5CK4.mjs +567 -0
  38. package/package.json +14 -14
  39. package/dist/web-BFg6-54-.mjs +0 -443
  40. package/dist/web-qH6jV2Kc.js +0 -1
@@ -1,16 +1,15 @@
1
- import l from "@intlayer/config/built";
2
- import { useContext as m } from "solid-js";
3
- import { IntlayerClientContext as s } from "./IntlayerProvider.mjs";
4
- import { useDictionary as u } from "./useDictionary.mjs";
5
- import { useLoadDynamic as f } from "./useLoadDynamic.mjs";
6
- const g = (n, r, i) => {
7
- var t;
8
- const { locale: e } = m(s), a = (t = l) == null ? void 0 : t.internationalization.defaultLocale, o = i ?? e() ?? a, c = f(
9
- `${String(r)}.${o}`,
10
- n[o]()
1
+ import c from "@intlayer/config/built";
2
+ import { useContext as l } from "solid-js";
3
+ import { IntlayerClientContext as m } from "./IntlayerProvider.mjs";
4
+ import { useDictionary as s } from "./useDictionary.mjs";
5
+ import { useLoadDynamic as u } from "./useLoadDynamic.mjs";
6
+ const L = (t, n, r) => {
7
+ const { locale: i } = l(m), e = c?.internationalization.defaultLocale, o = r ?? i() ?? e, a = u(
8
+ `${String(n)}.${o}`,
9
+ t[o]()
11
10
  );
12
- return u(c, o);
11
+ return s(a, o);
13
12
  };
14
13
  export {
15
- g as useDictionaryDynamic
14
+ L as useDictionaryDynamic
16
15
  };
@@ -1,11 +1,11 @@
1
- import { useContext as n, createMemo as l } from "solid-js";
2
- import { getIntlayer as a } from "../getIntlayer.mjs";
3
- import { IntlayerClientContext as c } from "./IntlayerProvider.mjs";
4
- const p = (t, r) => {
5
- const e = n(c);
6
- return l(() => {
7
- const o = e == null ? void 0 : e.locale();
8
- return a(t, r ?? o);
1
+ import { useContext as n, createMemo as c } from "solid-js";
2
+ import { getIntlayer as l } from "../getIntlayer.mjs";
3
+ import { IntlayerClientContext as a } from "./IntlayerProvider.mjs";
4
+ const p = (t, e) => {
5
+ const o = n(a);
6
+ return c(() => {
7
+ const r = o?.locale();
8
+ return l(t, e ?? r);
9
9
  });
10
10
  };
11
11
  export {
@@ -1,32 +1,31 @@
1
- import l from "@intlayer/config/built";
2
- import { useContext as m, createEffect as u } from "solid-js";
3
- import { IntlayerClientContext as n } from "./IntlayerProvider.mjs";
4
- import { useLocaleCookie as p } from "./useLocaleCookie.mjs";
5
- const z = ({ onLocaleChange: o } = {}) => {
6
- var e;
7
- const { defaultLocale: s, locales: i } = ((e = l) == null ? void 0 : e.internationalization) ?? {}, r = m(n), { setLocaleCookie: f } = p(), c = (t) => {
8
- if (!(i != null && i.map(String).includes(t))) {
9
- console.error(`Locale ${t} is not available`);
1
+ import n from "@intlayer/config/built";
2
+ import { useContext as l, createEffect as s } from "solid-js";
3
+ import { IntlayerClientContext as f } from "./IntlayerProvider.mjs";
4
+ import { useLocaleCookie as m } from "./useLocaleCookie.mjs";
5
+ const C = ({ onLocaleChange: e } = {}) => {
6
+ const { defaultLocale: c, locales: r } = n?.internationalization ?? {}, t = l(f), { setLocaleCookie: a } = m(), i = (o) => {
7
+ if (!r?.map(String).includes(o)) {
8
+ console.error(`Locale ${o} is not available`);
10
9
  return;
11
10
  }
12
- r == null || r.setLocale(t), f(t), o == null || o(t);
11
+ t?.setLocale(o), a(o), e?.(o);
13
12
  };
14
- return u(() => {
15
- if (o && (r != null && r.locale)) {
16
- const t = r.locale();
17
- o(t);
13
+ return s(() => {
14
+ if (e && t?.locale) {
15
+ const o = t.locale();
16
+ e(o);
18
17
  }
19
18
  }), {
20
- locale: r == null ? void 0 : r.locale,
19
+ locale: t?.locale,
21
20
  // Current locale (signal accessor)
22
- defaultLocale: s,
21
+ defaultLocale: c,
23
22
  // Principal locale defined in config
24
- availableLocales: i,
23
+ availableLocales: r,
25
24
  // List of the available locales defined in config
26
- setLocale: c
25
+ setLocale: i
27
26
  // Function to set the locale
28
27
  };
29
28
  };
30
29
  export {
31
- z as useLocale
30
+ C as useLocale
32
31
  };
@@ -1,51 +1,48 @@
1
1
  import { isSameKeyPath as c } from "@intlayer/core";
2
- import { createComponent as o, mergeProps as a, createMemo as l } from "solid-js";
2
+ import { createComponent as o, mergeProps as m, createMemo as a } from "solid-js";
3
3
  import "@intlayer/config/built";
4
4
  import "@intlayer/config/client";
5
- import { useIntlayerContext as y } from "../client/IntlayerProvider.mjs";
5
+ import { useIntlayerContext as d } from "../client/IntlayerProvider.mjs";
6
6
  import "@intlayer/editor";
7
7
  import "./contexts/ConfigurationContext.mjs";
8
8
  import "./contexts/DictionariesRecordContext.mjs";
9
9
  import "./contexts/EditedContentContext.mjs";
10
- import { useEditorEnabled as d } from "./contexts/EditorEnabledContext.mjs";
10
+ import { useEditorEnabled as l } from "./contexts/EditorEnabledContext.mjs";
11
11
  import "./contexts/CommunicatorContext.mjs";
12
- import { useFocusDictionary as h } from "./contexts/FocusDictionaryContext.mjs";
12
+ import { useFocusDictionary as s } from "./contexts/FocusDictionaryContext.mjs";
13
13
  import "../markdown/MarkdownProvider.mjs";
14
14
  import "../client/useLocaleCookie.mjs";
15
15
  import "../client/useLocaleBase.mjs";
16
- import { ContentSelector as s } from "../UI/ContentSelector.mjs";
17
- const p = (t) => {
16
+ import { ContentSelector as y } from "../UI/ContentSelector.mjs";
17
+ const h = (e) => {
18
18
  const {
19
- focusedContent: e,
19
+ focusedContent: t,
20
20
  setFocusedContent: r
21
- } = h(), n = () => r({
22
- dictionaryKey: t.dictionaryKey,
23
- keyPath: t.keyPath
24
- }), m = l(() => {
25
- var i;
26
- return ((e == null ? void 0 : e.dictionaryKey) === t.dictionaryKey && (((i = e == null ? void 0 : e.keyPath) == null ? void 0 : i.length) ?? 0) > 0 && c((e == null ? void 0 : e.keyPath) ?? [], t.keyPath)) ?? !1;
27
- });
28
- return o(s, {
21
+ } = s(), n = () => r({
22
+ dictionaryKey: e.dictionaryKey,
23
+ keyPath: e.keyPath
24
+ }), i = a(() => (t?.dictionaryKey === e.dictionaryKey && (t?.keyPath?.length ?? 0) > 0 && c(t?.keyPath ?? [], e.keyPath)) ?? !1);
25
+ return o(y, {
29
26
  onPress: n,
30
27
  get isSelecting() {
31
- return m();
28
+ return i();
32
29
  },
33
30
  get children() {
34
- return t.children;
31
+ return e.children;
35
32
  }
36
33
  });
37
- }, W = (t) => {
34
+ }, R = (e) => {
38
35
  const {
39
- enabled: e
40
- } = d(), {
36
+ enabled: t
37
+ } = l(), {
41
38
  disableEditor: r
42
- } = y();
43
- return e() && !r ? o(p, a(t, {
39
+ } = d();
40
+ return t() && !r ? o(h, m(e, {
44
41
  get children() {
45
- return t.children;
42
+ return e.children;
46
43
  }
47
- })) : t.children;
44
+ })) : e.children;
48
45
  };
49
46
  export {
50
- W as ContentSelectorRenderer
47
+ R as ContentSelectorRenderer
51
48
  };
@@ -1,51 +1,50 @@
1
- import { m } from "../../web-BFg6-54-.mjs";
2
- import s from "@intlayer/config/built";
1
+ import { m as n } from "../../web-mv0y5CK4.mjs";
2
+ import i from "@intlayer/config/built";
3
3
  import "@intlayer/editor";
4
4
  import "./contexts/ConfigurationContext.mjs";
5
5
  import "./contexts/DictionariesRecordContext.mjs";
6
6
  import "./contexts/EditedContentContext.mjs";
7
- import { useEditorEnabled as p } from "./contexts/EditorEnabledContext.mjs";
8
- import { EditorProvider as a } from "./contexts/EditorProvider.mjs";
7
+ import { useEditorEnabled as s } from "./contexts/EditorEnabledContext.mjs";
8
+ import { EditorProvider as m } from "./contexts/EditorProvider.mjs";
9
9
  import "./contexts/FocusDictionaryContext.mjs";
10
10
  import { createComponent as e } from "solid-js";
11
11
  import "./contexts/CommunicatorContext.mjs";
12
- import { useCrossURLPathSetter as f } from "./contexts/useCrossURLPathState.mjs";
13
- import { useIframeClickInterceptor as c } from "./contexts/useIframeClickInterceptor.mjs";
14
- const l = () => (f(), c(), []), {
12
+ import { useCrossURLPathSetter as p } from "./contexts/useCrossURLPathState.mjs";
13
+ import { useIframeClickInterceptor as d } from "./contexts/useIframeClickInterceptor.mjs";
14
+ const a = () => (p(), d(), []), {
15
15
  editor: o
16
- } = s, d = () => {
16
+ } = i, f = () => {
17
17
  const {
18
18
  enabled: r
19
- } = p();
20
- return r() ? e(l, {}) : [];
21
- }, P = (r) => e(a, {
19
+ } = s();
20
+ return r() ? e(a, {}) : [];
21
+ }, k = (r) => e(m, {
22
22
  postMessage: (t) => {
23
- var i, n;
24
- typeof window > "u" || !(window.self !== window.top) || (o.applicationURL.length > 0 && (window == null || window.postMessage(
23
+ typeof window > "u" || !(window.self !== window.top) || (o.applicationURL.length > 0 && window?.postMessage(
25
24
  t,
26
25
  // Use to restrict the origin of the editor for security reasons.
27
26
  // Correspond to the current application URL to synchronize the locales states.
28
27
  o.applicationURL
29
- )), o.editorURL.length > 0 && ((i = window.parent) == null || i.postMessage(
28
+ ), o.editorURL.length > 0 && window.parent?.postMessage(
30
29
  t,
31
30
  // Use to restrict the origin of the editor for security reasons.
32
31
  // Correspond to the editor URL to synchronize the locales states.
33
32
  o.editorURL
34
- )), o.cmsURL.length > 0 && ((n = window.parent) == null || n.postMessage(
33
+ ), o.cmsURL.length > 0 && window.parent?.postMessage(
35
34
  t,
36
35
  // Use to restrict the origin of the CMS for security reasons.
37
36
  // Correspond to the CMS URL.
38
37
  o.cmsURL
39
- )));
38
+ ));
40
39
  },
41
40
  get allowedOrigins() {
42
- return [o == null ? void 0 : o.editorURL, o == null ? void 0 : o.cmsURL, o == null ? void 0 : o.applicationURL];
41
+ return [o?.editorURL, o?.cmsURL, o?.applicationURL];
43
42
  },
44
- configuration: s,
43
+ configuration: i,
45
44
  get children() {
46
- return [e(d, {}), m(() => r.children)];
45
+ return [e(f, {}), n(() => r.children)];
47
46
  }
48
47
  });
49
48
  export {
50
- P as IntlayerEditorProvider
49
+ k as IntlayerEditorProvider
51
50
  };
@@ -1,30 +1,30 @@
1
1
  import s from "@intlayer/config/built";
2
- import { createContext as c, useContext as a, createMemo as x, createComponent as i } from "solid-js";
3
- const u = () => "xxxx-xxxx-4xxx-yxxx".replace(/[xy]/g, function(n) {
2
+ import { createContext as i, useContext as c, createMemo as a, createComponent as x } from "solid-js";
3
+ const d = () => "xxxx-xxxx-4xxx-yxxx".replace(/[xy]/g, function(e) {
4
4
  const t = Math.random() * 16 | 0;
5
- return (n == "x" ? t : t & 3 | 8).toString(16);
5
+ return (e == "x" ? t : t & 3 | 8).toString(16);
6
6
  }), {
7
- editor: e
8
- } = s, r = c({
7
+ editor: o
8
+ } = s, r = i({
9
9
  postMessage: () => null,
10
- allowedOrigins: [e == null ? void 0 : e.applicationURL, e == null ? void 0 : e.editorURL, e == null ? void 0 : e.cmsURL],
10
+ allowedOrigins: [o?.applicationURL, o?.editorURL, o?.cmsURL],
11
11
  senderId: ""
12
- }), g = (n) => {
13
- const t = u(), o = x(() => ({
14
- postMessage: n.postMessage,
15
- allowedOrigins: n.allowedOrigins,
12
+ }), m = (e) => {
13
+ const t = d(), n = a(() => ({
14
+ postMessage: e.postMessage,
15
+ allowedOrigins: e.allowedOrigins,
16
16
  senderId: t
17
17
  }));
18
- return i(r.Provider, {
18
+ return x(r.Provider, {
19
19
  get value() {
20
- return o();
20
+ return n();
21
21
  },
22
22
  get children() {
23
- return n.children;
23
+ return e.children;
24
24
  }
25
25
  });
26
- }, d = () => a(r);
26
+ }, g = () => c(r);
27
27
  export {
28
- g as CommunicatorProvider,
29
- d as useCommunicator
28
+ m as CommunicatorProvider,
29
+ g as useCommunicator
30
30
  };
@@ -1,16 +1,16 @@
1
- import { getContentNodeByKeyPath as D, renameContentNodeByKeyPath as Y, editDictionaryByKeyPath as j } from "@intlayer/core";
2
- import { MessageKey as N } from "@intlayer/editor";
3
- import { createContext as _, useContext as x, createComponent as T } from "solid-js";
4
- import { useDictionariesRecord as M } from "./DictionariesRecordContext.mjs";
5
- import { useCrossFrameMessageListener as A } from "./useCrossFrameMessageListener.mjs";
6
- import { useCrossFrameState as W } from "./useCrossFrameState.mjs";
7
- const P = _(void 0), X = (r) => A(`${N.INTLAYER_EDITED_CONTENT_CHANGED}/post`, r), Z = (r) => A(`${N.INTLAYER_EDITED_CONTENT_CHANGED}/get`, r), I = _(void 0), K = (r) => {
1
+ import { getContentNodeByKeyPath as m, renameContentNodeByKeyPath as k, editDictionaryByKeyPath as B } from "@intlayer/core";
2
+ import { MessageKey as f } from "@intlayer/editor";
3
+ import { createContext as h, useContext as T, createComponent as g } from "solid-js";
4
+ import { useDictionariesRecord as H } from "./DictionariesRecordContext.mjs";
5
+ import { useCrossFrameMessageListener as _ } from "./useCrossFrameMessageListener.mjs";
6
+ import { useCrossFrameState as Y } from "./useCrossFrameState.mjs";
7
+ const x = h(void 0), J = (c) => _(`${f.INTLAYER_EDITED_CONTENT_CHANGED}/post`, c), Q = (c) => _(`${f.INTLAYER_EDITED_CONTENT_CHANGED}/get`, c), A = h(void 0), U = (c) => {
8
8
  const {
9
- localeDictionaries: E
10
- } = M(), [g, c] = W(N.INTLAYER_EDITED_CONTENT_CHANGED), w = (t) => {
9
+ localeDictionaries: r
10
+ } = H(), [D, s] = Y(f.INTLAYER_EDITED_CONTENT_CHANGED), p = (t) => {
11
11
  if (typeof t == "function")
12
- c((e) => {
13
- const n = e == null ? void 0 : e[Object.keys(e || {})[0]], o = t(n);
12
+ s((e) => {
13
+ const n = e?.[Object.keys(e || {})[0]], o = t(n);
14
14
  return {
15
15
  ...e,
16
16
  [o.key]: o
@@ -18,130 +18,126 @@ const P = _(void 0), X = (r) => A(`${N.INTLAYER_EDITED_CONTENT_CHANGED}/post`, r
18
18
  });
19
19
  else {
20
20
  const e = t;
21
- c((n) => ({
21
+ s((n) => ({
22
22
  ...n,
23
23
  [e.key]: e
24
24
  }));
25
25
  }
26
- }, S = (t, e) => {
27
- c((n) => ({
26
+ }, P = (t, e) => {
27
+ s((n) => ({
28
28
  ...n,
29
29
  [t]: {
30
- ...n == null ? void 0 : n[t],
30
+ ...n?.[t],
31
31
  content: e
32
32
  }
33
33
  }));
34
- }, F = (t, e, n = [], o = !0) => {
35
- c((s) => {
36
- var l, m;
37
- const i = (l = E[t]) == null ? void 0 : l.content, C = structuredClone(((m = s == null ? void 0 : s[t]) == null ? void 0 : m.content) ?? i);
38
- let d = n;
34
+ }, I = (t, e, n = [], o = !0) => {
35
+ s((d) => {
36
+ const C = r[t]?.content, u = structuredClone(d?.[t]?.content ?? C);
37
+ let i = n;
39
38
  if (!o) {
40
- let u = 0;
41
- const H = n.slice(0, -1), f = n[n.length - 1];
42
- let h = f.key;
43
- for (; typeof D(C, d) < "u"; )
44
- u++, h = u === 0 ? f.key : `${f.key} (${u})`, d = [...H, {
45
- ...f,
46
- key: h
39
+ let l = 0;
40
+ const b = n.slice(0, -1), a = n[n.length - 1];
41
+ let N = a.key;
42
+ for (; typeof m(u, i) < "u"; )
43
+ l++, N = l === 0 ? a.key : `${a.key} (${l})`, i = [...b, {
44
+ ...a,
45
+ key: N
47
46
  }];
48
47
  }
49
- const a = j(C, d, e);
48
+ const E = B(u, i, e);
50
49
  return {
51
- ...s,
50
+ ...d,
52
51
  [t]: {
53
- ...s == null ? void 0 : s[t],
54
- content: a
52
+ ...d?.[t],
53
+ content: E
55
54
  }
56
55
  };
57
56
  });
58
- }, G = (t, e, n = []) => {
59
- c((o) => {
60
- var d, a;
61
- const s = (d = E[t]) == null ? void 0 : d.content, i = structuredClone(((a = o == null ? void 0 : o[t]) == null ? void 0 : a.content) ?? s), C = Y(i, e, n);
57
+ }, w = (t, e, n = []) => {
58
+ s((o) => {
59
+ const d = r[t]?.content, C = structuredClone(o?.[t]?.content ?? d), u = k(C, e, n);
62
60
  return {
63
61
  ...o,
64
62
  [t]: {
65
- ...o == null ? void 0 : o[t],
66
- content: C
63
+ ...o?.[t],
64
+ content: u
67
65
  }
68
66
  };
69
67
  });
70
- }, L = (t, e) => {
71
- c((n) => {
72
- var a, l, m;
73
- const o = (a = E[t]) == null ? void 0 : a.content, s = structuredClone(((l = n == null ? void 0 : n[t]) == null ? void 0 : l.content) ?? o), i = structuredClone(s), C = e.slice(0, -1), d = (m = e[e.length - 1]) == null ? void 0 : m.key;
74
- if (d) {
75
- const u = D(i, C);
76
- u && typeof u == "object" && d in u && delete u[d];
68
+ }, S = (t, e) => {
69
+ s((n) => {
70
+ const o = r[t]?.content, d = structuredClone(n?.[t]?.content ?? o), C = structuredClone(d), u = e.slice(0, -1), i = e[e.length - 1]?.key;
71
+ if (i) {
72
+ const E = m(C, u);
73
+ E && typeof E == "object" && i in E && delete E[i];
77
74
  }
78
75
  return {
79
76
  ...n,
80
77
  [t]: {
81
- ...n == null ? void 0 : n[t],
82
- content: i
78
+ ...n?.[t],
79
+ content: C
83
80
  }
84
81
  };
85
82
  });
86
- }, O = (t) => {
87
- c((e) => {
83
+ }, F = (t) => {
84
+ s((e) => {
88
85
  const n = {
89
86
  ...e
90
87
  };
91
88
  return delete n[t], n;
92
89
  });
93
- }, R = (t) => {
94
- c((e) => ({
90
+ }, G = (t) => {
91
+ s((e) => ({
95
92
  ...e,
96
93
  [t]: {
97
- ...e == null ? void 0 : e[t],
94
+ ...e?.[t],
98
95
  content: {}
99
96
  }
100
97
  }));
101
- }, $ = () => {
102
- c({});
103
- }, b = (t, e) => {
104
- var s, i, C;
105
- const n = (s = E[t]) == null ? void 0 : s.content, o = ((C = (i = g()) == null ? void 0 : i[t]) == null ? void 0 : C.content) ?? n;
106
- return D(o, e);
107
- }, k = {
108
- editedContent: g()
109
- }, B = {
110
- setEditedContentState: c,
111
- setEditedDictionary: w,
112
- setEditedContent: S,
113
- addEditedContent: F,
114
- renameEditedContent: G,
115
- removeEditedContent: L,
116
- restoreEditedContent: O,
117
- clearEditedDictionaryContent: R,
118
- clearEditedContent: $,
119
- getEditedContentValue: b
98
+ }, L = () => {
99
+ s({});
100
+ }, O = (t, e) => {
101
+ const n = r[t]?.content, o = D()?.[t]?.content ?? n;
102
+ return m(o, e);
103
+ }, R = {
104
+ editedContent: D()
105
+ }, $ = {
106
+ setEditedContentState: s,
107
+ setEditedDictionary: p,
108
+ setEditedContent: P,
109
+ addEditedContent: I,
110
+ renameEditedContent: w,
111
+ removeEditedContent: S,
112
+ restoreEditedContent: F,
113
+ clearEditedDictionaryContent: G,
114
+ clearEditedContent: L,
115
+ getEditedContentValue: O
120
116
  };
121
- return T(P.Provider, {
122
- value: k,
117
+ return g(x.Provider, {
118
+ value: R,
123
119
  get children() {
124
- return T(I.Provider, {
125
- value: B,
120
+ return g(A.Provider, {
121
+ value: $,
126
122
  get children() {
127
- return r.children;
123
+ return c.children;
128
124
  }
129
125
  });
130
126
  }
131
127
  });
132
- }, V = () => x(I), p = () => {
133
- const r = V(), E = x(P);
134
- if (!E)
128
+ }, j = () => T(A), X = () => {
129
+ const c = j(), r = T(x);
130
+ if (!r)
135
131
  throw new Error("useEditedContent must be used within a EditedContentProvider");
136
132
  return {
137
- ...E,
138
- ...r
133
+ ...r,
134
+ ...c
139
135
  };
140
136
  };
141
137
  export {
142
- K as EditedContentProvider,
143
- p as useEditedContent,
144
- V as useEditedContentActions,
145
- Z as useGetEditedContentState,
146
- X as usePostEditedContentState
138
+ U as EditedContentProvider,
139
+ X as useEditedContent,
140
+ j as useEditedContentActions,
141
+ Q as useGetEditedContentState,
142
+ J as usePostEditedContentState
147
143
  };
@@ -1,5 +1,5 @@
1
- import { m as o } from "../../../web-BFg6-54-.mjs";
2
- import { createComponent as r, createSignal as d, createEffect as i } from "solid-js";
1
+ import { m as i } from "../../../web-mv0y5CK4.mjs";
2
+ import { createComponent as r, createSignal as d, createEffect as o } from "solid-js";
3
3
  import { CommunicatorProvider as c } from "./CommunicatorContext.mjs";
4
4
  import { ConfigurationProvider as a } from "./ConfigurationContext.mjs";
5
5
  import { DictionariesRecordProvider as l } from "./DictionariesRecordContext.mjs";
@@ -8,7 +8,7 @@ import { EditorEnabledProvider as g, useGetEditorEnabledState as f, useEditorEna
8
8
  import { FocusDictionaryProvider as h } from "./FocusDictionaryContext.mjs";
9
9
  const E = (e) => {
10
10
  const t = u();
11
- return i(() => {
11
+ return o(() => {
12
12
  t();
13
13
  }), r(l, {
14
14
  get children() {
@@ -27,14 +27,14 @@ const E = (e) => {
27
27
  const t = f(), {
28
28
  enabled: n
29
29
  } = s();
30
- return i(() => {
30
+ return o(() => {
31
31
  n() || t();
32
- }), o(() => n() ? e.children : e.fallback);
32
+ }), i(() => i(() => !!n())() ? e.children : e.fallback);
33
33
  }, v = (e) => {
34
34
  const [t, n] = d(!1);
35
- return i(() => {
35
+ return o(() => {
36
36
  n(window.self !== window.top);
37
- }), o(() => t() ? e.children : e.fallback);
37
+ }), i(() => i(() => !!t())() ? e.children : e.fallback);
38
38
  }, G = (e) => r(g, {
39
39
  get children() {
40
40
  return r(a, {
@@ -1,35 +1,35 @@
1
1
  import { compareUrls as c } from "@intlayer/editor";
2
- import { onMount as f, onCleanup as M } from "solid-js";
3
- import { useCommunicator as g } from "./CommunicatorContext.mjs";
4
- const I = (r, o, C) => {
5
- const t = g();
2
+ import { onMount as f, onCleanup as g } from "solid-js";
3
+ import { useCommunicator as w } from "./CommunicatorContext.mjs";
4
+ const v = (r, o, l) => {
5
+ const t = w();
6
6
  if (!t)
7
7
  throw new Error("useCrossFrameMessageListener must be used within a CommunicatorProvider");
8
8
  const {
9
- allowedOrigins: e,
10
- postMessage: m,
9
+ allowedOrigins: s,
10
+ postMessage: i,
11
11
  senderId: n
12
12
  } = t;
13
13
  return f(() => {
14
14
  if (o) {
15
- const s = (a) => {
15
+ const e = (a) => {
16
16
  const {
17
- type: i,
18
- data: p,
19
- senderId: d
17
+ type: m,
18
+ data: d,
19
+ senderId: p
20
20
  } = a.data;
21
- i === r && d !== n && (typeof e > "u" || e != null && e.some((u) => c(u, a.origin)) || e != null && e.includes("*")) && o(p);
21
+ m === r && p !== n && (typeof s > "u" || s?.some((u) => c(u, a.origin)) || s?.includes("*")) && o(d);
22
22
  };
23
- window.addEventListener("message", s), M(() => window.removeEventListener("message", s));
23
+ window.addEventListener("message", e), g(() => window.removeEventListener("message", e));
24
24
  }
25
- }), (s) => {
26
- m({
25
+ }), (e) => {
26
+ i({
27
27
  type: r,
28
- data: s,
28
+ data: e,
29
29
  senderId: n
30
30
  });
31
31
  };
32
32
  };
33
33
  export {
34
- I as useCrossFrameMessageListener
34
+ v as useCrossFrameMessageListener
35
35
  };