solid-intlayer 8.3.3 → 8.4.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 (110) hide show
  1. package/dist/cjs/client/IntlayerProvider.cjs +1 -1
  2. package/dist/cjs/client/format/useIntl.cjs +1 -1
  3. package/dist/cjs/client/getBrowserLocale.cjs +1 -1
  4. package/dist/cjs/client/index.cjs +1 -1
  5. package/dist/cjs/client/t.cjs +1 -1
  6. package/dist/cjs/client/useContent.cjs +1 -1
  7. package/dist/cjs/client/useDictionary.cjs +1 -1
  8. package/dist/cjs/client/useDictionaryAsync.cjs +1 -1
  9. package/dist/cjs/client/useDictionaryDynamic.cjs +1 -1
  10. package/dist/cjs/client/useIntlayer.cjs +1 -1
  11. package/dist/cjs/client/useLocale.cjs +1 -1
  12. package/dist/cjs/client/useLocaleBase.cjs +1 -1
  13. package/dist/cjs/client/useLocaleStorage.cjs +1 -1
  14. package/dist/cjs/client/useRewriteURL.cjs +1 -1
  15. package/dist/cjs/client/useTraduction.cjs +1 -1
  16. package/dist/cjs/editor/ContentSelector.cjs +1 -0
  17. package/dist/cjs/editor/EditorProvider.cjs +1 -0
  18. package/dist/cjs/editor/useEditor.cjs +1 -0
  19. package/dist/cjs/getDictionary.cjs +1 -1
  20. package/dist/cjs/getIntlayer.cjs +1 -1
  21. package/dist/cjs/html/HTMLRenderer.cjs +1 -1
  22. package/dist/cjs/index.cjs +1 -1
  23. package/dist/cjs/markdown/MarkdownProvider.cjs +1 -1
  24. package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
  25. package/dist/cjs/plugins.cjs +1 -1
  26. package/dist/client-BOid_svT.mjs +108 -0
  27. package/dist/client-DLNjmXFC.js +1 -0
  28. package/dist/esm/client/IntlayerProvider.mjs +2 -56
  29. package/dist/esm/client/format/useIntl.mjs +2 -10
  30. package/dist/esm/client/getBrowserLocale.mjs +8 -8
  31. package/dist/esm/client/index.mjs +5 -11
  32. package/dist/esm/client/t.mjs +2 -10
  33. package/dist/esm/client/useContent.mjs +1 -1
  34. package/dist/esm/client/useDictionary.mjs +1 -1
  35. package/dist/esm/client/useDictionaryAsync.mjs +1 -1
  36. package/dist/esm/client/useDictionaryDynamic.mjs +1 -1
  37. package/dist/esm/client/useIntlayer.mjs +1 -1
  38. package/dist/esm/client/useLocale.mjs +2 -24
  39. package/dist/esm/client/useLocaleBase.mjs +2 -15
  40. package/dist/esm/client/useLocaleStorage.mjs +9 -9
  41. package/dist/esm/client/useRewriteURL.mjs +2 -15
  42. package/dist/esm/client/useTraduction.mjs +1 -1
  43. package/dist/esm/editor/ContentSelector.mjs +9 -0
  44. package/dist/esm/editor/EditorProvider.mjs +2 -0
  45. package/dist/esm/editor/useEditor.mjs +2 -0
  46. package/dist/esm/getDictionary.mjs +6 -2
  47. package/dist/esm/getIntlayer.mjs +6 -2
  48. package/dist/esm/html/HTMLRenderer.mjs +15 -24
  49. package/dist/esm/index.mjs +10 -14
  50. package/dist/esm/markdown/MarkdownProvider.mjs +0 -1
  51. package/dist/esm/markdown/MarkdownRenderer.mjs +22 -31
  52. package/dist/esm/plugins.mjs +145 -2
  53. package/dist/types/client/IntlayerProvider.d.ts +0 -1
  54. package/dist/types/client/useContent.d.ts +1 -1
  55. package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
  56. package/dist/types/client/useLocaleStorage.d.ts +4 -4
  57. package/dist/types/editor/ContentSelector.d.ts +16 -0
  58. package/dist/types/editor/EditorProvider.d.ts +2 -0
  59. package/dist/types/editor/useEditor.d.ts +6 -0
  60. package/package.json +8 -9
  61. package/dist/cjs/editor/ContentSelectorWrapper.cjs +0 -1
  62. package/dist/cjs/editor/IntlayerEditorProvider.cjs +0 -1
  63. package/dist/cjs/editor/contexts/CommunicatorContext.cjs +0 -1
  64. package/dist/cjs/editor/contexts/ConfigurationContext.cjs +0 -1
  65. package/dist/cjs/editor/contexts/DictionariesRecordContext.cjs +0 -1
  66. package/dist/cjs/editor/contexts/EditedContentContext.cjs +0 -1
  67. package/dist/cjs/editor/contexts/EditorEnabledContext.cjs +0 -1
  68. package/dist/cjs/editor/contexts/EditorProvider.cjs +0 -1
  69. package/dist/cjs/editor/contexts/FocusDictionaryContext.cjs +0 -1
  70. package/dist/cjs/editor/contexts/index.cjs +0 -1
  71. package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +0 -1
  72. package/dist/cjs/editor/contexts/useCrossFrameState.cjs +0 -1
  73. package/dist/cjs/editor/contexts/useCrossURLPathState.cjs +0 -1
  74. package/dist/cjs/editor/contexts/useIframeClickInterceptor.cjs +0 -1
  75. package/dist/cjs/editor/index.cjs +0 -1
  76. package/dist/cjs/editor/useEditedContentRenderer.cjs +0 -1
  77. package/dist/esm/editor/ContentSelectorWrapper.mjs +0 -2
  78. package/dist/esm/editor/IntlayerEditorProvider.mjs +0 -39
  79. package/dist/esm/editor/contexts/CommunicatorContext.mjs +0 -29
  80. package/dist/esm/editor/contexts/ConfigurationContext.mjs +0 -18
  81. package/dist/esm/editor/contexts/DictionariesRecordContext.mjs +0 -40
  82. package/dist/esm/editor/contexts/EditedContentContext.mjs +0 -136
  83. package/dist/esm/editor/contexts/EditorEnabledContext.mjs +0 -20
  84. package/dist/esm/editor/contexts/EditorProvider.mjs +0 -68
  85. package/dist/esm/editor/contexts/FocusDictionaryContext.mjs +0 -42
  86. package/dist/esm/editor/contexts/index.mjs +0 -12
  87. package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +0 -31
  88. package/dist/esm/editor/contexts/useCrossFrameState.mjs +0 -45
  89. package/dist/esm/editor/contexts/useCrossURLPathState.mjs +0 -24
  90. package/dist/esm/editor/contexts/useIframeClickInterceptor.mjs +0 -17
  91. package/dist/esm/editor/index.mjs +0 -2
  92. package/dist/esm/editor/useEditedContentRenderer.mjs +0 -16
  93. package/dist/getDictionary-DKdSGWHu.mjs +0 -188
  94. package/dist/getDictionary-DxYuk0_0.js +0 -1
  95. package/dist/types/editor/ContentSelectorWrapper.d.ts +0 -6
  96. package/dist/types/editor/IntlayerEditorProvider.d.ts +0 -2
  97. package/dist/types/editor/contexts/CommunicatorContext.d.ts +0 -9
  98. package/dist/types/editor/contexts/ConfigurationContext.d.ts +0 -8
  99. package/dist/types/editor/contexts/DictionariesRecordContext.d.ts +0 -15
  100. package/dist/types/editor/contexts/EditedContentContext.d.ts +0 -34
  101. package/dist/types/editor/contexts/EditorEnabledContext.d.ts +0 -10
  102. package/dist/types/editor/contexts/EditorProvider.d.ts +0 -5
  103. package/dist/types/editor/contexts/FocusDictionaryContext.d.ts +0 -20
  104. package/dist/types/editor/contexts/index.d.ts +0 -11
  105. package/dist/types/editor/contexts/useCrossFrameMessageListener.d.ts +0 -18
  106. package/dist/types/editor/contexts/useCrossFrameState.d.ts +0 -28
  107. package/dist/types/editor/contexts/useCrossURLPathState.d.ts +0 -3
  108. package/dist/types/editor/contexts/useIframeClickInterceptor.d.ts +0 -8
  109. package/dist/types/editor/index.d.ts +0 -1
  110. package/dist/types/editor/useEditedContentRenderer.d.ts +0 -12
@@ -1,29 +1,20 @@
1
- import { useEditedContentRenderer as e } from "../editor/useEditedContentRenderer.mjs";
2
- import { useHTMLContext as t } from "./HTMLProvider.mjs";
3
- import { getHTML as n } from "@intlayer/core/interpreter";
4
- import { Dynamic as r, createComponent as i, memo as a, mergeProps as o } from "solid-js/web";
5
- import { HTML_TAGS as s } from "@intlayer/core/transpiler";
6
- import { createMemo as c } from "solid-js";
7
- var l = (() => {
1
+ import { useHTMLContext as e } from "./HTMLProvider.mjs";
2
+ import { getHTML as t } from "@intlayer/core/interpreter";
3
+ import { Dynamic as n, createComponent as r, mergeProps as i } from "solid-js/web";
4
+ import { HTML_TAGS as a } from "@intlayer/core/transpiler";
5
+ var o = (() => {
8
6
  let e = {};
9
- for (let t of s) e[t] = ({ children: e, ...n }) => i(r, o({ component: t }, n, { children: e }));
7
+ for (let t of a) e[t] = ({ children: e, ...a }) => r(n, i({ component: t }, a, { children: e }));
10
8
  return e;
11
- })(), u = (e, { components: t } = {}) => n(e, {
12
- ...l,
13
- ...t
14
- }), d = ({ components: e } = {}) => {
15
- let n = t();
16
- return (t) => u(t, { components: {
9
+ })(), s = (e, { components: n } = {}) => t(e, {
10
+ ...o,
11
+ ...n
12
+ }), c = ({ components: t } = {}) => {
13
+ let n = e();
14
+ return (e) => s(e, { components: {
17
15
  ...n?.components,
18
- ...e
16
+ ...t
19
17
  } });
20
- }, f = (t) => {
21
- let n = d({ components: t.components || t.userComponents }), r = () => t.children || t.html || "", i = c(() => e({
22
- dictionaryKey: t.dictionaryKey,
23
- keyPath: t.keyPath,
24
- children: r()
25
- })), o = () => t.dictionaryKey && t.keyPath && typeof i() == "string" ? i() : r();
26
- return a(() => n(o()));
27
- };
18
+ }, l = (e) => c({ components: e.components || e.userComponents })(e.children || e.html || "");
28
19
  //#endregion
29
- export { f as HTMLRenderer, l as defaultHTMLComponents, u as renderHTML, d as useHTMLRenderer };
20
+ export { l as HTMLRenderer, o as defaultHTMLComponents, s as renderHTML, c as useHTMLRenderer };
@@ -1,17 +1,13 @@
1
- import { localeCookie as e, localeInStorage as t, setLocaleCookie as n, setLocaleInStorage as r, useLocaleCookie as i, useLocaleStorage as a } from "./client/useLocaleStorage.mjs";
2
- import { IntlayerClientContext as o, IntlayerProvider as s, IntlayerProviderContent as c, useIntlayerContext as l } from "./client/IntlayerProvider.mjs";
3
- import { useIntl as u } from "./client/format/useIntl.mjs";
4
- import { getBrowserLocale as d } from "./client/getBrowserLocale.mjs";
5
- import { t as f } from "./client/t.mjs";
6
- import { d as p, f as m, m as h, p as g, t as _, u as v } from "../getDictionary-DKdSGWHu.mjs";
7
- import { useLoadDynamic as y } from "./client/useLoadDynamic.mjs";
8
- import { useLocale as b } from "./client/useLocale.mjs";
9
- import { useLocaleBase as x } from "./client/useLocaleBase.mjs";
10
- import { useRewriteURL as S } from "./client/useRewriteURL.mjs";
11
- import { compileMarkdown as C } from "./markdown/compiler.mjs";
12
- import { MarkdownProvider as w, useMarkdown as T } from "./markdown/MarkdownProvider.mjs";
13
- import { MarkdownRenderer as E } from "./markdown/MarkdownRenderer.mjs";
1
+ import { compileMarkdown as e } from "./markdown/compiler.mjs";
2
+ import { MarkdownProvider as t, useMarkdown as n } from "./markdown/MarkdownProvider.mjs";
3
+ import { MarkdownRenderer as r } from "./markdown/MarkdownRenderer.mjs";
4
+ import { getDictionary as i } from "./getDictionary.mjs";
5
+ import { getIntlayer as a } from "./getIntlayer.mjs";
6
+ import { a as o, c as s, d as c, f as l, i as u, l as d, n as f, o as p, p as m, r as h, s as g, t as _, u as v } from "../client-BOid_svT.mjs";
7
+ import { localeCookie as y, localeInStorage as b, setLocaleCookie as x, setLocaleInStorage as S, useLocaleCookie as C, useLocaleStorage as w } from "./client/useLocaleStorage.mjs";
8
+ import { getBrowserLocale as T } from "./client/getBrowserLocale.mjs";
9
+ import { useLoadDynamic as E } from "./client/useLoadDynamic.mjs";
14
10
  import { HTMLProvider as D } from "./html/HTMLProvider.mjs";
15
11
  import { HTMLRenderer as O, renderHTML as k, useHTMLRenderer as A } from "./html/HTMLRenderer.mjs";
16
12
  import "./html/index.mjs";
17
- export { D as HTMLProvider, O as HTMLRenderer, o as IntlayerClientContext, s as IntlayerProvider, c as IntlayerProviderContent, w as MarkdownProvider, E as MarkdownRenderer, C as compileMarkdown, d as getBrowserLocale, _ as getDictionary, p as getIntlayer, e as localeCookie, t as localeInStorage, k as renderHTML, n as setLocaleCookie, r as setLocaleInStorage, f as t, h as useDictionary, g as useDictionaryAsync, m as useDictionaryDynamic, A as useHTMLRenderer, u as useIntl, v as useIntlayer, l as useIntlayerContext, y as useLoadDynamic, b as useLocale, x as useLocaleBase, i as useLocaleCookie, a as useLocaleStorage, T as useMarkdown, S as useRewriteURL };
13
+ export { D as HTMLProvider, O as HTMLRenderer, v as IntlayerClientContext, c as IntlayerProvider, l as IntlayerProviderContent, t as MarkdownProvider, r as MarkdownRenderer, e as compileMarkdown, T as getBrowserLocale, i as getDictionary, a as getIntlayer, y as localeCookie, b as localeInStorage, k as renderHTML, x as setLocaleCookie, S as setLocaleInStorage, s as t, g as useDictionary, p as useDictionaryAsync, o as useDictionaryDynamic, A as useHTMLRenderer, d as useIntl, u as useIntlayer, m as useIntlayerContext, E as useLoadDynamic, h as useLocale, f as useLocaleBase, C as useLocaleCookie, w as useLocaleStorage, n as useMarkdown, _ as useRewriteURL };
@@ -8,7 +8,6 @@ var i = n(), a = (n) => {
8
8
  preserveFrontmatter: r?.preserveFrontmatter ?? n.preserveFrontmatter,
9
9
  tagfilter: r?.tagfilter ?? n.tagfilter,
10
10
  wrapper: a || n.wrapper,
11
- forceWrapper: !!(a || n.wrapper),
12
11
  components: {
13
12
  ...n.components,
14
13
  ...i ?? {}
@@ -1,38 +1,29 @@
1
- import { useEditedContentRenderer as e } from "../editor/useEditedContentRenderer.mjs";
2
- import { compileMarkdown as t } from "./compiler.mjs";
3
- import { MarkdownContext as n, useMarkdown as r } from "./MarkdownProvider.mjs";
4
- import { getMarkdownMetadata as i } from "@intlayer/core/markdown";
5
- import { createMemo as a, useContext as o } from "solid-js";
6
- import { getContentNodeByKeyPath as s } from "@intlayer/core/dictionaryManipulator";
1
+ import { compileMarkdown as e } from "./compiler.mjs";
2
+ import { MarkdownContext as t, useMarkdown as n } from "./MarkdownProvider.mjs";
3
+ import { getMarkdownMetadata as r } from "@intlayer/core/markdown";
4
+ import { createMemo as i, useContext as a } from "solid-js";
5
+ import { getContentNodeByKeyPath as o } from "@intlayer/core/dictionaryManipulator";
7
6
  //#region src/markdown/MarkdownRenderer.tsx
8
- var c = (e, n = {}) => t(e, n), l = (e = {}) => {
9
- let t = o(n);
10
- return (n) => t ? t.renderMarkdown(n, {
7
+ var s = (t, n = {}) => e(t, n), c = (e = {}) => {
8
+ let n = a(t);
9
+ return (t) => n ? n.renderMarkdown(t, {
10
+ forceBlock: e.forceBlock,
11
+ preserveFrontmatter: e.preserveFrontmatter,
12
+ tagfilter: e.tagfilter
13
+ }, e.components, e.wrapper) : s(t, e);
14
+ }, l = (e) => {
15
+ let r = a(t), { renderMarkdown: i } = n();
16
+ return i(e.children, {
11
17
  forceBlock: e.forceBlock,
12
18
  preserveFrontmatter: e.preserveFrontmatter,
13
19
  tagfilter: e.tagfilter
14
- }, e.components, e.wrapper) : c(n, e);
15
- }, u = (t) => {
16
- let i = o(n), { renderMarkdown: s } = r(), c = a(() => e({
17
- dictionaryKey: t.dictionaryKey,
18
- keyPath: t.keyPath,
19
- children: t.children
20
- }));
21
- return s(typeof c() == "string" ? c() : t.children, {
22
- forceBlock: t.forceBlock,
23
- preserveFrontmatter: t.preserveFrontmatter,
24
- tagfilter: t.tagfilter
25
20
  }, {
26
- ...i?.components ?? {},
27
- ...t.components ?? {}
28
- }, t.wrapper);
29
- }, d = (t) => {
30
- let n = a(() => e({
31
- dictionaryKey: t.dictionaryKey,
32
- keyPath: t.keyPath,
33
- children: t.children
34
- })), r = a(() => i(n()));
35
- return a(() => s(r(), t.metadataKeyPath))();
21
+ ...r?.components ?? {},
22
+ ...e.components ?? {}
23
+ }, e.wrapper);
24
+ }, u = (e) => {
25
+ let t = i(() => r(e.children));
26
+ return i(() => o(t(), e.metadataKeyPath))();
36
27
  };
37
28
  //#endregion
38
- export { d as MarkdownMetadataRenderer, u as MarkdownRenderer, c as renderMarkdown, l as useMarkdownRenderer };
29
+ export { u as MarkdownMetadataRenderer, l as MarkdownRenderer, s as renderMarkdown, c as useMarkdownRenderer };
@@ -1,2 +1,145 @@
1
- import { a as e, c as t, i as n, n as r, o as i, r as a, s as o } from "../getDictionary-DKdSGWHu.mjs";
2
- export { r as getPlugins, a as htmlPlugin, n as insertionPlugin, e as intlayerNodePlugins, i as markdownPlugin, o as markdownStringPlugin, t as solidNodePlugins };
1
+ import { renderIntlayerNode as e } from "./IntlayerNode.mjs";
2
+ import { ContentSelector as t } from "./editor/ContentSelector.mjs";
3
+ import { MarkdownMetadataRenderer as n, MarkdownRenderer as r } from "./markdown/MarkdownRenderer.mjs";
4
+ import { renderSolidElement as i } from "./solidElement/renderSolidElement.mjs";
5
+ import { conditionPlugin as a, enumerationPlugin as o, filePlugin as s, genderPlugin as c, getHTML as l, nestedPlugin as u, splitInsertionTemplate as d, translationPlugin as f } from "@intlayer/core/interpreter";
6
+ import { Dynamic as p, createComponent as m, mergeProps as h } from "solid-js/web";
7
+ import g from "@intlayer/config/built";
8
+ import { getMarkdownMetadata as _ } from "@intlayer/core/markdown";
9
+ import { HTML_TAGS as v } from "@intlayer/core/transpiler";
10
+ import { NodeType as y } from "@intlayer/types/nodeType";
11
+ //#region src/plugins.tsx
12
+ var b = {
13
+ id: "intlayer-node-plugin",
14
+ canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
15
+ transform: (n, { plugins: r, ...i }) => e({
16
+ ...i,
17
+ value: i.children,
18
+ children: g?.editor.enabled ? m(t, h(i, { get children() {
19
+ return i.children;
20
+ } })) : i.children
21
+ })
22
+ }, x = {
23
+ id: "solid-node-plugin",
24
+ canHandle: (e) => typeof e == "object" && e?.props !== void 0 || typeof Node < "u" && e instanceof Node,
25
+ transform: (n, { plugins: r, ...a }) => e({
26
+ ...a,
27
+ value: "[[solid-element]]",
28
+ children: g?.editor.enabled ? m(t, h(a, { get children() {
29
+ return typeof Node < "u" && n instanceof Node ? n : i(n);
30
+ } })) : typeof Node < "u" && n instanceof Node ? n : i(n)
31
+ })
32
+ }, S = (e, t) => {
33
+ let n = d(e, t);
34
+ return n.isSimple, n.parts;
35
+ }, C = {
36
+ id: "insertion-plugin",
37
+ canHandle: (e) => typeof e == "object" && e?.nodeType === y.Insertion,
38
+ transform: (e, t, n) => {
39
+ let r = [...t.keyPath, { type: y.Insertion }], i = e[y.Insertion];
40
+ return (e) => {
41
+ let a = {
42
+ id: "insertion-string-plugin",
43
+ canHandle: (e) => typeof e == "string",
44
+ transform: (n, r, i) => {
45
+ let a = S(i(n, {
46
+ ...r,
47
+ children: n,
48
+ plugins: [...(t.plugins ?? []).filter((e) => e.id !== "intlayer-node-plugin")]
49
+ }), e);
50
+ return i(a, {
51
+ ...r,
52
+ plugins: t.plugins,
53
+ children: a
54
+ });
55
+ }
56
+ };
57
+ return n(i, {
58
+ ...t,
59
+ children: i,
60
+ keyPath: r,
61
+ plugins: [a, ...t.plugins ?? []]
62
+ });
63
+ };
64
+ }
65
+ }, w = {
66
+ id: "markdown-string-plugin",
67
+ canHandle: (e) => typeof e == "string",
68
+ transform: (i, a, o) => {
69
+ let { plugins: s, ...c } = a, l = o(_(i), {
70
+ plugins: [{
71
+ id: "markdown-metadata-plugin",
72
+ canHandle: (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || !e,
73
+ transform: (r, a) => e({
74
+ ...a,
75
+ value: r,
76
+ children: m(t, h(c, { get children() {
77
+ return m(n, h(c, {
78
+ get metadataKeyPath() {
79
+ return a.keyPath;
80
+ },
81
+ children: i
82
+ }));
83
+ } }))
84
+ })
85
+ }],
86
+ dictionaryKey: c.dictionaryKey,
87
+ keyPath: []
88
+ }), u = (n) => e({
89
+ ...a,
90
+ value: i,
91
+ children: m(t, h(c, { get children() {
92
+ return m(r, h(c, {
93
+ components: n,
94
+ children: i
95
+ }));
96
+ } })),
97
+ additionalProps: { metadata: l }
98
+ }), d = u();
99
+ return new Proxy(d, { get(e, t, n) {
100
+ return t === "value" ? i : t === "metadata" ? l : t === "use" ? (e) => u(e) : Reflect.get(e, t, n);
101
+ } });
102
+ }
103
+ }, T = {
104
+ id: "markdown-plugin",
105
+ canHandle: (e) => typeof e == "object" && e?.nodeType === y.Markdown,
106
+ transform: (e, t, n) => {
107
+ let r = [...t.keyPath, { type: y.Markdown }], i = e[y.Markdown];
108
+ return n(i, {
109
+ ...t,
110
+ children: i,
111
+ keyPath: r,
112
+ plugins: [w, ...t.plugins ?? []]
113
+ });
114
+ }
115
+ }, E = (() => {
116
+ let e = {};
117
+ for (let t of v) e[t] = ({ children: e, ...n }) => m(p, h({ component: t }, n, { children: e }));
118
+ return e;
119
+ })(), D = {
120
+ id: "html-plugin",
121
+ canHandle: (e) => typeof e == "object" && e?.nodeType === y.HTML,
122
+ transform: (e) => {
123
+ let t = e[y.HTML], n = (e) => l(t, {
124
+ ...E,
125
+ ...e
126
+ }), r = [n()];
127
+ return new Proxy(r, { get(e, r, i) {
128
+ return r === "value" ? t : r === "use" ? (e) => n(e) : Reflect.get(e, r, i);
129
+ } });
130
+ }
131
+ }, O = (e, t = !0) => [
132
+ f(e ?? g.internationalization.defaultLocale, t ? g.internationalization.defaultLocale : void 0),
133
+ o,
134
+ a,
135
+ u(e ?? g.internationalization.defaultLocale),
136
+ s,
137
+ c,
138
+ b,
139
+ x,
140
+ C,
141
+ T,
142
+ D
143
+ ];
144
+ //#endregion
145
+ export { O as getPlugins, D as htmlPlugin, C as insertionPlugin, b as intlayerNodePlugins, T as markdownPlugin, w as markdownStringPlugin, x as solidNodePlugins };
@@ -18,7 +18,6 @@ export type IntlayerProviderProps = ParentProps<{
18
18
  locale?: LocalesValues;
19
19
  defaultLocale?: LocalesValues;
20
20
  setLocale?: (locale: LocalesValues) => void;
21
- disableEditor?: boolean;
22
21
  isCookieEnabled?: boolean;
23
22
  }>;
24
23
  /**
@@ -3,7 +3,7 @@ import { StrictModeLocaleMap } from '@intlayer/types/module_augmentation';
3
3
  * On the client side, hook to get the translation content based on the locale
4
4
  */
5
5
  export declare const useContent: <Content>(languageContent: StrictModeLocaleMap<Content>) => {
6
- locale: import('intlayer').Locale;
6
+ locale: import('@intlayer/types/allLocales').Locale;
7
7
  content: Content;
8
8
  t: <Content_1 = string>(languageContent: StrictModeLocaleMap<Content_1>) => Content_1;
9
9
  };
@@ -5,4 +5,4 @@ import { DictionaryKeys, LocalesValues, StrictModeLocaleMap } from '@intlayer/ty
5
5
  *
6
6
  * If the locale is not provided, it will use the locale from the client context
7
7
  */
8
- export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is" | "is-IS" | "id" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ms" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi" | "mi-NZ" | "mr" | "mr-IN" | "mn" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA">>;
8
+ export declare const useDictionaryDynamic: <T extends Dictionary, K extends DictionaryKeys>(dictionaryPromise: StrictModeLocaleMap<() => Promise<T>>, key: K, locale?: LocalesValues) => import('solid-js').Accessor<import('@intlayer/core/interpreter').DeepTransformContent<T["content"], import('../plugins').IInterpreterPluginState, (string & {}) | "is" | "id" | "tr" | "th" | "hr" | "mi" | "mn" | "ms" | "af" | "af-ZA" | "sq" | "sq-AL" | "am" | "am-ET" | "ar" | "ar-DZ" | "ar-BH" | "ar-TD" | "ar-KM" | "ar-DJ" | "ar-EG" | "ar-IQ" | "ar-JO" | "ar-KW" | "ar-LB" | "ar-LY" | "ar-MR" | "ar-MA" | "ar-OM" | "ar-PS" | "ar-QA" | "ar-SA" | "ar-SO" | "ar-SD" | "ar-SY" | "ar-TN" | "ar-AE" | "ar-YE" | "hy" | "hy-AM" | "az" | "az-AZ" | "eu" | "eu-ES" | "be" | "be-BY" | "bn" | "bn-BD" | "bn-IN" | "bn-MM" | "bs" | "bs-BA" | "bg" | "bg-BG" | "my" | "my-MM" | "ca" | "ca-ES" | "zh" | "zh-HK" | "zh-MO" | "zh-Hans" | "zh-CN" | "zh-SG" | "zh-TW" | "zh-Hant" | "hr-BA" | "hr-HR" | "cs" | "cs-CZ" | "da" | "da-DK" | "dv" | "dv-MV" | "nl" | "nl-BE" | "nl-NL" | "en" | "en-AU" | "en-BZ" | "en-BW" | "en-CA" | "en-CB" | "en-GH" | "en-HK" | "en-IN" | "en-IE" | "en-JM" | "en-KE" | "en-MY" | "en-NZ" | "en-NG" | "en-PK" | "en-PH" | "en-SG" | "en-ZA" | "en-TZ" | "en-TT" | "en-UG" | "en-GB" | "en-US" | "en-ZW" | "eo" | "et" | "et-EE" | "fo" | "fo-FO" | "fa" | "fa-IR" | "fi" | "fi-FI" | "fr" | "fr-BE" | "fr-CA" | "fr-FR" | "fr-LU" | "fr-MC" | "fr-CH" | "mk" | "mk-MK" | "gl" | "gl-ES" | "ka" | "ka-GE" | "de" | "de-AT" | "de-DE" | "de-LI" | "de-LU" | "de-CH" | "el" | "el-GR" | "gu" | "gu-IN" | "he" | "he-IL" | "hi" | "hi-IN" | "hu" | "hu-HU" | "is-IS" | "id-ID" | "ga" | "ga-IE" | "it" | "it-IT" | "it-CH" | "ja" | "ja-JP" | "kn" | "kn-IN" | "kk" | "kk-KZ" | "km" | "km-KH" | "kok" | "kok-IN" | "ko" | "ko-KR" | "ku" | "ku-TR" | "ky" | "ky-KG" | "lo" | "lo-LA" | "lv" | "lv-LV" | "lt" | "lt-LT" | "dsb" | "dsb-DE" | "mg-MG" | "ml" | "ml-IN" | "ms-BN" | "ms-MY" | "mt" | "mt-MT" | "mi-NZ" | "mr" | "mr-IN" | "mn-MN" | "ne" | "ne-NP" | "ns" | "ns-ZA" | "no" | "nb" | "nb-NO" | "nn" | "nn-NO" | "ps" | "ps-AR" | "pl" | "pl-PL" | "pt" | "pt-BR" | "pt-CV" | "pt-GW" | "pt-MO" | "pt-MZ" | "pt-PT" | "pt-ST" | "pt-TL" | "pa" | "pa-IN" | "qu" | "qu-BO" | "qu-EC" | "qu-PE" | "ro" | "ro-MD" | "ro-RO" | "rm" | "rm-CH" | "ru" | "ru-MD" | "ru-RU" | "se" | "se-FI" | "se-NO" | "se-SE" | "sa" | "sa-IN" | "gd" | "gd-GB" | "sr-Cyrl" | "sr-BA" | "sr-RS" | "sr" | "sr-SP" | "si" | "si-LK" | "sk" | "sk-SK" | "sl" | "sl-SI" | "es" | "es-AR" | "es-BO" | "es-CL" | "es-CO" | "es-CR" | "es-CU" | "es-DO" | "es-EC" | "es-SV" | "es-GT" | "es-HN" | "es-MX" | "es-NI" | "es-PA" | "es-PY" | "es-PE" | "es-PR" | "es-ES" | "es-US" | "es-UY" | "es-VE" | "sw" | "sw-KE" | "sv" | "sv-FI" | "sv-SE" | "syr" | "syr-SY" | "tl" | "tl-PH" | "ta" | "ta-IN" | "tt" | "tt-RU" | "te" | "te-IN" | "th-TH" | "ts" | "tn" | "tn-ZA" | "tr-TR" | "uk" | "uk-UA" | "hsb" | "hsb-DE" | "ur" | "ur-PK" | "uz" | "uz-UZ" | "ve" | "ve-ZA" | "vi" | "vi-VN" | "cy" | "cy-GB" | "xh" | "xh-ZA" | "yi" | "yi-001" | "yo" | "yo-NG" | "zu" | "zu-ZA">>;
@@ -2,13 +2,13 @@ import { LocalesValues } from '@intlayer/types/module_augmentation';
2
2
  /**
3
3
  * Get the locale cookie
4
4
  */
5
- export declare const localeInStorage: import('intlayer').Locale | undefined;
5
+ export declare const localeInStorage: import('@intlayer/types/allLocales').Locale | undefined;
6
6
  /**
7
7
  * @deprecated Use localeInStorage instead
8
8
  *
9
9
  * Get the locale cookie
10
10
  */
11
- export declare const localeCookie: import('intlayer').Locale | undefined;
11
+ export declare const localeCookie: import('@intlayer/types/allLocales').Locale | undefined;
12
12
  /**
13
13
  * Set the locale cookie
14
14
  */
@@ -23,7 +23,7 @@ export declare const setLocaleCookie: (locale: LocalesValues, isCookieEnabled?:
23
23
  * Hook that provides the locale storage and a function to set it
24
24
  */
25
25
  export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('solid-js').Accessor<{
26
- getLocale: () => import('intlayer').Locale;
26
+ getLocale: () => import('@intlayer/types/allLocales').Locale;
27
27
  setLocale: (locale: LocalesValues) => void;
28
28
  }>;
29
29
  /**
@@ -34,6 +34,6 @@ export declare const useLocaleStorage: (isCookieEnabled?: boolean) => import('so
34
34
  * Hook that provides the locale cookie and a function to set it
35
35
  */
36
36
  export declare const useLocaleCookie: (isCookieEnabled?: boolean) => {
37
- localeCookie: import('intlayer').Locale;
37
+ localeCookie: import('@intlayer/types/allLocales').Locale;
38
38
  setLocaleCookie: (locale: LocalesValues) => void;
39
39
  };
@@ -0,0 +1,16 @@
1
+ import { NodeProps } from '@intlayer/core/interpreter';
2
+ import { Component, JSX } from 'solid-js';
3
+ declare module 'solid-js' {
4
+ namespace JSX {
5
+ interface IntrinsicElements {
6
+ 'intlayer-content-selector-wrapper': JSX.HTMLAttributes<HTMLElement> & {
7
+ 'key-path'?: string;
8
+ 'dictionary-key'?: string;
9
+ };
10
+ }
11
+ }
12
+ }
13
+ export type ContentSelectorWrapperProps = NodeProps & Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children'> & {
14
+ children?: JSX.Element;
15
+ };
16
+ export declare const ContentSelector: Component<ContentSelectorWrapperProps>;
@@ -0,0 +1,2 @@
1
+ import { Component, ParentProps } from 'solid-js';
2
+ export declare const EditorProvider: Component<ParentProps>;
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Initialises the Intlayer editor client singleton when the editor is enabled.
3
+ * Syncs the current locale from the Intlayer context into the editor manager so
4
+ * the editor always knows which locale the app is displaying.
5
+ */
6
+ export declare const useEditor: () => void;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "solid-intlayer",
3
- "version": "8.3.3",
3
+ "version": "8.4.0-canary.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -73,14 +73,13 @@
73
73
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
74
74
  },
75
75
  "dependencies": {
76
- "@intlayer/api": "8.3.3",
77
- "@intlayer/config": "8.3.3",
78
- "@intlayer/core": "8.3.3",
79
- "@intlayer/editor": "8.3.3",
80
- "@intlayer/types": "8.3.3"
76
+ "@intlayer/api": "8.4.0-canary.0",
77
+ "@intlayer/config": "8.4.0-canary.0",
78
+ "@intlayer/core": "8.4.0-canary.0",
79
+ "@intlayer/editor": "8.4.0-canary.0",
80
+ "@intlayer/types": "8.4.0-canary.0"
81
81
  },
82
82
  "devDependencies": {
83
- "@intlayer/unmerged-dictionaries-entry": "8.3.3",
84
83
  "@solidjs/testing-library": "0.8.10",
85
84
  "@testing-library/jest-dom": "6.9.1",
86
85
  "@testing-library/user-event": "14.6.1",
@@ -88,9 +87,9 @@
88
87
  "@utils/ts-config": "1.0.4",
89
88
  "@utils/ts-config-types": "1.0.4",
90
89
  "@utils/tsdown-config": "1.0.4",
91
- "jsdom": "28.1.0",
90
+ "jsdom": "29.0.0",
92
91
  "rimraf": "6.1.3",
93
- "tsdown": "0.21.2",
92
+ "tsdown": "0.21.4",
94
93
  "typescript": "5.9.3",
95
94
  "vite": "8.0.0",
96
95
  "vite-plugin-dts": "4.5.4",
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../getDictionary-DxYuk0_0.js`);exports.ContentSelectorRenderer=e.l;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../chunk-C91j1N6u.js`),t=require(`./contexts/DictionariesRecordContext.cjs`),n=require(`./contexts/EditorEnabledContext.cjs`),r=require(`./contexts/EditorProvider.cjs`),i=require(`./contexts/useCrossURLPathState.cjs`),a=require(`./contexts/useIframeClickInterceptor.cjs`);let o=require(`solid-js/web`),s=require(`@intlayer/config/built`);s=e.t(s);let c=require(`solid-js`);var l=()=>{i.useCrossURLPathSetter(),a.useIframeClickInterceptor();let{setLocaleDictionaries:e}=t.useDictionariesRecordActions()??{};return(0,c.onMount)(()=>{import(`@intlayer/unmerged-dictionaries-entry`).then(t=>{let n=t.getUnmergedDictionaries(),r=Object.fromEntries(Object.values(n).flat().map(e=>[e.localId,e]));e?.(r)})}),[]},{editor:u}=s.default,d=()=>{let{enabled:e}=n.useEditorEnabled();return e()?(0,o.createComponent)(l,{}):[]},f=e=>(0,o.createComponent)(r.EditorProvider,{postMessage:e=>{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))},get allowedOrigins(){return[u?.editorURL,u?.cmsURL,u?.applicationURL]},configuration:s.default,get children(){return[(0,o.createComponent)(d,{}),(0,o.memo)(()=>e.children)]}});exports.IntlayerEditorProvider=f;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../../chunk-C91j1N6u.js`);let t=require(`solid-js/web`),n=require(`@intlayer/config/built`);n=e.t(n);let r=require(`solid-js`);var i=()=>Math.random().toString(36).slice(2),{editor:a}=n.default,o=(0,r.createContext)({postMessage:()=>null,allowedOrigins:[a?.applicationURL,a?.editorURL,a?.cmsURL],senderId:``}),s=e=>{let n=i(),a=(0,r.createMemo)(()=>({postMessage:e.postMessage,allowedOrigins:e.allowedOrigins,senderId:n}));return(0,t.createComponent)(o.Provider,{get value(){return a()},get children(){return e.children}})},c=()=>(0,r.useContext)(o);exports.CommunicatorProvider=s,exports.useCommunicator=c;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./useCrossFrameState.cjs`);let t=require(`solid-js/web`),n=require(`solid-js`),r=require(`@intlayer/editor`);var i=(0,n.createContext)(void 0),a=()=>e.useCrossFrameState(r.MessageKey.INTLAYER_CONFIGURATION,void 0,{receive:!1,emit:!0}),o=e=>(0,t.createComponent)(i.Provider,{get value(){return e.configuration},get children(){return e.children}}),s=()=>(0,n.useContext)(i);exports.ConfigurationProvider=o,exports.useConfiguration=s,exports.useConfigurationState=a;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./useCrossFrameState.cjs`);let t=require(`solid-js/web`),n=require(`solid-js`),r=require(`@intlayer/editor`);var i=(0,n.createContext)(void 0),a=(0,n.createContext)(void 0),o=o=>{let[s,c]=e.useCrossFrameState(r.MessageKey.INTLAYER_LOCALE_DICTIONARIES_CHANGED,void 0),l=(0,n.createMemo)(()=>({localeDictionaries:s()??{}})),u=(0,n.createMemo)(()=>({setLocaleDictionaries:c,setLocaleDictionary:e=>{c(t=>({...t,[e.localId]:e}))}}));return(0,t.createComponent)(i.Provider,{get value(){return l()},get children(){return(0,t.createComponent)(a.Provider,{get value(){return u()},get children(){return o.children}})}})},s=()=>(0,n.useContext)(a),c=()=>{let e=s(),t=(0,n.useContext)(i);if(!t)throw Error(`useDictionariesRecordStates must be used within a DictionariesRecordProvider`);return{...t,...e}};exports.DictionariesRecordProvider=o,exports.useDictionariesRecord=c,exports.useDictionariesRecordActions=s;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./useCrossFrameMessageListener.cjs`),t=require(`./useCrossFrameState.cjs`),n=require(`./DictionariesRecordContext.cjs`);let r=require(`solid-js/web`),i=require(`@intlayer/types/nodeType`),a=require(`solid-js`),o=require(`@intlayer/editor`),s=require(`@intlayer/core/dictionaryManipulator`);var c=(0,a.createContext)(void 0),l=t=>e.useCrossFrameMessageListener(`${o.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED}/post`,t),u=t=>e.useCrossFrameMessageListener(`${o.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED}/get`,t),d=(0,a.createContext)(void 0),f=e=>{let{localeDictionaries:a}=n.useDictionariesRecord(),[l,u]=t.useCrossFrameState(o.MessageKey.INTLAYER_EDITED_CONTENT_CHANGED),f=e=>{if(typeof e==`function`)u(t=>{let n=t?.[Object.keys(t||{})[0]],r=e(n);return{...t,[r.key]:r}});else{let t=e;u(e=>({...e,[t.key]:t}))}},p=(e,t)=>{u(n=>({...n,[e]:{...n?.[e],content:t}}))},m=(e,t,n=[],r=!0)=>{u(i=>{let o=a[e]?.content,c=structuredClone(i?.[e]?.content??o),l=n;if(!r){let e=0,t=n.slice(0,-1),r=n[n.length-1],i=r.key;for(;(0,s.getContentNodeByKeyPath)(c,l)!==void 0;)e++,i=e===0?r.key:`${r.key} (${e})`,l=[...t,{...r,key:i}]}let u=(0,s.editDictionaryByKeyPath)(c,l,t);return{...i,[e]:{...i?.[e],content:u}}})},h=(e,t,n=[])=>{u(r=>{let i=a[e]?.content,o=(0,s.renameContentNodeByKeyPath)(structuredClone(r?.[e]?.content??i),t,n);return{...r,[e]:{...r?.[e],content:o}}})},g=(e,t)=>{u(n=>{let r=a[e]?.content,o=structuredClone(n?.[e]?.content??r),c=structuredClone(o),l=t.slice(0,-1),u=t[t.length-1]?.key;if(u){let e=(0,s.getContentNodeByKeyPath)(c,l.filter(e=>e.type!==i.NodeType.Translation));e&&typeof e==`object`&&u in e&&delete e[u]}return{...n,[e]:{...n?.[e],content:c}}})},_=e=>{u(t=>{let n={...t};return delete n[e],n})},v=e=>{u(t=>({...t,[e]:{...t?.[e],content:{}}}))},y=()=>{u({})},b=(e,t)=>{let n=l();if(!n)return;let r=t.filter(e=>e.type!==i.NodeType.Translation);if(e.includes(`:local:`)||e.includes(`:remote:`))return(0,s.getContentNodeByKeyPath)(n?.[e]?.content??{},r);let a=Object.keys(n).filter(t=>t.startsWith(`${e}:`));for(let e of a){let t=(0,s.getContentNodeByKeyPath)(n?.[e]?.content??{},r);if(t)return t}},x={editedContent:l()},S={setEditedContentState:u,setEditedDictionary:f,setEditedContent:p,addEditedContent:m,renameEditedContent:h,removeEditedContent:g,restoreEditedContent:_,clearEditedDictionaryContent:v,clearEditedContent:y,getEditedContentValue:b};return(0,r.createComponent)(c.Provider,{value:x,get children(){return(0,r.createComponent)(d.Provider,{value:S,get children(){return e.children}})}})},p=()=>(0,a.useContext)(d),m=()=>{let e=p(),t=(0,a.useContext)(c);if(!t)throw Error(`useEditedContent must be used within a EditedContentProvider`);return{...t,...e}};exports.EditedContentProvider=f,exports.useEditedContent=m,exports.useEditedContentActions=p,exports.useGetEditedContentState=u,exports.usePostEditedContentState=l;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./useCrossFrameMessageListener.cjs`),t=require(`./useCrossFrameState.cjs`);let n=require(`solid-js/web`),r=require(`solid-js`),i=require(`@intlayer/editor`);var a=(0,r.createContext)({enabled:()=>!1}),o=e=>t.useCrossFrameState(i.MessageKey.INTLAYER_EDITOR_ENABLED,!1,e),s=t=>e.useCrossFrameMessageListener(`${i.MessageKey.INTLAYER_EDITOR_ENABLED}/post`,t),c=t=>e.useCrossFrameMessageListener(`${i.MessageKey.INTLAYER_EDITOR_ENABLED}/get`,t),l=e=>{let[t]=o({emit:!1,receive:!0});return(0,n.createComponent)(a.Provider,{value:{enabled:t},get children(){return e.children}})},u=()=>(0,r.useContext)(a);exports.EditorEnabledProvider=l,exports.useEditorEnabled=u,exports.useEditorEnabledState=o,exports.useGetEditorEnabledState=c,exports.usePostEditorEnabledState=s;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./CommunicatorContext.cjs`),t=require(`./ConfigurationContext.cjs`),n=require(`./DictionariesRecordContext.cjs`),r=require(`./EditedContentContext.cjs`),i=require(`./EditorEnabledContext.cjs`),a=require(`./FocusDictionaryContext.cjs`);let o=require(`solid-js/web`),s=require(`solid-js`);var c=e=>{let t=r.useGetEditedContentState();return(0,s.createEffect)(()=>{t()}),(0,o.createComponent)(n.DictionariesRecordProvider,{get children(){return(0,o.createComponent)(r.EditedContentProvider,{get children(){return(0,o.createComponent)(a.FocusDictionaryProvider,{get children(){return e.children}})}})}})},l=e=>{let t=i.useGetEditorEnabledState(),{enabled:n}=i.useEditorEnabled();return(0,s.createEffect)(()=>{n()||t()}),(0,o.memo)(()=>(0,o.memo)(()=>!!n())()?e.children:e.fallback)},u=e=>{let[t,n]=(0,s.createSignal)(!1);return(0,s.createEffect)(()=>{n(window.self!==window.top)}),(0,o.memo)(()=>(0,o.memo)(()=>!!t())()?e.children:e.fallback)},d=n=>(0,o.createComponent)(i.EditorEnabledProvider,{get children(){return(0,o.createComponent)(t.ConfigurationProvider,{get configuration(){return n.configuration},get children(){return(0,o.createComponent)(u,{get fallback(){return n.children},get children(){return(0,o.createComponent)(e.CommunicatorProvider,{get postMessage(){return n.postMessage},get allowedOrigins(){return n.allowedOrigins},get children(){return(0,o.createComponent)(l,{get fallback(){return n.children},get children(){return(0,o.createComponent)(c,{get children(){return n.children}})}})}})}})}})}});exports.EditorProvider=d;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./useCrossFrameState.cjs`);let t=require(`solid-js/web`),n=require(`solid-js`),r=require(`@intlayer/editor`);var i=(0,n.createContext)(void 0),a=(0,n.createContext)(void 0),o=n=>{let[o,s]=e.useCrossFrameState(r.MessageKey.INTLAYER_FOCUSED_CONTENT_CHANGED,null),c=e=>{s(t=>t&&{...t,keyPath:e})};return(0,t.createComponent)(i.Provider,{get value(){return{focusedContent:o()}},get children(){return(0,t.createComponent)(a.Provider,{value:{setFocusedContent:s,setFocusedContentKeyPath:c},get children(){return n.children}})}})},s=()=>{let e=(0,n.useContext)(a);if(e===void 0)throw Error(`useFocusDictionaryActions must be used within a FocusDictionaryProvider`);return e},c=()=>{let e=s(),t=(0,n.useContext)(i);if(t===void 0)throw Error(`useFocusDictionaryState must be used within a FocusDictionaryProvider`);return{...t,...e}};exports.FocusDictionaryProvider=o,exports.useFocusDictionary=c,exports.useFocusDictionaryActions=s;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./useCrossFrameMessageListener.cjs`),t=require(`./useCrossFrameState.cjs`),n=require(`./ConfigurationContext.cjs`),r=require(`./DictionariesRecordContext.cjs`),i=require(`./EditedContentContext.cjs`),a=require(`./EditorEnabledContext.cjs`),o=require(`./FocusDictionaryContext.cjs`),s=require(`./EditorProvider.cjs`),c=require(`./useCrossURLPathState.cjs`),l=require(`./useIframeClickInterceptor.cjs`);exports.ConfigurationProvider=n.ConfigurationProvider,exports.DictionariesRecordProvider=r.DictionariesRecordProvider,exports.EditedContentProvider=i.EditedContentProvider,exports.EditorEnabledProvider=a.EditorEnabledProvider,exports.EditorProvider=s.EditorProvider,exports.FocusDictionaryProvider=o.FocusDictionaryProvider,exports.useConfiguration=n.useConfiguration,exports.useConfigurationState=n.useConfigurationState,exports.useCrossFrameMessageListener=e.useCrossFrameMessageListener,exports.useCrossFrameState=t.useCrossFrameState,exports.useCrossURLPathSetter=c.useCrossURLPathSetter,exports.useCrossURLPathState=c.useCrossURLPathState,exports.useDictionariesRecord=r.useDictionariesRecord,exports.useDictionariesRecordActions=r.useDictionariesRecordActions,exports.useEditedContent=i.useEditedContent,exports.useEditedContentActions=i.useEditedContentActions,exports.useEditorEnabled=a.useEditorEnabled,exports.useEditorEnabledState=a.useEditorEnabledState,exports.useFocusDictionary=o.useFocusDictionary,exports.useFocusDictionaryActions=o.useFocusDictionaryActions,exports.useGetEditedContentState=i.useGetEditedContentState,exports.useGetEditorEnabledState=a.useGetEditorEnabledState,exports.useIframeClickInterceptor=l.useIframeClickInterceptor,exports.useIframeClickMerger=l.useIframeClickMerger,exports.usePostEditedContentState=i.usePostEditedContentState,exports.usePostEditorEnabledState=a.usePostEditorEnabledState;var u=require(`@intlayer/editor`);Object.keys(u).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return u[e]}})});
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./CommunicatorContext.cjs`);let t=require(`solid-js`),n=require(`@intlayer/editor`);var r=(r,i)=>{let a=e.useCommunicator();if(!a)throw Error(`useCrossFrameMessageListener must be used within a CommunicatorProvider`);let{allowedOrigins:o,postMessage:s,senderId:c}=a;return(0,t.onMount)(()=>{if(i){let e=e=>{let{type:t,data:a,senderId:s}=e.data;t===r&&s!==c&&(o===void 0||o?.filter(e=>![null,void 0,``,`*`].includes(e)).some(t=>(0,n.compareUrls)(t,e.origin))||o?.includes(`*`))&&i(a)};window.addEventListener(`message`,e),(0,t.onCleanup)(()=>window.removeEventListener(`message`,e))}}),e=>{s({type:r,data:e,senderId:c})}};exports.useCrossFrameMessageListener=r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./CommunicatorContext.cjs`),t=require(`./useCrossFrameMessageListener.cjs`);let n=require(`solid-js`);var r=(r,i,a)=>{let{postMessage:o,senderId:s}=e.useCommunicator()??{},{emit:c,receive:l}=a??{emit:!0,receive:!0},[u,d]=(0,n.createSignal)(typeof i==`function`?i():i);return t.useCrossFrameMessageListener(`${r}/post`,l?e=>{d(()=>e)}:void 0),t.useCrossFrameMessageListener(`${r}/get`,c?(e,t)=>{c&&typeof o==`function`&&t!==s&&u()!==void 0&&o({type:`${r}/post`,data:u(),senderId:s})}:void 0),(0,n.createEffect)(()=>{l&&typeof o==`function`&&u()===void 0&&o({type:`${r}/get`,senderId:s})}),[u,e=>{d(t=>{let n=typeof e==`function`?e(t):e;return c&&typeof o==`function`&&n!==void 0&&o({type:`${r}/post`,data:n,senderId:s}),n})},()=>{typeof o==`function`&&o({type:`${r}/post`,data:u(),senderId:s})}]};exports.useCrossFrameState=r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./useCrossFrameState.cjs`);let t=require(`solid-js`),n=require(`@intlayer/editor`);var r=(t,r)=>e.useCrossFrameState(n.MessageKey.INTLAYER_URL_CHANGE,t,r),i=e=>{let n=r(e,{emit:!0,receive:!1}),[i,a]=n;return(0,t.onMount)(()=>{let e=history.pushState,n=history.replaceState,r=e=>function(...t){e.apply(this,t),window.dispatchEvent(new Event(`locationchange`))};history.pushState=r(e),history.replaceState=r(n);let i=()=>{a(window.location.pathname)};window.addEventListener(`locationchange`,i),window.addEventListener(`popstate`,i),window.addEventListener(`hashchange`,i),window.addEventListener(`load`,i),i(),(0,t.onCleanup)(()=>{window.removeEventListener(`locationchange`,i),window.removeEventListener(`popstate`,i),window.removeEventListener(`hashchange`,i),window.removeEventListener(`load`,i),history.pushState=e,history.replaceState=n})}),n};exports.useCrossURLPathSetter=i,exports.useCrossURLPathState=r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./useCrossFrameMessageListener.cjs`);let t=require(`solid-js`),n=require(`@intlayer/editor`);var r=()=>{let r=e.useCrossFrameMessageListener(n.MessageKey.INTLAYER_IFRAME_CLICKED);(0,t.onMount)(()=>{let e=e=>{r()};document.addEventListener(`mousedown`,e),(0,t.onCleanup)(()=>{document.removeEventListener(`mousedown`,e)})})},i=()=>e.useCrossFrameMessageListener(n.MessageKey.INTLAYER_IFRAME_CLICKED,n.mergeIframeClick);exports.useIframeClickInterceptor=r,exports.useIframeClickMerger=i;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../getDictionary-DxYuk0_0.js`);exports.ContentSelectorRenderer=e.l;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`./contexts/EditedContentContext.cjs`);let t=require(`@intlayer/core/interpreter`);var n=({dictionaryKey:t,keyPath:n,children:r})=>{let i=e.useEditedContentActions();return i?i.getEditedContentValue(t,n)??r:r},r=e=>{let r=n(e);if(typeof r==`object`){let n=(0,t.getContent)(r,e,e.locale);return typeof n==`string`?n:(console.error(`Incorrect edited content format. Content type: ${typeof n}. Expected string. Value ${JSON.stringify(n)}`),e.children)}return r};exports.EditedContentRenderer=r,exports.useEditedContentRenderer=n;
@@ -1,2 +0,0 @@
1
- import { l as e } from "../../getDictionary-DKdSGWHu.mjs";
2
- export { e as ContentSelectorRenderer };
@@ -1,39 +0,0 @@
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";
7
- import s from "@intlayer/config/built";
8
- import { onMount as c } from "solid-js";
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
- }
37
- });
38
- //#endregion
39
- export { f as IntlayerEditorProvider };
@@ -1,29 +0,0 @@
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 };