@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.
Files changed (3) hide show
  1. package/index.js +13 -16
  2. package/index.js.map +1 -1
  3. package/package.json +7 -7
package/index.js CHANGED
@@ -1,20 +1,17 @@
1
- import React from "react";
1
+ import react from "react";
2
2
  import { LexicalHtmlRenderer } from "@webiny/lexical-editor";
3
- const LexicalRenderer = props => {
4
- const getValue = value => {
5
- if (!value) {
6
- return null;
7
- }
8
- return typeof props?.value === "string" ? props.value : JSON.stringify(props.value);
9
- };
10
- return /*#__PURE__*/React.createElement(LexicalHtmlRenderer, {
11
- value: getValue(props?.value),
12
- theme: props.theme,
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,"names":["React","LexicalHtmlRenderer","LexicalRenderer","props","getValue","value","JSON","stringify","createElement","theme","nodes","RichTextLexicalRenderer"],"sources":["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"],"mappings":"AAAA,OAAOA,KAAK,MAAM,OAAO;AAGzB,SAASC,mBAAmB,QAAQ,wBAAwB;AAU5D,MAAMC,eAAe,GAAIC,KAA8B,IAAK;EACxD,MAAMC,QAAQ,GAAIC,KAA2B,IAAoB;IAC7D,IAAI,CAACA,KAAK,EAAE;MACR,OAAO,IAAI;IACf;IACA,OAAO,OAAOF,KAAK,EAAEE,KAAK,KAAK,QAAQ,GAAGF,KAAK,CAACE,KAAK,GAAGC,IAAI,CAACC,SAAS,CAACJ,KAAK,CAACE,KAAK,CAAC;EACvF,CAAC;EAED,oBACIL,KAAA,CAAAQ,aAAA,CAACP,mBAAmB;IAChBI,KAAK,EAAED,QAAQ,CAACD,KAAK,EAAEE,KAAK,CAAE;IAC9BI,KAAK,EAAEN,KAAK,CAACM,KAAM;IACnBC,KAAK,EAAEP,KAAK,CAACO;EAAM,CACtB,CAAC;AAEV,CAAC;AAED,OAAO,MAAMC,uBAAuB,GAAIR,KAA8B,IAAK;EACvE,oBAAOH,KAAA,CAAAQ,aAAA,CAACN,eAAe,EAAKC,KAAQ,CAAC;AACzC,CAAC","ignoreList":[]}
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.0-beta.4",
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.3.0-beta.4",
18
- "@webiny/lexical-theme": "6.3.0-beta.4",
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.3.0-beta.4",
25
- "@webiny/react-composition": "6.3.0-beta.4",
26
- "vitest": "4.1.5"
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": "7cefe15431dbd65504e1f58147dc9e55bcbfa693"
39
+ "gitHead": "a545d7529828af07d08d49c3da1bcb967483b9ce"
40
40
  }