@payloadcms/richtext-lexical 4.0.0-internal.d28e9fb → 4.0.0-internal.fa345ef

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 (949) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/cell/rscEntry.d.ts +1 -1
  3. package/dist/cell/rscEntry.d.ts.map +1 -1
  4. package/dist/cell/rscEntry.js +5 -5
  5. package/dist/cell/rscEntry.js.map +1 -1
  6. package/dist/exports/client/Field-XH5C4HFU.js +2 -0
  7. package/dist/exports/client/Field-XH5C4HFU.js.map +7 -0
  8. package/dist/exports/client/RelationshipComponent-YCPAKOL7.js +2 -0
  9. package/dist/exports/client/RelationshipComponent-YCPAKOL7.js.map +7 -0
  10. package/dist/exports/client/bundled.css +1 -1
  11. package/dist/exports/client/chunk-5VIL27GI.js +2 -0
  12. package/dist/exports/client/chunk-5VIL27GI.js.map +7 -0
  13. package/dist/exports/client/chunk-ESITTE3C.js +2 -0
  14. package/dist/exports/client/chunk-ESITTE3C.js.map +7 -0
  15. package/dist/exports/client/{chunk-BZZVLW4U.js → chunk-RJ5MAOKZ.js} +1 -1
  16. package/dist/exports/client/chunk-RJ5MAOKZ.js.map +7 -0
  17. package/dist/exports/client/chunk-UD4DQ4AK.js +2 -0
  18. package/dist/exports/client/chunk-UD4DQ4AK.js.map +7 -0
  19. package/dist/exports/client/chunk-WSAPGI3Z.js +2 -0
  20. package/dist/exports/client/chunk-WSAPGI3Z.js.map +7 -0
  21. package/dist/exports/client/chunk-X3D4LZS7.js +2 -0
  22. package/dist/exports/client/chunk-X3D4LZS7.js.map +7 -0
  23. package/dist/exports/client/component-PHZQBOJE.js +2 -0
  24. package/dist/exports/client/component-PHZQBOJE.js.map +7 -0
  25. package/dist/exports/client/componentInline-H24N7GUG.js +2 -0
  26. package/dist/exports/client/index.d.ts +0 -1
  27. package/dist/exports/client/index.d.ts.map +1 -1
  28. package/dist/exports/client/index.js +27 -28
  29. package/dist/exports/client/index.js.map +4 -4
  30. package/dist/exports/react/index.d.ts +1 -1
  31. package/dist/exports/react/index.d.ts.map +1 -1
  32. package/dist/exports/react/index.js.map +1 -1
  33. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  34. package/dist/features/align/client/toolbarAlignGroup.js +1 -0
  35. package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
  36. package/dist/features/blockquote/client/index.js +2 -2
  37. package/dist/features/blockquote/client/index.js.map +1 -1
  38. package/dist/features/blockquote/server/index.d.ts +1 -4
  39. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  40. package/dist/features/blockquote/server/index.js +4 -41
  41. package/dist/features/blockquote/server/index.js.map +1 -1
  42. package/dist/features/blockquote/server/schema.d.ts +8 -0
  43. package/dist/features/blockquote/server/schema.d.ts.map +1 -0
  44. package/dist/features/blockquote/server/schema.js +15 -0
  45. package/dist/features/blockquote/server/schema.js.map +1 -0
  46. package/dist/features/blocks/client/component/BlockContent.d.ts +10 -0
  47. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  48. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  49. package/dist/features/blocks/client/component/index.css +178 -0
  50. package/dist/features/blocks/client/component/index.d.ts +4 -3
  51. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  52. package/dist/features/blocks/client/component/index.js +89 -24
  53. package/dist/features/blocks/client/component/index.js.map +1 -1
  54. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  55. package/dist/features/blocks/client/componentInline/index.css +85 -0
  56. package/dist/features/blocks/client/componentInline/index.d.ts +4 -3
  57. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  58. package/dist/features/blocks/client/componentInline/index.js +33 -12
  59. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  60. package/dist/features/blocks/client/index.d.ts.map +1 -1
  61. package/dist/features/blocks/client/index.js +4 -4
  62. package/dist/features/blocks/client/index.js.map +1 -1
  63. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  64. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  65. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  66. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  67. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  68. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  69. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
  70. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  71. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  72. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  73. package/dist/features/blocks/client/markdown/markdownTransformer.js +4 -4
  74. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  75. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
  76. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  77. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  78. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +2 -2
  79. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  80. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  81. package/dist/features/blocks/client/plugin/index.d.ts +1 -1
  82. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  83. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  84. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts +1 -1
  85. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
  86. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +4 -0
  87. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  88. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +26 -0
  89. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts +1 -1
  90. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts.map +1 -1
  91. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +4 -1
  92. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
  93. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +38 -0
  94. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts +1 -1
  95. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts.map +1 -1
  96. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +7 -8
  97. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
  98. package/dist/features/blocks/premade/CodeBlock/Component/index.css +171 -0
  99. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts +1 -2
  100. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  101. package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
  102. package/dist/features/blocks/server/index.d.ts +1 -0
  103. package/dist/features/blocks/server/index.d.ts.map +1 -1
  104. package/dist/features/blocks/server/index.js +24 -72
  105. package/dist/features/blocks/server/index.js.map +1 -1
  106. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  107. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  108. package/dist/features/blocks/server/markdown/markdownTransformer.js +4 -4
  109. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  110. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -18
  111. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  112. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  113. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +2 -10
  114. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  115. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  116. package/dist/features/blocks/server/schema.d.ts +45 -0
  117. package/dist/features/blocks/server/schema.d.ts.map +1 -0
  118. package/dist/features/blocks/server/schema.js +140 -0
  119. package/dist/features/blocks/server/schema.js.map +1 -0
  120. package/dist/features/blocks/server/validate.d.ts +1 -2
  121. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  122. package/dist/features/blocks/server/validate.js.map +1 -1
  123. package/dist/features/converters/htmlToLexical/index.d.ts +1 -1
  124. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  125. package/dist/features/converters/htmlToLexical/index.js.map +1 -1
  126. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts +1 -1
  127. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts.map +1 -1
  128. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.js.map +1 -1
  129. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts +1 -1
  130. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
  131. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  132. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts +1 -1
  133. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts.map +1 -1
  134. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.js.map +1 -1
  135. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts +1 -1
  136. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts.map +1 -1
  137. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.js.map +1 -1
  138. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts +1 -1
  139. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
  140. package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
  141. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts +1 -1
  142. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  143. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  144. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts +1 -1
  145. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts.map +1 -1
  146. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.js.map +1 -1
  147. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts +1 -1
  148. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts.map +1 -1
  149. package/dist/features/converters/lexicalToHtml/async/converters/tab.js.map +1 -1
  150. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts +1 -1
  151. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
  152. package/dist/features/converters/lexicalToHtml/async/converters/table.js +1 -1
  153. package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
  154. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts +1 -1
  155. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
  156. package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
  157. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts +1 -1
  158. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
  159. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  160. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts +1 -1
  161. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts.map +1 -1
  162. package/dist/features/converters/lexicalToHtml/async/defaultConverters.js.map +1 -1
  163. package/dist/features/converters/lexicalToHtml/async/types.d.ts +15 -16
  164. package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
  165. package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
  166. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  167. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  168. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts +1 -1
  169. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts.map +1 -1
  170. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.js.map +1 -1
  171. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts +1 -1
  172. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
  173. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  174. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts +1 -1
  175. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts.map +1 -1
  176. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.js.map +1 -1
  177. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts +1 -1
  178. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts.map +1 -1
  179. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.js.map +1 -1
  180. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts +1 -1
  181. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
  182. package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
  183. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts +1 -1
  184. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  185. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  186. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts +1 -1
  187. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts.map +1 -1
  188. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.js.map +1 -1
  189. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts +1 -1
  190. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts.map +1 -1
  191. package/dist/features/converters/lexicalToHtml/sync/converters/tab.js.map +1 -1
  192. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts +1 -1
  193. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
  194. package/dist/features/converters/lexicalToHtml/sync/converters/table.js +1 -1
  195. package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
  196. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts +1 -1
  197. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
  198. package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
  199. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts +1 -1
  200. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
  201. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  202. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts +1 -1
  203. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts.map +1 -1
  204. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.js.map +1 -1
  205. package/dist/features/converters/lexicalToHtml/sync/types.d.ts +15 -16
  206. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  207. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  208. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +6 -4
  209. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  210. package/dist/features/converters/lexicalToJSX/Component/index.js +5 -4
  211. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  212. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts +1 -1
  213. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts.map +1 -1
  214. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
  215. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts +1 -1
  216. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  217. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  218. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts +1 -1
  219. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts.map +1 -1
  220. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
  221. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts +1 -1
  222. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts.map +1 -1
  223. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
  224. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts +1 -1
  225. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts.map +1 -1
  226. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
  227. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts +1 -1
  228. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  229. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  230. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts +1 -1
  231. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts.map +1 -1
  232. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
  233. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts +1 -1
  234. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts.map +1 -1
  235. package/dist/features/converters/lexicalToJSX/converter/converters/tab.js.map +1 -1
  236. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts +1 -1
  237. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts.map +1 -1
  238. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
  239. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts +1 -1
  240. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts.map +1 -1
  241. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
  242. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts +1 -1
  243. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  244. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  245. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts +1 -1
  246. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts.map +1 -1
  247. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.js.map +1 -1
  248. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +1 -1
  249. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  250. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  251. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +13 -15
  252. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  253. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  254. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  255. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  256. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  257. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +1 -1
  258. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js.map +1 -1
  259. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +13 -15
  260. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
  261. package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
  262. package/dist/features/converters/markdownToLexical/index.d.ts +1 -1
  263. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  264. package/dist/features/converters/markdownToLexical/index.js +5 -2
  265. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  266. package/dist/features/debug/jsxConverter/client/plugin/index.d.ts +1 -1
  267. package/dist/features/debug/jsxConverter/client/plugin/index.d.ts.map +1 -1
  268. package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -0
  269. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  270. package/dist/features/debug/jsxConverter/client/plugin/style.css +9 -0
  271. package/dist/features/debug/testRecorder/client/plugin/index.css +51 -0
  272. package/dist/features/debug/testRecorder/client/plugin/index.d.ts +1 -1
  273. package/dist/features/debug/testRecorder/client/plugin/index.d.ts.map +1 -1
  274. package/dist/features/debug/testRecorder/client/plugin/index.js +1 -0
  275. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  276. package/dist/features/debug/treeView/client/plugin/index.css +81 -0
  277. package/dist/features/debug/treeView/client/plugin/index.d.ts +1 -1
  278. package/dist/features/debug/treeView/client/plugin/index.d.ts.map +1 -1
  279. package/dist/features/debug/treeView/client/plugin/index.js +1 -0
  280. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  281. package/dist/features/experimental_table/client/index.js +2 -2
  282. package/dist/features/experimental_table/client/index.js.map +1 -1
  283. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +91 -0
  284. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts +1 -1
  285. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  286. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +3 -2
  287. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  288. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.css +11 -0
  289. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts +1 -1
  290. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  291. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +1 -0
  292. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  293. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +1 -1
  294. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  295. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +166 -0
  296. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts +17 -0
  297. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  298. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js +219 -0
  299. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  300. package/dist/features/experimental_table/client/plugins/TablePlugin/index.css +235 -0
  301. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
  302. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  303. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +95 -104
  304. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  305. package/dist/features/experimental_table/markdownTransformer.d.ts +2 -2
  306. package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -1
  307. package/dist/features/experimental_table/markdownTransformer.js +6 -3
  308. package/dist/features/experimental_table/markdownTransformer.js.map +1 -1
  309. package/dist/features/experimental_table/server/index.d.ts +1 -6
  310. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  311. package/dist/features/experimental_table/server/index.js +6 -104
  312. package/dist/features/experimental_table/server/index.js.map +1 -1
  313. package/dist/features/experimental_table/server/schema.d.ts +27 -0
  314. package/dist/features/experimental_table/server/schema.d.ts.map +1 -0
  315. package/dist/features/experimental_table/server/schema.js +107 -0
  316. package/dist/features/experimental_table/server/schema.js.map +1 -0
  317. package/dist/features/format/bold/feature.client.js +1 -1
  318. package/dist/features/format/bold/feature.client.js.map +1 -1
  319. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  320. package/dist/features/format/bold/feature.server.js +1 -1
  321. package/dist/features/format/bold/feature.server.js.map +1 -1
  322. package/dist/features/format/inlineCode/feature.client.js +1 -1
  323. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  324. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  325. package/dist/features/format/inlineCode/feature.server.js +1 -1
  326. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  327. package/dist/features/format/italic/feature.client.js +1 -1
  328. package/dist/features/format/italic/feature.client.js.map +1 -1
  329. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  330. package/dist/features/format/italic/feature.server.js +1 -1
  331. package/dist/features/format/italic/feature.server.js.map +1 -1
  332. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  333. package/dist/features/format/strikethrough/feature.client.js +1 -1
  334. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  335. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  336. package/dist/features/format/strikethrough/feature.server.js +1 -1
  337. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  338. package/dist/features/heading/client/index.js +2 -2
  339. package/dist/features/heading/client/index.js.map +1 -1
  340. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  341. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  342. package/dist/features/heading/markdownTransformer.js +6 -19
  343. package/dist/features/heading/markdownTransformer.js.map +1 -1
  344. package/dist/features/heading/server/index.d.ts +2 -4
  345. package/dist/features/heading/server/index.d.ts.map +1 -1
  346. package/dist/features/heading/server/index.js +4 -41
  347. package/dist/features/heading/server/index.js.map +1 -1
  348. package/dist/features/heading/server/schema.d.ts +10 -0
  349. package/dist/features/heading/server/schema.d.ts.map +1 -0
  350. package/dist/features/heading/server/schema.js +37 -0
  351. package/dist/features/heading/server/schema.js.map +1 -0
  352. package/dist/features/horizontalRule/client/index.js +2 -2
  353. package/dist/features/horizontalRule/client/index.js.map +1 -1
  354. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  355. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  356. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  357. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  358. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
  359. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  360. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  361. package/dist/features/horizontalRule/client/plugin/index.css +25 -0
  362. package/dist/features/horizontalRule/client/plugin/index.d.ts +1 -1
  363. package/dist/features/horizontalRule/client/plugin/index.d.ts.map +1 -1
  364. package/dist/features/horizontalRule/client/plugin/index.js +73 -4
  365. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  366. package/dist/features/horizontalRule/server/index.d.ts +1 -0
  367. package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
  368. package/dist/features/horizontalRule/server/index.js +4 -10
  369. package/dist/features/horizontalRule/server/index.js.map +1 -1
  370. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  371. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  372. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  373. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  374. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -5
  375. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  376. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  377. package/dist/features/horizontalRule/server/schema.d.ts +7 -0
  378. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -0
  379. package/dist/features/horizontalRule/server/schema.js +25 -0
  380. package/dist/features/horizontalRule/server/schema.js.map +1 -0
  381. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  382. package/dist/features/link/client/index.d.ts.map +1 -1
  383. package/dist/features/link/client/index.js +2 -2
  384. package/dist/features/link/client/index.js.map +1 -1
  385. package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
  386. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  387. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  388. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  389. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +28 -8
  390. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  391. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +108 -0
  392. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts +1 -1
  393. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  394. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -0
  395. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  396. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts +1 -1
  397. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts.map +1 -1
  398. package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
  399. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  400. package/dist/features/link/markdownTransformer.d.ts +5 -5
  401. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  402. package/dist/features/link/markdownTransformer.js +2 -2
  403. package/dist/features/link/markdownTransformer.js.map +1 -1
  404. package/dist/features/link/markdownTransformer.spec.js +10 -10
  405. package/dist/features/link/markdownTransformer.spec.js.map +1 -1
  406. package/dist/features/link/nodes/AutoLinkNode.d.ts +3 -3
  407. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  408. package/dist/features/link/nodes/AutoLinkNode.js +2 -1
  409. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  410. package/dist/features/link/nodes/LinkNode.d.ts +3 -3
  411. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  412. package/dist/features/link/nodes/LinkNode.js +2 -1
  413. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  414. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  415. package/dist/features/link/server/baseFields.js.map +1 -1
  416. package/dist/features/link/server/graphQLPopulationPromise.d.ts +1 -1
  417. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  418. package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
  419. package/dist/features/link/server/index.d.ts +2 -1
  420. package/dist/features/link/server/index.d.ts.map +1 -1
  421. package/dist/features/link/server/index.js +5 -73
  422. package/dist/features/link/server/index.js.map +1 -1
  423. package/dist/features/link/server/schema.d.ts +32 -0
  424. package/dist/features/link/server/schema.d.ts.map +1 -0
  425. package/dist/features/link/server/schema.js +171 -0
  426. package/dist/features/link/server/schema.js.map +1 -0
  427. package/dist/features/link/server/validate.d.ts +1 -1
  428. package/dist/features/link/server/validate.d.ts.map +1 -1
  429. package/dist/features/link/server/validate.js.map +1 -1
  430. package/dist/features/lists/checklist/client/index.js +1 -1
  431. package/dist/features/lists/checklist/client/index.js.map +1 -1
  432. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  433. package/dist/features/lists/checklist/server/index.js +4 -8
  434. package/dist/features/lists/checklist/server/index.js.map +1 -1
  435. package/dist/features/lists/orderedList/client/index.js +1 -1
  436. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  437. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  438. package/dist/features/lists/orderedList/server/index.js +4 -8
  439. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  440. package/dist/features/lists/plugin/index.d.ts +0 -9
  441. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  442. package/dist/features/lists/plugin/index.js.map +1 -1
  443. package/dist/features/lists/shared/schema.d.ts +18 -0
  444. package/dist/features/lists/shared/schema.d.ts.map +1 -0
  445. package/dist/features/lists/shared/schema.js +62 -0
  446. package/dist/features/lists/shared/schema.js.map +1 -0
  447. package/dist/features/lists/unorderedList/client/index.js +1 -1
  448. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  449. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  450. package/dist/features/lists/unorderedList/server/index.js +4 -8
  451. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  452. package/dist/features/relationship/client/components/RelationshipComponent.d.ts +2 -2
  453. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  454. package/dist/features/relationship/client/components/RelationshipComponent.js +29 -4
  455. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  456. package/dist/features/relationship/client/components/index.css +112 -0
  457. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  458. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
  459. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  460. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  461. package/dist/features/relationship/client/plugins/index.d.ts +1 -1
  462. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  463. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  464. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  465. package/dist/features/relationship/client/utils/useEnabledRelationships.js +9 -40
  466. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  467. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +1 -1
  468. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  469. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  470. package/dist/features/relationship/server/index.d.ts +1 -0
  471. package/dist/features/relationship/server/index.d.ts.map +1 -1
  472. package/dist/features/relationship/server/index.js +2 -0
  473. package/dist/features/relationship/server/index.js.map +1 -1
  474. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -10
  475. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  476. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  477. package/dist/features/relationship/server/schema.d.ts +28 -0
  478. package/dist/features/relationship/server/schema.d.ts.map +1 -0
  479. package/dist/features/relationship/server/schema.js +97 -0
  480. package/dist/features/relationship/server/schema.js.map +1 -0
  481. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +23 -0
  482. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -0
  483. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +34 -0
  484. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -0
  485. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  486. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  487. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  488. package/dist/features/textState/feature.client.js +1 -1
  489. package/dist/features/textState/feature.client.js.map +1 -1
  490. package/dist/features/toolbars/fixed/client/Toolbar/index.css +87 -0
  491. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts +1 -1
  492. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  493. package/dist/features/toolbars/fixed/client/Toolbar/index.js +1 -0
  494. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  495. package/dist/features/toolbars/inline/client/Toolbar/index.css +32 -0
  496. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts +1 -1
  497. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  498. package/dist/features/toolbars/inline/client/Toolbar/index.js +1 -0
  499. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  500. package/dist/features/toolbars/shared/ToolbarButton/index.css +57 -0
  501. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  502. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  503. package/dist/features/toolbars/shared/ToolbarButton/index.js +80 -74
  504. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  505. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  506. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +5 -2
  507. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  508. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +210 -0
  509. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  510. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  511. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +11 -7
  512. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  513. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  514. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  515. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  516. package/dist/features/toolbars/types.d.ts +5 -1
  517. package/dist/features/toolbars/types.d.ts.map +1 -1
  518. package/dist/features/toolbars/types.js.map +1 -1
  519. package/dist/features/typesClient.d.ts +2 -2
  520. package/dist/features/typesClient.d.ts.map +1 -1
  521. package/dist/features/typesClient.js.map +1 -1
  522. package/dist/features/typesServer.d.ts +19 -59
  523. package/dist/features/typesServer.d.ts.map +1 -1
  524. package/dist/features/typesServer.js.map +1 -1
  525. package/dist/features/upload/client/component/index.css +214 -0
  526. package/dist/features/upload/client/component/index.d.ts +2 -2
  527. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  528. package/dist/features/upload/client/component/index.js +86 -63
  529. package/dist/features/upload/client/component/index.js.map +1 -1
  530. package/dist/features/upload/client/component/pending/index.d.ts +0 -1
  531. package/dist/features/upload/client/component/pending/index.d.ts.map +1 -1
  532. package/dist/features/upload/client/component/pending/index.js.map +1 -1
  533. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  534. package/dist/features/upload/client/nodes/UploadNode.d.ts +1 -1
  535. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  536. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  537. package/dist/features/upload/client/plugin/index.d.ts +1 -1
  538. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  539. package/dist/features/upload/client/plugin/index.js +5 -5
  540. package/dist/features/upload/client/plugin/index.js.map +1 -1
  541. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +1 -1
  542. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  543. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  544. package/dist/features/upload/server/index.d.ts +1 -0
  545. package/dist/features/upload/server/index.d.ts.map +1 -1
  546. package/dist/features/upload/server/index.js +5 -82
  547. package/dist/features/upload/server/index.js.map +1 -1
  548. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  549. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  550. package/dist/features/upload/server/markdownTransformer.js +1 -1
  551. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  552. package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -55
  553. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  554. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  555. package/dist/features/upload/server/nodes/conversions.d.ts.map +1 -1
  556. package/dist/features/upload/server/nodes/conversions.js.map +1 -1
  557. package/dist/features/upload/server/schema.d.ts +52 -0
  558. package/dist/features/upload/server/schema.d.ts.map +1 -0
  559. package/dist/features/upload/server/schema.js +149 -0
  560. package/dist/features/upload/server/schema.js.map +1 -0
  561. package/dist/features/upload/server/validate.d.ts +1 -1
  562. package/dist/features/upload/server/validate.d.ts.map +1 -1
  563. package/dist/features/upload/server/validate.js.map +1 -1
  564. package/dist/field/Diff/converters/link.d.ts +1 -1
  565. package/dist/field/Diff/converters/link.d.ts.map +1 -1
  566. package/dist/field/Diff/converters/link.js.map +1 -1
  567. package/dist/field/Diff/converters/listitem/index.css +80 -0
  568. package/dist/field/Diff/converters/listitem/index.d.ts +2 -2
  569. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  570. package/dist/field/Diff/converters/listitem/index.js +1 -0
  571. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  572. package/dist/field/Diff/converters/relationship/index.css +108 -0
  573. package/dist/field/Diff/converters/relationship/index.d.ts +2 -2
  574. package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
  575. package/dist/field/Diff/converters/relationship/index.js +11 -28
  576. package/dist/field/Diff/converters/relationship/index.js.map +1 -1
  577. package/dist/field/Diff/converters/unknown/index.css +37 -0
  578. package/dist/field/Diff/converters/unknown/index.d.ts +1 -1
  579. package/dist/field/Diff/converters/unknown/index.d.ts.map +1 -1
  580. package/dist/field/Diff/converters/unknown/index.js +1 -0
  581. package/dist/field/Diff/converters/unknown/index.js.map +1 -1
  582. package/dist/field/Diff/converters/upload/index.css +175 -0
  583. package/dist/field/Diff/converters/upload/index.d.ts +2 -2
  584. package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
  585. package/dist/field/Diff/converters/upload/index.js +7 -2
  586. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  587. package/dist/field/Diff/index.css +156 -0
  588. package/dist/field/Diff/index.d.ts +1 -1
  589. package/dist/field/Diff/index.d.ts.map +1 -1
  590. package/dist/field/Diff/index.js +1 -0
  591. package/dist/field/Diff/index.js.map +1 -1
  592. package/dist/field/Field.d.ts +3 -3
  593. package/dist/field/Field.d.ts.map +1 -1
  594. package/dist/field/Field.js +13 -12
  595. package/dist/field/Field.js.map +1 -1
  596. package/dist/field/RenderLexical/index.d.ts +2 -2
  597. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  598. package/dist/field/RenderLexical/index.js.map +1 -1
  599. package/dist/field/RichTextViewProvider.d.ts +1 -1
  600. package/dist/field/RichTextViewProvider.d.ts.map +1 -1
  601. package/dist/field/RichTextViewProvider.js.map +1 -1
  602. package/dist/field/ViewSelector.css +32 -0
  603. package/dist/field/ViewSelector.d.ts +1 -1
  604. package/dist/field/ViewSelector.d.ts.map +1 -1
  605. package/dist/field/ViewSelector.js +1 -0
  606. package/dist/field/ViewSelector.js.map +1 -1
  607. package/dist/field/bundled.css +1 -1
  608. package/dist/field/index.css +60 -0
  609. package/dist/field/index.d.ts +1 -1
  610. package/dist/field/index.d.ts.map +1 -1
  611. package/dist/field/index.js +1 -1
  612. package/dist/field/index.js.map +1 -1
  613. package/dist/field/rscEntry.d.ts +1 -1
  614. package/dist/field/rscEntry.d.ts.map +1 -1
  615. package/dist/field/rscEntry.js +2 -0
  616. package/dist/field/rscEntry.js.map +1 -1
  617. package/dist/hooks.d.ts +6 -0
  618. package/dist/hooks.d.ts.map +1 -0
  619. package/dist/hooks.js +548 -0
  620. package/dist/hooks.js.map +1 -0
  621. package/dist/index.d.ts +13 -19
  622. package/dist/index.d.ts.map +1 -1
  623. package/dist/index.js +12 -629
  624. package/dist/index.js.map +1 -1
  625. package/dist/lexical/LexicalEditor.css +50 -0
  626. package/dist/lexical/LexicalEditor.d.ts +1 -1
  627. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  628. package/dist/lexical/LexicalEditor.js +1 -0
  629. package/dist/lexical/LexicalEditor.js.map +1 -1
  630. package/dist/lexical/LexicalProvider.d.ts +1 -1
  631. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  632. package/dist/lexical/LexicalProvider.js.map +1 -1
  633. package/dist/lexical/config/client/EditorConfigProvider.d.ts +1 -1
  634. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  635. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  636. package/dist/lexical/config/client/loader.d.ts +1 -1
  637. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  638. package/dist/lexical/config/client/loader.js +5 -1
  639. package/dist/lexical/config/client/loader.js.map +1 -1
  640. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  641. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  642. package/dist/lexical/config/client/sanitize.js.map +1 -1
  643. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  644. package/dist/lexical/config/server/sanitize.js +9 -17
  645. package/dist/lexical/config/server/sanitize.js.map +1 -1
  646. package/dist/lexical/config/types.d.ts +1 -1
  647. package/dist/lexical/config/types.d.ts.map +1 -1
  648. package/dist/lexical/config/types.js.map +1 -1
  649. package/dist/lexical/nodes/index.d.ts +1 -1
  650. package/dist/lexical/nodes/index.d.ts.map +1 -1
  651. package/dist/lexical/nodes/index.js.map +1 -1
  652. package/dist/lexical/plugins/DecoratorPlugin/index.css +11 -0
  653. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts +1 -1
  654. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  655. package/dist/lexical/plugins/DecoratorPlugin/index.js +1 -0
  656. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  657. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +52 -0
  658. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts +1 -1
  659. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  660. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +1 -0
  661. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  662. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  663. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  664. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  665. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +1 -1
  666. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  667. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  668. package/dist/lexical/plugins/SlashMenu/index.css +61 -0
  669. package/dist/lexical/plugins/SlashMenu/index.d.ts +1 -1
  670. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  671. package/dist/lexical/plugins/SlashMenu/index.js +2 -0
  672. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  673. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +40 -0
  674. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +1 -1
  675. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  676. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +1 -0
  677. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  678. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  679. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +84 -0
  680. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +1 -1
  681. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  682. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -9
  683. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  684. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +1 -1
  685. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  686. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  687. package/dist/lexical/theme/EditorTheme.css +358 -0
  688. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  689. package/dist/lexical/theme/EditorTheme.js +1 -0
  690. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  691. package/dist/lexical/ui/ContentEditable.css +95 -0
  692. package/dist/lexical/ui/ContentEditable.d.ts +1 -1
  693. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  694. package/dist/lexical/ui/ContentEditable.js +1 -0
  695. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  696. package/dist/lexical/ui/icons/Code/index.js +1 -1
  697. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  698. package/dist/lexical/ui/icons/CodeBlock/index.js +1 -1
  699. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  700. package/dist/lexical/ui/icons/Link/index.js +1 -1
  701. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  702. package/dist/lexical/ui/icons/Page/index.d.ts +5 -0
  703. package/dist/lexical/ui/icons/Page/index.d.ts.map +1 -0
  704. package/dist/lexical/ui/icons/Page/index.js +21 -0
  705. package/dist/lexical/ui/icons/Page/index.js.map +1 -0
  706. package/dist/lexical/ui/icons/Trash/index.d.ts +10 -0
  707. package/dist/lexical/ui/icons/Trash/index.d.ts.map +1 -0
  708. package/dist/lexical/ui/icons/Trash/index.js +29 -0
  709. package/dist/lexical/ui/icons/Trash/index.js.map +1 -0
  710. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  711. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  712. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  713. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  714. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +88 -0
  715. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +1 -0
  716. package/dist/lexical/utils/markdown/createBlockNode.d.ts +1 -1
  717. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  718. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  719. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  720. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  721. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  722. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  723. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  724. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  725. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  726. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  727. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
  728. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  729. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  730. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  731. package/dist/types/builtInNodes.d.ts +14 -0
  732. package/dist/types/builtInNodes.d.ts.map +1 -0
  733. package/dist/types/builtInNodes.js +203 -0
  734. package/dist/types/builtInNodes.js.map +1 -0
  735. package/dist/{types.d.ts → types/index.d.ts} +25 -26
  736. package/dist/types/index.d.ts.map +1 -0
  737. package/dist/types/index.js +2 -0
  738. package/dist/types/index.js.map +1 -0
  739. package/dist/types/jsonSchemaHelpers.d.ts +30 -0
  740. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -0
  741. package/dist/types/jsonSchemaHelpers.js +58 -0
  742. package/dist/types/jsonSchemaHelpers.js.map +1 -0
  743. package/dist/types/nodeTypes.d.ts +128 -0
  744. package/dist/types/nodeTypes.d.ts.map +1 -0
  745. package/dist/types/nodeTypes.js +6 -0
  746. package/dist/types/nodeTypes.js.map +1 -0
  747. package/dist/types/schema.d.ts +6 -0
  748. package/dist/types/schema.d.ts.map +1 -0
  749. package/dist/types/schema.js +90 -0
  750. package/dist/types/schema.js.map +1 -0
  751. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  752. package/dist/utilities/applyBaseFilterToFields.js +1 -2
  753. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  754. package/dist/utilities/buildEditorState.d.ts +18 -4
  755. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  756. package/dist/utilities/buildEditorState.js +8 -0
  757. package/dist/utilities/buildEditorState.js.map +1 -1
  758. package/dist/utilities/buildInitialState.d.ts +2 -1
  759. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  760. package/dist/utilities/buildInitialState.js.map +1 -1
  761. package/dist/utilities/createClientFeature.d.ts +1 -1
  762. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  763. package/dist/utilities/createClientFeature.js.map +1 -1
  764. package/dist/utilities/editorConfigFactory.d.ts +1 -1
  765. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  766. package/dist/utilities/editorConfigFactory.js.map +1 -1
  767. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
  768. package/dist/utilities/fieldsDrawer/Drawer.js +19 -10
  769. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  770. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -1
  771. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  772. package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -7
  773. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  774. package/dist/utilities/fieldsDrawer/index.css +12 -0
  775. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +29 -0
  776. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -0
  777. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js +97 -0
  778. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -0
  779. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +1 -0
  780. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  781. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +34 -18
  782. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  783. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  784. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  785. package/dist/utilities/generateImportMap.d.ts +1 -1
  786. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  787. package/dist/utilities/generateImportMap.js.map +1 -1
  788. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  789. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  790. package/dist/utilities/initLexicalFeatures.d.ts +1 -1
  791. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  792. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  793. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  794. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  795. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +1 -1
  796. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  797. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  798. package/dist/validate/index.d.ts.map +1 -1
  799. package/package.json +27 -31
  800. package/dist/exports/client/Field-NXLXFFLW.js +0 -2
  801. package/dist/exports/client/Field-NXLXFFLW.js.map +0 -7
  802. package/dist/exports/client/RelationshipComponent-BG3DPV3T.js +0 -2
  803. package/dist/exports/client/RelationshipComponent-BG3DPV3T.js.map +0 -7
  804. package/dist/exports/client/chunk-BZZVLW4U.js.map +0 -7
  805. package/dist/exports/client/chunk-DZDHVMML.js +0 -2
  806. package/dist/exports/client/chunk-DZDHVMML.js.map +0 -7
  807. package/dist/exports/client/chunk-F26IQ5RE.js +0 -2
  808. package/dist/exports/client/chunk-F26IQ5RE.js.map +0 -7
  809. package/dist/exports/client/chunk-FTT5KJ6W.js +0 -12
  810. package/dist/exports/client/chunk-FTT5KJ6W.js.map +0 -7
  811. package/dist/exports/client/chunk-INBEEENE.js +0 -2
  812. package/dist/exports/client/chunk-INBEEENE.js.map +0 -7
  813. package/dist/exports/client/chunk-QJ5EETIB.js +0 -2
  814. package/dist/exports/client/chunk-QJ5EETIB.js.map +0 -7
  815. package/dist/exports/client/component-XIHC3W6W.js +0 -2
  816. package/dist/exports/client/component-XIHC3W6W.js.map +0 -7
  817. package/dist/exports/client/componentInline-LCHKRXOV.js +0 -2
  818. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  819. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  820. package/dist/features/blockquote/markdownTransformer.js +0 -33
  821. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  822. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts +0 -4
  823. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts.map +0 -1
  824. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js +0 -7
  825. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js.map +0 -1
  826. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts +0 -4
  827. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts.map +0 -1
  828. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js +0 -38
  829. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js.map +0 -1
  830. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts +0 -4
  831. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts.map +0 -1
  832. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js +0 -9
  833. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js.map +0 -1
  834. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts +0 -4
  835. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts.map +0 -1
  836. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js +0 -33
  837. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js.map +0 -1
  838. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts +0 -6
  839. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts.map +0 -1
  840. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js +0 -9
  841. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js.map +0 -1
  842. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts +0 -70
  843. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts.map +0 -1
  844. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js +0 -104
  845. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js.map +0 -1
  846. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts +0 -27
  847. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts.map +0 -1
  848. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js +0 -2
  849. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js.map +0 -1
  850. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts +0 -39
  851. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts.map +0 -1
  852. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js +0 -122
  853. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js.map +0 -1
  854. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts +0 -12
  855. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts.map +0 -1
  856. package/dist/features/converters/lexicalToHtml_deprecated/index.js +0 -11
  857. package/dist/features/converters/lexicalToHtml_deprecated/index.js.map +0 -1
  858. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  859. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  860. package/dist/features/format/bold/markdownTransformers.js +0 -23
  861. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  862. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  863. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  864. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  865. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  866. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  867. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  868. package/dist/features/format/italic/markdownTransformers.js +0 -12
  869. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  870. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  871. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  872. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  873. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  874. package/dist/features/link/nodes/types.d.ts +0 -27
  875. package/dist/features/link/nodes/types.d.ts.map +0 -1
  876. package/dist/features/link/nodes/types.js +0 -2
  877. package/dist/features/link/nodes/types.js.map +0 -1
  878. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  879. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  880. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  881. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  882. package/dist/features/lists/htmlConverter.d.ts +0 -5
  883. package/dist/features/lists/htmlConverter.d.ts.map +0 -1
  884. package/dist/features/lists/htmlConverter.js +0 -81
  885. package/dist/features/lists/htmlConverter.js.map +0 -1
  886. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  887. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  888. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  889. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  890. package/dist/features/lists/shared/markdown.d.ts +0 -6
  891. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  892. package/dist/features/lists/shared/markdown.js +0 -57
  893. package/dist/features/lists/shared/markdown.js.map +0 -1
  894. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  895. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  896. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  897. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  898. package/dist/lexical/utils/guard.d.ts +0 -5
  899. package/dist/lexical/utils/guard.d.ts.map +0 -1
  900. package/dist/lexical/utils/guard.js +0 -9
  901. package/dist/lexical/utils/guard.js.map +0 -1
  902. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  903. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  904. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  905. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  906. package/dist/nodeTypes.d.ts +0 -74
  907. package/dist/nodeTypes.d.ts.map +0 -1
  908. package/dist/nodeTypes.js +0 -5
  909. package/dist/nodeTypes.js.map +0 -1
  910. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  911. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  912. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -213
  913. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  914. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  915. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  916. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -198
  917. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  918. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  919. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  920. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  921. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  922. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -147
  923. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  924. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -268
  925. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  926. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  927. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  928. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  929. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  930. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  931. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  932. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  933. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  934. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  935. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  936. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  937. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  938. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  939. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  940. package/dist/packages/@lexical/markdown/index.js +0 -39
  941. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  942. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  943. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  944. package/dist/packages/@lexical/markdown/utils.js +0 -267
  945. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
  946. package/dist/types.d.ts.map +0 -1
  947. package/dist/types.js +0 -2
  948. package/dist/types.js.map +0 -1
  949. /package/dist/exports/client/{componentInline-LCHKRXOV.js.map → componentInline-H24N7GUG.js.map} +0 -0
@@ -1,16 +1,19 @@
1
1
  'use client';
2
2
 
3
- import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
3
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
5
5
  import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
6
6
  import { getTranslation } from '@payloadcms/translations';
7
- import { Button, Drawer, EditDepthProvider, Form, formatDrawerSlug, FormSubmit, RenderFields, ShimmerEffect, useConfig, useDocumentForm, useDocumentInfo, useEditDepth, useServerFunctions, useTranslation } from '@payloadcms/ui';
7
+ import { Button, Drawer, EditDepthProvider, Form, formatDrawerSlug, RenderFields, ShimmerEffect, useConfig, useDocumentForm, useDocumentInfo, useEditDepth, useServerFunctions, useTranslation } from '@payloadcms/ui';
8
8
  import { abortAndIgnore } from '@payloadcms/ui/shared';
9
9
  import { $getNodeByKey, SKIP_DOM_SELECTION_TAG } from 'lexical';
10
+ import './index.css';
11
+ import '../../../../utilities/fieldsDrawer/index.css';
10
12
  import { deepCopyObjectSimpleWithoutReactComponents, reduceFieldsToValues } from 'payload/shared';
11
13
  import React, { createContext, useCallback, useEffect, useMemo, useRef } from 'react';
12
14
  import { v4 as uuid } from 'uuid';
13
15
  import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
16
+ import { RegisterFormSubmit, useDrawerSubmit } from '../../../../utilities/fieldsDrawer/useDrawerSubmit.js';
14
17
  import { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js';
15
18
  import { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js';
16
19
  const InlineBlockComponentContext = /*#__PURE__*/createContext({
@@ -141,7 +144,8 @@ export const InlineBlockComponent = props => {
141
144
  const componentMapRenderedBlockPath = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks.${formData.blockType}`;
142
145
  const clientSchemaMap = featureClientSchemaMap['blocks'];
143
146
  const blocksField = clientSchemaMap?.[componentMapRenderedBlockPath]?.[0];
144
- const clientBlock = blocksField.blockReferences ? typeof blocksField?.blockReferences?.[0] === 'string' ? config.blocksMap[blocksField?.blockReferences?.[0]] : blocksField?.blockReferences?.[0] : blocksField?.blocks?.[0];
147
+ const blockOrSlug = blocksField?.blocks?.[0];
148
+ const clientBlock = typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug;
145
149
  const clientBlockFields = clientBlock?.fields ?? [];
146
150
  // Open drawer on "mount"
147
151
  useEffect(() => {
@@ -303,13 +307,18 @@ export const InlineBlockComponent = props => {
303
307
  tag: SKIP_DOM_SELECTION_TAG
304
308
  });
305
309
  }, [editor, nodeKey, formData]);
310
+ const {
311
+ headerActions,
312
+ submitRef
313
+ } = useDrawerSubmit();
306
314
  const RemoveButton = useMemo(() => () => /*#__PURE__*/_jsx(Button, {
307
- buttonStyle: "icon-label",
315
+ buttonStyle: "ghost",
308
316
  className: `${baseClass}__removeButton`,
309
317
  disabled: !isEditable,
310
318
  icon: "x",
311
319
  onClick: e => {
312
320
  e.preventDefault();
321
+ e.stopPropagation();
313
322
  removeInlineBlock();
314
323
  },
315
324
  round: true,
@@ -319,7 +328,7 @@ export const InlineBlockComponent = props => {
319
328
  })
320
329
  }), [baseClass, blockDisplayName, isEditable, removeInlineBlock, t]);
321
330
  const EditButton = useMemo(() => () => /*#__PURE__*/_jsx(Button, {
322
- buttonStyle: "icon-label",
331
+ buttonStyle: "ghost",
323
332
  className: `${baseClass}__editButton`,
324
333
  disabled: !isEditable,
325
334
  el: "button",
@@ -338,9 +347,20 @@ export const InlineBlockComponent = props => {
338
347
  className
339
348
  }) => /*#__PURE__*/_jsx("div", {
340
349
  className: [`${baseClass}__container`, baseClass + '-' + formData.blockType, className].filter(Boolean).join(' '),
350
+ ...(isEditable ? {
351
+ onClick: () => toggleDrawer(),
352
+ onKeyDown: e_0 => {
353
+ if (e_0.key === 'Enter' || e_0.key === ' ') {
354
+ e_0.preventDefault();
355
+ toggleDrawer();
356
+ }
357
+ },
358
+ role: 'button',
359
+ tabIndex: 0
360
+ } : {}),
341
361
  ref: inlineBlockElemElemRef,
342
362
  children: children
343
- }), [baseClass, formData.blockType]);
363
+ }), [baseClass, formData.blockType, isEditable, toggleDrawer]);
344
364
  const Label = useMemo(() => {
345
365
  if (resolvedCustomLabel) {
346
366
  return () => resolvedCustomLabel;
@@ -384,11 +404,13 @@ export const InlineBlockComponent = props => {
384
404
  children: [/*#__PURE__*/_jsx(EditDepthProvider, {
385
405
  children: /*#__PURE__*/_jsx(Drawer, {
386
406
  className: '',
407
+ headerActions: headerActions,
387
408
  slug: drawerSlug,
388
409
  title: t(`lexical:blocks:inlineBlocks:${formData?.id ? 'edit' : 'create'}`, {
389
410
  label: blockDisplayName ?? t('lexical:blocks:inlineBlocks:label')
390
411
  }),
391
- children: initialState ? /*#__PURE__*/_jsxs(_Fragment, {
412
+ children: initialState ? /*#__PURE__*/_jsxs("div", {
413
+ className: "fields-drawer",
392
414
  children: [/*#__PURE__*/_jsx(RenderFields, {
393
415
  fields: clientBlock?.fields,
394
416
  forceRender: true,
@@ -397,9 +419,8 @@ export const InlineBlockComponent = props => {
397
419
  parentSchemaPath: schemaFieldsPath,
398
420
  permissions: true,
399
421
  readOnly: !isEditable
400
- }), /*#__PURE__*/_jsx(FormSubmit, {
401
- programmaticSubmit: true,
402
- children: t('fields:saveChanges')
422
+ }), /*#__PURE__*/_jsx(RegisterFormSubmit, {
423
+ submitRef: submitRef
403
424
  })]
404
425
  }) : null
405
426
  })
@@ -417,9 +438,9 @@ export const InlineBlockComponent = props => {
417
438
  children: [initialState ? /*#__PURE__*/_jsx(Label, {}) : /*#__PURE__*/_jsx(ShimmerEffect, {
418
439
  height: "15px",
419
440
  width: "40px"
420
- }), isEditable ? /*#__PURE__*/_jsxs("div", {
441
+ }), isEditable ? /*#__PURE__*/_jsx("div", {
421
442
  className: `${baseClass}__actions`,
422
- children: [/*#__PURE__*/_jsx(EditButton, {}), /*#__PURE__*/_jsx(RemoveButton, {})]
443
+ children: /*#__PURE__*/_jsx(RemoveButton, {})
423
444
  }) : null]
424
445
  })]
425
446
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","Drawer","EditDepthProvider","Form","formatDrawerSlug","FormSubmit","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","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","clientBlock","blockReferences","blocksMap","blocks","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","RemoveButton","buttonStyle","disabled","icon","onClick","e","preventDefault","round","size","tooltip","label","EditButton","el","InlineBlockContainer","children","filter","Boolean","join","ref","Label","_jsxs","beforeSubmit","disableValidationOnSubmit","onSubmit","title","_Fragment","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","programmaticSubmit","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 FormSubmit,\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.scss'\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.js'\nimport type { InlineBlockFields } from '../../server/nodes/InlineBlocksNode.js'\nimport type { BlockComponentProps } from '../component/index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.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 = clientSchemaMap?.[\n componentMapRenderedBlockPath\n ]?.[0] as BlocksFieldClient\n\n const clientBlock: ClientBlock | undefined = blocksField.blockReferences\n ? typeof blocksField?.blockReferences?.[0] === 'string'\n ? config.blocksMap[blocksField?.blockReferences?.[0]]\n : blocksField?.blockReferences?.[0]\n : blocksField?.blocks?.[0]\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 RemoveButton = useMemo(\n () => () => (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\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=\"icon-label\"\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 ref={inlineBlockElemElemRef}\n >\n {children}\n </div>\n ),\n [baseClass, formData.blockType],\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 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 <>\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 <FormSubmit programmaticSubmit={true}>{t('fields:saveChanges')}</FormSubmit>\n </>\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 <EditButton />\n <RemoveButton />\n </div>\n ) : null}\n </InlineBlockContainer>\n )}\n </Form>\n )\n}\n"],"mappings":"AAAA;;;A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AWhF,IAAA,CAAC9E,aAAA;QAAc2K,MAAA,EAAO;QAAOC,KAAA,EAAM;UAC9DrI,UAAA,gBACCwH,KAAA,CAAC;QAAIjI,SAAA,EAAW,GAAGC,SAAA,WAAoB;gCACrC+C,IAAA,CAACwE,UAAA,O,aACDxE,IAAA,CAAC6D,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","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,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,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 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/client/index.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,mBAAmB,8EA2L/B,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/blocks/client/index.tsx"],"names":[],"mappings":"AAsBA,eAAO,MAAM,mBAAmB,8EAmL/B,CAAA"}
@@ -25,10 +25,12 @@ export const BlocksFeatureClient = createClientFeature(({
25
25
  const blocksFields = Object.entries(clientSchema).filter(([key]) => key.startsWith(schemaMapRenderedBlockPathPrefix + '.') && !key.replace(schemaMapRenderedBlockPathPrefix + '.', '').includes('.')).map(([, value]) => value[0]);
26
26
  const inlineBlocksFields = Object.entries(clientSchema).filter(([key]) => key.startsWith(schemaMapRenderedInlineBlockPathPrefix + '.') && !key.replace(schemaMapRenderedInlineBlockPathPrefix + '.', '').includes('.')).map(([, value]) => value[0]);
27
27
  const clientBlocks = blocksFields.map(field => {
28
- return field.blockReferences ? typeof field.blockReferences[0] === 'string' ? config.blocksMap[field.blockReferences[0]] : field.blockReferences[0] : field.blocks[0];
28
+ const blockOrSlug = field.blocks[0];
29
+ return typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug;
29
30
  }).filter(block => block !== undefined);
30
31
  const clientInlineBlocks = inlineBlocksFields.map(field => {
31
- return field.blockReferences ? typeof field.blockReferences[0] === 'string' ? config.blocksMap[field.blockReferences[0]] : field.blockReferences[0] : field.blocks[0];
32
+ const blockOrSlug = field.blocks[0];
33
+ return typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug;
32
34
  }).filter(block => block !== undefined);
33
35
  return {
34
36
  markdownTransformers: getBlockMarkdownTransformers({
@@ -106,7 +108,6 @@ export const BlocksFeatureClient = createClientFeature(({
106
108
  ChildComponent: BlockIcon,
107
109
  items: clientBlocks.map((block, index) => {
108
110
  return {
109
- ChildComponent: getBlockImageComponent(block, BlockIcon),
110
111
  isActive: undefined,
111
112
  key: 'block-' + block.slug,
112
113
  label: ({
@@ -133,7 +134,6 @@ export const BlocksFeatureClient = createClientFeature(({
133
134
  ChildComponent: InlineBlocksIcon,
134
135
  items: clientInlineBlocks.map((inlineBlock, index) => {
135
136
  return {
136
- ChildComponent: getBlockImageComponent(inlineBlock, InlineBlocksIcon),
137
137
  isActive: undefined,
138
138
  key: 'inlineBlock-' + inlineBlock.slug,
139
139
  label: ({
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["getTranslation","BlockIcon","InlineBlocksIcon","createClientFeature","getBlockImageComponent","getBlockMarkdownTransformers","BlockNode","InlineBlockNode","INSERT_BLOCK_COMMAND","INSERT_INLINE_BLOCK_COMMAND","BlocksPlugin","BlocksFeatureClient","config","featureClientSchemaMap","props","schemaPath","schemaMapRenderedBlockPathPrefix","schemaMapRenderedInlineBlockPathPrefix","clientSchema","blocksFields","Object","entries","filter","key","startsWith","replace","includes","map","value","inlineBlocksFields","clientBlocks","field","blockReferences","blocksMap","blocks","block","undefined","clientInlineBlocks","markdownTransformers","inlineBlocks","nodes","plugins","Component","position","sanitizedClientFeatureProps","slashMenu","groups","length","items","Icon","slug","keywords","label","i18n","blockDisplayName","labels","singular","onSelect","editor","dispatchCommand","blockName","blockType","t","inlineBlock","Boolean","toolbarFixed","type","ChildComponent","index","isActive","order"],"sources":["../../../../src/features/blocks/client/index.tsx"],"sourcesContent":["'use client'\n\nimport type { I18nClient } from '@payloadcms/translations'\nimport type { BlocksFieldClient, ClientBlock } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nimport { BlockIcon } from '../../../lexical/ui/icons/Block/index.js'\nimport { InlineBlocksIcon } from '../../../lexical/ui/icons/InlineBlocks/index.js'\nimport { createClientFeature } from '../../../utilities/createClientFeature.js'\nimport { getBlockImageComponent } from './getBlockImageComponent.js'\nimport { getBlockMarkdownTransformers } from './markdown/markdownTransformer.js'\nimport { BlockNode } from './nodes/BlocksNode.js'\nimport { InlineBlockNode } from './nodes/InlineBlocksNode.js'\nimport { INSERT_BLOCK_COMMAND, INSERT_INLINE_BLOCK_COMMAND } from './plugin/commands.js'\nimport { BlocksPlugin } from './plugin/index.js'\nexport const BlocksFeatureClient = createClientFeature(\n ({ config, featureClientSchemaMap, props, schemaPath }) => {\n const schemaMapRenderedBlockPathPrefix = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks`\n const schemaMapRenderedInlineBlockPathPrefix = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks`\n const clientSchema = featureClientSchemaMap['blocks']\n\n if (!clientSchema) {\n return {}\n }\n\n const blocksFields: BlocksFieldClient[] = Object.entries(clientSchema)\n .filter(\n ([key]) =>\n key.startsWith(schemaMapRenderedBlockPathPrefix + '.') &&\n !key.replace(schemaMapRenderedBlockPathPrefix + '.', '').includes('.'),\n )\n .map(([, value]) => value[0] as BlocksFieldClient)\n\n const inlineBlocksFields: BlocksFieldClient[] = Object.entries(clientSchema)\n .filter(\n ([key]) =>\n key.startsWith(schemaMapRenderedInlineBlockPathPrefix + '.') &&\n !key.replace(schemaMapRenderedInlineBlockPathPrefix + '.', '').includes('.'),\n )\n .map(([, value]) => value[0] as BlocksFieldClient)\n\n const clientBlocks: ClientBlock[] = blocksFields\n .map((field) => {\n return field.blockReferences\n ? typeof field.blockReferences[0] === 'string'\n ? config.blocksMap[field.blockReferences[0]]\n : field.blockReferences[0]\n : field.blocks[0]\n })\n .filter((block) => block !== undefined)\n\n const clientInlineBlocks: ClientBlock[] = inlineBlocksFields\n .map((field) => {\n return field.blockReferences\n ? typeof field.blockReferences[0] === 'string'\n ? config.blocksMap[field.blockReferences[0]]\n : field.blockReferences[0]\n : field.blocks[0]\n })\n .filter((block) => block !== undefined)\n\n return {\n markdownTransformers: getBlockMarkdownTransformers({\n blocks: clientBlocks,\n inlineBlocks: clientInlineBlocks,\n }),\n nodes: [BlockNode, InlineBlockNode],\n plugins: [\n {\n Component: BlocksPlugin,\n position: 'normal',\n },\n ],\n sanitizedClientFeatureProps: props,\n slashMenu: {\n groups: [\n clientBlocks?.length\n ? {\n items: clientBlocks.map((block) => {\n return {\n Icon: getBlockImageComponent(block, BlockIcon),\n key: 'block-' + block.slug,\n keywords: ['block', 'blocks', block.slug],\n label: ({ i18n }) => {\n const blockDisplayName = block?.labels?.singular\n ? getTranslation(block.labels.singular, i18n)\n : block?.slug\n\n return blockDisplayName\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n blockName: '',\n blockType: block.slug,\n })\n },\n } as SlashMenuItem\n }),\n key: 'blocks',\n label: ({ i18n }: { i18n: I18nClient<object, 'lexical:blocks:label'> }) => {\n return i18n.t('lexical:blocks:label')\n },\n }\n : null,\n clientInlineBlocks?.length\n ? {\n items: clientInlineBlocks.map((inlineBlock) => {\n return {\n Icon: InlineBlocksIcon,\n key: 'inlineBlocks-' + inlineBlock.slug,\n keywords: ['inlineBlock', 'inline block', inlineBlock.slug],\n label: ({ i18n }) => {\n const blockDisplayName = inlineBlock?.labels?.singular\n ? getTranslation(inlineBlock.labels.singular, i18n)\n : inlineBlock?.slug\n\n return blockDisplayName\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_INLINE_BLOCK_COMMAND, {\n blockName: '',\n blockType: inlineBlock.slug,\n })\n },\n } as SlashMenuItem\n }),\n key: 'inlineBlocks',\n label: ({\n i18n,\n }: {\n i18n: I18nClient<object, 'lexical:blocks:inlineBlocks:label'>\n }) => {\n return i18n.t('lexical:blocks:inlineBlocks:label')\n },\n }\n : null,\n ].filter(Boolean) as SlashMenuGroup[],\n },\n toolbarFixed: {\n groups: [\n clientBlocks.length\n ? {\n type: 'dropdown',\n ChildComponent: BlockIcon,\n items: clientBlocks.map((block, index) => {\n return {\n ChildComponent: getBlockImageComponent(block, BlockIcon),\n isActive: undefined, // At this point, we would be inside a sub-richtext-editor. And at this point this will be run against the focused sub-editor, not the parent editor which has the actual block. Thus, no point in running this\n key: 'block-' + block.slug,\n label: ({ i18n }) => {\n const blockDisplayName = block?.labels?.singular\n ? getTranslation(block.labels.singular, i18n)\n : block?.slug\n\n return blockDisplayName\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n blockName: '',\n blockType: block.slug,\n })\n },\n order: index,\n } as ToolbarGroupItem\n }),\n key: 'blocks',\n order: 20,\n }\n : null,\n clientInlineBlocks?.length\n ? {\n type: 'dropdown',\n ChildComponent: InlineBlocksIcon,\n items: clientInlineBlocks.map((inlineBlock, index) => {\n return {\n ChildComponent: getBlockImageComponent(inlineBlock, InlineBlocksIcon),\n isActive: undefined,\n key: 'inlineBlock-' + inlineBlock.slug,\n label: ({ i18n }) => {\n const blockDisplayName = inlineBlock?.labels?.singular\n ? getTranslation(inlineBlock.labels.singular, i18n)\n : inlineBlock?.slug\n\n return blockDisplayName\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_INLINE_BLOCK_COMMAND, {\n blockName: '',\n blockType: inlineBlock.slug,\n })\n },\n order: index,\n } as ToolbarGroupItem\n }),\n key: 'inlineBlocks',\n order: 25,\n }\n : null,\n ].filter(Boolean) as ToolbarGro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BAAiBwC,WAAA,CAAYb,IAAI;YACtCE,KAAA,EAAOA,CAAC;cAAEC;YAAI,CAAE;cACd,MAAMC,gBAAA,GAAmBS,WAAA,EAAaR,MAAA,EAAQC,QAAA,GAC1CxD,cAAA,CAAe+D,WAAA,CAAYR,MAAM,CAACC,QAAQ,EAAEH,IAAA,IAC5CU,WAAA,EAAab,IAAA;cAEjB,OAAOI,gBAAA;YACT;YACAG,QAAA,EAAUA,CAAC;cAAEC;YAAM,CAAE;cACnBA,MAAA,CAAOC,eAAe,CAAClD,2BAAA,EAA6B;gBAClDmD,SAAA,EAAW;gBACXC,SAAA,EAAWE,WAAA,CAAYb;cACzB;YACF;YACAoB,KAAA,EAAOF;UACT;QACF;QACA7C,GAAA,EAAK;QACL+C,KAAA,EAAO;MACT,IACA,KACL,CAAChD,MAAM,CAAC0C,OAAA;IACX;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["getTranslation","BlockIcon","InlineBlocksIcon","createClientFeature","getBlockImageComponent","getBlockMarkdownTransformers","BlockNode","InlineBlockNode","INSERT_BLOCK_COMMAND","INSERT_INLINE_BLOCK_COMMAND","BlocksPlugin","BlocksFeatureClient","config","featureClientSchemaMap","props","schemaPath","schemaMapRenderedBlockPathPrefix","schemaMapRenderedInlineBlockPathPrefix","clientSchema","blocksFields","Object","entries","filter","key","startsWith","replace","includes","map","value","inlineBlocksFields","clientBlocks","field","blockOrSlug","blocks","blocksMap","block","undefined","clientInlineBlocks","markdownTransformers","inlineBlocks","nodes","plugins","Component","position","sanitizedClientFeatureProps","slashMenu","groups","length","items","Icon","slug","keywords","label","i18n","blockDisplayName","labels","singular","onSelect","editor","dispatchCommand","blockName","blockType","t","inlineBlock","Boolean","toolbarFixed","type","ChildComponent","index","isActive","order"],"sources":["../../../../src/features/blocks/client/index.tsx"],"sourcesContent":["'use client'\n\nimport type { I18nClient } from '@payloadcms/translations'\nimport type { BlocksFieldClient, ClientBlock } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport type {\n SlashMenuGroup,\n SlashMenuItem,\n} from '../../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nimport { BlockIcon } from '../../../lexical/ui/icons/Block/index.js'\nimport { InlineBlocksIcon } from '../../../lexical/ui/icons/InlineBlocks/index.js'\nimport { createClientFeature } from '../../../utilities/createClientFeature.js'\nimport { getBlockImageComponent } from './getBlockImageComponent.js'\nimport { getBlockMarkdownTransformers } from './markdown/markdownTransformer.js'\nimport { BlockNode } from './nodes/BlocksNode.js'\nimport { InlineBlockNode } from './nodes/InlineBlocksNode.js'\nimport { INSERT_BLOCK_COMMAND, INSERT_INLINE_BLOCK_COMMAND } from './plugin/commands.js'\nimport { BlocksPlugin } from './plugin/index.js'\nexport const BlocksFeatureClient = createClientFeature(\n ({ config, featureClientSchemaMap, props, schemaPath }) => {\n const schemaMapRenderedBlockPathPrefix = `${schemaPath}.lexical_internal_feature.blocks.lexical_blocks`\n const schemaMapRenderedInlineBlockPathPrefix = `${schemaPath}.lexical_internal_feature.blocks.lexical_inline_blocks`\n const clientSchema = featureClientSchemaMap['blocks']\n\n if (!clientSchema) {\n return {}\n }\n\n const blocksFields: BlocksFieldClient[] = Object.entries(clientSchema)\n .filter(\n ([key]) =>\n key.startsWith(schemaMapRenderedBlockPathPrefix + '.') &&\n !key.replace(schemaMapRenderedBlockPathPrefix + '.', '').includes('.'),\n )\n .map(([, value]) => value[0] as BlocksFieldClient)\n\n const inlineBlocksFields: BlocksFieldClient[] = Object.entries(clientSchema)\n .filter(\n ([key]) =>\n key.startsWith(schemaMapRenderedInlineBlockPathPrefix + '.') &&\n !key.replace(schemaMapRenderedInlineBlockPathPrefix + '.', '').includes('.'),\n )\n .map(([, value]) => value[0] as BlocksFieldClient)\n\n const clientBlocks: ClientBlock[] = blocksFields\n .map((field) => {\n const blockOrSlug = field.blocks[0]\n return typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug\n })\n .filter((block) => block !== undefined)\n\n const clientInlineBlocks: ClientBlock[] = inlineBlocksFields\n .map((field) => {\n const blockOrSlug = field.blocks[0]\n return typeof blockOrSlug === 'string' ? config.blocksMap[blockOrSlug] : blockOrSlug\n })\n .filter((block) => block !== undefined)\n\n return {\n markdownTransformers: getBlockMarkdownTransformers({\n blocks: clientBlocks,\n inlineBlocks: clientInlineBlocks,\n }),\n nodes: [BlockNode, InlineBlockNode],\n plugins: [\n {\n Component: BlocksPlugin,\n position: 'normal',\n },\n ],\n sanitizedClientFeatureProps: props,\n slashMenu: {\n groups: [\n clientBlocks?.length\n ? {\n items: clientBlocks.map((block) => {\n return {\n Icon: getBlockImageComponent(block, BlockIcon),\n key: 'block-' + block.slug,\n keywords: ['block', 'blocks', block.slug],\n label: ({ i18n }) => {\n const blockDisplayName = block?.labels?.singular\n ? getTranslation(block.labels.singular, i18n)\n : block?.slug\n\n return blockDisplayName\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n blockName: '',\n blockType: block.slug,\n })\n },\n } as SlashMenuItem\n }),\n key: 'blocks',\n label: ({ i18n }: { i18n: I18nClient<object, 'lexical:blocks:label'> }) => {\n return i18n.t('lexical:blocks:label')\n },\n }\n : null,\n clientInlineBlocks?.length\n ? {\n items: clientInlineBlocks.map((inlineBlock) => {\n return {\n Icon: InlineBlocksIcon,\n key: 'inlineBlocks-' + inlineBlock.slug,\n keywords: ['inlineBlock', 'inline block', inlineBlock.slug],\n label: ({ i18n }) => {\n const blockDisplayName = inlineBlock?.labels?.singular\n ? getTranslation(inlineBlock.labels.singular, i18n)\n : inlineBlock?.slug\n\n return blockDisplayName\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_INLINE_BLOCK_COMMAND, {\n blockName: '',\n blockType: inlineBlock.slug,\n })\n },\n } as SlashMenuItem\n }),\n key: 'inlineBlocks',\n label: ({\n i18n,\n }: {\n i18n: I18nClient<object, 'lexical:blocks:inlineBlocks:label'>\n }) => {\n return i18n.t('lexical:blocks:inlineBlocks:label')\n },\n }\n : null,\n ].filter(Boolean) as SlashMenuGroup[],\n },\n toolbarFixed: {\n groups: [\n clientBlocks.length\n ? {\n type: 'dropdown',\n ChildComponent: BlockIcon,\n items: clientBlocks.map((block, index) => {\n return {\n isActive: undefined, // At this point, we would be inside a sub-richtext-editor. And at this point this will be run against the focused sub-editor, not the parent editor which has the actual block. Thus, no point in running this\n key: 'block-' + block.slug,\n label: ({ i18n }) => {\n const blockDisplayName = block?.labels?.singular\n ? getTranslation(block.labels.singular, i18n)\n : block?.slug\n\n return blockDisplayName\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n blockName: '',\n blockType: block.slug,\n })\n },\n order: index,\n } as ToolbarGroupItem\n }),\n key: 'blocks',\n order: 20,\n }\n : null,\n clientInlineBlocks?.length\n ? {\n type: 'dropdown',\n ChildComponent: InlineBlocksIcon,\n items: clientInlineBlocks.map((inlineBlock, index) => {\n return {\n isActive: undefined,\n key: 'inlineBlock-' + inlineBlock.slug,\n label: ({ i18n }) => {\n const blockDisplayName = inlineBlock?.labels?.singular\n ? getTranslation(inlineBlock.labels.singular, i18n)\n : inlineBlock?.slug\n\n return blockDisplayName\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_INLINE_BLOCK_COMMAND, {\n blockName: '',\n blockType: inlineBlock.slug,\n })\n },\n order: index,\n } as ToolbarGroupItem\n }),\n key: 'inlineBlocks',\n order: 25,\n }\n : null,\n ].filter(Boolean) as ToolbarGroup[],\n },\n }\n },\n)\n"],"mappings":"AAAA;;AAKA,SAASA,cAAc,QAAQ;AAQ/B,SAASC,SAAS,QAAQ;AAC1B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,mBAAmB,QAAQ;AACpC,SAASC,sBAAsB,QAAQ;AACvC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,SAAS,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C,OAAA;IACX;EACF;AACF","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,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"}
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,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"}
@@ -258,8 +258,8 @@ function getMarkdownTransformerForBlock(block, isInlineBlock) {
258
258
  return [false, startLineIndex];
259
259
  }
260
260
  const node = $createBlockNode({
261
- blockType: block.slug,
262
- ...blockFields
261
+ ...blockFields,
262
+ blockType: block.slug
263
263
  });
264
264
  if (node) {
265
265
  // Now handle beforeStartLine and afterEndLine. If those are not empty, we need to add them as text nodes before and after the block node.
@@ -331,8 +331,8 @@ function getMarkdownTransformerForBlock(block, isInlineBlock) {
331
331
  return false;
332
332
  }
333
333
  const node = $createBlockNode({
334
- blockType: block.slug,
335
- ...blockFields
334
+ ...blockFields,
335
+ blockType: block.slug
336
336
  });
337
337
  if (node) {
338
338
  rootNode.append(node);