@payloadcms/richtext-lexical 3.0.0-beta.84 → 3.0.0-beta.86

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 (757) hide show
  1. package/dist/cell/index.js +117 -127
  2. package/dist/cell/index.js.map +1 -1
  3. package/dist/exports/client/Component-DOSSWC76.js +2 -0
  4. package/dist/exports/client/Component-DOSSWC76.js.map +7 -0
  5. package/dist/exports/client/Component-MBLHTKDK.js +2 -0
  6. package/dist/exports/client/Component-MBLHTKDK.js.map +7 -0
  7. package/dist/exports/client/Field-KUSPHC7Q.js +2 -0
  8. package/dist/exports/client/Field-KUSPHC7Q.js.map +7 -0
  9. package/dist/exports/client/RelationshipComponent-3QWBV4GT.js +2 -0
  10. package/dist/exports/client/RelationshipComponent-3QWBV4GT.js.map +7 -0
  11. package/dist/exports/client/bundled.css +1 -1
  12. package/dist/exports/client/chunk-G5DTIOPI.js +2 -0
  13. package/dist/exports/client/chunk-G5DTIOPI.js.map +7 -0
  14. package/dist/exports/client/chunk-LGUXX2QH.js +2 -0
  15. package/dist/exports/client/chunk-LGUXX2QH.js.map +7 -0
  16. package/dist/exports/client/chunk-NI6Z4GBD.js +2 -0
  17. package/dist/exports/client/{chunk-SQHN3N6E.js.map → chunk-NI6Z4GBD.js.map} +2 -2
  18. package/dist/exports/client/chunk-OKMIHD2R.js +2 -0
  19. package/dist/exports/client/chunk-OKMIHD2R.js.map +7 -0
  20. package/dist/exports/client/chunk-TO2W7Q2G.js +2 -0
  21. package/dist/exports/client/chunk-TO2W7Q2G.js.map +7 -0
  22. package/dist/exports/client/chunk-V2LKLT2F.js +3 -0
  23. package/dist/exports/client/chunk-V2LKLT2F.js.map +7 -0
  24. package/dist/exports/client/component-3OFD6Q4Z.js +2 -0
  25. package/dist/exports/client/component-3OFD6Q4Z.js.map +7 -0
  26. package/dist/exports/client/component-LCAAX56T.js +2 -0
  27. package/dist/exports/client/component-LCAAX56T.js.map +7 -0
  28. package/dist/exports/client/component-LLWMZU6K.js +2 -0
  29. package/dist/exports/client/component-LLWMZU6K.js.map +7 -0
  30. package/dist/exports/client/componentInline-72VZAAHP.js +2 -0
  31. package/dist/exports/client/componentInline-72VZAAHP.js.map +7 -0
  32. package/dist/exports/client/index.js +9 -9
  33. package/dist/exports/client/index.js.map +3 -3
  34. package/dist/exports/server/migrate.js +0 -1
  35. package/dist/exports/server/migrate.js.map +1 -1
  36. package/dist/features/align/client/index.js +151 -134
  37. package/dist/features/align/client/index.js.map +1 -1
  38. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  39. package/dist/features/align/client/toolbarAlignGroup.js +10 -9
  40. package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
  41. package/dist/features/align/server/i18n.js +192 -193
  42. package/dist/features/align/server/i18n.js.map +1 -1
  43. package/dist/features/align/server/index.js +5 -6
  44. package/dist/features/align/server/index.js.map +1 -1
  45. package/dist/features/blockquote/client/index.js +60 -65
  46. package/dist/features/blockquote/client/index.js.map +1 -1
  47. package/dist/features/blockquote/markdownTransformer.js +28 -34
  48. package/dist/features/blockquote/markdownTransformer.js.map +1 -1
  49. package/dist/features/blockquote/server/i18n.js +96 -97
  50. package/dist/features/blockquote/server/i18n.js.map +1 -1
  51. package/dist/features/blockquote/server/index.js +38 -37
  52. package/dist/features/blockquote/server/index.js.map +1 -1
  53. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  54. package/dist/features/blocks/client/component/BlockContent.js +166 -172
  55. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  56. package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +1 -1
  57. package/dist/features/blocks/client/component/FormSavePlugin.js +46 -22
  58. package/dist/features/blocks/client/component/FormSavePlugin.js.map +1 -1
  59. package/dist/features/blocks/client/component/index.js +130 -142
  60. package/dist/features/blocks/client/component/index.js.map +1 -1
  61. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +1 -1
  62. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +12 -8
  63. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +1 -1
  64. package/dist/features/blocks/client/componentInline/index.js +106 -122
  65. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  66. package/dist/features/blocks/client/index.js +149 -142
  67. package/dist/features/blocks/client/index.js.map +1 -1
  68. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  69. package/dist/features/blocks/client/nodes/BlocksNode.js +41 -40
  70. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  71. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  72. package/dist/features/blocks/client/nodes/InlineBlocksNode.js +31 -30
  73. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  74. package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -1
  75. package/dist/features/blocks/client/plugin/commands.js +2 -1
  76. package/dist/features/blocks/client/plugin/commands.js.map +1 -1
  77. package/dist/features/blocks/client/plugin/index.js +179 -106
  78. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  79. package/dist/features/blocks/server/graphQLPopulationPromise.js +41 -28
  80. package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
  81. package/dist/features/blocks/server/i18n.js +288 -289
  82. package/dist/features/blocks/server/i18n.js.map +1 -1
  83. package/dist/features/blocks/server/index.js +149 -151
  84. package/dist/features/blocks/server/index.js.map +1 -1
  85. package/dist/features/blocks/server/nodes/BlocksNode.js +76 -73
  86. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  87. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +78 -76
  88. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  89. package/dist/features/blocks/server/validate.js +45 -34
  90. package/dist/features/blocks/server/validate.js.map +1 -1
  91. package/dist/features/converters/html/converter/converters/linebreak.js +4 -7
  92. package/dist/features/converters/html/converter/converters/linebreak.js.map +1 -1
  93. package/dist/features/converters/html/converter/converters/paragraph.js +24 -19
  94. package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
  95. package/dist/features/converters/html/converter/converters/text.js +28 -29
  96. package/dist/features/converters/html/converter/converters/text.js.map +1 -1
  97. package/dist/features/converters/html/converter/defaultConverters.js +1 -6
  98. package/dist/features/converters/html/converter/defaultConverters.js.map +1 -1
  99. package/dist/features/converters/html/converter/index.js +66 -51
  100. package/dist/features/converters/html/converter/index.js.map +1 -1
  101. package/dist/features/converters/html/converter/types.js +1 -2
  102. package/dist/features/converters/html/converter/types.js.map +1 -1
  103. package/dist/features/converters/html/field/index.js +134 -139
  104. package/dist/features/converters/html/field/index.js.map +1 -1
  105. package/dist/features/converters/html/index.js +2 -3
  106. package/dist/features/converters/html/index.js.map +1 -1
  107. package/dist/features/createClientComponent.js +7 -6
  108. package/dist/features/createClientComponent.js.map +1 -1
  109. package/dist/features/createFeaturePropComponent.js +14 -13
  110. package/dist/features/createFeaturePropComponent.js.map +1 -1
  111. package/dist/features/debug/testRecorder/client/index.js +5 -7
  112. package/dist/features/debug/testRecorder/client/index.js.map +1 -1
  113. package/dist/features/debug/testRecorder/client/plugin/index.js +518 -402
  114. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  115. package/dist/features/debug/testRecorder/server/index.js +4 -5
  116. package/dist/features/debug/testRecorder/server/index.js.map +1 -1
  117. package/dist/features/debug/treeView/client/index.js +5 -7
  118. package/dist/features/debug/treeView/client/index.js.map +1 -1
  119. package/dist/features/debug/treeView/client/plugin/index.js +21 -11
  120. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  121. package/dist/features/debug/treeView/server/index.js +4 -5
  122. package/dist/features/debug/treeView/server/index.js.map +1 -1
  123. package/dist/features/experimental_table/client/index.js +41 -58
  124. package/dist/features/experimental_table/client/index.js.map +1 -1
  125. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +714 -560
  126. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  127. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +295 -301
  128. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  129. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -7
  130. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
  131. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +228 -159
  132. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  133. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
  134. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  135. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +129 -82
  136. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  137. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +1 -1
  138. package/dist/features/experimental_table/client/utils/debounce.js +108 -89
  139. package/dist/features/experimental_table/client/utils/debounce.js.map +1 -1
  140. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +1 -1
  141. package/dist/features/experimental_table/client/utils/useDebounce.js +11 -13
  142. package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
  143. package/dist/features/experimental_table/server/index.js +127 -114
  144. package/dist/features/experimental_table/server/index.js.map +1 -1
  145. package/dist/features/format/bold/feature.client.js +34 -35
  146. package/dist/features/format/bold/feature.client.js.map +1 -1
  147. package/dist/features/format/bold/feature.server.js +14 -18
  148. package/dist/features/format/bold/feature.server.js.map +1 -1
  149. package/dist/features/format/bold/markdownTransformers.js +14 -25
  150. package/dist/features/format/bold/markdownTransformers.js.map +1 -1
  151. package/dist/features/format/inlineCode/feature.client.js +26 -28
  152. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  153. package/dist/features/format/inlineCode/feature.server.js +5 -8
  154. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  155. package/dist/features/format/inlineCode/markdownTransformers.js +3 -6
  156. package/dist/features/format/inlineCode/markdownTransformers.js.map +1 -1
  157. package/dist/features/format/italic/feature.client.js +26 -29
  158. package/dist/features/format/italic/feature.client.js.map +1 -1
  159. package/dist/features/format/italic/feature.server.js +5 -9
  160. package/dist/features/format/italic/feature.server.js.map +1 -1
  161. package/dist/features/format/italic/markdownTransformers.js +7 -12
  162. package/dist/features/format/italic/markdownTransformers.js.map +1 -1
  163. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  164. package/dist/features/format/shared/toolbarFormatGroup.js +9 -8
  165. package/dist/features/format/shared/toolbarFormatGroup.js.map +1 -1
  166. package/dist/features/format/strikethrough/feature.client.js +26 -28
  167. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  168. package/dist/features/format/strikethrough/feature.server.js +5 -8
  169. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  170. package/dist/features/format/strikethrough/markdownTransformers.js +3 -6
  171. package/dist/features/format/strikethrough/markdownTransformers.js.map +1 -1
  172. package/dist/features/format/subscript/feature.client.js +25 -25
  173. package/dist/features/format/subscript/feature.client.js.map +1 -1
  174. package/dist/features/format/subscript/feature.server.js +4 -5
  175. package/dist/features/format/subscript/feature.server.js.map +1 -1
  176. package/dist/features/format/superscript/feature.client.js +25 -25
  177. package/dist/features/format/superscript/feature.client.js.map +1 -1
  178. package/dist/features/format/superscript/feature.server.js +4 -5
  179. package/dist/features/format/superscript/feature.server.js.map +1 -1
  180. package/dist/features/format/underline/feature.client.js +25 -25
  181. package/dist/features/format/underline/feature.client.js.map +1 -1
  182. package/dist/features/format/underline/feature.server.js +4 -5
  183. package/dist/features/format/underline/feature.server.js.map +1 -1
  184. package/dist/features/heading/client/index.js +86 -90
  185. package/dist/features/heading/client/index.js.map +1 -1
  186. package/dist/features/heading/markdownTransformer.js +22 -25
  187. package/dist/features/heading/markdownTransformer.js.map +1 -1
  188. package/dist/features/heading/server/i18n.js +96 -97
  189. package/dist/features/heading/server/i18n.js.map +1 -1
  190. package/dist/features/heading/server/index.js +49 -51
  191. package/dist/features/heading/server/index.js.map +1 -1
  192. package/dist/features/horizontalRule/client/component/index.js +81 -51
  193. package/dist/features/horizontalRule/client/component/index.js.map +1 -1
  194. package/dist/features/horizontalRule/client/index.js +48 -57
  195. package/dist/features/horizontalRule/client/index.js.map +1 -1
  196. package/dist/features/horizontalRule/client/markdownTransformer.js +15 -18
  197. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  198. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  199. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +33 -30
  200. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  201. package/dist/features/horizontalRule/client/plugin/index.js +31 -20
  202. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  203. package/dist/features/horizontalRule/server/i18n.js +96 -97
  204. package/dist/features/horizontalRule/server/i18n.js.map +1 -1
  205. package/dist/features/horizontalRule/server/index.js +17 -24
  206. package/dist/features/horizontalRule/server/index.js.map +1 -1
  207. package/dist/features/horizontalRule/server/markdownTransformer.js +15 -18
  208. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  209. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +71 -66
  210. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  211. package/dist/features/indent/client/index.js +52 -47
  212. package/dist/features/indent/client/index.js.map +1 -1
  213. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  214. package/dist/features/indent/client/toolbarIndentGroup.js +9 -8
  215. package/dist/features/indent/client/toolbarIndentGroup.js.map +1 -1
  216. package/dist/features/indent/server/i18n.js +128 -129
  217. package/dist/features/indent/server/i18n.js.map +1 -1
  218. package/dist/features/indent/server/index.js +5 -6
  219. package/dist/features/indent/server/index.js.map +1 -1
  220. package/dist/features/link/client/index.js +78 -83
  221. package/dist/features/link/client/index.js.map +1 -1
  222. package/dist/features/link/client/plugins/autoLink/index.js +267 -271
  223. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  224. package/dist/features/link/client/plugins/clickableLink/index.js +3 -3
  225. package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -1
  226. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  227. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js +2 -1
  228. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  229. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +254 -276
  230. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  231. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +8 -6
  232. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  233. package/dist/features/link/client/plugins/floatingLinkEditor/types.js +1 -2
  234. package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
  235. package/dist/features/link/client/plugins/link/index.js +50 -41
  236. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  237. package/dist/features/link/markdownTransformer.js +38 -39
  238. package/dist/features/link/markdownTransformer.js.map +1 -1
  239. package/dist/features/link/nodes/AutoLinkNode.js +57 -56
  240. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  241. package/dist/features/link/nodes/LinkNode.js +277 -276
  242. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  243. package/dist/features/link/nodes/types.js +1 -2
  244. package/dist/features/link/nodes/types.js.map +1 -1
  245. package/dist/features/link/server/baseFields.js +118 -88
  246. package/dist/features/link/server/baseFields.js.map +1 -1
  247. package/dist/features/link/server/graphQLPopulationPromise.js +42 -28
  248. package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
  249. package/dist/features/link/server/i18n.js +96 -97
  250. package/dist/features/link/server/i18n.js.map +1 -1
  251. package/dist/features/link/server/index.js +120 -114
  252. package/dist/features/link/server/index.js.map +1 -1
  253. package/dist/features/link/server/transformExtraFields.js +15 -15
  254. package/dist/features/link/server/transformExtraFields.js.map +1 -1
  255. package/dist/features/link/server/validate.js +37 -26
  256. package/dist/features/link/server/validate.js.map +1 -1
  257. package/dist/features/lists/checklist/client/index.js +77 -85
  258. package/dist/features/lists/checklist/client/index.js.map +1 -1
  259. package/dist/features/lists/checklist/client/plugin/index.js +3 -3
  260. package/dist/features/lists/checklist/client/plugin/index.js.map +1 -1
  261. package/dist/features/lists/checklist/markdownTransformers.js +7 -11
  262. package/dist/features/lists/checklist/markdownTransformers.js.map +1 -1
  263. package/dist/features/lists/checklist/server/i18n.js +96 -97
  264. package/dist/features/lists/checklist/server/i18n.js.map +1 -1
  265. package/dist/features/lists/checklist/server/index.js +21 -25
  266. package/dist/features/lists/checklist/server/index.js.map +1 -1
  267. package/dist/features/lists/htmlConverter.js +54 -43
  268. package/dist/features/lists/htmlConverter.js.map +1 -1
  269. package/dist/features/lists/orderedList/client/index.js +71 -77
  270. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  271. package/dist/features/lists/orderedList/markdownTransformer.js +7 -11
  272. package/dist/features/lists/orderedList/markdownTransformer.js.map +1 -1
  273. package/dist/features/lists/orderedList/server/i18n.js +96 -97
  274. package/dist/features/lists/orderedList/server/i18n.js.map +1 -1
  275. package/dist/features/lists/orderedList/server/index.js +21 -25
  276. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  277. package/dist/features/lists/plugin/index.js +3 -3
  278. package/dist/features/lists/plugin/index.js.map +1 -1
  279. package/dist/features/lists/shared/markdown.js +48 -49
  280. package/dist/features/lists/shared/markdown.js.map +1 -1
  281. package/dist/features/lists/shared/slashMenuListGroup.js +9 -8
  282. package/dist/features/lists/shared/slashMenuListGroup.js.map +1 -1
  283. package/dist/features/lists/unorderedList/client/index.js +68 -76
  284. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  285. package/dist/features/lists/unorderedList/markdownTransformer.js +7 -11
  286. package/dist/features/lists/unorderedList/markdownTransformer.js.map +1 -1
  287. package/dist/features/lists/unorderedList/server/i18n.js +96 -97
  288. package/dist/features/lists/unorderedList/server/i18n.js.map +1 -1
  289. package/dist/features/lists/unorderedList/server/index.js +17 -23
  290. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  291. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +18 -17
  292. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
  293. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +30 -29
  294. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
  295. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +21 -20
  296. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
  297. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +21 -19
  298. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
  299. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +18 -17
  300. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
  301. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +24 -23
  302. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
  303. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +20 -21
  304. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  305. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +1 -10
  306. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
  307. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +69 -61
  308. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
  309. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +1 -2
  310. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
  311. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +5 -7
  312. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
  313. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +42 -43
  314. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
  315. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +1 -1
  316. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +11 -11
  317. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  318. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +64 -59
  319. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  320. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +19 -19
  321. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
  322. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +20 -25
  323. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
  324. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +28 -30
  325. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
  326. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +26 -26
  327. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
  328. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +22 -21
  329. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
  330. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +22 -22
  331. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
  332. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +12 -13
  333. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  334. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +23 -23
  335. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
  336. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +22 -22
  337. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
  338. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +15 -16
  339. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  340. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +1 -13
  341. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
  342. package/dist/features/migrations/slateToLexical/converter/index.js +105 -98
  343. package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
  344. package/dist/features/migrations/slateToLexical/converter/types.js +1 -2
  345. package/dist/features/migrations/slateToLexical/converter/types.js.map +1 -1
  346. package/dist/features/migrations/slateToLexical/feature.client.js +7 -7
  347. package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
  348. package/dist/features/migrations/slateToLexical/feature.server.js +43 -44
  349. package/dist/features/migrations/slateToLexical/feature.server.js.map +1 -1
  350. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +1 -1
  351. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +11 -11
  352. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  353. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +64 -59
  354. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  355. package/dist/features/paragraph/client/index.js +58 -61
  356. package/dist/features/paragraph/client/index.js.map +1 -1
  357. package/dist/features/paragraph/server/i18n.js +128 -129
  358. package/dist/features/paragraph/server/i18n.js.map +1 -1
  359. package/dist/features/paragraph/server/index.js +6 -7
  360. package/dist/features/paragraph/server/index.js.map +1 -1
  361. package/dist/features/relationship/client/components/RelationshipComponent.js +141 -149
  362. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  363. package/dist/features/relationship/client/drawer/commands.js +0 -1
  364. package/dist/features/relationship/client/drawer/commands.js.map +1 -1
  365. package/dist/features/relationship/client/drawer/index.js +138 -67
  366. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  367. package/dist/features/relationship/client/index.js +53 -59
  368. package/dist/features/relationship/client/index.js.map +1 -1
  369. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  370. package/dist/features/relationship/client/nodes/RelationshipNode.js +60 -59
  371. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  372. package/dist/features/relationship/client/plugins/index.js +90 -35
  373. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  374. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.d.ts.map +1 -1
  375. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +97 -26
  376. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
  377. package/dist/features/relationship/server/graphQLPopulationPromise.js +34 -26
  378. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  379. package/dist/features/relationship/server/i18n.js +96 -97
  380. package/dist/features/relationship/server/i18n.js.map +1 -1
  381. package/dist/features/relationship/server/index.js +48 -44
  382. package/dist/features/relationship/server/index.js.map +1 -1
  383. package/dist/features/relationship/server/nodes/RelationshipNode.js +90 -87
  384. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  385. package/dist/features/shared/slashMenu/basicGroup.js +9 -8
  386. package/dist/features/shared/slashMenu/basicGroup.js.map +1 -1
  387. package/dist/features/shared/toolbar/addDropdownGroup.js +8 -9
  388. package/dist/features/shared/toolbar/addDropdownGroup.js.map +1 -1
  389. package/dist/features/shared/toolbar/featureButtonsGroup.js +7 -8
  390. package/dist/features/shared/toolbar/featureButtonsGroup.js.map +1 -1
  391. package/dist/features/shared/toolbar/textDropdownGroup.js +8 -9
  392. package/dist/features/shared/toolbar/textDropdownGroup.js.map +1 -1
  393. package/dist/features/toolbars/fixed/client/Toolbar/index.js +264 -187
  394. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  395. package/dist/features/toolbars/fixed/client/index.js +5 -7
  396. package/dist/features/toolbars/fixed/client/index.js.map +1 -1
  397. package/dist/features/toolbars/fixed/server/index.js +14 -13
  398. package/dist/features/toolbars/fixed/server/index.js.map +1 -1
  399. package/dist/features/toolbars/inline/client/Toolbar/index.js +374 -286
  400. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  401. package/dist/features/toolbars/inline/client/index.js +5 -7
  402. package/dist/features/toolbars/inline/client/index.js.map +1 -1
  403. package/dist/features/toolbars/inline/server/index.js +4 -5
  404. package/dist/features/toolbars/inline/server/index.js.map +1 -1
  405. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  406. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  407. package/dist/features/toolbars/shared/ToolbarButton/index.js +75 -97
  408. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  409. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +190 -211
  410. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  411. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  412. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  413. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +289 -124
  414. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  415. package/dist/features/toolbars/types.js +1 -2
  416. package/dist/features/toolbars/types.js.map +1 -1
  417. package/dist/features/typeUtilities.js +2 -3
  418. package/dist/features/typeUtilities.js.map +1 -1
  419. package/dist/features/typesClient.js +1 -2
  420. package/dist/features/typesClient.js.map +1 -1
  421. package/dist/features/typesServer.js +1 -2
  422. package/dist/features/typesServer.js.map +1 -1
  423. package/dist/features/upload/client/component/index.js +208 -224
  424. package/dist/features/upload/client/component/index.js.map +1 -1
  425. package/dist/features/upload/client/drawer/commands.js +1 -1
  426. package/dist/features/upload/client/drawer/commands.js.map +1 -1
  427. package/dist/features/upload/client/drawer/index.js +107 -58
  428. package/dist/features/upload/client/drawer/index.js.map +1 -1
  429. package/dist/features/upload/client/feature.client.js +51 -61
  430. package/dist/features/upload/client/feature.client.js.map +1 -1
  431. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  432. package/dist/features/upload/client/nodes/UploadNode.js +76 -73
  433. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  434. package/dist/features/upload/client/plugin/index.js +67 -39
  435. package/dist/features/upload/client/plugin/index.js.map +1 -1
  436. package/dist/features/upload/server/feature.server.js +190 -171
  437. package/dist/features/upload/server/feature.server.js.map +1 -1
  438. package/dist/features/upload/server/graphQLPopulationPromise.js +60 -47
  439. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  440. package/dist/features/upload/server/i18n.js +96 -97
  441. package/dist/features/upload/server/i18n.js.map +1 -1
  442. package/dist/features/upload/server/nodes/UploadNode.js +113 -108
  443. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  444. package/dist/features/upload/server/validate.js +53 -40
  445. package/dist/features/upload/server/validate.js.map +1 -1
  446. package/dist/field/Field.js +124 -105
  447. package/dist/field/Field.js.map +1 -1
  448. package/dist/field/bundled.css +1 -0
  449. package/dist/field/index.js +92 -36
  450. package/dist/field/index.js.map +1 -1
  451. package/dist/i18n.js +160 -161
  452. package/dist/i18n.js.map +1 -1
  453. package/dist/index.d.ts.map +1 -1
  454. package/dist/index.js +670 -623
  455. package/dist/index.js.map +1 -1
  456. package/dist/lexical/EditorPlugin.d.ts.map +1 -1
  457. package/dist/lexical/EditorPlugin.js +15 -10
  458. package/dist/lexical/EditorPlugin.js.map +1 -1
  459. package/dist/lexical/LexicalEditor.js +206 -161
  460. package/dist/lexical/LexicalEditor.js.map +1 -1
  461. package/dist/lexical/LexicalProvider.js +83 -82
  462. package/dist/lexical/LexicalProvider.js.map +1 -1
  463. package/dist/lexical/config/client/EditorConfigProvider.js +76 -79
  464. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  465. package/dist/lexical/config/client/default.js +3 -3
  466. package/dist/lexical/config/client/default.js.map +1 -1
  467. package/dist/lexical/config/client/loader.js +42 -39
  468. package/dist/lexical/config/client/loader.js.map +1 -1
  469. package/dist/lexical/config/client/sanitize.js +165 -165
  470. package/dist/lexical/config/client/sanitize.js.map +1 -1
  471. package/dist/lexical/config/server/default.js +5 -27
  472. package/dist/lexical/config/server/default.js.map +1 -1
  473. package/dist/lexical/config/server/loader.js +103 -103
  474. package/dist/lexical/config/server/loader.js.map +1 -1
  475. package/dist/lexical/config/server/sanitize.js +98 -99
  476. package/dist/lexical/config/server/sanitize.js.map +1 -1
  477. package/dist/lexical/config/types.js +1 -2
  478. package/dist/lexical/config/types.js.map +1 -1
  479. package/dist/lexical/nodes/index.js +9 -8
  480. package/dist/lexical/nodes/index.js.map +1 -1
  481. package/dist/lexical/plugins/MarkdownShortcut/index.js +17 -5
  482. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  483. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +384 -361
  484. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  485. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +223 -160
  486. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  487. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -2
  488. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  489. package/dist/lexical/plugins/SlashMenu/index.js +191 -179
  490. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  491. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.d.ts.map +1 -1
  492. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js +41 -26
  493. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  494. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +164 -129
  495. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  496. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  497. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +11 -10
  498. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
  499. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.d.ts.map +1 -1
  500. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +11 -10
  501. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
  502. package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  503. package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js +27 -23
  504. package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  505. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +331 -300
  506. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  507. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +110 -97
  508. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  509. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  510. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +23 -16
  511. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -1
  512. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -1
  513. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +18 -27
  514. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
  515. package/dist/lexical/plugins/handles/utils/getCollapsedMargins.d.ts.map +1 -1
  516. package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js +15 -11
  517. package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js.map +1 -1
  518. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
  519. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +133 -118
  520. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
  521. package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  522. package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +3 -2
  523. package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  524. package/dist/lexical/plugins/handles/utils/isOnHandleElement.d.ts.map +1 -1
  525. package/dist/lexical/plugins/handles/utils/isOnHandleElement.js +3 -2
  526. package/dist/lexical/plugins/handles/utils/isOnHandleElement.js.map +1 -1
  527. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  528. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +26 -25
  529. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  530. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  531. package/dist/lexical/theme/EditorTheme.js +97 -102
  532. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  533. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  534. package/dist/lexical/ui/ContentEditable.js +27 -10
  535. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  536. package/dist/lexical/ui/icons/AI/index.d.ts.map +1 -1
  537. package/dist/lexical/ui/icons/AI/index.js +31 -33
  538. package/dist/lexical/ui/icons/AI/index.js.map +1 -1
  539. package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
  540. package/dist/lexical/ui/icons/Add/index.js +16 -18
  541. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  542. package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
  543. package/dist/lexical/ui/icons/AlignCenter/index.js +25 -28
  544. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  545. package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
  546. package/dist/lexical/ui/icons/AlignJustify/index.js +25 -28
  547. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  548. package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
  549. package/dist/lexical/ui/icons/AlignLeft/index.js +25 -28
  550. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  551. package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
  552. package/dist/lexical/ui/icons/AlignRight/index.js +25 -28
  553. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  554. package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
  555. package/dist/lexical/ui/icons/Block/index.js +34 -37
  556. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  557. package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
  558. package/dist/lexical/ui/icons/Blockquote/index.js +16 -15
  559. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  560. package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
  561. package/dist/lexical/ui/icons/Bold/index.js +16 -15
  562. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  563. package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
  564. package/dist/lexical/ui/icons/Checklist/index.js +24 -26
  565. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  566. package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
  567. package/dist/lexical/ui/icons/Code/index.js +19 -21
  568. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  569. package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
  570. package/dist/lexical/ui/icons/CodeBlock/index.js +19 -21
  571. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  572. package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
  573. package/dist/lexical/ui/icons/H1/index.js +16 -15
  574. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  575. package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
  576. package/dist/lexical/ui/icons/H2/index.js +16 -15
  577. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  578. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  579. package/dist/lexical/ui/icons/H3/index.js +16 -15
  580. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  581. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  582. package/dist/lexical/ui/icons/H4/index.js +16 -15
  583. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  584. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  585. package/dist/lexical/ui/icons/H5/index.js +16 -15
  586. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  587. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  588. package/dist/lexical/ui/icons/H6/index.js +16 -15
  589. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  590. package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
  591. package/dist/lexical/ui/icons/HorizontalRule/index.js +19 -18
  592. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  593. package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
  594. package/dist/lexical/ui/icons/IndentDecrease/index.js +28 -32
  595. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  596. package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
  597. package/dist/lexical/ui/icons/IndentIncrease/index.js +28 -32
  598. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  599. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
  600. package/dist/lexical/ui/icons/InlineBlocks/index.js +18 -17
  601. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
  602. package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
  603. package/dist/lexical/ui/icons/Italic/index.js +16 -15
  604. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  605. package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
  606. package/dist/lexical/ui/icons/Link/index.js +17 -16
  607. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  608. package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
  609. package/dist/lexical/ui/icons/Meatballs/index.js +19 -22
  610. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
  611. package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
  612. package/dist/lexical/ui/icons/OrderedList/index.js +31 -36
  613. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  614. package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
  615. package/dist/lexical/ui/icons/Relationship/index.js +31 -33
  616. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  617. package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
  618. package/dist/lexical/ui/icons/Strikethrough/index.js +19 -21
  619. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  620. package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
  621. package/dist/lexical/ui/icons/Subscript/index.js +16 -15
  622. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  623. package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
  624. package/dist/lexical/ui/icons/Superscript/index.js +16 -15
  625. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  626. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
  627. package/dist/lexical/ui/icons/Table/index.js +17 -16
  628. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  629. package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
  630. package/dist/lexical/ui/icons/Text/index.js +16 -15
  631. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  632. package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
  633. package/dist/lexical/ui/icons/Underline/index.js +19 -21
  634. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  635. package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
  636. package/dist/lexical/ui/icons/UnorderedList/index.js +46 -52
  637. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  638. package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
  639. package/dist/lexical/ui/icons/Upload/index.js +28 -31
  640. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  641. package/dist/lexical/utils/canUseDOM.d.ts.map +1 -1
  642. package/dist/lexical/utils/canUseDOM.js +2 -1
  643. package/dist/lexical/utils/canUseDOM.js.map +1 -1
  644. package/dist/lexical/utils/environment.d.ts.map +1 -1
  645. package/dist/lexical/utils/environment.js +2 -1
  646. package/dist/lexical/utils/environment.js.map +1 -1
  647. package/dist/lexical/utils/getDOMRangeRect.d.ts.map +1 -1
  648. package/dist/lexical/utils/getDOMRangeRect.js +13 -12
  649. package/dist/lexical/utils/getDOMRangeRect.js.map +1 -1
  650. package/dist/lexical/utils/getSelectedNode.d.ts.map +1 -1
  651. package/dist/lexical/utils/getSelectedNode.js +18 -13
  652. package/dist/lexical/utils/getSelectedNode.js.map +1 -1
  653. package/dist/lexical/utils/guard.d.ts.map +1 -1
  654. package/dist/lexical/utils/guard.js +3 -2
  655. package/dist/lexical/utils/guard.js.map +1 -1
  656. package/dist/lexical/utils/joinClasses.d.ts.map +1 -1
  657. package/dist/lexical/utils/joinClasses.js +3 -2
  658. package/dist/lexical/utils/joinClasses.js.map +1 -1
  659. package/dist/lexical/utils/markdown/createBlockNode.js +9 -10
  660. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  661. package/dist/lexical/utils/nodeFormat.js +58 -59
  662. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  663. package/dist/lexical/utils/point.d.ts.map +1 -1
  664. package/dist/lexical/utils/point.js +40 -32
  665. package/dist/lexical/utils/point.js.map +1 -1
  666. package/dist/lexical/utils/rect.d.ts.map +1 -1
  667. package/dist/lexical/utils/rect.js +167 -134
  668. package/dist/lexical/utils/rect.js.map +1 -1
  669. package/dist/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  670. package/dist/lexical/utils/setFloatingElemPosition.js +56 -45
  671. package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
  672. package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.d.ts.map +1 -1
  673. package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js +23 -22
  674. package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js.map +1 -1
  675. package/dist/lexical/utils/swipe.d.ts.map +1 -1
  676. package/dist/lexical/utils/swipe.js +82 -83
  677. package/dist/lexical/utils/swipe.js.map +1 -1
  678. package/dist/lexical/utils/url.js +23 -22
  679. package/dist/lexical/utils/url.js.map +1 -1
  680. package/dist/nodeTypes.js +1 -2
  681. package/dist/nodeTypes.js.map +1 -1
  682. package/dist/populateGraphQL/defaultValue.js +24 -29
  683. package/dist/populateGraphQL/defaultValue.js.map +1 -1
  684. package/dist/populateGraphQL/populate.js +35 -25
  685. package/dist/populateGraphQL/populate.js.map +1 -1
  686. package/dist/populateGraphQL/populateLexicalPopulationPromises.js +47 -32
  687. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  688. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js +39 -25
  689. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
  690. package/dist/types.js +1 -2
  691. package/dist/types.js.map +1 -1
  692. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  693. package/dist/utilities/createClientFeature.js +40 -26
  694. package/dist/utilities/createClientFeature.js.map +1 -1
  695. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  696. package/dist/utilities/createServerFeature.js +46 -31
  697. package/dist/utilities/createServerFeature.js.map +1 -1
  698. package/dist/utilities/fieldsDrawer/Drawer.js +28 -17
  699. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  700. package/dist/utilities/fieldsDrawer/DrawerContent.js +149 -78
  701. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  702. package/dist/utilities/forEachNodeRecursively.js +24 -19
  703. package/dist/utilities/forEachNodeRecursively.js.map +1 -1
  704. package/dist/utilities/generateComponentMap.js +90 -82
  705. package/dist/utilities/generateComponentMap.js.map +1 -1
  706. package/dist/utilities/generateImportMap.js +53 -47
  707. package/dist/utilities/generateImportMap.js.map +1 -1
  708. package/dist/utilities/generateSchemaMap.js +35 -30
  709. package/dist/utilities/generateSchemaMap.js.map +1 -1
  710. package/dist/utilities/migrateSlateToLexical/index.js +99 -86
  711. package/dist/utilities/migrateSlateToLexical/index.js.map +1 -1
  712. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +73 -66
  713. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
  714. package/dist/utilities/recurseNodeTree.js +25 -22
  715. package/dist/utilities/recurseNodeTree.js.map +1 -1
  716. package/dist/utilities/upgradeLexicalData/index.js +99 -86
  717. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  718. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +71 -66
  719. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  720. package/dist/utilities/useLexicalFeature.js +9 -8
  721. package/dist/utilities/useLexicalFeature.js.map +1 -1
  722. package/dist/validate/index.js +32 -26
  723. package/dist/validate/index.js.map +1 -1
  724. package/dist/validate/validateNodes.js +31 -28
  725. package/dist/validate/validateNodes.js.map +1 -1
  726. package/package.json +22 -11
  727. package/dist/exports/client/Component-7HS6FEJS.js +0 -2
  728. package/dist/exports/client/Component-7HS6FEJS.js.map +0 -7
  729. package/dist/exports/client/Component-LAKSCIDX.js +0 -2
  730. package/dist/exports/client/Component-LAKSCIDX.js.map +0 -7
  731. package/dist/exports/client/Field-BYB3WX7J.js +0 -2
  732. package/dist/exports/client/Field-BYB3WX7J.js.map +0 -7
  733. package/dist/exports/client/RelationshipComponent-GYUTPDNG.js +0 -2
  734. package/dist/exports/client/RelationshipComponent-GYUTPDNG.js.map +0 -7
  735. package/dist/exports/client/chunk-4EX7W4UX.js +0 -2
  736. package/dist/exports/client/chunk-4EX7W4UX.js.map +0 -7
  737. package/dist/exports/client/chunk-E4HH5PS6.js +0 -2
  738. package/dist/exports/client/chunk-E4HH5PS6.js.map +0 -7
  739. package/dist/exports/client/chunk-EBB2CEB6.js +0 -2
  740. package/dist/exports/client/chunk-EBB2CEB6.js.map +0 -7
  741. package/dist/exports/client/chunk-LTR7V74A.js +0 -2
  742. package/dist/exports/client/chunk-LTR7V74A.js.map +0 -7
  743. package/dist/exports/client/chunk-SQHN3N6E.js +0 -2
  744. package/dist/exports/client/chunk-VMCQSR3T.js +0 -3
  745. package/dist/exports/client/chunk-VMCQSR3T.js.map +0 -7
  746. package/dist/exports/client/component-6C5JERGA.js +0 -2
  747. package/dist/exports/client/component-6C5JERGA.js.map +0 -7
  748. package/dist/exports/client/component-GUWIGB77.js +0 -2
  749. package/dist/exports/client/component-GUWIGB77.js.map +0 -7
  750. package/dist/exports/client/component-UQ2BKD5X.js +0 -2
  751. package/dist/exports/client/component-UQ2BKD5X.js.map +0 -7
  752. package/dist/exports/client/componentInline-C2XIK5VZ.js +0 -2
  753. package/dist/exports/client/componentInline-C2XIK5VZ.js.map +0 -7
  754. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts +0 -12
  755. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  756. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js +0 -181
  757. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js.map +0 -1
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+
2
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
4
  import { createHeadlessEditor } from '@lexical/headless';
4
5
  import { useClientFunctions, useTableCell } from '@payloadcms/ui';
@@ -8,138 +9,127 @@ import { defaultEditorLexicalConfig } from '../lexical/config/client/default.js'
8
9
  import { loadClientFeatures } from '../lexical/config/client/loader.js';
9
10
  import { sanitizeClientEditorConfig } from '../lexical/config/client/sanitize.js';
10
11
  import { getEnabledNodes } from '../lexical/nodes/index.js';
11
- export const RichTextCell = (props)=>{
12
- const { admin, field: { _schemaPath, richTextComponentMap }, lexicalEditorConfig } = props;
13
- const [preview, setPreview] = React.useState('Loading...');
14
- const { cellData } = useTableCell();
15
- const clientFunctions = useClientFunctions();
16
- const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false);
17
- const [featureProviders, setFeatureProviders] = useState([]);
18
- const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] = useState(null);
19
- const featureProviderComponents = richTextComponentMap.get('features').sort((a, b)=>a.order - b.order) // order by order
20
- ;
21
- let featureProvidersAndComponentsToLoad = 0 // feature providers and components
22
- ;
23
- for (const featureProvider of featureProviderComponents){
24
- const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key)=>key.startsWith(`feature.${featureProvider.key}.components.`));
25
- featureProvidersAndComponentsToLoad += 1;
26
- featureProvidersAndComponentsToLoad += featureComponentKeys.length;
27
- }
28
- useEffect(()=>{
29
- if (!hasLoadedFeatures) {
30
- const featureProvidersLocal = [];
31
- let featureProvidersAndComponentsLoaded = 0 // feature providers and components only
32
- ;
33
- Object.entries(clientFunctions).forEach(([key, plugin])=>{
34
- if (key.startsWith(`lexicalFeature.${_schemaPath}.`)) {
35
- if (!key.includes('.lexical_internal_components.')) {
36
- featureProvidersLocal.push(plugin);
37
- }
38
- featureProvidersAndComponentsLoaded++;
39
- }
40
- });
41
- if (featureProvidersAndComponentsLoaded === featureProvidersAndComponentsToLoad) {
42
- setFeatureProviders(featureProvidersLocal);
43
- setHasLoadedFeatures(true);
44
- /**
45
- * Loaded feature provided => create the final sanitized editor config
46
- */ const resolvedClientFeatures = loadClientFeatures({
47
- clientFunctions,
48
- schemaPath: _schemaPath,
49
- unSanitizedEditorConfig: {
50
- features: featureProvidersLocal,
51
- lexical: lexicalEditorConfig
52
- }
53
- });
54
- setFinalSanitizedEditorConfig(sanitizeClientEditorConfig(lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig, resolvedClientFeatures, admin));
55
- }
56
- }
57
- }, [
58
- admin,
59
- featureProviderComponents,
60
- hasLoadedFeatures,
61
- clientFunctions,
62
- _schemaPath,
63
- featureProviderComponents.length,
64
- featureProviders,
65
- finalSanitizedEditorConfig,
66
- lexicalEditorConfig,
67
- richTextComponentMap,
68
- featureProvidersAndComponentsToLoad
69
- ]);
70
- useEffect(()=>{
71
- if (!hasLoadedFeatures) {
72
- return;
73
- }
74
- let dataToUse = cellData;
75
- if (dataToUse == null || !hasLoadedFeatures || !finalSanitizedEditorConfig) {
76
- setPreview('');
77
- return;
78
- }
79
- // Transform data through load hooks
80
- if (finalSanitizedEditorConfig?.features?.hooks?.load?.length) {
81
- finalSanitizedEditorConfig.features.hooks.load.forEach((hook)=>{
82
- dataToUse = hook({
83
- incomingEditorState: dataToUse
84
- });
85
- });
86
- }
87
- if (!dataToUse || typeof dataToUse !== 'object') {
88
- setPreview('');
89
- return;
90
- }
91
- // If data is from Slate and not Lexical
92
- if (Array.isArray(dataToUse) && !('root' in dataToUse)) {
93
- setPreview('');
94
- return;
95
- }
96
- // If data is from payload-plugin-lexical
97
- if ('jsonContent' in dataToUse) {
98
- setPreview('');
99
- return;
12
+ export const RichTextCell = props => {
13
+ const {
14
+ admin,
15
+ field: {
16
+ _schemaPath,
17
+ richTextComponentMap
18
+ },
19
+ lexicalEditorConfig
20
+ } = props;
21
+ const [preview, setPreview] = React.useState('Loading...');
22
+ const {
23
+ cellData
24
+ } = useTableCell();
25
+ const clientFunctions = useClientFunctions();
26
+ const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false);
27
+ const [featureProviders, setFeatureProviders] = useState([]);
28
+ const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] = useState(null);
29
+ const featureProviderComponents = richTextComponentMap.get('features').sort((a, b) => a.order - b.order) // order by order
30
+ ;
31
+ let featureProvidersAndComponentsToLoad = 0 // feature providers and components
32
+ ;
33
+ for (const featureProvider of featureProviderComponents) {
34
+ const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter(key => key.startsWith(`feature.${featureProvider.key}.components.`));
35
+ featureProvidersAndComponentsToLoad += 1;
36
+ featureProvidersAndComponentsToLoad += featureComponentKeys.length;
37
+ }
38
+ useEffect(() => {
39
+ if (!hasLoadedFeatures) {
40
+ const featureProvidersLocal = [];
41
+ let featureProvidersAndComponentsLoaded = 0 // feature providers and components only
42
+ ;
43
+ Object.entries(clientFunctions).forEach(([key_0, plugin]) => {
44
+ if (key_0.startsWith(`lexicalFeature.${_schemaPath}.`)) {
45
+ if (!key_0.includes('.lexical_internal_components.')) {
46
+ featureProvidersLocal.push(plugin);
47
+ }
48
+ featureProvidersAndComponentsLoaded++;
100
49
  }
101
- // initialize headless editor
102
- const headlessEditor = createHeadlessEditor({
103
- namespace: finalSanitizedEditorConfig.lexical.namespace,
104
- nodes: getEnabledNodes({
105
- editorConfig: finalSanitizedEditorConfig
106
- }),
107
- theme: finalSanitizedEditorConfig.lexical.theme
50
+ });
51
+ if (featureProvidersAndComponentsLoaded === featureProvidersAndComponentsToLoad) {
52
+ setFeatureProviders(featureProvidersLocal);
53
+ setHasLoadedFeatures(true);
54
+ /**
55
+ * Loaded feature provided => create the final sanitized editor config
56
+ */
57
+ const resolvedClientFeatures = loadClientFeatures({
58
+ clientFunctions,
59
+ schemaPath: _schemaPath,
60
+ unSanitizedEditorConfig: {
61
+ features: featureProvidersLocal,
62
+ lexical: lexicalEditorConfig
63
+ }
108
64
  });
109
- headlessEditor.setEditorState(headlessEditor.parseEditorState(dataToUse));
110
- const textContent = headlessEditor.getEditorState().read(()=>{
111
- return $getRoot().getTextContent();
112
- }) || '';
113
- // Limiting the number of characters shown is done in a CSS rule
114
- setPreview(textContent);
115
- }, [
116
- cellData,
117
- lexicalEditorConfig,
118
- hasLoadedFeatures,
119
- finalSanitizedEditorConfig
120
- ]);
65
+ setFinalSanitizedEditorConfig(sanitizeClientEditorConfig(lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig, resolvedClientFeatures, admin));
66
+ }
67
+ }
68
+ }, [admin, featureProviderComponents, hasLoadedFeatures, clientFunctions, _schemaPath, featureProviderComponents.length, featureProviders, finalSanitizedEditorConfig, lexicalEditorConfig, richTextComponentMap, featureProvidersAndComponentsToLoad]);
69
+ useEffect(() => {
121
70
  if (!hasLoadedFeatures) {
122
- return /*#__PURE__*/ _jsx(React.Fragment, {
123
- children: Array.isArray(featureProviderComponents) && featureProviderComponents.map((featureProvider)=>{
124
- // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}
125
- const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key)=>key.startsWith(`lexical_internal_feature.${featureProvider.key}.lexical_internal_components.`));
126
- const featureComponents = featureComponentKeys.map((key)=>{
127
- return richTextComponentMap.get(key);
128
- });
129
- return /*#__PURE__*/ _jsxs(React.Fragment, {
130
- children: [
131
- featureComponents?.length ? featureComponents.map((FeatureComponent)=>{
132
- return FeatureComponent;
133
- }) : null,
134
- featureProvider.ClientFeature
135
- ]
136
- }, featureProvider.key);
137
- })
71
+ return;
72
+ }
73
+ let dataToUse = cellData;
74
+ if (dataToUse == null || !hasLoadedFeatures || !finalSanitizedEditorConfig) {
75
+ setPreview('');
76
+ return;
77
+ }
78
+ // Transform data through load hooks
79
+ if (finalSanitizedEditorConfig?.features?.hooks?.load?.length) {
80
+ finalSanitizedEditorConfig.features.hooks.load.forEach(hook => {
81
+ dataToUse = hook({
82
+ incomingEditorState: dataToUse
138
83
  });
84
+ });
85
+ }
86
+ if (!dataToUse || typeof dataToUse !== 'object') {
87
+ setPreview('');
88
+ return;
89
+ }
90
+ // If data is from Slate and not Lexical
91
+ if (Array.isArray(dataToUse) && !('root' in dataToUse)) {
92
+ setPreview('');
93
+ return;
139
94
  }
140
- return /*#__PURE__*/ _jsx("span", {
141
- children: preview
95
+ // If data is from payload-plugin-lexical
96
+ if ('jsonContent' in dataToUse) {
97
+ setPreview('');
98
+ return;
99
+ }
100
+ // initialize headless editor
101
+ const headlessEditor = createHeadlessEditor({
102
+ namespace: finalSanitizedEditorConfig.lexical.namespace,
103
+ nodes: getEnabledNodes({
104
+ editorConfig: finalSanitizedEditorConfig
105
+ }),
106
+ theme: finalSanitizedEditorConfig.lexical.theme
107
+ });
108
+ headlessEditor.setEditorState(headlessEditor.parseEditorState(dataToUse));
109
+ const textContent = headlessEditor.getEditorState().read(() => {
110
+ return $getRoot().getTextContent();
111
+ }) || '';
112
+ // Limiting the number of characters shown is done in a CSS rule
113
+ setPreview(textContent);
114
+ }, [cellData, lexicalEditorConfig, hasLoadedFeatures, finalSanitizedEditorConfig]);
115
+ if (!hasLoadedFeatures) {
116
+ return /*#__PURE__*/_jsx(React.Fragment, {
117
+ children: Array.isArray(featureProviderComponents) && featureProviderComponents.map(featureProvider_0 => {
118
+ // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}
119
+ const featureComponentKeys_0 = Array.from(richTextComponentMap.keys()).filter(key_1 => key_1.startsWith(`lexical_internal_feature.${featureProvider_0.key}.lexical_internal_components.`));
120
+ const featureComponents = featureComponentKeys_0.map(key_2 => {
121
+ return richTextComponentMap.get(key_2);
122
+ });
123
+ return /*#__PURE__*/_jsxs(React.Fragment, {
124
+ children: [featureComponents?.length ? featureComponents.map(FeatureComponent => {
125
+ return FeatureComponent;
126
+ }) : null, featureProvider_0.ClientFeature]
127
+ }, featureProvider_0.key);
128
+ })
142
129
  });
130
+ }
131
+ return /*#__PURE__*/_jsx("span", {
132
+ children: preview
133
+ });
143
134
  };
144
-
145
135
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cell/index.tsx"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\nimport type { CellComponentProps, RichTextFieldClient } from 'payload'\n\nimport { createHeadlessEditor } from '@lexical/headless'\nimport { useClientFunctions, useTableCell } from '@payloadcms/ui'\nimport { $getRoot } from 'lexical'\nimport React, { useEffect, useState } from 'react'\n\nimport type { FeatureProviderClient } from '../features/typesClient.js'\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\nimport type { GeneratedFeatureProviderComponent, LexicalFieldAdminProps } from '../types.js'\n\nimport { defaultEditorLexicalConfig } from '../lexical/config/client/default.js'\nimport { loadClientFeatures } from '../lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from '../lexical/config/client/sanitize.js'\nimport { getEnabledNodes } from '../lexical/nodes/index.js'\n\nexport const RichTextCell: React.FC<\n {\n admin?: LexicalFieldAdminProps\n lexicalEditorConfig: LexicalEditorConfig\n } & CellComponentProps<RichTextFieldClient>\n> = (props) => {\n const {\n admin,\n field: { _schemaPath, richTextComponentMap },\n lexicalEditorConfig,\n } = props\n\n const [preview, setPreview] = React.useState('Loading...')\n\n const { cellData } = useTableCell()\n\n const clientFunctions = useClientFunctions()\n const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false)\n\n const [featureProviders, setFeatureProviders] = useState<\n FeatureProviderClient<unknown, unknown>[]\n >([])\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<SanitizedClientEditorConfig>(null)\n\n const featureProviderComponents: GeneratedFeatureProviderComponent[] = (\n richTextComponentMap.get('features') as GeneratedFeatureProviderComponent[]\n ).sort((a, b) => a.order - b.order) // order by order\n\n let featureProvidersAndComponentsToLoad = 0 // feature providers and components\n for (const featureProvider of featureProviderComponents) {\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(`feature.${featureProvider.key}.components.`),\n )\n\n featureProvidersAndComponentsToLoad += 1\n featureProvidersAndComponentsToLoad += featureComponentKeys.length\n }\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n const featureProvidersLocal: FeatureProviderClient<unknown, unknown>[] = []\n let featureProvidersAndComponentsLoaded = 0 // feature providers and components only\n\n Object.entries(clientFunctions).forEach(([key, plugin]) => {\n if (key.startsWith(`lexicalFeature.${_schemaPath}.`)) {\n if (!key.includes('.lexical_internal_components.')) {\n featureProvidersLocal.push(plugin)\n }\n featureProvidersAndComponentsLoaded++\n }\n })\n\n if (featureProvidersAndComponentsLoaded === featureProvidersAndComponentsToLoad) {\n setFeatureProviders(featureProvidersLocal)\n setHasLoadedFeatures(true)\n\n /**\n * Loaded feature provided => create the final sanitized editor config\n */\n\n const resolvedClientFeatures = loadClientFeatures({\n clientFunctions,\n schemaPath: _schemaPath,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: lexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig,\n resolvedClientFeatures,\n admin,\n ),\n )\n }\n }\n }, [\n admin,\n featureProviderComponents,\n hasLoadedFeatures,\n clientFunctions,\n _schemaPath,\n featureProviderComponents.length,\n featureProviders,\n finalSanitizedEditorConfig,\n lexicalEditorConfig,\n richTextComponentMap,\n featureProvidersAndComponentsToLoad,\n ])\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n return\n }\n let dataToUse = cellData\n if (dataToUse == null || !hasLoadedFeatures || !finalSanitizedEditorConfig) {\n setPreview('')\n return\n }\n\n // Transform data through load hooks\n if (finalSanitizedEditorConfig?.features?.hooks?.load?.length) {\n finalSanitizedEditorConfig.features.hooks.load.forEach((hook) => {\n dataToUse = hook({ incomingEditorState: dataToUse })\n })\n }\n\n if (!dataToUse || typeof dataToUse !== 'object') {\n setPreview('')\n return\n }\n\n // If data is from Slate and not Lexical\n if (Array.isArray(dataToUse) && !('root' in dataToUse)) {\n setPreview('')\n return\n }\n\n // If data is from payload-plugin-lexical\n if ('jsonContent' in dataToUse) {\n setPreview('')\n return\n }\n\n // initialize headless editor\n const headlessEditor = createHeadlessEditor({\n namespace: finalSanitizedEditorConfig.lexical.namespace,\n nodes: getEnabledNodes({ editorConfig: finalSanitizedEditorConfig }),\n theme: finalSanitizedEditorConfig.lexical.theme,\n })\n headlessEditor.setEditorState(headlessEditor.parseEditorState(dataToUse))\n\n const textContent =\n headlessEditor.getEditorState().read(() => {\n return $getRoot().getTextContent()\n }) || ''\n\n // Limiting the number of characters shown is done in a CSS rule\n setPreview(textContent)\n }, [cellData, lexicalEditorConfig, hasLoadedFeatures, finalSanitizedEditorConfig])\n\n if (!hasLoadedFeatures) {\n return (\n <React.Fragment>\n {Array.isArray(featureProviderComponents) &&\n featureProviderComponents.map((featureProvider) => {\n // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(\n `lexical_internal_feature.${featureProvider.key}.lexical_internal_components.`,\n ),\n )\n\n const featureComponents: React.ReactNode[] = featureComponentKeys.map((key) => {\n return richTextComponentMap.get(key)\n }) as React.ReactNode[]\n\n return (\n <React.Fragment key={featureProvider.key}>\n {featureComponents?.length\n ? featureComponents.map((FeatureComponent) => {\n return FeatureComponent\n })\n : null}\n {featureProvider.ClientFeature}\n </React.Fragment>\n )\n })}\n </React.Fragment>\n )\n }\n\n return <span>{preview}</span>\n}\n"],"names":["createHeadlessEditor","useClientFunctions","useTableCell","$getRoot","React","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","getEnabledNodes","RichTextCell","props","admin","field","_schemaPath","richTextComponentMap","lexicalEditorConfig","preview","setPreview","cellData","clientFunctions","hasLoadedFeatures","setHasLoadedFeatures","featureProviders","setFeatureProviders","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","featureProviderComponents","get","sort","a","b","order","featureProvidersAndComponentsToLoad","featureProvider","featureComponentKeys","Array","from","keys","filter","key","startsWith","length","featureProvidersLocal","featureProvidersAndComponentsLoaded","Object","entries","forEach","plugin","includes","push","resolvedClientFeatures","schemaPath","unSanitizedEditorConfig","features","lexical","dataToUse","hooks","load","hook","incomingEditorState","isArray","headlessEditor","namespace","nodes","editorConfig","theme","setEditorState","parseEditorState","textContent","getEditorState","read","getTextContent","Fragment","map","featureComponents","FeatureComponent","ClientFeature","span"],"mappings":"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"}
1
+ {"version":3,"file":"index.js","names":["createHeadlessEditor","useClientFunctions","useTableCell","$getRoot","React","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","getEnabledNodes","RichTextCell","props","admin","field","_schemaPath","richTextComponentMap","lexicalEditorConfig","preview","setPreview","cellData","clientFunctions","hasLoadedFeatures","setHasLoadedFeatures","featureProviders","setFeatureProviders","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","featureProviderComponents","get","sort","a","b","order","featureProvidersAndComponentsToLoad","featureProvider","featureComponentKeys","Array","from","keys","filter","key","startsWith","length","featureProvidersLocal","featureProvidersAndComponentsLoaded","Object","entries","forEach","plugin","includes","push","resolvedClientFeatures","schemaPath","unSanitizedEditorConfig","features","lexical","dataToUse","hooks","load","hook","incomingEditorState","isArray","headlessEditor","namespace","nodes","editorConfig","theme","setEditorState","parseEditorState","textContent","getEditorState","read","getTextContent","_jsx","Fragment","map","featureComponents","_jsxs","FeatureComponent","ClientFeature"],"sources":["../../src/cell/index.tsx"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\nimport type { CellComponentProps, RichTextFieldClient } from 'payload'\n\nimport { createHeadlessEditor } from '@lexical/headless'\nimport { useClientFunctions, useTableCell } from '@payloadcms/ui'\nimport { $getRoot } from 'lexical'\nimport React, { useEffect, useState } from 'react'\n\nimport type { FeatureProviderClient } from '../features/typesClient.js'\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\nimport type { GeneratedFeatureProviderComponent, LexicalFieldAdminProps } from '../types.js'\n\nimport { defaultEditorLexicalConfig } from '../lexical/config/client/default.js'\nimport { loadClientFeatures } from '../lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from '../lexical/config/client/sanitize.js'\nimport { getEnabledNodes } from '../lexical/nodes/index.js'\n\nexport const RichTextCell: React.FC<\n {\n admin?: LexicalFieldAdminProps\n lexicalEditorConfig: LexicalEditorConfig\n } & CellComponentProps<RichTextFieldClient>\n> = (props) => {\n const {\n admin,\n field: { _schemaPath, richTextComponentMap },\n lexicalEditorConfig,\n } = props\n\n const [preview, setPreview] = React.useState('Loading...')\n\n const { cellData } = useTableCell()\n\n const clientFunctions = useClientFunctions()\n const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false)\n\n const [featureProviders, setFeatureProviders] = useState<\n FeatureProviderClient<unknown, unknown>[]\n >([])\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<SanitizedClientEditorConfig>(null)\n\n const featureProviderComponents: GeneratedFeatureProviderComponent[] = (\n richTextComponentMap.get('features') as GeneratedFeatureProviderComponent[]\n ).sort((a, b) => a.order - b.order) // order by order\n\n let featureProvidersAndComponentsToLoad = 0 // feature providers and components\n for (const featureProvider of featureProviderComponents) {\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(`feature.${featureProvider.key}.components.`),\n )\n\n featureProvidersAndComponentsToLoad += 1\n featureProvidersAndComponentsToLoad += featureComponentKeys.length\n }\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n const featureProvidersLocal: FeatureProviderClient<unknown, unknown>[] = []\n let featureProvidersAndComponentsLoaded = 0 // feature providers and components only\n\n Object.entries(clientFunctions).forEach(([key, plugin]) => {\n if (key.startsWith(`lexicalFeature.${_schemaPath}.`)) {\n if (!key.includes('.lexical_internal_components.')) {\n featureProvidersLocal.push(plugin)\n }\n featureProvidersAndComponentsLoaded++\n }\n })\n\n if (featureProvidersAndComponentsLoaded === featureProvidersAndComponentsToLoad) {\n setFeatureProviders(featureProvidersLocal)\n setHasLoadedFeatures(true)\n\n /**\n * Loaded feature provided => create the final sanitized editor config\n */\n\n const resolvedClientFeatures = loadClientFeatures({\n clientFunctions,\n schemaPath: _schemaPath,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: lexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig,\n resolvedClientFeatures,\n admin,\n ),\n )\n }\n }\n }, [\n admin,\n featureProviderComponents,\n hasLoadedFeatures,\n clientFunctions,\n _schemaPath,\n featureProviderComponents.length,\n featureProviders,\n finalSanitizedEditorConfig,\n lexicalEditorConfig,\n richTextComponentMap,\n featureProvidersAndComponentsToLoad,\n ])\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n return\n }\n let dataToUse = cellData\n if (dataToUse == null || !hasLoadedFeatures || !finalSanitizedEditorConfig) {\n setPreview('')\n return\n }\n\n // Transform data through load hooks\n if (finalSanitizedEditorConfig?.features?.hooks?.load?.length) {\n finalSanitizedEditorConfig.features.hooks.load.forEach((hook) => {\n dataToUse = hook({ incomingEditorState: dataToUse })\n })\n }\n\n if (!dataToUse || typeof dataToUse !== 'object') {\n setPreview('')\n return\n }\n\n // If data is from Slate and not Lexical\n if (Array.isArray(dataToUse) && !('root' in dataToUse)) {\n setPreview('')\n return\n }\n\n // If data is from payload-plugin-lexical\n if ('jsonContent' in dataToUse) {\n setPreview('')\n return\n }\n\n // initialize headless editor\n const headlessEditor = createHeadlessEditor({\n namespace: finalSanitizedEditorConfig.lexical.namespace,\n nodes: getEnabledNodes({ editorConfig: finalSanitizedEditorConfig }),\n theme: finalSanitizedEditorConfig.lexical.theme,\n })\n headlessEditor.setEditorState(headlessEditor.parseEditorState(dataToUse))\n\n const textContent =\n headlessEditor.getEditorState().read(() => {\n return $getRoot().getTextContent()\n }) || ''\n\n // Limiting the number of characters shown is done in a CSS rule\n setPreview(textContent)\n }, [cellData, lexicalEditorConfig, hasLoadedFeatures, finalSanitizedEditorConfig])\n\n if (!hasLoadedFeatures) {\n return (\n <React.Fragment>\n {Array.isArray(featureProviderComponents) &&\n featureProviderComponents.map((featureProvider) => {\n // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(\n `lexical_internal_feature.${featureProvider.key}.lexical_internal_components.`,\n ),\n )\n\n const featureComponents: React.ReactNode[] = featureComponentKeys.map((key) => {\n return richTextComponentMap.get(key)\n }) as React.ReactNode[]\n\n return (\n <React.Fragment key={featureProvider.key}>\n {featureComponents?.length\n ? featureComponents.map((FeatureComponent) => {\n return FeatureComponent\n })\n : null}\n {featureProvider.ClientFeature}\n </React.Fragment>\n )\n })}\n </React.Fragment>\n )\n }\n\n return <span>{preview}</span>\n}\n"],"mappings":"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","ignoreList":[]}
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as o,jsxs as t}from"react/jsx-runtime";import"react";var c=n=>{let{data:e}=n;return t("div",{children:["Unknown converted Slate node: ",o("strong",{children:e?.nodeType})]})};export{c as UnknownConvertedNodeComponent};
2
+ //# sourceMappingURL=Component-DOSSWC76.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.tsx"],
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\n\nimport type { UnknownConvertedNodeData } from './index.js'\n\nimport './index.scss'\n\ntype Props = {\n data: UnknownConvertedNodeData\n}\n\nexport const UnknownConvertedNodeComponent: React.FC<Props> = (props) => {\n const { data } = props\n\n return (\n <div>\n Unknown converted Slate node: <strong>{data?.nodeType}</strong>\n </div>\n )\n}\n"],
5
+ "mappings": "+DACA,MAAkB,QAUX,IAAMA,EAAkDC,GAAA,CAC7D,GAAM,CAAEC,KAAAA,CAAI,EAAKD,EAEjB,OACEE,EAAC,MAAA,WAAI,iCAC2BC,EAAC,SAAA,UAAQF,GAAMG,aAGnD",
6
+ "names": ["UnknownConvertedNodeComponent", "props", "data", "_jsxs", "_jsx", "nodeType"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use client";import{jsx as e,jsxs as t}from"react/jsx-runtime";import"react";var a=n=>{let{data:o}=n;return t("div",{children:["Unknown converted payload-plugin-lexical node: ",e("strong",{children:o?.nodeType})]})};export{a as UnknownConvertedNodeComponent};
2
+ //# sourceMappingURL=Component-MBLHTKDK.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.tsx"],
4
+ "sourcesContent": ["'use client'\nimport React from 'react'\n\nimport type { UnknownConvertedNodeData } from './index.js'\n\nimport './index.scss'\n\ntype Props = {\n data: UnknownConvertedNodeData\n}\n\nexport const UnknownConvertedNodeComponent: React.FC<Props> = (props) => {\n const { data } = props\n\n return (\n <div>\n Unknown converted payload-plugin-lexical node: <strong>{data?.nodeType}</strong>\n </div>\n )\n}\n"],
5
+ "mappings": "+DACA,MAAkB,QAUX,IAAMA,EAAkDC,GAAA,CAC7D,GAAM,CAAEC,KAAAA,CAAI,EAAKD,EAEjB,OACEE,EAAC,MAAA,WAAI,kDAC4CC,EAAC,SAAA,UAAQF,GAAMG,aAGpE",
6
+ "names": ["UnknownConvertedNodeComponent", "props", "data", "_jsxs", "_jsx", "nodeType"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use client";import{a as he,b as xe,c as be,d as Ce,e as J,f as $,h as Ee}from"./chunk-TO2W7Q2G.js";import{a as ye,b as M}from"./chunk-NI6Z4GBD.js";import{jsx as V,jsxs as ge}from"react/jsx-runtime";import{FieldDescription as to,FieldError as oo,FieldLabel as no,useField as ro,useFieldProps as io,withCondition as so}from"@payloadcms/ui";import{useCallback as lo}from"react";import{ErrorBoundary as ao}from"react-error-boundary";import{jsx as z}from"react/jsx-runtime";import{LexicalComposer as eo}from"@lexical/react/LexicalComposer.js";import*as Ze from"react";import{useMemo as Xe}from"react";import{c as jt}from"react/compiler-runtime";import{jsx as w,jsxs as ne}from"react/jsx-runtime";import{useLexicalComposerContext as zt}from"@lexical/react/LexicalComposerContext.js";import{LexicalErrorBoundary as Ht}from"@lexical/react/LexicalErrorBoundary.js";import{HistoryPlugin as Kt}from"@lexical/react/LexicalHistoryPlugin.js";import{OnChangePlugin as Gt}from"@lexical/react/LexicalOnChangePlugin.js";import{RichTextPlugin as Wt}from"@lexical/react/LexicalRichTextPlugin.js";import{TabIndentationPlugin as Yt}from"@lexical/react/LexicalTabIndentationPlugin.js";import{BLUR_COMMAND as Ut,COMMAND_PRIORITY_LOW as Ve,FOCUS_COMMAND as Vt}from"lexical";import*as te from"react";import{useEffect as qe,useState as Je}from"react";import{jsx as Ne}from"react/jsx-runtime";import"react";var W=({anchorElem:t,clientProps:e,plugin:n})=>n.position==="floatingAnchorElem"?n.Component&&Ne(n.Component,{anchorElem:t,clientProps:e}):n.Component&&Ne(n.Component,{clientProps:e});import{c as it}from"react/compiler-runtime";import{jsx as st}from"react/jsx-runtime";import{MarkdownShortcutPlugin as lt}from"@lexical/react/LexicalMarkdownShortcutPlugin.js";import"react";var we=()=>{let t=it(2),{editorConfig:e}=M(),n;return t[0]!==e.features.markdownTransformers?(n=st(lt,{transformers:e.features.markdownTransformers}),t[0]=e.features.markdownTransformers,t[1]=n):n=t[1],n};import{jsx as Q,jsxs as ke}from"react/jsx-runtime";import{useLexicalComposerContext as ct}from"@lexical/react/LexicalComposerContext.js";import{useFieldProps as Re,useTranslation as Se}from"@payloadcms/ui";import{useCallback as Te,useMemo as ut,useState as mt}from"react";import"react";import*as ve from"react-dom";import{c as at}from"react/compiler-runtime";import"react";function Pe(t,e){let n=at(4),{maxLength:o,minLength:r}=e,a=o===void 0?75:o,d=r===void 0?1:r,p;return n[0]!==t||n[1]!==a||n[2]!==d?(p=c=>{let{query:s}=c,b="[^"+t+xe+"\\s]",l=new RegExp("(^|\\s|\\()(["+t+"]((?:"+b+"){0,"+a+"}))$").exec(s);if(l!==null){let i=l[1],g=l[3];if(g.length>=d)return{leadOffset:l.index+i.length,matchingString:g,replaceableString:l[2]}}return null},n[0]=t,n[1]=a,n[2]=d,n[3]=p):p=n[3],p}var A="slash-menu-popup";function dt({isSelected:t,item:e,onClick:n,onMouseEnter:o}){let{field:{richTextComponentMap:r}}=M(),{schemaPath:a}=Re(),{i18n:d}=Se(),p=`${A}__item ${A}__item-${e.key}`;t&&(p+=` ${A}__item--selected`);let c=e.key;return e.label&&(c=typeof e.label=="function"?e.label({i18n:d,richTextComponentMap:r,schemaPath:a}):e.label),c.length>25&&(c=c.substring(0,25)+"..."),ke("button",{"aria-selected":t,className:p,id:A+"__item-"+e.key,onClick:n,onMouseEnter:o,ref:s=>{e.ref={current:s}},role:"option",tabIndex:-1,type:"button",children:[e?.Icon&&Q(e.Icon,{}),Q("span",{className:`${A}__item-text`,children:c})]},e.key)}function Me({anchorElem:t=document.body}){let[e]=ct(),[n,o]=mt(null),{editorConfig:r}=M(),{i18n:a}=Se(),{field:{richTextComponentMap:d}}=M(),{schemaPath:p}=Re(),c=Pe("/",{minLength:0}),s=Te(()=>{let l=[];for(let i of r.features.slashMenu.dynamicGroups){let g=i({editor:e,queryString:n});l=l.concat(g)}return l},[e,n,r?.features]),b=ut(()=>{let l=[];for(let i of r?.features.slashMenu.groups??[])l.push(i);if(n){l=l.map(g=>{let h=g.items.filter(m=>{let f=m.key;return m.label&&(f=typeof m.label=="function"?m.label({i18n:a,richTextComponentMap:d,schemaPath:p}):m.label),new RegExp(n,"gi").exec(f)?!0:m.keywords!=null?m.keywords.some(u=>new RegExp(n,"gi").exec(u)):!1});return h.length?{...g,items:h}:null}),l=l.filter(g=>g!=null);let i=s();for(let g of i){let h=l.find(m=>m.key===g.key);h?l=l.filter(m=>m.key!==g.key):h={...g,items:[]},h?.items?.length&&(h.items=h.items.concat(h.items)),l.push(h)}}return l},[s,n,r?.features,a]),y=Te((l,i,g,h)=>{i&&e.update(()=>{i.remove()}),l.onSelect({editor:e,queryString:h}),g()},[e]);return Q(Ce,{anchorElem:t,groups:b,menuRenderFn:(l,{selectItemAndCleanUp:i,selectedItemKey:g,setSelectedItemKey:h})=>l.current&&b.length?ve.createPortal(Q("div",{className:A,children:b.map(m=>{let f=m.key;return m.label&&(f=typeof m.label=="function"?m.label({i18n:a,richTextComponentMap:d,schemaPath:p}):m.label),ke("div",{className:`${A}__group ${A}__group-${m.key}`,children:[Q("div",{className:`${A}__group-title`,children:f}),m.items.map((u,x)=>Q(dt,{index:x,isSelected:g===u.key,item:u,onClick:()=>{h(u.key),i(u)},onMouseEnter:()=>{h(u.key)}},u.key))]},m.key)})}),l.current):null,onQueryChange:o,onSelectItem:y,triggerFn:c})}import{c as xt}from"react/compiler-runtime";import{jsx as fe}from"react/jsx-runtime";import{useLexicalComposerContext as bt}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as Ct}from"lexical";import*as Ae from"react";import{useEffect as Be,useRef as Et,useState as Nt}from"react";import{createPortal as wt}from"react-dom";var X=(t,e,n,o,r=50,a=25)=>{let d=0;if(t&&!t.contains(o)){let{bottom:p,left:c,right:s,top:b}=t.getBoundingClientRect(),y=b+window.scrollY,l=p+window.scrollY;if(n<y-a||n>l+a||e<c-r||e>s+r)return-1;(e<c||e>s)&&(d=e<c?e-c:e-s)}return d};import{$getNodeByKey as ie}from"lexical";function j(t){let e=t.getBoundingClientRect(),n=getComputedStyle(t).getPropertyValue("transform");if(!n||n==="none")return e;let o=n.split(",").pop();return e.y=e.y-Number(o.replace(")","")),e}function re(t){let e=(c,s)=>c?parseFloat(window.getComputedStyle(c)[s]):0,{marginBottom:n,marginTop:o}=window.getComputedStyle(t),r=e(t.previousElementSibling,"marginBottom"),a=e(t.nextElementSibling,"marginTop"),d=Math.max(parseFloat(o),r);return{marginBottom:Math.max(parseFloat(n),a),marginTop:d}}import{$getRoot as ft}from"lexical";function Y(t){return t.getEditorState().read(()=>ft().getChildrenKeys())}var pt=1,gt=-1,Ie=0,D={props:null,result:null};function ht(t,e,n=20){let o=t.x-e.x,r=t.y-e.y;return o*o+r*r<=n*n}function Z(t){let{anchorElem:e,cache_threshold:n=20,editor:o,fuzzy:r=!1,horizontalOffset:a=0,point:{x:d,y:p},startIndex:c=0,useEdgeAsDefault:s=!1,verbose:b=!1}=t;if(n>0&&D.props&&D.result&&D.props.fuzzy===t.fuzzy&&D.props.horizontalOffset===t.horizontalOffset&&D.props.useEdgeAsDefault===t.useEdgeAsDefault&&ht(D.props.point,t.point,n))return D.result;let y=e.getBoundingClientRect(),l=Y(o),i={blockElem:null,blockNode:null,distance:1/0,foundAtIndex:-1,isFoundNodeEmptyParagraph:!1};return o.getEditorState().read(()=>{if(s){let[m,f]=[o.getElementByKey(l[0]),o.getElementByKey(l[l.length-1])],[u,x]=[j(m),j(f)];if(u&&x&&(p<u.top?(i.blockElem=m,i.distance=u.top-p,i.blockNode=ie(l[0]),i.foundAtIndex=0):p>x.bottom&&(i.distance=p-x.bottom,i.blockNode=ie(l[l.length-1]),i.blockElem=f,i.foundAtIndex=l.length-1),i?.blockElem))return{blockElem:null,isFoundNodeEmptyParagraph:!1}}let g=c,h=Ie;for(;g>=0&&g<l.length;){let m=l[g],f=o.getElementByKey(m);if(f===null)break;let u=new $(d+a,p),x=Ee.fromDOMRect(j(f)),{marginBottom:C,marginTop:S}=re(f),k=x.generateNewRect({bottom:x.bottom+C,left:y.left,right:y.right,top:x.top-S}),{distance:N,isOnBottomSide:I,isOnTopSide:R}=k.distanceFromPoint(u);if(N===0){i.blockElem=f,i.blockNode=ie(m),i.foundAtIndex=g,i.distance=N,i.blockNode&&i.blockNode.getType()==="paragraph"&&i.blockNode.getTextContent()===""&&(!r&&!t.returnEmptyParagraphs&&(i.blockElem=null,i.blockNode=null),i.isFoundNodeEmptyParagraph=!0);break}else r&&N<i.distance&&(i.blockElem=f,i.blockNode=ie(m),i.distance=N,i.foundAtIndex=g);h===Ie&&(R?h=gt:I?h=pt:h=1/0),g+=h}}),D.props=t,D.result={blockElem:i.blockElem,blockNode:i.blockNode,foundAtIndex:i.foundAtIndex,isFoundNodeEmptyParagraph:i.isFoundNodeEmptyParagraph},{blockElem:i.blockElem,blockNode:i.blockNode,foundAtIndex:i.foundAtIndex,isFoundNodeEmptyParagraph:i.isFoundNodeEmptyParagraph}}function se(t,e){return!!t.closest(`.${e}`)}var yt=["IMG","INPUT","TEXTAREA","SELECT","BUTTON","VIDEO","OBJECT","EMBED","IFRAME","HR"];function Le(t){if(!t||yt.includes(t.tagName)||t.offsetHeight===0||t.offsetWidth===0)return!1;let e=window.getComputedStyle(t);return!(e.display==="table-cell"||e.position==="absolute"||e.visibility==="hidden"||e.opacity==="0")}function le(t,e,n,o=0){if(!t){e.style.opacity="0",e.style.transform="translate(-10000px, -10000px)";return}let r=t.getBoundingClientRect(),a=window.getComputedStyle(t),d=e.getBoundingClientRect(),p=n.getBoundingClientRect(),c;if(r.height<60)c=r.top-d.height/2-p.top+r.height/2-1;else{let y=Le(t)?parseInt(a.lineHeight,10):0;c=r.top+(y-d.height)/2-p.top-1}let b=o;e.style.opacity="1",e.style.transform=`translate(${b}px, ${c}px)`}var Pt="add-block-menu",ae=1/0;function Tt(t){return t===0?1/0:ae>=0&&ae<t?ae:Math.floor(t/2)}function kt(t,e,n){let o=xt(15),r=e.parentElement,{editorConfig:a}=M(),d=a?.admin?.hideGutter?-24:12,p=Et(null),[c,s]=Nt(null),b,y;o[0]!==r||o[1]!==t||o[2]!==e||o[3]!==c?(b=()=>{let m=function(u){let x=u.target;if(!J(x))return;let C=X(r,u.pageX,u.pageY,x);if(C===-1){s(null);return}if(se(x,Pt))return;let S=Y(t),{blockElem:k,blockNode:N,foundAtIndex:I}=Z({anchorElem:e,cache_threshold:0,editor:t,horizontalOffset:-C,point:new $(u.x,u.y),returnEmptyParagraphs:!0,startIndex:Tt(S.length),useEdgeAsDefault:!1});ae=I,k&&(c?.node!==N||c?.elem!==k)&&s({elem:k,node:N})};return document?.addEventListener("mousemove",m),()=>{document?.removeEventListener("mousemove",m)}},y=[r,e,t,c],o[0]=r,o[1]=t,o[2]=e,o[3]=c,o[4]=b,o[5]=y):(b=o[4],y=o[5]),Be(b,y);let l;o[6]!==e||o[7]!==c||o[8]!==d?(l=[e,c,d],o[6]=e,o[7]=c,o[8]=d,o[9]=l):l=o[9],Be(()=>{p.current&&c?.node&&le(c?.elem,p.current,e,d)},l);let i;o[10]!==c||o[11]!==t?(i=m=>{let f;f=c,f?.node&&(t.update(()=>{let u=!0;if((f.node.getType()!=="paragraph"||f.node.getTextContent()!=="")&&(u=!1),!u){let x=Ct();f.node.insertAfter(x),setTimeout(()=>{f={elem:t.getElementByKey(x.getKey()),node:x},s(f)},0)}}),setTimeout(()=>{t.update(()=>{t.focus(),f.node&&"select"in f.node&&typeof f.node.select=="function"&&f.node.select()})},1),setTimeout(()=>{t.dispatchCommand(be,{node:f.node})},2),m.stopPropagation(),m.preventDefault())},o[10]=c,o[11]=t,o[12]=i):i=o[12];let g=i,h;return o[13]!==g?(h=m=>{g(m)},o[13]=g,o[14]=h):h=o[14],wt(fe(Ae.Fragment,{children:fe("button",{className:"icon add-block-menu",onClick:h,ref:p,type:"button",children:fe("div",{className:n?"icon":""})})}),e)}function De(t){let{anchorElem:e}=t,n=e===void 0?document.body:e,[o]=bt();return kt(o,n,o._editable)}import{c as vt}from"react/compiler-runtime";import{jsx as ce,jsxs as Mt}from"react/jsx-runtime";import{useLexicalComposerContext as It}from"@lexical/react/LexicalComposerContext.js";import{eventFiles as _e}from"@lexical/rich-text";import{$getNearestNodeFromDOMNode as $e,$getNodeByKey as Lt}from"lexical";import*as Ge from"react";import{useEffect as pe,useRef as ue,useState as je}from"react";import{createPortal as Bt}from"react-dom";function Fe(t,e,n){if(!t.current)return;let{left:o,top:r}=n.getBoundingClientRect(),a=j(e),d=a.width,p=a.height,c=a.top-r,s=a.left-o;t.current.style.border="2px solid green",t.current.style.boxSizing="border-box",t.current.style.height=p+"px",t.current.style.pointerEvents="none",t.current.style.position="absolute",t.current.style.top=c+"px",t.current.style.left=s+"px",t.current.style.width=d+"px",t.current.style.zIndex="1000",t.current.style.opacity="0.5"}var ee=25,Rt=-24,St=!1,U=0;function Oe(t,e,n,o,r,a,d,p,c,s=!1){let{height:b,top:y}=o.getBoundingClientRect(),{top:l,width:i}=d.getBoundingClientRect(),{marginBottom:g,marginTop:h}=re(o),m=y,f=a>=y+b/2+window.scrollY,u=!1;if(r?.elem)if(o!==r?.elem)(f&&r?.elem&&r?.elem===o.nextElementSibling||!f&&r?.elem&&r?.elem===o.previousElementSibling)&&(U++,U<200&&(u=!0));else{U++;let N=r?.boundingBox?.y,I=o.getBoundingClientRect().y;(f===r?.isBelow&&N===I||U<200)&&(u=!1)}if(u)return{isBelow:f,willStayInSamePosition:u};s?m+=b/2:f?m+=b+g/2:m-=h/2;let x=0;s||(f?x=-ee:x=ee);let C=m-l+x,S=Rt-e;n.style.width=`calc(${i}px - ${t})`,n.style.opacity=".4";let k=12;return s?n.style.transform=`translate(${S}px, ${C-ee}px)`:f?(o.style.marginBottom=ee*2+k+"px",n.style.transform=`translate(${S}px, calc(${C}px - 0px))`):(o.style.marginTop=ee*2+k+"px",n.style.transform=`translate(${S}px, calc(${C-ee*2}px - 0px))`),St&&Fe(c,o,d),r.elem.style.opacity="",r?.elem===o?f?r.elem.style.marginTop="":r.elem.style.marginBottom="":(r.elem.style.marginBottom="",r.elem.style.marginTop=""),U=0,{isBelow:f,willStayInSamePosition:u}}var At="draggable-block-menu",ze="application/x-lexical-drag-block",oe=1/0;function He(t){return t===0?1/0:oe>=0&&oe<t?oe:Math.floor(t/2)}function Dt(t,e){let{transform:n}=e.style;t.setDragImage(e,0,0),setTimeout(()=>{e.style.transform=n})}function Ke(t,e){t&&(t.style.opacity="0"),e&&(e.style.opacity="",e.style.marginBottom="",e.style.marginTop="")}function Ft(t,e,n){let o=vt(19),r=e.parentElement,a=ue(null),d=ue(null),p=ue(null),c=ue(!1),[s,b]=je(null),[y,l]=je(null),{editorConfig:i}=M(),g=i?.admin?.hideGutter?-44:-8,h,m;o[0]!==r||o[1]!==t||o[2]!==e||o[3]!==s?(h=()=>{let N=function(R){let E=R.target;if(!J(E))return;let v=X(r,R.pageX,R.pageY,E);if(v===-1){b(null);return}if(se(E,At))return;let H=Y(t),{blockElem:B,foundAtIndex:F,isFoundNodeEmptyParagraph:O}=Z({anchorElem:e,cache_threshold:0,editor:t,horizontalOffset:-v,point:new $(R.x,R.y),startIndex:He(H.length),useEdgeAsDefault:!1,verbose:!1});oe=F,!(!B&&!O)&&s!==B&&b(B)};return document?.addEventListener("mousemove",N),()=>{document?.removeEventListener("mousemove",N)}},m=[r,e,t,s],o[0]=r,o[1]=t,o[2]=e,o[3]=s,o[4]=h,o[5]=m):(h=o[4],m=o[5]),pe(h,m);let f,u;o[6]!==s||o[7]!==e||o[8]!==g?(f=()=>{a.current&&le(s,a.current,e,g)},u=[e,s,g],o[6]=s,o[7]=e,o[8]=g,o[9]=f,o[10]=u):(f=o[9],u=o[10]),pe(f,u);let x=i?.admin?.hideGutter,C;return o[11]!==r||o[12]!==g||o[13]!==e||o[14]!==t||o[15]!==y||o[16]!==s||o[17]!==x?(C=[r,g,e,t,y,s,x],o[11]=r,o[12]=g,o[13]=e,o[14]=t,o[15]=y,o[16]=s,o[17]=x,o[18]=C):C=o[18],pe(()=>{let N=function(E){if(!c.current)return!1;let[v]=_e(E);if(v)return!1;let{pageY:H,target:B}=E;if(!J(B))return!1;let F=X(r,E.pageX,E.pageY,B,100,50),O=Y(t),{blockElem:T,foundAtIndex:K,isFoundNodeEmptyParagraph:L}=Z({anchorElem:e,editor:t,fuzzy:!0,horizontalOffset:-F,point:new $(E.x,E.y),startIndex:He(O.length),useEdgeAsDefault:!0,verbose:!0});oe=K;let G=d.current;if(T===null||G===null)return!1;if(s!==T){let{isBelow:_,willStayInSamePosition:de}=Oe(i?.admin?.hideGutter?"0px":"3rem",g+(i?.admin?.hideGutter?a?.current?.getBoundingClientRect()?.width??0:-(a?.current?.getBoundingClientRect()?.width??0)),G,T,y,H,e,E,p,L);E.preventDefault(),de||l({boundingBox:T.getBoundingClientRect(),elem:T,isBelow:_})}else Ke(G,y?.elem),l({boundingBox:T.getBoundingClientRect(),elem:T,isBelow:!1});return!0},I=function(E){if(!c.current)return!1;let[v]=_e(E);if(v)return!1;let{dataTransfer:H,pageY:B,target:F}=E,O=H?.getData(ze)||"";return t.update(()=>{let T=Lt(O);if(!T||!J(F))return!1;let K=X(r,E.pageX,E.pageY,F,100,50),{blockElem:L,isFoundNodeEmptyParagraph:G}=Z({anchorElem:e,editor:t,fuzzy:!0,horizontalOffset:-K,point:new $(E.x,E.y),useEdgeAsDefault:!0});if(!L)return!1;let _=$e(L);if(!_)return!1;if(_===T)return!0;let{height:de,top:ot}=j(L),nt=B>=ot+de/2+window.scrollY;G?(_.insertBefore(T),_.remove()):nt?_.insertAfter(T):_.insertBefore(T),s!==null&&b(null),document.querySelectorAll(".lexical-block-highlighter").forEach(q=>{q.remove()});let rt=t.getElementByKey(T.getKey());setTimeout(()=>{let q=rt.getBoundingClientRect(),P=document.createElement("div");P.className="lexical-block-highlighter",document.documentElement.getAttribute("data-theme")==="dark"?P.style.backgroundColor="white":P.style.backgroundColor="black",P.style.transition="opacity 0.1s ease-in-out",P.style.zIndex="1",P.style.pointerEvents="none",P.style.boxSizing="border-box",P.style.borderRadius="4px",P.style.position="absolute",document.body.appendChild(P),P.style.opacity="0.1",P.style.height=`${q.height+8}px`,P.style.width=`${q.width+8}px`,P.style.top=`${q.top+window.scrollY-4}px`,P.style.left=`${q.left-4}px`,setTimeout(()=>{P.style.opacity="0",setTimeout(()=>{P.remove()},1e3)},3e3)},120)}),!0};return document.addEventListener("dragover",N),document.addEventListener("drop",I),()=>{document.removeEventListener("dragover",N),document.removeEventListener("drop",I)}},C),Bt(Mt(Ge.Fragment,{children:[ce("div",{className:"icon draggable-block-menu",draggable:!0,onDragEnd:function(){c.current=!1,Ke(d.current,y?.elem)},onDragStart:function(I){let R=I.dataTransfer;if(!R||!s)return;Dt(R,s);let E;E="",t.update(()=>{let v=$e(s);v&&(E=v.getKey())}),c.current=!0,R.setData(ze,E)},ref:a,children:ce("div",{className:n?"icon":""})}),ce("div",{className:"draggable-block-target-line",ref:d}),ce("div",{className:"debug-highlight",ref:p})]}),e)}function We(t){let{anchorElem:e}=t,n=e===void 0?document.body:e,[o]=It();return Ft(o,n,o._editable)}import{c as Ot}from"react/compiler-runtime";import{jsx as Ye}from"react/jsx-runtime";import{ContentEditable as _t}from"@lexical/react/LexicalContentEditable.js";import{useTranslation as $t}from"@payloadcms/ui";import"react";function Ue(t){let e=Ot(3),{className:n}=t,{t:o}=$t(),r;return e[0]!==o||e[1]!==n?(r=Ye(_t,{"aria-placeholder":o("lexical:general:placeholder"),className:n??"ContentEditable__root",placeholder:Ye("p",{className:"editor-placeholder",children:o("lexical:general:placeholder")})}),e[0]=o,e[1]=n,e[2]=r):r=e[2],r}var Qe=t=>{let e=jt(22),{editorConfig:n,editorContainerRef:o,onChange:r}=t,a=M(),[d]=zt(),[p,c]=Je(null),s;e[0]===Symbol.for("react.memo_cache_sentinel")?(s=u=>{u!==null&&c(u)},e[0]=s):s=e[0];let b=s,y,l;e[1]!==a||e[2]!==d?(y=()=>{if(!a?.uuid){console.error("Lexical Editor must be used within an EditorConfigProvider");return}a?.parentEditor?.uuid&&a.parentEditor?.registerChild(a.uuid,a);let u=()=>{a.focusEditor(a)},x=()=>{a.blurEditor(a)},C=d.registerCommand(Vt,()=>(u(),!0),Ve),S=d.registerCommand(Ut,()=>(x(),!0),Ve);return()=>{C(),S(),a.parentEditor?.unregisterChild?.(a.uuid)}},l=[d,a],e[1]=a,e[2]=d,e[3]=y,e[4]=l):(y=e[3],l=e[4]),qe(y,l);let[i,g]=Je(!1),h,m;e[5]!==i?(h=()=>{let u=()=>{let x=window.matchMedia("(max-width: 768px)").matches;x!==i&&g(x)};return u(),window.addEventListener("resize",u),()=>{window.removeEventListener("resize",u)}},m=[i],e[5]=i,e[6]=h,e[7]=m):(h=e[6],m=e[7]),qe(h,m);let f;if(e[8]!==n.features||e[9]!==r||e[10]!==p||e[11]!==i||e[12]!==d||e[13]!==o){let u;e[15]!==r?(u=(C,S,k)=>{(!k.has("focus")||k.size>1)&&r?.(C,S,k)},e[15]=r,e[16]=u):u=e[16];let x;e[17]!==p||e[18]!==i||e[19]!==d||e[20]!==n?(x=p&&ne(te.Fragment,{children:[!i&&d.isEditable()&&ne(te.Fragment,{children:[w(We,{anchorElem:p}),w(De,{anchorElem:p})]}),n.features.plugins.map(C=>{if(C.position==="floatingAnchorElem"&&!(C.desktopOnly===!0&&i))return w(W,{anchorElem:p,clientProps:C.clientProps,plugin:C},C.key)}),d.isEditable()&&w(te.Fragment,{children:w(Me,{anchorElem:p})})]}),e[17]=p,e[18]=i,e[19]=d,e[20]=n,e[21]=x):x=e[21],f=ne(te.Fragment,{children:[n.features.plugins.map(qt),ne("div",{className:"editor-container",ref:o,children:[n.features.plugins.map(Jt),w(Wt,{ErrorBoundary:Ht,contentEditable:w("div",{className:"editor-scroller",children:w("div",{className:"editor",ref:b,children:w(Ue,{})})})}),w(Gt,{ignoreSelectionChange:!0,onChange:u}),x,d.isEditable()&&ne(te.Fragment,{children:[w(Kt,{}),n?.features?.markdownTransformers?.length>0&&w(we,{})]}),w(Yt,{}),n.features.plugins.map(Qt),n.features.plugins.map(Xt)]}),n.features.plugins.map(Zt)]}),e[8]=n.features,e[9]=r,e[10]=p,e[11]=i,e[12]=d,e[13]=o,e[14]=f}else f=e[14];return f};function qt(t){if(t.position==="aboveContainer")return w(W,{clientProps:t.clientProps,plugin:t},t.key)}function Jt(t){if(t.position==="top")return w(W,{clientProps:t.clientProps,plugin:t},t.key)}function Qt(t){if(t.position==="normal")return w(W,{clientProps:t.clientProps,plugin:t},t.key)}function Xt(t){if(t.position==="bottom")return w(W,{clientProps:t.clientProps,plugin:t},t.key)}function Zt(t){if(t.position==="belowContainer")return w(W,{clientProps:t.clientProps,plugin:t},t.key)}var et=({children:t,providers:e})=>{if(!e?.length)return t;let n=e[0];return e.length>1?z(n,{children:z(et,{providers:e.slice(1),children:t})}):z(n,{children:t})},tt=t=>{let{editorConfig:e,field:n,onChange:o,path:r,readOnly:a,value:d}=t,p=M(),c=Ze.useRef(null),s=Xe(()=>{let y=d;return e?.features?.hooks?.load?.length&&e.features.hooks.load.forEach(l=>{y=l({incomingEditorState:y})}),y},[e,d]),b=Xe(()=>{if(s&&typeof s!="object")throw new Error("The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: "+JSON.stringify(s));if(s&&Array.isArray(s)&&!("root"in s))throw new Error("You have tried to pass in data from the old Slate editor to the new Lexical editor. The data structure is different, thus you will have to migrate your data. We offer a one-line migration script which migrates all your rich text fields: https://payloadcms.com/docs/beta/lexical/migration#migration-via-migration-script-recommended");if(s&&"jsonContent"in s)throw new Error("You have tried to pass in data from payload-plugin-lexical. The data structure is different, thus you will have to migrate your data. Migration guide: https://payloadcms.com/docs/beta/lexical/migration#migrating-from-payload-plugin-lexical");return{editable:a!==!0,editorState:s!=null?JSON.stringify(s):void 0,namespace:e.lexical.namespace,nodes:[...he({editorConfig:e})],onError:y=>{throw y},theme:e.lexical.theme}},[e,s,a]);return b?z(eo,{initialConfig:b,children:z(ye,{editorConfig:e,editorContainerRef:c,field:n,parentContext:p,children:z(et,{providers:e.features.providers,children:z(Qe,{editorConfig:e,editorContainerRef:c,onChange:o})})})},r):z("p",{children:"Loading..."})};import"./bundled.css";var me="rich-text-lexical",co=t=>{let{descriptionProps:e,editorConfig:n,errorProps:o,field:{name:r,_path:a,admin:{className:d,components:{Description:p,Error:c,Label:s},readOnly:b,style:y,width:l}={},label:i,required:g},field:h,labelProps:m,readOnly:f,validate:u}=t,x=f||b,C=lo((K,L)=>{if(typeof u=="function")return u(K,{...L,props:t,required:g})},[u,g]),{path:S,readOnly:k}=io(),N=ro({path:S??a??r,validate:C}),{formInitializing:I,formProcessing:R,initialValue:E,path:v,setValue:H,showError:B,value:F}=N,O=x||k||R||I,T=[me,"field-type",d,B&&"error",O&&`${me}--read-only`,n?.admin?.hideGutter!==!0?`${me}--show-gutter`:null].filter(Boolean).join(" ");return ge("div",{className:T,style:{...y,width:l},children:[V(oo,{CustomError:c,path:v,...o||{},alignCaret:"left"}),V(no,{Label:s,label:i,required:g,...m||{}}),ge("div",{className:`${me}__wrap`,children:[V(ao,{fallbackRender:uo,onReset:()=>{},children:V(tt,{editorConfig:n,field:h,onChange:K=>{let L=K.toJSON();n?.features?.hooks?.save?.length&&n.features.hooks.save.forEach(G=>{L=G({incomingEditorState:L})}),H(L)},path:v,readOnly:O,value:F},JSON.stringify({initialValue:E,path:v}))}),V(to,{Description:p,...e||{}})]})]},v)};function uo({error:t}){return ge("div",{className:"errorBoundary",role:"alert",children:[V("p",{children:"Something went wrong:"}),V("pre",{style:{color:"red"},children:t.message})]})}var Tr=so(co);export{Tr as RichText};
2
+ //# sourceMappingURL=Field-KUSPHC7Q.js.map