solid-intlayer 8.0.0-canary.5 → 8.0.0-canary.6
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.
|
@@ -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=require("@intlayer/core"),n=require("solid-js"),a=require("../editor/useEditedContentRenderer.cjs"),l=require("./compiler.cjs"),c=require("./MarkdownProvider.cjs"),i=(e,t={})=>l.compileMarkdown(e,t),m=(e={})=>{const t=n.useContext(c.MarkdownContext);return r=>t?t.renderMarkdown(r,e):i(r,e)},h=e=>{const{renderMarkdown:t}=c.useMarkdown(),r=n.createMemo(()=>a.useEditedContentRenderer({dictionaryKey:e.dictionaryKey,keyPath:e.keyPath,children:e.children})),d=()=>typeof r()=="string"?r():e.children,{dictionaryKey:R,keyPath:P,locale:K,children:g,components:k,wrapper:s,forceBlock:M,preserveFrontmatter:u,tagfilter:y,...w}=e;return t(d(),{components:k,wrapper:s,forceBlock:M,preserveFrontmatter:u,tagfilter:y,...w})},C=e=>{const t=n.createMemo(()=>a.useEditedContentRenderer({dictionaryKey:e.dictionaryKey,keyPath:e.keyPath,children:e.children})),r=n.createMemo(()=>o.getMarkdownMetadata(t()));return n.createMemo(()=>o.getContentNodeByKeyPath(r(),e.metadataKeyPath))()};exports.MarkdownMetadataRenderer=C;exports.MarkdownRenderer=h;exports.renderMarkdown=i;exports.useMarkdownRenderer=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 e=require("./compiler.cjs"),o=require("./MarkdownProvider.cjs"),r=require("./MarkdownRenderer.cjs"),n=require("./runtime.cjs");exports.compile=e.compile;exports.compileMarkdown=e.compileMarkdown;exports.compiler=e.compiler;exports.MarkdownContext=o.MarkdownContext;exports.MarkdownProvider=o.MarkdownProvider;exports.useMarkdown=o.useMarkdown;exports.MarkdownMetadataRenderer=r.MarkdownMetadataRenderer;exports.MarkdownRenderer=r.MarkdownRenderer;exports.renderMarkdown=r.renderMarkdown;exports.useMarkdownRenderer=r.useMarkdownRenderer;exports.solidRuntime=n.solidRuntime;
|
|
@@ -1,43 +1,49 @@
|
|
|
1
|
-
import { getMarkdownMetadata as
|
|
2
|
-
import { createMemo as n } from "solid-js";
|
|
3
|
-
import { useEditedContentRenderer as
|
|
4
|
-
import {
|
|
5
|
-
|
|
1
|
+
import { getMarkdownMetadata as M, getContentNodeByKeyPath as h } from "@intlayer/core";
|
|
2
|
+
import { createMemo as n, useContext as l } from "solid-js";
|
|
3
|
+
import { useEditedContentRenderer as a } from "../editor/useEditedContentRenderer.mjs";
|
|
4
|
+
import { compileMarkdown as s } from "./compiler.mjs";
|
|
5
|
+
import { useMarkdown as w, MarkdownContext as u } from "./MarkdownProvider.mjs";
|
|
6
|
+
const f = (e, t = {}) => s(e, t), F = (e = {}) => {
|
|
7
|
+
const t = l(u);
|
|
8
|
+
return (r) => t ? t.renderMarkdown(r, e) : f(r, e);
|
|
9
|
+
}, N = (e) => {
|
|
6
10
|
const {
|
|
7
|
-
renderMarkdown:
|
|
8
|
-
} =
|
|
11
|
+
renderMarkdown: t
|
|
12
|
+
} = w(), r = n(() => a({
|
|
9
13
|
dictionaryKey: e.dictionaryKey,
|
|
10
14
|
keyPath: e.keyPath,
|
|
11
15
|
children: e.children
|
|
12
|
-
})),
|
|
13
|
-
dictionaryKey:
|
|
14
|
-
keyPath:
|
|
15
|
-
locale:
|
|
16
|
-
children:
|
|
16
|
+
})), o = () => typeof r() == "string" ? r() : e.children, {
|
|
17
|
+
dictionaryKey: C,
|
|
18
|
+
keyPath: K,
|
|
19
|
+
locale: P,
|
|
20
|
+
children: x,
|
|
17
21
|
components: d,
|
|
18
22
|
wrapper: c,
|
|
19
23
|
forceBlock: i,
|
|
20
24
|
preserveFrontmatter: y,
|
|
21
25
|
tagfilter: m,
|
|
22
|
-
...
|
|
26
|
+
...k
|
|
23
27
|
} = e;
|
|
24
|
-
return
|
|
28
|
+
return t(o(), {
|
|
25
29
|
components: d,
|
|
26
30
|
wrapper: c,
|
|
27
31
|
forceBlock: i,
|
|
28
32
|
preserveFrontmatter: y,
|
|
29
33
|
tagfilter: m,
|
|
30
|
-
...
|
|
34
|
+
...k
|
|
31
35
|
});
|
|
32
|
-
},
|
|
33
|
-
const
|
|
36
|
+
}, T = (e) => {
|
|
37
|
+
const t = n(() => a({
|
|
34
38
|
dictionaryKey: e.dictionaryKey,
|
|
35
39
|
keyPath: e.keyPath,
|
|
36
40
|
children: e.children
|
|
37
|
-
})),
|
|
38
|
-
return n(() =>
|
|
41
|
+
})), r = n(() => M(t()));
|
|
42
|
+
return n(() => h(r(), e.metadataKeyPath))();
|
|
39
43
|
};
|
|
40
44
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
45
|
+
T as MarkdownMetadataRenderer,
|
|
46
|
+
N as MarkdownRenderer,
|
|
47
|
+
f as renderMarkdown,
|
|
48
|
+
F as useMarkdownRenderer
|
|
43
49
|
};
|
|
@@ -1,15 +1,17 @@
|
|
|
1
|
-
import { compile as
|
|
2
|
-
import { MarkdownContext as t, MarkdownProvider as
|
|
3
|
-
import { MarkdownMetadataRenderer as
|
|
4
|
-
import { solidRuntime as
|
|
1
|
+
import { compile as o, compileMarkdown as d, compiler as n } from "./compiler.mjs";
|
|
2
|
+
import { MarkdownContext as t, MarkdownProvider as M, useMarkdown as k } from "./MarkdownProvider.mjs";
|
|
3
|
+
import { MarkdownMetadataRenderer as w, MarkdownRenderer as p, renderMarkdown as i, useMarkdownRenderer as x } from "./MarkdownRenderer.mjs";
|
|
4
|
+
import { solidRuntime as l } from "./runtime.mjs";
|
|
5
5
|
export {
|
|
6
6
|
t as MarkdownContext,
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
w as MarkdownMetadataRenderer,
|
|
8
|
+
M as MarkdownProvider,
|
|
9
|
+
p as MarkdownRenderer,
|
|
10
|
+
o as compile,
|
|
11
11
|
d as compileMarkdown,
|
|
12
12
|
n as compiler,
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
i as renderMarkdown,
|
|
14
|
+
l as solidRuntime,
|
|
15
|
+
k as useMarkdown,
|
|
16
|
+
x as useMarkdownRenderer
|
|
15
17
|
};
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import { KeyPath, LocalesValues } from '@intlayer/types';
|
|
2
|
-
import { Component } from 'solid-js';
|
|
2
|
+
import { Component, JSX } from 'solid-js';
|
|
3
3
|
import { HTMLComponents } from '../html/types';
|
|
4
|
-
type
|
|
5
|
-
dictionaryKey: string;
|
|
6
|
-
keyPath: KeyPath[];
|
|
7
|
-
locale?: LocalesValues;
|
|
8
|
-
children: string;
|
|
4
|
+
type RenderMarkdownOptions = {
|
|
9
5
|
components?: HTMLComponents<'permissive', {}>;
|
|
10
6
|
wrapper?: any;
|
|
11
7
|
forceBlock?: boolean;
|
|
12
8
|
preserveFrontmatter?: boolean;
|
|
13
9
|
tagfilter?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export declare const renderMarkdown: (content: string, options?: RenderMarkdownOptions) => JSX.Element;
|
|
12
|
+
export declare const useMarkdownRenderer: (options?: RenderMarkdownOptions) => (content: string) => JSX.Element;
|
|
13
|
+
type MarkdownRendererProps = RenderMarkdownOptions & {
|
|
14
|
+
dictionaryKey: string;
|
|
15
|
+
keyPath: KeyPath[];
|
|
16
|
+
locale?: LocalesValues;
|
|
17
|
+
children: string;
|
|
14
18
|
[key: string]: any;
|
|
15
19
|
};
|
|
16
20
|
export declare const MarkdownRenderer: Component<MarkdownRendererProps>;
|
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.6",
|
|
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.6",
|
|
78
|
+
"@intlayer/config": "8.0.0-canary.6",
|
|
79
|
+
"@intlayer/core": "8.0.0-canary.6",
|
|
80
|
+
"@intlayer/editor": "8.0.0-canary.6",
|
|
81
|
+
"@intlayer/types": "8.0.0-canary.6"
|
|
82
82
|
},
|
|
83
83
|
"devDependencies": {
|
|
84
|
-
"@intlayer/unmerged-dictionaries-entry": "8.0.0-canary.
|
|
84
|
+
"@intlayer/unmerged-dictionaries-entry": "8.0.0-canary.6",
|
|
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,7 +91,7 @@
|
|
|
91
91
|
"@utils/tsdown-config": "1.0.4",
|
|
92
92
|
"jsdom": "27.4.0",
|
|
93
93
|
"rimraf": "6.1.2",
|
|
94
|
-
"tsdown": "0.20.
|
|
94
|
+
"tsdown": "0.20.1",
|
|
95
95
|
"typescript": "5.9.3",
|
|
96
96
|
"vite": "7.3.1",
|
|
97
97
|
"vite-plugin-dts": "4.5.4",
|