@payloadcms/richtext-lexical 3.65.0-internal.098b771 → 3.65.0-internal.5b33fe0

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 (88) hide show
  1. package/dist/exports/client/Field-CFLUGR3C.js +2 -0
  2. package/dist/exports/client/Field-CFLUGR3C.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-6NIGQP6A.js +12 -0
  5. package/dist/exports/client/chunk-6NIGQP6A.js.map +7 -0
  6. package/dist/exports/client/index.d.ts +1 -0
  7. package/dist/exports/client/index.d.ts.map +1 -1
  8. package/dist/exports/client/index.js +20 -20
  9. package/dist/exports/client/index.js.map +3 -3
  10. package/dist/exports/react/index.d.ts +1 -1
  11. package/dist/exports/react/index.d.ts.map +1 -1
  12. package/dist/exports/react/index.js.map +1 -1
  13. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +2 -14
  14. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  15. package/dist/features/converters/lexicalToJSX/Component/index.js +4 -2
  16. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  17. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +16 -1
  18. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  19. package/dist/features/converters/lexicalToJSX/converter/index.js +76 -4
  20. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  21. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +14 -10
  22. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  23. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  24. package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -1
  25. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  26. package/dist/features/typesServer.d.ts +2 -2
  27. package/dist/features/typesServer.d.ts.map +1 -1
  28. package/dist/features/typesServer.js.map +1 -1
  29. package/dist/field/Field.d.ts.map +1 -1
  30. package/dist/field/Field.js +10 -5
  31. package/dist/field/Field.js.map +1 -1
  32. package/dist/field/RichTextViewProvider.d.ts +83 -0
  33. package/dist/field/RichTextViewProvider.d.ts.map +1 -0
  34. package/dist/field/RichTextViewProvider.js +87 -0
  35. package/dist/field/RichTextViewProvider.js.map +1 -0
  36. package/dist/field/ViewSelector.d.ts +4 -0
  37. package/dist/field/ViewSelector.d.ts.map +1 -0
  38. package/dist/field/ViewSelector.js +89 -0
  39. package/dist/field/ViewSelector.js.map +1 -0
  40. package/dist/field/bundled.css +1 -1
  41. package/dist/field/index.d.ts +1 -0
  42. package/dist/field/index.d.ts.map +1 -1
  43. package/dist/field/index.js +47 -29
  44. package/dist/field/index.js.map +1 -1
  45. package/dist/field/rscEntry.d.ts +1 -1
  46. package/dist/field/rscEntry.d.ts.map +1 -1
  47. package/dist/field/rscEntry.js +12 -0
  48. package/dist/field/rscEntry.js.map +1 -1
  49. package/dist/index.d.ts +1 -1
  50. package/dist/index.d.ts.map +1 -1
  51. package/dist/index.js +3 -1
  52. package/dist/index.js.map +1 -1
  53. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  54. package/dist/lexical/LexicalEditor.js +2 -1
  55. package/dist/lexical/LexicalEditor.js.map +1 -1
  56. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  57. package/dist/lexical/LexicalProvider.js +12 -3
  58. package/dist/lexical/LexicalProvider.js.map +1 -1
  59. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  60. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  61. package/dist/lexical/config/client/sanitize.js +3 -2
  62. package/dist/lexical/config/client/sanitize.js.map +1 -1
  63. package/dist/lexical/config/types.d.ts +4 -0
  64. package/dist/lexical/config/types.d.ts.map +1 -1
  65. package/dist/lexical/config/types.js.map +1 -1
  66. package/dist/lexical/nodes/index.d.ts +12 -2
  67. package/dist/lexical/nodes/index.d.ts.map +1 -1
  68. package/dist/lexical/nodes/index.js +195 -2
  69. package/dist/lexical/nodes/index.js.map +1 -1
  70. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts +2 -0
  71. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -0
  72. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +48 -0
  73. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -0
  74. package/dist/types.d.ts +136 -2
  75. package/dist/types.d.ts.map +1 -1
  76. package/dist/types.js.map +1 -1
  77. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  78. package/dist/utilities/generateImportMap.js +1 -0
  79. package/dist/utilities/generateImportMap.js.map +1 -1
  80. package/dist/validate/hasText.d.ts +6 -1
  81. package/dist/validate/hasText.d.ts.map +1 -1
  82. package/dist/validate/hasText.js +10 -4
  83. package/dist/validate/hasText.js.map +1 -1
  84. package/package.json +6 -6
  85. package/dist/exports/client/Field-QUXIGJRC.js +0 -2
  86. package/dist/exports/client/Field-QUXIGJRC.js.map +0 -7
  87. package/dist/exports/client/chunk-AFXLIYGL.js +0 -12
  88. package/dist/exports/client/chunk-AFXLIYGL.js.map +0 -7
@@ -12,5 +12,5 @@ export { TextJSXConverter } from '../../features/converters/lexicalToJSX/convert
12
12
  export { UploadJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/upload.js';
13
13
  export { defaultJSXConverters } from '../../features/converters/lexicalToJSX/converter/defaultConverters.js';
14
14
  export { convertLexicalNodesToJSX } from '../../features/converters/lexicalToJSX/converter/index.js';
15
- export type { JSXConverter, JSXConverters, SerializedLexicalNodeWithParent, } from '../../features/converters/lexicalToJSX/converter/types.js';
15
+ export type { JSXConverter, JSXConverterArgs, JSXConverters, SerializedLexicalNodeWithParent, } from '../../features/converters/lexicalToJSX/converter/types.js';
16
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/react/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,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G,OAAO,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAA;AACtG,OAAO,EAAE,qBAAqB,EAAE,MAAM,0EAA0E,CAAA;AAChH,OAAO,EAAE,eAAe,EAAE,MAAM,oEAAoE,CAAA;AACpG,OAAO,EAAE,iBAAiB,EAAE,MAAM,sEAAsE,CAAA;AAExG,OAAO,EAAE,gBAAgB,EAAE,MAAM,qEAAqE,CAAA;AAEtG,OAAO,EAAE,kBAAkB,EAAE,MAAM,uEAAuE,CAAA;AAC1G,OAAO,EAAE,oBAAoB,EAAE,MAAM,uEAAuE,CAAA;AAC5G,OAAO,EAAE,wBAAwB,EAAE,MAAM,2DAA2D,CAAA;AACpG,YAAY,EACV,YAAY,EACZ,gBAAgB,EAChB,aAAa,EACb,+BAA+B,GAChC,MAAM,2DAA2D,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["RichText","BlockquoteJSXConverter","HeadingJSXConverter","HorizontalRuleJSXConverter","LinebreakJSXConverter","LinkJSXConverter","ListJSXConverter","ParagraphJSXConverter","TabJSXConverter","TableJSXConverter","TextJSXConverter","UploadJSXConverter","defaultJSXConverters","convertLexicalNodesToJSX"],"sources":["../../../src/exports/react/index.ts"],"sourcesContent":["export {\n type JSXConvertersFunction,\n RichText,\n} from '../../features/converters/lexicalToJSX/Component/index.js'\nexport { BlockquoteJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/blockquote.js'\nexport { HeadingJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/heading.js'\nexport { HorizontalRuleJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/horizontalRule.js'\nexport { LinebreakJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/linebreak.js'\nexport { LinkJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/link.js'\nexport { ListJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/list.js'\nexport { ParagraphJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/paragraph.js'\nexport { TabJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/tab.js'\nexport { TableJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/table.js'\n\nexport { TextJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/text.js'\n\nexport { UploadJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/upload.js'\nexport { defaultJSXConverters } from '../../features/converters/lexicalToJSX/converter/defaultConverters.js'\nexport { convertLexicalNodesToJSX } from '../../features/converters/lexicalToJSX/converter/index.js'\nexport type {\n JSXConverter,\n JSXConverters,\n SerializedLexicalNodeWithParent,\n} from '../../features/converters/lexicalToJSX/converter/types.js'\n"],"mappings":"AAAA,SAEEA,QAAQ,QACH;AACP,SAASC,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,eAAe,QAAQ;AAChC,SAASC,iBAAiB,QAAQ;AAElC,SAASC,gBAAgB,QAAQ;AAEjC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,wBAAwB,QAAQ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["RichText","BlockquoteJSXConverter","HeadingJSXConverter","HorizontalRuleJSXConverter","LinebreakJSXConverter","LinkJSXConverter","ListJSXConverter","ParagraphJSXConverter","TabJSXConverter","TableJSXConverter","TextJSXConverter","UploadJSXConverter","defaultJSXConverters","convertLexicalNodesToJSX"],"sources":["../../../src/exports/react/index.ts"],"sourcesContent":["export {\n type JSXConvertersFunction,\n RichText,\n} from '../../features/converters/lexicalToJSX/Component/index.js'\nexport { BlockquoteJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/blockquote.js'\nexport { HeadingJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/heading.js'\nexport { HorizontalRuleJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/horizontalRule.js'\nexport { LinebreakJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/linebreak.js'\nexport { LinkJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/link.js'\nexport { ListJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/list.js'\nexport { ParagraphJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/paragraph.js'\nexport { TabJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/tab.js'\nexport { TableJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/table.js'\n\nexport { TextJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/text.js'\n\nexport { UploadJSXConverter } from '../../features/converters/lexicalToJSX/converter/converters/upload.js'\nexport { defaultJSXConverters } from '../../features/converters/lexicalToJSX/converter/defaultConverters.js'\nexport { convertLexicalNodesToJSX } from '../../features/converters/lexicalToJSX/converter/index.js'\nexport type {\n JSXConverter,\n JSXConverterArgs,\n JSXConverters,\n SerializedLexicalNodeWithParent,\n} from '../../features/converters/lexicalToJSX/converter/types.js'\n"],"mappings":"AAAA,SAEEA,QAAQ,QACH;AACP,SAASC,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,eAAe,QAAQ;AAChC,SAASC,iBAAiB,QAAQ;AAElC,SAASC,gBAAgB,QAAQ;AAEjC,SAASC,kBAAkB,QAAQ;AACnC,SAASC,oBAAoB,QAAQ;AACrC,SAASC,wBAAwB,QAAQ","ignoreList":[]}
@@ -1,7 +1,7 @@
1
- import type { SerializedEditorState } from 'lexical';
2
1
  import React from 'react';
3
2
  import type { DefaultNodeTypes, SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js';
4
3
  import type { JSXConverters } from '../converter/types.js';
4
+ import { type ConvertLexicalToJSXArgs } from '../converter/index.js';
5
5
  export type JSXConvertersFunction<T extends {
6
6
  [key: string]: any;
7
7
  type?: string;
@@ -21,23 +21,11 @@ type RichTextProps = {
21
21
  * Custom converters to transform your nodes to JSX. Can be an object or a function that receives the default converters.
22
22
  */
23
23
  converters?: JSXConverters | JSXConvertersFunction;
24
- /**
25
- * Serialized editor state to render.
26
- */
27
- data: SerializedEditorState;
28
24
  /**
29
25
  * If true, removes the container div wrapper.
30
26
  */
31
27
  disableContainer?: boolean;
32
- /**
33
- * If true, disables indentation globally. If an array, disables for specific node `type` values.
34
- */
35
- disableIndent?: boolean | string[];
36
- /**
37
- * If true, disables text alignment globally. If an array, disables for specific node `type` values.
38
- */
39
- disableTextAlign?: boolean | string[];
40
- };
28
+ } & Pick<ConvertLexicalToJSXArgs, 'data' | 'disableIndent' | 'disableTextAlign' | 'nodeMap'>;
41
29
  export declare const RichText: React.FC<RichTextProps>;
42
30
  export {};
43
31
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/Component/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAK1D,MAAM,MAAM,qBAAqB,CAC/B,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C,gBAAgB,GAChB,mBAAmB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CAAE,CAAC,GAClD,yBAAyB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CAAE,CAAC,IAC1D,CAAC,IAAI,EAAE;IAAE,iBAAiB,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAA;CAAE,KAAK,aAAa,CAAC,CAAC,CAAC,CAAA;AAEtF,KAAK,aAAa,GAAG;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,GAAG,qBAAqB,CAAA;IAClD;;OAEG;IACH,IAAI,EAAE,qBAAqB,CAAA;IAC3B;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;IAC1B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;CACtC,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAwC5C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/Component/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAA;AAG1D,OAAO,EAAuB,KAAK,uBAAuB,EAAE,MAAM,uBAAuB,CAAA;AAEzF,MAAM,MAAM,qBAAqB,CAC/B,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C,gBAAgB,GAChB,mBAAmB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CAAE,CAAC,GAClD,yBAAyB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;CAAE,CAAC,IAC1D,CAAC,IAAI,EAAE;IAAE,iBAAiB,EAAE,aAAa,CAAC,gBAAgB,CAAC,CAAA;CAAE,KAAK,aAAa,CAAC,CAAC,CAAC,CAAA;AAEtF,KAAK,aAAa,GAAG;IACnB;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB;;OAEG;IACH,UAAU,CAAC,EAAE,aAAa,GAAG,qBAAqB,CAAA;IAElD;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,GAAG,IAAI,CAAC,uBAAuB,EAAE,MAAM,GAAG,eAAe,GAAG,kBAAkB,GAAG,SAAS,CAAC,CAAA;AAE5F,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA0C5C,CAAA"}
@@ -8,7 +8,8 @@ export const RichText = ({
8
8
  data: editorState,
9
9
  disableContainer,
10
10
  disableIndent,
11
- disableTextAlign
11
+ disableTextAlign,
12
+ nodeMap
12
13
  }) => {
13
14
  if (!editorState) {
14
15
  return null;
@@ -29,7 +30,8 @@ export const RichText = ({
29
30
  converters: finalConverters,
30
31
  data: editorState,
31
32
  disableIndent,
32
- disableTextAlign
33
+ disableTextAlign,
34
+ nodeMap
33
35
  });
34
36
  if (disableContainer) {
35
37
  return /*#__PURE__*/_jsx(_Fragment, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","defaultJSXConverters","convertLexicalToJSX","RichText","className","converters","data","editorState","disableContainer","disableIndent","disableTextAlign","finalConverters","defaultConverters","content","Array","isArray","_jsx","_Fragment"],"sources":["../../../../../src/features/converters/lexicalToJSX/Component/index.tsx"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\n\nimport React from 'react'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../nodeTypes.js'\nimport type { JSXConverters } from '../converter/types.js'\n\nimport { defaultJSXConverters } from '../converter/defaultConverters.js'\nimport { convertLexicalToJSX } from '../converter/index.js'\n\nexport type JSXConvertersFunction<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string }>\n | SerializedInlineBlockNode<{ blockName?: null | string }>,\n> = (args: { defaultConverters: JSXConverters<DefaultNodeTypes> }) => JSXConverters<T>\n\ntype RichTextProps = {\n /**\n * Override class names for the container.\n */\n className?: string\n /**\n * Custom converters to transform your nodes to JSX. Can be an object or a function that receives the default converters.\n */\n converters?: JSXConverters | JSXConvertersFunction\n /**\n * Serialized editor state to render.\n */\n data: SerializedEditorState\n /**\n * If true, removes the container div wrapper.\n */\n disableContainer?: boolean\n /**\n * If true, disables indentation globally. If an array, disables for specific node `type` values.\n */\n disableIndent?: boolean | string[]\n /**\n * If true, disables text alignment globally. If an array, disables for specific node `type` values.\n */\n disableTextAlign?: boolean | string[]\n}\n\nexport const RichText: React.FC<RichTextProps> = ({\n className,\n converters,\n data: editorState,\n disableContainer,\n disableIndent,\n disableTextAlign,\n}) => {\n if (!editorState) {\n return null\n }\n\n let finalConverters: JSXConverters = {}\n if (converters) {\n if (typeof converters === 'function') {\n finalConverters = converters({ defaultConverters: defaultJSXConverters })\n } else {\n finalConverters = converters\n }\n } else {\n finalConverters = defaultJSXConverters\n }\n\n const content =\n editorState &&\n !Array.isArray(editorState) &&\n typeof editorState === 'object' &&\n 'root' in editorState &&\n convertLexicalToJSX({\n converters: finalConverters,\n data: editorState,\n disableIndent,\n disableTextAlign,\n })\n\n if (disableContainer) {\n return <>{content}</>\n }\n\n return <div className={className ?? 'payload-richtext'}>{content}</div>\n}\n"],"mappings":";AAEA,OAAOA,KAAA,MAAW;AASlB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,QAAQ;AAoCpC,OAAO,MAAMC,QAAA,GAAoCA,CAAC;EAChDC,SAAS;EACTC,UAAU;EACVC,IAAA,EAAMC,WAAW;EACjBC,gBAAgB;EAChBC,aAAa;EACbC;AAAgB,CACjB;EACC,IAAI,CAACH,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAII,eAAA,GAAiC,CAAC;EACtC,IAAIN,UAAA,EAAY;IACd,IAAI,OAAOA,UAAA,KAAe,YAAY;MACpCM,eAAA,GAAkBN,UAAA,CAAW;QAAEO,iBAAA,EAAmBX;MAAqB;IACzE,OAAO;MACLU,eAAA,GAAkBN,UAAA;IACpB;EACF,OAAO;IACLM,eAAA,GAAkBV,oBAAA;EACpB;EAEA,MAAMY,OAAA,GACJN,WAAA,IACA,CAACO,KAAA,CAAMC,OAAO,CAACR,WAAA,KACf,OAAOA,WAAA,KAAgB,YACvB,UAAUA,WAAA,IACVL,mBAAA,CAAoB;IAClBG,UAAA,EAAYM,eAAA;IACZL,IAAA,EAAMC,WAAA;IACNE,aAAA;IACAC;EACF;EAEF,IAAIF,gBAAA,EAAkB;IACpB,oBAAOQ,IAAA,CAAAC,SAAA;gBAAGJ;;EACZ;EAEA,oBAAOG,IAAA,CAAC;IAAIZ,SAAA,EAAWA,SAAA,IAAa;cAAqBS;;AAC3D","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","defaultJSXConverters","convertLexicalToJSX","RichText","className","converters","data","editorState","disableContainer","disableIndent","disableTextAlign","nodeMap","finalConverters","defaultConverters","content","Array","isArray","_jsx","_Fragment"],"sources":["../../../../../src/features/converters/lexicalToJSX/Component/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../nodeTypes.js'\nimport type { JSXConverters } from '../converter/types.js'\n\nimport { defaultJSXConverters } from '../converter/defaultConverters.js'\nimport { convertLexicalToJSX, type ConvertLexicalToJSXArgs } from '../converter/index.js'\n\nexport type JSXConvertersFunction<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string }>\n | SerializedInlineBlockNode<{ blockName?: null | string }>,\n> = (args: { defaultConverters: JSXConverters<DefaultNodeTypes> }) => JSXConverters<T>\n\ntype RichTextProps = {\n /**\n * Override class names for the container.\n */\n className?: string\n /**\n * Custom converters to transform your nodes to JSX. Can be an object or a function that receives the default converters.\n */\n converters?: JSXConverters | JSXConvertersFunction\n\n /**\n * If true, removes the container div wrapper.\n */\n disableContainer?: boolean\n} & Pick<ConvertLexicalToJSXArgs, 'data' | 'disableIndent' | 'disableTextAlign' | 'nodeMap'>\n\nexport const RichText: React.FC<RichTextProps> = ({\n className,\n converters,\n data: editorState,\n disableContainer,\n disableIndent,\n disableTextAlign,\n nodeMap,\n}) => {\n if (!editorState) {\n return null\n }\n\n let finalConverters: JSXConverters = {}\n if (converters) {\n if (typeof converters === 'function') {\n finalConverters = converters({ defaultConverters: defaultJSXConverters })\n } else {\n finalConverters = converters\n }\n } else {\n finalConverters = defaultJSXConverters\n }\n\n const content =\n editorState &&\n !Array.isArray(editorState) &&\n typeof editorState === 'object' &&\n 'root' in editorState &&\n convertLexicalToJSX({\n converters: finalConverters,\n data: editorState,\n disableIndent,\n disableTextAlign,\n nodeMap,\n })\n\n if (disableContainer) {\n return <>{content}</>\n }\n\n return <div className={className ?? 'payload-richtext'}>{content}</div>\n}\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AASlB,SAASC,oBAAoB,QAAQ;AACrC,SAASC,mBAAmB,QAAsC;AAyBlE,OAAO,MAAMC,QAAA,GAAoCA,CAAC;EAChDC,SAAS;EACTC,UAAU;EACVC,IAAA,EAAMC,WAAW;EACjBC,gBAAgB;EAChBC,aAAa;EACbC,gBAAgB;EAChBC;AAAO,CACR;EACC,IAAI,CAACJ,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAIK,eAAA,GAAiC,CAAC;EACtC,IAAIP,UAAA,EAAY;IACd,IAAI,OAAOA,UAAA,KAAe,YAAY;MACpCO,eAAA,GAAkBP,UAAA,CAAW;QAAEQ,iBAAA,EAAmBZ;MAAqB;IACzE,OAAO;MACLW,eAAA,GAAkBP,UAAA;IACpB;EACF,OAAO;IACLO,eAAA,GAAkBX,oBAAA;EACpB;EAEA,MAAMa,OAAA,GACJP,WAAA,IACA,CAACQ,KAAA,CAAMC,OAAO,CAACT,WAAA,KACf,OAAOA,WAAA,KAAgB,YACvB,UAAUA,WAAA,IACVL,mBAAA,CAAoB;IAClBG,UAAA,EAAYO,eAAA;IACZN,IAAA,EAAMC,WAAA;IACNE,aAAA;IACAC,gBAAA;IACAC;EACF;EAEF,IAAIH,gBAAA,EAAkB;IACpB,oBAAOS,IAAA,CAAAC,SAAA;gBAAGJ;;EACZ;EAEA,oBAAOG,IAAA,CAAC;IAAIb,SAAA,EAAWA,SAAA,IAAa;cAAqBU;;AAC3D","ignoreList":[]}
@@ -1,13 +1,28 @@
1
1
  import type { SerializedEditorState, SerializedLexicalNode } from 'lexical';
2
2
  import React from 'react';
3
+ import type { LexicalEditorNodeMap } from '../../../../types.js';
3
4
  import type { JSXConverters, SerializedLexicalNodeWithParent } from './types.js';
4
5
  export type ConvertLexicalToJSXArgs = {
5
6
  converters: JSXConverters;
7
+ /**
8
+ * Serialized editor state to render.
9
+ */
6
10
  data: SerializedEditorState;
11
+ /**
12
+ * If true, disables indentation globally. If an array, disables for specific node `type` values.
13
+ */
7
14
  disableIndent?: boolean | string[];
15
+ /**
16
+ * If true, disables text alignment globally. If an array, disables for specific node `type` values.
17
+ */
8
18
  disableTextAlign?: boolean | string[];
19
+ /**
20
+ * You can use the lexical editor node map or view map as converters. NodeMap converters will override converters passed
21
+ * in the `converters` prop. If a LexicalEditorViewMap is provided, the `default` view will be used.
22
+ */
23
+ nodeMap?: LexicalEditorNodeMap;
9
24
  };
10
- export declare function convertLexicalToJSX({ converters, data, disableIndent, disableTextAlign, }: ConvertLexicalToJSXArgs): React.ReactNode;
25
+ export declare function convertLexicalToJSX({ converters, data, disableIndent, disableTextAlign, nodeMap, }: ConvertLexicalToJSXArgs): React.ReactNode;
11
26
  export declare function convertLexicalNodesToJSX({ converters, disableIndent, disableTextAlign, nodes, parent, }: {
12
27
  converters: JSXConverters;
13
28
  disableIndent?: boolean | string[];
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAgB,aAAa,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAI9F,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,aAAa,CAAA;IACzB,IAAI,EAAE,qBAAqB,CAAA;IAC3B,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;CACtC,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,IAAI,EACJ,aAAa,EACb,gBAAgB,GACjB,EAAE,uBAAuB,GAAG,KAAK,CAAC,SAAS,CAW3C;AAED,wBAAgB,wBAAwB,CAAC,EACvC,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,MAAM,GACP,EAAE;IACD,UAAU,EAAE,aAAa,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC,KAAK,EAAE,qBAAqB,EAAE,CAAA;IAC9B,MAAM,EAAE,+BAA+B,CAAA;CACxC,GAAG,KAAK,CAAC,SAAS,EAAE,CAmIpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,oBAAoB,EAAgB,MAAM,sBAAsB,CAAA;AAC9E,OAAO,KAAK,EAAgB,aAAa,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AA8E9F,MAAM,MAAM,uBAAuB,GAAG;IACpC,UAAU,EAAE,aAAa,CAAA;IACzB;;OAEG;IACH,IAAI,EAAE,qBAAqB,CAAA;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAA;CAC/B,CAAA;AAED,wBAAgB,mBAAmB,CAAC,EAClC,UAAU,EACV,IAAI,EACJ,aAAa,EACb,gBAAgB,EAChB,OAAO,GACR,EAAE,uBAAuB,GAAG,KAAK,CAAC,SAAS,CAoB3C;AAED,wBAAgB,wBAAwB,CAAC,EACvC,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,MAAM,GACP,EAAE;IACD,UAAU,EAAE,aAAa,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC,KAAK,EAAE,qBAAqB,EAAE,CAAA;IAC9B,MAAM,EAAE,+BAA+B,CAAA;CACxC,GAAG,KAAK,CAAC,SAAS,EAAE,CAmIpB"}
@@ -1,19 +1,91 @@
1
1
  /* eslint-disable no-console */import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
2
  import React from 'react';
3
3
  import { hasText } from '../../../../validate/hasText.js';
4
+ /**
5
+ * Creates a JSX converter from a NodeMapValue
6
+ */
7
+ function createConverterFromNodeMapValue(viewDef) {
8
+ return args => {
9
+ const converterArgs = {
10
+ ...args,
11
+ isEditor: false,
12
+ isJSXConverter: true
13
+ };
14
+ // If Component is provided, use it
15
+ if (viewDef.Component) {
16
+ return viewDef.Component(converterArgs);
17
+ }
18
+ // If html is provided (as a function or string), use it
19
+ // Note: Using span instead of div to avoid forcing block-level semantics
20
+ if (viewDef.html) {
21
+ const htmlContent = typeof viewDef.html === 'function' ? viewDef.html(converterArgs) : viewDef.html;
22
+ return /*#__PURE__*/_jsx("span", {
23
+ dangerouslySetInnerHTML: {
24
+ __html: htmlContent
25
+ }
26
+ });
27
+ }
28
+ return null;
29
+ };
30
+ }
31
+ /**
32
+ * Converts a LexicalEditorNodeMap into JSXConverters
33
+ */
34
+ function nodeMapToConverters(nodeMap) {
35
+ const converters = {};
36
+ for (const [nodeType, value] of Object.entries(nodeMap)) {
37
+ if (!value || typeof value !== 'object') {
38
+ continue;
39
+ }
40
+ // Handle special keys: blocks, inlineBlocks
41
+ if (nodeType === 'blocks') {
42
+ converters.blocks = {};
43
+ for (const [blockType, _viewDef] of Object.entries(value)) {
44
+ const viewDef = _viewDef;
45
+ if (viewDef.Component || viewDef.html) {
46
+ converters.blocks[blockType] = createConverterFromNodeMapValue(viewDef);
47
+ }
48
+ }
49
+ continue;
50
+ }
51
+ if (nodeType === 'inlineBlocks') {
52
+ converters.inlineBlocks = {};
53
+ for (const [blockType, _viewDef] of Object.entries(value)) {
54
+ const viewDef = _viewDef;
55
+ if (viewDef.Component || viewDef.html) {
56
+ converters.inlineBlocks[blockType] = createConverterFromNodeMapValue(viewDef);
57
+ }
58
+ }
59
+ continue;
60
+ }
61
+ // Handle regular node types
62
+ const viewDef = value;
63
+ if (viewDef.Component || viewDef.html) {
64
+ converters[nodeType] = createConverterFromNodeMapValue(viewDef);
65
+ }
66
+ }
67
+ return converters;
68
+ }
4
69
  export function convertLexicalToJSX({
5
70
  converters,
6
71
  data,
7
72
  disableIndent,
8
- disableTextAlign
73
+ disableTextAlign,
74
+ nodeMap
9
75
  }) {
10
76
  if (hasText(data)) {
77
+ // Merge nodeMap converters with existing converters
78
+ // NodeMap converters override existing converters
79
+ const mergedConverters = nodeMap ? {
80
+ ...converters,
81
+ ...nodeMapToConverters(nodeMap)
82
+ } : converters;
11
83
  return convertLexicalNodesToJSX({
12
- converters,
84
+ converters: mergedConverters,
13
85
  disableIndent,
14
86
  disableTextAlign,
15
- nodes: data?.root?.children,
16
- parent: data?.root
87
+ nodes: data.root.children,
88
+ parent: data.root
17
89
  });
18
90
  }
19
91
  return /*#__PURE__*/_jsx(_Fragment, {});
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["jsx","_jsx","Fragment","_Fragment","React","hasText","convertLexicalToJSX","converters","data","disableIndent","disableTextAlign","convertLexicalNodesToJSX","nodes","root","children","parent","unknownConverter","unknown","jsxArray","map","node","i","converterForNode","type","blocks","fields","blockType","console","error","inlineBlocks","reactNode","converted","childIndex","nodesToJSX","args","style","Array","isArray","includes","format","textAlign","indent","paddingInlineStart","Number","isValidElement","newStyle","props","cloneElement","key","filter","Boolean"],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport React from 'react'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js'\nimport type { JSXConverter, JSXConverters, SerializedLexicalNodeWithParent } from './types.js'\n\nimport { hasText } from '../../../../validate/hasText.js'\n\nexport type ConvertLexicalToJSXArgs = {\n converters: JSXConverters\n data: SerializedEditorState\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n}\n\nexport function convertLexicalToJSX({\n converters,\n data,\n disableIndent,\n disableTextAlign,\n}: ConvertLexicalToJSXArgs): React.ReactNode {\n if (hasText(data)) {\n return convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes: data?.root?.children,\n parent: data?.root,\n })\n }\n return <></>\n}\n\nexport function convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes,\n parent,\n}: {\n converters: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent: SerializedLexicalNodeWithParent\n}): React.ReactNode[] {\n const unknownConverter: JSXConverter<any> = converters.unknown as JSXConverter<any>\n\n const jsxArray: React.ReactNode[] = nodes.map((node, i) => {\n let converterForNode: JSXConverter<any> | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[(node as SerializedBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode =\n converters?.inlineBlocks?.[(node as SerializedInlineBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as JSXConverter<any>\n }\n\n try {\n if (!converterForNode && unknownConverter) {\n converterForNode = unknownConverter\n }\n\n let reactNode: React.ReactNode\n if (converterForNode) {\n const converted =\n typeof converterForNode === 'function'\n ? converterForNode({\n childIndex: i,\n converters,\n node,\n nodesToJSX: (args) => {\n return convertLexicalNodesToJSX({\n converters: args.converters ?? converters,\n disableIndent: args.disableIndent ?? disableIndent,\n disableTextAlign: args.disableTextAlign ?? disableTextAlign,\n nodes: args.nodes,\n parent: args.parent ?? {\n ...node,\n parent,\n },\n })\n },\n parent,\n })\n : converterForNode\n reactNode = converted\n } else {\n reactNode = <span key={i}>unknown node</span>\n }\n\n const style: React.CSSProperties = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style.textAlign = 'center'\n break\n case 'end':\n style.textAlign = 'right'\n break\n case 'justify':\n style.textAlign = 'justify'\n break\n case 'left':\n //style.textAlign = 'left'\n // Do nothing, as left is the default\n break\n case 'right':\n style.textAlign = 'right'\n break\n case 'start':\n style.textAlign = 'left'\n break\n }\n }\n }\n\n if (\n !disableIndent &&\n (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))\n ) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style.paddingInlineStart = `${Number(node.indent) * 40}px`\n }\n }\n\n if (React.isValidElement(reactNode)) {\n // Inject style into reactNode\n if (style.textAlign || style.paddingInlineStart) {\n const newStyle = {\n ...style,\n // @ts-expect-error type better later\n ...(reactNode?.props?.style ?? {}),\n // reactNode style comes after, thus a textAlign specified in the converter has priority over the one we inject here\n }\n\n return React.cloneElement(reactNode, {\n key: i,\n // @ts-expect-error type better later\n style: newStyle,\n })\n }\n return React.cloneElement(reactNode, {\n key: i,\n })\n }\n\n return reactNode\n } catch (error) {\n console.error('Error converting lexical node to JSX:', error, 'node:', node)\n return null\n }\n })\n\n return jsxArray.filter(Boolean)\n}\n"],"mappings":"AAAA,+BAA6B,SAAAA,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAG7B,OAAOC,KAAA,MAAW;AAKlB,SAASC,OAAO,QAAQ;AASxB,OAAO,SAASC,oBAAoB;EAClCC,UAAU;EACVC,IAAI;EACJC,aAAa;EACbC;AAAgB,CACQ;EACxB,IAAIL,OAAA,CAAQG,IAAA,GAAO;IACjB,OAAOG,wBAAA,CAAyB;MAC9BJ,UAAA;MACAE,aAAA;MACAC,gBAAA;MACAE,KAAA,EAAOJ,IAAA,EAAMK,IAAA,EAAMC,QAAA;MACnBC,MAAA,EAAQP,IAAA,EAAMK;IAChB;EACF;EACA,oBAAOZ,IAAA,CAAAE,SAAA;AAC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B,GAAG,GAAGC,MAAA,CAAOvB,IAAA,CAAKqB,MAAM,IAAI,MAAM;QAC5D;MACF;MAEA,iBAAIrC,KAAA,CAAMwC,cAAc,CAACd,SAAA,GAAY;QACnC;QACA,IAAIK,KAAA,CAAMK,SAAS,IAAIL,KAAA,CAAMO,kBAAkB,EAAE;UAC/C,MAAMG,QAAA,GAAW;YACf,GAAGV,KAAK;YACR;YACA,IAAIL,SAAA,EAAWgB,KAAA,EAAOX,KAAA,IAAS,CAAC,CAAC;UAEnC;UAEA,oBAAO/B,KAAA,CAAM2C,YAAY,CAACjB,SAAA,EAAW;YACnCkB,GAAA,EAAK3B,CAAA;YACL;YACAc,KAAA,EAAOU;UACT;QACF;QACA,oBAAOzC,KAAA,CAAM2C,YAAY,CAACjB,SAAA,EAAW;UACnCkB,GAAA,EAAK3B;QACP;MACF;MAEA,OAAOS,SAAA;IACT,EAAE,OAAOF,KAAA,EAAO;MACdD,OAAA,CAAQC,KAAK,CAAC,yCAAyCA,KAAA,EAAO,SAASR,IAAA;MACvE,OAAO;IACT;EACF;EAEA,OAAOF,QAAA,CAAS+B,MAAM,CAACC,OAAA;AACzB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["jsx","_jsx","Fragment","_Fragment","React","hasText","createConverterFromNodeMapValue","viewDef","args","converterArgs","isEditor","isJSXConverter","Component","html","htmlContent","dangerouslySetInnerHTML","__html","nodeMapToConverters","nodeMap","converters","nodeType","value","Object","entries","blocks","blockType","_viewDef","inlineBlocks","convertLexicalToJSX","data","disableIndent","disableTextAlign","mergedConverters","convertLexicalNodesToJSX","nodes","root","children","parent","unknownConverter","unknown","jsxArray","map","node","i","converterForNode","type","fields","console","error","reactNode","converted","childIndex","nodesToJSX","style","Array","isArray","includes","format","textAlign","indent","paddingInlineStart","Number","isValidElement","newStyle","props","cloneElement","key","filter","Boolean"],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport React from 'react'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js'\nimport type { LexicalEditorNodeMap, NodeMapValue } from '../../../../types.js'\nimport type { JSXConverter, JSXConverters, SerializedLexicalNodeWithParent } from './types.js'\n\nimport { hasText } from '../../../../validate/hasText.js'\n\n/**\n * Creates a JSX converter from a NodeMapValue\n */\nfunction createConverterFromNodeMapValue(viewDef: NodeMapValue): JSXConverter {\n return (args) => {\n const converterArgs = {\n ...args,\n isEditor: false as const,\n isJSXConverter: true as const,\n }\n\n // If Component is provided, use it\n if (viewDef.Component) {\n return viewDef.Component(converterArgs)\n }\n\n // If html is provided (as a function or string), use it\n // Note: Using span instead of div to avoid forcing block-level semantics\n if (viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function' ? viewDef.html(converterArgs) : viewDef.html\n\n return <span dangerouslySetInnerHTML={{ __html: htmlContent }} />\n }\n\n return null\n }\n}\n\n/**\n * Converts a LexicalEditorNodeMap into JSXConverters\n */\nfunction nodeMapToConverters(nodeMap: LexicalEditorNodeMap): JSXConverters {\n const converters: JSXConverters = {}\n\n for (const [nodeType, value] of Object.entries(nodeMap)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // Handle special keys: blocks, inlineBlocks\n if (nodeType === 'blocks') {\n converters.blocks = {}\n for (const [blockType, _viewDef] of Object.entries(value)) {\n const viewDef = _viewDef as NodeMapValue\n if (viewDef.Component || viewDef.html) {\n converters.blocks[blockType] = createConverterFromNodeMapValue(viewDef)\n }\n }\n continue\n }\n\n if (nodeType === 'inlineBlocks') {\n converters.inlineBlocks = {}\n for (const [blockType, _viewDef] of Object.entries(value)) {\n const viewDef = _viewDef as NodeMapValue\n if (viewDef.Component || viewDef.html) {\n converters.inlineBlocks[blockType] = createConverterFromNodeMapValue(viewDef)\n }\n }\n continue\n }\n\n // Handle regular node types\n const viewDef = value as NodeMapValue\n\n if (viewDef.Component || viewDef.html) {\n converters[nodeType] = createConverterFromNodeMapValue(viewDef)\n }\n }\n\n return converters\n}\n\nexport type ConvertLexicalToJSXArgs = {\n converters: JSXConverters\n /**\n * Serialized editor state to render.\n */\n data: SerializedEditorState\n /**\n * If true, disables indentation globally. If an array, disables for specific node `type` values.\n */\n disableIndent?: boolean | string[]\n /**\n * If true, disables text alignment globally. If an array, disables for specific node `type` values.\n */\n disableTextAlign?: boolean | string[]\n /**\n * You can use the lexical editor node map or view map as converters. NodeMap converters will override converters passed\n * in the `converters` prop. If a LexicalEditorViewMap is provided, the `default` view will be used.\n */\n nodeMap?: LexicalEditorNodeMap\n}\n\nexport function convertLexicalToJSX({\n converters,\n data,\n disableIndent,\n disableTextAlign,\n nodeMap,\n}: ConvertLexicalToJSXArgs): React.ReactNode {\n if (hasText(data)) {\n // Merge nodeMap converters with existing converters\n // NodeMap converters override existing converters\n const mergedConverters = nodeMap\n ? {\n ...converters,\n ...nodeMapToConverters(nodeMap),\n }\n : converters\n\n return convertLexicalNodesToJSX({\n converters: mergedConverters,\n disableIndent,\n disableTextAlign,\n nodes: data.root.children,\n parent: data.root,\n })\n }\n return <></>\n}\n\nexport function convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes,\n parent,\n}: {\n converters: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent: SerializedLexicalNodeWithParent\n}): React.ReactNode[] {\n const unknownConverter: JSXConverter<any> = converters.unknown as JSXConverter<any>\n\n const jsxArray: React.ReactNode[] = nodes.map((node, i) => {\n let converterForNode: JSXConverter<any> | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[(node as SerializedBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode =\n converters?.inlineBlocks?.[(node as SerializedInlineBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as JSXConverter<any>\n }\n\n try {\n if (!converterForNode && unknownConverter) {\n converterForNode = unknownConverter\n }\n\n let reactNode: React.ReactNode\n if (converterForNode) {\n const converted =\n typeof converterForNode === 'function'\n ? converterForNode({\n childIndex: i,\n converters,\n node,\n nodesToJSX: (args) => {\n return convertLexicalNodesToJSX({\n converters: args.converters ?? converters,\n disableIndent: args.disableIndent ?? disableIndent,\n disableTextAlign: args.disableTextAlign ?? disableTextAlign,\n nodes: args.nodes,\n parent: args.parent ?? {\n ...node,\n parent,\n },\n })\n },\n parent,\n })\n : converterForNode\n reactNode = converted\n } else {\n reactNode = <span key={i}>unknown node</span>\n }\n\n const style: React.CSSProperties = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style.textAlign = 'center'\n break\n case 'end':\n style.textAlign = 'right'\n break\n case 'justify':\n style.textAlign = 'justify'\n break\n case 'left':\n //style.textAlign = 'left'\n // Do nothing, as left is the default\n break\n case 'right':\n style.textAlign = 'right'\n break\n case 'start':\n style.textAlign = 'left'\n break\n }\n }\n }\n\n if (\n !disableIndent &&\n (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))\n ) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style.paddingInlineStart = `${Number(node.indent) * 40}px`\n }\n }\n\n if (React.isValidElement(reactNode)) {\n // Inject style into reactNode\n if (style.textAlign || style.paddingInlineStart) {\n const newStyle = {\n ...style,\n // @ts-expect-error type better later\n ...(reactNode?.props?.style ?? {}),\n // reactNode style comes after, thus a textAlign specified in the converter has priority over the one we inject here\n }\n\n return React.cloneElement(reactNode, {\n key: i,\n // @ts-expect-error type better later\n style: newStyle,\n })\n }\n return React.cloneElement(reactNode, {\n key: i,\n })\n }\n\n return reactNode\n } catch (error) {\n console.error('Error converting lexical node to JSX:', error, 'node:', node)\n return null\n }\n })\n\n return jsxArray.filter(Boolean)\n}\n"],"mappings":"AAAA,+BAA6B,SAAAA,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAG7B,OAAOC,KAAA,MAAW;AAMlB,SAASC,OAAO,QAAQ;AAExB;;;AAGA,SAASC,gCAAgCC,OAAqB;EAC5D,OAAQC,IAAA;IACN,MAAMC,aAAA,GAAgB;MACpB,GAAGD,IAAI;MACPE,QAAA,EAAU;MACVC,cAAA,EAAgB;IAClB;IAEA;IACA,IAAIJ,OAAA,CAAQK,SAAS,EAAE;MACrB,OAAOL,OAAA,CAAQK,SAAS,CAACH,aAAA;IAC3B;IAEA;IACA;IACA,IAAIF,OAAA,CAAQM,IAAI,EAAE;MAChB,MAAMC,WAAA,GACJ,OAAOP,OAAA,CAAQM,IAAI,KAAK,aAAaN,OAAA,CAAQM,IAAI,CAACJ,aAAA,IAAiBF,OAAA,CAAQM,IAAI;MAEjF,oBAAOZ,IAAA,CAAC;QAAKc,uBAAA,EAAyB;UAAEC,MAAA,EAAQF;QAAY;;IAC9D;IAEA,OAAO;EACT;AACF;AAEA;;;AAGA,SAASG,oBAAoBC,OAA6B;EACxD,MAAMC,UAAA,GAA4B,CAAC;EAEnC,KAAK,MAAM,CAACC,QAAA,EAAUC,KAAA,CAAM,IAAIC,MAAA,CAAOC,OAAO,CAACL,OAAA,GAAU;IACvD,IAAI,CAACG,KAAA,IAAS,OAAOA,KAAA,KAAU,UAAU;MACvC;IACF;IAEA;IACA,IAAID,QAAA,KAAa,UAAU;MACzBD,UAAA,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IAAA,IAAQA,IAAA,CAAKiB,MAAM,IAAIjB,IAAA,CAAKG,IAAI,KAAK,YAAY;UAC/D;UACA;UACA;UACA;UACAQ,KAAA,CAAMO,kBAAkB,GAAG,GAAGC,MAAA,CAAOnB,IAAA,CAAKiB,MAAM,IAAI,MAAM;QAC5D;MACF;MAEA,iBAAIvD,KAAA,CAAM0D,cAAc,CAACb,SAAA,GAAY;QACnC;QACA,IAAII,KAAA,CAAMK,SAAS,IAAIL,KAAA,CAAMO,kBAAkB,EAAE;UAC/C,MAAMG,QAAA,GAAW;YACf,GAAGV,KAAK;YACR;YACA,IAAIJ,SAAA,EAAWe,KAAA,EAAOX,KAAA,IAAS,CAAC,CAAC;UAEnC;UAEA,oBAAOjD,KAAA,CAAM6D,YAAY,CAAChB,SAAA,EAAW;YACnCiB,GAAA,EAAKvB,CAAA;YACL;YACAU,KAAA,EAAOU;UACT;QACF;QACA,oBAAO3D,KAAA,CAAM6D,YAAY,CAAChB,SAAA,EAAW;UACnCiB,GAAA,EAAKvB;QACP;MACF;MAEA,OAAOM,SAAA;IACT,EAAE,OAAOD,KAAA,EAAO;MACdD,OAAA,CAAQC,KAAK,CAAC,yCAAyCA,KAAA,EAAO,SAASN,IAAA;MACvE,OAAO;IACT;EACF;EAEA,OAAOF,QAAA,CAAS2B,MAAM,CAACC,OAAA;AACzB","ignoreList":[]}
@@ -1,12 +1,12 @@
1
1
  import type { SerializedLexicalNode } from 'lexical';
2
2
  import type { DefaultNodeTypes, SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js';
3
- export type JSXConverter<T extends {
3
+ export type JSXConverterArgs<TNode extends {
4
4
  [key: string]: any;
5
5
  type?: string;
6
- } = SerializedLexicalNode> = ((args: {
6
+ } = SerializedLexicalNode> = {
7
7
  childIndex: number;
8
8
  converters: JSXConverters;
9
- node: T;
9
+ node: TNode;
10
10
  nodesToJSX: (args: {
11
11
  converters?: JSXConverters;
12
12
  disableIndent?: boolean | string[];
@@ -15,8 +15,12 @@ export type JSXConverter<T extends {
15
15
  parent?: SerializedLexicalNodeWithParent;
16
16
  }) => React.ReactNode[];
17
17
  parent: SerializedLexicalNodeWithParent;
18
- }) => React.ReactNode) | React.ReactNode;
19
- export type JSXConverters<T extends {
18
+ };
19
+ export type JSXConverter<TNode extends {
20
+ [key: string]: any;
21
+ type?: string;
22
+ } = SerializedLexicalNode> = ((args: JSXConverterArgs<TNode>) => React.ReactNode) | React.ReactNode;
23
+ export type JSXConverters<TNodes extends {
20
24
  [key: string]: any;
21
25
  type?: string;
22
26
  } = DefaultNodeTypes | SerializedBlockNode<{
@@ -30,27 +34,27 @@ export type JSXConverters<T extends {
30
34
  [blockSlug: string]: JSXConverter<any>;
31
35
  } | JSXConverter<any> | undefined;
32
36
  } & {
33
- [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<Extract<T, {
37
+ [nodeType in Exclude<NonNullable<TNodes['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<Extract<TNodes, {
34
38
  type: nodeType;
35
39
  }>>;
36
40
  } & {
37
41
  blocks?: {
38
- [K in Extract<Extract<T, {
42
+ [K in Extract<Extract<TNodes, {
39
43
  type: 'block';
40
44
  }> extends SerializedBlockNode<infer B> ? B extends {
41
45
  blockType: string;
42
- } ? B['blockType'] : never : never, string>]?: JSXConverter<Extract<T, {
46
+ } ? B['blockType'] : never : never, string>]?: JSXConverter<Extract<TNodes, {
43
47
  type: 'block';
44
48
  }> extends SerializedBlockNode<infer B> ? SerializedBlockNode<Extract<B, {
45
49
  blockType: K;
46
50
  }>> : SerializedBlockNode>;
47
51
  };
48
52
  inlineBlocks?: {
49
- [K in Extract<Extract<T, {
53
+ [K in Extract<Extract<TNodes, {
50
54
  type: 'inlineBlock';
51
55
  }> extends SerializedInlineBlockNode<infer B> ? B extends {
52
56
  blockType: string;
53
- } ? B['blockType'] : never : never, string>]?: JSXConverter<Extract<T, {
57
+ } ? B['blockType'] : never : never, string>]?: JSXConverter<Extract<TNodes, {
54
58
  type: 'inlineBlock';
55
59
  }> extends SerializedInlineBlockNode<infer B> ? SerializedInlineBlockNode<Extract<B, {
56
60
  blockType: K;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAA;AACjC,MAAM,MAAM,YAAY,CAAC,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IAC5F,CAAC,CAAC,IAAI,EAAE;IACN,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,aAAa,CAAA;IACzB,IAAI,EAAE,CAAC,CAAA;IACP,UAAU,EAAE,CAAC,IAAI,EAAE;QACjB,UAAU,CAAC,EAAE,aAAa,CAAA;QAC1B,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;QAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;QACrC,KAAK,EAAE,qBAAqB,EAAE,CAAA;QAC9B,MAAM,CAAC,EAAE,+BAA+B,CAAA;KACzC,KAAK,KAAK,CAAC,SAAS,EAAE,CAAA;IACvB,MAAM,EAAE,+BAA+B,CAAA;CACxC,KAAK,KAAK,CAAC,SAAS,CAAC,GACtB,KAAK,CAAC,SAAS,CAAA;AAEnB,MAAM,MAAM,aAAa,CACvB,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAC3C,gBAAgB,GAChB,mBAAmB,CAAC;IAAE,SAAS,CAAC,EAAE,IAAI,GAAG,M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,CAAC,CAAC,GAC1E,CAAC,SAAS;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE,GAC7B,CAAC,CAAC,WAAW,CAAC,GACd,KAAK,GACP,KAAK,EACT,MAAM,CACP,CAAC,CAAC,EAAE,YAAY,CACf,OAAO,CAAC,CAAC,EAAE;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC,SAAS,yBAAyB,CAAC,MAAM,CAAC,CAAC,GAC1E,yBAAyB,CAAC,OAAO,CAAC,CAAC,EAAE;YAAE,SAAS,EAAE,CAAC,CAAA;SAAE,CAAC,CAAC,GACvD,yBAAyB,CAC9B;KACF,CAAA;IACD,OAAO,CAAC,EAAE,YAAY,CAAC,qBAAqB,CAAC,CAAA;CAC9C,CAAA;AACD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,CAAC,EAAE,qBAAqB,CAAA;CAC/B,GAAG,qBAAqB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,0BAA0B,CAAA;AAEjC,MAAM,MAAM,gBAAgB,CAC1B,KAAK,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IACzE;IACF,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,aAAa,CAAA;IACzB,IAAI,EAAE,KAAK,CAAA;IACX,UAAU,EAAE,CAAC,IAAI,EAAE;QACjB,UAAU,CAAC,EAAE,aAAa,CAAA;QAC1B,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;QAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;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":[],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../nodeTypes.js'\nexport type JSXConverter<T extends { [key: string]: any; type?: string } = SerializedLexicalNode> =\n | ((args: {\n childIndex: number\n converters: JSXConverters\n node: T\n nodesToJSX: (args: {\n converters?: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => React.ReactNode[]\n parent: SerializedLexicalNodeWithParent\n }) => React.ReactNode)\n | React.ReactNode\n\nexport type JSXConverters<\n T extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>, // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n> = {\n [key: string]:\n | {\n [blockSlug: string]: JSXConverter<any>\n }\n | JSXConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<\n Extract<T, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract<\n Extract<T, { type: 'block' }> extends SerializedBlockNode<infer B>\n ? B extends { blockType: string }\n ? B['blockType']\n : never\n : never,\n string\n >]?: JSXConverter<\n Extract<T, { type: 'block' }> extends SerializedBlockNode<infer B>\n ? SerializedBlockNode<Extract<B, { blockType: K }>>\n : SerializedBlockNode\n >\n }\n inlineBlocks?: {\n [K in Extract<\n Extract<T, { type: 'inlineBlock' }> extends SerializedInlineBlockNode<infer B>\n ? B extends { blockType: string }\n ? B['blockType']\n : never\n : never,\n string\n >]?: JSXConverter<\n Extract<T, { type: 'inlineBlock' }> extends SerializedInlineBlockNode<infer B>\n ? SerializedInlineBlockNode<Extract<B, { blockType: K }>>\n : SerializedInlineBlockNode\n >\n }\n unknown?: JSXConverter<SerializedLexicalNode>\n}\nexport type SerializedLexicalNodeWithParent = {\n parent?: SerializedLexicalNode\n} & SerializedLexicalNode\n"],"mappings":"AAsEA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../nodeTypes.js'\n\nexport type JSXConverterArgs<\n TNode extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> = {\n childIndex: number\n converters: JSXConverters\n node: TNode\n nodesToJSX: (args: {\n converters?: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => React.ReactNode[]\n parent: SerializedLexicalNodeWithParent\n}\nexport type JSXConverter<\n TNode extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> = ((args: JSXConverterArgs<TNode>) => React.ReactNode) | React.ReactNode\n\nexport type JSXConverters<\n TNodes extends { [key: string]: any; type?: string } =\n | DefaultNodeTypes\n | SerializedBlockNode<{ blockName?: null | string; blockType: string }> // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n | SerializedInlineBlockNode<{ blockName?: null | string; blockType: string }>, // need these to ensure types for blocks and inlineBlocks work if no generics are provided\n> = {\n [key: string]:\n | {\n [blockSlug: string]: JSXConverter<any>\n }\n | JSXConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<TNodes['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<\n Extract<TNodes, { type: nodeType }>\n >\n} & {\n blocks?: {\n [K in Extract<\n Extract<TNodes, { type: 'block' }> extends SerializedBlockNode<infer B>\n ? B extends { blockType: string }\n ? B['blockType']\n : never\n : never,\n string\n >]?: JSXConverter<\n Extract<TNodes, { type: 'block' }> extends SerializedBlockNode<infer B>\n ? SerializedBlockNode<Extract<B, { blockType: K }>>\n : SerializedBlockNode\n >\n }\n inlineBlocks?: {\n [K in Extract<\n Extract<TNodes, { type: 'inlineBlock' }> extends SerializedInlineBlockNode<infer B>\n ? B extends { blockType: string }\n ? B['blockType']\n : never\n : never,\n string\n >]?: JSXConverter<\n Extract<TNodes, { type: 'inlineBlock' }> extends SerializedInlineBlockNode<infer B>\n ? SerializedInlineBlockNode<Extract<B, { blockType: K }>>\n : SerializedInlineBlockNode\n >\n }\n unknown?: JSXConverter<SerializedLexicalNode>\n}\nexport type SerializedLexicalNodeWithParent = {\n parent?: SerializedLexicalNode\n} & SerializedLexicalNode\n"],"mappings":"AA0EA","ignoreList":[]}
@@ -11,7 +11,7 @@ export function RichTextPlugin() {
11
11
  const [editor] = useLexicalComposerContext();
12
12
  let t0;
13
13
  if ($[0] !== editor) {
14
- t0 = editor.getEditorState().toJSON();
14
+ t0 = () => editor.getEditorState().toJSON();
15
15
  $[0] = editor;
16
16
  $[1] = t0;
17
17
  } else {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useEffect","useState","defaultJSXConverters","RichText","RichTextPlugin","$","editor","t0","getEditorState","toJSON","editorState","setEditorState","t1","t2","registerUpdateListener","t3","editorState_0","_jsx","className","children","converters","data"],"sources":["../../../../../../src/features/debug/jsxConverter/client/plugin/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useEffect, useState } from 'react'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { defaultJSXConverters, RichText } from '../../../../../exports/react/index.js'\nimport './style.scss'\n\nexport function RichTextPlugin() {\n const [editor] = useLexicalComposerContext()\n const [editorState, setEditorState] = useState(editor.getEditorState().toJSON())\n\n useEffect(() => {\n return editor.registerUpdateListener(({ editorState }) => {\n setEditorState(editorState.toJSON())\n })\n }, [editor])\n\n return (\n <div className=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AmB,IAAA,EAAkDX;MAAA,C;;;;;;;SADpDK,E","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useEffect","useState","defaultJSXConverters","RichText","RichTextPlugin","$","editor","t0","getEditorState","toJSON","editorState","setEditorState","t1","t2","registerUpdateListener","t3","editorState_0","_jsx","className","children","converters","data"],"sources":["../../../../../../src/features/debug/jsxConverter/client/plugin/index.tsx"],"sourcesContent":["'use client'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useEffect, useState } from 'react'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { defaultJSXConverters, RichText } from '../../../../../exports/react/index.js'\nimport './style.scss'\n\nexport function RichTextPlugin() {\n const [editor] = useLexicalComposerContext()\n const [editorState, setEditorState] = useState(() => editor.getEditorState().toJSON())\n\n useEffect(() => {\n return editor.registerUpdateListener(({ editorState }) => {\n setEditorState(editorState.toJSON())\n })\n }, [editor])\n\n return (\n <div className=\"debug-jsx-converter\">\n <RichText converters={defaultJSXConverters} data={editorState} />\n </div>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,SAAS,EAAEC,QAAQ,QAAQ;AAEpC;AACA,SAASC,oBAAoB,EAAEC,QAAQ,QAAQ;AAG/C,OAAO,SAAAC,eAAA;EAAA,MAAAC,CAAA,GAAAP,EAAA;EACL,OAAAQ,MAAA,IAAiBP,yBAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAF,CAAA,QAAAC,MAAA;IAC8BC,EAAA,GAAAA,CAAA,KAAMD,MAAA,CAAAE,cAAA,CAAqB,EAAAC,MAAA,CAAS;IAAAJ,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EAAnF,OAAAK,WAAA,EAAAC,cAAA,IAAsCV,QAAA,CAASM,EAAoC;EAAA,IAAAK,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAC,MAAA;IAEzEM,EAAA,GAAAA,CAAA,KACDN,MAAA,CAAAQ,sBAAA,CAAAC,EAAA;MAA+B;QAAAL,WAAA,EAAAM;MAAA,IAAAD,EAAe;MACnDJ,cAAA,CAAeD,aAAA,CAAAD,MAAA,CAAkB;IAAA,CACnC;IACCI,EAAA,IAACP,MAAA;IAAOD,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAO,EAAA;IAAAP,CAAA,MAAAQ,EAAA;EAAA;IAAAD,EAAA,GAAAP,CAAA;IAAAQ,EAAA,GAAAR,CAAA;EAAA;EAJXL,SAAA,CAAUY,EAIV,EAAGC,EAAQ;EAAA,IAAAE,EAAA;EAAA,IAAAV,CAAA,QAAAK,WAAA;IAGTK,EAAA,GAAAE,IAAA,CAAC;MAAAC,SAAA,EAAc;MAAAC,QAAA,EACbF,IAAA,CAAAd,QAAA;QAAAiB,UAAA,EAAAlB,oBAAA;QAAAmB,IAAA,EAAkDX;MAAA,C;;;;;;;SADpDK,E","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations';
2
2
  import type { JSONSchema4 } from 'json-schema';
3
3
  import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState, SerializedLexicalNode } from 'lexical';
4
- import type { Field, FieldSchemaMap, ImportMapGenerators, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, ValidateOptions, ValidationFieldError } from 'payload';
4
+ import type { Field, FieldSchemaMap, ImportMapGenerators, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, TypedFallbackLocale, ValidateOptions, ValidationFieldError } from 'payload';
5
5
  import type { ServerEditorConfig } from '../lexical/config/types.js';
6
6
  import type { Transformer } from '../packages/@lexical/markdown/index.js';
7
7
  import type { LexicalRichTextField } from '../types.js';
@@ -73,7 +73,7 @@ export type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {
73
73
  */
74
74
  depth: number;
75
75
  draft: boolean;
76
- fallbackLocale: string | string[];
76
+ fallbackLocale: TypedFallbackLocale;
77
77
  /**
78
78
  * Only available in `afterRead` field hooks.
79
79
  */
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.d.ts","sourceRoot":"","sources":["../../src/features/typesServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,KAAK,EACL,cAAc,EACd,mBAAmB,EACnB,UAAU,EACV,gBAAgB,EAChB,cAAc,EACd,YAAY,EACZ,UAAU,EACV,cAAc,EACd,aAAa,EACb,aAAa,EACb,eAAe,EACf,eAAe,EACf,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,4BAA4B,CAAA;AACpE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACzE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AACvD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAA;AAC7F,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAA;AAE9D,MAAM,MAAM,iBAAiB,CAAC,CAAC,SAAS,qBAAqB,GAAG,qBAAqB,IAAI,CAAC,IAAI,EAAE;IAC9F,OAAO,EAAE,cAAc,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,MAAM,CAAA;IAC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AC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACxE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9E,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;KACnF,CAAA,CAAC,yDAAyD;IAC3D,kDAAkD;IAClD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;CAChD,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Field,\n FieldSchemaMap,\n ImportMapGenerators,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { LexicalRichTextField } from '../types.js'\nimport type { HTMLConverter } from './converters/lexicalToHtml_deprecated/converter/types.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: LexicalRichTextField\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: string | string[]\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * Allows you to define how a node can be serialized into different formats. Currently, only supports html.\n * Markdown converters are defined in `markdownTransformers` and not here.\n *\n * @deprecated - will be removed in 4.0\n */\n converters?: {\n /**\n * @deprecated - will be removed in 4.0\n */\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n | ImportMapGenerators[0]\n | PayloadComponent[]\n generatedTypes?: {\n modifyOutputSchema: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: LexicalRichTextField\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: LexicalRichTextField\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AA+WA","ignoreList":[]}
1
+ {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Field,\n FieldSchemaMap,\n ImportMapGenerators,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n TypedFallbackLocale,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { LexicalRichTextField } from '../types.js'\nimport type { HTMLConverter } from './converters/lexicalToHtml_deprecated/converter/types.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: LexicalRichTextField\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * Allows you to define how a node can be serialized into different formats. Currently, only supports html.\n * Markdown converters are defined in `markdownTransformers` and not here.\n *\n * @deprecated - will be removed in 4.0\n */\n converters?: {\n /**\n * @deprecated - will be removed in 4.0\n */\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n | ImportMapGenerators[0]\n | PayloadComponent[]\n generatedTypes?: {\n modifyOutputSchema: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: LexicalRichTextField\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: LexicalRichTextField\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AAgXA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAGxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,mCAAmC,CAAA;AAC1C,OAAO,eAAe,CAAA;AACtB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAO5D,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAA;CACnD,GAAG,yBAAyB,CA4K9B,CAAA;AAaD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAGxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,mCAAmC,CAAA;AAC1C,OAAO,eAAe,CAAA;AACtB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,aAAa,CAAA;AAQ5D,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAA;CACnD,GAAG,yBAAyB,CAsL9B,CAAA;AAaD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}