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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (254) hide show
  1. package/dist/cell/rscEntry.js +2 -21
  2. package/dist/cell/rscEntry.js.map +1 -1
  3. package/dist/features/blocks/client/component/BlockContent.js +13 -48
  4. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  5. package/dist/features/blocks/client/component/components/BlockCollapsible.js +1 -10
  6. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
  7. package/dist/features/blocks/client/component/components/BlockEditButton.js +1 -7
  8. package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
  9. package/dist/features/blocks/client/component/components/BlockRemoveButton.js +1 -7
  10. package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
  11. package/dist/features/blocks/client/component/index.js +81 -247
  12. package/dist/features/blocks/client/component/index.js.map +1 -1
  13. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js +1 -9
  14. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
  15. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js +1 -7
  16. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
  17. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js +1 -7
  18. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
  19. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js +1 -7
  20. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
  21. package/dist/features/blocks/client/componentInline/index.js +68 -217
  22. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  23. package/dist/features/blocks/client/getBlockImageComponent.js +4 -15
  24. package/dist/features/blocks/client/getBlockImageComponent.js.map +1 -1
  25. package/dist/features/blocks/client/nodes/BlocksNode.js +1 -12
  26. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  27. package/dist/features/blocks/client/nodes/InlineBlocksNode.js +2 -12
  28. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  29. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +26 -127
  30. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  31. package/dist/features/blocks/premade/CodeBlock/Component/Code.js +49 -65
  32. package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
  33. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +3 -16
  34. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
  35. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +4 -25
  36. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
  37. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  38. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  39. package/dist/features/converters/lexicalToJSX/Component/index.js +2 -13
  40. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  41. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js +1 -8
  42. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
  43. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +1 -8
  44. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  45. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js +1 -6
  46. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
  47. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js +1 -6
  48. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
  49. package/dist/features/converters/lexicalToJSX/converter/converters/link.js +10 -19
  50. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
  51. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +16 -63
  52. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  53. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js +4 -19
  54. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
  55. package/dist/features/converters/lexicalToJSX/converter/converters/table.js +12 -45
  56. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
  57. package/dist/features/converters/lexicalToJSX/converter/converters/text.js +11 -57
  58. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
  59. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +7 -46
  60. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  61. package/dist/features/converters/lexicalToJSX/converter/index.js +5 -12
  62. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  63. package/dist/features/debug/jsxConverter/client/plugin/index.js +3 -16
  64. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  65. package/dist/features/debug/testRecorder/client/plugin/index.js +38 -113
  66. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  67. package/dist/features/debug/treeView/client/plugin/index.js +1 -15
  68. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  69. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +79 -357
  70. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  71. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +7 -41
  72. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  73. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +9 -39
  74. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  75. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +28 -59
  76. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  77. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +0 -1
  78. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  79. package/dist/features/indent/client/IndentPlugin.js +1 -6
  80. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  81. package/dist/features/link/client/plugins/clickableLink/index.js +1 -7
  82. package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -1
  83. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +59 -151
  84. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  85. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -9
  86. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  87. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  88. package/dist/features/lists/checklist/client/plugin/index.js +1 -7
  89. package/dist/features/lists/checklist/client/plugin/index.js.map +1 -1
  90. package/dist/features/lists/plugin/index.js +1 -7
  91. package/dist/features/lists/plugin/index.js.map +1 -1
  92. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +3 -18
  93. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  94. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -9
  95. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  96. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +3 -18
  97. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  98. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -9
  99. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  100. package/dist/features/relationship/client/components/RelationshipComponent.js +31 -100
  101. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  102. package/dist/features/relationship/client/drawer/index.js +4 -21
  103. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  104. package/dist/features/relationship/client/nodes/RelationshipNode.js +2 -12
  105. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  106. package/dist/features/relationship/client/plugins/index.js +1 -8
  107. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  108. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  109. package/dist/features/textState/feature.client.js +5 -22
  110. package/dist/features/textState/feature.client.js.map +1 -1
  111. package/dist/features/toolbars/fixed/client/Toolbar/index.js +27 -123
  112. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  113. package/dist/features/toolbars/inline/client/Toolbar/index.js +18 -111
  114. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  115. package/dist/features/toolbars/shared/ToolbarButton/index.js +4 -14
  116. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  117. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +56 -135
  118. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  119. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +16 -70
  120. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  121. package/dist/features/upload/client/component/index.js +43 -167
  122. package/dist/features/upload/client/component/index.js.map +1 -1
  123. package/dist/features/upload/client/component/pending/index.js +3 -16
  124. package/dist/features/upload/client/component/pending/index.js.map +1 -1
  125. package/dist/features/upload/client/drawer/index.js +4 -21
  126. package/dist/features/upload/client/drawer/index.js.map +1 -1
  127. package/dist/features/upload/client/nodes/UploadNode.js +3 -17
  128. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  129. package/dist/features/upload/client/plugin/index.js +2 -9
  130. package/dist/features/upload/client/plugin/index.js.map +1 -1
  131. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  132. package/dist/field/Diff/converters/listitem/index.js +11 -54
  133. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  134. package/dist/field/Diff/converters/relationship/index.js +18 -60
  135. package/dist/field/Diff/converters/relationship/index.js.map +1 -1
  136. package/dist/field/Diff/converters/unknown/index.js +7 -42
  137. package/dist/field/Diff/converters/unknown/index.js.map +1 -1
  138. package/dist/field/Diff/converters/upload/index.js +21 -91
  139. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  140. package/dist/field/Diff/index.js +4 -17
  141. package/dist/field/Diff/index.js.map +1 -1
  142. package/dist/field/Field.js +25 -124
  143. package/dist/field/Field.js.map +1 -1
  144. package/dist/field/RenderLexical/index.js +15 -47
  145. package/dist/field/RenderLexical/index.js.map +1 -1
  146. package/dist/field/index.js +5 -24
  147. package/dist/field/index.js.map +1 -1
  148. package/dist/field/rscEntry.js +1 -9
  149. package/dist/field/rscEntry.js.map +1 -1
  150. package/dist/lexical/EditorPlugin.js +2 -17
  151. package/dist/lexical/EditorPlugin.js.map +1 -1
  152. package/dist/lexical/LexicalEditor.js +69 -232
  153. package/dist/lexical/LexicalEditor.js.map +1 -1
  154. package/dist/lexical/LexicalProvider.js +13 -64
  155. package/dist/lexical/LexicalProvider.js.map +1 -1
  156. package/dist/lexical/config/client/EditorConfigProvider.js +2 -11
  157. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  158. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +5 -28
  159. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  160. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +1 -14
  161. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  162. package/dist/lexical/plugins/SlashMenu/index.js +31 -98
  163. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  164. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +7 -27
  165. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  166. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +7 -45
  167. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  168. package/dist/lexical/ui/ContentEditable.js +3 -18
  169. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  170. package/dist/lexical/ui/icons/AI/index.js +10 -58
  171. package/dist/lexical/ui/icons/AI/index.js.map +1 -1
  172. package/dist/lexical/ui/icons/Add/index.js +4 -31
  173. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  174. package/dist/lexical/ui/icons/AlignCenter/index.js +5 -45
  175. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  176. package/dist/lexical/ui/icons/AlignJustify/index.js +5 -45
  177. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  178. package/dist/lexical/ui/icons/AlignLeft/index.js +5 -45
  179. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  180. package/dist/lexical/ui/icons/AlignRight/index.js +5 -45
  181. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  182. package/dist/lexical/ui/icons/Block/index.js +5 -54
  183. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  184. package/dist/lexical/ui/icons/Blockquote/index.js +3 -24
  185. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  186. package/dist/lexical/ui/icons/Bold/index.js +3 -24
  187. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  188. package/dist/lexical/ui/icons/Checklist/index.js +4 -39
  189. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  190. package/dist/lexical/ui/icons/Code/index.js +4 -34
  191. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  192. package/dist/lexical/ui/icons/CodeBlock/index.js +3 -22
  193. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  194. package/dist/lexical/ui/icons/Collapse/index.js +3 -23
  195. package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
  196. package/dist/lexical/ui/icons/H1/index.js +3 -24
  197. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  198. package/dist/lexical/ui/icons/H2/index.js +3 -24
  199. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  200. package/dist/lexical/ui/icons/H3/index.js +3 -24
  201. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  202. package/dist/lexical/ui/icons/H4/index.js +3 -24
  203. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  204. package/dist/lexical/ui/icons/H5/index.js +3 -24
  205. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  206. package/dist/lexical/ui/icons/H6/index.js +3 -24
  207. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  208. package/dist/lexical/ui/icons/HorizontalRule/index.js +3 -27
  209. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  210. package/dist/lexical/ui/icons/IndentDecrease/index.js +6 -53
  211. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  212. package/dist/lexical/ui/icons/IndentIncrease/index.js +6 -53
  213. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  214. package/dist/lexical/ui/icons/InlineBlocks/index.js +3 -26
  215. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
  216. package/dist/lexical/ui/icons/Italic/index.js +3 -24
  217. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  218. package/dist/lexical/ui/icons/Link/index.js +3 -25
  219. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  220. package/dist/lexical/ui/icons/Meatballs/index.js +5 -39
  221. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
  222. package/dist/lexical/ui/icons/OrderedList/index.js +7 -61
  223. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  224. package/dist/lexical/ui/icons/Relationship/index.js +10 -58
  225. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  226. package/dist/lexical/ui/icons/Strikethrough/index.js +4 -34
  227. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  228. package/dist/lexical/ui/icons/Subscript/index.js +3 -24
  229. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  230. package/dist/lexical/ui/icons/Superscript/index.js +3 -24
  231. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  232. package/dist/lexical/ui/icons/Table/index.js +3 -24
  233. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  234. package/dist/lexical/ui/icons/Text/index.js +3 -24
  235. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  236. package/dist/lexical/ui/icons/TextState/index.js +12 -18
  237. package/dist/lexical/ui/icons/TextState/index.js.map +1 -1
  238. package/dist/lexical/ui/icons/Underline/index.js +4 -34
  239. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  240. package/dist/lexical/ui/icons/UnorderedList/index.js +8 -81
  241. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  242. package/dist/lexical/ui/icons/Upload/index.js +5 -48
  243. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  244. package/dist/lexical/utils/point.js.map +1 -1
  245. package/dist/lexical/utils/rect.js.map +1 -1
  246. package/dist/utilities/fieldsDrawer/Drawer.js +16 -41
  247. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  248. package/dist/utilities/fieldsDrawer/DrawerContent.js +10 -42
  249. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  250. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +1 -9
  251. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  252. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +3 -11
  253. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
  254. package/package.json +7 -7
@@ -1,4 +1,3 @@
1
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
2
1
  export const UploadJSXConverter = {
3
2
  upload: ({ node })=>{
4
3
  // TO-DO (v4): SerializedUploadNode should use UploadData_P4
@@ -11,29 +10,14 @@ export const UploadJSXConverter = {
11
10
  /**
12
11
  * If the upload is not an image, return a link to the upload
13
12
  */ if (!uploadDoc.mimeType.startsWith('image')) {
14
- return /*#__PURE__*/ _jsxDEV("a", {
15
- href: url,
16
- rel: "noopener noreferrer",
17
- children: uploadDoc.filename
18
- }, void 0, false, {
19
- fileName: "src/features/converters/lexicalToJSX/converter/converters/upload.tsx",
20
- lineNumber: 24,
21
- columnNumber: 9
22
- }, this);
13
+ return <a href={url} rel="noopener noreferrer">
14
+ {uploadDoc.filename}
15
+ </a>;
23
16
  }
24
17
  /**
25
18
  * If the upload is a simple image with no different sizes, return a simple img tag
26
19
  */ if (!uploadDoc.sizes || !Object.keys(uploadDoc.sizes).length) {
27
- return /*#__PURE__*/ _jsxDEV("img", {
28
- alt: uploadDoc.filename,
29
- height: uploadDoc.height,
30
- src: url,
31
- width: uploadDoc.width
32
- }, void 0, false, {
33
- fileName: "src/features/converters/lexicalToJSX/converter/converters/upload.tsx",
34
- lineNumber: 35,
35
- columnNumber: 9
36
- }, this);
20
+ return <img alt={uploadDoc.filename} height={uploadDoc.height} src={url} width={uploadDoc.width}/>;
37
21
  }
38
22
  /**
39
23
  * If the upload is an image with different sizes, return a picture element
@@ -46,34 +30,11 @@ export const UploadJSXConverter = {
46
30
  continue;
47
31
  }
48
32
  const imageSizeURL = imageSize?.url;
49
- pictureJSX.push(/*#__PURE__*/ _jsxDEV("source", {
50
- media: `(max-width: ${imageSize.width}px)`,
51
- srcSet: imageSizeURL,
52
- type: imageSize.mimeType
53
- }, size, false, {
54
- fileName: "src/features/converters/lexicalToJSX/converter/converters/upload.tsx",
55
- lineNumber: 63,
56
- columnNumber: 9
57
- }, this));
33
+ pictureJSX.push(<source key={size} media={`(max-width: ${imageSize.width}px)`} srcSet={imageSizeURL} type={imageSize.mimeType}/>);
58
34
  }
59
35
  // Add the default img tag
60
- pictureJSX.push(/*#__PURE__*/ _jsxDEV("img", {
61
- alt: uploadDoc?.filename,
62
- height: uploadDoc?.height,
63
- src: url,
64
- width: uploadDoc?.width
65
- }, 'image', false, {
66
- fileName: "src/features/converters/lexicalToJSX/converter/converters/upload.tsx",
67
- lineNumber: 74,
68
- columnNumber: 7
69
- }, this));
70
- return /*#__PURE__*/ _jsxDEV("picture", {
71
- children: pictureJSX
72
- }, void 0, false, {
73
- fileName: "src/features/converters/lexicalToJSX/converter/converters/upload.tsx",
74
- lineNumber: 82,
75
- columnNumber: 12
76
- }, this);
36
+ pictureJSX.push(<img alt={uploadDoc?.filename} height={uploadDoc?.height} key={'image'} src={url} width={uploadDoc?.width}/>);
37
+ return <picture>{pictureJSX}</picture>;
77
38
  }
78
39
  };
79
40
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/upload.tsx"],"sourcesContent":["import type { FileData, FileSizeImproved, TypeWithID } from 'payload'\n\nimport type { SerializedUploadNode } from '../../../../../nodeTypes.js'\nimport type { UploadDataImproved } from '../../../../upload/server/nodes/UploadNode.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const UploadJSXConverter: JSXConverters<SerializedUploadNode> = {\n upload: ({ node }) => {\n // TO-DO (v4): SerializedUploadNode should use UploadData_P4\n const uploadNode = node as UploadDataImproved\n if (typeof uploadNode.value !== 'object') {\n return null\n }\n\n const uploadDoc = uploadNode.value as FileData & TypeWithID\n\n const url = uploadDoc.url\n\n /**\n * If the upload is not an image, return a link to the upload\n */\n if (!uploadDoc.mimeType.startsWith('image')) {\n return (\n <a href={url} rel=\"noopener noreferrer\">\n {uploadDoc.filename}\n </a>\n )\n }\n\n /**\n * If the upload is a simple image with no different sizes, return a simple img tag\n */\n if (!uploadDoc.sizes || !Object.keys(uploadDoc.sizes).length) {\n return (\n <img alt={uploadDoc.filename} height={uploadDoc.height} src={url} width={uploadDoc.width} />\n )\n }\n\n /**\n * If the upload is an image with different sizes, return a picture element\n */\n const pictureJSX: React.ReactNode[] = []\n\n // Iterate through each size in the data.sizes object\n for (const size in uploadDoc.sizes) {\n const imageSize = uploadDoc.sizes[size] as FileSizeImproved\n\n // Skip if any property of the size object is null\n if (\n !imageSize ||\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n const imageSizeURL = imageSize?.url\n\n pictureJSX.push(\n <source\n key={size}\n media={`(max-width: ${imageSize.width}px)`}\n srcSet={imageSizeURL}\n type={imageSize.mimeType}\n />,\n )\n }\n\n // Add the default img tag\n pictureJSX.push(\n <img\n alt={uploadDoc?.filename}\n height={uploadDoc?.height}\n key={'image'}\n src={url}\n width={uploadDoc?.width}\n />,\n )\n return <picture>{pictureJSX}</picture>\n },\n}\n"],"names":["UploadJSXConverter","upload","node","uploadNode","value","uploadDoc","url","mimeType","startsWith","a","href","rel","filename","sizes","Object","keys","length","img","alt","height","src","width","pictureJSX","size","imageSize","filesize","imageSizeURL","push","source","media","srcSet","type","picture"],"mappings":";AAMA,OAAO,MAAMA,qBAA0D;IACrEC,QAAQ,CAAC,EAAEC,IAAI,EAAE;QACf,4DAA4D;QAC5D,MAAMC,aAAaD;QACnB,IAAI,OAAOC,WAAWC,KAAK,KAAK,UAAU;YACxC,OAAO;QACT;QAEA,MAAMC,YAAYF,WAAWC,KAAK;QAElC,MAAME,MAAMD,UAAUC,GAAG;QAEzB;;KAEC,GACD,IAAI,CAACD,UAAUE,QAAQ,CAACC,UAAU,CAAC,UAAU;YAC3C,qBACE,QAACC;gBAAEC,MAAMJ;gBAAKK,KAAI;0BACfN,UAAUO,QAAQ;;;;;;QAGzB;QAEA;;KAEC,GACD,IAAI,CAACP,UAAUQ,KAAK,IAAI,CAACC,OAAOC,IAAI,CAACV,UAAUQ,KAAK,EAAEG,MAAM,EAAE;YAC5D,qBACE,QAACC;gBAAIC,KAAKb,UAAUO,QAAQ;gBAAEO,QAAQd,UAAUc,MAAM;gBAAEC,KAAKd;gBAAKe,OAAOhB,UAAUgB,KAAK;;;;;;QAE5F;QAEA;;KAEC,GACD,MAAMC,aAAgC,EAAE;QAExC,qDAAqD;QACrD,IAAK,MAAMC,QAAQlB,UAAUQ,KAAK,CAAE;YAClC,MAAMW,YAAYnB,UAAUQ,KAAK,CAACU,KAAK;YAEvC,kDAAkD;YAClD,IACE,CAACC,aACD,CAACA,UAAUH,KAAK,IAChB,CAACG,UAAUL,MAAM,IACjB,CAACK,UAAUjB,QAAQ,IACnB,CAACiB,UAAUC,QAAQ,IACnB,CAACD,UAAUZ,QAAQ,IACnB,CAACY,UAAUlB,GAAG,EACd;gBACA;YACF;YACA,MAAMoB,eAAeF,WAAWlB;YAEhCgB,WAAWK,IAAI,eACb,QAACC;gBAECC,OAAO,CAAC,YAAY,EAAEL,UAAUH,KAAK,CAAC,GAAG,CAAC;gBAC1CS,QAAQJ;gBACRK,MAAMP,UAAUjB,QAAQ;eAHnBgB;;;;;QAMX;QAEA,0BAA0B;QAC1BD,WAAWK,IAAI,eACb,QAACV;YACCC,KAAKb,WAAWO;YAChBO,QAAQd,WAAWc;YAEnBC,KAAKd;YACLe,OAAOhB,WAAWgB;WAFb;;;;;QAKT,qBAAO,QAACW;sBAASV;;;;;;IACnB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/converters/lexicalToJSX/converter/converters/upload.tsx"],"sourcesContent":["import type { FileData, FileSizeImproved, TypeWithID } from 'payload'\n\nimport type { SerializedUploadNode } from '../../../../../nodeTypes.js'\nimport type { UploadDataImproved } from '../../../../upload/server/nodes/UploadNode.js'\nimport type { JSXConverters } from '../types.js'\n\nexport const UploadJSXConverter: JSXConverters<SerializedUploadNode> = {\n upload: ({ node }) => {\n // TO-DO (v4): SerializedUploadNode should use UploadData_P4\n const uploadNode = node as UploadDataImproved\n if (typeof uploadNode.value !== 'object') {\n return null\n }\n\n const uploadDoc = uploadNode.value as FileData & TypeWithID\n\n const url = uploadDoc.url\n\n /**\n * If the upload is not an image, return a link to the upload\n */\n if (!uploadDoc.mimeType.startsWith('image')) {\n return (\n <a href={url} rel=\"noopener noreferrer\">\n {uploadDoc.filename}\n </a>\n )\n }\n\n /**\n * If the upload is a simple image with no different sizes, return a simple img tag\n */\n if (!uploadDoc.sizes || !Object.keys(uploadDoc.sizes).length) {\n return (\n <img alt={uploadDoc.filename} height={uploadDoc.height} src={url} width={uploadDoc.width} />\n )\n }\n\n /**\n * If the upload is an image with different sizes, return a picture element\n */\n const pictureJSX: React.ReactNode[] = []\n\n // Iterate through each size in the data.sizes object\n for (const size in uploadDoc.sizes) {\n const imageSize = uploadDoc.sizes[size] as FileSizeImproved\n\n // Skip if any property of the size object is null\n if (\n !imageSize ||\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n const imageSizeURL = imageSize?.url\n\n pictureJSX.push(\n <source\n key={size}\n media={`(max-width: ${imageSize.width}px)`}\n srcSet={imageSizeURL}\n type={imageSize.mimeType}\n />,\n )\n }\n\n // Add the default img tag\n pictureJSX.push(\n <img\n alt={uploadDoc?.filename}\n height={uploadDoc?.height}\n key={'image'}\n src={url}\n width={uploadDoc?.width}\n />,\n )\n return <picture>{pictureJSX}</picture>\n },\n}\n"],"names":["UploadJSXConverter","upload","node","uploadNode","value","uploadDoc","url","mimeType","startsWith","a","href","rel","filename","sizes","Object","keys","length","img","alt","height","src","width","pictureJSX","size","imageSize","filesize","imageSizeURL","push","source","key","media","srcSet","type","picture"],"mappings":"AAMA,OAAO,MAAMA,qBAA0D;IACrEC,QAAQ,CAAC,EAAEC,IAAI,EAAE;QACf,4DAA4D;QAC5D,MAAMC,aAAaD;QACnB,IAAI,OAAOC,WAAWC,KAAK,KAAK,UAAU;YACxC,OAAO;QACT;QAEA,MAAMC,YAAYF,WAAWC,KAAK;QAElC,MAAME,MAAMD,UAAUC,GAAG;QAEzB;;KAEC,GACD,IAAI,CAACD,UAAUE,QAAQ,CAACC,UAAU,CAAC,UAAU;YAC3C,QACGC,EAAEC,MAAMJ,KAAKK,IAAI,sBAAsB;UACtC,CAACN,UAAUO,QAAQ,CAAC;QACtB,EAAEH;QAEN;QAEA;;KAEC,GACD,IAAI,CAACJ,UAAUQ,KAAK,IAAI,CAACC,OAAOC,IAAI,CAACV,UAAUQ,KAAK,EAAEG,MAAM,EAAE;YAC5D,QACGC,IAAIC,KAAKb,UAAUO,QAAQ,EAAEO,QAAQd,UAAUc,MAAM,EAAEC,KAAKd,KAAKe,OAAOhB,UAAUgB,KAAK;QAE5F;QAEA;;KAEC,GACD,MAAMC,aAAgC,EAAE;QAExC,qDAAqD;QACrD,IAAK,MAAMC,QAAQlB,UAAUQ,KAAK,CAAE;YAClC,MAAMW,YAAYnB,UAAUQ,KAAK,CAACU,KAAK;YAEvC,kDAAkD;YAClD,IACE,CAACC,aACD,CAACA,UAAUH,KAAK,IAChB,CAACG,UAAUL,MAAM,IACjB,CAACK,UAAUjB,QAAQ,IACnB,CAACiB,UAAUC,QAAQ,IACnB,CAACD,UAAUZ,QAAQ,IACnB,CAACY,UAAUlB,GAAG,EACd;gBACA;YACF;YACA,MAAMoB,eAAeF,WAAWlB;YAEhCgB,WAAWK,IAAI,EACZC,OACCC,KAAKN,MACLO,OAAO,CAAC,YAAY,EAAEN,UAAUH,KAAK,CAAC,GAAG,CAAC,EAC1CU,QAAQL,cACRM,MAAMR,UAAUjB,QAAQ;QAG9B;QAEA,0BAA0B;QAC1Be,WAAWK,IAAI,EACZV,IACCC,KAAKb,WAAWO,UAChBO,QAAQd,WAAWc,QACnBU,KAAK,SACLT,KAAKd,KACLe,OAAOhB,WAAWgB;QAGtB,QAAQY,SAASX,aAAaW;IAChC;AACF,EAAC"}
@@ -1,4 +1,3 @@
1
- import { jsxDEV as _jsxDEV, Fragment as _Fragment } from "react/jsx-dev-runtime";
2
1
  /* eslint-disable no-console */ import React from 'react';
3
2
  import { hasText } from '../../../../validate/hasText.js';
4
3
  export function convertLexicalToJSX({ converters, data, disableIndent, disableTextAlign }) {
@@ -11,7 +10,7 @@ export function convertLexicalToJSX({ converters, data, disableIndent, disableTe
11
10
  parent: data?.root
12
11
  });
13
12
  }
14
- return /*#__PURE__*/ _jsxDEV(_Fragment, {}, void 0, false);
13
+ return <></>;
15
14
  }
16
15
  export function convertLexicalNodesToJSX({ converters, disableIndent, disableTextAlign, nodes, parent }) {
17
16
  const unknownConverter = converters.unknown;
@@ -56,13 +55,7 @@ export function convertLexicalNodesToJSX({ converters, disableIndent, disableTex
56
55
  }) : converterForNode;
57
56
  reactNode = converted;
58
57
  } else {
59
- reactNode = /*#__PURE__*/ _jsxDEV("span", {
60
- children: "unknown node"
61
- }, i, false, {
62
- fileName: "src/features/converters/lexicalToJSX/converter/index.tsx",
63
- lineNumber: 102,
64
- columnNumber: 21
65
- }, this);
58
+ reactNode = <span key={i}>unknown node</span>;
66
59
  }
67
60
  const style = {};
68
61
  // Check if disableTextAlign is not true and does not include node type
@@ -98,7 +91,7 @@ export function convertLexicalNodesToJSX({ converters, disableIndent, disableTex
98
91
  style.paddingInlineStart = `${Number(node.indent) * 40}px`;
99
92
  }
100
93
  }
101
- if (/*#__PURE__*/ React.isValidElement(reactNode)) {
94
+ if (React.isValidElement(reactNode)) {
102
95
  // Inject style into reactNode
103
96
  if (style.textAlign || style.paddingInlineStart) {
104
97
  const newStyle = {
@@ -107,13 +100,13 @@ export function convertLexicalNodesToJSX({ converters, disableIndent, disableTex
107
100
  ...reactNode?.props?.style ?? {}
108
101
  };
109
102
  // reactNode style comes after, thus a textAlign specified in the converter has priority over the one we inject here
110
- return /*#__PURE__*/ React.cloneElement(reactNode, {
103
+ return React.cloneElement(reactNode, {
111
104
  key: i,
112
105
  // @ts-expect-error type better later
113
106
  style: newStyle
114
107
  });
115
108
  }
116
- return /*#__PURE__*/ React.cloneElement(reactNode, {
109
+ return React.cloneElement(reactNode, {
117
110
  key: i
118
111
  });
119
112
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport React from 'react'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js'\nimport type { JSXConverter, JSXConverters, SerializedLexicalNodeWithParent } from './types.js'\n\nimport { hasText } from '../../../../validate/hasText.js'\n\nexport type ConvertLexicalToJSXArgs = {\n converters: JSXConverters\n data: SerializedEditorState\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n}\n\nexport function convertLexicalToJSX({\n converters,\n data,\n disableIndent,\n disableTextAlign,\n}: ConvertLexicalToJSXArgs): React.ReactNode {\n if (hasText(data)) {\n return convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes: data?.root?.children,\n parent: data?.root,\n })\n }\n return <></>\n}\n\nexport function convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes,\n parent,\n}: {\n converters: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent: SerializedLexicalNodeWithParent\n}): React.ReactNode[] {\n const unknownConverter: JSXConverter<any> = converters.unknown as JSXConverter<any>\n\n const jsxArray: React.ReactNode[] = nodes.map((node, i) => {\n let converterForNode: JSXConverter<any> | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[(node as SerializedBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode =\n converters?.inlineBlocks?.[(node as SerializedInlineBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as JSXConverter<any>\n }\n\n try {\n if (!converterForNode && unknownConverter) {\n converterForNode = unknownConverter\n }\n\n let reactNode: React.ReactNode\n if (converterForNode) {\n const converted =\n typeof converterForNode === 'function'\n ? converterForNode({\n childIndex: i,\n converters,\n node,\n nodesToJSX: (args) => {\n return convertLexicalNodesToJSX({\n converters: args.converters ?? converters,\n disableIndent: args.disableIndent ?? disableIndent,\n disableTextAlign: args.disableTextAlign ?? disableTextAlign,\n nodes: args.nodes,\n parent: args.parent ?? {\n ...node,\n parent,\n },\n })\n },\n parent,\n })\n : converterForNode\n reactNode = converted\n } else {\n reactNode = <span key={i}>unknown node</span>\n }\n\n const style: React.CSSProperties = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style.textAlign = 'center'\n break\n case 'end':\n style.textAlign = 'right'\n break\n case 'justify':\n style.textAlign = 'justify'\n break\n case 'left':\n //style.textAlign = 'left'\n // Do nothing, as left is the default\n break\n case 'right':\n style.textAlign = 'right'\n break\n case 'start':\n style.textAlign = 'left'\n break\n }\n }\n }\n\n if (\n !disableIndent &&\n (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))\n ) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style.paddingInlineStart = `${Number(node.indent) * 40}px`\n }\n }\n\n if (React.isValidElement(reactNode)) {\n // Inject style into reactNode\n if (style.textAlign || style.paddingInlineStart) {\n const newStyle = {\n ...style,\n // @ts-expect-error type better later\n ...(reactNode?.props?.style ?? {}),\n // reactNode style comes after, thus a textAlign specified in the converter has priority over the one we inject here\n }\n\n return React.cloneElement(reactNode, {\n key: i,\n // @ts-expect-error type better later\n style: newStyle,\n })\n }\n return React.cloneElement(reactNode, {\n key: i,\n })\n }\n\n return reactNode\n } catch (error) {\n console.error('Error converting lexical node to JSX:', error, 'node:', node)\n return null\n }\n })\n\n return jsxArray.filter(Boolean)\n}\n"],"names":["React","hasText","convertLexicalToJSX","converters","data","disableIndent","disableTextAlign","convertLexicalNodesToJSX","nodes","root","children","parent","unknownConverter","unknown","jsxArray","map","node","i","converterForNode","type","blocks","fields","blockType","console","error","inlineBlocks","reactNode","converted","childIndex","nodesToJSX","args","span","style","Array","isArray","includes","format","textAlign","indent","paddingInlineStart","Number","isValidElement","newStyle","props","cloneElement","key","filter","Boolean"],"mappings":";AAAA,6BAA6B,GAG7B,OAAOA,WAAW,QAAO;AAKzB,SAASC,OAAO,QAAQ,kCAAiC;AASzD,OAAO,SAASC,oBAAoB,EAClCC,UAAU,EACVC,IAAI,EACJC,aAAa,EACbC,gBAAgB,EACQ;IACxB,IAAIL,QAAQG,OAAO;QACjB,OAAOG,yBAAyB;YAC9BJ;YACAE;YACAC;YACAE,OAAOJ,MAAMK,MAAMC;YACnBC,QAAQP,MAAMK;QAChB;IACF;IACA,qBAAO;AACT;AAEA,OAAO,SAASF,yBAAyB,EACvCJ,UAAU,EACVE,aAAa,EACbC,gBAAgB,EAChBE,KAAK,EACLG,MAAM,EAOP;IACC,MAAMC,mBAAsCT,WAAWU,OAAO;IAE9D,MAAMC,WAA8BN,MAAMO,GAAG,CAAC,CAACC,MAAMC;QACnD,IAAIC;QACJ,IAAIF,KAAKG,IAAI,KAAK,SAAS;YACzBD,mBAAmBf,YAAYiB,QAAQ,CAAEJ,MAA8BK,QAAQC,UAAU;YACzF,IAAI,CAACJ,oBAAoB,CAACN,kBAAkB;gBAC1CW,QAAQC,KAAK,CACX,CAAC,kDAAkD,EAAGR,MAA8BK,QAAQC,UAAU,oCAAoC,CAAC;YAE/I;QACF,OAAO,IAAIN,KAAKG,IAAI,KAAK,eAAe;YACtCD,mBACEf,YAAYsB,cAAc,CAAET,MAAoCK,QAAQC,UAAU;YACpF,IAAI,CAACJ,oBAAoB,CAACN,kBAAkB;gBAC1CW,QAAQC,KAAK,CACX,CAAC,yDAAyD,EAAGR,MAAoCK,QAAQC,UAAU,2CAA2C,CAA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B,KAAKG,IAAI,CAAA,GACpE;gBACA,IAAI,YAAYH,QAAQA,KAAKsB,MAAM,IAAItB,KAAKG,IAAI,KAAK,YAAY;oBAC/D,yEAAyE;oBACzE,wDAAwD;oBACxD,mBAAmB;oBACnB,6EAA6E;oBAC7Ea,MAAMO,kBAAkB,GAAG,GAAGC,OAAOxB,KAAKsB,MAAM,IAAI,GAAG,EAAE,CAAC;gBAC5D;YACF;YAEA,kBAAItC,MAAMyC,cAAc,CAACf,YAAY;gBACnC,8BAA8B;gBAC9B,IAAIM,MAAMK,SAAS,IAAIL,MAAMO,kBAAkB,EAAE;oBAC/C,MAAMG,WAAW;wBACf,GAAGV,KAAK;wBACR,qCAAqC;wBACrC,GAAIN,WAAWiB,OAAOX,SAAS,CAAC,CAAC;oBAEnC;oBADE,oHAAoH;oBAGtH,qBAAOhC,MAAM4C,YAAY,CAAClB,WAAW;wBACnCmB,KAAK5B;wBACL,qCAAqC;wBACrCe,OAAOU;oBACT;gBACF;gBACA,qBAAO1C,MAAM4C,YAAY,CAAClB,WAAW;oBACnCmB,KAAK5B;gBACP;YACF;YAEA,OAAOS;QACT,EAAE,OAAOF,OAAO;YACdD,QAAQC,KAAK,CAAC,yCAAyCA,OAAO,SAASR;YACvE,OAAO;QACT;IACF;IAEA,OAAOF,SAASgC,MAAM,CAACC;AACzB"}
1
+ {"version":3,"sources":["../../../../../src/features/converters/lexicalToJSX/converter/index.tsx"],"sourcesContent":["/* eslint-disable no-console */\nimport type { SerializedEditorState, SerializedLexicalNode } from 'lexical'\n\nimport React from 'react'\n\nimport type { SerializedBlockNode, SerializedInlineBlockNode } from '../../../../nodeTypes.js'\nimport type { JSXConverter, JSXConverters, SerializedLexicalNodeWithParent } from './types.js'\n\nimport { hasText } from '../../../../validate/hasText.js'\n\nexport type ConvertLexicalToJSXArgs = {\n converters: JSXConverters\n data: SerializedEditorState\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n}\n\nexport function convertLexicalToJSX({\n converters,\n data,\n disableIndent,\n disableTextAlign,\n}: ConvertLexicalToJSXArgs): React.ReactNode {\n if (hasText(data)) {\n return convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes: data?.root?.children,\n parent: data?.root,\n })\n }\n return <></>\n}\n\nexport function convertLexicalNodesToJSX({\n converters,\n disableIndent,\n disableTextAlign,\n nodes,\n parent,\n}: {\n converters: JSXConverters\n disableIndent?: boolean | string[]\n disableTextAlign?: boolean | string[]\n nodes: SerializedLexicalNode[]\n parent: SerializedLexicalNodeWithParent\n}): React.ReactNode[] {\n const unknownConverter: JSXConverter<any> = converters.unknown as JSXConverter<any>\n\n const jsxArray: React.ReactNode[] = nodes.map((node, i) => {\n let converterForNode: JSXConverter<any> | undefined\n if (node.type === 'block') {\n converterForNode = converters?.blocks?.[(node as SerializedBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Blocks converter: found ${(node as SerializedBlockNode)?.fields?.blockType} block, but no converter is provided`,\n )\n }\n } else if (node.type === 'inlineBlock') {\n converterForNode =\n converters?.inlineBlocks?.[(node as SerializedInlineBlockNode)?.fields?.blockType]\n if (!converterForNode && !unknownConverter) {\n console.error(\n `Lexical => JSX converter: Inline Blocks converter: found ${(node as SerializedInlineBlockNode)?.fields?.blockType} inline block, but no converter is provided`,\n )\n }\n } else {\n converterForNode = converters[node.type] as JSXConverter<any>\n }\n\n try {\n if (!converterForNode && unknownConverter) {\n converterForNode = unknownConverter\n }\n\n let reactNode: React.ReactNode\n if (converterForNode) {\n const converted =\n typeof converterForNode === 'function'\n ? converterForNode({\n childIndex: i,\n converters,\n node,\n nodesToJSX: (args) => {\n return convertLexicalNodesToJSX({\n converters: args.converters ?? converters,\n disableIndent: args.disableIndent ?? disableIndent,\n disableTextAlign: args.disableTextAlign ?? disableTextAlign,\n nodes: args.nodes,\n parent: args.parent ?? {\n ...node,\n parent,\n },\n })\n },\n parent,\n })\n : converterForNode\n reactNode = converted\n } else {\n reactNode = <span key={i}>unknown node</span>\n }\n\n const style: React.CSSProperties = {}\n\n // Check if disableTextAlign is not true and does not include node type\n if (\n !disableTextAlign &&\n (!Array.isArray(disableTextAlign) || !disableTextAlign?.includes(node.type))\n ) {\n if ('format' in node && node.format) {\n switch (node.format) {\n case 'center':\n style.textAlign = 'center'\n break\n case 'end':\n style.textAlign = 'right'\n break\n case 'justify':\n style.textAlign = 'justify'\n break\n case 'left':\n //style.textAlign = 'left'\n // Do nothing, as left is the default\n break\n case 'right':\n style.textAlign = 'right'\n break\n case 'start':\n style.textAlign = 'left'\n break\n }\n }\n }\n\n if (\n !disableIndent &&\n (!Array.isArray(disableIndent) || !disableIndent?.includes(node.type))\n ) {\n if ('indent' in node && node.indent && node.type !== 'listitem') {\n // the unit should be px. Do not change it to rem, em, or something else.\n // The quantity should be 40px. Do not change it either.\n // See rationale in\n // https://github.com/payloadcms/payload/issues/13130#issuecomment-3058348085\n style.paddingInlineStart = `${Number(node.indent) * 40}px`\n }\n }\n\n if (React.isValidElement(reactNode)) {\n // Inject style into reactNode\n if (style.textAlign || style.paddingInlineStart) {\n const newStyle = {\n ...style,\n // @ts-expect-error type better later\n ...(reactNode?.props?.style ?? {}),\n // reactNode style comes after, thus a textAlign specified in the converter has priority over the one we inject here\n }\n\n return React.cloneElement(reactNode, {\n key: i,\n // @ts-expect-error type better later\n style: newStyle,\n })\n }\n return React.cloneElement(reactNode, {\n key: i,\n })\n }\n\n return reactNode\n } catch (error) {\n console.error('Error converting lexical node to JSX:', error, 'node:', node)\n return null\n }\n })\n\n return jsxArray.filter(Boolean)\n}\n"],"names":["React","hasText","convertLexicalToJSX","converters","data","disableIndent","disableTextAlign","convertLexicalNodesToJSX","nodes","root","children","parent","unknownConverter","unknown","jsxArray","map","node","i","converterForNode","type","blocks","fields","blockType","console","error","inlineBlocks","reactNode","converted","childIndex","nodesToJSX","args","span","key","style","Array","isArray","includes","format","textAlign","indent","paddingInlineStart","Number","isValidElement","newStyle","props","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AAG,EAAE,CAAC;gBAC5D;YACF;YAEA,IAAIvC,MAAM0C,cAAc,CAAChB,YAAY;gBACnC,8BAA8B;gBAC9B,IAAIO,MAAMK,SAAS,IAAIL,MAAMO,kBAAkB,EAAE;oBAC/C,MAAMG,WAAW;wBACf,GAAGV,KAAK;wBACR,qCAAqC;wBACrC,GAAIP,WAAWkB,OAAOX,SAAS,CAAC,CAAC;oBAEnC;oBADE,oHAAoH;oBAGtH,OAAOjC,MAAM6C,YAAY,CAACnB,WAAW;wBACnCM,KAAKf;wBACL,qCAAqC;wBACrCgB,OAAOU;oBACT;gBACF;gBACA,OAAO3C,MAAM6C,YAAY,CAACnB,WAAW;oBACnCM,KAAKf;gBACP;YACF;YAEA,OAAOS;QACT,EAAE,OAAOF,OAAO;YACdD,QAAQC,KAAK,CAAC,yCAAyCA,OAAO,SAASR;YACvE,OAAO;QACT;IACF;IAEA,OAAOF,SAASgC,MAAM,CAACC;AACzB"}
@@ -1,5 +1,4 @@
1
1
  'use client';
2
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
2
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
4
3
  import { useEffect, useState } from 'react';
5
4
  // eslint-disable-next-line payload/no-imports-from-exports-dir
@@ -15,21 +14,9 @@ export function RichTextPlugin() {
15
14
  }, [
16
15
  editor
17
16
  ]);
18
- return /*#__PURE__*/ _jsxDEV("div", {
19
- className: "debug-jsx-converter",
20
- children: /*#__PURE__*/ _jsxDEV(RichText, {
21
- converters: defaultJSXConverters,
22
- data: editorState
23
- }, void 0, false, {
24
- fileName: "src/features/debug/jsxConverter/client/plugin/index.tsx",
25
- lineNumber: 22,
26
- columnNumber: 7
27
- }, this)
28
- }, void 0, false, {
29
- fileName: "src/features/debug/jsxConverter/client/plugin/index.tsx",
30
- lineNumber: 21,
31
- columnNumber: 5
32
- }, this);
17
+ return <div className="debug-jsx-converter">
18
+ <RichText converters={defaultJSXConverters} data={editorState}/>
19
+ </div>;
33
20
  }
34
21
 
35
22
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"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"],"names":["useLexicalComposerContext","useEffect","useState","defaultJSXConverters","RichText","RichTextPlugin","editor","editorState","setEditorState","getEditorState","toJSON","registerUpdateListener","div","className","converters","data"],"mappings":"AAAA;;AAEA,SAASA,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE3C,+DAA+D;AAC/D,SAASC,oBAAoB,EAAEC,QAAQ,QAAQ,wCAAuC;AACtF,OAAO,eAAc;AAErB,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGN;IACjB,MAAM,CAACO,aAAaC,eAAe,GAAGN,SAASI,OAAOG,cAAc,GAAGC,MAAM;IAE7ET,UAAU;QACR,OAAOK,OAAOK,sBAAsB,CAAC,CAAC,EAAEJ,WAAW,EAAE;YACnDC,eAAeD,YAAYG,MAAM;QACnC;IACF,GAAG;QAACJ;KAAO;IAEX,qBACE,QAACM;QAAIC,WAAU;kBACb,cAAA,QAACT;YAASU,YAAYX;YAAsBY,MAAMR;;;;;;;;;;;AAGxD"}
1
+ {"version":3,"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"],"names":["useLexicalComposerContext","useEffect","useState","defaultJSXConverters","RichText","RichTextPlugin","editor","editorState","setEditorState","getEditorState","toJSON","registerUpdateListener","div","className","converters","data"],"mappings":"AAAA;AAEA,SAASA,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAE3C,+DAA+D;AAC/D,SAASC,oBAAoB,EAAEC,QAAQ,QAAQ,wCAAuC;AACtF,OAAO,eAAc;AAErB,OAAO,SAASC;IACd,MAAM,CAACC,OAAO,GAAGN;IACjB,MAAM,CAACO,aAAaC,eAAe,GAAGN,SAASI,OAAOG,cAAc,GAAGC,MAAM;IAE7ET,UAAU;QACR,OAAOK,OAAOK,sBAAsB,CAAC,CAAC,EAAEJ,WAAW,EAAE;YACnDC,eAAeD,YAAYG,MAAM;QACnC;IACF,GAAG;QAACJ;KAAO;IAEX,QACGM,IAAIC,UAAU,sBAAsB;MACnC,CAACT,SAASU,YAAYX,sBAAsBY,MAAMR,cAAe;IACnE,EAAEK;AAEN"}
@@ -1,5 +1,4 @@
1
1
  'use client';
2
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
2
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
4
3
  import { $createParagraphNode, $createTextNode, $getRoot, getDOMSelection } from 'lexical';
5
4
  import * as React from 'react';
@@ -389,125 +388,51 @@ ${steps.map(formatStep).join(`\n`)}
389
388
  }, [
390
389
  generateTestContent
391
390
  ]);
392
- const button = /*#__PURE__*/ _jsxDEV("button", {
393
- className: `editor-dev-button ${isRecording ? 'active' : ''}`,
394
- id: "test-recorder-button",
395
- onClick: (e)=>{
396
- toggleEditorSelection(getCurrentEditor());
397
- e.preventDefault();
398
- },
399
- title: isRecording ? 'Disable test recorder' : 'Enable test recorder',
400
- type: "button",
401
- children: isRecording ? 'Disable test recorder' : 'Enable test recorder'
402
- }, void 0, false, {
403
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
404
- lineNumber: 386,
405
- columnNumber: 5
406
- }, this);
407
- const output = isRecording ? /*#__PURE__*/ _jsxDEV("div", {
408
- className: "test-recorder-output",
409
- children: [
410
- /*#__PURE__*/ _jsxDEV("div", {
411
- className: "test-recorder-toolbar",
412
- children: [
413
- /*#__PURE__*/ _jsxDEV("button", {
414
- className: "test-recorder-button",
415
- id: "test-recorder-button-snapshot",
416
- onClick: (e)=>{
417
- onSnapshotClick();
418
- e.preventDefault();
419
- },
420
- title: "Insert snapshot",
421
- type: "button",
422
- children: "Insert Snapshot"
423
- }, void 0, false, {
424
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
425
- lineNumber: 402,
426
- columnNumber: 9
427
- }, this),
428
- /*#__PURE__*/ _jsxDEV("button", {
429
- className: "test-recorder-button",
430
- id: "test-recorder-button-copy",
431
- onClick: (e)=>{
432
- onCopyClick();
433
- e.preventDefault();
434
- },
435
- title: "Copy to clipboard",
436
- type: "button",
437
- children: "Copy"
438
- }, void 0, false, {
439
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
440
- lineNumber: 414,
441
- columnNumber: 9
442
- }, this),
443
- /*#__PURE__*/ _jsxDEV("button", {
444
- className: "test-recorder-button",
445
- id: "test-recorder-button-download",
446
- onClick: (e)=>{
447
- onDownloadClick();
448
- e.preventDefault();
449
- },
450
- title: "Download as a file",
451
- type: "button",
452
- children: "Download"
453
- }, void 0, false, {
454
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
455
- lineNumber: 426,
456
- columnNumber: 9
457
- }, this)
458
- ]
459
- }, void 0, true, {
460
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
461
- lineNumber: 401,
462
- columnNumber: 7
463
- }, this),
464
- /*#__PURE__*/ _jsxDEV("pre", {
465
- id: "test-recorder",
466
- ref: preRef,
467
- children: templatedTest
468
- }, void 0, false, {
469
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
470
- lineNumber: 439,
471
- columnNumber: 7
472
- }, this)
473
- ]
474
- }, void 0, true, {
475
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
476
- lineNumber: 400,
477
- columnNumber: 5
478
- }, this) : null;
391
+ const button1 = <button className={`editor-dev-button ${isRecording ? 'active' : ''}`} id="test-recorder-button" onClick={(e)=>{
392
+ toggleEditorSelection(getCurrentEditor());
393
+ e.preventDefault();
394
+ }} title={isRecording ? 'Disable test recorder' : 'Enable test recorder'} type="button">
395
+ {isRecording ? 'Disable test recorder' : 'Enable test recorder'}
396
+ </button>;
397
+ const output = isRecording ? <div className="test-recorder-output">
398
+ <div className="test-recorder-toolbar">
399
+ <button className="test-recorder-button" id="test-recorder-button-snapshot" onClick={(e)=>{
400
+ onSnapshotClick();
401
+ e.preventDefault();
402
+ }} title="Insert snapshot" type="button">
403
+ Insert Snapshot
404
+ </button>
405
+ <button className="test-recorder-button" id="test-recorder-button-copy" onClick={(e)=>{
406
+ onCopyClick();
407
+ e.preventDefault();
408
+ }} title="Copy to clipboard" type="button">
409
+ Copy
410
+ </button>
411
+ <button className="test-recorder-button" id="test-recorder-button-download" onClick={(e)=>{
412
+ onDownloadClick();
413
+ e.preventDefault();
414
+ }} title="Download as a file" type="button">
415
+ Download
416
+ </button>
417
+ </div>
418
+ <pre id="test-recorder" ref={preRef}>
419
+ {templatedTest}
420
+ </pre>
421
+ </div> : null;
479
422
  return [
480
- button,
423
+ button1,
481
424
  output
482
425
  ];
483
426
  }
484
427
  export const TestRecorderPlugin = ()=>{
485
428
  const [editor] = useLexicalComposerContext();
486
429
  const [testRecorderButton, testRecorderOutput] = useTestRecorder(editor);
487
- return /*#__PURE__*/ _jsxDEV(React.Fragment, {
488
- children: [
489
- /*#__PURE__*/ _jsxDEV("p", {
490
- children: "HI"
491
- }, void 0, false, {
492
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
493
- lineNumber: 453,
494
- columnNumber: 7
495
- }, this),
496
- testRecorderButton,
497
- testRecorderOutput,
498
- /*#__PURE__*/ _jsxDEV("p", {
499
- children: "DONE"
500
- }, void 0, false, {
501
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
502
- lineNumber: 456,
503
- columnNumber: 7
504
- }, this)
505
- ]
506
- }, void 0, true, {
507
- fileName: "src/features/debug/testRecorder/client/plugin/index.tsx",
508
- lineNumber: 452,
509
- columnNumber: 5
510
- }, this);
430
+ return <React.Fragment>
431
+ <p>HI</p>
432
+ {testRecorderButton}
433
+ {testRecorderOutput}
434
+ <p>DONE</p>
435
+ </React.Fragment>;
511
436
  };
512
437
 
513
438
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"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"],"names":["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","className","id","onClick","e","preventDefault","title","type","output","div","pre","ref","TestRecorderPlugin","testRecorderButton","testRecorderOutput","Fragment","p"],"mappings":"AAAA;;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,oBAAoB,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,eAAe,QAAQ,UAAS;AAC1F,YAAYC,WAAW,QAAO;AAC9B,SAAmBC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAI3F,SAASC,QAAQ,QAAQ,8CAA6C;AACtE,OAAO,eAAc;AAErB,MAAMC,OAAO,CAACC;IACZ,MAAMC,WAAWC,SAASC,aAAa,CAAC;IACxCF,SAASG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O;AACzB;AACA,OAAO,MAAMI,qBAAiD;IAC5D,MAAM,CAACpE,OAAO,GAAG7E;IACjB,MAAM,CAACkJ,oBAAoBC,mBAAmB,GAAGvE,gBAAgBC;IAEjE,qBACE,QAACxE,MAAM+I,QAAQ;;0BACb,QAACC;0BAAE;;;;;;YACFH;YACAC;0BACD,QAACE;0BAAE;;;;;;;;;;;;AAGT,EAAC"}
1
+ {"version":3,"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"],"names":["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","className","id","onClick","e","preventDefault","title","type","output","div","pre","ref","TestRecorderPlugin","testRecorderButton","testRecorderOutput","Fragment","p"],"mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,oBAAoB,EAAEC,eAAe,EAAEC,QAAQ,EAAEC,eAAe,QAAQ,UAAS;AAC1F,YAAYC,WAAW,QAAO;AAC9B,SAAmBC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAI3F,SAASC,QAAQ,QAAQ,8CAA6C;AACtE,OAAO,eAAc;AAErB,MAAMC,OAAO,CAACC;IACZ,MAAMC,WAAWC,SAASC,aAAa,CAAC;IACxCF,SAASG,KAAK,GAAGJ,QAAQ;IACzBC,SAASI,KAAK,CAACC,QAAQ,GAAG;IAC1BL,SAASI,KAAK,CAACE,OAAO,GAAG;IACzBL,SAASM,IAAI,EAAEC,YAAYR;IAC3BA,SAASS,KAAK;IACdT,SAASU,MAAM;IACf,IAAI;QACF,MAAMC,SAASV,SAASW,WAAW,CAAC;QACpC,sCAAsC;QACtCC,QAAQC,GAAG,CAACH;IACd,EAAE,OAAOI,OAAO;QACdF,QAAQE,KAAK,CAACA;IAChB;IACAd,SAASM,IAAI,EAAES,YAAYhB;AAC7B;AAEA,MAAMiB,WAAW,CAACC,UAAkBnB;IAClC,MAAMoB,IAAIlB,SAASC,aAAa,CAAC;IACjCiB,EAAEC,YAAY,CAAC,QAAQ,mCAAmCC,mBAAmBtB,QAAQ;IACrFoB,EAAEC,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ACC;QACRd,sBAAsBnC;QACtBiD,EAAEC,cAAc;IAClB,GACAC,OAAO3D,cAAc,0BAA0B,wBAC/C4D,KAAK,SACN;MACC,CAAC5D,cAAc,0BAA0B,uBAAuB;IAClE,EAAEqD;IAEJ,MAAMQ,SAAS7D,eACZ8D,IAAIR,UAAU,uBAAuB;MACpC,CAACQ,IAAIR,UAAU,wBAAwB;QACrC,CAACD,OACCC,UAAU,uBACVC,GAAG,gCACHC,SAAS,CAACC;QACRP;QACAO,EAAEC,cAAc;IAClB,GACAC,MAAM,kBACNC,KAAK,SACN;;QAED,EAAEP,OAAO;QACT,CAACA,OACCC,UAAU,uBACVC,GAAG,4BACHC,SAAS,CAACC;QACRN;QACAM,EAAEC,cAAc;IAClB,GACAC,MAAM,oBACNC,KAAK,SACN;;QAED,EAAEP,OAAO;QACT,CAACA,OACCC,UAAU,uBACVC,GAAG,gCACHC,SAAS,CAACC;QACRL;QACAK,EAAEC,cAAc;IAClB,GACAC,MAAM,qBACNC,KAAK,SACN;;QAED,EAAEP,OAAO;MACX,EAAES,IAAI;MACN,CAACC,IAAIR,GAAG,gBAAgBS,KAAKzD,QAAQ;QACnC,CAACJ,cAAc;MACjB,EAAE4D,IAAI;IACR,EAAED,OACA;IAEJ,OAAO;QAACT;QAAQQ;KAAO;AACzB;AACA,OAAO,MAAMI,qBAAiD;IAC5D,MAAM,CAACpE,OAAO,GAAG7E;IACjB,MAAM,CAACkJ,oBAAoBC,mBAAmB,GAAGvE,gBAAgBC;IAEjE,QACGxE,MAAM+I,SAAS;MACd,CAACC,EAAE,EAAE,EAAEA,EAAE;MACT,CAACH,mBAAmB;MACpB,CAACC,mBAAmB;MACpB,CAACE,EAAE,IAAI,EAAEA,EAAE;IACb,EAAEhJ,MAAM+I;AAEZ,EAAC"}
@@ -1,24 +1,10 @@
1
1
  'use client';
2
- import { jsxDEV as _jsxDEV } from "react/jsx-dev-runtime";
3
2
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
4
3
  import { TreeView } from '@lexical/react/LexicalTreeView.js';
5
- import * as React from 'react';
6
4
  import './index.scss';
7
5
  export const TreeViewPlugin = ()=>{
8
6
  const [editor] = useLexicalComposerContext();
9
- return /*#__PURE__*/ _jsxDEV(TreeView, {
10
- editor: editor,
11
- timeTravelButtonClassName: "debug-timetravel-button",
12
- timeTravelPanelButtonClassName: "debug-timetravel-panel-button",
13
- timeTravelPanelClassName: "debug-timetravel-panel",
14
- timeTravelPanelSliderClassName: "debug-timetravel-panel-slider",
15
- treeTypeButtonClassName: "debug-treetype-button",
16
- viewClassName: "tree-view-output"
17
- }, void 0, false, {
18
- fileName: "src/features/debug/treeView/client/plugin/index.tsx",
19
- lineNumber: 13,
20
- columnNumber: 5
21
- }, this);
7
+ return <TreeView editor={editor} timeTravelButtonClassName="debug-timetravel-button" timeTravelPanelButtonClassName="debug-timetravel-panel-button" timeTravelPanelClassName="debug-timetravel-panel" timeTravelPanelSliderClassName="debug-timetravel-panel-slider" treeTypeButtonClassName="debug-treetype-button" viewClassName="tree-view-output"/>;
22
8
  };
23
9
 
24
10
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/features/debug/treeView/client/plugin/index.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { TreeView } from '@lexical/react/LexicalTreeView.js'\nimport * as React from 'react'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nimport './index.scss'\n\nexport const TreeViewPlugin: PluginComponent<undefined> = () => {\n const [editor] = useLexicalComposerContext()\n return (\n <TreeView\n editor={editor}\n timeTravelButtonClassName=\"debug-timetravel-button\"\n timeTravelPanelButtonClassName=\"debug-timetravel-panel-button\"\n timeTravelPanelClassName=\"debug-timetravel-panel\"\n timeTravelPanelSliderClassName=\"debug-timetravel-panel-slider\"\n treeTypeButtonClassName=\"debug-treetype-button\"\n viewClassName=\"tree-view-output\"\n />\n )\n}\n"],"names":["useLexicalComposerContext","TreeView","React","TreeViewPlugin","editor","timeTravelButtonClassName","timeTravelPanelButtonClassName","timeTravelPanelClassName","timeTravelPanelSliderClassName","treeTypeButtonClassName","viewClassName"],"mappings":"AAAA;;AACA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,QAAQ,QAAQ,oCAAmC;AAC5D,YAAYC,WAAW,QAAO;AAI9B,OAAO,eAAc;AAErB,OAAO,MAAMC,iBAA6C;IACxD,MAAM,CAACC,OAAO,GAAGJ;IACjB,qBACE,QAACC;QACCG,QAAQA;QACRC,2BAA0B;QAC1BC,gCAA+B;QAC/BC,0BAAyB;QACzBC,gCAA+B;QAC/BC,yBAAwB;QACxBC,eAAc;;;;;;AAGpB,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/features/debug/treeView/client/plugin/index.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { TreeView } from '@lexical/react/LexicalTreeView.js'\nimport * as React from 'react'\n\nimport type { PluginComponent } from '../../../../typesClient.js'\n\nimport './index.scss'\n\nexport const TreeViewPlugin: PluginComponent<undefined> = () => {\n const [editor] = useLexicalComposerContext()\n return (\n <TreeView\n editor={editor}\n timeTravelButtonClassName=\"debug-timetravel-button\"\n timeTravelPanelButtonClassName=\"debug-timetravel-panel-button\"\n timeTravelPanelClassName=\"debug-timetravel-panel\"\n timeTravelPanelSliderClassName=\"debug-timetravel-panel-slider\"\n treeTypeButtonClassName=\"debug-treetype-button\"\n viewClassName=\"tree-view-output\"\n />\n )\n}\n"],"names":["useLexicalComposerContext","TreeView","TreeViewPlugin","editor","timeTravelButtonClassName","timeTravelPanelButtonClassName","timeTravelPanelClassName","timeTravelPanelSliderClassName","treeTypeButtonClassName","viewClassName"],"mappings":"AAAA;AACA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,QAAQ,QAAQ,oCAAmC;AAK5D,OAAO,eAAc;AAErB,OAAO,MAAMC,iBAA6C;IACxD,MAAM,CAACC,OAAO,GAAGH;IACjB,QACGC,SACCE,QAAQA,QACRC,0BAA0B,0BAC1BC,+BAA+B,gCAC/BC,yBAAyB,yBACzBC,+BAA+B,gCAC/BC,wBAAwB,wBACxBC,cAAc;AAGpB,EAAC"}