@payloadcms/richtext-lexical 3.80.0-internal.60d6f94 → 3.80.0-internal.82dcece

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 (163) hide show
  1. package/dist/exports/client/Field-OIMYWB22.js +2 -0
  2. package/dist/exports/client/Field-OIMYWB22.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-2S5Q7QYO.js +2 -0
  5. package/dist/exports/client/chunk-2S5Q7QYO.js.map +7 -0
  6. package/dist/exports/client/chunk-EZX4YW7S.js +12 -0
  7. package/dist/exports/client/chunk-EZX4YW7S.js.map +7 -0
  8. package/dist/exports/client/componentInline-NL25DNZ5.js +2 -0
  9. package/dist/exports/client/index.d.ts +0 -1
  10. package/dist/exports/client/index.d.ts.map +1 -1
  11. package/dist/exports/client/index.js +23 -23
  12. package/dist/exports/client/index.js.map +3 -3
  13. package/dist/exports/react/index.d.ts +1 -3
  14. package/dist/exports/react/index.d.ts.map +1 -1
  15. package/dist/exports/react/index.js +0 -1
  16. package/dist/exports/react/index.js.map +1 -1
  17. package/dist/features/blocks/client/component/BlockContent.d.ts +4 -7
  18. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  19. package/dist/features/blocks/client/component/BlockContent.js +8 -9
  20. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  21. package/dist/features/blocks/client/component/index.d.ts +4 -20
  22. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  23. package/dist/features/blocks/client/component/index.js +55 -112
  24. package/dist/features/blocks/client/component/index.js.map +1 -1
  25. package/dist/features/blocks/client/componentInline/index.d.ts +14 -8
  26. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  27. package/dist/features/blocks/client/componentInline/index.js +18 -67
  28. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  29. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -4
  30. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  31. package/dist/features/blocks/client/nodes/BlocksNode.js +1 -3
  32. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  33. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +2 -4
  34. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  35. package/dist/features/blocks/client/nodes/InlineBlocksNode.js +1 -3
  36. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  37. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
  38. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +3 -1
  39. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  40. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
  41. package/dist/features/converters/lexicalToHtml/async/converters/link.js +7 -2
  42. package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
  43. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  44. package/dist/features/converters/lexicalToHtml/async/converters/list.js +5 -1
  45. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  46. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
  47. package/dist/features/converters/lexicalToHtml/async/converters/table.js +2 -1
  48. package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
  49. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
  50. package/dist/features/converters/lexicalToHtml/async/converters/text.js +2 -1
  51. package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
  52. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
  53. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +11 -10
  54. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  55. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts +5 -0
  56. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -0
  57. package/dist/features/converters/lexicalToHtml/shared/cssColors.js +8 -0
  58. package/dist/features/converters/lexicalToHtml/shared/cssColors.js.map +1 -0
  59. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
  60. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +3 -1
  61. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  62. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
  63. package/dist/features/converters/lexicalToHtml/sync/converters/link.js +7 -2
  64. package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
  65. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  66. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +5 -1
  67. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  68. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
  69. package/dist/features/converters/lexicalToHtml/sync/converters/table.js +2 -1
  70. package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
  71. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
  72. package/dist/features/converters/lexicalToHtml/sync/converters/text.js +2 -1
  73. package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
  74. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
  75. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +11 -10
  76. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  77. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +20 -6
  78. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  79. package/dist/features/converters/lexicalToJSX/Component/index.js +5 -7
  80. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  81. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +2 -17
  82. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  83. package/dist/features/converters/lexicalToJSX/converter/index.js +4 -124
  84. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  85. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +10 -14
  86. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  87. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  88. package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -1
  89. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  90. package/dist/field/Diff/converters/link.d.ts.map +1 -1
  91. package/dist/field/Diff/converters/link.js +7 -2
  92. package/dist/field/Diff/converters/link.js.map +1 -1
  93. package/dist/field/Field.d.ts.map +1 -1
  94. package/dist/field/Field.js +19 -19
  95. package/dist/field/Field.js.map +1 -1
  96. package/dist/field/bundled.css +1 -1
  97. package/dist/field/index.d.ts +0 -1
  98. package/dist/field/index.d.ts.map +1 -1
  99. package/dist/field/index.js +35 -64
  100. package/dist/field/index.js.map +1 -1
  101. package/dist/field/rscEntry.d.ts +1 -1
  102. package/dist/field/rscEntry.d.ts.map +1 -1
  103. package/dist/field/rscEntry.js +0 -12
  104. package/dist/field/rscEntry.js.map +1 -1
  105. package/dist/index.d.ts +1 -1
  106. package/dist/index.d.ts.map +1 -1
  107. package/dist/index.js +1 -3
  108. package/dist/index.js.map +1 -1
  109. package/dist/lexical/LexicalEditor.d.ts +1 -1
  110. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  111. package/dist/lexical/LexicalEditor.js +9 -7
  112. package/dist/lexical/LexicalEditor.js.map +1 -1
  113. package/dist/lexical/LexicalProvider.d.ts +1 -0
  114. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  115. package/dist/lexical/LexicalProvider.js +6 -13
  116. package/dist/lexical/LexicalProvider.js.map +1 -1
  117. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  118. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  119. package/dist/lexical/config/client/sanitize.js +2 -3
  120. package/dist/lexical/config/client/sanitize.js.map +1 -1
  121. package/dist/lexical/config/types.d.ts +0 -4
  122. package/dist/lexical/config/types.d.ts.map +1 -1
  123. package/dist/lexical/config/types.js.map +1 -1
  124. package/dist/lexical/nodes/index.d.ts +2 -12
  125. package/dist/lexical/nodes/index.d.ts.map +1 -1
  126. package/dist/lexical/nodes/index.js +2 -213
  127. package/dist/lexical/nodes/index.js.map +1 -1
  128. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  129. package/dist/lexical/plugins/SlashMenu/index.js +1 -14
  130. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  131. package/dist/types.d.ts +2 -329
  132. package/dist/types.d.ts.map +1 -1
  133. package/dist/types.js.map +1 -1
  134. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  135. package/dist/utilities/generateImportMap.js +0 -1
  136. package/dist/utilities/generateImportMap.js.map +1 -1
  137. package/dist/validate/hasText.d.ts +1 -6
  138. package/dist/validate/hasText.d.ts.map +1 -1
  139. package/dist/validate/hasText.js +4 -10
  140. package/dist/validate/hasText.js.map +1 -1
  141. package/package.json +6 -11
  142. package/dist/exports/client/Field-ESDONIMD.js +0 -2
  143. package/dist/exports/client/Field-ESDONIMD.js.map +0 -7
  144. package/dist/exports/client/chunk-VCJQ5B3S.js +0 -12
  145. package/dist/exports/client/chunk-VCJQ5B3S.js.map +0 -7
  146. package/dist/exports/client/chunk-YWIZCGSY.js +0 -2
  147. package/dist/exports/client/chunk-YWIZCGSY.js.map +0 -7
  148. package/dist/exports/client/componentInline-CBBUBQ7P.js +0 -2
  149. package/dist/exports/client/internal-client.d.ts +0 -3
  150. package/dist/exports/client/internal-client.d.ts.map +0 -1
  151. package/dist/field/RichTextViewProvider.d.ts +0 -86
  152. package/dist/field/RichTextViewProvider.d.ts.map +0 -1
  153. package/dist/field/RichTextViewProvider.js +0 -90
  154. package/dist/field/RichTextViewProvider.js.map +0 -1
  155. package/dist/field/ViewSelector.d.ts +0 -4
  156. package/dist/field/ViewSelector.d.ts.map +0 -1
  157. package/dist/field/ViewSelector.js +0 -89
  158. package/dist/field/ViewSelector.js.map +0 -1
  159. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts +0 -2
  160. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +0 -1
  161. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +0 -48
  162. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +0 -1
  163. /package/dist/exports/client/{componentInline-CBBUBQ7P.js.map → componentInline-NL25DNZ5.js.map} +0 -0
@@ -1,12 +1,12 @@
1
1
  import type { SerializedLexicalNode } from 'lexical';
2
2
  import type { DefaultNodeTypes, SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js';
3
- export type JSXConverterArgs<TNode extends {
3
+ export type JSXConverter<T extends {
4
4
  [key: string]: any;
5
5
  type?: string;
6
- } = SerializedLexicalNode> = {
6
+ } = SerializedLexicalNode> = ((args: {
7
7
  childIndex: number;
8
8
  converters: JSXConverters;
9
- node: TNode;
9
+ node: T;
10
10
  nodesToJSX: (args: {
11
11
  converters?: JSXConverters;
12
12
  disableIndent?: boolean | string[];
@@ -15,12 +15,8 @@ export type JSXConverterArgs<TNode extends {
15
15
  parent?: SerializedLexicalNodeWithParent;
16
16
  }) => React.ReactNode[];
17
17
  parent: SerializedLexicalNodeWithParent;
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 {
18
+ }) => React.ReactNode) | React.ReactNode;
19
+ export type JSXConverters<T extends {
24
20
  [key: string]: any;
25
21
  type?: string;
26
22
  } = DefaultNodeTypes | SerializedBlockNode<{
@@ -34,27 +30,27 @@ export type JSXConverters<TNodes extends {
34
30
  [blockSlug: string]: JSXConverter<any>;
35
31
  } | JSXConverter<any> | undefined;
36
32
  } & {
37
- [nodeType in Exclude<NonNullable<TNodes['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<Extract<TNodes, {
33
+ [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: JSXConverter<Extract<T, {
38
34
  type: nodeType;
39
35
  }>>;
40
36
  } & {
41
37
  blocks?: {
42
- [K in Extract<Extract<TNodes, {
38
+ [K in Extract<Extract<T, {
43
39
  type: 'block';
44
40
  }> extends SerializedBlockNode<infer B> ? B extends {
45
41
  blockType: string;
46
- } ? B['blockType'] : never : never, string>]?: JSXConverter<Extract<TNodes, {
42
+ } ? B['blockType'] : never : never, string>]?: JSXConverter<Extract<T, {
47
43
  type: 'block';
48
44
  }> extends SerializedBlockNode<infer B> ? SerializedBlockNode<Extract<B, {
49
45
  blockType: K;
50
46
  }>> : SerializedBlockNode>;
51
47
  };
52
48
  inlineBlocks?: {
53
- [K in Extract<Extract<TNodes, {
49
+ [K in Extract<Extract<T, {
54
50
  type: 'inlineBlock';
55
51
  }> extends SerializedInlineBlockNode<infer B> ? B extends {
56
52
  blockType: string;
57
- } ? B['blockType'] : never : never, string>]?: JSXConverter<Extract<TNodes, {
53
+ } ? B['blockType'] : never : never, string>]?: JSXConverter<Extract<T, {
58
54
  type: 'inlineBlock';
59
55
  }> extends SerializedInlineBlockNode<infer B> ? SerializedInlineBlockNode<Extract<B, {
60
56
  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;AAEjC,MAAM,MAAM,gBAAgB,CAC1B,KAAK,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB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AAS,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;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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E;SACZ,CAAC,IAAI,OAAO,CACX,OAAO,CAAC,CAAC,EAAE;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC,SAAS,yBAAyB,CAAC,MAAM,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 +1 @@
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":[]}
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'\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":[]}
@@ -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=\"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
+ {"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,GAAAD,MAAA,CAAAE,cAAA,CAAqB,EAAAC,MAAA,CAAS;IAAAJ,CAAA,MAAAC,MAAA;IAAAD,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EAA7E,OAAAK,WAAA,EAAAC,cAAA,IAAsCV,QAAA,CAASM,EAA8B;EAAA,IAAAK,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAR,CAAA,QAAAC,MAAA;IAEnEM,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 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/field/Diff/converters/link.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2DAA2D,CAAA;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAEvF,eAAO,MAAM,0BAA0B,EAAE,CAAC,IAAI,EAAE;IAC9C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,kBAAkB,CAAA;QAC5B,QAAQ,CAAC,EAAE,cAAc,CAAA;KAC1B,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;CAC/B,KAAK,mBAAmB,CAAC,sBAAsB,GAAG,kBAAkB,CA6CnE,CAAA"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/field/Diff/converters/link.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2DAA2D,CAAA;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAEvF,eAAO,MAAM,0BAA0B,EAAE,CAAC,IAAI,EAAE;IAC9C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,kBAAkB,CAAA;QAC5B,QAAQ,CAAC,EAAE,cAAc,CAAA;KAC1B,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;CAC/B,KAAK,mBAAmB,CAAC,sBAAsB,GAAG,kBAAkB,CAkDnE,CAAA"}
@@ -1,4 +1,6 @@
1
1
  import { createHash } from 'crypto';
2
+ import escapeHTML from 'escape-html';
3
+ import { sanitizeUrl } from 'payload/shared';
2
4
  export const LinkDiffHTMLConverterAsync = ({
3
5
  internalDocToHref
4
6
  }) => ({
@@ -12,7 +14,8 @@ export const LinkDiffHTMLConverterAsync = ({
12
14
  })).join('');
13
15
  // hash fields to ensure they are diffed if they change
14
16
  const nodeFieldsHash = createHash('sha256').update(JSON.stringify(node.fields)).digest('hex');
15
- return `<a${providedStyleTag} data-fields-hash="${nodeFieldsHash}" data-enable-match="true" href="${node.fields.url}"${node.fields.newTab ? ' rel="noopener noreferrer" target="_blank"' : ''}>
17
+ const href = escapeHTML(sanitizeUrl(node.fields.url ?? ''));
18
+ return `<a${providedStyleTag} data-fields-hash="${nodeFieldsHash}" data-enable-match="true" href="${href}"${node.fields.newTab ? ' rel="noopener noreferrer" target="_blank"' : ''}>
16
19
  ${children}
17
20
  </a>`;
18
21
  },
@@ -33,13 +36,15 @@ export const LinkDiffHTMLConverterAsync = ({
33
36
  populate
34
37
  });
35
38
  } else {
39
+ // eslint-disable-next-line no-console
36
40
  console.error('Lexical => HTML converter: Link converter: found internal link, but internalDocToHref is not provided');
37
41
  href = '#'; // fallback
38
42
  }
39
43
  }
40
44
  // hash fields to ensure they are diffed if they change
41
45
  const nodeFieldsHash = createHash('sha256').update(JSON.stringify(node.fields ?? {})).digest('hex');
42
- return `<a${providedStyleTag} data-fields-hash="${nodeFieldsHash}" data-enable-match="true" href="${href}"${node.fields.newTab ? ' rel="noopener noreferrer" target="_blank"' : ''}>
46
+ const safeHref = escapeHTML(sanitizeUrl(href));
47
+ return `<a${providedStyleTag} data-fields-hash="${nodeFieldsHash}" data-enable-match="true" href="${safeHref}"${node.fields.newTab ? ' rel="noopener noreferrer" target="_blank"' : ''}>
43
48
  ${children}
44
49
  </a>`;
45
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"link.js","names":["createHash","LinkDiffHTMLConverterAsync","internalDocToHref","autolink","node","nodesToHTML","providedStyleTag","children","nodes","join","nodeFieldsHash","update","JSON","stringify","fields","digest","url","newTab","link","populate","href","linkType","linkNode","console","error"],"sources":["../../../../src/field/Diff/converters/link.ts"],"sourcesContent":["import { createHash } from 'crypto'\n\nimport type {\n HTMLConvertersAsync,\n HTMLPopulateFn,\n} from '../../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../nodeTypes.js'\n\nexport const LinkDiffHTMLConverterAsync: (args: {\n internalDocToHref?: (args: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => Promise<string> | string\n}) => HTMLConvertersAsync<SerializedAutoLinkNode | SerializedLinkNode> = ({\n internalDocToHref,\n}) => ({\n autolink: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n // hash fields to ensure they are diffed if they change\n const nodeFieldsHash = createHash('sha256').update(JSON.stringify(node.fields)).digest('hex')\n\n return `<a${providedStyleTag} data-fields-hash=\"${nodeFieldsHash}\" data-enable-match=\"true\" href=\"${node.fields.url}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>\n ${children}\n </a>`\n },\n link: async ({ node, nodesToHTML, populate, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n if (internalDocToHref) {\n href = await internalDocToHref({ linkNode: node, populate })\n } else {\n console.error(\n 'Lexical => HTML converter: Link converter: found internal link, but internalDocToHref is not provided',\n )\n href = '#' // fallback\n }\n }\n\n // hash fields to ensure they are diffed if they change\n const nodeFieldsHash = createHash('sha256')\n .update(JSON.stringify(node.fields ?? {}))\n .digest('hex')\n\n return `<a${providedStyleTag} data-fields-hash=\"${nodeFieldsHash}\" data-enable-match=\"true\" href=\"${href}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>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U,MAAM,IAAI,CAAC,IACtCC,MAAM,CAAC;IAEV,OAAO,KAAKT,gBAAA,sBAAsCI,cAAA,oCAAkDU,IAAA,IAAQhB,IAAA,CAAKU,MAAM,CAACG,MAAM,GAAG,+CAA+C;UAC1KV,QAAA;WACC;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"file":"link.js","names":["createHash","escapeHTML","sanitizeUrl","LinkDiffHTMLConverterAsync","internalDocToHref","autolink","node","nodesToHTML","providedStyleTag","children","nodes","join","nodeFieldsHash","update","JSON","stringify","fields","digest","href","url","newTab","link","populate","linkType","linkNode","console","error","safeHref"],"sources":["../../../../src/field/Diff/converters/link.ts"],"sourcesContent":["import { createHash } from 'crypto'\nimport escapeHTML from 'escape-html'\nimport { sanitizeUrl } from 'payload/shared'\n\nimport type {\n HTMLConvertersAsync,\n HTMLPopulateFn,\n} from '../../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../nodeTypes.js'\n\nexport const LinkDiffHTMLConverterAsync: (args: {\n internalDocToHref?: (args: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => Promise<string> | string\n}) => HTMLConvertersAsync<SerializedAutoLinkNode | SerializedLinkNode> = ({\n internalDocToHref,\n}) => ({\n autolink: async ({ node, nodesToHTML, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n // hash fields to ensure they are diffed if they change\n const nodeFieldsHash = createHash('sha256').update(JSON.stringify(node.fields)).digest('hex')\n\n const href = escapeHTML(sanitizeUrl(node.fields.url ?? ''))\n\n return `<a${providedStyleTag} data-fields-hash=\"${nodeFieldsHash}\" data-enable-match=\"true\" href=\"${href}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>\n ${children}\n </a>`\n },\n link: async ({ node, nodesToHTML, populate, providedStyleTag }) => {\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n if (internalDocToHref) {\n href = await internalDocToHref({ linkNode: node, populate })\n } else {\n // eslint-disable-next-line no-console\n console.error(\n 'Lexical => HTML converter: Link converter: found internal link, but internalDocToHref is not provided',\n )\n href = '#' // fallback\n }\n }\n\n // hash fields to ensure they are diffed if they change\n const nodeFieldsHash = createHash('sha256')\n .update(JSON.stringify(node.fields ?? {}))\n .digest('hex')\n\n const safeHref = escapeHTML(sanitizeUrl(href))\n\n return `<a${providedStyleTag} data-fields-hash=\"${nodeFieldsHash}\" data-enable-match=\"true\" href=\"${safeHref}\"${node.fields.newTab ? ' rel=\"noopener noreferrer\" target=\"_blank\"' : ''}>\n ${children}\n </a>`\n },\n})\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ;AAC3B,OAAOC,UAAA,MAAgB;AACvB,SAASC,WAAW,QAAQ;AAQ5B,OAAO,MAAMC,0BAAA,GAK4DA,CAAC;EACxEC;AAAiB,CAClB,MAAM;EACLC,QAAA,EAAU,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC;EAAgB,CAAE;IACtD,MAAMC,QAAA,GAAW,CACf,MAAMF,WAAA,CAAY;MAChBG,KAAA,EAAOJ,IAAA,CAAKG;IACd,EAAC,EACDE,IAAI,CAAC;IAEP;IACA,MAAMC,cAAA,GAAiBZ,UAAA,CAAW,UAAUa,MAAM,CAACC,IAAA,CAAKC,SAAS,CAACT,IAAA,CAAKU,MAAM,GAAGC,MAAM,CAAC;IAEvF,MAAMC,IAAA,GAAOjB,UAAA,CAAWC,WAAA,CAAYI,IAAA,CAAKU,MAAM,CAACG,GAAG,IAAI;IAEvD,OAAO,KAAKX,gBAAA,sBAAsCI,cAAA,oCAAkDM,IAAA,IAAQZ,IAAA,CAAKU,MAAM,CAACI,MAAM,GAAG,+CAA+C;UAC1KX,QAAA;WACC;EACT;EACAY,IAAA,EAAM,MAAAA,CAAO;IAAEf,IAAI;IAAEC,WAAW;IAAEe,QAAQ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;CACnD,GAAG,yBAAyB,CA0L9B,CAAA;AAaD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AAmBA,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,CAwL9B,CAAA;AAaD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
2
 
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- import { BulkUploadProvider, FieldDescription, FieldError, FieldLabel, RenderCustomComponent, useEditDepth, useEffectEvent, useField } from '@payloadcms/ui';
4
+ import { BulkUploadProvider, FieldDescription, FieldError, FieldLabel, isFieldRTL, RenderCustomComponent, useConfig, useEditDepth, useEffectEvent, useField, useLocale } from '@payloadcms/ui';
5
5
  import { mergeFieldStyles } from '@payloadcms/ui/shared';
6
6
  import { dequal } from 'dequal/lite';
7
7
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
@@ -9,8 +9,6 @@ import { ErrorBoundary } from 'react-error-boundary';
9
9
  import './bundled.css';
10
10
  import { LexicalProvider } from '../lexical/LexicalProvider.js';
11
11
  import { useRunDeprioritized } from '../utilities/useRunDeprioritized.js';
12
- import { useRichTextView } from './RichTextViewProvider.js';
13
- import { ViewSelector } from './ViewSelector.js';
14
12
  const baseClass = 'rich-text-lexical';
15
13
  const RichTextComponent = props => {
16
14
  const {
@@ -28,14 +26,21 @@ const RichTextComponent = props => {
28
26
  },
29
27
  path: pathFromProps,
30
28
  readOnly: readOnlyFromTopLevelProps,
31
- schemaPath,
32
29
  validate
33
30
  } = props;
34
31
  const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin;
35
- const editDepth = useEditDepth();
32
+ const locale = useLocale();
36
33
  const {
37
- isControlledByParent
38
- } = useRichTextView();
34
+ config: {
35
+ localization: localizationConfig
36
+ }
37
+ } = useConfig();
38
+ const rtl = isFieldRTL({
39
+ fieldLocalized: localized,
40
+ locale,
41
+ localizationConfig: localizationConfig || undefined
42
+ });
43
+ const editDepth = useEditDepth();
39
44
  const memoizedValidate = useCallback((value, validationOptions) => {
40
45
  if (typeof validate === 'function') {
41
46
  // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve
@@ -86,7 +91,7 @@ const RichTextComponent = props => {
86
91
  window.removeEventListener('resize', updateViewPortWidth);
87
92
  };
88
93
  }, [isSmallWidthViewport]);
89
- const classes = ['field-type', baseClass, className, showError && 'error', disabled && `${baseClass}--read-only`, editorConfig?.admin?.hideGutter !== true && !isSmallWidthViewport ? `${baseClass}--show-gutter` : null].filter(Boolean).join(' ');
94
+ const classes = [baseClass, 'field-type', className, showError && 'error', disabled && `${baseClass}--read-only`, editorConfig?.admin?.hideGutter !== true && !isSmallWidthViewport ? `${baseClass}--show-gutter` : null].filter(Boolean).join(' ');
90
95
  const pathWithEditDepth = `${path}.${editDepth}`;
91
96
  const runDeprioritized = useRunDeprioritized() // defaults to 500 ms timeout
92
97
  ;
@@ -125,9 +130,6 @@ const RichTextComponent = props => {
125
130
  }, [initialValue]);
126
131
  return /*#__PURE__*/_jsxs("div", {
127
132
  className: classes,
128
- "data-field-path": path,
129
- "data-field-schemapath": schemaPath,
130
- "data-lexical-view": editorConfig?.view,
131
133
  style: styles,
132
134
  children: [/*#__PURE__*/_jsx(RenderCustomComponent, {
133
135
  CustomComponent: Error,
@@ -135,14 +137,11 @@ const RichTextComponent = props => {
135
137
  path: path,
136
138
  showError: showError
137
139
  })
138
- }), /*#__PURE__*/_jsxs("div", {
139
- className: `${baseClass}__label-row`,
140
- children: [Label || /*#__PURE__*/_jsx(FieldLabel, {
141
- label: label,
142
- localized: localized,
143
- path: path,
144
- required: required
145
- }), !isControlledByParent && /*#__PURE__*/_jsx(ViewSelector, {})]
140
+ }), Label || /*#__PURE__*/_jsx(FieldLabel, {
141
+ label: label,
142
+ localized: localized,
143
+ path: path,
144
+ required: required
146
145
  }), /*#__PURE__*/_jsxs("div", {
147
146
  className: `${baseClass}__wrap`,
148
147
  children: [/*#__PURE__*/_jsxs(ErrorBoundary, {
@@ -157,6 +156,7 @@ const RichTextComponent = props => {
157
156
  isSmallWidthViewport: isSmallWidthViewport,
158
157
  onChange: handleChange,
159
158
  readOnly: disabled,
159
+ rtl: rtl,
160
160
  value: value_0
161
161
  }, JSON.stringify({
162
162
  path,
@@ -1 +1 @@
1
- {"version":3,"file":"Field.js","names":["BulkUploadProvider","FieldDescription","FieldError","FieldLabel","RenderCustomComponent","useEditDepth","useEffectEvent","useField","mergeFieldStyles","dequal","React","useCallback","useEffect","useMemo","useState","ErrorBoundary","LexicalProvider","useRunDeprioritized","useRichTextView","ViewSelector","baseClass","RichTextComponent","props","editorConfig","field","admin","className","description","readOnly","readOnlyFromAdmin","label","localized","required","path","pathFromProps","readOnlyFromTopLevelProps","schemaPath","validate","readOnlyFromProps","editDepth","isControlledByParent","memoizedValidate","value","validationOptions","customComponents","AfterInput","BeforeInput","Description","Error","Label","disabled","disabledFromField","initialValue","setValue","showError","potentiallyStalePath","isSmallWidthViewport","setIsSmallWidthViewport","rerenderProviderKey","setRerenderProviderKey","prevInitialValueRef","useRef","prevValueRef","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","classes","hideGutter","filter","Boolean","join","pathWithEditDepth","runDeprioritized","handleChange","editorState","updateFieldValue","newState","toJSON","current","styles","handleInitialValueChange","JSON","parse","stringify","Date","Object","is","_jsxs","view","style","_jsx","CustomComponent","Fallback","fallbackRender","onReset","drawerSlugPrefix","composerKey","fieldProps","onChange","error","role","color","message","RichText"],"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { EditorState, SerializedEditorState } from 'lexical'\n\nimport {\n BulkUploadProvider,\n FieldDescription,\n FieldError,\n FieldLabel,\n RenderCustomComponent,\n useEditDepth,\n useEffectEvent,\n useField,\n} from '@payloadcms/ui'\nimport { mergeFieldStyles } from '@payloadcms/ui/shared'\nimport { dequal } from 'dequal/lite'\nimport { type Validate } from 'payload'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\n\nimport '../lexical/theme/EditorTheme.scss'\nimport './bundled.css'\nimport './index.scss'\n\nimport type { LexicalRichTextFieldProps } from '../types.js'\n\nimport { LexicalProvider } from '../lexical/LexicalProvider.js'\nimport { useRunDeprioritized } from '../utilities/useRunDeprioritized.js'\nimport { useRichTextView } from './RichTextViewProvider.js'\nimport { ViewSelector } from './ViewSelector.js'\n\nconst baseClass = 'rich-text-lexical'\n\nconst RichTextComponent: React.FC<\n {\n readonly editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n } & LexicalRichTextFieldProps\n> = (props) => {\n const {\n editorConfig,\n field,\n field: {\n admin: { className, description, readOnly: readOnlyFromAdmin } = {},\n label,\n localized,\n required,\n },\n path: pathFromProps,\n readOnly: readOnlyFromTopLevelProps,\n schemaPath,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n } = props\n\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const editDepth = useEditDepth()\n const { isControlledByParent } = useRichTextView()\n\n const memoizedValidate = useCallback<Validate>(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return validate(value, { ...validationOptions, required })\n }\n return true\n },\n // Important: do not add props to the dependencies array.\n // This would cause an infinite loop and endless re-rendering.\n // Removing props from the dependencies array fixed this issue: https://github.com/payloadcms/payload/issues/3709\n [validate, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n disabled: disabledFromField,\n initialValue,\n path,\n setValue,\n showError,\n value,\n } = useField<SerializedEditorState>({\n potentiallyStalePath: pathFromProps,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || disabledFromField\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n const [rerenderProviderKey, setRerenderProviderKey] = useState<Date>()\n\n const prevInitialValueRef = React.useRef<SerializedEditorState | undefined>(initialValue)\n const prevValueRef = React.useRef<SerializedEditorState | undefined>(value)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n const classes = [\n 'field-type',\n baseClass,\n className,\n showError && 'error',\n disabled && `${baseClass}--read-only`,\n editorConfig?.admin?.hideGutter !== true && !isSmallWidthViewport\n ? `${baseClass}--show-gutter`\n : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n const pathWithEditDepth = `${path}.${editDepth}`\n\n const runDeprioritized = useRunDeprioritized() // defaults to 500 ms timeout\n\n const handleChange = useCallback(\n (editorState: EditorState) => {\n // Capture `editorState` in the closure so we can safely run later.\n const updateFieldValue = () => {\n const newState = editorState.toJSON()\n prevValueRef.current = newState\n setValue(newState)\n }\n\n // Queue the update for the browser’s idle time (or Safari shim)\n // and let the hook handle debouncing/cancellation.\n void runDeprioritized(updateFieldValue)\n },\n [setValue, runDeprioritized], // `runDeprioritized` is stable (useCallback inside hook)\n )\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n const handleInitialValueChange = useEffectEvent(\n (initialValue: SerializedEditorState | undefined) => {\n // Object deep equality check here, as re-mounting the editor if\n // the new value is the same as the old one is not necessary.\n // In postgres, the order of keys in JSON objects is not guaranteed to be preserved,\n // so we need to do a deep equality check here that does not care about key order => we use dequal.\n // If we used JSON.stringify, the editor would re-mount every time you save the document, as the order of keys changes => change detected => re-mount.\n if (\n prevValueRef.current !== value &&\n !dequal(\n prevValueRef.current != null\n ? JSON.parse(JSON.stringify(prevValueRef.current))\n : prevValueRef.current,\n value,\n )\n ) {\n prevInitialValueRef.current = initialValue\n prevValueRef.current = value\n setRerenderProviderKey(new Date())\n }\n },\n )\n\n useEffect(() => {\n // Needs to trigger for object reference changes - otherwise,\n // reacting to the same initial value change twice will cause\n // the second change to be ignored, even though the value has changed.\n // That's because initialValue is not kept up-to-date\n if (!Object.is(initialValue, prevInitialValueRef.current)) {\n handleInitialValueChange(initialValue)\n }\n }, [initialValue])\n\n return (\n <div\n className={classes}\n data-field-path={path}\n data-field-schemapath={schemaPath}\n data-lexical-view={editorConfig?.view}\n key={pathWithEditDepth}\n style={styles}\n >\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n <div className={`${baseClass}__label-row`}>\n {Label || (\n <FieldLabel label={label} localized={localized} path={path} required={required} />\n )}\n {!isControlledByParent && <ViewSelector />}\n </div>\n <div className={`${baseClass}__wrap`}>\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n {BeforeInput}\n {/* Lexical may be in a drawer. We need to define another BulkUploadProvider to ensure that the bulk upload drawer\n is rendered in the correct depth (not displayed *behind* the current drawer)*/}\n <BulkUploadProvider drawerSlugPrefix={path}>\n <LexicalProvider\n composerKey={pathWithEditDepth}\n editorConfig={editorConfig}\n fieldProps={props}\n isSmallWidthViewport={isSmallWidthViewport}\n key={JSON.stringify({ path, rerenderProviderKey })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={handleChange}\n readOnly={disabled}\n value={value}\n />\n </BulkUploadProvider>\n {AfterInput}\n </ErrorBoundary>\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }: { error: Error }) {\n // Call resetErrorBoundary() to reset the error boundary and retry the render.\n\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error.message}</pre>\n </div>\n )\n}\n\nexport const RichText: typeof RichTextComponent = RichTextComponent\n"],"mappings":"AAAA;;;AAGA,SACEA,kBAAkB,EAClBC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,qBAAqB,EACrBC,YAAY,EACZC,cAAc,EACdC,QAAQ,QACH;AACP,SAASC,gBAAgB,QAAQ;AACjC,SAASC,MAAM,QAAQ;AAEvB,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AACjE,SAASC,aAAa,QAAQ;AAK9B,OAAO;AAKP,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,eAAe,QAAQ;AAChC,SAASC,YAAY,QAAQ;AAE7B,MAAMC,SAAA,GAAY;AAElB,MAAMC,iBAAA,GAIDC,KAAA;EACH,MAAM;IACJC,YAAY;IACZC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QAAEC,SAAS;QAAEC,WAAW;QAAEC,QAAA,EAAUC;MAAiB,CAAE,GAAG,CAAC,CAAC;MACnEC,KAAK;MACLC,SAAS;MACTC;IAAQ,CACT;IACDC,IAAA,EAAMC,aAAa;IACnBN,QAAA,EAAUO,yBAAyB;IACnCC,UAAU;IACVC;EAAQ,CACT,GAAGf,KAA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AAA;YACbpD,YAAA,EAAcA,YAAA;YACd8E,UAAA,EAAY/E,KAAA;YACZkC,oBAAA,EAAsBA,oBAAA;YAEtB8C,QAAA,EAAUzB,YAAA;YACVjD,QAAA,EAAUsB,QAAA;YACVR,KAAA,EAAOA;aAHF2C,IAAA,CAAKE,SAAS,CAAC;YAAEtD,IAAA;YAAMyB;UAAoB;YAMnDb,UAAA;uBAEHiD,IAAA,CAAC1F,qBAAA;QACC2F,eAAA,EAAiBhD,WAAA;QACjBiD,QAAA,eAAUF,IAAA,CAAC7F,gBAAA;UAAiB0B,WAAA,EAAaA,WAAA;UAAaM,IAAA,EAAMA;;;;KAlC3D0C,iBAAA;AAuCX;AAEA,SAASsB,eAAe;EAAEM;AAAK,CAAoB;EACjD;EAEA,oBACEZ,KAAA,CAAC;IAAIjE,SAAA,EAAU;IAAgB8E,IAAA,EAAK;4BAClCV,IAAA,CAAC;gBAAE;qBACHA,IAAA,CAAC;MAAID,KAAA,EAAO;QAAEY,KAAA,EAAO;MAAM;gBAAIF,KAAA,CAAMG;;;AAG3C;AAEA,OAAO,MAAMC,QAAA,GAAqCtF,iBAAA","ignoreList":[]}
1
+ {"version":3,"file":"Field.js","names":["BulkUploadProvider","FieldDescription","FieldError","FieldLabel","isFieldRTL","RenderCustomComponent","useConfig","useEditDepth","useEffectEvent","useField","useLocale","mergeFieldStyles","dequal","React","useCallback","useEffect","useMemo","useState","ErrorBoundary","LexicalProvider","useRunDeprioritized","baseClass","RichTextComponent","props","editorConfig","field","admin","className","description","readOnly","readOnlyFromAdmin","label","localized","required","path","pathFromProps","readOnlyFromTopLevelProps","validate","readOnlyFromProps","locale","config","localization","localizationConfig","rtl","fieldLocalized","undefined","editDepth","memoizedValidate","value","validationOptions","customComponents","AfterInput","BeforeInput","Description","Error","Label","disabled","disabledFromField","initialValue","setValue","showError","potentiallyStalePath","isSmallWidthViewport","setIsSmallWidthViewport","rerenderProviderKey","setRerenderProviderKey","prevInitialValueRef","useRef","prevValueRef","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","classes","hideGutter","filter","Boolean","join","pathWithEditDepth","runDeprioritized","handleChange","editorState","updateFieldValue","newState","toJSON","current","styles","handleInitialValueChange","JSON","parse","stringify","Date","Object","is","_jsxs","style","_jsx","CustomComponent","Fallback","fallbackRender","onReset","drawerSlugPrefix","composerKey","fieldProps","onChange","error","role","color","message","RichText"],"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { EditorState, SerializedEditorState } from 'lexical'\n\nimport {\n BulkUploadProvider,\n FieldDescription,\n FieldError,\n FieldLabel,\n isFieldRTL,\n RenderCustomComponent,\n useConfig,\n useEditDepth,\n useEffectEvent,\n useField,\n useLocale,\n} from '@payloadcms/ui'\nimport { mergeFieldStyles } from '@payloadcms/ui/shared'\nimport { dequal } from 'dequal/lite'\nimport { type Validate } from 'payload'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\n\nimport '../lexical/theme/EditorTheme.scss'\nimport './bundled.css'\nimport './index.scss'\n\nimport type { LexicalRichTextFieldProps } from '../types.js'\n\nimport { LexicalProvider } from '../lexical/LexicalProvider.js'\nimport { useRunDeprioritized } from '../utilities/useRunDeprioritized.js'\n\nconst baseClass = 'rich-text-lexical'\n\nconst RichTextComponent: React.FC<\n {\n readonly editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n } & LexicalRichTextFieldProps\n> = (props) => {\n const {\n editorConfig,\n field,\n field: {\n admin: { className, description, readOnly: readOnlyFromAdmin } = {},\n label,\n localized,\n required,\n },\n path: pathFromProps,\n readOnly: readOnlyFromTopLevelProps,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n } = props\n\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const locale = useLocale()\n const {\n config: { localization: localizationConfig },\n } = useConfig()\n\n const rtl = isFieldRTL({\n fieldLocalized: localized,\n locale,\n localizationConfig: localizationConfig || undefined,\n })\n\n const editDepth = useEditDepth()\n\n const memoizedValidate = useCallback<Validate>(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return validate(value, { ...validationOptions, required })\n }\n return true\n },\n // Important: do not add props to the dependencies array.\n // This would cause an infinite loop and endless re-rendering.\n // Removing props from the dependencies array fixed this issue: https://github.com/payloadcms/payload/issues/3709\n [validate, required],\n )\n\n const {\n customComponents: { AfterInput, BeforeInput, Description, Error, Label } = {},\n disabled: disabledFromField,\n initialValue,\n path,\n setValue,\n showError,\n value,\n } = useField<SerializedEditorState>({\n potentiallyStalePath: pathFromProps,\n validate: memoizedValidate,\n })\n\n const disabled = readOnlyFromProps || disabledFromField\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n const [rerenderProviderKey, setRerenderProviderKey] = useState<Date>()\n\n const prevInitialValueRef = React.useRef<SerializedEditorState | undefined>(initialValue)\n const prevValueRef = React.useRef<SerializedEditorState | undefined>(value)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n const classes = [\n baseClass,\n 'field-type',\n className,\n showError && 'error',\n disabled && `${baseClass}--read-only`,\n editorConfig?.admin?.hideGutter !== true && !isSmallWidthViewport\n ? `${baseClass}--show-gutter`\n : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n const pathWithEditDepth = `${path}.${editDepth}`\n\n const runDeprioritized = useRunDeprioritized() // defaults to 500 ms timeout\n\n const handleChange = useCallback(\n (editorState: EditorState) => {\n // Capture `editorState` in the closure so we can safely run later.\n const updateFieldValue = () => {\n const newState = editorState.toJSON()\n prevValueRef.current = newState\n setValue(newState)\n }\n\n // Queue the update for the browser’s idle time (or Safari shim)\n // and let the hook handle debouncing/cancellation.\n void runDeprioritized(updateFieldValue)\n },\n [setValue, runDeprioritized], // `runDeprioritized` is stable (useCallback inside hook)\n )\n\n const styles = useMemo(() => mergeFieldStyles(field), [field])\n\n const handleInitialValueChange = useEffectEvent(\n (initialValue: SerializedEditorState | undefined) => {\n // Object deep equality check here, as re-mounting the editor if\n // the new value is the same as the old one is not necessary.\n // In postgres, the order of keys in JSON objects is not guaranteed to be preserved,\n // so we need to do a deep equality check here that does not care about key order => we use dequal.\n // If we used JSON.stringify, the editor would re-mount every time you save the document, as the order of keys changes => change detected => re-mount.\n if (\n prevValueRef.current !== value &&\n !dequal(\n prevValueRef.current != null\n ? JSON.parse(JSON.stringify(prevValueRef.current))\n : prevValueRef.current,\n value,\n )\n ) {\n prevInitialValueRef.current = initialValue\n prevValueRef.current = value\n setRerenderProviderKey(new Date())\n }\n },\n )\n\n useEffect(() => {\n // Needs to trigger for object reference changes - otherwise,\n // reacting to the same initial value change twice will cause\n // the second change to be ignored, even though the value has changed.\n // That's because initialValue is not kept up-to-date\n if (!Object.is(initialValue, prevInitialValueRef.current)) {\n handleInitialValueChange(initialValue)\n }\n }, [initialValue])\n\n return (\n <div className={classes} key={pathWithEditDepth} style={styles}>\n <RenderCustomComponent\n CustomComponent={Error}\n Fallback={<FieldError path={path} showError={showError} />}\n />\n {Label || <FieldLabel label={label} localized={localized} path={path} required={required} />}\n <div className={`${baseClass}__wrap`}>\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n {BeforeInput}\n {/* Lexical may be in a drawer. We need to define another BulkUploadProvider to ensure that the bulk upload drawer\n is rendered in the correct depth (not displayed *behind* the current drawer)*/}\n <BulkUploadProvider drawerSlugPrefix={path}>\n <LexicalProvider\n composerKey={pathWithEditDepth}\n editorConfig={editorConfig}\n fieldProps={props}\n isSmallWidthViewport={isSmallWidthViewport}\n key={JSON.stringify({ path, rerenderProviderKey })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={handleChange}\n readOnly={disabled}\n rtl={rtl}\n value={value}\n />\n </BulkUploadProvider>\n {AfterInput}\n </ErrorBoundary>\n <RenderCustomComponent\n CustomComponent={Description}\n Fallback={<FieldDescription description={description} path={path} />}\n />\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }: { error: Error }) {\n // Call resetErrorBoundary() to reset the error boundary and retry the render.\n\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error.message}</pre>\n </div>\n )\n}\n\nexport const RichText: typeof RichTextComponent = RichTextComponent\n"],"mappings":"AAAA;;;AAGA,SACEA,kBAAkB,EAClBC,gBAAgB,EAChBC,UAAU,EACVC,UAAU,EACVC,UAAU,EACVC,qBAAqB,EACrBC,SAAS,EACTC,YAAY,EACZC,cAAc,EACdC,QAAQ,EACRC,SAAS,QACJ;AACP,SAASC,gBAAgB,QAAQ;AACjC,SAASC,MAAM,QAAQ;AAEvB,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ;AACjE,SAASC,aAAa,QAAQ;AAK9B,OAAO;AAKP,SAASC,eAAe,QAAQ;AAChC,SAASC,mBAAmB,QAAQ;AAEpC,MAAMC,SAAA,GAAY;AAElB,MAAMC,iBAAA,GAIDC,KAAA;EACH,MAAM;IACJC,YAAY;IACZC,KAAK;IACLA,KAAA,EAAO;MACLC,KAAA,EAAO;QAAEC,SAAS;QAAEC,WAAW;QAAEC,QAAA,EAAUC;MAAiB,CAAE,GAAG,CAAC,CAAC;MACnEC,KAAK;MACLC,SAAS;MACTC;IAAQ,CACT;IACDC,IAAA,EAAMC,aAAa;IACnBN,QAA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