solid-intlayer 8.0.2-canary.0 → 8.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +7 -7
- package/dist/plugins-CYs2R9PT.js +0 -1
- package/dist/plugins-D-fEci5W.mjs +0 -222
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-intlayer",
|
|
3
|
-
"version": "8.0.2
|
|
3
|
+
"version": "8.0.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -74,14 +74,14 @@
|
|
|
74
74
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@intlayer/api": "8.0.2
|
|
78
|
-
"@intlayer/config": "8.0.2
|
|
79
|
-
"@intlayer/core": "8.0.2
|
|
80
|
-
"@intlayer/editor": "8.0.2
|
|
81
|
-
"@intlayer/types": "8.0.2
|
|
77
|
+
"@intlayer/api": "8.0.2",
|
|
78
|
+
"@intlayer/config": "8.0.2",
|
|
79
|
+
"@intlayer/core": "8.0.2",
|
|
80
|
+
"@intlayer/editor": "8.0.2",
|
|
81
|
+
"@intlayer/types": "8.0.2"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@intlayer/unmerged-dictionaries-entry": "8.0.2
|
|
84
|
+
"@intlayer/unmerged-dictionaries-entry": "8.0.2",
|
|
85
85
|
"@solidjs/testing-library": "0.8.10",
|
|
86
86
|
"@testing-library/jest-dom": "6.9.1",
|
|
87
87
|
"@testing-library/user-event": "14.6.1",
|
package/dist/plugins-CYs2R9PT.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const q=require("./web-Ch-xTpJg.js"),m=require("@intlayer/core"),s=require("@intlayer/types"),r=require("solid-js"),w=require("./cjs/client/IntlayerProvider.cjs");require("@intlayer/config/built");const T=require("./cjs/editor/useEditedContentRenderer.cjs"),p=require("./cjs/IntlayerNode.cjs");require("./cjs/markdown/MarkdownProvider.cjs");const h=require("./cjs/markdown/MarkdownRenderer.cjs"),N=require("./cjs/solidElement/renderSolidElement.cjs");require("./cjs/client/useLocaleStorage.cjs");require("./cjs/client/useLocaleBase.cjs");const M=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 S=require("./cjs/editor/contexts/EditorEnabledContext.cjs");require("./cjs/editor/contexts/CommunicatorContext.cjs");const H=require("./cjs/editor/contexts/FocusDictionaryContext.cjs"),I=e=>{const{focusedContent:n,setFocusedContent:t}=H.useFocusDictionary(),l=r.createMemo(()=>e.keyPath.filter(a=>a.type!==s.NodeType.Translation)),i=()=>t({dictionaryKey:e.dictionaryKey,keyPath:l()}),c=r.createMemo(()=>(n?.dictionaryKey===e.dictionaryKey&&(n?.keyPath?.length??0)>0&&m.isSameKeyPath(n?.keyPath??[],l()))??!1);return r.createComponent(M.ContentSelector,{onPress:i,get isSelecting(){return c()},get children(){return e.children}})},y=e=>{const{enabled:n}=S.useEditorEnabled(),{disableEditor:t}=w.useIntlayerContext();return n()&&!t?r.createComponent(I,r.mergeProps(e,{get children(){return e.children}})):e.children},b={id:"intlayer-node-plugin",canHandle:e=>typeof e=="bigint"||typeof e=="string"||typeof e=="number",transform:(e,{plugins:n,...t})=>p.renderIntlayerNode({...t,value:t.children,children:r.createComponent(y,r.mergeProps(t,{get children(){return r.createComponent(T.EditedContentRenderer,r.mergeProps(t,{get children(){return t.children}}))}}))})},K={id:"solid-node-plugin",canHandle:e=>typeof e=="object"&&e?.props!==void 0||typeof Node<"u"&&e instanceof Node,transform:(e,{plugins:n,...t})=>p.renderIntlayerNode({...t,value:"[[solid-element]]",children:r.createComponent(y,r.mergeProps(t,{get children(){return typeof Node<"u"&&e instanceof Node?e:N.renderSolidElement(e)}}))})},_=(e,n)=>{const t=m.splitInsertionTemplate(e,n);return t.isSimple,t.parts},E={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}],i=e[s.NodeType.Insertion];return t(i,{...n,children:i,keyPath:l,plugins:[{id:"insertion-string-plugin",canHandle:a=>typeof a=="string",transform:(a,u,g)=>{const f=g(a,{...u,children:a,plugins:[...(n.plugins??[]).filter(o=>o.id!=="intlayer-node-plugin"&&o.id!=="markdown-string-plugin"&&o.id!=="html-string-plugin")]});return o=>{const d=_(f,o);return g(d,{...u,plugins:n.plugins,children:d})}}},...n.plugins??[]]})}},P={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,n,t)=>{const{plugins:l,...i}=n,c=m.getMarkdownMetadata(e),u=t(c,{plugins:[{id:"markdown-metadata-plugin",canHandle:o=>typeof o=="string"||typeof o=="number"||typeof o=="boolean"||!o,transform:(o,d)=>p.renderIntlayerNode({...d,value:o,children:r.createComponent(y,r.mergeProps(i,{get children(){return r.createComponent(h.MarkdownMetadataRenderer,r.mergeProps(i,{get metadataKeyPath(){return d.keyPath},children:e}))}}))})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),g=o=>p.renderIntlayerNode({...n,value:e,children:r.createComponent(y,r.mergeProps(i,{get children(){return r.createComponent(h.MarkdownRenderer,r.mergeProps(i,o,{children:e}))}})),additionalProps:{metadata:u}}),f=g();return new Proxy(f,{get(o,d,k){return d==="value"?e:d==="metadata"?u:d==="use"?C=>g(C):Reflect.get(o,d,k)}})}},R={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}],i=e[s.NodeType.Markdown];return t(i,{...n,children:i,keyPath:l,plugins:[P,...n.plugins??[]]})}},v=()=>{const e={};for(const n of m.HTML_TAGS)e[n]=({children:t,...l})=>r.createComponent(q.Dynamic,r.mergeProps({component:n},l,{children:t}));return e},x=v(),L={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={...x,...c};return m.getHTML(n,a)},i=[t()];return new Proxy(i,{get(c,a,u){return a==="value"?n:a==="use"?g=>t(g):Reflect.get(c,a,u)}})}};exports.ContentSelectorRenderer=y;exports.htmlPlugin=L;exports.insertionPlugin=E;exports.intlayerNodePlugins=b;exports.markdownPlugin=R;exports.markdownStringPlugin=P;exports.solidNodePlugins=K;
|
|
@@ -1,222 +0,0 @@
|
|
|
1
|
-
import { D as w } from "./web-mv0y5CK4.mjs";
|
|
2
|
-
import { isSameKeyPath as M, HTML_TAGS as H, getMarkdownMetadata as C, getHTML as S, splitInsertionTemplate as T } from "@intlayer/core";
|
|
3
|
-
import { NodeType as d } from "@intlayer/types";
|
|
4
|
-
import { createComponent as s, mergeProps as c, createMemo as p } from "solid-js";
|
|
5
|
-
import { useIntlayerContext as b } from "./esm/client/IntlayerProvider.mjs";
|
|
6
|
-
import "@intlayer/config/built";
|
|
7
|
-
import { EditedContentRenderer as K } from "./esm/editor/useEditedContentRenderer.mjs";
|
|
8
|
-
import { renderIntlayerNode as y } from "./esm/IntlayerNode.mjs";
|
|
9
|
-
import "./esm/markdown/MarkdownProvider.mjs";
|
|
10
|
-
import { MarkdownMetadataRenderer as v, MarkdownRenderer as I } from "./esm/markdown/MarkdownRenderer.mjs";
|
|
11
|
-
import { renderSolidElement as R } from "./esm/solidElement/renderSolidElement.mjs";
|
|
12
|
-
import "./esm/client/useLocaleStorage.mjs";
|
|
13
|
-
import "./esm/client/useLocaleBase.mjs";
|
|
14
|
-
import { ContentSelector as L } from "./esm/UI/ContentSelector.mjs";
|
|
15
|
-
import "@intlayer/editor";
|
|
16
|
-
import "./esm/editor/contexts/ConfigurationContext.mjs";
|
|
17
|
-
import "./esm/editor/contexts/DictionariesRecordContext.mjs";
|
|
18
|
-
import "./esm/editor/contexts/EditedContentContext.mjs";
|
|
19
|
-
import { useEditorEnabled as E } from "./esm/editor/contexts/EditorEnabledContext.mjs";
|
|
20
|
-
import "./esm/editor/contexts/CommunicatorContext.mjs";
|
|
21
|
-
import { useFocusDictionary as N } from "./esm/editor/contexts/FocusDictionaryContext.mjs";
|
|
22
|
-
const j = (e) => {
|
|
23
|
-
const {
|
|
24
|
-
focusedContent: n,
|
|
25
|
-
setFocusedContent: t
|
|
26
|
-
} = N(), a = p(() => e.keyPath.filter((o) => o.type !== d.Translation)), i = () => t({
|
|
27
|
-
dictionaryKey: e.dictionaryKey,
|
|
28
|
-
keyPath: a()
|
|
29
|
-
}), u = p(() => (n?.dictionaryKey === e.dictionaryKey && (n?.keyPath?.length ?? 0) > 0 && M(n?.keyPath ?? [], a())) ?? !1);
|
|
30
|
-
return s(L, {
|
|
31
|
-
onPress: i,
|
|
32
|
-
get isSelecting() {
|
|
33
|
-
return u();
|
|
34
|
-
},
|
|
35
|
-
get children() {
|
|
36
|
-
return e.children;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}, f = (e) => {
|
|
40
|
-
const {
|
|
41
|
-
enabled: n
|
|
42
|
-
} = E(), {
|
|
43
|
-
disableEditor: t
|
|
44
|
-
} = b();
|
|
45
|
-
return n() && !t ? s(j, c(e, {
|
|
46
|
-
get children() {
|
|
47
|
-
return e.children;
|
|
48
|
-
}
|
|
49
|
-
})) : e.children;
|
|
50
|
-
}, ae = {
|
|
51
|
-
id: "intlayer-node-plugin",
|
|
52
|
-
canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
|
|
53
|
-
transform: (e, {
|
|
54
|
-
plugins: n,
|
|
55
|
-
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
56
|
-
...t
|
|
57
|
-
}) => y({
|
|
58
|
-
...t,
|
|
59
|
-
value: t.children,
|
|
60
|
-
children: s(f, c(t, {
|
|
61
|
-
get children() {
|
|
62
|
-
return s(K, c(t, {
|
|
63
|
-
get children() {
|
|
64
|
-
return t.children;
|
|
65
|
-
}
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
}))
|
|
69
|
-
})
|
|
70
|
-
}, le = {
|
|
71
|
-
id: "solid-node-plugin",
|
|
72
|
-
canHandle: (e) => typeof e == "object" && e?.props !== void 0 || typeof Node < "u" && e instanceof Node,
|
|
73
|
-
transform: (e, {
|
|
74
|
-
plugins: n,
|
|
75
|
-
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
76
|
-
...t
|
|
77
|
-
}) => y({
|
|
78
|
-
...t,
|
|
79
|
-
value: "[[solid-element]]",
|
|
80
|
-
children: s(f, c(t, {
|
|
81
|
-
get children() {
|
|
82
|
-
return typeof Node < "u" && e instanceof Node ? e : R(e);
|
|
83
|
-
}
|
|
84
|
-
}))
|
|
85
|
-
})
|
|
86
|
-
}, x = (e, n) => {
|
|
87
|
-
const t = T(e, n);
|
|
88
|
-
return t.isSimple, t.parts;
|
|
89
|
-
}, se = {
|
|
90
|
-
id: "insertion-plugin",
|
|
91
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType === d.Insertion,
|
|
92
|
-
transform: (e, n, t) => {
|
|
93
|
-
const a = [...n.keyPath, {
|
|
94
|
-
type: d.Insertion
|
|
95
|
-
}], i = e[d.Insertion];
|
|
96
|
-
return t(i, {
|
|
97
|
-
...n,
|
|
98
|
-
children: i,
|
|
99
|
-
keyPath: a,
|
|
100
|
-
plugins: [{
|
|
101
|
-
id: "insertion-string-plugin",
|
|
102
|
-
canHandle: (o) => typeof o == "string",
|
|
103
|
-
transform: (o, m, g) => {
|
|
104
|
-
const h = g(o, {
|
|
105
|
-
...m,
|
|
106
|
-
children: o,
|
|
107
|
-
plugins: [...(n.plugins ?? []).filter((r) => r.id !== "intlayer-node-plugin" && r.id !== "markdown-string-plugin" && r.id !== "html-string-plugin")]
|
|
108
|
-
});
|
|
109
|
-
return (r) => {
|
|
110
|
-
const l = x(h, r);
|
|
111
|
-
return g(l, {
|
|
112
|
-
...m,
|
|
113
|
-
plugins: n.plugins,
|
|
114
|
-
children: l
|
|
115
|
-
});
|
|
116
|
-
};
|
|
117
|
-
}
|
|
118
|
-
}, ...n.plugins ?? []]
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
}, D = {
|
|
122
|
-
id: "markdown-string-plugin",
|
|
123
|
-
canHandle: (e) => typeof e == "string",
|
|
124
|
-
transform: (e, n, t) => {
|
|
125
|
-
const {
|
|
126
|
-
plugins: a,
|
|
127
|
-
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
128
|
-
...i
|
|
129
|
-
} = n, u = C(e), m = t(u, {
|
|
130
|
-
plugins: [{
|
|
131
|
-
id: "markdown-metadata-plugin",
|
|
132
|
-
canHandle: (r) => typeof r == "string" || typeof r == "number" || typeof r == "boolean" || !r,
|
|
133
|
-
transform: (r, l) => y({
|
|
134
|
-
...l,
|
|
135
|
-
value: r,
|
|
136
|
-
children: s(f, c(i, {
|
|
137
|
-
get children() {
|
|
138
|
-
return s(v, c(i, {
|
|
139
|
-
get metadataKeyPath() {
|
|
140
|
-
return l.keyPath;
|
|
141
|
-
},
|
|
142
|
-
children: e
|
|
143
|
-
}));
|
|
144
|
-
}
|
|
145
|
-
}))
|
|
146
|
-
})
|
|
147
|
-
}],
|
|
148
|
-
dictionaryKey: i.dictionaryKey,
|
|
149
|
-
keyPath: []
|
|
150
|
-
}), g = (r) => y({
|
|
151
|
-
...n,
|
|
152
|
-
value: e,
|
|
153
|
-
children: s(f, c(i, {
|
|
154
|
-
get children() {
|
|
155
|
-
return s(I, c(i, r, {
|
|
156
|
-
children: e
|
|
157
|
-
}));
|
|
158
|
-
}
|
|
159
|
-
})),
|
|
160
|
-
additionalProps: {
|
|
161
|
-
metadata: m
|
|
162
|
-
}
|
|
163
|
-
}), h = g();
|
|
164
|
-
return new Proxy(h, {
|
|
165
|
-
get(r, l, P) {
|
|
166
|
-
return l === "value" ? e : l === "metadata" ? m : l === "use" ? (k) => g(k) : Reflect.get(r, l, P);
|
|
167
|
-
}
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
}, ce = {
|
|
171
|
-
id: "markdown-plugin",
|
|
172
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType === d.Markdown,
|
|
173
|
-
transform: (e, n, t) => {
|
|
174
|
-
const a = [...n.keyPath, {
|
|
175
|
-
type: d.Markdown
|
|
176
|
-
}], i = e[d.Markdown];
|
|
177
|
-
return t(i, {
|
|
178
|
-
...n,
|
|
179
|
-
children: i,
|
|
180
|
-
keyPath: a,
|
|
181
|
-
plugins: [D, ...n.plugins ?? []]
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}, A = () => {
|
|
185
|
-
const e = {};
|
|
186
|
-
for (const n of H)
|
|
187
|
-
e[n] = ({
|
|
188
|
-
children: t,
|
|
189
|
-
...a
|
|
190
|
-
}) => s(w, c({
|
|
191
|
-
component: n
|
|
192
|
-
}, a, {
|
|
193
|
-
children: t
|
|
194
|
-
}));
|
|
195
|
-
return e;
|
|
196
|
-
}, F = A(), de = {
|
|
197
|
-
id: "html-plugin",
|
|
198
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType === d.HTML,
|
|
199
|
-
transform: (e) => {
|
|
200
|
-
const n = e[d.HTML], t = (u) => {
|
|
201
|
-
const o = {
|
|
202
|
-
...F,
|
|
203
|
-
...u
|
|
204
|
-
};
|
|
205
|
-
return S(n, o);
|
|
206
|
-
}, i = [t()];
|
|
207
|
-
return new Proxy(i, {
|
|
208
|
-
get(u, o, m) {
|
|
209
|
-
return o === "value" ? n : o === "use" ? (g) => t(g) : Reflect.get(u, o, m);
|
|
210
|
-
}
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
};
|
|
214
|
-
export {
|
|
215
|
-
f as C,
|
|
216
|
-
se as a,
|
|
217
|
-
D as b,
|
|
218
|
-
de as h,
|
|
219
|
-
ae as i,
|
|
220
|
-
ce as m,
|
|
221
|
-
le as s
|
|
222
|
-
};
|