@payloadcms/richtext-lexical 3.0.0-alpha.67 → 3.0.0-alpha.68

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 (256) hide show
  1. package/dist/exports/components.d.ts +2 -2
  2. package/dist/exports/components.d.ts.map +1 -1
  3. package/dist/exports/components.js +2 -2
  4. package/dist/exports/components.js.map +1 -1
  5. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  6. package/dist/field/features/align/feature.client.js +15 -21
  7. package/dist/field/features/align/feature.client.js.map +1 -1
  8. package/dist/field/features/align/inlineToolbarAlignGroup.d.ts +3 -0
  9. package/dist/field/features/align/inlineToolbarAlignGroup.d.ts.map +1 -0
  10. package/dist/field/features/align/{floatingSelectToolbarAlignDropdownSection.js → inlineToolbarAlignGroup.js} +4 -4
  11. package/dist/field/features/align/inlineToolbarAlignGroup.js.map +1 -0
  12. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  13. package/dist/field/features/blockquote/feature.client.js +33 -31
  14. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  15. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  16. package/dist/field/features/blocks/feature.client.js +25 -27
  17. package/dist/field/features/blocks/feature.client.js.map +1 -1
  18. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts.map +1 -1
  19. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
  20. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts.map +1 -1
  21. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +1 -1
  22. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js.map +1 -1
  23. package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.d.ts.map +1 -1
  24. package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js.map +1 -1
  25. package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts.map +1 -1
  26. package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
  27. package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts.map +1 -1
  28. package/dist/field/features/debug/{treeview → treeView}/feature.server.js +1 -1
  29. package/dist/field/features/debug/{treeview → treeView}/feature.server.js.map +1 -1
  30. package/dist/field/features/debug/{treeview → treeView}/plugin/index.d.ts.map +1 -1
  31. package/dist/field/features/debug/{treeview → treeView}/plugin/index.js.map +1 -1
  32. package/dist/field/features/format/bold/feature.client.js +7 -7
  33. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  34. package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts.map +1 -1
  35. package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.js +10 -10
  36. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
  37. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts.map +1 -1
  38. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +1 -1
  39. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js.map +1 -1
  40. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
  41. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
  42. package/dist/field/features/format/italic/feature.client.js +10 -10
  43. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  44. package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts +3 -0
  45. package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts.map +1 -0
  46. package/dist/field/features/format/shared/inlineToolbarFormatGroup.js +10 -0
  47. package/dist/field/features/format/shared/inlineToolbarFormatGroup.js.map +1 -0
  48. package/dist/field/features/format/strikethrough/feature.client.js +9 -9
  49. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  50. package/dist/field/features/format/subscript/feature.client.js +5 -5
  51. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  52. package/dist/field/features/format/superscript/feature.client.js +5 -5
  53. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  54. package/dist/field/features/format/underline/feature.client.js +5 -5
  55. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  56. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  57. package/dist/field/features/heading/feature.client.js +39 -39
  58. package/dist/field/features/heading/feature.client.js.map +1 -1
  59. package/dist/field/features/{horizontalrule → horizontalRule}/component/index.d.ts.map +1 -1
  60. package/dist/field/features/{horizontalrule → horizontalRule}/component/index.js.map +1 -1
  61. package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.d.ts.map +1 -1
  62. package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.js +7 -7
  63. package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
  64. package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.d.ts.map +1 -1
  65. package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.js +1 -1
  66. package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.js.map +1 -1
  67. package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts.map +1 -1
  68. package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js.map +1 -1
  69. package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts.map +1 -1
  70. package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js.map +1 -1
  71. package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.d.ts.map +1 -1
  72. package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.js.map +1 -1
  73. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  74. package/dist/field/features/indent/feature.client.js +9 -11
  75. package/dist/field/features/indent/feature.client.js.map +1 -1
  76. package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts +3 -0
  77. package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts.map +1 -0
  78. package/dist/field/features/indent/inlineToolbarIndentGroup.js +10 -0
  79. package/dist/field/features/indent/inlineToolbarIndentGroup.js.map +1 -0
  80. package/dist/field/features/link/feature.client.js +28 -28
  81. package/dist/field/features/link/feature.client.js.map +1 -1
  82. package/dist/field/features/lists/checklist/feature.client.d.ts +1 -1
  83. package/dist/field/features/lists/checklist/feature.client.js +28 -28
  84. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  85. package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
  86. package/dist/field/features/lists/checklist/feature.server.js +4 -4
  87. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  88. package/dist/field/features/lists/checklist/markdownTransformers.js +1 -1
  89. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  90. package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts.map +1 -1
  91. package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.js +26 -26
  92. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
  93. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts.map +1 -1
  94. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +1 -1
  95. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js.map +1 -1
  96. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts.map +1 -1
  97. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +1 -1
  98. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js.map +1 -1
  99. package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
  100. package/dist/field/features/lists/{common → shared}/markdown.js.map +1 -1
  101. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
  102. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.js +24 -24
  103. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
  104. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts.map +1 -1
  105. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +1 -1
  106. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js.map +1 -1
  107. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts.map +1 -1
  108. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +1 -1
  109. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js.map +1 -1
  110. package/dist/field/features/paragraph/feature.client.js +27 -27
  111. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  112. package/dist/field/features/relationship/feature.client.js +7 -7
  113. package/dist/field/features/relationship/feature.client.js.map +1 -1
  114. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts +3 -0
  115. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts.map +1 -0
  116. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js +10 -0
  117. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js.map +1 -0
  118. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts +3 -0
  119. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts.map +1 -0
  120. package/dist/field/features/{common/floatingSelectToolbarTextDropdownSection/index.js → shared/inlineToolbar/textDropdownGroup.js} +4 -4
  121. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.js.map +1 -0
  122. package/dist/field/features/types.d.ts +51 -12
  123. package/dist/field/features/types.d.ts.map +1 -1
  124. package/dist/field/features/types.js.map +1 -1
  125. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  126. package/dist/field/features/upload/feature.client.js +7 -7
  127. package/dist/field/features/upload/feature.client.js.map +1 -1
  128. package/dist/field/lexical/LexicalEditor.js +1 -1
  129. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  130. package/dist/field/lexical/LexicalEditor.scss +3 -19
  131. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  132. package/dist/field/lexical/config/client/sanitize.js +80 -32
  133. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  134. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  135. package/dist/field/lexical/config/server/default.js +6 -6
  136. package/dist/field/lexical/config/server/default.js.map +1 -1
  137. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +9 -9
  138. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  139. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +71 -71
  140. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  141. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +4 -4
  142. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  143. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -3
  144. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  145. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +12 -20
  146. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  147. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
  148. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  149. package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
  150. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  151. package/dist/field/lexical/plugins/SlashMenu/index.js +67 -61
  152. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  153. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/fixed}/types.d.ts +6 -6
  154. package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts.map +1 -0
  155. package/dist/field/lexical/plugins/toolbars/fixed/types.js.map +1 -0
  156. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  157. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline/Toolbar}/index.js +32 -32
  158. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.js.map +1 -0
  159. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline/Toolbar}/index.scss +5 -4
  160. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts +8 -0
  161. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts.map +1 -0
  162. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarButton/index.js +9 -9
  163. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.js.map +1 -0
  164. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarButton/index.scss +1 -1
  165. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarDropdown/DropDown.d.ts +3 -3
  166. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts.map +1 -0
  167. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarDropdown/DropDown.js +12 -12
  168. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.js.map +1 -0
  169. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarDropdown/index.d.ts +6 -6
  170. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts.map +1 -0
  171. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js +42 -0
  172. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js.map +1 -0
  173. package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline}/ToolbarDropdown/index.scss +6 -6
  174. package/dist/field/lexical/plugins/toolbars/inline/types.d.ts +40 -0
  175. package/dist/field/lexical/plugins/toolbars/inline/types.d.ts.map +1 -0
  176. package/dist/field/lexical/plugins/toolbars/inline/types.js +3 -0
  177. package/dist/field/lexical/plugins/toolbars/inline/types.js.map +1 -0
  178. package/dist/field/lexical/theme/EditorTheme.scss +2 -6
  179. package/dist/index.d.ts +12 -11
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.js +11 -11
  182. package/dist/index.js.map +1 -1
  183. package/package.json +9 -9
  184. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
  185. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
  186. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
  187. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
  188. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
  189. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
  190. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
  191. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
  192. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
  193. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
  194. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
  195. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
  196. package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
  197. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
  198. package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
  199. package/dist/field/features/horizontalrule/feature.client.js.map +0 -1
  200. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
  201. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
  202. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
  203. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
  204. package/dist/field/features/indent/index.scss +0 -4
  205. package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
  206. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
  207. package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
  208. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
  209. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
  210. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
  211. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
  212. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
  213. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
  214. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
  215. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
  216. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
  217. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
  218. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
  219. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
  220. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +0 -0
  221. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
  222. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
  223. /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.d.ts +0 -0
  224. /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +0 -0
  225. /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.scss +0 -0
  226. /package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +0 -0
  227. /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
  228. /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
  229. /package/dist/field/features/debug/{treeview → treeView}/plugin/index.d.ts +0 -0
  230. /package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +0 -0
  231. /package/dist/field/features/debug/{treeview → treeView}/plugin/index.scss +0 -0
  232. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +0 -0
  233. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
  234. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
  235. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
  236. /package/dist/field/features/{horizontalrule → horizontalRule}/component/index.d.ts +0 -0
  237. /package/dist/field/features/{horizontalrule → horizontalRule}/component/index.js +0 -0
  238. /package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.d.ts +0 -0
  239. /package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.d.ts +0 -0
  240. /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts +0 -0
  241. /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js +0 -0
  242. /package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts +0 -0
  243. /package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js +0 -0
  244. /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.d.ts +0 -0
  245. /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.js +0 -0
  246. /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.scss +0 -0
  247. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +0 -0
  248. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
  249. /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
  250. /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
  251. /package/dist/field/features/lists/{common → shared}/markdown.js +0 -0
  252. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +0 -0
  253. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
  254. /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
  255. /package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/fixed}/types.js +0 -0
  256. /package/dist/field/lexical/plugins/{FloatingSelectToolbar → toolbars/inline/Toolbar}/index.d.ts +0 -0
@@ -1,6 +1,6 @@
1
1
  export { RichTextCell } from '../cell/index.js';
2
2
  export { RichTextField } from '../field/index.js';
3
3
  export { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js';
4
- export { ToolbarButton } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js';
5
- export { ToolbarDropdown } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js';
4
+ export { ToolbarButton } from '../field/lexical/plugins/toolbars/inline/ToolbarButton/index.js';
5
+ export { ToolbarDropdown } from '../field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js';
6
6
  //# sourceMappingURL=components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/exports/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAA;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,uEAAuE,CAAA;AACrG,OAAO,EAAE,eAAe,EAAE,MAAM,yEAAyE,CAAA"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/exports/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAA;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,iEAAiE,CAAA;AAC/F,OAAO,EAAE,eAAe,EAAE,MAAM,mEAAmE,CAAA"}
@@ -1,7 +1,7 @@
1
1
  export { RichTextCell } from '../cell/index.js';
2
2
  export { RichTextField } from '../field/index.js';
3
3
  export { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js';
4
- export { ToolbarButton } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js';
5
- export { ToolbarDropdown } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js';
4
+ export { ToolbarButton } from '../field/lexical/plugins/toolbars/inline/ToolbarButton/index.js';
5
+ export { ToolbarDropdown } from '../field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js';
6
6
 
7
7
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exports/components.ts"],"sourcesContent":["export { RichTextCell } from '../cell/index.js'\nexport { RichTextField } from '../field/index.js'\n\nexport { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js'\nexport { ToolbarButton } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js'\nexport { ToolbarDropdown } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js'\n"],"names":["RichTextCell","RichTextField","defaultEditorLexicalConfig","ToolbarButton","ToolbarDropdown"],"rangeMappings":";;;;","mappings":"AAAA,SAASA,YAAY,QAAQ,mBAAkB;AAC/C,SAASC,aAAa,QAAQ,oBAAmB;AAEjD,SAASC,0BAA0B,QAAQ,4CAA2C;AACtF,SAASC,aAAa,QAAQ,wEAAuE;AACrG,SAASC,eAAe,QAAQ,0EAAyE"}
1
+ {"version":3,"sources":["../../src/exports/components.ts"],"sourcesContent":["export { RichTextCell } from '../cell/index.js'\nexport { RichTextField } from '../field/index.js'\n\nexport { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js'\nexport { ToolbarButton } from '../field/lexical/plugins/toolbars/inline/ToolbarButton/index.js'\nexport { ToolbarDropdown } from '../field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js'\n"],"names":["RichTextCell","RichTextField","defaultEditorLexicalConfig","ToolbarButton","ToolbarDropdown"],"rangeMappings":";;;;","mappings":"AAAA,SAASA,YAAY,QAAQ,mBAAkB;AAC/C,SAASC,aAAa,QAAQ,oBAAmB;AAEjD,SAASC,0BAA0B,QAAQ,4CAA2C;AACtF,SAASC,aAAa,QAAQ,kEAAiE;AAC/F,SAASC,eAAe,QAAQ,oEAAmE"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/feature.client.tsx"],"names":[],"mappings":";AA0EA,eAAO,MAAM,2BAA2B,+BAA4C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/feature.client.tsx"],"names":[],"mappings":";AAoEA,eAAO,MAAM,2BAA2B,+BAA4C,CAAA"}
@@ -5,57 +5,51 @@ import { AlignJustifyIcon } from '../../lexical/ui/icons/AlignJustify/index.js';
5
5
  import { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js';
6
6
  import { AlignRightIcon } from '../../lexical/ui/icons/AlignRight/index.js';
7
7
  import { createClientComponent } from '../createClientComponent.js';
8
- import { AlignDropdownSectionWithEntries } from './floatingSelectToolbarAlignDropdownSection.js';
8
+ import { alignGroupWithItems } from './inlineToolbarAlignGroup.js';
9
9
  const AlignFeatureClient = (props)=>{
10
10
  return {
11
11
  clientFeatureProps: props,
12
12
  feature: ()=>({
13
13
  clientFeatureProps: props,
14
- floatingSelectToolbar: {
15
- sections: [
16
- AlignDropdownSectionWithEntries([
14
+ toolbarInline: {
15
+ groups: [
16
+ alignGroupWithItems([
17
17
  {
18
18
  ChildComponent: AlignLeftIcon,
19
19
  isActive: ()=>false,
20
- key: 'align-left',
20
+ key: 'alignLeft',
21
21
  label: `Align Left`,
22
- onClick: ({ editor })=>{
22
+ onSelect: ({ editor })=>{
23
23
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left');
24
24
  },
25
25
  order: 1
26
- }
27
- ]),
28
- AlignDropdownSectionWithEntries([
26
+ },
29
27
  {
30
28
  ChildComponent: AlignCenterIcon,
31
29
  isActive: ()=>false,
32
- key: 'align-center',
30
+ key: 'alignCenter',
33
31
  label: `Align Center`,
34
- onClick: ({ editor })=>{
32
+ onSelect: ({ editor })=>{
35
33
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center');
36
34
  },
37
35
  order: 2
38
- }
39
- ]),
40
- AlignDropdownSectionWithEntries([
36
+ },
41
37
  {
42
38
  ChildComponent: AlignRightIcon,
43
39
  isActive: ()=>false,
44
- key: 'align-right',
40
+ key: 'alignRight',
45
41
  label: `Align Right`,
46
- onClick: ({ editor })=>{
42
+ onSelect: ({ editor })=>{
47
43
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right');
48
44
  },
49
45
  order: 3
50
- }
51
- ]),
52
- AlignDropdownSectionWithEntries([
46
+ },
53
47
  {
54
48
  ChildComponent: AlignJustifyIcon,
55
49
  isActive: ()=>false,
56
- key: 'align-justify',
50
+ key: 'alignJustify',
57
51
  label: `Align Justify`,
58
- onClick: ({ editor })=>{
52
+ onSelect: ({ editor })=>{
59
53
  editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify');
60
54
  },
61
55
  order: 4
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/align/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { FORMAT_ELEMENT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { AlignCenterIcon } from '../../lexical/ui/icons/AlignCenter/index.js'\nimport { AlignJustifyIcon } from '../../lexical/ui/icons/AlignJustify/index.js'\nimport { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js'\nimport { AlignRightIcon } from '../../lexical/ui/icons/AlignRight/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { AlignDropdownSectionWithEntries } from './floatingSelectToolbarAlignDropdownSection.js'\n\nconst AlignFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n AlignDropdownSectionWithEntries([\n {\n ChildComponent: AlignLeftIcon,\n isActive: () => false,\n key: 'align-left',\n label: `Align Left`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')\n },\n order: 1,\n },\n ]),\n AlignDropdownSectionWithEntries([\n {\n ChildComponent: AlignCenterIcon,\n isActive: () => false,\n key: 'align-center',\n label: `Align Center`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')\n },\n order: 2,\n },\n ]),\n AlignDropdownSectionWithEntries([\n {\n ChildComponent: AlignRightIcon,\n isActive: () => false,\n key: 'align-right',\n label: `Align Right`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')\n },\n order: 3,\n },\n ]),\n AlignDropdownSectionWithEntries([\n {\n ChildComponent: AlignJustifyIcon,\n isActive: () => false,\n key: 'align-justify',\n label: `Align Justify`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')\n },\n order: 4,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const AlignFeatureClientComponent = createClientComponent(AlignFeatureClient)\n"],"names":["FORMAT_ELEMENT_COMMAND","AlignCenterIcon","AlignJustifyIcon","AlignLeftIcon","AlignRightIcon","createClientComponent","AlignDropdownSectionWithEntries","AlignFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","key","label","onClick","editor","dispatchCommand","order","AlignFeatureClientComponent"],"rangeMappings":";;;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CACtBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,8BAA8BhB,sBAAsBE,oBAAmB"}
1
+ {"version":3,"sources":["../../../../src/field/features/align/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { FORMAT_ELEMENT_COMMAND } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { AlignCenterIcon } from '../../lexical/ui/icons/AlignCenter/index.js'\nimport { AlignJustifyIcon } from '../../lexical/ui/icons/AlignJustify/index.js'\nimport { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js'\nimport { AlignRightIcon } from '../../lexical/ui/icons/AlignRight/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { alignGroupWithItems } from './inlineToolbarAlignGroup.js'\n\nconst AlignFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n toolbarInline: {\n groups: [\n alignGroupWithItems([\n {\n ChildComponent: AlignLeftIcon,\n isActive: () => false,\n key: 'alignLeft',\n label: `Align Left`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')\n },\n order: 1,\n },\n {\n ChildComponent: AlignCenterIcon,\n isActive: () => false,\n key: 'alignCenter',\n label: `Align Center`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')\n },\n order: 2,\n },\n {\n ChildComponent: AlignRightIcon,\n isActive: () => false,\n key: 'alignRight',\n label: `Align Right`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')\n },\n order: 3,\n },\n {\n ChildComponent: AlignJustifyIcon,\n isActive: () => false,\n key: 'alignJustify',\n label: `Align Justify`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')\n },\n order: 4,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const AlignFeatureClientComponent = createClientComponent(AlignFeatureClient)\n"],"names":["FORMAT_ELEMENT_COMMAND","AlignCenterIcon","AlignJustifyIcon","AlignLeftIcon","AlignRightIcon","createClientComponent","alignGroupWithItems","AlignFeatureClient","props","clientFeatureProps","feature","toolbarInline","groups","ChildComponent","isActive","key","label","onSelect","editor","dispatchCommand","order","AlignFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,sBAAsB,QAAQ,UAAS;AAIhD,SAASC,eAAe,QAAQ,8CAA6C;AAC7E,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,aAAa,QAAQ,4CAA2C;AACzE,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mBAAmB,QAAQ,+BAA8B;AAElE,MAAMC,qBAA+D,CAACC;IACpE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,eAAe;oBACbC,QAAQ;wBACNN,oBAAoB;4BAClB;gCACEO,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,UAAU,CAAC;gCACnBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;4BACA;gCACEP,gBAAgBZ;gCAChBa,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,YAAY,CAAC;gCACrBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;4BACA;gCACEP,gBAAgBT;gCAChBU,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,WAAW,CAAC;gCACpBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;4BACA;gCACEP,gBAAgBX;gCAChBY,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,aAAa,CAAC;gCACtBC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,8BAA8BhB,sBAAsBE,oBAAmB"}
@@ -0,0 +1,3 @@
1
+ import type { InlineToolbarGroup, InlineToolbarGroupItem } from '../../lexical/plugins/toolbars/inline/types.js';
2
+ export declare const alignGroupWithItems: (items: InlineToolbarGroupItem[]) => InlineToolbarGroup;
3
+ //# sourceMappingURL=inlineToolbarAlignGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"inlineToolbarAlignGroup.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/inlineToolbarAlignGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,sBAAsB,EACvB,MAAM,gDAAgD,CAAA;AAIvD,eAAO,MAAM,mBAAmB,UAAW,sBAAsB,EAAE,KAAG,kBAQrE,CAAA"}
@@ -1,12 +1,12 @@
1
1
  import { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js';
2
- export const AlignDropdownSectionWithEntries = (entries)=>{
2
+ export const alignGroupWithItems = (items)=>{
3
3
  return {
4
4
  type: 'dropdown',
5
5
  ChildComponent: AlignLeftIcon,
6
- entries,
7
- key: 'dropdown-align',
6
+ items,
7
+ key: 'align',
8
8
  order: 2
9
9
  };
10
10
  };
11
11
 
12
- //# sourceMappingURL=floatingSelectToolbarAlignDropdownSection.js.map
12
+ //# sourceMappingURL=inlineToolbarAlignGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/align/inlineToolbarAlignGroup.ts"],"sourcesContent":["import type {\n InlineToolbarGroup,\n InlineToolbarGroupItem,\n} from '../../lexical/plugins/toolbars/inline/types.js'\n\nimport { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js'\n\nexport const alignGroupWithItems = (items: InlineToolbarGroupItem[]): InlineToolbarGroup => {\n return {\n type: 'dropdown',\n ChildComponent: AlignLeftIcon,\n items,\n key: 'align',\n order: 2,\n }\n}\n"],"names":["AlignLeftIcon","alignGroupWithItems","items","type","ChildComponent","key","order"],"rangeMappings":";;;;;;;;;","mappings":"AAKA,SAASA,aAAa,QAAQ,4CAA2C;AAEzE,OAAO,MAAMC,sBAAsB,CAACC;IAClC,OAAO;QACLC,MAAM;QACNC,gBAAgBJ;QAChBE;QACAG,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/blockquote/feature.client.tsx"],"names":[],"mappings":";AAgEA,eAAO,MAAM,gCAAgC,+BAAiD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/blockquote/feature.client.tsx"],"names":[],"mappings":";AAkEA,eAAO,MAAM,gCAAgC,+BAAiD,CAAA"}
@@ -2,35 +2,15 @@
2
2
  import { $createQuoteNode, QuoteNode } from '@lexical/rich-text';
3
3
  import { $setBlocksType } from '@lexical/selection';
4
4
  import { $getSelection } from 'lexical';
5
- import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
6
5
  import { BlockquoteIcon } from '../../lexical/ui/icons/Blockquote/index.js';
7
- import { TextDropdownSectionWithEntries } from '../common/floatingSelectToolbarTextDropdownSection/index.js';
8
6
  import { createClientComponent } from '../createClientComponent.js';
7
+ import { inlineToolbarTextDropdownGroupWithItems } from '../shared/inlineToolbar/textDropdownGroup.js';
9
8
  import { MarkdownTransformer } from './markdownTransformer.js';
10
9
  const BlockQuoteFeatureClient = (props)=>{
11
10
  return {
12
11
  clientFeatureProps: props,
13
12
  feature: ()=>({
14
13
  clientFeatureProps: props,
15
- floatingSelectToolbar: {
16
- sections: [
17
- TextDropdownSectionWithEntries([
18
- {
19
- ChildComponent: BlockquoteIcon,
20
- isActive: ()=>false,
21
- key: 'blockquote',
22
- label: `Blockquote`,
23
- onClick: ({ editor })=>{
24
- editor.update(()=>{
25
- const selection = $getSelection();
26
- $setBlocksType(selection, ()=>$createQuoteNode());
27
- });
28
- },
29
- order: 20
30
- }
31
- ])
32
- ]
33
- },
34
14
  markdownTransformers: [
35
15
  MarkdownTransformer
36
16
  ],
@@ -38,26 +18,48 @@ const BlockQuoteFeatureClient = (props)=>{
38
18
  QuoteNode
39
19
  ],
40
20
  slashMenu: {
41
- options: [
21
+ groups: [
42
22
  {
43
23
  displayName: 'Basic',
44
- key: 'basic',
45
- options: [
46
- new SlashMenuOption(`blockquote`, {
24
+ items: [
25
+ {
47
26
  Icon: BlockquoteIcon,
48
- displayName: `Blockquote`,
27
+ displayName: 'Blockquote',
28
+ key: 'blockquote',
49
29
  keywords: [
50
30
  'quote',
51
31
  'blockquote'
52
32
  ],
53
- onSelect: ()=>{
54
- const selection = $getSelection();
55
- $setBlocksType(selection, ()=>$createQuoteNode());
33
+ onSelect: ({ editor })=>{
34
+ editor.update(()=>{
35
+ const selection = $getSelection();
36
+ $setBlocksType(selection, ()=>$createQuoteNode());
37
+ });
56
38
  }
57
- })
58
- ]
39
+ }
40
+ ],
41
+ key: 'basic'
59
42
  }
60
43
  ]
44
+ },
45
+ toolbarInline: {
46
+ groups: [
47
+ inlineToolbarTextDropdownGroupWithItems([
48
+ {
49
+ ChildComponent: BlockquoteIcon,
50
+ isActive: ()=>false,
51
+ key: 'blockquote',
52
+ label: `Blockquote`,
53
+ onSelect: ({ editor })=>{
54
+ editor.update(()=>{
55
+ const selection = $getSelection();
56
+ $setBlocksType(selection, ()=>$createQuoteNode());
57
+ });
58
+ },
59
+ order: 20
60
+ }
61
+ ])
62
+ ]
61
63
  }
62
64
  })
63
65
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/blockquote/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $createQuoteNode, QuoteNode } from '@lexical/rich-text'\nimport { $setBlocksType } from '@lexical/selection'\nimport { $getSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { BlockquoteIcon } from '../../lexical/ui/icons/Blockquote/index.js'\nimport { TextDropdownSectionWithEntries } from '../common/floatingSelectToolbarTextDropdownSection/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nconst BlockQuoteFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n TextDropdownSectionWithEntries([\n {\n ChildComponent: BlockquoteIcon,\n isActive: () => false,\n key: 'blockquote',\n label: `Blockquote`,\n onClick: ({ editor }) => {\n editor.update(() => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createQuoteNode())\n })\n },\n order: 20,\n },\n ]),\n ],\n },\n markdownTransformers: [MarkdownTransformer],\n\n nodes: [QuoteNode],\n slashMenu: {\n options: [\n {\n displayName: 'Basic',\n key: 'basic',\n options: [\n new SlashMenuOption(`blockquote`, {\n Icon: BlockquoteIcon,\n displayName: `Blockquote`,\n keywords: ['quote', 'blockquote'],\n onSelect: () => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createQuoteNode())\n },\n }),\n ],\n },\n ],\n },\n }),\n }\n}\n\nexport const BlockQuoteFeatureClientComponent = createClientComponent(BlockQuoteFeatureClient)\n"],"names":["$createQuoteNode","QuoteNode","$setBlocksType","$getSelection","SlashMenuOption","BlockquoteIcon","TextDropdownSectionWithEntries","createClientComponent","MarkdownTransformer","BlockQuoteFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","key","label","onClick","editor","update","selection","order","markdownTransformers","nodes","slashMenu","options","displayName","Icon","keywords","onSelect","BlockQuoteFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,gBAAgB,EAAEC,SAAS,QAAQ,qBAAoB;AAChE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,QAAQ,UAAS;AAIvC,SAASC,eAAe,QAAQ,sEAAqE;AACrG,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAASC,8BAA8B,QAAQ,8DAA6D;AAC5G,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,MAAMC,0BAAoE,CAACC;IACzE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRR,+BAA+B;4BAC7B;gCACES,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,UAAU,CAAC;gCACnBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,MAAM,CAAC;wCACZ,MAAMC,YAAYnB;wCAClBD,eAAeoB,WAAW,IAAMtB;oCAClC;gCACF;gCACAuB,OAAO;4BACT;yBACD;qBACF;gBACH;gBACAC,sBAAsB;oBAAChB;iBAAoB;gBAE3CiB,OAAO;oBAACxB;iBAAU;gBAClByB,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbX,KAAK;4BACLU,SAAS;gCACP,IAAIvB,gBAAgB,CAAC,UAAU,CAAC,EAAE;oCAChCyB,MAAMxB;oCACNuB,aAAa,CAAC,UAAU,CAAC;oCACzBE,UAAU;wCAAC;wCAAS;qCAAa;oCACjCC,UAAU;wCACR,MAAMT,YAAYnB;wCAClBD,eAAeoB,WAAW,IAAMtB;oCAClC;gCACF;6BACD;wBACH;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMgC,mCAAmCzB,sBAAsBE,yBAAwB"}
1
+ {"version":3,"sources":["../../../../src/field/features/blockquote/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $createQuoteNode, QuoteNode } from '@lexical/rich-text'\nimport { $setBlocksType } from '@lexical/selection'\nimport { $getSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { BlockquoteIcon } from '../../lexical/ui/icons/Blockquote/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { inlineToolbarTextDropdownGroupWithItems } from '../shared/inlineToolbar/textDropdownGroup.js'\nimport { MarkdownTransformer } from './markdownTransformer.js'\n\nconst BlockQuoteFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n markdownTransformers: [MarkdownTransformer],\n nodes: [QuoteNode],\n\n slashMenu: {\n groups: [\n {\n displayName: 'Basic',\n items: [\n {\n Icon: BlockquoteIcon,\n displayName: 'Blockquote',\n key: 'blockquote',\n keywords: ['quote', 'blockquote'],\n onSelect: ({ editor }) => {\n editor.update(() => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createQuoteNode())\n })\n },\n },\n ],\n key: 'basic',\n },\n ],\n },\n toolbarInline: {\n groups: [\n inlineToolbarTextDropdownGroupWithItems([\n {\n ChildComponent: BlockquoteIcon,\n isActive: () => false,\n key: 'blockquote',\n label: `Blockquote`,\n onSelect: ({ editor }) => {\n editor.update(() => {\n const selection = $getSelection()\n $setBlocksType(selection, () => $createQuoteNode())\n })\n },\n order: 20,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const BlockQuoteFeatureClientComponent = createClientComponent(BlockQuoteFeatureClient)\n"],"names":["$createQuoteNode","QuoteNode","$setBlocksType","$getSelection","BlockquoteIcon","createClientComponent","inlineToolbarTextDropdownGroupWithItems","MarkdownTransformer","BlockQuoteFeatureClient","props","clientFeatureProps","feature","markdownTransformers","nodes","slashMenu","groups","displayName","items","Icon","key","keywords","onSelect","editor","update","selection","toolbarInline","ChildComponent","isActive","label","order","BlockQuoteFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,gBAAgB,EAAEC,SAAS,QAAQ,qBAAoB;AAChE,SAASC,cAAc,QAAQ,qBAAoB;AACnD,SAASC,aAAa,QAAQ,UAAS;AAIvC,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,uCAAuC,QAAQ,+CAA8C;AACtG,SAASC,mBAAmB,QAAQ,2BAA0B;AAE9D,MAAMC,0BAAoE,CAACC;IACzE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,sBAAsB;oBAACL;iBAAoB;gBAC3CM,OAAO;oBAACZ;iBAAU;gBAElBa,WAAW;oBACTC,QAAQ;wBACN;4BACEC,aAAa;4BACbC,OAAO;gCACL;oCACEC,MAAMd;oCACNY,aAAa;oCACbG,KAAK;oCACLC,UAAU;wCAAC;wCAAS;qCAAa;oCACjCC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,MAAM,CAAC;4CACZ,MAAMC,YAAYrB;4CAClBD,eAAesB,WAAW,IAAMxB;wCAClC;oCACF;gCACF;6BACD;4BACDmB,KAAK;wBACP;qBACD;gBACH;gBACAM,eAAe;oBACbV,QAAQ;wBACNT,wCAAwC;4BACtC;gCACEoB,gBAAgBtB;gCAChBuB,UAAU,IAAM;gCAChBR,KAAK;gCACLS,OAAO,CAAC,UAAU,CAAC;gCACnBP,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnBA,OAAOC,MAAM,CAAC;wCACZ,MAAMC,YAAYrB;wCAClBD,eAAesB,WAAW,IAAMxB;oCAClC;gCACF;gCACA6B,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,mCAAmCzB,sBAAsBG,yBAAwB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/blocks/feature.client.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAa9E,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,YAAY,EAAE,CAAA;CAC9B,CAAA;AAgDD,eAAO,MAAM,4BAA4B,0FAA6C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/blocks/feature.client.tsx"],"names":[],"mappings":";AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAY9E,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,YAAY,EAAE,CAAA;CAC9B,CAAA;AA+CD,eAAO,MAAM,4BAA4B,0FAA6C,CAAA"}
@@ -1,6 +1,5 @@
1
1
  'use client';
2
2
  import { getTranslation } from '@payloadcms/translations';
3
- import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
4
3
  import { BlockIcon } from '../../lexical/ui/icons/Block/index.js';
5
4
  import { createClientComponent } from '../createClientComponent.js';
6
5
  import { BlockNode } from './nodes/BlocksNode.js';
@@ -21,35 +20,34 @@ const BlocksFeatureClient = (props)=>{
21
20
  }
22
21
  ],
23
22
  slashMenu: {
24
- options: [
23
+ groups: [
25
24
  {
26
25
  displayName: 'Blocks',
27
- key: 'blocks',
28
- options: [
29
- ...props.reducedBlocks.map((block)=>{
30
- return new SlashMenuOption('block-' + block.slug, {
31
- Icon: BlockIcon,
32
- displayName: ({ i18n })=>{
33
- if (!block.labels.singular) {
34
- return block.slug;
35
- }
36
- return getTranslation(block.labels.singular, i18n);
37
- },
38
- keywords: [
39
- 'block',
40
- 'blocks',
41
- block.slug
42
- ],
43
- onSelect: ({ editor })=>{
44
- editor.dispatchCommand(INSERT_BLOCK_COMMAND, {
45
- id: null,
46
- blockName: '',
47
- blockType: block.slug
48
- });
26
+ items: props.reducedBlocks.map((block)=>{
27
+ return {
28
+ Icon: BlockIcon,
29
+ displayName: ({ i18n })=>{
30
+ if (!block.labels.singular) {
31
+ return block.slug;
49
32
  }
50
- });
51
- })
52
- ]
33
+ return getTranslation(block.labels.singular, i18n);
34
+ },
35
+ key: 'block-' + block.slug,
36
+ keywords: [
37
+ 'block',
38
+ 'blocks',
39
+ block.slug
40
+ ],
41
+ onSelect: ({ editor })=>{
42
+ editor.dispatchCommand(INSERT_BLOCK_COMMAND, {
43
+ id: null,
44
+ blockName: '',
45
+ blockType: block.slug
46
+ });
47
+ }
48
+ };
49
+ }),
50
+ key: 'blocks'
53
51
  }
54
52
  ]
55
53
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/blocks/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport { BlockIcon } from '../../lexical/ui/icons/Block/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { BlockNode } from './nodes/BlocksNode.js'\nimport { INSERT_BLOCK_COMMAND } from './plugin/commands.js'\nimport { BlocksPlugin } from './plugin/index.js'\n\nexport type BlocksFeatureClientProps = {\n reducedBlocks: ReducedBlock[]\n}\n\nconst BlocksFeatureClient: FeatureProviderProviderClient<BlocksFeatureClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n nodes: [BlockNode],\n plugins: [\n {\n Component: BlocksPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n options: [\n {\n displayName: 'Blocks',\n key: 'blocks',\n options: [\n ...props.reducedBlocks.map((block) => {\n return new SlashMenuOption('block-' + block.slug, {\n Icon: BlockIcon,\n displayName: ({ i18n }) => {\n if (!block.labels.singular) {\n return block.slug\n }\n\n return getTranslation(block.labels.singular, i18n)\n },\n keywords: ['block', 'blocks', block.slug],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n id: null,\n blockName: '',\n blockType: block.slug,\n })\n },\n })\n }),\n ],\n },\n ],\n },\n }),\n }\n}\n\nexport const BlocksFeatureClientComponent = createClientComponent(BlocksFeatureClient)\n"],"names":["getTranslation","SlashMenuOption","BlockIcon","createClientComponent","BlockNode","INSERT_BLOCK_COMMAND","BlocksPlugin","BlocksFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","position","slashMenu","options","displayName","key","reducedBlocks","map","block","slug","Icon","i18n","labels","singular","keywords","onSelect","editor","dispatchCommand","id","blockName","blockType","BlocksFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,cAAc,QAAQ,2BAA0B;AAIzD,SAASC,eAAe,QAAQ,sEAAqE;AACrG,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,oBAAoB,QAAQ,uBAAsB;AAC3D,SAASC,YAAY,QAAQ,oBAAmB;AAMhD,MAAMC,sBAA+E,CAACC;IACpF,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,OAAO;oBAACP;iBAAU;gBAClBQ,SAAS;oBACP;wBACEC,WAAWP;wBACXQ,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,SAAS;wBACP;4BACEC,aAAa;4BACbC,KAAK;4BACLF,SAAS;mCACJR,MAAMW,aAAa,CAACC,GAAG,CAAC,CAACC;oCAC1B,OAAO,IAAIpB,gBAAgB,WAAWoB,MAAMC,IAAI,EAAE;wCAChDC,MAAMrB;wCACNe,aAAa,CAAC,EAAEO,IAAI,EAAE;4CACpB,IAAI,CAACH,MAAMI,MAAM,CAACC,QAAQ,EAAE;gDAC1B,OAAOL,MAAMC,IAAI;4CACnB;4CAEA,OAAOtB,eAAeqB,MAAMI,MAAM,CAACC,QAAQ,EAAEF;wCAC/C;wCACAG,UAAU;4CAAC;4CAAS;4CAAUN,MAAMC,IAAI;yCAAC;wCACzCM,UAAU,CAAC,EAAEC,MAAM,EAAE;4CACnBA,OAAOC,eAAe,CAACzB,sBAAsB;gDAC3C0B,IAAI;gDACJC,WAAW;gDACXC,WAAWZ,MAAMC,IAAI;4CACvB;wCACF;oCACF;gCACF;6BACD;wBACH;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMY,+BAA+B/B,sBAAsBI,qBAAoB"}
1
+ {"version":3,"sources":["../../../../src/field/features/blocks/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { BlockIcon } from '../../lexical/ui/icons/Block/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { BlockNode } from './nodes/BlocksNode.js'\nimport { INSERT_BLOCK_COMMAND } from './plugin/commands.js'\nimport { BlocksPlugin } from './plugin/index.js'\n\nexport type BlocksFeatureClientProps = {\n reducedBlocks: ReducedBlock[]\n}\n\nconst BlocksFeatureClient: FeatureProviderProviderClient<BlocksFeatureClientProps> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n nodes: [BlockNode],\n plugins: [\n {\n Component: BlocksPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n {\n displayName: 'Blocks',\n items: props.reducedBlocks.map((block) => {\n return {\n Icon: BlockIcon,\n displayName: ({ i18n }) => {\n if (!block.labels.singular) {\n return block.slug\n }\n\n return getTranslation(block.labels.singular, i18n)\n },\n key: 'block-' + block.slug,\n keywords: ['block', 'blocks', block.slug],\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n id: null,\n blockName: '',\n blockType: block.slug,\n })\n },\n }\n }),\n key: 'blocks',\n },\n ],\n },\n }),\n }\n}\n\nexport const BlocksFeatureClientComponent = createClientComponent(BlocksFeatureClient)\n"],"names":["getTranslation","BlockIcon","createClientComponent","BlockNode","INSERT_BLOCK_COMMAND","BlocksPlugin","BlocksFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","position","slashMenu","groups","displayName","items","reducedBlocks","map","block","Icon","i18n","labels","singular","slug","key","keywords","onSelect","editor","dispatchCommand","id","blockName","blockType","BlocksFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,cAAc,QAAQ,2BAA0B;AAIzD,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,oBAAoB,QAAQ,uBAAsB;AAC3D,SAASC,YAAY,QAAQ,oBAAmB;AAMhD,MAAMC,sBAA+E,CAACC;IACpF,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,OAAO;oBAACP;iBAAU;gBAClBQ,SAAS;oBACP;wBACEC,WAAWP;wBACXQ,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,QAAQ;wBACN;4BACEC,aAAa;4BACbC,OAAOV,MAAMW,aAAa,CAACC,GAAG,CAAC,CAACC;gCAC9B,OAAO;oCACLC,MAAMpB;oCACNe,aAAa,CAAC,EAAEM,IAAI,EAAE;wCACpB,IAAI,CAACF,MAAMG,MAAM,CAACC,QAAQ,EAAE;4CAC1B,OAAOJ,MAAMK,IAAI;wCACnB;wCAEA,OAAOzB,eAAeoB,MAAMG,MAAM,CAACC,QAAQ,EAAEF;oCAC/C;oCACAI,KAAK,WAAWN,MAAMK,IAAI;oCAC1BE,UAAU;wCAAC;wCAAS;wCAAUP,MAAMK,IAAI;qCAAC;oCACzCG,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnBA,OAAOC,eAAe,CAAC1B,sBAAsB;4CAC3C2B,IAAI;4CACJC,WAAW;4CACXC,WAAWb,MAAMK,IAAI;wCACvB;oCACF;gCACF;4BACF;4BACAC,KAAK;wBACP;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMQ,+BAA+BhC,sBAAsBI,qBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/debug/testrecorder/feature.client.tsx"],"names":[],"mappings":";AAqBA,eAAO,MAAM,kCAAkC,+BAAmD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/debug/testRecorder/feature.client.tsx"],"names":[],"mappings":";AAqBA,eAAO,MAAM,kCAAkC,+BAAmD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/debug/testrecorder/feature.client.tsx"],"sourcesContent":["'use client'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { TestRecorderPlugin } from './plugin/index.js'\n\nconst TestRecorderFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: TestRecorderPlugin,\n position: 'bottom',\n },\n ],\n }),\n }\n}\n\nexport const TestRecorderFeatureClientComponent = createClientComponent(TestRecorderFeatureClient)\n"],"names":["createClientComponent","TestRecorderPlugin","TestRecorderFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","TestRecorderFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,oBAAmB;AAEtD,MAAMC,4BAAsE,CAACC;IAC3E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,qCAAqCT,sBAAsBE,2BAA0B"}
1
+ {"version":3,"sources":["../../../../../src/field/features/debug/testRecorder/feature.client.tsx"],"sourcesContent":["'use client'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { TestRecorderPlugin } from './plugin/index.js'\n\nconst TestRecorderFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: TestRecorderPlugin,\n position: 'bottom',\n },\n ],\n }),\n }\n}\n\nexport const TestRecorderFeatureClientComponent = createClientComponent(TestRecorderFeatureClient)\n"],"names":["createClientComponent","TestRecorderPlugin","TestRecorderFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","TestRecorderFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,kBAAkB,QAAQ,oBAAmB;AAEtD,MAAMC,4BAAsE,CAACC;IAC3E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,qCAAqCT,sBAAsBE,2BAA0B"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/debug/testrecorder/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AAInE,eAAO,MAAM,mBAAmB,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CAWnF,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/debug/testRecorder/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AAInE,eAAO,MAAM,mBAAmB,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CAWnF,CAAA"}
@@ -7,7 +7,7 @@ export const TestRecorderFeature = (props)=>{
7
7
  serverFeatureProps: props
8
8
  };
9
9
  },
10
- key: 'testrecorder',
10
+ key: 'testRecorder',
11
11
  serverFeatureProps: props
12
12
  };
13
13
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/debug/testrecorder/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { TestRecorderFeatureClientComponent } from './feature.client.js'\n\nexport const TestRecorderFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: TestRecorderFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'testrecorder',\n serverFeatureProps: props,\n }\n}\n"],"names":["TestRecorderFeatureClientComponent","TestRecorderFeature","props","feature","ClientComponent","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,kCAAkC,QAAQ,sBAAqB;AAExE,OAAO,MAAMC,sBAA2E,CAACC;IACvF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/debug/testRecorder/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { TestRecorderFeatureClientComponent } from './feature.client.js'\n\nexport const TestRecorderFeature: FeatureProviderProviderServer<undefined, undefined> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: TestRecorderFeatureClientComponent,\n serverFeatureProps: props,\n }\n },\n key: 'testRecorder',\n serverFeatureProps: props,\n }\n}\n"],"names":["TestRecorderFeatureClientComponent","TestRecorderFeature","props","feature","ClientComponent","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;","mappings":"AAEA,SAASA,kCAAkC,QAAQ,sBAAqB;AAExE,OAAO,MAAMC,sBAA2E,CAACC;IACvF,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoBH;YACtB;QACF;QACAI,KAAK;QACLD,oBAAoBH;IACtB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/debug/testrecorder/plugin/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,cAAc,CAAA;AA8ErB,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAEzD;AAmWD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAYtC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/debug/testRecorder/plugin/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAI9B,OAAO,cAAc,CAAA;AA8ErB,wBAAgB,WAAW,CAAC,KAAK,EAAE,aAAa,GAAG,OAAO,CAEzD;AAmWD,eAAO,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAYtC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/debug/testrecorder/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $createParagraphNode, $createTextNode, $getRoot } from 'lexical'\nimport * as React from 'react'\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\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 'press': {\n return ` await page.keyboard.press('${value}');`\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 'type': {\n return ` await page.keyboard.type('${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 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.keyCode === 65 && (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 = []\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 'Enter',\n 'Backspace',\n 'Delete',\n 'Escape',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\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 = window.getSelection()\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 = window.getSelection()\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 = window.getSelection()\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: React.FC = () => {\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","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","keyCode","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","getSelection","contains","map","pushStep","currentSteps","currentIndex","length","lastStep","slice","onKeyDown","key","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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,oBAAoB,EAAEC,eAAe,EAAEC,QAAQ,QAAQ,UAAS;AACzE,YAAYC,WAAW,QAAO;AAC9B,SAASC,WAAW,EAAEC,SAAS,EAAEC,eAAe,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAEjF,SAASC,QAAQ,QAAQ,2CAA0C;AACnE,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,S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AAaQ;KAAiB;IAE5C,MAAM6C,cAAc9H,YAAY;QAC9BM,KAAK4E;IACP,GAAG;QAACA;KAAoB;IAExB,MAAM6C,kBAAkB/H,YAAY;QAClCyB,SAAS,WAAWyD;IACtB,GAAG;QAACA;KAAoB;IAExB,MAAM8C,uBACJ,oBAACA;QACCC,WAAW,CAAC,kBAAkB,EAAExD,cAAc,WAAW,GAAG,CAAC;QAC7DyD,IAAG;QACHC,SAAS,CAACC;YACRd,sBAAsBrC;YACtBmD,EAAEC,cAAc;QAClB;QACAC,OAAO7D,cAAc,0BAA0B;QAC/C8D,MAAK;OAEJ9D,cAAc,0BAA0B;IAG7C,MAAM+D,SAAS/D,4BACb,oBAACgE;QAAIR,WAAU;qBACb,oBAACQ;QAAIR,WAAU;qBACb,oBAACD;QACCC,WAAU;QACVC,IAAG;QACHC,SAAS,CAACC;YACRP;YACAO,EAAEC,cAAc;QAClB;QACAC,OAAM;QACNC,MAAK;OACN,kCAGD,oBAACP;QACCC,WAAU;QACVC,IAAG;QACHC,SAAS,CAACC;YACRN;YACAM,EAAEC,cAAc;QAClB;QACAC,OAAM;QACNC,MAAK;OACN,uBAGD,oBAACP;QACCC,WAAU;QACVC,IAAG;QACHC,SAAS,CAACC;YACRL;YACAK,EAAEC,cAAc;QAClB;QACAC,OAAM;QACNC,MAAK;OACN,4BAIH,oBAACG;QAAIR,IAAG;QAAgBS,KAAK3D;OAC1BJ,kBAGH;IAEJ,OAAO;QAACoD;QAAQQ;KAAO;AACzB;AACA,OAAO,MAAMI,qBAA+B;IAC1C,MAAM,CAACtE,OAAO,GAAG3E;IACjB,MAAM,CAACkJ,oBAAoBC,mBAAmB,GAAGzE,gBAAgBC;IAEjE,qBACE,oBAACvE,MAAMgJ,QAAQ,sBACb,oBAACC,WAAE,OACFH,oBACAC,kCACD,oBAACE,WAAE;AAGT,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/debug/testRecorder/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection, LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $createParagraphNode, $createTextNode, $getRoot } from 'lexical'\nimport * as React from 'react'\nimport { useCallback, useEffect, useLayoutEffect, useRef, useState } from 'react'\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 'press': {\n return ` await page.keyboard.press('${value}');`\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 'type': {\n return ` await page.keyboard.type('${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 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.keyCode === 65 && (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 = []\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 'Enter',\n 'Backspace',\n 'Delete',\n 'Escape',\n 'ArrowLeft',\n 'ArrowRight',\n 'ArrowUp',\n 'ArrowDown',\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 = window.getSelection()\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 = window.getSelection()\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 = window.getSelection()\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: React.FC = () => {\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","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","keyCode","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","getSelection","contains","map","pushStep","currentSteps","currentIndex","length","lastStep","slice","onKeyDown","key","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"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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kB,EAAExD,cAAc,WAAW,GAAG,CAAC;QAC7DyD,IAAG;QACHC,SAAS,CAACC;YACRd,sBAAsBrC;YACtBmD,EAAEC,cAAc;QAClB;QACAC,OAAO7D,cAAc,0BAA0B;QAC/C8D,MAAK;OAEJ9D,cAAc,0BAA0B;IAG7C,MAAM+D,SAAS/D,4BACb,oBAACgE;QAAIR,WAAU;qBACb,oBAACQ;QAAIR,WAAU;qBACb,oBAACD;QACCC,WAAU;QACVC,IAAG;QACHC,SAAS,CAACC;YACRP;YACAO,EAAEC,cAAc;QAClB;QACAC,OAAM;QACNC,MAAK;OACN,kCAGD,oBAACP;QACCC,WAAU;QACVC,IAAG;QACHC,SAAS,CAACC;YACRN;YACAM,EAAEC,cAAc;QAClB;QACAC,OAAM;QACNC,MAAK;OACN,uBAGD,oBAACP;QACCC,WAAU;QACVC,IAAG;QACHC,SAAS,CAACC;YACRL;YACAK,EAAEC,cAAc;QAClB;QACAC,OAAM;QACNC,MAAK;OACN,4BAIH,oBAACG;QAAIR,IAAG;QAAgBS,KAAK3D;OAC1BJ,kBAGH;IAEJ,OAAO;QAACoD;QAAQQ;KAAO;AACzB;AACA,OAAO,MAAMI,qBAA+B;IAC1C,MAAM,CAACtE,OAAO,GAAG3E;IACjB,MAAM,CAACkJ,oBAAoBC,mBAAmB,GAAGzE,gBAAgBC;IAEjE,qBACE,oBAACvE,MAAMgJ,QAAQ,sBACb,oBAACC,WAAE,OACFH,oBACAC,kCACD,oBAACE,WAAE;AAGT,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/debug/treeview/feature.client.tsx"],"names":[],"mappings":";AAqBA,eAAO,MAAM,8BAA8B,+BAA+C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/debug/treeView/feature.client.tsx"],"names":[],"mappings":";AAqBA,eAAO,MAAM,8BAA8B,+BAA+C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/debug/treeview/feature.client.tsx"],"sourcesContent":["'use client'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { TreeViewPlugin } from './plugin/index.js'\n\nconst TreeViewFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: TreeViewPlugin,\n position: 'bottom',\n },\n ],\n }),\n }\n}\n\nexport const TreeViewFeatureClientComponent = createClientComponent(TreeViewFeatureClient)\n"],"names":["createClientComponent","TreeViewPlugin","TreeViewFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","TreeViewFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,cAAc,QAAQ,oBAAmB;AAElD,MAAMC,wBAAkE,CAACC;IACvE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,iCAAiCT,sBAAsBE,uBAAsB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/debug/treeView/feature.client.tsx"],"sourcesContent":["'use client'\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { TreeViewPlugin } from './plugin/index.js'\n\nconst TreeViewFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: TreeViewPlugin,\n position: 'bottom',\n },\n ],\n }),\n }\n}\n\nexport const TreeViewFeatureClientComponent = createClientComponent(TreeViewFeatureClient)\n"],"names":["createClientComponent","TreeViewPlugin","TreeViewFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","TreeViewFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,cAAc,QAAQ,oBAAmB;AAElD,MAAMC,wBAAkE,CAACC;IACvE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,iCAAiCT,sBAAsBE,uBAAsB"}