@payloadcms/richtext-lexical 3.0.0-canary.3bd3027 → 3.0.0-canary.483db21

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 (734) hide show
  1. package/dist/cell/index.d.ts +2 -2
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +2 -2
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/exports/client/Field-5GGTGCKC.js +2 -0
  6. package/dist/exports/client/Field-5GGTGCKC.js.map +7 -0
  7. package/dist/exports/client/RelationshipComponent-ZR2OCBGL.js +2 -0
  8. package/dist/exports/client/RelationshipComponent-ZR2OCBGL.js.map +7 -0
  9. package/dist/exports/client/bundled.css +1 -1
  10. package/dist/exports/client/{chunk-OSR74ZNW.js → chunk-6QXGZYUK.js} +2 -2
  11. package/dist/exports/client/chunk-6QXGZYUK.js.map +7 -0
  12. package/dist/exports/client/chunk-EBB2CEB6.js +2 -0
  13. package/dist/exports/client/chunk-EBB2CEB6.js.map +7 -0
  14. package/dist/exports/client/chunk-IPCJ5EVK.js +2 -0
  15. package/dist/exports/client/chunk-IPCJ5EVK.js.map +7 -0
  16. package/dist/exports/client/{chunk-3K3B6PJM.js → chunk-IWZVO3AI.js} +2 -2
  17. package/dist/exports/client/chunk-IWZVO3AI.js.map +7 -0
  18. package/dist/exports/client/{chunk-MLIITFAS.js → chunk-Q5DYR7MH.js} +2 -2
  19. package/dist/exports/client/chunk-Q5DYR7MH.js.map +7 -0
  20. package/dist/exports/client/chunk-VUVXZJJR.js +2 -0
  21. package/dist/exports/client/chunk-VUVXZJJR.js.map +7 -0
  22. package/dist/exports/client/component-D4GWDXK5.js +2 -0
  23. package/dist/exports/client/component-D4GWDXK5.js.map +7 -0
  24. package/dist/exports/client/component-KA7FDRMA.js +2 -0
  25. package/dist/exports/client/component-KA7FDRMA.js.map +7 -0
  26. package/dist/exports/client/{component-QWIGEOVD.js → component-VM36FRT2.js} +2 -2
  27. package/dist/exports/client/componentInline-6EKPZSCV.js +2 -0
  28. package/dist/exports/client/componentInline-6EKPZSCV.js.map +7 -0
  29. package/dist/exports/client/index.d.ts +17 -6
  30. package/dist/exports/client/index.d.ts.map +1 -1
  31. package/dist/exports/client/index.js +8 -6
  32. package/dist/exports/client/index.js.map +4 -4
  33. package/dist/features/align/feature.client.js.map +1 -1
  34. package/dist/features/align/feature.server.d.ts +1 -1
  35. package/dist/features/align/feature.server.d.ts.map +1 -1
  36. package/dist/features/align/feature.server.js.map +1 -1
  37. package/dist/features/align/i18n.js.map +1 -1
  38. package/dist/features/align/toolbarAlignGroup.js.map +1 -1
  39. package/dist/features/blockquote/feature.client.js.map +1 -1
  40. package/dist/features/blockquote/feature.server.d.ts +6 -1
  41. package/dist/features/blockquote/feature.server.d.ts.map +1 -1
  42. package/dist/features/blockquote/feature.server.js +5 -2
  43. package/dist/features/blockquote/feature.server.js.map +1 -1
  44. package/dist/features/blockquote/i18n.js.map +1 -1
  45. package/dist/features/blockquote/markdownTransformer.js.map +1 -1
  46. package/dist/features/blocks/component/BlockContent.d.ts +5 -5
  47. package/dist/features/blocks/component/BlockContent.d.ts.map +1 -1
  48. package/dist/features/blocks/component/BlockContent.js +7 -4
  49. package/dist/features/blocks/component/BlockContent.js.map +1 -1
  50. package/dist/features/blocks/component/FormSavePlugin.js +1 -1
  51. package/dist/features/blocks/component/FormSavePlugin.js.map +1 -1
  52. package/dist/features/blocks/component/index.d.ts +0 -4
  53. package/dist/features/blocks/component/index.d.ts.map +1 -1
  54. package/dist/features/blocks/component/index.js +10 -6
  55. package/dist/features/blocks/component/index.js.map +1 -1
  56. package/dist/features/blocks/component/removeEmptyArrayValues.js.map +1 -1
  57. package/dist/features/blocks/componentInline/index.d.ts +10 -0
  58. package/dist/features/blocks/componentInline/index.d.ts.map +1 -0
  59. package/dist/features/blocks/componentInline/index.js +133 -0
  60. package/dist/features/blocks/componentInline/index.js.map +1 -0
  61. package/dist/features/blocks/feature.client.d.ts +6 -2
  62. package/dist/features/blocks/feature.client.d.ts.map +1 -1
  63. package/dist/features/blocks/feature.client.js +70 -8
  64. package/dist/features/blocks/feature.client.js.map +1 -1
  65. package/dist/features/blocks/feature.server.d.ts +3 -2
  66. package/dist/features/blocks/feature.server.d.ts.map +1 -1
  67. package/dist/features/blocks/feature.server.js +100 -45
  68. package/dist/features/blocks/feature.server.js.map +1 -1
  69. package/dist/features/blocks/graphQLPopulationPromise.d.ts +4 -3
  70. package/dist/features/blocks/graphQLPopulationPromise.d.ts.map +1 -1
  71. package/dist/features/blocks/graphQLPopulationPromise.js +2 -2
  72. package/dist/features/blocks/graphQLPopulationPromise.js.map +1 -1
  73. package/dist/features/blocks/i18n.d.ts.map +1 -1
  74. package/dist/features/blocks/i18n.js +192 -0
  75. package/dist/features/blocks/i18n.js.map +1 -1
  76. package/dist/features/blocks/nodes/BlocksNode.d.ts +7 -5
  77. package/dist/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  78. package/dist/features/blocks/nodes/BlocksNode.js +3 -3
  79. package/dist/features/blocks/nodes/BlocksNode.js.map +1 -1
  80. package/dist/features/blocks/nodes/InlineBlocksNode.d.ts +39 -0
  81. package/dist/features/blocks/nodes/InlineBlocksNode.d.ts.map +1 -0
  82. package/dist/features/blocks/nodes/InlineBlocksNode.js +94 -0
  83. package/dist/features/blocks/nodes/InlineBlocksNode.js.map +1 -0
  84. package/dist/features/blocks/plugin/commands.d.ts +5 -0
  85. package/dist/features/blocks/plugin/commands.d.ts.map +1 -1
  86. package/dist/features/blocks/plugin/commands.js +2 -0
  87. package/dist/features/blocks/plugin/commands.js.map +1 -1
  88. package/dist/features/blocks/plugin/index.d.ts +1 -1
  89. package/dist/features/blocks/plugin/index.d.ts.map +1 -1
  90. package/dist/features/blocks/plugin/index.js +76 -7
  91. package/dist/features/blocks/plugin/index.js.map +1 -1
  92. package/dist/features/blocks/validate.d.ts +4 -3
  93. package/dist/features/blocks/validate.d.ts.map +1 -1
  94. package/dist/features/blocks/validate.js +4 -3
  95. package/dist/features/blocks/validate.js.map +1 -1
  96. package/dist/features/converters/html/converter/converters/linebreak.js.map +1 -1
  97. package/dist/features/converters/html/converter/converters/paragraph.d.ts.map +1 -1
  98. package/dist/features/converters/html/converter/converters/paragraph.js +5 -2
  99. package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
  100. package/dist/features/converters/html/converter/converters/text.js.map +1 -1
  101. package/dist/features/converters/html/converter/defaultConverters.js.map +1 -1
  102. package/dist/features/converters/html/converter/index.d.ts +8 -2
  103. package/dist/features/converters/html/converter/index.d.ts.map +1 -1
  104. package/dist/features/converters/html/converter/index.js +14 -5
  105. package/dist/features/converters/html/converter/index.js.map +1 -1
  106. package/dist/features/converters/html/converter/types.d.ts +7 -4
  107. package/dist/features/converters/html/converter/types.d.ts.map +1 -1
  108. package/dist/features/converters/html/converter/types.js.map +1 -1
  109. package/dist/features/converters/html/feature.server.d.ts +3 -3
  110. package/dist/features/converters/html/feature.server.d.ts.map +1 -1
  111. package/dist/features/converters/html/feature.server.js.map +1 -1
  112. package/dist/features/converters/html/field/index.d.ts.map +1 -1
  113. package/dist/features/converters/html/field/index.js +5 -2
  114. package/dist/features/converters/html/field/index.js.map +1 -1
  115. package/dist/features/createClientComponent.d.ts +2 -1
  116. package/dist/features/createClientComponent.d.ts.map +1 -1
  117. package/dist/features/createClientComponent.js.map +1 -1
  118. package/dist/features/createFeaturePropComponent.js +1 -1
  119. package/dist/features/createFeaturePropComponent.js.map +1 -1
  120. package/dist/features/debug/testRecorder/feature.client.js.map +1 -1
  121. package/dist/features/debug/testRecorder/feature.server.d.ts +1 -1
  122. package/dist/features/debug/testRecorder/feature.server.d.ts.map +1 -1
  123. package/dist/features/debug/testRecorder/feature.server.js.map +1 -1
  124. package/dist/features/debug/testRecorder/plugin/index.d.ts +1 -1
  125. package/dist/features/debug/testRecorder/plugin/index.d.ts.map +1 -1
  126. package/dist/features/debug/testRecorder/plugin/index.js.map +1 -1
  127. package/dist/features/debug/treeView/feature.client.js.map +1 -1
  128. package/dist/features/debug/treeView/feature.server.d.ts +1 -1
  129. package/dist/features/debug/treeView/feature.server.d.ts.map +1 -1
  130. package/dist/features/debug/treeView/feature.server.js.map +1 -1
  131. package/dist/features/debug/treeView/plugin/index.d.ts +1 -1
  132. package/dist/features/debug/treeView/plugin/index.d.ts.map +1 -1
  133. package/dist/features/debug/treeView/plugin/index.js.map +1 -1
  134. package/dist/features/experimental_table/feature.client.d.ts +2 -0
  135. package/dist/features/experimental_table/feature.client.d.ts.map +1 -0
  136. package/dist/features/experimental_table/feature.client.js +71 -0
  137. package/dist/features/experimental_table/feature.client.js.map +1 -0
  138. package/dist/features/experimental_table/feature.server.d.ts +13 -0
  139. package/dist/features/experimental_table/feature.server.d.ts.map +1 -0
  140. package/dist/features/experimental_table/feature.server.js +125 -0
  141. package/dist/features/experimental_table/feature.server.js.map +1 -0
  142. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts +4 -0
  143. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  144. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js +604 -0
  145. package/dist/features/experimental_table/plugins/TableActionMenuPlugin/index.js.map +1 -0
  146. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts +3 -0
  147. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  148. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js +327 -0
  149. package/dist/features/experimental_table/plugins/TableCellResizerPlugin/index.js.map +1 -0
  150. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts +12 -0
  151. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  152. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js +181 -0
  153. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  154. package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts +24 -0
  155. package/dist/features/experimental_table/plugins/TablePlugin/index.d.ts.map +1 -0
  156. package/dist/features/experimental_table/plugins/TablePlugin/index.js +98 -0
  157. package/dist/features/experimental_table/plugins/TablePlugin/index.js.map +1 -0
  158. package/dist/features/experimental_table/utils/debounce.d.ts +61 -0
  159. package/dist/features/experimental_table/utils/debounce.d.ts.map +1 -0
  160. package/dist/features/experimental_table/utils/debounce.js +202 -0
  161. package/dist/features/experimental_table/utils/debounce.js.map +1 -0
  162. package/dist/features/experimental_table/utils/useDebounce.d.ts +6 -0
  163. package/dist/features/experimental_table/utils/useDebounce.d.ts.map +1 -0
  164. package/dist/features/experimental_table/utils/useDebounce.js +18 -0
  165. package/dist/features/experimental_table/utils/useDebounce.js.map +1 -0
  166. package/dist/features/format/bold/feature.client.js.map +1 -1
  167. package/dist/features/format/bold/feature.server.d.ts +1 -1
  168. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  169. package/dist/features/format/bold/feature.server.js.map +1 -1
  170. package/dist/features/format/bold/markdownTransformers.js.map +1 -1
  171. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  172. package/dist/features/format/inlineCode/feature.server.d.ts +1 -1
  173. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  174. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  175. package/dist/features/format/inlineCode/markdownTransformers.js.map +1 -1
  176. package/dist/features/format/italic/feature.client.js.map +1 -1
  177. package/dist/features/format/italic/feature.server.d.ts +1 -1
  178. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  179. package/dist/features/format/italic/feature.server.js.map +1 -1
  180. package/dist/features/format/italic/markdownTransformers.js.map +1 -1
  181. package/dist/features/format/shared/toolbarFormatGroup.js.map +1 -1
  182. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  183. package/dist/features/format/strikethrough/feature.server.d.ts +1 -1
  184. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  185. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  186. package/dist/features/format/strikethrough/markdownTransformers.js.map +1 -1
  187. package/dist/features/format/subscript/feature.client.js.map +1 -1
  188. package/dist/features/format/subscript/feature.server.d.ts +1 -1
  189. package/dist/features/format/subscript/feature.server.d.ts.map +1 -1
  190. package/dist/features/format/subscript/feature.server.js.map +1 -1
  191. package/dist/features/format/superscript/feature.client.js.map +1 -1
  192. package/dist/features/format/superscript/feature.server.d.ts +1 -1
  193. package/dist/features/format/superscript/feature.server.d.ts.map +1 -1
  194. package/dist/features/format/superscript/feature.server.js.map +1 -1
  195. package/dist/features/format/underline/feature.client.js.map +1 -1
  196. package/dist/features/format/underline/feature.server.d.ts +1 -1
  197. package/dist/features/format/underline/feature.server.d.ts.map +1 -1
  198. package/dist/features/format/underline/feature.server.js.map +1 -1
  199. package/dist/features/heading/feature.client.js.map +1 -1
  200. package/dist/features/heading/feature.server.d.ts +6 -2
  201. package/dist/features/heading/feature.server.d.ts.map +1 -1
  202. package/dist/features/heading/feature.server.js +5 -2
  203. package/dist/features/heading/feature.server.js.map +1 -1
  204. package/dist/features/heading/i18n.js +2 -2
  205. package/dist/features/heading/i18n.js.map +1 -1
  206. package/dist/features/heading/markdownTransformer.js.map +1 -1
  207. package/dist/features/horizontalRule/component/index.js.map +1 -1
  208. package/dist/features/horizontalRule/feature.client.js.map +1 -1
  209. package/dist/features/horizontalRule/feature.server.d.ts +1 -1
  210. package/dist/features/horizontalRule/feature.server.d.ts.map +1 -1
  211. package/dist/features/horizontalRule/feature.server.js.map +1 -1
  212. package/dist/features/horizontalRule/i18n.js.map +1 -1
  213. package/dist/features/horizontalRule/markdownTransformer.js.map +1 -1
  214. package/dist/features/horizontalRule/nodes/HorizontalRuleNode.d.ts +5 -2
  215. package/dist/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -1
  216. package/dist/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -1
  217. package/dist/features/horizontalRule/plugin/index.d.ts +1 -1
  218. package/dist/features/horizontalRule/plugin/index.d.ts.map +1 -1
  219. package/dist/features/horizontalRule/plugin/index.js.map +1 -1
  220. package/dist/features/indent/feature.client.js.map +1 -1
  221. package/dist/features/indent/feature.server.d.ts +1 -1
  222. package/dist/features/indent/feature.server.d.ts.map +1 -1
  223. package/dist/features/indent/feature.server.js.map +1 -1
  224. package/dist/features/indent/i18n.js.map +1 -1
  225. package/dist/features/indent/toolbarIndentGroup.js.map +1 -1
  226. package/dist/features/link/drawer/baseFields.d.ts +2 -2
  227. package/dist/features/link/drawer/baseFields.d.ts.map +1 -1
  228. package/dist/features/link/drawer/baseFields.js.map +1 -1
  229. package/dist/features/link/feature.client.d.ts +2 -2
  230. package/dist/features/link/feature.client.js.map +1 -1
  231. package/dist/features/link/feature.server.d.ts +6 -6
  232. package/dist/features/link/feature.server.d.ts.map +1 -1
  233. package/dist/features/link/feature.server.js +12 -16
  234. package/dist/features/link/feature.server.js.map +1 -1
  235. package/dist/features/link/graphQLPopulationPromise.d.ts +1 -1
  236. package/dist/features/link/graphQLPopulationPromise.d.ts.map +1 -1
  237. package/dist/features/link/graphQLPopulationPromise.js.map +1 -1
  238. package/dist/features/link/i18n.js.map +1 -1
  239. package/dist/features/link/markdownTransformer.js.map +1 -1
  240. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  241. package/dist/features/link/nodes/AutoLinkNode.js +7 -1
  242. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  243. package/dist/features/link/nodes/LinkNode.js +1 -2
  244. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  245. package/dist/features/link/nodes/types.d.ts +10 -6
  246. package/dist/features/link/nodes/types.d.ts.map +1 -1
  247. package/dist/features/link/nodes/types.js.map +1 -1
  248. package/dist/features/link/plugins/autoLink/index.d.ts +1 -1
  249. package/dist/features/link/plugins/autoLink/index.d.ts.map +1 -1
  250. package/dist/features/link/plugins/autoLink/index.js +21 -5
  251. package/dist/features/link/plugins/autoLink/index.js.map +1 -1
  252. package/dist/features/link/plugins/clickableLink/index.d.ts +1 -1
  253. package/dist/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  254. package/dist/features/link/plugins/clickableLink/index.js.map +1 -1
  255. package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  256. package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  257. package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +11 -7
  258. package/dist/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  259. package/dist/features/link/plugins/floatingLinkEditor/index.d.ts +1 -1
  260. package/dist/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  261. package/dist/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  262. package/dist/features/link/plugins/floatingLinkEditor/types.js.map +1 -1
  263. package/dist/features/link/plugins/floatingLinkEditor/utilities.d.ts +2 -2
  264. package/dist/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  265. package/dist/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  266. package/dist/features/link/plugins/link/index.d.ts +1 -1
  267. package/dist/features/link/plugins/link/index.d.ts.map +1 -1
  268. package/dist/features/link/plugins/link/index.js.map +1 -1
  269. package/dist/features/link/validate.d.ts +1 -1
  270. package/dist/features/link/validate.d.ts.map +1 -1
  271. package/dist/features/link/validate.js +2 -1
  272. package/dist/features/link/validate.js.map +1 -1
  273. package/dist/features/lists/checklist/feature.client.js.map +1 -1
  274. package/dist/features/lists/checklist/feature.server.d.ts +1 -1
  275. package/dist/features/lists/checklist/feature.server.d.ts.map +1 -1
  276. package/dist/features/lists/checklist/feature.server.js.map +1 -1
  277. package/dist/features/lists/checklist/i18n.js.map +1 -1
  278. package/dist/features/lists/checklist/markdownTransformers.js.map +1 -1
  279. package/dist/features/lists/checklist/plugin/index.d.ts +1 -1
  280. package/dist/features/lists/checklist/plugin/index.d.ts.map +1 -1
  281. package/dist/features/lists/checklist/plugin/index.js.map +1 -1
  282. package/dist/features/lists/htmlConverter.d.ts +1 -1
  283. package/dist/features/lists/htmlConverter.d.ts.map +1 -1
  284. package/dist/features/lists/htmlConverter.js +10 -4
  285. package/dist/features/lists/htmlConverter.js.map +1 -1
  286. package/dist/features/lists/orderedList/feature.client.js.map +1 -1
  287. package/dist/features/lists/orderedList/feature.server.d.ts +1 -2
  288. package/dist/features/lists/orderedList/feature.server.d.ts.map +1 -1
  289. package/dist/features/lists/orderedList/feature.server.js.map +1 -1
  290. package/dist/features/lists/orderedList/i18n.js.map +1 -1
  291. package/dist/features/lists/orderedList/markdownTransformer.js.map +1 -1
  292. package/dist/features/lists/plugin/index.d.ts +11 -1
  293. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  294. package/dist/features/lists/plugin/index.js.map +1 -1
  295. package/dist/features/lists/shared/markdown.js.map +1 -1
  296. package/dist/features/lists/shared/slashMenuListGroup.js.map +1 -1
  297. package/dist/features/lists/unorderedList/feature.client.js.map +1 -1
  298. package/dist/features/lists/unorderedList/feature.server.d.ts +1 -1
  299. package/dist/features/lists/unorderedList/feature.server.d.ts.map +1 -1
  300. package/dist/features/lists/unorderedList/feature.server.js.map +1 -1
  301. package/dist/features/lists/unorderedList/i18n.js.map +1 -1
  302. package/dist/features/lists/unorderedList/markdownTransformer.js.map +1 -1
  303. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/client.js.map +1 -1
  304. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts.map +1 -1
  305. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
  306. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/index.js.map +1 -1
  307. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/client.js.map +1 -1
  308. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
  309. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/index.js.map +1 -1
  310. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/client.js.map +1 -1
  311. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts.map +1 -1
  312. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
  313. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/index.js.map +1 -1
  314. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/client.js.map +1 -1
  315. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts.map +1 -1
  316. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
  317. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/index.js.map +1 -1
  318. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/client.js.map +1 -1
  319. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts.map +1 -1
  320. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
  321. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/index.js.map +1 -1
  322. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/client.js.map +1 -1
  323. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
  324. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/index.js.map +1 -1
  325. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/client.js.map +1 -1
  326. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  327. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/index.js.map +1 -1
  328. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
  329. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
  330. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts +2 -2
  331. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts.map +1 -1
  332. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
  333. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
  334. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts +1 -1
  335. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +1 -1
  336. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
  337. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  338. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  339. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  340. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts.map +1 -1
  341. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
  342. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  343. package/dist/features/migrations/slateToLexical/converter/converters/heading/client.js.map +1 -1
  344. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts.map +1 -1
  345. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
  346. package/dist/features/migrations/slateToLexical/converter/converters/heading/index.js.map +1 -1
  347. package/dist/features/migrations/slateToLexical/converter/converters/indent/client.js.map +1 -1
  348. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
  349. package/dist/features/migrations/slateToLexical/converter/converters/indent/index.js.map +1 -1
  350. package/dist/features/migrations/slateToLexical/converter/converters/link/client.js.map +1 -1
  351. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
  352. package/dist/features/migrations/slateToLexical/converter/converters/link/index.js.map +1 -1
  353. package/dist/features/migrations/slateToLexical/converter/converters/listItem/client.js.map +1 -1
  354. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts.map +1 -1
  355. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
  356. package/dist/features/migrations/slateToLexical/converter/converters/listItem/index.js.map +1 -1
  357. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/client.js.map +1 -1
  358. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts.map +1 -1
  359. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
  360. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/index.js.map +1 -1
  361. package/dist/features/migrations/slateToLexical/converter/converters/relationship/client.js.map +1 -1
  362. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  363. package/dist/features/migrations/slateToLexical/converter/converters/relationship/index.js.map +1 -1
  364. package/dist/features/migrations/slateToLexical/converter/converters/unknown/client.js.map +1 -1
  365. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
  366. package/dist/features/migrations/slateToLexical/converter/converters/unknown/index.js.map +1 -1
  367. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/client.js.map +1 -1
  368. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts.map +1 -1
  369. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
  370. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/index.js.map +1 -1
  371. package/dist/features/migrations/slateToLexical/converter/converters/upload/client.js.map +1 -1
  372. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  373. package/dist/features/migrations/slateToLexical/converter/converters/upload/index.js.map +1 -1
  374. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
  375. package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  376. package/dist/features/migrations/slateToLexical/converter/index.js +1 -0
  377. package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
  378. package/dist/features/migrations/slateToLexical/converter/types.js.map +1 -1
  379. package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
  380. package/dist/features/migrations/slateToLexical/feature.server.d.ts +3 -1
  381. package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +1 -1
  382. package/dist/features/migrations/slateToLexical/feature.server.js +3 -1
  383. package/dist/features/migrations/slateToLexical/feature.server.js.map +1 -1
  384. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  385. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  386. package/dist/features/paragraph/feature.client.js.map +1 -1
  387. package/dist/features/paragraph/feature.server.d.ts +1 -1
  388. package/dist/features/paragraph/feature.server.d.ts.map +1 -1
  389. package/dist/features/paragraph/feature.server.js.map +1 -1
  390. package/dist/features/paragraph/i18n.js.map +1 -1
  391. package/dist/features/relationship/drawer/commands.js.map +1 -1
  392. package/dist/features/relationship/drawer/index.js.map +1 -1
  393. package/dist/features/relationship/feature.client.d.ts +6 -6
  394. package/dist/features/relationship/feature.client.js.map +1 -1
  395. package/dist/features/relationship/feature.server.d.ts +6 -5
  396. package/dist/features/relationship/feature.server.d.ts.map +1 -1
  397. package/dist/features/relationship/feature.server.js.map +1 -1
  398. package/dist/features/relationship/graphQLPopulationPromise.d.ts +1 -1
  399. package/dist/features/relationship/graphQLPopulationPromise.d.ts.map +1 -1
  400. package/dist/features/relationship/graphQLPopulationPromise.js.map +1 -1
  401. package/dist/features/relationship/i18n.js.map +1 -1
  402. package/dist/features/relationship/nodes/RelationshipNode.d.ts +6 -2
  403. package/dist/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  404. package/dist/features/relationship/nodes/RelationshipNode.js +1 -1
  405. package/dist/features/relationship/nodes/RelationshipNode.js.map +1 -1
  406. package/dist/features/relationship/nodes/components/RelationshipComponent.d.ts +0 -1
  407. package/dist/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  408. package/dist/features/relationship/nodes/components/RelationshipComponent.js +2 -3
  409. package/dist/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  410. package/dist/features/relationship/plugins/index.d.ts +1 -1
  411. package/dist/features/relationship/plugins/index.d.ts.map +1 -1
  412. package/dist/features/relationship/plugins/index.js.map +1 -1
  413. package/dist/features/relationship/utils/EnabledRelationshipsCondition.js.map +1 -1
  414. package/dist/features/shared/slashMenu/basicGroup.js.map +1 -1
  415. package/dist/features/shared/toolbar/addDropdownGroup.js.map +1 -1
  416. package/dist/features/shared/toolbar/featureButtonsGroup.js.map +1 -1
  417. package/dist/features/shared/toolbar/textDropdownGroup.js.map +1 -1
  418. package/dist/features/toolbars/fixed/Toolbar/index.d.ts +1 -1
  419. package/dist/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -1
  420. package/dist/features/toolbars/fixed/Toolbar/index.js.map +1 -1
  421. package/dist/features/toolbars/fixed/feature.client.d.ts +1 -1
  422. package/dist/features/toolbars/fixed/feature.client.d.ts.map +1 -1
  423. package/dist/features/toolbars/fixed/feature.client.js +8 -15
  424. package/dist/features/toolbars/fixed/feature.client.js.map +1 -1
  425. package/dist/features/toolbars/fixed/feature.server.d.ts +1 -2
  426. package/dist/features/toolbars/fixed/feature.server.d.ts.map +1 -1
  427. package/dist/features/toolbars/fixed/feature.server.js +16 -18
  428. package/dist/features/toolbars/fixed/feature.server.js.map +1 -1
  429. package/dist/features/toolbars/inline/Toolbar/index.d.ts +1 -1
  430. package/dist/features/toolbars/inline/Toolbar/index.d.ts.map +1 -1
  431. package/dist/features/toolbars/inline/Toolbar/index.js.map +1 -1
  432. package/dist/features/toolbars/inline/feature.client.d.ts +1 -1
  433. package/dist/features/toolbars/inline/feature.client.d.ts.map +1 -1
  434. package/dist/features/toolbars/inline/feature.client.js +9 -16
  435. package/dist/features/toolbars/inline/feature.client.js.map +1 -1
  436. package/dist/features/toolbars/inline/feature.server.d.ts +1 -2
  437. package/dist/features/toolbars/inline/feature.server.d.ts.map +1 -1
  438. package/dist/features/toolbars/inline/feature.server.js +8 -11
  439. package/dist/features/toolbars/inline/feature.server.js.map +1 -1
  440. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  441. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  442. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +0 -1
  443. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  444. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  445. package/dist/features/toolbars/types.d.ts +37 -5
  446. package/dist/features/toolbars/types.d.ts.map +1 -1
  447. package/dist/features/toolbars/types.js.map +1 -1
  448. package/dist/features/typeUtilities.d.ts +1 -1
  449. package/dist/features/typeUtilities.d.ts.map +1 -1
  450. package/dist/features/typeUtilities.js.map +1 -1
  451. package/dist/features/typesClient.d.ts +186 -0
  452. package/dist/features/typesClient.d.ts.map +1 -0
  453. package/dist/features/typesClient.js +3 -0
  454. package/dist/features/typesClient.js.map +1 -0
  455. package/dist/features/{types.d.ts → typesServer.d.ts} +50 -202
  456. package/dist/features/typesServer.d.ts.map +1 -0
  457. package/dist/features/typesServer.js +3 -0
  458. package/dist/features/typesServer.js.map +1 -0
  459. package/dist/features/upload/component/index.d.ts.map +1 -1
  460. package/dist/features/upload/component/index.js +34 -11
  461. package/dist/features/upload/component/index.js.map +1 -1
  462. package/dist/features/upload/drawer/commands.js.map +1 -1
  463. package/dist/features/upload/drawer/index.js.map +1 -1
  464. package/dist/features/upload/feature.client.d.ts +1 -1
  465. package/dist/features/upload/feature.client.d.ts.map +1 -1
  466. package/dist/features/upload/feature.client.js +62 -69
  467. package/dist/features/upload/feature.client.js.map +1 -1
  468. package/dist/features/upload/feature.server.d.ts +3 -4
  469. package/dist/features/upload/feature.server.d.ts.map +1 -1
  470. package/dist/features/upload/feature.server.js +157 -169
  471. package/dist/features/upload/feature.server.js.map +1 -1
  472. package/dist/features/upload/graphQLPopulationPromise.d.ts +1 -1
  473. package/dist/features/upload/graphQLPopulationPromise.d.ts.map +1 -1
  474. package/dist/features/upload/graphQLPopulationPromise.js.map +1 -1
  475. package/dist/features/upload/i18n.js.map +1 -1
  476. package/dist/features/upload/nodes/UploadNode.d.ts +7 -5
  477. package/dist/features/upload/nodes/UploadNode.d.ts.map +1 -1
  478. package/dist/features/upload/nodes/UploadNode.js +1 -2
  479. package/dist/features/upload/nodes/UploadNode.js.map +1 -1
  480. package/dist/features/upload/plugin/index.d.ts +1 -1
  481. package/dist/features/upload/plugin/index.d.ts.map +1 -1
  482. package/dist/features/upload/plugin/index.js.map +1 -1
  483. package/dist/features/upload/validate.d.ts +1 -1
  484. package/dist/features/upload/validate.d.ts.map +1 -1
  485. package/dist/features/upload/validate.js +1 -0
  486. package/dist/features/upload/validate.js.map +1 -1
  487. package/dist/field/Field.d.ts +3 -3
  488. package/dist/field/Field.d.ts.map +1 -1
  489. package/dist/field/Field.js +14 -12
  490. package/dist/field/Field.js.map +1 -1
  491. package/dist/field/index.d.ts +3 -3
  492. package/dist/field/index.d.ts.map +1 -1
  493. package/dist/field/index.js +11 -9
  494. package/dist/field/index.js.map +1 -1
  495. package/dist/i18n.js.map +1 -1
  496. package/dist/index.d.ts +14 -9
  497. package/dist/index.d.ts.map +1 -1
  498. package/dist/index.js +16 -16
  499. package/dist/index.js.map +1 -1
  500. package/dist/lexical/EditorPlugin.d.ts +1 -1
  501. package/dist/lexical/EditorPlugin.d.ts.map +1 -1
  502. package/dist/lexical/EditorPlugin.js.map +1 -1
  503. package/dist/lexical/LexicalEditor.d.ts +2 -2
  504. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  505. package/dist/lexical/LexicalEditor.js +0 -6
  506. package/dist/lexical/LexicalEditor.js.map +1 -1
  507. package/dist/lexical/LexicalProvider.d.ts +3 -3
  508. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  509. package/dist/lexical/LexicalProvider.js +26 -6
  510. package/dist/lexical/LexicalProvider.js.map +1 -1
  511. package/dist/lexical/config/client/EditorConfigProvider.d.ts +5 -5
  512. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  513. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  514. package/dist/lexical/config/client/default.js.map +1 -1
  515. package/dist/lexical/config/client/loader.d.ts +1 -1
  516. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  517. package/dist/lexical/config/client/loader.js.map +1 -1
  518. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  519. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  520. package/dist/lexical/config/client/sanitize.js +4 -0
  521. package/dist/lexical/config/client/sanitize.js.map +1 -1
  522. package/dist/lexical/config/server/default.d.ts +2 -2
  523. package/dist/lexical/config/server/default.d.ts.map +1 -1
  524. package/dist/lexical/config/server/default.js.map +1 -1
  525. package/dist/lexical/config/server/loader.d.ts +1 -1
  526. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  527. package/dist/lexical/config/server/loader.js.map +1 -1
  528. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  529. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  530. package/dist/lexical/config/server/sanitize.js.map +1 -1
  531. package/dist/lexical/config/types.d.ts +4 -3
  532. package/dist/lexical/config/types.d.ts.map +1 -1
  533. package/dist/lexical/config/types.js.map +1 -1
  534. package/dist/lexical/nodes/index.js.map +1 -1
  535. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  536. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +4 -4
  537. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  538. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +0 -2
  539. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  540. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +0 -1
  541. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  542. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +1 -20
  543. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  544. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +23 -8
  545. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  546. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  547. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  548. package/dist/lexical/plugins/SlashMenu/index.js +43 -41
  549. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  550. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  551. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  552. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
  553. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
  554. package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  555. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +1 -1
  556. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  557. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  558. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -1
  559. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
  560. package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js.map +1 -1
  561. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
  562. package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  563. package/dist/lexical/plugins/handles/utils/isOnHandleElement.js.map +1 -1
  564. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  565. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  566. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  567. package/dist/lexical/ui/ContentEditable.js +8 -1
  568. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  569. package/dist/lexical/ui/icons/AI/index.js.map +1 -1
  570. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  571. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  572. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  573. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  574. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  575. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  576. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  577. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  578. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  579. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  580. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  581. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  582. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  583. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  584. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  585. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  586. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  587. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  588. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  589. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  590. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts +3 -0
  591. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -0
  592. package/dist/lexical/ui/icons/InlineBlocks/index.js +20 -0
  593. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -0
  594. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  595. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  596. package/dist/lexical/ui/icons/Meatballs/index.d.ts +3 -0
  597. package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -0
  598. package/dist/lexical/ui/icons/Meatballs/index.js +25 -0
  599. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -0
  600. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  601. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  602. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  603. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  604. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  605. package/dist/lexical/ui/icons/Table/index.d.ts +3 -0
  606. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -0
  607. package/dist/lexical/ui/icons/Table/index.js +20 -0
  608. package/dist/lexical/ui/icons/Table/index.js.map +1 -0
  609. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  610. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  611. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  612. package/dist/lexical/ui/icons/Upload/index.js +1 -1
  613. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  614. package/dist/lexical/utils/canUseDOM.js.map +1 -1
  615. package/dist/lexical/utils/environment.js.map +1 -1
  616. package/dist/lexical/utils/getDOMRangeRect.js.map +1 -1
  617. package/dist/lexical/utils/getSelectedNode.js.map +1 -1
  618. package/dist/lexical/utils/guard.js.map +1 -1
  619. package/dist/lexical/utils/invariant.js.map +1 -1
  620. package/dist/lexical/utils/joinClasses.js.map +1 -1
  621. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  622. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  623. package/dist/lexical/utils/point.js.map +1 -1
  624. package/dist/lexical/utils/rect.js.map +1 -1
  625. package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
  626. package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js.map +1 -1
  627. package/dist/lexical/utils/swipe.js.map +1 -1
  628. package/dist/lexical/utils/url.js.map +1 -1
  629. package/dist/nodeTypes.d.ts +32 -0
  630. package/dist/nodeTypes.d.ts.map +1 -0
  631. package/dist/nodeTypes.js +3 -0
  632. package/dist/nodeTypes.js.map +1 -0
  633. package/dist/populateGraphQL/defaultValue.d.ts.map +1 -1
  634. package/dist/populateGraphQL/defaultValue.js +1 -0
  635. package/dist/populateGraphQL/defaultValue.js.map +1 -1
  636. package/dist/populateGraphQL/populate.d.ts +4 -4
  637. package/dist/populateGraphQL/populate.d.ts.map +1 -1
  638. package/dist/populateGraphQL/populate.js.map +1 -1
  639. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +3 -3
  640. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  641. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  642. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts +4 -4
  643. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  644. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
  645. package/dist/types.d.ts +6 -6
  646. package/dist/types.d.ts.map +1 -1
  647. package/dist/types.js.map +1 -1
  648. package/dist/utilities/createClientFeature.d.ts +1 -1
  649. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  650. package/dist/utilities/createClientFeature.js.map +1 -1
  651. package/dist/utilities/createServerFeature.d.ts +3 -3
  652. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  653. package/dist/utilities/createServerFeature.js.map +1 -1
  654. package/dist/utilities/fieldsDrawer/Drawer.d.ts +18 -0
  655. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -0
  656. package/dist/utilities/fieldsDrawer/Drawer.js +26 -0
  657. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -0
  658. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -0
  659. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -0
  660. package/dist/utilities/fieldsDrawer/DrawerContent.js +90 -0
  661. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -0
  662. package/dist/utilities/forEachNodeRecursively.js.map +1 -1
  663. package/dist/utilities/generateComponentMap.d.ts +1 -1
  664. package/dist/utilities/generateComponentMap.d.ts.map +1 -1
  665. package/dist/utilities/generateComponentMap.js +6 -4
  666. package/dist/utilities/generateComponentMap.js.map +1 -1
  667. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  668. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  669. package/dist/utilities/generateSchemaMap.js +10 -1
  670. package/dist/utilities/generateSchemaMap.js.map +1 -1
  671. package/dist/utilities/migrateSlateToLexical/index.d.ts +15 -0
  672. package/dist/utilities/migrateSlateToLexical/index.d.ts.map +1 -0
  673. package/dist/utilities/migrateSlateToLexical/index.js +105 -0
  674. package/dist/utilities/migrateSlateToLexical/index.js.map +1 -0
  675. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +9 -0
  676. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +1 -0
  677. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +77 -0
  678. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -0
  679. package/dist/utilities/recurseNodeTree.js.map +1 -1
  680. package/dist/utilities/upgradeLexicalData/index.d.ts +11 -0
  681. package/dist/utilities/upgradeLexicalData/index.d.ts.map +1 -0
  682. package/dist/utilities/upgradeLexicalData/index.js +101 -0
  683. package/dist/utilities/upgradeLexicalData/index.js.map +1 -0
  684. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts +9 -0
  685. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -0
  686. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +74 -0
  687. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -0
  688. package/dist/utilities/useLexicalFeature.d.ts +1 -1
  689. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  690. package/dist/utilities/useLexicalFeature.js.map +1 -1
  691. package/dist/validate/index.js.map +1 -1
  692. package/dist/validate/validateNodes.d.ts +2 -2
  693. package/dist/validate/validateNodes.d.ts.map +1 -1
  694. package/dist/validate/validateNodes.js.map +1 -1
  695. package/package.json +44 -43
  696. package/dist/exports/client/Field-YMWNSE3A.js +0 -2
  697. package/dist/exports/client/Field-YMWNSE3A.js.map +0 -7
  698. package/dist/exports/client/RelationshipComponent-5OU5HATX.js +0 -2
  699. package/dist/exports/client/RelationshipComponent-5OU5HATX.js.map +0 -7
  700. package/dist/exports/client/chunk-3K3B6PJM.js.map +0 -7
  701. package/dist/exports/client/chunk-MLIITFAS.js.map +0 -7
  702. package/dist/exports/client/chunk-OSR74ZNW.js.map +0 -7
  703. package/dist/exports/client/chunk-WDKKMO4H.js +0 -2
  704. package/dist/exports/client/chunk-WDKKMO4H.js.map +0 -7
  705. package/dist/exports/client/chunk-ZITHDR53.js +0 -2
  706. package/dist/exports/client/chunk-ZITHDR53.js.map +0 -7
  707. package/dist/exports/client/component-IAKI3GRY.js +0 -2
  708. package/dist/exports/client/component-IAKI3GRY.js.map +0 -7
  709. package/dist/exports/client/component-W3PV5MJ7.js +0 -2
  710. package/dist/exports/client/component-W3PV5MJ7.js.map +0 -7
  711. package/dist/features/blocks/drawer/index.d.ts +0 -9
  712. package/dist/features/blocks/drawer/index.d.ts.map +0 -1
  713. package/dist/features/blocks/drawer/index.js +0 -78
  714. package/dist/features/blocks/drawer/index.js.map +0 -1
  715. package/dist/features/link/drawer/index.d.ts +0 -5
  716. package/dist/features/link/drawer/index.d.ts.map +0 -1
  717. package/dist/features/link/drawer/index.js +0 -94
  718. package/dist/features/link/drawer/index.js.map +0 -1
  719. package/dist/features/link/drawer/types.d.ts +0 -10
  720. package/dist/features/link/drawer/types.d.ts.map +0 -1
  721. package/dist/features/link/drawer/types.js +0 -3
  722. package/dist/features/link/drawer/types.js.map +0 -1
  723. package/dist/features/types.d.ts.map +0 -1
  724. package/dist/features/types.js +0 -3
  725. package/dist/features/types.js.map +0 -1
  726. package/dist/features/upload/component/ExtraFieldsDrawer/index.d.ts +0 -12
  727. package/dist/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +0 -1
  728. package/dist/features/upload/component/ExtraFieldsDrawer/index.js +0 -123
  729. package/dist/features/upload/component/ExtraFieldsDrawer/index.js.map +0 -1
  730. package/dist/lexical/utils/cloneDeep.d.ts +0 -2
  731. package/dist/lexical/utils/cloneDeep.d.ts.map +0 -1
  732. package/dist/lexical/utils/cloneDeep.js +0 -50
  733. package/dist/lexical/utils/cloneDeep.js.map +0 -1
  734. /package/dist/exports/client/{component-QWIGEOVD.js.map → component-VM36FRT2.js.map} +0 -0
@@ -0,0 +1,133 @@
1
+ 'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
+ import React, { useCallback, useEffect, useRef } from 'react';
4
+ const baseClass = 'inline-block';
5
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext';
6
+ import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection';
7
+ import { mergeRegister } from '@lexical/utils';
8
+ import { getTranslation } from '@payloadcms/translations';
9
+ import { Button, useTranslation } from '@payloadcms/ui';
10
+ import { $getNodeByKey, $getSelection, $isNodeSelection, CLICK_COMMAND, COMMAND_PRIORITY_LOW, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND } from 'lexical';
11
+ import { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js';
12
+ import { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js';
13
+ import { OPEN_INLINE_BLOCK_DRAWER_COMMAND } from '../plugin/commands.js';
14
+ export const InlineBlockComponent = (props)=>{
15
+ const { formData, nodeKey } = props;
16
+ const [editor] = useLexicalComposerContext();
17
+ const { i18n, t } = useTranslation();
18
+ const { editorConfig, field } = useEditorConfigContext();
19
+ const inlineBlockElemElemRef = useRef(null);
20
+ const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
21
+ const reducedBlock = editorConfig?.resolvedFeatureMap?.get('blocks')?.sanitizedClientFeatureProps?.reducedInlineBlocks?.find((block)=>block.slug === formData?.blockType);
22
+ const removeInlineBlock = useCallback(()=>{
23
+ editor.update(()=>{
24
+ $getNodeByKey(nodeKey).remove();
25
+ });
26
+ }, [
27
+ editor,
28
+ nodeKey
29
+ ]);
30
+ const $onDelete = useCallback((event)=>{
31
+ if (isSelected && $isNodeSelection($getSelection())) {
32
+ event.preventDefault();
33
+ const node = $getNodeByKey(nodeKey);
34
+ if ($isInlineBlockNode(node)) {
35
+ node.remove();
36
+ return true;
37
+ }
38
+ }
39
+ return false;
40
+ }, [
41
+ isSelected,
42
+ nodeKey
43
+ ]);
44
+ const onClick = useCallback((payload)=>{
45
+ const event = payload;
46
+ // Check if inlineBlockElemElemRef.target or anything WITHIN inlineBlockElemElemRef.target was clicked
47
+ if (event.target === inlineBlockElemElemRef.current || inlineBlockElemElemRef.current?.contains(event.target)) {
48
+ if (event.shiftKey) {
49
+ setSelected(!isSelected);
50
+ } else {
51
+ if (!isSelected) {
52
+ clearSelection();
53
+ setSelected(true);
54
+ }
55
+ }
56
+ return true;
57
+ }
58
+ return false;
59
+ }, [
60
+ isSelected,
61
+ setSelected,
62
+ clearSelection
63
+ ]);
64
+ useEffect(()=>{
65
+ return mergeRegister(editor.registerCommand(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW));
66
+ }, [
67
+ clearSelection,
68
+ editor,
69
+ isSelected,
70
+ nodeKey,
71
+ $onDelete,
72
+ setSelected,
73
+ onClick
74
+ ]);
75
+ const LabelComponent = reducedBlock?.LabelComponent;
76
+ const blockDisplayName = reducedBlock.labels.singular ? getTranslation(reducedBlock.labels.singular, i18n) : reducedBlock.slug;
77
+ return /*#__PURE__*/ _jsxs("div", {
78
+ className: [
79
+ baseClass,
80
+ baseClass + '-' + formData.blockType,
81
+ isSelected && `${baseClass}--selected`
82
+ ].filter(Boolean).join(' '),
83
+ ref: inlineBlockElemElemRef,
84
+ children: [
85
+ LabelComponent ? /*#__PURE__*/ _jsx(LabelComponent, {
86
+ blockKind: 'lexicalInlineBlock',
87
+ formData: formData
88
+ }) : /*#__PURE__*/ _jsx("div", {
89
+ children: getTranslation(reducedBlock.labels.singular, i18n)
90
+ }),
91
+ editor.isEditable() && /*#__PURE__*/ _jsxs("div", {
92
+ className: `${baseClass}__actions`,
93
+ children: [
94
+ /*#__PURE__*/ _jsx(Button, {
95
+ buttonStyle: "icon-label",
96
+ className: `${baseClass}__editButton`,
97
+ disabled: field?.readOnly,
98
+ el: "div",
99
+ icon: "edit",
100
+ onClick: ()=>{
101
+ editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {
102
+ fields: formData,
103
+ nodeKey
104
+ });
105
+ },
106
+ round: true,
107
+ size: "small",
108
+ tooltip: t('lexical:blocks:inlineBlocks:edit', {
109
+ label: blockDisplayName
110
+ })
111
+ }),
112
+ /*#__PURE__*/ _jsx(Button, {
113
+ buttonStyle: "icon-label",
114
+ className: `${baseClass}__removeButton`,
115
+ disabled: field?.readOnly,
116
+ icon: "x",
117
+ onClick: (e)=>{
118
+ e.preventDefault();
119
+ removeInlineBlock();
120
+ },
121
+ round: true,
122
+ size: "small",
123
+ tooltip: t('lexical:blocks:inlineBlocks:remove', {
124
+ label: blockDisplayName
125
+ })
126
+ })
127
+ ]
128
+ })
129
+ ]
130
+ });
131
+ };
132
+
133
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/features/blocks/componentInline/index.tsx"],"sourcesContent":["'use client'\n\nimport React, { useCallback, useEffect, useRef } from 'react'\nconst baseClass = 'inline-block'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button, useTranslation } from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\n\nimport type { ClientComponentProps } from '../../typesClient.js'\nimport type { BlocksFeatureClientProps, ClientBlock } from '../feature.client.js'\nimport type { InlineBlockFields } from '../nodes/InlineBlocksNode.js'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport { $isInlineBlockNode } from '../nodes/InlineBlocksNode.js'\nimport { OPEN_INLINE_BLOCK_DRAWER_COMMAND } from '../plugin/commands.js'\nimport './index.scss'\n\ntype Props = {\n readonly formData: InlineBlockFields\n readonly nodeKey?: string\n}\n\nexport const InlineBlockComponent: React.FC<Props> = (props) => {\n const { formData, nodeKey } = props\n const [editor] = useLexicalComposerContext()\n const { i18n, t } = useTranslation<object, string>()\n const { editorConfig, field } = useEditorConfigContext()\n const inlineBlockElemElemRef = useRef<HTMLDivElement | null>(null)\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const reducedBlock: ClientBlock = (\n editorConfig?.resolvedFeatureMap?.get('blocks')\n ?.sanitizedClientFeatureProps as ClientComponentProps<BlocksFeatureClientProps>\n )?.reducedInlineBlocks?.find((block) => block.slug === formData?.blockType)\n\n const removeInlineBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isInlineBlockNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if inlineBlockElemElemRef.target or anything WITHIN inlineBlockElemElemRef.target was clicked\n if (\n event.target === inlineBlockElemElemRef.current ||\n inlineBlockElemElemRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick])\n\n const LabelComponent = reducedBlock?.LabelComponent\n\n const blockDisplayName = reducedBlock.labels.singular\n ? getTranslation(reducedBlock.labels.singular, i18n)\n : reducedBlock.slug\n\n return (\n <div\n className={[\n baseClass,\n baseClass + '-' + formData.blockType,\n isSelected && `${baseClass}--selected`,\n ]\n .filter(Boolean)\n .join(' ')}\n ref={inlineBlockElemElemRef}\n >\n {LabelComponent ? (\n <LabelComponent blockKind={'lexicalInlineBlock'} formData={formData} />\n ) : (\n <div>{getTranslation(reducedBlock.labels.singular, i18n)}</div>\n )}\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__editButton`}\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"edit\"\n onClick={() => {\n editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {\n fields: formData,\n nodeKey,\n })\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:edit', { label: blockDisplayName })}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeInlineBlock()\n }}\n round\n size=\"small\"\n tooltip={t('lexical:blocks:inlineBlocks:remove', { label: blockDisplayName })}\n />\n </div>\n )}\n </div>\n )\n}\n"],"names":["React","useCallback","useEffect","useRef","baseClass","useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","useTranslation","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","useEditorConfigContext","$isInlineBlockNode","OPEN_INLINE_BLOCK_DRAWER_COMMAND","InlineBlockComponent","props","formData","nodeKey","editor","i18n","t","editorConfig","field","inlineBlockElemElemRef","isSelected","setSelected","clearSelection","reducedBlock","resolvedFeatureMap","get","sanitizedClientFeatureProps","reducedInlineBlocks","find","block","slug","blockType","removeInlineBlock","update","remove","$onDelete","event","preventDefault","node","onClick","payload","target","current","contains","shiftKey","registerCommand","LabelComponent","blockDisplayName","labels","singular","div","className","filter","Boolean","join","ref","blockKind","isEditable","buttonStyle","disabled","readOnly","el","icon","dispatchCommand","fields","round","size","tooltip","label","e"],"mappings":"AAAA;;AAEA,OAAOA,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,QAAQ,QAAO;AAC7D,MAAMC,YAAY;AAElB,SAASC,yBAAyB,QAAQ,wCAAuC;AACjF,SAASC,uBAAuB,QAAQ,yCAAwC;AAChF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SAASC,cAAc,QAAQ,2BAA0B;AACzD,SAASC,MAAM,EAAEC,cAAc,QAAQ,iBAAgB;AACvD,SACEC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,UAAS;AAMhB,SAASC,sBAAsB,QAAQ,yDAAwD;AAC/F,SAASC,kBA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A,EAAEhC,cAAc;4BAChBL;wBACF;wBACAiC,KAAK;wBACLC,MAAK;wBACLC,SAASnD,EAAE,sCAAsC;4BAAEoD,OAAOrB;wBAAiB;;;;;;AAMvF,EAAC"}
@@ -1,6 +1,10 @@
1
- import type { ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap';
1
+ import type { Block, ReducedBlock } from 'payload';
2
+ export type ClientBlock = {
3
+ LabelComponent?: Block['admin']['components']['Label'];
4
+ } & ReducedBlock;
2
5
  export type BlocksFeatureClientProps = {
3
- reducedBlocks: ReducedBlock[];
6
+ reducedBlocks: ClientBlock[];
7
+ reducedInlineBlocks: ClientBlock[];
4
8
  };
5
9
  export declare const BlocksFeatureClient: import("react").FC<{
6
10
  featureKey: string;
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../src/features/blocks/feature.client.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4CAA4C,CAAA;AAU9E,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,YAAY,EAAE,CAAA;CAC9B,CAAA;AAED,eAAO,MAAM,mBAAmB;;;6BAwE7B,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../src/features/blocks/feature.client.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAclD,MAAM,MAAM,WAAW,GAAG;IACxB,cAAc,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,YAAY,CAAC,CAAC,OAAO,CAAC,CAAA;CACvD,GAAG,YAAY,CAAA;AAEhB,MAAM,MAAM,wBAAwB,GAAG;IACrC,aAAa,EAAE,WAAW,EAAE,CAAA;IAC5B,mBAAmB,EAAE,WAAW,EAAE,CAAA;CACnC,CAAA;AAED,eAAO,MAAM,mBAAmB;;;6BAyI7B,CAAA"}
@@ -1,13 +1,16 @@
1
1
  'use client';
2
2
  import { getTranslation } from '@payloadcms/translations';
3
3
  import { BlockIcon } from '../../lexical/ui/icons/Block/index.js';
4
+ import { InlineBlocksIcon } from '../../lexical/ui/icons/InlineBlocks/index.js';
4
5
  import { createClientFeature } from '../../utilities/createClientFeature.js';
5
6
  import { BlockNode } from './nodes/BlocksNode.js';
6
- import { INSERT_BLOCK_COMMAND } from './plugin/commands.js';
7
+ import { InlineBlockNode } from './nodes/InlineBlocksNode.js';
8
+ import { INSERT_BLOCK_COMMAND, OPEN_INLINE_BLOCK_DRAWER_COMMAND } from './plugin/commands.js';
7
9
  import { BlocksPlugin } from './plugin/index.js';
8
10
  export const BlocksFeatureClient = createClientFeature(({ props })=>({
9
11
  nodes: [
10
- BlockNode
12
+ BlockNode,
13
+ InlineBlockNode
11
14
  ],
12
15
  plugins: [
13
16
  {
@@ -18,7 +21,7 @@ export const BlocksFeatureClient = createClientFeature(({ props })=>({
18
21
  sanitizedClientFeatureProps: props,
19
22
  slashMenu: {
20
23
  groups: [
21
- {
24
+ props.reducedBlocks?.length ? {
22
25
  items: props.reducedBlocks.map((block)=>{
23
26
  return {
24
27
  Icon: BlockIcon,
@@ -47,12 +50,44 @@ export const BlocksFeatureClient = createClientFeature(({ props })=>({
47
50
  label: ({ i18n })=>{
48
51
  return i18n.t('lexical:blocks:label');
49
52
  }
50
- }
51
- ]
53
+ } : null,
54
+ props.reducedInlineBlocks?.length ? {
55
+ items: props.reducedInlineBlocks.map((inlineBlock)=>{
56
+ return {
57
+ Icon: InlineBlocksIcon,
58
+ key: 'inlineBlocks-' + inlineBlock.slug,
59
+ keywords: [
60
+ 'inlineBlock',
61
+ 'inline block',
62
+ inlineBlock.slug
63
+ ],
64
+ label: ({ i18n })=>{
65
+ if (!inlineBlock.labels.singular) {
66
+ return inlineBlock.slug;
67
+ }
68
+ return getTranslation(inlineBlock.labels.singular, i18n);
69
+ },
70
+ onSelect: ({ editor })=>{
71
+ editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {
72
+ fields: {
73
+ id: null,
74
+ blockName: '',
75
+ blockType: inlineBlock.slug
76
+ }
77
+ });
78
+ }
79
+ };
80
+ }),
81
+ key: 'inlineBlocks',
82
+ label: ({ i18n })=>{
83
+ return i18n.t('lexical:blocks:inlineBlocks:label');
84
+ }
85
+ } : null
86
+ ].filter(Boolean)
52
87
  },
53
88
  toolbarFixed: {
54
89
  groups: [
55
- {
90
+ props.reducedBlocks?.length ? {
56
91
  type: 'dropdown',
57
92
  ChildComponent: BlockIcon,
58
93
  items: props.reducedBlocks.map((block, index)=>{
@@ -78,8 +113,35 @@ export const BlocksFeatureClient = createClientFeature(({ props })=>({
78
113
  }),
79
114
  key: 'blocks',
80
115
  order: 20
81
- }
82
- ]
116
+ } : null,
117
+ props.reducedInlineBlocks?.length ? {
118
+ type: 'dropdown',
119
+ ChildComponent: InlineBlocksIcon,
120
+ items: props.reducedInlineBlocks.map((inlineBlock, index)=>{
121
+ return {
122
+ ChildComponent: InlineBlocksIcon,
123
+ isActive: undefined,
124
+ key: 'inlineBlock-' + inlineBlock.slug,
125
+ label: ({ i18n })=>{
126
+ if (!inlineBlock.labels.singular) {
127
+ return inlineBlock.slug;
128
+ }
129
+ return getTranslation(inlineBlock.labels.singular, i18n);
130
+ },
131
+ onSelect: ({ editor })=>{
132
+ editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {
133
+ fields: {
134
+ blockType: inlineBlock.slug
135
+ }
136
+ });
137
+ },
138
+ order: index
139
+ };
140
+ }),
141
+ key: 'inlineBlocks',
142
+ order: 25
143
+ } : null
144
+ ].filter(Boolean)
83
145
  }
84
146
  }));
85
147
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/blocks/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport { BlockIcon } from '../../lexical/ui/icons/Block/index.js'\nimport { createClientFeature } from '../../utilities/createClientFeature.js'\nimport { BlockNode } from './nodes/BlocksNode.js'\nimport { INSERT_BLOCK_COMMAND } from './plugin/commands.js'\nimport { BlocksPlugin } from './plugin/index.js'\n\nexport type BlocksFeatureClientProps = {\n reducedBlocks: ReducedBlock[]\n}\n\nexport const BlocksFeatureClient = createClientFeature<BlocksFeatureClientProps>(({ props }) => ({\n nodes: [BlockNode],\n plugins: [\n {\n Component: BlocksPlugin,\n position: 'normal',\n },\n ],\n sanitizedClientFeatureProps: props,\n slashMenu: {\n groups: [\n {\n items: props.reducedBlocks.map((block) => {\n return {\n Icon: BlockIcon,\n key: 'block-' + block.slug,\n keywords: ['block', 'blocks', block.slug],\n label: ({ i18n }) => {\n if (!block.labels.singular) {\n return block.slug\n }\n\n return getTranslation(block.labels.singular, i18n)\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n id: null,\n blockName: '',\n blockType: block.slug,\n })\n },\n }\n }),\n key: 'blocks',\n label: ({ i18n }) => {\n return i18n.t('lexical:blocks:label')\n },\n },\n ],\n },\n toolbarFixed: {\n groups: [\n {\n type: 'dropdown',\n ChildComponent: BlockIcon,\n items: props.reducedBlocks.map((block, index) => {\n return {\n ChildComponent: 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 if (!block.labels.singular) {\n return block.slug\n }\n\n return getTranslation(block.labels.singular, i18n)\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n id: null,\n blockName: '',\n blockType: block.slug,\n })\n },\n order: index,\n }\n }),\n key: 'blocks',\n order: 20,\n },\n ],\n },\n}))\n"],"names":["getTranslation","BlockIcon","createClientFeature","BlockNode","INSERT_BLOCK_COMMAND","BlocksPlugin","BlocksFeatureClient","props","nodes","plugins","Component","position","sanitizedClientFeatureProps","slashMenu","groups","items","reducedBlocks","map","block","Icon","key","slug","keywords","label","i18n","labels","singular","onSelect","editor","dispatchCommand","id","blockName","blockType","t","toolbarFixed","type","ChildComponent","index","isActive","undefined","order"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,cAAc,QAAQ,2BAA0B;AAEzD,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,oBAAoB,QAAQ,uBAAsB;AAC3D,SAASC,YAAY,QAAQ,oBAAmB;AAMhD,OAAO,MAAMC,sBAAsBJ,oBAA8C,CAAC,EAAEK,KAAK,EAAE,GAAM,CAAA;QAC/FC,OAAO;YAACL;SAAU;QAClBM,SAAS;YACP;gBACEC,WAAWL;gBACXM,UAAU;YACZ;SACD;QACDC,6BAA6BL;QAC7BM,WAAW;YACTC,QAAQ;gBACN;oBACEC,OAAOR,MAAMS,aAAa,CAACC,GAAG,CAAC,CAACC;wBAC9B,OAAO;4BACLC,MAAMlB;4BACNmB,KAAK,WAAWF,MAAMG,IAAI;4BAC1BC,UAAU;gCAAC;gCAAS;gCAAUJ,MAAMG,IAAI;6BAAC;4BACzCE,OAAO,CAAC,EAAEC,IAAI,EAAE;gCACd,IAAI,CAACN,MAAMO,MAAM,CAACC,QAAQ,EAAE;oCAC1B,OAAOR,MAAMG,IAAI;gCACnB;gCAEA,OAAOrB,eAAekB,MAAMO,MAAM,CAACC,QAAQ,EAAEF;4BAC/C;4BACAG,UAAU,CAAC,EAAEC,MAAM,EAAE;gCACnBA,OAAOC,eAAe,CAACzB,sBAAsB;oCAC3C0B,IAAI;oCACJC,WAAW;oCACXC,WAAWd,MAAMG,IAAI;gCACvB;4BACF;wBACF;oBACF;oBACAD,KAAK;oBACLG,OAAO,CAAC,EAAEC,IAAI,EAAE;wBACd,OAAOA,KAAKS,CAAC,CAAC;oBAChB;gBACF;aACD;QACH;QACAC,cAAc;YACZpB,QAAQ;gBACN;oBACEqB,MAAM;oBACNC,gBAAgBnC;oBAChBc,OAAOR,MAAMS,aAAa,CAACC,GAAG,CAAC,CAACC,OAAOmB;wBACrC,OAAO;4BACLD,gBAAgBnC;4BAChBqC,UAAUC;4BACVnB,KAAK,WAAWF,MAAMG,IAAI;4BAC1BE,OAAO,CAAC,EAAEC,IAAI,EAAE;gCACd,IAAI,CAACN,MAAMO,MAAM,CAACC,QAAQ,EAAE;oCAC1B,OAAOR,MAAMG,IAAI;gCACnB;gCAEA,OAAOrB,eAAekB,MAAMO,MAAM,CAACC,QAAQ,EAAEF;4BAC/C;4BACAG,UAAU,CAAC,EAAEC,MAAM,EAAE;gCACnBA,OAAOC,eAAe,CAACzB,sBAAsB;oCAC3C0B,IAAI;oCACJC,WAAW;oCACXC,WAAWd,MAAMG,IAAI;gCACvB;4BACF;4BACAmB,OAAOH;wBACT;oBACF;oBACAjB,KAAK;oBACLoB,OAAO;gBACT;aACD;QACH;IACF,CAAA,GAAG"}
1
+ {"version":3,"sources":["../../../src/features/blocks/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { Block, ReducedBlock } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\n\nimport type { ToolbarGroup } 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 { BlockNode } from './nodes/BlocksNode.js'\nimport { InlineBlockNode } from './nodes/InlineBlocksNode.js'\nimport { INSERT_BLOCK_COMMAND, OPEN_INLINE_BLOCK_DRAWER_COMMAND } from './plugin/commands.js'\nimport { BlocksPlugin } from './plugin/index.js'\n\nexport type ClientBlock = {\n LabelComponent?: Block['admin']['components']['Label']\n} & ReducedBlock\n\nexport type BlocksFeatureClientProps = {\n reducedBlocks: ClientBlock[]\n reducedInlineBlocks: ClientBlock[]\n}\n\nexport const BlocksFeatureClient = createClientFeature<BlocksFeatureClientProps>(({ props }) => ({\n nodes: [BlockNode, InlineBlockNode],\n plugins: [\n {\n Component: BlocksPlugin,\n position: 'normal',\n },\n ],\n sanitizedClientFeatureProps: props,\n slashMenu: {\n groups: [\n props.reducedBlocks?.length\n ? {\n items: props.reducedBlocks.map((block) => {\n return {\n Icon: BlockIcon,\n key: 'block-' + block.slug,\n keywords: ['block', 'blocks', block.slug],\n label: ({ i18n }) => {\n if (!block.labels.singular) {\n return block.slug\n }\n\n return getTranslation(block.labels.singular, i18n)\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n id: null,\n blockName: '',\n blockType: block.slug,\n })\n },\n }\n }),\n key: 'blocks',\n label: ({ i18n }) => {\n return i18n.t('lexical:blocks:label')\n },\n }\n : null,\n props.reducedInlineBlocks?.length\n ? {\n items: props.reducedInlineBlocks.map((inlineBlock) => {\n return {\n Icon: InlineBlocksIcon,\n key: 'inlineBlocks-' + inlineBlock.slug,\n keywords: ['inlineBlock', 'inline block', inlineBlock.slug],\n label: ({ i18n }) => {\n if (!inlineBlock.labels.singular) {\n return inlineBlock.slug\n }\n\n return getTranslation(inlineBlock.labels.singular, i18n)\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {\n fields: {\n id: null,\n blockName: '',\n blockType: inlineBlock.slug,\n },\n })\n },\n }\n }),\n key: 'inlineBlocks',\n label: ({ i18n }) => {\n return i18n.t('lexical:blocks:inlineBlocks:label')\n },\n }\n : null,\n ].filter(Boolean),\n },\n toolbarFixed: {\n groups: [\n props.reducedBlocks?.length\n ? {\n type: 'dropdown',\n ChildComponent: BlockIcon,\n items: props.reducedBlocks.map((block, index) => {\n return {\n ChildComponent: 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 if (!block.labels.singular) {\n return block.slug\n }\n\n return getTranslation(block.labels.singular, i18n)\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(INSERT_BLOCK_COMMAND, {\n id: null,\n blockName: '',\n blockType: block.slug,\n })\n },\n order: index,\n }\n }),\n key: 'blocks',\n order: 20,\n }\n : null,\n props.reducedInlineBlocks?.length\n ? {\n type: 'dropdown',\n ChildComponent: InlineBlocksIcon,\n items: props.reducedInlineBlocks.map((inlineBlock, index) => {\n return {\n ChildComponent: InlineBlocksIcon,\n isActive: undefined,\n key: 'inlineBlock-' + inlineBlock.slug,\n label: ({ i18n }) => {\n if (!inlineBlock.labels.singular) {\n return inlineBlock.slug\n }\n\n return getTranslation(inlineBlock.labels.singular, i18n)\n },\n onSelect: ({ editor }) => {\n editor.dispatchCommand(OPEN_INLINE_BLOCK_DRAWER_COMMAND, {\n fields: {\n blockType: inlineBlock.slug,\n },\n })\n },\n order: index,\n }\n }),\n key: 'inlineBlocks',\n order: 25,\n }\n : null,\n ].filter(Boolean) as ToolbarGroup[],\n },\n}))\n"],"names":["getTranslation","BlockIcon","InlineBlocksIcon","createClientFeature","BlockNode","InlineBlockNode","INSERT_BLOCK_COMMAND","OPEN_INLINE_BLOCK_DRAWER_COMMAND","BlocksPlugin","BlocksFeatureClient","props","nodes","plugins","Component","position","sanitizedClientFeatureProps","slashMenu","groups","reducedBlocks","length","items","map","block","Icon","key","slug","keywords","label","i18n","labels","singular","onSelect","editor","dispatchCommand","id","blockName","blockType","t","reducedInlineBlocks","inlineBlock","fields","filter","Boolean","toolbarFixed","type","ChildComponent","index","isActive","undefined","order"],"mappings":"AAAA;AAIA,SAASA,cAAc,QAAQ,2BAA0B;AAIzD,SAASC,SAAS,QAAQ,wCAAuC;AACjE,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,mBAAmB,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;oBACEyB,MAAM;oBACNC,gBAAgB3C;oBAChBkB,OAAOV,MAAM4B,mBAAmB,CAACjB,GAAG,CAAC,CAACkB,aAAaO;wBACjD,OAAO;4BACLD,gBAAgB3C;4BAChB6C,UAAUC;4BACVxB,KAAK,iBAAiBe,YAAYd,IAAI;4BACtCE,OAAO,CAAC,EAAEC,IAAI,EAAE;gCACd,IAAI,CAACW,YAAYV,MAAM,CAACC,QAAQ,EAAE;oCAChC,OAAOS,YAAYd,IAAI;gCACzB;gCAEA,OAAOzB,eAAeuC,YAAYV,MAAM,CAACC,QAAQ,EAAEF;4BACrD;4BACAG,UAAU,CAAC,EAAEC,MAAM,EAAE;gCACnBA,OAAOC,eAAe,CAAC1B,kCAAkC;oCACvDiC,QAAQ;wCACNJ,WAAWG,YAAYd,IAAI;oCAC7B;gCACF;4BACF;4BACAwB,OAAOH;wBACT;oBACF;oBACAtB,KAAK;oBACLyB,OAAO;gBACT,IACA;aACL,CAACR,MAAM,CAACC;QACX;IACF,CAAA,GAAG"}
@@ -1,7 +1,8 @@
1
1
  import type { Block } from 'payload';
2
2
  import type { BlocksFeatureClientProps } from './feature.client.js';
3
3
  export type BlocksFeatureProps = {
4
- blocks: Block[];
4
+ blocks?: Block[];
5
+ inlineBlocks?: Block[];
5
6
  };
6
- export declare const BlocksFeature: import("../types.js").FeatureProviderProviderServer<BlocksFeatureProps, BlocksFeatureProps, BlocksFeatureClientProps>;
7
+ export declare const BlocksFeature: import("../typesServer.js").FeatureProviderProviderServer<BlocksFeatureProps, BlocksFeatureProps, BlocksFeatureClientProps>;
7
8
  //# sourceMappingURL=feature.server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/blocks/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAA6B,MAAM,SAAS,CAAA;AAK/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAWnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,EAAE,KAAK,EAAE,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,aAAa,uHAiHxB,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../src/features/blocks/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAA6B,MAAM,SAAS,CAAA;AAI/D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AAYnE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,MAAM,CAAC,EAAE,KAAK,EAAE,CAAA;IAChB,YAAY,CAAC,EAAE,KAAK,EAAE,CAAA;CACvB,CAAA;AAED,eAAO,MAAM,aAAa,6HAoKxB,CAAA"}
@@ -1,4 +1,3 @@
1
- import { traverseFields } from '@payloadcms/ui/utilities/buildFieldSchemaMap/traverseFields';
2
1
  import { baseBlockFields, fieldsToJSONSchema, formatLabels, sanitizeFields } from 'payload';
3
2
  // eslint-disable-next-line payload/no-imports-from-exports-dir
4
3
  import { BlocksFeatureClient } from '../../exports/client/index.js';
@@ -7,72 +6,111 @@ import { createNode } from '../typeUtilities.js';
7
6
  import { blockPopulationPromiseHOC } from './graphQLPopulationPromise.js';
8
7
  import { i18n } from './i18n.js';
9
8
  import { BlockNode } from './nodes/BlocksNode.js';
9
+ import { InlineBlockNode } from './nodes/InlineBlocksNode.js';
10
10
  import { blockValidationHOC } from './validate.js';
11
11
  export const BlocksFeature = createServerFeature({
12
12
  feature: async ({ config: _config, isRoot, props })=>{
13
- if (props?.blocks?.length) {
13
+ if (props?.blocks?.length || props?.inlineBlocks?.length) {
14
14
  const validRelationships = _config.collections.map((c)=>c.slug) || [];
15
- for (const block of props.blocks){
16
- block.fields = block.fields.concat(baseBlockFields);
17
- block.labels = !block.labels ? formatLabels(block.slug) : block.labels;
18
- block.fields = await sanitizeFields({
19
- config: _config,
20
- fields: block.fields,
21
- requireFieldLevelRichTextEditor: isRoot,
22
- validRelationships
23
- });
15
+ if (props?.blocks?.length) {
16
+ for (const block of props.blocks){
17
+ block.fields = block.fields.concat(baseBlockFields);
18
+ block.labels = !block.labels ? formatLabels(block.slug) : block.labels;
19
+ block.fields = await sanitizeFields({
20
+ config: _config,
21
+ fields: block.fields,
22
+ requireFieldLevelRichTextEditor: isRoot,
23
+ validRelationships
24
+ });
25
+ }
26
+ }
27
+ if (props?.inlineBlocks?.length) {
28
+ for (const block of props.inlineBlocks){
29
+ block.fields = block.fields.concat(baseBlockFields);
30
+ block.labels = !block.labels ? formatLabels(block.slug) : block.labels;
31
+ block.fields = await sanitizeFields({
32
+ config: _config,
33
+ fields: block.fields,
34
+ requireFieldLevelRichTextEditor: isRoot,
35
+ validRelationships
36
+ });
37
+ }
24
38
  }
25
39
  }
26
40
  // Build clientProps
27
41
  const clientProps = {
28
- reducedBlocks: []
42
+ reducedBlocks: [],
43
+ reducedInlineBlocks: []
29
44
  };
30
- for (const block of props.blocks){
31
- clientProps.reducedBlocks.push({
32
- slug: block.slug,
33
- fieldMap: [],
34
- imageAltText: block.imageAltText,
35
- imageURL: block.imageURL,
36
- labels: block.labels
37
- });
45
+ if (props?.blocks?.length) {
46
+ for (const block of props.blocks){
47
+ clientProps.reducedBlocks.push({
48
+ slug: block.slug,
49
+ LabelComponent: block?.admin?.components?.Label,
50
+ fieldMap: [],
51
+ imageAltText: block.imageAltText,
52
+ imageURL: block.imageURL,
53
+ labels: block.labels
54
+ });
55
+ }
56
+ }
57
+ if (props?.inlineBlocks?.length) {
58
+ for (const block of props.inlineBlocks){
59
+ clientProps.reducedInlineBlocks.push({
60
+ slug: block.slug,
61
+ LabelComponent: block?.admin?.components?.Label,
62
+ fieldMap: [],
63
+ imageAltText: block.imageAltText,
64
+ imageURL: block.imageURL,
65
+ labels: block.labels
66
+ });
67
+ }
38
68
  }
39
69
  return {
40
70
  ClientFeature: BlocksFeatureClient,
41
71
  clientFeatureProps: clientProps,
42
- generateSchemaMap: ({ config, i18n, props })=>{
43
- const validRelationships = config.collections.map((c)=>c.slug) || [];
72
+ generateSchemaMap: ({ props })=>{
44
73
  /**
45
74
  * Add sub-fields to the schemaMap. E.g. if you have an array field as part of the block, and it runs addRow, it will request these
46
75
  * sub-fields from the component map. Thus, we need to put them in the component map here.
47
76
  */ const schemaMap = new Map();
48
- for (const block of props.blocks){
49
- schemaMap.set(block.slug, block.fields || []);
50
- traverseFields({
51
- config,
52
- fields: block.fields,
53
- i18n,
54
- schemaMap,
55
- schemaPath: block.slug,
56
- validRelationships
57
- });
77
+ if (props?.blocks?.length) {
78
+ for (const block of props.blocks){
79
+ schemaMap.set(block.slug, block.fields || []);
80
+ }
81
+ }
82
+ if (props?.inlineBlocks?.length) {
83
+ for (const block of props.inlineBlocks){
84
+ schemaMap.set(block.slug, block.fields || []);
85
+ }
58
86
  }
59
87
  return schemaMap;
60
88
  },
61
89
  generatedTypes: {
62
90
  modifyOutputSchema: ({ collectionIDFieldTypes, config, currentSchema, field, interfaceNameDefinitions })=>{
63
- if (!props?.blocks?.length) {
91
+ if (!props?.blocks?.length && !props?.inlineBlocks?.length) {
64
92
  return currentSchema;
65
93
  }
66
- const blocksField = {
67
- name: field?.name + '_lexical_blocks',
68
- type: 'blocks',
69
- blocks: props.blocks
70
- };
71
- // This is only done so that interfaceNameDefinitions sets those block's interfaceNames.
72
- // we don't actually use the JSON Schema itself in the generated types yet.
73
- fieldsToJSONSchema(collectionIDFieldTypes, [
74
- blocksField
75
- ], interfaceNameDefinitions, config);
94
+ const fields = [];
95
+ if (props?.blocks?.length) {
96
+ fields.push({
97
+ name: field?.name + '_lexical_blocks',
98
+ type: 'blocks',
99
+ blocks: props.blocks
100
+ });
101
+ }
102
+ if (props?.inlineBlocks?.length) {
103
+ fields.push({
104
+ name: field?.name + '_lexical_inline_blocks',
105
+ type: 'blocks',
106
+ blocks: props.inlineBlocks
107
+ });
108
+ }
109
+ if (fields.length) {
110
+ // This is only done so that interfaceNameDefinitions sets those block's interfaceNames.
111
+ // we don't actually use the JSON Schema itself in the generated types yet.
112
+ fieldsToJSONSchema(collectionIDFieldTypes, fields, interfaceNameDefinitions, config);
113
+ }
76
114
  return currentSchema;
77
115
  }
78
116
  },
@@ -88,11 +126,28 @@ export const BlocksFeature = createServerFeature({
88
126
  return node?.fields;
89
127
  },
90
128
  graphQLPopulationPromises: [
91
- blockPopulationPromiseHOC(props)
129
+ blockPopulationPromiseHOC(props.blocks)
92
130
  ],
93
131
  node: BlockNode,
94
132
  validations: [
95
- blockValidationHOC(props)
133
+ blockValidationHOC(props.blocks)
134
+ ]
135
+ }),
136
+ createNode({
137
+ getSubFields: ({ node })=>{
138
+ const blockType = node.fields.blockType;
139
+ const block = props.inlineBlocks.find((block)=>block.slug === blockType);
140
+ return block?.fields;
141
+ },
142
+ getSubFieldsData: ({ node })=>{
143
+ return node?.fields;
144
+ },
145
+ graphQLPopulationPromises: [
146
+ blockPopulationPromiseHOC(props.inlineBlocks)
147
+ ],
148
+ node: InlineBlockNode,
149
+ validations: [
150
+ blockValidationHOC(props.inlineBlocks)
96
151
  ]
97
152
  })
98
153
  ],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/features/blocks/feature.server.ts"],"sourcesContent":["import type { Block, BlockField, Config, Field } from 'payload'\n\nimport { traverseFields } from '@payloadcms/ui/utilities/buildFieldSchemaMap/traverseFields'\nimport { baseBlockFields, fieldsToJSONSchema, formatLabels, sanitizeFields } from 'payload'\n\nimport type { BlocksFeatureClientProps } from './feature.client.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { BlocksFeatureClient } from '../../exports/client/index.js'\nimport { createServerFeature } from '../../utilities/createServerFeature.js'\nimport { createNode } from '../typeUtilities.js'\nimport { blockPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { BlockNode } from './nodes/BlocksNode.js'\nimport { blockValidationHOC } from './validate.js'\n\nexport type BlocksFeatureProps = {\n blocks: Block[]\n}\n\nexport const BlocksFeature = createServerFeature<\n BlocksFeatureProps,\n BlocksFeatureProps,\n BlocksFeatureClientProps\n>({\n feature: async ({ config: _config, isRoot, props }) => {\n if (props?.blocks?.length) {\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const block of props.blocks) {\n block.fields = block.fields.concat(baseBlockFields)\n block.labels = !block.labels ? formatLabels(block.slug) : block.labels\n\n block.fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: block.fields,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n // Build clientProps\n const clientProps: BlocksFeatureClientProps = {\n reducedBlocks: [],\n }\n for (const block of props.blocks) {\n clientProps.reducedBlocks.push({\n slug: block.slug,\n fieldMap: [],\n imageAltText: block.imageAltText,\n imageURL: block.imageURL,\n labels: block.labels,\n })\n }\n\n return {\n ClientFeature: BlocksFeatureClient,\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ config, i18n, props }) => {\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n /**\n * Add sub-fields to the schemaMap. E.g. if you have an array field as part of the block, and it runs addRow, it will request these\n * sub-fields from the component map. Thus, we need to put them in the component map here.\n */\n const schemaMap = new Map<string, Field[]>()\n\n for (const block of props.blocks) {\n schemaMap.set(block.slug, block.fields || [])\n\n traverseFields({\n config,\n fields: block.fields,\n i18n,\n schemaMap,\n schemaPath: block.slug,\n validRelationships,\n })\n }\n\n return schemaMap\n },\n generatedTypes: {\n modifyOutputSchema: ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n }) => {\n if (!props?.blocks?.length) {\n return currentSchema\n }\n\n const blocksField: BlockField = {\n name: field?.name + '_lexical_blocks',\n type: 'blocks',\n blocks: props.blocks,\n }\n // This is only done so that interfaceNameDefinitions sets those block's interfaceNames.\n // we don't actually use the JSON Schema itself in the generated types yet.\n fieldsToJSONSchema(\n collectionIDFieldTypes,\n [blocksField],\n interfaceNameDefinitions,\n config,\n )\n\n return currentSchema\n },\n },\n i18n,\n nodes: [\n createNode({\n getSubFields: ({ node }) => {\n const blockType = node.fields.blockType\n\n const block = props.blocks.find((block) => block.slug === blockType)\n return block?.fields\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [blockPopulationPromiseHOC(props)],\n node: BlockNode,\n validations: [blockValidationHOC(props)],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'blocks',\n})\n"],"names":["traverseFields","baseBlockFields","fieldsToJSONSchema","formatLabels","sanitizeFields","BlocksFeatureClient","createServerFeature","createNode","blockPopulationPromiseHOC","i18n","BlockNode","blockValidationHOC","BlocksFeature","feature","config","_config","isRoot","props","blocks","length","validRelationships","collections","map","c","slug","block","fields","concat","labels","requireFieldLevelRichTextEditor","clientProps","reducedBlocks","push","fieldMap","imageAltText","imageURL","ClientFeature","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","schemaPath","generatedTypes","modifyOutputSchema","collectionIDFieldTypes","currentSchema","field","interfaceNameDefinitions","blocksField","name","type","nodes","getSubFields","node","blockType","find","getSubFieldsData","graphQLPopulationPromises","validations","sanitizedServerFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,cAAc,QAAQ,8DAA6D;AAC5F,SAASC,eAAe,EAAEC,kBAAkB,EAAEC,YAAY,EAAEC,cAAc,QAAQ,UAAS;AAI3F,+DAA+D;AAC/D,SAASC,mBAAmB,QAAQ,gCAA+B;AACnE,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,yBAAyB,QAAQ,gCAA+B;AACzE,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,kBAAkB,QAAQ,gBAAe;AAMlD,OAAO,MAAMC,gB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ACbc;wBACAY,QAAQD,MAAMC,MAAM;wBACpBjB;wBACA8B;wBACAG,YAAYjB,MAAMD,IAAI;wBACtBJ;oBACF;gBACF;gBAEA,OAAOmB;YACT;YACAI,gBAAgB;gBACdC,oBAAoB,CAAC,EACnBC,sBAAsB,EACtB/B,MAAM,EACNgC,aAAa,EACbC,KAAK,EACLC,wBAAwB,EACzB;oBACC,IAAI,CAAC/B,OAAOC,QAAQC,QAAQ;wBAC1B,OAAO2B;oBACT;oBAEA,MAAMG,cAA0B;wBAC9BC,MAAMH,OAAOG,OAAO;wBACpBC,MAAM;wBACNjC,QAAQD,MAAMC,MAAM;oBACtB;oBACA,wFAAwF;oBACxF,2EAA2E;oBAC3EhB,mBACE2C,wBACA;wBAACI;qBAAY,EACbD,0BACAlC;oBAGF,OAAOgC;gBACT;YACF;YACArC;YACA2C,OAAO;gBACL7C,WAAW;oBACT8C,cAAc,CAAC,EAAEC,IAAI,EAAE;wBACrB,MAAMC,YAAYD,KAAK5B,MAAM,CAAC6B,SAAS;wBAEvC,MAAM9B,QAAQR,MAAMC,MAAM,CAACsC,IAAI,CAAC,CAAC/B,QAAUA,MAAMD,IAAI,KAAK+B;wBAC1D,OAAO9B,OAAOC;oBAChB;oBACA+B,kBAAkB,CAAC,EAAEH,IAAI,EAAE;wBACzB,OAAOA,MAAM5B;oBACf;oBACAgC,2BAA2B;wBAAClD,0BAA0BS;qBAAO;oBAC7DqC,MAAM5C;oBACNiD,aAAa;wBAAChD,mBAAmBM;qBAAO;gBAC1C;aACD;YACD2C,6BAA6B3C;QAC/B;IACF;IACA4C,KAAK;AACP,GAAE"}
1
+ {"version":3,"sources":["../../../src/features/blocks/feature.server.ts"],"sourcesContent":["import type { Block, BlockField, Config, Field } from 'payload'\n\nimport { baseBlockFields, fieldsToJSONSchema, formatLabels, sanitizeFields } from 'payload'\n\nimport type { BlocksFeatureClientProps } from './feature.client.js'\n\n// eslint-disable-next-line payload/no-imports-from-exports-dir\nimport { BlocksFeatureClient } from '../../exports/client/index.js'\nimport { createServerFeature } from '../../utilities/createServerFeature.js'\nimport { createNode } from '../typeUtilities.js'\nimport { blockPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { BlockNode } from './nodes/BlocksNode.js'\nimport { InlineBlockNode } from './nodes/InlineBlocksNode.js'\nimport { blockValidationHOC } from './validate.js'\n\nexport type BlocksFeatureProps = {\n blocks?: Block[]\n inlineBlocks?: Block[]\n}\n\nexport const BlocksFeature = createServerFeature<\n BlocksFeatureProps,\n BlocksFeatureProps,\n BlocksFeatureClientProps\n>({\n feature: async ({ config: _config, isRoot, props }) => {\n if (props?.blocks?.length || props?.inlineBlocks?.length) {\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n if (props?.blocks?.length) {\n for (const block of props.blocks) {\n block.fields = block.fields.concat(baseBlockFields)\n block.labels = !block.labels ? formatLabels(block.slug) : block.labels\n\n block.fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: block.fields,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n if (props?.inlineBlocks?.length) {\n for (const block of props.inlineBlocks) {\n block.fields = block.fields.concat(baseBlockFields)\n block.labels = !block.labels ? formatLabels(block.slug) : block.labels\n\n block.fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: block.fields,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n }\n\n // Build clientProps\n const clientProps: BlocksFeatureClientProps = {\n reducedBlocks: [],\n reducedInlineBlocks: [],\n }\n if (props?.blocks?.length) {\n for (const block of props.blocks) {\n clientProps.reducedBlocks.push({\n slug: block.slug,\n LabelComponent: block?.admin?.components?.Label,\n fieldMap: [],\n imageAltText: block.imageAltText,\n imageURL: block.imageURL,\n labels: block.labels,\n })\n }\n }\n if (props?.inlineBlocks?.length) {\n for (const block of props.inlineBlocks) {\n clientProps.reducedInlineBlocks.push({\n slug: block.slug,\n LabelComponent: block?.admin?.components?.Label,\n fieldMap: [],\n imageAltText: block.imageAltText,\n imageURL: block.imageURL,\n labels: block.labels,\n })\n }\n }\n\n return {\n ClientFeature: BlocksFeatureClient,\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ props }) => {\n /**\n * Add sub-fields to the schemaMap. E.g. if you have an array field as part of the block, and it runs addRow, it will request these\n * sub-fields from the component map. Thus, we need to put them in the component map here.\n */\n const schemaMap = new Map<string, Field[]>()\n\n if (props?.blocks?.length) {\n for (const block of props.blocks) {\n schemaMap.set(block.slug, block.fields || [])\n }\n }\n\n if (props?.inlineBlocks?.length) {\n for (const block of props.inlineBlocks) {\n schemaMap.set(block.slug, block.fields || [])\n }\n }\n\n return schemaMap\n },\n generatedTypes: {\n modifyOutputSchema: ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n }) => {\n if (!props?.blocks?.length && !props?.inlineBlocks?.length) {\n return currentSchema\n }\n\n const fields: BlockField[] = []\n\n if (props?.blocks?.length) {\n fields.push({\n name: field?.name + '_lexical_blocks',\n type: 'blocks',\n blocks: props.blocks,\n })\n }\n if (props?.inlineBlocks?.length) {\n fields.push({\n name: field?.name + '_lexical_inline_blocks',\n type: 'blocks',\n blocks: props.inlineBlocks,\n })\n }\n\n if (fields.length) {\n // This is only done so that interfaceNameDefinitions sets those block's interfaceNames.\n // we don't actually use the JSON Schema itself in the generated types yet.\n fieldsToJSONSchema(collectionIDFieldTypes, fields, interfaceNameDefinitions, config)\n }\n\n return currentSchema\n },\n },\n i18n,\n nodes: [\n createNode({\n getSubFields: ({ node }) => {\n const blockType = node.fields.blockType\n\n const block = props.blocks.find((block) => block.slug === blockType)\n return block?.fields\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [blockPopulationPromiseHOC(props.blocks)],\n node: BlockNode,\n validations: [blockValidationHOC(props.blocks)],\n }),\n createNode({\n getSubFields: ({ node }) => {\n const blockType = node.fields.blockType\n\n const block = props.inlineBlocks.find((block) => block.slug === blockType)\n return block?.fields\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [blockPopulationPromiseHOC(props.inlineBlocks)],\n node: InlineBlockNode,\n validations: [blockValidationHOC(props.inlineBlocks)],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'blocks',\n})\n"],"names":["baseBlockFields","fieldsToJSONSchema","formatLabels","sanitizeFields","BlocksFeatureClient","createServerFeature","createNode","blockPopulationPromiseHOC","i18n","BlockNode","InlineBlockNode","blockValidationHOC","BlocksFeature","feature","config","_config","isRoot","props","blocks","length","inlineBlocks","validRelationships","collections","map","c","slug","block","fields","concat","labels","requireFieldLevelRichTextEditor","clientProps","reducedBlocks","reducedInlineBlocks","push","LabelComponent","admin","components","Label","fieldMap","imageAltText","imageURL","ClientFeature","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","generatedTypes","modifyOutputSchema","collectionIDFieldTypes","currentSchema","field","interfaceNameDefinitions","name","type","nodes","getSubFields","node","blockType","find","getSubFieldsData","graphQLPopulationPromises","validations","sanitizedServerFeatureProps","key"],"mappings":"AAEA,SAASA,eAAe,EAAEC,kBAAkB,EAAEC,YAAY,EAAEC,cAAc,QAAQ,UAAS;AAI3F,+DAA+D;AAC/D,SAASC,mBAAmB,QAAQ,gCAA+B;AACnE,SAASC,mBAAmB,QAAQ,yCAAwC;AAC5E,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,yBAAyB,QAAQ,gCAA+B;AACzE,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,SAAS,QAAQ,wBAAuB;AACjD,SAASC,eAAe,QAAQ,8BAA6B;AAC7D,SAASC,kBAAkB,QAAQ,gBAAe;AAOlD,OAAO,MAAMC,gBAAgBP,oBAI3B;IACAQ,SAAS,OAAO,EAAEC,QAAQC,OAAO,EAAEC,MAAM,EAAEC,KAAK,EAAE;QAChD,IAAIA,OAAOC,QAAQC,UAAUF,OAAOG,cAAcD,QAAQ;YACxD,MAAME,qBA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{ PopulationPromise } from '../types.js';
2
- import type { BlocksFeatureProps } from './feature.server.js';
1
+ import type { Block } from 'payload';
2
+ import type { PopulationPromise } from '../typesServer.js';
3
3
  import type { SerializedBlockNode } from './nodes/BlocksNode.js';
4
- export declare const blockPopulationPromiseHOC: (props: BlocksFeatureProps) => PopulationPromise<SerializedBlockNode>;
4
+ import type { SerializedInlineBlockNode } from './nodes/InlineBlocksNode.js';
5
+ export declare const blockPopulationPromiseHOC: (blocks: Block[]) => PopulationPromise<SerializedBlockNode | SerializedInlineBlockNode>;
5
6
  //# sourceMappingURL=graphQLPopulationPromise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graphQLPopulationPromise.d.ts","sourceRoot":"","sources":["../../../src/features/blocks/graphQLPopulationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAIhE,eAAO,MAAM,yBAAyB,UAC7B,kBAAkB,KACxB,iBAAiB,CAAC,mBAAmB,CA4CvC,CAAA"}
1
+ {"version":3,"file":"graphQLPopulationPromise.d.ts","sourceRoot":"","sources":["../../../src/features/blocks/graphQLPopulationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAEpC,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAA;AAC1D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAA;AAChE,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAA;AAI5E,eAAO,MAAM,yBAAyB,WAC5B,KAAK,EAAE,KACd,iBAAiB,CAAC,mBAAmB,GAAG,yBAAyB,CA4CnE,CAAA"}
@@ -1,9 +1,9 @@
1
1
  import { recursivelyPopulateFieldsForGraphQL } from '../../populateGraphQL/recursivelyPopulateFieldsForGraphQL.js';
2
- export const blockPopulationPromiseHOC = (props)=>{
2
+ export const blockPopulationPromiseHOC = (blocks)=>{
3
3
  const blockPopulationPromise = ({ context, currentDepth, depth, draft, editorPopulationPromises, fieldPromises, findMany, flattenLocales, node, overrideAccess, populationPromises, req, showHiddenFields })=>{
4
4
  const blockFieldData = node.fields;
5
5
  // find block used in this node
6
- const block = props.blocks.find((block)=>block.slug === blockFieldData.blockType);
6
+ const block = blocks.find((block)=>block.slug === blockFieldData.blockType);
7
7
  if (!block || !block?.fields?.length || !blockFieldData) {
8
8
  return;
9
9
  }