solid-intlayer 8.1.2 → 8.1.3
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.
- package/dist/cjs/UI/ContentSelector.cjs +1 -1
- package/dist/cjs/client/IntlayerProvider.cjs +1 -1
- package/dist/cjs/client/format/useIntl.cjs +1 -1
- package/dist/cjs/client/getBrowserLocale.cjs +1 -1
- package/dist/cjs/client/t.cjs +1 -1
- package/dist/cjs/client/useLocaleStorage.cjs +1 -1
- package/dist/cjs/client/useRewriteURL.cjs +1 -1
- package/dist/cjs/client/useTraduction.cjs +1 -1
- package/dist/cjs/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/IntlayerEditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/CommunicatorContext.cjs +1 -1
- package/dist/cjs/editor/contexts/ConfigurationContext.cjs +1 -1
- package/dist/cjs/editor/contexts/DictionariesRecordContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditedContentContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditorEnabledContext.cjs +1 -1
- package/dist/cjs/editor/contexts/EditorProvider.cjs +1 -1
- package/dist/cjs/editor/contexts/FocusDictionaryContext.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/editor/useEditedContentRenderer.cjs +1 -1
- package/dist/cjs/getDictionary.cjs +1 -1
- package/dist/cjs/getIntlayer.cjs +1 -1
- package/dist/cjs/html/HTMLProvider.cjs +1 -1
- package/dist/cjs/html/HTMLRenderer.cjs +1 -1
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/markdown/MarkdownProvider.cjs +1 -1
- package/dist/cjs/markdown/MarkdownRenderer.cjs +1 -1
- package/dist/cjs/markdown/compiler.cjs +1 -1
- package/dist/cjs/markdown/runtime.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/cjs/solidElement/renderSolidElement.cjs +1 -1
- package/dist/esm/UI/ContentSelector.mjs +7 -7
- package/dist/esm/client/IntlayerProvider.mjs +7 -6
- package/dist/esm/client/format/useIntl.mjs +1 -1
- package/dist/esm/client/getBrowserLocale.mjs +1 -1
- package/dist/esm/client/t.mjs +1 -1
- package/dist/esm/client/useLocaleStorage.mjs +8 -7
- package/dist/esm/client/useRewriteURL.mjs +1 -1
- package/dist/esm/client/useTraduction.mjs +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.mjs +7 -3
- package/dist/esm/editor/IntlayerEditorProvider.mjs +5 -5
- package/dist/esm/editor/contexts/CommunicatorContext.mjs +13 -12
- package/dist/esm/editor/contexts/ConfigurationContext.mjs +9 -8
- package/dist/esm/editor/contexts/DictionariesRecordContext.mjs +12 -11
- package/dist/esm/editor/contexts/EditedContentContext.mjs +14 -13
- package/dist/esm/editor/contexts/EditorEnabledContext.mjs +10 -9
- package/dist/esm/editor/contexts/EditorProvider.mjs +6 -6
- package/dist/esm/editor/contexts/FocusDictionaryContext.mjs +14 -13
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/editor/useEditedContentRenderer.mjs +4 -3
- package/dist/esm/getDictionary.mjs +2 -2
- package/dist/esm/getIntlayer.mjs +2 -2
- package/dist/esm/html/HTMLProvider.mjs +5 -4
- package/dist/esm/html/HTMLRenderer.mjs +12 -11
- package/dist/esm/index.mjs +50 -49
- package/dist/esm/markdown/MarkdownProvider.mjs +29 -28
- package/dist/esm/markdown/MarkdownRenderer.mjs +18 -17
- package/dist/esm/markdown/compiler.mjs +1 -1
- package/dist/esm/markdown/runtime.mjs +7 -8
- package/dist/esm/plugins.mjs +11 -10
- package/dist/esm/solidElement/renderSolidElement.mjs +1 -1
- package/dist/{plugins-BKpuMxBh.mjs → plugins-BDLeP00w.mjs} +80 -75
- package/dist/plugins-BNX3Lsth.js +1 -0
- package/dist/types/IntlayerNode.d.ts +1 -1
- package/dist/types/client/useDictionaryAsync.d.ts +1 -1
- package/dist/types/client/useDictionaryDynamic.d.ts +1 -1
- package/dist/types/editor/ContentSelectorWrapper.d.ts +1 -1
- package/dist/types/getDictionary.d.ts +1 -1
- package/dist/types/getIntlayer.d.ts +1 -1
- package/dist/types/html/types.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/markdown/compiler.d.ts +1 -1
- package/dist/types/markdown/runtime.d.ts +1 -1
- package/dist/types/plugins.d.ts +4 -4
- package/package.json +7 -7
- package/dist/plugins-CR0xYCzd.js +0 -1
- package/dist/web-Ch-xTpJg.js +0 -1
- package/dist/web-mv0y5CK4.mjs +0 -567
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent as h } from "solid-js/web";
|
|
2
|
+
import { getContentNodeByKeyPath as f, renameContentNodeByKeyPath as j, editDictionaryByKeyPath as B } from "@intlayer/core/dictionaryManipulator";
|
|
2
3
|
import { MessageKey as m } from "@intlayer/editor";
|
|
3
|
-
import { NodeType as
|
|
4
|
-
import { createContext as g,
|
|
4
|
+
import { NodeType as T } from "@intlayer/types";
|
|
5
|
+
import { createContext as g, useContext as p } from "solid-js";
|
|
5
6
|
import { useDictionariesRecord as H } from "./DictionariesRecordContext.mjs";
|
|
6
7
|
import { useCrossFrameMessageListener as _ } from "./useCrossFrameMessageListener.mjs";
|
|
7
8
|
import { useCrossFrameState as W } from "./useCrossFrameState.mjs";
|
|
8
|
-
const x = g(void 0),
|
|
9
|
+
const x = g(void 0), U = (u) => _(`${m.INTLAYER_EDITED_CONTENT_CHANGED}/post`, u), X = (u) => _(`${m.INTLAYER_EDITED_CONTENT_CHANGED}/get`, u), A = g(void 0), Z = (u) => {
|
|
9
10
|
const {
|
|
10
11
|
localeDictionaries: a
|
|
11
12
|
} = H(), [N, c] = W(m.INTLAYER_EDITED_CONTENT_CHANGED), P = (t) => {
|
|
@@ -70,7 +71,7 @@ const x = g(void 0), Q = (u) => _(`${m.INTLAYER_EDITED_CONTENT_CHANGED}/post`, u
|
|
|
70
71
|
c((e) => {
|
|
71
72
|
const s = a[t]?.content, d = structuredClone(e?.[t]?.content ?? s), C = structuredClone(d), o = n.slice(0, -1), r = n[n.length - 1]?.key;
|
|
72
73
|
if (r) {
|
|
73
|
-
const i = f(C, o.filter((l) => l.type !==
|
|
74
|
+
const i = f(C, o.filter((l) => l.type !== T.Translation));
|
|
74
75
|
i && typeof i == "object" && r in i && delete i[r];
|
|
75
76
|
}
|
|
76
77
|
return {
|
|
@@ -101,7 +102,7 @@ const x = g(void 0), Q = (u) => _(`${m.INTLAYER_EDITED_CONTENT_CHANGED}/post`, u
|
|
|
101
102
|
}, y = (t, n) => {
|
|
102
103
|
const e = N();
|
|
103
104
|
if (!e) return;
|
|
104
|
-
const s = n.filter((o) => o.type !==
|
|
105
|
+
const s = n.filter((o) => o.type !== T.Translation);
|
|
105
106
|
if (t.includes(":local:") || t.includes(":remote:")) {
|
|
106
107
|
const o = e?.[t]?.content ?? {};
|
|
107
108
|
return f(o, s);
|
|
@@ -125,10 +126,10 @@ const x = g(void 0), Q = (u) => _(`${m.INTLAYER_EDITED_CONTENT_CHANGED}/post`, u
|
|
|
125
126
|
clearEditedContent: k,
|
|
126
127
|
getEditedContentValue: y
|
|
127
128
|
};
|
|
128
|
-
return
|
|
129
|
+
return h(x.Provider, {
|
|
129
130
|
value: F,
|
|
130
131
|
get children() {
|
|
131
|
-
return
|
|
132
|
+
return h(A.Provider, {
|
|
132
133
|
value: G,
|
|
133
134
|
get children() {
|
|
134
135
|
return u.children;
|
|
@@ -136,7 +137,7 @@ const x = g(void 0), Q = (u) => _(`${m.INTLAYER_EDITED_CONTENT_CHANGED}/post`, u
|
|
|
136
137
|
});
|
|
137
138
|
}
|
|
138
139
|
});
|
|
139
|
-
}, Y = () => p(A),
|
|
140
|
+
}, Y = () => p(A), K = () => {
|
|
140
141
|
const u = Y(), a = p(x);
|
|
141
142
|
if (!a)
|
|
142
143
|
throw new Error("useEditedContent must be used within a EditedContentProvider");
|
|
@@ -146,9 +147,9 @@ const x = g(void 0), Q = (u) => _(`${m.INTLAYER_EDITED_CONTENT_CHANGED}/post`, u
|
|
|
146
147
|
};
|
|
147
148
|
};
|
|
148
149
|
export {
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
Z as EditedContentProvider,
|
|
151
|
+
K as useEditedContent,
|
|
151
152
|
Y as useEditedContentActions,
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
X as useGetEditedContentState,
|
|
154
|
+
U as usePostEditedContentState
|
|
154
155
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
+
import { createComponent as n } from "solid-js/web";
|
|
1
2
|
import { MessageKey as t } from "@intlayer/editor";
|
|
2
|
-
import { createContext as
|
|
3
|
+
import { createContext as E, useContext as a } from "solid-js";
|
|
3
4
|
import { useCrossFrameMessageListener as r } from "./useCrossFrameMessageListener.mjs";
|
|
4
5
|
import { useCrossFrameState as d } from "./useCrossFrameState.mjs";
|
|
5
|
-
const o =
|
|
6
|
+
const o = E({
|
|
6
7
|
enabled: () => !1
|
|
7
|
-
}), i = (e) => d(t.INTLAYER_EDITOR_ENABLED, !1, e),
|
|
8
|
+
}), i = (e) => d(t.INTLAYER_EDITOR_ENABLED, !1, e), f = (e) => r(`${t.INTLAYER_EDITOR_ENABLED}/post`, e), p = (e) => r(`${t.INTLAYER_EDITOR_ENABLED}/get`, e), L = (e) => {
|
|
8
9
|
const [s] = i({
|
|
9
10
|
emit: !1,
|
|
10
11
|
receive: !0
|
|
11
12
|
});
|
|
12
|
-
return
|
|
13
|
+
return n(o.Provider, {
|
|
13
14
|
value: {
|
|
14
15
|
enabled: s
|
|
15
16
|
},
|
|
@@ -17,11 +18,11 @@ const o = n({
|
|
|
17
18
|
return e.children;
|
|
18
19
|
}
|
|
19
20
|
});
|
|
20
|
-
},
|
|
21
|
+
}, A = () => a(o);
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
23
|
+
L as EditorEnabledProvider,
|
|
24
|
+
A as useEditorEnabled,
|
|
24
25
|
i as useEditorEnabledState,
|
|
25
|
-
|
|
26
|
-
|
|
26
|
+
p as useGetEditorEnabledState,
|
|
27
|
+
f as usePostEditorEnabledState
|
|
27
28
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { createComponent as r, memo as i } from "solid-js/web";
|
|
2
|
+
import { createSignal as d, createEffect as o } from "solid-js";
|
|
3
3
|
import { CommunicatorProvider as c } from "./CommunicatorContext.mjs";
|
|
4
4
|
import { ConfigurationProvider as a } from "./ConfigurationContext.mjs";
|
|
5
5
|
import { DictionariesRecordProvider as l } from "./DictionariesRecordContext.mjs";
|
|
6
|
-
import { useGetEditedContentState as u, EditedContentProvider as
|
|
7
|
-
import { EditorEnabledProvider as
|
|
6
|
+
import { useGetEditedContentState as u, EditedContentProvider as g } from "./EditedContentContext.mjs";
|
|
7
|
+
import { EditorEnabledProvider as m, useGetEditorEnabledState as f, useEditorEnabled as s } from "./EditorEnabledContext.mjs";
|
|
8
8
|
import { FocusDictionaryProvider as h } from "./FocusDictionaryContext.mjs";
|
|
9
9
|
const E = (e) => {
|
|
10
10
|
const t = u();
|
|
@@ -12,7 +12,7 @@ const E = (e) => {
|
|
|
12
12
|
t();
|
|
13
13
|
}), r(l, {
|
|
14
14
|
get children() {
|
|
15
|
-
return r(
|
|
15
|
+
return r(g, {
|
|
16
16
|
get children() {
|
|
17
17
|
return r(h, {
|
|
18
18
|
get children() {
|
|
@@ -35,7 +35,7 @@ const E = (e) => {
|
|
|
35
35
|
return o(() => {
|
|
36
36
|
n(window.self !== window.top);
|
|
37
37
|
}), i(() => i(() => !!t())() ? e.children : e.fallback);
|
|
38
|
-
}, G = (e) => r(
|
|
38
|
+
}, G = (e) => r(m, {
|
|
39
39
|
get children() {
|
|
40
40
|
return r(a, {
|
|
41
41
|
get configuration() {
|
|
@@ -1,23 +1,24 @@
|
|
|
1
|
+
import { createComponent as n } from "solid-js/web";
|
|
1
2
|
import { MessageKey as C } from "@intlayer/editor";
|
|
2
|
-
import { createContext as i,
|
|
3
|
+
import { createContext as i, useContext as s } from "solid-js";
|
|
3
4
|
import { useCrossFrameState as F } from "./useCrossFrameState.mjs";
|
|
4
|
-
const c = i(void 0), u = i(void 0),
|
|
5
|
-
const [o,
|
|
6
|
-
|
|
5
|
+
const c = i(void 0), u = i(void 0), h = (t) => {
|
|
6
|
+
const [o, r] = F(C.INTLAYER_FOCUSED_CONTENT_CHANGED, null), a = (d) => {
|
|
7
|
+
r((e) => e && {
|
|
7
8
|
...e,
|
|
8
9
|
keyPath: d
|
|
9
10
|
});
|
|
10
11
|
};
|
|
11
|
-
return
|
|
12
|
+
return n(c.Provider, {
|
|
12
13
|
get value() {
|
|
13
14
|
return {
|
|
14
15
|
focusedContent: o()
|
|
15
16
|
};
|
|
16
17
|
},
|
|
17
18
|
get children() {
|
|
18
|
-
return
|
|
19
|
+
return n(u.Provider, {
|
|
19
20
|
value: {
|
|
20
|
-
setFocusedContent:
|
|
21
|
+
setFocusedContent: r,
|
|
21
22
|
setFocusedContentKeyPath: a
|
|
22
23
|
},
|
|
23
24
|
get children() {
|
|
@@ -26,13 +27,13 @@ const c = i(void 0), u = i(void 0), f = (t) => {
|
|
|
26
27
|
});
|
|
27
28
|
}
|
|
28
29
|
});
|
|
29
|
-
},
|
|
30
|
+
}, m = () => {
|
|
30
31
|
const t = s(u);
|
|
31
32
|
if (t === void 0)
|
|
32
33
|
throw new Error("useFocusDictionaryActions must be used within a FocusDictionaryProvider");
|
|
33
34
|
return t;
|
|
34
|
-
},
|
|
35
|
-
const t =
|
|
35
|
+
}, x = () => {
|
|
36
|
+
const t = m(), o = s(c);
|
|
36
37
|
if (o === void 0)
|
|
37
38
|
throw new Error("useFocusDictionaryState must be used within a FocusDictionaryProvider");
|
|
38
39
|
return {
|
|
@@ -41,7 +42,7 @@ const c = i(void 0), u = i(void 0), f = (t) => {
|
|
|
41
42
|
};
|
|
42
43
|
};
|
|
43
44
|
export {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
45
|
+
h as FocusDictionaryProvider,
|
|
46
|
+
x as useFocusDictionary,
|
|
47
|
+
m as useFocusDictionaryActions
|
|
47
48
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { getContent as r } from "@intlayer/core";
|
|
1
|
+
import { getContent as r } from "@intlayer/core/interpreter";
|
|
2
2
|
import "@intlayer/editor";
|
|
3
3
|
import "./contexts/ConfigurationContext.mjs";
|
|
4
4
|
import "./contexts/DictionariesRecordContext.mjs";
|
|
5
5
|
import { useEditedContentActions as i } from "./contexts/EditedContentContext.mjs";
|
|
6
6
|
import "./contexts/EditorEnabledContext.mjs";
|
|
7
|
+
import "solid-js/web";
|
|
7
8
|
import "solid-js";
|
|
8
9
|
import "./contexts/CommunicatorContext.mjs";
|
|
9
10
|
import "./contexts/FocusDictionaryContext.mjs";
|
|
@@ -14,7 +15,7 @@ const d = ({
|
|
|
14
15
|
}) => {
|
|
15
16
|
const o = i();
|
|
16
17
|
return o ? o.getEditedContentValue(e, n) ?? t : t;
|
|
17
|
-
},
|
|
18
|
+
}, V = (e) => {
|
|
18
19
|
const n = d(e);
|
|
19
20
|
if (typeof n == "object") {
|
|
20
21
|
const t = r(n, e, e.locale);
|
|
@@ -23,6 +24,6 @@ const d = ({
|
|
|
23
24
|
return n;
|
|
24
25
|
};
|
|
25
26
|
export {
|
|
26
|
-
|
|
27
|
+
V as EditedContentRenderer,
|
|
27
28
|
d as useEditedContentRenderer
|
|
28
29
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getDictionary as s } from "@intlayer/core";
|
|
2
|
-
import { i as r, s as a, a as e, m as g, h as l } from "../plugins-
|
|
1
|
+
import { getDictionary as s } from "@intlayer/core/interpreter";
|
|
2
|
+
import { i as r, s as a, a as e, m as g, h as l } from "../plugins-BDLeP00w.mjs";
|
|
3
3
|
const c = (i, n, o) => {
|
|
4
4
|
const t = [
|
|
5
5
|
r,
|
package/dist/esm/getIntlayer.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getIntlayer as r } from "@intlayer/core";
|
|
2
|
-
import { i as a, s as e, a as l, m as o, h as g } from "../plugins-
|
|
1
|
+
import { getIntlayer as r } from "@intlayer/core/interpreter";
|
|
2
|
+
import { i as a, s as e, a as l, m as o, h as g } from "../plugins-BDLeP00w.mjs";
|
|
3
3
|
const P = (n, t, s) => {
|
|
4
4
|
const i = [
|
|
5
5
|
a,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { createComponent as o } from "solid-js/web";
|
|
2
|
+
import { createContext as n, useContext as r } from "solid-js";
|
|
3
|
+
const t = n(), i = () => r(t), s = (e) => o(t.Provider, {
|
|
3
4
|
get value() {
|
|
4
5
|
return {
|
|
5
6
|
components: e.components
|
|
@@ -10,6 +11,6 @@ const t = n(), s = () => r(t), u = (e) => o(t.Provider, {
|
|
|
10
11
|
}
|
|
11
12
|
});
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
s as HTMLProvider,
|
|
15
|
+
i as useHTMLContext
|
|
15
16
|
};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
1
|
+
import { memo as c, createComponent as m, Dynamic as s, mergeProps as i } from "solid-js/web";
|
|
2
|
+
import { getHTML as d } from "@intlayer/core/interpreter";
|
|
3
|
+
import { HTML_TAGS as a } from "@intlayer/core/transpiler";
|
|
4
|
+
import { createMemo as f } from "solid-js";
|
|
5
|
+
import { useEditedContentRenderer as u } from "../editor/useEditedContentRenderer.mjs";
|
|
6
|
+
import { useHTMLContext as y } from "./HTMLProvider.mjs";
|
|
6
7
|
const T = () => {
|
|
7
8
|
const e = {};
|
|
8
|
-
for (const t of
|
|
9
|
+
for (const t of a)
|
|
9
10
|
e[t] = ({
|
|
10
11
|
children: n,
|
|
11
12
|
...o
|
|
12
|
-
}) =>
|
|
13
|
+
}) => m(s, i({
|
|
13
14
|
component: t
|
|
14
15
|
}, o, {
|
|
15
16
|
children: n
|
|
@@ -26,17 +27,17 @@ const T = () => {
|
|
|
26
27
|
}, H = ({
|
|
27
28
|
components: e
|
|
28
29
|
} = {}) => {
|
|
29
|
-
const t =
|
|
30
|
+
const t = y();
|
|
30
31
|
return (n) => M(n, {
|
|
31
32
|
components: {
|
|
32
33
|
...t?.components,
|
|
33
34
|
...e
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
|
-
},
|
|
37
|
+
}, P = (e) => {
|
|
37
38
|
const t = H({
|
|
38
39
|
components: e.components || e.userComponents
|
|
39
|
-
}), n = () => e.children || e.html || "", o =
|
|
40
|
+
}), n = () => e.children || e.html || "", o = f(() => u({
|
|
40
41
|
dictionaryKey: e.dictionaryKey,
|
|
41
42
|
keyPath: e.keyPath,
|
|
42
43
|
children: n()
|
|
@@ -44,7 +45,7 @@ const T = () => {
|
|
|
44
45
|
return c(() => t(r()));
|
|
45
46
|
};
|
|
46
47
|
export {
|
|
47
|
-
|
|
48
|
+
P as HTMLRenderer,
|
|
48
49
|
C as defaultHTMLComponents,
|
|
49
50
|
M as renderHTML,
|
|
50
51
|
H as useHTMLRenderer
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import { useIntl as
|
|
2
|
-
import { getBrowserLocale as
|
|
3
|
-
import { IntlayerClientContext as
|
|
4
|
-
import { t as
|
|
5
|
-
import { useDictionary as
|
|
6
|
-
import { useDictionaryAsync as
|
|
7
|
-
import { useDictionaryDynamic as
|
|
8
|
-
import { useIntlayer as
|
|
9
|
-
import { useLoadDynamic as
|
|
10
|
-
import { useLocale as
|
|
11
|
-
import { useLocaleBase as
|
|
12
|
-
import { localeCookie as
|
|
13
|
-
import { useRewriteURL as
|
|
14
|
-
import { getDictionary as
|
|
15
|
-
import { getIntlayer as
|
|
16
|
-
import { HTMLProvider as
|
|
17
|
-
import { HTMLRenderer as
|
|
18
|
-
import { compileMarkdown as
|
|
19
|
-
import { MarkdownProvider as
|
|
20
|
-
import { MarkdownRenderer as
|
|
1
|
+
import { useIntl as t } from "./client/format/useIntl.mjs";
|
|
2
|
+
import { getBrowserLocale as n } from "./client/getBrowserLocale.mjs";
|
|
3
|
+
import { IntlayerClientContext as p, IntlayerProvider as x, IntlayerProviderContent as i, useIntlayerContext as f } from "./client/IntlayerProvider.mjs";
|
|
4
|
+
import { t as s } from "./client/t.mjs";
|
|
5
|
+
import { useDictionary as u } from "./client/useDictionary.mjs";
|
|
6
|
+
import { useDictionaryAsync as y } from "./client/useDictionaryAsync.mjs";
|
|
7
|
+
import { useDictionaryDynamic as I } from "./client/useDictionaryDynamic.mjs";
|
|
8
|
+
import { useIntlayer as k } from "./client/useIntlayer.mjs";
|
|
9
|
+
import { useLoadDynamic as g } from "./client/useLoadDynamic.mjs";
|
|
10
|
+
import { useLocale as D } from "./client/useLocale.mjs";
|
|
11
|
+
import { useLocaleBase as v } from "./client/useLocaleBase.mjs";
|
|
12
|
+
import { localeCookie as P, localeInStorage as T, setLocaleCookie as S, setLocaleInStorage as B, useLocaleCookie as A, useLocaleStorage as U } from "./client/useLocaleStorage.mjs";
|
|
13
|
+
import { useRewriteURL as h } from "./client/useRewriteURL.mjs";
|
|
14
|
+
import { getDictionary as q } from "./getDictionary.mjs";
|
|
15
|
+
import { getIntlayer as E } from "./getIntlayer.mjs";
|
|
16
|
+
import { HTMLProvider as G } from "./html/HTMLProvider.mjs";
|
|
17
|
+
import { HTMLRenderer as K, renderHTML as N, useHTMLRenderer as O } from "./html/HTMLRenderer.mjs";
|
|
18
|
+
import { compileMarkdown as V } from "./markdown/compiler.mjs";
|
|
19
|
+
import { MarkdownProvider as X, useMarkdown as Y } from "./markdown/MarkdownProvider.mjs";
|
|
20
|
+
import { MarkdownRenderer as _ } from "./markdown/MarkdownRenderer.mjs";
|
|
21
|
+
import "solid-js/web";
|
|
21
22
|
export {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
G as HTMLProvider,
|
|
24
|
+
K as HTMLRenderer,
|
|
25
|
+
p as IntlayerClientContext,
|
|
25
26
|
x as IntlayerProvider,
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
27
|
+
i as IntlayerProviderContent,
|
|
28
|
+
X as MarkdownProvider,
|
|
29
|
+
_ as MarkdownRenderer,
|
|
30
|
+
V as compileMarkdown,
|
|
31
|
+
n as getBrowserLocale,
|
|
32
|
+
q as getDictionary,
|
|
33
|
+
E as getIntlayer,
|
|
34
|
+
P as localeCookie,
|
|
35
|
+
T as localeInStorage,
|
|
36
|
+
N as renderHTML,
|
|
37
|
+
S as setLocaleCookie,
|
|
38
|
+
B as setLocaleInStorage,
|
|
39
|
+
s as t,
|
|
40
|
+
u as useDictionary,
|
|
41
|
+
y as useDictionaryAsync,
|
|
42
|
+
I as useDictionaryDynamic,
|
|
43
|
+
O as useHTMLRenderer,
|
|
44
|
+
t as useIntl,
|
|
45
|
+
k as useIntlayer,
|
|
45
46
|
f as useIntlayerContext,
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
g as useLoadDynamic,
|
|
48
|
+
D as useLocale,
|
|
49
|
+
v as useLocaleBase,
|
|
50
|
+
A as useLocaleCookie,
|
|
51
|
+
U as useLocaleStorage,
|
|
52
|
+
Y as useMarkdown,
|
|
53
|
+
h as useRewriteURL
|
|
53
54
|
};
|
|
@@ -1,46 +1,47 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createComponent as k } from "solid-js/web";
|
|
2
|
+
import { createContext as s, useContext as u } from "solid-js";
|
|
2
3
|
import { compileMarkdown as M } from "./compiler.mjs";
|
|
3
|
-
const
|
|
4
|
-
const
|
|
5
|
-
if (
|
|
6
|
-
return
|
|
7
|
-
const a =
|
|
4
|
+
const o = s(), x = (r) => {
|
|
5
|
+
const n = (e, t) => {
|
|
6
|
+
if (r.renderMarkdown)
|
|
7
|
+
return r.renderMarkdown(e, t);
|
|
8
|
+
const a = t && typeof t == "object" && ("components" in t || "wrapper" in t || "forceBlock" in t || "preserveFrontmatter" in t || "tagfilter" in t), {
|
|
8
9
|
components: c,
|
|
9
|
-
wrapper:
|
|
10
|
-
forceBlock:
|
|
10
|
+
wrapper: m,
|
|
11
|
+
forceBlock: l,
|
|
11
12
|
preserveFrontmatter: i,
|
|
12
13
|
tagfilter: w,
|
|
13
14
|
...p
|
|
14
|
-
} = a ?
|
|
15
|
-
components:
|
|
16
|
-
},
|
|
17
|
-
forceBlock:
|
|
18
|
-
preserveFrontmatter: i ??
|
|
19
|
-
tagfilter: w ??
|
|
20
|
-
wrapper:
|
|
15
|
+
} = a ? t : {
|
|
16
|
+
components: t
|
|
17
|
+
}, f = c || p, d = {
|
|
18
|
+
forceBlock: l ?? r.forceBlock,
|
|
19
|
+
preserveFrontmatter: i ?? r.preserveFrontmatter,
|
|
20
|
+
tagfilter: w ?? r.tagfilter,
|
|
21
|
+
wrapper: m || r.wrapper,
|
|
21
22
|
components: {
|
|
22
|
-
...
|
|
23
|
-
...
|
|
23
|
+
...r.components,
|
|
24
|
+
...f
|
|
24
25
|
}
|
|
25
26
|
};
|
|
26
|
-
return M(
|
|
27
|
+
return M(e, d);
|
|
27
28
|
};
|
|
28
|
-
return
|
|
29
|
+
return k(o.Provider, {
|
|
29
30
|
value: {
|
|
30
|
-
renderMarkdown:
|
|
31
|
+
renderMarkdown: n
|
|
31
32
|
},
|
|
32
33
|
get children() {
|
|
33
|
-
return
|
|
34
|
+
return r.children;
|
|
34
35
|
}
|
|
35
36
|
});
|
|
36
|
-
},
|
|
37
|
-
const
|
|
38
|
-
if (!
|
|
37
|
+
}, C = () => {
|
|
38
|
+
const r = u(o);
|
|
39
|
+
if (!r)
|
|
39
40
|
throw new Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");
|
|
40
|
-
return
|
|
41
|
+
return r;
|
|
41
42
|
};
|
|
42
43
|
export {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
o as MarkdownContext,
|
|
45
|
+
x as MarkdownProvider,
|
|
46
|
+
C as useMarkdown
|
|
46
47
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getContentNodeByKeyPath as M } from "@intlayer/core/dictionaryManipulator";
|
|
2
|
+
import { getMarkdownMetadata as h } from "@intlayer/core/markdown";
|
|
2
3
|
import { createMemo as n, useContext as l } from "solid-js";
|
|
3
4
|
import { useEditedContentRenderer as a } from "../editor/useEditedContentRenderer.mjs";
|
|
4
5
|
import { compileMarkdown as s } from "./compiler.mjs";
|
|
5
|
-
import { useMarkdown as w, MarkdownContext as
|
|
6
|
-
const
|
|
7
|
-
const t = l(
|
|
8
|
-
return (r) => t ? t.renderMarkdown(r, e) :
|
|
9
|
-
},
|
|
6
|
+
import { useMarkdown as w, MarkdownContext as f } from "./MarkdownProvider.mjs";
|
|
7
|
+
const u = (e, t = {}) => s(e, t), N = (e = {}) => {
|
|
8
|
+
const t = l(f);
|
|
9
|
+
return (r) => t ? t.renderMarkdown(r, e) : u(r, e);
|
|
10
|
+
}, T = (e) => {
|
|
10
11
|
const {
|
|
11
12
|
renderMarkdown: t
|
|
12
13
|
} = w(), r = n(() => a({
|
|
@@ -21,29 +22,29 @@ const f = (e, t = {}) => s(e, t), F = (e = {}) => {
|
|
|
21
22
|
components: d,
|
|
22
23
|
wrapper: c,
|
|
23
24
|
forceBlock: i,
|
|
24
|
-
preserveFrontmatter:
|
|
25
|
-
tagfilter:
|
|
25
|
+
preserveFrontmatter: m,
|
|
26
|
+
tagfilter: y,
|
|
26
27
|
...k
|
|
27
28
|
} = e;
|
|
28
29
|
return t(o(), {
|
|
29
30
|
components: d,
|
|
30
31
|
wrapper: c,
|
|
31
32
|
forceBlock: i,
|
|
32
|
-
preserveFrontmatter:
|
|
33
|
-
tagfilter:
|
|
33
|
+
preserveFrontmatter: m,
|
|
34
|
+
tagfilter: y,
|
|
34
35
|
...k
|
|
35
36
|
});
|
|
36
|
-
},
|
|
37
|
+
}, b = (e) => {
|
|
37
38
|
const t = n(() => a({
|
|
38
39
|
dictionaryKey: e.dictionaryKey,
|
|
39
40
|
keyPath: e.keyPath,
|
|
40
41
|
children: e.children
|
|
41
|
-
})), r = n(() =>
|
|
42
|
-
return n(() =>
|
|
42
|
+
})), r = n(() => h(t()));
|
|
43
|
+
return n(() => M(r(), e.metadataKeyPath))();
|
|
43
44
|
};
|
|
44
45
|
export {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
b as MarkdownMetadataRenderer,
|
|
47
|
+
T as MarkdownRenderer,
|
|
48
|
+
u as renderMarkdown,
|
|
49
|
+
N as useMarkdownRenderer
|
|
49
50
|
};
|
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { createComponent as a } from "solid-js";
|
|
1
|
+
import { createComponent as a, Dynamic as c } from "solid-js/web";
|
|
3
2
|
const i = {
|
|
4
3
|
/**
|
|
5
4
|
* Creates a Solid JSX Element.
|
|
6
5
|
* Uses Solid's Dynamic component for element creation.
|
|
7
6
|
*/
|
|
8
|
-
createElement: (e,
|
|
7
|
+
createElement: (e, n, ...t) => a(c, {
|
|
9
8
|
get component() {
|
|
10
9
|
return e;
|
|
11
10
|
},
|
|
12
|
-
...
|
|
11
|
+
...n,
|
|
13
12
|
get children() {
|
|
14
13
|
return t.length === 1 ? t[0] : t;
|
|
15
14
|
}
|
|
@@ -19,7 +18,7 @@ const i = {
|
|
|
19
18
|
* In the context of markdown rendering, we usually don't need to deep-clone
|
|
20
19
|
* but rather merge props if we're wrapping a result.
|
|
21
20
|
*/
|
|
22
|
-
cloneElement: (e,
|
|
21
|
+
cloneElement: (e, n) => typeof e == "function" ? a(e, n) : e,
|
|
23
22
|
/**
|
|
24
23
|
* Solid Fragment equivalent.
|
|
25
24
|
* In Solid, a fragment is just an array or a function returning children.
|
|
@@ -29,10 +28,10 @@ const i = {
|
|
|
29
28
|
* Solid-specific prop normalization.
|
|
30
29
|
* Solid uses 'class' instead of 'className'.
|
|
31
30
|
*/
|
|
32
|
-
normalizeProps: (e,
|
|
31
|
+
normalizeProps: (e, n) => {
|
|
33
32
|
const t = {};
|
|
34
|
-
for (const [
|
|
35
|
-
|
|
33
|
+
for (const [r, o] of Object.entries(n))
|
|
34
|
+
r === "className" ? t.class = o : t[r] = o;
|
|
36
35
|
return t;
|
|
37
36
|
}
|
|
38
37
|
};
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,18 +1,19 @@
|
|
|
1
|
-
import "
|
|
2
|
-
import "@intlayer/core";
|
|
1
|
+
import "solid-js/web";
|
|
2
|
+
import "@intlayer/core/interpreter";
|
|
3
|
+
import "@intlayer/core/markdown";
|
|
4
|
+
import "@intlayer/core/transpiler";
|
|
3
5
|
import "@intlayer/types";
|
|
4
|
-
import { h as
|
|
6
|
+
import { h as P, a as d, i as e, m as h, b as k, s as w } from "../plugins-BDLeP00w.mjs";
|
|
5
7
|
import "./editor/useEditedContentRenderer.mjs";
|
|
6
8
|
import "./IntlayerNode.mjs";
|
|
7
9
|
import "./markdown/MarkdownProvider.mjs";
|
|
8
10
|
import "./markdown/MarkdownRenderer.mjs";
|
|
9
11
|
import "./solidElement/renderSolidElement.mjs";
|
|
10
|
-
import "solid-js";
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
P as htmlPlugin,
|
|
14
|
+
d as insertionPlugin,
|
|
15
|
+
e as intlayerNodePlugins,
|
|
16
|
+
h as markdownPlugin,
|
|
17
|
+
k as markdownStringPlugin,
|
|
18
|
+
w as solidNodePlugins
|
|
18
19
|
};
|