@payloadcms/richtext-lexical 3.68.0-internal-debug.35482da → 3.68.0-internal-debug.e9b66ee

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 (254) hide show
  1. package/dist/cell/rscEntry.js +2 -21
  2. package/dist/cell/rscEntry.js.map +1 -1
  3. package/dist/features/blocks/client/component/BlockContent.js +13 -48
  4. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  5. package/dist/features/blocks/client/component/components/BlockCollapsible.js +1 -10
  6. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
  7. package/dist/features/blocks/client/component/components/BlockEditButton.js +1 -7
  8. package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
  9. package/dist/features/blocks/client/component/components/BlockRemoveButton.js +1 -7
  10. package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
  11. package/dist/features/blocks/client/component/index.js +81 -247
  12. package/dist/features/blocks/client/component/index.js.map +1 -1
  13. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js +1 -9
  14. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
  15. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js +1 -7
  16. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
  17. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js +1 -7
  18. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
  19. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js +1 -7
  20. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
  21. package/dist/features/blocks/client/componentInline/index.js +68 -217
  22. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  23. package/dist/features/blocks/client/getBlockImageComponent.js +4 -15
  24. package/dist/features/blocks/client/getBlockImageComponent.js.map +1 -1
  25. package/dist/features/blocks/client/nodes/BlocksNode.js +1 -12
  26. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  27. package/dist/features/blocks/client/nodes/InlineBlocksNode.js +2 -12
  28. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  29. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +26 -127
  30. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  31. package/dist/features/blocks/premade/CodeBlock/Component/Code.js +49 -65
  32. package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
  33. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +3 -16
  34. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
  35. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +4 -25
  36. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
  37. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  38. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  39. package/dist/features/converters/lexicalToJSX/Component/index.js +2 -13
  40. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  41. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js +1 -8
  42. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
  43. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +1 -8
  44. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  45. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js +1 -6
  46. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
  47. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js +1 -6
  48. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
  49. package/dist/features/converters/lexicalToJSX/converter/converters/link.js +10 -19
  50. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
  51. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +16 -63
  52. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  53. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js +4 -19
  54. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
  55. package/dist/features/converters/lexicalToJSX/converter/converters/table.js +12 -45
  56. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
  57. package/dist/features/converters/lexicalToJSX/converter/converters/text.js +11 -57
  58. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
  59. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +7 -46
  60. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  61. package/dist/features/converters/lexicalToJSX/converter/index.js +5 -12
  62. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  63. package/dist/features/debug/jsxConverter/client/plugin/index.js +3 -16
  64. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  65. package/dist/features/debug/testRecorder/client/plugin/index.js +38 -113
  66. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  67. package/dist/features/debug/treeView/client/plugin/index.js +1 -15
  68. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  69. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +79 -357
  70. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  71. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +7 -41
  72. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  73. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +9 -39
  74. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  75. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +28 -59
  76. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  77. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +0 -1
  78. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  79. package/dist/features/indent/client/IndentPlugin.js +1 -6
  80. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  81. package/dist/features/link/client/plugins/clickableLink/index.js +1 -7
  82. package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -1
  83. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +59 -151
  84. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  85. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -9
  86. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  87. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  88. package/dist/features/lists/checklist/client/plugin/index.js +1 -7
  89. package/dist/features/lists/checklist/client/plugin/index.js.map +1 -1
  90. package/dist/features/lists/plugin/index.js +1 -7
  91. package/dist/features/lists/plugin/index.js.map +1 -1
  92. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +3 -18
  93. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  94. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -9
  95. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  96. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +3 -18
  97. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  98. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -9
  99. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  100. package/dist/features/relationship/client/components/RelationshipComponent.js +31 -100
  101. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  102. package/dist/features/relationship/client/drawer/index.js +4 -21
  103. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  104. package/dist/features/relationship/client/nodes/RelationshipNode.js +2 -12
  105. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  106. package/dist/features/relationship/client/plugins/index.js +1 -8
  107. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  108. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  109. package/dist/features/textState/feature.client.js +5 -22
  110. package/dist/features/textState/feature.client.js.map +1 -1
  111. package/dist/features/toolbars/fixed/client/Toolbar/index.js +27 -123
  112. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  113. package/dist/features/toolbars/inline/client/Toolbar/index.js +18 -111
  114. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  115. package/dist/features/toolbars/shared/ToolbarButton/index.js +4 -14
  116. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  117. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +56 -135
  118. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  119. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +16 -70
  120. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  121. package/dist/features/upload/client/component/index.js +43 -167
  122. package/dist/features/upload/client/component/index.js.map +1 -1
  123. package/dist/features/upload/client/component/pending/index.js +3 -16
  124. package/dist/features/upload/client/component/pending/index.js.map +1 -1
  125. package/dist/features/upload/client/drawer/index.js +4 -21
  126. package/dist/features/upload/client/drawer/index.js.map +1 -1
  127. package/dist/features/upload/client/nodes/UploadNode.js +3 -17
  128. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  129. package/dist/features/upload/client/plugin/index.js +2 -9
  130. package/dist/features/upload/client/plugin/index.js.map +1 -1
  131. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  132. package/dist/field/Diff/converters/listitem/index.js +11 -54
  133. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  134. package/dist/field/Diff/converters/relationship/index.js +18 -60
  135. package/dist/field/Diff/converters/relationship/index.js.map +1 -1
  136. package/dist/field/Diff/converters/unknown/index.js +7 -42
  137. package/dist/field/Diff/converters/unknown/index.js.map +1 -1
  138. package/dist/field/Diff/converters/upload/index.js +21 -91
  139. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  140. package/dist/field/Diff/index.js +4 -17
  141. package/dist/field/Diff/index.js.map +1 -1
  142. package/dist/field/Field.js +25 -124
  143. package/dist/field/Field.js.map +1 -1
  144. package/dist/field/RenderLexical/index.js +15 -47
  145. package/dist/field/RenderLexical/index.js.map +1 -1
  146. package/dist/field/index.js +5 -24
  147. package/dist/field/index.js.map +1 -1
  148. package/dist/field/rscEntry.js +1 -9
  149. package/dist/field/rscEntry.js.map +1 -1
  150. package/dist/lexical/EditorPlugin.js +2 -17
  151. package/dist/lexical/EditorPlugin.js.map +1 -1
  152. package/dist/lexical/LexicalEditor.js +69 -232
  153. package/dist/lexical/LexicalEditor.js.map +1 -1
  154. package/dist/lexical/LexicalProvider.js +13 -64
  155. package/dist/lexical/LexicalProvider.js.map +1 -1
  156. package/dist/lexical/config/client/EditorConfigProvider.js +2 -11
  157. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  158. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +5 -28
  159. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  160. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +1 -14
  161. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  162. package/dist/lexical/plugins/SlashMenu/index.js +31 -98
  163. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  164. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +7 -27
  165. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  166. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +7 -45
  167. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  168. package/dist/lexical/ui/ContentEditable.js +3 -18
  169. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  170. package/dist/lexical/ui/icons/AI/index.js +10 -58
  171. package/dist/lexical/ui/icons/AI/index.js.map +1 -1
  172. package/dist/lexical/ui/icons/Add/index.js +4 -31
  173. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  174. package/dist/lexical/ui/icons/AlignCenter/index.js +5 -45
  175. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  176. package/dist/lexical/ui/icons/AlignJustify/index.js +5 -45
  177. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  178. package/dist/lexical/ui/icons/AlignLeft/index.js +5 -45
  179. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  180. package/dist/lexical/ui/icons/AlignRight/index.js +5 -45
  181. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  182. package/dist/lexical/ui/icons/Block/index.js +5 -54
  183. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  184. package/dist/lexical/ui/icons/Blockquote/index.js +3 -24
  185. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  186. package/dist/lexical/ui/icons/Bold/index.js +3 -24
  187. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  188. package/dist/lexical/ui/icons/Checklist/index.js +4 -39
  189. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  190. package/dist/lexical/ui/icons/Code/index.js +4 -34
  191. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  192. package/dist/lexical/ui/icons/CodeBlock/index.js +3 -22
  193. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  194. package/dist/lexical/ui/icons/Collapse/index.js +3 -23
  195. package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
  196. package/dist/lexical/ui/icons/H1/index.js +3 -24
  197. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  198. package/dist/lexical/ui/icons/H2/index.js +3 -24
  199. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  200. package/dist/lexical/ui/icons/H3/index.js +3 -24
  201. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  202. package/dist/lexical/ui/icons/H4/index.js +3 -24
  203. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  204. package/dist/lexical/ui/icons/H5/index.js +3 -24
  205. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  206. package/dist/lexical/ui/icons/H6/index.js +3 -24
  207. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  208. package/dist/lexical/ui/icons/HorizontalRule/index.js +3 -27
  209. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  210. package/dist/lexical/ui/icons/IndentDecrease/index.js +6 -53
  211. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  212. package/dist/lexical/ui/icons/IndentIncrease/index.js +6 -53
  213. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  214. package/dist/lexical/ui/icons/InlineBlocks/index.js +3 -26
  215. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
  216. package/dist/lexical/ui/icons/Italic/index.js +3 -24
  217. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  218. package/dist/lexical/ui/icons/Link/index.js +3 -25
  219. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  220. package/dist/lexical/ui/icons/Meatballs/index.js +5 -39
  221. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
  222. package/dist/lexical/ui/icons/OrderedList/index.js +7 -61
  223. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  224. package/dist/lexical/ui/icons/Relationship/index.js +10 -58
  225. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  226. package/dist/lexical/ui/icons/Strikethrough/index.js +4 -34
  227. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  228. package/dist/lexical/ui/icons/Subscript/index.js +3 -24
  229. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  230. package/dist/lexical/ui/icons/Superscript/index.js +3 -24
  231. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  232. package/dist/lexical/ui/icons/Table/index.js +3 -24
  233. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  234. package/dist/lexical/ui/icons/Text/index.js +3 -24
  235. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  236. package/dist/lexical/ui/icons/TextState/index.js +12 -18
  237. package/dist/lexical/ui/icons/TextState/index.js.map +1 -1
  238. package/dist/lexical/ui/icons/Underline/index.js +4 -34
  239. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  240. package/dist/lexical/ui/icons/UnorderedList/index.js +8 -81
  241. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  242. package/dist/lexical/ui/icons/Upload/index.js +5 -48
  243. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  244. package/dist/lexical/utils/point.js.map +1 -1
  245. package/dist/lexical/utils/rect.js.map +1 -1
  246. package/dist/utilities/fieldsDrawer/Drawer.js +16 -41
  247. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  248. package/dist/utilities/fieldsDrawer/DrawerContent.js +10 -42
  249. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  250. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +1 -9
  251. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  252. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +3 -11
  253. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
  254. package/package.json +7 -7
@@ -1 +1 @@
1
- {"version":3,"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"],"names":["React","defaultJSXConverters","convertLexicalToJSX","RichText","className","converters","data","editorState","disableContainer","disableIndent","disableTextAlign","finalConverters","defaultConverters","content","Array","isArray","div"],"mappings":";AAEA,OAAOA,WAAW,QAAO;AASzB,SAASC,oBAAoB,QAAQ,oCAAmC;AACxE,SAASC,mBAAmB,QAAQ,wBAAuB;AAUzD;;GAEC,GAED;;GAEC,GAED;;GAEC,GAED;;GAEC,GAED;;GAEC,GAED;;GAEC,GAIH,OAAO,MAAMC,WAAoC,CAAC,EAChDC,SAAS,EACTC,UAAU,EACVC,MAAMC,WAAW,EACjBC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,EACjB;IACC,IAAI,CAACH,aAAa;QAChB,OAAO;IACT;IAEA,IAAII,kBAAiC,CAAC;IACtC,IAAIN,YAAY;QACd,IAAI,OAAOA,eAAe,YAAY;YACpCM,kBAAkBN,WAAW;gBAAEO,mBAAmBX;YAAqB;QACzE,OAAO;YACLU,kBAAkBN;QACpB;IACF,OAAO;QACLM,kBAAkBV;IACpB;IAEA,MAAMY,UACJN,eACA,CAACO,MAAMC,OAAO,CAACR,gBACf,OAAOA,gBAAgB,YACvB,UAAUA,eACVL,oBAAoB;QAClBG,YAAYM;QACZL,MAAMC;QACNE;QACAC;IACF;IAEF,IAAIF,kBAAkB;QACpB,qBAAO;sBAAGK;;IACZ;IAEA,qBAAO,QAACG;QAAIZ,WAAWA,aAAa;kBAAqBS;;;;;;AAC3D,EAAC"}
1
+ {"version":3,"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"],"names":["defaultJSXConverters","convertLexicalToJSX","RichText","className","converters","data","editorState","disableContainer","disableIndent","disableTextAlign","finalConverters","defaultConverters","content","Array","isArray","div"],"mappings":"AAWA,SAASA,oBAAoB,QAAQ,oCAAmC;AACxE,SAASC,mBAAmB,QAAQ,wBAAuB;AAUzD;;GAEC,GAED;;GAEC,GAED;;GAEC,GAED;;GAEC,GAED;;GAEC,GAED;;GAEC,GAIH,OAAO,MAAMC,WAAoC,CAAC,EAChDC,SAAS,EACTC,UAAU,EACVC,MAAMC,WAAW,EACjBC,gBAAgB,EAChBC,aAAa,EACbC,gBAAgB,EACjB;IACC,IAAI,CAACH,aAAa;QAChB,OAAO;IACT;IAEA,IAAII,kBAAiC,CAAC;IACtC,IAAIN,YAAY;QACd,IAAI,OAAOA,eAAe,YAAY;YACpCM,kBAAkBN,WAAW;gBAAEO,mBAAmBX;YAAqB;QACzE,OAAO;YACLU,kBAAkBN;QACpB;IACF,OAAO;QACLM,kBAAkBV;IACpB;IAEA,MAAMY,UACJN,eACA,CAACO,MAAMC,OAAO,CAACR,gBACf,OAAOA,gBAAgB,YACvB,UAAUA,eACVL,oBAAoB;QAClBG,YAAYM;QACZL,MAAMC;QACNE;QACAC;IACF;IAEF,IAAIF,kBAAkB;QACpB,UAAUK;IACZ;IAEA,QAAQG,IAAIZ,WAAWA,aAAa,qBAAqBS,UAAUG;AACrE,EAAC"}
@@ -1,16 +1,9 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
1
  export const BlockquoteJSXConverter = {
3
2
  quote: ({ node, nodesToJSX })=>{
4
3
  const children = nodesToJSX({
5
4
  nodes: node.children
6
5
  });
7
- return /*#__PURE__*/ _jsxDEV("blockquote", {
8
- children: children
9
- }, void 0, false, {
10
- fileName: "src/features/converters/lexicalToJSX/converter/converters/blockquote.tsx",
11
- lineNumber: 10,
12
- columnNumber: 12
13
- }, this);
6
+ return <blockquote>{children}</blockquote>;
14
7
  }
15
8
  };
16
9
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/blockquote.tsx"],"sourcesContent":["import type { SerializedQuoteNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const BlockquoteJSXConverter: JSXConverters<SerializedQuoteNode> = {\n quote: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n return <blockquote>{children}</blockquote>\n },\n}\n"],"names":["BlockquoteJSXConverter","quote","node","nodesToJSX","children","nodes","blockquote"],"mappings":";AAGA,OAAO,MAAMA,yBAA6D;IACxEC,OAAO,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAC1B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,qBAAO,QAACE;sBAAYF;;;;;;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/blockquote.tsx"],"sourcesContent":["import type { SerializedQuoteNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const BlockquoteJSXConverter: JSXConverters<SerializedQuoteNode> = {\n quote: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n return <blockquote>{children}</blockquote>\n },\n}\n"],"names":["BlockquoteJSXConverter","quote","node","nodesToJSX","children","nodes","blockquote"],"mappings":"AAGA,OAAO,MAAMA,yBAA6D;IACxEC,OAAO,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAC1B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,QAAQE,YAAYF,WAAWE;IACjC;AACF,EAAC"}
@@ -1,17 +1,10 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
1
  export const HeadingJSXConverter = {
3
2
  heading: ({ node, nodesToJSX })=>{
4
3
  const children = nodesToJSX({
5
4
  nodes: node.children
6
5
  });
7
6
  const NodeTag = node.tag;
8
- return /*#__PURE__*/ _jsxDEV(NodeTag, {
9
- children: children
10
- }, void 0, false, {
11
- fileName: "src/features/converters/lexicalToJSX/converter/converters/heading.tsx",
12
- lineNumber: 12,
13
- columnNumber: 12
14
- }, this);
7
+ return <NodeTag>{children}</NodeTag>;
15
8
  }
16
9
  };
17
10
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/heading.tsx"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const HeadingJSXConverter: JSXConverters<SerializedHeadingNode> = {\n heading: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const NodeTag = node.tag\n\n return <NodeTag>{children}</NodeTag>\n },\n}\n"],"names":["HeadingJSXConverter","heading","node","nodesToJSX","children","nodes","NodeTag","tag"],"mappings":";AAGA,OAAO,MAAMA,sBAA4D;IACvEC,SAAS,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAC5B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,MAAME,UAAUJ,KAAKK,GAAG;QAExB,qBAAO,QAACD;sBAASF;;;;;;IACnB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/heading.tsx"],"sourcesContent":["import type { SerializedHeadingNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const HeadingJSXConverter: JSXConverters<SerializedHeadingNode> = {\n heading: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const NodeTag = node.tag\n\n return <NodeTag>{children}</NodeTag>\n },\n}\n"],"names":["HeadingJSXConverter","heading","node","nodesToJSX","children","nodes","NodeTag","tag"],"mappings":"AAGA,OAAO,MAAMA,sBAA4D;IACvEC,SAAS,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAC5B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,MAAME,UAAUJ,KAAKK,GAAG;QAExB,QAAQD,SAASF,WAAWE;IAC9B;AACF,EAAC"}
@@ -1,10 +1,5 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
1
  export const HorizontalRuleJSXConverter = {
3
- horizontalrule: /*#__PURE__*/ _jsxDEV("hr", {}, void 0, false, {
4
- fileName: "src/features/converters/lexicalToJSX/converter/converters/horizontalRule.tsx",
5
- lineNumber: 4,
6
- columnNumber: 19
7
- }, this)
2
+ horizontalrule: <hr/>
8
3
  };
9
4
 
10
5
  //# sourceMappingURL=horizontalRule.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/horizontalRule.tsx"],"sourcesContent":["import type { SerializedHorizontalRuleNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\nexport const HorizontalRuleJSXConverter: JSXConverters<SerializedHorizontalRuleNode> = {\n horizontalrule: <hr />,\n}\n"],"names":["HorizontalRuleJSXConverter","horizontalrule","hr"],"mappings":";AAEA,OAAO,MAAMA,6BAA0E;IACrFC,8BAAgB,QAACC;;;;;AACnB,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/horizontalRule.tsx"],"sourcesContent":["import type { SerializedHorizontalRuleNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\nexport const HorizontalRuleJSXConverter: JSXConverters<SerializedHorizontalRuleNode> = {\n horizontalrule: <hr />,\n}\n"],"names":["HorizontalRuleJSXConverter","horizontalrule","hr"],"mappings":"AAEA,OAAO,MAAMA,6BAA0E;IACrFC,iBAAiBC;AACnB,EAAC"}
@@ -1,10 +1,5 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
1
  export const LinebreakJSXConverter = {
3
- linebreak: /*#__PURE__*/ _jsxDEV("br", {}, void 0, false, {
4
- fileName: "src/features/converters/lexicalToJSX/converter/converters/linebreak.tsx",
5
- lineNumber: 5,
6
- columnNumber: 14
7
- }, this)
2
+ linebreak: <br/>
8
3
  };
9
4
 
10
5
  //# sourceMappingURL=linebreak.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/linebreak.tsx"],"sourcesContent":["import type { SerializedLineBreakNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const LinebreakJSXConverter: JSXConverters<SerializedLineBreakNode> = {\n linebreak: <br />,\n}\n"],"names":["LinebreakJSXConverter","linebreak","br"],"mappings":";AAGA,OAAO,MAAMA,wBAAgE;IAC3EC,yBAAW,QAACC;;;;;AACd,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/linebreak.tsx"],"sourcesContent":["import type { SerializedLineBreakNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const LinebreakJSXConverter: JSXConverters<SerializedLineBreakNode> = {\n linebreak: <br />,\n}\n"],"names":["LinebreakJSXConverter","linebreak","br"],"mappings":"AAGA,OAAO,MAAMA,wBAAgE;IAC3EC,YAAYC;AACd,EAAC"}
@@ -1,4 +1,3 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
1
  export const LinkJSXConverter = ({ internalDocToHref })=>({
3
2
  autolink: ({ node, nodesToJSX })=>{
4
3
  const children = nodesToJSX({
@@ -6,16 +5,12 @@ export const LinkJSXConverter = ({ internalDocToHref })=>({
6
5
  });
7
6
  const rel = node.fields.newTab ? 'noopener noreferrer' : undefined;
8
7
  const target = node.fields.newTab ? '_blank' : undefined;
9
- return /*#__PURE__*/ _jsxDEV("a", {
10
- href: node.fields.url,
8
+ return <a href={node.fields.url} {...{
11
9
  rel,
12
- target,
13
- children: children
14
- }, void 0, false, {
15
- fileName: "src/features/converters/lexicalToJSX/converter/converters/link.tsx",
16
- lineNumber: 16,
17
- columnNumber: 7
18
- }, this);
10
+ target
11
+ }}>
12
+ {children}
13
+ </a>;
19
14
  },
20
15
  link: ({ node, nodesToJSX })=>{
21
16
  const children = nodesToJSX({
@@ -35,16 +30,12 @@ export const LinkJSXConverter = ({ internalDocToHref })=>({
35
30
  }
36
31
  }
37
32
  // fallback
38
- return /*#__PURE__*/ _jsxDEV("a", {
39
- href: href,
33
+ return <a href={href} {...{
40
34
  rel,
41
- target,
42
- children: children
43
- }, void 0, false, {
44
- fileName: "src/features/converters/lexicalToJSX/converter/converters/link.tsx",
45
- lineNumber: 42,
46
- columnNumber: 7
47
- }, this);
35
+ target
36
+ }}>
37
+ {children}
38
+ </a>;
48
39
  }
49
40
  });
50
41
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/link.tsx"],"sourcesContent":["import type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const LinkJSXConverter: (args: {\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string\n}) => JSXConverters<SerializedAutoLinkNode | SerializedLinkNode> = ({ internalDocToHref }) => ({\n autolink: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined\n const target: string | undefined = node.fields.newTab ? '_blank' : undefined\n\n return (\n <a href={node.fields.url} {...{ rel, target }}>\n {children}\n </a>\n )\n },\n link: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined\n const target: string | undefined = node.fields.newTab ? '_blank' : undefined\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n if (internalDocToHref) {\n href = internalDocToHref({ linkNode: node })\n } else {\n console.error(\n 'Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided',\n )\n href = '#' // fallback\n }\n }\n\n return (\n <a href={href} {...{ rel, target }}>\n {children}\n </a>\n )\n },\n})\n"],"names":["LinkJSXConverter","internalDocToHref","autolink","node","nodesToJSX","children","nodes","rel","fields","newTab","undefined","target","a","href","url","link","linkType","linkNode","console","error"],"mappings":";AAGA,OAAO,MAAMA,mBAEsD,CAAC,EAAEC,iBAAiB,EAAE,GAAM,CAAA;QAC7FC,UAAU,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;YAC7B,MAAMC,WAAWD,WAAW;gBAC1BE,OAAOH,KAAKE,QAAQ;YACtB;YAEA,MAAME,MAA0BJ,KAAKK,MAAM,CAACC,MAAM,GAAG,wBAAwBC;YAC7E,MAAMC,SAA6BR,KAAKK,MAAM,CAACC,MAAM,GAAG,WAAWC;YAEnE,qBACE,QAACE;gBAAEC,MAAMV,KAAKK,MAAM,CAACM,GAAG;gBAAQP;gBAAKI;0BAClCN;;;;;;QAGP;QACAU,MAAM,CAAC,EAAEZ,IAAI,EAAEC,UAAU,EAAE;YACzB,MAAMC,WAAWD,WAAW;gBAC1BE,OAAOH,KAAKE,QAAQ;YACtB;YAEA,MAAME,MAA0BJ,KAAKK,MAAM,CAACC,MAAM,GAAG,wBAAwBC;YAC7E,MAAMC,SAA6BR,KAAKK,MAAM,CAACC,MAAM,GAAG,WAAWC;YAEnE,IAAIG,OAAeV,KAAKK,MAAM,CAACM,GAAG,IAAI;YACtC,IAAIX,KAAKK,MAAM,CAACQ,QAAQ,KAAK,YAAY;gBACvC,IAAIf,mBAAmB;oBACrBY,OAAOZ,kBAAkB;wBAAEgB,UAAUd;oBAAK;gBAC5C,OAAO;oBACLe,QAAQC,KAAK,CACX;oBAEFN,OAAO;gBACT;YACF;YAFe,WAAW;YAI1B,qBACE,QAACD;gBAAEC,MAAMA;gBAAYN;gBAAKI;0BACvBN;;;;;;QAGP;IACF,CAAA,EAAE"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/link.tsx"],"sourcesContent":["import type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const LinkJSXConverter: (args: {\n internalDocToHref?: (args: { linkNode: SerializedLinkNode }) => string\n}) => JSXConverters<SerializedAutoLinkNode | SerializedLinkNode> = ({ internalDocToHref }) => ({\n autolink: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined\n const target: string | undefined = node.fields.newTab ? '_blank' : undefined\n\n return (\n <a href={node.fields.url} {...{ rel, target }}>\n {children}\n </a>\n )\n },\n link: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const rel: string | undefined = node.fields.newTab ? 'noopener noreferrer' : undefined\n const target: string | undefined = node.fields.newTab ? '_blank' : undefined\n\n let href: string = node.fields.url ?? ''\n if (node.fields.linkType === 'internal') {\n if (internalDocToHref) {\n href = internalDocToHref({ linkNode: node })\n } else {\n console.error(\n 'Lexical => JSX converter: Link converter: found internal link, but internalDocToHref is not provided',\n )\n href = '#' // fallback\n }\n }\n\n return (\n <a href={href} {...{ rel, target }}>\n {children}\n </a>\n )\n },\n})\n"],"names":["LinkJSXConverter","internalDocToHref","autolink","node","nodesToJSX","children","nodes","rel","fields","newTab","undefined","target","a","href","url","link","linkType","linkNode","console","error"],"mappings":"AAGA,OAAO,MAAMA,mBAEsD,CAAC,EAAEC,iBAAiB,EAAE,GAAM,CAAA;QAC7FC,UAAU,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;YAC7B,MAAMC,WAAWD,WAAW;gBAC1BE,OAAOH,KAAKE,QAAQ;YACtB;YAEA,MAAME,MAA0BJ,KAAKK,MAAM,CAACC,MAAM,GAAG,wBAAwBC;YAC7E,MAAMC,SAA6BR,KAAKK,MAAM,CAACC,MAAM,GAAG,WAAWC;YAEnE,QACGE,EAAEC,MAAMV,KAAKK,MAAM,CAACM,GAAG,GAAG,GAAG;gBAAEP;gBAAKI;YAAO,CAAC,EAAE;QAC7C,CAACN,SAAS;MACZ,EAAEO;QAEN;QACAG,MAAM,CAAC,EAAEZ,IAAI,EAAEC,UAAU,EAAE;YACzB,MAAMC,WAAWD,WAAW;gBAC1BE,OAAOH,KAAKE,QAAQ;YACtB;YAEA,MAAME,MAA0BJ,KAAKK,MAAM,CAACC,MAAM,GAAG,wBAAwBC;YAC7E,MAAMC,SAA6BR,KAAKK,MAAM,CAACC,MAAM,GAAG,WAAWC;YAEnE,IAAIG,OAAeV,KAAKK,MAAM,CAACM,GAAG,IAAI;YACtC,IAAIX,KAAKK,MAAM,CAACQ,QAAQ,KAAK,YAAY;gBACvC,IAAIf,mBAAmB;oBACrBY,OAAOZ,kBAAkB;wBAAEgB,UAAUd;oBAAK;gBAC5C,OAAO;oBACLe,QAAQC,KAAK,CACX;oBAEFN,OAAO;gBACT;YACF;YAFe,WAAW;YAI1B,QACGD,EAAEC,MAAMA,OAAO,GAAG;gBAAEN;gBAAKI;YAAO,CAAC,EAAE;QAClC,CAACN,SAAS;MACZ,EAAEO;QAEN;IACF,CAAA,EAAE"}
@@ -1,4 +1,3 @@
1
- import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime";
2
1
  import { v4 as uuidv4 } from 'uuid';
3
2
  export const ListJSXConverter = {
4
3
  list: ({ node, nodesToJSX })=>{
@@ -6,14 +5,7 @@ export const ListJSXConverter = {
6
5
  nodes: node.children
7
6
  });
8
7
  const NodeTag = node.tag;
9
- return /*#__PURE__*/ _jsxDEV(NodeTag, {
10
- className: `list-${node?.listType}`,
11
- children: children
12
- }, void 0, false, {
13
- fileName: "src/features/converters/lexicalToJSX/converter/converters/list.tsx",
14
- lineNumber: 14,
15
- columnNumber: 12
16
- }, this);
8
+ return <NodeTag className={`list-${node?.listType}`}>{children}</NodeTag>;
17
9
  },
18
10
  listitem: ({ node, nodesToJSX, parent })=>{
19
11
  const hasSubLists = node.children.some((child)=>child.type === 'list');
@@ -22,61 +14,22 @@ export const ListJSXConverter = {
22
14
  });
23
15
  if ('listType' in parent && parent?.listType === 'check') {
24
16
  const uuid = uuidv4();
25
- return /*#__PURE__*/ _jsxDEV("li", {
26
- "aria-checked": node.checked ? 'true' : 'false',
27
- className: `list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}`,
28
- // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
29
- role: "checkbox",
30
- style: {
31
- listStyleType: 'none'
32
- },
33
- tabIndex: -1,
34
- value: node?.value,
35
- children: hasSubLists ? children : /*#__PURE__*/ _jsxDEV(_Fragment, {
36
- children: [
37
- /*#__PURE__*/ _jsxDEV("input", {
38
- checked: node.checked,
39
- id: uuid,
40
- readOnly: true,
41
- type: "checkbox"
42
- }, void 0, false, {
43
- fileName: "src/features/converters/lexicalToJSX/converter/converters/list.tsx",
44
- lineNumber: 40,
45
- columnNumber: 15
46
- }, this),
47
- /*#__PURE__*/ _jsxDEV("label", {
48
- htmlFor: uuid,
49
- children: children
50
- }, void 0, false, {
51
- fileName: "src/features/converters/lexicalToJSX/converter/converters/list.tsx",
52
- lineNumber: 41,
53
- columnNumber: 15
54
- }, this),
55
- /*#__PURE__*/ _jsxDEV("br", {}, void 0, false, {
56
- fileName: "src/features/converters/lexicalToJSX/converter/converters/list.tsx",
57
- lineNumber: 42,
58
- columnNumber: 15
59
- }, this)
60
- ]
61
- }, void 0, true)
62
- }, void 0, false, {
63
- fileName: "src/features/converters/lexicalToJSX/converter/converters/list.tsx",
64
- lineNumber: 27,
65
- columnNumber: 9
66
- }, this);
17
+ return <li aria-checked={node.checked ? 'true' : 'false'} className={`list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}`} // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role
18
+ role="checkbox" style={{
19
+ listStyleType: 'none'
20
+ }} tabIndex={-1} value={node?.value}>
21
+ {hasSubLists ? children : <>
22
+ <input checked={node.checked} id={uuid} readOnly={true} type="checkbox"/>
23
+ <label htmlFor={uuid}>{children}</label>
24
+ <br/>
25
+ </>}
26
+ </li>;
67
27
  } else {
68
- return /*#__PURE__*/ _jsxDEV("li", {
69
- className: `${hasSubLists ? 'nestedListItem' : ''}`,
70
- style: hasSubLists ? {
71
- listStyleType: 'none'
72
- } : undefined,
73
- value: node?.value,
74
- children: children
75
- }, void 0, false, {
76
- fileName: "src/features/converters/lexicalToJSX/converter/converters/list.tsx",
77
- lineNumber: 49,
78
- columnNumber: 9
79
- }, this);
28
+ return <li className={`${hasSubLists ? 'nestedListItem' : ''}`} style={hasSubLists ? {
29
+ listStyleType: 'none'
30
+ } : undefined} value={node?.value}>
31
+ {children}
32
+ </li>;
80
33
  }
81
34
  }
82
35
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/list.tsx"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const ListJSXConverter: JSXConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const NodeTag = node.tag\n\n return <NodeTag className={`list-${node?.listType}`}>{children}</NodeTag>\n },\n listitem: ({ node, nodesToJSX, parent }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n\n return (\n <li\n aria-checked={node.checked ? 'true' : 'false'}\n className={`list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}`}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"checkbox\"\n style={{ listStyleType: 'none' }}\n tabIndex={-1}\n value={node?.value}\n >\n {hasSubLists ? (\n children\n ) : (\n <>\n <input checked={node.checked} id={uuid} readOnly={true} type=\"checkbox\" />\n <label htmlFor={uuid}>{children}</label>\n <br />\n </>\n )}\n </li>\n )\n } else {\n return (\n <li\n className={`${hasSubLists ? 'nestedListItem' : ''}`}\n style={hasSubLists ? { listStyleType: 'none' } : undefined}\n value={node?.value}\n >\n {children}\n </li>\n )\n }\n },\n}\n"],"names":["v4","uuidv4","ListJSXConverter","list","node","nodesToJSX","children","nodes","NodeTag","tag","className","listType","listitem","parent","hasSubLists","some","child","type","uuid","li","aria-checked","checked","role","style","listStyleType","tabIndex","value","input","id","readOnly","label","htmlFor","br","undefined"],"mappings":";AAAA,SAASA,MAAMC,MAAM,QAAQ,OAAM;AAKnC,OAAO,MAAMC,mBAA+E;IAC1FC,MAAM,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QACzB,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,MAAME,UAAUJ,KAAKK,GAAG;QAExB,qBAAO,QAACD;YAAQE,WAAW,CAAC,KAAK,EAAEN,MAAMO,UAAU;sBAAGL;;;;;;IACxD;IACAM,UAAU,CAAC,EAAER,IAAI,EAAEC,UAAU,EAAEQ,MAAM,EAAE;QACrC,MAAMC,cAAcV,KAAKE,QAAQ,CAACS,IAAI,CAAC,CAACC,QAAUA,MAAMC,IAAI,KAAK;QAEjE,MAAMX,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,IAAI,cAAcO,UAAUA,QAAQF,aAAa,SAAS;YACxD,MAAMO,OAAOjB;YAEb,qBACE,QAACkB;gBACCC,gBAAchB,KAAKiB,OAAO,GAAG,SAAS;gBACtCX,WAAW,CAAC,kBAAkB,EAAEN,KAAKiB,OAAO,GAAG,gCAAgC,kCAAkCP,cAAc,oBAAoB,IAAI;gBACvJ,kFAAkF;gBAClFQ,MAAK;gBACLC,OAAO;oBAAEC,eAAe;gBAAO;gBAC/BC,UAAU,CAAC;gBACXC,OAAOtB,MAAMsB;0BAEZZ,cACCR,yBAEA;;sCACE,QAACqB;4BAAMN,SAASjB,KAAKiB,OAAO;4BAAEO,IAAIV;4BAAMW,UAAU;4BAAMZ,MAAK;;;;;;sCAC7D,QAACa;4BAAMC,SAASb;sCAAOZ;;;;;;sCACvB,QAAC0B;;;;;;;;;;;;QAKX,OAAO;YACL,qBACE,QAACb;gBACCT,WAAW,GAAGI,cAAc,mBAAmB,IAAI;gBACnDS,OAAOT,cAAc;oBAAEU,eAAe;gBAAO,IAAIS;gBACjDP,OAAOtB,MAAMsB;0BAEZpB;;;;;;QAGP;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/list.tsx"],"sourcesContent":["import { v4 as uuidv4 } from 'uuid'\n\nimport type { SerializedListItemNode, SerializedListNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const ListJSXConverter: JSXConverters<SerializedListItemNode | SerializedListNode> = {\n list: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const NodeTag = node.tag\n\n return <NodeTag className={`list-${node?.listType}`}>{children}</NodeTag>\n },\n listitem: ({ node, nodesToJSX, parent }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n if ('listType' in parent && parent?.listType === 'check') {\n const uuid = uuidv4()\n\n return (\n <li\n aria-checked={node.checked ? 'true' : 'false'}\n className={`list-item-checkbox${node.checked ? ' list-item-checkbox-checked' : ' list-item-checkbox-unchecked'}${hasSubLists ? ' nestedListItem' : ''}`}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"checkbox\"\n style={{ listStyleType: 'none' }}\n tabIndex={-1}\n value={node?.value}\n >\n {hasSubLists ? (\n children\n ) : (\n <>\n <input checked={node.checked} id={uuid} readOnly={true} type=\"checkbox\" />\n <label htmlFor={uuid}>{children}</label>\n <br />\n </>\n )}\n </li>\n )\n } else {\n return (\n <li\n className={`${hasSubLists ? 'nestedListItem' : ''}`}\n style={hasSubLists ? { listStyleType: 'none' } : undefined}\n value={node?.value}\n >\n {children}\n </li>\n )\n }\n },\n}\n"],"names":["v4","uuidv4","ListJSXConverter","list","node","nodesToJSX","children","nodes","NodeTag","tag","className","listType","listitem","parent","hasSubLists","some","child","type","uuid","li","aria-checked","checked","role","style","listStyleType","tabIndex","value","input","id","readOnly","label","htmlFor","br","undefined"],"mappings":"AAAA,SAASA,MAAMC,MAAM,QAAQ,OAAM;AAKnC,OAAO,MAAMC,mBAA+E;IAC1FC,MAAM,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QACzB,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,MAAME,UAAUJ,KAAKK,GAAG;QAExB,QAAQD,QAAQE,WAAW,CAAC,KAAK,EAAEN,MAAMO,UAAU,GAAGL,WAAWE;IACnE;IACAI,UAAU,CAAC,EAAER,IAAI,EAAEC,UAAU,EAAEQ,MAAM,EAAE;QACrC,MAAMC,cAAcV,KAAKE,QAAQ,CAACS,IAAI,CAAC,CAACC,QAAUA,MAAMC,IAAI,KAAK;QAEjE,MAAMX,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,IAAI,cAAcO,UAAUA,QAAQF,aAAa,SAAS;YACxD,MAAMO,OAAOjB;YAEb,QACGkB,GACCC,cAAchB,KAAKiB,OAAO,GAAG,SAAS,SACtCX,WAAW,CAAC,kBAAkB,EAAEN,KAAKiB,OAAO,GAAG,gCAAgC,kCAAkCP,cAAc,oBAAoB,IAAI,EACvJ,kFAAkF;YAClFQ,KAAK,WACLC,OAAO;gBAAEC,eAAe;YAAO,GAC/BC,UAAU,CAAC,GACXC,OAAOtB,MAAMsB,OACd;UACC,CAACZ,cACCR,aAEE;cACA,CAACqB,MAAMN,SAASjB,KAAKiB,OAAO,EAAEO,IAAIV,MAAMW,UAAU,MAAMZ,KAAK,YAAa;cAC1E,CAACa,MAAMC,SAASb,OAAOZ,WAAWwB,MAAM;cACxC,CAACE,IAAK;YACR,IACA;QACJ,EAAEb;QAEN,OAAO;YACL,QACGA,GACCT,WAAW,GAAGI,cAAc,mBAAmB,IAAI,EACnDS,OAAOT,cAAc;gBAAEU,eAAe;YAAO,IAAIS,WACjDP,OAAOtB,MAAMsB,OACd;UACC,CAACpB,SAAS;QACZ,EAAEa;QAEN;IACF;AACF,EAAC"}
@@ -1,29 +1,14 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
1
  export const ParagraphJSXConverter = {
3
2
  paragraph: ({ node, nodesToJSX })=>{
4
3
  const children = nodesToJSX({
5
4
  nodes: node.children
6
5
  });
7
6
  if (!children?.length) {
8
- return /*#__PURE__*/ _jsxDEV("p", {
9
- children: /*#__PURE__*/ _jsxDEV("br", {}, void 0, false, {
10
- fileName: "src/features/converters/lexicalToJSX/converter/converters/paragraph.tsx",
11
- lineNumber: 13,
12
- columnNumber: 11
13
- }, this)
14
- }, void 0, false, {
15
- fileName: "src/features/converters/lexicalToJSX/converter/converters/paragraph.tsx",
16
- lineNumber: 12,
17
- columnNumber: 9
18
- }, this);
7
+ return <p>
8
+ <br/>
9
+ </p>;
19
10
  }
20
- return /*#__PURE__*/ _jsxDEV("p", {
21
- children: children
22
- }, void 0, false, {
23
- fileName: "src/features/converters/lexicalToJSX/converter/converters/paragraph.tsx",
24
- lineNumber: 18,
25
- columnNumber: 12
26
- }, this);
11
+ return <p>{children}</p>;
27
12
  }
28
13
  };
29
14
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/paragraph.tsx"],"sourcesContent":["import type { SerializedParagraphNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const ParagraphJSXConverter: JSXConverters<SerializedParagraphNode> = {\n paragraph: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n if (!children?.length) {\n return (\n <p>\n <br />\n </p>\n )\n }\n\n return <p>{children}</p>\n },\n}\n"],"names":["ParagraphJSXConverter","paragraph","node","nodesToJSX","children","nodes","length","p","br"],"mappings":";AAGA,OAAO,MAAMA,wBAAgE;IAC3EC,WAAW,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAC9B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,IAAI,CAACA,UAAUE,QAAQ;YACrB,qBACE,QAACC;0BACC,cAAA,QAACC;;;;;;;;;;QAGP;QAEA,qBAAO,QAACD;sBAAGH;;;;;;IACb;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/paragraph.tsx"],"sourcesContent":["import type { SerializedParagraphNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const ParagraphJSXConverter: JSXConverters<SerializedParagraphNode> = {\n paragraph: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n if (!children?.length) {\n return (\n <p>\n <br />\n </p>\n )\n }\n\n return <p>{children}</p>\n },\n}\n"],"names":["ParagraphJSXConverter","paragraph","node","nodesToJSX","children","nodes","length","p","br"],"mappings":"AAGA,OAAO,MAAMA,wBAAgE;IAC3EC,WAAW,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAC9B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,IAAI,CAACA,UAAUE,QAAQ;YACrB,QACGC,EAAE;UACD,CAACC,IAAK;QACR,EAAED;QAEN;QAEA,QAAQA,GAAGH,WAAWG;IACxB;AACF,EAAC"}
@@ -1,33 +1,15 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
1
  export const TableJSXConverter = {
3
2
  table: ({ node, nodesToJSX })=>{
4
3
  const children = nodesToJSX({
5
4
  nodes: node.children
6
5
  });
7
- return /*#__PURE__*/ _jsxDEV("div", {
8
- className: "lexical-table-container",
9
- children: /*#__PURE__*/ _jsxDEV("table", {
10
- className: "lexical-table",
11
- style: {
12
- borderCollapse: 'collapse'
13
- },
14
- children: /*#__PURE__*/ _jsxDEV("tbody", {
15
- children: children
16
- }, void 0, false, {
17
- fileName: "src/features/converters/lexicalToJSX/converter/converters/table.tsx",
18
- lineNumber: 18,
19
- columnNumber: 11
20
- }, this)
21
- }, void 0, false, {
22
- fileName: "src/features/converters/lexicalToJSX/converter/converters/table.tsx",
23
- lineNumber: 17,
24
- columnNumber: 9
25
- }, this)
26
- }, void 0, false, {
27
- fileName: "src/features/converters/lexicalToJSX/converter/converters/table.tsx",
28
- lineNumber: 16,
29
- columnNumber: 7
30
- }, this);
6
+ return <div className="lexical-table-container">
7
+ <table className="lexical-table" style={{
8
+ borderCollapse: 'collapse'
9
+ }}>
10
+ <tbody>{children}</tbody>
11
+ </table>
12
+ </div>;
31
13
  },
32
14
  tablecell: ({ node, nodesToJSX })=>{
33
15
  const children = nodesToJSX({
@@ -45,31 +27,16 @@ export const TableJSXConverter = {
45
27
  // Note: JSX does not support setting attributes directly as strings, so you must convert the colSpan and rowSpan to numbers
46
28
  const colSpan = node.colSpan && node.colSpan > 1 ? node.colSpan : undefined;
47
29
  const rowSpan = node.rowSpan && node.rowSpan > 1 ? node.rowSpan : undefined;
48
- return /*#__PURE__*/ _jsxDEV(TagName, {
49
- className: `lexical-table-cell ${headerStateClass}`,
50
- colSpan: colSpan,
51
- // colSpan and rowSpan will only be added if they are not null
52
- rowSpan: rowSpan,
53
- style: style,
54
- children: children
55
- }, void 0, false, {
56
- fileName: "src/features/converters/lexicalToJSX/converter/converters/table.tsx",
57
- lineNumber: 41,
58
- columnNumber: 7
59
- }, this);
30
+ return <TagName className={`lexical-table-cell ${headerStateClass}`} colSpan={colSpan} // colSpan and rowSpan will only be added if they are not null
31
+ rowSpan={rowSpan} style={style}>
32
+ {children}
33
+ </TagName>;
60
34
  },
61
35
  tablerow: ({ node, nodesToJSX })=>{
62
36
  const children = nodesToJSX({
63
37
  nodes: node.children
64
38
  });
65
- return /*#__PURE__*/ _jsxDEV("tr", {
66
- className: "lexical-table-row",
67
- children: children
68
- }, void 0, false, {
69
- fileName: "src/features/converters/lexicalToJSX/converter/converters/table.tsx",
70
- lineNumber: 55,
71
- columnNumber: 12
72
- }, this);
39
+ return <tr className="lexical-table-row">{children}</tr>;
73
40
  }
74
41
  };
75
42
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/table.tsx"],"sourcesContent":["import type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const TableJSXConverter: JSXConverters<\n SerializedTableCellNode | SerializedTableNode | SerializedTableRowNode\n> = {\n table: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n return (\n <div className=\"lexical-table-container\">\n <table className=\"lexical-table\" style={{ borderCollapse: 'collapse' }}>\n <tbody>{children}</tbody>\n </table>\n </div>\n )\n },\n tablecell: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const TagName = node.headerState > 0 ? 'th' : 'td' // Use capital letter to denote a component\n const headerStateClass = `lexical-table-cell-header-${node.headerState}`\n const style = {\n backgroundColor: node.backgroundColor || undefined, // Use undefined to avoid setting the style property if not needed\n border: '1px solid #ccc',\n padding: '8px',\n }\n\n // Note: JSX does not support setting attributes directly as strings, so you must convert the colSpan and rowSpan to numbers\n const colSpan = node.colSpan && node.colSpan > 1 ? node.colSpan : undefined\n const rowSpan = node.rowSpan && node.rowSpan > 1 ? node.rowSpan : undefined\n\n return (\n <TagName\n className={`lexical-table-cell ${headerStateClass}`}\n colSpan={colSpan} // colSpan and rowSpan will only be added if they are not null\n rowSpan={rowSpan}\n style={style}\n >\n {children}\n </TagName>\n )\n },\n tablerow: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n return <tr className=\"lexical-table-row\">{children}</tr>\n },\n}\n"],"names":["TableJSXConverter","table","node","nodesToJSX","children","nodes","div","className","style","borderCollapse","tbody","tablecell","TagName","headerState","headerStateClass","backgroundColor","undefined","border","padding","colSpan","rowSpan","tablerow","tr"],"mappings":";AAOA,OAAO,MAAMA,oBAET;IACFC,OAAO,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAC1B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QACA,qBACE,QAACE;YAAIC,WAAU;sBACb,cAAA,QAACN;gBAAMM,WAAU;gBAAgBC,OAAO;oBAAEC,gBAAgB;gBAAW;0BACnE,cAAA,QAACC;8BAAON;;;;;;;;;;;;;;;;IAIhB;IACAO,WAAW,CAAC,EAAET,IAAI,EAAEC,UAAU,EAAE;QAC9B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,MAAMQ,UAAUV,KAAKW,WAAW,GAAG,IAAI,OAAO;QAAK,2CAA2C;QAC9F,MAAMC,mBAAmB,CAAC,0BAA0B,EAAEZ,KAAKW,WAAW,EAAE;QACxE,MAAML,QAAQ;YACZO,iBAAiBb,KAAKa,eAAe,IAAIC;YAAW,kEAAkE;YACtHC,QAAQ;YACRC,SAAS;QACX;QAEA,4HAA4H;QAC5H,MAAMC,UAAUjB,KAAKiB,OAAO,IAAIjB,KAAKiB,OAAO,GAAG,IAAIjB,KAAKiB,OAAO,GAAGH;QAClE,MAAMI,UAAUlB,KAAKkB,OAAO,IAAIlB,KAAKkB,OAAO,GAAG,IAAIlB,KAAKkB,OAAO,GAAGJ;QAElE,qBACE,QAACJ;YACCL,WAAW,CAAC,mBAAmB,EAAEO,kBAAkB;YACnDK,SAASA;YAAS,8DAA8D;YAChFC,SAASA;YACTZ,OAAOA;sBAENJ;;;;;;IAGP;IACAiB,UAAU,CAAC,EAAEnB,IAAI,EAAEC,UAAU,EAAE;QAC7B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QACA,qBAAO,QAACkB;YAAGf,WAAU;sBAAqBH;;;;;;IAC5C;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/table.tsx"],"sourcesContent":["import type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const TableJSXConverter: JSXConverters<\n SerializedTableCellNode | SerializedTableNode | SerializedTableRowNode\n> = {\n table: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n return (\n <div className=\"lexical-table-container\">\n <table className=\"lexical-table\" style={{ borderCollapse: 'collapse' }}>\n <tbody>{children}</tbody>\n </table>\n </div>\n )\n },\n tablecell: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n\n const TagName = node.headerState > 0 ? 'th' : 'td' // Use capital letter to denote a component\n const headerStateClass = `lexical-table-cell-header-${node.headerState}`\n const style = {\n backgroundColor: node.backgroundColor || undefined, // Use undefined to avoid setting the style property if not needed\n border: '1px solid #ccc',\n padding: '8px',\n }\n\n // Note: JSX does not support setting attributes directly as strings, so you must convert the colSpan and rowSpan to numbers\n const colSpan = node.colSpan && node.colSpan > 1 ? node.colSpan : undefined\n const rowSpan = node.rowSpan && node.rowSpan > 1 ? node.rowSpan : undefined\n\n return (\n <TagName\n className={`lexical-table-cell ${headerStateClass}`}\n colSpan={colSpan} // colSpan and rowSpan will only be added if they are not null\n rowSpan={rowSpan}\n style={style}\n >\n {children}\n </TagName>\n )\n },\n tablerow: ({ node, nodesToJSX }) => {\n const children = nodesToJSX({\n nodes: node.children,\n })\n return <tr className=\"lexical-table-row\">{children}</tr>\n },\n}\n"],"names":["TableJSXConverter","table","node","nodesToJSX","children","nodes","div","className","style","borderCollapse","tbody","tablecell","TagName","headerState","headerStateClass","backgroundColor","undefined","border","padding","colSpan","rowSpan","tablerow","tr"],"mappings":"AAOA,OAAO,MAAMA,oBAET;IACFC,OAAO,CAAC,EAAEC,IAAI,EAAEC,UAAU,EAAE;QAC1B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QACA,QACGE,IAAIC,UAAU,0BAA0B;QACvC,CAACN,MAAMM,UAAU,gBAAgBC,OAAO;YAAEC,gBAAgB;QAAW,GAAG;UACtE,CAACC,OAAON,WAAWM,MAAM;QAC3B,EAAET,MAAM;MACV,EAAEK;IAEN;IACAK,WAAW,CAAC,EAAET,IAAI,EAAEC,UAAU,EAAE;QAC9B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QAEA,MAAMQ,UAAUV,KAAKW,WAAW,GAAG,IAAI,OAAO;QAAK,2CAA2C;QAC9F,MAAMC,mBAAmB,CAAC,0BAA0B,EAAEZ,KAAKW,WAAW,EAAE;QACxE,MAAML,QAAQ;YACZO,iBAAiBb,KAAKa,eAAe,IAAIC;YAAW,kEAAkE;YACtHC,QAAQ;YACRC,SAAS;QACX;QAEA,4HAA4H;QAC5H,MAAMC,UAAUjB,KAAKiB,OAAO,IAAIjB,KAAKiB,OAAO,GAAG,IAAIjB,KAAKiB,OAAO,GAAGH;QAClE,MAAMI,UAAUlB,KAAKkB,OAAO,IAAIlB,KAAKkB,OAAO,GAAG,IAAIlB,KAAKkB,OAAO,GAAGJ;QAElE,QACGJ,QACCL,WAAW,CAAC,mBAAmB,EAAEO,kBAAkB,EACnDK,SAASA,SAAS,8DAA8D;QAChFC,SAASA,SACTZ,OAAOA,OACR;QACC,CAACJ,SAAS;MACZ,EAAEQ;IAEN;IACAS,UAAU,CAAC,EAAEnB,IAAI,EAAEC,UAAU,EAAE;QAC7B,MAAMC,WAAWD,WAAW;YAC1BE,OAAOH,KAAKE,QAAQ;QACtB;QACA,QAAQkB,GAAGf,UAAU,qBAAqBH,WAAWkB;IACvD;AACF,EAAC"}
@@ -1,77 +1,31 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
- import React from 'react';
3
1
  import { NodeFormat } from '../../../../../lexical/utils/nodeFormat.js';
4
2
  export const TextJSXConverter = {
5
3
  text: ({ node })=>{
6
4
  let text = node.text;
7
5
  if (node.format & NodeFormat.IS_BOLD) {
8
- text = /*#__PURE__*/ _jsxDEV("strong", {
9
- children: text
10
- }, void 0, false, {
11
- fileName: "src/features/converters/lexicalToJSX/converter/converters/text.tsx",
12
- lineNumber: 13,
13
- columnNumber: 14
14
- }, this);
6
+ text = <strong>{text}</strong>;
15
7
  }
16
8
  if (node.format & NodeFormat.IS_ITALIC) {
17
- text = /*#__PURE__*/ _jsxDEV("em", {
18
- children: text
19
- }, void 0, false, {
20
- fileName: "src/features/converters/lexicalToJSX/converter/converters/text.tsx",
21
- lineNumber: 16,
22
- columnNumber: 14
23
- }, this);
9
+ text = <em>{text}</em>;
24
10
  }
25
11
  if (node.format & NodeFormat.IS_STRIKETHROUGH) {
26
- text = /*#__PURE__*/ _jsxDEV("span", {
27
- style: {
28
- textDecoration: 'line-through'
29
- },
30
- children: text
31
- }, void 0, false, {
32
- fileName: "src/features/converters/lexicalToJSX/converter/converters/text.tsx",
33
- lineNumber: 19,
34
- columnNumber: 14
35
- }, this);
12
+ text = <span style={{
13
+ textDecoration: 'line-through'
14
+ }}>{text}</span>;
36
15
  }
37
16
  if (node.format & NodeFormat.IS_UNDERLINE) {
38
- text = /*#__PURE__*/ _jsxDEV("span", {
39
- style: {
40
- textDecoration: 'underline'
41
- },
42
- children: text
43
- }, void 0, false, {
44
- fileName: "src/features/converters/lexicalToJSX/converter/converters/text.tsx",
45
- lineNumber: 22,
46
- columnNumber: 14
47
- }, this);
17
+ text = <span style={{
18
+ textDecoration: 'underline'
19
+ }}>{text}</span>;
48
20
  }
49
21
  if (node.format & NodeFormat.IS_CODE) {
50
- text = /*#__PURE__*/ _jsxDEV("code", {
51
- children: text
52
- }, void 0, false, {
53
- fileName: "src/features/converters/lexicalToJSX/converter/converters/text.tsx",
54
- lineNumber: 25,
55
- columnNumber: 14
56
- }, this);
22
+ text = <code>{text}</code>;
57
23
  }
58
24
  if (node.format & NodeFormat.IS_SUBSCRIPT) {
59
- text = /*#__PURE__*/ _jsxDEV("sub", {
60
- children: text
61
- }, void 0, false, {
62
- fileName: "src/features/converters/lexicalToJSX/converter/converters/text.tsx",
63
- lineNumber: 28,
64
- columnNumber: 14
65
- }, this);
25
+ text = <sub>{text}</sub>;
66
26
  }
67
27
  if (node.format & NodeFormat.IS_SUPERSCRIPT) {
68
- text = /*#__PURE__*/ _jsxDEV("sup", {
69
- children: text
70
- }, void 0, false, {
71
- fileName: "src/features/converters/lexicalToJSX/converter/converters/text.tsx",
72
- lineNumber: 31,
73
- columnNumber: 14
74
- }, this);
28
+ text = <sup>{text}</sup>;
75
29
  }
76
30
  return text;
77
31
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/text.tsx"],"sourcesContent":["import React from 'react'\n\nimport type { SerializedTextNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nimport { NodeFormat } from '../../../../../lexical/utils/nodeFormat.js'\n\nexport const TextJSXConverter: JSXConverters<SerializedTextNode> = {\n text: ({ node }) => {\n let text: React.ReactNode = node.text\n\n if (node.format & NodeFormat.IS_BOLD) {\n text = <strong>{text}</strong>\n }\n if (node.format & NodeFormat.IS_ITALIC) {\n text = <em>{text}</em>\n }\n if (node.format & NodeFormat.IS_STRIKETHROUGH) {\n text = <span style={{ textDecoration: 'line-through' }}>{text}</span>\n }\n if (node.format & NodeFormat.IS_UNDERLINE) {\n text = <span style={{ textDecoration: 'underline' }}>{text}</span>\n }\n if (node.format & NodeFormat.IS_CODE) {\n text = <code>{text}</code>\n }\n if (node.format & NodeFormat.IS_SUBSCRIPT) {\n text = <sub>{text}</sub>\n }\n if (node.format & NodeFormat.IS_SUPERSCRIPT) {\n text = <sup>{text}</sup>\n }\n\n return text\n },\n}\n"],"names":["React","NodeFormat","TextJSXConverter","text","node","format","IS_BOLD","strong","IS_ITALIC","em","IS_STRIKETHROUGH","span","style","textDecoration","IS_UNDERLINE","IS_CODE","code","IS_SUBSCRIPT","sub","IS_SUPERSCRIPT","sup"],"mappings":";AAAA,OAAOA,WAAW,QAAO;AAKzB,SAASC,UAAU,QAAQ,6CAA4C;AAEvE,OAAO,MAAMC,mBAAsD;IACjEC,MAAM,CAAC,EAAEC,IAAI,EAAE;QACb,IAAID,OAAwBC,KAAKD,IAAI;QAErC,IAAIC,KAAKC,MAAM,GAAGJ,WAAWK,OAAO,EAAE;YACpCH,qBAAO,QAACI;0BAAQJ;;;;;;QAClB;QACA,IAAIC,KAAKC,MAAM,GAAGJ,WAAWO,SAAS,EAAE;YACtCL,qBAAO,QAACM;0BAAIN;;;;;;QACd;QACA,IAAIC,KAAKC,MAAM,GAAGJ,WAAWS,gBAAgB,EAAE;YAC7CP,qBAAO,QAACQ;gBAAKC,OAAO;oBAAEC,gBAAgB;gBAAe;0BAAIV;;;;;;QAC3D;QACA,IAAIC,KAAKC,MAAM,GAAGJ,WAAWa,YAAY,EAAE;YACzCX,qBAAO,QAACQ;gBAAKC,OAAO;oBAAEC,gBAAgB;gBAAY;0BAAIV;;;;;;QACxD;QACA,IAAIC,KAAKC,MAAM,GAAGJ,WAAWc,OAAO,EAAE;YACpCZ,qBAAO,QAACa;0BAAMb;;;;;;QAChB;QACA,IAAIC,KAAKC,MAAM,GAAGJ,WAAWgB,YAAY,EAAE;YACzCd,qBAAO,QAACe;0BAAKf;;;;;;QACf;QACA,IAAIC,KAAKC,MAAM,GAAGJ,WAAWkB,cAAc,EAAE;YAC3ChB,qBAAO,QAACiB;0BAAKjB;;;;;;QACf;QAEA,OAAOA;IACT;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/text.tsx"],"sourcesContent":["import React from 'react'\n\nimport type { SerializedTextNode } from '../../../../../nodeTypes.js'\nimport type { JSXConverters } from '../types.js'\n\nimport { NodeFormat } from '../../../../../lexical/utils/nodeFormat.js'\n\nexport const TextJSXConverter: JSXConverters<SerializedTextNode> = {\n text: ({ node }) => {\n let text: React.ReactNode = node.text\n\n if (node.format & NodeFormat.IS_BOLD) {\n text = <strong>{text}</strong>\n }\n if (node.format & NodeFormat.IS_ITALIC) {\n text = <em>{text}</em>\n }\n if (node.format & NodeFormat.IS_STRIKETHROUGH) {\n text = <span style={{ textDecoration: 'line-through' }}>{text}</span>\n }\n if (node.format & NodeFormat.IS_UNDERLINE) {\n text = <span style={{ textDecoration: 'underline' }}>{text}</span>\n }\n if (node.format & NodeFormat.IS_CODE) {\n text = <code>{text}</code>\n }\n if (node.format & NodeFormat.IS_SUBSCRIPT) {\n text = <sub>{text}</sub>\n }\n if (node.format & NodeFormat.IS_SUPERSCRIPT) {\n text = <sup>{text}</sup>\n }\n\n return text\n },\n}\n"],"names":["NodeFormat","TextJSXConverter","text","node","format","IS_BOLD","strong","IS_ITALIC","em","IS_STRIKETHROUGH","span","style","textDecoration","IS_UNDERLINE","IS_CODE","code","IS_SUBSCRIPT","sub","IS_SUPERSCRIPT","sup"],"mappings":"AAKA,SAASA,UAAU,QAAQ,6CAA4C;AAEvE,OAAO,MAAMC,mBAAsD;IACjEC,MAAM,CAAC,EAAEC,IAAI,EAAE;QACb,IAAID,OAAwBC,KAAKD,IAAI;QAErC,IAAIC,KAAKC,MAAM,GAAGJ,WAAWK,OAAO,EAAE;YACpCH,QAAQI,QAAQJ,OAAOI;QACzB;QACA,IAAIH,KAAKC,MAAM,GAAGJ,WAAWO,SAAS,EAAE;YACtCL,QAAQM,IAAIN,OAAOM;QACrB;QACA,IAAIL,KAAKC,MAAM,GAAGJ,WAAWS,gBAAgB,EAAE;YAC7CP,QAAQQ,KAAKC,OAAO;gBAAEC,gBAAgB;YAAe,IAAIV,OAAOQ;QAClE;QACA,IAAIP,KAAKC,MAAM,GAAGJ,WAAWa,YAAY,EAAE;YACzCX,QAAQQ,KAAKC,OAAO;gBAAEC,gBAAgB;YAAY,IAAIV,OAAOQ;QAC/D;QACA,IAAIP,KAAKC,MAAM,GAAGJ,WAAWc,OAAO,EAAE;YACpCZ,QAAQa,MAAMb,OAAOa;QACvB;QACA,IAAIZ,KAAKC,MAAM,GAAGJ,WAAWgB,YAAY,EAAE;YACzCd,QAAQe,KAAKf,OAAOe;QACtB;QACA,IAAId,KAAKC,MAAM,GAAGJ,WAAWkB,cAAc,EAAE;YAC3ChB,QAAQiB,KAAKjB,OAAOiB;QACtB;QAEA,OAAOjB;IACT;AACF,EAAC"}