@webiny/react-rich-text-lexical-renderer 6.3.0-beta.4 → 6.4.0-beta.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/index.js +13 -16
- package/index.js.map +1 -1
- package/package.json +7 -7
package/index.js
CHANGED
|
@@ -1,20 +1,17 @@
|
|
|
1
|
-
import
|
|
1
|
+
import react from "react";
|
|
2
2
|
import { LexicalHtmlRenderer } from "@webiny/lexical-editor";
|
|
3
|
-
const LexicalRenderer = props
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
}
|
|
8
|
-
return
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
nodes: props.nodes
|
|
14
|
-
});
|
|
15
|
-
};
|
|
16
|
-
export const RichTextLexicalRenderer = props => {
|
|
17
|
-
return /*#__PURE__*/React.createElement(LexicalRenderer, props);
|
|
3
|
+
const LexicalRenderer = (props)=>{
|
|
4
|
+
const getValue = (value)=>{
|
|
5
|
+
if (!value) return null;
|
|
6
|
+
return "string" == typeof props?.value ? props.value : JSON.stringify(props.value);
|
|
7
|
+
};
|
|
8
|
+
return /*#__PURE__*/ react.createElement(LexicalHtmlRenderer, {
|
|
9
|
+
value: getValue(props?.value),
|
|
10
|
+
theme: props.theme,
|
|
11
|
+
nodes: props.nodes
|
|
12
|
+
});
|
|
18
13
|
};
|
|
14
|
+
const RichTextLexicalRenderer = (props)=>/*#__PURE__*/ react.createElement(LexicalRenderer, props);
|
|
15
|
+
export { RichTextLexicalRenderer };
|
|
19
16
|
|
|
20
17
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../src/index.tsx"],"sourcesContent":["import React from \"react\";\nimport type { Klass, LexicalNode, LexicalValue } from \"@webiny/lexical-editor/types.js\";\nimport type { EditorTheme } from \"@webiny/lexical-theme\";\nimport { LexicalHtmlRenderer } from \"@webiny/lexical-editor\";\n\ntype RendererLexicalValue = LexicalValue | Record<string, any> | null | undefined;\n\ninterface RichTextLexicalRenderer {\n value: RendererLexicalValue;\n theme: EditorTheme;\n nodes?: Klass<LexicalNode>[];\n}\n\nconst LexicalRenderer = (props: RichTextLexicalRenderer) => {\n const getValue = (value: RendererLexicalValue): string | null => {\n if (!value) {\n return null;\n }\n return typeof props?.value === \"string\" ? props.value : JSON.stringify(props.value);\n };\n\n return (\n <LexicalHtmlRenderer\n value={getValue(props?.value)}\n theme={props.theme}\n nodes={props.nodes}\n />\n );\n};\n\nexport const RichTextLexicalRenderer = (props: RichTextLexicalRenderer) => {\n return <LexicalRenderer {...props} />;\n};\n"],"names":["LexicalRenderer","props","getValue","value","JSON","LexicalHtmlRenderer","RichTextLexicalRenderer"],"mappings":";;AAaA,MAAMA,kBAAkB,CAACC;IACrB,MAAMC,WAAW,CAACC;QACd,IAAI,CAACA,OACD,OAAO;QAEX,OAAO,AAAwB,YAAxB,OAAOF,OAAO,QAAqBA,MAAM,KAAK,GAAGG,KAAK,SAAS,CAACH,MAAM,KAAK;IACtF;IAEA,OAAO,WAAP,GACI,oBAACI,qBAAmBA;QAChB,OAAOH,SAASD,OAAO;QACvB,OAAOA,MAAM,KAAK;QAClB,OAAOA,MAAM,KAAK;;AAG9B;AAEO,MAAMK,0BAA0B,CAACL,QAC7B,WAAP,GAAO,oBAACD,iBAAoBC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@webiny/react-rich-text-lexical-renderer",
|
|
3
|
-
"version": "6.
|
|
3
|
+
"version": "6.4.0-beta.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./index.js",
|
|
@@ -14,16 +14,16 @@
|
|
|
14
14
|
"license": "MIT",
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"@types/react": "18.3.28",
|
|
17
|
-
"@webiny/lexical-editor": "6.
|
|
18
|
-
"@webiny/lexical-theme": "6.
|
|
17
|
+
"@webiny/lexical-editor": "6.4.0-beta.0",
|
|
18
|
+
"@webiny/lexical-theme": "6.4.0-beta.0",
|
|
19
19
|
"react": "18.3.1"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
22
|
"@emotion/react": "11.14.0",
|
|
23
23
|
"@testing-library/react": "16.3.2",
|
|
24
|
-
"@webiny/build-tools": "6.
|
|
25
|
-
"@webiny/react-composition": "6.
|
|
26
|
-
"vitest": "4.1.
|
|
24
|
+
"@webiny/build-tools": "6.4.0-beta.0",
|
|
25
|
+
"@webiny/react-composition": "6.4.0-beta.0",
|
|
26
|
+
"vitest": "4.1.6"
|
|
27
27
|
},
|
|
28
28
|
"publishConfig": {
|
|
29
29
|
"access": "public",
|
|
@@ -36,5 +36,5 @@
|
|
|
36
36
|
]
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
|
-
"gitHead": "
|
|
39
|
+
"gitHead": "a545d7529828af07d08d49c3da1bcb967483b9ce"
|
|
40
40
|
}
|