solid-intlayer 8.0.0-canary.1 → 8.0.0-canary.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/dist/cjs/IntlayerNode.cjs +1 -1
- 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/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 -0
- package/dist/cjs/markdown/index.cjs +1 -1
- package/dist/cjs/markdown/runtime.cjs +1 -0
- package/dist/cjs/plugins.cjs +1 -1
- package/dist/esm/IntlayerNode.mjs +11 -10
- package/dist/esm/editor/ContentSelectorWrapper.mjs +1 -1
- package/dist/esm/editor/index.mjs +1 -1
- package/dist/esm/getDictionary.mjs +9 -8
- package/dist/esm/getIntlayer.mjs +10 -9
- package/dist/esm/index.mjs +43 -47
- package/dist/esm/markdown/MarkdownProvider.mjs +35 -11
- package/dist/esm/markdown/MarkdownRenderer.mjs +29 -17
- package/dist/esm/markdown/compiler.mjs +8 -0
- package/dist/esm/markdown/index.mjs +13 -7
- package/dist/esm/markdown/runtime.mjs +42 -0
- package/dist/esm/plugins.mjs +7 -6
- package/dist/plugins-CAuPi9pi.mjs +235 -0
- package/dist/plugins-DJinCEPo.js +1 -0
- package/dist/types/client/useLocale.d.ts +2 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/markdown/MarkdownProvider.d.ts +8 -1
- package/dist/types/markdown/MarkdownRenderer.d.ts +5 -0
- package/dist/types/markdown/compiler.d.ts +11 -0
- package/dist/types/markdown/index.d.ts +2 -0
- package/dist/types/markdown/runtime.d.ts +7 -0
- package/dist/types/plugins.d.ts +15 -1
- package/package.json +9 -9
- package/dist/plugins-BXXH1pIx.mjs +0 -197
- package/dist/plugins-D2xp5Loy.js +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=({children:f,value:r,additionalProps:n})=>{const i=[f];if(i.value=r,n)for(const e in n)i[e]=n[e];return new Proxy(i,{get(e,t,g){return t==="value"?r:t==="toString"?()=>String(r):t===Symbol.toPrimitive?u=>u==="string"?String(r):u==="number"?Number(r):r:Reflect.get(e,t,g)}})};exports.renderIntlayerNode=o;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/core");require("@intlayer/types");require("solid-js");require("../client/IntlayerProvider.cjs");require("@intlayer/config/built");const e=require("../../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("@intlayer/core");require("@intlayer/types");require("solid-js");require("../client/IntlayerProvider.cjs");require("@intlayer/config/built");const e=require("../../plugins-DJinCEPo.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-DJinCEPo.js");exports.ContentSelectorRenderer=e.ContentSelectorRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core"),e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("@intlayer/core"),e=require("../plugins-DJinCEPo.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
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("@intlayer/core"),e=require("../plugins-DJinCEPo.js"),l=(t,n,r)=>{const o=[e.intlayerNodePlugins,e.solidNodePlugins,e.insertionPlugin,e.markdownPlugin,e.htmlPlugin,...r??[]];return i.getIntlayer(t,n,o)};exports.getIntlayer=l;
|
package/dist/cjs/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./client/format/useIntl.cjs"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./client/format/useIntl.cjs"),n=require("./client/getBrowserLocale.cjs"),r=require("./client/IntlayerProvider.cjs"),a=require("./client/t.cjs"),i=require("./client/useDictionary.cjs"),c=require("./client/useDictionaryAsync.cjs"),s=require("./client/useDictionaryDynamic.cjs"),l=require("./client/useIntlayer.cjs"),u=require("./client/useLoadDynamic.cjs"),y=require("./client/useLocale.cjs"),d=require("./client/useLocaleBase.cjs"),e=require("./client/useLocaleStorage.cjs"),I=require("./getDictionary.cjs"),L=require("./getIntlayer.cjs"),k=require("./markdown/compiler.cjs"),o=require("./markdown/MarkdownProvider.cjs"),g=require("./markdown/MarkdownRenderer.cjs");exports.useIntl=t.useIntl;exports.getBrowserLocale=n.getBrowserLocale;exports.IntlayerClientContext=r.IntlayerClientContext;exports.IntlayerProvider=r.IntlayerProvider;exports.IntlayerProviderContent=r.IntlayerProviderContent;exports.useIntlayerContext=r.useIntlayerContext;exports.t=a.t;exports.useDictionary=i.useDictionary;exports.useDictionaryAsync=c.useDictionaryAsync;exports.useDictionaryDynamic=s.useDictionaryDynamic;exports.useIntlayer=l.useIntlayer;exports.useLoadDynamic=u.useLoadDynamic;exports.useLocale=y.useLocale;exports.useLocaleBase=d.useLocaleBase;exports.localeCookie=e.localeCookie;exports.localeInStorage=e.localeInStorage;exports.setLocaleCookie=e.setLocaleCookie;exports.setLocaleInStorage=e.setLocaleInStorage;exports.useLocaleCookie=e.useLocaleCookie;exports.useLocaleStorage=e.useLocaleStorage;exports.getDictionary=I.getDictionary;exports.getIntlayer=L.getIntlayer;exports.compileMarkdown=k.compileMarkdown;exports.MarkdownProvider=o.MarkdownProvider;exports.useMarkdown=o.useMarkdown;exports.MarkdownRenderer=g.MarkdownRenderer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("solid-js"),p=require("./compiler.cjs"),n=t.createContext(),f=e=>{const a=(o,r)=>{if(e.renderMarkdown)return e.renderMarkdown(o,r);const c=r&&typeof r=="object"&&("components"in r||"wrapper"in r||"forceBlock"in r||"preserveFrontmatter"in r||"tagfilter"in r),{components:l,wrapper:i,forceBlock:d,preserveFrontmatter:w,tagfilter:s,...m}=c?r:{components:r},k=l||m,u={forceBlock:d??e.forceBlock,preserveFrontmatter:w??e.preserveFrontmatter,tagfilter:s??e.tagfilter,wrapper:i||e.wrapper,components:{...e.components,...k}};return p.compileMarkdown(o,u)};return t.createComponent(n.Provider,{value:{renderMarkdown:a},get children(){return e.children}})},M=()=>{const e=t.useContext(n);if(!e)throw new Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");return e};exports.MarkdownContext=n;exports.MarkdownProvider=f;exports.useMarkdown=M;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("@intlayer/core"),a=require("../editor/useEditedContentRenderer.cjs"),s=require("./MarkdownProvider.cjs"),h=e=>{const{renderMarkdown:n}=s.useMarkdown(),t=a.useEditedContentRenderer({dictionaryKey:e.dictionaryKey,keyPath:e.keyPath,children:e.children}),r=typeof t=="string"?t:e.children,{dictionaryKey:M,keyPath:w,locale:P,children:m,components:o,wrapper:c,forceBlock:i,preserveFrontmatter:y,tagfilter:k,...l}=e;return n(r,{components:o,wrapper:c,forceBlock:i,preserveFrontmatter:y,tagfilter:k,...l})},u=e=>{const n=a.useEditedContentRenderer({dictionaryKey:e.dictionaryKey,keyPath:e.keyPath,children:e.children}),t=d.getMarkdownMetadata(n);return d.getContentNodeByKeyPath(t,e.metadataKeyPath)};exports.MarkdownMetadataRenderer=u;exports.MarkdownRenderer=h;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("@intlayer/core"),t=require("./runtime.cjs"),e=(o="",i={})=>r.compileWithOptions(o,t.solidRuntime,i),c=e,n=e;exports.compile=n;exports.compileMarkdown=e;exports.compiler=c;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./compiler.cjs"),e=require("./MarkdownProvider.cjs"),o=require("./MarkdownRenderer.cjs"),n=require("./runtime.cjs");exports.compile=r.compile;exports.compileMarkdown=r.compileMarkdown;exports.compiler=r.compiler;exports.MarkdownContext=e.MarkdownContext;exports.MarkdownProvider=e.MarkdownProvider;exports.useMarkdown=e.useMarkdown;exports.MarkdownMetadataRenderer=o.MarkdownMetadataRenderer;exports.MarkdownRenderer=o.MarkdownRenderer;exports.solidRuntime=n.solidRuntime;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../web-Ch-xTpJg.js"),s=require("solid-js"),u={createElement:(e,n,...t)=>s.createComponent(i.Dynamic,{get component(){return e},...n,get children(){return t.length===1?t[0]:t}}),cloneElement:(e,n)=>typeof e=="function"?s.createComponent(e,n):e,Fragment:e=>e.children,normalizeProps:(e,n)=>{const t={};for(const[r,o]of Object.entries(n))r==="className"?t.class=o:t[r]=o;return t}};exports.default=u;exports.solidRuntime=u;
|
package/dist/cjs/plugins.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../web-Ch-xTpJg.js");require("@intlayer/core");require("@intlayer/types");const e=require("../plugins-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("../web-Ch-xTpJg.js");require("@intlayer/core");require("@intlayer/types");const e=require("../plugins-DJinCEPo.js");require("./editor/useEditedContentRenderer.cjs");require("./IntlayerNode.cjs");require("./markdown/MarkdownProvider.cjs");require("./markdown/MarkdownRenderer.cjs");require("./solidElement/renderSolidElement.cjs");require("solid-js");exports.htmlPlugin=e.htmlPlugin;exports.insertionPlugin=e.insertionPlugin;exports.interpreterPluginsEnabledState=e.interpreterPluginsEnabledState;exports.intlayerNodePlugins=e.intlayerNodePlugins;exports.markdownPlugin=e.markdownPlugin;exports.markdownStringPlugin=e.markdownStringPlugin;exports.solidNodePlugins=e.solidNodePlugins;
|
|
@@ -1,17 +1,18 @@
|
|
|
1
|
-
const
|
|
2
|
-
children:
|
|
3
|
-
value:
|
|
1
|
+
const c = ({
|
|
2
|
+
children: g,
|
|
3
|
+
value: r,
|
|
4
4
|
additionalProps: n
|
|
5
5
|
}) => {
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
6
|
+
const i = [g];
|
|
7
|
+
if (i.value = r, n)
|
|
8
|
+
for (const t in n)
|
|
9
|
+
i[t] = n[t];
|
|
10
|
+
return new Proxy(i, {
|
|
11
|
+
get(t, e, u) {
|
|
12
|
+
return e === "value" ? r : e === "toString" ? () => String(r) : e === Symbol.toPrimitive ? (f) => f === "string" ? String(r) : f === "number" ? Number(r) : r : Reflect.get(t, e, u);
|
|
12
13
|
}
|
|
13
14
|
});
|
|
14
15
|
};
|
|
15
16
|
export {
|
|
16
|
-
|
|
17
|
+
c as renderIntlayerNode
|
|
17
18
|
};
|
|
@@ -3,7 +3,7 @@ import "@intlayer/types";
|
|
|
3
3
|
import "solid-js";
|
|
4
4
|
import "../client/IntlayerProvider.mjs";
|
|
5
5
|
import "@intlayer/config/built";
|
|
6
|
-
import { C as S } from "../../plugins-
|
|
6
|
+
import { C as S } from "../../plugins-CAuPi9pi.mjs";
|
|
7
7
|
import "../client/useLocaleStorage.mjs";
|
|
8
8
|
import "../client/useLocaleBase.mjs";
|
|
9
9
|
import "../UI/ContentSelector.mjs";
|
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { getDictionary as
|
|
2
|
-
import { i as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
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-CAuPi9pi.mjs";
|
|
3
|
+
const c = (i, n, o) => {
|
|
4
|
+
const t = [
|
|
5
|
+
r,
|
|
6
6
|
a,
|
|
7
7
|
e,
|
|
8
8
|
g,
|
|
9
|
-
|
|
9
|
+
l,
|
|
10
|
+
...o ?? []
|
|
10
11
|
];
|
|
11
|
-
return
|
|
12
|
+
return s(i, n, t);
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
c as getDictionary
|
|
15
16
|
};
|
package/dist/esm/getIntlayer.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { getIntlayer as
|
|
2
|
-
import { i as
|
|
3
|
-
const
|
|
4
|
-
const
|
|
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-CAuPi9pi.mjs";
|
|
3
|
+
const P = (n, t, s) => {
|
|
4
|
+
const i = [
|
|
5
|
+
a,
|
|
6
|
+
e,
|
|
5
7
|
l,
|
|
6
8
|
o,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
...r ?? []
|
|
9
|
+
g,
|
|
10
|
+
...s ?? []
|
|
10
11
|
];
|
|
11
|
-
return
|
|
12
|
+
return r(n, t, i);
|
|
12
13
|
};
|
|
13
14
|
export {
|
|
14
|
-
|
|
15
|
+
P as getIntlayer
|
|
15
16
|
};
|
package/dist/esm/index.mjs
CHANGED
|
@@ -1,49 +1,45 @@
|
|
|
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 { getDictionary as
|
|
14
|
-
import { getIntlayer as
|
|
15
|
-
import {
|
|
16
|
-
import "
|
|
17
|
-
import "
|
|
18
|
-
import "./editor/contexts/ConfigurationContext.mjs";
|
|
19
|
-
import "./editor/contexts/DictionariesRecordContext.mjs";
|
|
20
|
-
import "./editor/contexts/EditedContentContext.mjs";
|
|
21
|
-
import "./editor/contexts/EditorEnabledContext.mjs";
|
|
22
|
-
import "solid-js";
|
|
23
|
-
import "./editor/contexts/CommunicatorContext.mjs";
|
|
24
|
-
import "./editor/contexts/FocusDictionaryContext.mjs";
|
|
1
|
+
import { useIntl as r } from "./client/format/useIntl.mjs";
|
|
2
|
+
import { getBrowserLocale as a } from "./client/getBrowserLocale.mjs";
|
|
3
|
+
import { IntlayerClientContext as l, IntlayerProvider as m, IntlayerProviderContent as x, useIntlayerContext as i } from "./client/IntlayerProvider.mjs";
|
|
4
|
+
import { t as c } from "./client/t.mjs";
|
|
5
|
+
import { useDictionary as s } from "./client/useDictionary.mjs";
|
|
6
|
+
import { useDictionaryAsync as u } 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 w } from "./client/useLocale.mjs";
|
|
11
|
+
import { useLocaleBase as v } from "./client/useLocaleBase.mjs";
|
|
12
|
+
import { localeCookie as S, localeInStorage as B, setLocaleCookie as A, setLocaleInStorage as R, useLocaleCookie as b, useLocaleStorage as h } from "./client/useLocaleStorage.mjs";
|
|
13
|
+
import { getDictionary as q } from "./getDictionary.mjs";
|
|
14
|
+
import { getIntlayer as E } from "./getIntlayer.mjs";
|
|
15
|
+
import { compileMarkdown as G } from "./markdown/compiler.mjs";
|
|
16
|
+
import { MarkdownProvider as J, useMarkdown as K } from "./markdown/MarkdownProvider.mjs";
|
|
17
|
+
import { MarkdownRenderer as O } from "./markdown/MarkdownRenderer.mjs";
|
|
25
18
|
export {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
19
|
+
l as IntlayerClientContext,
|
|
20
|
+
m as IntlayerProvider,
|
|
21
|
+
x as IntlayerProviderContent,
|
|
22
|
+
J as MarkdownProvider,
|
|
23
|
+
O as MarkdownRenderer,
|
|
24
|
+
G as compileMarkdown,
|
|
25
|
+
a as getBrowserLocale,
|
|
26
|
+
q as getDictionary,
|
|
27
|
+
E as getIntlayer,
|
|
28
|
+
S as localeCookie,
|
|
29
|
+
B as localeInStorage,
|
|
30
|
+
A as setLocaleCookie,
|
|
31
|
+
R as setLocaleInStorage,
|
|
32
|
+
c as t,
|
|
33
|
+
s as useDictionary,
|
|
34
|
+
u as useDictionaryAsync,
|
|
35
|
+
I as useDictionaryDynamic,
|
|
36
|
+
r as useIntl,
|
|
37
|
+
k as useIntlayer,
|
|
38
|
+
i as useIntlayerContext,
|
|
39
|
+
g as useLoadDynamic,
|
|
40
|
+
w as useLocale,
|
|
41
|
+
v as useLocaleBase,
|
|
42
|
+
b as useLocaleCookie,
|
|
43
|
+
h as useLocaleStorage,
|
|
44
|
+
K as useMarkdown
|
|
49
45
|
};
|
|
@@ -1,22 +1,46 @@
|
|
|
1
|
-
import { createContext as
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { createContext as k, createComponent as s, useContext as u } from "solid-js";
|
|
2
|
+
import { compileMarkdown as M } from "./compiler.mjs";
|
|
3
|
+
const n = k(), h = (e) => {
|
|
4
|
+
const o = (t, r) => {
|
|
5
|
+
if (e.renderMarkdown)
|
|
6
|
+
return e.renderMarkdown(t, r);
|
|
7
|
+
const a = r && typeof r == "object" && ("components" in r || "wrapper" in r || "forceBlock" in r || "preserveFrontmatter" in r || "tagfilter" in r), {
|
|
8
|
+
components: c,
|
|
9
|
+
wrapper: l,
|
|
10
|
+
forceBlock: m,
|
|
11
|
+
preserveFrontmatter: i,
|
|
12
|
+
tagfilter: w,
|
|
13
|
+
...p
|
|
14
|
+
} = a ? r : {
|
|
15
|
+
components: r
|
|
16
|
+
}, d = c || p, f = {
|
|
17
|
+
forceBlock: m ?? e.forceBlock,
|
|
18
|
+
preserveFrontmatter: i ?? e.preserveFrontmatter,
|
|
19
|
+
tagfilter: w ?? e.tagfilter,
|
|
20
|
+
wrapper: l || e.wrapper,
|
|
21
|
+
components: {
|
|
22
|
+
...e.components,
|
|
23
|
+
...d
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
return M(t, f);
|
|
27
|
+
};
|
|
28
|
+
return s(n.Provider, {
|
|
5
29
|
value: {
|
|
6
30
|
renderMarkdown: o
|
|
7
31
|
},
|
|
8
32
|
get children() {
|
|
9
|
-
return
|
|
33
|
+
return e.children;
|
|
10
34
|
}
|
|
11
35
|
});
|
|
12
|
-
},
|
|
13
|
-
const
|
|
14
|
-
if (!
|
|
36
|
+
}, x = () => {
|
|
37
|
+
const e = u(n);
|
|
38
|
+
if (!e)
|
|
15
39
|
throw new Error("useMarkdown must be used within a MarkdownProvider. To fix this error, wrap your component with <MarkdownProvider>.");
|
|
16
|
-
return
|
|
40
|
+
return e;
|
|
17
41
|
};
|
|
18
42
|
export {
|
|
19
43
|
n as MarkdownContext,
|
|
20
|
-
|
|
21
|
-
|
|
44
|
+
h as MarkdownProvider,
|
|
45
|
+
x as useMarkdown
|
|
22
46
|
};
|
|
@@ -1,30 +1,42 @@
|
|
|
1
|
-
import { getMarkdownMetadata as
|
|
2
|
-
import { useEditedContentRenderer as
|
|
3
|
-
import { useMarkdown as
|
|
4
|
-
const
|
|
1
|
+
import { getMarkdownMetadata as l, getContentNodeByKeyPath as m } from "@intlayer/core";
|
|
2
|
+
import { useEditedContentRenderer as r } from "../editor/useEditedContentRenderer.mjs";
|
|
3
|
+
import { useMarkdown as k } from "./MarkdownProvider.mjs";
|
|
4
|
+
const g = (e) => {
|
|
5
5
|
const {
|
|
6
6
|
renderMarkdown: n
|
|
7
|
-
} =
|
|
7
|
+
} = k(), t = r({
|
|
8
8
|
dictionaryKey: e.dictionaryKey,
|
|
9
9
|
keyPath: e.keyPath,
|
|
10
10
|
children: e.children
|
|
11
11
|
}), a = typeof t == "string" ? t : e.children, {
|
|
12
|
-
dictionaryKey:
|
|
13
|
-
keyPath:
|
|
14
|
-
locale:
|
|
15
|
-
children:
|
|
16
|
-
|
|
12
|
+
dictionaryKey: s,
|
|
13
|
+
keyPath: K,
|
|
14
|
+
locale: M,
|
|
15
|
+
children: P,
|
|
16
|
+
components: o,
|
|
17
|
+
wrapper: d,
|
|
18
|
+
forceBlock: c,
|
|
19
|
+
preserveFrontmatter: i,
|
|
20
|
+
tagfilter: y,
|
|
21
|
+
...h
|
|
17
22
|
} = e;
|
|
18
|
-
return n(a,
|
|
19
|
-
|
|
20
|
-
|
|
23
|
+
return n(a, {
|
|
24
|
+
components: o,
|
|
25
|
+
wrapper: d,
|
|
26
|
+
forceBlock: c,
|
|
27
|
+
preserveFrontmatter: i,
|
|
28
|
+
tagfilter: y,
|
|
29
|
+
...h
|
|
30
|
+
});
|
|
31
|
+
}, u = (e) => {
|
|
32
|
+
const n = r({
|
|
21
33
|
dictionaryKey: e.dictionaryKey,
|
|
22
34
|
keyPath: e.keyPath,
|
|
23
35
|
children: e.children
|
|
24
|
-
}), t =
|
|
25
|
-
return
|
|
36
|
+
}), t = l(n);
|
|
37
|
+
return m(t, e.metadataKeyPath);
|
|
26
38
|
};
|
|
27
39
|
export {
|
|
28
|
-
|
|
29
|
-
|
|
40
|
+
u as MarkdownMetadataRenderer,
|
|
41
|
+
g as MarkdownRenderer
|
|
30
42
|
};
|
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { compile as e, compileMarkdown as d, compiler as n } from "./compiler.mjs";
|
|
2
|
+
import { MarkdownContext as t, MarkdownProvider as m, useMarkdown as p } from "./MarkdownProvider.mjs";
|
|
3
|
+
import { MarkdownMetadataRenderer as i, MarkdownRenderer as k } from "./MarkdownRenderer.mjs";
|
|
4
|
+
import { solidRuntime as x } from "./runtime.mjs";
|
|
3
5
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
6
|
+
t as MarkdownContext,
|
|
7
|
+
i as MarkdownMetadataRenderer,
|
|
8
|
+
m as MarkdownProvider,
|
|
9
|
+
k as MarkdownRenderer,
|
|
10
|
+
e as compile,
|
|
11
|
+
d as compileMarkdown,
|
|
12
|
+
n as compiler,
|
|
13
|
+
x as solidRuntime,
|
|
14
|
+
p as useMarkdown
|
|
9
15
|
};
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { D as s } from "../../web-mv0y5CK4.mjs";
|
|
2
|
+
import { createComponent as a } from "solid-js";
|
|
3
|
+
const i = {
|
|
4
|
+
/**
|
|
5
|
+
* Creates a Solid JSX Element.
|
|
6
|
+
* Uses Solid's Dynamic component for element creation.
|
|
7
|
+
*/
|
|
8
|
+
createElement: (e, r, ...t) => a(s, {
|
|
9
|
+
get component() {
|
|
10
|
+
return e;
|
|
11
|
+
},
|
|
12
|
+
...r,
|
|
13
|
+
get children() {
|
|
14
|
+
return t.length === 1 ? t[0] : t;
|
|
15
|
+
}
|
|
16
|
+
}),
|
|
17
|
+
/**
|
|
18
|
+
* Solid doesn't have a built-in cloneElement like React.
|
|
19
|
+
* In the context of markdown rendering, we usually don't need to deep-clone
|
|
20
|
+
* but rather merge props if we're wrapping a result.
|
|
21
|
+
*/
|
|
22
|
+
cloneElement: (e, r) => typeof e == "function" ? a(e, r) : e,
|
|
23
|
+
/**
|
|
24
|
+
* Solid Fragment equivalent.
|
|
25
|
+
* In Solid, a fragment is just an array or a function returning children.
|
|
26
|
+
*/
|
|
27
|
+
Fragment: (e) => e.children,
|
|
28
|
+
/**
|
|
29
|
+
* Solid-specific prop normalization.
|
|
30
|
+
* Solid uses 'class' instead of 'className'.
|
|
31
|
+
*/
|
|
32
|
+
normalizeProps: (e, r) => {
|
|
33
|
+
const t = {};
|
|
34
|
+
for (const [n, o] of Object.entries(r))
|
|
35
|
+
n === "className" ? t.class = o : t[n] = o;
|
|
36
|
+
return t;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
export {
|
|
40
|
+
i as default,
|
|
41
|
+
i as solidRuntime
|
|
42
|
+
};
|
package/dist/esm/plugins.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../web-mv0y5CK4.mjs";
|
|
2
2
|
import "@intlayer/core";
|
|
3
3
|
import "@intlayer/types";
|
|
4
|
-
import { h as g,
|
|
4
|
+
import { h as g, a as u, c as P, i as d, m as b, b as h, s as k } from "../plugins-CAuPi9pi.mjs";
|
|
5
5
|
import "./editor/useEditedContentRenderer.mjs";
|
|
6
6
|
import "./IntlayerNode.mjs";
|
|
7
7
|
import "./markdown/MarkdownProvider.mjs";
|
|
@@ -10,9 +10,10 @@ import "./solidElement/renderSolidElement.mjs";
|
|
|
10
10
|
import "solid-js";
|
|
11
11
|
export {
|
|
12
12
|
g as htmlPlugin,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
b as
|
|
17
|
-
h as
|
|
13
|
+
u as insertionPlugin,
|
|
14
|
+
P as interpreterPluginsEnabledState,
|
|
15
|
+
d as intlayerNodePlugins,
|
|
16
|
+
b as markdownPlugin,
|
|
17
|
+
h as markdownStringPlugin,
|
|
18
|
+
k as solidNodePlugins
|
|
18
19
|
};
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
import { D as w } from "./web-mv0y5CK4.mjs";
|
|
2
|
+
import { isSameKeyPath as M, HTML_TAGS as H, getMarkdownMetadata as S, getHTML as C, splitInsertionTemplate as b } from "@intlayer/core";
|
|
3
|
+
import { NodeType as c } from "@intlayer/types";
|
|
4
|
+
import { createComponent as s, mergeProps as d, createMemo as h } from "solid-js";
|
|
5
|
+
import { useIntlayerContext as T } 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 I, MarkdownRenderer as v } from "./esm/markdown/MarkdownRenderer.mjs";
|
|
11
|
+
import { renderSolidElement as N } from "./esm/solidElement/renderSolidElement.mjs";
|
|
12
|
+
import "./esm/client/useLocaleStorage.mjs";
|
|
13
|
+
import "./esm/client/useLocaleBase.mjs";
|
|
14
|
+
import { ContentSelector as R } 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 L } from "./esm/editor/contexts/FocusDictionaryContext.mjs";
|
|
22
|
+
const j = (e) => {
|
|
23
|
+
const {
|
|
24
|
+
focusedContent: t,
|
|
25
|
+
setFocusedContent: n
|
|
26
|
+
} = L(), a = h(() => e.keyPath.filter((o) => o.type !== c.Translation)), r = () => n({
|
|
27
|
+
dictionaryKey: e.dictionaryKey,
|
|
28
|
+
keyPath: a()
|
|
29
|
+
}), u = h(() => (t?.dictionaryKey === e.dictionaryKey && (t?.keyPath?.length ?? 0) > 0 && M(t?.keyPath ?? [], a())) ?? !1);
|
|
30
|
+
return s(R, {
|
|
31
|
+
onPress: r,
|
|
32
|
+
get isSelecting() {
|
|
33
|
+
return u();
|
|
34
|
+
},
|
|
35
|
+
get children() {
|
|
36
|
+
return e.children;
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}, f = (e) => {
|
|
40
|
+
const {
|
|
41
|
+
enabled: t
|
|
42
|
+
} = E(), {
|
|
43
|
+
disableEditor: n
|
|
44
|
+
} = T();
|
|
45
|
+
return t() && !n ? s(j, d(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: t,
|
|
55
|
+
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
56
|
+
...n
|
|
57
|
+
}) => y({
|
|
58
|
+
...n,
|
|
59
|
+
value: n.children,
|
|
60
|
+
children: s(f, d(n, {
|
|
61
|
+
get children() {
|
|
62
|
+
return s(K, d(n, {
|
|
63
|
+
get children() {
|
|
64
|
+
return n.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: t,
|
|
75
|
+
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
76
|
+
...n
|
|
77
|
+
}) => y({
|
|
78
|
+
...n,
|
|
79
|
+
value: "[[solid-element]]",
|
|
80
|
+
children: s(f, d(n, {
|
|
81
|
+
get children() {
|
|
82
|
+
return typeof Node < "u" && e instanceof Node ? e : N(e);
|
|
83
|
+
}
|
|
84
|
+
}))
|
|
85
|
+
})
|
|
86
|
+
}, x = (e, t) => {
|
|
87
|
+
const n = b(e, t);
|
|
88
|
+
return n.isSimple, n.parts;
|
|
89
|
+
}, se = {
|
|
90
|
+
id: "insertion-plugin",
|
|
91
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === c.Insertion,
|
|
92
|
+
transform: (e, t, n) => {
|
|
93
|
+
const a = [...t.keyPath, {
|
|
94
|
+
type: c.Insertion
|
|
95
|
+
}], r = e[c.Insertion];
|
|
96
|
+
return n(r, {
|
|
97
|
+
...t,
|
|
98
|
+
children: r,
|
|
99
|
+
keyPath: a,
|
|
100
|
+
plugins: [{
|
|
101
|
+
id: "insertion-string-plugin",
|
|
102
|
+
canHandle: (o) => typeof o == "string",
|
|
103
|
+
transform: (o, m, g) => {
|
|
104
|
+
const p = g(o, {
|
|
105
|
+
...m,
|
|
106
|
+
children: o,
|
|
107
|
+
plugins: [...(t.plugins ?? []).filter((i) => i.id !== "intlayer-node-plugin")]
|
|
108
|
+
});
|
|
109
|
+
return (i) => {
|
|
110
|
+
const l = x(p, i);
|
|
111
|
+
return g(l, {
|
|
112
|
+
...m,
|
|
113
|
+
plugins: t.plugins,
|
|
114
|
+
children: l
|
|
115
|
+
});
|
|
116
|
+
};
|
|
117
|
+
}
|
|
118
|
+
}, ...t.plugins ?? []]
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}, D = {
|
|
122
|
+
id: "markdown-string-plugin",
|
|
123
|
+
canHandle: (e) => typeof e == "string",
|
|
124
|
+
transform: (e, t, n) => {
|
|
125
|
+
const {
|
|
126
|
+
plugins: a,
|
|
127
|
+
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
128
|
+
...r
|
|
129
|
+
} = t, u = S(e), m = n(u, {
|
|
130
|
+
plugins: [{
|
|
131
|
+
id: "markdown-metadata-plugin",
|
|
132
|
+
canHandle: (i) => typeof i == "string" || typeof i == "number" || typeof i == "boolean" || !i,
|
|
133
|
+
transform: (i, l) => y({
|
|
134
|
+
...l,
|
|
135
|
+
value: i,
|
|
136
|
+
children: s(f, d(r, {
|
|
137
|
+
get children() {
|
|
138
|
+
return s(I, d(r, {
|
|
139
|
+
get metadataKeyPath() {
|
|
140
|
+
return l.keyPath;
|
|
141
|
+
},
|
|
142
|
+
children: e
|
|
143
|
+
}));
|
|
144
|
+
}
|
|
145
|
+
}))
|
|
146
|
+
})
|
|
147
|
+
}],
|
|
148
|
+
dictionaryKey: r.dictionaryKey,
|
|
149
|
+
keyPath: []
|
|
150
|
+
}), g = (i) => y({
|
|
151
|
+
...t,
|
|
152
|
+
value: e,
|
|
153
|
+
children: s(f, d(r, {
|
|
154
|
+
get children() {
|
|
155
|
+
return s(v, d(r, i, {
|
|
156
|
+
children: e
|
|
157
|
+
}));
|
|
158
|
+
}
|
|
159
|
+
})),
|
|
160
|
+
additionalProps: {
|
|
161
|
+
metadata: m
|
|
162
|
+
}
|
|
163
|
+
}), p = g();
|
|
164
|
+
return new Proxy(p, {
|
|
165
|
+
get(i, l, P) {
|
|
166
|
+
return l === "value" ? e : l === "metadata" ? m : l === "use" ? (k) => g(k) : Reflect.get(i, l, P);
|
|
167
|
+
}
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
}, de = {
|
|
171
|
+
id: "markdown-plugin",
|
|
172
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === c.Markdown,
|
|
173
|
+
transform: (e, t, n) => {
|
|
174
|
+
const a = [...t.keyPath, {
|
|
175
|
+
type: c.Markdown
|
|
176
|
+
}], r = e[c.Markdown];
|
|
177
|
+
return n(r, {
|
|
178
|
+
...t,
|
|
179
|
+
children: r,
|
|
180
|
+
keyPath: a,
|
|
181
|
+
plugins: [D, ...t.plugins ?? []]
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}, A = () => {
|
|
185
|
+
const e = {};
|
|
186
|
+
for (const t of H)
|
|
187
|
+
e[t] = ({
|
|
188
|
+
children: n,
|
|
189
|
+
...a
|
|
190
|
+
}) => s(w, d({
|
|
191
|
+
component: t
|
|
192
|
+
}, a, {
|
|
193
|
+
children: n
|
|
194
|
+
}));
|
|
195
|
+
return e;
|
|
196
|
+
}, F = A(), ce = {
|
|
197
|
+
id: "html-plugin",
|
|
198
|
+
canHandle: (e) => typeof e == "object" && e?.nodeType === c.HTML,
|
|
199
|
+
transform: (e) => {
|
|
200
|
+
const t = e[c.HTML], n = (u) => {
|
|
201
|
+
const o = {
|
|
202
|
+
...F,
|
|
203
|
+
...u
|
|
204
|
+
};
|
|
205
|
+
return C(t, o);
|
|
206
|
+
}, r = [n()];
|
|
207
|
+
return new Proxy(r, {
|
|
208
|
+
get(u, o, m) {
|
|
209
|
+
return o === "value" ? t : o === "use" ? (g) => n(g) : Reflect.get(u, o, m);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
}, ue = {
|
|
214
|
+
translation: !0,
|
|
215
|
+
enumeration: !0,
|
|
216
|
+
condition: !0,
|
|
217
|
+
insertion: !0,
|
|
218
|
+
nested: !0,
|
|
219
|
+
html: !0,
|
|
220
|
+
solidNode: !0,
|
|
221
|
+
solidIntlayerNode: !0,
|
|
222
|
+
solidInsertion: !0,
|
|
223
|
+
solidMarkdown: !0,
|
|
224
|
+
solidHtml: !0
|
|
225
|
+
};
|
|
226
|
+
export {
|
|
227
|
+
f as C,
|
|
228
|
+
se as a,
|
|
229
|
+
D as b,
|
|
230
|
+
ue as c,
|
|
231
|
+
ce as h,
|
|
232
|
+
ae as i,
|
|
233
|
+
de as m,
|
|
234
|
+
le as s
|
|
235
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
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 N=require("./cjs/editor/useEditedContentRenderer.cjs"),p=require("./cjs/IntlayerNode.cjs");require("./cjs/markdown/MarkdownProvider.cjs");const f=require("./cjs/markdown/MarkdownRenderer.cjs"),T=require("./cjs/solidElement/renderSolidElement.cjs");require("./cjs/client/useLocaleStorage.cjs");require("./cjs/client/useLocaleBase.cjs");const S=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 M=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(),a=r.createMemo(()=>e.keyPath.filter(l=>l.type!==s.NodeType.Translation)),o=()=>t({dictionaryKey:e.dictionaryKey,keyPath:a()}),c=r.createMemo(()=>(n?.dictionaryKey===e.dictionaryKey&&(n?.keyPath?.length??0)>0&&m.isSameKeyPath(n?.keyPath??[],a()))??!1);return r.createComponent(S.ContentSelector,{onPress:o,get isSelecting(){return c()},get children(){return e.children}})},y=e=>{const{enabled:n}=M.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(N.EditedContentRenderer,r.mergeProps(t,{get children(){return t.children}}))}}))})},E={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:T.renderSolidElement(e)}}))})},K=(e,n)=>{const t=m.splitInsertionTemplate(e,n);return t.isSimple,t.parts},_={id:"insertion-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===s.NodeType.Insertion,transform:(e,n,t)=>{const a=[...n.keyPath,{type:s.NodeType.Insertion}],o=e[s.NodeType.Insertion];return t(o,{...n,children:o,keyPath:a,plugins:[{id:"insertion-string-plugin",canHandle:l=>typeof l=="string",transform:(l,u,g)=>{const P=g(l,{...u,children:l,plugins:[...(n.plugins??[]).filter(i=>i.id!=="intlayer-node-plugin")]});return i=>{const d=K(P,i);return g(d,{...u,plugins:n.plugins,children:d})}}},...n.plugins??[]]})}},h={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,n,t)=>{const{plugins:a,...o}=n,c=m.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)=>p.renderIntlayerNode({...d,value:i,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(f.MarkdownMetadataRenderer,r.mergeProps(o,{get metadataKeyPath(){return d.keyPath},children:e}))}}))})}],dictionaryKey:o.dictionaryKey,keyPath:[]}),g=i=>p.renderIntlayerNode({...n,value:e,children:r.createComponent(y,r.mergeProps(o,{get children(){return r.createComponent(f.MarkdownRenderer,r.mergeProps(o,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)}})}},R={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===s.NodeType.Markdown,transform:(e,n,t)=>{const a=[...n.keyPath,{type:s.NodeType.Markdown}],o=e[s.NodeType.Markdown];return t(o,{...n,children:o,keyPath:a,plugins:[h,...n.plugins??[]]})}},v=()=>{const e={};for(const n of m.HTML_TAGS)e[n]=({children:t,...a})=>r.createComponent(q.Dynamic,r.mergeProps({component:n},a,{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 l={...x,...c};return m.getHTML(n,l)},o=[t()];return new Proxy(o,{get(c,l,u){return l==="value"?n:l==="use"?g=>t(g):Reflect.get(c,l,u)}})}},j={translation:!0,enumeration:!0,condition:!0,insertion:!0,nested:!0,html:!0,solidNode:!0,solidIntlayerNode:!0,solidInsertion:!0,solidMarkdown:!0,solidHtml:!0};exports.ContentSelectorRenderer=y;exports.htmlPlugin=L;exports.insertionPlugin=_;exports.interpreterPluginsEnabledState=j;exports.intlayerNodePlugins=b;exports.markdownPlugin=R;exports.markdownStringPlugin=h;exports.solidNodePlugins=E;
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { DeclaredLocales, LocalesValues } from '@intlayer/types';
|
|
2
|
+
import { Accessor } from 'solid-js';
|
|
2
3
|
type useLocaleProps = {
|
|
3
4
|
isCookieEnabled?: boolean;
|
|
4
5
|
onLocaleChange?: (locale: LocalesValues) => void;
|
|
5
6
|
};
|
|
6
7
|
type UseLocaleResult = {
|
|
7
|
-
locale: DeclaredLocales
|
|
8
|
+
locale: Accessor<DeclaredLocales>;
|
|
8
9
|
defaultLocale: DeclaredLocales;
|
|
9
10
|
availableLocales: DeclaredLocales[];
|
|
10
11
|
setLocale: (locale: LocalesValues) => void;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -8,4 +8,4 @@ export { getBrowserLocale, IntlayerClientContext, IntlayerProvider, IntlayerProv
|
|
|
8
8
|
export { getDictionary } from './getDictionary';
|
|
9
9
|
export { getIntlayer } from './getIntlayer';
|
|
10
10
|
export type { IntlayerNode } from './IntlayerNode';
|
|
11
|
-
export { MarkdownProvider } from './markdown/index';
|
|
11
|
+
export { compileMarkdown, MarkdownProvider, MarkdownRenderer, useMarkdown, } from './markdown/index';
|
|
@@ -2,13 +2,20 @@ import { Component, JSXElement, ParentProps } from 'solid-js';
|
|
|
2
2
|
type RenderMarkdownOptions = {
|
|
3
3
|
components?: any;
|
|
4
4
|
wrapper?: any;
|
|
5
|
-
|
|
5
|
+
forceBlock?: boolean;
|
|
6
|
+
preserveFrontmatter?: boolean;
|
|
7
|
+
tagfilter?: boolean;
|
|
6
8
|
};
|
|
7
9
|
type MarkdownProviderValue = {
|
|
8
10
|
renderMarkdown: (content: string, overrides?: any | RenderMarkdownOptions) => JSXElement;
|
|
9
11
|
};
|
|
10
12
|
export declare const MarkdownContext: import('solid-js').Context<MarkdownProviderValue | undefined>;
|
|
11
13
|
export type MarkdownProviderProps = ParentProps<{
|
|
14
|
+
components?: any;
|
|
15
|
+
wrapper?: any;
|
|
16
|
+
forceBlock?: boolean;
|
|
17
|
+
preserveFrontmatter?: boolean;
|
|
18
|
+
tagfilter?: boolean;
|
|
12
19
|
renderMarkdown?: (content: string, overrides?: any | RenderMarkdownOptions) => JSXElement;
|
|
13
20
|
}>;
|
|
14
21
|
export declare const MarkdownProvider: Component<MarkdownProviderProps>;
|
|
@@ -5,6 +5,11 @@ type MarkdownRendererProps = {
|
|
|
5
5
|
keyPath: KeyPath[];
|
|
6
6
|
locale?: LocalesValues;
|
|
7
7
|
children: string;
|
|
8
|
+
components?: any;
|
|
9
|
+
wrapper?: any;
|
|
10
|
+
forceBlock?: boolean;
|
|
11
|
+
preserveFrontmatter?: boolean;
|
|
12
|
+
tagfilter?: boolean;
|
|
8
13
|
[key: string]: any;
|
|
9
14
|
};
|
|
10
15
|
export declare const MarkdownRenderer: Component<MarkdownRendererProps>;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CompileOptions } from '@intlayer/core';
|
|
2
|
+
import { JSX } from 'solid-js';
|
|
3
|
+
/**
|
|
4
|
+
* Compile markdown to Solid JSX elements.
|
|
5
|
+
*/
|
|
6
|
+
export declare const compileMarkdown: (markdown?: string, options?: CompileOptions) => JSX.Element;
|
|
7
|
+
/**
|
|
8
|
+
* Solid component that renders markdown to JSX.
|
|
9
|
+
*/
|
|
10
|
+
export declare const compiler: (markdown?: string, options?: CompileOptions) => JSX.Element;
|
|
11
|
+
export declare const compile: (markdown?: string, options?: CompileOptions) => JSX.Element;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { MarkdownRuntime } from '@intlayer/core';
|
|
2
|
+
/**
|
|
3
|
+
* Solid-specific runtime for the markdown processor.
|
|
4
|
+
* Implements the MarkdownRuntime interface using Solid's primitives.
|
|
5
|
+
*/
|
|
6
|
+
export declare const solidRuntime: MarkdownRuntime;
|
|
7
|
+
export default solidRuntime;
|
package/dist/types/plugins.d.ts
CHANGED
|
@@ -17,11 +17,23 @@ export type SolidNodeCond<T> = T extends {
|
|
|
17
17
|
} ? JSX.Element : never;
|
|
18
18
|
/** Translation plugin. Replaces node with a locale string if nodeType = Translation. */
|
|
19
19
|
export declare const solidNodePlugins: Plugins;
|
|
20
|
+
/** ---------------------------------------------
|
|
21
|
+
* INSERTION PLUGIN
|
|
22
|
+
* --------------------------------------------- */
|
|
23
|
+
export type InsertionCond<T, _S, _L> = T extends {
|
|
24
|
+
nodeType: NodeType | string;
|
|
25
|
+
[NodeType.Insertion]: string;
|
|
26
|
+
fields: readonly string[];
|
|
27
|
+
} ? (values: {
|
|
28
|
+
[K in T['fields'][number]]: string | number | JSX.Element;
|
|
29
|
+
}) => JSX.Element : never;
|
|
30
|
+
/** Insertion plugin for Solid. Handles component/element insertion. */
|
|
31
|
+
export declare const insertionPlugin: Plugins;
|
|
20
32
|
/**
|
|
21
33
|
* MARKDOWN PLUGIN
|
|
22
34
|
*/
|
|
23
35
|
export type MarkdownStringCond<T> = T extends string ? IntlayerNode<string, {
|
|
24
|
-
metadata:
|
|
36
|
+
metadata: DeepTransformContentCore<string>;
|
|
25
37
|
}> : never;
|
|
26
38
|
/** Markdown string plugin. Replaces string node with a component that render the markdown. */
|
|
27
39
|
export declare const markdownStringPlugin: Plugins;
|
|
@@ -43,6 +55,7 @@ export declare const htmlPlugin: Plugins;
|
|
|
43
55
|
export interface IInterpreterPluginSolid<T, S, L extends LocalesValues> {
|
|
44
56
|
solidNode: SolidNodeCond<T>;
|
|
45
57
|
solidIntlayerNode: IntlayerNodeCond<T>;
|
|
58
|
+
solidInsertion: InsertionCond<T, S, L>;
|
|
46
59
|
solidMarkdown: MarkdownCond<T, S, L>;
|
|
47
60
|
solidHtml: HTMLPluginCond<T, S, L>;
|
|
48
61
|
}
|
|
@@ -54,6 +67,7 @@ export interface IInterpreterPluginSolid<T, S, L extends LocalesValues> {
|
|
|
54
67
|
export type IInterpreterPluginState = IInterpreterPluginStateCore & {
|
|
55
68
|
solidNode: true;
|
|
56
69
|
solidIntlayerNode: true;
|
|
70
|
+
solidInsertion: true;
|
|
57
71
|
solidMarkdown: true;
|
|
58
72
|
solidHtml: true;
|
|
59
73
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "solid-intlayer",
|
|
3
|
-
"version": "8.0.0-canary.
|
|
3
|
+
"version": "8.0.0-canary.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.0-canary.
|
|
78
|
-
"@intlayer/config": "8.0.0-canary.
|
|
79
|
-
"@intlayer/core": "8.0.0-canary.
|
|
80
|
-
"@intlayer/editor": "8.0.0-canary.
|
|
81
|
-
"@intlayer/types": "8.0.0-canary.
|
|
77
|
+
"@intlayer/api": "8.0.0-canary.2",
|
|
78
|
+
"@intlayer/config": "8.0.0-canary.2",
|
|
79
|
+
"@intlayer/core": "8.0.0-canary.2",
|
|
80
|
+
"@intlayer/editor": "8.0.0-canary.2",
|
|
81
|
+
"@intlayer/types": "8.0.0-canary.2"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@intlayer/unmerged-dictionaries-entry": "8.0.0-canary.
|
|
84
|
+
"@intlayer/unmerged-dictionaries-entry": "8.0.0-canary.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",
|
|
@@ -91,12 +91,12 @@
|
|
|
91
91
|
"@utils/tsdown-config": "1.0.4",
|
|
92
92
|
"jsdom": "27.4.0",
|
|
93
93
|
"rimraf": "6.1.2",
|
|
94
|
-
"tsdown": "0.
|
|
94
|
+
"tsdown": "0.20.0",
|
|
95
95
|
"typescript": "5.9.3",
|
|
96
96
|
"vite": "7.3.1",
|
|
97
97
|
"vite-plugin-dts": "4.5.4",
|
|
98
98
|
"vite-plugin-solid": "2.11.10",
|
|
99
|
-
"vitest": "4.0.
|
|
99
|
+
"vitest": "4.0.18"
|
|
100
100
|
},
|
|
101
101
|
"peerDependencies": {
|
|
102
102
|
"solid-js": ">=1.0.0"
|
|
@@ -1,197 +0,0 @@
|
|
|
1
|
-
import { D as M } from "./web-mv0y5CK4.mjs";
|
|
2
|
-
import { isSameKeyPath as w, HTML_TAGS as C, getMarkdownMetadata as H, getHTML as b } from "@intlayer/core";
|
|
3
|
-
import { NodeType as s } from "@intlayer/types";
|
|
4
|
-
import { createComponent as i, mergeProps as d, createMemo as h } from "solid-js";
|
|
5
|
-
import { useIntlayerContext as S } from "./esm/client/IntlayerProvider.mjs";
|
|
6
|
-
import "@intlayer/config/built";
|
|
7
|
-
import { EditedContentRenderer as T } from "./esm/editor/useEditedContentRenderer.mjs";
|
|
8
|
-
import { renderIntlayerNode as y } from "./esm/IntlayerNode.mjs";
|
|
9
|
-
import "./esm/markdown/MarkdownProvider.mjs";
|
|
10
|
-
import { MarkdownMetadataRenderer as K, MarkdownRenderer as v } from "./esm/markdown/MarkdownRenderer.mjs";
|
|
11
|
-
import { renderSolidElement as E } 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 R } from "./esm/editor/contexts/EditorEnabledContext.mjs";
|
|
20
|
-
import "./esm/editor/contexts/CommunicatorContext.mjs";
|
|
21
|
-
import { useFocusDictionary as x } from "./esm/editor/contexts/FocusDictionaryContext.mjs";
|
|
22
|
-
const D = (e) => {
|
|
23
|
-
const {
|
|
24
|
-
focusedContent: n,
|
|
25
|
-
setFocusedContent: t
|
|
26
|
-
} = x(), a = h(() => e.keyPath.filter((u) => u.type !== s.Translation)), r = () => t({
|
|
27
|
-
dictionaryKey: e.dictionaryKey,
|
|
28
|
-
keyPath: a()
|
|
29
|
-
}), l = h(() => (n?.dictionaryKey === e.dictionaryKey && (n?.keyPath?.length ?? 0) > 0 && w(n?.keyPath ?? [], a())) ?? !1);
|
|
30
|
-
return i(L, {
|
|
31
|
-
onPress: r,
|
|
32
|
-
get isSelecting() {
|
|
33
|
-
return l();
|
|
34
|
-
},
|
|
35
|
-
get children() {
|
|
36
|
-
return e.children;
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
}, f = (e) => {
|
|
40
|
-
const {
|
|
41
|
-
enabled: n
|
|
42
|
-
} = R(), {
|
|
43
|
-
disableEditor: t
|
|
44
|
-
} = S();
|
|
45
|
-
return n() && !t ? i(D, d(e, {
|
|
46
|
-
get children() {
|
|
47
|
-
return e.children;
|
|
48
|
-
}
|
|
49
|
-
})) : e.children;
|
|
50
|
-
}, oe = {
|
|
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: i(f, d(t, {
|
|
61
|
-
get children() {
|
|
62
|
-
return i(T, d(t, {
|
|
63
|
-
get children() {
|
|
64
|
-
return t.children;
|
|
65
|
-
}
|
|
66
|
-
}));
|
|
67
|
-
}
|
|
68
|
-
}))
|
|
69
|
-
})
|
|
70
|
-
}, ie = {
|
|
71
|
-
id: "solid-node-plugin",
|
|
72
|
-
canHandle: (e) => typeof e == "object" && typeof e.props < "u",
|
|
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: i(f, d(t, {
|
|
81
|
-
get children() {
|
|
82
|
-
return E(e);
|
|
83
|
-
}
|
|
84
|
-
}))
|
|
85
|
-
})
|
|
86
|
-
}, N = {
|
|
87
|
-
id: "markdown-string-plugin",
|
|
88
|
-
canHandle: (e) => typeof e == "string",
|
|
89
|
-
transform: (e, n, t) => {
|
|
90
|
-
const {
|
|
91
|
-
plugins: a,
|
|
92
|
-
// Removed to avoid next error - Functions cannot be passed directly to Client Components
|
|
93
|
-
...r
|
|
94
|
-
} = n, l = H(e), m = t(l, {
|
|
95
|
-
plugins: [{
|
|
96
|
-
id: "markdown-metadata-plugin",
|
|
97
|
-
canHandle: (o) => typeof o == "string" || typeof o == "number" || typeof o == "boolean" || !o,
|
|
98
|
-
transform: (o, c) => y({
|
|
99
|
-
...c,
|
|
100
|
-
value: o,
|
|
101
|
-
children: i(f, d(r, {
|
|
102
|
-
get children() {
|
|
103
|
-
return i(K, d(r, {
|
|
104
|
-
get metadataKeyPath() {
|
|
105
|
-
return c.keyPath;
|
|
106
|
-
},
|
|
107
|
-
children: e
|
|
108
|
-
}));
|
|
109
|
-
}
|
|
110
|
-
}))
|
|
111
|
-
})
|
|
112
|
-
}],
|
|
113
|
-
dictionaryKey: r.dictionaryKey,
|
|
114
|
-
keyPath: []
|
|
115
|
-
}), g = (o) => y({
|
|
116
|
-
...n,
|
|
117
|
-
value: e,
|
|
118
|
-
children: i(f, d(r, {
|
|
119
|
-
get children() {
|
|
120
|
-
return i(v, d(r, o, {
|
|
121
|
-
children: e
|
|
122
|
-
}));
|
|
123
|
-
}
|
|
124
|
-
})),
|
|
125
|
-
additionalProps: {
|
|
126
|
-
metadata: m
|
|
127
|
-
}
|
|
128
|
-
}), p = g();
|
|
129
|
-
return new Proxy(p, {
|
|
130
|
-
get(o, c, P) {
|
|
131
|
-
return c === "value" ? e : c === "metadata" ? m : c === "use" ? (k) => g(k) : Reflect.get(o, c, P);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
}, ae = {
|
|
136
|
-
id: "markdown-plugin",
|
|
137
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType === s.Markdown,
|
|
138
|
-
transform: (e, n, t) => {
|
|
139
|
-
const a = [...n.keyPath, {
|
|
140
|
-
type: s.Markdown
|
|
141
|
-
}], r = e[s.Markdown];
|
|
142
|
-
return t(r, {
|
|
143
|
-
...n,
|
|
144
|
-
children: r,
|
|
145
|
-
keyPath: a,
|
|
146
|
-
plugins: [N, ...n.plugins ?? []]
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}, j = () => {
|
|
150
|
-
const e = {};
|
|
151
|
-
for (const n of C)
|
|
152
|
-
e[n] = ({
|
|
153
|
-
children: t,
|
|
154
|
-
...a
|
|
155
|
-
}) => i(M, d({
|
|
156
|
-
component: n
|
|
157
|
-
}, a, {
|
|
158
|
-
children: t
|
|
159
|
-
}));
|
|
160
|
-
return e;
|
|
161
|
-
}, I = j(), le = {
|
|
162
|
-
id: "html-plugin",
|
|
163
|
-
canHandle: (e) => typeof e == "object" && e?.nodeType === s.HTML,
|
|
164
|
-
transform: (e) => {
|
|
165
|
-
const n = e[s.HTML], t = (r) => {
|
|
166
|
-
const l = {
|
|
167
|
-
...I,
|
|
168
|
-
...r
|
|
169
|
-
};
|
|
170
|
-
return b(n, l);
|
|
171
|
-
}, a = t();
|
|
172
|
-
return new Proxy(a, {
|
|
173
|
-
get(r, l, u) {
|
|
174
|
-
return l === "value" ? n : l === "use" ? (m) => t(m) : Reflect.get(r, l, u);
|
|
175
|
-
}
|
|
176
|
-
});
|
|
177
|
-
}
|
|
178
|
-
}, de = {
|
|
179
|
-
translation: !0,
|
|
180
|
-
enumeration: !0,
|
|
181
|
-
condition: !0,
|
|
182
|
-
insertion: !0,
|
|
183
|
-
nested: !0,
|
|
184
|
-
solidNode: !0,
|
|
185
|
-
solidIntlayerNode: !0,
|
|
186
|
-
solidMarkdown: !0,
|
|
187
|
-
solidHtml: !0
|
|
188
|
-
};
|
|
189
|
-
export {
|
|
190
|
-
f as C,
|
|
191
|
-
N as a,
|
|
192
|
-
de as b,
|
|
193
|
-
le as h,
|
|
194
|
-
oe as i,
|
|
195
|
-
ae as m,
|
|
196
|
-
ie as s
|
|
197
|
-
};
|
package/dist/plugins-D2xp5Loy.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const q=require("./web-Ch-xTpJg.js"),g=require("@intlayer/core"),c=require("@intlayer/types"),t=require("solid-js"),w=require("./cjs/client/IntlayerProvider.cjs");require("@intlayer/config/built");const M=require("./cjs/editor/useEditedContentRenderer.cjs"),y=require("./cjs/IntlayerNode.cjs");require("./cjs/markdown/MarkdownProvider.cjs");const h=require("./cjs/markdown/MarkdownRenderer.cjs"),S=require("./cjs/solidElement/renderSolidElement.cjs");require("./cjs/client/useLocaleStorage.cjs");require("./cjs/client/useLocaleBase.cjs");const T=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 N=require("./cjs/editor/contexts/EditorEnabledContext.cjs");require("./cjs/editor/contexts/CommunicatorContext.cjs");const b=require("./cjs/editor/contexts/FocusDictionaryContext.cjs"),H=e=>{const{focusedContent:r,setFocusedContent:n}=b.useFocusDictionary(),a=t.createMemo(()=>e.keyPath.filter(u=>u.type!==c.NodeType.Translation)),o=()=>n({dictionaryKey:e.dictionaryKey,keyPath:a()}),d=t.createMemo(()=>(r?.dictionaryKey===e.dictionaryKey&&(r?.keyPath?.length??0)>0&&g.isSameKeyPath(r?.keyPath??[],a()))??!1);return t.createComponent(T.ContentSelector,{onPress:o,get isSelecting(){return d()},get children(){return e.children}})},s=e=>{const{enabled:r}=N.useEditorEnabled(),{disableEditor:n}=w.useIntlayerContext();return r()&&!n?t.createComponent(H,t.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:r,...n})=>y.renderIntlayerNode({...n,value:n.children,children:t.createComponent(s,t.mergeProps(n,{get children(){return t.createComponent(M.EditedContentRenderer,t.mergeProps(n,{get children(){return n.children}}))}}))})},_={id:"solid-node-plugin",canHandle:e=>typeof e=="object"&&typeof e.props<"u",transform:(e,{plugins:r,...n})=>y.renderIntlayerNode({...n,value:"[[solid-element]]",children:t.createComponent(s,t.mergeProps(n,{get children(){return S.renderSolidElement(e)}}))})},p={id:"markdown-string-plugin",canHandle:e=>typeof e=="string",transform:(e,r,n)=>{const{plugins:a,...o}=r,d=g.getMarkdownMetadata(e),m=n(d,{plugins:[{id:"markdown-metadata-plugin",canHandle:i=>typeof i=="string"||typeof i=="number"||typeof i=="boolean"||!i,transform:(i,l)=>y.renderIntlayerNode({...l,value:i,children:t.createComponent(s,t.mergeProps(o,{get children(){return t.createComponent(h.MarkdownMetadataRenderer,t.mergeProps(o,{get metadataKeyPath(){return l.keyPath},children:e}))}}))})}],dictionaryKey:o.dictionaryKey,keyPath:[]}),P=i=>y.renderIntlayerNode({...r,value:e,children:t.createComponent(s,t.mergeProps(o,{get children(){return t.createComponent(h.MarkdownRenderer,t.mergeProps(o,i,{children:e}))}})),additionalProps:{metadata:m}}),f=P();return new Proxy(f,{get(i,l,C){return l==="value"?e:l==="metadata"?m:l==="use"?k=>P(k):Reflect.get(i,l,C)}})}},K={id:"markdown-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===c.NodeType.Markdown,transform:(e,r,n)=>{const a=[...r.keyPath,{type:c.NodeType.Markdown}],o=e[c.NodeType.Markdown];return n(o,{...r,children:o,keyPath:a,plugins:[p,...r.plugins??[]]})}},I=()=>{const e={};for(const r of g.HTML_TAGS)e[r]=({children:n,...a})=>t.createComponent(q.Dynamic,t.mergeProps({component:r},a,{children:n}));return e},R=I(),v={id:"html-plugin",canHandle:e=>typeof e=="object"&&e?.nodeType===c.NodeType.HTML,transform:e=>{const r=e[c.NodeType.HTML],n=o=>{const d={...R,...o};return g.getHTML(r,d)},a=n();return new Proxy(a,{get(o,d,u){return d==="value"?r:d==="use"?m=>n(m):Reflect.get(o,d,u)}})}},x={translation:!0,enumeration:!0,condition:!0,insertion:!0,nested:!0,solidNode:!0,solidIntlayerNode:!0,solidMarkdown:!0,solidHtml:!0};exports.ContentSelectorRenderer=s;exports.htmlPlugin=v;exports.interpreterPluginsEnabledState=x;exports.intlayerNodePlugins=E;exports.markdownPlugin=K;exports.markdownStringPlugin=p;exports.solidNodePlugins=_;
|