solid-intlayer 8.3.0-canary.1 → 8.3.0-canary.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/editor/ContentSelectorWrapper.cjs +1 -1
- package/dist/cjs/editor/index.cjs +1 -1
- package/dist/cjs/getDictionary.cjs +1 -1
- package/dist/cjs/getIntlayer.cjs +1 -1
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/getDictionary.mjs +1 -1
- package/dist/esm/getIntlayer.mjs +1 -1
- package/dist/esm/plugins.mjs +8 -7
- package/dist/{plugins-qgberWhD.mjs → plugins-DLH-ZWTW.mjs} +44 -44
- package/dist/plugins-DXLQjL5N.js +1 -0
- package/dist/types/plugins.d.ts +2 -2
- package/package.json +7 -7
- package/dist/plugins-Da2V8QmE.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("solid-js/web");require("@intlayer/core/utils");require("@intlayer/types/nodeType");require("solid-js");require("@intlayer/core/formatters");require("../client/IntlayerProvider.cjs");require("@intlayer/config/built");require("@intlayer/core/localization");require("@intlayer/types/locales");require("@intlayer/core/interpreter");const e=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("solid-js/web");require("@intlayer/core/utils");require("@intlayer/types/nodeType");require("solid-js");require("@intlayer/core/formatters");require("../client/IntlayerProvider.cjs");require("@intlayer/config/built");require("@intlayer/core/localization");require("@intlayer/types/locales");require("@intlayer/core/interpreter");const e=require("../../plugins-DXLQjL5N.js");require("../client/useLocaleStorage.cjs");require("../client/useLocaleBase.cjs");require("../UI/ContentSelector.cjs");require("@intlayer/editor");require("./contexts/ConfigurationContext.cjs");require("./contexts/DictionariesRecordContext.cjs");require("./contexts/EditedContentContext.cjs");require("./contexts/EditorEnabledContext.cjs");require("./contexts/CommunicatorContext.cjs");require("./contexts/FocusDictionaryContext.cjs");exports.ContentSelectorRenderer=e.ContentSelectorRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../../plugins-DXLQjL5N.js");exports.ContentSelectorRenderer=e.ContentSelectorRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core/interpreter"),e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core/interpreter"),e=require("../plugins-DXLQjL5N.js"),l=(t,i,n)=>{const r=[e.intlayerNodePlugins,e.solidNodePlugins,e.insertionPlugin,e.markdownPlugin,e.htmlPlugin,...n??[]];return o.getDictionary(t,i,r)};exports.getDictionary=l;
|
package/dist/cjs/getIntlayer.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/interpreter"),e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("@intlayer/core/interpreter"),e=require("../plugins-DXLQjL5N.js"),o=(t,n,r)=>{const i=[e.intlayerNodePlugins,e.solidNodePlugins,e.insertionPlugin,e.markdownPlugin,e.htmlPlugin,...r??[]];return l.getIntlayer(t,n,i)};exports.getIntlayer=o;
|
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("solid-js/web");require("@intlayer/core/interpreter");require("@intlayer/core/markdown");require("@intlayer/core/transpiler");require("@intlayer/types/nodeType");const e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("solid-js/web");require("@intlayer/config/built");require("@intlayer/core/interpreter");require("@intlayer/core/markdown");require("@intlayer/core/transpiler");require("@intlayer/types/nodeType");const e=require("../plugins-DXLQjL5N.js");require("./editor/useEditedContentRenderer.cjs");require("./IntlayerNode.cjs");require("./markdown/MarkdownProvider.cjs");require("./markdown/MarkdownRenderer.cjs");require("./solidElement/renderSolidElement.cjs");exports.htmlPlugin=e.htmlPlugin;exports.insertionPlugin=e.insertionPlugin;exports.intlayerNodePlugins=e.intlayerNodePlugins;exports.markdownPlugin=e.markdownPlugin;exports.markdownStringPlugin=e.markdownStringPlugin;exports.solidNodePlugins=e.solidNodePlugins;
|
|
@@ -8,7 +8,7 @@ import "@intlayer/config/built";
|
|
|
8
8
|
import "@intlayer/core/localization";
|
|
9
9
|
import "@intlayer/types/locales";
|
|
10
10
|
import "@intlayer/core/interpreter";
|
|
11
|
-
import { C as k } from "../../plugins-
|
|
11
|
+
import { C as k } from "../../plugins-DLH-ZWTW.mjs";
|
|
12
12
|
import "../client/useLocaleStorage.mjs";
|
|
13
13
|
import "../client/useLocaleBase.mjs";
|
|
14
14
|
import "../UI/ContentSelector.mjs";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { i as r, s as a, a as e, m as g, h as l } from "../plugins-DLH-ZWTW.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
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-
|
|
2
|
+
import { i as a, s as e, a as l, m as o, h as g } from "../plugins-DLH-ZWTW.mjs";
|
|
3
3
|
const P = (n, t, s) => {
|
|
4
4
|
const i = [
|
|
5
5
|
a,
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
import "solid-js/web";
|
|
2
|
+
import "@intlayer/config/built";
|
|
2
3
|
import "@intlayer/core/interpreter";
|
|
3
4
|
import "@intlayer/core/markdown";
|
|
4
5
|
import "@intlayer/core/transpiler";
|
|
5
6
|
import "@intlayer/types/nodeType";
|
|
6
|
-
import { h as
|
|
7
|
+
import { h as d, a as e, i as h, m as k, b as w, s as N } from "../plugins-DLH-ZWTW.mjs";
|
|
7
8
|
import "./editor/useEditedContentRenderer.mjs";
|
|
8
9
|
import "./IntlayerNode.mjs";
|
|
9
10
|
import "./markdown/MarkdownProvider.mjs";
|
|
10
11
|
import "./markdown/MarkdownRenderer.mjs";
|
|
11
12
|
import "./solidElement/renderSolidElement.mjs";
|
|
12
13
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
d as htmlPlugin,
|
|
15
|
+
e as insertionPlugin,
|
|
16
|
+
h as intlayerNodePlugins,
|
|
17
|
+
k as markdownPlugin,
|
|
18
|
+
w as markdownStringPlugin,
|
|
19
|
+
N as solidNodePlugins
|
|
19
20
|
};
|
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
import { createComponent as s, mergeProps as c, Dynamic as w } from "solid-js/web";
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
2
|
+
import M from "@intlayer/config/built";
|
|
3
|
+
import { getHTML as H, splitInsertionTemplate as C } from "@intlayer/core/interpreter";
|
|
4
|
+
import { getMarkdownMetadata as S } from "@intlayer/core/markdown";
|
|
5
|
+
import { HTML_TAGS as b } from "@intlayer/core/transpiler";
|
|
5
6
|
import { NodeType as d } from "@intlayer/types/nodeType";
|
|
6
7
|
import { isSameKeyPath as T } from "@intlayer/core/utils";
|
|
7
8
|
import { createMemo as h } from "solid-js";
|
|
8
9
|
import "@intlayer/core/formatters";
|
|
9
|
-
import { useIntlayerContext as
|
|
10
|
-
import "@intlayer/config/built";
|
|
10
|
+
import { useIntlayerContext as K } from "./esm/client/IntlayerProvider.mjs";
|
|
11
11
|
import "@intlayer/core/localization";
|
|
12
12
|
import "@intlayer/types/locales";
|
|
13
|
-
import { EditedContentRenderer as
|
|
13
|
+
import { EditedContentRenderer as v } from "./esm/editor/useEditedContentRenderer.mjs";
|
|
14
14
|
import { renderIntlayerNode as f } from "./esm/IntlayerNode.mjs";
|
|
15
15
|
import "./esm/markdown/MarkdownProvider.mjs";
|
|
16
|
-
import { MarkdownMetadataRenderer as
|
|
17
|
-
import { renderSolidElement as
|
|
16
|
+
import { MarkdownMetadataRenderer as I, MarkdownRenderer as R } from "./esm/markdown/MarkdownRenderer.mjs";
|
|
17
|
+
import { renderSolidElement as L } from "./esm/solidElement/renderSolidElement.mjs";
|
|
18
18
|
import "./esm/client/useLocaleStorage.mjs";
|
|
19
19
|
import "./esm/client/useLocaleBase.mjs";
|
|
20
|
-
import { ContentSelector as
|
|
20
|
+
import { ContentSelector as E } from "./esm/UI/ContentSelector.mjs";
|
|
21
21
|
import "@intlayer/editor";
|
|
22
22
|
import "./esm/editor/contexts/ConfigurationContext.mjs";
|
|
23
23
|
import "./esm/editor/contexts/DictionariesRecordContext.mjs";
|
|
24
24
|
import "./esm/editor/contexts/EditedContentContext.mjs";
|
|
25
|
-
import { useEditorEnabled as
|
|
25
|
+
import { useEditorEnabled as N } from "./esm/editor/contexts/EditorEnabledContext.mjs";
|
|
26
26
|
import "./esm/editor/contexts/CommunicatorContext.mjs";
|
|
27
|
-
import { useFocusDictionary as
|
|
28
|
-
const
|
|
27
|
+
import { useFocusDictionary as j } from "./esm/editor/contexts/FocusDictionaryContext.mjs";
|
|
28
|
+
const x = (e) => {
|
|
29
29
|
const {
|
|
30
30
|
focusedContent: t,
|
|
31
31
|
setFocusedContent: n
|
|
32
|
-
} =
|
|
32
|
+
} = j(), a = h(() => e.keyPath.filter((o) => o.type !== d.Translation)), r = () => n({
|
|
33
33
|
dictionaryKey: e.dictionaryKey,
|
|
34
34
|
keyPath: a()
|
|
35
35
|
}), m = h(() => (t?.dictionaryKey === e.dictionaryKey && (t?.keyPath?.length ?? 0) > 0 && T(t?.keyPath ?? [], a())) ?? !1);
|
|
36
|
-
return s(
|
|
36
|
+
return s(E, {
|
|
37
37
|
onPress: r,
|
|
38
38
|
get isSelecting() {
|
|
39
39
|
return m();
|
|
@@ -45,15 +45,15 @@ const j = (e) => {
|
|
|
45
45
|
}, y = (e) => {
|
|
46
46
|
const {
|
|
47
47
|
enabled: t
|
|
48
|
-
} =
|
|
48
|
+
} = N(), {
|
|
49
49
|
disableEditor: n
|
|
50
|
-
} =
|
|
51
|
-
return t() && !n ? s(
|
|
50
|
+
} = K();
|
|
51
|
+
return t() && !n ? s(x, c(e, {
|
|
52
52
|
get children() {
|
|
53
53
|
return e.children;
|
|
54
54
|
}
|
|
55
55
|
})) : e.children;
|
|
56
|
-
},
|
|
56
|
+
}, ge = {
|
|
57
57
|
id: "intlayer-node-plugin",
|
|
58
58
|
canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
|
|
59
59
|
transform: (e, {
|
|
@@ -63,17 +63,17 @@ const j = (e) => {
|
|
|
63
63
|
}) => f({
|
|
64
64
|
...n,
|
|
65
65
|
value: n.children,
|
|
66
|
-
children: s(y, c(n, {
|
|
66
|
+
children: M.editor.enabled ? s(y, c(n, {
|
|
67
67
|
get children() {
|
|
68
|
-
return s(
|
|
68
|
+
return s(v, c(n, {
|
|
69
69
|
get children() {
|
|
70
70
|
return n.children;
|
|
71
71
|
}
|
|
72
72
|
}));
|
|
73
73
|
}
|
|
74
|
-
}))
|
|
74
|
+
})) : n.children
|
|
75
75
|
})
|
|
76
|
-
},
|
|
76
|
+
}, fe = {
|
|
77
77
|
id: "solid-node-plugin",
|
|
78
78
|
canHandle: (e) => typeof e == "object" && e?.props !== void 0 || typeof Node < "u" && e instanceof Node,
|
|
79
79
|
transform: (e, {
|
|
@@ -85,14 +85,14 @@ const j = (e) => {
|
|
|
85
85
|
value: "[[solid-element]]",
|
|
86
86
|
children: s(y, c(n, {
|
|
87
87
|
get children() {
|
|
88
|
-
return typeof Node < "u" && e instanceof Node ? e :
|
|
88
|
+
return typeof Node < "u" && e instanceof Node ? e : L(e);
|
|
89
89
|
}
|
|
90
90
|
}))
|
|
91
91
|
})
|
|
92
|
-
},
|
|
93
|
-
const n =
|
|
92
|
+
}, D = (e, t) => {
|
|
93
|
+
const n = C(e, t);
|
|
94
94
|
return n.isSimple, n.parts;
|
|
95
|
-
},
|
|
95
|
+
}, ye = {
|
|
96
96
|
id: "insertion-plugin",
|
|
97
97
|
canHandle: (e) => typeof e == "object" && e?.nodeType === d.Insertion,
|
|
98
98
|
transform: (e, t, n) => {
|
|
@@ -113,7 +113,7 @@ const j = (e) => {
|
|
|
113
113
|
plugins: [...(t.plugins ?? []).filter((i) => i.id !== "intlayer-node-plugin")]
|
|
114
114
|
});
|
|
115
115
|
return (i) => {
|
|
116
|
-
const l =
|
|
116
|
+
const l = D(p, i);
|
|
117
117
|
return g(l, {
|
|
118
118
|
...u,
|
|
119
119
|
plugins: t.plugins,
|
|
@@ -124,7 +124,7 @@ const j = (e) => {
|
|
|
124
124
|
}, ...t.plugins ?? []]
|
|
125
125
|
});
|
|
126
126
|
}
|
|
127
|
-
},
|
|
127
|
+
}, A = {
|
|
128
128
|
id: "markdown-string-plugin",
|
|
129
129
|
canHandle: (e) => typeof e == "string",
|
|
130
130
|
transform: (e, t, n) => {
|
|
@@ -132,7 +132,7 @@ const j = (e) => {
|
|
|
132
132
|
plugins: a,
|
|
133
133
|
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
134
134
|
...r
|
|
135
|
-
} = t, m =
|
|
135
|
+
} = t, m = S(e), u = n(m, {
|
|
136
136
|
plugins: [{
|
|
137
137
|
id: "markdown-metadata-plugin",
|
|
138
138
|
canHandle: (i) => typeof i == "string" || typeof i == "number" || typeof i == "boolean" || !i,
|
|
@@ -141,7 +141,7 @@ const j = (e) => {
|
|
|
141
141
|
value: i,
|
|
142
142
|
children: s(y, c(r, {
|
|
143
143
|
get children() {
|
|
144
|
-
return s(
|
|
144
|
+
return s(I, c(r, {
|
|
145
145
|
get metadataKeyPath() {
|
|
146
146
|
return l.keyPath;
|
|
147
147
|
},
|
|
@@ -158,7 +158,7 @@ const j = (e) => {
|
|
|
158
158
|
value: e,
|
|
159
159
|
children: s(y, c(r, {
|
|
160
160
|
get children() {
|
|
161
|
-
return s(
|
|
161
|
+
return s(R, c(r, {
|
|
162
162
|
components: i,
|
|
163
163
|
children: e
|
|
164
164
|
}));
|
|
@@ -174,7 +174,7 @@ const j = (e) => {
|
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
176
|
}
|
|
177
|
-
},
|
|
177
|
+
}, pe = {
|
|
178
178
|
id: "markdown-plugin",
|
|
179
179
|
canHandle: (e) => typeof e == "object" && e?.nodeType === d.Markdown,
|
|
180
180
|
transform: (e, t, n) => {
|
|
@@ -185,12 +185,12 @@ const j = (e) => {
|
|
|
185
185
|
...t,
|
|
186
186
|
children: r,
|
|
187
187
|
keyPath: a,
|
|
188
|
-
plugins: [
|
|
188
|
+
plugins: [A, ...t.plugins ?? []]
|
|
189
189
|
});
|
|
190
190
|
}
|
|
191
|
-
},
|
|
191
|
+
}, F = () => {
|
|
192
192
|
const e = {};
|
|
193
|
-
for (const t of
|
|
193
|
+
for (const t of b)
|
|
194
194
|
e[t] = ({
|
|
195
195
|
children: n,
|
|
196
196
|
...a
|
|
@@ -200,16 +200,16 @@ const j = (e) => {
|
|
|
200
200
|
children: n
|
|
201
201
|
}));
|
|
202
202
|
return e;
|
|
203
|
-
},
|
|
203
|
+
}, _ = F(), he = {
|
|
204
204
|
id: "html-plugin",
|
|
205
205
|
canHandle: (e) => typeof e == "object" && e?.nodeType === d.HTML,
|
|
206
206
|
transform: (e) => {
|
|
207
207
|
const t = e[d.HTML], n = (m) => {
|
|
208
208
|
const o = {
|
|
209
|
-
...
|
|
209
|
+
..._,
|
|
210
210
|
...m
|
|
211
211
|
};
|
|
212
|
-
return
|
|
212
|
+
return H(t, o);
|
|
213
213
|
}, r = [n()];
|
|
214
214
|
return new Proxy(r, {
|
|
215
215
|
get(m, o, u) {
|
|
@@ -220,10 +220,10 @@ const j = (e) => {
|
|
|
220
220
|
};
|
|
221
221
|
export {
|
|
222
222
|
y as C,
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
223
|
+
ye as a,
|
|
224
|
+
A as b,
|
|
225
|
+
he as h,
|
|
226
|
+
ge as i,
|
|
227
|
+
pe as m,
|
|
228
|
+
fe as s
|
|
229
229
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("solid-js/web"),w=require("@intlayer/config/built"),P=require("@intlayer/core/interpreter"),T=require("@intlayer/core/markdown"),N=require("@intlayer/core/transpiler"),s=require("@intlayer/types/nodeType"),M=require("@intlayer/core/utils"),f=require("solid-js");require("@intlayer/core/formatters");const S=require("./cjs/client/IntlayerProvider.cjs");require("@intlayer/core/localization");require("@intlayer/types/locales");const H=require("./cjs/editor/useEditedContentRenderer.cjs"),m=require("./cjs/IntlayerNode.cjs");require("./cjs/markdown/MarkdownProvider.cjs");const h=require("./cjs/markdown/MarkdownRenderer.cjs"),b=require("./cjs/solidElement/renderSolidElement.cjs");require("./cjs/client/useLocaleStorage.cjs");require("./cjs/client/useLocaleBase.cjs");const I=require("./cjs/UI/ContentSelector.cjs");require("@intlayer/editor");require("./cjs/editor/contexts/ConfigurationContext.cjs");require("./cjs/editor/contexts/DictionariesRecordContext.cjs");require("./cjs/editor/contexts/EditedContentContext.cjs");const K=require("./cjs/editor/contexts/EditorEnabledContext.cjs");require("./cjs/editor/contexts/CommunicatorContext.cjs");const _=require("./cjs/editor/contexts/FocusDictionaryContext.cjs"),E=e=>{const{focusedContent:n,setFocusedContent:t}=_.useFocusDictionary(),l=f.createMemo(()=>e.keyPath.filter(a=>a.type!==s.NodeType.Translation)),o=()=>t({dictionaryKey:e.dictionaryKey,keyPath:l()}),c=f.createMemo(()=>(n?.dictionaryKey===e.dictionaryKey&&(n?.keyPath?.length??0)>0&&M.isSameKeyPath(n?.keyPath??[],l()))??!1);return r.createComponent(I.ContentSelector,{onPress:o,get isSelecting(){return c()},get children(){return e.children}})},y=e=>{const{enabled:n}=K.useEditorEnabled(),{disableEditor:t}=S.useIntlayerContext();return n()&&!t?r.createComponent(E,r.mergeProps(e,{get children(){return e.children}})):e.children},R={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{plugins:n,...t})=>m.renderIntlayerNode({...t,value:t.children,children:w.editor.enabled?r.createComponent(y,r.mergeProps(t,{get children(){return r.createComponent(H.EditedContentRenderer,r.mergeProps(t,{get children(){return t.children}}))}})):t.children})},v={id:"solid-node-plugin",canHandle:e=>typeof e=="object"&&e?.props!==void 0||typeof Node<"u"&&e instanceof Node,transform:(e,{plugins:n,...t})=>m.renderIntlayerNode({...t,value:"[[solid-element]]",children:r.createComponent(y,r.mergeProps(t,{get children(){return typeof Node<"u"&&e instanceof Node?e:b.renderSolidElement(e)}}))})},x=(e,n)=>{const t=P.splitInsertionTemplate(e,n);return t.isSimple,t.parts},L={id:"insertion-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===s.NodeType.Insertion,transform:(e,n,t)=>{const l=[...n.keyPath,{type:s.NodeType.Insertion}],o=e[s.NodeType.Insertion];return t(o,{...n,children:o,keyPath:l,plugins:[{id:"insertion-string-plugin",canHandle:a=>typeof a=="string",transform:(a,u,g)=>{const p=g(a,{...u,children:a,plugins:[...(n.plugins??[]).filter(i=>i.id!=="intlayer-node-plugin")]});return i=>{const d=x(p,i);return g(d,{...u,plugins:n.plugins,children:d})}}},...n.plugins??[]]})}},q={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,n,t)=>{const{plugins:l,...o}=n,c=T.getMarkdownMetadata(e),u=t(c,{plugins:[{id:"markdown-metadata-plugin",canHandle:i=>typeof i=="string"||typeof i=="number"||typeof i=="boolean"||!i,transform:(i,d)=>m.renderIntlayerNode({...d,value:i,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(h.MarkdownMetadataRenderer,r.mergeProps(o,{get metadataKeyPath(){return d.keyPath},children:e}))}}))})}],dictionaryKey:o.dictionaryKey,keyPath:[]}),g=i=>m.renderIntlayerNode({...n,value:e,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(h.MarkdownRenderer,r.mergeProps(o,{components:i,children:e}))}})),additionalProps:{metadata:u}}),p=g();return new Proxy(p,{get(i,d,k){return d==="value"?e:d==="metadata"?u:d==="use"?C=>g(C):Reflect.get(i,d,k)}})}},j={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===s.NodeType.Markdown,transform:(e,n,t)=>{const l=[...n.keyPath,{type:s.NodeType.Markdown}],o=e[s.NodeType.Markdown];return t(o,{...n,children:o,keyPath:l,plugins:[q,...n.plugins??[]]})}},D=()=>{const e={};for(const n of N.HTML_TAGS)e[n]=({children:t,...l})=>r.createComponent(r.Dynamic,r.mergeProps({component:n},l,{children:t}));return e},F=D(),A={id:"html-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===s.NodeType.HTML,transform:e=>{const n=e[s.NodeType.HTML],t=c=>{const a={...F,...c};return P.getHTML(n,a)},o=[t()];return new Proxy(o,{get(c,a,u){return a==="value"?n:a==="use"?g=>t(g):Reflect.get(c,a,u)}})}};exports.ContentSelectorRenderer=y;exports.htmlPlugin=A;exports.insertionPlugin=L;exports.intlayerNodePlugins=R;exports.markdownPlugin=j;exports.markdownStringPlugin=q;exports.solidNodePlugins=v;
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DeepTransformContent as DeepTransformContentCore, IInterpreterPluginState as IInterpreterPluginStateCore, Plugins } from '@intlayer/core/interpreter';
|
|
2
|
-
import { DeclaredLocales, LocalesValues } from '@intlayer/types/module_augmentation';
|
|
2
|
+
import { DeclaredLocales, LocalesValues, ResolvedEditor } from '@intlayer/types/module_augmentation';
|
|
3
3
|
import { NodeType } from '@intlayer/types/nodeType';
|
|
4
4
|
import { JSX } from 'solid-js';
|
|
5
5
|
import { HTMLComponents } from './html/types';
|
|
@@ -7,7 +7,7 @@ import { IntlayerNode } from './IntlayerNode';
|
|
|
7
7
|
/** ---------------------------------------------
|
|
8
8
|
* INTLAYER NODE PLUGIN
|
|
9
9
|
* --------------------------------------------- */
|
|
10
|
-
export type IntlayerNodeCond<T> = T extends number | string ? IntlayerNode<T
|
|
10
|
+
export type IntlayerNodeCond<T> = T extends number | string ? ResolvedEditor<T, IntlayerNode<T>> : never;
|
|
11
11
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
12
12
|
export declare const intlayerNodePlugins: Plugins;
|
|
13
13
|
/** ---------------------------------------------
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-intlayer",
|
|
3
|
-
"version": "8.3.0-canary.
|
|
3
|
+
"version": "8.3.0-canary.3",
|
|
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,14 @@
|
|
|
73
73
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
74
74
|
},
|
|
75
75
|
"dependencies": {
|
|
76
|
-
"@intlayer/api": "8.3.0-canary.
|
|
77
|
-
"@intlayer/config": "8.3.0-canary.
|
|
78
|
-
"@intlayer/core": "8.3.0-canary.
|
|
79
|
-
"@intlayer/editor": "8.3.0-canary.
|
|
80
|
-
"@intlayer/types": "8.3.0-canary.
|
|
76
|
+
"@intlayer/api": "8.3.0-canary.3",
|
|
77
|
+
"@intlayer/config": "8.3.0-canary.3",
|
|
78
|
+
"@intlayer/core": "8.3.0-canary.3",
|
|
79
|
+
"@intlayer/editor": "8.3.0-canary.3",
|
|
80
|
+
"@intlayer/types": "8.3.0-canary.3"
|
|
81
81
|
},
|
|
82
82
|
"devDependencies": {
|
|
83
|
-
"@intlayer/unmerged-dictionaries-entry": "8.3.0-canary.
|
|
83
|
+
"@intlayer/unmerged-dictionaries-entry": "8.3.0-canary.3",
|
|
84
84
|
"@solidjs/testing-library": "0.8.10",
|
|
85
85
|
"@testing-library/jest-dom": "6.9.1",
|
|
86
86
|
"@testing-library/user-event": "14.6.1",
|
package/dist/plugins-Da2V8QmE.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("solid-js/web"),h=require("@intlayer/core/interpreter"),w=require("@intlayer/core/markdown"),T=require("@intlayer/core/transpiler"),d=require("@intlayer/types/nodeType"),N=require("@intlayer/core/utils"),f=require("solid-js");require("@intlayer/core/formatters");const M=require("./cjs/client/IntlayerProvider.cjs");require("@intlayer/config/built");require("@intlayer/core/localization");require("@intlayer/types/locales");const S=require("./cjs/editor/useEditedContentRenderer.cjs"),m=require("./cjs/IntlayerNode.cjs");require("./cjs/markdown/MarkdownProvider.cjs");const P=require("./cjs/markdown/MarkdownRenderer.cjs"),H=require("./cjs/solidElement/renderSolidElement.cjs");require("./cjs/client/useLocaleStorage.cjs");require("./cjs/client/useLocaleBase.cjs");const I=require("./cjs/UI/ContentSelector.cjs");require("@intlayer/editor");require("./cjs/editor/contexts/ConfigurationContext.cjs");require("./cjs/editor/contexts/DictionariesRecordContext.cjs");require("./cjs/editor/contexts/EditedContentContext.cjs");const b=require("./cjs/editor/contexts/EditorEnabledContext.cjs");require("./cjs/editor/contexts/CommunicatorContext.cjs");const K=require("./cjs/editor/contexts/FocusDictionaryContext.cjs"),_=e=>{const{focusedContent:n,setFocusedContent:t}=K.useFocusDictionary(),l=f.createMemo(()=>e.keyPath.filter(a=>a.type!==d.NodeType.Translation)),o=()=>t({dictionaryKey:e.dictionaryKey,keyPath:l()}),c=f.createMemo(()=>(n?.dictionaryKey===e.dictionaryKey&&(n?.keyPath?.length??0)>0&&N.isSameKeyPath(n?.keyPath??[],l()))??!1);return r.createComponent(I.ContentSelector,{onPress:o,get isSelecting(){return c()},get children(){return e.children}})},y=e=>{const{enabled:n}=b.useEditorEnabled(),{disableEditor:t}=M.useIntlayerContext();return n()&&!t?r.createComponent(_,r.mergeProps(e,{get children(){return e.children}})):e.children},E={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{plugins:n,...t})=>m.renderIntlayerNode({...t,value:t.children,children:r.createComponent(y,r.mergeProps(t,{get children(){return r.createComponent(S.EditedContentRenderer,r.mergeProps(t,{get children(){return t.children}}))}}))})},R={id:"solid-node-plugin",canHandle:e=>typeof e=="object"&&e?.props!==void 0||typeof Node<"u"&&e instanceof Node,transform:(e,{plugins:n,...t})=>m.renderIntlayerNode({...t,value:"[[solid-element]]",children:r.createComponent(y,r.mergeProps(t,{get children(){return typeof Node<"u"&&e instanceof Node?e:H.renderSolidElement(e)}}))})},v=(e,n)=>{const t=h.splitInsertionTemplate(e,n);return t.isSimple,t.parts},x={id:"insertion-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Insertion,transform:(e,n,t)=>{const l=[...n.keyPath,{type:d.NodeType.Insertion}],o=e[d.NodeType.Insertion];return t(o,{...n,children:o,keyPath:l,plugins:[{id:"insertion-string-plugin",canHandle:a=>typeof a=="string",transform:(a,u,g)=>{const p=g(a,{...u,children:a,plugins:[...(n.plugins??[]).filter(i=>i.id!=="intlayer-node-plugin")]});return i=>{const s=v(p,i);return g(s,{...u,plugins:n.plugins,children:s})}}},...n.plugins??[]]})}},q={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,n,t)=>{const{plugins:l,...o}=n,c=w.getMarkdownMetadata(e),u=t(c,{plugins:[{id:"markdown-metadata-plugin",canHandle:i=>typeof i=="string"||typeof i=="number"||typeof i=="boolean"||!i,transform:(i,s)=>m.renderIntlayerNode({...s,value:i,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(P.MarkdownMetadataRenderer,r.mergeProps(o,{get metadataKeyPath(){return s.keyPath},children:e}))}}))})}],dictionaryKey:o.dictionaryKey,keyPath:[]}),g=i=>m.renderIntlayerNode({...n,value:e,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(P.MarkdownRenderer,r.mergeProps(o,{components:i,children:e}))}})),additionalProps:{metadata:u}}),p=g();return new Proxy(p,{get(i,s,k){return s==="value"?e:s==="metadata"?u:s==="use"?C=>g(C):Reflect.get(i,s,k)}})}},L={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.Markdown,transform:(e,n,t)=>{const l=[...n.keyPath,{type:d.NodeType.Markdown}],o=e[d.NodeType.Markdown];return t(o,{...n,children:o,keyPath:l,plugins:[q,...n.plugins??[]]})}},j=()=>{const e={};for(const n of T.HTML_TAGS)e[n]=({children:t,...l})=>r.createComponent(r.Dynamic,r.mergeProps({component:n},l,{children:t}));return e},D=j(),F={id:"html-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===d.NodeType.HTML,transform:e=>{const n=e[d.NodeType.HTML],t=c=>{const a={...D,...c};return h.getHTML(n,a)},o=[t()];return new Proxy(o,{get(c,a,u){return a==="value"?n:a==="use"?g=>t(g):Reflect.get(c,a,u)}})}};exports.ContentSelectorRenderer=y;exports.htmlPlugin=F;exports.insertionPlugin=x;exports.intlayerNodePlugins=E;exports.markdownPlugin=L;exports.markdownStringPlugin=q;exports.solidNodePlugins=R;
|