@payloadcms/richtext-lexical 3.85.0 → 4.0.0-canary.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (934) hide show
  1. package/dist/cell/rscEntry.d.ts +1 -1
  2. package/dist/cell/rscEntry.d.ts.map +1 -1
  3. package/dist/cell/rscEntry.js.map +1 -1
  4. package/dist/exports/client/Field-G5Z2HM5Y.js +2 -0
  5. package/dist/exports/client/Field-G5Z2HM5Y.js.map +7 -0
  6. package/dist/exports/client/RelationshipComponent-RZL743CS.js +2 -0
  7. package/dist/exports/client/RelationshipComponent-RZL743CS.js.map +7 -0
  8. package/dist/exports/client/bundled.css +1 -1
  9. package/dist/exports/client/chunk-5VIL27GI.js +2 -0
  10. package/dist/exports/client/chunk-5VIL27GI.js.map +7 -0
  11. package/dist/exports/client/{chunk-FTT5KJ6W.js → chunk-LH634DPU.js} +1 -1
  12. package/dist/exports/client/chunk-LH634DPU.js.map +7 -0
  13. package/dist/exports/client/{chunk-BZZVLW4U.js → chunk-RJ5MAOKZ.js} +1 -1
  14. package/dist/exports/client/chunk-RJ5MAOKZ.js.map +7 -0
  15. package/dist/exports/client/chunk-UD4DQ4AK.js +2 -0
  16. package/dist/exports/client/chunk-UD4DQ4AK.js.map +7 -0
  17. package/dist/exports/client/chunk-WSAPGI3Z.js +2 -0
  18. package/dist/exports/client/chunk-WSAPGI3Z.js.map +7 -0
  19. package/dist/exports/client/chunk-XIJE2UCQ.js +2 -0
  20. package/dist/exports/client/chunk-XIJE2UCQ.js.map +7 -0
  21. package/dist/exports/client/component-KESPRYJR.js +2 -0
  22. package/dist/exports/client/component-KESPRYJR.js.map +7 -0
  23. package/dist/exports/client/componentInline-R2RSJX4K.js +2 -0
  24. package/dist/exports/client/index.d.ts +0 -2
  25. package/dist/exports/client/index.d.ts.map +1 -1
  26. package/dist/exports/client/index.js +30 -30
  27. package/dist/exports/client/index.js.map +4 -4
  28. package/dist/exports/react/index.d.ts +1 -1
  29. package/dist/exports/react/index.d.ts.map +1 -1
  30. package/dist/exports/react/index.js.map +1 -1
  31. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  32. package/dist/features/align/client/toolbarAlignGroup.js +1 -0
  33. package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
  34. package/dist/features/blockquote/server/index.d.ts +1 -1
  35. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  36. package/dist/features/blockquote/server/index.js +0 -39
  37. package/dist/features/blockquote/server/index.js.map +1 -1
  38. package/dist/features/blocks/client/component/BlockContent.d.ts +10 -0
  39. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  40. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  41. package/dist/features/blocks/client/component/index.css +178 -0
  42. package/dist/features/blocks/client/component/index.d.ts +3 -2
  43. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  44. package/dist/features/blocks/client/component/index.js +88 -24
  45. package/dist/features/blocks/client/component/index.js.map +1 -1
  46. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  47. package/dist/features/blocks/client/componentInline/index.css +85 -0
  48. package/dist/features/blocks/client/componentInline/index.d.ts +3 -2
  49. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  50. package/dist/features/blocks/client/componentInline/index.js +33 -13
  51. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  52. package/dist/features/blocks/client/index.d.ts.map +1 -1
  53. package/dist/features/blocks/client/index.js +0 -2
  54. package/dist/features/blocks/client/index.js.map +1 -1
  55. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  56. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +1 -1
  57. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  58. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  59. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +1 -1
  60. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  61. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  62. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts +1 -1
  63. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
  64. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +3 -0
  65. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  66. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +26 -0
  67. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts +1 -1
  68. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts.map +1 -1
  69. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +4 -1
  70. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
  71. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +40 -0
  72. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts +1 -1
  73. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts.map +1 -1
  74. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +7 -8
  75. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
  76. package/dist/features/blocks/premade/CodeBlock/Component/index.css +171 -0
  77. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  78. package/dist/features/blocks/server/index.js +1 -1
  79. package/dist/features/blocks/server/index.js.map +1 -1
  80. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  81. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -1
  82. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  83. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  84. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +1 -1
  85. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  86. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  87. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  88. package/dist/features/converters/htmlToLexical/index.d.ts +1 -1
  89. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  90. package/dist/features/converters/htmlToLexical/index.js.map +1 -1
  91. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts +1 -1
  92. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts.map +1 -1
  93. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.js.map +1 -1
  94. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts +1 -1
  95. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
  96. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  97. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts +1 -1
  98. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts.map +1 -1
  99. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.js.map +1 -1
  100. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts +1 -1
  101. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts.map +1 -1
  102. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.js.map +1 -1
  103. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts +1 -1
  104. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
  105. package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
  106. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts +1 -1
  107. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  108. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  109. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts +1 -1
  110. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts.map +1 -1
  111. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.js.map +1 -1
  112. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts +1 -1
  113. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts.map +1 -1
  114. package/dist/features/converters/lexicalToHtml/async/converters/tab.js.map +1 -1
  115. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts +1 -1
  116. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
  117. package/dist/features/converters/lexicalToHtml/async/converters/table.js +1 -1
  118. package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
  119. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts +1 -1
  120. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
  121. package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
  122. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts +1 -1
  123. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
  124. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  125. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts +1 -1
  126. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts.map +1 -1
  127. package/dist/features/converters/lexicalToHtml/async/defaultConverters.js.map +1 -1
  128. package/dist/features/converters/lexicalToHtml/async/types.d.ts +1 -1
  129. package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
  130. package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
  131. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  132. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  133. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts +1 -1
  134. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts.map +1 -1
  135. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.js.map +1 -1
  136. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts +1 -1
  137. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
  138. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  139. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts +1 -1
  140. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts.map +1 -1
  141. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.js.map +1 -1
  142. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts +1 -1
  143. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts.map +1 -1
  144. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.js.map +1 -1
  145. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts +1 -1
  146. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
  147. package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
  148. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts +1 -1
  149. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  150. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  151. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts +1 -1
  152. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts.map +1 -1
  153. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.js.map +1 -1
  154. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts +1 -1
  155. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts.map +1 -1
  156. package/dist/features/converters/lexicalToHtml/sync/converters/tab.js.map +1 -1
  157. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts +1 -1
  158. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
  159. package/dist/features/converters/lexicalToHtml/sync/converters/table.js +1 -1
  160. package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
  161. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts +1 -1
  162. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
  163. package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
  164. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts +1 -1
  165. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
  166. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  167. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts +1 -1
  168. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts.map +1 -1
  169. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.js.map +1 -1
  170. package/dist/features/converters/lexicalToHtml/sync/types.d.ts +1 -1
  171. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  172. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  173. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +2 -2
  174. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  175. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  176. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts +1 -1
  177. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts.map +1 -1
  178. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
  179. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts +1 -1
  180. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  181. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  182. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts +1 -1
  183. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts.map +1 -1
  184. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
  185. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts +1 -1
  186. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts.map +1 -1
  187. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
  188. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts +1 -1
  189. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts.map +1 -1
  190. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
  191. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts +1 -1
  192. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  193. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  194. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts +1 -1
  195. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts.map +1 -1
  196. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
  197. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts +1 -1
  198. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts.map +1 -1
  199. package/dist/features/converters/lexicalToJSX/converter/converters/tab.js.map +1 -1
  200. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts +1 -1
  201. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts.map +1 -1
  202. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
  203. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts +1 -1
  204. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts.map +1 -1
  205. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
  206. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts +1 -1
  207. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  208. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  209. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts +1 -1
  210. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts.map +1 -1
  211. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.js.map +1 -1
  212. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +1 -1
  213. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  214. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  215. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +1 -1
  216. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  217. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  218. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  219. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +1 -1
  220. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js.map +1 -1
  221. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +1 -1
  222. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
  223. package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
  224. package/dist/features/converters/markdownToLexical/index.d.ts +1 -1
  225. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  226. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  227. package/dist/features/debug/jsxConverter/client/plugin/index.d.ts +1 -1
  228. package/dist/features/debug/jsxConverter/client/plugin/index.d.ts.map +1 -1
  229. package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -0
  230. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  231. package/dist/features/debug/jsxConverter/client/plugin/style.css +9 -0
  232. package/dist/features/debug/testRecorder/client/plugin/index.css +51 -0
  233. package/dist/features/debug/testRecorder/client/plugin/index.d.ts +1 -1
  234. package/dist/features/debug/testRecorder/client/plugin/index.d.ts.map +1 -1
  235. package/dist/features/debug/testRecorder/client/plugin/index.js +1 -0
  236. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  237. package/dist/features/debug/treeView/client/plugin/index.css +81 -0
  238. package/dist/features/debug/treeView/client/plugin/index.d.ts +1 -1
  239. package/dist/features/debug/treeView/client/plugin/index.d.ts.map +1 -1
  240. package/dist/features/debug/treeView/client/plugin/index.js +1 -0
  241. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  242. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +91 -0
  243. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts +1 -1
  244. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  245. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +3 -2
  246. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  247. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.css +11 -0
  248. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts +1 -1
  249. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  250. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +1 -0
  251. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  252. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +1 -1
  253. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  254. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +166 -0
  255. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts +17 -0
  256. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  257. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js +219 -0
  258. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  259. package/dist/features/experimental_table/client/plugins/TablePlugin/index.css +235 -0
  260. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
  261. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  262. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +95 -104
  263. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  264. package/dist/features/experimental_table/server/index.d.ts +1 -1
  265. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  266. package/dist/features/experimental_table/server/index.js +0 -102
  267. package/dist/features/experimental_table/server/index.js.map +1 -1
  268. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  269. package/dist/features/heading/server/index.d.ts +1 -1
  270. package/dist/features/heading/server/index.d.ts.map +1 -1
  271. package/dist/features/heading/server/index.js +0 -39
  272. package/dist/features/heading/server/index.js.map +1 -1
  273. package/dist/features/horizontalRule/client/plugin/index.css +25 -0
  274. package/dist/features/horizontalRule/client/plugin/index.d.ts +1 -1
  275. package/dist/features/horizontalRule/client/plugin/index.d.ts.map +1 -1
  276. package/dist/features/horizontalRule/client/plugin/index.js +73 -4
  277. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  278. package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
  279. package/dist/features/horizontalRule/server/index.js +0 -8
  280. package/dist/features/horizontalRule/server/index.js.map +1 -1
  281. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  282. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  283. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  284. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  285. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  286. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  287. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +28 -8
  288. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  289. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +112 -0
  290. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts +1 -1
  291. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  292. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -0
  293. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  294. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  295. package/dist/features/link/nodes/types.d.ts +1 -1
  296. package/dist/features/link/nodes/types.d.ts.map +1 -1
  297. package/dist/features/link/nodes/types.js.map +1 -1
  298. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  299. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  300. package/dist/features/link/server/index.d.ts.map +1 -1
  301. package/dist/features/link/server/index.js +0 -71
  302. package/dist/features/link/server/index.js.map +1 -1
  303. package/dist/features/link/server/validate.d.ts.map +1 -1
  304. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  305. package/dist/features/lists/checklist/server/index.js +0 -7
  306. package/dist/features/lists/checklist/server/index.js.map +1 -1
  307. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  308. package/dist/features/lists/orderedList/server/index.js +0 -7
  309. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  310. package/dist/features/lists/plugin/index.d.ts +1 -1
  311. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  312. package/dist/features/lists/plugin/index.js.map +1 -1
  313. package/dist/features/lists/shared/markdown.d.ts.map +1 -1
  314. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  315. package/dist/features/lists/unorderedList/server/index.js +0 -7
  316. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  317. package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
  318. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  319. package/dist/features/relationship/client/components/RelationshipComponent.js +29 -4
  320. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  321. package/dist/features/relationship/client/components/index.css +112 -0
  322. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  323. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  324. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  325. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -1
  326. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  327. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  328. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  329. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  330. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  331. package/dist/features/toolbars/fixed/client/Toolbar/index.css +87 -0
  332. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts +1 -1
  333. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  334. package/dist/features/toolbars/fixed/client/Toolbar/index.js +1 -0
  335. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  336. package/dist/features/toolbars/inline/client/Toolbar/index.css +43 -0
  337. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts +1 -1
  338. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  339. package/dist/features/toolbars/inline/client/Toolbar/index.js +1 -0
  340. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  341. package/dist/features/toolbars/shared/ToolbarButton/index.css +57 -0
  342. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  343. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  344. package/dist/features/toolbars/shared/ToolbarButton/index.js +80 -74
  345. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  346. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  347. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +5 -2
  348. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  349. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +214 -0
  350. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  351. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  352. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +11 -7
  353. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  354. package/dist/features/toolbars/types.d.ts +5 -1
  355. package/dist/features/toolbars/types.d.ts.map +1 -1
  356. package/dist/features/toolbars/types.js.map +1 -1
  357. package/dist/features/typesClient.d.ts +1 -1
  358. package/dist/features/typesClient.d.ts.map +1 -1
  359. package/dist/features/typesClient.js.map +1 -1
  360. package/dist/features/typesServer.d.ts +3 -20
  361. package/dist/features/typesServer.d.ts.map +1 -1
  362. package/dist/features/typesServer.js.map +1 -1
  363. package/dist/features/upload/client/component/index.css +214 -0
  364. package/dist/features/upload/client/component/index.d.ts +1 -1
  365. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  366. package/dist/features/upload/client/component/index.js +86 -63
  367. package/dist/features/upload/client/component/index.js.map +1 -1
  368. package/dist/features/upload/client/component/pending/index.d.ts +0 -1
  369. package/dist/features/upload/client/component/pending/index.d.ts.map +1 -1
  370. package/dist/features/upload/client/component/pending/index.js.map +1 -1
  371. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  372. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  373. package/dist/features/upload/server/index.d.ts.map +1 -1
  374. package/dist/features/upload/server/index.js +0 -78
  375. package/dist/features/upload/server/index.js.map +1 -1
  376. package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -1
  377. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  378. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  379. package/dist/features/upload/server/validate.d.ts.map +1 -1
  380. package/dist/field/Diff/converters/link.d.ts +1 -1
  381. package/dist/field/Diff/converters/link.d.ts.map +1 -1
  382. package/dist/field/Diff/converters/link.js.map +1 -1
  383. package/dist/field/Diff/converters/listitem/index.css +80 -0
  384. package/dist/field/Diff/converters/listitem/index.d.ts +2 -2
  385. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  386. package/dist/field/Diff/converters/listitem/index.js +1 -0
  387. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  388. package/dist/field/Diff/converters/relationship/index.css +108 -0
  389. package/dist/field/Diff/converters/relationship/index.d.ts +2 -2
  390. package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
  391. package/dist/field/Diff/converters/relationship/index.js +11 -28
  392. package/dist/field/Diff/converters/relationship/index.js.map +1 -1
  393. package/dist/field/Diff/converters/unknown/index.css +37 -0
  394. package/dist/field/Diff/converters/unknown/index.d.ts +1 -1
  395. package/dist/field/Diff/converters/unknown/index.d.ts.map +1 -1
  396. package/dist/field/Diff/converters/unknown/index.js +1 -0
  397. package/dist/field/Diff/converters/unknown/index.js.map +1 -1
  398. package/dist/field/Diff/converters/upload/index.css +175 -0
  399. package/dist/field/Diff/converters/upload/index.d.ts +2 -2
  400. package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
  401. package/dist/field/Diff/converters/upload/index.js +7 -2
  402. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  403. package/dist/field/Diff/index.css +156 -0
  404. package/dist/field/Diff/index.d.ts +1 -1
  405. package/dist/field/Diff/index.d.ts.map +1 -1
  406. package/dist/field/Diff/index.js +1 -0
  407. package/dist/field/Diff/index.js.map +1 -1
  408. package/dist/field/Field.d.ts +3 -3
  409. package/dist/field/Field.d.ts.map +1 -1
  410. package/dist/field/Field.js +12 -11
  411. package/dist/field/Field.js.map +1 -1
  412. package/dist/field/RenderLexical/index.d.ts +2 -2
  413. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  414. package/dist/field/RenderLexical/index.js.map +1 -1
  415. package/dist/field/RichTextViewProvider.d.ts +1 -1
  416. package/dist/field/RichTextViewProvider.d.ts.map +1 -1
  417. package/dist/field/RichTextViewProvider.js.map +1 -1
  418. package/dist/field/ViewSelector.css +32 -0
  419. package/dist/field/ViewSelector.d.ts +1 -1
  420. package/dist/field/ViewSelector.d.ts.map +1 -1
  421. package/dist/field/ViewSelector.js +1 -0
  422. package/dist/field/ViewSelector.js.map +1 -1
  423. package/dist/field/bundled.css +1 -1
  424. package/dist/field/index.css +60 -0
  425. package/dist/field/index.d.ts +1 -1
  426. package/dist/field/index.d.ts.map +1 -1
  427. package/dist/field/index.js.map +1 -1
  428. package/dist/field/rscEntry.d.ts +1 -1
  429. package/dist/field/rscEntry.d.ts.map +1 -1
  430. package/dist/field/rscEntry.js.map +1 -1
  431. package/dist/hooks.d.ts +6 -0
  432. package/dist/hooks.d.ts.map +1 -0
  433. package/dist/hooks.js +548 -0
  434. package/dist/hooks.js.map +1 -0
  435. package/dist/index.d.ts +3 -13
  436. package/dist/index.d.ts.map +1 -1
  437. package/dist/index.js +20 -628
  438. package/dist/index.js.map +1 -1
  439. package/dist/lexical/LexicalEditor.css +50 -0
  440. package/dist/lexical/LexicalEditor.d.ts +1 -1
  441. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  442. package/dist/lexical/LexicalEditor.js +1 -0
  443. package/dist/lexical/LexicalEditor.js.map +1 -1
  444. package/dist/lexical/LexicalProvider.d.ts +1 -1
  445. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  446. package/dist/lexical/LexicalProvider.js.map +1 -1
  447. package/dist/lexical/config/client/EditorConfigProvider.d.ts +1 -1
  448. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  449. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  450. package/dist/lexical/config/client/loader.d.ts +1 -1
  451. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  452. package/dist/lexical/config/client/loader.js.map +1 -1
  453. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  454. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  455. package/dist/lexical/config/client/sanitize.js.map +1 -1
  456. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  457. package/dist/lexical/config/server/loader.js +12 -9
  458. package/dist/lexical/config/server/loader.js.map +1 -1
  459. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  460. package/dist/lexical/config/server/sanitize.js +3 -9
  461. package/dist/lexical/config/server/sanitize.js.map +1 -1
  462. package/dist/lexical/config/types.d.ts +1 -1
  463. package/dist/lexical/config/types.d.ts.map +1 -1
  464. package/dist/lexical/config/types.js.map +1 -1
  465. package/dist/lexical/nodes/index.d.ts +1 -1
  466. package/dist/lexical/nodes/index.d.ts.map +1 -1
  467. package/dist/lexical/nodes/index.js.map +1 -1
  468. package/dist/lexical/plugins/DecoratorPlugin/index.css +11 -0
  469. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts +1 -1
  470. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  471. package/dist/lexical/plugins/DecoratorPlugin/index.js +1 -0
  472. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  473. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +52 -0
  474. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts +1 -1
  475. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  476. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +1 -0
  477. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  478. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +1 -1
  479. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  480. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  481. package/dist/lexical/plugins/SlashMenu/index.css +65 -0
  482. package/dist/lexical/plugins/SlashMenu/index.d.ts +1 -1
  483. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  484. package/dist/lexical/plugins/SlashMenu/index.js +2 -0
  485. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  486. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +40 -0
  487. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +1 -1
  488. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  489. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +1 -0
  490. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  491. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  492. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +84 -0
  493. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +1 -1
  494. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  495. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +15 -8
  496. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  497. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +1 -1
  498. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  499. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  500. package/dist/lexical/theme/EditorTheme.css +359 -0
  501. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  502. package/dist/lexical/theme/EditorTheme.js +1 -0
  503. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  504. package/dist/lexical/ui/ContentEditable.css +95 -0
  505. package/dist/lexical/ui/ContentEditable.d.ts +1 -1
  506. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  507. package/dist/lexical/ui/ContentEditable.js +1 -0
  508. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  509. package/dist/lexical/ui/icons/Add/index.d.ts +4 -1
  510. package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
  511. package/dist/lexical/ui/icons/Add/index.js +19 -12
  512. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  513. package/dist/lexical/ui/icons/Add/index.svg +2 -3
  514. package/dist/lexical/ui/icons/Add/light.svg +2 -3
  515. package/dist/lexical/ui/icons/AlignCenter/index.d.ts +3 -1
  516. package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
  517. package/dist/lexical/ui/icons/AlignCenter/index.js +15 -19
  518. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  519. package/dist/lexical/ui/icons/AlignJustify/index.d.ts +3 -1
  520. package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
  521. package/dist/lexical/ui/icons/AlignJustify/index.js +15 -19
  522. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  523. package/dist/lexical/ui/icons/AlignLeft/index.d.ts +3 -1
  524. package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
  525. package/dist/lexical/ui/icons/AlignLeft/index.js +15 -19
  526. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  527. package/dist/lexical/ui/icons/AlignRight/index.d.ts +3 -1
  528. package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
  529. package/dist/lexical/ui/icons/AlignRight/index.js +15 -19
  530. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  531. package/dist/lexical/ui/icons/Block/index.d.ts +3 -1
  532. package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
  533. package/dist/lexical/ui/icons/Block/index.js +13 -28
  534. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  535. package/dist/lexical/ui/icons/Blockquote/index.d.ts +3 -1
  536. package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
  537. package/dist/lexical/ui/icons/Blockquote/index.js +9 -6
  538. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  539. package/dist/lexical/ui/icons/Bold/index.d.ts +3 -1
  540. package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
  541. package/dist/lexical/ui/icons/Bold/index.js +13 -8
  542. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  543. package/dist/lexical/ui/icons/Checklist/index.d.ts +4 -1
  544. package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
  545. package/dist/lexical/ui/icons/Checklist/index.js +17 -18
  546. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  547. package/dist/lexical/ui/icons/Code/index.d.ts +3 -1
  548. package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
  549. package/dist/lexical/ui/icons/Code/index.js +15 -13
  550. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  551. package/dist/lexical/ui/icons/CodeBlock/index.d.ts +4 -1
  552. package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
  553. package/dist/lexical/ui/icons/CodeBlock/index.js +18 -7
  554. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  555. package/dist/lexical/ui/icons/Collapse/index.d.ts +3 -1
  556. package/dist/lexical/ui/icons/Collapse/index.d.ts.map +1 -1
  557. package/dist/lexical/ui/icons/Collapse/index.js +10 -8
  558. package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
  559. package/dist/lexical/ui/icons/DraggableBlock/index.svg +7 -7
  560. package/dist/lexical/ui/icons/DraggableBlock/light.svg +7 -7
  561. package/dist/lexical/ui/icons/Expand/index.d.ts +5 -0
  562. package/dist/lexical/ui/icons/Expand/index.d.ts.map +1 -0
  563. package/dist/lexical/ui/icons/Expand/index.js +22 -0
  564. package/dist/lexical/ui/icons/Expand/index.js.map +1 -0
  565. package/dist/lexical/ui/icons/H1/index.d.ts +3 -1
  566. package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
  567. package/dist/lexical/ui/icons/H1/index.js +9 -6
  568. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  569. package/dist/lexical/ui/icons/H2/index.d.ts +3 -1
  570. package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
  571. package/dist/lexical/ui/icons/H2/index.js +9 -6
  572. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  573. package/dist/lexical/ui/icons/H3/index.d.ts +3 -1
  574. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  575. package/dist/lexical/ui/icons/H3/index.js +9 -6
  576. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  577. package/dist/lexical/ui/icons/H4/index.d.ts +3 -1
  578. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  579. package/dist/lexical/ui/icons/H4/index.js +9 -6
  580. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  581. package/dist/lexical/ui/icons/H5/index.d.ts +3 -1
  582. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  583. package/dist/lexical/ui/icons/H5/index.js +9 -6
  584. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  585. package/dist/lexical/ui/icons/H6/index.d.ts +3 -1
  586. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  587. package/dist/lexical/ui/icons/H6/index.js +9 -6
  588. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  589. package/dist/lexical/ui/icons/HorizontalRule/index.d.ts +3 -1
  590. package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
  591. package/dist/lexical/ui/icons/HorizontalRule/index.js +11 -11
  592. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  593. package/dist/lexical/ui/icons/IndentDecrease/index.d.ts +3 -1
  594. package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
  595. package/dist/lexical/ui/icons/IndentDecrease/index.js +18 -22
  596. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  597. package/dist/lexical/ui/icons/IndentIncrease/index.d.ts +3 -1
  598. package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
  599. package/dist/lexical/ui/icons/IndentIncrease/index.js +15 -22
  600. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  601. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts +3 -1
  602. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
  603. package/dist/lexical/ui/icons/InlineBlocks/index.js +9 -6
  604. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
  605. package/dist/lexical/ui/icons/Italic/index.d.ts +3 -1
  606. package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
  607. package/dist/lexical/ui/icons/Italic/index.js +13 -8
  608. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  609. package/dist/lexical/ui/icons/Link/index.d.ts +4 -1
  610. package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
  611. package/dist/lexical/ui/icons/Link/index.js +14 -9
  612. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  613. package/dist/lexical/ui/icons/Meatballs/index.d.ts +4 -1
  614. package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
  615. package/dist/lexical/ui/icons/Meatballs/index.js +19 -15
  616. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
  617. package/dist/lexical/ui/icons/OrderedList/index.d.ts +4 -1
  618. package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
  619. package/dist/lexical/ui/icons/OrderedList/index.js +19 -25
  620. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  621. package/dist/lexical/ui/icons/Page/index.d.ts +5 -0
  622. package/dist/lexical/ui/icons/Page/index.d.ts.map +1 -0
  623. package/dist/lexical/ui/icons/Page/index.js +21 -0
  624. package/dist/lexical/ui/icons/Page/index.js.map +1 -0
  625. package/dist/lexical/ui/icons/Relationship/index.d.ts +3 -1
  626. package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
  627. package/dist/lexical/ui/icons/Relationship/index.js +13 -25
  628. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  629. package/dist/lexical/ui/icons/Strikethrough/index.d.ts +3 -1
  630. package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
  631. package/dist/lexical/ui/icons/Strikethrough/index.js +13 -13
  632. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  633. package/dist/lexical/ui/icons/Subscript/index.d.ts +3 -1
  634. package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
  635. package/dist/lexical/ui/icons/Subscript/index.js +10 -7
  636. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  637. package/dist/lexical/ui/icons/Superscript/index.d.ts +3 -1
  638. package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
  639. package/dist/lexical/ui/icons/Superscript/index.js +10 -7
  640. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  641. package/dist/lexical/ui/icons/Table/index.d.ts +4 -1
  642. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
  643. package/dist/lexical/ui/icons/Table/index.js +20 -15
  644. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  645. package/dist/lexical/ui/icons/Text/index.d.ts +4 -1
  646. package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
  647. package/dist/lexical/ui/icons/Text/index.js +17 -8
  648. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  649. package/dist/lexical/ui/icons/Trash/index.d.ts +10 -0
  650. package/dist/lexical/ui/icons/Trash/index.d.ts.map +1 -0
  651. package/dist/lexical/ui/icons/Trash/index.js +29 -0
  652. package/dist/lexical/ui/icons/Trash/index.js.map +1 -0
  653. package/dist/lexical/ui/icons/Underline/index.d.ts +3 -1
  654. package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
  655. package/dist/lexical/ui/icons/Underline/index.js +16 -14
  656. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  657. package/dist/lexical/ui/icons/UnorderedList/index.d.ts +3 -1
  658. package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
  659. package/dist/lexical/ui/icons/UnorderedList/index.js +13 -40
  660. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  661. package/dist/lexical/ui/icons/Upload/index.d.ts +3 -1
  662. package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
  663. package/dist/lexical/ui/icons/Upload/index.js +15 -22
  664. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  665. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  666. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
  667. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  668. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  669. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  670. package/dist/{types.d.ts → types/index.d.ts} +9 -9
  671. package/dist/types/index.d.ts.map +1 -0
  672. package/dist/types/index.js +2 -0
  673. package/dist/types/index.js.map +1 -0
  674. package/dist/{nodeTypes.d.ts → types/nodeTypes.d.ts} +10 -10
  675. package/dist/types/nodeTypes.d.ts.map +1 -0
  676. package/dist/types/nodeTypes.js.map +1 -0
  677. package/dist/types/schema.d.ts +6 -0
  678. package/dist/types/schema.d.ts.map +1 -0
  679. package/dist/types/schema.js +81 -0
  680. package/dist/types/schema.js.map +1 -0
  681. package/dist/utilities/buildEditorState.d.ts +1 -1
  682. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  683. package/dist/utilities/buildEditorState.js +13 -0
  684. package/dist/utilities/buildEditorState.js.map +1 -1
  685. package/dist/utilities/buildInitialState.js.map +1 -1
  686. package/dist/utilities/createClientFeature.d.ts +1 -1
  687. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  688. package/dist/utilities/createClientFeature.js.map +1 -1
  689. package/dist/utilities/editorConfigFactory.d.ts +1 -1
  690. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  691. package/dist/utilities/editorConfigFactory.js.map +1 -1
  692. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
  693. package/dist/utilities/fieldsDrawer/Drawer.js +19 -10
  694. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  695. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -1
  696. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  697. package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -7
  698. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  699. package/dist/utilities/fieldsDrawer/index.css +12 -0
  700. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +29 -0
  701. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -0
  702. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js +97 -0
  703. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -0
  704. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +1 -0
  705. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  706. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +34 -18
  707. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  708. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  709. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  710. package/dist/utilities/generateImportMap.d.ts +1 -1
  711. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  712. package/dist/utilities/generateImportMap.js.map +1 -1
  713. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  714. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  715. package/dist/utilities/initLexicalFeatures.d.ts +1 -1
  716. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  717. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  718. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  719. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  720. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  721. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  722. package/dist/validate/index.d.ts.map +1 -1
  723. package/package.json +15 -20
  724. package/dist/exports/client/Component-DOSSWC76.js +0 -2
  725. package/dist/exports/client/Component-DOSSWC76.js.map +0 -7
  726. package/dist/exports/client/Component-MBLHTKDK.js +0 -2
  727. package/dist/exports/client/Component-MBLHTKDK.js.map +0 -7
  728. package/dist/exports/client/Field-OVF2FPGD.js +0 -2
  729. package/dist/exports/client/Field-OVF2FPGD.js.map +0 -7
  730. package/dist/exports/client/RelationshipComponent-BG3DPV3T.js +0 -2
  731. package/dist/exports/client/RelationshipComponent-BG3DPV3T.js.map +0 -7
  732. package/dist/exports/client/chunk-BZZVLW4U.js.map +0 -7
  733. package/dist/exports/client/chunk-F26IQ5RE.js +0 -2
  734. package/dist/exports/client/chunk-F26IQ5RE.js.map +0 -7
  735. package/dist/exports/client/chunk-FTT5KJ6W.js.map +0 -7
  736. package/dist/exports/client/chunk-INBEEENE.js +0 -2
  737. package/dist/exports/client/chunk-INBEEENE.js.map +0 -7
  738. package/dist/exports/client/chunk-QJ5EETIB.js +0 -2
  739. package/dist/exports/client/chunk-QJ5EETIB.js.map +0 -7
  740. package/dist/exports/client/chunk-XFA5M7FY.js +0 -2
  741. package/dist/exports/client/chunk-XFA5M7FY.js.map +0 -7
  742. package/dist/exports/client/component-XIHC3W6W.js +0 -2
  743. package/dist/exports/client/component-XIHC3W6W.js.map +0 -7
  744. package/dist/exports/client/componentInline-A4H3EY3L.js +0 -2
  745. package/dist/exports/server/migrate.d.ts +0 -16
  746. package/dist/exports/server/migrate.d.ts.map +0 -1
  747. package/dist/exports/server/migrate.js +0 -16
  748. package/dist/exports/server/migrate.js.map +0 -1
  749. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts +0 -4
  750. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts.map +0 -1
  751. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js +0 -7
  752. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js.map +0 -1
  753. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts +0 -4
  754. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts.map +0 -1
  755. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js +0 -38
  756. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js.map +0 -1
  757. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts +0 -4
  758. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts.map +0 -1
  759. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js +0 -9
  760. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js.map +0 -1
  761. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts +0 -4
  762. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts.map +0 -1
  763. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js +0 -33
  764. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js.map +0 -1
  765. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts +0 -6
  766. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts.map +0 -1
  767. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js +0 -9
  768. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js.map +0 -1
  769. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts +0 -70
  770. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts.map +0 -1
  771. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js +0 -104
  772. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js.map +0 -1
  773. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts +0 -27
  774. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts.map +0 -1
  775. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js +0 -2
  776. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js.map +0 -1
  777. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts +0 -39
  778. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts.map +0 -1
  779. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js +0 -122
  780. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js.map +0 -1
  781. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts +0 -12
  782. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts.map +0 -1
  783. package/dist/features/converters/lexicalToHtml_deprecated/index.js +0 -11
  784. package/dist/features/converters/lexicalToHtml_deprecated/index.js.map +0 -1
  785. package/dist/features/lists/htmlConverter.d.ts +0 -5
  786. package/dist/features/lists/htmlConverter.d.ts.map +0 -1
  787. package/dist/features/lists/htmlConverter.js +0 -81
  788. package/dist/features/lists/htmlConverter.js.map +0 -1
  789. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts +0 -3
  790. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts.map +0 -1
  791. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +0 -22
  792. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +0 -1
  793. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts +0 -3
  794. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts.map +0 -1
  795. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +0 -33
  796. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +0 -1
  797. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts +0 -3
  798. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts.map +0 -1
  799. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +0 -24
  800. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +0 -1
  801. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts +0 -3
  802. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
  803. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +0 -25
  804. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +0 -1
  805. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts +0 -3
  806. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts.map +0 -1
  807. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +0 -22
  808. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +0 -1
  809. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts +0 -3
  810. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
  811. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +0 -28
  812. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +0 -1
  813. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts +0 -3
  814. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +0 -1
  815. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +0 -22
  816. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +0 -1
  817. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts +0 -3
  818. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts.map +0 -1
  819. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +0 -9
  820. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +0 -1
  821. package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts +0 -19
  822. package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +0 -1
  823. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +0 -78
  824. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +0 -1
  825. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts +0 -23
  826. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts.map +0 -1
  827. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +0 -2
  828. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +0 -1
  829. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +0 -2
  830. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +0 -1
  831. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +0 -10
  832. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +0 -1
  833. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts +0 -10
  834. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +0 -1
  835. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +0 -49
  836. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +0 -1
  837. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
  838. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
  839. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +0 -15
  840. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
  841. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
  842. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
  843. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +0 -74
  844. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
  845. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts +0 -3
  846. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts.map +0 -1
  847. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +0 -23
  848. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +0 -1
  849. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts +0 -3
  850. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts.map +0 -1
  851. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +0 -24
  852. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +0 -1
  853. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts +0 -3
  854. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts.map +0 -1
  855. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +0 -33
  856. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +0 -1
  857. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts +0 -3
  858. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts.map +0 -1
  859. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +0 -30
  860. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +0 -1
  861. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts +0 -3
  862. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
  863. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +0 -26
  864. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +0 -1
  865. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts +0 -3
  866. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts.map +0 -1
  867. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +0 -26
  868. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +0 -1
  869. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts +0 -3
  870. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +0 -1
  871. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +0 -15
  872. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +0 -1
  873. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts +0 -3
  874. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
  875. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +0 -27
  876. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +0 -1
  877. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts +0 -3
  878. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts.map +0 -1
  879. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +0 -26
  880. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +0 -1
  881. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts +0 -3
  882. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +0 -1
  883. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +0 -18
  884. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +0 -1
  885. package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts +0 -3
  886. package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts.map +0 -1
  887. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +0 -12
  888. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +0 -1
  889. package/dist/features/migrations/slateToLexical/converter/index.d.ts +0 -19
  890. package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +0 -1
  891. package/dist/features/migrations/slateToLexical/converter/index.js +0 -130
  892. package/dist/features/migrations/slateToLexical/converter/index.js.map +0 -1
  893. package/dist/features/migrations/slateToLexical/converter/types.d.ts +0 -16
  894. package/dist/features/migrations/slateToLexical/converter/types.d.ts.map +0 -1
  895. package/dist/features/migrations/slateToLexical/converter/types.js +0 -2
  896. package/dist/features/migrations/slateToLexical/converter/types.js.map +0 -1
  897. package/dist/features/migrations/slateToLexical/feature.client.d.ts +0 -2
  898. package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +0 -1
  899. package/dist/features/migrations/slateToLexical/feature.client.js +0 -10
  900. package/dist/features/migrations/slateToLexical/feature.client.js.map +0 -1
  901. package/dist/features/migrations/slateToLexical/feature.server.d.ts +0 -40
  902. package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +0 -1
  903. package/dist/features/migrations/slateToLexical/feature.server.js +0 -68
  904. package/dist/features/migrations/slateToLexical/feature.server.js.map +0 -1
  905. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
  906. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
  907. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +0 -15
  908. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
  909. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
  910. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
  911. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +0 -74
  912. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
  913. package/dist/lexical/ui/icons/AI/index.d.ts +0 -3
  914. package/dist/lexical/ui/icons/AI/index.d.ts.map +0 -1
  915. package/dist/lexical/ui/icons/AI/index.js +0 -34
  916. package/dist/lexical/ui/icons/AI/index.js.map +0 -1
  917. package/dist/lexical/ui/icons/Caret/index.svg +0 -3
  918. package/dist/lexical/ui/icons/Edit/index.svg +0 -10
  919. package/dist/lexical/ui/icons/Remove/index.svg +0 -4
  920. package/dist/nodeTypes.d.ts.map +0 -1
  921. package/dist/nodeTypes.js.map +0 -1
  922. package/dist/types.d.ts.map +0 -1
  923. package/dist/types.js +0 -2
  924. package/dist/types.js.map +0 -1
  925. package/dist/utilities/migrateSlateToLexical/index.d.ts +0 -15
  926. package/dist/utilities/migrateSlateToLexical/index.d.ts.map +0 -1
  927. package/dist/utilities/migrateSlateToLexical/index.js +0 -152
  928. package/dist/utilities/migrateSlateToLexical/index.js.map +0 -1
  929. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +0 -10
  930. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +0 -1
  931. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +0 -85
  932. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +0 -1
  933. /package/dist/exports/client/{componentInline-A4H3EY3L.js.map → componentInline-R2RSJX4K.js.map} +0 -0
  934. /package/dist/{nodeTypes.js → types/nodeTypes.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"defaultConverters.js","names":["BlockquoteJSXConverter","HeadingJSXConverter","HorizontalRuleJSXConverter","LinebreakJSXConverter","LinkJSXConverter","ListJSXConverter","ParagraphJSXConverter","TabJSXConverter","TableJSXConverter","TextJSXConverter","UploadJSXConverter","defaultJSXConverters"],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/defaultConverters.ts"],"sourcesContent":["import type { DefaultNodeTypes } from '../../../../nodeTypes.js'\nimport type { JSXConverters } from './types.js'\n\nimport { BlockquoteJSXConverter } from './converters/blockquote.js'\nimport { HeadingJSXConverter } from './converters/heading.js'\nimport { HorizontalRuleJSXConverter } from './converters/horizontalRule.js'\nimport { LinebreakJSXConverter } from './converters/linebreak.js'\nimport { LinkJSXConverter } from './converters/link.js'\nimport { ListJSXConverter } from './converters/list.js'\nimport { ParagraphJSXConverter } from './converters/paragraph.js'\nimport { TabJSXConverter } from './converters/tab.js'\nimport { TableJSXConverter } from './converters/table.js'\nimport { TextJSXConverter } from './converters/text.js'\nimport { UploadJSXConverter } from './converters/upload.js'\n\nexport const defaultJSXConverters: JSXConverters<DefaultNodeTypes> = {\n ...ParagraphJSXConverter,\n ...TextJSXConverter,\n ...LinebreakJSXConverter,\n ...BlockquoteJSXConverter,\n ...TableJSXConverter,\n ...HeadingJSXConverter,\n ...HorizontalRuleJSXConverter,\n ...ListJSXConverter,\n ...LinkJSXConverter({}),\n ...UploadJSXConverter,\n ...TabJSXConverter,\n}\n"],"mappings":"AAGA,SAASA,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,eAAe,QAAQ;AAChC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,MAAMC,oBAAA,GAAwD;EACnE,GAAGL,qBAAqB;EACxB,GAAGG,gBAAgB;EACnB,GAAGN,qBAAqB;EACxB,GAAGH,sBAAsB;EACzB,GAAGQ,iBAAiB;EACpB,GAAGP,mBAAmB;EACtB,GAAGC,0BAA0B;EAC7B,GAAGG,gBAAgB;EACnB,GAAGD,gBAAA,CAAiB,CAAC,EAAE;EACvB,GAAGM,kBAAkB;EACrB,GAAGH;AACL","ignoreList":[]}
1
+ {"version":3,"file":"defaultConverters.js","names":["BlockquoteJSXConverter","HeadingJSXConverter","HorizontalRuleJSXConverter","LinebreakJSXConverter","LinkJSXConverter","ListJSXConverter","ParagraphJSXConverter","TabJSXConverter","TableJSXConverter","TextJSXConverter","UploadJSXConverter","defaultJSXConverters"],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/defaultConverters.ts"],"sourcesContent":["import type { DefaultNodeTypes } from '../../../../types/nodeTypes.js'\nimport type { JSXConverters } from './types.js'\n\nimport { BlockquoteJSXConverter } from './converters/blockquote.js'\nimport { HeadingJSXConverter } from './converters/heading.js'\nimport { HorizontalRuleJSXConverter } from './converters/horizontalRule.js'\nimport { LinebreakJSXConverter } from './converters/linebreak.js'\nimport { LinkJSXConverter } from './converters/link.js'\nimport { ListJSXConverter } from './converters/list.js'\nimport { ParagraphJSXConverter } from './converters/paragraph.js'\nimport { TabJSXConverter } from './converters/tab.js'\nimport { TableJSXConverter } from './converters/table.js'\nimport { TextJSXConverter } from './converters/text.js'\nimport { UploadJSXConverter } from './converters/upload.js'\n\nexport const defaultJSXConverters: JSXConverters<DefaultNodeTypes> = {\n ...ParagraphJSXConverter,\n ...TextJSXConverter,\n ...LinebreakJSXConverter,\n ...BlockquoteJSXConverter,\n ...TableJSXConverter,\n ...HeadingJSXConverter,\n ...HorizontalRuleJSXConverter,\n ...ListJSXConverter,\n ...LinkJSXConverter({}),\n ...UploadJSXConverter,\n ...TabJSXConverter,\n}\n"],"mappings":"AAGA,SAASA,sBAAsB,QAAQ;AACvC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,qBAAqB,QAAQ;AACtC,SAASC,eAAe,QAAQ;AAChC,SAASC,iBAAiB,QAAQ;AAClC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,MAAMC,oBAAA,GAAwD;EACnE,GAAGL,qBAAqB;EACxB,GAAGG,gBAAgB;EACnB,GAAGN,qBAAqB;EACxB,GAAGH,sBAAsB;EACzB,GAAGQ,iBAAiB;EACpB,GAAGP,mBAAmB;EACtB,GAAGC,0BAA0B;EAC7B,GAAGG,gBAAgB;EACnB,GAAGD,gBAAA,CAAiB,CAAC,EAAE;EACvB,GAAGM,kBAAkB;EACrB,GAAGH;AACL","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { SerializedEditorState, SerializedLexicalNode } from 'lexical';
2
2
  import React from 'react';
3
- import type { LexicalEditorNodeMap, SerializedNodeBase } from '../../../../types.js';
3
+ import type { LexicalEditorNodeMap, SerializedNodeBase } from '../../../../types/index.js';
4
4
  import type { JSXConverters, SerializedLexicalNodeWithParent } from './types.js';
5
5
  export type ConvertLexicalToJSXArgs<TNodes extends SerializedNodeBase = SerializedNodeBase> = {
6
6
  converters: JSXConverters;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EACV,oBAAoB,EAGpB,kBAAkB,EAEnB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAgB,aAAa,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAkI9F,MAAM,MAAM,uBAAuB,CAAC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,IAAI;IAC5F,UAAU,EAAE,aAAa,CAAA;IACzB;;OAEG;IACH,IAAI,EAAE,qBAAqB,CAAA;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;CACvC,CAAA;AAED,wBAAgB,mBAAmB,CAAC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,EAAE,EAC1F,UAAU,EACV,IAAI,EACJ,aAAa,EACb,gBAAgB,EAChB,OAAO,GACR,EAAE,uBAAuB,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,CAuBnD;AAED,wBAAgB,wBAAwB,CAAC,EACvC,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,MAAM,GACP,EAAE;IACD,UAAU,EAAE,aAAa,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC,KAAK,EAAE,qBAAqB,EAAE,CAAA;IAC9B,MAAM,EAAE,+BAA+B,CAAA;CACxC,GAAG,KAAK,CAAC,SAAS,EAAE,CAmIpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,qBAAqB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAE3E,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EACV,oBAAoB,EAGpB,kBAAkB,EAEnB,MAAM,4BAA4B,CAAA;AAEnC,OAAO,KAAK,EAAgB,aAAa,EAAE,+BAA+B,EAAE,MAAM,YAAY,CAAA;AAkI9F,MAAM,MAAM,uBAAuB,CAAC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,IAAI;IAC5F,UAAU,EAAE,aAAa,CAAA;IACzB;;OAEG;IACH,IAAI,EAAE,qBAAqB,CAAA;IAC3B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC;;OAEG;IACH,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,oBAAoB,CAAC,MAAM,CAAC,CAAA;CACvC,CAAA;AAED,wBAAgB,mBAAmB,CAAC,MAAM,SAAS,kBAAkB,GAAG,kBAAkB,EAAE,EAC1F,UAAU,EACV,IAAI,EACJ,aAAa,EACb,gBAAgB,EAChB,OAAO,GACR,EAAE,uBAAuB,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,SAAS,CAuBnD;AAED,wBAAgB,wBAAwB,CAAC,EACvC,UAAU,EACV,aAAa,EACb,gBAAgB,EAChB,KAAK,EACL,MAAM,GACP,EAAE;IACD,UAAU,EAAE,aAAa,CAAA;IACzB,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;IACrC,KAAK,EAAE,qBAAqB,EAAE,CAAA;IAC9B,MAAM,EAAE,+BAA+B,CAAA;CACxC,GAAG,KAAK,CAAC,SAAS,EAAE,CAmIpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["jsx","_jsx","Fragment","_Fragment","React","hasText","createConverterFromNodeMapValue","viewDef","args","converterArgs","isEditor","isJSXConverter","Component","html","htmlContent","dangerouslySetInnerHTML","__html","createConverterFromBlockValue","Block","blockNode","node","blockProps","childIndex","converters","formData","fields","nodesToJSX","parent","createElement","nodeMapToConverters","nodeMap","nodeType","value","Object","entries","blocks","blockType","_viewDef","inlineBlocks","convertLexicalToJSX","data","disableIndent","disableTextAlign","nodeMapConverters","undefined","mergedConverters","convertLexicalNodesToJSX","nodes","root","children","unknownConverter","unknown","jsxArray","map","i","converterForNode","type","console","error","reactNode","converted","style","Array","isArray","includes","format","textAlign","indent","paddingInlineStart","Number","isValidElement","newStyle","props","cloneElement","key","filter","Boolean"],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport React from 'react'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js'\nimport type {\n LexicalEditorNodeMap,\n NodeMapBlockValue,\n NodeMapValue,\n SerializedNodeBase,\n ViewMapBlockJSXConverterProps,\n} from '../../../../types.js'\nimport type { JSXConverter, JSXConverters, SerializedLexicalNodeWithParent } from './types.js'\n\nimport { hasText } from '../../../../validate/hasText.js'\n\n/**\n * Creates a JSX converter from a NodeMapValue\n */\nfunction createConverterFromNodeMapValue(viewDef: NodeMapValue): JSXConverter {\n return (args) => {\n const converterArgs = {\n ...args,\n isEditor: false as const,\n isJSXConverter: true as const,\n }\n\n // If Component is provided, use it\n if (viewDef.Component) {\n return viewDef.Component(converterArgs)\n }\n\n // If html is provided (as a function or string), use it\n // Note: Using span instead of div to avoid forcing block-level semantics\n if (viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function' ? viewDef.html(converterArgs) : viewDef.html\n\n return <span dangerouslySetInnerHTML={{ __html: htmlContent }} />\n }\n\n return null\n }\n}\n\n/**\n * Creates a JSX converter from a NodeMapBlockValue (for blocks/inlineBlocks)\n * This also checks for Block FC as a fallback when Component is not defined.\n */\nfunction createConverterFromBlockValue(viewDef: NodeMapBlockValue<any>): JSXConverter {\n return (args) => {\n // Priority: Component > Block > html\n if (viewDef.Component) {\n const converterArgs = {\n ...args,\n isEditor: false as const,\n isJSXConverter: true as const,\n }\n return viewDef.Component(converterArgs)\n }\n\n // Use Block FC with JSX converter props\n if (viewDef.Block) {\n const blockNode = args.node as SerializedBlockNode\n const blockProps: ViewMapBlockJSXConverterProps<any> = {\n childIndex: args.childIndex,\n converters: args.converters,\n formData: blockNode.fields ?? {},\n isEditor: false,\n isJSXConverter: true,\n node: blockNode,\n nodesToJSX: args.nodesToJSX,\n parent: args.parent,\n }\n return React.createElement(viewDef.Block, blockProps)\n }\n\n if (viewDef.html) {\n const converterArgs = {\n ...args,\n isEditor: false as const,\n isJSXConverter: true as const,\n }\n const htmlContent =\n typeof viewDef.html === 'function' ? viewDef.html(converterArgs) : viewDef.html\n\n return <span dangerouslySetInnerHTML={{ __html: htmlContent }} />\n }\n\n return null\n }\n}\n\n/**\n * Converts a LexicalEditorNodeMap into JSXConverters\n */\nfunction nodeMapToConverters<TNodes extends SerializedNodeBase = SerializedNodeBase>(\n nodeMap: LexicalEditorNodeMap<TNodes>,\n): JSXConverters {\n const converters: JSXConverters = {}\n\n for (const [nodeType, value] of Object.entries(nodeMap)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // Handle special keys: blocks, inlineBlocks\n if (nodeType === 'blocks') {\n converters.blocks = {}\n for (const [blockType, _viewDef] of Object.entries(value)) {\n const viewDef = _viewDef as NodeMapBlockValue<any>\n // Check for Component, Block, or html\n if (viewDef.Component || viewDef.Block || viewDef.html) {\n converters.blocks[blockType] = createConverterFromBlockValue(viewDef)\n }\n }\n continue\n }\n\n if (nodeType === 'inlineBlocks') {\n converters.inlineBlocks = {}\n for (const [blockType, _viewDef] of Object.entries(value)) {\n const viewDef = _viewDef as NodeMapBlockValue<any>\n // Check for Component, Block, or html\n if (viewDef.Component || viewDef.Block || viewDef.html) {\n converters.inlineBlocks[blockType] = createConverterFromBlockValue(viewDef)\n }\n }\n continue\n }\n\n // Handle regular node types\n const viewDef = value as NodeMapValue\n\n if (viewDef.Component || viewDef.html) {\n converters[nodeType] = createConverterFromNodeMapValue(viewDef)\n }\n }\n\n return converters\n}\n\nexport type ConvertLexicalToJSXArgs<TNodes extends SerializedNodeBase = SerializedNodeBase> = {\n converters: JSXConverters\n /**\n * Serialized editor state to render.\n */\n data: SerializedEditorState\n /**\n * If true, disables indentation globally. If an array, disables for specific node `type` values.\n */\n disableIndent?: boolean | string[]\n /**\n * If true, disables text alignment globally. If an array, disables for specific node `type` values.\n */\n disableTextAlign?: boolean | string[]\n /**\n * You can use the lexical editor node map or view map as converters. NodeMap converters will override converters passed\n * in the `converters` prop. If a LexicalEditorViewMap is provided, the `default` view will be used.\n */\n nodeMap?: LexicalEditorNodeMap<TNodes>\n}\n\nexport function convertLexicalToJSX<TNodes extends SerializedNodeBase = SerializedNodeBase>({\n converters,\n data,\n disableIndent,\n disableTextAlign,\n nodeMap,\n}: ConvertLexicalToJSXArgs<TNodes>): React.ReactNode {\n if (hasText(data)) {\n // Merge nodeMap converters with existing converters\n // NodeMap converters override existing converters\n const nodeMapConverters = nodeMap ? nodeMapToConverters(nodeMap) : undefined\n const mergedConverters = nodeMapConverters\n ? {\n ...converters,\n ...nodeMapConverters,\n blocks: { ...converters.blocks, ...nodeMapConverters.blocks },\n inlineBlocks: { ...converters.inlineBlocks, ...nodeMapConverters.inlineBlocks },\n }\n : converters\n\n return convertLexicalNodesToJSX({\n converters: mergedConverters,\n disableIndent,\n disableTextAlign,\n nodes: data.root.children,\n parent: data.root,\n })\n }\n return <></>\n}\n\nexport function convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes,\n parent,\n}: {\n converters: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent: SerializedLexicalNodeWithParent\n}): React.ReactNode[] {\n const unknownConverter: JSXConverter<any> = converters.unknown as JSXConverter<any>\n\n const jsxArray: React.ReactNode[] = nodes.map((node, i) => {\n let converterForNode: JSXConverter<any> | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[(node as SerializedBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode =\n converters?.inlineBlocks?.[(node as SerializedInlineBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as JSXConverter<any>\n }\n\n try {\n if (!converterForNode && unknownConverter) {\n converterForNode = unknownConverter\n }\n\n let reactNode: React.ReactNode\n if (converterForNode) {\n const converted =\n typeof converterForNode === 'function'\n ? converterForNode({\n childIndex: i,\n converters,\n node,\n nodesToJSX: (args) => {\n return convertLexicalNodesToJSX({\n converters: args.converters ?? converters,\n disableIndent: args.disableIndent ?? disableIndent,\n disableTextAlign: args.disableTextAlign ?? disableTextAlign,\n nodes: args.nodes,\n parent: args.parent ?? {\n ...node,\n parent,\n },\n })\n },\n parent,\n })\n : converterForNode\n reactNode = converted\n } else {\n reactNode = <span key={i}>unknown node</span>\n }\n\n const style: React.CSSProperties = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style.textAlign = 'center'\n break\n case 'end':\n style.textAlign = 'right'\n break\n case 'justify':\n style.textAlign = 'justify'\n break\n case 'left':\n //style.textAlign = 'left'\n // Do nothing, as left is the default\n break\n case 'right':\n style.textAlign = 'right'\n break\n case 'start':\n style.textAlign = 'left'\n break\n }\n }\n }\n\n if (\n !disableIndent &&\n (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))\n ) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style.paddingInlineStart = `${Number(node.indent) * 40}px`\n }\n }\n\n if (React.isValidElement(reactNode)) {\n // Inject style into reactNode\n if (style.textAlign || style.paddingInlineStart) {\n const newStyle = {\n ...style,\n // @ts-expect-error type better later\n ...(reactNode?.props?.style ?? {}),\n // reactNode style comes after, thus a textAlign specified in the converter has priority over the one we inject here\n }\n\n return React.cloneElement(reactNode, {\n key: i,\n // @ts-expect-error type better later\n style: newStyle,\n })\n }\n return React.cloneElement(reactNode, {\n key: i,\n })\n }\n\n return reactNode\n } catch (error) {\n console.error('Error converting lexical node to JSX:', error, 'node:', node)\n return null\n }\n })\n\n return jsxArray.filter(Boolean)\n}\n"],"mappings":"AAAA,+BAA6B,SAAAA,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAG7B,OAAOC,KAAA,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;MACF;MAEA,iBAAI/D,KAAA,CAAMkE,cAAc,CAACX,SAAA,GAAY;QACnC;QACA,IAAIE,KAAA,CAAMK,SAAS,IAAIL,KAAA,CAAMO,kBAAkB,EAAE;UAC/C,MAAMG,QAAA,GAAW;YACf,GAAGV,KAAK;YACR;YACA,IAAIF,SAAA,EAAWa,KAAA,EAAOX,KAAA,IAAS,CAAC,CAAC;UAEnC;UAEA,oBAAOzD,KAAA,CAAMqE,YAAY,CAACd,SAAA,EAAW;YACnCe,GAAA,EAAKpB,CAAA;YACL;YACAO,KAAA,EAAOU;UACT;QACF;QACA,oBAAOnE,KAAA,CAAMqE,YAAY,CAACd,SAAA,EAAW;UACnCe,GAAA,EAAKpB;QACP;MACF;MAEA,OAAOK,SAAA;IACT,EAAE,OAAOD,KAAA,EAAO;MACdD,OAAA,CAAQC,KAAK,CAAC,yCAAyCA,KAAA,EAAO,SAAStC,IAAA;MACvE,OAAO;IACT;EACF;EAEA,OAAOgC,QAAA,CAASuB,MAAM,CAACC,OAAA;AACzB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["jsx","_jsx","Fragment","_Fragment","React","hasText","createConverterFromNodeMapValue","viewDef","args","converterArgs","isEditor","isJSXConverter","Component","html","htmlContent","dangerouslySetInnerHTML","__html","createConverterFromBlockValue","Block","blockNode","node","blockProps","childIndex","converters","formData","fields","nodesToJSX","parent","createElement","nodeMapToConverters","nodeMap","nodeType","value","Object","entries","blocks","blockType","_viewDef","inlineBlocks","convertLexicalToJSX","data","disableIndent","disableTextAlign","nodeMapConverters","undefined","mergedConverters","convertLexicalNodesToJSX","nodes","root","children","unknownConverter","unknown","jsxArray","map","i","converterForNode","type","console","error","reactNode","converted","style","Array","isArray","includes","format","textAlign","indent","paddingInlineStart","Number","isValidElement","newStyle","props","cloneElement","key","filter","Boolean"],"sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport React from 'react'\n\nimport type {\n LexicalEditorNodeMap,\n NodeMapBlockValue,\n NodeMapValue,\n SerializedNodeBase,\n ViewMapBlockJSXConverterProps,\n} from '../../../../types/index.js'\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../types/nodeTypes.js'\nimport type { JSXConverter, JSXConverters, SerializedLexicalNodeWithParent } from './types.js'\n\nimport { hasText } from '../../../../validate/hasText.js'\n\n/**\n * Creates a JSX converter from a NodeMapValue\n */\nfunction createConverterFromNodeMapValue(viewDef: NodeMapValue): JSXConverter {\n return (args) => {\n const converterArgs = {\n ...args,\n isEditor: false as const,\n isJSXConverter: true as const,\n }\n\n // If Component is provided, use it\n if (viewDef.Component) {\n return viewDef.Component(converterArgs)\n }\n\n // If html is provided (as a function or string), use it\n // Note: Using span instead of div to avoid forcing block-level semantics\n if (viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function' ? viewDef.html(converterArgs) : viewDef.html\n\n return <span dangerouslySetInnerHTML={{ __html: htmlContent }} />\n }\n\n return null\n }\n}\n\n/**\n * Creates a JSX converter from a NodeMapBlockValue (for blocks/inlineBlocks)\n * This also checks for Block FC as a fallback when Component is not defined.\n */\nfunction createConverterFromBlockValue(viewDef: NodeMapBlockValue<any>): JSXConverter {\n return (args) => {\n // Priority: Component > Block > html\n if (viewDef.Component) {\n const converterArgs = {\n ...args,\n isEditor: false as const,\n isJSXConverter: true as const,\n }\n return viewDef.Component(converterArgs)\n }\n\n // Use Block FC with JSX converter props\n if (viewDef.Block) {\n const blockNode = args.node as SerializedBlockNode\n const blockProps: ViewMapBlockJSXConverterProps<any> = {\n childIndex: args.childIndex,\n converters: args.converters,\n formData: blockNode.fields ?? {},\n isEditor: false,\n isJSXConverter: true,\n node: blockNode,\n nodesToJSX: args.nodesToJSX,\n parent: args.parent,\n }\n return React.createElement(viewDef.Block, blockProps)\n }\n\n if (viewDef.html) {\n const converterArgs = {\n ...args,\n isEditor: false as const,\n isJSXConverter: true as const,\n }\n const htmlContent =\n typeof viewDef.html === 'function' ? viewDef.html(converterArgs) : viewDef.html\n\n return <span dangerouslySetInnerHTML={{ __html: htmlContent }} />\n }\n\n return null\n }\n}\n\n/**\n * Converts a LexicalEditorNodeMap into JSXConverters\n */\nfunction nodeMapToConverters<TNodes extends SerializedNodeBase = SerializedNodeBase>(\n nodeMap: LexicalEditorNodeMap<TNodes>,\n): JSXConverters {\n const converters: JSXConverters = {}\n\n for (const [nodeType, value] of Object.entries(nodeMap)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // Handle special keys: blocks, inlineBlocks\n if (nodeType === 'blocks') {\n converters.blocks = {}\n for (const [blockType, _viewDef] of Object.entries(value)) {\n const viewDef = _viewDef as NodeMapBlockValue<any>\n // Check for Component, Block, or html\n if (viewDef.Component || viewDef.Block || viewDef.html) {\n converters.blocks[blockType] = createConverterFromBlockValue(viewDef)\n }\n }\n continue\n }\n\n if (nodeType === 'inlineBlocks') {\n converters.inlineBlocks = {}\n for (const [blockType, _viewDef] of Object.entries(value)) {\n const viewDef = _viewDef as NodeMapBlockValue<any>\n // Check for Component, Block, or html\n if (viewDef.Component || viewDef.Block || viewDef.html) {\n converters.inlineBlocks[blockType] = createConverterFromBlockValue(viewDef)\n }\n }\n continue\n }\n\n // Handle regular node types\n const viewDef = value as NodeMapValue\n\n if (viewDef.Component || viewDef.html) {\n converters[nodeType] = createConverterFromNodeMapValue(viewDef)\n }\n }\n\n return converters\n}\n\nexport type ConvertLexicalToJSXArgs<TNodes extends SerializedNodeBase = SerializedNodeBase> = {\n converters: JSXConverters\n /**\n * Serialized editor state to render.\n */\n data: SerializedEditorState\n /**\n * If true, disables indentation globally. If an array, disables for specific node `type` values.\n */\n disableIndent?: boolean | string[]\n /**\n * If true, disables text alignment globally. If an array, disables for specific node `type` values.\n */\n disableTextAlign?: boolean | string[]\n /**\n * You can use the lexical editor node map or view map as converters. NodeMap converters will override converters passed\n * in the `converters` prop. If a LexicalEditorViewMap is provided, the `default` view will be used.\n */\n nodeMap?: LexicalEditorNodeMap<TNodes>\n}\n\nexport function convertLexicalToJSX<TNodes extends SerializedNodeBase = SerializedNodeBase>({\n converters,\n data,\n disableIndent,\n disableTextAlign,\n nodeMap,\n}: ConvertLexicalToJSXArgs<TNodes>): React.ReactNode {\n if (hasText(data)) {\n // Merge nodeMap converters with existing converters\n // NodeMap converters override existing converters\n const nodeMapConverters = nodeMap ? nodeMapToConverters(nodeMap) : undefined\n const mergedConverters = nodeMapConverters\n ? {\n ...converters,\n ...nodeMapConverters,\n blocks: { ...converters.blocks, ...nodeMapConverters.blocks },\n inlineBlocks: { ...converters.inlineBlocks, ...nodeMapConverters.inlineBlocks },\n }\n : converters\n\n return convertLexicalNodesToJSX({\n converters: mergedConverters,\n disableIndent,\n disableTextAlign,\n nodes: data.root.children,\n parent: data.root,\n })\n }\n return <></>\n}\n\nexport function convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes,\n parent,\n}: {\n converters: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent: SerializedLexicalNodeWithParent\n}): React.ReactNode[] {\n const unknownConverter: JSXConverter<any> = converters.unknown as JSXConverter<any>\n\n const jsxArray: React.ReactNode[] = nodes.map((node, i) => {\n let converterForNode: JSXConverter<any> | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[(node as SerializedBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode =\n converters?.inlineBlocks?.[(node as SerializedInlineBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as JSXConverter<any>\n }\n\n try {\n if (!converterForNode && unknownConverter) {\n converterForNode = unknownConverter\n }\n\n let reactNode: React.ReactNode\n if (converterForNode) {\n const converted =\n typeof converterForNode === 'function'\n ? converterForNode({\n childIndex: i,\n converters,\n node,\n nodesToJSX: (args) => {\n return convertLexicalNodesToJSX({\n converters: args.converters ?? converters,\n disableIndent: args.disableIndent ?? disableIndent,\n disableTextAlign: args.disableTextAlign ?? disableTextAlign,\n nodes: args.nodes,\n parent: args.parent ?? {\n ...node,\n parent,\n },\n })\n },\n parent,\n })\n : converterForNode\n reactNode = converted\n } else {\n reactNode = <span key={i}>unknown node</span>\n }\n\n const style: React.CSSProperties = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style.textAlign = 'center'\n break\n case 'end':\n style.textAlign = 'right'\n break\n case 'justify':\n style.textAlign = 'justify'\n break\n case 'left':\n //style.textAlign = 'left'\n // Do nothing, as left is the default\n break\n case 'right':\n style.textAlign = 'right'\n break\n case 'start':\n style.textAlign = 'left'\n break\n }\n }\n }\n\n if (\n !disableIndent &&\n (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))\n ) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style.paddingInlineStart = `${Number(node.indent) * 40}px`\n }\n }\n\n if (React.isValidElement(reactNode)) {\n // Inject style into reactNode\n if (style.textAlign || style.paddingInlineStart) {\n const newStyle = {\n ...style,\n // @ts-expect-error type better later\n ...(reactNode?.props?.style ?? {}),\n // reactNode style comes after, thus a textAlign specified in the converter has priority over the one we inject here\n }\n\n return React.cloneElement(reactNode, {\n key: i,\n // @ts-expect-error type better later\n style: newStyle,\n })\n }\n return React.cloneElement(reactNode, {\n key: i,\n })\n }\n\n return reactNode\n } catch (error) {\n console.error('Error converting lexical node to JSX:', error, 'node:', node)\n return null\n }\n })\n\n return jsxArray.filter(Boolean)\n}\n"],"mappings":"AAAA,+BAA6B,SAAAA,GAAA,IAAAC,IAAA,EAAAC,QAAA,IAAAC,SAAA;AAG7B,OAAOC,KAAA,MAAW;AAYlB,SAASC,OAAO,QAAQ;AAExB;;;AAGA,SAASC,gCAAgCC,OAAqB;EAC5D,OAAQC,IAAA;IACN,MAAMC,aAAA,GAAgB;MACpB,GAAGD,IAAI;MACPE,QAAA,EAAU;MACVC,cAAA,EAAgB;IAClB;IAEA;IACA,IAAIJ,OAAA,CAAQK,SAAS,EAAE;MACrB,OAAOL,OAAA,CAAQK,SAAS,CAACH,aAAA;IAC3B;IAEA;IACA;IACA,IAAIF,OAAA,CAAQM,IAAI,EAAE;MAChB,MAAMC,WAAA,GACJ,OAAOP,OAAA,CAAQM,IAAI,KAAK,aAAaN,OAAA,CAAQM,IAAI,CAACJ,aAAA,IAAiBF,OAAA,CAAQM,IAAI;MAEjF,oBAAOZ,IAAA,CAAC;QAAKc,uBAAA,EAAyB;UAAEC,MAAA,EAAQF;QAAY;;IAC9D;IAEA,OAAO;EACT;AACF;AAEA;;;;AAIA,SAASG,8BAA8BV,OAA+B;EACpE,OAAQC,IAAA;IACN;IACA,IAAID,OAAA,CAAQK,SAAS,EAAE;MACrB,MAAMH,aAAA,GAAgB;QACpB,GAAGD,IAAI;QACPE,QAAA,EAAU;QACVC,cAAA,EAAgB;MAClB;MACA,OAAOJ,OAAA,CAAQK,SAAS,CAACH,aAAA;IAC3B;IAEA;IACA,IAAIF,OAAA,CAAQW,KAAK,EAAE;MACjB,MAAMC,SAAA,GAAYX,IAAA,CAAKY,IAAI;MAC3B,MAAMC,UAAA,GAAiD;QACrDC,UAAA,EAAYd,IAAA,CAAKc,UAAU;QAC3BC,UAAA,EAAYf,IAAA,CAAKe,UAAU;QAC3BC,QAAA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AKoC,IAAI,IACpE;QACA,IAAI,YAAYpC,IAAA,IAAQA,IAAA,CAAK+C,MAAM,IAAI/C,IAAA,CAAKoC,IAAI,KAAK,YAAY;UAC/D;UACA;UACA;UACA;UACAK,KAAA,CAAMO,kBAAkB,GAAG,GAAGC,MAAA,CAAOjD,IAAA,CAAK+C,MAAM,IAAI,MAAM;QAC5D;MACF;MAEA,iBAAI/D,KAAA,CAAMkE,cAAc,CAACX,SAAA,GAAY;QACnC;QACA,IAAIE,KAAA,CAAMK,SAAS,IAAIL,KAAA,CAAMO,kBAAkB,EAAE;UAC/C,MAAMG,QAAA,GAAW;YACf,GAAGV,KAAK;YACR;YACA,IAAIF,SAAA,EAAWa,KAAA,EAAOX,KAAA,IAAS,CAAC,CAAC;UAEnC;UAEA,oBAAOzD,KAAA,CAAMqE,YAAY,CAACd,SAAA,EAAW;YACnCe,GAAA,EAAKpB,CAAA;YACL;YACAO,KAAA,EAAOU;UACT;QACF;QACA,oBAAOnE,KAAA,CAAMqE,YAAY,CAACd,SAAA,EAAW;UACnCe,GAAA,EAAKpB;QACP;MACF;MAEA,OAAOK,SAAA;IACT,EAAE,OAAOD,KAAA,EAAO;MACdD,OAAA,CAAQC,KAAK,CAAC,yCAAyCA,KAAA,EAAO,SAAStC,IAAA;MACvE,OAAO;IACT;EACF;EAEA,OAAOgC,QAAA,CAASuB,MAAM,CAACC,OAAA;AACzB","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { SerializedLexicalNode } from 'lexical';
2
- import type { DefaultNodeTypes, SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js';
2
+ import type { DefaultNodeTypes, SerializedBlockNode, SerializedInlineBlockNode } from '../../../../types/nodeTypes.js';
3
3
  export type JSXConverterArgs<TNode extends {
4
4
  [key: string]: any;
5
5
  type?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"names":[],"mappings":"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AAS;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,MAAM,EAAE;YAAE,IAAI,EAAE,aAAa,CAAA;SAAE,CAAC,SAAS,yBAAyB,CAAC,MAAM,CAAC,CAAC,GAC/E,yBAAyB,CAAC,OAAO,CAAC,CAAC,EAAE;YAAE,SAAS,EAAE,CAAC,CAAA;SAAE,CAAC,CAAC,GACvD,yBAAyB,CAC9B;KACF,CAAA;IACD,OAAO,CAAC,EAAE,YAAY,CAAC,qBAAqB,CAAC,CAAA;CAC9C,CAAA;AACD,MAAM,MAAM,+BAA+B,GAAG;IAC5C,MAAM,CAAC,EAAE,qBAAqB,CAAA;CAC/B,GAAG,qBAAqB,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToJSX/converter/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AAEvC,MAAM,MAAM,gBAAgB,CAC1B,KAAK,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IACzE;IACF,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,aAAa,CAAA;IACzB,IAAI,EAAE,KAAK,CAAA;IACX,UAAU,EAAE,CAAC,IAAI,EAAE;QACjB,UAAU,CAAC,EAAE,aAAa,CAAA;QAC1B,aAAa,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;QAClC,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE,CAAA;QACrC,KAAK,EAAE,qBAAqB,E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alToJSX/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 '../../../../types/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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/lexicalToMarkdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAKnF,eAAO,MAAM,wBAAwB,4BAGlC;IACD,IAAI,EAAE,qBAAqB,CAAA;IAC3B,YAAY,EAAE,2BAA2B,CAAA;CAC1C,KAAG,MAoBH,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/lexicalToMarkdown/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AAKnF,eAAO,MAAM,wBAAwB,GAAI,yBAGtC;IACD,IAAI,EAAE,qBAAqB,CAAA;IAC3B,YAAY,EAAE,2BAA2B,CAAA;CAC1C,KAAG,MAoBH,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"convertLexicalToPlaintext.spec.js","names":["describe","it","expect","convertLexicalToPlaintext","textNode","text","bold","type","detail","format","mode","style","version","linebreakNode","tabNode","paragraphNode","children","direction","indent","textFormat","headingNode","tag","listItemNode","checked","value","listNode","listType","start","tableNode","tableRowNode","tableCellNode","headerState","rootNode","nodes","root","data","plaintext","toBe"],"sources":["../../../../src/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport type {\n DefaultNodeTypes,\n DefaultTypedEditorState,\n SerializedTabNode,\n SerializedParagraphNode,\n SerializedTextNode,\n SerializedLineBreakNode,\n SerializedHeadingNode,\n SerializedListItemNode,\n SerializedListNode,\n SerializedTableRowNode,\n SerializedTableNode,\n SerializedTableCellNode,\n} from '../../../nodeTypes.js'\nimport { convertLexicalToPlaintext } from './sync/index.js'\n\nfunction textNode(text: string, bold?: boolean): SerializedTextNode {\n return {\n type: 'text',\n detail: 0,\n format: bold ? 1 : 0,\n mode: 'normal',\n style: '',\n text,\n version: 1,\n }\n}\n\nfunction linebreakNode(): SerializedLineBreakNode {\n return {\n type: 'linebreak',\n version: 1,\n }\n}\n\nfunction tabNode(): SerializedTabNode {\n return {\n type: 'tab',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text: '',\n version: 1,\n }\n}\n\nfunction paragraphNode(children: DefaultNodeTypes[]): SerializedParagraphNode {\n return {\n type: 'paragraph',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n textFormat: 0,\n version: 1,\n }\n}\n\nfunction headingNode(children: DefaultNodeTypes[]): SerializedHeadingNode {\n return {\n type: 'heading',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n textFormat: 0,\n tag: 'h1',\n version: 1,\n }\n}\n\nfunction listItemNode(children: DefaultNodeTypes[]): SerializedListItemNode {\n return {\n type: 'listitem',\n children,\n checked: false,\n direction: 'ltr',\n format: '',\n indent: 0,\n value: 0,\n version: 1,\n }\n}\n\nfunction listNode(children: DefaultNodeTypes[]): SerializedListNode {\n return {\n type: 'list',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n listType: 'bullet',\n start: 0,\n tag: 'ul',\n version: 1,\n }\n}\n\nfunction tableNode(children: (DefaultNodeTypes | SerializedTableRowNode)[]): SerializedTableNode {\n return {\n type: 'table',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n }\n}\n\nfunction tableRowNode(\n children: (DefaultNodeTypes | SerializedTableCellNode)[],\n): SerializedTableRowNode {\n return {\n type: 'tablerow',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n }\n}\n\nfunction tableCellNode(children: DefaultNodeTypes[]): SerializedTableCellNode {\n return {\n type: 'tablecell',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n headerState: 0,\n version: 1,\n }\n}\n\nfunction rootNode(nodes: (DefaultNodeTypes | SerializedTableNode)[]): DefaultTypedEditorState {\n return {\n root: {\n type: 'root',\n children: nodes,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n },\n }\n}\n\ndescribe('convertLexicalToPlaintext', () => {\n it('ensure paragraph with text is correctly converted', () => {\n const data: DefaultTypedEditorState = rootNode([paragraphNode([textNode('Basic Text')])])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text')\n })\n\n it('ensure paragraph with multiple text nodes is correctly converted', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), textNode(' Bold', true), textNode(' Text')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text Bold Text')\n })\n\n it('ensure linebreaks are converted correctly', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), linebreakNode(), textNode('Next Line')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text\\nNext Line')\n })\n\n it('ensure tabs are converted correctly', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), tabNode(), textNode('Next Line')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text\\tNext Line')\n })\n\n it('ensure new lines are added between paragraphs', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic text')]),\n paragraphNode([textNode('Next block-node')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic text\\n\\nNext block-node')\n })\n\n it('ensure new lines are added between heading nodes', () => {\n const data: DefaultTypedEditorState = rootNode([\n headingNode([textNode('Basic text')]),\n headingNode([textNode('Next block-node')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic text\\n\\nNext block-node')\n })\n\n it('ensure new lines are added between list items and lists', () => {\n const data: DefaultTypedEditorState = rootNode([\n listNode([listItemNode([textNode('First item')]), listItemNode([textNode('Second item')])]),\n listNode([listItemNode([textNode('Next list')])]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('First item\\nSecond item\\n\\nNext list')\n })\n\n it('ensure new lines are added between tables, table rows, and table cells', () => {\n const data: DefaultTypedEditorState = rootNode([\n tableNode([\n tableRowNode([\n tableCellNode([textNode('Cell 1, Row 1')]),\n tableCellNode([textNode('Cell 2, Row 1')]),\n ]),\n tableRowNode([\n tableCellNode([textNode('Cell 1, Row 2')]),\n tableCellNode([textNode('Cell 2, Row 2')]),\n ]),\n ]),\n tableNode([tableRowNode([tableCellNode([textNode('Cell in Table 2')])])]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe(\n 'Cell 1, Row 1 | Cell 2, Row 1\\nCell 1, Row 2 | Cell 2, Row 2\\n\\nCell in Table 2',\n )\n })\n})\n"],"mappings":"AAAA,SAASA,QAAQ,EA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c,GAAGkB,YAAA,CAAa,CAAClB,QAAA,CAAS,eAAe,EAAE,GAC1FqB,QAAA,CAAS,CAACH,YAAA,CAAa,CAAClB,QAAA,CAAS,aAAa,EAAE,EACjD;IAED,MAAMgC,SAAA,GAAYjC,yBAAA,CAA0B;MAC1CgC;IACF;IAEAjC,MAAA,CAAOkC,SAAA,EAAWC,IAAI,CAAC;EACzB;EAEApC,EAAA,CAAG,0EAA0E;IAC3E,MAAMkC,IAAA,GAAgCH,QAAA,CAAS,CAC7CJ,SAAA,CAAU,CACRC,YAAA,CAAa,CACXC,aAAA,CAAc,CAAC1B,QAAA,CAAS,iBAAiB,GACzC0B,aAAA,CAAc,CAAC1B,QAAA,CAAS,iBAAiB,EAC1C,GACDyB,YAAA,CAAa,CACXC,aAAA,CAAc,CAAC1B,QAAA,CAAS,iBAAiB,GACzC0B,aAAA,CAAc,CAAC1B,QAAA,CAAS,iBAAiB,EAC1C,EACF,GACDwB,SAAA,CAAU,CAACC,YAAA,CAAa,CAACC,aAAA,CAAc,CAAC1B,QAAA,CAAS,mBAAmB,EAAE,EAAE,EACzE;IAED,MAAMgC,SAAA,GAAYjC,yBAAA,CAA0B;MAC1CgC;IACF;IAEAjC,MAAA,CAAOkC,SAAA,EAAWC,IAAI,CACpB;EAEJ;AACF","ignoreList":[]}
1
+ {"version":3,"file":"convertLexicalToPlaintext.spec.js","names":["describe","it","expect","convertLexicalToPlaintext","textNode","text","bold","type","detail","format","mode","style","version","linebreakNode","tabNode","paragraphNode","children","direction","indent","textFormat","headingNode","tag","listItemNode","checked","value","listNode","listType","start","tableNode","tableRowNode","tableCellNode","headerState","rootNode","nodes","root","data","plaintext","toBe"],"sources":["../../../../src/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.ts"],"sourcesContent":["import { describe, it, expect } from 'vitest'\nimport type {\n DefaultNodeTypes,\n DefaultTypedEditorState,\n SerializedTabNode,\n SerializedParagraphNode,\n SerializedTextNode,\n SerializedLineBreakNode,\n SerializedHeadingNode,\n SerializedListItemNode,\n SerializedListNode,\n SerializedTableRowNode,\n SerializedTableNode,\n SerializedTableCellNode,\n} from '../../../types/nodeTypes.js'\nimport { convertLexicalToPlaintext } from './sync/index.js'\n\nfunction textNode(text: string, bold?: boolean): SerializedTextNode {\n return {\n type: 'text',\n detail: 0,\n format: bold ? 1 : 0,\n mode: 'normal',\n style: '',\n text,\n version: 1,\n }\n}\n\nfunction linebreakNode(): SerializedLineBreakNode {\n return {\n type: 'linebreak',\n version: 1,\n }\n}\n\nfunction tabNode(): SerializedTabNode {\n return {\n type: 'tab',\n detail: 0,\n format: 0,\n mode: 'normal',\n style: '',\n text: '',\n version: 1,\n }\n}\n\nfunction paragraphNode(children: DefaultNodeTypes[]): SerializedParagraphNode {\n return {\n type: 'paragraph',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n textFormat: 0,\n version: 1,\n }\n}\n\nfunction headingNode(children: DefaultNodeTypes[]): SerializedHeadingNode {\n return {\n type: 'heading',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n textFormat: 0,\n tag: 'h1',\n version: 1,\n }\n}\n\nfunction listItemNode(children: DefaultNodeTypes[]): SerializedListItemNode {\n return {\n type: 'listitem',\n children,\n checked: false,\n direction: 'ltr',\n format: '',\n indent: 0,\n value: 0,\n version: 1,\n }\n}\n\nfunction listNode(children: DefaultNodeTypes[]): SerializedListNode {\n return {\n type: 'list',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n listType: 'bullet',\n start: 0,\n tag: 'ul',\n version: 1,\n }\n}\n\nfunction tableNode(children: (DefaultNodeTypes | SerializedTableRowNode)[]): SerializedTableNode {\n return {\n type: 'table',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n }\n}\n\nfunction tableRowNode(\n children: (DefaultNodeTypes | SerializedTableCellNode)[],\n): SerializedTableRowNode {\n return {\n type: 'tablerow',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n }\n}\n\nfunction tableCellNode(children: DefaultNodeTypes[]): SerializedTableCellNode {\n return {\n type: 'tablecell',\n children,\n direction: 'ltr',\n format: '',\n indent: 0,\n headerState: 0,\n version: 1,\n }\n}\n\nfunction rootNode(nodes: (DefaultNodeTypes | SerializedTableNode)[]): DefaultTypedEditorState {\n return {\n root: {\n type: 'root',\n children: nodes,\n direction: 'ltr',\n format: '',\n indent: 0,\n version: 1,\n },\n }\n}\n\ndescribe('convertLexicalToPlaintext', () => {\n it('ensure paragraph with text is correctly converted', () => {\n const data: DefaultTypedEditorState = rootNode([paragraphNode([textNode('Basic Text')])])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text')\n })\n\n it('ensure paragraph with multiple text nodes is correctly converted', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), textNode(' Bold', true), textNode(' Text')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text Bold Text')\n })\n\n it('ensure linebreaks are converted correctly', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), linebreakNode(), textNode('Next Line')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text\\nNext Line')\n })\n\n it('ensure tabs are converted correctly', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic Text'), tabNode(), textNode('Next Line')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic Text\\tNext Line')\n })\n\n it('ensure new lines are added between paragraphs', () => {\n const data: DefaultTypedEditorState = rootNode([\n paragraphNode([textNode('Basic text')]),\n paragraphNode([textNode('Next block-node')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic text\\n\\nNext block-node')\n })\n\n it('ensure new lines are added between heading nodes', () => {\n const data: DefaultTypedEditorState = rootNode([\n headingNode([textNode('Basic text')]),\n headingNode([textNode('Next block-node')]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('Basic text\\n\\nNext block-node')\n })\n\n it('ensure new lines are added between list items and lists', () => {\n const data: DefaultTypedEditorState = rootNode([\n listNode([listItemNode([textNode('First item')]), listItemNode([textNode('Second item')])]),\n listNode([listItemNode([textNode('Next list')])]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe('First item\\nSecond item\\n\\nNext list')\n })\n\n it('ensure new lines are added between tables, table rows, and table cells', () => {\n const data: DefaultTypedEditorState = rootNode([\n tableNode([\n tableRowNode([\n tableCellNode([textNode('Cell 1, Row 1')]),\n tableCellNode([textNode('Cell 2, Row 1')]),\n ]),\n tableRowNode([\n tableCellNode([textNode('Cell 1, Row 2')]),\n tableCellNode([textNode('Cell 2, Row 2')]),\n ]),\n ]),\n tableNode([tableRowNode([tableCellNode([textNode('Cell in Table 2')])])]),\n ])\n\n const plaintext = convertLexicalToPlaintext({\n data,\n })\n\n expect(plaintext).toBe(\n 'Cell 1, Row 1 | Cell 2, Row 1\\nCell 1, Row 2 | Cell 2, Row 2\\n\\nCell in Table 2',\n )\n })\n})\n"],"mappings":"AAAA,SAASA,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ;AAerC,SAASC,yBAAyB,QAAQ;AAE1C,SAASC,SAASC,IAAY,EAAEC,IAAc;EAC5C,OAAO;IACLC,IAAA,EAAM;IACNC,MAAA,EAAQ;IACRC,MAAA,EAAQH,IAAA,GAAO,IAAI;IACnBI,IAAA,EAAM;IACNC,KAAA,EAAO;IACPN,IAAA;IACAO,OAAA,EAAS;EACX;AACF;AAEA,SAASC,cAAA;EACP,OAAO;IACLN,IAAA,EAAM;IACNK,OAAA,EAAS;EACX;AACF;AAEA,SAASE,QAAA;EACP,OAAO;IACLP,IAAA,EAAM;IACNC,MAAA,EAAQ;IACRC,MAAA,EAAQ;IACRC,IAAA,EAAM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iBAAiB,EAC1C,GACDyB,YAAA,CAAa,CACXC,aAAA,CAAc,CAAC1B,QAAA,CAAS,iBAAiB,GACzC0B,aAAA,CAAc,CAAC1B,QAAA,CAAS,iBAAiB,EAC1C,EACF,GACDwB,SAAA,CAAU,CAACC,YAAA,CAAa,CAACC,aAAA,CAAc,CAAC1B,QAAA,CAAS,mBAAmB,EAAE,EAAE,EACzE;IAED,MAAMgC,SAAA,GAAYjC,yBAAA,CAA0B;MAC1CgC;IACF;IAEAjC,MAAA,CAAOkC,SAAA,EAAWC,IAAI,CACpB;EAEJ;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"findConverterForNode.js","names":["findConverterForNode","converters","node","converterForNode","type","blocks","fields","blockType","inlineBlocks"],"sources":["../../../../../src/features/converters/lexicalToPlaintext/shared/findConverterForNode.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js'\nimport type { PlaintextConverter, PlaintextConverters } from '../sync/types.js'\n\nexport function findConverterForNode<\n TConverters extends PlaintextConverters,\n TConverter extends PlaintextConverter<any>,\n>({\n converters,\n\n node,\n}: {\n converters: TConverters\n node: SerializedLexicalNode\n}): TConverter | undefined {\n let converterForNode: TConverter | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[\n (node as SerializedBlockNode)?.fields?.blockType\n ] as TConverter\n } else if (node.type === 'inlineBlock') {\n converterForNode = converters?.inlineBlocks?.[\n (node as SerializedInlineBlockNode)?.fields?.blockType\n ] as TConverter\n } else {\n converterForNode = converters[node.type] as TConverter\n }\n\n return converterForNode\n}\n"],"mappings":"AAKA,OAAO,SAASA,qBAGd;EACAC,UAAU;EAEVC;AAAI,CAIL;EACC,IAAIC,gBAAA;EACJ,IAAID,IAAA,CAAKE,IAAI,KAAK,SAAS;IACzBD,gBAAA,GAAmBF,UAAA,EAAYI,MAAA,GAC5BH,IAAA,EAA8BI,MAAA,EAAQC,SAAA,CACxC;EACH,OAAO,IAAIL,IAAA,CAAKE,IAAI,KAAK,eAAe;IACtCD,gBAAA,GAAmBF,UAAA,EAAYO,YAAA,GAC5BN,IAAA,EAAoCI,MAAA,EAAQC,SAAA,CAC9C;EACH,OAAO;IACLJ,gBAAA,GAAmBF,UAAU,CAACC,IAAA,CAAKE,IAAI,CAAC;EAC1C;EAEA,OAAOD,gBAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"findConverterForNode.js","names":["findConverterForNode","converters","node","converterForNode","type","blocks","fields","blockType","inlineBlocks"],"sources":["../../../../../src/features/converters/lexicalToPlaintext/shared/findConverterForNode.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../types/nodeTypes.js'\nimport type { PlaintextConverter, PlaintextConverters } from '../sync/types.js'\n\nexport function findConverterForNode<\n TConverters extends PlaintextConverters,\n TConverter extends PlaintextConverter<any>,\n>({\n converters,\n\n node,\n}: {\n converters: TConverters\n node: SerializedLexicalNode\n}): TConverter | undefined {\n let converterForNode: TConverter | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[\n (node as SerializedBlockNode)?.fields?.blockType\n ] as TConverter\n } else if (node.type === 'inlineBlock') {\n converterForNode = converters?.inlineBlocks?.[\n (node as SerializedInlineBlockNode)?.fields?.blockType\n ] as TConverter\n } else {\n converterForNode = converters[node.type] as TConverter\n }\n\n return converterForNode\n}\n"],"mappings":"AAKA,OAAO,SAASA,qBAGd;EACAC,UAAU;EAEVC;AAAI,CAIL;EACC,IAAIC,gBAAA;EACJ,IAAID,IAAA,CAAKE,IAAI,KAAK,SAAS;IACzBD,gBAAA,GAAmBF,UAAA,EAAYI,MAAA,GAC5BH,IAAA,EAA8BI,MAAA,EAAQC,SAAA,CACxC;EACH,OAAO,IAAIL,IAAA,CAAKE,IAAI,KAAK,eAAe;IACtCD,gBAAA,GAAmBF,UAAA,EAAYO,YAAA,GAC5BN,IAAA,EAAoCI,MAAA,EAAQC,SAAA,CAC9C;EACH,OAAO;IACLJ,gBAAA,GAAmBF,UAAU,CAACC,IAAA,CAAKE,IAAI,CAAC;EAC1C;EAEA,OAAOD,gBAAA;AACT","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { SerializedLexicalNode } from 'lexical';
2
- import type { DefaultNodeTypes, SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js';
2
+ import type { DefaultNodeTypes, SerializedBlockNode, SerializedInlineBlockNode } from '../../../../types/nodeTypes.js';
3
3
  import type { SerializedLexicalNodeWithParent } from '../shared/types.js';
4
4
  export type PlaintextConverter<T extends {
5
5
  [key: string]: any;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToPlaintext/sync/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,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAA;AAEzE,MAAM,MAAM,kBAAkB,CAC5B,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IAErE,CAAC,CAAC,IAAI,EAAE;IACN,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,mBAAmB,CAAA;IAC/B,IAAI,EAAE,CAAC,CAAA;IACP,gBAAgB,EAAE,CAAC,IAAI,EAAE;QACvB,UAAU,CAAC,EAAE,mBAAmB,CAAA;QAChC,KAAK,EAAE,qBAAqB,EAAE,CAAA;QAC9B,MAAM,CAAC,EAAE,+BAA+B,CAAA;KACzC,KAAK,MAAM,EAAE,CAAA;IACd,MAAM,EAAE,+BAA+B,CAAA;CACx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AS,mBAAmB,CAAC,MAAM,CAAC,CAAC,GAC9D,mBAAmB,CAAC,OAAO,CAAC,CAAC,EAAE;YAAE,SAAS,EAAE,CAAC,CAAA;SAAE,CAAC,CAAC,GACjD,mBAAmB,CACxB;KACF,CAAA;IACD,YAAY,CAAC,EAAE;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,kBAAkB,CACrB,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;CACF,CAAA"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/features/converters/lexicalToPlaintext/sync/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EACV,gBAAgB,EAChB,mBAAmB,EACnB,yBAAyB,EAC1B,MAAM,gCAAgC,CAAA;AACvC,OAAO,KAAK,EAAE,+BAA+B,EAAE,MAAM,oBAAoB,CAAA;AAEzE,MAAM,MAAM,kBAAkB,CAC5B,CAAC,SAAS;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,qBAAqB,IAErE,CAAC,CAAC,IAAI,EAAE;IACN,UAAU,EAAE,MAAM,CAAA;IAClB,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;SAAE,CAAC,SAAS,mBAAmB,CAAC,MAAM,CAAC,CAAC,GAC9D,CAAC,SAAS;YAAE,SAAS,EAAE,MAAM,CAAA;SAAE,GAC7B,CAAC,CAAC,WAAW,CAAC,GACd,KAAK,GACP,KAAK,EACT,MAAM,CACP,CAAC,CAAC,EAAE,kBAAkB,CACrB,OAAO,CAAC,CAAC,EAAE;YAAE,IAAI,EAAE,OAAO,CAAA;SAAE,CAAC,SAAS,mBAAmB,CAAC,MAAM,CAAC,CAAC,GAC9D,mBAAmB,CAAC,OAAO,CAAC,CAAC,EAAE;YAAE,SAAS,EAAE,CAAC,CAAA;SAAE,CAAC,CAAC,GACjD,mBAAmB,CACxB;KACF,CAAA;IACD,YAAY,CAAC,EAAE;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,kBAAkB,CACrB,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;CACF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToPlaintext/sync/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../nodeTypes.js'\nimport type { SerializedLexicalNodeWithParent } from '../shared/types.js'\n\nexport type PlaintextConverter<\n T extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> =\n | ((args: {\n childIndex: number\n converters: PlaintextConverters\n node: T\n nodesToPlaintext: (args: {\n converters?: PlaintextConverters\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => string[]\n parent: SerializedLexicalNodeWithParent\n }) => string)\n | string\n\nexport type DefaultPlaintextNodeTypes =\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 }>\n\nexport type PlaintextConverters<\n T extends { [key: string]: any; type?: string } = DefaultPlaintextNodeTypes,\n> = {\n [key: string]:\n | {\n [blockSlug: string]: PlaintextConverter<any>\n }\n | PlaintextConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: PlaintextConverter<\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 >]?: PlaintextConverter<\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 >]?: PlaintextConverter<\n Extract<T, { type: 'inlineBlock' }> extends SerializedInlineBlockNode<infer B>\n ? SerializedInlineBlockNode<Extract<B, { blockType: K }>>\n : SerializedInlineBlockNode\n >\n }\n}\n"],"mappings":"AA8BA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../../../src/features/converters/lexicalToPlaintext/sync/types.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type {\n DefaultNodeTypes,\n SerializedBlockNode,\n SerializedInlineBlockNode,\n} from '../../../../types/nodeTypes.js'\nimport type { SerializedLexicalNodeWithParent } from '../shared/types.js'\n\nexport type PlaintextConverter<\n T extends { [key: string]: any; type?: string } = SerializedLexicalNode,\n> =\n | ((args: {\n childIndex: number\n converters: PlaintextConverters\n node: T\n nodesToPlaintext: (args: {\n converters?: PlaintextConverters\n nodes: SerializedLexicalNode[]\n parent?: SerializedLexicalNodeWithParent\n }) => string[]\n parent: SerializedLexicalNodeWithParent\n }) => string)\n | string\n\nexport type DefaultPlaintextNodeTypes =\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 }>\n\nexport type PlaintextConverters<\n T extends { [key: string]: any; type?: string } = DefaultPlaintextNodeTypes,\n> = {\n [key: string]:\n | {\n [blockSlug: string]: PlaintextConverter<any>\n }\n | PlaintextConverter<any>\n | undefined\n} & {\n [nodeType in Exclude<NonNullable<T['type']>, 'block' | 'inlineBlock'>]?: PlaintextConverter<\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 >]?: PlaintextConverter<\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 >]?: PlaintextConverter<\n Extract<T, { type: 'inlineBlock' }> extends SerializedInlineBlockNode<infer B>\n ? SerializedInlineBlockNode<Extract<B, { blockType: K }>>\n : SerializedInlineBlockNode\n >\n }\n}\n"],"mappings":"AA8BA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { SerializedLexicalNode } from 'lexical';
2
2
  import type { SanitizedServerEditorConfig } from '../../../lexical/config/types.js';
3
- import type { DefaultNodeTypes, TypedEditorState } from '../../../nodeTypes.js';
3
+ import type { DefaultNodeTypes, TypedEditorState } from '../../../types/nodeTypes.js';
4
4
  export declare const convertMarkdownToLexical: <TNodeTypes extends SerializedLexicalNode = DefaultNodeTypes>({ editorConfig, markdown, }: {
5
5
  editorConfig: SanitizedServerEditorConfig;
6
6
  markdown: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/markdownToLexical/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAA;AAK/E,eAAO,MAAM,wBAAwB,GACnC,UAAU,SAAS,qBAAqB,kDAIvC;IACD,YAAY,EAAE,2BAA2B,CAAA;IACzC,QAAQ,EAAE,MAAM,CAAA;CACjB,KAAG,gBAAgB,CAAC,UAAU,CAiB9B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/converters/markdownToLexical/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAA;AACnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAA;AAKrF,eAAO,MAAM,wBAAwB,GACnC,UAAU,SAAS,qBAAqB,GAAG,gBAAgB,EAC3D,6BAGC;IACD,YAAY,EAAE,2BAA2B,CAAA;IACzC,QAAQ,EAAE,MAAM,CAAA;CACjB,KAAG,gBAAgB,CAAC,UAAU,CAiB9B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["createHeadlessEditor","getEnabledNodes","$convertFromMarkdownString","convertMarkdownToLexical","editorConfig","markdown","headlessEditor","nodes","update","features","markdownTransformers","discrete","editorJSON","getEditorState","toJSON"],"sources":["../../../../src/features/converters/markdownToLexical/index.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\n\nimport type { SanitizedServerEditorConfig } from '../../../lexical/config/types.js'\nimport type { DefaultNodeTypes, TypedEditorState } from '../../../nodeTypes.js'\n\nimport { getEnabledNodes } from '../../../lexical/nodes/index.js'\nimport { $convertFromMarkdownString } from '../../../packages/@lexical/markdown/index.js'\n\nexport const convertMarkdownToLexical = <\n TNodeTypes extends SerializedLexicalNode = DefaultNodeTypes,\n>({\n editorConfig,\n markdown,\n}: {\n editorConfig: SanitizedServerEditorConfig\n markdown: string\n}): TypedEditorState<TNodeTypes> => {\n const headlessEditor = createHeadlessEditor({\n nodes: getEnabledNodes({\n editorConfig,\n }),\n })\n\n headlessEditor.update(\n () => {\n $convertFromMarkdownString(markdown, editorConfig.features.markdownTransformers)\n },\n { discrete: true },\n )\n\n const editorJSON = headlessEditor.getEditorState().toJSON()\n\n return editorJSON as TypedEditorState<TNodeTypes>\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAKrC,SAASC,eAAe,QAAQ;AAChC,SAASC,0BAA0B,QAAQ;AAE3C,OAAO,MAAMC,wBAAA,GAA2BA,CAEtC;EACAC,YAAY;EACZC;AAAQ,CAIT;EACC,MAAMC,cAAA,GAAiBN,oBAAA,CAAqB;IAC1CO,KAAA,EAAON,eAAA,CAAgB;MACrBG;IACF;EACF;EAEAE,cAAA,CAAeE,MAAM,CACnB;IACEN,0BAAA,CAA2BG,QAAA,EAAUD,YAAA,CAAaK,QAAQ,CAACC,oBAAoB;EACjF,GACA;IAAEC,QAAA,EAAU;EAAK;EAGnB,MAAMC,UAAA,GAAaN,cAAA,CAAeO,cAAc,GAAGC,MAAM;EAEzD,OAAOF,UAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["createHeadlessEditor","getEnabledNodes","$convertFromMarkdownString","convertMarkdownToLexical","editorConfig","markdown","headlessEditor","nodes","update","features","markdownTransformers","discrete","editorJSON","getEditorState","toJSON"],"sources":["../../../../src/features/converters/markdownToLexical/index.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\n\nimport type { SanitizedServerEditorConfig } from '../../../lexical/config/types.js'\nimport type { DefaultNodeTypes, TypedEditorState } from '../../../types/nodeTypes.js'\n\nimport { getEnabledNodes } from '../../../lexical/nodes/index.js'\nimport { $convertFromMarkdownString } from '../../../packages/@lexical/markdown/index.js'\n\nexport const convertMarkdownToLexical = <\n TNodeTypes extends SerializedLexicalNode = DefaultNodeTypes,\n>({\n editorConfig,\n markdown,\n}: {\n editorConfig: SanitizedServerEditorConfig\n markdown: string\n}): TypedEditorState<TNodeTypes> => {\n const headlessEditor = createHeadlessEditor({\n nodes: getEnabledNodes({\n editorConfig,\n }),\n })\n\n headlessEditor.update(\n () => {\n $convertFromMarkdownString(markdown, editorConfig.features.markdownTransformers)\n },\n { discrete: true },\n )\n\n const editorJSON = headlessEditor.getEditorState().toJSON()\n\n return editorJSON as TypedEditorState<TNodeTypes>\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAKrC,SAASC,eAAe,QAAQ;AAChC,SAASC,0BAA0B,QAAQ;AAE3C,OAAO,MAAMC,wBAAA,GAA2BA,CAEtC;EACAC,YAAY;EACZC;AAAQ,CAIT;EACC,MAAMC,cAAA,GAAiBN,oBAAA,CAAqB;IAC1CO,KAAA,EAAON,eAAA,CAAgB;MACrBG;IACF;EACF;EAEAE,cAAA,CAAeE,MAAM,CACnB;IACEN,0BAAA,CAA2BG,QAAA,EAAUD,YAAA,CAAaK,QAAQ,CAACC,oBAAoB;EACjF,GACA;IAAEC,QAAA,EAAU;EAAK;EAGnB,MAAMC,UAAA,GAAaN,cAAA,CAAeO,cAAc,GAAGC,MAAM;EAEzD,OAAOF,UAAA;AACT","ignoreList":[]}
@@ -1,3 +1,3 @@
1
- import './style.scss';
1
+ import './style.css';
2
2
  export declare function RichTextPlugin(): import("react").JSX.Element;
3
3
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/debug/jsxConverter/client/plugin/index.tsx"],"names":[],"mappings":"AAOA,OAAO,cAAc,CAAA;AAErB,wBAAgB,cAAc,gCAe7B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/debug/jsxConverter/client/plugin/index.tsx"],"names":[],"mappings":"AAOA,OAAO,aAAa,CAAA;AAEpB,wBAAgB,cAAc,gCAe7B"}
@@ -6,6 +6,7 @@ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext
6
6
  import { useEffect, useState } from 'react';
7
7
  // eslint-disable-next-line payload/no-imports-from-exports-dir
8
8
  import { defaultJSXConverters, RichText } from '../../../../../exports/react/index.js';
9
+ import './style.css';
9
10
  export function RichTextPlugin() {
10
11
  const $ = _c(7);
11
12
  const [editor] = useLexicalComposerContext();
@@ -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.css'\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;AAC/C,OAAO;AAEP,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":[]}
@@ -0,0 +1,9 @@
1
+ .debug-jsx-converter {
2
+ padding-left: var(--spacer-5);
3
+
4
+ ul,
5
+ ol {
6
+ padding-left: revert;
7
+ margin: revert;
8
+ }
9
+ }
@@ -0,0 +1,51 @@
1
+ @layer payload-default {
2
+ .test-recorder-output {
3
+ margin: var(--spacer-4) auto var(--spacer-4) auto;
4
+ width: 100%;
5
+ }
6
+ .test-recorder-toolbar {
7
+ display: flex;
8
+ }
9
+
10
+ .test-recorder-button {
11
+ position: relative;
12
+ display: block;
13
+ font-size: var(--text-body-small-font-size);
14
+ padding: var(--spacer-1);
15
+ border-radius: var(--radius-medium);
16
+ border: none;
17
+ cursor: pointer;
18
+ outline: none;
19
+ box-shadow: 1px 2px 2px rgba(0, 0, 0, 0.4);
20
+ background-color: #222;
21
+ color: white;
22
+ transition: box-shadow 50ms ease-out;
23
+ }
24
+
25
+ .test-recorder-button:active {
26
+ box-shadow: 1px 2px 4px rgba(0, 0, 0, 0.4);
27
+ }
28
+
29
+ .test-recorder-button + .test-recorder-button {
30
+ margin-left: var(--spacer-1);
31
+ }
32
+
33
+ .test-recorder-button::after {
34
+ content: '';
35
+ position: absolute;
36
+ top: var(--spacer-2);
37
+ right: var(--spacer-2);
38
+ bottom: var(--spacer-2);
39
+ left: var(--spacer-2);
40
+ display: block;
41
+ background-size: contain;
42
+ filter: invert(1);
43
+ }
44
+ #test-recorder-button {
45
+ position: relative;
46
+ }
47
+
48
+ #test-recorder-button-snapshot {
49
+ margin-right: auto;
50
+ }
51
+ }
@@ -1,5 +1,5 @@
1
1
  import type { PluginComponent } from '../../../../typesClient.js';
2
- import './index.scss';
2
+ import './index.css';
3
3
  export declare function isSelectAll(event: KeyboardEvent): boolean;
4
4
  export declare const TestRecorderPlugin: PluginComponent<undefined>;
5
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/debug/testRecorder/client/plugin/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,cAAc,CAAA;AA8ErB,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAEzD;AAmWD,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,SAAS,CAYzD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/debug/testRecorder/client/plugin/index.tsx"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,aAAa,CAAA;AA8EpB,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAEzD;AAmWD,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,SAAS,CAYzD,CAAA"}
@@ -7,6 +7,7 @@ import { $createParagraphNode, $createTextNode, $getRoot, getDOMSelection } from
7
7
  import * as React from 'react';
8
8
  import { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react';
9
9
  import { IS_APPLE } from '../../../../../lexical/utils/environment.js';
10
+ import './index.css';
10
11
  const copy = text => {
11
12
  const textArea = document.createElement('textarea');
12
13
  textArea.value = text || '';
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$createParagraphNode","$createTextNode","$getRoot","getDOMSelection","React","useCallback","useEffect","useLayoutEffect","useRef","useState","IS_APPLE","copy","text","textArea","document","createElement","value","style","position","opacity","body","appendChild","focus","select","result","execCommand","console","log","error","removeChild","download","filename","a","setAttribute","encodeURIComponent","display","click","formatStep","step","formatOneStep","name","x","y","anchorPath","toString","anchorOffset","focusPath","focusOffset","formattedStep","count","join","isSelectAll","event","key","toLowerCase","metaKey","ctrlKey","sanitizeSelection","selection","anchorNode","focusNode","getPathFromNodeToEditor","node","rootElement","currentNode","path","undefined","unshift","Array","from","parentNode","childNodes","indexOf","keyPresses","Set","useTestRecorder","editor","steps","setSteps","isRecording","setIsRecording","setCurrentInnerHTML","templatedTest","setTemplatedTest","previousSelectionRef","skipNextSelectionChangeRef","preRef","getCurrentEditor","generateTestContent","getRootElement","browserSelection","_window","contains","map","pushStep","currentSteps","currentIndex","length","lastStep","slice","onKeyDown","has","onKeyUp","registerRootListener","prevRootElement","removeEventListener","addEventListener","current","scrollTo","scrollHeight","testContent","removeUpdateListener","registerUpdateListener","dirtyElements","dirtyLeaves","editorState","currentSelection","_selection","previousSelection","skipNextSelectionChange","size","innerHTML","toggleEditorSelection","currentEditor","update","root","clear","append","currentIsRecording","onSnapshotClick","onCopyClick","onDownloadClick","button","_jsx","className","id","onClick","e","preventDefault","title","type","output","_jsxs","ref","TestRecorderPlugin","$","testRecorderButton","testRecorderOutput","t0","Fragment","children"],"sources":["../../../../../../src/features/debug/testRecorder/client/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $createParagraphNode, $createTextNode, $getRoot, getDOMSelection } from 'lexical'\nimport * as React from 'react'\nimport { type JSX, useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nimport { IS_APPLE } from '../../../../../lexical/utils/environment.js'\nimport './index.scss'\n\nconst copy = (text: null | string) => {\n const textArea = document.createElement('textarea')\n textArea.value = text || ''\n textArea.style.position = 'absolute'\n textArea.style.opacity = '0'\n document.body?.appendChild(textArea)\n textArea.focus()\n textArea.select()\n try {\n const result = document.execCommand('copy')\n // eslint-disable-next-line no-console\n console.log(result)\n } catch (error) {\n console.error(error)\n }\n document.body?.removeChild(textArea)\n}\n\nconst download = (filename: string, text: null | string) => {\n const a = document.createElement('a')\n a.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text || ''))\n a.setAttribute('download', filename)\n a.style.display = 'none'\n document.body?.appendChild(a)\n a.click()\n document.body?.removeChild(a)\n}\n\nconst formatStep = (step: Step) => {\n const formatOneStep = (name: string, value: Step['value']) => {\n switch (name) {\n case 'click': {\n return ` await page.mouse.click(${value.x}, ${value.y});`\n }\n case 'keydown': {\n return ` await page.keyboard.keydown('${value}');`\n }\n case 'keyup': {\n return ` await page.keyboard.keyup('${value}');`\n }\n case 'press': {\n return ` await page.keyboard.press('${value}');`\n }\n case 'selectAll': {\n return ` await selectAll(page);`\n }\n case 'snapshot': {\n return ` await assertHTMLSnapshot(page);\n await assertSelection(page, {\n anchorPath: [${value.anchorPath.toString()}],\n anchorOffset: ${value.anchorOffset},\n focusPath: [${value.focusPath.toString()}],\n focusOffset: ${value.focusOffset},\n });\n`\n }\n case 'type': {\n return ` await page.keyboard.type('${value}');`\n }\n default:\n return ``\n }\n }\n const formattedStep = formatOneStep(step.name, step.value)\n switch (step.count) {\n case 1:\n return formattedStep\n case 2:\n return [formattedStep, formattedStep].join(`\\n`)\n default:\n return ` await repeat(${step.count}, async () => {\n ${formattedStep}\n );`\n }\n}\n\nexport function isSelectAll(event: KeyboardEvent): boolean {\n return event.key.toLowerCase() === 'a' && (IS_APPLE ? event.metaKey : event.ctrlKey)\n}\n\n// stolen from LexicalSelection-test\nfunction sanitizeSelection(selection: Selection) {\n const { anchorNode, focusNode } = selection\n let { anchorOffset, focusOffset } = selection\n if (anchorOffset !== 0) {\n anchorOffset--\n }\n if (focusOffset !== 0) {\n focusOffset--\n }\n return { anchorNode, anchorOffset, focusNode, focusOffset }\n}\n\nfunction getPathFromNodeToEditor(node: Node, rootElement: HTMLElement | null) {\n let currentNode: Node | null | undefined = node\n const path: number[] = []\n while (currentNode !== rootElement) {\n if (currentNode !== null && currentNode !== undefined) {\n path.unshift(\n Array.from(currentNode?.parentNode?.childNodes ?? []).indexOf(currentNode as ChildNode),\n )\n }\n currentNode = currentNode?.parentNode\n }\n return path\n}\n\nconst keyPresses = new Set([\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'Backspace',\n 'Delete',\n 'Enter',\n 'Escape',\n])\n\ntype Step = {\n count: number\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any\n}\n\ntype Steps = Step[]\n\nfunction useTestRecorder(editor: LexicalEditor): [JSX.Element, JSX.Element | null] {\n const [steps, setSteps] = useState<Steps>([])\n const [isRecording, setIsRecording] = useState(false)\n const [, setCurrentInnerHTML] = useState('')\n const [templatedTest, setTemplatedTest] = useState('')\n const previousSelectionRef = useRef<BaseSelection | null>(null)\n const skipNextSelectionChangeRef = useRef(false)\n const preRef = useRef<HTMLPreElement>(null)\n\n const getCurrentEditor = useCallback(() => {\n return editor\n }, [editor])\n\n const generateTestContent = useCallback(() => {\n const rootElement = editor.getRootElement()\n const browserSelection = getDOMSelection(editor._window)\n\n if (\n rootElement == null ||\n browserSelection == null ||\n browserSelection.anchorNode == null ||\n browserSelection.focusNode == null ||\n !rootElement.contains(browserSelection.anchorNode) ||\n !rootElement.contains(browserSelection.focusNode)\n ) {\n return null\n }\n\n return `\nimport {\n initializeE2E,\n assertHTMLSnapshot,\n assertSelection,\n repeat,\n} from '../utils';\nimport {selectAll} from '../keyboardShortcuts';\nimport { RangeSelection } from 'lexical';\nimport { NodeSelection } from 'lexical';\n\ndescribe('Test case', () => {\n initializeE2E((e2e) => {\n it('Should pass this test', async () => {\n const {page} = e2e;\n\n await page.focus('div[contenteditable=\"true\"]');\n${steps.map(formatStep).join(`\\n`)}\n });\n});\n `\n }, [editor, steps])\n\n // just a wrapper around inserting new actions so that we can\n // coalesce some actions like insertText/moveNativeSelection\n const pushStep = useCallback(\n (name: string, value: Step['value']) => {\n setSteps((currentSteps) => {\n // trying to group steps\n const currentIndex = steps.length - 1\n const lastStep = steps[currentIndex]\n if (lastStep) {\n if (lastStep.name === name) {\n if (name === 'type') {\n // for typing events we just append the text\n return [\n ...steps.slice(0, currentIndex),\n { ...lastStep, value: lastStep.value + value },\n ]\n } else {\n // for other events we bump the counter if their values are the same\n if (lastStep.value === value) {\n return [...steps.slice(0, currentIndex), { ...lastStep, count: lastStep.count + 1 }]\n }\n }\n }\n }\n // could not group, just append a new one\n return [...currentSteps, { name, count: 1, value }]\n })\n },\n [steps, setSteps],\n )\n\n useLayoutEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (!isRecording) {\n return\n }\n const key = event.key\n if (isSelectAll(event)) {\n pushStep('selectAll', '')\n } else if (keyPresses.has(key)) {\n pushStep('press', event.key)\n } else if ([...key].length > 1) {\n pushStep('keydown', event.key)\n } else {\n pushStep('type', event.key)\n }\n }\n\n const onKeyUp = (event: KeyboardEvent) => {\n if (!isRecording) {\n return\n }\n const key = event.key\n if (!keyPresses.has(key) && [...key].length > 1) {\n pushStep('keyup', event.key)\n }\n }\n\n return editor.registerRootListener(\n (rootElement: HTMLElement | null, prevRootElement: HTMLElement | null) => {\n if (prevRootElement !== null) {\n prevRootElement.removeEventListener('keydown', onKeyDown)\n prevRootElement.removeEventListener('keyup', onKeyUp)\n }\n if (rootElement !== null) {\n rootElement.addEventListener('keydown', onKeyDown)\n rootElement.addEventListener('keyup', onKeyUp)\n }\n },\n )\n }, [editor, isRecording, pushStep])\n\n useLayoutEffect(() => {\n if (preRef.current) {\n preRef.current.scrollTo(0, preRef.current.scrollHeight)\n }\n }, [generateTestContent])\n\n useEffect(() => {\n if (steps) {\n const testContent = generateTestContent()\n if (testContent !== null) {\n setTemplatedTest(testContent)\n }\n if (preRef.current) {\n preRef.current.scrollTo(0, preRef.current.scrollHeight)\n }\n }\n }, [generateTestContent, steps])\n\n useEffect(() => {\n const removeUpdateListener = editor.registerUpdateListener(\n ({ dirtyElements, dirtyLeaves, editorState }) => {\n if (!isRecording) {\n return\n }\n const currentSelection = editorState._selection\n const previousSelection = previousSelectionRef.current\n const skipNextSelectionChange = skipNextSelectionChangeRef.current\n if (previousSelection !== currentSelection) {\n if (dirtyLeaves.size === 0 && dirtyElements.size === 0 && !skipNextSelectionChange) {\n const browserSelection = getDOMSelection(editor._window)\n if (\n browserSelection &&\n (browserSelection.anchorNode == null || browserSelection.focusNode == null)\n ) {\n return\n }\n }\n previousSelectionRef.current = currentSelection\n }\n skipNextSelectionChangeRef.current = false\n const testContent = generateTestContent()\n if (testContent !== null) {\n setTemplatedTest(testContent)\n }\n },\n )\n return removeUpdateListener\n }, [editor, generateTestContent, isRecording, pushStep])\n\n // save innerHTML\n useEffect(() => {\n if (!isRecording) {\n return\n }\n const removeUpdateListener = editor.registerUpdateListener(() => {\n const rootElement = editor.getRootElement()\n if (rootElement !== null) {\n setCurrentInnerHTML(rootElement?.innerHTML)\n }\n })\n return removeUpdateListener\n }, [editor, isRecording])\n\n // clear editor and start recording\n const toggleEditorSelection = useCallback(\n (currentEditor: LexicalEditor) => {\n if (!isRecording) {\n currentEditor.update(() => {\n const root = $getRoot()\n root.clear()\n const text = $createTextNode()\n root.append($createParagraphNode().append(text))\n text.select()\n })\n setSteps([])\n }\n setIsRecording((currentIsRecording) => !currentIsRecording)\n },\n [isRecording],\n )\n\n const onSnapshotClick = useCallback(() => {\n if (!isRecording) {\n return\n }\n const browserSelection = getDOMSelection(editor._window)\n if (\n browserSelection === null ||\n browserSelection.anchorNode == null ||\n browserSelection.focusNode == null\n ) {\n return\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = sanitizeSelection(browserSelection)\n const rootElement = getCurrentEditor().getRootElement()\n let anchorPath\n if (anchorNode !== null) {\n anchorPath = getPathFromNodeToEditor(anchorNode, rootElement)\n }\n let focusPath\n if (focusNode !== null) {\n focusPath = getPathFromNodeToEditor(focusNode, rootElement)\n }\n pushStep('snapshot', {\n anchorNode,\n anchorOffset,\n anchorPath,\n focusNode,\n focusOffset,\n focusPath,\n })\n }, [pushStep, isRecording, getCurrentEditor])\n\n const onCopyClick = useCallback(() => {\n copy(generateTestContent())\n }, [generateTestContent])\n\n const onDownloadClick = useCallback(() => {\n download('test.js', generateTestContent())\n }, [generateTestContent])\n\n const button = (\n <button\n className={`editor-dev-button ${isRecording ? 'active' : ''}`}\n id=\"test-recorder-button\"\n onClick={(e) => {\n toggleEditorSelection(getCurrentEditor())\n e.preventDefault()\n }}\n title={isRecording ? 'Disable test recorder' : 'Enable test recorder'}\n type=\"button\"\n >\n {isRecording ? 'Disable test recorder' : 'Enable test recorder'}\n </button>\n )\n const output = isRecording ? (\n <div className=\"test-recorder-output\">\n <div className=\"test-recorder-toolbar\">\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-snapshot\"\n onClick={(e) => {\n onSnapshotClick()\n e.preventDefault()\n }}\n title=\"Insert snapshot\"\n type=\"button\"\n >\n Insert Snapshot\n </button>\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-copy\"\n onClick={(e) => {\n onCopyClick()\n e.preventDefault()\n }}\n title=\"Copy to clipboard\"\n type=\"button\"\n >\n Copy\n </button>\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-download\"\n onClick={(e) => {\n onDownloadClick()\n e.preventDefault()\n }}\n title=\"Download as a file\"\n type=\"button\"\n >\n Download\n </button>\n </div>\n <pre id=\"test-recorder\" ref={preRef}>\n {templatedTest}\n </pre>\n </div>\n ) : null\n\n return [button, output]\n}\nexport const TestRecorderPlugin: PluginComponent<undefined> = () => {\n const [editor] = useLexicalComposerContext()\n const [testRecorderButton, testRecorderOutput] = useTestRecorder(editor)\n\n return (\n <React.Fragment>\n <p>HI</p>\n {testRecorderButton}\n {testRecorderOutput}\n <p>DONE</p>\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,eAAe,QAAQ;AACjF,YAAYC,KAAA,MAAW;AACvB,SAAmBC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAIpF,SAASC,QAAQ,QAAQ;AAGzB,MAAMC,IAAA,GAAQC,IAAA;EACZ,MAAMC,QAAA,GAAWC,QAAA,CAASC,aAAa,CAAC;EACxCF,QAAA,CAASG,KAAK,GAAGJ,IAAA,IAAQ;EACzBC,QAAA,CAASI,KAAK,CAACC,QAAQ,GAAG;EAC1BL,QAAA,CAASI,KAAK,CAACE,OAAO,GAAG;EACzBL,QAAA,CAASM,IAAI,EAAEC,WAAA,CAAYR,QAAA;EAC3BA,QAAA,CAASS,KAAK;EACdT,QAAA,CAASU,MAAM;EACf,IAAI;IACF,MAAMC,MAAA,GAASV,QAAA,CAASW,WAAW,CAAC;IACpC;I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,cAAc;QAClB;QACAC,KAAA,EAAM;QACNC,IAAA,EAAK;kBACN;;qBAIHP,IAAA,CAAC;MAAIE,EAAA,EAAG;MAAgBQ,GAAA,EAAKzD,MAAA;gBAC1BJ;;OAGH;EAEJ,OAAO,CAACkD,MAAA,EAAQS,MAAA,CAAO;AACzB;AACA,OAAO,MAAMG,kBAAA,GAAiDA,CAAA;EAAA,MAAAC,CAAA,GAAAnJ,EAAA;EAC5D,OAAA8E,MAAA,IAAiB7E,yBAAA;EACjB,OAAAmJ,kBAAA,EAAAC,kBAAA,IAAiDxE,eAAA,CAAgBC,MAAA;EAAA,IAAAwE,EAAA;EAAA,IAAAH,CAAA,QAAAC,kBAAA,IAAAD,CAAA,QAAAE,kBAAA;IAG/DC,EAAA,GAAAN,KAAA,CAAA1I,KAAA,CAAAiJ,QAAA;MAAAC,QAAA,GACEjB,IAAA,CAAC;QAAAiB,QAAA,EAAE;MAAA,C,GACFJ,kBAAA,EACAC,kBAAA,EACDd,IAAA,CAAC;QAAAiB,QAAA,EAAE;MAAA,C;;;;;;;;SAJLF,E;CAOJ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","$createParagraphNode","$createTextNode","$getRoot","getDOMSelection","React","useCallback","useEffect","useLayoutEffect","useRef","useState","IS_APPLE","copy","text","textArea","document","createElement","value","style","position","opacity","body","appendChild","focus","select","result","execCommand","console","log","error","removeChild","download","filename","a","setAttribute","encodeURIComponent","display","click","formatStep","step","formatOneStep","name","x","y","anchorPath","toString","anchorOffset","focusPath","focusOffset","formattedStep","count","join","isSelectAll","event","key","toLowerCase","metaKey","ctrlKey","sanitizeSelection","selection","anchorNode","focusNode","getPathFromNodeToEditor","node","rootElement","currentNode","path","undefined","unshift","Array","from","parentNode","childNodes","indexOf","keyPresses","Set","useTestRecorder","editor","steps","setSteps","isRecording","setIsRecording","setCurrentInnerHTML","templatedTest","setTemplatedTest","previousSelectionRef","skipNextSelectionChangeRef","preRef","getCurrentEditor","generateTestContent","getRootElement","browserSelection","_window","contains","map","pushStep","currentSteps","currentIndex","length","lastStep","slice","onKeyDown","has","onKeyUp","registerRootListener","prevRootElement","removeEventListener","addEventListener","current","scrollTo","scrollHeight","testContent","removeUpdateListener","registerUpdateListener","dirtyElements","dirtyLeaves","editorState","currentSelection","_selection","previousSelection","skipNextSelectionChange","size","innerHTML","toggleEditorSelection","currentEditor","update","root","clear","append","currentIsRecording","onSnapshotClick","onCopyClick","onDownloadClick","button","_jsx","className","id","onClick","e","preventDefault","title","type","output","_jsxs","ref","TestRecorderPlugin","$","testRecorderButton","testRecorderOutput","t0","Fragment","children"],"sources":["../../../../../../src/features/debug/testRecorder/client/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $createParagraphNode, $createTextNode, $getRoot, getDOMSelection } from 'lexical'\nimport * as React from 'react'\nimport { type JSX, useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nimport { IS_APPLE } from '../../../../../lexical/utils/environment.js'\nimport './index.css'\n\nconst copy = (text: null | string) => {\n const textArea = document.createElement('textarea')\n textArea.value = text || ''\n textArea.style.position = 'absolute'\n textArea.style.opacity = '0'\n document.body?.appendChild(textArea)\n textArea.focus()\n textArea.select()\n try {\n const result = document.execCommand('copy')\n // eslint-disable-next-line no-console\n console.log(result)\n } catch (error) {\n console.error(error)\n }\n document.body?.removeChild(textArea)\n}\n\nconst download = (filename: string, text: null | string) => {\n const a = document.createElement('a')\n a.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text || ''))\n a.setAttribute('download', filename)\n a.style.display = 'none'\n document.body?.appendChild(a)\n a.click()\n document.body?.removeChild(a)\n}\n\nconst formatStep = (step: Step) => {\n const formatOneStep = (name: string, value: Step['value']) => {\n switch (name) {\n case 'click': {\n return ` await page.mouse.click(${value.x}, ${value.y});`\n }\n case 'keydown': {\n return ` await page.keyboard.keydown('${value}');`\n }\n case 'keyup': {\n return ` await page.keyboard.keyup('${value}');`\n }\n case 'press': {\n return ` await page.keyboard.press('${value}');`\n }\n case 'selectAll': {\n return ` await selectAll(page);`\n }\n case 'snapshot': {\n return ` await assertHTMLSnapshot(page);\n await assertSelection(page, {\n anchorPath: [${value.anchorPath.toString()}],\n anchorOffset: ${value.anchorOffset},\n focusPath: [${value.focusPath.toString()}],\n focusOffset: ${value.focusOffset},\n });\n`\n }\n case 'type': {\n return ` await page.keyboard.type('${value}');`\n }\n default:\n return ``\n }\n }\n const formattedStep = formatOneStep(step.name, step.value)\n switch (step.count) {\n case 1:\n return formattedStep\n case 2:\n return [formattedStep, formattedStep].join(`\\n`)\n default:\n return ` await repeat(${step.count}, async () => {\n ${formattedStep}\n );`\n }\n}\n\nexport function isSelectAll(event: KeyboardEvent): boolean {\n return event.key.toLowerCase() === 'a' && (IS_APPLE ? event.metaKey : event.ctrlKey)\n}\n\n// stolen from LexicalSelection-test\nfunction sanitizeSelection(selection: Selection) {\n const { anchorNode, focusNode } = selection\n let { anchorOffset, focusOffset } = selection\n if (anchorOffset !== 0) {\n anchorOffset--\n }\n if (focusOffset !== 0) {\n focusOffset--\n }\n return { anchorNode, anchorOffset, focusNode, focusOffset }\n}\n\nfunction getPathFromNodeToEditor(node: Node, rootElement: HTMLElement | null) {\n let currentNode: Node | null | undefined = node\n const path: number[] = []\n while (currentNode !== rootElement) {\n if (currentNode !== null && currentNode !== undefined) {\n path.unshift(\n Array.from(currentNode?.parentNode?.childNodes ?? []).indexOf(currentNode as ChildNode),\n )\n }\n currentNode = currentNode?.parentNode\n }\n return path\n}\n\nconst keyPresses = new Set([\n 'ArrowDown',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'Backspace',\n 'Delete',\n 'Enter',\n 'Escape',\n])\n\ntype Step = {\n count: number\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value: any\n}\n\ntype Steps = Step[]\n\nfunction useTestRecorder(editor: LexicalEditor): [JSX.Element, JSX.Element | null] {\n const [steps, setSteps] = useState<Steps>([])\n const [isRecording, setIsRecording] = useState(false)\n const [, setCurrentInnerHTML] = useState('')\n const [templatedTest, setTemplatedTest] = useState('')\n const previousSelectionRef = useRef<BaseSelection | null>(null)\n const skipNextSelectionChangeRef = useRef(false)\n const preRef = useRef<HTMLPreElement>(null)\n\n const getCurrentEditor = useCallback(() => {\n return editor\n }, [editor])\n\n const generateTestContent = useCallback(() => {\n const rootElement = editor.getRootElement()\n const browserSelection = getDOMSelection(editor._window)\n\n if (\n rootElement == null ||\n browserSelection == null ||\n browserSelection.anchorNode == null ||\n browserSelection.focusNode == null ||\n !rootElement.contains(browserSelection.anchorNode) ||\n !rootElement.contains(browserSelection.focusNode)\n ) {\n return null\n }\n\n return `\nimport {\n initializeE2E,\n assertHTMLSnapshot,\n assertSelection,\n repeat,\n} from '../utils';\nimport {selectAll} from '../keyboardShortcuts';\nimport { RangeSelection } from 'lexical';\nimport { NodeSelection } from 'lexical';\n\ndescribe('Test case', () => {\n initializeE2E((e2e) => {\n it('Should pass this test', async () => {\n const {page} = e2e;\n\n await page.focus('div[contenteditable=\"true\"]');\n${steps.map(formatStep).join(`\\n`)}\n });\n});\n `\n }, [editor, steps])\n\n // just a wrapper around inserting new actions so that we can\n // coalesce some actions like insertText/moveNativeSelection\n const pushStep = useCallback(\n (name: string, value: Step['value']) => {\n setSteps((currentSteps) => {\n // trying to group steps\n const currentIndex = steps.length - 1\n const lastStep = steps[currentIndex]\n if (lastStep) {\n if (lastStep.name === name) {\n if (name === 'type') {\n // for typing events we just append the text\n return [\n ...steps.slice(0, currentIndex),\n { ...lastStep, value: lastStep.value + value },\n ]\n } else {\n // for other events we bump the counter if their values are the same\n if (lastStep.value === value) {\n return [...steps.slice(0, currentIndex), { ...lastStep, count: lastStep.count + 1 }]\n }\n }\n }\n }\n // could not group, just append a new one\n return [...currentSteps, { name, count: 1, value }]\n })\n },\n [steps, setSteps],\n )\n\n useLayoutEffect(() => {\n const onKeyDown = (event: KeyboardEvent) => {\n if (!isRecording) {\n return\n }\n const key = event.key\n if (isSelectAll(event)) {\n pushStep('selectAll', '')\n } else if (keyPresses.has(key)) {\n pushStep('press', event.key)\n } else if ([...key].length > 1) {\n pushStep('keydown', event.key)\n } else {\n pushStep('type', event.key)\n }\n }\n\n const onKeyUp = (event: KeyboardEvent) => {\n if (!isRecording) {\n return\n }\n const key = event.key\n if (!keyPresses.has(key) && [...key].length > 1) {\n pushStep('keyup', event.key)\n }\n }\n\n return editor.registerRootListener(\n (rootElement: HTMLElement | null, prevRootElement: HTMLElement | null) => {\n if (prevRootElement !== null) {\n prevRootElement.removeEventListener('keydown', onKeyDown)\n prevRootElement.removeEventListener('keyup', onKeyUp)\n }\n if (rootElement !== null) {\n rootElement.addEventListener('keydown', onKeyDown)\n rootElement.addEventListener('keyup', onKeyUp)\n }\n },\n )\n }, [editor, isRecording, pushStep])\n\n useLayoutEffect(() => {\n if (preRef.current) {\n preRef.current.scrollTo(0, preRef.current.scrollHeight)\n }\n }, [generateTestContent])\n\n useEffect(() => {\n if (steps) {\n const testContent = generateTestContent()\n if (testContent !== null) {\n setTemplatedTest(testContent)\n }\n if (preRef.current) {\n preRef.current.scrollTo(0, preRef.current.scrollHeight)\n }\n }\n }, [generateTestContent, steps])\n\n useEffect(() => {\n const removeUpdateListener = editor.registerUpdateListener(\n ({ dirtyElements, dirtyLeaves, editorState }) => {\n if (!isRecording) {\n return\n }\n const currentSelection = editorState._selection\n const previousSelection = previousSelectionRef.current\n const skipNextSelectionChange = skipNextSelectionChangeRef.current\n if (previousSelection !== currentSelection) {\n if (dirtyLeaves.size === 0 && dirtyElements.size === 0 && !skipNextSelectionChange) {\n const browserSelection = getDOMSelection(editor._window)\n if (\n browserSelection &&\n (browserSelection.anchorNode == null || browserSelection.focusNode == null)\n ) {\n return\n }\n }\n previousSelectionRef.current = currentSelection\n }\n skipNextSelectionChangeRef.current = false\n const testContent = generateTestContent()\n if (testContent !== null) {\n setTemplatedTest(testContent)\n }\n },\n )\n return removeUpdateListener\n }, [editor, generateTestContent, isRecording, pushStep])\n\n // save innerHTML\n useEffect(() => {\n if (!isRecording) {\n return\n }\n const removeUpdateListener = editor.registerUpdateListener(() => {\n const rootElement = editor.getRootElement()\n if (rootElement !== null) {\n setCurrentInnerHTML(rootElement?.innerHTML)\n }\n })\n return removeUpdateListener\n }, [editor, isRecording])\n\n // clear editor and start recording\n const toggleEditorSelection = useCallback(\n (currentEditor: LexicalEditor) => {\n if (!isRecording) {\n currentEditor.update(() => {\n const root = $getRoot()\n root.clear()\n const text = $createTextNode()\n root.append($createParagraphNode().append(text))\n text.select()\n })\n setSteps([])\n }\n setIsRecording((currentIsRecording) => !currentIsRecording)\n },\n [isRecording],\n )\n\n const onSnapshotClick = useCallback(() => {\n if (!isRecording) {\n return\n }\n const browserSelection = getDOMSelection(editor._window)\n if (\n browserSelection === null ||\n browserSelection.anchorNode == null ||\n browserSelection.focusNode == null\n ) {\n return\n }\n const { anchorNode, anchorOffset, focusNode, focusOffset } = sanitizeSelection(browserSelection)\n const rootElement = getCurrentEditor().getRootElement()\n let anchorPath\n if (anchorNode !== null) {\n anchorPath = getPathFromNodeToEditor(anchorNode, rootElement)\n }\n let focusPath\n if (focusNode !== null) {\n focusPath = getPathFromNodeToEditor(focusNode, rootElement)\n }\n pushStep('snapshot', {\n anchorNode,\n anchorOffset,\n anchorPath,\n focusNode,\n focusOffset,\n focusPath,\n })\n }, [pushStep, isRecording, getCurrentEditor])\n\n const onCopyClick = useCallback(() => {\n copy(generateTestContent())\n }, [generateTestContent])\n\n const onDownloadClick = useCallback(() => {\n download('test.js', generateTestContent())\n }, [generateTestContent])\n\n const button = (\n <button\n className={`editor-dev-button ${isRecording ? 'active' : ''}`}\n id=\"test-recorder-button\"\n onClick={(e) => {\n toggleEditorSelection(getCurrentEditor())\n e.preventDefault()\n }}\n title={isRecording ? 'Disable test recorder' : 'Enable test recorder'}\n type=\"button\"\n >\n {isRecording ? 'Disable test recorder' : 'Enable test recorder'}\n </button>\n )\n const output = isRecording ? (\n <div className=\"test-recorder-output\">\n <div className=\"test-recorder-toolbar\">\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-snapshot\"\n onClick={(e) => {\n onSnapshotClick()\n e.preventDefault()\n }}\n title=\"Insert snapshot\"\n type=\"button\"\n >\n Insert Snapshot\n </button>\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-copy\"\n onClick={(e) => {\n onCopyClick()\n e.preventDefault()\n }}\n title=\"Copy to clipboard\"\n type=\"button\"\n >\n Copy\n </button>\n <button\n className=\"test-recorder-button\"\n id=\"test-recorder-button-download\"\n onClick={(e) => {\n onDownloadClick()\n e.preventDefault()\n }}\n title=\"Download as a file\"\n type=\"button\"\n >\n Download\n </button>\n </div>\n <pre id=\"test-recorder\" ref={preRef}>\n {templatedTest}\n </pre>\n </div>\n ) : null\n\n return [button, output]\n}\nexport const TestRecorderPlugin: PluginComponent<undefined> = () => {\n const [editor] = useLexicalComposerContext()\n const [testRecorderButton, testRecorderOutput] = useTestRecorder(editor)\n\n return (\n <React.Fragment>\n <p>HI</p>\n {testRecorderButton}\n {testRecorderOutput}\n <p>DONE</p>\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,eAAe,QAAQ;AACjF,YAAYC,KAAA,MAAW;AACvB,SAAmBC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAIpF,SAASC,QAAQ,QAAQ;AACzB,OAAO;AAEP,MAAMC,IAAA,GAAQC,IAAA;EACZ,MAAMC,QAAA,GAAWC,QAAA,CAASC,aAAa,CAAC;EACxCF,QAAA,CAASG,KAAK,GAAGJ,IA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