solid-intlayer 8.3.4 → 8.4.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 (107) 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/useDictionaryDynamic.d.ts +1 -1
  55. package/dist/types/editor/{ContentSelectorWrapper.d.ts → ContentSelector.d.ts} +4 -4
  56. package/dist/types/editor/EditorProvider.d.ts +2 -0
  57. package/dist/types/editor/useEditor.d.ts +6 -0
  58. package/package.json +7 -7
  59. package/dist/cjs/editor/ContentSelectorWrapper.cjs +0 -1
  60. package/dist/cjs/editor/IntlayerEditorProvider.cjs +0 -1
  61. package/dist/cjs/editor/contexts/CommunicatorContext.cjs +0 -1
  62. package/dist/cjs/editor/contexts/ConfigurationContext.cjs +0 -1
  63. package/dist/cjs/editor/contexts/DictionariesRecordContext.cjs +0 -1
  64. package/dist/cjs/editor/contexts/EditedContentContext.cjs +0 -1
  65. package/dist/cjs/editor/contexts/EditorEnabledContext.cjs +0 -1
  66. package/dist/cjs/editor/contexts/EditorProvider.cjs +0 -1
  67. package/dist/cjs/editor/contexts/FocusDictionaryContext.cjs +0 -1
  68. package/dist/cjs/editor/contexts/index.cjs +0 -1
  69. package/dist/cjs/editor/contexts/useCrossFrameMessageListener.cjs +0 -1
  70. package/dist/cjs/editor/contexts/useCrossFrameState.cjs +0 -1
  71. package/dist/cjs/editor/contexts/useCrossURLPathState.cjs +0 -1
  72. package/dist/cjs/editor/contexts/useIframeClickInterceptor.cjs +0 -1
  73. package/dist/cjs/editor/index.cjs +0 -1
  74. package/dist/cjs/editor/useEditedContentRenderer.cjs +0 -1
  75. package/dist/esm/editor/ContentSelectorWrapper.mjs +0 -2
  76. package/dist/esm/editor/IntlayerEditorProvider.mjs +0 -11
  77. package/dist/esm/editor/contexts/CommunicatorContext.mjs +0 -11
  78. package/dist/esm/editor/contexts/ConfigurationContext.mjs +0 -9
  79. package/dist/esm/editor/contexts/DictionariesRecordContext.mjs +0 -19
  80. package/dist/esm/editor/contexts/EditedContentContext.mjs +0 -30
  81. package/dist/esm/editor/contexts/EditorEnabledContext.mjs +0 -20
  82. package/dist/esm/editor/contexts/EditorProvider.mjs +0 -38
  83. package/dist/esm/editor/contexts/FocusDictionaryContext.mjs +0 -19
  84. package/dist/esm/editor/contexts/index.mjs +0 -13
  85. package/dist/esm/editor/contexts/useCrossFrameMessageListener.mjs +0 -9
  86. package/dist/esm/editor/contexts/useCrossFrameState.mjs +0 -25
  87. package/dist/esm/editor/contexts/useCrossURLPathState.mjs +0 -4
  88. package/dist/esm/editor/contexts/useIframeClickInterceptor.mjs +0 -10
  89. package/dist/esm/editor/index.mjs +0 -2
  90. package/dist/esm/editor/useEditedContentRenderer.mjs +0 -19
  91. package/dist/getDictionary-DdbGMGJZ.mjs +0 -197
  92. package/dist/getDictionary-PBgZNa_l.js +0 -1
  93. package/dist/types/editor/IntlayerEditorProvider.d.ts +0 -2
  94. package/dist/types/editor/contexts/CommunicatorContext.d.ts +0 -8
  95. package/dist/types/editor/contexts/ConfigurationContext.d.ts +0 -2
  96. package/dist/types/editor/contexts/DictionariesRecordContext.d.ts +0 -12
  97. package/dist/types/editor/contexts/EditedContentContext.d.ts +0 -30
  98. package/dist/types/editor/contexts/EditorEnabledContext.d.ts +0 -6
  99. package/dist/types/editor/contexts/EditorProvider.d.ts +0 -15
  100. package/dist/types/editor/contexts/FocusDictionaryContext.d.ts +0 -12
  101. package/dist/types/editor/contexts/index.d.ts +0 -12
  102. package/dist/types/editor/contexts/useCrossFrameMessageListener.d.ts +0 -2
  103. package/dist/types/editor/contexts/useCrossFrameState.d.ts +0 -7
  104. package/dist/types/editor/contexts/useCrossURLPathState.d.ts +0 -2
  105. package/dist/types/editor/contexts/useIframeClickInterceptor.d.ts +0 -2
  106. package/dist/types/editor/index.d.ts +0 -1
  107. 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-DdbGMGJZ.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-DdbGMGJZ.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
  /**
@@ -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">>;
@@ -3,9 +3,9 @@ import { Component, JSX } from 'solid-js';
3
3
  declare module 'solid-js' {
4
4
  namespace JSX {
5
5
  interface IntrinsicElements {
6
- 'intlayer-content-selector': JSX.HTMLAttributes<HTMLElement> & {
7
- 'is-selecting'?: boolean | undefined;
8
- 'press-duration'?: number;
6
+ 'intlayer-content-selector-wrapper': JSX.HTMLAttributes<HTMLElement> & {
7
+ 'key-path'?: string;
8
+ 'dictionary-key'?: string;
9
9
  };
10
10
  }
11
11
  }
@@ -13,4 +13,4 @@ declare module 'solid-js' {
13
13
  export type ContentSelectorWrapperProps = NodeProps & Omit<JSX.HTMLAttributes<HTMLDivElement>, 'children'> & {
14
14
  children?: JSX.Element;
15
15
  };
16
- export declare const ContentSelectorRenderer: Component<ContentSelectorWrapperProps>;
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.4",
3
+ "version": "8.4.0",
4
4
  "private": false,
5
5
  "description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
6
6
  "keywords": [
@@ -73,11 +73,11 @@
73
73
  "typecheck": "tsc --noEmit --project tsconfig.types.json"
74
74
  },
75
75
  "dependencies": {
76
- "@intlayer/api": "8.3.4",
77
- "@intlayer/config": "8.3.4",
78
- "@intlayer/core": "8.3.4",
79
- "@intlayer/editor": "8.3.4",
80
- "@intlayer/types": "8.3.4"
76
+ "@intlayer/api": "8.4.0",
77
+ "@intlayer/config": "8.4.0",
78
+ "@intlayer/core": "8.4.0",
79
+ "@intlayer/editor": "8.4.0",
80
+ "@intlayer/types": "8.4.0"
81
81
  },
82
82
  "devDependencies": {
83
83
  "@solidjs/testing-library": "0.8.10",
@@ -87,7 +87,7 @@
87
87
  "@utils/ts-config": "1.0.4",
88
88
  "@utils/ts-config-types": "1.0.4",
89
89
  "@utils/tsdown-config": "1.0.4",
90
- "jsdom": "28.1.0",
90
+ "jsdom": "29.0.0",
91
91
  "rimraf": "6.1.3",
92
92
  "tsdown": "0.21.4",
93
93
  "typescript": "5.9.3",
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../getDictionary-PBgZNa_l.js`);exports.ContentSelectorRenderer=e.l;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../chunk-C91j1N6u.js`);const e=require(`./contexts/EditorProvider.cjs`);let t=require(`solid-js/web`);var n=n=>(0,t.createComponent)(e.EditorProvider,{mode:`client`,get children(){return n.children}});exports.IntlayerEditorProvider=n;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./EditorProvider.cjs`);var t=()=>{let t=e.useEditorStateManager();return{postMessage:e=>t.messenger.send(e.type,e.data),senderId:t.messenger.senderId}};exports.useCommunicator=t;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./EditorProvider.cjs`);let t=require(`solid-js`);var n=()=>{let n=e.useEditorStateManager(),[r,i]=(0,t.createSignal)(n.configuration.value),a=e=>i(e.detail);return n.configuration.addEventListener(`change`,a),(0,t.onCleanup)(()=>n.configuration.removeEventListener(`change`,a)),r};exports.useConfiguration=n;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./EditorProvider.cjs`);let t=require(`solid-js`);var n=()=>{let n=e.useEditorStateManager(),[r,i]=(0,t.createSignal)(n.localeDictionaries.value??{}),a=e=>i(e.detail??{});return n.localeDictionaries.addEventListener(`change`,a),(0,t.onCleanup)(()=>n.localeDictionaries.removeEventListener(`change`,a)),{localeDictionaries:r,setLocaleDictionaries:e=>n.localeDictionaries.set(e),setLocaleDictionary:e=>n.setLocaleDictionary(e)}},r=()=>{let{setLocaleDictionaries:e,setLocaleDictionary:t}=n();return{setLocaleDictionaries:e,setLocaleDictionary:t}};exports.useDictionariesRecord=n,exports.useDictionariesRecordActions=r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./EditorProvider.cjs`);let t=require(`solid-js`);var n=()=>{let n=e.useEditorStateManager(),[r,i]=(0,t.createSignal)(n.editedContent.value),a=e=>i(e.detail);return n.editedContent.addEventListener(`change`,a),(0,t.onCleanup)(()=>n.editedContent.removeEventListener(`change`,a)),{editedContent:r,setEditedContentState:e=>n.editedContent.set(e),setEditedDictionary:e=>n.setEditedDictionary(e),setEditedContent:(e,t)=>n.setEditedContent(e,t),addEditedContent:(e,t,r,i)=>n.addContent(e,t,r,i),renameEditedContent:(e,t,r)=>n.renameContent(e,t,r),removeEditedContent:(e,t)=>n.removeContent(e,t),restoreEditedContent:e=>n.restoreContent(e),clearEditedDictionaryContent:e=>n.clearContent(e),clearEditedContent:()=>n.clearAllContent(),getEditedContentValue:(e,t)=>n.getContentValue(e,t)}},r=()=>{let{editedContent:e,...t}=n();return t},i=()=>{let t=e.useEditorStateManager();return()=>t.messenger.send(`INTLAYER_EDITED_CONTENT_CHANGED/get`)},a=()=>{let t=e.useEditorStateManager();return()=>t.editedContent.postCurrentValue()};exports.useEditedContent=n,exports.useEditedContentActions=r,exports.useGetEditedContentState=i,exports.usePostEditedContentState=a;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./EditorProvider.cjs`);let t=require(`solid-js`);var n=()=>{let n=e.useEditorStateManager(),[r,i]=(0,t.createSignal)(n.editorEnabled.value??!1),a=e=>i(e.detail);return n.editorEnabled.addEventListener(`change`,a),(0,t.onCleanup)(()=>n.editorEnabled.removeEventListener(`change`,a)),{enabled:r}},r=()=>{let{enabled:t}=n(),r=e.useEditorStateManager();return[t,e=>r.editorEnabled.set(e)]},i=()=>{let t=e.useEditorStateManager();return()=>{t.messenger.send(`INTLAYER_EDITOR_ENABLED/get`)}},a=()=>{let t=e.useEditorStateManager();return()=>t.editorEnabled.postCurrentValue()};exports.useEditorEnabled=n,exports.useEditorEnabledState=r,exports.useGetEditorEnabledState=i,exports.usePostEditorEnabledState=a;
@@ -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(`@intlayer/editor`),i=require(`solid-js`);var{editor:a}=n.default??{},o=()=>({allowedOrigins:[a?.applicationURL,a?.editorURL,a?.cmsURL].filter(Boolean),postMessageFn:(e,t)=>{typeof window>`u`||window.self!==window.top&&(window.parent?.postMessage(e,t),window.postMessage(e,t))}}),s=(0,i.createContext)(null),c=()=>{let e=(0,i.useContext)(s);if(!e)throw Error(`useEditorStateManager: no EditorProvider found`);return e},l=e=>{let a=e.postMessage||e.allowedOrigins?{allowedOrigins:e.allowedOrigins??[`*`],postMessageFn:e.postMessage?t=>e.postMessage(t):o().postMessageFn}:o(),c=new r.EditorStateManager({mode:e.mode??`client`,messenger:a,configuration:e.configuration??n.default});return(0,i.onMount)(()=>{(0,r.defineIntlayerElements)(),c.start()}),(0,i.onCleanup)(()=>c.stop()),(0,t.createComponent)(s.Provider,{value:c,get children(){return e.children}})};exports.EditorProvider=l,exports.useEditorStateManager=c;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./EditorProvider.cjs`);let t=require(`solid-js`);var n=()=>{let n=e.useEditorStateManager(),[r,i]=(0,t.createSignal)(n.focusedContent.value??null),a=e=>i(e.detail);return n.focusedContent.addEventListener(`change`,a),(0,t.onCleanup)(()=>n.focusedContent.removeEventListener(`change`,a)),{focusedContent:r,setFocusedContent:e=>n.focusedContent.set(e),setFocusedContentKeyPath:e=>n.setFocusedContentKeyPath(e)}},r=()=>{let{setFocusedContent:e,setFocusedContentKeyPath:t}=n();return{setFocusedContent:e,setFocusedContentKeyPath:t}};exports.useFocusDictionary=n,exports.useFocusDictionaryActions=r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`./EditorProvider.cjs`),t=require(`./CommunicatorContext.cjs`),n=require(`./ConfigurationContext.cjs`),r=require(`./DictionariesRecordContext.cjs`),i=require(`./EditedContentContext.cjs`),a=require(`./EditorEnabledContext.cjs`),o=require(`./FocusDictionaryContext.cjs`),s=require(`./useCrossFrameMessageListener.cjs`),c=require(`./useCrossFrameState.cjs`),l=require(`./useCrossURLPathState.cjs`),u=require(`./useIframeClickInterceptor.cjs`);exports.EditorProvider=e.EditorProvider,exports.useCommunicator=t.useCommunicator,exports.useConfiguration=n.useConfiguration,exports.useCrossFrameMessageListener=s.useCrossFrameMessageListener,exports.useCrossFrameState=c.useCrossFrameState,exports.useCrossURLPathSetter=l.useCrossURLPathSetter,exports.useCrossURLPathState=l.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.useEditorStateManager=e.useEditorStateManager,exports.useFocusDictionary=o.useFocusDictionary,exports.useFocusDictionaryActions=o.useFocusDictionaryActions,exports.useGetEditedContentState=i.useGetEditedContentState,exports.useGetEditorEnabledState=a.useGetEditorEnabledState,exports.useIframeClickInterceptor=u.useIframeClickInterceptor,exports.useIframeClickMerger=u.useIframeClickMerger,exports.usePostEditedContentState=i.usePostEditedContentState,exports.usePostEditorEnabledState=a.usePostEditorEnabledState;var d=require(`@intlayer/editor`);Object.keys(d).forEach(function(e){e!==`default`&&!Object.prototype.hasOwnProperty.call(exports,e)&&Object.defineProperty(exports,e,{enumerable:!0,get:function(){return d[e]}})});
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./EditorProvider.cjs`);let t=require(`solid-js`);var n=(n,r)=>{let i=e.useEditorStateManager();return r&&(0,t.onCleanup)(i.messenger.subscribe(n,r)),e=>i.messenger.send(n,e)};exports.useCrossFrameMessageListener=n;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./EditorProvider.cjs`);let t=require(`@intlayer/editor`),n=require(`solid-js`);var r=(r,i,a)=>{let o=e.useEditorStateManager(),{emit:s=!0,receive:c=!0}=a??{},l=new t.CrossFrameStateManager(r,o.messenger,{emit:s,receive:c,initialValue:i});l.start(),(0,n.onCleanup)(()=>l.stop());let[u,d]=(0,n.createSignal)(l.value,{equals:!1}),f=e=>{d(()=>e.detail)};return l.addEventListener(`change`,f),(0,n.onCleanup)(()=>l.removeEventListener(`change`,f)),[u,e=>{let t=typeof e==`function`?e(u()):e;l.set(t)},()=>l.postCurrentValue()]};exports.useCrossFrameState=r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=()=>{},t=()=>{};exports.useCrossURLPathSetter=e,exports.useCrossURLPathState=t;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`}),require(`../../../chunk-C91j1N6u.js`);const e=require(`./useCrossFrameMessageListener.cjs`);let t=require(`@intlayer/editor`);var n=()=>{e.useCrossFrameMessageListener(t.MessageKey.INTLAYER_IFRAME_CLICKED)},r=()=>{e.useCrossFrameMessageListener(t.MessageKey.INTLAYER_IFRAME_CLICKED,t.mergeIframeClick)};exports.useIframeClickInterceptor=n,exports.useIframeClickMerger=r;
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require(`../../getDictionary-PBgZNa_l.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,locale:e.locale},(0,t.getBasePlugins)(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-DdbGMGJZ.mjs";
2
- export { e as ContentSelectorRenderer };
@@ -1,11 +0,0 @@
1
- import { EditorProvider as e } from "./contexts/EditorProvider.mjs";
2
- import { createComponent as t } from "solid-js/web";
3
- //#region src/editor/IntlayerEditorProvider.tsx
4
- var n = (n) => t(e, {
5
- mode: "client",
6
- get children() {
7
- return n.children;
8
- }
9
- });
10
- //#endregion
11
- export { n as IntlayerEditorProvider };
@@ -1,11 +0,0 @@
1
- import { useEditorStateManager as e } from "./EditorProvider.mjs";
2
- //#region src/editor/contexts/CommunicatorContext.tsx
3
- var t = () => {
4
- let t = e();
5
- return {
6
- postMessage: (e) => t.messenger.send(e.type, e.data),
7
- senderId: t.messenger.senderId
8
- };
9
- };
10
- //#endregion
11
- export { t as useCommunicator };
@@ -1,9 +0,0 @@
1
- import { useEditorStateManager as e } from "./EditorProvider.mjs";
2
- import { createSignal as t, onCleanup as n } from "solid-js";
3
- //#region src/editor/contexts/ConfigurationContext.tsx
4
- var r = () => {
5
- let r = e(), [i, a] = t(r.configuration.value), o = (e) => a(e.detail);
6
- return r.configuration.addEventListener("change", o), n(() => r.configuration.removeEventListener("change", o)), i;
7
- };
8
- //#endregion
9
- export { r as useConfiguration };
@@ -1,19 +0,0 @@
1
- import { useEditorStateManager as e } from "./EditorProvider.mjs";
2
- import { createSignal as t, onCleanup as n } from "solid-js";
3
- //#region src/editor/contexts/DictionariesRecordContext.tsx
4
- var r = () => {
5
- let r = e(), [i, a] = t(r.localeDictionaries.value ?? {}), o = (e) => a(e.detail ?? {});
6
- return r.localeDictionaries.addEventListener("change", o), n(() => r.localeDictionaries.removeEventListener("change", o)), {
7
- localeDictionaries: i,
8
- setLocaleDictionaries: (e) => r.localeDictionaries.set(e),
9
- setLocaleDictionary: (e) => r.setLocaleDictionary(e)
10
- };
11
- }, i = () => {
12
- let { setLocaleDictionaries: e, setLocaleDictionary: t } = r();
13
- return {
14
- setLocaleDictionaries: e,
15
- setLocaleDictionary: t
16
- };
17
- };
18
- //#endregion
19
- export { r as useDictionariesRecord, i as useDictionariesRecordActions };
@@ -1,30 +0,0 @@
1
- import { useEditorStateManager as e } from "./EditorProvider.mjs";
2
- import { createSignal as t, onCleanup as n } from "solid-js";
3
- //#region src/editor/contexts/EditedContentContext.tsx
4
- var r = () => {
5
- let r = e(), [i, a] = t(r.editedContent.value), o = (e) => a(e.detail);
6
- return r.editedContent.addEventListener("change", o), n(() => r.editedContent.removeEventListener("change", o)), {
7
- editedContent: i,
8
- setEditedContentState: (e) => r.editedContent.set(e),
9
- setEditedDictionary: (e) => r.setEditedDictionary(e),
10
- setEditedContent: (e, t) => r.setEditedContent(e, t),
11
- addEditedContent: (e, t, n, i) => r.addContent(e, t, n, i),
12
- renameEditedContent: (e, t, n) => r.renameContent(e, t, n),
13
- removeEditedContent: (e, t) => r.removeContent(e, t),
14
- restoreEditedContent: (e) => r.restoreContent(e),
15
- clearEditedDictionaryContent: (e) => r.clearContent(e),
16
- clearEditedContent: () => r.clearAllContent(),
17
- getEditedContentValue: (e, t) => r.getContentValue(e, t)
18
- };
19
- }, i = () => {
20
- let { editedContent: e, ...t } = r();
21
- return t;
22
- }, a = () => {
23
- let t = e();
24
- return () => t.messenger.send("INTLAYER_EDITED_CONTENT_CHANGED/get");
25
- }, o = () => {
26
- let t = e();
27
- return () => t.editedContent.postCurrentValue();
28
- };
29
- //#endregion
30
- export { r as useEditedContent, i as useEditedContentActions, a as useGetEditedContentState, o as usePostEditedContentState };
@@ -1,20 +0,0 @@
1
- import { useEditorStateManager as e } from "./EditorProvider.mjs";
2
- import { createSignal as t, onCleanup as n } from "solid-js";
3
- //#region src/editor/contexts/EditorEnabledContext.tsx
4
- var r = () => {
5
- let r = e(), [i, a] = t(r.editorEnabled.value ?? !1), o = (e) => a(e.detail);
6
- return r.editorEnabled.addEventListener("change", o), n(() => r.editorEnabled.removeEventListener("change", o)), { enabled: i };
7
- }, i = () => {
8
- let { enabled: t } = r(), n = e();
9
- return [t, (e) => n.editorEnabled.set(e)];
10
- }, a = () => {
11
- let t = e();
12
- return () => {
13
- t.messenger.send("INTLAYER_EDITOR_ENABLED/get");
14
- };
15
- }, o = () => {
16
- let t = e();
17
- return () => t.editorEnabled.postCurrentValue();
18
- };
19
- //#endregion
20
- export { r as useEditorEnabled, i as useEditorEnabledState, a as useGetEditorEnabledState, o as usePostEditorEnabledState };
@@ -1,38 +0,0 @@
1
- import { createComponent as e } from "solid-js/web";
2
- import t from "@intlayer/config/built";
3
- import { EditorStateManager as n, defineIntlayerElements as r } from "@intlayer/editor";
4
- import { createContext as i, onCleanup as a, onMount as o, useContext as s } from "solid-js";
5
- //#region src/editor/contexts/EditorProvider.tsx
6
- var { editor: c } = t ?? {}, l = () => ({
7
- allowedOrigins: [
8
- c?.applicationURL,
9
- c?.editorURL,
10
- c?.cmsURL
11
- ].filter(Boolean),
12
- postMessageFn: (e, t) => {
13
- typeof window > "u" || window.self !== window.top && (window.parent?.postMessage(e, t), window.postMessage(e, t));
14
- }
15
- }), u = i(null), d = () => {
16
- let e = s(u);
17
- if (!e) throw Error("useEditorStateManager: no EditorProvider found");
18
- return e;
19
- }, f = (i) => {
20
- let s = i.postMessage || i.allowedOrigins ? {
21
- allowedOrigins: i.allowedOrigins ?? ["*"],
22
- postMessageFn: i.postMessage ? (e) => i.postMessage(e) : l().postMessageFn
23
- } : l(), c = new n({
24
- mode: i.mode ?? "client",
25
- messenger: s,
26
- configuration: i.configuration ?? t
27
- });
28
- return o(() => {
29
- r(), c.start();
30
- }), a(() => c.stop()), e(u.Provider, {
31
- value: c,
32
- get children() {
33
- return i.children;
34
- }
35
- });
36
- };
37
- //#endregion
38
- export { f as EditorProvider, d as useEditorStateManager };