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.
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,21 +1,15 @@
1
- const o = (r) => {
2
- let e = "pending", t;
3
- const c = r.then(
4
- (n) => {
5
- e = "success", t = n;
6
- },
7
- (n) => {
8
- e = "error", t = n;
9
- }
10
- );
11
- return {
12
- read() {
13
- if (e === "pending") throw c;
14
- if (e === "error") throw t;
15
- return t;
16
- }
17
- };
18
- }, s = /* @__PURE__ */ new Map(), a = (r, e) => (s.has(r) || s.set(r, o(e)), s.get(r).read());
19
- export {
20
- a as useLoadDynamic
21
- };
1
+ //#region src/client/useLoadDynamic.ts
2
+ var e = (e) => {
3
+ let t = "pending", n, r = e.then((e) => {
4
+ t = "success", n = e;
5
+ }, (e) => {
6
+ t = "error", n = e;
7
+ });
8
+ return { read() {
9
+ if (t === "pending") throw r;
10
+ if (t === "error") throw n;
11
+ return n;
12
+ } };
13
+ }, t = /* @__PURE__ */ new Map(), n = (n, r) => (t.has(n) || t.set(n, e(r)), t.get(n).read());
14
+ //#endregion
15
+ export { n as useLoadDynamic };
@@ -1,37 +1,24 @@
1
- import c 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 { setLocaleInStorage as m } from "./useLocaleStorage.mjs";
5
- const b = ({
6
- isCookieEnabled: a,
7
- onLocaleChange: o
8
- } = {}) => {
9
- const { defaultLocale: n, locales: r } = c?.internationalization ?? {}, e = l(f), i = (t) => {
10
- if (!r?.map(String).includes(t)) {
11
- console.error(`Locale ${t} is not available`);
12
- return;
13
- }
14
- e?.setLocale(t), m(
15
- t,
16
- a ?? e?.isCookieEnabled ?? !0
17
- ), o?.(t);
18
- };
19
- return s(() => {
20
- if (o && e?.locale) {
21
- const t = e.locale();
22
- o(t);
23
- }
24
- }), {
25
- locale: e?.locale,
26
- // Current locale (signal accessor)
27
- defaultLocale: n,
28
- // Principal locale defined in config
29
- availableLocales: r,
30
- // List of the available locales defined in config
31
- setLocale: i
32
- // Function to set the locale
33
- };
34
- };
35
- export {
36
- b as useLocale
1
+ import { setLocaleInStorage as e } from "./useLocaleStorage.mjs";
2
+ import { IntlayerClientContext as t } from "./IntlayerProvider.mjs";
3
+ import n from "@intlayer/config/built";
4
+ import { createEffect as r, useContext as i } from "solid-js";
5
+ //#region src/client/useLocale.ts
6
+ var a = ({ isCookieEnabled: a, onLocaleChange: o } = {}) => {
7
+ let { defaultLocale: s, locales: c } = n?.internationalization ?? {}, l = i(t);
8
+ return r(() => {
9
+ o && l?.locale && o(l.locale());
10
+ }), {
11
+ locale: l?.locale,
12
+ defaultLocale: s,
13
+ availableLocales: c,
14
+ setLocale: (t) => {
15
+ if (!c?.map(String).includes(t)) {
16
+ console.error(`Locale ${t} is not available`);
17
+ return;
18
+ }
19
+ l?.setLocale(t), e(t, a ?? l?.isCookieEnabled ?? !0), o?.(t);
20
+ }
21
+ };
37
22
  };
23
+ //#endregion
24
+ export { a as useLocale };
@@ -1,19 +1,15 @@
1
- import e from "@intlayer/config/built";
2
- import { useContext as a } from "solid-js";
3
- import { IntlayerClientContext as l } from "./IntlayerProvider.mjs";
4
- const { defaultLocale: n, locales: r } = e.internationalization, m = () => {
5
- const { locale: o, setLocale: t } = a(l);
6
- return {
7
- locale: o,
8
- // Current locale
9
- defaultLocale: n,
10
- // Principal locale defined in config
11
- availableLocales: r,
12
- // List of the available locales defined in config
13
- setLocale: t
14
- // Function to set the locale
15
- };
16
- };
17
- export {
18
- m as useLocaleBase
1
+ import { IntlayerClientContext as e } from "./IntlayerProvider.mjs";
2
+ import t from "@intlayer/config/built";
3
+ import { useContext as n } from "solid-js";
4
+ //#region src/client/useLocaleBase.ts
5
+ var { defaultLocale: r, locales: i } = t.internationalization, a = () => {
6
+ let { locale: t, setLocale: a } = n(e);
7
+ return {
8
+ locale: t,
9
+ defaultLocale: r,
10
+ availableLocales: i,
11
+ setLocale: a
12
+ };
19
13
  };
14
+ //#endregion
15
+ export { a as useLocaleBase };
@@ -1,26 +1,19 @@
1
- import { localeStorageOptions as t } from "@intlayer/core/localization";
2
- import { getLocaleFromStorage as a, setLocaleInStorage as c, LocaleStorage as r } from "@intlayer/core/utils";
3
- import { createMemo as l } from "solid-js";
4
- const s = a(t), S = s, n = (o, e) => c(o, {
5
- ...t,
6
- isCookieEnabled: e
7
- }), k = n, g = (o) => l(
8
- () => r({
9
- ...t,
10
- isCookieEnabled: o
11
- })
12
- ), p = (o) => {
13
- const e = g(o);
14
- return {
15
- localeCookie: e().getLocale(),
16
- setLocaleCookie: e().setLocale
17
- };
18
- };
19
- export {
20
- S as localeCookie,
21
- s as localeInStorage,
22
- k as setLocaleCookie,
23
- n as setLocaleInStorage,
24
- p as useLocaleCookie,
25
- g as useLocaleStorage
1
+ import { LocaleStorage as e, getLocaleFromStorage as t, setLocaleInStorage as n } from "@intlayer/core/utils";
2
+ import { createMemo as r } from "solid-js";
3
+ import { localeStorageOptions as i } from "@intlayer/core/localization";
4
+ //#region src/client/useLocaleStorage.ts
5
+ var a = t(i), o = a, s = (e, t) => n(e, {
6
+ ...i,
7
+ isCookieEnabled: t
8
+ }), c = s, l = (t) => r(() => e({
9
+ ...i,
10
+ isCookieEnabled: t
11
+ })), u = (e) => {
12
+ let t = l(e);
13
+ return {
14
+ localeCookie: t().getLocale(),
15
+ setLocaleCookie: t().setLocale
16
+ };
26
17
  };
18
+ //#endregion
19
+ export { o as localeCookie, a as localeInStorage, c as setLocaleCookie, s as setLocaleInStorage, u as useLocaleCookie, l as useLocaleStorage };
@@ -1,19 +1,15 @@
1
- import n from "@intlayer/config/built";
2
- import { getRewritePath as a } from "@intlayer/core/localization";
3
- import { createEffect as c } from "solid-js";
4
- import { useLocale as w } from "./useLocale.mjs";
5
- const p = () => {
6
- const { locale: i } = w(), o = n?.routing?.rewrite;
7
- c(() => {
8
- if (typeof window > "u" || !o) return;
9
- const r = i(), e = window.location.pathname, t = a(e, r, o);
10
- t && t !== e && window.history.replaceState(
11
- window.history.state,
12
- "",
13
- t + window.location.search + window.location.hash
14
- );
15
- });
16
- };
17
- export {
18
- p as useRewriteURL
1
+ import { useLocale as e } from "./useLocale.mjs";
2
+ import t from "@intlayer/config/built";
3
+ import { createEffect as n } from "solid-js";
4
+ import { getRewritePath as r } from "@intlayer/core/localization";
5
+ //#region src/client/useRewriteURL.ts
6
+ var i = () => {
7
+ let { locale: i } = e(), a = t?.routing?.rewrite;
8
+ n(() => {
9
+ if (typeof window > "u" || !a) return;
10
+ let e = i(), t = window.location.pathname, n = r(t, e, a);
11
+ n && n !== t && window.history.replaceState(window.history.state, "", n + window.location.search + window.location.hash);
12
+ });
19
13
  };
14
+ //#endregion
15
+ export { i as useRewriteURL };
@@ -1,14 +1,11 @@
1
+ import { IntlayerClientContext as e } from "./IntlayerProvider.mjs";
2
+ import { getTranslation as t } from "@intlayer/core/interpreter";
1
3
  import n from "@intlayer/config/built";
2
- import { getTranslation as r } from "@intlayer/core/interpreter";
3
- import { useContext as e } from "solid-js";
4
- import { IntlayerClientContext as i } from "./IntlayerProvider.mjs";
5
- const s = (t) => {
6
- const { locale: o } = e(i) ?? {};
7
- return r(
8
- t,
9
- o?.() ?? n?.internationalization.defaultLocale
10
- );
11
- };
12
- export {
13
- s as useTranslation
4
+ import { useContext as r } from "solid-js";
5
+ //#region src/client/useTraduction.ts
6
+ var i = (i) => {
7
+ let { locale: a } = r(e) ?? {};
8
+ return t(i, a?.() ?? n?.internationalization.defaultLocale);
14
9
  };
10
+ //#endregion
11
+ export { i as useTranslation };
@@ -1,24 +1,2 @@
1
- import "solid-js/web";
2
- import "@intlayer/core/utils";
3
- import "@intlayer/types/nodeType";
4
- import "solid-js";
5
- import "@intlayer/core/formatters";
6
- import "../client/IntlayerProvider.mjs";
7
- import "@intlayer/config/built";
8
- import "@intlayer/core/localization";
9
- import "@intlayer/types/locales";
10
- import "@intlayer/core/interpreter";
11
- import { C as k } from "../../plugins-FXnYVZH5.mjs";
12
- import "../client/useLocaleStorage.mjs";
13
- import "../client/useLocaleBase.mjs";
14
- import "../UI/ContentSelector.mjs";
15
- import "@intlayer/editor";
16
- import "./contexts/ConfigurationContext.mjs";
17
- import "./contexts/DictionariesRecordContext.mjs";
18
- import "./contexts/EditedContentContext.mjs";
19
- import "./contexts/EditorEnabledContext.mjs";
20
- import "./contexts/CommunicatorContext.mjs";
21
- import "./contexts/FocusDictionaryContext.mjs";
22
- export {
23
- k as ContentSelectorRenderer
24
- };
1
+ import { l as e } from "../../getDictionary-DKdSGWHu.mjs";
2
+ export { e as ContentSelectorRenderer };
@@ -1,61 +1,39 @@
1
- import { createComponent as r, memo as p } from "solid-js/web";
1
+ import { useDictionariesRecordActions as e } from "./contexts/DictionariesRecordContext.mjs";
2
+ import { useEditorEnabled as t } from "./contexts/EditorEnabledContext.mjs";
3
+ import { EditorProvider as n } from "./contexts/EditorProvider.mjs";
4
+ import { useCrossURLPathSetter as r } from "./contexts/useCrossURLPathState.mjs";
5
+ import { useIframeClickInterceptor as i } from "./contexts/useIframeClickInterceptor.mjs";
6
+ import { createComponent as a, memo as o } from "solid-js/web";
2
7
  import s from "@intlayer/config/built";
3
8
  import { onMount as c } from "solid-js";
4
- import "@intlayer/editor";
5
- import "./contexts/ConfigurationContext.mjs";
6
- import { useDictionariesRecordActions as a } from "./contexts/DictionariesRecordContext.mjs";
7
- import "./contexts/EditedContentContext.mjs";
8
- import { useEditorEnabled as d } from "./contexts/EditorEnabledContext.mjs";
9
- import { EditorProvider as l } from "./contexts/EditorProvider.mjs";
10
- import "./contexts/FocusDictionaryContext.mjs";
11
- import "./contexts/CommunicatorContext.mjs";
12
- import { useCrossURLPathSetter as f } from "./contexts/useCrossURLPathState.mjs";
13
- import { useIframeClickInterceptor as u } from "./contexts/useIframeClickInterceptor.mjs";
14
- const g = () => {
15
- f(), u();
16
- const {
17
- setLocaleDictionaries: t
18
- } = a() ?? {};
19
- return c(() => {
20
- import("@intlayer/unmerged-dictionaries-entry").then((e) => {
21
- const i = e.getUnmergedDictionaries(), m = Object.fromEntries(Object.values(i).flat().map((n) => [n.localId, n]));
22
- t?.(m);
23
- });
24
- }), [];
25
- }, {
26
- editor: o
27
- } = s, w = () => {
28
- const {
29
- enabled: t
30
- } = d();
31
- return t() ? r(g, {}) : [];
32
- }, O = (t) => r(l, {
33
- postMessage: (e) => {
34
- typeof window > "u" || !(window.self !== window.top) || (o.applicationURL.length > 0 && window?.postMessage(
35
- e,
36
- // Use to restrict the origin of the editor for security reasons.
37
- // Correspond to the current application URL to synchronize the locales states.
38
- o.applicationURL
39
- ), o.editorURL.length > 0 && window.parent?.postMessage(
40
- e,
41
- // Use to restrict the origin of the editor for security reasons.
42
- // Correspond to the editor URL to synchronize the locales states.
43
- o.editorURL
44
- ), o.cmsURL.length > 0 && window.parent?.postMessage(
45
- e,
46
- // Use to restrict the origin of the CMS for security reasons.
47
- // Correspond to the CMS URL.
48
- o.cmsURL
49
- ));
50
- },
51
- get allowedOrigins() {
52
- return [o?.editorURL, o?.cmsURL, o?.applicationURL];
53
- },
54
- configuration: s,
55
- get children() {
56
- return [r(w, {}), p(() => t.children)];
57
- }
9
+ //#region src/editor/IntlayerEditorProvider.tsx
10
+ var l = () => {
11
+ r(), i();
12
+ let { setLocaleDictionaries: t } = e() ?? {};
13
+ return c(() => {
14
+ import("@intlayer/unmerged-dictionaries-entry").then((e) => {
15
+ let n = e.getUnmergedDictionaries(), r = Object.fromEntries(Object.values(n).flat().map((e) => [e.localId, e]));
16
+ t?.(r);
17
+ });
18
+ }), [];
19
+ }, { editor: u } = s, d = () => {
20
+ let { enabled: e } = t();
21
+ return e() ? a(l, {}) : [];
22
+ }, f = (e) => a(n, {
23
+ postMessage: (e) => {
24
+ typeof window > "u" || window.self !== window.top && (u.applicationURL.length > 0 && window?.postMessage(e, u.applicationURL), u.editorURL.length > 0 && window.parent?.postMessage(e, u.editorURL), u.cmsURL.length > 0 && window.parent?.postMessage(e, u.cmsURL));
25
+ },
26
+ get allowedOrigins() {
27
+ return [
28
+ u?.editorURL,
29
+ u?.cmsURL,
30
+ u?.applicationURL
31
+ ];
32
+ },
33
+ configuration: s,
34
+ get children() {
35
+ return [a(d, {}), o(() => e.children)];
36
+ }
58
37
  });
59
- export {
60
- O as IntlayerEditorProvider
61
- };
38
+ //#endregion
39
+ export { f as IntlayerEditorProvider };
@@ -1,28 +1,29 @@
1
- import { createComponent as i } from "solid-js/web";
2
- import s from "@intlayer/config/built";
3
- import { createContext as a, createMemo as c, useContext as m } from "solid-js";
4
- const d = () => Math.random().toString(36).slice(2), {
5
- editor: o
6
- } = s, t = a({
7
- postMessage: () => null,
8
- allowedOrigins: [o?.applicationURL, o?.editorURL, o?.cmsURL],
9
- senderId: ""
10
- }), C = (e) => {
11
- const r = d(), n = c(() => ({
12
- postMessage: e.postMessage,
13
- allowedOrigins: e.allowedOrigins,
14
- senderId: r
15
- }));
16
- return i(t.Provider, {
17
- get value() {
18
- return n();
19
- },
20
- get children() {
21
- return e.children;
22
- }
23
- });
24
- }, p = () => m(t);
25
- export {
26
- C as CommunicatorProvider,
27
- p as useCommunicator
28
- };
1
+ import { createComponent as e } from "solid-js/web";
2
+ import t from "@intlayer/config/built";
3
+ import { createContext as n, createMemo as r, useContext as i } from "solid-js";
4
+ //#region src/editor/contexts/CommunicatorContext.tsx
5
+ var a = () => Math.random().toString(36).slice(2), { editor: o } = t, s = n({
6
+ postMessage: () => null,
7
+ allowedOrigins: [
8
+ o?.applicationURL,
9
+ o?.editorURL,
10
+ o?.cmsURL
11
+ ],
12
+ senderId: ""
13
+ }), c = (t) => {
14
+ let n = a(), i = r(() => ({
15
+ postMessage: t.postMessage,
16
+ allowedOrigins: t.allowedOrigins,
17
+ senderId: n
18
+ }));
19
+ return e(s.Provider, {
20
+ get value() {
21
+ return i();
22
+ },
23
+ get children() {
24
+ return t.children;
25
+ }
26
+ });
27
+ }, l = () => i(s);
28
+ //#endregion
29
+ export { c as CommunicatorProvider, l as useCommunicator };
@@ -1,20 +1,18 @@
1
- import { createComponent as o } from "solid-js/web";
2
- import { MessageKey as r } from "@intlayer/editor";
3
- import { createContext as n, useContext as i } from "solid-js";
4
- import { useCrossFrameState as a } from "./useCrossFrameState.mjs";
5
- const t = n(void 0), f = () => a(r.INTLAYER_CONFIGURATION, void 0, {
6
- receive: !1,
7
- emit: !0
8
- }), C = (e) => o(t.Provider, {
9
- get value() {
10
- return e.configuration;
11
- },
12
- get children() {
13
- return e.children;
14
- }
15
- }), g = () => i(t);
16
- export {
17
- C as ConfigurationProvider,
18
- g as useConfiguration,
19
- f as useConfigurationState
20
- };
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/ConfigurationContext.tsx
6
+ var a = n(void 0), o = () => e(i.INTLAYER_CONFIGURATION, void 0, {
7
+ receive: !1,
8
+ emit: !0
9
+ }), s = (e) => t(a.Provider, {
10
+ get value() {
11
+ return e.configuration;
12
+ },
13
+ get children() {
14
+ return e.children;
15
+ }
16
+ }), c = () => r(a);
17
+ //#endregion
18
+ export { s as ConfigurationProvider, c as useConfiguration, o as useConfigurationState };
@@ -1,45 +1,40 @@
1
- import { createComponent as i } from "solid-js/web";
2
- import { MessageKey as m } from "@intlayer/editor";
3
- import { createContext as c, createMemo as n, useContext as s } from "solid-js";
4
- import { useCrossFrameState as C } from "./useCrossFrameState.mjs";
5
- const a = c(void 0), d = c(void 0), f = (t) => {
6
- const [e, o] = C(m.INTLAYER_LOCALE_DICTIONARIES_CHANGED, void 0), u = n(() => ({
7
- localeDictionaries: e() ?? {}
8
- })), l = n(() => ({
9
- setLocaleDictionaries: o,
10
- setLocaleDictionary: (r) => {
11
- o((D) => ({
12
- ...D,
13
- [r.localId]: r
14
- }));
15
- }
16
- }));
17
- return i(a.Provider, {
18
- get value() {
19
- return u();
20
- },
21
- get children() {
22
- return i(d.Provider, {
23
- get value() {
24
- return l();
25
- },
26
- get children() {
27
- return t.children;
28
- }
29
- });
30
- }
31
- });
32
- }, v = () => s(d), g = () => {
33
- const t = v(), e = s(a);
34
- if (!e)
35
- throw new Error("useDictionariesRecordStates must be used within a DictionariesRecordProvider");
36
- return {
37
- ...e,
38
- ...t
39
- };
40
- };
41
- export {
42
- f as DictionariesRecordProvider,
43
- g as useDictionariesRecord,
44
- v as useDictionariesRecordActions
1
+ import { useCrossFrameState as e } from "./useCrossFrameState.mjs";
2
+ import { createComponent as t } from "solid-js/web";
3
+ import { createContext as n, createMemo as r, useContext as i } from "solid-js";
4
+ import { MessageKey as a } from "@intlayer/editor";
5
+ //#region src/editor/contexts/DictionariesRecordContext.tsx
6
+ var o = n(void 0), s = n(void 0), c = (n) => {
7
+ let [i, c] = e(a.INTLAYER_LOCALE_DICTIONARIES_CHANGED, void 0), l = r(() => ({ localeDictionaries: i() ?? {} })), u = r(() => ({
8
+ setLocaleDictionaries: c,
9
+ setLocaleDictionary: (e) => {
10
+ c((t) => ({
11
+ ...t,
12
+ [e.localId]: e
13
+ }));
14
+ }
15
+ }));
16
+ return t(o.Provider, {
17
+ get value() {
18
+ return l();
19
+ },
20
+ get children() {
21
+ return t(s.Provider, {
22
+ get value() {
23
+ return u();
24
+ },
25
+ get children() {
26
+ return n.children;
27
+ }
28
+ });
29
+ }
30
+ });
31
+ }, l = () => i(s), u = () => {
32
+ let e = l(), t = i(o);
33
+ if (!t) throw Error("useDictionariesRecordStates must be used within a DictionariesRecordProvider");
34
+ return {
35
+ ...t,
36
+ ...e
37
+ };
45
38
  };
39
+ //#endregion
40
+ export { c as DictionariesRecordProvider, u as useDictionariesRecord, l as useDictionariesRecordActions };