@payloadcms/richtext-lexical 3.0.0-beta.133 → 3.0.0-beta.135

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 (406) hide show
  1. package/dist/exports/client/Field-KKSJXHR7.js +2 -0
  2. package/dist/exports/client/Field-KKSJXHR7.js.map +7 -0
  3. package/dist/exports/client/bundled.css +1 -1
  4. package/dist/exports/client/chunk-2CYU43GM.js +2 -0
  5. package/dist/exports/client/chunk-2CYU43GM.js.map +7 -0
  6. package/dist/exports/client/chunk-C7S3V4EB.js +2 -0
  7. package/dist/exports/client/chunk-C7S3V4EB.js.map +7 -0
  8. package/dist/exports/client/chunk-QPPOQTHD.js +2 -0
  9. package/dist/exports/client/{chunk-OOBB5GCO.js.map → chunk-QPPOQTHD.js.map} +3 -3
  10. package/dist/exports/client/chunk-U7O7EYCP.js +2 -0
  11. package/dist/exports/client/chunk-U7O7EYCP.js.map +7 -0
  12. package/dist/exports/client/component-H3EYQ5KG.js +2 -0
  13. package/dist/exports/client/{component-YICNYPTU.js.map → component-H3EYQ5KG.js.map} +1 -1
  14. package/dist/exports/client/componentInline-ZGO3K4TA.js +2 -0
  15. package/dist/exports/client/componentInline-ZGO3K4TA.js.map +7 -0
  16. package/dist/exports/client/index.d.ts +7 -0
  17. package/dist/exports/client/index.d.ts.map +1 -1
  18. package/dist/exports/client/index.js +15 -13
  19. package/dist/exports/client/index.js.map +4 -4
  20. package/dist/exports/server/ast/mdx.d.ts +7 -0
  21. package/dist/exports/server/ast/mdx.d.ts.map +1 -0
  22. package/dist/exports/server/ast/mdx.js +37 -0
  23. package/dist/exports/server/ast/mdx.js.map +1 -0
  24. package/dist/exports/shared.d.ts +4 -0
  25. package/dist/exports/shared.d.ts.map +1 -0
  26. package/dist/exports/shared.js +4 -0
  27. package/dist/exports/shared.js.map +1 -0
  28. package/dist/features/blocks/client/component/BlockContent.d.ts +34 -9
  29. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  30. package/dist/features/blocks/client/component/BlockContent.js +63 -158
  31. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  32. package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts +11 -0
  33. package/dist/features/blocks/client/component/components/BlockCollapsible.d.ts.map +1 -0
  34. package/dist/features/blocks/client/component/components/BlockCollapsible.js +37 -0
  35. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -0
  36. package/dist/features/blocks/client/component/components/BlockEditButton.d.ts +3 -0
  37. package/dist/features/blocks/client/component/components/BlockEditButton.d.ts.map +1 -0
  38. package/dist/features/blocks/client/component/components/BlockEditButton.js +22 -0
  39. package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -0
  40. package/dist/features/blocks/client/component/components/BlockRemoveButton.d.ts +3 -0
  41. package/dist/features/blocks/client/component/components/BlockRemoveButton.d.ts.map +1 -0
  42. package/dist/features/blocks/client/component/components/BlockRemoveButton.js +22 -0
  43. package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -0
  44. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  45. package/dist/features/blocks/client/component/index.js +242 -63
  46. package/dist/features/blocks/client/component/index.js.map +1 -1
  47. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts +5 -0
  48. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -0
  49. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js +28 -0
  50. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -0
  51. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.d.ts +3 -0
  52. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.d.ts.map +1 -0
  53. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js +22 -0
  54. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -0
  55. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.d.ts +3 -0
  56. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.d.ts.map +1 -0
  57. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js +22 -0
  58. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -0
  59. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.d.ts +3 -0
  60. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.d.ts.map +1 -0
  61. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js +22 -0
  62. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -0
  63. package/dist/features/blocks/client/componentInline/index.d.ts +13 -1
  64. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  65. package/dist/features/blocks/client/componentInline/index.js +219 -43
  66. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  67. package/dist/features/blocks/client/index.d.ts +1 -5
  68. package/dist/features/blocks/client/index.d.ts.map +1 -1
  69. package/dist/features/blocks/client/index.js +138 -157
  70. package/dist/features/blocks/client/index.js.map +1 -1
  71. package/dist/features/blocks/client/markdownTransformer.d.ts +16 -0
  72. package/dist/features/blocks/client/markdownTransformer.d.ts.map +1 -0
  73. package/dist/features/blocks/client/markdownTransformer.js +144 -0
  74. package/dist/features/blocks/client/markdownTransformer.js.map +1 -0
  75. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  76. package/dist/features/blocks/client/nodes/BlocksNode.js +1 -3
  77. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  78. package/dist/features/blocks/client/plugin/commands.d.ts +0 -4
  79. package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -1
  80. package/dist/features/blocks/client/plugin/commands.js +0 -1
  81. package/dist/features/blocks/client/plugin/commands.js.map +1 -1
  82. package/dist/features/blocks/client/plugin/index.d.ts +1 -2
  83. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  84. package/dist/features/blocks/client/plugin/index.js +28 -135
  85. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  86. package/dist/features/blocks/server/index.d.ts +1 -2
  87. package/dist/features/blocks/server/index.d.ts.map +1 -1
  88. package/dist/features/blocks/server/index.js +33 -10
  89. package/dist/features/blocks/server/index.js.map +1 -1
  90. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts +22 -0
  91. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.d.ts.map +1 -0
  92. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js +136 -0
  93. package/dist/features/blocks/server/linesFromMatchToContentAndPropsString.js.map +1 -0
  94. package/dist/features/blocks/server/markdownTransformer.d.ts +22 -0
  95. package/dist/features/blocks/server/markdownTransformer.d.ts.map +1 -0
  96. package/dist/features/blocks/server/markdownTransformer.js +400 -0
  97. package/dist/features/blocks/server/markdownTransformer.js.map +1 -0
  98. package/dist/features/experimental_table/client/index.d.ts.map +1 -1
  99. package/dist/features/experimental_table/client/index.js +2 -0
  100. package/dist/features/experimental_table/client/index.js.map +1 -1
  101. package/dist/features/experimental_table/markdownTransformer.d.ts +5 -0
  102. package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -0
  103. package/dist/features/experimental_table/markdownTransformer.js +127 -0
  104. package/dist/features/experimental_table/markdownTransformer.js.map +1 -0
  105. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  106. package/dist/features/experimental_table/server/index.js +2 -0
  107. package/dist/features/experimental_table/server/index.js.map +1 -1
  108. package/dist/features/typesClient.d.ts +12 -19
  109. package/dist/features/typesClient.d.ts.map +1 -1
  110. package/dist/features/typesClient.js.map +1 -1
  111. package/dist/features/typesServer.d.ts +6 -2
  112. package/dist/features/typesServer.d.ts.map +1 -1
  113. package/dist/features/typesServer.js.map +1 -1
  114. package/dist/field/Field.d.ts.map +1 -1
  115. package/dist/field/Field.js +10 -21
  116. package/dist/field/Field.js.map +1 -1
  117. package/dist/field/bundled.css +1 -1
  118. package/dist/field/index.d.ts.map +1 -1
  119. package/dist/field/index.js +23 -14
  120. package/dist/field/index.js.map +1 -1
  121. package/dist/field/rscEntry.d.ts.map +1 -1
  122. package/dist/field/rscEntry.js +23 -1
  123. package/dist/field/rscEntry.js.map +1 -1
  124. package/dist/index.d.ts +4 -1
  125. package/dist/index.d.ts.map +1 -1
  126. package/dist/index.js +4 -1
  127. package/dist/index.js.map +1 -1
  128. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  129. package/dist/lexical/LexicalProvider.js +9 -18
  130. package/dist/lexical/LexicalProvider.js.map +1 -1
  131. package/dist/lexical/config/client/loader.d.ts +6 -1
  132. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  133. package/dist/lexical/config/client/loader.js +6 -0
  134. package/dist/lexical/config/client/loader.js.map +1 -1
  135. package/dist/lexical/config/client/sanitize.js +15 -14
  136. package/dist/lexical/config/client/sanitize.js.map +1 -1
  137. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  138. package/dist/lexical/config/server/sanitize.js +15 -2
  139. package/dist/lexical/config/server/sanitize.js.map +1 -1
  140. package/dist/lexical/nodes/index.d.ts +4 -0
  141. package/dist/lexical/nodes/index.d.ts.map +1 -1
  142. package/dist/lexical/nodes/index.js +8 -1
  143. package/dist/lexical/nodes/index.js.map +1 -1
  144. package/dist/lexical-proxy/@lexical-headless.d.ts +2 -0
  145. package/dist/lexical-proxy/@lexical-headless.d.ts.map +1 -0
  146. package/dist/lexical-proxy/@lexical-headless.js +2 -0
  147. package/dist/lexical-proxy/@lexical-headless.js.map +1 -0
  148. package/dist/lexical-proxy/@lexical-link.d.ts +2 -0
  149. package/dist/lexical-proxy/@lexical-link.d.ts.map +1 -0
  150. package/dist/lexical-proxy/@lexical-link.js +2 -0
  151. package/dist/lexical-proxy/@lexical-link.js.map +1 -0
  152. package/dist/lexical-proxy/@lexical-list.d.ts +2 -0
  153. package/dist/lexical-proxy/@lexical-list.d.ts.map +1 -0
  154. package/dist/lexical-proxy/@lexical-list.js +2 -0
  155. package/dist/lexical-proxy/@lexical-list.js.map +1 -0
  156. package/dist/lexical-proxy/@lexical-mark.d.ts +2 -0
  157. package/dist/lexical-proxy/@lexical-mark.d.ts.map +1 -0
  158. package/dist/lexical-proxy/@lexical-mark.js +2 -0
  159. package/dist/lexical-proxy/@lexical-mark.js.map +1 -0
  160. package/dist/lexical-proxy/@lexical-markdown.d.ts +2 -0
  161. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -0
  162. package/dist/lexical-proxy/@lexical-markdown.js +2 -0
  163. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -0
  164. package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts +2 -0
  165. package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.d.ts.map +1 -0
  166. package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js +2 -0
  167. package/dist/lexical-proxy/@lexical-react/LexicalAutoEmbedPlugin.js.map +1 -0
  168. package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts +2 -0
  169. package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.d.ts.map +1 -0
  170. package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js +2 -0
  171. package/dist/lexical-proxy/@lexical-react/LexicalAutoFocusPlugin.js.map +1 -0
  172. package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts +2 -0
  173. package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.d.ts.map +1 -0
  174. package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js +2 -0
  175. package/dist/lexical-proxy/@lexical-react/LexicalAutoLinkPlugin.js.map +1 -0
  176. package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts +2 -0
  177. package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.d.ts.map +1 -0
  178. package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js +2 -0
  179. package/dist/lexical-proxy/@lexical-react/LexicalBlockWithAlignableContents.js.map +1 -0
  180. package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts +2 -0
  181. package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.d.ts.map +1 -0
  182. package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js +2 -0
  183. package/dist/lexical-proxy/@lexical-react/LexicalCharacterLimitPlugin.js.map +1 -0
  184. package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts +2 -0
  185. package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.d.ts.map +1 -0
  186. package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js +2 -0
  187. package/dist/lexical-proxy/@lexical-react/LexicalCheckListPlugin.js.map +1 -0
  188. package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts +2 -0
  189. package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.d.ts.map +1 -0
  190. package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js +2 -0
  191. package/dist/lexical-proxy/@lexical-react/LexicalClearEditorPlugin.js.map +1 -0
  192. package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts +2 -0
  193. package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.d.ts.map +1 -0
  194. package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js +2 -0
  195. package/dist/lexical-proxy/@lexical-react/LexicalClickableLinkPlugin.js.map +1 -0
  196. package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts +2 -0
  197. package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.d.ts.map +1 -0
  198. package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js +2 -0
  199. package/dist/lexical-proxy/@lexical-react/LexicalCollaborationContext.js.map +1 -0
  200. package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts +2 -0
  201. package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.d.ts.map +1 -0
  202. package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js +2 -0
  203. package/dist/lexical-proxy/@lexical-react/LexicalCollaborationPlugin.js.map +1 -0
  204. package/dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts +2 -0
  205. package/dist/lexical-proxy/@lexical-react/LexicalComposer.d.ts.map +1 -0
  206. package/dist/lexical-proxy/@lexical-react/LexicalComposer.js +2 -0
  207. package/dist/lexical-proxy/@lexical-react/LexicalComposer.js.map +1 -0
  208. package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts +2 -0
  209. package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.d.ts.map +1 -0
  210. package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.js +2 -0
  211. package/dist/lexical-proxy/@lexical-react/LexicalComposerContext.js.map +1 -0
  212. package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts +2 -0
  213. package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.d.ts.map +1 -0
  214. package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.js +2 -0
  215. package/dist/lexical-proxy/@lexical-react/LexicalContentEditable.js.map +1 -0
  216. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +2 -0
  217. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +1 -0
  218. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +2 -0
  219. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +1 -0
  220. package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts +2 -0
  221. package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.d.ts.map +1 -0
  222. package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js +2 -0
  223. package/dist/lexical-proxy/@lexical-react/LexicalDecoratorBlockNode.js.map +1 -0
  224. package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts +2 -0
  225. package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.d.ts.map +1 -0
  226. package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js +2 -0
  227. package/dist/lexical-proxy/@lexical-react/LexicalDraggableBlockPlugin.js.map +1 -0
  228. package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts +2 -0
  229. package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.d.ts.map +1 -0
  230. package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js +2 -0
  231. package/dist/lexical-proxy/@lexical-react/LexicalEditorRefPlugin.js.map +1 -0
  232. package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts +2 -0
  233. package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.d.ts.map +1 -0
  234. package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js +2 -0
  235. package/dist/lexical-proxy/@lexical-react/LexicalErrorBoundary.js.map +1 -0
  236. package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts +2 -0
  237. package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.d.ts.map +1 -0
  238. package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js +2 -0
  239. package/dist/lexical-proxy/@lexical-react/LexicalHashtagPlugin.js.map +1 -0
  240. package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts +2 -0
  241. package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.d.ts.map +1 -0
  242. package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js +2 -0
  243. package/dist/lexical-proxy/@lexical-react/LexicalHistoryPlugin.js.map +1 -0
  244. package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts +2 -0
  245. package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.d.ts.map +1 -0
  246. package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js +2 -0
  247. package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRuleNode.js.map +1 -0
  248. package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts +2 -0
  249. package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.d.ts.map +1 -0
  250. package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js +2 -0
  251. package/dist/lexical-proxy/@lexical-react/LexicalHorizontalRulePlugin.js.map +1 -0
  252. package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts +2 -0
  253. package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.d.ts.map +1 -0
  254. package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js +2 -0
  255. package/dist/lexical-proxy/@lexical-react/LexicalLinkPlugin.js.map +1 -0
  256. package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts +2 -0
  257. package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.d.ts.map +1 -0
  258. package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.js +2 -0
  259. package/dist/lexical-proxy/@lexical-react/LexicalListPlugin.js.map +1 -0
  260. package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts +2 -0
  261. package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.d.ts.map +1 -0
  262. package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js +2 -0
  263. package/dist/lexical-proxy/@lexical-react/LexicalMarkdownShortcutPlugin.js.map +1 -0
  264. package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts +2 -0
  265. package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.d.ts.map +1 -0
  266. package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js +2 -0
  267. package/dist/lexical-proxy/@lexical-react/LexicalNestedComposer.js.map +1 -0
  268. package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts +2 -0
  269. package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.d.ts.map +1 -0
  270. package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js +2 -0
  271. package/dist/lexical-proxy/@lexical-react/LexicalNodeEventPlugin.js.map +1 -0
  272. package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts +2 -0
  273. package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.d.ts.map +1 -0
  274. package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js +2 -0
  275. package/dist/lexical-proxy/@lexical-react/LexicalNodeMenuPlugin.js.map +1 -0
  276. package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts +2 -0
  277. package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.d.ts.map +1 -0
  278. package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js +2 -0
  279. package/dist/lexical-proxy/@lexical-react/LexicalOnChangePlugin.js.map +1 -0
  280. package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts +2 -0
  281. package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.d.ts.map +1 -0
  282. package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js +2 -0
  283. package/dist/lexical-proxy/@lexical-react/LexicalPlainTextPlugin.js.map +1 -0
  284. package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts +2 -0
  285. package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.d.ts.map +1 -0
  286. package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js +2 -0
  287. package/dist/lexical-proxy/@lexical-react/LexicalRichTextPlugin.js.map +1 -0
  288. package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts +2 -0
  289. package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.d.ts.map +1 -0
  290. package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js +2 -0
  291. package/dist/lexical-proxy/@lexical-react/LexicalTabIndentationPlugin.js.map +1 -0
  292. package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts +2 -0
  293. package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.d.ts.map +1 -0
  294. package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js +2 -0
  295. package/dist/lexical-proxy/@lexical-react/LexicalTableOfContents.js.map +1 -0
  296. package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts +2 -0
  297. package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.d.ts.map +1 -0
  298. package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js +2 -0
  299. package/dist/lexical-proxy/@lexical-react/LexicalTableOfContentsPlugin.js.map +1 -0
  300. package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts +2 -0
  301. package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.d.ts.map +1 -0
  302. package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js +2 -0
  303. package/dist/lexical-proxy/@lexical-react/LexicalTablePlugin.js.map +1 -0
  304. package/dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts +2 -0
  305. package/dist/lexical-proxy/@lexical-react/LexicalTreeView.d.ts.map +1 -0
  306. package/dist/lexical-proxy/@lexical-react/LexicalTreeView.js +2 -0
  307. package/dist/lexical-proxy/@lexical-react/LexicalTreeView.js.map +1 -0
  308. package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts +2 -0
  309. package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.d.ts.map +1 -0
  310. package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js +2 -0
  311. package/dist/lexical-proxy/@lexical-react/LexicalTypeaheadMenuPlugin.js.map +1 -0
  312. package/dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts +2 -0
  313. package/dist/lexical-proxy/@lexical-react/useLexicalEditable.d.ts.map +1 -0
  314. package/dist/lexical-proxy/@lexical-react/useLexicalEditable.js +2 -0
  315. package/dist/lexical-proxy/@lexical-react/useLexicalEditable.js.map +1 -0
  316. package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts +2 -0
  317. package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.d.ts.map +1 -0
  318. package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js +2 -0
  319. package/dist/lexical-proxy/@lexical-react/useLexicalIsTextContentEmpty.js.map +1 -0
  320. package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts +2 -0
  321. package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.d.ts.map +1 -0
  322. package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js +2 -0
  323. package/dist/lexical-proxy/@lexical-react/useLexicalNodeSelection.js.map +1 -0
  324. package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts +2 -0
  325. package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.d.ts.map +1 -0
  326. package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.js +2 -0
  327. package/dist/lexical-proxy/@lexical-react/useLexicalSubscription.js.map +1 -0
  328. package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts +2 -0
  329. package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.d.ts.map +1 -0
  330. package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js +2 -0
  331. package/dist/lexical-proxy/@lexical-react/useLexicalTextEntity.js.map +1 -0
  332. package/dist/lexical-proxy/@lexical-rich-text.d.ts +2 -0
  333. package/dist/lexical-proxy/@lexical-rich-text.d.ts.map +1 -0
  334. package/dist/lexical-proxy/@lexical-rich-text.js +2 -0
  335. package/dist/lexical-proxy/@lexical-rich-text.js.map +1 -0
  336. package/dist/lexical-proxy/@lexical-selection.d.ts +2 -0
  337. package/dist/lexical-proxy/@lexical-selection.d.ts.map +1 -0
  338. package/dist/lexical-proxy/@lexical-selection.js +2 -0
  339. package/dist/lexical-proxy/@lexical-selection.js.map +1 -0
  340. package/dist/lexical-proxy/@lexical-utils.d.ts +2 -0
  341. package/dist/lexical-proxy/@lexical-utils.d.ts.map +1 -0
  342. package/dist/lexical-proxy/@lexical-utils.js +2 -0
  343. package/dist/lexical-proxy/@lexical-utils.js.map +1 -0
  344. package/dist/lexical-proxy/lexical.d.ts +2 -0
  345. package/dist/lexical-proxy/lexical.d.ts.map +1 -0
  346. package/dist/lexical-proxy/lexical.js +2 -0
  347. package/dist/lexical-proxy/lexical.js.map +1 -0
  348. package/dist/types.d.ts +2 -0
  349. package/dist/types.d.ts.map +1 -1
  350. package/dist/types.js.map +1 -1
  351. package/dist/utilities/buildInitialState.d.ts +27 -0
  352. package/dist/utilities/buildInitialState.d.ts.map +1 -0
  353. package/dist/utilities/buildInitialState.js +53 -0
  354. package/dist/utilities/buildInitialState.js.map +1 -0
  355. package/dist/utilities/createClientFeature.d.ts +5 -0
  356. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  357. package/dist/utilities/createClientFeature.js +6 -0
  358. package/dist/utilities/createClientFeature.js.map +1 -1
  359. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  360. package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -5
  361. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  362. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  363. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js +8 -8
  364. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -1
  365. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  366. package/dist/utilities/initLexicalFeatures.js +3 -2
  367. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  368. package/dist/utilities/jsx/collectTopLevelJSXInLines.d.ts +52 -0
  369. package/dist/utilities/jsx/collectTopLevelJSXInLines.d.ts.map +1 -0
  370. package/dist/utilities/jsx/collectTopLevelJSXInLines.js +79 -0
  371. package/dist/utilities/jsx/collectTopLevelJSXInLines.js.map +1 -0
  372. package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts +12 -0
  373. package/dist/utilities/jsx/extractPropsFromJSXPropsString.d.ts.map +1 -0
  374. package/dist/utilities/jsx/extractPropsFromJSXPropsString.js +125 -0
  375. package/dist/utilities/jsx/extractPropsFromJSXPropsString.js.map +1 -0
  376. package/dist/utilities/jsx/jsx.d.ts +26 -0
  377. package/dist/utilities/jsx/jsx.d.ts.map +1 -0
  378. package/dist/utilities/jsx/jsx.js +105 -0
  379. package/dist/utilities/jsx/jsx.js.map +1 -0
  380. package/dist/utilities/jsx/jsx.spec.d.ts +2 -0
  381. package/dist/utilities/jsx/jsx.spec.d.ts.map +1 -0
  382. package/dist/utilities/jsx/jsx.spec.js +142 -0
  383. package/dist/utilities/jsx/jsx.spec.js.map +1 -0
  384. package/dist/utilities/jsx/lexicalMarkdownCopy.d.ts +11 -0
  385. package/dist/utilities/jsx/lexicalMarkdownCopy.d.ts.map +1 -0
  386. package/dist/utilities/jsx/lexicalMarkdownCopy.js +61 -0
  387. package/dist/utilities/jsx/lexicalMarkdownCopy.js.map +1 -0
  388. package/package.json +284 -7
  389. package/dist/exports/client/Field-GWJ72IYP.js +0 -2
  390. package/dist/exports/client/Field-GWJ72IYP.js.map +0 -7
  391. package/dist/exports/client/chunk-D7PD5DUW.js +0 -2
  392. package/dist/exports/client/chunk-D7PD5DUW.js.map +0 -7
  393. package/dist/exports/client/chunk-OOBB5GCO.js +0 -2
  394. package/dist/exports/client/chunk-XDEGE6I5.js +0 -2
  395. package/dist/exports/client/chunk-XDEGE6I5.js.map +0 -7
  396. package/dist/exports/client/chunk-YGRKYSDC.js +0 -2
  397. package/dist/exports/client/chunk-YGRKYSDC.js.map +0 -7
  398. package/dist/exports/client/component-KLNTKKNE.js +0 -2
  399. package/dist/exports/client/component-KLNTKKNE.js.map +0 -7
  400. package/dist/exports/client/component-YICNYPTU.js +0 -2
  401. package/dist/exports/client/componentInline-6RPSMLNJ.js +0 -2
  402. package/dist/exports/client/componentInline-6RPSMLNJ.js.map +0 -7
  403. package/dist/features/blocks/client/component/FormSavePlugin.d.ts +0 -11
  404. package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +0 -1
  405. package/dist/features/blocks/client/component/FormSavePlugin.js +0 -53
  406. package/dist/features/blocks/client/component/FormSavePlugin.js.map +0 -1
@@ -0,0 +1,7 @@
1
+ import { fromMarkdown } from 'mdast-util-from-markdown';
2
+ export type AST = ReturnType<typeof fromMarkdown>;
3
+ export declare function parseJSXToAST({ jsxString, keepPositions, }: {
4
+ jsxString: string;
5
+ keepPositions?: boolean;
6
+ }): AST;
7
+ //# sourceMappingURL=mdx.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx.d.ts","sourceRoot":"","sources":["../../../../src/exports/server/ast/mdx.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAA;AAIvD,MAAM,MAAM,GAAG,GAAG,UAAU,CAAC,OAAO,YAAY,CAAC,CAAA;AAEjD,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,aAAa,GACd,EAAE;IACD,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,CAAC,EAAE,OAAO,CAAA;CACxB,GAAG,GAAG,CA6BN"}
@@ -0,0 +1,37 @@
1
+ import * as acorn from 'acorn';
2
+ import { fromMarkdown } from 'mdast-util-from-markdown';
3
+ import { mdxJsxFromMarkdown } from 'mdast-util-mdx-jsx';
4
+ import { mdxJsx } from 'micromark-extension-mdx-jsx';
5
+ export function parseJSXToAST({
6
+ jsxString,
7
+ keepPositions
8
+ }) {
9
+ const treeComplex = fromMarkdown(jsxString, {
10
+ // @ts-expect-error
11
+ extensions: [mdxJsx({
12
+ acorn,
13
+ addResult: false
14
+ })],
15
+ mdastExtensions: [mdxJsxFromMarkdown()]
16
+ });
17
+ // Remove "position" keys
18
+ const parseTree = tree => {
19
+ for (const key in tree) {
20
+ if (key === 'position' && tree[key].start && tree[key].end) {
21
+ delete tree[key];
22
+ } else if (typeof tree[key] === 'object') {
23
+ parseTree(tree[key]);
24
+ } else if (Array.isArray(tree[key])) {
25
+ for (const item of tree[key]) {
26
+ parseTree(item);
27
+ }
28
+ }
29
+ }
30
+ };
31
+ const tree = treeComplex;
32
+ if (keepPositions !== true) {
33
+ parseTree(tree);
34
+ }
35
+ return tree;
36
+ }
37
+ //# sourceMappingURL=mdx.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"mdx.js","names":["acorn","fromMarkdown","mdxJsxFromMarkdown","mdxJsx","parseJSXToAST","jsxString","keepPositions","treeComplex","extensions","addResult","mdastExtensions","parseTree","tree","key","start","end","Array","isArray","item"],"sources":["../../../../src/exports/server/ast/mdx.ts"],"sourcesContent":["import * as acorn from 'acorn'\nimport { fromMarkdown } from 'mdast-util-from-markdown'\nimport { mdxJsxFromMarkdown } from 'mdast-util-mdx-jsx'\nimport { mdxJsx } from 'micromark-extension-mdx-jsx'\n\nexport type AST = ReturnType<typeof fromMarkdown>\n\nexport function parseJSXToAST({\n jsxString,\n keepPositions,\n}: {\n jsxString: string\n keepPositions?: boolean\n}): AST {\n const treeComplex: AST = fromMarkdown(jsxString, {\n // @ts-expect-error\n extensions: [mdxJsx({ acorn, addResult: false })],\n mdastExtensions: [mdxJsxFromMarkdown()],\n })\n\n // Remove \"position\" keys\n const parseTree = (tree: object) => {\n for (const key in tree) {\n if (key === 'position' && tree[key].start && tree[key].end) {\n delete tree[key]\n } else if (typeof tree[key] === 'object') {\n parseTree(tree[key])\n } else if (Array.isArray(tree[key])) {\n for (const item of tree[key]) {\n parseTree(item)\n }\n }\n }\n }\n\n const tree: AST = treeComplex\n\n if (keepPositions !== true) {\n parseTree(tree)\n }\n\n return tree\n}\n"],"mappings":"AAAA,YAAYA,KAAA,MAAW;AACvB,SAASC,YAAY,QAAQ;AAC7B,SAASC,kBAAkB,QAAQ;AACnC,SAASC,MAAM,QAAQ;AAIvB,OAAO,SAASC,cAAc;EAC5BC,SAAS;EACTC;AAAa,CAId;EACC,MAAMC,WAAA,GAAmBN,YAAA,CAAaI,SAAA,EAAW;IAC/C;IACAG,UAAA,EAAY,CAACL,MAAA,CAAO;MAAEH,KAAA;MAAOS,SAAA,EAAW;IAAM,GAAG;IACjDC,eAAA,EAAiB,CAACR,kBAAA;EACpB;EAEA;EACA,MAAMS,SAAA,GAAaC,IAAA;IACjB,KAAK,MAAMC,GAAA,IAAOD,IAAA,EAAM;MACtB,IAAIC,GAAA,KAAQ,cAAcD,IAAI,CAACC,GAAA,CAAI,CAACC,KAAK,IAAIF,IAAI,CAACC,GAAA,CAAI,CAACE,GAAG,EAAE;QAC1D,OAAOH,IAAI,CAACC,GAAA,CAAI;MAClB,OAAO,IAAI,OAAOD,IAAI,CAACC,GAAA,CAAI,KAAK,UAAU;QACxCF,SAAA,CAAUC,IAAI,CAACC,GAAA,CAAI;MACrB,OAAO,IAAIG,KAAA,CAAMC,OAAO,CAACL,IAAI,CAACC,GAAA,CAAI,GAAG;QACnC,KAAK,MAAMK,IAAA,IAAQN,IAAI,CAACC,GAAA,CAAI,EAAE;UAC5BF,SAAA,CAAUO,IAAA;QACZ;MACF;IACF;EACF;EAEA,MAAMN,IAAA,GAAYL,WAAA;EAElB,IAAID,aAAA,KAAkB,MAAM;IAC1BK,SAAA,CAAUC,IAAA;EACZ;EAEA,OAAOA,IAAA;AACT","ignoreList":[]}
@@ -0,0 +1,4 @@
1
+ export { collectTopLevelJSXInLines } from '../utilities/jsx/collectTopLevelJSXInLines.js';
2
+ export { extractPropsFromJSXPropsString } from '../utilities/jsx/extractPropsFromJSXPropsString.js';
3
+ export { extractFrontmatter, frontmatterToObject, objectToFrontmatter, propsToJSXString, } from '../utilities/jsx/jsx.js';
4
+ //# sourceMappingURL=shared.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/exports/shared.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,+CAA+C,CAAA;AAEzF,OAAO,EAAE,8BAA8B,EAAE,MAAM,oDAAoD,CAAA;AACnG,OAAO,EACL,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,gBAAgB,GACjB,MAAM,yBAAyB,CAAA"}
@@ -0,0 +1,4 @@
1
+ export { collectTopLevelJSXInLines } from '../utilities/jsx/collectTopLevelJSXInLines.js';
2
+ export { extractPropsFromJSXPropsString } from '../utilities/jsx/extractPropsFromJSXPropsString.js';
3
+ export { extractFrontmatter, frontmatterToObject, objectToFrontmatter, propsToJSXString } from '../utilities/jsx/jsx.js';
4
+ //# sourceMappingURL=shared.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"shared.js","names":["collectTopLevelJSXInLines","extractPropsFromJSXPropsString","extractFrontmatter","frontmatterToObject","objectToFrontmatter","propsToJSXString"],"sources":["../../src/exports/shared.ts"],"sourcesContent":["export { collectTopLevelJSXInLines } from '../utilities/jsx/collectTopLevelJSXInLines.js'\n\nexport { extractPropsFromJSXPropsString } from '../utilities/jsx/extractPropsFromJSXPropsString.js'\nexport {\n extractFrontmatter,\n frontmatterToObject,\n objectToFrontmatter,\n propsToJSXString,\n} from '../utilities/jsx/jsx.js'\n"],"mappings":"AAAA,SAASA,yBAAyB,QAAQ;AAE1C,SAASC,8BAA8B,QAAQ;AAC/C,SACEC,kBAAkB,EAClBC,mBAAmB,EACnBC,mBAAmB,EACnBC,gBAAgB,QACX","ignoreList":[]}
@@ -1,18 +1,43 @@
1
- import type { ClientBlock, ClientField } from 'payload';
1
+ import type { ClientField, FormState } from 'payload';
2
2
  import React from 'react';
3
- import type { LexicalRichTextFieldProps } from '../../../../types.js';
4
- import type { BlockFields } from '../../server/nodes/BlocksNode.js';
5
3
  type Props = {
6
4
  baseClass: string;
7
- clientBlock: ClientBlock;
8
- field: LexicalRichTextFieldProps['field'];
9
- formData: BlockFields;
5
+ BlockDrawer: React.FC;
6
+ Collapsible: React.FC<{
7
+ children?: React.ReactNode;
8
+ editButton?: boolean;
9
+ errorCount?: number;
10
+ fieldHasErrors?: boolean;
11
+ /**
12
+ * Override the default label with a custom label
13
+ */
14
+ Label?: React.ReactNode;
15
+ removeButton?: boolean;
16
+ }>;
17
+ CustomBlock: React.ReactNode;
18
+ EditButton: React.FC;
19
+ errorCount: number;
10
20
  formSchema: ClientField[];
11
- Label?: React.ReactNode;
21
+ initialState: false | FormState | undefined;
12
22
  nodeKey: string;
13
- path: string;
14
- schemaPath: string;
23
+ RemoveButton: React.FC;
15
24
  };
25
+ type BlockComponentContextType = {
26
+ BlockCollapsible?: React.FC<{
27
+ children?: React.ReactNode;
28
+ editButton?: boolean;
29
+ /**
30
+ * Override the default label with a custom label
31
+ */
32
+ Label?: React.ReactNode;
33
+ removeButton?: boolean;
34
+ }>;
35
+ EditButton?: React.FC;
36
+ initialState: false | FormState | undefined;
37
+ nodeKey?: string;
38
+ RemoveButton?: React.FC;
39
+ };
40
+ export declare const useBlockComponentContext: () => BlockComponentContextType;
16
41
  /**
17
42
  * The actual content of the Block. This should be INSIDE a Form component,
18
43
  * scoped to the block. All format operations in here are thus scoped to the block's form, and
@@ -1 +1 @@
1
- {"version":3,"file":"BlockContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,WAAW,EAAmC,MAAM,SAAS,CAAA;AAiBxF,OAAO,KAAiC,MAAM,OAAO,CAAA;AAErD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA;AACrE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAMnE,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,WAAW,CAAA;IACxB,KAAK,EAAE,yBAAyB,CAAC,OAAO,CAAC,CAAA;IACzC,QAAQ,EAAE,WAAW,CAAA;IACrB,UAAU,EAAE,WAAW,EAAE,CAAA;IACzB,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,OAAO,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,MAAM,CAAA;IACZ,UAAU,EAAE,MAAM,CAAA;CACnB,CAAA;AAoBD;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAgLxC,CAAA"}
1
+ {"version":3,"file":"BlockContent.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAGrD,OAAO,KAAiC,MAAM,OAAO,CAAA;AAErD,KAAK,KAAK,GAAG;IACX,SAAS,EAAE,MAAM,CAAA;IACjB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAA;IACrB,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC;QACpB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB,UAAU,CAAC,EAAE,MAAM,CAAA;QACnB,cAAc,CAAC,EAAE,OAAO,CAAA;QACxB;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QACvB,YAAY,CAAC,EAAE,OAAO,CAAA;KACvB,CAAC,CAAA;IACF,WAAW,EAAE,KAAK,CAAC,SAAS,CAAA;IAC5B,UAAU,EAAE,KAAK,CAAC,EAAE,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,WAAW,EAAE,CAAA;IACzB,YAAY,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAA;IAE3C,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,KAAK,CAAC,EAAE,CAAA;CACvB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,gBAAgB,CAAC,EAAE,KAAK,CAAC,EAAE,CAAC;QAC1B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;QACpB;;WAEG;QACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;QACvB,YAAY,CAAC,EAAE,OAAO,CAAA;KACvB,CAAC,CAAA;IACF,UAAU,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACrB,YAAY,EAAE,KAAK,GAAG,SAAS,GAAG,SAAS,CAAA;IAE3C,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,YAAY,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;CACxB,CAAA;AAMD,eAAO,MAAM,wBAAwB,iCAAgD,CAAA;AAErF;;;;GAIG;AACH,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAmExC,CAAA"}
@@ -1,183 +1,88 @@
1
1
  'use client';
2
2
 
3
+ import { c as _c } from "react/compiler-runtime";
3
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
5
- import { getTranslation } from '@payloadcms/translations';
6
- import { Button, Collapsible, ErrorPill, Pill, RenderFields, SectionTitle, useDocumentInfo, useFormSubmitted, useTranslation } from '@payloadcms/ui';
7
- import { dequal } from 'dequal/lite';
8
- import { $getNodeByKey } from 'lexical';
9
- import React, { useCallback, useEffect } from 'react';
10
- import { $isBlockNode } from '../nodes/BlocksNode.js';
11
- import { FormSavePlugin } from './FormSavePlugin.js';
12
- // Recursively remove all undefined values from even being present in formData, as they will
13
- // cause isDeepEqual to return false if, for example, formData has a key that fields.data
14
- // does not have, even if it's undefined.
15
- // Currently, this happens if a block has another sub-blocks field. Inside formData, that sub-blocks field has an undefined blockName property.
16
- // Inside of fields.data however, that sub-blocks blockName property does not exist at all.
17
- function removeUndefinedAndNullAndEmptyArraysRecursively(obj) {
18
- for (const key in obj) {
19
- const value = obj[key];
20
- if (Array.isArray(value) && !value?.length) {
21
- delete obj[key];
22
- } else if (value && typeof value === 'object') {
23
- removeUndefinedAndNullAndEmptyArraysRecursively(value);
24
- } else if (value === undefined || value === null) {
25
- delete obj[key];
26
- }
27
- }
28
- }
5
+ import { RenderFields, useFormSubmitted } from '@payloadcms/ui';
6
+ import React, { createContext, useMemo } from 'react';
7
+ const BlockComponentContext = /*#__PURE__*/createContext({
8
+ initialState: false
9
+ });
10
+ export const useBlockComponentContext = () => {
11
+ return React.useContext(BlockComponentContext);
12
+ };
29
13
  /**
30
14
  * The actual content of the Block. This should be INSIDE a Form component,
31
15
  * scoped to the block. All format operations in here are thus scoped to the block's form, and
32
16
  * not the whole document.
33
17
  */
34
18
  export const BlockContent = props => {
19
+ const $ = _c(13);
35
20
  const {
36
- baseClass,
37
- clientBlock,
38
- field,
21
+ BlockDrawer,
22
+ Collapsible,
23
+ CustomBlock,
24
+ EditButton,
25
+ errorCount,
39
26
  formSchema,
40
- Label,
41
- nodeKey
42
- } = props;
43
- let {
44
- formData
27
+ initialState,
28
+ nodeKey,
29
+ RemoveButton
45
30
  } = props;
46
- const {
47
- i18n
48
- } = useTranslation();
49
- const [editor] = useLexicalComposerContext();
50
- // Used for saving collapsed to preferences (and gettin' it from there again)
51
- // Remember, these preferences are scoped to the whole document, not just this form. This
52
- // is important to consider for the data path used in setDocFieldPreferences
53
- const {
54
- getDocPreferences,
55
- setDocFieldPreferences
56
- } = useDocumentInfo();
57
- const [isCollapsed, setIsCollapsed] = React.useState();
58
- useEffect(() => {
59
- void getDocPreferences().then(currentDocPreferences => {
60
- const currentFieldPreferences = currentDocPreferences?.fields[field.name];
61
- const collapsedArray = currentFieldPreferences?.collapsed;
62
- setIsCollapsed(collapsedArray ? collapsedArray.includes(formData.id) : false);
63
- });
64
- }, [field.name, formData.id, getDocPreferences]);
65
31
  const hasSubmitted = useFormSubmitted();
66
- const [errorCount, setErrorCount] = React.useState(0);
67
32
  const fieldHasErrors = hasSubmitted && errorCount > 0;
68
- const classNames = [`${baseClass}__row`, fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`].filter(Boolean).join(' ');
69
- const onFormChange = useCallback(({
70
- fullFieldsWithValues,
71
- newFormData
72
- }) => {
73
- newFormData.id = formData.id;
74
- newFormData.blockType = formData.blockType;
75
- removeUndefinedAndNullAndEmptyArraysRecursively(newFormData);
76
- removeUndefinedAndNullAndEmptyArraysRecursively(formData);
77
- // Only update if the data has actually changed. Otherwise, we may be triggering an unnecessary value change,
78
- // which would trigger the "Leave without saving" dialog unnecessarily
79
- if (!dequal(formData, newFormData)) {
80
- // Running this in the next tick in the meantime fixes this issue: https://github.com/payloadcms/payload/issues/4108
81
- // I don't know why. When this is called immediately, it might focus out of a nested lexical editor field if an update is made there.
82
- // My hypothesis is that the nested editor might not have fully finished its update cycle yet. By updating in the next tick, we
83
- // ensure that the nested editor has finished its update cycle before we update the block node.
84
- setTimeout(() => {
85
- editor.update(() => {
86
- const node = $getNodeByKey(nodeKey);
87
- if (node && $isBlockNode(node)) {
88
- formData = newFormData;
89
- node.setFields(newFormData);
90
- }
91
- });
92
- }, 0);
93
- }
94
- // update error count
95
- if (hasSubmitted) {
96
- let rowErrorCount = 0;
97
- for (const formField of Object.values(fullFieldsWithValues)) {
98
- if (formField?.valid === false) {
99
- rowErrorCount++;
100
- }
101
- }
102
- setErrorCount(rowErrorCount);
103
- }
104
- }, [editor, nodeKey, hasSubmitted, formData]);
105
- const onCollapsedChange = useCallback(changedCollapsed => {
106
- void getDocPreferences().then(currentDocPreferences_0 => {
107
- const currentFieldPreferences_0 = currentDocPreferences_0?.fields[field.name];
108
- const collapsedArray_0 = currentFieldPreferences_0?.collapsed;
109
- const newCollapsed = collapsedArray_0 && collapsedArray_0?.length ? collapsedArray_0 : [];
110
- if (changedCollapsed) {
111
- if (!newCollapsed.includes(formData.id)) {
112
- newCollapsed.push(formData.id);
113
- }
114
- } else {
115
- if (newCollapsed.includes(formData.id)) {
116
- newCollapsed.splice(newCollapsed.indexOf(formData.id), 1);
117
- }
118
- }
119
- setDocFieldPreferences(field.name, {
120
- collapsed: newCollapsed,
121
- hello: 'hi'
122
- });
123
- });
124
- }, [getDocPreferences, field.name, setDocFieldPreferences, formData.id]);
125
- const removeBlock = useCallback(() => {
126
- editor.update(() => {
127
- $getNodeByKey(nodeKey)?.remove();
33
+ let t0;
34
+ let t1;
35
+ if ($[0] !== Collapsible || $[1] !== errorCount || $[2] !== fieldHasErrors) {
36
+ t1 = props_0 => _jsx(Collapsible, {
37
+ editButton: props_0.editButton,
38
+ errorCount,
39
+ fieldHasErrors,
40
+ Label: props_0.Label,
41
+ removeButton: props_0.removeButton,
42
+ children: props_0.children
128
43
  });
129
- }, [editor, nodeKey]);
130
- if (typeof isCollapsed !== 'boolean') {
131
- return null;
44
+ $[0] = Collapsible;
45
+ $[1] = errorCount;
46
+ $[2] = fieldHasErrors;
47
+ $[3] = t1;
48
+ } else {
49
+ t1 = $[3];
132
50
  }
133
- return /*#__PURE__*/_jsxs(React.Fragment, {
134
- children: [/*#__PURE__*/_jsx(Collapsible, {
135
- className: classNames,
136
- collapsibleStyle: fieldHasErrors ? 'error' : 'default',
137
- header: Label || /*#__PURE__*/_jsxs("div", {
138
- className: `${baseClass}__block-header`,
139
- children: [/*#__PURE__*/_jsxs("div", {
140
- children: [/*#__PURE__*/_jsx(Pill, {
141
- className: `${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`,
142
- pillStyle: "white",
143
- children: typeof clientBlock?.labels?.singular === 'string' ? getTranslation(clientBlock?.labels.singular, i18n) : clientBlock.slug
144
- }), /*#__PURE__*/_jsx(SectionTitle, {
145
- path: "blockName",
146
- readOnly: field?.admin?.readOnly || false
147
- }), fieldHasErrors && /*#__PURE__*/_jsx(ErrorPill, {
148
- count: errorCount,
149
- i18n: i18n,
150
- withMessage: true
151
- })]
152
- }), editor.isEditable() && /*#__PURE__*/_jsx(Button, {
153
- buttonStyle: "icon-label",
154
- className: `${baseClass}__removeButton`,
155
- disabled: field?.admin?.readOnly,
156
- icon: "x",
157
- onClick: e => {
158
- e.preventDefault();
159
- removeBlock();
160
- },
161
- round: true,
162
- tooltip: "Remove Block"
163
- })]
164
- }),
165
- isCollapsed: isCollapsed,
166
- onToggle: incomingCollapsedState => {
167
- onCollapsedChange(incomingCollapsedState);
168
- setIsCollapsed(incomingCollapsedState);
51
+ t0 = t1;
52
+ const CollapsibleWithErrorProps = t0;
53
+ let t2;
54
+ if ($[4] !== CustomBlock || $[5] !== CollapsibleWithErrorProps || $[6] !== EditButton || $[7] !== initialState || $[8] !== nodeKey || $[9] !== RemoveButton || $[10] !== BlockDrawer || $[11] !== formSchema) {
55
+ t2 = CustomBlock ? _jsxs(BlockComponentContext.Provider, {
56
+ value: {
57
+ BlockCollapsible: CollapsibleWithErrorProps,
58
+ EditButton,
59
+ initialState,
60
+ nodeKey,
61
+ RemoveButton
169
62
  },
170
- children: /*#__PURE__*/_jsx(RenderFields, {
63
+ children: [CustomBlock, _jsx(BlockDrawer, {})]
64
+ }) : _jsx(CollapsibleWithErrorProps, {
65
+ children: _jsx(RenderFields, {
171
66
  fields: formSchema,
172
67
  forceRender: true,
173
68
  parentIndexPath: "",
174
- parentPath: '',
69
+ parentPath: "",
175
70
  parentSchemaPath: "",
176
71
  permissions: true
177
72
  })
178
- }, 0), /*#__PURE__*/_jsx(FormSavePlugin, {
179
- onChange: onFormChange
180
- })]
181
- });
73
+ });
74
+ $[4] = CustomBlock;
75
+ $[5] = CollapsibleWithErrorProps;
76
+ $[6] = EditButton;
77
+ $[7] = initialState;
78
+ $[8] = nodeKey;
79
+ $[9] = RemoveButton;
80
+ $[10] = BlockDrawer;
81
+ $[11] = formSchema;
82
+ $[12] = t2;
83
+ } else {
84
+ t2 = $[12];
85
+ }
86
+ return t2;
182
87
  };
183
88
  //# sourceMappingURL=BlockContent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"BlockContent.js","names":["useLexicalComposerContext","getTranslation","Button","Collapsible","ErrorPill","Pill","RenderFields","SectionTitle","useDocumentInfo","useFormSubmitted","useTranslation","dequal","$getNodeByKey","React","useCallback","useEffect","$isBlockNode","FormSavePlugin","removeUndefinedAndNullAndEmptyArraysRecursively","obj","key","value","Array","isArray","length","undefined","BlockContent","props","baseClass","clientBlock","field","formSchema","Label","nodeKey","formData","i18n","editor","getDocPreferences","setDocFieldPreferences","isCollapsed","setIsCollapsed","useState","then","currentDocPreferences","currentFieldPreferences","fields","name","collapsedArray","collapsed","includes","id","hasSubmitted","errorCount","setErrorCount","fieldHasErrors","classNames","filter","Boolean","join","onFormChange","fullFieldsWithValues","newFormData","blockType","setTimeout","update","node","setFields","rowErrorCount","formField","Object","values","valid","onCollapsedChange","changedCollapsed","newCollapsed","push","splice","indexOf","hello","removeBlock","remove","_jsxs","Fragment","_jsx","className","collapsibleStyle","header","pillStyle","labels","singular","slug","path","readOnly","admin","count","withMessage","isEditable","buttonStyle","disabled","icon","onClick","e","preventDefault","round","tooltip","onToggle","incomingCollapsedState","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions","onChange"],"sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"sourcesContent":["'use client'\nimport type { ClientBlock, ClientField, CollapsedPreferences, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Collapsible,\n ErrorPill,\n Pill,\n RenderFields,\n SectionTitle,\n useDocumentInfo,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui'\nimport { dequal } from 'dequal/lite'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback, useEffect } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../../../../types.js'\nimport type { BlockFields } from '../../server/nodes/BlocksNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { $isBlockNode } from '../nodes/BlocksNode.js'\nimport { FormSavePlugin } from './FormSavePlugin.js'\n\ntype Props = {\n baseClass: string\n clientBlock: ClientBlock\n field: LexicalRichTextFieldProps['field']\n formData: BlockFields\n formSchema: ClientField[]\n Label?: React.ReactNode\n nodeKey: string\n path: string\n schemaPath: string\n}\n\n// Recursively remove all undefined values from even being present in formData, as they will\n// cause isDeepEqual to return false if, for example, formData has a key that fields.data\n// does not have, even if it's undefined.\n// Currently, this happens if a block has another sub-blocks field. Inside formData, that sub-blocks field has an undefined blockName property.\n// Inside of fields.data however, that sub-blocks blockName property does not exist at all.\nfunction removeUndefinedAndNullAndEmptyArraysRecursively(obj: object) {\n for (const key in obj) {\n const value = obj[key]\n if (Array.isArray(value) && !value?.length) {\n delete obj[key]\n } else if (value && typeof value === 'object') {\n removeUndefinedAndNullAndEmptyArraysRecursively(value)\n } else if (value === undefined || value === null) {\n delete obj[key]\n }\n }\n}\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<Props> = (props) => {\n const { baseClass, clientBlock, field, formSchema, Label, nodeKey } = props\n let { formData } = props\n\n const { i18n } = useTranslation()\n const [editor] = useLexicalComposerContext()\n // Used for saving collapsed to preferences (and gettin' it from there again)\n // Remember, these preferences are scoped to the whole document, not just this form. This\n // is important to consider for the data path used in setDocFieldPreferences\n const { getDocPreferences, setDocFieldPreferences } = useDocumentInfo()\n\n const [isCollapsed, setIsCollapsed] = React.useState<boolean>()\n\n useEffect(() => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n const collapsedArray = currentFieldPreferences?.collapsed\n setIsCollapsed(collapsedArray ? collapsedArray.includes(formData.id) : false)\n })\n }, [field.name, formData.id, getDocPreferences])\n\n const hasSubmitted = useFormSubmitted()\n\n const [errorCount, setErrorCount] = React.useState(0)\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n const onFormChange = useCallback(\n ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: BlockFields\n }) => {\n newFormData.id = formData.id\n newFormData.blockType = formData.blockType\n\n removeUndefinedAndNullAndEmptyArraysRecursively(newFormData)\n removeUndefinedAndNullAndEmptyArraysRecursively(formData)\n\n // Only update if the data has actually changed. Otherwise, we may be triggering an unnecessary value change,\n // which would trigger the \"Leave without saving\" dialog unnecessarily\n if (!dequal(formData, newFormData)) {\n // Running this in the next tick in the meantime fixes this issue: https://github.com/payloadcms/payload/issues/4108\n // I don't know why. When this is called immediately, it might focus out of a nested lexical editor field if an update is made there.\n // My hypothesis is that the nested editor might not have fully finished its update cycle yet. By updating in the next tick, we\n // ensure that the nested editor has finished its update cycle before we update the block node.\n setTimeout(() => {\n editor.update(() => {\n const node = $getNodeByKey(nodeKey)\n if (node && $isBlockNode(node)) {\n formData = newFormData\n node.setFields(newFormData)\n }\n })\n }, 0)\n }\n\n // update error count\n if (hasSubmitted) {\n let rowErrorCount = 0\n for (const formField of Object.values(fullFieldsWithValues)) {\n if (formField?.valid === false) {\n rowErrorCount++\n }\n }\n setErrorCount(rowErrorCount)\n }\n },\n [editor, nodeKey, hasSubmitted, formData],\n )\n\n const onCollapsedChange = useCallback(\n (changedCollapsed: boolean) => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n const newCollapsed: CollapsedPreferences =\n collapsedArray && collapsedArray?.length ? collapsedArray : []\n\n if (changedCollapsed) {\n if (!newCollapsed.includes(formData.id)) {\n newCollapsed.push(formData.id)\n }\n } else {\n if (newCollapsed.includes(formData.id)) {\n newCollapsed.splice(newCollapsed.indexOf(formData.id), 1)\n }\n }\n\n setDocFieldPreferences(field.name, {\n collapsed: newCollapsed,\n hello: 'hi',\n })\n })\n },\n [getDocPreferences, field.name, setDocFieldPreferences, formData.id],\n )\n\n const removeBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n if (typeof isCollapsed !== 'boolean') {\n return null\n }\n\n return (\n <React.Fragment>\n <Collapsible\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n Label || (\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {typeof clientBlock?.labels?.singular === 'string'\n ? getTranslation(clientBlock?.labels.singular, i18n)\n : clientBlock.slug}\n </Pill>\n <SectionTitle path=\"blockName\" readOnly={field?.admin?.readOnly || false} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n {editor.isEditable() && (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.admin?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeBlock()\n }}\n round\n tooltip=\"Remove Block\"\n />\n )}\n </div>\n )\n }\n isCollapsed={isCollapsed}\n key={0}\n onToggle={(incomingCollapsedState) => {\n onCollapsedChange(incomingCollapsedState)\n setIsCollapsed(incomingCollapsedState)\n }}\n >\n <RenderFields\n fields={formSchema}\n forceRender={true}\n parentIndexPath=\"\"\n parentPath={''}\n parentSchemaPath=\"\"\n permissions={true}\n />\n </Collapsible>\n\n <FormSavePlugin onChange={onFormChange} />\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,WAAW,EACXC,SAAS,EACTC,IAAI,EACJC,YAAY,EACZC,YAAY,EACZC,eAAe,EACfC,gBAAgB,EAChBC,cAAc,QACT;AACP,SAASC,MAAM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AWC,sBAAA;QACTlC,iBAAA,CAAkBkC,sBAAA;QAClBlE,cAAA,CAAekE,sBAAA;MACjB;gBAEA,aAAAvB,IAAA,CAAC7E,YAAA;QACCuC,MAAA,EAAQd,UAAA;QACR4E,WAAA,EAAa;QACbC,eAAA,EAAgB;QAChBC,UAAA,EAAY;QACZC,gBAAA,EAAiB;QACjBC,WAAA,EAAa;;OAZV,I,aAgBP5B,IAAA,CAAClE,cAAA;MAAe+F,QAAA,EAAUrD;;;AAGhC","ignoreList":[]}
1
+ {"version":3,"file":"BlockContent.js","names":["c","_c","RenderFields","useFormSubmitted","React","createContext","useMemo","BlockComponentContext","initialState","useBlockComponentContext","useContext","BlockContent","props","$","BlockDrawer","Collapsible","CustomBlock","EditButton","errorCount","formSchema","nodeKey","RemoveButton","hasSubmitted","fieldHasErrors","t0","t1","props_0","_jsx","editButton","Label","removeButton","children","CollapsibleWithErrorProps","t2","_jsxs","Provider","value","BlockCollapsible","fields","forceRender","parentIndexPath","parentPath","parentSchemaPath","permissions"],"sources":["../../../../../src/features/blocks/client/component/BlockContent.tsx"],"sourcesContent":["'use client'\nimport type { ClientField, FormState } from 'payload'\n\nimport { RenderFields, useFormSubmitted } from '@payloadcms/ui'\nimport React, { createContext, useMemo } from 'react'\n\ntype Props = {\n baseClass: string\n BlockDrawer: React.FC\n Collapsible: React.FC<{\n children?: React.ReactNode\n editButton?: boolean\n errorCount?: number\n fieldHasErrors?: boolean\n /**\n * Override the default label with a custom label\n */\n Label?: React.ReactNode\n removeButton?: boolean\n }>\n CustomBlock: React.ReactNode\n EditButton: React.FC\n errorCount: number\n formSchema: ClientField[]\n initialState: false | FormState | undefined\n\n nodeKey: string\n RemoveButton: React.FC\n}\n\ntype BlockComponentContextType = {\n BlockCollapsible?: React.FC<{\n children?: React.ReactNode\n editButton?: boolean\n /**\n * Override the default label with a custom label\n */\n Label?: React.ReactNode\n removeButton?: boolean\n }>\n EditButton?: React.FC\n initialState: false | FormState | undefined\n\n nodeKey?: string\n RemoveButton?: React.FC\n}\n\nconst BlockComponentContext = createContext<BlockComponentContextType>({\n initialState: false,\n})\n\nexport const useBlockComponentContext = () => React.useContext(BlockComponentContext)\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<Props> = (props) => {\n const {\n BlockDrawer,\n Collapsible,\n CustomBlock,\n EditButton,\n errorCount,\n formSchema,\n initialState,\n nodeKey,\n RemoveButton,\n } = props\n\n const hasSubmitted = useFormSubmitted()\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const CollapsibleWithErrorProps = useMemo(\n () =>\n (props: {\n children?: React.ReactNode\n editButton?: boolean\n\n /**\n * Override the default label with a custom label\n */\n Label?: React.ReactNode\n removeButton?: boolean\n }) => (\n <Collapsible\n editButton={props.editButton}\n errorCount={errorCount}\n fieldHasErrors={fieldHasErrors}\n Label={props.Label}\n removeButton={props.removeButton}\n >\n {props.children}\n </Collapsible>\n ),\n [Collapsible, fieldHasErrors, errorCount],\n )\n\n return CustomBlock ? (\n <BlockComponentContext.Provider\n value={{\n BlockCollapsible: CollapsibleWithErrorProps,\n EditButton,\n initialState,\n nodeKey,\n RemoveButton,\n }}\n >\n {CustomBlock}\n <BlockDrawer />\n </BlockComponentContext.Provider>\n ) : (\n <CollapsibleWithErrorProps>\n <RenderFields\n fields={formSchema}\n forceRender={true}\n parentIndexPath=\"\"\n parentPath={''}\n parentSchemaPath=\"\"\n permissions={true}\n />\n </CollapsibleWithErrorProps>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,YAAY,EAAEC,gBAAgB,QAAQ;AAC/C,OAAOC,KAAA,IAASC,aAAa,EAAEC,OAAO,QAAQ;AA2C9C,MAAMC,qBAAA,gBAAwBF,aAAA,CAAyC;EACrEG,YAAA,EAAc;AAChB;AAEA,OAAO,MAAMC,wBAAA,GAA2BA,CAAA;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f,WAAA,EACDW,IAAA,CAACb,WAAA;IAAA,C,IAGHa,IAAA,CAACK,yBAAA;MAAAD,QAAA,EACCJ,IAAA,CAAAzB,YAAA;QAAAoC,MAAA,EACUnB,UAAA;QAAAoB,WAAA;QAAAC,eAAA,EAEQ;QAAAC,UAAA,EACJ;QAAAC,gBAAA,EACK;QAAAC,WAAA;MAAA,C;;;;;;;;;;;;;;SApBhBV,E;CAyBT","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ import React from 'react';
2
+ export declare const BlockCollapsible: React.FC<{
3
+ children?: React.ReactNode;
4
+ editButton?: boolean;
5
+ /**
6
+ * Override the default label with a custom label
7
+ */
8
+ Label?: React.ReactNode;
9
+ removeButton?: boolean;
10
+ }>;
11
+ //# sourceMappingURL=BlockCollapsible.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockCollapsible.d.ts","sourceRoot":"","sources":["../../../../../../src/features/blocks/client/component/components/BlockCollapsible.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,gBAAgB,EAAE,KAAK,CAAC,EAAE,CAAC;IACtC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAA;IAEpB;;OAEG;IACH,KAAK,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACvB,YAAY,CAAC,EAAE,OAAO,CAAA;CACvB,CAQA,CAAA"}
@@ -0,0 +1,37 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import React from 'react';
6
+ import { useBlockComponentContext } from '../BlockContent.js';
7
+ export const BlockCollapsible = t0 => {
8
+ const $ = _c(6);
9
+ const {
10
+ children,
11
+ editButton,
12
+ Label,
13
+ removeButton
14
+ } = t0;
15
+ const {
16
+ BlockCollapsible
17
+ } = useBlockComponentContext();
18
+ let t1;
19
+ if ($[0] !== BlockCollapsible || $[1] !== editButton || $[2] !== Label || $[3] !== removeButton || $[4] !== children) {
20
+ t1 = BlockCollapsible ? _jsx(BlockCollapsible, {
21
+ editButton,
22
+ Label,
23
+ removeButton,
24
+ children
25
+ }) : null;
26
+ $[0] = BlockCollapsible;
27
+ $[1] = editButton;
28
+ $[2] = Label;
29
+ $[3] = removeButton;
30
+ $[4] = children;
31
+ $[5] = t1;
32
+ } else {
33
+ t1 = $[5];
34
+ }
35
+ return t1;
36
+ };
37
+ //# sourceMappingURL=BlockCollapsible.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockCollapsible.js","names":["c","_c","React","useBlockComponentContext","BlockCollapsible","t0","$","children","editButton","Label","removeButton","t1","_jsx"],"sources":["../../../../../../src/features/blocks/client/component/components/BlockCollapsible.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockCollapsible: React.FC<{\n children?: React.ReactNode\n editButton?: boolean\n\n /**\n * Override the default label with a custom label\n */\n Label?: React.ReactNode\n removeButton?: boolean\n}> = ({ children, editButton, Label, removeButton }) => {\n const { BlockCollapsible } = useBlockComponentContext()\n\n return BlockCollapsible ? (\n <BlockCollapsible editButton={editButton} Label={Label} removeButton={removeButton}>\n {children}\n </BlockCollapsible>\n ) : null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,MAAW;AAElB,SAASC,wBAAwB,QAAQ;AAEzC,OAAO,MAAMC,gBAAA,GASRC,EAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EAAC;IAAAM,QAAA;IAAAC,UAAA;IAAAC,KAAA;IAAAC;EAAA,IAAAL,EAA6C;EACjD;IAAAD;EAAA,IAA6BD,wBAAA;EAAA,IAAAQ,EAAA;EAAA,IAAAL,CAAA,QAAAF,gBAAA,IAAAE,CAAA,QAAAE,UAAA,IAAAF,CAAA,QAAAG,KAAA,IAAAH,CAAA,QAAAI,YAAA,IAAAJ,CAAA,QAAAC,QAAA;IAEtBI,EAAA,GAAAP,gBAAA,GACLQ,IAAA,CAACR,gBAAA;MAAAI,UAAA;MAAAC,KAAA;MAAAC,YAAA;MAAAH;IAAA,C,QAGC;IAAAD,CAAA,MAAAF,gBAAA;IAAAE,CAAA,MAAAE,UAAA;IAAAF,CAAA,MAAAG,KAAA;IAAAH,CAAA,MAAAI,YAAA;IAAAJ,CAAA,MAAAC,QAAA;IAAAD,CAAA,MAAAK,EAAA;EAAA;IAAAA,EAAA,GAAAL,CAAA;EAAA;EAAA,OAJGK,EAIH;AAAA,CACN","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const BlockEditButton: () => React.JSX.Element | null;
3
+ //# sourceMappingURL=BlockEditButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockEditButton.d.ts","sourceRoot":"","sources":["../../../../../../src/features/blocks/client/component/components/BlockEditButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,eAAe,gCAI3B,CAAA"}
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import React from 'react';
6
+ import { useBlockComponentContext } from '../BlockContent.js';
7
+ export const BlockEditButton = () => {
8
+ const $ = _c(2);
9
+ const {
10
+ EditButton
11
+ } = useBlockComponentContext();
12
+ let t0;
13
+ if ($[0] !== EditButton) {
14
+ t0 = EditButton ? _jsx(EditButton, {}) : null;
15
+ $[0] = EditButton;
16
+ $[1] = t0;
17
+ } else {
18
+ t0 = $[1];
19
+ }
20
+ return t0;
21
+ };
22
+ //# sourceMappingURL=BlockEditButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockEditButton.js","names":["c","_c","React","useBlockComponentContext","BlockEditButton","$","EditButton","t0","_jsx"],"sources":["../../../../../../src/features/blocks/client/component/components/BlockEditButton.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockEditButton = () => {\n const { EditButton } = useBlockComponentContext()\n\n return EditButton ? <EditButton /> : null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,MAAW;AAElB,SAASC,wBAAwB,QAAQ;AAEzC,OAAO,MAAMC,eAAA,GAAkBA,CAAA;EAAA,MAAAC,CAAA,GAAAJ,EAAA;EAC7B;IAAAK;EAAA,IAAuBH,wBAAA;EAAA,IAAAI,EAAA;EAAA,IAAAF,CAAA,QAAAC,UAAA;IAEhBC,EAAA,GAAAD,UAAA,GAAaE,IAAA,CAACF,UAAA,YAAgB;IAAAD,CAAA,MAAAC,UAAA;IAAAD,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EAAA,OAA9BE,EAA8B;AAAA,CACvC","ignoreList":[]}
@@ -0,0 +1,3 @@
1
+ import React from 'react';
2
+ export declare const BlockRemoveButton: () => React.JSX.Element | null;
3
+ //# sourceMappingURL=BlockRemoveButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockRemoveButton.d.ts","sourceRoot":"","sources":["../../../../../../src/features/blocks/client/component/components/BlockRemoveButton.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,MAAM,OAAO,CAAA;AAIzB,eAAO,MAAM,iBAAiB,gCAI7B,CAAA"}
@@ -0,0 +1,22 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { jsx as _jsx } from "react/jsx-runtime";
5
+ import React from 'react';
6
+ import { useBlockComponentContext } from '../BlockContent.js';
7
+ export const BlockRemoveButton = () => {
8
+ const $ = _c(2);
9
+ const {
10
+ RemoveButton
11
+ } = useBlockComponentContext();
12
+ let t0;
13
+ if ($[0] !== RemoveButton) {
14
+ t0 = RemoveButton ? _jsx(RemoveButton, {}) : null;
15
+ $[0] = RemoveButton;
16
+ $[1] = t0;
17
+ } else {
18
+ t0 = $[1];
19
+ }
20
+ return t0;
21
+ };
22
+ //# sourceMappingURL=BlockRemoveButton.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BlockRemoveButton.js","names":["c","_c","React","useBlockComponentContext","BlockRemoveButton","$","RemoveButton","t0","_jsx"],"sources":["../../../../../../src/features/blocks/client/component/components/BlockRemoveButton.tsx"],"sourcesContent":["'use client'\nimport React from 'react'\n\nimport { useBlockComponentContext } from '../BlockContent.js'\n\nexport const BlockRemoveButton = () => {\n const { RemoveButton } = useBlockComponentContext()\n\n return RemoveButton ? <RemoveButton /> : null\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,MAAW;AAElB,SAASC,wBAAwB,QAAQ;AAEzC,OAAO,MAAMC,iBAAA,GAAoBA,CAAA;EAAA,MAAAC,CAAA,GAAAJ,EAAA;EAC/B;IAAAK;EAAA,IAAyBH,wBAAA;EAAA,IAAAI,EAAA;EAAA,IAAAF,CAAA,QAAAC,YAAA;IAElBC,EAAA,GAAAD,YAAA,GAAeE,IAAA,CAACF,YAAA,YAAkB;IAAAD,CAAA,MAAAC,YAAA;IAAAD,CAAA,MAAAE,EAAA;EAAA;IAAAA,EAAA,GAAAF,CAAA;EAAA;EAAA,OAAlCE,EAAkC;AAAA,CAC3C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/index.tsx"],"names":[],"mappings":"AAcA,OAAO,KAA4D,MAAM,OAAO,CAAA;AAOhF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAInE,OAAO,cAAc,CAAA;AAErB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CAsM1C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/blocks/client/component/index.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAkD,MAAM,OAAO,CAAA;AAStE,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kCAAkC,CAAA;AAMnE,OAAO,cAAc,CAAA;AAGrB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IACnC,QAAQ,CAAC,QAAQ,EAAE,WAAW,CAAA;IAC9B,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CACzB,CAAA;AAED,eAAO,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,KAAK,CA4c1C,CAAA"}