solid-intlayer 9.0.2 → 9.1.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.
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/esm/plugins.mjs +49 -48
- package/package.json +11 -11
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require("./analytics/exposureSink.cjs"),l=require("./IntlayerNode.cjs"),u=require("./solidElement/renderSolidElement.cjs");let d=require("solid-js/web"),f=require("@intlayer/config/built"),p=require("@intlayer/core/interpreter"),m=require("@intlayer/core/markdown"),h=require("@intlayer/types/nodeType");h=s(h);let g=require("solid-js");var _=process.env.INTLAYER_EDITOR_ENABLED===`false`?null:(0,g.lazy)(()=>Promise.resolve().then(()=>require("./editor/ContentSelector.cjs")).then(e=>({default:e.ContentSelector}))),v=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?null:Promise.resolve().then(()=>require("./markdown/MarkdownRenderer.cjs")).then(e=>({MarkdownRenderer:e.MarkdownRenderer,MarkdownMetadataRenderer:e.MarkdownMetadataRenderer})),y=process.env.INTLAYER_NODE_TYPE_HTML===`false`?null:Promise.resolve().then(()=>require("./html/HTMLRenderer.cjs")).then(e=>e.HTMLRenderer),b={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{plugins:t,...n})=>(process.env.INTLAYER_ANALYTICS_ENABLED!==`false`&&c.reportExposure({dictionaryKey:n.dictionaryKey,keyPath:n.keyPath,locale:n.locale,nodeType:`text`}),l.renderIntlayerNode({...n,value:n.children,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get fallback(){return n.children},get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(n,{get children(){return n.children}}))}}):n.children}))},x=process.env.INTLAYER_NODE_TYPE_SOLID_NODE===`false`?p.fallbackPlugin:{id:`solid-node-plugin`,canHandle:e=>typeof e==`object`&&e?.props!==void 0||typeof Node<`u`&&e instanceof Node,transform:(e,{plugins:t,...n})=>(process.env.INTLAYER_ANALYTICS_ENABLED!==`false`&&c.reportExposure({dictionaryKey:n.dictionaryKey,keyPath:n.keyPath,locale:n.locale,nodeType:`solid-node`}),l.renderIntlayerNode({...n,value:`[[solid-element]]`,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get fallback(){return typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)},get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(n,{get children(){return typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)}}))}}):typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)}))},S=(e,t)=>{let n=(0,p.splitInsertionTemplate)(e,t);return n.isSimple,n.parts},C=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?p.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.INSERTION}],i=e[h.INSERTION];return e=>{let a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,p.isInterpolableWrapperNode)(e),transform:(n,r,i)=>{if((0,p.isInterpolableWrapperNode)(n))return(0,p.transformInterpolableNode)(n,e,r,t.plugins,i);let a=S(i(n,{...r,children:n,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]}),e);return i(a,{...r,plugins:t.plugins,children:a})}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}}},w=(0,g.lazy)(()=>v.then(e=>({default:e.MarkdownRenderer}))),T=(0,g.lazy)(()=>v.then(e=>({default:e.MarkdownMetadataRenderer}))),E=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?p.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,a=n((0,m.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>l.renderIntlayerNode({...n,value:t,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(i,{get children(){return(0,d.createComponent)(T,(0,d.mergeProps)(i,{get metadataKeyPath(){return n.keyPath},children:e}))}}))}}):(0,d.createComponent)(T,(0,d.mergeProps)(i,{get metadataKeyPath(){return n.keyPath},children:e}))})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),o=n=>l.renderIntlayerNode({...t,value:e,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(i,{get children(){return(0,d.createComponent)(w,(0,d.mergeProps)(i,{components:n,children:e}))}}))}}):(0,d.createComponent)(w,(0,d.mergeProps)(i,{components:n,children:e})),additionalProps:{metadata:a}}),s=o();return new Proxy(s,{get(t,n,r){if(n===`value`)return e;if(n===Symbol.toPrimitive||n===`toString`||n===`valueOf`)return()=>e;if(typeof n==`string`&&n!==`constructor`){let t=String.prototype[n];if(typeof t==`function`)return t.bind(e)}return n===`metadata`?a:n===`use`?e=>o(e):Reflect.get(t,n,r)}})}},D=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?p.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.MARKDOWN}],i=e[h.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[E,...t.plugins??[]]})}},O=(0,g.lazy)(()=>y.then(e=>({default:e}))),k=process.env.INTLAYER_NODE_TYPE_HTML===`false`?p.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.HTML,transform:(e,t)=>{let n=e[h.HTML],{plugins:r,children:i,...a}=t,o=e=>l.renderIntlayerNode({...a,value:n,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(a,{get children(){return(0,d.createComponent)(O,(0,d.mergeProps)(a,{html:n,components:e}))}}))}}):(0,d.createComponent)(O,(0,d.mergeProps)(a,{html:n,components:e}))}),s=[o()];return new Proxy(s,{get(e,t,r){if(t===`value`)return n;if(t===Symbol.toPrimitive||t===`toString`||t===`valueOf`)return()=>n;if(typeof t==`string`&&t!==`constructor`){let e=String.prototype[t];if(typeof e==`function`)return e.bind(n)}return t===`use`?e=>o(e):Reflect.get(e,t,r)}})}},A=new Map,j=(e,t=!0)=>{let n=`${e??f.internationalization.defaultLocale}_${t}`;if(A.has(n))return A.get(n);let r=[(0,p.translationPlugin)(e??f.internationalization.defaultLocale,t?f.internationalization.defaultLocale:void 0),p.enumerationPlugin,(0,p.pluralPlugin)(e??f.internationalization.defaultLocale),p.conditionPlugin,(0,p.nestedPlugin)(e??f.internationalization.defaultLocale),p.filePlugin,p.genderPlugin,b,x,C,D,k];return A.set(n,r),r};exports.getPlugins=j,exports.htmlPlugin=k,exports.insertionPlugin=C,exports.intlayerNodePlugins=b,exports.markdownPlugin=D,exports.markdownStringPlugin=E,exports.solidNodePlugins=x;
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},s=(n,r,a)=>(a=n==null?{}:e(i(n)),o(r||!n||!n.__esModule?t(a,`default`,{value:n,enumerable:!0}):a,n));const c=require("./analytics/exposureSink.cjs"),l=require("./IntlayerNode.cjs"),u=require("./solidElement/renderSolidElement.cjs");let d=require("solid-js/web"),f=require("@intlayer/config/built"),p=require("@intlayer/core/interpreter"),m=require("@intlayer/core/markdown"),h=require("@intlayer/types/nodeType");h=s(h);let g=require("solid-js");var _=process.env.INTLAYER_EDITOR_ENABLED===`false`?null:(0,g.lazy)(()=>Promise.resolve().then(()=>require("./editor/ContentSelector.cjs")).then(e=>({default:e.ContentSelector}))),v=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?null:Promise.resolve().then(()=>require("./markdown/MarkdownRenderer.cjs")).then(e=>({MarkdownRenderer:e.MarkdownRenderer,MarkdownMetadataRenderer:e.MarkdownMetadataRenderer})),y=process.env.INTLAYER_NODE_TYPE_HTML===`false`?null:Promise.resolve().then(()=>require("./html/HTMLRenderer.cjs")).then(e=>e.HTMLRenderer),b={id:`intlayer-node-plugin`,canHandle:e=>typeof e==`bigint`||typeof e==`string`||typeof e==`number`,transform:(e,{plugins:t,...n})=>(process.env.INTLAYER_ANALYTICS_ENABLED!==`false`&&c.reportExposure({dictionaryKey:n.dictionaryKey,keyPath:n.keyPath,locale:n.locale,nodeType:`text`}),l.renderIntlayerNode({...n,value:n.children,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get fallback(){return n.children},get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(n,{get children(){return n.children}}))}}):n.children}))},x=process.env.INTLAYER_NODE_TYPE_SOLID_NODE===`false`?p.fallbackPlugin:{id:`solid-node-plugin`,canHandle:e=>typeof e==`object`&&e?.props!==void 0||typeof Node<`u`&&e instanceof Node,transform:(e,{plugins:t,...n})=>(process.env.INTLAYER_ANALYTICS_ENABLED!==`false`&&c.reportExposure({dictionaryKey:n.dictionaryKey,keyPath:n.keyPath,locale:n.locale,nodeType:`solid-node`}),l.renderIntlayerNode({...n,value:`[[solid-element]]`,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get fallback(){return typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)},get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(n,{get children(){return typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)}}))}}):typeof Node<`u`&&e instanceof Node?e:u.renderSolidElement(e)}))},S=(e,t)=>{let n=(0,p.splitInsertionTemplate)(e,t);return n.isSimple,n.parts},C=process.env.INTLAYER_NODE_TYPE_INSERTION===`false`?p.fallbackPlugin:{id:`insertion-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.INSERTION,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.INSERTION}],i=e[h.INSERTION];return e=>{let a={id:`insertion-string-plugin`,canHandle:e=>typeof e==`string`||(0,p.isInterpolableWrapperNode)(e),transform:(n,r,i)=>{if((0,p.isInterpolableWrapperNode)(n))return(0,p.transformInterpolableNode)(n,e,r,t.plugins,i);let a=S(i(n,{...r,children:n,plugins:[...(t.plugins??[]).filter(e=>e.id!==`intlayer-node-plugin`)]}),e);return i(a,{...r,plugins:t.plugins,children:a})}};return n(i,{...t,children:i,keyPath:r,plugins:[a,...t.plugins??[]]})}}},w=(0,g.lazy)(()=>v.then(e=>({default:e.MarkdownRenderer}))),T=(0,g.lazy)(()=>v.then(e=>({default:e.MarkdownMetadataRenderer}))),E=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?p.fallbackPlugin:{id:`markdown-string-plugin`,canHandle:e=>typeof e==`string`,transform:(e,t,n)=>{let{plugins:r,...i}=t,a=n((0,m.getMarkdownMetadata)(e)??{},{plugins:[{id:`markdown-metadata-plugin`,canHandle:e=>typeof e==`string`||typeof e==`number`||typeof e==`boolean`||!e,transform:(t,n)=>l.renderIntlayerNode({...n,value:t,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(i,{get children(){return(0,d.createComponent)(T,(0,d.mergeProps)(i,{get metadataKeyPath(){return n.keyPath},children:e}))}}))}}):(0,d.createComponent)(T,(0,d.mergeProps)(i,{get metadataKeyPath(){return n.keyPath},children:e}))})}],dictionaryKey:i.dictionaryKey,keyPath:[]}),o=n=>l.renderIntlayerNode({...t,value:e,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(i,{get children(){return(0,d.createComponent)(w,(0,d.mergeProps)(i,{components:n,children:e}))}}))}}):(0,d.createComponent)(w,(0,d.mergeProps)(i,{components:n,children:e})),additionalProps:{metadata:a}}),s=o();return new Proxy(s,{get(t,n,r){if(n===`value`)return e;if(n===Symbol.toPrimitive||n===`toString`||n===`valueOf`)return()=>e;if(typeof n==`string`&&n!==`constructor`){let t=String.prototype[n];if(typeof t==`function`)return t.bind(e)}return n===`metadata`?a:n===`use`?e=>o(e):Reflect.get(t,n,r)}})}},D=process.env.INTLAYER_NODE_TYPE_MARKDOWN===`false`?p.fallbackPlugin:{id:`markdown-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.MARKDOWN,transform:(e,t,n)=>{let r=[...t.keyPath,{type:h.MARKDOWN}],i=e[h.MARKDOWN];return n(i,{...t,children:i,keyPath:r,plugins:[E,...t.plugins??[]]})}},O=(0,g.lazy)(()=>y.then(e=>({default:e}))),k=process.env.INTLAYER_NODE_TYPE_HTML===`false`?p.fallbackPlugin:{id:`html-plugin`,canHandle:e=>typeof e==`object`&&e?.nodeType===h.HTML,transform:(e,t)=>{let n=e[h.HTML],{plugins:r,children:i,...a}=t,o=e=>l.renderIntlayerNode({...a,value:n,children:process.env.INTLAYER_EDITOR_ENABLED!==`false`&&f.editor.enabled?(0,d.createComponent)(g.Suspense,{get children(){return(0,d.createComponent)(_,(0,d.mergeProps)(a,{get children(){return(0,d.createComponent)(O,(0,d.mergeProps)(a,{html:n,components:e}))}}))}}):(0,d.createComponent)(O,(0,d.mergeProps)(a,{html:n,components:e}))}),s=[o()];return new Proxy(s,{get(e,t,r){if(t===`value`)return n;if(t===Symbol.toPrimitive||t===`toString`||t===`valueOf`)return()=>n;if(typeof t==`string`&&t!==`constructor`){let e=String.prototype[t];if(typeof e==`function`)return e.bind(n)}return t===`use`?e=>o(e):Reflect.get(e,t,r)}})}},A=new Map,j=(e,t=!0)=>{let n=`${e??f.internationalization.defaultLocale}_${t}`;if(A.has(n))return A.get(n);let r=[(0,p.translationPlugin)(e??f.internationalization.defaultLocale,t?f.internationalization.defaultLocale:void 0),p.enumerationPlugin,(0,p.pluralPlugin)(e??f.internationalization.defaultLocale),p.conditionPlugin,(0,p.nestedPlugin)(e??f.internationalization.defaultLocale),p.filePlugin,p.genderPlugin,p.selectPlugin,b,x,C,D,k];return A.set(n,r),r};exports.getPlugins=j,exports.htmlPlugin=k,exports.insertionPlugin=C,exports.intlayerNodePlugins=b,exports.markdownPlugin=D,exports.markdownStringPlugin=E,exports.solidNodePlugins=x;
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -3,15 +3,15 @@ import { renderIntlayerNode as t } from "./IntlayerNode.mjs";
|
|
|
3
3
|
import { renderSolidElement as n } from "./solidElement/renderSolidElement.mjs";
|
|
4
4
|
import { createComponent as r, mergeProps as i } from "solid-js/web";
|
|
5
5
|
import { editor as a, internationalization as o } from "@intlayer/config/built";
|
|
6
|
-
import { conditionPlugin as s, enumerationPlugin as c, fallbackPlugin as l, filePlugin as u, genderPlugin as d, isInterpolableWrapperNode as f, nestedPlugin as p, pluralPlugin as m,
|
|
7
|
-
import { getMarkdownMetadata as
|
|
8
|
-
import * as
|
|
9
|
-
import { Suspense as
|
|
6
|
+
import { conditionPlugin as s, enumerationPlugin as c, fallbackPlugin as l, filePlugin as u, genderPlugin as d, isInterpolableWrapperNode as f, nestedPlugin as p, pluralPlugin as m, selectPlugin as h, splitInsertionTemplate as g, transformInterpolableNode as _, translationPlugin as v } from "@intlayer/core/interpreter";
|
|
7
|
+
import { getMarkdownMetadata as y } from "@intlayer/core/markdown";
|
|
8
|
+
import * as b from "@intlayer/types/nodeType";
|
|
9
|
+
import { Suspense as x, lazy as S } from "solid-js";
|
|
10
10
|
//#region src/plugins.tsx
|
|
11
|
-
var
|
|
11
|
+
var C = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : S(() => import("./editor/ContentSelector.mjs").then((e) => ({ default: e.ContentSelector }))), w = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? null : import("./markdown/MarkdownRenderer.mjs").then((e) => ({
|
|
12
12
|
MarkdownRenderer: e.MarkdownRenderer,
|
|
13
13
|
MarkdownMetadataRenderer: e.MarkdownMetadataRenderer
|
|
14
|
-
})),
|
|
14
|
+
})), T = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? null : import("./html/HTMLRenderer.mjs").then((e) => e.HTMLRenderer), E = {
|
|
15
15
|
id: "intlayer-node-plugin",
|
|
16
16
|
canHandle: (e) => typeof e == "bigint" || typeof e == "string" || typeof e == "number",
|
|
17
17
|
transform: (n, { plugins: o, ...s }) => (process.env.INTLAYER_ANALYTICS_ENABLED !== "false" && e({
|
|
@@ -22,18 +22,18 @@ var S = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : x(() => import(
|
|
|
22
22
|
}), t({
|
|
23
23
|
...s,
|
|
24
24
|
value: s.children,
|
|
25
|
-
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(
|
|
25
|
+
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(x, {
|
|
26
26
|
get fallback() {
|
|
27
27
|
return s.children;
|
|
28
28
|
},
|
|
29
29
|
get children() {
|
|
30
|
-
return r(
|
|
30
|
+
return r(C, i(s, { get children() {
|
|
31
31
|
return s.children;
|
|
32
32
|
} }));
|
|
33
33
|
}
|
|
34
34
|
}) : s.children
|
|
35
35
|
}))
|
|
36
|
-
},
|
|
36
|
+
}, D = process.env.INTLAYER_NODE_TYPE_SOLID_NODE === "false" ? l : {
|
|
37
37
|
id: "solid-node-plugin",
|
|
38
38
|
canHandle: (e) => typeof e == "object" && e?.props !== void 0 || typeof Node < "u" && e instanceof Node,
|
|
39
39
|
transform: (o, { plugins: s, ...c }) => (process.env.INTLAYER_ANALYTICS_ENABLED !== "false" && e({
|
|
@@ -44,32 +44,32 @@ var S = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : x(() => import(
|
|
|
44
44
|
}), t({
|
|
45
45
|
...c,
|
|
46
46
|
value: "[[solid-element]]",
|
|
47
|
-
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(
|
|
47
|
+
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(x, {
|
|
48
48
|
get fallback() {
|
|
49
49
|
return typeof Node < "u" && o instanceof Node ? o : n(o);
|
|
50
50
|
},
|
|
51
51
|
get children() {
|
|
52
|
-
return r(
|
|
52
|
+
return r(C, i(c, { get children() {
|
|
53
53
|
return typeof Node < "u" && o instanceof Node ? o : n(o);
|
|
54
54
|
} }));
|
|
55
55
|
}
|
|
56
56
|
}) : typeof Node < "u" && o instanceof Node ? o : n(o)
|
|
57
57
|
}))
|
|
58
|
-
},
|
|
59
|
-
let n =
|
|
58
|
+
}, O = (e, t) => {
|
|
59
|
+
let n = g(e, t);
|
|
60
60
|
return n.isSimple, n.parts;
|
|
61
|
-
},
|
|
61
|
+
}, k = process.env.INTLAYER_NODE_TYPE_INSERTION === "false" ? l : {
|
|
62
62
|
id: "insertion-plugin",
|
|
63
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
63
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === b.INSERTION,
|
|
64
64
|
transform: (e, t, n) => {
|
|
65
|
-
let r = [...t.keyPath, { type:
|
|
65
|
+
let r = [...t.keyPath, { type: b.INSERTION }], i = e[b.INSERTION];
|
|
66
66
|
return (e) => {
|
|
67
67
|
let a = {
|
|
68
68
|
id: "insertion-string-plugin",
|
|
69
69
|
canHandle: (e) => typeof e == "string" || f(e),
|
|
70
70
|
transform: (n, r, i) => {
|
|
71
|
-
if (f(n)) return
|
|
72
|
-
let a =
|
|
71
|
+
if (f(n)) return _(n, e, r, t.plugins, i);
|
|
72
|
+
let a = O(i(n, {
|
|
73
73
|
...r,
|
|
74
74
|
children: n,
|
|
75
75
|
plugins: [...(t.plugins ?? []).filter((e) => e.id !== "intlayer-node-plugin")]
|
|
@@ -89,27 +89,27 @@ var S = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : x(() => import(
|
|
|
89
89
|
});
|
|
90
90
|
};
|
|
91
91
|
}
|
|
92
|
-
},
|
|
92
|
+
}, A = S(() => w.then((e) => ({ default: e.MarkdownRenderer }))), j = S(() => w.then((e) => ({ default: e.MarkdownMetadataRenderer }))), M = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? l : {
|
|
93
93
|
id: "markdown-string-plugin",
|
|
94
94
|
canHandle: (e) => typeof e == "string",
|
|
95
95
|
transform: (e, n, o) => {
|
|
96
|
-
let { plugins: s, ...c } = n, l = o(
|
|
96
|
+
let { plugins: s, ...c } = n, l = o(y(e) ?? {}, {
|
|
97
97
|
plugins: [{
|
|
98
98
|
id: "markdown-metadata-plugin",
|
|
99
99
|
canHandle: (e) => typeof e == "string" || typeof e == "number" || typeof e == "boolean" || !e,
|
|
100
100
|
transform: (n, o) => t({
|
|
101
101
|
...o,
|
|
102
102
|
value: n,
|
|
103
|
-
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(
|
|
104
|
-
return r(
|
|
105
|
-
return r(
|
|
103
|
+
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(x, { get children() {
|
|
104
|
+
return r(C, i(c, { get children() {
|
|
105
|
+
return r(j, i(c, {
|
|
106
106
|
get metadataKeyPath() {
|
|
107
107
|
return o.keyPath;
|
|
108
108
|
},
|
|
109
109
|
children: e
|
|
110
110
|
}));
|
|
111
111
|
} }));
|
|
112
|
-
} }) : r(
|
|
112
|
+
} }) : r(j, i(c, {
|
|
113
113
|
get metadataKeyPath() {
|
|
114
114
|
return o.keyPath;
|
|
115
115
|
},
|
|
@@ -122,14 +122,14 @@ var S = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : x(() => import(
|
|
|
122
122
|
}), u = (o) => t({
|
|
123
123
|
...n,
|
|
124
124
|
value: e,
|
|
125
|
-
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(
|
|
126
|
-
return r(
|
|
127
|
-
return r(
|
|
125
|
+
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(x, { get children() {
|
|
126
|
+
return r(C, i(c, { get children() {
|
|
127
|
+
return r(A, i(c, {
|
|
128
128
|
components: o,
|
|
129
129
|
children: e
|
|
130
130
|
}));
|
|
131
131
|
} }));
|
|
132
|
-
} }) : r(
|
|
132
|
+
} }) : r(A, i(c, {
|
|
133
133
|
components: o,
|
|
134
134
|
children: e
|
|
135
135
|
})),
|
|
@@ -145,33 +145,33 @@ var S = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : x(() => import(
|
|
|
145
145
|
return n === "metadata" ? l : n === "use" ? (e) => u(e) : Reflect.get(t, n, r);
|
|
146
146
|
} });
|
|
147
147
|
}
|
|
148
|
-
},
|
|
148
|
+
}, N = process.env.INTLAYER_NODE_TYPE_MARKDOWN === "false" ? l : {
|
|
149
149
|
id: "markdown-plugin",
|
|
150
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
150
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === b.MARKDOWN,
|
|
151
151
|
transform: (e, t, n) => {
|
|
152
|
-
let r = [...t.keyPath, { type:
|
|
152
|
+
let r = [...t.keyPath, { type: b.MARKDOWN }], i = e[b.MARKDOWN];
|
|
153
153
|
return n(i, {
|
|
154
154
|
...t,
|
|
155
155
|
children: i,
|
|
156
156
|
keyPath: r,
|
|
157
|
-
plugins: [
|
|
157
|
+
plugins: [M, ...t.plugins ?? []]
|
|
158
158
|
});
|
|
159
159
|
}
|
|
160
|
-
},
|
|
160
|
+
}, P = S(() => T.then((e) => ({ default: e }))), F = process.env.INTLAYER_NODE_TYPE_HTML === "false" ? l : {
|
|
161
161
|
id: "html-plugin",
|
|
162
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType ===
|
|
162
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === b.HTML,
|
|
163
163
|
transform: (e, n) => {
|
|
164
|
-
let o = e[
|
|
164
|
+
let o = e[b.HTML], { plugins: s, children: c, ...l } = n, u = (e) => t({
|
|
165
165
|
...l,
|
|
166
166
|
value: o,
|
|
167
|
-
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(
|
|
168
|
-
return r(
|
|
169
|
-
return r(
|
|
167
|
+
children: process.env.INTLAYER_EDITOR_ENABLED !== "false" && a.enabled ? r(x, { get children() {
|
|
168
|
+
return r(C, i(l, { get children() {
|
|
169
|
+
return r(P, i(l, {
|
|
170
170
|
html: o,
|
|
171
171
|
components: e
|
|
172
172
|
}));
|
|
173
173
|
} }));
|
|
174
|
-
} }) : r(
|
|
174
|
+
} }) : r(P, i(l, {
|
|
175
175
|
html: o,
|
|
176
176
|
components: e
|
|
177
177
|
}))
|
|
@@ -186,24 +186,25 @@ var S = process.env.INTLAYER_EDITOR_ENABLED === "false" ? null : x(() => import(
|
|
|
186
186
|
return t === "use" ? (e) => u(e) : Reflect.get(e, t, n);
|
|
187
187
|
} });
|
|
188
188
|
}
|
|
189
|
-
},
|
|
189
|
+
}, I = /* @__PURE__ */ new Map(), L = (e, t = !0) => {
|
|
190
190
|
let n = `${e ?? o.defaultLocale}_${t}`;
|
|
191
|
-
if (
|
|
191
|
+
if (I.has(n)) return I.get(n);
|
|
192
192
|
let r = [
|
|
193
|
-
|
|
193
|
+
v(e ?? o.defaultLocale, t ? o.defaultLocale : void 0),
|
|
194
194
|
c,
|
|
195
195
|
m(e ?? o.defaultLocale),
|
|
196
196
|
s,
|
|
197
197
|
p(e ?? o.defaultLocale),
|
|
198
198
|
u,
|
|
199
199
|
d,
|
|
200
|
-
|
|
200
|
+
h,
|
|
201
201
|
E,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
D,
|
|
203
|
+
k,
|
|
204
|
+
N,
|
|
205
|
+
F
|
|
205
206
|
];
|
|
206
|
-
return
|
|
207
|
+
return I.set(n, r), r;
|
|
207
208
|
};
|
|
208
209
|
//#endregion
|
|
209
|
-
export {
|
|
210
|
+
export { L as getPlugins, F as htmlPlugin, k as insertionPlugin, E as intlayerNodePlugins, N as markdownPlugin, M as markdownStringPlugin, D as solidNodePlugins };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-intlayer",
|
|
3
|
-
"version": "9.0
|
|
3
|
+
"version": "9.1.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Easily internationalize i18n your Solid applications with type-safe multilingual content management.",
|
|
6
6
|
"keywords": [
|
|
@@ -113,35 +113,35 @@
|
|
|
113
113
|
"typecheck": "tsc --noEmit --project tsconfig.types.json"
|
|
114
114
|
},
|
|
115
115
|
"dependencies": {
|
|
116
|
-
"@intlayer/api": "9.0
|
|
117
|
-
"@intlayer/config": "9.0
|
|
118
|
-
"@intlayer/core": "9.0
|
|
119
|
-
"@intlayer/editor": "9.0
|
|
120
|
-
"@intlayer/types": "9.0
|
|
116
|
+
"@intlayer/api": "9.1.0",
|
|
117
|
+
"@intlayer/config": "9.1.0",
|
|
118
|
+
"@intlayer/core": "9.1.0",
|
|
119
|
+
"@intlayer/editor": "9.1.0",
|
|
120
|
+
"@intlayer/types": "9.1.0"
|
|
121
121
|
},
|
|
122
122
|
"devDependencies": {
|
|
123
123
|
"@solidjs/testing-library": "0.8.10",
|
|
124
124
|
"@testing-library/jest-dom": "7.0.0",
|
|
125
125
|
"@testing-library/user-event": "14.6.1",
|
|
126
|
-
"@types/node": "26.1.
|
|
126
|
+
"@types/node": "26.1.2",
|
|
127
127
|
"@typescript/typescript6": "^6.0.2",
|
|
128
128
|
"@utils/ts-config": "1.0.4",
|
|
129
129
|
"@utils/ts-config-types": "1.0.4",
|
|
130
130
|
"@utils/tsdown-config": "1.0.4",
|
|
131
|
-
"jsdom": "
|
|
131
|
+
"jsdom": "30.0.1",
|
|
132
132
|
"rimraf": "6.1.3",
|
|
133
133
|
"tsdown": "0.22.14",
|
|
134
134
|
"typescript": "7.0.2",
|
|
135
|
-
"vite": "8.
|
|
135
|
+
"vite": "8.2.0",
|
|
136
136
|
"vite-plugin-dts": "5.0.3",
|
|
137
|
-
"vite-plugin-solid": "2.11.
|
|
137
|
+
"vite-plugin-solid": "2.11.14",
|
|
138
138
|
"vitest": "4.1.10"
|
|
139
139
|
},
|
|
140
140
|
"peerDependencies": {
|
|
141
141
|
"solid-js": ">=1.0.0"
|
|
142
142
|
},
|
|
143
143
|
"optionalDependencies": {
|
|
144
|
-
"@intlayer/analytics": "9.0
|
|
144
|
+
"@intlayer/analytics": "9.1.0"
|
|
145
145
|
},
|
|
146
146
|
"engines": {
|
|
147
147
|
"node": ">=14.18"
|