@payloadcms/richtext-lexical 4.0.0-internal.bc5cf8c → 4.0.0-internal.bf4bcce

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 (793) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/exports/client/Field-W2ABOM7M.js +2 -0
  3. package/dist/exports/client/Field-W2ABOM7M.js.map +7 -0
  4. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  5. package/dist/exports/client/chunk-3LRZDIIG.js.map +7 -0
  6. package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
  7. package/dist/exports/client/chunk-E6LSRRP2.js.map +7 -0
  8. package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
  9. package/dist/exports/client/chunk-ZQX5HXUL.js.map +7 -0
  10. package/dist/exports/client/component-6DQLENIE.js +2 -0
  11. package/dist/exports/client/component-6DQLENIE.js.map +7 -0
  12. package/dist/exports/client/componentInline-HNE5G4TE.js +2 -0
  13. package/dist/exports/client/index.d.ts +1 -3
  14. package/dist/exports/client/index.d.ts.map +1 -1
  15. package/dist/exports/client/index.js +28 -29
  16. package/dist/exports/client/index.js.map +4 -4
  17. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  18. package/dist/features/blockquote/client/index.js +2 -2
  19. package/dist/features/blockquote/client/index.js.map +1 -1
  20. package/dist/features/blockquote/server/index.js +2 -2
  21. package/dist/features/blockquote/server/index.js.map +1 -1
  22. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  23. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  24. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  25. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  26. package/dist/features/blocks/client/component/index.css +2 -2
  27. package/dist/features/blocks/client/component/index.d.ts +0 -6
  28. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  29. package/dist/features/blocks/client/component/index.js +169 -101
  30. package/dist/features/blocks/client/component/index.js.map +1 -1
  31. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  32. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  33. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  34. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  35. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  36. package/dist/features/blocks/client/componentInline/index.css +8 -9
  37. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  38. package/dist/features/blocks/client/componentInline/index.js +30 -22
  39. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  40. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  41. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  42. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  43. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  44. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  45. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  46. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  47. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  48. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  49. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  50. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  51. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
  52. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  53. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  54. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  55. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  56. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  57. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  58. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  59. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  60. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
  61. package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
  62. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  63. package/dist/features/blocks/server/index.js +2 -2
  64. package/dist/features/blocks/server/index.js.map +1 -1
  65. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  66. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  67. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  68. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  69. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  70. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  71. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  72. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  73. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  74. package/dist/features/blocks/server/schema.d.ts +2 -0
  75. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  76. package/dist/features/blocks/server/schema.js +10 -11
  77. package/dist/features/blocks/server/schema.js.map +1 -1
  78. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  79. package/dist/features/blocks/server/validate.js +1 -1
  80. package/dist/features/blocks/server/validate.js.map +1 -1
  81. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  82. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  83. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  84. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  85. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  86. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  87. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  88. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  89. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  90. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  91. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  92. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  93. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  94. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  95. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  96. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  97. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  98. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  99. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  100. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  101. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  102. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  103. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  104. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  105. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  106. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  107. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  108. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  109. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  110. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  111. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  112. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  113. package/dist/features/converters/markdownToLexical/index.js +5 -2
  114. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  115. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  116. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  117. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  118. package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
  119. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  120. package/dist/features/format/bold/feature.client.js +1 -1
  121. package/dist/features/format/bold/feature.client.js.map +1 -1
  122. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  123. package/dist/features/format/bold/feature.server.js +1 -1
  124. package/dist/features/format/bold/feature.server.js.map +1 -1
  125. package/dist/features/format/inlineCode/feature.client.js +1 -1
  126. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  127. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  128. package/dist/features/format/inlineCode/feature.server.js +1 -1
  129. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  130. package/dist/features/format/italic/feature.client.js +1 -1
  131. package/dist/features/format/italic/feature.client.js.map +1 -1
  132. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  133. package/dist/features/format/italic/feature.server.js +1 -1
  134. package/dist/features/format/italic/feature.server.js.map +1 -1
  135. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  136. package/dist/features/format/strikethrough/feature.client.js +1 -1
  137. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  138. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  139. package/dist/features/format/strikethrough/feature.server.js +1 -1
  140. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  141. package/dist/features/heading/client/index.js +2 -2
  142. package/dist/features/heading/client/index.js.map +1 -1
  143. package/dist/features/heading/constants.d.ts +2 -0
  144. package/dist/features/heading/constants.d.ts.map +1 -0
  145. package/dist/features/heading/constants.js +2 -0
  146. package/dist/features/heading/constants.js.map +1 -0
  147. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  148. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  149. package/dist/features/heading/markdownTransformer.js +6 -19
  150. package/dist/features/heading/markdownTransformer.js.map +1 -1
  151. package/dist/features/heading/server/index.d.ts.map +1 -1
  152. package/dist/features/heading/server/index.js +7 -3
  153. package/dist/features/heading/server/index.js.map +1 -1
  154. package/dist/features/heading/server/schema.d.ts.map +1 -1
  155. package/dist/features/heading/server/validate.d.ts +6 -0
  156. package/dist/features/heading/server/validate.d.ts.map +1 -0
  157. package/dist/features/heading/server/validate.js +15 -0
  158. package/dist/features/heading/server/validate.js.map +1 -0
  159. package/dist/features/horizontalRule/client/index.js +2 -2
  160. package/dist/features/horizontalRule/client/index.js.map +1 -1
  161. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  162. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  163. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  164. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  165. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  166. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  167. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  168. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  169. package/dist/features/horizontalRule/client/plugin/index.css +2 -2
  170. package/dist/features/horizontalRule/server/index.js +2 -2
  171. package/dist/features/horizontalRule/server/index.js.map +1 -1
  172. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  173. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  174. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  175. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  176. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  177. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  178. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  179. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  180. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  181. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  182. package/dist/features/horizontalRule/server/schema.js +6 -5
  183. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  184. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  185. package/dist/features/indent/client/IndentPlugin.js +122 -1
  186. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  187. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  188. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  189. package/dist/features/indent/server/i18n.js +74 -37
  190. package/dist/features/indent/server/i18n.js.map +1 -1
  191. package/dist/features/link/client/index.js +2 -2
  192. package/dist/features/link/client/index.js.map +1 -1
  193. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  194. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  195. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  196. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  197. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -13
  198. package/dist/features/link/markdownTransformer.d.ts +4 -4
  199. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  200. package/dist/features/link/markdownTransformer.js +2 -2
  201. package/dist/features/link/markdownTransformer.js.map +1 -1
  202. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  203. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  204. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  205. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  206. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  207. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  208. package/dist/features/link/nodes/LinkNode.js +2 -15
  209. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  210. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  211. package/dist/features/link/server/baseFields.js.map +1 -1
  212. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  213. package/dist/features/link/server/index.js +4 -4
  214. package/dist/features/link/server/index.js.map +1 -1
  215. package/dist/features/link/server/schema.d.ts.map +1 -1
  216. package/dist/features/link/server/schema.js +4 -2
  217. package/dist/features/link/server/schema.js.map +1 -1
  218. package/dist/features/link/server/validate.d.ts.map +1 -1
  219. package/dist/features/link/server/validate.js +1 -1
  220. package/dist/features/link/server/validate.js.map +1 -1
  221. package/dist/features/lists/checklist/client/index.js +1 -1
  222. package/dist/features/lists/checklist/client/index.js.map +1 -1
  223. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  224. package/dist/features/lists/checklist/server/index.js +6 -3
  225. package/dist/features/lists/checklist/server/index.js.map +1 -1
  226. package/dist/features/lists/orderedList/client/index.js +1 -1
  227. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  228. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  229. package/dist/features/lists/orderedList/server/index.js +6 -3
  230. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  231. package/dist/features/lists/shared/constants.d.ts +2 -0
  232. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  233. package/dist/features/lists/shared/constants.js +2 -0
  234. package/dist/features/lists/shared/constants.js.map +1 -0
  235. package/dist/features/lists/shared/validate.d.ts +5 -0
  236. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  237. package/dist/features/lists/shared/validate.js +15 -0
  238. package/dist/features/lists/shared/validate.js.map +1 -0
  239. package/dist/features/lists/unorderedList/client/index.js +1 -1
  240. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  241. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  242. package/dist/features/lists/unorderedList/server/index.js +6 -3
  243. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  244. package/dist/features/relationship/client/components/index.css +3 -6
  245. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  246. package/dist/features/relationship/client/index.d.ts +2 -2
  247. package/dist/features/relationship/client/index.d.ts.map +1 -1
  248. package/dist/features/relationship/client/index.js.map +1 -1
  249. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  250. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  251. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  252. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  253. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  254. package/dist/features/relationship/client/plugins/index.js +27 -31
  255. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  256. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  257. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  258. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  259. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  260. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  261. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  262. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  263. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  264. package/dist/features/relationship/server/index.d.ts +8 -1
  265. package/dist/features/relationship/server/index.d.ts.map +1 -1
  266. package/dist/features/relationship/server/index.js +28 -11
  267. package/dist/features/relationship/server/index.js.map +1 -1
  268. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  269. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  270. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  271. package/dist/features/relationship/server/schema.d.ts +6 -5
  272. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  273. package/dist/features/relationship/server/schema.js +31 -17
  274. package/dist/features/relationship/server/schema.js.map +1 -1
  275. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  276. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  277. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  278. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  279. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  280. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  281. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  282. package/dist/features/table/client/index.d.ts.map +1 -0
  283. package/dist/features/{experimental_table → table}/client/index.js +2 -2
  284. package/dist/features/table/client/index.js.map +1 -0
  285. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  286. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  287. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  288. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  289. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -1
  290. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  291. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  292. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  293. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  294. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  295. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  296. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  297. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  298. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  299. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  300. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  301. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  302. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  303. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  304. package/dist/features/table/client/utils/debounce.js.map +1 -0
  305. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  306. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  307. package/dist/features/table/markdownTransformer.d.ts +5 -0
  308. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  309. package/dist/features/{experimental_table → table}/markdownTransformer.js +6 -3
  310. package/dist/features/table/markdownTransformer.js.map +1 -0
  311. package/dist/features/table/server/index.d.ts +3 -0
  312. package/dist/features/table/server/index.d.ts.map +1 -0
  313. package/dist/features/{experimental_table → table}/server/index.js +6 -6
  314. package/dist/features/table/server/index.js.map +1 -0
  315. package/dist/features/table/server/schema.d.ts.map +1 -0
  316. package/dist/features/table/server/schema.js.map +1 -0
  317. package/dist/features/textState/feature.client.js +1 -1
  318. package/dist/features/textState/feature.client.js.map +1 -1
  319. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  320. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  321. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  322. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  323. package/dist/features/toolbars/fixed/client/Toolbar/index.css +80 -8
  324. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  325. package/dist/features/toolbars/fixed/client/Toolbar/index.js +19 -1
  326. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  327. package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -14
  328. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  329. package/dist/features/toolbars/inline/client/Toolbar/index.js +17 -2
  330. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  331. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  332. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  333. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  334. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  335. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  336. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  337. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +23 -25
  338. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  339. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  340. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  341. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
  342. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  343. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  344. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  345. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  346. package/dist/features/typesClient.d.ts +1 -1
  347. package/dist/features/typesClient.d.ts.map +1 -1
  348. package/dist/features/typesClient.js.map +1 -1
  349. package/dist/features/typesServer.d.ts +19 -14
  350. package/dist/features/typesServer.d.ts.map +1 -1
  351. package/dist/features/typesServer.js.map +1 -1
  352. package/dist/features/upload/client/component/index.css +9 -11
  353. package/dist/features/upload/client/component/index.js +2 -1
  354. package/dist/features/upload/client/component/index.js.map +1 -1
  355. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  356. package/dist/features/upload/client/index.d.ts +3 -2
  357. package/dist/features/upload/client/index.d.ts.map +1 -1
  358. package/dist/features/upload/client/index.js.map +1 -1
  359. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  360. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  361. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  362. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  363. package/dist/features/upload/client/plugin/index.js +50 -53
  364. package/dist/features/upload/client/plugin/index.js.map +1 -1
  365. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  366. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  367. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  368. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  369. package/dist/features/upload/server/index.d.ts +7 -3
  370. package/dist/features/upload/server/index.d.ts.map +1 -1
  371. package/dist/features/upload/server/index.js +22 -18
  372. package/dist/features/upload/server/index.js.map +1 -1
  373. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  374. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  375. package/dist/features/upload/server/markdownTransformer.js +1 -1
  376. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  377. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  378. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  379. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  380. package/dist/features/upload/server/schema.d.ts +6 -18
  381. package/dist/features/upload/server/schema.d.ts.map +1 -1
  382. package/dist/features/upload/server/schema.js +34 -16
  383. package/dist/features/upload/server/schema.js.map +1 -1
  384. package/dist/features/upload/server/validate.d.ts +2 -2
  385. package/dist/features/upload/server/validate.d.ts.map +1 -1
  386. package/dist/features/upload/server/validate.js +4 -1
  387. package/dist/features/upload/server/validate.js.map +1 -1
  388. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  389. package/dist/field/Diff/converters/listitem/index.js +2 -1
  390. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  391. package/dist/field/Diff/converters/relationship/index.css +0 -1
  392. package/dist/field/Diff/converters/unknown/index.css +1 -2
  393. package/dist/field/Diff/converters/upload/index.css +0 -1
  394. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  395. package/dist/field/Diff/index.css +0 -2
  396. package/dist/field/Diff/index.d.ts +3 -2
  397. package/dist/field/Diff/index.d.ts.map +1 -1
  398. package/dist/field/Diff/index.js +3 -2
  399. package/dist/field/Diff/index.js.map +1 -1
  400. package/dist/field/Field.d.ts.map +1 -1
  401. package/dist/field/Field.js +26 -16
  402. package/dist/field/Field.js.map +1 -1
  403. package/dist/field/RenderLexical/index.d.ts +3 -1
  404. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  405. package/dist/field/RenderLexical/index.js +23 -23
  406. package/dist/field/RenderLexical/index.js.map +1 -1
  407. package/dist/field/ViewSelector.css +1 -1
  408. package/dist/field/ViewSelector.d.ts.map +1 -1
  409. package/dist/field/ViewSelector.js +1 -0
  410. package/dist/field/ViewSelector.js.map +1 -1
  411. package/dist/field/bundled.css +1 -1
  412. package/dist/field/index.css +4 -5
  413. package/dist/field/rscEntry.d.ts +2 -2
  414. package/dist/field/rscEntry.d.ts.map +1 -1
  415. package/dist/field/rscEntry.js.map +1 -1
  416. package/dist/i18n.d.ts.map +1 -1
  417. package/dist/i18n.js +68 -0
  418. package/dist/i18n.js.map +1 -1
  419. package/dist/index.d.ts +6 -6
  420. package/dist/index.d.ts.map +1 -1
  421. package/dist/index.js +33 -54
  422. package/dist/index.js.map +1 -1
  423. package/dist/lexical/LexicalEditor.css +30 -19
  424. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  425. package/dist/lexical/LexicalEditor.js +62 -99
  426. package/dist/lexical/LexicalEditor.js.map +1 -1
  427. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  428. package/dist/lexical/LexicalProvider.js +7 -22
  429. package/dist/lexical/LexicalProvider.js.map +1 -1
  430. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  431. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  432. package/dist/lexical/config/server/loader.d.ts +1 -1
  433. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  434. package/dist/lexical/config/server/loader.js +2 -2
  435. package/dist/lexical/config/server/loader.js.map +1 -1
  436. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  437. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  438. package/dist/lexical/config/server/sanitize.js +2 -2
  439. package/dist/lexical/config/server/sanitize.js.map +1 -1
  440. package/dist/lexical/plugins/DecoratorPlugin/index.css +1 -1
  441. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  442. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  443. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  444. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  445. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  446. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  447. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  448. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  449. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  450. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  451. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  452. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  453. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  454. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  455. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  456. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  457. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  458. package/dist/lexical/plugins/SlashMenu/index.css +1 -7
  459. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +2 -1
  460. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  461. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  462. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  463. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +5 -3
  464. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  465. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +17 -3
  466. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  467. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  468. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  469. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  470. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  471. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  472. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  473. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  474. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  475. package/dist/lexical/theme/EditorTheme.css +18 -21
  476. package/dist/lexical/ui/ContentEditable.css +22 -17
  477. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  478. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  479. package/dist/lexical/ui/ContentEditable.js +32 -11
  480. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  481. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  482. package/dist/lexical/ui/icons/H3/index.js +13 -6
  483. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  484. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  485. package/dist/lexical/ui/icons/H4/index.js +13 -6
  486. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  487. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  488. package/dist/lexical/ui/icons/H5/index.js +13 -6
  489. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  490. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  491. package/dist/lexical/ui/icons/H6/index.js +13 -6
  492. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  493. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  494. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  495. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  496. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  497. package/dist/lexical/utils/markdown/createBlockNode.d.ts +2 -2
  498. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  499. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  500. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  501. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  502. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  503. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  504. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  505. package/dist/lexical/utils/point.d.ts.map +1 -1
  506. package/dist/lexical/utils/rect.d.ts.map +1 -1
  507. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  508. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  509. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  510. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  511. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  512. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  513. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  514. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  515. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  516. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  517. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  518. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  519. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  520. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  521. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  522. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  523. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  524. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  525. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  526. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  527. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  528. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  529. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  530. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  531. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  532. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  533. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  534. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  535. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  536. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  537. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  538. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  539. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  540. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  541. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  542. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  543. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  544. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  545. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  546. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  547. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  548. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  549. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  550. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  551. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  552. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  553. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  554. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  555. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  556. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  557. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  558. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  559. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  560. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  561. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  562. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  563. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  564. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  565. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  566. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  567. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  568. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  569. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  570. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  571. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  572. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  573. package/dist/presets/llmInstructions.d.ts +2 -0
  574. package/dist/presets/llmInstructions.d.ts.map +1 -0
  575. package/dist/presets/llmInstructions.js +13 -0
  576. package/dist/presets/llmInstructions.js.map +1 -0
  577. package/dist/types/builtInNodes.d.ts +1 -1
  578. package/dist/types/builtInNodes.d.ts.map +1 -1
  579. package/dist/types/builtInNodes.js +8 -3
  580. package/dist/types/builtInNodes.js.map +1 -1
  581. package/dist/types/index.d.ts +4 -7
  582. package/dist/types/index.d.ts.map +1 -1
  583. package/dist/types/index.js.map +1 -1
  584. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  585. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  586. package/dist/types/jsonSchemaHelpers.js +7 -2
  587. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  588. package/dist/types/nodeTypes.d.ts +6 -1
  589. package/dist/types/nodeTypes.d.ts.map +1 -1
  590. package/dist/types/nodeTypes.js.map +1 -1
  591. package/dist/types/schema.d.ts.map +1 -1
  592. package/dist/types/schema.js +12 -5
  593. package/dist/types/schema.js.map +1 -1
  594. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  595. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  596. package/dist/utilities/buildInitialState.d.ts +3 -2
  597. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  598. package/dist/utilities/buildInitialState.js +1 -0
  599. package/dist/utilities/buildInitialState.js.map +1 -1
  600. package/dist/utilities/createServerFeature.d.ts +1 -1
  601. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  602. package/dist/utilities/createServerFeature.js +2 -2
  603. package/dist/utilities/createServerFeature.js.map +1 -1
  604. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  605. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  606. package/dist/utilities/editorConfigFactory.js +9 -9
  607. package/dist/utilities/editorConfigFactory.js.map +1 -1
  608. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  609. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  610. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  611. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  612. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  613. package/dist/utilities/generateImportMap.d.ts +3 -3
  614. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  615. package/dist/utilities/generateImportMap.js +3 -7
  616. package/dist/utilities/generateImportMap.js.map +1 -1
  617. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  618. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  619. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  620. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  621. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  622. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  623. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  624. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  625. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  626. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  627. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  628. package/dist/validate/hasText.d.ts +2 -2
  629. package/dist/validate/hasText.d.ts.map +1 -1
  630. package/dist/validate/hasText.js.map +1 -1
  631. package/dist/validate/index.d.ts +1 -1
  632. package/dist/validate/index.d.ts.map +1 -1
  633. package/package.json +98 -30
  634. package/dist/@types/assets.d.js +0 -2
  635. package/dist/@types/assets.d.js.map +0 -1
  636. package/dist/dependencyChecker.spec.js +0 -16
  637. package/dist/dependencyChecker.spec.js.map +0 -1
  638. package/dist/exports/client/Field-JXXWHUE4.js +0 -2
  639. package/dist/exports/client/Field-JXXWHUE4.js.map +0 -7
  640. package/dist/exports/client/bundled.css +0 -1
  641. package/dist/exports/client/chunk-4EIYXZ6H.js +0 -12
  642. package/dist/exports/client/chunk-4EIYXZ6H.js.map +0 -7
  643. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  644. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  645. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  646. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  647. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  648. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  649. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  650. package/dist/exports/server/rsc.browser.d.ts +0 -11
  651. package/dist/exports/server/rsc.browser.d.ts.map +0 -1
  652. package/dist/exports/server/rsc.browser.js +0 -10
  653. package/dist/exports/server/rsc.browser.js.map +0 -1
  654. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  655. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  656. package/dist/features/blockquote/markdownTransformer.js +0 -33
  657. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  658. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  659. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  660. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  661. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  662. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  663. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  664. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  665. package/dist/features/experimental_table/client/index.js.map +0 -1
  666. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  667. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  668. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  669. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  670. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  671. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  672. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  673. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  674. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  675. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  676. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  677. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  678. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  679. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  680. package/dist/features/experimental_table/markdownTransformer.d.ts +0 -5
  681. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  682. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  683. package/dist/features/experimental_table/server/index.d.ts +0 -3
  684. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  685. package/dist/features/experimental_table/server/index.js.map +0 -1
  686. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  687. package/dist/features/experimental_table/server/schema.js.map +0 -1
  688. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  689. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  690. package/dist/features/format/bold/markdownTransformers.js +0 -23
  691. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  692. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  693. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  694. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  695. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  696. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  697. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  698. package/dist/features/format/italic/markdownTransformers.js +0 -12
  699. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  700. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  701. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  702. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  703. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  704. package/dist/features/link/markdownTransformer.spec.js +0 -195
  705. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  706. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  707. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  708. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  709. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  710. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  711. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  712. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  713. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  714. package/dist/features/lists/shared/markdown.d.ts +0 -6
  715. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  716. package/dist/features/lists/shared/markdown.js +0 -57
  717. package/dist/features/lists/shared/markdown.js.map +0 -1
  718. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  719. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  720. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  721. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  722. package/dist/field/clientEntry.d.ts +0 -29
  723. package/dist/field/clientEntry.d.ts.map +0 -1
  724. package/dist/field/clientEntry.js +0 -86
  725. package/dist/field/clientEntry.js.map +0 -1
  726. package/dist/lexical/utils/guard.d.ts +0 -5
  727. package/dist/lexical/utils/guard.d.ts.map +0 -1
  728. package/dist/lexical/utils/guard.js +0 -9
  729. package/dist/lexical/utils/guard.js.map +0 -1
  730. package/dist/lexical/utils/url.spec.js +0 -114
  731. package/dist/lexical/utils/url.spec.js.map +0 -1
  732. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  733. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  734. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  735. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  736. package/dist/packages/@lexical/markdown/LexicalMarkdownHardLineBreak.spec.js +0 -160
  737. package/dist/packages/@lexical/markdown/LexicalMarkdownHardLineBreak.spec.js.map +0 -1
  738. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  739. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  740. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -220
  741. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  742. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  743. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  744. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -199
  745. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  746. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  747. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  748. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  749. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  750. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -173
  751. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  752. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -352
  753. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  754. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  755. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  756. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  757. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  758. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  759. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  760. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  761. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  762. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  763. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  764. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  765. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  766. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  767. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  768. package/dist/packages/@lexical/markdown/index.js +0 -39
  769. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  770. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  771. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  772. package/dist/packages/@lexical/markdown/utils.js +0 -267
  773. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
  774. package/dist/utilities/jsx/jsx.spec.js +0 -178
  775. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  776. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
  777. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  778. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  779. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  780. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  781. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  782. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  783. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  784. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  785. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  786. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  787. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  788. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  789. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  790. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  791. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  792. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  793. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -9,12 +9,13 @@ import { abortAndIgnore } from '@payloadcms/ui/shared';
9
9
  import { $getNodeByKey, SKIP_DOM_SELECTION_TAG } from 'lexical';
10
10
  import './index.css';
11
11
  import '../../../../utilities/fieldsDrawer/index.css';
12
- import { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared';
12
+ import { deepCopyObjectSimpleWithoutReactComponents } from 'payload/shared';
13
13
  import React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react';
14
14
  import { v4 as uuid } from 'uuid';
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 { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js';
19
20
  const InlineBlockComponentContext = /*#__PURE__*/createContext({
20
21
  initialState: false
@@ -53,19 +54,23 @@ export const InlineBlockComponent = props => {
53
54
  } = useServerFunctions();
54
55
  const editDepth = useEditDepth();
55
56
  const firstTimeDrawer = useRef(false);
57
+ const blockType = formData.blockType;
58
+ const formDataRef = useRef(formData);
59
+ formDataRef.current = formData;
60
+ const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${blockType}.fields`;
56
61
  const [initialState, setInitialState] = React.useState(() => {
57
62
  // Initial form state that was calculated server-side. May have stale values
58
- const cachedFormState = initialLexicalFormState?.[formData.id]?.formState;
63
+ const cachedState = initialLexicalFormState?.[formData.id];
64
+ const cachedFormState = cachedState?.formState;
59
65
  if (!cachedFormState) {
60
66
  return false;
61
67
  }
62
- // Merge current formData values into the cached form state
63
- // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits
64
- return Object.fromEntries(Object.entries(cachedFormState).map(([fieldName, fieldState]) => [fieldName, fieldName in formData ? {
65
- ...fieldState,
66
- initialValue: formData[fieldName],
67
- value: formData[fieldName]
68
- } : fieldState]));
68
+ return getCachedFormStateIfDataMatches({
69
+ cachedFormState,
70
+ cachedSchemaPath: cachedState.schemaPath,
71
+ currentSchemaPath: schemaFieldsPath,
72
+ formData
73
+ });
69
74
  });
70
75
  const hasMounted = useRef(false);
71
76
  const prevCacheBuster = useRef(cacheBuster);
@@ -141,7 +146,7 @@ export const InlineBlockComponent = props => {
141
146
  const {
142
147
  config
143
148
  } = useConfig();
144
- const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`;
149
+ const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${blockType}`;
145
150
  const clientSchemaMap = featureClientSchemaMap['blocks'];
146
151
  const blocksField = clientSchemaMap?.[componentMapRenderedBlockPath]?.[0];
147
152
  const blockOrSlug = blocksField?.blocks?.[0];
@@ -165,7 +170,6 @@ export const InlineBlockComponent = props => {
165
170
  }, [editor, nodeKey]);
166
171
  const blockDisplayName = clientBlock?.labels?.singular ? getTranslation(clientBlock?.labels.singular, i18n) : clientBlock?.slug;
167
172
  const onChangeAbortControllerRef = useRef(new AbortController());
168
- const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${clientBlock?.slug}.fields`;
169
173
  // Initial state for newly created blocks
170
174
  useEffect(() => {
171
175
  const abortController = new AbortController();
@@ -190,7 +194,6 @@ export const InlineBlockComponent = props => {
190
194
  }),
191
195
  globalSlug,
192
196
  initialBlockData: formData,
193
- initialBlockFormState: formData,
194
197
  operation: 'update',
195
198
  readOnly: !isEditable,
196
199
  renderAllFields: true,
@@ -198,9 +201,9 @@ export const InlineBlockComponent = props => {
198
201
  signal: abortController.signal
199
202
  });
200
203
  if (state) {
201
- const newFormStateData = reduceFieldsToValues(deepCopyObjectSimpleWithoutReactComponents(state, {
204
+ const newFormStateData = reduceFormStateToBlockData(deepCopyObjectSimpleWithoutReactComponents(state, {
202
205
  excludeFiles: true
203
- }), true);
206
+ }));
204
207
  // Things like default values may come back from the server => update the node with the new data
205
208
  editor.update(() => {
206
209
  const node = $getNodeByKey(nodeKey);
@@ -224,13 +227,13 @@ export const InlineBlockComponent = props => {
224
227
  }
225
228
  }
226
229
  };
227
- if (formData && !initialState) {
230
+ if (clientBlock && formData && !initialState) {
228
231
  void awaitInitialState();
229
232
  }
230
233
  return () => {
231
234
  abortAndIgnore(abortController);
232
235
  };
233
- }, [getFormState, editor, nodeKey, isEditable, CustomLabelFromProps, CustomBlockFromProps, schemaFieldsPath, id, formData, initialState, collectionSlug, globalSlug, getDocPreferences, parentDocumentFields]);
236
+ }, [getFormState, editor, nodeKey, isEditable, CustomLabelFromProps, CustomBlockFromProps, schemaFieldsPath, id, formData, initialState, collectionSlug, globalSlug, getDocPreferences, parentDocumentFields, clientBlock]);
234
237
  /**
235
238
  * HANDLE ONCHANGE
236
239
  */
@@ -241,11 +244,15 @@ export const InlineBlockComponent = props => {
241
244
  abortAndIgnore(onChangeAbortControllerRef.current);
242
245
  const controller = new AbortController();
243
246
  onChangeAbortControllerRef.current = controller;
247
+ const blockData = reduceFormStateToBlockData(deepCopyObjectSimpleWithoutReactComponents(prevFormState, {
248
+ excludeFiles: true
249
+ }), formDataRef.current);
244
250
  const {
245
251
  state: state_0
246
252
  } = await getFormState({
247
253
  id,
248
254
  collectionSlug,
255
+ data: blockData,
249
256
  docPermissions: {
250
257
  fields: true
251
258
  },
@@ -255,7 +262,7 @@ export const InlineBlockComponent = props => {
255
262
  }),
256
263
  formState: prevFormState,
257
264
  globalSlug,
258
- initialBlockFormState: prevFormState,
265
+ initialBlockData: blockData,
259
266
  operation: 'update',
260
267
  readOnly: !isEditable,
261
268
  renderAllFields: submit ? true : false,
@@ -293,8 +300,9 @@ export const InlineBlockComponent = props => {
293
300
  /**
294
301
  * HANDLE FORM SUBMIT
295
302
  */
296
- const onFormSubmit = useCallback((formState, newData_0) => {
297
- newData_0.blockType = formData.blockType;
303
+ const onFormSubmit = useCallback(formState => {
304
+ const newData_0 = reduceFormStateToBlockData(formState, formDataRef.current);
305
+ newData_0.blockType = blockType;
298
306
  editor.update(() => {
299
307
  const node_0 = $getNodeByKey(nodeKey);
300
308
  if (node_0 && $isInlineBlockNode(node_0)) {
@@ -306,7 +314,7 @@ export const InlineBlockComponent = props => {
306
314
  {
307
315
  tag: SKIP_DOM_SELECTION_TAG
308
316
  });
309
- }, [editor, nodeKey, formData]);
317
+ }, [blockType, editor, nodeKey]);
310
318
  const {
311
319
  headerActions,
312
320
  submitRef
@@ -396,8 +404,8 @@ export const InlineBlockComponent = props => {
396
404
  fields: clientBlock?.fields,
397
405
  initialState: initialState || {},
398
406
  onChange: [onChange],
399
- onSubmit: (formState_1, data) => {
400
- onFormSubmit(formState_1, data);
407
+ onSubmit: formState_1 => {
408
+ onFormSubmit(formState_1);
401
409
  toggleDrawer();
402
410
  },
403
411
  uuid: formUuid,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","Drawer","EditDepthProvider","Form","formatDrawerSlug","RenderFields","ShimmerEffect","useConfig","useDocumentForm","useDocumentInfo","useEditDepth","useServerFunctions","useTranslation","abortAndIgnore","$getNodeByKey","SKIP_DOM_SELECTION_TAG","deepCopyObjectSimpleWithoutReactComponents","reduceFieldsToValues","React","createContext","useCallback","useEffect","useMemo","useRef","v4","uuid","useEditorConfigContext","RegisterFormSubmit","useDrawerSubmit","useLexicalDrawer","$isInlineBlockNode","InlineBlockComponentContext","initialState","useInlineBlockComponentContext","use","InlineBlockComponent","props","cacheBuster","className","baseClass","CustomBlock","CustomBlockFromProps","CustomLabel","CustomLabelFromProps","formData","nodeKey","editor","isEditable","i18n","t","createdInlineBlock","fieldProps","featureClientSchemaMap","initialLexicalFormState","schemaPath","setCreatedInlineBlock","uuidFromContext","fields","parentDocumentFields","getFormState","editDepth","firstTimeDrawer","setInitialState","useState","cachedFormState","id","formState","Object","fromEntries","entries","map","fieldName","fieldState","initialValue","value","hasMounted","prevCacheBuster","current","formUuid","setCustomLabel","undefined","customComponents","BlockLabel","setCustomBlock","Block","resolvedCustomBlock","_jsx","isEditor","isJSXConverter","resolvedCustomLabel","drawerSlug","slug","depth","toggleDrawer","inlineBlockElemElemRef","collectionSlug","getDocPreferences","globalSlug","config","componentMapRenderedBlockPath","blockType","clientSchemaMap","blocksField","blockOrSlug","blocks","clientBlock","blocksMap","clientBlockFields","getKey","length","removeInlineBlock","update","remove","blockDisplayName","labels","singular","onChangeAbortControllerRef","AbortController","schemaFieldsPath","abortController","awaitInitialState","state","data","docPermissions","docPreferences","documentFormState","excludeFiles","initialBlockData","initialBlockFormState","operation","readOnly","renderAllFields","signal","newFormStateData","node","newData","setFields","tag","onChange","prevFormState","submit","controller","isStateOutOfSync","keys","some","key","onFormSubmit","headerActions","submitRef","RemoveButton","buttonStyle","disabled","icon","onClick","e","preventDefault","stopPropagation","round","size","tooltip","label","EditButton","el","InlineBlockContainer","children","filter","Boolean","join","onKeyDown","role","tabIndex","ref","Label","_jsxs","beforeSubmit","disableValidationOnSubmit","onSubmit","title","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","height","width"],"sources":["../../../../../src/features/blocks/client/componentInline/index.tsx"],"sourcesContent":["'use client'\n\nimport type { BlocksFieldClient, ClientBlock, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Drawer,\n EditDepthProvider,\n Form,\n formatDrawerSlug,\n RenderFields,\n ShimmerEffect,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey, SKIP_DOM_SELECTION_TAG } from 'lexical'\n\nimport './index.css'\nimport '../../../../utilities/fieldsDrawer/index.css'\n\nimport { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared'\nimport React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types/index.js'\nimport type { InlineBlockFields } from '../../server/schema.js'\nimport type { BlockComponentProps } from '../component/index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport {\n RegisterFormSubmit,\n useDrawerSubmit,\n} from '../../../../utilities/fieldsDrawer/useDrawerSubmit.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\nexport type InlineBlockComponentProps<\n TFormData extends Record<string, unknown> = InlineBlockFields,\n> = {\n readonly CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>\n readonly CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>\n} & Pick<BlockComponentProps<TFormData>, 'cacheBuster' | 'className' | 'formData' | 'nodeKey'>\n\nexport type InlineBlockComponentContextType = {\n EditButton?: React.FC\n initialState: false | FormState | undefined\n InlineBlockContainer?: React.FC<{ children: React.ReactNode }>\n Label?: React.FC\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst InlineBlockComponentContext = createContext<InlineBlockComponentContextType>({\n initialState: false,\n})\n\nexport const useInlineBlockComponentContext = () => React.use(InlineBlockComponentContext)\n\nexport const InlineBlockComponent: React.FC<InlineBlockComponentProps<InlineBlockFields>> = (\n props,\n) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: { featureClientSchemaMap, initialLexicalFormState, schemaPath },\n setCreatedInlineBlock,\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n const { fields: parentDocumentFields } = useDocumentForm()\n\n const { getFormState } = useServerFunctions()\n const editDepth = useEditDepth()\n const firstTimeDrawer = useRef(false)\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedFormState = initialLexicalFormState?.[formData.id]?.formState\n if (!cachedFormState) {\n return false\n }\n\n // Merge current formData values into the cached form state\n // This ensures that when the component remounts (e.g., due to view changes), we don't lose user edits\n return Object.fromEntries(\n Object.entries(cachedFormState).map(([fieldName, fieldState]) => [\n fieldName,\n fieldName in formData\n ? {\n ...fieldState,\n initialValue: formData[fieldName],\n value: formData[fieldName],\n }\n : fieldState,\n ]),\n )\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist, we render them directly with formData instead.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-inlineBlocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug, true)\n\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { config } = useConfig()\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient | undefined = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient | undefined\n\n const blockOrSlug = blocksField?.blocks?.[0]\n const clientBlock: ClientBlock | undefined =\n typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug\n\n const clientBlockFields = clientBlock?.fields ?? []\n\n // Open drawer on \"mount\"\n useEffect(() => {\n if (!firstTimeDrawer.current && createdInlineBlock?.getKey() === nodeKey) {\n // > 2 because they always have \"id\" and \"blockName\" fields\n if (clientBlockFields.length > 2) {\n toggleDrawer()\n }\n setCreatedInlineBlock?.(undefined)\n firstTimeDrawer.current = true\n }\n }, [clientBlockFields.length, createdInlineBlock, nodeKey, setCreatedInlineBlock, toggleDrawer])\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock?.slug\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${clientBlock?.slug}.fields`\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n initialBlockFormState: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n const newFormStateData: InlineBlockFields = reduceFieldsToValues(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n true,\n ) as InlineBlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = formData.blockType\n\n node.setFields(newData, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n }\n\n if (formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n editor,\n nodeKey,\n isEditable,\n CustomLabelFromProps,\n CustomBlockFromProps,\n schemaFieldsPath,\n id,\n formData,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n ])\n\n /**\n * HANDLE ONCHANGE\n */\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockFormState: prevFormState,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n isEditable,\n schemaFieldsPath,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n // cleanup effect\n useEffect(() => {\n const isStateOutOfSync = (formData: InlineBlockFields, initialState: FormState) => {\n return Object.keys(initialState).some(\n (key) => initialState[key] && formData[key] !== initialState[key].value,\n )\n }\n\n return () => {\n // If the component is unmounted (either via removeInlineBlock or via lexical itself) and the form state got changed before,\n // we need to reset the initial state to force a re-fetch of the initial state when it gets mounted again (e.g. via lexical history undo).\n // Otherwise it would use an outdated initial state.\n if (initialState && isStateOutOfSync(formData, initialState)) {\n setInitialState(false)\n }\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [formData, initialState])\n\n /**\n * HANDLE FORM SUBMIT\n */\n const onFormSubmit = useCallback(\n (formState: FormState, newData: Data) => {\n newData.blockType = formData.blockType\n\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n node.setFields(newData as InlineBlockFields, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n },\n [editor, nodeKey, formData],\n )\n\n const { headerActions, submitRef } = useDrawerSubmit()\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n removeInlineBlock()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[`${baseClass}__container`, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n {...(isEditable\n ? {\n onClick: () => toggleDrawer(),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n toggleDrawer()\n }\n },\n role: 'button',\n tabIndex: 0,\n }\n : {})}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [baseClass, formData.blockType, isEditable, toggleDrawer],\n )\n\n const Label = useMemo(() => {\n if (resolvedCustomLabel) {\n return () => resolvedCustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [resolvedCustomLabel, clientBlock?.labels, i18n])\n\n if (!clientBlock) {\n return (\n <InlineBlockContainer className={`${baseClass}-not-found`}>\n <span>Error: Block '{formData.blockType}' not found</span>\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )\n }\n\n return (\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer\n return await onChange({ formState, submit: true })\n },\n ]}\n disableValidationOnSubmit\n el=\"div\"\n fields={clientBlock?.fields}\n initialState={initialState || {}}\n onChange={[onChange]}\n onSubmit={(formState, data) => {\n onFormSubmit(formState, data)\n toggleDrawer()\n }}\n uuid={formUuid}\n >\n <EditDepthProvider>\n <Drawer\n className={''}\n headerActions={headerActions}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <div className=\"fields-drawer\">\n <RenderFields\n fields={clientBlock?.fields}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <RegisterFormSubmit submitRef={submitRef} />\n </div>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {resolvedCustomBlock ? (\n <InlineBlockComponentContext\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {resolvedCustomBlock}\n </InlineBlockComponentContext>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,MAAM,EACNC,iBAAiB,EACjBC,IAAI,EACJC,gBAAgB,EAChBC,YAAY,EACZC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,kBAAkB,EAClBC,cAAc,QACT;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,EAAEC,sBAAsB,QAAQ;AAEtD,OAAO;AACP,OAAO;AAEP,SAASC,0CAA0C,EAAEC,oBAAoB,QAAQ;AACjF,OAAOC,KAAA,IAASC,aAAa,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ;AAC9E,SAASC,EAAA,IAAMC,IAAI,QAAQ;AAM3B,SAASC,sBAAsB,QAAQ;AACvC,SACEC,kBAAkB,EAClBC,eAAe,QACV;AACP,SAASC,gBAAgB,QAAQ;AACjC,SAASC,kBAAkB,QAAQ;AAkBnC,MAAMC,2BAAA,gBAA8BZ,aAAA,CAA+C;EACjFa,YAAA,EAAc;AAChB;AAEA,OAAO,MAAMC,8BAAA,GAAiC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AA,EAAMqD,QAAA;4BAENQ,IAAA,CAACpF,iBAAA;gBACC,aAAAoF,IAAA,CAACrF,MAAA;QACCqC,SAAA,EAAW;QACX6G,aAAA,EAAeA,aAAA;QACfxD,IAAA,EAAMD,UAAA;QACNuF,KAAA,EAAOhI,CAAA,CAAE,+BAA+BL,QAAA,EAAUqB,EAAA,GAAK,SAAS,UAAU,EAAE;UAC1E+F,KAAA,EAAO/C,gBAAA,IAAoBhE,CAAA,CAAE;QAC/B;kBAECjB,YAAA,gBACC6I,KAAA,CAAC;UAAIvI,SAAA,EAAU;kCACbgD,IAAA,CAACjF,YAAA;YACCoD,MAAA,EAAQgD,WAAA,EAAahD,MAAA;YACrByH,WAAW;YACXC,eAAA,EAAgB;YAChBC,UAAA,EAAW;YACXC,gBAAA,EAAkB/D,gBAAA;YAClBgE,WAAA,EAAa;YACbpD,QAAA,EAAU,CAACnF;2BAEbuC,IAAA,CAAC3D,kBAAA;YAAmByH,SAAA,EAAWA;;aAE/B;;QAGP/D,mBAAA,gBACCC,IAAA,CAACvD,2BAAA;MACC2C,KAAA,EAAO;QACLuF,UAAA;QACAjI,YAAA;QACAmI,oBAAA;QACAS,KAAA;QACA/H,OAAA;QACAwG;MACF;gBAEChE;sBAGHwF,KAAA,CAACV,oBAAA;iBACEnI,YAAA,gBAAesD,IAAA,CAACsF,KAAA,qBAAWtF,IAAA,CAAChF,aAAA;QAAciL,MAAA,EAAO;QAAOC,KAAA,EAAM;UAC9DzI,UAAA,gBACCuC,IAAA,CAAC;QAAIhD,SAAA,EAAW,GAAGC,SAAA,WAAoB;kBACrC,aAAA+C,IAAA,CAAC+D,YAAA;WAED;;;AAKd","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","Drawer","EditDepthProvider","Form","formatDrawerSlug","RenderFields","ShimmerEffect","useConfig","useDocumentForm","useDocumentInfo","useEditDepth","useServerFunctions","useTranslation","abortAndIgnore","$getNodeByKey","SKIP_DOM_SELECTION_TAG","deepCopyObjectSimpleWithoutReactComponents","React","createContext","useCallback","useEffect","useMemo","useRef","v4","uuid","useEditorConfigContext","RegisterFormSubmit","useDrawerSubmit","useLexicalDrawer","getCachedFormStateIfDataMatches","reduceFormStateToBlockData","$isInlineBlockNode","InlineBlockComponentContext","initialState","useInlineBlockComponentContext","use","InlineBlockComponent","props","cacheBuster","className","baseClass","CustomBlock","CustomBlockFromProps","CustomLabel","CustomLabelFromProps","formData","nodeKey","editor","isEditable","i18n","t","createdInlineBlock","fieldProps","featureClientSchemaMap","initialLexicalFormState","schemaPath","setCreatedInlineBlock","uuidFromContext","fields","parentDocumentFields","getFormState","editDepth","firstTimeDrawer","blockType","formDataRef","current","schemaFieldsPath","setInitialState","useState","cachedState","id","cachedFormState","formState","cachedSchemaPath","currentSchemaPath","hasMounted","prevCacheBuster","formUuid","setCustomLabel","undefined","customComponents","BlockLabel","setCustomBlock","Block","resolvedCustomBlock","_jsx","isEditor","isJSXConverter","resolvedCustomLabel","drawerSlug","slug","depth","toggleDrawer","inlineBlockElemElemRef","collectionSlug","getDocPreferences","globalSlug","config","componentMapRenderedBlockPath","clientSchemaMap","blocksField","blockOrSlug","blocks","clientBlock","blocksMap","clientBlockFields","getKey","length","removeInlineBlock","update","remove","blockDisplayName","labels","singular","onChangeAbortControllerRef","AbortController","abortController","awaitInitialState","state","data","docPermissions","docPreferences","documentFormState","excludeFiles","initialBlockData","operation","readOnly","renderAllFields","signal","newFormStateData","node","newData","setFields","tag","onChange","prevFormState","submit","controller","blockData","isStateOutOfSync","Object","keys","some","key","value","onFormSubmit","headerActions","submitRef","RemoveButton","buttonStyle","disabled","icon","onClick","e","preventDefault","stopPropagation","round","size","tooltip","label","EditButton","el","InlineBlockContainer","children","filter","Boolean","join","onKeyDown","role","tabIndex","ref","Label","_jsxs","beforeSubmit","disableValidationOnSubmit","onSubmit","title","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","height","width"],"sources":["../../../../../src/features/blocks/client/componentInline/index.tsx"],"sourcesContent":["'use client'\n\nimport type { BlocksFieldClient, ClientBlock, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Drawer,\n EditDepthProvider,\n Form,\n formatDrawerSlug,\n RenderFields,\n ShimmerEffect,\n useConfig,\n useDocumentForm,\n useDocumentInfo,\n useEditDepth,\n useServerFunctions,\n useTranslation,\n} from '@payloadcms/ui'\nimport { abortAndIgnore } from '@payloadcms/ui/shared'\nimport { $getNodeByKey, SKIP_DOM_SELECTION_TAG } from 'lexical'\n\nimport './index.css'\nimport '../../../../utilities/fieldsDrawer/index.css'\n\nimport { deepCopyObjectSimpleWithoutReactComponents } from 'payload/shared'\nimport React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ViewMapInlineBlockComponentProps } from '../../../../types/index.js'\nimport type { InlineBlockFields } from '../../server/schema.js'\nimport type { BlockComponentProps } from '../component/index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport {\n RegisterFormSubmit,\n useDrawerSubmit,\n} from '../../../../utilities/fieldsDrawer/useDrawerSubmit.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport {\n getCachedFormStateIfDataMatches,\n reduceFormStateToBlockData,\n} from '../getCachedFormStateIfDataMatches.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\n\nexport type InlineBlockComponentProps<\n TFormData extends Record<string, unknown> = InlineBlockFields,\n> = {\n readonly CustomBlock?: React.FC<ViewMapInlineBlockComponentProps>\n readonly CustomLabel?: React.FC<ViewMapInlineBlockComponentProps>\n} & Pick<BlockComponentProps<TFormData>, 'cacheBuster' | 'className' | 'formData' | 'nodeKey'>\n\nexport type InlineBlockComponentContextType = {\n EditButton?: React.FC\n initialState: false | FormState | undefined\n InlineBlockContainer?: React.FC<{ children: React.ReactNode }>\n Label?: React.FC\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst InlineBlockComponentContext = createContext<InlineBlockComponentContextType>({\n initialState: false,\n})\n\nexport const useInlineBlockComponentContext = () => React.use(InlineBlockComponentContext)\n\nexport const InlineBlockComponent: React.FC<InlineBlockComponentProps<InlineBlockFields>> = (\n props,\n) => {\n const {\n cacheBuster,\n className: baseClass,\n CustomBlock: CustomBlockFromProps,\n CustomLabel: CustomLabelFromProps,\n formData,\n nodeKey,\n } = props\n\n const [editor] = useLexicalComposerContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation<object, string>()\n const {\n createdInlineBlock,\n fieldProps: { featureClientSchemaMap, initialLexicalFormState, schemaPath },\n setCreatedInlineBlock,\n uuid: uuidFromContext,\n } = useEditorConfigContext()\n const { fields: parentDocumentFields } = useDocumentForm()\n\n const { getFormState } = useServerFunctions()\n const editDepth = useEditDepth()\n const firstTimeDrawer = useRef(false)\n const blockType = formData.blockType\n const formDataRef = useRef(formData)\n formDataRef.current = formData\n const schemaFieldsPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${blockType}.fields`\n\n const [initialState, setInitialState] = React.useState<false | FormState | undefined>(() => {\n // Initial form state that was calculated server-side. May have stale values\n const cachedState = initialLexicalFormState?.[formData.id]\n const cachedFormState = cachedState?.formState\n if (!cachedFormState) {\n return false\n }\n\n return getCachedFormStateIfDataMatches({\n cachedFormState,\n cachedSchemaPath: cachedState.schemaPath,\n currentSchemaPath: schemaFieldsPath,\n formData,\n })\n })\n\n const hasMounted = useRef(false)\n const prevCacheBuster = useRef(cacheBuster)\n useEffect(() => {\n if (hasMounted.current) {\n if (prevCacheBuster.current !== cacheBuster) {\n setInitialState(false)\n }\n prevCacheBuster.current = cacheBuster\n } else {\n hasMounted.current = true\n }\n }, [cacheBuster])\n\n const [formUuid] = React.useState(() => uuid())\n\n // Server-rendered custom components (from admin.components, NOT viewMap).\n // When viewMap components exist, we render them directly with formData instead.\n const [CustomLabel, setCustomLabel] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomLabelFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.BlockLabel ?? undefined\n })\n\n const [CustomBlock, setCustomBlock] = React.useState<React.ReactNode | undefined>(() => {\n if (CustomBlockFromProps) {\n return undefined\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n return initialState?.['_components']?.customComponents?.Block ?? undefined\n })\n\n const resolvedCustomBlock = useMemo(() => {\n if (CustomBlockFromProps) {\n return (\n <CustomBlockFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomBlock\n }, [CustomBlockFromProps, baseClass, formData, nodeKey, CustomBlock])\n\n const resolvedCustomLabel = useMemo(() => {\n if (CustomLabelFromProps) {\n return (\n <CustomLabelFromProps\n className={baseClass}\n formData={formData}\n isEditor={true}\n isJSXConverter={false}\n nodeKey={nodeKey}\n // eslint-disable-next-line react-compiler/react-compiler -- intentionally passed as a prop for custom block components to call\n useInlineBlockComponentContext={useInlineBlockComponentContext}\n />\n )\n }\n return CustomLabel\n }, [CustomLabelFromProps, baseClass, formData, nodeKey, CustomLabel])\n\n const drawerSlug = formatDrawerSlug({\n slug: `lexical-inlineBlocks-create-${uuidFromContext}-${formData.id}`,\n depth: editDepth,\n })\n const { toggleDrawer } = useLexicalDrawer(drawerSlug, true)\n\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const { id, collectionSlug, getDocPreferences, globalSlug } = useDocumentInfo()\n const { config } = useConfig()\n\n const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${blockType}`\n\n const clientSchemaMap = featureClientSchemaMap['blocks']\n\n const blocksField: BlocksFieldClient | undefined = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient | undefined\n\n const blockOrSlug = blocksField?.blocks?.[0]\n const clientBlock: ClientBlock | undefined =\n typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug\n\n const clientBlockFields = clientBlock?.fields ?? []\n\n // Open drawer on \"mount\"\n useEffect(() => {\n if (!firstTimeDrawer.current && createdInlineBlock?.getKey() === nodeKey) {\n // > 2 because they always have \"id\" and \"blockName\" fields\n if (clientBlockFields.length > 2) {\n toggleDrawer()\n }\n setCreatedInlineBlock?.(undefined)\n firstTimeDrawer.current = true\n }\n }, [clientBlockFields.length, createdInlineBlock, nodeKey, setCreatedInlineBlock, toggleDrawer])\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const blockDisplayName = clientBlock?.labels?.singular\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock?.slug\n\n const onChangeAbortControllerRef = useRef(new AbortController())\n\n // Initial state for newly created blocks\n useEffect(() => {\n const abortController = new AbortController()\n\n const awaitInitialState = async () => {\n /*\n * This will only run if a new block is created. For all existing blocks that are loaded when the document is loaded, or when the form is saved,\n * this is not run, as the lexical field RSC will fetch the state server-side and pass it to the client. That way, we avoid unnecessary client-side\n * requests. Though for newly created blocks, we need to fetch the state client-side, as the server doesn't know about the block yet.\n */\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: formData,\n docPermissions: { fields: true },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n globalSlug,\n initialBlockData: formData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: true,\n schemaPath: schemaFieldsPath,\n signal: abortController.signal,\n })\n\n if (state) {\n const newFormStateData = reduceFormStateToBlockData(\n deepCopyObjectSimpleWithoutReactComponents(state, { excludeFiles: true }),\n ) as InlineBlockFields\n\n // Things like default values may come back from the server => update the node with the new data\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n const newData = newFormStateData\n newData.blockType = formData.blockType\n\n node.setFields(newData, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n\n setInitialState(state)\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n }\n\n if (clientBlock && formData && !initialState) {\n void awaitInitialState()\n }\n\n return () => {\n abortAndIgnore(abortController)\n }\n }, [\n getFormState,\n editor,\n nodeKey,\n isEditable,\n CustomLabelFromProps,\n CustomBlockFromProps,\n schemaFieldsPath,\n id,\n formData,\n initialState,\n collectionSlug,\n globalSlug,\n getDocPreferences,\n parentDocumentFields,\n clientBlock,\n ])\n\n /**\n * HANDLE ONCHANGE\n */\n const onChange = useCallback(\n async ({ formState: prevFormState, submit }: { formState: FormState; submit?: boolean }) => {\n abortAndIgnore(onChangeAbortControllerRef.current)\n\n const controller = new AbortController()\n onChangeAbortControllerRef.current = controller\n const blockData = reduceFormStateToBlockData(\n deepCopyObjectSimpleWithoutReactComponents(prevFormState, { excludeFiles: true }),\n formDataRef.current,\n )\n\n const { state } = await getFormState({\n id,\n collectionSlug,\n data: blockData,\n docPermissions: {\n fields: true,\n },\n docPreferences: await getDocPreferences(),\n documentFormState: deepCopyObjectSimpleWithoutReactComponents(parentDocumentFields, {\n excludeFiles: true,\n }),\n formState: prevFormState,\n globalSlug,\n initialBlockData: blockData,\n operation: 'update',\n readOnly: !isEditable,\n renderAllFields: submit ? true : false,\n schemaPath: schemaFieldsPath,\n signal: controller.signal,\n })\n\n if (!state) {\n return prevFormState\n }\n\n if (submit) {\n if (!CustomLabelFromProps) {\n setCustomLabel(state['_components']?.customComponents?.BlockLabel)\n }\n if (!CustomBlockFromProps) {\n setCustomBlock(state['_components']?.customComponents?.Block)\n }\n }\n\n return state\n },\n [\n getFormState,\n id,\n collectionSlug,\n getDocPreferences,\n parentDocumentFields,\n globalSlug,\n isEditable,\n schemaFieldsPath,\n CustomBlockFromProps,\n CustomLabelFromProps,\n ],\n )\n // cleanup effect\n useEffect(() => {\n const isStateOutOfSync = (formData: InlineBlockFields, initialState: FormState) => {\n return Object.keys(initialState).some(\n (key) => initialState[key] && formData[key] !== initialState[key].value,\n )\n }\n\n return () => {\n // If the component is unmounted (either via removeInlineBlock or via lexical itself) and the form state got changed before,\n // we need to reset the initial state to force a re-fetch of the initial state when it gets mounted again (e.g. via lexical history undo).\n // Otherwise it would use an outdated initial state.\n if (initialState && isStateOutOfSync(formData, initialState)) {\n setInitialState(false)\n }\n abortAndIgnore(onChangeAbortControllerRef.current)\n }\n }, [formData, initialState])\n\n /**\n * HANDLE FORM SUBMIT\n */\n const onFormSubmit = useCallback(\n (formState: FormState) => {\n const newData = reduceFormStateToBlockData(formState, formDataRef.current)\n newData.blockType = blockType\n\n editor.update(\n () => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isInlineBlockNode(node)) {\n node.setFields(newData as InlineBlockFields, true)\n }\n },\n // Without this, the outer editor's reconciler resets DOM selection\n // back into its own root, kicking focus out of any nested richText.\n { tag: SKIP_DOM_SELECTION_TAG },\n )\n },\n [blockType, editor, nodeKey],\n )\n\n const { headerActions, submitRef } = useDrawerSubmit()\n\n const RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n e.stopPropagation()\n removeInlineBlock()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, removeInlineBlock, t],\n )\n\n const EditButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__editButton`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n size=\"medium\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n ),\n [baseClass, blockDisplayName, isEditable, t, toggleDrawer],\n )\n\n const InlineBlockContainer = useMemo(\n () =>\n ({ children, className }: { children: React.ReactNode; className?: string }) => (\n <div\n className={[`${baseClass}__container`, baseClass + '-' + formData.blockType, className]\n .filter(Boolean)\n .join(' ')}\n {...(isEditable\n ? {\n onClick: () => toggleDrawer(),\n onKeyDown: (e: React.KeyboardEvent) => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n toggleDrawer()\n }\n },\n role: 'button',\n tabIndex: 0,\n }\n : {})}\n ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [baseClass, formData.blockType, isEditable, toggleDrawer],\n )\n\n const Label = useMemo(() => {\n if (resolvedCustomLabel) {\n return () => resolvedCustomLabel\n } else {\n return () => (\n <div>{clientBlock?.labels ? getTranslation(clientBlock?.labels.singular, i18n) : ''}</div>\n )\n }\n }, [resolvedCustomLabel, clientBlock?.labels, i18n])\n\n if (!clientBlock) {\n return (\n <InlineBlockContainer className={`${baseClass}-not-found`}>\n <span>Error: Block '{formData.blockType}' not found</span>\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )\n }\n\n return (\n <Form\n beforeSubmit={[\n async ({ formState }) => {\n // This is only called when form is submitted from drawer\n return await onChange({ formState, submit: true })\n },\n ]}\n disableValidationOnSubmit\n el=\"div\"\n fields={clientBlock?.fields}\n initialState={initialState || {}}\n onChange={[onChange]}\n onSubmit={(formState) => {\n onFormSubmit(formState)\n toggleDrawer()\n }}\n uuid={formUuid}\n >\n <EditDepthProvider>\n <Drawer\n className={''}\n headerActions={headerActions}\n slug={drawerSlug}\n title={t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {\n label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label'),\n })}\n >\n {initialState ? (\n <div className=\"fields-drawer\">\n <RenderFields\n fields={clientBlock?.fields}\n forceRender\n parentIndexPath=\"\"\n parentPath=\"\" // See Blocks feature path for details as for why this is empty\n parentSchemaPath={schemaFieldsPath}\n permissions={true}\n readOnly={!isEditable}\n />\n <RegisterFormSubmit submitRef={submitRef} />\n </div>\n ) : null}\n </Drawer>\n </EditDepthProvider>\n {resolvedCustomBlock ? (\n <InlineBlockComponentContext\n value={{\n EditButton,\n initialState,\n InlineBlockContainer,\n Label,\n nodeKey,\n RemoveButton,\n }}\n >\n {resolvedCustomBlock}\n </InlineBlockComponentContext>\n ) : (\n <InlineBlockContainer>\n {initialState ? <Label /> : <ShimmerEffect height=\"15px\" width=\"40px\" />}\n {isEditable ? (\n <div className={`${baseClass}__actions`}>\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,MAAM,EACNC,iBAAiB,EACjBC,IAAI,EACJC,gBAAgB,EAChBC,YAAY,EACZC,aAAa,EACbC,SAAS,EACTC,eAAe,EACfC,eAAe,EACfC,YAAY,EACZC,kBAAkB,EAClBC,cAAc,QACT;AACP,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,EAAEC,sBAAsB,QAAQ;AAEtD,OAAO;AACP,OAAO;AAEP,SAASC,0CAA0C,QAAQ;AAC3D,OAAOC,KAAA,IAASC,aAAa,EAAEC,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,QAAQ;AAC9E,SAASC,EAAA,IAA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,CAACsF,KAAA,qBAAWtF,IAAA,CAAC/E,aAAA;QAAcgL,MAAA,EAAO;QAAOC,KAAA,EAAM;UAC9DvI,UAAA,gBACCqC,IAAA,CAAC;QAAI9C,SAAA,EAAW,GAAGC,SAAA,WAAoB;kBACrC,aAAA6C,IAAA,CAAC+D,YAAA;WAED;;;AAKd","ignoreList":[]}
@@ -6,5 +6,5 @@ import React from 'react';
6
6
  * Priority for URL: images.icon > images.thumbnail > imageURL (deprecated)
7
7
  * Priority for alt: images.icon.alt > images.thumbnail.alt > imageAltText (deprecated)
8
8
  */
9
- export declare function getBlockImageComponent(block: ClientBlock, fallback: React.ElementType): React.ElementType<any, keyof React.JSX.IntrinsicElements> | (() => React.JSX.Element);
9
+ export declare function getBlockImageComponent(block: ClientBlock, fallback: React.ElementType): (() => React.JSX.Element) | React.ElementType<any, keyof React.JSX.IntrinsicElements>;
10
10
  //# sourceMappingURL=getBlockImageComponent.d.ts.map
@@ -0,0 +1,9 @@
1
+ import type { Data, FormState } from 'payload';
2
+ export declare const getCachedFormStateIfDataMatches: ({ cachedFormState, cachedSchemaPath, currentSchemaPath, formData, }: {
3
+ cachedFormState: FormState;
4
+ cachedSchemaPath?: string;
5
+ currentSchemaPath?: string;
6
+ formData: Data;
7
+ }) => false | FormState;
8
+ export declare const reduceFormStateToBlockData: (formState: FormState, currentData?: Data) => Data;
9
+ //# sourceMappingURL=getCachedFormStateIfDataMatches.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCachedFormStateIfDataMatches.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/client/getCachedFormStateIfDataMatches.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAK9C,eAAO,MAAM,+BAA+B,wEAKzC;IACD,eAAe,EAAE,SAAS,CAAA;IAC1B,gBAAgB,CAAC,EAAE,MAAM,CAAA;IACzB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,QAAQ,EAAE,IAAI,CAAA;CACf,KAAG,KAAK,GAAG,SAcX,CAAA;AAED,eAAO,MAAM,0BAA0B,cAAe,SAAS,gBAAgB,IAAI,KAAG,IA4BrF,CAAA"}
@@ -0,0 +1,95 @@
1
+ import { dequal } from 'dequal/lite';
2
+ import { reduceFieldsToValues } from 'payload/shared';
3
+ export const getCachedFormStateIfDataMatches = ({
4
+ cachedFormState,
5
+ cachedSchemaPath,
6
+ currentSchemaPath,
7
+ formData
8
+ }) => {
9
+ if (cachedSchemaPath !== currentSchemaPath) {
10
+ return false;
11
+ }
12
+ const cachedData = reduceFormStateToBlockData(cachedFormState);
13
+ const currentData = normalizeData({
14
+ data: formData,
15
+ rowFieldPaths: getRowFieldPaths(cachedFormState)
16
+ });
17
+ return dequal(withoutSystemBlockFields(cachedData), withoutSystemBlockFields(currentData)) ? cachedFormState : false;
18
+ };
19
+ export const reduceFormStateToBlockData = (formState, currentData) => {
20
+ const formStateWithoutRowCounts = Object.fromEntries(Object.entries(formState).map(([path, fieldState]) => {
21
+ if (!fieldState || !Array.isArray(fieldState.rows)) {
22
+ return [path, fieldState];
23
+ }
24
+ if (fieldState.value === undefined || fieldState.disableFormData !== false && fieldState.isModified !== true && fieldState.rows.length === 0 && getValueAtPath(currentData, path) === null) {
25
+ return [path, {
26
+ ...fieldState,
27
+ value: null
28
+ }];
29
+ }
30
+ return [path, fieldState.value === null ? fieldState : {
31
+ ...fieldState,
32
+ disableFormData: true
33
+ }];
34
+ }));
35
+ return normalizeData({
36
+ data: reduceFieldsToValues(formStateWithoutRowCounts, true),
37
+ rowFieldPaths: new Set()
38
+ });
39
+ };
40
+ const getValueAtPath = (data, path) => path.split('.').reduce((value, pathSegment) => {
41
+ if (!value || typeof value !== 'object') {
42
+ return undefined;
43
+ }
44
+ return value[pathSegment];
45
+ }, data);
46
+ const getRowFieldPaths = formState => new Set(Object.entries(formState).filter(([, fieldState]) => Array.isArray(fieldState?.rows) && fieldState.value !== null && fieldState.value !== undefined).map(([path]) => path));
47
+ const normalizeData = ({
48
+ data,
49
+ parentPath = '',
50
+ rowFieldPaths
51
+ }) => {
52
+ const normalizedData = {};
53
+ for (const [key, value] of Object.entries(data)) {
54
+ const path = parentPath ? `${parentPath}.${key}` : key;
55
+ const normalizedValue = normalizeValue({
56
+ parentPath: path,
57
+ rowFieldPaths,
58
+ value
59
+ });
60
+ if (normalizedValue !== undefined) {
61
+ normalizedData[key] = normalizedValue;
62
+ }
63
+ }
64
+ return normalizedData;
65
+ };
66
+ const normalizeValue = ({
67
+ parentPath,
68
+ rowFieldPaths,
69
+ value
70
+ }) => {
71
+ if (value === undefined || Array.isArray(value) && value.length === 0 && rowFieldPaths.has(parentPath)) {
72
+ return undefined;
73
+ }
74
+ if (Array.isArray(value)) {
75
+ return value.map((item, index) => item && typeof item === 'object' && !Array.isArray(item) ? normalizeData({
76
+ data: item,
77
+ parentPath: `${parentPath}.${index}`,
78
+ rowFieldPaths
79
+ }) : item);
80
+ }
81
+ if (value && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype) {
82
+ return normalizeData({
83
+ data: value,
84
+ parentPath,
85
+ rowFieldPaths
86
+ });
87
+ }
88
+ return value;
89
+ };
90
+ const withoutSystemBlockFields = ({
91
+ blockName: _blockName,
92
+ blockType: _blockType,
93
+ ...data
94
+ }) => data;
95
+ //# sourceMappingURL=getCachedFormStateIfDataMatches.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getCachedFormStateIfDataMatches.js","names":["dequal","reduceFieldsToValues","getCachedFormStateIfDataMatches","cachedFormState","cachedSchemaPath","currentSchemaPath","formData","cachedData","reduceFormStateToBlockData","currentData","normalizeData","data","rowFieldPaths","getRowFieldPaths","withoutSystemBlockFields","formState","formStateWithoutRowCounts","Object","fromEntries","entries","map","path","fieldState","Array","isArray","rows","value","undefined","disableFormData","isModified","length","getValueAtPath","Set","split","reduce","pathSegment","filter","parentPath","normalizedData","key","normalizedValue","normalizeValue","has","item","index","getPrototypeOf","prototype","blockName","_blockName","blockType","_blockType"],"sources":["../../../../src/features/blocks/client/getCachedFormStateIfDataMatches.ts"],"sourcesContent":["import type { Data, FormState } from 'payload'\n\nimport { dequal } from 'dequal/lite'\nimport { reduceFieldsToValues } from 'payload/shared'\n\nexport const getCachedFormStateIfDataMatches = ({\n cachedFormState,\n cachedSchemaPath,\n currentSchemaPath,\n formData,\n}: {\n cachedFormState: FormState\n cachedSchemaPath?: string\n currentSchemaPath?: string\n formData: Data\n}): false | FormState => {\n if (cachedSchemaPath !== currentSchemaPath) {\n return false\n }\n\n const cachedData = reduceFormStateToBlockData(cachedFormState)\n const currentData = normalizeData({\n data: formData,\n rowFieldPaths: getRowFieldPaths(cachedFormState),\n })\n\n return dequal(withoutSystemBlockFields(cachedData), withoutSystemBlockFields(currentData))\n ? cachedFormState\n : false\n}\n\nexport const reduceFormStateToBlockData = (formState: FormState, currentData?: Data): Data => {\n const formStateWithoutRowCounts = Object.fromEntries(\n Object.entries(formState).map(([path, fieldState]) => {\n if (!fieldState || !Array.isArray(fieldState.rows)) {\n return [path, fieldState]\n }\n\n if (\n fieldState.value === undefined ||\n (fieldState.disableFormData !== false &&\n fieldState.isModified !== true &&\n fieldState.rows.length === 0 &&\n getValueAtPath(currentData, path) === null)\n ) {\n return [path, { ...fieldState, value: null }]\n }\n\n return [\n path,\n fieldState.value === null ? fieldState : { ...fieldState, disableFormData: true },\n ]\n }),\n ) as FormState\n\n return normalizeData({\n data: reduceFieldsToValues(formStateWithoutRowCounts, true),\n rowFieldPaths: new Set(),\n })\n}\n\nconst getValueAtPath = (data: Data | undefined, path: string): unknown =>\n path.split('.').reduce<unknown>((value, pathSegment) => {\n if (!value || typeof value !== 'object') {\n return undefined\n }\n\n return (value as Record<string, unknown>)[pathSegment]\n }, data)\n\nconst getRowFieldPaths = (formState: FormState): Set<string> =>\n new Set(\n Object.entries(formState)\n .filter(\n ([, fieldState]) =>\n Array.isArray(fieldState?.rows) &&\n fieldState.value !== null &&\n fieldState.value !== undefined,\n )\n .map(([path]) => path),\n )\n\nconst normalizeData = ({\n data,\n parentPath = '',\n rowFieldPaths,\n}: {\n data: Data\n parentPath?: string\n rowFieldPaths: Set<string>\n}): Data => {\n const normalizedData: Data = {}\n\n for (const [key, value] of Object.entries(data)) {\n const path = parentPath ? `${parentPath}.${key}` : key\n const normalizedValue = normalizeValue({ parentPath: path, rowFieldPaths, value })\n\n if (normalizedValue !== undefined) {\n normalizedData[key] = normalizedValue\n }\n }\n\n return normalizedData\n}\n\nconst normalizeValue = ({\n parentPath,\n rowFieldPaths,\n value,\n}: {\n parentPath: string\n rowFieldPaths: Set<string>\n value: unknown\n}): unknown => {\n if (\n value === undefined ||\n (Array.isArray(value) && value.length === 0 && rowFieldPaths.has(parentPath))\n ) {\n return undefined\n }\n\n if (Array.isArray(value)) {\n return value.map((item, index) =>\n item && typeof item === 'object' && !Array.isArray(item)\n ? normalizeData({\n data: item as Data,\n parentPath: `${parentPath}.${index}`,\n rowFieldPaths,\n })\n : item,\n )\n }\n\n if (value && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype) {\n return normalizeData({ data: value as Data, parentPath, rowFieldPaths })\n }\n\n return value\n}\n\nconst withoutSystemBlockFields = ({\n blockName: _blockName,\n blockType: _blockType,\n ...data\n}: Data): Data => data\n"],"mappings":"AAEA,SAASA,MAAM,QAAQ;AACvB,SAASC,oBAAoB,QAAQ;AAErC,OAAO,MAAMC,+BAAA,GAAkCA,CAAC;EAC9CC,eAAe;EACfC,gBAAgB;EAChBC,iBAAiB;EACjBC;AAAQ,CAMT;EACC,IAAIF,gBAAA,KAAqBC,iBAAA,EAAmB;IAC1C,OAAO;EACT;EAEA,MAAME,UAAA,GAAaC,0BAAA,CAA2BL,eAAA;EAC9C,MAAMM,WAAA,GAAcC,aAAA,CAAc;IAChCC,IAAA,EAAML,QAAA;IACNM,aAAA,EAAeC,gBAAA,CAAiBV,eAAA;EAClC;EAEA,OAAOH,MAAA,CAAOc,wBAAA,CAAyBP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IAAA,KAAS,YAAY,CAACpB,KAAA,CAAMC,OAAO,CAACmB,IAAA,IAC/CjC,aAAA,CAAc;MACZC,IAAA,EAAMgC,IAAA;MACNN,UAAA,EAAY,GAAGA,UAAA,IAAcO,KAAA,EAAO;MACpChC;IACF,KACA+B,IAAA;EAER;EAEA,IAAIjB,KAAA,IAAS,OAAOA,KAAA,KAAU,YAAYT,MAAA,CAAO4B,cAAc,CAACnB,KAAA,MAAWT,MAAA,CAAO6B,SAAS,EAAE;IAC3F,OAAOpC,aAAA,CAAc;MAAEC,IAAA,EAAMe,KAAA;MAAeW,UAAA;MAAYzB;IAAc;EACxE;EAEA,OAAOc,KAAA;AACT;AAEA,MAAMZ,wBAAA,GAA2BA,CAAC;EAChCiC,SAAA,EAAWC,UAAU;EACrBC,SAAA,EAAWC,UAAU;EACrB,GAAGvC;AAAA,CACE,KAAWA,IAAA","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { Klass, LexicalNode, LexicalNodeReplacement } from 'lexical';
2
- import { type Transformer } from '../../../../packages/@lexical/markdown/index.js';
2
+ import { type Transformer } from '@lexical/markdown';
3
3
  export declare function getLexicalToMarkdown(allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>, allTransformers: Transformer[]): (args: {
4
4
  editorState: Record<string, any>;
5
5
  }) => string;
@@ -1 +1 @@
1
- {"version":3,"file":"getLexicalToMarkdown.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/getLexicalToMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAIzE,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iDAAiD,CAAA;AAExD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,EAC5D,eAAe,EAAE,WAAW,EAAE,GAC7B,CAAC,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,KAAK,MAAM,CAoBxD"}
1
+ {"version":3,"file":"getLexicalToMarkdown.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/getLexicalToMarkdown.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAGzE,OAAO,EAA4B,KAAK,WAAW,EAAE,MAAM,mBAAmB,CAAA;AAE9E,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,EAC5D,eAAe,EAAE,WAAW,EAAE,GAC7B,CAAC,IAAI,EAAE;IAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;CAAE,KAAK,MAAM,CAoBxD"}
@@ -1,5 +1,5 @@
1
1
  import { createHeadlessEditor } from '@lexical/headless';
2
- import { $convertToMarkdownString } from '../../../../packages/@lexical/markdown/index.js';
2
+ import { $convertToMarkdownString } from '@lexical/markdown';
3
3
  export function getLexicalToMarkdown(allNodes, allTransformers) {
4
4
  const lexicalToMarkdown = ({
5
5
  editorState
@@ -1 +1 @@
1
- {"version":3,"file":"getLexicalToMarkdown.js","names":["createHeadlessEditor","$convertToMarkdownString","getLexicalToMarkdown","allNodes","allTransformers","lexicalToMarkdown","editorState","headlessEditor","nodes","setEditorState","parseEditorState","e","console","error","markdown","getEditorState","read"],"sources":["../../../../../src/features/blocks/client/markdown/getLexicalToMarkdown.ts"],"sourcesContent":["import type { Klass, LexicalNode, LexicalNodeReplacement } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\n\nimport {\n $convertToMarkdownString,\n type Transformer,\n} from '../../../../packages/@lexical/markdown/index.js'\n\nexport function getLexicalToMarkdown(\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>,\n allTransformers: Transformer[],\n): (args: { editorState: Record<string, any> }) => string {\n const lexicalToMarkdown = ({ editorState }: { editorState: Record<string, any> }): string => {\n const headlessEditor = createHeadlessEditor({\n nodes: allNodes,\n })\n\n try {\n headlessEditor.setEditorState(headlessEditor.parseEditorState(editorState as any)) // This should commit the editor state immediately\n } catch (e) {\n console.error('getLexicalToMarkdown: ERROR parsing editor state', e)\n }\n\n let markdown: string = ''\n headlessEditor.getEditorState().read(() => {\n markdown = $convertToMarkdownString(allTransformers)\n })\n\n return markdown\n }\n return lexicalToMarkdown\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAErC,SACEC,wBAAwB,QAEnB;AAEP,OAAO,SAASC,qBACdC,QAA4D,EAC5DC,eAA8B;EAE9B,MAAMC,iBAAA,GAAoBA,CAAC;IAAEC;EAAW,CAAwC;IAC9E,MAAMC,cAAA,GAAiBP,oBAAA,CAAqB;MAC1CQ,KAAA,EAAOL;IACT;IAEA,IAAI;MACFI,cAAA,CAAeE,cAAc,CAACF,cAAA,CAAeG,gBAAgB,CAACJ,WAAA,IAAqB;IACrF,EAAE,OAAOK,CAAA,EAAG;MACVC,OAAA,CAAQC,KAAK,CAAC,oDAAoDF,CAAA;IACpE;IAEA,IAAIG,QAAA,GAAmB;IACvBP,cAAA,CAAeQ,cAAc,GAAGC,IAAI,CAAC;MACnCF,QAAA,GAAWb,wBAAA,CAAyBG,eAAA;IACtC;IAEA,OAAOU,QAAA;EACT;EACA,OAAOT,iBAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"getLexicalToMarkdown.js","names":["createHeadlessEditor","$convertToMarkdownString","getLexicalToMarkdown","allNodes","allTransformers","lexicalToMarkdown","editorState","headlessEditor","nodes","setEditorState","parseEditorState","e","console","error","markdown","getEditorState","read"],"sources":["../../../../../src/features/blocks/client/markdown/getLexicalToMarkdown.ts"],"sourcesContent":["import type { Klass, LexicalNode, LexicalNodeReplacement } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\nimport { $convertToMarkdownString, type Transformer } from '@lexical/markdown'\n\nexport function getLexicalToMarkdown(\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>,\n allTransformers: Transformer[],\n): (args: { editorState: Record<string, any> }) => string {\n const lexicalToMarkdown = ({ editorState }: { editorState: Record<string, any> }): string => {\n const headlessEditor = createHeadlessEditor({\n nodes: allNodes,\n })\n\n try {\n headlessEditor.setEditorState(headlessEditor.parseEditorState(editorState as any)) // This should commit the editor state immediately\n } catch (e) {\n console.error('getLexicalToMarkdown: ERROR parsing editor state', e)\n }\n\n let markdown: string = ''\n headlessEditor.getEditorState().read(() => {\n markdown = $convertToMarkdownString(allTransformers)\n })\n\n return markdown\n }\n return lexicalToMarkdown\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AACrC,SAASC,wBAAwB,QAA0B;AAE3D,OAAO,SAASC,qBACdC,QAA4D,EAC5DC,eAA8B;EAE9B,MAAMC,iBAAA,GAAoBA,CAAC;IAAEC;EAAW,CAAwC;IAC9E,MAAMC,cAAA,GAAiBP,oBAAA,CAAqB;MAC1CQ,KAAA,EAAOL;IACT;IAEA,IAAI;MACFI,cAAA,CAAeE,cAAc,CAACF,cAAA,CAAeG,gBAAgB,CAACJ,WAAA,IAAqB;IACrF,EAAE,OAAOK,CAAA,EAAG;MACVC,OAAA,CAAQC,KAAK,CAAC,oDAAoDF,CAAA;IACpE;IAEA,IAAIG,QAAA,GAAmB;IACvBP,cAAA,CAAeQ,cAAc,GAAGC,IAAI,CAAC;MACnCF,QAAA,GAAWb,wBAAA,CAAyBG,eAAA;IACtC;IAEA,OAAOU,QAAA;EACT;EACA,OAAOT,iBAAA;AACT","ignoreList":[]}
@@ -1,5 +1,5 @@
1
+ import type { Transformer } from '@lexical/markdown';
1
2
  import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState } from 'lexical';
2
- import { type Transformer } from '../../../../packages/@lexical/markdown/index.js';
3
3
  export declare function getMarkdownToLexical(allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>, allTransformers: Transformer[]): (args: {
4
4
  markdown: string;
5
5
  }) => SerializedEditorState;
@@ -1 +1 @@
1
- {"version":3,"file":"getMarkdownToLexical.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/getMarkdownToLexical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAIhG,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iDAAiD,CAAA;AAExD,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,EAC5D,eAAe,EAAE,WAAW,EAAE,GAC7B,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,KAAK,qBAAqB,CAkBvD"}
1
+ {"version":3,"file":"getMarkdownToLexical.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/getMarkdownToLexical.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAMhG,wBAAgB,oBAAoB,CAClC,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,EAC5D,eAAe,EAAE,WAAW,EAAE,GAC7B,CAAC,IAAI,EAAE;IAAE,QAAQ,EAAE,MAAM,CAAA;CAAE,KAAK,qBAAqB,CAqBvD"}
@@ -1,5 +1,5 @@
1
1
  import { createHeadlessEditor } from '@lexical/headless';
2
- import { $convertFromMarkdownString } from '../../../../packages/@lexical/markdown/index.js';
2
+ import { $convertFromMarkdownString } from '../../../../lexical/utils/markdown/convertFromMarkdownString.js';
3
3
  export function getMarkdownToLexical(allNodes, allTransformers) {
4
4
  const markdownToLexical = ({
5
5
  markdown
@@ -8,7 +8,10 @@ export function getMarkdownToLexical(allNodes, allTransformers) {
8
8
  nodes: allNodes
9
9
  });
10
10
  headlessEditor.update(() => {
11
- $convertFromMarkdownString(markdown, allTransformers);
11
+ // shouldMergeAdjacentLines is true to preserve how Payload parses block
12
+ // content (multi-line tags, soft-wrapped lines). The exported
13
+ // $convertFromMarkdownString now defaults to false to match upstream.
14
+ $convertFromMarkdownString(markdown, allTransformers, undefined, false, true);
12
15
  }, {
13
16
  discrete: true
14
17
  });
@@ -1 +1 @@
1
- {"version":3,"file":"getMarkdownToLexical.js","names":["createHeadlessEditor","$convertFromMarkdownString","getMarkdownToLexical","allNodes","allTransformers","markdownToLexical","markdown","headlessEditor","nodes","update","discrete","editorJSON","getEditorState","toJSON"],"sources":["../../../../../src/features/blocks/client/markdown/getMarkdownToLexical.ts"],"sourcesContent":["import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\n\nimport {\n $convertFromMarkdownString,\n type Transformer,\n} from '../../../../packages/@lexical/markdown/index.js'\n\nexport function getMarkdownToLexical(\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>,\n allTransformers: Transformer[],\n): (args: { markdown: string }) => SerializedEditorState {\n const markdownToLexical = ({ markdown }: { markdown: string }): SerializedEditorState => {\n const headlessEditor = createHeadlessEditor({\n nodes: allNodes,\n })\n\n headlessEditor.update(\n () => {\n $convertFromMarkdownString(markdown, allTransformers)\n },\n { discrete: true },\n )\n\n const editorJSON = headlessEditor.getEditorState().toJSON()\n\n return editorJSON\n }\n return markdownToLexical\n}\n"],"mappings":"AAEA,SAASA,oBAAoB,QAAQ;AAErC,SACEC,0BAA0B,QAErB;AAEP,OAAO,SAASC,qBACdC,QAA4D,EAC5DC,eAA8B;EAE9B,MAAMC,iBAAA,GAAoBA,CAAC;IAAEC;EAAQ,CAAwB;IAC3D,MAAMC,cAAA,GAAiBP,oBAAA,CAAqB;MAC1CQ,KAAA,EAAOL;IACT;IAEAI,cAAA,CAAeE,MAAM,CACnB;MACER,0BAAA,CAA2BK,QAAA,EAAUF,eAAA;IACvC,GACA;MAAEM,QAAA,EAAU;IAAK;IAGnB,MAAMC,UAAA,GAAaJ,cAAA,CAAeK,cAAc,GAAGC,MAAM;IAEzD,OAAOF,UAAA;EACT;EACA,OAAON,iBAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"getMarkdownToLexical.js","names":["createHeadlessEditor","$convertFromMarkdownString","getMarkdownToLexical","allNodes","allTransformers","markdownToLexical","markdown","headlessEditor","nodes","update","undefined","discrete","editorJSON","getEditorState","toJSON"],"sources":["../../../../../src/features/blocks/client/markdown/getMarkdownToLexical.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\n\nimport { $convertFromMarkdownString } from '../../../../lexical/utils/markdown/convertFromMarkdownString.js'\n\nexport function getMarkdownToLexical(\n allNodes: Array<Klass<LexicalNode> | LexicalNodeReplacement>,\n allTransformers: Transformer[],\n): (args: { markdown: string }) => SerializedEditorState {\n const markdownToLexical = ({ markdown }: { markdown: string }): SerializedEditorState => {\n const headlessEditor = createHeadlessEditor({\n nodes: allNodes,\n })\n\n headlessEditor.update(\n () => {\n // shouldMergeAdjacentLines is true to preserve how Payload parses block\n // content (multi-line tags, soft-wrapped lines). The exported\n // $convertFromMarkdownString now defaults to false to match upstream.\n $convertFromMarkdownString(markdown, allTransformers, undefined, false, true)\n },\n { discrete: true },\n )\n\n const editorJSON = headlessEditor.getEditorState().toJSON()\n\n return editorJSON\n }\n return markdownToLexical\n}\n"],"mappings":"AAGA,SAASA,oBAAoB,QAAQ;AAErC,SAASC,0BAA0B,QAAQ;AAE3C,OAAO,SAASC,qBACdC,QAA4D,EAC5DC,eAA8B;EAE9B,MAAMC,iBAAA,GAAoBA,CAAC;IAAEC;EAAQ,CAAwB;IAC3D,MAAMC,cAAA,GAAiBP,oBAAA,CAAqB;MAC1CQ,KAAA,EAAOL;IACT;IAEAI,cAAA,CAAeE,MAAM,CACnB;MACE;MACA;MACA;MACAR,0BAAA,CAA2BK,QAAA,EAAUF,eAAA,EAAiBM,SAAA,EAAW,OAAO;IAC1E,GACA;MAAEC,QAAA,EAAU;IAAK;IAGnB,MAAMC,UAAA,GAAaL,cAAA,CAAeM,cAAc,GAAGC,MAAM;IAEzD,OAAOF,UAAA;EACT;EACA,OAAOP,iBAAA;AACT","ignoreList":[]}
@@ -1,7 +1,6 @@
1
+ import type { MultilineElementTransformer, TextMatchTransformer, Transformer } from '@lexical/markdown';
1
2
  import type { ClientBlock } from 'payload';
2
3
  import { type Klass, type LexicalNode, type LexicalNodeReplacement } from 'lexical';
3
- import type { Transformer } from '../../../../packages/@lexical/markdown/index.js';
4
- import type { MultilineElementTransformer, TextMatchTransformer } from '../../../../packages/@lexical/markdown/MarkdownTransformers.js';
5
4
  export declare const getBlockMarkdownTransformers: ({ blocks, inlineBlocks, }: {
6
5
  blocks: ClientBlock[];
7
6
  inlineBlocks: ClientBlock[];
@@ -1 +1 @@
1
- {"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/markdownTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAE5B,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iDAAiD,CAAA;AAClF,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACrB,MAAM,gEAAgE,CAAA;AAqBvE,eAAO,MAAM,4BAA4B,GAAI,2BAG1C;IACD,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,KAAG,CAAC,CAAC,KAAK,EAAE;IACX,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAAA;IAC5D,eAAe,EAAE,WAAW,EAAE,CAAA;CAC/B,KAAK,2BAA2B,GAAG,oBAAoB,CAAC,EA8BxD,CAAA"}
1
+ {"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/markdown/markdownTransformer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,2BAA2B,EAC3B,oBAAoB,EACpB,WAAW,EACZ,MAAM,mBAAmB,CAAA;AAC1B,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C,OAAO,EAGL,KAAK,KAAK,EACV,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAE5B,MAAM,SAAS,CAAA;AAqBhB,eAAO,MAAM,4BAA4B,8BAGtC;IACD,MAAM,EAAE,WAAW,EAAE,CAAA;IACrB,YAAY,EAAE,WAAW,EAAE,CAAA;CAC5B,KAAG,CAAC,CAAC,KAAK,EAAE;IACX,QAAQ,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAAA;IAC5D,eAAe,EAAE,WAAW,EAAE,CAAA;CAC/B,KAAK,2BAA2B,GAAG,oBAAoB,CAAC,EA8BxD,CAAA"}