@payloadcms/richtext-lexical 4.0.0-internal.f05c47f → 4.0.0-internal.f15737c

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 (285) hide show
  1. package/dist/exports/client/Field-MT4FK3IP.js +2 -0
  2. package/dist/exports/client/Field-MT4FK3IP.js.map +7 -0
  3. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  4. package/dist/exports/client/{chunk-LN6VX25I.js.map → chunk-3LRZDIIG.js.map} +2 -2
  5. package/dist/exports/client/chunk-ATPSL6IX.js +2 -0
  6. package/dist/exports/client/chunk-ATPSL6IX.js.map +7 -0
  7. package/dist/exports/client/componentInline-ZEP5JPTC.js +2 -0
  8. package/dist/exports/client/index.js +23 -23
  9. package/dist/exports/client/index.js.map +4 -4
  10. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  11. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  12. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  13. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  14. package/dist/features/blocks/client/component/index.d.ts +0 -6
  15. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  16. package/dist/features/blocks/client/component/index.js +169 -101
  17. package/dist/features/blocks/client/component/index.js.map +1 -1
  18. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  19. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  20. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  21. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  22. package/dist/features/blocks/client/componentInline/index.css +0 -1
  23. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  24. package/dist/features/blocks/client/componentInline/index.js +30 -22
  25. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  26. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  27. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  28. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  29. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  30. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  31. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  32. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  33. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  34. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  35. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  36. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  37. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  38. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  39. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  40. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  41. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  42. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  43. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  44. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  45. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  46. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  47. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  48. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  49. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  50. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  51. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  52. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  53. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -4
  54. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  55. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  56. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  57. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  58. package/dist/features/heading/constants.d.ts +2 -0
  59. package/dist/features/heading/constants.d.ts.map +1 -0
  60. package/dist/features/heading/constants.js +2 -0
  61. package/dist/features/heading/constants.js.map +1 -0
  62. package/dist/features/heading/server/index.d.ts.map +1 -1
  63. package/dist/features/heading/server/index.js +5 -1
  64. package/dist/features/heading/server/index.js.map +1 -1
  65. package/dist/features/heading/server/validate.d.ts +6 -0
  66. package/dist/features/heading/server/validate.d.ts.map +1 -0
  67. package/dist/features/heading/server/validate.js +15 -0
  68. package/dist/features/heading/server/validate.js.map +1 -0
  69. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  70. package/dist/features/indent/client/IndentPlugin.js +122 -1
  71. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  72. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  73. package/dist/features/indent/server/i18n.js +74 -37
  74. package/dist/features/indent/server/i18n.js.map +1 -1
  75. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  76. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  77. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  78. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
  79. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  80. package/dist/features/lists/checklist/server/index.js +5 -2
  81. package/dist/features/lists/checklist/server/index.js.map +1 -1
  82. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  83. package/dist/features/lists/orderedList/server/index.js +5 -2
  84. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  85. package/dist/features/lists/shared/constants.d.ts +2 -0
  86. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  87. package/dist/features/lists/shared/constants.js +2 -0
  88. package/dist/features/lists/shared/constants.js.map +1 -0
  89. package/dist/features/lists/shared/validate.d.ts +5 -0
  90. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  91. package/dist/features/lists/shared/validate.js +15 -0
  92. package/dist/features/lists/shared/validate.js.map +1 -0
  93. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  94. package/dist/features/lists/unorderedList/server/index.js +5 -2
  95. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  96. package/dist/features/relationship/client/components/index.css +3 -6
  97. package/dist/features/relationship/client/index.d.ts +2 -2
  98. package/dist/features/relationship/client/index.d.ts.map +1 -1
  99. package/dist/features/relationship/client/index.js.map +1 -1
  100. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  101. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  102. package/dist/features/relationship/client/plugins/index.js +27 -31
  103. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  104. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  105. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  106. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  107. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  108. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  109. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  110. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  111. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  112. package/dist/features/relationship/server/index.d.ts +8 -1
  113. package/dist/features/relationship/server/index.d.ts.map +1 -1
  114. package/dist/features/relationship/server/index.js +28 -11
  115. package/dist/features/relationship/server/index.js.map +1 -1
  116. package/dist/features/relationship/server/schema.d.ts +2 -2
  117. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  118. package/dist/features/relationship/server/schema.js +5 -10
  119. package/dist/features/relationship/server/schema.js.map +1 -1
  120. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  121. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  122. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  123. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  124. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  125. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  126. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  127. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  128. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.css +0 -1
  129. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  130. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js +17 -44
  131. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  132. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  133. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js +41 -18
  134. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  135. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  136. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  137. package/dist/features/toolbars/inline/client/Toolbar/index.js +2 -2
  138. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  139. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  140. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  141. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  142. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  143. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  144. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  145. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -12
  146. package/dist/features/typesServer.d.ts +13 -8
  147. package/dist/features/typesServer.d.ts.map +1 -1
  148. package/dist/features/typesServer.js.map +1 -1
  149. package/dist/features/upload/client/component/index.css +0 -2
  150. package/dist/features/upload/client/index.d.ts +3 -2
  151. package/dist/features/upload/client/index.d.ts.map +1 -1
  152. package/dist/features/upload/client/index.js.map +1 -1
  153. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  154. package/dist/features/upload/client/plugin/index.js +50 -53
  155. package/dist/features/upload/client/plugin/index.js.map +1 -1
  156. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  157. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  158. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  159. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  160. package/dist/features/upload/server/index.d.ts +6 -2
  161. package/dist/features/upload/server/index.d.ts.map +1 -1
  162. package/dist/features/upload/server/index.js +18 -14
  163. package/dist/features/upload/server/index.js.map +1 -1
  164. package/dist/features/upload/server/schema.d.ts +2 -2
  165. package/dist/features/upload/server/schema.d.ts.map +1 -1
  166. package/dist/features/upload/server/schema.js +4 -8
  167. package/dist/features/upload/server/schema.js.map +1 -1
  168. package/dist/features/upload/server/validate.d.ts +2 -2
  169. package/dist/features/upload/server/validate.d.ts.map +1 -1
  170. package/dist/features/upload/server/validate.js +3 -0
  171. package/dist/features/upload/server/validate.js.map +1 -1
  172. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  173. package/dist/field/Diff/converters/listitem/index.js +2 -1
  174. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  175. package/dist/field/Diff/converters/relationship/index.css +0 -1
  176. package/dist/field/Diff/converters/unknown/index.css +0 -1
  177. package/dist/field/Diff/converters/upload/index.css +0 -1
  178. package/dist/field/Diff/index.css +0 -2
  179. package/dist/field/Diff/index.d.ts +3 -2
  180. package/dist/field/Diff/index.d.ts.map +1 -1
  181. package/dist/field/Diff/index.js +1 -0
  182. package/dist/field/Diff/index.js.map +1 -1
  183. package/dist/field/Field.d.ts.map +1 -1
  184. package/dist/field/Field.js +8 -1
  185. package/dist/field/Field.js.map +1 -1
  186. package/dist/field/RenderLexical/index.d.ts +3 -1
  187. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  188. package/dist/field/RenderLexical/index.js +23 -23
  189. package/dist/field/RenderLexical/index.js.map +1 -1
  190. package/dist/field/ViewSelector.d.ts.map +1 -1
  191. package/dist/field/ViewSelector.js +1 -0
  192. package/dist/field/ViewSelector.js.map +1 -1
  193. package/dist/field/bundled.css +1 -1
  194. package/dist/field/index.css +0 -1
  195. package/dist/index.d.ts +1 -1
  196. package/dist/index.d.ts.map +1 -1
  197. package/dist/index.js +23 -1
  198. package/dist/index.js.map +1 -1
  199. package/dist/lexical/LexicalEditor.css +21 -10
  200. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  201. package/dist/lexical/LexicalEditor.js +61 -64
  202. package/dist/lexical/LexicalEditor.js.map +1 -1
  203. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  204. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  205. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  206. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +2 -1
  207. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +1 -1
  208. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  209. package/dist/lexical/plugins/SlashMenu/index.css +0 -1
  210. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  211. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  212. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  213. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +1 -0
  214. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  215. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  216. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  217. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  218. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  219. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  220. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  221. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  222. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  223. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  224. package/dist/lexical/theme/EditorTheme.css +0 -2
  225. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  226. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  227. package/dist/lexical/ui/ContentEditable.js +21 -7
  228. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  229. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  230. package/dist/lexical/ui/icons/H3/index.js +13 -6
  231. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  232. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  233. package/dist/lexical/ui/icons/H4/index.js +13 -6
  234. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  235. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  236. package/dist/lexical/ui/icons/H5/index.js +13 -6
  237. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  238. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  239. package/dist/lexical/ui/icons/H6/index.js +13 -6
  240. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  241. package/dist/presets/llmInstructions.d.ts +2 -0
  242. package/dist/presets/llmInstructions.d.ts.map +1 -0
  243. package/dist/presets/llmInstructions.js +13 -0
  244. package/dist/presets/llmInstructions.js.map +1 -0
  245. package/dist/types/index.d.ts +2 -2
  246. package/dist/types/index.d.ts.map +1 -1
  247. package/dist/types/index.js.map +1 -1
  248. package/dist/utilities/buildInitialState.d.ts +1 -0
  249. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  250. package/dist/utilities/buildInitialState.js +1 -0
  251. package/dist/utilities/buildInitialState.js.map +1 -1
  252. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  253. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  254. package/dist/validate/hasText.d.ts +2 -2
  255. package/dist/validate/hasText.d.ts.map +1 -1
  256. package/dist/validate/hasText.js.map +1 -1
  257. package/dist/validate/index.d.ts +1 -1
  258. package/dist/validate/index.d.ts.map +1 -1
  259. package/package.json +24 -24
  260. package/dist/dependencyChecker.spec.js +0 -16
  261. package/dist/dependencyChecker.spec.js.map +0 -1
  262. package/dist/exports/client/Field-F22V5L4V.js +0 -2
  263. package/dist/exports/client/Field-F22V5L4V.js.map +0 -7
  264. package/dist/exports/client/bundled.css +0 -1
  265. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  266. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  267. package/dist/exports/client/chunk-LN6VX25I.js +0 -2
  268. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  269. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  270. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  271. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  272. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  273. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  274. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  275. package/dist/features/link/markdownTransformer.spec.js +0 -195
  276. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  277. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.spec.js +0 -65
  278. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.spec.js.map +0 -1
  279. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  280. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  281. package/dist/lexical/utils/url.spec.js +0 -114
  282. package/dist/lexical/utils/url.spec.js.map +0 -1
  283. package/dist/utilities/jsx/jsx.spec.js +0 -178
  284. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  285. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-ZEP5JPTC.js.map} +0 -0
@@ -0,0 +1,11 @@
1
+ import type { LexicalEditor } from 'lexical';
2
+ import type { ReactNode } from 'react';
3
+ import { useBlockReordering } from '../useBlockReordering.js';
4
+ export declare function BlockReordering({ children, editor, nodeKey, }: {
5
+ children: (props: {
6
+ reorderInstructionsID: string;
7
+ } & ReturnType<typeof useBlockReordering>) => ReactNode;
8
+ editor: LexicalEditor;
9
+ nodeKey: string;
10
+ }): ReactNode;
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/blocks/client/component/BlockReordering/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAC5C,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAA;AAE7D,wBAAgB,eAAe,CAAC,EAC9B,QAAQ,EACR,MAAM,EACN,OAAO,GACR,EAAE;IACD,QAAQ,EAAE,CACR,KAAK,EAAE;QAAE,qBAAqB,EAAE,MAAM,CAAA;KAAE,GAAG,UAAU,CAAC,OAAO,kBAAkB,CAAC,KAC7E,SAAS,CAAA;IACd,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,EAAE,MAAM,CAAA;CAChB,aAKA"}
@@ -0,0 +1,18 @@
1
+ import { useId } from 'react';
2
+ import { useBlockReordering } from '../useBlockReordering.js';
3
+ export function BlockReordering({
4
+ children,
5
+ editor,
6
+ nodeKey
7
+ }) {
8
+ const reorder = useBlockReordering({
9
+ editor,
10
+ nodeKey
11
+ });
12
+ const reorderInstructionsID = useId();
13
+ return children({
14
+ ...reorder,
15
+ reorderInstructionsID
16
+ });
17
+ }
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["useId","useBlockReordering","BlockReordering","children","editor","nodeKey","reorder","reorderInstructionsID"],"sources":["../../../../../../src/features/blocks/client/component/BlockReordering/index.tsx"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\nimport type { ReactNode } from 'react'\n\nimport { useId } from 'react'\n\nimport { useBlockReordering } from '../useBlockReordering.js'\n\nexport function BlockReordering({\n children,\n editor,\n nodeKey,\n}: {\n children: (\n props: { reorderInstructionsID: string } & ReturnType<typeof useBlockReordering>,\n ) => ReactNode\n editor: LexicalEditor\n nodeKey: string\n}) {\n const reorder = useBlockReordering({ editor, nodeKey })\n const reorderInstructionsID = useId()\n\n return children({ ...reorder, reorderInstructionsID })\n}\n"],"mappings":"AAGA,SAASA,KAAK,QAAQ;AAEtB,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,SAASC,gBAAgB;EAC9BC,QAAQ;EACRC,MAAM;EACNC;AAAO,CAOR;EACC,MAAMC,OAAA,GAAUL,kBAAA,CAAmB;IAAEG,MAAA;IAAQC;EAAQ;EACrD,MAAME,qBAAA,GAAwBP,KAAA;EAE9B,OAAOG,QAAA,CAAS;IAAE,GAAGG,OAAO;IAAEC;EAAsB;AACtD","ignoreList":[]}
@@ -21,13 +21,7 @@ export type BlockComponentProps<TFormData extends Record<string, unknown> = Bloc
21
21
  * Will be rendered with useBlockComponentContext hook.
22
22
  */
23
23
  readonly CustomLabel?: React.FC<ViewMapBlockComponentProps>;
24
- /**
25
- * The block's form data (field values).
26
- */
27
24
  readonly formData: TFormData;
28
- /**
29
- * The unique key identifying this block node in the current editor instance.
30
- */
31
25
  readonly nodeKey: string;
32
26
  };
33
27
  export declare const BlockComponent: React.FC<BlockComponentProps>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAGtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,aAAa,CAAA;AACpB,OAAO,8CAA8C,CAAA;AAerD,MAAM,MAAM,mBAAmB,CAAC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,IAAI;IACzF;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAA;IAC3D;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAA;IAC3D;;OAEG;IACH,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B;;OAEG;IACH,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA0uBxD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/index.tsx"],"names":[],"mappings":"AAqCA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAGtE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,4BAA4B,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAA;AAEzD,OAAO,aAAa,CAAA;AACpB,OAAO,8CAA8C,CAAA;AAmBrD,MAAM,MAAM,mBAAmB,CAAC,SAAS,SAAS,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,WAAW,IAAI;IACzF;;;;OAIG;IACH,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAA;IAC5B,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAA;IAC1B;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAA;IAC3D;;;OAGG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC,0BAA0B,CAAC,CAAA;IAC3D,QAAQ,CAAC,QAAQ,EAAE,SAAS,CAAA;IAC5B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CAmzBxD,CAAA"}
@@ -1,13 +1,13 @@
1
1
  'use client';
2
2
 
3
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
4
4
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
5
5
  import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
6
6
  import { getTranslation } from '@payloadcms/translations';
7
7
  import { Button, Collapsible, Drawer, EditDepthProvider, ErrorPill, Form, formatDrawerSlug, MoreIcon, Pill, Popup, PopupList, RenderFields, SectionTitle, useConfig, useDocumentForm, useDocumentInfo, useEditDepth, useFormSubmitted, useServerFunctions, useTranslation, XIcon } from '@payloadcms/ui';
8
8
  import { abortAndIgnore } from '@payloadcms/ui/shared';
9
9
  import { $getNodeByKey, $getRoot, SKIP_DOM_SELECTION_TAG } from 'lexical';
10
- import { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared';
10
+ import { deepCopyObjectSimpleWithoutReactComponents } from 'payload/shared';
11
11
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
12
12
  import { v4 as uuid } from 'uuid';
13
13
  import './index.css';
@@ -15,9 +15,10 @@ import '../../../../utilities/fieldsDrawer/index.css';
15
15
  import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
16
16
  import { RegisterFormSubmit, useDrawerSubmit } from '../../../../utilities/fieldsDrawer/useDrawerSubmit.js';
17
17
  import { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js';
18
+ import { getCachedFormStateIfDataMatches, reduceFormStateToBlockData } from '../getCachedFormStateIfDataMatches.js';
18
19
  import { $isBlockNode } from '../nodes/BlocksNode.js';
19
20
  import { BlockContent, useBlockComponentContext } from './BlockContent.js';
20
- import { removeEmptyArrayValues } from './removeEmptyArrayValues.js';
21
+ import { BlockReordering } from './BlockReordering/index.js';
21
22
  export const BlockComponent = props => {
22
23
  const {
23
24
  cacheBuster,
@@ -68,31 +69,43 @@ export const BlockComponent = props => {
68
69
  const [editor] = useLexicalComposerContext();
69
70
  const isEditable = useLexicalEditable();
70
71
  const blockType = formData.blockType;
72
+ const formDataRef = useRef(formData);
73
+ formDataRef.current = formData;
74
+ const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}`;
75
+ const clientSchemaMap = featureClientSchemaMap['blocks'];
76
+ const blocksField = clientSchemaMap?.[componentMapRenderedBlockPath]?.[0];
77
+ const blockOrSlug = blocksField?.blocks?.[0];
78
+ const clientBlock = typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug;
71
79
  const {
72
80
  getFormState
73
81
  } = useServerFunctions();
74
82
  const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}.fields`;
75
83
  const [initialState, setInitialState] = React.useState(() => {
76
84
  // Initial form state that was calculated server-side. May have stale values
77
- const cachedFormState = initialLexicalFormState?.[formData.id]?.formState;
85
+ const cachedState = initialLexicalFormState?.[formData.id];
86
+ const cachedFormState = cachedState?.formState;
78
87
  if (!cachedFormState) {
79
88
  return false;
80
89
  }
81
- // Merge current formData values into the cached form state
82
- // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits
83
- const mergedState = Object.fromEntries(Object.entries(cachedFormState).map(([fieldName, fieldState]) => [fieldName, fieldName in formData ? {
84
- ...fieldState,
85
- initialValue: formData[fieldName],
86
- value: formData[fieldName]
87
- } : fieldState]));
90
+ const matchingCachedState = getCachedFormStateIfDataMatches({
91
+ cachedFormState,
92
+ cachedSchemaPath: cachedState.schemaPath,
93
+ currentSchemaPath: schemaFieldsPath,
94
+ formData
95
+ });
96
+ if (!matchingCachedState) {
97
+ return false;
98
+ }
88
99
  // Manually add blockName, as it's not part of cachedFormState
89
- mergedState.blockName = {
90
- initialValue: formData.blockName,
91
- passesCondition: true,
92
- valid: true,
93
- value: formData.blockName
100
+ return {
101
+ ...matchingCachedState,
102
+ blockName: {
103
+ initialValue: formData.blockName,
104
+ passesCondition: true,
105
+ valid: true,
106
+ value: formData.blockName
107
+ }
94
108
  };
95
- return mergedState;
96
109
  });
97
110
  const hasMounted = useRef(false);
98
111
  const prevCacheBuster = useRef(cacheBuster);
@@ -191,9 +204,9 @@ export const BlockComponent = props => {
191
204
  valid: true,
192
205
  value: formData.blockName
193
206
  };
194
- const newFormStateData = reduceFieldsToValues(deepCopyObjectSimpleWithoutReactComponents(state, {
207
+ const newFormStateData = reduceFormStateToBlockData(deepCopyObjectSimpleWithoutReactComponents(state, {
195
208
  excludeFiles: true
196
- }), true);
209
+ }));
197
210
  // Things like default values may come back from the server => update the node with the new data
198
211
  editor.update(() => {
199
212
  const node = $getNodeByKey(nodeKey);
@@ -217,19 +230,14 @@ export const BlockComponent = props => {
217
230
  }
218
231
  }
219
232
  };
220
- if (formData && !initialState) {
233
+ if (clientBlock && formData && !initialState) {
221
234
  void awaitInitialState();
222
235
  }
223
236
  return () => {
224
237
  abortAndIgnore(abortController);
225
238
  };
226
- }, [getFormState, schemaFieldsPath, isEditable, id, CustomLabelFromProps, CustomBlockFromProps, formData, editor, nodeKey, initialState, collectionSlug, globalSlug, getDocPreferences, parentDocumentFields, blockType]);
239
+ }, [getFormState, schemaFieldsPath, isEditable, id, CustomLabelFromProps, CustomBlockFromProps, formData, editor, nodeKey, initialState, collectionSlug, globalSlug, getDocPreferences, parentDocumentFields, blockType, clientBlock]);
227
240
  const [isCollapsed, setIsCollapsed] = React.useState(initialLexicalFormState?.[formData.id]?.collapsed ?? false);
228
- const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks.${blockType}`;
229
- const clientSchemaMap = featureClientSchemaMap['blocks'];
230
- const blocksField = clientSchemaMap?.[componentMapRenderedBlockPath]?.[0];
231
- const blockOrSlug = blocksField?.blocks?.[0];
232
- const clientBlock = typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug;
233
241
  const {
234
242
  i18n,
235
243
  t
@@ -241,11 +249,15 @@ export const BlockComponent = props => {
241
249
  abortAndIgnore(onChangeAbortControllerRef.current);
242
250
  const controller = new AbortController();
243
251
  onChangeAbortControllerRef.current = controller;
252
+ const blockData = reduceFormStateToBlockData(deepCopyObjectSimpleWithoutReactComponents(prevFormState, {
253
+ excludeFiles: true
254
+ }), formDataRef.current);
244
255
  const {
245
256
  state: newFormState
246
257
  } = await getFormState({
247
258
  id,
248
259
  collectionSlug,
260
+ data: blockData,
249
261
  docPermissions: {
250
262
  fields: true
251
263
  },
@@ -255,7 +267,7 @@ export const BlockComponent = props => {
255
267
  }),
256
268
  formState: prevFormState,
257
269
  globalSlug,
258
- initialBlockFormState: prevFormState,
270
+ initialBlockData: blockData,
259
271
  operation: 'update',
260
272
  readOnly: !isEditable,
261
273
  renderAllFields: submit ? true : false,
@@ -268,11 +280,9 @@ export const BlockComponent = props => {
268
280
  if (prevFormState.blockName) {
269
281
  newFormState.blockName = prevFormState.blockName;
270
282
  }
271
- const newFormStateData_0 = reduceFieldsToValues(removeEmptyArrayValues({
272
- fields: deepCopyObjectSimpleWithoutReactComponents(newFormState, {
273
- excludeFiles: true
274
- })
275
- }), true);
283
+ const newFormStateData_0 = reduceFormStateToBlockData(deepCopyObjectSimpleWithoutReactComponents(newFormState, {
284
+ excludeFiles: true
285
+ }), blockData);
276
286
  setTimeout(() => {
277
287
  editor.update(() => {
278
288
  const node_0 = $getNodeByKey(nodeKey);
@@ -394,7 +404,7 @@ export const BlockComponent = props => {
394
404
  round: true,
395
405
  tooltip: "Remove Block"
396
406
  }), [baseClass, isEditable, removeBlock]);
397
- const BlockCollapsible = useMemo(() => ({
407
+ const BlockCollapsible = useMemo(() => function BlockCollapsible({
398
408
  Actions,
399
409
  children: children_0,
400
410
  className,
@@ -408,77 +418,134 @@ export const BlockComponent = props => {
408
418
  removeButton,
409
419
  showDragHandle = true,
410
420
  showRowNumber = true
411
- }) => {
412
- return /*#__PURE__*/_jsx("div", {
413
- className: `${baseClass}__container ${baseClass}-${blockType}`,
414
- children: /*#__PURE__*/_jsx(Collapsible, {
415
- actions: typeof Actions !== 'undefined' ? Actions : isEditable ? /*#__PURE__*/_jsx(Popup, {
416
- button: /*#__PURE__*/_jsx(MoreIcon, {}),
417
- buttonClassName: `${baseClass}__actions-button`,
418
- caret: false,
419
- horizontalAlign: "right",
420
- render: ({
421
- close
422
- }) => /*#__PURE__*/_jsxs(PopupList.ButtonGroup, {
423
- buttonSize: "medium",
424
- children: [(resolvedCustomBlock && editButton !== false || !resolvedCustomBlock && editButton) && /*#__PURE__*/_jsx(PopupList.Button, {
425
- onClick: () => {
426
- toggleDrawer();
427
- close();
428
- },
429
- children: t('general:edit')
430
- }), removeButton !== false && /*#__PURE__*/_jsxs(PopupList.Button, {
431
- onClick: () => {
432
- removeBlock();
433
- close();
434
- },
435
- children: [/*#__PURE__*/_jsx(XIcon, {}), t('general:remove')]
436
- })]
421
+ }) {
422
+ return /*#__PURE__*/_jsx(BlockReordering, {
423
+ editor: editor,
424
+ nodeKey: nodeKey,
425
+ children: ({
426
+ isReordering,
427
+ move,
428
+ onBlur,
429
+ onKeyDown,
430
+ reorderInstructionsID,
431
+ targetIndex
432
+ }) => /*#__PURE__*/_jsx("div", {
433
+ className: `${baseClass}__container ${baseClass}-${blockType}`,
434
+ onKeyDownCapture: event => {
435
+ const target = event.target;
436
+ if (event.altKey || event.ctrlKey || event.metaKey || target.closest('.collapsible')?.parentElement !== event.currentTarget) {
437
+ return;
438
+ }
439
+ // Handle controls before Lexical consumes keys using its retained text selection.
440
+ if (target.matches('.collapsible__drag') && (event.key !== 'Escape' || isReordering) && [' ', 'ArrowDown', 'ArrowUp', 'Enter', 'Escape', 'Tab'].includes(event.key)) {
441
+ onKeyDown(event);
442
+ event.stopPropagation();
443
+ } else if (event.key === 'Tab' && target.matches('.collapsible__toggle')) {
444
+ event.stopPropagation();
445
+ }
446
+ },
447
+ children: /*#__PURE__*/_jsxs(Collapsible, {
448
+ actions: typeof Actions !== 'undefined' ? Actions : isEditable ? /*#__PURE__*/_jsx(Popup, {
449
+ button: /*#__PURE__*/_jsx(MoreIcon, {}),
450
+ buttonAriaLabel: t('general:moreOptions'),
451
+ buttonClassName: `${baseClass}__actions-button`,
452
+ caret: false,
453
+ horizontalAlign: "right",
454
+ popupType: "menu",
455
+ render: ({
456
+ close
457
+ }) => /*#__PURE__*/_jsxs(PopupList.ButtonGroup, {
458
+ buttonSize: "medium",
459
+ children: [/*#__PURE__*/_jsx(PopupList.Button, {
460
+ onClick: () => {
461
+ close();
462
+ move({
463
+ direction: -1
464
+ });
465
+ },
466
+ children: t('general:moveUp')
467
+ }), /*#__PURE__*/_jsx(PopupList.Button, {
468
+ onClick: () => {
469
+ close();
470
+ move({
471
+ direction: 1
472
+ });
473
+ },
474
+ children: t('general:moveDown')
475
+ }), (resolvedCustomBlock && editButton !== false || !resolvedCustomBlock && editButton) && /*#__PURE__*/_jsx(PopupList.Button, {
476
+ onClick: () => {
477
+ toggleDrawer();
478
+ close();
479
+ },
480
+ children: t('general:edit')
481
+ }), removeButton !== false && /*#__PURE__*/_jsxs(PopupList.Button, {
482
+ onClick: () => {
483
+ removeBlock();
484
+ close();
485
+ },
486
+ children: [/*#__PURE__*/_jsx(XIcon, {}), t('general:remove')]
487
+ })]
488
+ }),
489
+ size: "large"
490
+ }) : null,
491
+ className: [`${baseClass}__row`, fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`, className].filter(Boolean).join(' '),
492
+ collapsibleStyle: fieldHasErrors ? 'error' : 'default',
493
+ dragHandleProps: showDragHandle && isEditable ? {
494
+ id: nodeKey,
495
+ attributes: {
496
+ 'aria-describedby': reorderInstructionsID,
497
+ 'aria-pressed': isReordering,
498
+ role: 'button',
499
+ tabIndex: 0
500
+ },
501
+ listeners: {
502
+ onBlur
503
+ }
504
+ } : undefined,
505
+ header: /*#__PURE__*/_jsx("div", {
506
+ className: `${baseClass}__block-header`,
507
+ children: typeof Label !== 'undefined' ? Label : typeof resolvedCustomLabel !== 'undefined' ? resolvedCustomLabel : /*#__PURE__*/_jsxs("div", {
508
+ className: `${baseClass}__block-label`,
509
+ children: [showRowNumber && /*#__PURE__*/_jsx("span", {
510
+ className: `${baseClass}__block-number`,
511
+ children: String(rowIndex + 1).padStart(2, '0')
512
+ }), typeof CustomPill !== 'undefined' ? CustomPill : /*#__PURE__*/_jsx(Pill, {
513
+ className: `${baseClass}__block-pill ${baseClass}__block-pill-${blockType}`,
514
+ pillStyle: "white",
515
+ size: "small",
516
+ children: blockDisplayName ?? blockType
517
+ }), !disableBlockName && !clientBlock?.admin?.disableBlockName && /*#__PURE__*/_jsx(SectionTitle, {
518
+ path: "blockName",
519
+ readOnly: !isEditable
520
+ }), fieldHasErrors && /*#__PURE__*/_jsx(ErrorPill, {
521
+ count: errorCount_0 ?? 0,
522
+ i18n: i18n,
523
+ withMessage: true
524
+ })]
525
+ })
437
526
  }),
438
- size: "large"
439
- }) : null,
440
- className: [`${baseClass}__row`, fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`, className].filter(Boolean).join(' '),
441
- collapsibleStyle: fieldHasErrors ? 'error' : 'default',
442
- dragHandleProps: showDragHandle ? {
443
- id: nodeKey,
444
- attributes: {
445
- role: 'button',
446
- tabIndex: 0
527
+ isCollapsed: isCollapsed,
528
+ onToggle: incomingCollapsedState => {
529
+ onCollapsedChange(incomingCollapsedState);
530
+ setIsCollapsed(incomingCollapsedState);
447
531
  },
448
- listeners: {}
449
- } : undefined,
450
- header: /*#__PURE__*/_jsx("div", {
451
- className: `${baseClass}__block-header`,
452
- children: typeof Label !== 'undefined' ? Label : typeof resolvedCustomLabel !== 'undefined' ? resolvedCustomLabel : /*#__PURE__*/_jsxs("div", {
453
- className: `${baseClass}__block-label`,
454
- children: [showRowNumber && /*#__PURE__*/_jsx("span", {
455
- className: `${baseClass}__block-number`,
456
- children: String(rowIndex + 1).padStart(2, '0')
457
- }), typeof CustomPill !== 'undefined' ? CustomPill : /*#__PURE__*/_jsx(Pill, {
458
- className: `${baseClass}__block-pill ${baseClass}__block-pill-${blockType}`,
459
- pillStyle: "white",
460
- size: "small",
461
- children: blockDisplayName ?? blockType
462
- }), !disableBlockName && !clientBlock?.admin?.disableBlockName && /*#__PURE__*/_jsx(SectionTitle, {
463
- path: "blockName",
464
- readOnly: !isEditable
465
- }), fieldHasErrors && /*#__PURE__*/_jsx(ErrorPill, {
466
- count: errorCount_0 ?? 0,
467
- i18n: i18n,
468
- withMessage: true
532
+ ...(collapsibleProps || {}),
533
+ AfterCollapsible: /*#__PURE__*/_jsxs(_Fragment, {
534
+ children: [collapsibleProps?.AfterCollapsible, /*#__PURE__*/_jsx("span", {
535
+ className: "sr-only",
536
+ role: "status",
537
+ children: isReordering ? `${t('general:order')}: ${(targetIndex ?? 0) + 1}` : ''
469
538
  })]
470
- })
471
- }),
472
- isCollapsed: isCollapsed,
473
- onToggle: incomingCollapsedState => {
474
- onCollapsedChange(incomingCollapsedState);
475
- setIsCollapsed(incomingCollapsedState);
476
- },
477
- ...(collapsibleProps || {}),
478
- children: children_0
479
- }, 0)
539
+ }),
540
+ children: [/*#__PURE__*/_jsxs("span", {
541
+ className: "sr-only",
542
+ id: reorderInstructionsID,
543
+ children: ["Space / Enter · ", t('general:moveUp'), " ↑ · ", t('general:moveDown'), " ↓ ·", ' ', t('general:cancel'), " Escape"]
544
+ }), children_0]
545
+ }, 0)
546
+ })
480
547
  });
481
- }, [resolvedCustomBlock, resolvedCustomLabel, blockDisplayName, baseClass, clientBlock?.admin?.disableBlockName, blockType, i18n, isCollapsed, onCollapsedChange, isEditable, nodeKey, removeBlock, rowIndex, t, toggleDrawer]);
548
+ }, [editor, resolvedCustomBlock, resolvedCustomLabel, blockDisplayName, baseClass, clientBlock?.admin?.disableBlockName, blockType, i18n, isCollapsed, onCollapsedChange, isEditable, nodeKey, removeBlock, rowIndex, t, toggleDrawer]);
482
549
  const blockID = formData?.id;
483
550
  const {
484
551
  headerActions,
@@ -532,8 +599,9 @@ export const BlockComponent = props => {
532
599
  fields: clientBlock?.fields ?? [],
533
600
  initialState: initialState,
534
601
  onChange: [onChange],
535
- onSubmit: (formState_0, newData_1) => {
602
+ onSubmit: formState_0 => {
536
603
  // This is only called when form is submitted from drawer - usually only the case if the block has a custom Block component
604
+ const newData_1 = reduceFormStateToBlockData(formState_0, formDataRef.current);
537
605
  newData_1.blockType = blockType;
538
606
  editor.update(() => {
539
607
  const node_1 = $getNodeByKey(nodeKey);