@payloadcms/richtext-lexical 3.0.0-beta.5 → 3.0.0-beta.51

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 (968) hide show
  1. package/README.md +1 -1
  2. package/dist/cell/index.d.ts +5 -2
  3. package/dist/cell/index.d.ts.map +1 -1
  4. package/dist/cell/index.js +45 -31
  5. package/dist/cell/index.js.map +1 -1
  6. package/dist/exports/client/Component-6AVANNNR.js +2 -0
  7. package/dist/exports/client/Component-6AVANNNR.js.map +7 -0
  8. package/dist/exports/client/Component-SZVAYRJX.js +2 -0
  9. package/dist/exports/client/Component-SZVAYRJX.js.map +7 -0
  10. package/dist/exports/client/Field-U5PHZTST.js +2 -0
  11. package/dist/exports/client/Field-U5PHZTST.js.map +7 -0
  12. package/dist/exports/client/RelationshipComponent-FGUPLCD2.js +2 -0
  13. package/dist/exports/client/RelationshipComponent-FGUPLCD2.js.map +7 -0
  14. package/dist/exports/client/bundled.css +1 -0
  15. package/dist/exports/client/chunk-35NZOHAF.js +2 -0
  16. package/dist/exports/client/chunk-35NZOHAF.js.map +7 -0
  17. package/dist/exports/client/chunk-3PZ2ZFQG.js +3 -0
  18. package/dist/exports/client/chunk-3PZ2ZFQG.js.map +7 -0
  19. package/dist/exports/client/chunk-FSTRW2TI.js +2 -0
  20. package/dist/exports/client/chunk-FSTRW2TI.js.map +7 -0
  21. package/dist/exports/client/chunk-M6MN4CA5.js +2 -0
  22. package/dist/exports/client/chunk-M6MN4CA5.js.map +7 -0
  23. package/dist/exports/client/chunk-Y5455JF3.js +2 -0
  24. package/dist/exports/client/chunk-Y5455JF3.js.map +7 -0
  25. package/dist/exports/client/component-FFLILIUZ.js +2 -0
  26. package/dist/exports/client/component-FFLILIUZ.js.map +7 -0
  27. package/dist/exports/client/component-RAVN56DE.js +2 -0
  28. package/dist/exports/client/component-RAVN56DE.js.map +7 -0
  29. package/dist/exports/client/component-Z34HXRX3.js +2 -0
  30. package/dist/exports/client/component-Z34HXRX3.js.map +7 -0
  31. package/dist/exports/client/index.d.ts +52 -0
  32. package/dist/exports/client/index.d.ts.map +1 -0
  33. package/dist/exports/client/index.js +36 -0
  34. package/dist/exports/client/index.js.map +7 -0
  35. package/dist/field/Field.d.ts +1 -2
  36. package/dist/field/Field.d.ts.map +1 -1
  37. package/dist/field/Field.js +69 -55
  38. package/dist/field/Field.js.map +1 -1
  39. package/dist/field/bundled.css +0 -0
  40. package/dist/field/features/align/feature.client.d.ts +4 -1
  41. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  42. package/dist/field/features/align/feature.client.js +135 -54
  43. package/dist/field/features/align/feature.client.js.map +1 -1
  44. package/dist/field/features/align/feature.server.d.ts.map +1 -1
  45. package/dist/field/features/align/feature.server.js +4 -1
  46. package/dist/field/features/align/feature.server.js.map +1 -1
  47. package/dist/field/features/align/i18n.d.ts +3 -0
  48. package/dist/field/features/align/i18n.d.ts.map +1 -0
  49. package/dist/field/features/align/i18n.js +196 -0
  50. package/dist/field/features/align/i18n.js.map +1 -0
  51. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  52. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  53. package/dist/field/features/align/toolbarAlignGroup.js +12 -0
  54. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  55. package/dist/field/features/blockquote/feature.client.d.ts +4 -1
  56. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  57. package/dist/field/features/blockquote/feature.client.js +60 -46
  58. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  59. package/dist/field/features/blockquote/feature.server.d.ts +1 -1
  60. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  61. package/dist/field/features/blockquote/feature.server.js +10 -7
  62. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  63. package/dist/field/features/blockquote/i18n.d.ts +3 -0
  64. package/dist/field/features/blockquote/i18n.d.ts.map +1 -0
  65. package/dist/field/features/blockquote/i18n.js +100 -0
  66. package/dist/field/features/blockquote/i18n.js.map +1 -0
  67. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  68. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  69. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  70. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  71. package/dist/field/features/blocks/component/BlockContent.js +77 -67
  72. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  73. package/dist/field/features/blocks/component/FormSavePlugin.d.ts +1 -2
  74. package/dist/field/features/blocks/component/FormSavePlugin.d.ts.map +1 -1
  75. package/dist/field/features/blocks/component/FormSavePlugin.js +2 -2
  76. package/dist/field/features/blocks/component/FormSavePlugin.js.map +1 -1
  77. package/dist/field/features/blocks/component/index.d.ts +0 -1
  78. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  79. package/dist/field/features/blocks/component/index.js +60 -30
  80. package/dist/field/features/blocks/component/index.js.map +1 -1
  81. package/dist/field/features/blocks/component/removeEmptyArrayValues.d.ts +1 -1
  82. package/dist/field/features/blocks/component/removeEmptyArrayValues.d.ts.map +1 -1
  83. package/dist/field/features/blocks/component/removeEmptyArrayValues.js.map +1 -1
  84. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  85. package/dist/field/features/blocks/drawer/index.js +5 -11
  86. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  87. package/dist/field/features/blocks/feature.client.d.ts +4 -1
  88. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  89. package/dist/field/features/blocks/feature.client.js +58 -27
  90. package/dist/field/features/blocks/feature.client.js.map +1 -1
  91. package/dist/field/features/blocks/feature.server.d.ts +2 -5
  92. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  93. package/dist/field/features/blocks/feature.server.js +62 -82
  94. package/dist/field/features/blocks/feature.server.js.map +1 -1
  95. package/dist/field/features/blocks/{populationPromise.d.ts → graphQLPopulationPromise.d.ts} +1 -1
  96. package/dist/field/features/blocks/graphQLPopulationPromise.d.ts.map +1 -0
  97. package/dist/field/features/blocks/graphQLPopulationPromise.js +31 -0
  98. package/dist/field/features/blocks/graphQLPopulationPromise.js.map +1 -0
  99. package/dist/field/features/blocks/i18n.d.ts +3 -0
  100. package/dist/field/features/blocks/i18n.d.ts.map +1 -0
  101. package/dist/field/features/blocks/i18n.js +100 -0
  102. package/dist/field/features/blocks/i18n.js.map +1 -0
  103. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +2 -4
  104. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  105. package/dist/field/features/blocks/nodes/BlocksNode.js +3 -3
  106. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  107. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  108. package/dist/field/features/blocks/plugin/commands.js +1 -2
  109. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  110. package/dist/field/features/blocks/plugin/index.d.ts +3 -2
  111. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  112. package/dist/field/features/blocks/plugin/index.js +10 -11
  113. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  114. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  115. package/dist/field/features/blocks/validate.js +22 -36
  116. package/dist/field/features/blocks/validate.js.map +1 -1
  117. package/dist/field/features/converters/html/field/index.d.ts +14 -2
  118. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  119. package/dist/field/features/converters/html/field/index.js +97 -57
  120. package/dist/field/features/converters/html/field/index.js.map +1 -1
  121. package/dist/field/features/createFeaturePropComponent.d.ts.map +1 -1
  122. package/dist/field/features/createFeaturePropComponent.js +6 -3
  123. package/dist/field/features/createFeaturePropComponent.js.map +1 -1
  124. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +4 -1
  125. package/dist/field/features/debug/testRecorder/feature.client.d.ts.map +1 -0
  126. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
  127. package/dist/field/features/debug/testRecorder/feature.server.d.ts.map +1 -0
  128. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +3 -2
  129. package/dist/field/features/debug/testRecorder/feature.server.js.map +1 -0
  130. package/dist/field/features/debug/testRecorder/plugin/index.d.ts +5 -0
  131. package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -0
  132. package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +68 -45
  133. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -0
  134. package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +4 -1
  135. package/dist/field/features/debug/treeView/feature.client.d.ts.map +1 -0
  136. package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
  137. package/dist/field/features/debug/treeView/feature.server.d.ts.map +1 -0
  138. package/dist/field/features/debug/{treeview → treeView}/feature.server.js +3 -2
  139. package/dist/field/features/debug/treeView/feature.server.js.map +1 -0
  140. package/dist/field/features/debug/treeView/plugin/index.d.ts +4 -0
  141. package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -0
  142. package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +6 -8
  143. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -0
  144. package/dist/field/features/format/bold/feature.client.d.ts +4 -1
  145. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  146. package/dist/field/features/format/bold/feature.client.js +26 -23
  147. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  148. package/dist/field/features/format/bold/feature.server.d.ts.map +1 -1
  149. package/dist/field/features/format/bold/feature.server.js +2 -1
  150. package/dist/field/features/format/bold/feature.server.js.map +1 -1
  151. package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +4 -1
  152. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -0
  153. package/dist/field/features/format/inlineCode/feature.client.js +46 -0
  154. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
  155. package/dist/field/features/format/inlineCode/feature.server.d.ts.map +1 -0
  156. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +3 -2
  157. package/dist/field/features/format/inlineCode/feature.server.js.map +1 -0
  158. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
  159. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
  160. package/dist/field/features/format/italic/feature.client.d.ts +4 -1
  161. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  162. package/dist/field/features/format/italic/feature.client.js +27 -24
  163. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  164. package/dist/field/features/format/italic/feature.server.d.ts.map +1 -1
  165. package/dist/field/features/format/italic/feature.server.js +2 -1
  166. package/dist/field/features/format/italic/feature.server.js.map +1 -1
  167. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  168. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  169. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  170. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  171. package/dist/field/features/format/strikethrough/feature.client.d.ts +4 -1
  172. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  173. package/dist/field/features/format/strikethrough/feature.client.js +27 -24
  174. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  175. package/dist/field/features/format/strikethrough/feature.server.d.ts.map +1 -1
  176. package/dist/field/features/format/strikethrough/feature.server.js +2 -1
  177. package/dist/field/features/format/strikethrough/feature.server.js.map +1 -1
  178. package/dist/field/features/format/subscript/feature.client.d.ts +4 -1
  179. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  180. package/dist/field/features/format/subscript/feature.client.js +25 -22
  181. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  182. package/dist/field/features/format/subscript/feature.server.d.ts.map +1 -1
  183. package/dist/field/features/format/subscript/feature.server.js +2 -1
  184. package/dist/field/features/format/subscript/feature.server.js.map +1 -1
  185. package/dist/field/features/format/superscript/feature.client.d.ts +4 -1
  186. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  187. package/dist/field/features/format/superscript/feature.client.js +25 -22
  188. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  189. package/dist/field/features/format/superscript/feature.server.d.ts.map +1 -1
  190. package/dist/field/features/format/superscript/feature.server.js +2 -1
  191. package/dist/field/features/format/superscript/feature.server.js.map +1 -1
  192. package/dist/field/features/format/underline/feature.client.d.ts +4 -1
  193. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  194. package/dist/field/features/format/underline/feature.client.js +25 -22
  195. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  196. package/dist/field/features/format/underline/feature.server.d.ts.map +1 -1
  197. package/dist/field/features/format/underline/feature.server.js +2 -1
  198. package/dist/field/features/format/underline/feature.server.js.map +1 -1
  199. package/dist/field/features/heading/feature.client.d.ts +4 -1
  200. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  201. package/dist/field/features/heading/feature.client.js +75 -54
  202. package/dist/field/features/heading/feature.client.js.map +1 -1
  203. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  204. package/dist/field/features/heading/feature.server.js +9 -6
  205. package/dist/field/features/heading/feature.server.js.map +1 -1
  206. package/dist/field/features/heading/i18n.d.ts +3 -0
  207. package/dist/field/features/heading/i18n.d.ts.map +1 -0
  208. package/dist/field/features/heading/i18n.js +100 -0
  209. package/dist/field/features/heading/i18n.js.map +1 -0
  210. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  211. package/dist/field/features/heading/markdownTransformer.js +1 -2
  212. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  213. package/dist/field/features/horizontalRule/component/index.d.ts +10 -0
  214. package/dist/field/features/horizontalRule/component/index.d.ts.map +1 -0
  215. package/dist/field/features/horizontalRule/component/index.js +67 -0
  216. package/dist/field/features/horizontalRule/component/index.js.map +1 -0
  217. package/dist/field/features/horizontalRule/feature.client.d.ts +6 -0
  218. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
  219. package/dist/field/features/horizontalRule/feature.client.js +77 -0
  220. package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
  221. package/dist/field/features/horizontalRule/feature.server.d.ts +3 -0
  222. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
  223. package/dist/field/features/horizontalRule/feature.server.js +39 -0
  224. package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
  225. package/dist/field/features/horizontalRule/i18n.d.ts +3 -0
  226. package/dist/field/features/horizontalRule/i18n.d.ts.map +1 -0
  227. package/dist/field/features/horizontalRule/i18n.js +100 -0
  228. package/dist/field/features/horizontalRule/i18n.js.map +1 -0
  229. package/dist/field/features/horizontalRule/markdownTransformer.d.ts +3 -0
  230. package/dist/field/features/horizontalRule/markdownTransformer.d.ts.map +1 -0
  231. package/dist/field/features/horizontalRule/markdownTransformer.js +23 -0
  232. package/dist/field/features/horizontalRule/markdownTransformer.js.map +1 -0
  233. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts +53 -0
  234. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  235. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +92 -0
  236. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -0
  237. package/dist/field/features/horizontalRule/plugin/index.d.ts +7 -0
  238. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -0
  239. package/dist/field/features/horizontalRule/plugin/index.js +30 -0
  240. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
  241. package/dist/field/features/indent/feature.client.d.ts +4 -1
  242. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  243. package/dist/field/features/indent/feature.client.js +47 -42
  244. package/dist/field/features/indent/feature.client.js.map +1 -1
  245. package/dist/field/features/indent/feature.server.d.ts.map +1 -1
  246. package/dist/field/features/indent/feature.server.js +4 -1
  247. package/dist/field/features/indent/feature.server.js.map +1 -1
  248. package/dist/field/features/indent/i18n.d.ts +3 -0
  249. package/dist/field/features/indent/i18n.d.ts.map +1 -0
  250. package/dist/field/features/indent/i18n.js +132 -0
  251. package/dist/field/features/indent/i18n.js.map +1 -0
  252. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  253. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  254. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  255. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  256. package/dist/field/features/link/drawer/baseFields.d.ts +2 -3
  257. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  258. package/dist/field/features/link/drawer/baseFields.js +30 -43
  259. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  260. package/dist/field/features/link/drawer/index.d.ts.map +1 -1
  261. package/dist/field/features/link/drawer/index.js +32 -31
  262. package/dist/field/features/link/drawer/index.js.map +1 -1
  263. package/dist/field/features/link/drawer/types.d.ts +5 -3
  264. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  265. package/dist/field/features/link/drawer/types.js.map +1 -1
  266. package/dist/field/features/link/feature.client.d.ts +13 -1
  267. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  268. package/dist/field/features/link/feature.client.js +65 -47
  269. package/dist/field/features/link/feature.client.js.map +1 -1
  270. package/dist/field/features/link/feature.server.d.ts +10 -6
  271. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  272. package/dist/field/features/link/feature.server.js +66 -17
  273. package/dist/field/features/link/feature.server.js.map +1 -1
  274. package/dist/field/features/link/{populationPromise.d.ts → graphQLPopulationPromise.d.ts} +1 -1
  275. package/dist/field/features/link/graphQLPopulationPromise.d.ts.map +1 -0
  276. package/dist/field/features/link/graphQLPopulationPromise.js +31 -0
  277. package/dist/field/features/link/graphQLPopulationPromise.js.map +1 -0
  278. package/dist/field/features/link/i18n.d.ts +3 -0
  279. package/dist/field/features/link/i18n.d.ts.map +1 -0
  280. package/dist/field/features/link/i18n.js +100 -0
  281. package/dist/field/features/link/i18n.js.map +1 -0
  282. package/dist/field/features/link/markdownTransformer.d.ts +6 -0
  283. package/dist/field/features/link/markdownTransformer.d.ts.map +1 -0
  284. package/dist/field/features/link/markdownTransformer.js +50 -0
  285. package/dist/field/features/link/markdownTransformer.js.map +1 -0
  286. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  287. package/dist/field/features/link/nodes/AutoLinkNode.js +3 -2
  288. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  289. package/dist/field/features/link/nodes/LinkNode.d.ts +9 -8
  290. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  291. package/dist/field/features/link/nodes/LinkNode.js +28 -11
  292. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  293. package/dist/field/features/link/nodes/types.d.ts +2 -1
  294. package/dist/field/features/link/nodes/types.d.ts.map +1 -1
  295. package/dist/field/features/link/nodes/types.js.map +1 -1
  296. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  297. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  298. package/dist/field/features/link/plugins/autoLink/index.js +11 -12
  299. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  300. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  301. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  302. package/dist/field/features/link/plugins/clickableLink/index.js +5 -6
  303. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  304. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  305. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  306. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  307. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  308. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +179 -143
  309. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  310. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  311. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  312. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -2
  313. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  314. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -6
  315. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  316. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +12 -30
  317. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  318. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  319. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  320. package/dist/field/features/link/plugins/link/index.js +7 -16
  321. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  322. package/dist/field/features/link/validate.d.ts +6 -0
  323. package/dist/field/features/link/validate.d.ts.map +1 -0
  324. package/dist/field/features/link/validate.js +28 -0
  325. package/dist/field/features/link/validate.js.map +1 -0
  326. package/dist/field/features/lists/checklist/feature.client.d.ts +4 -1
  327. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  328. package/dist/field/features/lists/checklist/feature.client.js +69 -44
  329. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  330. package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
  331. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  332. package/dist/field/features/lists/checklist/feature.server.js +13 -10
  333. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  334. package/dist/field/features/lists/checklist/i18n.d.ts +3 -0
  335. package/dist/field/features/lists/checklist/i18n.d.ts.map +1 -0
  336. package/dist/field/features/lists/checklist/i18n.js +100 -0
  337. package/dist/field/features/lists/checklist/i18n.js.map +1 -0
  338. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  339. package/dist/field/features/lists/checklist/markdownTransformers.js +2 -3
  340. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  341. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  342. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  343. package/dist/field/features/lists/checklist/plugin/index.js +5 -5
  344. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  345. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  346. package/dist/field/features/lists/htmlConverter.js +13 -6
  347. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  348. package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +4 -1
  349. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -0
  350. package/dist/field/features/lists/orderedList/feature.client.js +97 -0
  351. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
  352. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -0
  353. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +12 -9
  354. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -0
  355. package/dist/field/features/lists/orderedList/i18n.d.ts +3 -0
  356. package/dist/field/features/lists/orderedList/i18n.d.ts.map +1 -0
  357. package/dist/field/features/lists/orderedList/i18n.js +100 -0
  358. package/dist/field/features/lists/orderedList/i18n.js.map +1 -0
  359. package/dist/field/features/lists/orderedList/markdownTransformer.d.ts.map +1 -0
  360. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +2 -3
  361. package/dist/field/features/lists/orderedList/markdownTransformer.js.map +1 -0
  362. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  363. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  364. package/dist/field/features/lists/plugin/index.js +5 -5
  365. package/dist/field/features/lists/plugin/index.js.map +1 -1
  366. package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
  367. package/dist/field/features/lists/{common → shared}/markdown.js +1 -2
  368. package/dist/field/features/lists/shared/markdown.js.map +1 -0
  369. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts +3 -0
  370. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts.map +1 -0
  371. package/dist/field/features/lists/shared/slashMenuListGroup.js +11 -0
  372. package/dist/field/features/lists/shared/slashMenuListGroup.js.map +1 -0
  373. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +4 -1
  374. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
  375. package/dist/field/features/lists/unorderedList/feature.client.js +97 -0
  376. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
  377. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -0
  378. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +11 -8
  379. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -0
  380. package/dist/field/features/lists/unorderedList/i18n.d.ts +3 -0
  381. package/dist/field/features/lists/unorderedList/i18n.d.ts.map +1 -0
  382. package/dist/field/features/lists/unorderedList/i18n.js +100 -0
  383. package/dist/field/features/lists/unorderedList/i18n.js.map +1 -0
  384. package/dist/field/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -0
  385. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +2 -3
  386. package/dist/field/features/lists/unorderedList/markdownTransformer.js.map +1 -0
  387. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  388. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  389. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  390. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts +4 -1
  391. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
  392. package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +1 -1
  393. package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.js +2 -1
  394. package/dist/field/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
  395. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -2
  396. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  397. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +3 -6
  398. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  399. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +4 -5
  400. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  401. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  402. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  403. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  404. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  405. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  406. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  407. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  408. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  409. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  410. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  411. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  412. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  413. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  414. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  415. package/dist/field/features/migrations/slateToLexical/feature.client.d.ts +4 -1
  416. package/dist/field/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
  417. package/dist/field/features/migrations/slateToLexical/feature.server.d.ts.map +1 -1
  418. package/dist/field/features/migrations/slateToLexical/feature.server.js +2 -1
  419. package/dist/field/features/migrations/slateToLexical/feature.server.js.map +1 -1
  420. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -2
  421. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  422. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +3 -6
  423. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  424. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +4 -5
  425. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  426. package/dist/field/features/paragraph/feature.client.d.ts +4 -1
  427. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  428. package/dist/field/features/paragraph/feature.client.js +54 -41
  429. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  430. package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
  431. package/dist/field/features/paragraph/feature.server.js +4 -1
  432. package/dist/field/features/paragraph/feature.server.js.map +1 -1
  433. package/dist/field/features/paragraph/i18n.d.ts +3 -0
  434. package/dist/field/features/paragraph/i18n.d.ts.map +1 -0
  435. package/dist/field/features/paragraph/i18n.js +132 -0
  436. package/dist/field/features/paragraph/i18n.js.map +1 -0
  437. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  438. package/dist/field/features/relationship/drawer/commands.js +1 -2
  439. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  440. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  441. package/dist/field/features/relationship/drawer/index.js +18 -16
  442. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  443. package/dist/field/features/relationship/feature.client.d.ts +17 -2
  444. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  445. package/dist/field/features/relationship/feature.client.js +51 -28
  446. package/dist/field/features/relationship/feature.client.js.map +1 -1
  447. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  448. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  449. package/dist/field/features/relationship/feature.server.js +43 -8
  450. package/dist/field/features/relationship/feature.server.js.map +1 -1
  451. package/dist/field/features/relationship/graphQLPopulationPromise.d.ts +5 -0
  452. package/dist/field/features/relationship/graphQLPopulationPromise.d.ts.map +1 -0
  453. package/dist/field/features/relationship/graphQLPopulationPromise.js +29 -0
  454. package/dist/field/features/relationship/graphQLPopulationPromise.js.map +1 -0
  455. package/dist/field/features/relationship/i18n.d.ts +3 -0
  456. package/dist/field/features/relationship/i18n.d.ts.map +1 -0
  457. package/dist/field/features/relationship/i18n.js +100 -0
  458. package/dist/field/features/relationship/i18n.js.map +1 -0
  459. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +4 -9
  460. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  461. package/dist/field/features/relationship/nodes/RelationshipNode.js +12 -11
  462. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  463. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  464. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +119 -56
  465. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  466. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  467. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  468. package/dist/field/features/relationship/plugins/index.js +16 -18
  469. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  470. package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.d.ts.map +1 -1
  471. package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js +1 -3
  472. package/dist/field/features/relationship/utils/EnabledRelationshipsCondition.js.map +1 -1
  473. package/dist/field/features/shared/slashMenu/basicGroup.d.ts +3 -0
  474. package/dist/field/features/shared/slashMenu/basicGroup.d.ts.map +1 -0
  475. package/dist/field/features/shared/slashMenu/basicGroup.js +11 -0
  476. package/dist/field/features/shared/slashMenu/basicGroup.js.map +1 -0
  477. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  478. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  479. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  480. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  481. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  482. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  483. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  484. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  485. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  486. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  487. package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
  488. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  489. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +5 -0
  490. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  491. package/dist/field/features/toolbars/fixed/Toolbar/index.js +207 -0
  492. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  493. package/dist/field/features/toolbars/fixed/feature.client.d.ts +7 -0
  494. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  495. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  496. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  497. package/dist/field/features/toolbars/fixed/feature.server.d.ts +19 -0
  498. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  499. package/dist/field/features/toolbars/fixed/feature.server.js +21 -0
  500. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  501. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  502. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  503. package/dist/field/features/toolbars/inline/Toolbar/index.js +319 -0
  504. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  505. package/dist/field/features/toolbars/inline/feature.client.d.ts +6 -0
  506. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  507. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  508. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  509. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  510. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  511. package/dist/field/features/toolbars/inline/feature.server.js +16 -0
  512. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  513. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  514. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  515. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +34 -23
  516. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  517. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +22 -0
  518. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  519. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +75 -102
  520. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  521. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  522. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  523. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +141 -0
  524. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  525. package/dist/field/features/toolbars/types.d.ts +48 -0
  526. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  527. package/dist/field/features/toolbars/types.js.map +1 -0
  528. package/dist/field/features/typeUtilities.d.ts +8 -0
  529. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  530. package/dist/field/features/typeUtilities.js +8 -0
  531. package/dist/field/features/typeUtilities.js.map +1 -0
  532. package/dist/field/features/types.d.ts +259 -69
  533. package/dist/field/features/types.d.ts.map +1 -1
  534. package/dist/field/features/types.js.map +1 -1
  535. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts +1 -1
  536. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  537. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +35 -37
  538. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  539. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  540. package/dist/field/features/upload/component/index.js +160 -85
  541. package/dist/field/features/upload/component/index.js.map +1 -1
  542. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  543. package/dist/field/features/upload/drawer/commands.js +1 -2
  544. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  545. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  546. package/dist/field/features/upload/drawer/index.js +17 -18
  547. package/dist/field/features/upload/drawer/index.js.map +1 -1
  548. package/dist/field/features/upload/feature.client.d.ts +4 -1
  549. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  550. package/dist/field/features/upload/feature.client.js +52 -26
  551. package/dist/field/features/upload/feature.client.js.map +1 -1
  552. package/dist/field/features/upload/feature.server.d.ts +10 -3
  553. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  554. package/dist/field/features/upload/feature.server.js +93 -15
  555. package/dist/field/features/upload/feature.server.js.map +1 -1
  556. package/dist/field/features/upload/{populationPromise.d.ts → graphQLPopulationPromise.d.ts} +1 -1
  557. package/dist/field/features/upload/graphQLPopulationPromise.d.ts.map +1 -0
  558. package/dist/field/features/upload/graphQLPopulationPromise.js +52 -0
  559. package/dist/field/features/upload/graphQLPopulationPromise.js.map +1 -0
  560. package/dist/field/features/upload/i18n.d.ts +3 -0
  561. package/dist/field/features/upload/i18n.d.ts.map +1 -0
  562. package/dist/field/features/upload/i18n.js +100 -0
  563. package/dist/field/features/upload/i18n.js.map +1 -0
  564. package/dist/field/features/upload/nodes/UploadNode.d.ts +7 -19
  565. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  566. package/dist/field/features/upload/nodes/UploadNode.js +45 -15
  567. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  568. package/dist/field/features/upload/plugin/index.d.ts +5 -4
  569. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  570. package/dist/field/features/upload/plugin/index.js +18 -20
  571. package/dist/field/features/upload/plugin/index.js.map +1 -1
  572. package/dist/field/features/upload/validate.d.ts +2 -1
  573. package/dist/field/features/upload/validate.d.ts.map +1 -1
  574. package/dist/field/features/upload/validate.js +37 -10
  575. package/dist/field/features/upload/validate.js.map +1 -1
  576. package/dist/field/index.d.ts +3 -1
  577. package/dist/field/index.d.ts.map +1 -1
  578. package/dist/field/index.js +35 -86
  579. package/dist/field/index.js.map +1 -1
  580. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  581. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  582. package/dist/field/lexical/EditorPlugin.js +8 -4
  583. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  584. package/dist/field/lexical/LexicalEditor.d.ts +3 -1
  585. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  586. package/dist/field/lexical/LexicalEditor.js +157 -77
  587. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  588. package/dist/field/lexical/LexicalProvider.d.ts +1 -2
  589. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  590. package/dist/field/lexical/LexicalProvider.js +52 -41
  591. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  592. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +15 -4
  593. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  594. package/dist/field/lexical/config/client/EditorConfigProvider.js +61 -11
  595. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  596. package/dist/field/lexical/config/client/default.d.ts +1 -1
  597. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  598. package/dist/field/lexical/config/client/default.js.map +1 -1
  599. package/dist/field/lexical/config/client/sanitize.d.ts +3 -2
  600. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  601. package/dist/field/lexical/config/client/sanitize.js +83 -33
  602. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  603. package/dist/field/lexical/config/server/default.d.ts +2 -3
  604. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  605. package/dist/field/lexical/config/server/default.js +12 -10
  606. package/dist/field/lexical/config/server/default.js.map +1 -1
  607. package/dist/field/lexical/config/server/loader.d.ts +5 -2
  608. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  609. package/dist/field/lexical/config/server/loader.js +4 -2
  610. package/dist/field/lexical/config/server/loader.js.map +1 -1
  611. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  612. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  613. package/dist/field/lexical/config/server/sanitize.js +39 -9
  614. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  615. package/dist/field/lexical/config/types.d.ts +3 -1
  616. package/dist/field/lexical/config/types.d.ts.map +1 -1
  617. package/dist/field/lexical/config/types.js.map +1 -1
  618. package/dist/field/lexical/nodes/index.d.ts +1 -2
  619. package/dist/field/lexical/nodes/index.d.ts.map +1 -1
  620. package/dist/field/lexical/nodes/index.js.map +1 -1
  621. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  622. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +3 -3
  623. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  624. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +10 -10
  625. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  626. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +74 -77
  627. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  628. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +5 -5
  629. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  630. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +8 -10
  631. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  632. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +19 -27
  633. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  634. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
  635. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  636. package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
  637. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  638. package/dist/field/lexical/plugins/SlashMenu/index.js +108 -93
  639. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  640. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  641. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  642. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +47 -126
  643. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  644. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  645. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  646. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  647. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  648. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  649. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +116 -67
  650. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  651. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  652. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  653. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +83 -16
  654. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  655. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  656. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  657. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  658. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  659. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
  660. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
  661. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
  662. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
  663. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +5 -1
  664. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  665. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +5 -18
  666. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  667. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  668. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  669. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  670. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
  671. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  672. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +19 -7
  673. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  674. package/dist/field/lexical/theme/EditorTheme.d.ts.map +1 -1
  675. package/dist/field/lexical/theme/EditorTheme.js +1 -1
  676. package/dist/field/lexical/theme/EditorTheme.js.map +1 -1
  677. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  678. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  679. package/dist/field/lexical/ui/ContentEditable.js +3 -4
  680. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  681. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  682. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  683. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  684. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  685. package/dist/field/lexical/ui/icons/Add/index.js +21 -0
  686. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  687. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  688. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  689. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  690. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  691. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  692. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  693. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  694. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  695. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  696. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  697. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  698. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  699. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  700. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  701. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  702. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  703. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  704. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  705. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  706. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  707. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  708. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  709. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  710. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  711. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  712. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  713. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  714. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  715. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  716. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  717. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  718. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  719. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  720. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  721. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
  722. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
  723. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +21 -0
  724. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
  725. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  726. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  727. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  728. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  729. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  730. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  731. package/dist/field/lexical/ui/icons/Link/index.d.ts.map +1 -1
  732. package/dist/field/lexical/ui/icons/Link/index.js +10 -18
  733. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  734. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  735. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  736. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  737. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  738. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  739. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  740. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  741. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  742. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  743. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  744. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  745. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  746. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  747. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  748. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  749. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  750. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  751. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  752. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  753. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  754. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  755. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -2
  756. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  757. package/dist/field/lexical/utils/nodeFormat.js +1 -1
  758. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  759. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  760. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  761. package/dist/field/lexical/utils/setFloatingElemPosition.js +16 -13
  762. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  763. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  764. package/dist/field/lexical/utils/url.js +13 -2
  765. package/dist/field/lexical/utils/url.js.map +1 -1
  766. package/dist/forEachNodeRecursively.d.ts +10 -0
  767. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  768. package/dist/forEachNodeRecursively.js +24 -0
  769. package/dist/forEachNodeRecursively.js.map +1 -0
  770. package/dist/generateComponentMap.d.ts +1 -1
  771. package/dist/generateComponentMap.d.ts.map +1 -1
  772. package/dist/generateComponentMap.js +21 -29
  773. package/dist/generateComponentMap.js.map +1 -1
  774. package/dist/generateSchemaMap.d.ts +1 -1
  775. package/dist/generateSchemaMap.d.ts.map +1 -1
  776. package/dist/generateSchemaMap.js +4 -12
  777. package/dist/generateSchemaMap.js.map +1 -1
  778. package/dist/i18n.d.ts +3 -0
  779. package/dist/i18n.d.ts.map +1 -0
  780. package/dist/i18n.js +164 -0
  781. package/dist/i18n.js.map +1 -0
  782. package/dist/index.d.ts +21 -36
  783. package/dist/index.d.ts.map +1 -1
  784. package/dist/index.js +592 -201
  785. package/dist/index.js.map +1 -1
  786. package/dist/{populate → populateGraphQL}/defaultValue.d.ts +0 -1
  787. package/dist/populateGraphQL/defaultValue.d.ts.map +1 -0
  788. package/dist/{populate → populateGraphQL}/defaultValue.js +1 -19
  789. package/dist/populateGraphQL/defaultValue.js.map +1 -0
  790. package/dist/populateGraphQL/populate.d.ts +17 -0
  791. package/dist/populateGraphQL/populate.d.ts.map +1 -0
  792. package/dist/populateGraphQL/populate.js +28 -0
  793. package/dist/populateGraphQL/populate.js.map +1 -0
  794. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +12 -0
  795. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -0
  796. package/dist/populateGraphQL/populateLexicalPopulationPromises.js +37 -0
  797. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -0
  798. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts +28 -0
  799. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -0
  800. package/dist/{populate/recurseNestedFields.js → populateGraphQL/recursivelyPopulateFieldsForGraphQL.js} +7 -5
  801. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -0
  802. package/dist/recurseNodeTree.d.ts +9 -0
  803. package/dist/recurseNodeTree.d.ts.map +1 -0
  804. package/dist/recurseNodeTree.js +27 -0
  805. package/dist/recurseNodeTree.js.map +1 -0
  806. package/dist/types.d.ts +45 -8
  807. package/dist/types.d.ts.map +1 -1
  808. package/dist/types.js.map +1 -1
  809. package/dist/useLexicalFeature.d.ts.map +1 -1
  810. package/dist/useLexicalFeature.js +6 -3
  811. package/dist/useLexicalFeature.js.map +1 -1
  812. package/dist/validate/index.d.ts +2 -2
  813. package/dist/validate/index.d.ts.map +1 -1
  814. package/dist/validate/index.js +3 -2
  815. package/dist/validate/index.js.map +1 -1
  816. package/dist/validate/validateNodes.d.ts +1 -1
  817. package/dist/validate/validateNodes.d.ts.map +1 -1
  818. package/dist/validate/validateNodes.js +1 -1
  819. package/dist/validate/validateNodes.js.map +1 -1
  820. package/package.json +71 -53
  821. package/components.d.ts +0 -6
  822. package/components.js +0 -7
  823. package/dist/exports/components.d.ts +0 -6
  824. package/dist/exports/components.d.ts.map +0 -1
  825. package/dist/exports/components.js +0 -7
  826. package/dist/exports/components.js.map +0 -1
  827. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
  828. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
  829. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +0 -12
  830. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
  831. package/dist/field/features/blocks/component/index.scss +0 -153
  832. package/dist/field/features/blocks/populationPromise.d.ts.map +0 -1
  833. package/dist/field/features/blocks/populationPromise.js +0 -46
  834. package/dist/field/features/blocks/populationPromise.js.map +0 -1
  835. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
  836. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
  837. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
  838. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
  839. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
  840. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
  841. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +0 -12
  842. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
  843. package/dist/field/features/debug/testrecorder/feature.client.d.ts.map +0 -1
  844. package/dist/field/features/debug/testrecorder/feature.server.d.ts.map +0 -1
  845. package/dist/field/features/debug/testrecorder/feature.server.js.map +0 -1
  846. package/dist/field/features/debug/testrecorder/plugin/index.d.ts +0 -5
  847. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +0 -1
  848. package/dist/field/features/debug/testrecorder/plugin/index.js.map +0 -1
  849. package/dist/field/features/debug/testrecorder/plugin/index.scss +0 -49
  850. package/dist/field/features/debug/treeview/feature.client.d.ts.map +0 -1
  851. package/dist/field/features/debug/treeview/feature.server.d.ts.map +0 -1
  852. package/dist/field/features/debug/treeview/feature.server.js.map +0 -1
  853. package/dist/field/features/debug/treeview/plugin/index.d.ts +0 -4
  854. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +0 -1
  855. package/dist/field/features/debug/treeview/plugin/index.js.map +0 -1
  856. package/dist/field/features/debug/treeview/plugin/index.scss +0 -78
  857. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
  858. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
  859. package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
  860. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
  861. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +0 -1
  862. package/dist/field/features/format/inlinecode/feature.client.js +0 -43
  863. package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
  864. package/dist/field/features/format/inlinecode/feature.server.d.ts.map +0 -1
  865. package/dist/field/features/format/inlinecode/feature.server.js.map +0 -1
  866. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
  867. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
  868. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
  869. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
  870. package/dist/field/features/indent/index.scss +0 -4
  871. package/dist/field/features/link/drawer/index.scss +0 -50
  872. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +0 -78
  873. package/dist/field/features/link/populationPromise.d.ts.map +0 -1
  874. package/dist/field/features/link/populationPromise.js +0 -46
  875. package/dist/field/features/link/populationPromise.js.map +0 -1
  876. package/dist/field/features/lists/common/markdown.js.map +0 -1
  877. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +0 -1
  878. package/dist/field/features/lists/orderedlist/feature.client.js +0 -72
  879. package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
  880. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +0 -1
  881. package/dist/field/features/lists/orderedlist/feature.server.js.map +0 -1
  882. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +0 -1
  883. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +0 -1
  884. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
  885. package/dist/field/features/lists/unorderedlist/feature.client.js +0 -72
  886. package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
  887. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +0 -1
  888. package/dist/field/features/lists/unorderedlist/feature.server.js.map +0 -1
  889. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +0 -1
  890. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +0 -1
  891. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.scss +0 -14
  892. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.scss +0 -14
  893. package/dist/field/features/relationship/nodes/components/index.scss +0 -97
  894. package/dist/field/features/relationship/populationPromise.d.ts +0 -4
  895. package/dist/field/features/relationship/populationPromise.d.ts.map +0 -1
  896. package/dist/field/features/relationship/populationPromise.js +0 -24
  897. package/dist/field/features/relationship/populationPromise.js.map +0 -1
  898. package/dist/field/features/upload/component/index.scss +0 -152
  899. package/dist/field/features/upload/populationPromise.d.ts.map +0 -1
  900. package/dist/field/features/upload/populationPromise.js +0 -46
  901. package/dist/field/features/upload/populationPromise.js.map +0 -1
  902. package/dist/field/index.scss +0 -46
  903. package/dist/field/lexical/LexicalEditor.scss +0 -56
  904. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
  905. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
  906. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
  907. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.scss +0 -37
  908. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +0 -17
  909. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
  910. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
  911. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +0 -18
  912. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
  913. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
  914. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
  915. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.scss +0 -100
  916. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +0 -6
  917. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
  918. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +0 -270
  919. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
  920. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.scss +0 -57
  921. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +0 -40
  922. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
  923. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
  924. package/dist/field/lexical/plugins/SlashMenu/index.scss +0 -61
  925. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +0 -31
  926. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  927. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
  928. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +0 -55
  929. package/dist/field/lexical/theme/EditorTheme.scss +0 -505
  930. package/dist/field/lexical/ui/ContentEditable.scss +0 -25
  931. package/dist/populate/defaultValue.d.ts.map +0 -1
  932. package/dist/populate/defaultValue.js.map +0 -1
  933. package/dist/populate/populate.d.ts +0 -21
  934. package/dist/populate/populate.d.ts.map +0 -1
  935. package/dist/populate/populate.js +0 -21
  936. package/dist/populate/populate.js.map +0 -1
  937. package/dist/populate/recurseNestedFields.d.ts +0 -25
  938. package/dist/populate/recurseNestedFields.d.ts.map +0 -1
  939. package/dist/populate/recurseNestedFields.js.map +0 -1
  940. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  941. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  942. package/dist/populate/richTextRelationshipPromise.js +0 -68
  943. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  944. package/dist/scss/app.scss +0 -209
  945. package/dist/scss/colors.scss +0 -269
  946. package/dist/scss/fonts.scss +0 -75
  947. package/dist/scss/queries.scss +0 -27
  948. package/dist/scss/resets.scss +0 -17
  949. package/dist/scss/styles.scss +0 -11
  950. package/dist/scss/svg.scss +0 -10
  951. package/dist/scss/toastify.scss +0 -58
  952. package/dist/scss/type.scss +0 -117
  953. package/dist/scss/vars.scss +0 -220
  954. package/dist/scss/z-index.scss +0 -9
  955. package/src/index.ts +0 -423
  956. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
  957. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
  958. /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
  959. /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
  960. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
  961. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
  962. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
  963. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
  964. /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
  965. /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
  966. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
  967. /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
  968. /package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars}/types.js +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/field/features/horizontalRule/component/index.tsx"],
4
+ "sourcesContent": ["'use client'\n\nimport type { NodeKey } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { addClassNamesToElement, mergeRegister, removeClassNamesFromElement } from '@lexical/utils'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect } from 'react'\n\nimport { $isHorizontalRuleNode } from '../nodes/HorizontalRuleNode.js'\n\nconst isSelectedClassName = 'selected'\n\n/**\n * React component rendered in the lexical editor, WITHIN the hr element created by createDOM of the HorizontalRuleNode.\n *\n * @param nodeKey every node has a unique key (this key is not saved to the database and thus may differ between sessions). It's useful for working with the CURRENT lexical editor state\n */\nexport function HorizontalRuleComponent({ nodeKey }: { nodeKey: NodeKey }) {\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isHorizontalRuleNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n const hrElem = editor.getElementByKey(nodeKey)\n\n if (event.target === hrElem) {\n if (!event.shiftKey) {\n clearSelection()\n }\n setSelected(!isSelected)\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected])\n\n useEffect(() => {\n const hrElem = editor.getElementByKey(nodeKey)\n if (hrElem !== null) {\n if (isSelected) {\n addClassNamesToElement(hrElem, isSelectedClassName)\n } else {\n removeClassNamesFromElement(hrElem, isSelectedClassName)\n }\n }\n }, [editor, isSelected, nodeKey])\n\n return null\n}\n"],
5
+ "mappings": "qDAIA,OAAS,6BAAAA,MAAiC,2CAC1C,OAAS,2BAAAC,MAA+B,4CACxC,OAAS,0BAAAC,EAAwB,iBAAAC,EAAe,+BAAAC,MAAmC,iBACnF,OACE,iBAAAC,EACA,iBAAAC,EACA,oBAAAC,EACA,iBAAAC,EACA,wBAAAC,EACA,yBAAAC,EACA,sBAAAC,MACK,UACP,OAAS,eAAAC,EAAa,aAAAC,MAAiB,QAIvC,IAAMC,EAAsB,WAOrB,SAASC,EAAwB,CAAE,QAAAC,CAAQ,EAAyB,CACzE,GAAM,CAACC,CAAM,EAAIC,EAA0B,EACrC,CAACC,EAAYC,EAAaC,CAAc,EAAIC,EAAwBN,CAAO,EAE3EO,EAAYC,EACfC,GAAyB,CACxB,GAAIN,GAAcO,EAAiBC,EAAc,CAAC,EAAG,CACnDF,EAAM,eAAe,EACrB,IAAMG,EAAOC,EAAcb,CAAO,EAClC,GAAIc,EAAsBF,CAAI,EAC5B,OAAAA,EAAK,OAAO,EACL,EAEX,CACA,MAAO,EACT,EACA,CAACT,EAAYH,CAAO,CACtB,EAEA,OAAAe,EAAU,IACDC,EACLf,EAAO,gBACLgB,EACCR,GAAsB,CACrB,IAAMS,EAASjB,EAAO,gBAAgBD,CAAO,EAE7C,OAAIS,EAAM,SAAWS,GACdT,EAAM,UACTJ,EAAe,EAEjBD,EAAY,CAACD,CAAU,EAChB,IAGF,EACT,EACAgB,CACF,EACAlB,EAAO,gBAAgBmB,EAAoBb,EAAWY,CAAoB,EAC1ElB,EAAO,gBAAgBoB,EAAuBd,EAAWY,CAAoB,CAC/E,EACC,CAACd,EAAgBJ,EAAQE,EAAYH,EAASO,EAAWH,CAAW,CAAC,EAExEW,EAAU,IAAM,CACd,IAAMG,EAASjB,EAAO,gBAAgBD,CAAO,EACzCkB,IAAW,OACTf,EACFmB,EAAuBJ,EAAQpB,CAAmB,EAElDyB,EAA4BL,EAAQpB,CAAmB,EAG7D,EAAG,CAACG,EAAQE,EAAYH,CAAO,CAAC,EAEzB,IACT",
6
+ "names": ["useLexicalComposerContext", "useLexicalNodeSelection", "addClassNamesToElement", "mergeRegister", "removeClassNamesFromElement", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "useCallback", "useEffect", "isSelectedClassName", "HorizontalRuleComponent", "nodeKey", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "$onDelete", "useCallback", "event", "$isNodeSelection", "$getSelection", "node", "$getNodeByKey", "$isHorizontalRuleNode", "useEffect", "mergeRegister", "CLICK_COMMAND", "hrElem", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "addClassNamesToElement", "removeClassNamesFromElement"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use client";import{b as D}from"./chunk-Y5455JF3.js";import{Collapsible as oe,Form as te,Pill as ae,SectionTitle as re,ShimmerEffect as le,useConfig as se,useDocumentInfo as ie,useFieldProps as ne,useFormSubmitted as ce,useTranslation as de}from"@payloadcms/ui/client";import{useCallback as me,useEffect as pe,useMemo as fe,useState as ue}from"react";import{getTranslation as ye}from"@payloadcms/translations";import{getFormState as V}from"@payloadcms/ui/shared";import{v4 as he}from"uuid";import{useLexicalComposerContext as j}from"@lexical/react/LexicalComposerContext.js";import{getTranslation as W}from"@payloadcms/translations";import{Button as z,Collapsible as H,ErrorPill as J,Pill as q,RenderFields as G,SectionTitle as Q,useDocumentInfo as X,useFormSubmitted as Y,useTranslation as Z}from"@payloadcms/ui/client";import ee from"deep-equal";import{$getNodeByKey as M}from"lexical";import w,{useCallback as x}from"react";import{useAllFormFields as U}from"@payloadcms/ui/client";import{reduceFieldsToValues as I}from"@payloadcms/ui/shared";import{useEffect as K}from"react";function E({fields:i}){for(let e in i){let a=i[e];Array.isArray(a.rows)&&"value"in a&&(a.disableFormData=!0)}return i}var O=i=>{let{onChange:e}=i,[a]=U(),o=E({fields:a}),m=I(o,!0);return K(()=>{e&&e({fullFieldsWithValues:o,newFormData:m})},[m,e,o]),null};import{jsx as F,jsxs as A}from"react/jsx-runtime";var L=i=>{let{baseClass:e,field:a,formData:o,formSchema:m,nodeKey:n,reducedBlock:{labels:g},schemaPath:_}=i,{i18n:S}=Z(),[c]=j(),{getDocPreferences:y,setDocFieldPreferences:P}=X(),[T,B]=w.useState(()=>{let r=!1;return y().then(d=>{let t=d?.fields[a.name]?.collapsed;t&&t.includes(o.id)&&(r=!0,B(!0))}),r}),s=Y(),[p,k]=w.useState(0),h=s&&p>0,R=[`${e}__row`,h?`${e}__row--has-errors`:`${e}__row--no-errors`].filter(Boolean).join(" "),N=x(({fullFieldsWithValues:r,newFormData:d})=>{d={...d,id:o.id,blockType:o.blockType};function v(t){for(let l in t){let b=t[l];Array.isArray(b)&&!b?.length?delete t[l]:b&&typeof b=="object"?v(b):b==null&&delete t[l]}}if(v(d),v(o),ee(o,d)||setTimeout(()=>{c.update(()=>{let t=M(n);t&&t.setFields(d)})},0),s){let t=0;for(let l of Object.values(r))l?.valid===!1&&t++;k(t)}},[c,n,s,o]),$=x(r=>{y().then(d=>{let t=d?.fields[a.name]?.collapsed,l=t&&t?.length?t:[];r?l.includes(o.id)||l.push(o.id):l.includes(o.id)&&l.splice(l.indexOf(o.id),1),P(a.name,{collapsed:l,hello:"hi"})})},[y,a.name,P,o.id]),C=x(()=>{c.update(()=>{M(n).remove()})},[c,n]);return A(w.Fragment,{children:[F(H,{className:R,collapsibleStyle:h?"error":"default",header:A("div",{className:`${e}__block-header`,children:[A("div",{children:[F(q,{className:`${e}__block-pill ${e}__block-pill-${o?.blockType}`,pillStyle:"white",children:typeof g.singular=="string"?W(g.singular,S):"[Singular Label]"}),F(Q,{path:"blockName",readOnly:a?.readOnly}),h&&F(J,{count:p,i18n:S,withMessage:!0})]}),c.isEditable()&&F(z,{buttonStyle:"icon-label",className:`${e}__removeButton`,disabled:a?.readOnly,icon:"x",onClick:r=>{r.preventDefault(),C()},round:!0,tooltip:"Remove Block"})]}),isCollapsed:T,onToggle:r=>{$(r),B(r)},children:F(G,{className:`${e}__fields`,fieldMap:Array.isArray(m)?m:[],forceRender:!0,margins:"small",path:"",readOnly:!1,schemaPath:_})},0),F(O,{onChange:N})]})};import{jsx as u,jsxs as be}from"react/jsx-runtime";var f="lexical-block",Ie=i=>{let{formData:e,nodeKey:a}=i,o=se(),m=ce(),{id:n}=ie(),{path:g,schemaPath:_}=ne(),{editorConfig:S,field:c}=D(),[y,P]=ue(!1),{field:{richTextComponentMap:T}}=D(),B=`feature.blocks.fields.${e?.blockType}`,s=`${_}.feature.blocks.${e?.blockType}`,p=S?.resolvedFeatureMap?.get("blocks")?.clientFeatureProps?.reducedBlocks?.find(C=>C.slug===e?.blockType),k=T.get(B);pe(()=>{e&&(async()=>{let r=await V({apiRoute:o.routes.api,body:{id:n,data:JSON.parse(JSON.stringify(e)),operation:"update",schemaPath:s},serverURL:o.serverURL});r&&P({...r,blockName:{initialValue:"",passesCondition:!0,valid:!0,value:e.blockName}})})()},[o.routes.api,o.serverURL,s,n]);let h=me(async({formState:C})=>({...await V({apiRoute:o.routes.api,body:{id:n,formState:C,operation:"update",schemaPath:s},serverURL:o.serverURL}),blockName:{initialValue:"",passesCondition:!0,valid:!0,value:e.blockName}}),[o.routes.api,o.serverURL,s,n,e.blockName]),{i18n:R}=de(),N=[`${f}__row`,`${f}__row--no-errors`].filter(Boolean).join(" "),$=fe(()=>p&&y!==!1?u(te,{beforeSubmit:[h],fields:k,initialState:y,onChange:[h],submitted:m,uuid:he(),children:u(L,{baseClass:f,field:c,formData:e,formSchema:Array.isArray(k)?k:[],nodeKey:a,path:`${g}.feature.blocks.${e.blockType}`,reducedBlock:p,schemaPath:s})}):u(oe,{className:N,collapsibleStyle:"default",header:u("div",{className:`${f}__block-header`,children:be("div",{children:[u(ae,{className:`${f}__block-pill ${f}__block-pill-${e?.blockType}`,pillStyle:"white",children:typeof p.labels.singular=="string"?ye(p.labels.singular,R):"[Singular Label]"}),u(re,{path:"blockName",readOnly:c?.readOnly})]})}),children:u(le,{height:"35vh"})},0),[N,k,c,a,R,m,y,p,h,s,g]);return u("div",{className:f+" "+f+"-"+e.blockType,children:$})};export{Ie as BlockComponent};
2
+ //# sourceMappingURL=component-RAVN56DE.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/field/features/blocks/component/index.tsx", "../../../src/field/features/blocks/component/BlockContent.tsx", "../../../src/field/features/blocks/component/FormSavePlugin.tsx", "../../../src/field/features/blocks/component/removeEmptyArrayValues.ts"],
4
+ "sourcesContent": ["'use client'\n\nimport type { FormProps } from '@payloadcms/ui/forms/Form'\n\nimport {\n Collapsible,\n Form,\n Pill,\n SectionTitle,\n ShimmerEffect,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui/client'\nimport React, { useCallback, useEffect, useMemo, useState } from 'react'\n\nimport { type BlockFields } from '../nodes/BlocksNode.js'\nconst baseClass = 'lexical-block'\nimport type { ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'\nimport type { FormState } from 'payload'\n\nimport { getTranslation } from '@payloadcms/translations'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport { v4 as uuid } from 'uuid'\n\nimport type { ClientComponentProps } from '../../types.js'\nimport type { BlocksFeatureClientProps } from '../feature.client.js'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport { BlockContent } from './BlockContent.js'\ntype Props = {\n children?: React.ReactNode\n\n formData: BlockFields\n nodeKey?: string\n /**\n * This transformedFormData already comes wrapped in blockFieldWrapperName\n */\n transformedFormData: BlockFields\n}\n\nexport const BlockComponent: React.FC<Props> = (props) => {\n const { formData, nodeKey } = props\n const config = useConfig()\n const submitted = useFormSubmitted()\n const { id } = useDocumentInfo()\n const { path, schemaPath } = useFieldProps()\n const { editorConfig, field: parentLexicalRichTextField } = useEditorConfigContext()\n\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.blocks.fields.${formData?.blockType}`\n const schemaFieldsPath = `${schemaPath}.feature.blocks.${formData?.blockType}`\n\n const reducedBlock: ReducedBlock = (\n editorConfig?.resolvedFeatureMap?.get('blocks')\n ?.clientFeatureProps as ClientComponentProps<BlocksFeatureClientProps>\n )?.reducedBlocks?.find((block) => block.slug === formData?.blockType)\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath)\n // Field Schema\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: JSON.parse(JSON.stringify(formData)),\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n if (state) {\n setInitialState({\n ...state,\n blockName: {\n initialValue: '',\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n },\n })\n }\n }\n\n if (formData) {\n void awaitInitialState()\n }\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n const formState = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n\n return {\n ...formState,\n blockName: {\n initialValue: '',\n passesCondition: true,\n valid: true,\n value: formData.blockName,\n },\n }\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id, formData.blockName],\n )\n const { i18n } = useTranslation()\n\n const classNames = [`${baseClass}__row`, `${baseClass}__row--no-errors`].filter(Boolean).join(' ')\n\n // Memoized Form JSX\n const formContent = useMemo(() => {\n return reducedBlock && initialState !== false ? (\n <Form\n beforeSubmit={[onChange]}\n // @ts-expect-error TODO: Fix this\n fields={fieldMap}\n initialState={initialState}\n onChange={[onChange]}\n submitted={submitted}\n uuid={uuid()}\n >\n <BlockContent\n baseClass={baseClass}\n field={parentLexicalRichTextField}\n formData={formData}\n formSchema={Array.isArray(fieldMap) ? fieldMap : []}\n nodeKey={nodeKey}\n path={`${path}.feature.blocks.${formData.blockType}`}\n reducedBlock={reducedBlock}\n schemaPath={schemaFieldsPath}\n />\n </Form>\n ) : (\n <Collapsible\n className={classNames}\n collapsibleStyle=\"default\"\n header={\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {typeof reducedBlock.labels.singular === 'string'\n ? getTranslation(reducedBlock.labels.singular, i18n)\n : '[Singular Label]'}\n </Pill>\n <SectionTitle path=\"blockName\" readOnly={parentLexicalRichTextField?.readOnly} />\n </div>\n </div>\n }\n key={0}\n >\n <ShimmerEffect height=\"35vh\" />\n </Collapsible>\n )\n }, [\n classNames,\n fieldMap,\n parentLexicalRichTextField,\n nodeKey,\n i18n,\n submitted,\n initialState,\n reducedBlock,\n onChange,\n schemaFieldsPath,\n path,\n ]) // Adding formData to the dependencies here might break it\n return <div className={baseClass + ' ' + baseClass + '-' + formData.blockType}>{formContent}</div>\n}\n", "import type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { FieldMap, ReducedBlock } from '@payloadcms/ui/utilities/buildComponentMap'\nimport type { CollapsedPreferences, Data, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n Collapsible,\n ErrorPill,\n Pill,\n RenderFields,\n SectionTitle,\n useDocumentInfo,\n useFormSubmitted,\n useTranslation,\n} from '@payloadcms/ui/client'\nimport isDeepEqual from 'deep-equal'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback } from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../../../lexical/config/types.js'\nimport type { BlockFields, BlockNode } from '../nodes/BlocksNode.js'\n\nimport { FormSavePlugin } from './FormSavePlugin.js'\n\ntype Props = {\n baseClass: string\n field: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n formData: BlockFields\n formSchema: FieldMap\n nodeKey: string\n path: string\n reducedBlock: ReducedBlock\n schemaPath: string\n}\n\n/**\n * The actual content of the Block. This should be INSIDE a Form component,\n * scoped to the block. All format operations in here are thus scoped to the block's form, and\n * not the whole document.\n */\nexport const BlockContent: React.FC<Props> = (props) => {\n const {\n baseClass,\n field,\n formData,\n formSchema,\n nodeKey,\n reducedBlock: { labels },\n schemaPath,\n } = props\n\n const { i18n } = useTranslation()\n const [editor] = useLexicalComposerContext()\n // Used for saving collapsed to preferences (and gettin' it from there again)\n // Remember, these preferences are scoped to the whole document, not just this form. This\n // is important to consider for the data path used in setDocFieldPreferences\n const { getDocPreferences, setDocFieldPreferences } = useDocumentInfo()\n\n const [isCollapsed, setIsCollapsed] = React.useState<boolean>(() => {\n let initialState = false\n\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n if (collapsedArray && collapsedArray.includes(formData.id)) {\n initialState = true\n setIsCollapsed(true)\n }\n })\n return initialState\n })\n\n const hasSubmitted = useFormSubmitted()\n\n const [errorCount, setErrorCount] = React.useState(0)\n\n const fieldHasErrors = hasSubmitted && errorCount > 0\n\n const classNames = [\n `${baseClass}__row`,\n fieldHasErrors ? `${baseClass}__row--has-errors` : `${baseClass}__row--no-errors`,\n ]\n .filter(Boolean)\n .join(' ')\n\n const onFormChange = useCallback(\n ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: Data\n }) => {\n newFormData = {\n ...newFormData,\n id: formData.id,\n blockType: formData.blockType,\n }\n\n // Recursively remove all undefined values from even being present in formData, as they will\n // cause isDeepEqual to return false if, for example, formData has a key that fields.data\n // does not have, even if it's undefined.\n // Currently, this happens if a block has another sub-blocks field. Inside formData, that sub-blocks field has an undefined blockName property.\n // Inside of fields.data however, that sub-blocks blockName property does not exist at all.\n function removeUndefinedAndNullAndEmptyArraysRecursively(obj: object) {\n for (const key in obj) {\n const value = obj[key]\n if (Array.isArray(value) && !value?.length) {\n delete obj[key]\n } else if (value && typeof value === 'object') {\n removeUndefinedAndNullAndEmptyArraysRecursively(value)\n } else if (value === undefined || value === null) {\n delete obj[key]\n }\n }\n }\n removeUndefinedAndNullAndEmptyArraysRecursively(newFormData)\n\n removeUndefinedAndNullAndEmptyArraysRecursively(formData)\n\n // Only update if the data has actually changed. Otherwise, we may be triggering an unnecessary value change,\n // which would trigger the \"Leave without saving\" dialog unnecessarily\n if (!isDeepEqual(formData, newFormData)) {\n // Running this in the next tick in the meantime fixes this issue: https://github.com/payloadcms/payload/issues/4108\n // I don't know why. When this is called immediately, it might focus out of a nested lexical editor field if an update is made there.\n // My hypothesis is that the nested editor might not have fully finished its update cycle yet. By updating in the next tick, we\n // ensure that the nested editor has finished its update cycle before we update the block node.\n setTimeout(() => {\n editor.update(() => {\n const node: BlockNode = $getNodeByKey(nodeKey)\n if (node) {\n node.setFields(newFormData as BlockFields)\n }\n })\n }, 0)\n }\n\n // update error count\n if (hasSubmitted) {\n let rowErrorCount = 0\n for (const formField of Object.values(fullFieldsWithValues)) {\n if (formField?.valid === false) {\n rowErrorCount++\n }\n }\n setErrorCount(rowErrorCount)\n }\n },\n [editor, nodeKey, hasSubmitted, formData],\n )\n\n const onCollapsedChange = useCallback(\n (changedCollapsed: boolean) => {\n void getDocPreferences().then((currentDocPreferences) => {\n const currentFieldPreferences = currentDocPreferences?.fields[field.name]\n\n const collapsedArray = currentFieldPreferences?.collapsed\n\n const newCollapsed: CollapsedPreferences =\n collapsedArray && collapsedArray?.length ? collapsedArray : []\n\n if (changedCollapsed) {\n if (!newCollapsed.includes(formData.id)) {\n newCollapsed.push(formData.id)\n }\n } else {\n if (newCollapsed.includes(formData.id)) {\n newCollapsed.splice(newCollapsed.indexOf(formData.id), 1)\n }\n }\n\n setDocFieldPreferences(field.name, {\n collapsed: newCollapsed,\n hello: 'hi',\n })\n })\n },\n [getDocPreferences, field.name, setDocFieldPreferences, formData.id],\n )\n\n const removeBlock = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n return (\n <React.Fragment>\n <Collapsible\n className={classNames}\n collapsibleStyle={fieldHasErrors ? 'error' : 'default'}\n header={\n <div className={`${baseClass}__block-header`}>\n <div>\n <Pill\n className={`${baseClass}__block-pill ${baseClass}__block-pill-${formData?.blockType}`}\n pillStyle=\"white\"\n >\n {typeof labels.singular === 'string'\n ? getTranslation(labels.singular, i18n)\n : '[Singular Label]'}\n </Pill>\n <SectionTitle path=\"blockName\" readOnly={field?.readOnly} />\n {fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}\n </div>\n {editor.isEditable() && (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeBlock()\n }}\n round\n tooltip=\"Remove Block\"\n />\n )}\n </div>\n }\n isCollapsed={isCollapsed}\n key={0}\n onToggle={(incomingCollapsedState) => {\n onCollapsedChange(incomingCollapsedState)\n setIsCollapsed(incomingCollapsedState)\n }}\n >\n <RenderFields\n className={`${baseClass}__fields`}\n fieldMap={Array.isArray(formSchema) ? formSchema : []}\n forceRender\n margins=\"small\"\n path=\"\" // Leaving path empty makes it so field values are not prefixed / scoped by the entire schemaPath. e.g. we can access \"myField\" instead of \"someLexicalField.feature.blocks.someArrayB\" // TODO: Could there be any implications leaving path different than schemaPath?\n readOnly={false}\n schemaPath={schemaPath} // Having the correct schemaPath here allows sub-fields (like array > addRow) to run correct form-state calls and retrieve their needed form state from the server\n />\n </Collapsible>\n\n <FormSavePlugin onChange={onFormChange} />\n </React.Fragment>\n )\n}\n", "import type { Data, FormState } from 'payload'\nimport type React from 'react'\n\nimport { useAllFormFields } from '@payloadcms/ui/client'\nimport { reduceFieldsToValues } from '@payloadcms/ui/shared'\nimport { useEffect } from 'react'\n\nimport { removeEmptyArrayValues } from './removeEmptyArrayValues.js'\n\ntype Props = {\n onChange?: ({\n fullFieldsWithValues,\n newFormData,\n }: {\n fullFieldsWithValues: FormState\n newFormData: Data\n }) => void\n}\n\nexport const FormSavePlugin: React.FC<Props> = (props) => {\n const { onChange } = props\n\n const [_fields] = useAllFormFields()\n\n const fields = removeEmptyArrayValues({ fields: _fields })\n\n // Pass in fields, and indicate if you'd like to \"unflatten\" field data.\n // The result below will reflect the data stored in the form at the given time\n const newFormData = reduceFieldsToValues(fields, true)\n\n useEffect(() => {\n if (onChange) {\n onChange({ fullFieldsWithValues: fields, newFormData })\n }\n }, [newFormData, onChange, fields])\n\n return null\n}\n", "import type { FormState } from 'payload'\n\n/**\n * By default, if an array field is empty, it will be included in the form state with a value of 0.\n * We do not need this behavior here, By setting `disableFormData` to true, we can prevent the field from being included in the form state\n * like that.\n * @param fields form state\n */\nexport function removeEmptyArrayValues({ fields }: { fields: FormState }): FormState {\n for (const key in fields) {\n const field = fields[key]\n if (Array.isArray(field.rows) && 'value' in field) {\n field.disableFormData = true\n }\n }\n return fields\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["Collapsible", "Form", "Pill", "SectionTitle", "ShimmerEffect", "useConfig", "useDocumentInfo", "useFieldProps", "useFormSubmitted", "useTranslation", "useCallback", "useEffect", "useMemo", "useState", "getTranslation", "getFormState", "uuid", "useLexicalComposerContext", "getTranslation", "Button", "Collapsible", "ErrorPill", "Pill", "RenderFields", "SectionTitle", "useDocumentInfo", "useFormSubmitted", "useTranslation", "isDeepEqual", "$getNodeByKey", "React", "useCallback", "useAllFormFields", "reduceFieldsToValues", "useEffect", "removeEmptyArrayValues", "fields", "key", "field", "FormSavePlugin", "props", "onChange", "_fields", "useAllFormFields", "fields", "removeEmptyArrayValues", "newFormData", "reduceFieldsToValues", "useEffect", "jsx", "jsxs", "BlockContent", "props", "baseClass", "field", "formData", "formSchema", "nodeKey", "labels", "schemaPath", "i18n", "useTranslation", "editor", "useLexicalComposerContext", "getDocPreferences", "setDocFieldPreferences", "useDocumentInfo", "isCollapsed", "setIsCollapsed", "React", "initialState", "currentDocPreferences", "collapsedArray", "hasSubmitted", "useFormSubmitted", "errorCount", "setErrorCount", "fieldHasErrors", "classNames", "onFormChange", "useCallback", "fullFieldsWithValues", "newFormData", "removeUndefinedAndNullAndEmptyArraysRecursively", "obj", "key", "value", "isDeepEqual", "node", "$getNodeByKey", "rowErrorCount", "formField", "onCollapsedChange", "changedCollapsed", "newCollapsed", "removeBlock", "Collapsible", "Pill", "getTranslation", "SectionTitle", "ErrorPill", "Button", "e", "incomingCollapsedState", "RenderFields", "FormSavePlugin", "jsx", "jsxs", "baseClass", "BlockComponent", "props", "formData", "nodeKey", "config", "useConfig", "submitted", "useFormSubmitted", "id", "useDocumentInfo", "path", "schemaPath", "useFieldProps", "editorConfig", "parentLexicalRichTextField", "useEditorConfigContext", "initialState", "setInitialState", "useState", "richTextComponentMap", "componentMapRenderedFieldsPath", "schemaFieldsPath", "reducedBlock", "block", "fieldMap", "useEffect", "state", "getFormState", "onChange", "useCallback", "prevFormState", "i18n", "useTranslation", "classNames", "formContent", "useMemo", "Form", "uuid", "BlockContent", "Collapsible", "Pill", "getTranslation", "SectionTitle", "ShimmerEffect"]
7
+ }
@@ -0,0 +1,2 @@
1
+ "use client";import{a as j,b as W,e as Y}from"./chunk-M6MN4CA5.js";import{b as N}from"./chunk-Y5455JF3.js";import{useLexicalComposerContext as Ce}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as ge}from"@lexical/react/useLexicalNodeSelection.js";import{mergeRegister as ve}from"@lexical/utils";import{getTranslation as ye}from"@payloadcms/translations";import{Button as T,DrawerToggler as De,File as be,useConfig as he,useDocumentDrawer as Re,useDrawerSlug as Se,usePayloadAPI as _e,useTranslation as Ee}from"@payloadcms/ui/client";import{$getNodeByKey as z,$getSelection as we,$isNodeSelection as Ne,CLICK_COMMAND as Ue,COMMAND_PRIORITY_LOW as O,KEY_BACKSPACE_COMMAND as Pe,KEY_DELETE_COMMAND as Fe}from"lexical";import{useCallback as U,useEffect as $e,useReducer as xe,useRef as Me,useState as Le}from"react";import{useLexicalComposerContext as X}from"@lexical/react/LexicalComposerContext.js";import{getTranslation as Z}from"@payloadcms/translations";import{Drawer as ee,Form as te,FormSubmit as oe,RenderFields as ae,useConfig as re,useDocumentInfo as le,useFieldProps as ie,useModal as ne,useTranslation as se}from"@payloadcms/ui/client";import{getFormState as H}from"@payloadcms/ui/shared";import{$getNodeByKey as de}from"lexical";import{deepCopyObject as ce}from"payload/shared";import{useCallback as V,useEffect as me,useState as pe}from"react";import{v4 as ue}from"uuid";import{jsx as L,jsxs as fe}from"react/jsx-runtime";var q=d=>{let{data:{fields:P,relationTo:F,value:C},drawerSlug:a,nodeKey:R,relatedCollection:g}=d,[S]=X(),{closeModal:m}=ne(),{i18n:r,t:l}=se(),{id:n}=le(),{schemaPath:v}=ie(),i=re(),[p,$]=pe(!1),{field:{richTextComponentMap:y}}=N(),_=`feature.upload.fields.${g.slug}`,c=`${v}.feature.upload.${g.slug}`,s=y.get(_);me(()=>{(async()=>{let b=await H({apiRoute:i.routes.api,body:{id:n,data:ce(P||{}),operation:"update",schemaPath:c},serverURL:i.serverURL});$(b)})()},[i.routes.api,i.serverURL,c,n,P]);let x=V(async({formState:D})=>await H({apiRoute:i.routes.api,body:{id:n,formState:D,operation:"update",schemaPath:c},serverURL:i.serverURL}),[i.routes.api,i.serverURL,c,n]),E=V((D,b)=>{S.update(()=>{let u=de(R);if(u){let f={...u.getData(),fields:b};u.setData(f)}}),m(a)},[m,S,a,R]);return L(ee,{slug:a,title:l("general:editLabel",{label:Z(g.labels.singular,r)}),children:p!==!1&&fe(te,{beforeSubmit:[x],disableValidationOnSubmit:!0,fields:s,initialState:p,onChange:[x],onSubmit:E,uuid:ue(),children:[L(ae,{fieldMap:Array.isArray(s)?s:[],forceRender:!0,path:"",readOnly:!1,schemaPath:c}),L(oe,{children:l("fields:saveChanges")})]})})};import{jsx as e,jsxs as h}from"react/jsx-runtime";var o="lexical-upload",G={depth:0},Te=d=>{let{data:{fields:P,relationTo:F,value:C},nodeKey:a}=d,{collections:R,routes:{api:g},serverURL:S}=he(),m=Me(null),[r]=Ce(),[l,n,v]=ge(a),{editorConfig:i,field:p}=N(),{i18n:$,t:y}=Ee(),[_,c]=xe(t=>t+1,0),[s,x]=Le(()=>R.find(t=>t.slug===F)),E=Se("upload-drawer"),[D,b,{closeDrawer:u}]=Re({id:C,collectionSlug:s.slug}),[{data:f},{setParams:A}]=_e(`${S}${g}/${s.slug}/${C}`,{initialParams:G}),K=f?.thumbnailURL||f?.url,J=U(()=>{r.update(()=>{z(a).remove()})},[r,a]),Q=U(t=>{A({...G,cacheBust:_}),c(),u()},[A,_,u]),M=U(t=>{if(l&&Ne(we())){t.preventDefault();let k=z(a);if(Y(k))return k.remove(),!0}return!1},[l,a]),I=U(t=>{let w=t;return w.target===m.current||m.current?.contains(w.target)?(w.shiftKey?n(!l):l||(v(),n(!0)),!0):!1},[l,n,v]);$e(()=>ve(r.registerCommand(Ue,I,O),r.registerCommand(Fe,M,O),r.registerCommand(Pe,M,O)),[v,r,l,a,M,n,I]);let B=(i?.resolvedFeatureMap?.get("upload")?.clientFeatureProps).collections?.[s.slug]?.hasExtraFields;return h("div",{className:[o,l&&`${o}--selected`].filter(Boolean).join(" "),contentEditable:!1,ref:m,children:[h("div",{className:`${o}__card`,children:[h("div",{className:`${o}__topRow`,children:[e("div",{className:`${o}__thumbnail`,children:K?e("img",{alt:f?.filename,"data-lexical-upload-id":C,"data-lexical-upload-relation-to":F,src:K}):e(be,{})}),h("div",{className:`${o}__topRowRightPanel`,children:[e("div",{className:`${o}__collectionLabel`,children:ye(s.labels.singular,$)}),r.isEditable()&&h("div",{className:`${o}__actions`,children:[B?e(De,{className:`${o}__upload-drawer-toggler`,disabled:p?.readOnly,slug:E,children:e(T,{buttonStyle:"icon-label",el:"div",icon:"edit",onClick:t=>{t.preventDefault()},round:!0,tooltip:y("fields:editRelationship")})}):null,e(T,{buttonStyle:"icon-label",disabled:p?.readOnly,el:"div",icon:"swap",onClick:()=>{r.dispatchCommand(W,{replace:{nodeKey:a}})},round:!0,tooltip:y("fields:swapUpload")}),e(T,{buttonStyle:"icon-label",className:`${o}__removeButton`,disabled:p?.readOnly,icon:"x",onClick:t=>{t.preventDefault(),J()},round:!0,tooltip:y("fields:removeUpload")})]})]})]}),e("div",{className:`${o}__bottomRow`,children:e(b,{className:`${o}__doc-drawer-toggler`,children:e("strong",{children:f?.filename})})})]}),C&&e(D,{onSave:Q}),B?e(q,{drawerSlug:E,relatedCollection:s,...d}):null]})},nt=d=>e(j,{...d,uploads:!0,children:e(Te,{...d})});export{nt as UploadComponent};
2
+ //# sourceMappingURL=component-Z34HXRX3.js.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/field/features/upload/component/index.tsx", "../../../src/field/features/upload/component/ExtraFieldsDrawer/index.tsx"],
4
+ "sourcesContent": ["'use client'\nimport type { ClientCollectionConfig } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n DrawerToggler,\n File,\n useConfig,\n useDocumentDrawer,\n useDrawerSlug,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui/client'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'\n\nimport type { ClientComponentProps } from '../../types.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadData } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport { EnabledRelationshipsCondition } from '../../relationship/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isUploadNode } from '../nodes/UploadNode.js'\nimport { ExtraFieldsUploadDrawer } from './ExtraFieldsDrawer/index.js'\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n const {\n collections,\n routes: { api },\n serverURL,\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const { editorConfig, field } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection, setRelatedCollection] = useState<ClientCollectionConfig>(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const drawerSlug = useDrawerSlug('upload-drawer')\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (json) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDrawer()\n },\n [setParams, cacheBust, closeDrawer],\n )\n\n const $onDelete = useCallback(\n (payload: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n const event: KeyboardEvent = payload\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isUploadNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked\n if (event.target === uploadRef.current || uploadRef.current?.contains(event.target as Node)) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick])\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.clientFeatureProps as ClientComponentProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? (\n <img\n alt={data?.filename}\n data-lexical-upload-id={value}\n data-lexical-upload-relation-to={relationTo}\n src={thumbnailSRC}\n />\n ) : (\n <File />\n )}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <DrawerToggler\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={field?.readOnly}\n slug={drawerSlug}\n >\n <Button\n buttonStyle=\"icon-label\"\n el=\"div\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n </DrawerToggler>\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value && <DocumentDrawer onSave={updateUpload} />}\n {hasExtraFields ? (\n <ExtraFieldsUploadDrawer\n drawerSlug={drawerSlug}\n relatedCollection={relatedCollection}\n {...props}\n />\n ) : null}\n </div>\n )\n}\n\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n", "'use client'\nimport type { FormProps } from '@payloadcms/ui/forms/Form'\nimport type { ClientCollectionConfig, FormState } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Drawer,\n Form,\n FormSubmit,\n RenderFields,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useModal,\n useTranslation,\n} from '@payloadcms/ui/client'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport { $getNodeByKey } from 'lexical'\nimport { deepCopyObject } from 'payload/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { UploadData, UploadNode } from '../../nodes/UploadNode.js'\nimport type { ElementProps } from '../index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\n\n/**\n * This handles the extra fields, e.g. captions or alt text, which are\n * potentially added to the upload feature.\n */\nexport const ExtraFieldsUploadDrawer: React.FC<\n ElementProps & {\n drawerSlug: string\n relatedCollection: ClientCollectionConfig\n }\n> = (props) => {\n const {\n data: { fields, relationTo, value },\n drawerSlug,\n nodeKey,\n relatedCollection,\n } = props\n\n const [editor] = useLexicalComposerContext()\n\n const { closeModal } = useModal()\n\n const { i18n, t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.upload.fields.${relatedCollection.slug}`\n const schemaFieldsPath = `${schemaPath}.feature.upload.${relatedCollection.slug}`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: deepCopyObject(fields || {}),\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, fields])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n const handleUpdateEditData = useCallback(\n (_, data) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: UploadNode | null = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n\n closeModal(drawerSlug)\n },\n [closeModal, editor, drawerSlug, nodeKey],\n )\n\n return (\n <Drawer\n slug={drawerSlug}\n title={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n >\n {initialState !== false && (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n // @ts-expect-error TODO: Fix this\n fields={fieldMap}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleUpdateEditData}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )}\n </Drawer>\n )\n}\n"],
5
+ "mappings": "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",
6
+ "names": ["useLexicalComposerContext", "useLexicalNodeSelection", "mergeRegister", "getTranslation", "Button", "DrawerToggler", "File", "useConfig", "useDocumentDrawer", "useDrawerSlug", "usePayloadAPI", "useTranslation", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "useCallback", "useEffect", "useReducer", "useRef", "useState", "useLexicalComposerContext", "getTranslation", "Drawer", "Form", "FormSubmit", "RenderFields", "useConfig", "useDocumentInfo", "useFieldProps", "useModal", "useTranslation", "getFormState", "$getNodeByKey", "deepCopyObject", "useCallback", "useEffect", "useState", "uuid", "jsx", "jsxs", "ExtraFieldsUploadDrawer", "props", "fields", "relationTo", "value", "drawerSlug", "nodeKey", "relatedCollection", "editor", "useLexicalComposerContext", "closeModal", "useModal", "i18n", "t", "useTranslation", "id", "useDocumentInfo", "schemaPath", "useFieldProps", "config", "useConfig", "initialState", "setInitialState", "useState", "richTextComponentMap", "useEditorConfigContext", "componentMapRenderedFieldsPath", "schemaFieldsPath", "fieldMap", "useEffect", "state", "getFormState", "deepCopyObject", "onChange", "useCallback", "prevFormState", "handleUpdateEditData", "_", "data", "uploadNode", "$getNodeByKey", "newData", "Drawer", "getTranslation", "Form", "uuid", "RenderFields", "FormSubmit", "jsx", "jsxs", "baseClass", "initialParams", "Component", "props", "fields", "relationTo", "value", "nodeKey", "collections", "api", "serverURL", "useConfig", "uploadRef", "useRef", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "editorConfig", "field", "useEditorConfigContext", "i18n", "t", "useTranslation", "cacheBust", "dispatchCacheBust", "useReducer", "state", "relatedCollection", "setRelatedCollection", "useState", "coll", "drawerSlug", "useDrawerSlug", "DocumentDrawer", "DocumentDrawerToggler", "closeDrawer", "useDocumentDrawer", "data", "setParams", "usePayloadAPI", "thumbnailSRC", "removeUpload", "useCallback", "$getNodeByKey", "updateUpload", "json", "$onDelete", "payload", "$isNodeSelection", "$getSelection", "node", "$isUploadNode", "onClick", "event", "useEffect", "mergeRegister", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "hasExtraFields", "File", "getTranslation", "DrawerToggler", "Button", "e", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "ExtraFieldsUploadDrawer", "UploadComponent", "EnabledRelationshipsCondition"]
7
+ }
@@ -0,0 +1,52 @@
1
+ export { RichTextCell } from '../../cell/index.js';
2
+ export { AlignFeatureClientComponent } from '../../field/features/align/feature.client.js';
3
+ export { BlockquoteFeatureClientComponent } from '../../field/features/blockquote/feature.client.js';
4
+ export { BlocksFeatureClientComponent } from '../../field/features/blocks/feature.client.js';
5
+ export { createClientComponent } from '../../field/features/createClientComponent.js';
6
+ export { TestRecorderFeatureClientComponent } from '../../field/features/debug/testRecorder/feature.client.js';
7
+ export { TreeViewFeatureClientComponent } from '../../field/features/debug/treeView/feature.client.js';
8
+ export { BoldFeatureClientComponent } from '../../field/features/format/bold/feature.client.js';
9
+ export { InlineCodeFeatureClientComponent } from '../../field/features/format/inlineCode/feature.client.js';
10
+ export { ItalicFeatureClientComponent } from '../../field/features/format/italic/feature.client.js';
11
+ export { toolbarFormatGroupWithItems } from '../../field/features/format/shared/toolbarFormatGroup.js';
12
+ export { StrikethroughFeatureClientComponent } from '../../field/features/format/strikethrough/feature.client.js';
13
+ export { SubscriptFeatureClientComponent } from '../../field/features/format/subscript/feature.client.js';
14
+ export { SuperscriptFeatureClientComponent } from '../../field/features/format/superscript/feature.client.js';
15
+ export { UnderlineFeatureClientComponent } from '../../field/features/format/underline/feature.client.js';
16
+ export { HeadingFeatureClientComponent } from '../../field/features/heading/feature.client.js';
17
+ export { HorizontalRuleFeatureClientComponent } from '../../field/features/horizontalRule/feature.client.js';
18
+ export { IndentFeatureClientComponent } from '../../field/features/indent/feature.client.js';
19
+ export { LinkFeatureClientComponent } from '../../field/features/link/feature.client.js';
20
+ export { ChecklistFeatureClientComponent } from '../../field/features/lists/checklist/feature.client.js';
21
+ export { OrderedListFeatureClientComponent } from '../../field/features/lists/orderedList/feature.client.js';
22
+ export { UnorderedListFeatureClientComponent } from '../../field/features/lists/unorderedList/feature.client.js';
23
+ export { LexicalPluginToLexicalFeatureClientComponent } from '../../field/features/migrations/lexicalPluginToLexical/feature.client.js';
24
+ export { SlateToLexicalFeatureClientComponent } from '../../field/features/migrations/slateToLexical/feature.client.js';
25
+ export { ParagraphFeatureClientComponent } from '../../field/features/paragraph/feature.client.js';
26
+ export { RelationshipFeatureClientComponent } from '../../field/features/relationship/feature.client.js';
27
+ export { toolbarAddDropdownGroupWithItems } from '../../field/features/shared/toolbar/addDropdownGroup.js';
28
+ export { toolbarFeatureButtonsGroupWithItems } from '../../field/features/shared/toolbar/featureButtonsGroup.js';
29
+ export { toolbarTextDropdownGroupWithItems } from '../../field/features/shared/toolbar/textDropdownGroup.js';
30
+ export { FixedToolbarFeatureClientComponent } from '../../field/features/toolbars/fixed/feature.client.js';
31
+ export { InlineToolbarFeatureClientComponent } from '../../field/features/toolbars/inline/feature.client.js';
32
+ export { ToolbarButton } from '../../field/features/toolbars/shared/ToolbarButton/index.js';
33
+ export { ToolbarDropdown } from '../../field/features/toolbars/shared/ToolbarDropdown/index.js';
34
+ export { UploadFeatureClientComponent } from '../../field/features/upload/feature.client.js';
35
+ export { RichTextField } from '../../field/index.js';
36
+ export { type EditorConfigContextType, EditorConfigProvider, useEditorConfigContext, } from '../../field/lexical/config/client/EditorConfigProvider.js';
37
+ export { defaultEditorLexicalConfig } from '../../field/lexical/config/client/default.js';
38
+ export { sanitizeClientEditorConfig, sanitizeClientFeatures, } from '../../field/lexical/config/client/sanitize.js';
39
+ export { CAN_USE_DOM } from '../../field/lexical/utils/canUseDOM.js';
40
+ export { cloneDeep } from '../../field/lexical/utils/cloneDeep.js';
41
+ export { getDOMRangeRect } from '../../field/lexical/utils/getDOMRangeRect.js';
42
+ export { getSelectedNode } from '../../field/lexical/utils/getSelectedNode.js';
43
+ export { isHTMLElement } from '../../field/lexical/utils/guard.js';
44
+ export { invariant } from '../../field/lexical/utils/invariant.js';
45
+ export { joinClasses } from '../../field/lexical/utils/joinClasses.js';
46
+ export { createBlockNode } from '../../field/lexical/utils/markdown/createBlockNode.js';
47
+ export { Point, isPoint } from '../../field/lexical/utils/point.js';
48
+ export { Rect } from '../../field/lexical/utils/rect.js';
49
+ export { setFloatingElemPosition } from '../../field/lexical/utils/setFloatingElemPosition.js';
50
+ export { setFloatingElemPositionForLinkEditor } from '../../field/lexical/utils/setFloatingElemPositionForLinkEditor.js';
51
+ export { addSwipeDownListener, addSwipeLeftListener, addSwipeRightListener, addSwipeUpListener, } from '../../field/lexical/utils/swipe.js';
52
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/exports/client/index.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,36 @@
1
+ "use client";import{a as me,b as Re,c as Ie,d as Pe}from"./chunk-3PZ2ZFQG.js";import{a as fe,b as Me,c as Ae,d as ro}from"./chunk-FSTRW2TI.js";import{a as De,b as Ce,c as Oe,d as He,e as no}from"./chunk-M6MN4CA5.js";import{a as oo,b as pi,c as mi,d as fi,e as Ci}from"./chunk-35NZOHAF.js";import{a as ui,b as S}from"./chunk-Y5455JF3.js";import{createHeadlessEditor as gi}from"@lexical/headless";import{useClientFunctions as hi,useTableCell as xi}from"@payloadcms/ui/client";import{$getRoot as Ti}from"lexical";import dt,{useEffect as so,useState as ut}from"react";var io={block:"LexicalEditorTheme__block",blockCursor:"LexicalEditorTheme__blockCursor",characterLimit:"LexicalEditorTheme__characterLimit",code:"LexicalEditorTheme__code",codeHighlight:{atrule:"LexicalEditorTheme__tokenAttr",attr:"LexicalEditorTheme__tokenAttr",boolean:"LexicalEditorTheme__tokenProperty",builtin:"LexicalEditorTheme__tokenSelector",cdata:"LexicalEditorTheme__tokenComment",char:"LexicalEditorTheme__tokenSelector",class:"LexicalEditorTheme__tokenFunction","class-name":"LexicalEditorTheme__tokenFunction",comment:"LexicalEditorTheme__tokenComment",constant:"LexicalEditorTheme__tokenProperty",deleted:"LexicalEditorTheme__tokenProperty",doctype:"LexicalEditorTheme__tokenComment",entity:"LexicalEditorTheme__tokenOperator",function:"LexicalEditorTheme__tokenFunction",important:"LexicalEditorTheme__tokenVariable",inserted:"LexicalEditorTheme__tokenSelector",keyword:"LexicalEditorTheme__tokenAttr",namespace:"LexicalEditorTheme__tokenVariable",number:"LexicalEditorTheme__tokenProperty",operator:"LexicalEditorTheme__tokenOperator",prolog:"LexicalEditorTheme__tokenComment",property:"LexicalEditorTheme__tokenProperty",punctuation:"LexicalEditorTheme__tokenPunctuation",regex:"LexicalEditorTheme__tokenVariable",selector:"LexicalEditorTheme__tokenSelector",string:"LexicalEditorTheme__tokenSelector",symbol:"LexicalEditorTheme__tokenProperty",tag:"LexicalEditorTheme__tokenProperty",url:"LexicalEditorTheme__tokenOperator",variable:"LexicalEditorTheme__tokenVariable"},embedBlock:{base:"LexicalEditorTheme__embedBlock",focus:"LexicalEditorTheme__embedBlockFocus"},hashtag:"LexicalEditorTheme__hashtag",heading:{h1:"LexicalEditorTheme__h1",h2:"LexicalEditorTheme__h2",h3:"LexicalEditorTheme__h3",h4:"LexicalEditorTheme__h4",h5:"LexicalEditorTheme__h5",h6:"LexicalEditorTheme__h6"},hr:"LexicalEditorTheme__hr",indent:"LexicalEditorTheme__indent",inlineImage:"LexicalEditor__inline-image",link:"LexicalEditorTheme__link",list:{checklist:"LexicalEditorTheme__checklist",listitem:"LexicalEditorTheme__listItem",listitemChecked:"LexicalEditorTheme__listItemChecked",listitemUnchecked:"LexicalEditorTheme__listItemUnchecked",nested:{listitem:"LexicalEditorTheme__nestedListItem"},olDepth:["LexicalEditorTheme__ol1","LexicalEditorTheme__ol2","LexicalEditorTheme__ol3","LexicalEditorTheme__ol4","LexicalEditorTheme__ol5"],ul:"LexicalEditorTheme__ul"},ltr:"LexicalEditorTheme__ltr",mark:"LexicalEditorTheme__mark",markOverlap:"LexicalEditorTheme__markOverlap",paragraph:"LexicalEditorTheme__paragraph",quote:"LexicalEditorTheme__quote",relationship:"LexicalEditorTheme__relationship",rtl:"LexicalEditorTheme__rtl",table:"LexicalEditorTheme__table",tableAddColumns:"LexicalEditorTheme__tableAddColumns",tableAddRows:"LexicalEditorTheme__tableAddRows",tableCell:"LexicalEditorTheme__tableCell",tableCellActionButton:"LexicalEditorTheme__tableCellActionButton",tableCellActionButtonContainer:"LexicalEditorTheme__tableCellActionButtonContainer",tableCellEditing:"LexicalEditorTheme__tableCellEditing",tableCellHeader:"LexicalEditorTheme__tableCellHeader",tableCellPrimarySelected:"LexicalEditorTheme__tableCellPrimarySelected",tableCellResizer:"LexicalEditorTheme__tableCellResizer",tableCellSelected:"LexicalEditorTheme__tableCellSelected",tableCellSortedIndicator:"LexicalEditorTheme__tableCellSortedIndicator",tableResizeRuler:"LexicalEditorTheme__tableCellResizeRuler",tableSelected:"LexicalEditorTheme__tableSelected",text:{bold:"LexicalEditorTheme__textBold",code:"LexicalEditorTheme__textCode",italic:"LexicalEditorTheme__textItalic",strikethrough:"LexicalEditorTheme__textStrikethrough",subscript:"LexicalEditorTheme__textSubscript",superscript:"LexicalEditorTheme__textSuperscript",underline:"LexicalEditorTheme__textUnderline",underlineStrikethrough:"LexicalEditorTheme__textUnderlineStrikethrough"},upload:"editor-upload"};var ge={namespace:"lexical",theme:io};function Be({clientFunctions:e,schemaPath:t,unSanitizedEditorConfig:o}){for(let l of o.features)if(!l?.clientFeatureProps?.featureKey||l?.clientFeatureProps?.order===void 0||l?.clientFeatureProps?.order===null)throw new Error("A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.");o.features=o.features.sort((l,a)=>l.clientFeatureProps.order-a.clientFeatureProps.order);let r=new Map(o.features.map(l=>[l.clientFeatureProps.featureKey,l])),n=new Map,i=0;for(let l of o.features){let a={};Object.entries(e).forEach(([c,d])=>{if(c.startsWith(`lexicalFeature.${t}.${l.clientFeatureProps.featureKey}.components.`)){let p=c.split(`${t}.${l.clientFeatureProps.featureKey}.components.`)[1];a[p]=d}});let s=l.feature({clientFunctions:a,featureProviderMap:r,resolvedFeatures:n,unSanitizedEditorConfig:o});n.set(l.clientFeatureProps.featureKey,{...s,key:l.clientFeatureProps.featureKey,order:i}),i++}return n}var lo=e=>{let t={enabledFeatures:[],hooks:{load:[],save:[]},markdownTransformers:[],nodes:[],plugins:[],slashMenu:{dynamicGroups:[],groups:[]},toolbarFixed:{groups:[]},toolbarInline:{groups:[]}};if(!e?.size)return t;e.forEach(o=>{if(o.hooks&&(o.hooks?.load?.length&&(t.hooks.load=t.hooks.load.concat(o.hooks.load)),o.hooks?.save?.length&&(t.hooks.save=t.hooks.save.concat(o.hooks.save))),o.nodes?.length&&(t.nodes=t.nodes.concat(o.nodes)),o.plugins?.length&&o.plugins.forEach((r,n)=>{t.plugins.push({Component:r.Component,clientProps:o.clientFeatureProps,key:o.key+n,position:r.position})}),o.toolbarInline?.groups?.length)for(let r of o.toolbarInline.groups){let n=t.toolbarInline.groups.find(i=>i.key===r.key);n?t.toolbarInline.groups=t.toolbarInline.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),t.toolbarInline?.groups.push(n)}if(o.toolbarFixed?.groups?.length)for(let r of o.toolbarFixed.groups){let n=t.toolbarFixed.groups.find(i=>i.key===r.key);n?t.toolbarFixed.groups=t.toolbarFixed.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),t.toolbarFixed?.groups.push(n)}if(o.slashMenu?.groups){o.slashMenu.dynamicGroups?.length&&(t.slashMenu.dynamicGroups=t.slashMenu.dynamicGroups.concat(o.slashMenu.dynamicGroups));for(let r of o.slashMenu.groups){let n=t.slashMenu.groups.find(i=>i.key===r.key);n?t.slashMenu.groups=t.slashMenu.groups.filter(i=>i.key!==r.key):n={...r,items:[]},r?.items?.length&&(n.items=n.items.concat(r.items)),t.slashMenu.groups.push(n)}}o.markdownTransformers?.length&&(t.markdownTransformers=t.markdownTransformers.concat(o.markdownTransformers)),t.enabledFeatures.push(o.key)}),t.toolbarInline.groups.sort((o,r)=>o.order&&r.order?o.order-r.order:o.order?-1:r.order?1:0),t.toolbarFixed.groups.sort((o,r)=>o.order&&r.order?o.order-r.order:o.order?-1:r.order?1:0);for(let o of t.toolbarInline.groups)o.items.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0);for(let o of t.toolbarFixed.groups)o.items.sort((r,n)=>r.order&&n.order?r.order-n.order:r.order?-1:n.order?1:0);return t};function he(e,t,o){return{admin:o,features:lo(t),lexical:e,resolvedFeatureMap:t}}import{jsx as ao,jsxs as Li}from"react/jsx-runtime";var yi=e=>{let{admin:t,lexicalEditorConfig:o,richTextComponentMap:r}=e,[n,i]=dt.useState("Loading..."),{cellData:l,cellProps:{schemaPath:a}}=xi(),s=hi(),[c,d]=ut(!1),[p,u]=ut([]),[m,f]=ut(null),C=r.get("features").sort((x,N)=>x.order-N.order),y=0;for(let x of C){let N=Array.from(r.keys()).filter(v=>v.startsWith(`feature.${x.key}.components.`));y+=1,y+=N.length}return so(()=>{if(!c){let x=[],N=0;if(Object.entries(s).forEach(([v,g])=>{v.startsWith(`lexicalFeature.${a}.`)&&(v.includes(".components.")||x.push(g),N++)}),N===y){u(x),d(!0);let v=Be({clientFunctions:s,schemaPath:a,unSanitizedEditorConfig:{features:x,lexical:o}});f(he(o||ge,v,t))}}},[t,C,c,s,a,C.length,p,m,o,r,y]),so(()=>{if(!c)return;let x=l;if(x==null||!c||!m){i("");return}if(m?.features?.hooks?.load?.length&&m.features.hooks.load.forEach(g=>{x=g({incomingEditorState:x})}),!x||typeof x!="object"){i("");return}if(Array.isArray(x)&&!("root"in x)){i("");return}if("jsonContent"in x){i("");return}let N=gi({namespace:m.lexical.namespace,nodes:oo({editorConfig:m}),theme:m.lexical.theme});N.setEditorState(N.parseEditorState(x));let v=N.getEditorState().read(()=>Ti().getTextContent())||"";i(v)},[l,o,c,m]),c?ao("span",{children:n}):ao(dt.Fragment,{children:Array.isArray(C)&&C.map(x=>{let v=Array.from(r.keys()).filter(g=>g.startsWith(`feature.${x.key}.components.`)).map(g=>r.get(g));return Li(dt.Fragment,{children:[v?.length?v.map(g=>g):null,x.ClientComponent]},x.key)})})};import{$isElementNode as W,$isRangeSelection as $e,FORMAT_ELEMENT_COMMAND as Ue}from"lexical";import{jsx as pt,jsxs as bi}from"react/jsx-runtime";var co=()=>bi("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[pt("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),pt("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),pt("path",{d:"M5 15H15",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as mt,jsxs as Ei}from"react/jsx-runtime";var uo=()=>Ei("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[mt("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),mt("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),mt("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as ft,jsxs as ki}from"react/jsx-runtime";var Ge=()=>ki("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ft("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),ft("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),ft("path",{d:"M2.5 15H12.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{jsx as Ct,jsxs as Ni}from"react/jsx-runtime";var po=()=>Ni("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Ct("path",{d:"M2.5 5H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ct("path",{d:"M2.5 10H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ct("path",{d:"M7.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{useAddClientFunction as vi,useFieldProps as Fi,useTableCell as _i}from"@payloadcms/ui/client";var mo=(e,t)=>{let{schemaPath:o}=Fi(),i=_i()?.cellProps?.schemaPath||o;vi(`lexicalFeature.${i}.${e}`,t)};var h=e=>t=>(mo(t.featureKey,e(t)),null);var fo=e=>({type:"dropdown",ChildComponent:Ge,items:e,key:"align",order:30});var Co=[fo([{ChildComponent:Ge,isActive:({selection:e})=>{if(!$e(e))return!1;for(let t of e.getNodes()){if(W(t)&&t.getFormatType()==="left")continue;let o=t.getParent();if(!(W(o)&&o.getFormatType()==="left"))return!1}return!0},key:"alignLeft",label:({i18n:e})=>e.t("lexical:align:alignLeftLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Ue,"left")},order:1},{ChildComponent:co,isActive:({selection:e})=>{if(!$e(e))return!1;for(let t of e.getNodes()){if(W(t)&&t.getFormatType()==="center")continue;let o=t.getParent();if(!(W(o)&&o.getFormatType()==="center"))return!1}return!0},key:"alignCenter",label:({i18n:e})=>e.t("lexical:align:alignCenterLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Ue,"center")},order:2},{ChildComponent:po,isActive:({selection:e})=>{if(!$e(e))return!1;for(let t of e.getNodes()){if(W(t)&&t.getFormatType()==="right")continue;let o=t.getParent();if(!(W(o)&&o.getFormatType()==="right"))return!1}return!0},key:"alignRight",label:({i18n:e})=>e.t("lexical:align:alignRightLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Ue,"right")},order:3},{ChildComponent:uo,isActive:({selection:e})=>{if(!$e(e))return!1;for(let t of e.getNodes()){if(W(t)&&t.getFormatType()==="justify")continue;let o=t.getParent();if(!(W(o)&&o.getFormatType()==="justify"))return!1}return!0},key:"alignJustify",label:({i18n:e})=>e.t("lexical:align:alignJustifyLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Ue,"justify")},order:4}])],wi=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,toolbarFixed:{groups:Co},toolbarInline:{groups:Co}})}),Si=h(wi);import{$createQuoteNode as bo,$isQuoteNode as yo,QuoteNode as Mi}from"@lexical/rich-text";import{$setBlocksType as Eo}from"@lexical/selection";import{$getSelection as ko,$isRangeSelection as Ai}from"lexical";import{jsx as go}from"react/jsx-runtime";var gt=()=>go("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:go("path",{d:"M13.5353 10.5725C13.5353 9.47709 11.0456 9.99991 11.0456 7.85883C11.0456 6.46464 12.1162 5.61816 13.361 5.61816C14.805 5.61816 16 6.86298 16 8.92937C16 11.2945 14.4564 13.7841 11.1203 14.3816L10.8216 13.1368C12.888 12.4895 13.5353 11.4937 13.5353 10.5725ZM6.71369 10.5725C6.71369 9.47709 4.22407 9.99991 4.22407 7.85883C4.22407 6.46464 5.29461 5.61816 6.53942 5.61816C7.9834 5.61816 9.17842 6.86298 9.17842 8.92937C9.17842 11.2945 7.63485 13.7841 4.29876 14.3816L4 13.1368C6.06639 12.4895 6.71369 11.4937 6.71369 10.5725Z",fill:"currentColor"})});function A(e){return{items:e,key:"basic",label:({i18n:t})=>t.t("lexical:general:slashMenuBasicGroupLabel")}}import{jsx as ho}from"react/jsx-runtime";var xe=()=>ho("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ho("path",{d:"M11.708 14.5H7.79785V13.9414H8.01367C9.00391 13.9414 9.15625 13.9033 9.15625 13.6113V6.70508H8.07715C6.82031 6.70508 6.73145 7.08594 6.28711 8.67285H5.80469L5.91895 6.12109H13.5869L13.7012 8.67285H13.2188C12.7744 7.08594 12.6855 6.70508 11.4287 6.70508H10.3496V13.6113C10.3496 13.9033 10.502 13.9414 11.4922 13.9414H11.708V14.5Z",fill:"currentColor"})});var M=e=>({type:"dropdown",ChildComponent:xe,items:e,key:"text",order:25});import{$createQuoteNode as Ri,$isQuoteNode as xo,QuoteNode as Ii}from"@lexical/rich-text";import{$createLineBreakNode as Pi}from"lexical";var To={type:"element",dependencies:[Ii],export:(e,t)=>{if(!xo(e))return null;let o=t(e).split(`
2
+ `),r=[];for(let n of o)r.push("> "+n);return r.join(`
3
+ `)},regExp:/^>\s/,replace:(e,t,o,r)=>{if(r){let i=e.getPreviousSibling();if(xo(i)){i.splice(i.getChildrenSize(),0,[Pi(),...t]),i.select(0,0),e.remove();return}}let n=Ri();n.append(...t),e.replace(n),n.select(0,0)}};var Lo=[M([{ChildComponent:gt,isActive:({selection:e})=>{if(!Ai(e))return!1;for(let t of e.getNodes())if(!yo(t)&&!yo(t.getParent()))return!1;return!0},key:"blockquote",label:({i18n:e})=>e.t("lexical:blockquote:label"),onSelect:({editor:e})=>{e.update(()=>{let t=ko();Eo(t,()=>bo())})},order:20}])],Di=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,markdownTransformers:[To],nodes:[Mi],slashMenu:{groups:[A([{Icon:gt,key:"blockquote",keywords:["quote","blockquote"],label:({i18n:t})=>t.t("lexical:blockquote:label"),onSelect:({editor:t})=>{t.update(()=>{let o=ko();Eo(o,()=>bo())})}}])]},toolbarFixed:{groups:Lo},toolbarInline:{groups:Lo}})}),Oi=h(Di);import{getTranslation as _o}from"@payloadcms/translations";import{jsx as ht,jsxs as Hi}from"react/jsx-runtime";var We=()=>Hi("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ht("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"8",y:"5"}),ht("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"5",y:"11"}),ht("rect",{height:"4",rx:"0.5",stroke:"currentColor",width:"4",x:"11",y:"11"})]});import{DecoratorBlockNode as Bi}from"@lexical/react/LexicalDecoratorBlockNode.js";import Gi from"bson-objectid";import $i from"react";import{jsx as Wi}from"react/jsx-runtime";var Ui=$i.lazy(()=>import("./component-RAVN56DE.js").then(e=>({default:e.BlockComponent}))),X=class e extends Bi{__fields;constructor({fields:t,format:o,key:r}){super(o,r),this.__fields=t}static clone(t){return new e({fields:t.__fields,format:t.__format,key:t.__key})}static getType(){return"block"}static importDOM(){return{}}static importJSON(t){t.version===1&&(t={...t,fields:{...t.fields.data},version:2});let o=Te(t.fields);return o.setFormat(t.format),o}static isInline(){return!1}decorate(t,o){return Wi(Ui,{formData:this.getFields(),nodeKey:this.getKey()})}exportDOM(){let t=document.createElement("div"),o=document.createTextNode(this.getTextContent());return t.append(o),{element:t}}exportJSON(){return{...super.exportJSON(),type:this.getType(),fields:this.getFields(),version:2}}getFields(){return this.getLatest().__fields}getTextContent(){return"Block Field"}setFields(t){let o=JSON.parse(JSON.stringify(t)),r=this.getWritable();r.__fields=o}};function Te(e){return new X({fields:{...e,id:e?.id||new Gi.default().toHexString()}})}import{createCommand as Vi}from"lexical";var Y=Vi("INSERT_BLOCK_COMMAND");import{useLexicalComposerContext as ll}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as sl,mergeRegister as al}from"@lexical/utils";import{$getPreviousSelection as cl,$getSelection as dl,$isParagraphNode as vo,$isRangeSelection as ul,COMMAND_PRIORITY_EDITOR as pl}from"lexical";import{useEffect as ml}from"react";import{useLexicalComposerContext as Ki}from"@lexical/react/LexicalComposerContext.js";import{BlocksDrawer as zi,formatDrawerSlug as ji,useEditDepth as Zi,useModal as Ji,useTranslation as Xi}from"@payloadcms/ui/client";import{$getNodeByKey as Yi,COMMAND_PRIORITY_EDITOR as qi,createCommand as Qi}from"lexical";import{useCallback as el,useEffect as tl,useState as ol}from"react";import{jsx as il}from"react/jsx-runtime";var rl=Qi("INSERT_BLOCK_WITH_DRAWER_COMMAND"),nl=({blockType:e,editor:t,replaceNodeKey:o})=>{o?t.update(()=>{let r=Yi(o);r&&r.replace(Te({id:null,blockName:"",blockType:e}))}):t.dispatchCommand(Y,{id:null,blockName:"",blockType:e})},No=()=>{let[e]=Ki(),{editorConfig:t,uuid:o}=S(),[r,n]=ol(null),i=Zi(),{t:l}=Xi(),{openModal:a}=Ji(),s={plural:l("fields:blocks")||"Blocks",singular:l("fields:block")||"Block"},c=el((u,m)=>{nl({blockType:m,editor:e,replaceNodeKey:r})},[e,r]),d=ji({slug:"lexical-rich-text-blocks-"+o,depth:i}),p=t?.resolvedFeatureMap?.get("blocks")?.clientFeatureProps?.reducedBlocks;return tl(()=>e.registerCommand(rl,u=>(n(u?.replace?u?.replace.nodeKey:null),a(d),!0),qi),[e,d,a]),il(zi,{addRow:c,addRowIndex:0,blocks:p,drawerSlug:d,labels:s})};import{jsx as fl}from"react/jsx-runtime";var Fo=()=>{let[e]=ll();return ml(()=>{if(!e.hasNodes([X]))throw new Error("BlocksPlugin: BlocksNode not registered on editor");return al(e.registerCommand(Y,t=>(e.update(()=>{let o=dl()||cl();if(ul(o)){let r=Te(t);sl(r);let{focus:n}=o,i=n.getNode();vo(i)&&i.getTextContentSize()===0&&i.getParent().getChildren().filter(l=>vo(l)).length>1&&i.remove()}}),!0),pl))},[e]),fl(No,{})};var Cl=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,nodes:[X],plugins:[{Component:Fo,position:"normal"}],slashMenu:{groups:[{items:e.reducedBlocks.map(t=>({Icon:We,key:"block-"+t.slug,keywords:["block","blocks",t.slug],label:({i18n:o})=>t.labels.singular?_o(t.labels.singular,o):t.slug,onSelect:({editor:o})=>{o.dispatchCommand(Y,{id:null,blockName:"",blockType:t.slug})}})),key:"blocks",label:({i18n:t})=>t.t("lexical:blocks:label")}]},toolbarFixed:{groups:[{type:"dropdown",ChildComponent:We,items:e.reducedBlocks.map((t,o)=>({ChildComponent:We,isActive:void 0,key:"block-"+t.slug,label:({i18n:r})=>t.labels.singular?_o(t.labels.singular,r):t.slug,onSelect:({editor:r})=>{r.dispatchCommand(Y,{id:null,blockName:"",blockType:t.slug})},order:o})),key:"blocks",order:20}]}})}),gl=h(Cl);import{useLexicalComposerContext as Tl}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as yl,$createTextNode as Ll,$getRoot as bl}from"lexical";import*as Po from"react";import{useCallback as q,useEffect as xt,useLayoutEffect as So,useRef as Tt,useState as Ve}from"react";var D=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";var hl=D&&"documentMode"in document?document.documentMode:null,wo=D&&/Mac|iPod|iPhone|iPad/.test(navigator.platform),Mm=D&&/^(?!.*Seamonkey)(?=.*Firefox).*/i.test(navigator.userAgent),Am=D&&"InputEvent"in window&&!hl?"getTargetRanges"in new window.InputEvent("input"):!1,Dm=D&&/Version\/[\d.].*Safari/.test(navigator.userAgent),Om=D&&/iPad|iPhone|iPod/.test(navigator.userAgent)&&!window.MSStream,Hm=D&&/Android/.test(navigator.userAgent),Bm=D&&/Win/.test(navigator.platform),xl=D&&/^(?=.*Chrome).*/i.test(navigator.userAgent),Gm=D&&/AppleWebKit\/[\d.]+/.test(navigator.userAgent)&&!xl;import{jsx as Q,jsxs as yt}from"react/jsx-runtime";var El=e=>{let t=document.createElement("textarea");t.value=e||"",t.style.position="absolute",t.style.opacity="0",document.body?.appendChild(t),t.focus(),t.select();try{let o=document.execCommand("copy");console.log(o)}catch(o){console.error(o)}document.body?.removeChild(t)},kl=(e,t)=>{let o=document.createElement("a");o.setAttribute("href","data:text/plain;charset=utf-8,"+encodeURIComponent(t||"")),o.setAttribute("download",e),o.style.display="none",document.body?.appendChild(o),o.click(),document.body?.removeChild(o)},Nl=e=>{let o=((r,n)=>{switch(r){case"click":return` await page.mouse.click(${n.x}, ${n.y});`;case"press":return` await page.keyboard.press('${n}');`;case"keydown":return` await page.keyboard.keydown('${n}');`;case"keyup":return` await page.keyboard.keyup('${n}');`;case"type":return` await page.keyboard.type('${n}');`;case"selectAll":return" await selectAll(page);";case"snapshot":return` await assertHTMLSnapshot(page);
4
+ await assertSelection(page, {
5
+ anchorPath: [${n.anchorPath.toString()}],
6
+ anchorOffset: ${n.anchorOffset},
7
+ focusPath: [${n.focusPath.toString()}],
8
+ focusOffset: ${n.focusOffset},
9
+ });
10
+ `;default:return""}})(e.name,e.value);switch(e.count){case 1:return o;case 2:return[o,o].join(`
11
+ `);default:return` await repeat(${e.count}, async () => {
12
+ ${o}
13
+ );`}};function vl(e){return e.key.toLowerCase()==="a"&&(wo?e.metaKey:e.ctrlKey)}function Fl(e){let{anchorNode:t,focusNode:o}=e,{anchorOffset:r,focusOffset:n}=e;return r!==0&&r--,n!==0&&n--,{anchorNode:t,anchorOffset:r,focusNode:o,focusOffset:n}}function Ro(e,t){let o=e,r=[];for(;o!==t;)o!=null&&r.unshift(Array.from(o?.parentNode?.childNodes??[]).indexOf(o)),o=o?.parentNode;return r}var Io=new Set(["Enter","Backspace","Delete","Escape","ArrowLeft","ArrowRight","ArrowUp","ArrowDown"]);function _l(e){let[t,o]=Ve([]),[r,n]=Ve(!1),[,i]=Ve(""),[l,a]=Ve(""),s=Tt(null),c=Tt(!1),d=Tt(null),p=q(()=>e,[e]),u=q(()=>{let g=e.getRootElement(),L=window.getSelection();return g==null||L==null||L.anchorNode==null||L.focusNode==null||!g.contains(L.anchorNode)||!g.contains(L.focusNode)?null:`
14
+ import {
15
+ initializeE2E,
16
+ assertHTMLSnapshot,
17
+ assertSelection,
18
+ repeat,
19
+ } from '../utils';
20
+ import {selectAll} from '../keyboardShortcuts';
21
+ import { RangeSelection } from 'lexical';
22
+ import { NodeSelection } from 'lexical';
23
+
24
+ describe('Test case', () => {
25
+ initializeE2E((e2e) => {
26
+ it('Should pass this test', async () => {
27
+ const {page} = e2e;
28
+
29
+ await page.focus('div[contenteditable="true"]');
30
+ ${t.map(Nl).join(`
31
+ `)}
32
+ });
33
+ });
34
+ `},[e,t]),m=q((g,L)=>{o(E=>{let b=t.length-1,w=t[b];if(w&&w.name===g){if(g==="type")return[...t.slice(0,b),{...w,value:w.value+L}];if(w.value===L)return[...t.slice(0,b),{...w,count:w.count+1}]}return[...E,{name:g,count:1,value:L}]})},[t,o]);So(()=>{let g=E=>{if(!r)return;let b=E.key;vl(E)?m("selectAll",""):Io.has(b)?m("press",E.key):[...b].length>1?m("keydown",E.key):m("type",E.key)},L=E=>{if(!r)return;let b=E.key;!Io.has(b)&&[...b].length>1&&m("keyup",E.key)};return e.registerRootListener((E,b)=>{b!==null&&(b.removeEventListener("keydown",g),b.removeEventListener("keyup",L)),E!==null&&(E.addEventListener("keydown",g),E.addEventListener("keyup",L))})},[e,r,m]),So(()=>{d.current&&d.current.scrollTo(0,d.current.scrollHeight)},[u]),xt(()=>{if(t){let g=u();g!==null&&a(g),d.current&&d.current.scrollTo(0,d.current.scrollHeight)}},[u,t]),xt(()=>e.registerUpdateListener(({dirtyElements:L,dirtyLeaves:E,editorState:b})=>{if(!r)return;let w=b._selection,P=s.current,k=c.current;if(P!==w){if(E.size===0&&L.size===0&&!k){let G=window.getSelection();if(G&&(G.anchorNode==null||G.focusNode==null))return}s.current=w}c.current=!1;let _=u();_!==null&&a(_)}),[e,u,r,m]),xt(()=>r?e.registerUpdateListener(()=>{let L=e.getRootElement();L!==null&&i(L?.innerHTML)}):void 0,[e,r]);let f=q(g=>{r||(g.update(()=>{let L=bl();L.clear();let E=Ll();L.append(yl().append(E)),E.select()}),o([])),n(L=>!L)},[r]),C=q(()=>{if(!r)return;let g=window.getSelection();if(g===null||g.anchorNode==null||g.focusNode==null)return;let{anchorNode:L,anchorOffset:E,focusNode:b,focusOffset:w}=Fl(g),P=p().getRootElement(),k;L!==null&&(k=Ro(L,P));let _;b!==null&&(_=Ro(b,P)),m("snapshot",{anchorNode:L,anchorOffset:E,anchorPath:k,focusNode:b,focusOffset:w,focusPath:_})},[m,r,p]),y=q(()=>{El(u())},[u]),x=q(()=>{kl("test.js",u())},[u]);return[Q("button",{className:`editor-dev-button ${r?"active":""}`,id:"test-recorder-button",onClick:g=>{f(p()),g.preventDefault()},title:r?"Disable test recorder":"Enable test recorder",type:"button",children:r?"Disable test recorder":"Enable test recorder"}),r?yt("div",{className:"test-recorder-output",children:[yt("div",{className:"test-recorder-toolbar",children:[Q("button",{className:"test-recorder-button",id:"test-recorder-button-snapshot",onClick:g=>{C(),g.preventDefault()},title:"Insert snapshot",type:"button",children:"Insert Snapshot"}),Q("button",{className:"test-recorder-button",id:"test-recorder-button-copy",onClick:g=>{y(),g.preventDefault()},title:"Copy to clipboard",type:"button",children:"Copy"}),Q("button",{className:"test-recorder-button",id:"test-recorder-button-download",onClick:g=>{x(),g.preventDefault()},title:"Download as a file",type:"button",children:"Download"})]}),Q("pre",{id:"test-recorder",ref:d,children:l})]}):null]}var Mo=()=>{let[e]=Tl(),[t,o]=_l(e);return yt(Po.Fragment,{children:[Q("p",{children:"HI"}),t,o,Q("p",{children:"DONE"})]})};var wl=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,plugins:[{Component:Mo,position:"bottom"}]})}),Sl=h(wl);import{useLexicalComposerContext as Rl}from"@lexical/react/LexicalComposerContext.js";import{TreeView as Il}from"@lexical/react/LexicalTreeView.js";import{jsx as Pl}from"react/jsx-runtime";var Ao=()=>{let[e]=Rl();return Pl(Il,{editor:e,timeTravelButtonClassName:"debug-timetravel-button",timeTravelPanelButtonClassName:"debug-timetravel-panel-button",timeTravelPanelClassName:"debug-timetravel-panel",timeTravelPanelSliderClassName:"debug-timetravel-panel-slider",treeTypeButtonClassName:"debug-treetype-button",viewClassName:"tree-view-output"})};var Ml=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,plugins:[{Component:Ao,position:"bottom"}]})}),Al=h(Ml);import{$isRangeSelection as Dl,FORMAT_TEXT_COMMAND as Ol}from"lexical";import{jsx as Do}from"react/jsx-runtime";var Oo=()=>Do("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Do("path",{d:"M10.6772 15H6.27017V5.718H10.4172C12.6792 5.718 13.8492 6.602 13.8492 8.292C13.8492 9.098 13.1992 9.982 12.4712 10.216C13.3812 10.476 14.1742 11.256 14.1742 12.322C14.1742 14.09 12.9002 15 10.6772 15ZM8.46717 9.501H10.3262C11.3012 9.501 11.7042 9.046 11.7042 8.409C11.7042 7.72 11.2362 7.317 10.3392 7.317H8.46717V9.501ZM8.46717 11.061V13.401H10.4822C11.4702 13.401 11.9642 12.959 11.9642 12.218C11.9642 11.49 11.4702 11.061 10.4822 11.061H8.46717Z",fill:"currentColor"})});var R=e=>({type:"buttons",items:e,key:"format",order:40});var Ho={type:"text-format",format:["bold","italic"],tag:"***"},Bo={type:"text-format",format:["bold","italic"],intraword:!1,tag:"___"},Go={type:"text-format",format:["bold"],tag:"**"},$o={type:"text-format",format:["bold"],intraword:!1,tag:"__"};var Uo=[R([{ChildComponent:Oo,isActive:({selection:e})=>Dl(e)?e.hasFormat("bold"):!1,key:"bold",onSelect:({editor:e})=>{e.dispatchCommand(Ol,"bold")},order:1}])],Hl=e=>({clientFeatureProps:e,feature:({featureProviderMap:t})=>{let o=[Go,$o];return t.get("italic")&&o.push(Bo,Ho),{clientFeatureProps:e,markdownTransformers:o,toolbarFixed:{groups:Uo},toolbarInline:{groups:Uo}}}}),Bl=h(Hl);import{$isRangeSelection as $l,FORMAT_TEXT_COMMAND as Ul}from"lexical";import{jsx as Wo,jsxs as Gl}from"react/jsx-runtime";var Vo=()=>Gl("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Wo("path",{d:"M7.76465 6L3.76465 10L7.76465 14",stroke:"currentColor"}),Wo("path",{d:"M12.2354 6L16.2354 10L12.2354 14",stroke:"currentColor"})]});var Ko={type:"text-format",format:["code"],tag:"`"};var zo=[R([{ChildComponent:Vo,isActive:({selection:e})=>$l(e)?e.hasFormat("code"):!1,key:"inlineCode",onSelect:({editor:e})=>{e.dispatchCommand(Ul,"code")},order:7}])],Wl=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,markdownTransformers:[Ko],toolbarFixed:{groups:zo},toolbarInline:{groups:zo}})}),Vl=h(Wl);import{$isRangeSelection as Kl,FORMAT_TEXT_COMMAND as zl}from"lexical";import{jsx as jo}from"react/jsx-runtime";var Zo=()=>jo("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:jo("path",{d:"M11.311 14.2969L11.0327 15H6.18408L6.4624 14.2969C7.54639 14.2969 7.70752 14.209 7.83936 13.8721L10.8423 6.45996C10.8716 6.38672 10.8862 6.32812 10.8862 6.26953C10.8862 6.09375 10.6519 6.03516 9.80225 6.03516L10.0952 5.33203H14.9438L14.6509 6.03516C13.5669 6.03516 13.4204 6.12305 13.2886 6.45996L10.2856 13.8721C10.2563 13.9453 10.2271 14.0039 10.2271 14.0625C10.2271 14.2383 10.4614 14.2969 11.311 14.2969Z",fill:"currentColor"})});var Jo={type:"text-format",format:["italic"],tag:"*"},Xo={type:"text-format",format:["italic"],intraword:!1,tag:"_"};var Yo=[R([{ChildComponent:Zo,isActive:({selection:e})=>Kl(e)?e.hasFormat("italic"):!1,key:"italic",onSelect:({editor:e})=>{e.dispatchCommand(zl,"italic")},order:2}])],jl=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,markdownTransformers:[Jo,Xo],toolbarFixed:{groups:Yo},toolbarInline:{groups:Yo}})}),Zl=h(jl);import{$isRangeSelection as Xl,FORMAT_TEXT_COMMAND as Yl}from"lexical";import{jsx as qo,jsxs as Jl}from"react/jsx-runtime";var Qo=()=>Jl("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[qo("path",{d:"M5.50756 12.76H7.42756C7.56256 14.215 8.82256 14.71 10.1576 14.71C11.4326 14.71 12.4226 14.14 12.4226 13.06C12.4226 12.28 11.9576 11.845 10.6676 11.605L8.70256 11.245C7.12756 10.96 5.85256 10.21 5.85256 8.335C5.85256 6.43 7.53256 5.11 9.87256 5.11C12.4226 5.11 13.9526 6.22 14.1626 8.23H12.2876C12.1526 7.18 11.2226 6.595 9.88756 6.595C8.59756 6.595 7.78756 7.27 7.78756 8.215C7.78756 9.1 8.34256 9.385 9.49756 9.61L11.5676 10.015C13.3226 10.345 14.3726 11.215 14.3726 12.94C14.3726 14.89 12.5876 16.18 10.2176 16.18C7.66756 16.18 5.70256 15.115 5.50756 12.76Z",fill:"currentColor"}),qo("path",{d:"M4.99756 11.44H15.0026V12.19H4.99756V11.44Z",fill:"currentColor"})]});var er={type:"text-format",format:["strikethrough"],tag:"~~"};var tr=[R([{ChildComponent:Qo,isActive:({selection:e})=>Xl(e)?e.hasFormat("strikethrough"):!1,key:"strikethrough",onSelect:({editor:e})=>{e.dispatchCommand(Yl,"strikethrough")},order:4}])],ql=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,markdownTransformers:[er],toolbarFixed:{groups:tr},toolbarInline:{groups:tr}})}),Ql=h(ql);import{$isRangeSelection as es,FORMAT_TEXT_COMMAND as ts}from"lexical";import{jsx as or}from"react/jsx-runtime";var rr=()=>or("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:or("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 13.258C16.7768 14.155 16.1398 14.532 15.2038 15C14.5538 15.325 14.2808 15.546 14.2418 15.78H16.7898V16.82H12.7208V16.339C12.7208 15.286 13.5918 14.675 14.3588 14.233C15.0868 13.83 15.4378 13.635 15.4378 13.232C15.4378 12.894 15.2038 12.686 14.8268 12.686C14.3848 12.686 14.1248 13.024 14.1118 13.427H12.7468C12.8248 12.426 13.5528 11.633 14.8398 11.633C15.9448 11.633 16.7768 12.257 16.7768 13.258Z",fill:"currentColor"})});var nr=[R([{ChildComponent:rr,isActive:({selection:e})=>es(e)?e.hasFormat("subscript"):!1,key:"subscript",onSelect:({editor:e})=>{e.dispatchCommand(ts,"subscript")},order:5}])],os=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,toolbarFixed:{groups:nr},toolbarInline:{groups:nr}})}),rs=h(os);import{$isRangeSelection as ns,FORMAT_TEXT_COMMAND as is}from"lexical";import{jsx as ir}from"react/jsx-runtime";var lr=()=>ir("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ir("path",{d:"M10.167 15L7.45002 11.36L4.73302 15H2.91302L6.55302 10.177L3.23802 5.718H5.20102L7.54102 8.89L9.89402 5.718H11.714L8.43802 10.06L12.13 15H10.167ZM16.7768 7.252C16.7768 8.149 16.1398 8.526 15.2038 8.994C14.5538 9.319 14.2808 9.54 14.2418 9.774H16.7898V10.814H12.7208V10.333C12.7208 9.28 13.5918 8.669 14.3588 8.227C15.0868 7.824 15.4378 7.629 15.4378 7.226C15.4378 6.888 15.2038 6.68 14.8268 6.68C14.3848 6.68 14.1248 7.018 14.1118 7.421H12.7468C12.8248 6.42 13.5528 5.627 14.8398 5.627C15.9448 5.627 16.7768 6.251 16.7768 7.252Z",fill:"currentColor"})});var sr=[R([{ChildComponent:lr,isActive:({selection:e})=>ns(e)?e.hasFormat("superscript"):!1,key:"superscript",onSelect:({editor:e})=>{e.dispatchCommand(is,"superscript")},order:6}])],ls=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,toolbarFixed:{groups:sr},toolbarInline:{groups:sr}})}),ss=h(ls);import{$isRangeSelection as cs,FORMAT_TEXT_COMMAND as ds}from"lexical";import{jsx as ar,jsxs as as}from"react/jsx-runtime";var cr=()=>as("svg",{"aria-hidden":"true",className:"icon",fill:"currentColor",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ar("path",{d:"M13.9656 11.256C13.9656 13.791 12.5096 15.156 10.0006 15.156C7.50461 15.156 6.03561 13.791 6.03561 11.23V5.718H7.76461V11.243C7.76461 12.868 8.50561 13.778 10.0006 13.778C11.4956 13.778 12.2496 12.868 12.2496 11.243V5.718H13.9656V11.256Z",fill:"currentColor"}),ar("path",{d:"M5.09961 16.3H14.9016V16.95H5.09961V16.3Z",fill:"currentColor"})]});var dr=[R([{ChildComponent:cr,isActive:({selection:e})=>cs(e)?e.hasFormat("underline"):!1,key:"underline",onSelect:({editor:e})=>{e.dispatchCommand(ds,"underline")},order:3}])],us=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,toolbarFixed:{groups:dr},toolbarInline:{groups:dr}})}),ps=h(us);import{$createHeadingNode as gs,$isHeadingNode as kr,HeadingNode as hs}from"@lexical/rich-text";import{$setBlocksType as xs}from"@lexical/selection";import{$getSelection as Ts,$isRangeSelection as ys}from"lexical";import{jsx as ur}from"react/jsx-runtime";var pr=()=>ur("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:ur("path",{d:"M4.639 13.5V7.074H6.196V9.648H9.076V7.074H10.642V13.5H9.076V10.836H6.196V13.5H4.639ZM11.5656 9.045V8.019C12.6636 8.019 13.1316 7.731 13.2846 7.065H14.4006V13.5H12.8436V9.045H11.5656Z",fill:"currentColor"})});import{jsx as mr}from"react/jsx-runtime";var fr=()=>mr("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:mr("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM15.9796 8.973C15.9796 10.116 15.1696 10.656 14.0356 11.232C13.2256 11.646 12.8206 11.943 12.7846 12.294H15.9886V13.5H11.0566V12.951C11.0566 11.601 12.1636 10.845 13.1176 10.287C14.0356 9.756 14.5126 9.486 14.5126 8.946C14.5126 8.46 14.2156 8.145 13.6306 8.145C13.0186 8.145 12.6586 8.613 12.6226 9.198H11.1196C11.2186 7.947 12.1006 6.966 13.6396 6.966C15.0346 6.966 15.9796 7.785 15.9796 8.973Z",fill:"currentColor"})});import{jsx as Cr}from"react/jsx-runtime";var gr=()=>Cr("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Cr("path",{d:"M4.139 13.5V7.074H5.696V9.648H8.576V7.074H10.142V13.5H8.576V10.836H5.696V13.5H4.139ZM16.1146 11.745C16.1146 12.744 15.2236 13.608 13.6126 13.608C12.0736 13.608 11.0926 12.762 10.9846 11.547H12.4696C12.5146 12.114 13.0006 12.456 13.6126 12.456C14.2876 12.456 14.6746 12.132 14.6746 11.619C14.6746 11.061 14.2426 10.836 13.6216 10.836H12.9826V9.738H13.6036C14.1526 9.738 14.5486 9.486 14.5486 8.937C14.5486 8.46 14.2156 8.127 13.6486 8.127C13.0366 8.127 12.6586 8.514 12.6226 9.045H11.1916C11.2726 7.929 12.1276 6.966 13.6666 6.966C15.1876 6.966 15.9706 7.848 15.9706 8.865C15.9706 9.603 15.5026 10.143 14.8186 10.269C15.6196 10.404 16.1146 10.971 16.1146 11.745Z",fill:"currentColor"})});import{jsx as hr}from"react/jsx-runtime";var xr=()=>hr("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:hr("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM15.1736 7.074V10.854H16.3706V12.033H15.1736V13.5H13.6796V12.033H10.5116V10.845L13.4996 7.074H15.1736ZM13.6796 8.46L11.8256 10.854H13.6796V8.46Z",fill:"currentColor"})});import{jsx as Tr}from"react/jsx-runtime";var yr=()=>Tr("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Tr("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.1576 10.269C12.6896 10.269 12.3746 10.494 12.2216 10.737H10.8176L11.1956 7.074H15.2546V8.28H12.3206L12.1856 9.549C12.4016 9.351 12.8516 9.126 13.4636 9.126C14.7866 9.126 15.6596 10.053 15.6596 11.358C15.6596 12.609 14.7326 13.608 13.1756 13.608C11.5826 13.608 10.6556 12.753 10.5566 11.511H12.1136C12.1586 12.06 12.5456 12.465 13.1576 12.465C13.8236 12.465 14.1746 11.97 14.1746 11.376C14.1746 10.764 13.8416 10.269 13.1576 10.269Z",fill:"currentColor"})});import{jsx as Lr}from"react/jsx-runtime";var br=()=>Lr("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Lr("path",{d:"M3.639 13.5V7.074H5.196V9.648H8.076V7.074H9.642V13.5H8.076V10.836H5.196V13.5H3.639ZM13.3646 8.127C12.5456 8.127 12.0416 8.937 12.0416 9.999C12.3296 9.54 12.8246 9.207 13.5536 9.207C14.8586 9.207 15.8036 10.134 15.8036 11.376C15.8036 12.645 14.8226 13.608 13.3196 13.608C11.7266 13.608 10.6196 12.393 10.6196 10.395C10.6196 8.316 11.7716 6.966 13.4186 6.966C14.7056 6.966 15.5786 7.749 15.7316 8.829H14.3186C14.2016 8.415 13.9226 8.127 13.3646 8.127ZM13.3106 12.51C13.9586 12.51 14.3816 12.042 14.3816 11.385C14.3816 10.737 13.9586 10.278 13.3106 10.278C12.6536 10.278 12.2126 10.737 12.2126 11.385C12.2126 12.042 12.6536 12.51 13.3106 12.51Z",fill:"currentColor"})});import{$createHeadingNode as ms,$isHeadingNode as fs,HeadingNode as Cs}from"@lexical/rich-text";var Lt=e=>(t,o,r)=>{let n=e(r);n&&(n.append(...o),t.replace(n),n.select(0,0))};var Er=e=>{let o=`^(${e.map(n=>Number(n.slice(1))).map(n=>`#{${n}}`).join("|")})\\s`,r=new RegExp(o);return{type:"element",dependencies:[Cs],export:(n,i)=>{if(!fs(n))return null;let l=Number(n.getTag().slice(1));return"#".repeat(l)+" "+i(n)},regExp:r,replace:Lt(n=>{let i="h"+n[1].length;return ms(i)})}};var Nr=e=>{let t=Ts();xs(t,()=>gs(e))},vr={h1:pr,h2:fr,h3:gr,h4:xr,h5:yr,h6:br},Ls=e=>({clientFeatureProps:e,feature:()=>{let{enabledHeadingSizes:t=["h1","h2","h3","h4","h5","h6"]}=e,o=[M(t.map((r,n)=>({ChildComponent:vr[r],isActive:({selection:i})=>{if(!ys(i))return!1;for(let l of i.getNodes()){if(kr(l)&&l.getTag()===r)continue;let a=l.getParent();if(!(kr(a)&&a.getTag()===r))return!1}return!0},key:r,label:({i18n:i})=>i.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:i})=>{i.update(()=>{Nr(r)})},order:n+2})))];return{clientFeatureProps:e,markdownTransformers:[Er(t)],nodes:[hs],slashMenu:{groups:t?.length?[A(t.map(r=>({Icon:vr[r],key:`heading-${r.charAt(1)}`,keywords:["heading",r],label:({i18n:n})=>n.t("lexical:heading:label",{headingLevel:r.charAt(1)}),onSelect:({editor:n})=>{n.update(()=>{Nr(r)})}})))]:[]},toolbarFixed:{groups:t?.length?o:[]},toolbarInline:{groups:t?.length?o:[]}}}}),bs=h(Ls);import{$isNodeSelection as Ss}from"lexical";import{jsx as Fr}from"react/jsx-runtime";var bt=()=>Fr("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Fr("rect",{fill:"currentColor",height:"1",width:"12",x:"4",y:"9.5"})});import{jsx as _r,jsxs as Es}from"react/jsx-runtime";var wr=()=>Es("svg",{fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[_r("path",{d:"M5 10h10",stroke:"currentColor"}),_r("path",{d:"M10 15V5",stroke:"currentColor"})]});var ee=e=>({type:"dropdown",ChildComponent:wr,items:e,key:"add",order:10});var Sr={type:"element",dependencies:[Re],export:(e,t)=>Pe(e)?"---":null,regExp:/^---\s*$/,replace:e=>{let t=Ie();t&&e.replace(t)}};import{useLexicalComposerContext as ks}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as Ns}from"@lexical/utils";import{$getSelection as vs,$isRangeSelection as Fs,COMMAND_PRIORITY_EDITOR as _s}from"lexical";import{useEffect as ws}from"react";var Rr=()=>{let[e]=ks();return ws(()=>e.registerCommand(me,t=>{let o=vs();if(!Fs(o))return!1;if(o.focus.getNode()!==null){let n=Ie();Ns(n)}return!0},_s),[e]),null};var Rs=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,markdownTransformers:[Sr],nodes:[Re],plugins:[{Component:Rr,position:"normal"}],slashMenu:{groups:[A([{Icon:bt,key:"horizontalRule",keywords:["hr","horizontal rule","line","separator"],label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(me,void 0)}}])]},toolbarFixed:{groups:[ee([{ChildComponent:bt,isActive:({selection:t})=>{if(!Ss(t)||!t.getNodes().length)return!1;let o=t.getNodes()[0];return Pe(o)},key:"horizontalRule",label:({i18n:t})=>t.t("lexical:horizontalRule:label"),onSelect:({editor:t})=>{t.dispatchCommand(me,void 0)}}])]}})}),Is=h(Rs);import{INDENT_CONTENT_COMMAND as As,OUTDENT_CONTENT_COMMAND as Ds}from"lexical";import{jsx as Ke,jsxs as Ps}from"react/jsx-runtime";var Ir=()=>Ps("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Ke("path",{d:"M2.5 5H10.5",stroke:"currentColor",strokeWidth:"1.5"}),Ke("path",{d:"M2.5 10H10.5",stroke:"currentColor",strokeWidth:"1.5"}),Ke("path",{d:"M2.5 15H17.5",stroke:"currentColor",strokeWidth:"1.5"}),Ke("path",{d:"M12.25 7.25L17.25 3.75V10.75L12.25 7.25Z",fill:"currentColor"})]});import{jsx as ze,jsxs as Ms}from"react/jsx-runtime";var Pr=()=>Ms("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ze("path",{d:"M17.5 5H9.5",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M17.5 10H9.5",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M17.5 15H2.5",stroke:"currentColor",strokeWidth:"1.5"}),ze("path",{d:"M7.75 7.25L2.75 3.75V10.75L7.75 7.25Z",fill:"currentColor"})]});var Mr=e=>({type:"buttons",items:e,key:"indent",order:35});var Ar=[Mr([{ChildComponent:Ir,isActive:()=>!1,isEnabled:({selection:e})=>{if(!e||!e?.getNodes()?.length)return!1;for(let t of e.getNodes())if("__indent"in t&&t.__indent>0||t.getParent()&&"__indent"in t.getParent()&&t.getParent().__indent>0)return!0;return!1},key:"indentDecrease",label:({i18n:e})=>e.t("lexical:indent:decreaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(Ds,void 0)},order:1},{ChildComponent:Pr,isActive:()=>!1,key:"indentIncrease",label:({i18n:e})=>e.t("lexical:indent:increaseLabel"),onSelect:({editor:e})=>{e.dispatchCommand(As,void 0)},order:2}])],Os=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,toolbarFixed:{groups:Ar},toolbarInline:{groups:Ar}})}),Hs=h(Os);import{$findMatchingParent as rc}from"@lexical/utils";import{$getSelection as Pt,$isRangeSelection as mn}from"lexical";import{jsx as Dr}from"react/jsx-runtime";var Or=()=>Dr("svg",{"aria-hidden":"true",className:"icon",fill:"none",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:Dr("path",{d:"M8.5 11.5L11.5 8.5M8.5 7L9.625 5.875C10.868 4.633 12.882 4.633 14.125 5.875C15.368 7.118 15.368 9.133 14.125 10.375L13 11.5M7 8.5L5.746 9.754C4.56 10.94 4.519 12.85 5.652 14.087C6.814 15.354 8.78 15.449 10.058 14.298L11.5 13",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})});import{$isAtNodeEnd as Hr}from"@lexical/selection";function ne(e){let{anchor:t}=e,{focus:o}=e,r=e.anchor.getNode(),n=e.focus.getNode();return r===n?r:e.isBackward()?Hr(o)?r:n:Hr(t)?r:n}var Et=e=>({type:"buttons",items:e,key:"features",order:50});import{$createTextNode as Js,$isTextNode as Xs}from"lexical";import{addClassNamesToElement as Bs,isHTMLAnchorElement as Gs}from"@lexical/utils";import vt from"bson-objectid";import{$applyNodeReplacement as $s,$createTextNode as Br,$getSelection as Us,$isElementNode as Gr,$isRangeSelection as Nt,ElementNode as Ws,createCommand as Vs}from"lexical";var Ks=new Set(["http:","https:","mailto:","sms:","tel:"]),O=class e extends Ws{__fields;__id;constructor({id:t,fields:o={doc:null,linkType:"custom",newTab:!1,url:void 0},key:r}){super(r),this.__fields=o,this.__id=t}static clone(t){return new e({id:t.__id,fields:t.__fields,key:t.__key})}static getType(){return"link"}static importDOM(){return{a:t=>({conversion:zs,priority:1})}}static importJSON(t){t.version===1&&typeof t.fields?.doc?.value=="object"&&t.fields?.doc?.value?.id&&(t.fields.doc.value=t.fields.doc.value.id,t.version=2),t.version===2&&!t.id&&(t.id=new vt.default().toHexString(),t.version=3);let o=V({id:t.id,fields:t.fields});return o.setFormat(t.format),o.setIndent(t.indent),o.setDirection(t.direction),o}canBeEmpty(){return!1}canInsertTextAfter(){return!1}canInsertTextBefore(){return!1}createDOM(t){let o=document.createElement("a");return this.__fields?.linkType==="custom"&&(o.href=this.sanitizeUrl(this.__fields.url??"")),(this.__fields?.newTab??!1)&&(o.target="_blank"),this.__fields?.newTab===!0&&this.__fields?.linkType==="custom"&&(o.rel=kt(o.rel,"add","noopener")),Bs(o,t.theme.link),o}exportJSON(){let t={...super.exportJSON(),type:this.getType(),fields:this.getFields(),version:3},o=this.getID();return o&&(t.id=o),t}extractWithChild(t,o,r){if(!Nt(o))return!1;let n=o.anchor.getNode(),i=o.focus.getNode();return this.isParentOf(n)&&this.isParentOf(i)&&o.getTextContent().length>0}getFields(){return this.getLatest().__fields}getID(){return this.getLatest().__id}insertNewAfter(t,o=!0){let r=this.getParentOrThrow().insertNewAfter(t,o);if(Gr(r)){let n=V({fields:this.__fields});return r.append(n),n}return null}isInline(){return!0}sanitizeUrl(t){try{let o=new URL(t);if(!Ks.has(o.protocol))return"about:blank"}catch{return"https://"}return t}setFields(t){let o=this.getWritable();o.__fields=t}updateDOM(t,o,r){let n=this.__fields?.url,i=this.__fields?.newTab;return n!=null&&n!==t.__fields?.url&&this.__fields?.linkType==="custom"&&(o.href=n),this.__fields?.linkType==="internal"&&t.__fields?.linkType==="custom"&&o.removeAttribute("href"),o.rel==null&&(o.rel=""),i!==t.__fields?.newTab&&(i??!1?(o.target="_blank",this.__fields?.linkType==="custom"&&(o.rel=kt(o.rel,"add","noopener"))):(o.removeAttribute("target"),o.rel=kt(o.rel,"remove","noopener"))),!1}};function zs(e){let t=null;if(Gs(e)){let o=e.textContent;o!==null&&o!==""&&(t=V({id:new vt.default().toHexString(),fields:{doc:null,linkType:"custom",newTab:e.getAttribute("target")==="_blank",url:e.getAttribute("href")??""}}))}return{node:t}}function V({id:e,fields:t}){return $s(new O({id:e??new vt.default().toHexString(),fields:t}))}function I(e){return e instanceof O}var $=Vs("TOGGLE_LINK_COMMAND");function $r(e){let t=Us();if(!Nt(t)&&!e.selectedNodes.length)return;let o=Nt(t)?t.extract():e.selectedNodes;if(e===null)o.forEach(r=>{let n=r.getParent();if(I(n)){let i=n.getChildren();for(let l=0;l<i.length;l+=1)n.insertBefore(i[l]);n.remove()}});else{if(o.length===1){let i=o[0],l=I(i)?i:js(i);if(l!==null){l.setFields(e.fields),e.text!=null&&e.text!==l.getTextContent()&&(l.append(Br(e.text)),l.getChildren().forEach(a=>{a!==l.getLastChild()&&a.remove()}));return}}let r=null,n=null;o.forEach(i=>{let l=i.getParent();if(!(l===n||l===null||Gr(i)&&!i.isInline())){if(I(l)){n=l,l.setFields(e.fields),e.text!=null&&e.text!==l.getTextContent()&&(l.append(Br(e.text)),l.getChildren().forEach(a=>{a!==l.getLastChild()&&a.remove()}));return}if(l.is(r)||(r=l,n=V({fields:e.fields}),I(l)?i.getPreviousSibling()===null?l.insertBefore(n):l.insertAfter(n):i.insertBefore(n)),I(i)){if(i.is(n))return;if(n!==null){let a=i.getChildren();for(let s=0;s<a.length;s+=1)n.append(a[s])}i.remove();return}n!==null&&n.append(i)}})}}function js(e){return Zs(e,t=>I(t))}function Zs(e,t){let o=e;for(;o!==null&&(o=o.getParent())!==null&&!t(o););return o}function kt(e,t,o){let r,n=`${e}`;if(t==="add"){if(n.includes(o)){let i=new RegExp(o,"g");n=n.replace(i,"").trim()}n=n.trim(),r=n.length===0?`${o}`:`${n} ${o}`}else{let i=new RegExp(o,"g");r=n.replace(i,"").trim()}return r}var Ur={type:"text-match",dependencies:[O],export:(e,t,o)=>{if(!I(e))return null;let r=e,{url:n}=r.getFields(),i=`[${r.getTextContent()}](${n})`,l=r.getFirstChild();return r.getChildrenSize()===1&&Xs(l)?o(l,i):i},importRegExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)/,regExp:/\[([^[]+)\]\(([^()\s]+)(?:\s"((?:[^"]*\\")*[^"]*)"\s*)?\)$/,replace:(e,t)=>{let[,o,r]=t,n=V({fields:{doc:null,linkType:"custom",newTab:!1,url:r}}),i=Js(o);i.setFormat(e.getFormat()),n.append(i),e.replace(n)},trigger:")"};import{$applyNodeReplacement as Ys,$isElementNode as qs}from"lexical";var K=class e extends O{static clone(t){return new e({id:void 0,fields:t.__fields,key:t.__key})}static getType(){return"autolink"}static importDOM(){return null}static importJSON(t){t.version===1&&typeof t.fields?.doc?.value=="object"&&t.fields?.doc?.value?.id&&(t.fields.doc.value=t.fields.doc.value.id,t.version=2);let o=je({fields:t.fields});return o.setFormat(t.format),o.setIndent(t.indent),o.setDirection(t.direction),o}exportJSON(){return{...super.exportJSON(),type:"autolink",version:2}}insertNewAfter(t,o=!0){let r=this.getParentOrThrow().insertNewAfter(t,o);if(qs(r)){let n=je({fields:this.__fields});return r.append(n),n}return null}};function je({fields:e}){return Ys(new K({id:void 0,fields:e}))}function z(e){return e instanceof K}import{useLexicalComposerContext as Qs}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as ea}from"@lexical/utils";import{$createTextNode as Wr,$getSelection as ta,$isElementNode as Kr,$isLineBreakNode as zr,$isNodeSelection as oa,$isRangeSelection as ra,$isTextNode as ye,TextNode as na}from"lexical";import{useEffect as ia}from"react";function Ft(e,t,...o){if(!e)throw new Error("Internal Lexical error: invariant() is meant to be replaced at compile time. There is no runtime version. Error: "+t)}function Vr(e,t=o=>o){return o=>{let r=e.exec(o);return r===null?null:{index:r.index,length:r[0].length,text:r[0],url:t(r[0])}}}function jr(e,t){for(let o=0;o<t.length;o++){let r=t[o](e);if(r!=null)return r}return null}var la=/[.,;\s]/;function Je(e){return la.test(e)}function Zr(e){return Je(e[e.length-1])}function wt(e){return Je(e[0])}function Jr(e){let t=e.getPreviousSibling();return Kr(t)&&(t=t.getLastDescendant()),t===null||zr(t)||ye(t)&&Zr(t.getTextContent())}function Xr(e){let t=e.getNextSibling();return Kr(t)&&(t=t.getFirstDescendant()),t===null||zr(t)||ye(t)&&wt(t.getTextContent())}function sa(e,t,o,r){return(e>0?Je(o[e-1]):Jr(r[0]))?t<o.length?Je(o[t]):Xr(r[r.length-1]):!1}function aa(e,t,o){let r=[],n=[],i=[],l=0,a=0,s=[...e];for(;s.length>0;){let c=s[0],p=c.getTextContent().length,u=a;a+p<=t?(r.push(c),l+=p):u>=o?i.push(c):n.push(c),a+=p,s.shift()}return[l,r,n,i]}function ca(e,t,o,r){let n={linkType:"custom",url:r.url,...r.fields},i=je({fields:n});if(e.length===1){let l=e[0],a;t===0?[a,l]=l.splitText(o):[,a,l]=l.splitText(t,o);let s=Wr(r.text);return s.setFormat(a.getFormat()),s.setDetail(a.getDetail()),s.setStyle(a.getStyle()),i.append(s),a.replace(i),l}else if(e.length>1){let l=e[0],a=l.getTextContent().length,s;t===0?s=l:[,s]=l.splitText(t);let c=[],d;for(let f=1;f<e.length;f++){let C=e[f],x=C.getTextContent().length,N=a,v=a+x;if(N<o)if(v<=o)c.push(C);else{let[g,L]=C.splitText(o-N);c.push(g),d=L}a+=x}let p=ta(),u=p?p.getNodes().find(ye):void 0,m=Wr(s.getTextContent());return m.setFormat(s.getFormat()),m.setDetail(s.getDetail()),m.setStyle(s.getStyle()),i.append(m,...c),u&&u===s&&(ra(p)?m.select(p.anchor.offset,p.focus.offset):oa(p)&&m.select(0,m.getTextContent().length)),s.replace(i),d}}function da(e,t,o){let r=[...e],n=r.map(s=>s.getTextContent()).join(""),i=n,l,a=0;for(;(l=jr(i,t))!=null&&l!==null;){let s=l.index,c=l.length,d=s+c;if(sa(a+s,a+d,n,r)){let[u,,m,f]=aa(r,a+s,a+d),C=a+s-u,y=a+d-u,x=ca(m,C,y,l);r=x?[x,...f]:f,o(l.url,null),a=0}else a+=d;i=i.substring(d)}}function _t(e,t,o){let r=e.getChildren(),n=r.length;for(let s=0;s<n;s++){let c=r[s];if(!ye(c)||!c.isSimpleText()){Ze(e),o(null,e.getFields()?.url??null);return}}let i=e.getTextContent(),l=jr(i,t);if(l===null||l.text!==i){Ze(e),o(null,e.getFields()?.url??null);return}if(!Jr(e)||!Xr(e)){Ze(e),o(null,e.getFields()?.url??null);return}let a=e.getFields()?.url;if(a!==l?.url){let s=e.getFields();s.url=l?.url,e.setFields(s),o(l.url,a??null)}}function ua(e,t,o){let r=e.getPreviousSibling(),n=e.getNextSibling(),i=e.getTextContent();z(r)&&!wt(i)&&(r.append(e),_t(r,t,o),o(null,r.getFields()?.url??null)),z(n)&&!Zr(i)&&(Ze(n),_t(n,t,o),o(null,n.getFields()?.url??null))}function Ze(e){let t=e.getChildren(),o=t.length;for(let r=o-1;r>=0;r--)e.insertAfter(t[r]);return e.remove(),t.map(r=>r.getLatest())}function pa(e){let t=[e],o=e.getNextSibling();for(;o!==null&&ye(o)&&o.isSimpleText()&&(t.push(o),!/\s/.test(o.getTextContent()));)o=o.getNextSibling();return t}function ma(e,t,o){ia(()=>{e.hasNodes([K])||Ft(!1,"LexicalAutoLinkPlugin: AutoLinkNode not registered on editor");let r=(n,i)=>{o?.(n,i)};return ea(e.registerNodeTransform(na,n=>{let i=n.getParentOrThrow(),l=n.getPreviousSibling();if(z(i))_t(i,t,r);else if(!I(i)){if(n.isSimpleText()&&(wt(n.getTextContent())||!z(l))){let a=pa(n);da(a,t,r)}ua(n,t,r)}}))},[e,t,o])}var fa=/((https?:\/\/(www\.)?)|(www\.))[-\w@:%.+~#=]{1,256}\.[a-zA-Z\d()]{1,6}\b([-\w()@:%+.~#?&/=]*)/,Ca=/(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\])|(([a-z\-\d]+\.)+[a-z]{2,}))/i,ga=[Vr(fa,e=>e.startsWith("http")?e:`https://${e}`),Vr(Ca,e=>`mailto:${e}`)],Yr=()=>{let[e]=Qs();return ma(e,ga),null};import{ClickableLinkPlugin as ha}from"@lexical/react/LexicalClickableLinkPlugin.js";import{jsx as xa}from"react/jsx-runtime";var qr=()=>xa(ha,{});import{createCommand as Ta}from"lexical";var Xe=Ta("TOGGLE_LINK_WITH_MODAL_COMMAND");import{createPortal as za}from"react-dom";import{useLexicalComposerContext as Ma}from"@lexical/react/LexicalComposerContext.js";import{$findMatchingParent as tn,mergeRegister as on}from"@lexical/utils";import{getTranslation as Aa}from"@payloadcms/translations";import{formatDrawerSlug as Da,useConfig as Oa,useEditDepth as Ha,useModal as Ba,useTranslation as Ga}from"@payloadcms/ui/client";import{$getSelection as rn,$isLineBreakNode as $a,$isRangeSelection as nn,COMMAND_PRIORITY_HIGH as Ua,COMMAND_PRIORITY_LOW as ln,KEY_ESCAPE_COMMAND as Wa,SELECTION_CHANGE_COMMAND as Va}from"lexical";import sn,{useCallback as an,useEffect as qe,useRef as Ka,useState as ie}from"react";function Ye(e,t,o,r=10,n=5){let i=o.parentElement;if(e===null||i==null){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let l=t.getBoundingClientRect(),a=o.getBoundingClientRect(),s=i.getBoundingClientRect(),c=e.top-r,d=e.left-n;c<s.top&&(c+=l.height+e.height+r*2),d+l.width>s.right&&(d=s.right-l.width-n),c-=a.top,d-=a.left,t.style.opacity="1",t.style.transform=`translate(${d}px, ${c}px)`}import{Drawer as ya,Form as La,FormSubmit as ba,RenderFields as Ea,useConfig as ka,useDocumentInfo as Na,useFieldProps as va,useTranslation as Fa}from"@payloadcms/ui/client";import{getFormState as Qr}from"@payloadcms/ui/shared";import{useCallback as _a,useEffect as wa,useState as Sa}from"react";import{v4 as Ra}from"uuid";import{jsx as St,jsxs as Pa}from"react/jsx-runtime";var Ia="lexical-link-edit-drawer",en=({drawerSlug:e,handleModalSubmit:t,stateData:o})=>{let{t:r}=Fa(),{id:n}=Na(),{schemaPath:i}=va(),l=ka(),[a,s]=Sa(!1),{field:{richTextComponentMap:c}}=S(),d="feature.link.fields.fields",p=`${i}.feature.link.fields`,u=c.get(d);wa(()=>{o&&(async()=>{let C=await Qr({apiRoute:l.routes.api,body:{id:n,data:o,operation:"update",schemaPath:p},serverURL:l.serverURL});s(C)})()},[l.routes.api,l.serverURL,p,n,o]);let m=_a(async({formState:f})=>await Qr({apiRoute:l.routes.api,body:{id:n,formState:f,operation:"update",schemaPath:p},serverURL:l.serverURL}),[l.routes.api,l.serverURL,p,n]);return St(ya,{className:Ia,slug:e,title:r("fields:editLink")??"",children:a!==!1&&Pa(La,{beforeSubmit:[m],disableValidationOnSubmit:!0,fields:Array.isArray(u)?u:[],initialState:a,onChange:[m],onSubmit:t,uuid:Ra(),children:[St(Ea,{fieldMap:Array.isArray(u)?u:[],forceRender:!0,path:"",readOnly:!1,schemaPath:p}),St(ba,{children:r("general:submit")})]})})};import{jsx as le,jsxs as Rt}from"react/jsx-runtime";function cn({anchorElem:e}){let[t]=Ma(),o=Ka(null),[r,n]=ie(null),[i,l]=ie(null),{uuid:a}=S(),s=Oa(),{i18n:c,t:d}=Ga(),[p,u]=ie({}),{closeModal:m,isModalOpen:f,toggleModal:C}=Ba(),y=Ha(),[x,N]=ie(!1),[v,g]=ie([]),[L,E]=ie(!1),b=Da({slug:"lexical-rich-text-link-"+a,depth:y}),w=an(()=>{N(!1),o&&o.current&&(o.current.style.opacity="0",o.current.style.transform="translate(-10000px, -10000px)"),E(!1),n(null),l(null),g([]),u({})},[N,n,l,g]),P=an(()=>{let k=rn(),_=null;if(!nn(k)||!k){w();return}let G=ne(k);_=t.getElementByKey(G.getKey())?.getBoundingClientRect();let F=tn(G,I),Se=k.getNodes().filter(re=>!$a(re)).find(re=>{let J=tn(re,I);return F&&!F.is(J)||J&&!J.is(F)});if(F==null||Se){w();return}let Z={doc:void 0,linkType:void 0,newTab:void 0,url:"",...F.getFields(),id:F.getID(),text:F.getTextContent()};if(F.getFields()?.linkType==="custom")n(F.getFields()?.url??null),l(null);else{n(`/admin/collections/${F.getFields()?.doc?.relationTo}/${F.getFields()?.doc?.value}`);let re=s.collections.find(J=>J.slug===F.getFields()?.doc?.relationTo);if(!re)l(F.getFields()?.label?String(F.getFields()?.label):null),n(F.getFields()?.url?String(F.getFields()?.url):null);else{let J=d("fields:linkedTo",{label:Aa(re.labels.singular,c)}).replace(/<[^>]*>?/g,"");l(J)}}u(Z),N(!0),g(k?k?.getNodes():[]),z(F)?E(!0):E(!1);let pe=o.current,at=window.getSelection(),{activeElement:to}=document;if(pe===null)return;let ct=t.getRootElement();return at!==null&&ct!==null&&ct.contains(at.anchorNode)?(_||(_=at.getRangeAt(0).getBoundingClientRect()),_!=null&&(_.y+=40,Ye(_,pe,e))):(to==null||to.className!=="link-input")&&(ct!==null&&Ye(null,pe,e),n(null),l(null)),!0},[t,w,s.collections,d,c,e]);return qe(()=>on(t.registerCommand(Xe,k=>(t.dispatchCommand($,k),P(),C(b),!0),ln)),[t,P,C,b]),qe(()=>{let k=e.parentElement,_=()=>{t.getEditorState().read(()=>{P()})};return window.addEventListener("resize",_),k?.addEventListener("scroll",_),()=>{window.removeEventListener("resize",_),k?.removeEventListener("scroll",_)}},[e.parentElement,t,P]),qe(()=>on(t.registerUpdateListener(({editorState:k})=>{k.read(()=>{P()})}),t.registerCommand(Va,()=>(P(),!0),ln),t.registerCommand(Wa,()=>x?(w(),!0):!1,Ua)),[t,P,x,w]),qe(()=>{t.getEditorState().read(()=>{P()})},[t,P]),Rt(sn.Fragment,{children:[le("div",{className:"link-editor",ref:o,children:Rt("div",{className:"link-input",children:[r&&r.length>0?le("a",{href:r,rel:"noopener noreferrer",target:"_blank",children:i!=null&&i.length>0?i:r}):i!=null&&i.length>0?le("span",{className:"link-input__label-pure",children:i}):null,t.isEditable()&&Rt(sn.Fragment,{children:[le("button",{"aria-label":"Edit link",className:"link-edit",onClick:()=>{C(b)},onMouseDown:k=>{k.preventDefault()},tabIndex:0,type:"button"}),!L&&le("button",{"aria-label":"Remove link",className:"link-trash",onClick:()=>{t.dispatchCommand($,null)},onMouseDown:k=>{k.preventDefault()},tabIndex:0,type:"button"})]})]})}),f(b)&&le(en,{drawerSlug:b,handleModalSubmit:(k,_)=>{m(b);let G=_,F={...G};delete F.text,t.update(()=>{let Se=rn(),Z=null;if(nn(Se)?Z=ne(Se).getParent():v.length&&(Z=v[0].getParent()),Z&&z(Z)){let pe=V({fields:F});Z.replace(pe,!0)}}),t.dispatchCommand($,{fields:F,selectedNodes:v,text:G.text})},stateData:p})]})}import{jsx as ja}from"react/jsx-runtime";var dn=e=>{let{anchorElem:t=document.body}=e;return za(ja(cn,{anchorElem:t}),t)};import{useLexicalComposerContext as Xa}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as Ya}from"@lexical/utils";import{$getSelection as qa,$isElementNode as Qa,$isRangeSelection as ec,COMMAND_PRIORITY_LOW as un,PASTE_COMMAND as tc}from"lexical";import{useEffect as oc}from"react";var Za=/(?:[A-Za-z]{3,9}:(?:\/\/)?(?:[-;:&=+$,\w]+@)?[A-Za-z\d.-]+|(?:www.|[-;:&=+$,\w]+@)[A-Za-z\d.-]+)(?:\/[+~%/.\w-]*)?\??[-+=&;%@.\w]*#?\w*/,Ja=/^[\w\-./]*(?:#\w[\w-]*)?$/;function It(e){if(!e)return!1;if(e==="https://"||Za.test(e)||Ja.test(e))return!0;try{return new URL(e),!0}catch{}return!1}var pn=()=>{let[e]=Xa();return oc(()=>{if(!e.hasNodes([O]))throw new Error("LinkPlugin: LinkNode not registered on editor");return Ya(e.registerCommand($,t=>($r(t),!0),un),It!==void 0?e.registerCommand(tc,t=>{let o=qa();if(!ec(o)||o.isCollapsed()||!(t instanceof ClipboardEvent)||t.clipboardData==null)return!1;let r=t.clipboardData.getData("text");if(!It(r))return!1;if(!o.getNodes().some(n=>Qa(n))){let n={doc:null,linkType:"custom",newTab:!1,url:r};return e.dispatchCommand($,{fields:n,text:null}),t.preventDefault(),!0}return!1},un):()=>{})},[e]),null};var fn=[Et([{ChildComponent:Or,isActive:({selection:e})=>{if(mn(e)){let t=ne(e);return rc(t,I)!=null}return!1},isEnabled:({selection:e})=>!!(mn(e)&&Pt()?.getTextContent()?.length),key:"link",label:({i18n:e})=>e.t("lexical:link:label"),onSelect:({editor:e,isActive:t})=>{if(t)e.dispatchCommand($,null);else{let o=null,r=[];if(e.getEditorState().read(()=>{o=Pt()?.getTextContent(),r=Pt()?.getNodes()??[]}),!o?.length)return;let n={doc:null,linkType:"custom",newTab:!1,url:"https://"};e.dispatchCommand(Xe,{fields:n,selectedNodes:r,text:o})}},order:1}])],nc=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,markdownTransformers:[Ur],nodes:[O,K],plugins:[{Component:pn,position:"normal"},{Component:Yr,position:"normal"},{Component:qr,position:"normal"},{Component:dn,position:"floatingAnchorElem"}],toolbarFixed:{groups:fn},toolbarInline:{groups:fn}})}),ic=h(nc);import{$isListNode as Dt,INSERT_CHECK_LIST_COMMAND as yn,ListItemNode as hc,ListNode as xc}from"@lexical/list";import{$isRangeSelection as Tc}from"lexical";import{jsx as Cn,jsxs as lc}from"react/jsx-runtime";var Mt=()=>lc("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Cn("rect",{height:"13",rx:"1.5",stroke:"currentColor",width:"13",x:"3.5",y:"3.5"}),Cn("path",{d:"M7 10L9 12.5L13 7.5",stroke:"currentColor",strokeWidth:"1.5"})]});import{ListPlugin as sc}from"@lexical/react/LexicalListPlugin.js";import{jsx as ac}from"react/jsx-runtime";var se=()=>ac(sc,{});function ae(e){return{items:e,key:"lists",label:({i18n:t})=>t.t("lexical:general:slashMenuListGroupLabel")}}import{$isListNode as pc,ListItemNode as mc,ListNode as fc}from"@lexical/list";import{$createListItemNode as cc,$createListNode as dc,$isListItemNode as uc,$isListNode as At}from"@lexical/list";var gn=4,ce=e=>(t,o,r)=>{let n=t.getPreviousSibling(),i=t.getNextSibling(),l=cc(e==="check"?r[3]==="x":void 0);if(At(i)&&i.getListType()===e){let s=i.getFirstChild();s!==null?s.insertBefore(l):i.append(l),t.remove()}else if(At(n)&&n.getListType()===e)n.append(l),t.remove();else{let s=dc(e,e==="number"?Number(r[2]):void 0);s.append(l),t.replace(s)}l.append(...o),l.select(0,0);let a=Math.floor(r[1].length/gn);a&&l.setIndent(a)},te=(e,t,o)=>{let r=[],n=e.getChildren(),i=0;for(let l of n)if(uc(l)){if(l.getChildrenSize()===1){let d=l.getFirstChild();if(At(d)){r.push(te(d,t,o+1));continue}}let a=" ".repeat(o*gn),s=e.getListType(),c=s==="number"?`${e.getStart()+i}. `:s==="check"?`- [${l.getChecked()?"x":" "}] `:"- ";r.push(a+c+t(l)),i++}return r.join(`
35
+ `)};var hn={type:"element",dependencies:[fc,mc],export:(e,t)=>pc(e)?te(e,t,0):null,regExp:/^(\s*)(?:-\s)?\s?(\[(\s|x)?\])\s/i,replace:ce("check")};import{CheckListPlugin as Cc}from"@lexical/react/LexicalCheckListPlugin.js";import{jsx as gc}from"react/jsx-runtime";var xn=()=>gc(Cc,{});var Tn=[M([{ChildComponent:Mt,isActive:({selection:e})=>{if(!Tc(e))return!1;for(let t of e.getNodes()){if(Dt(t)&&t.getListType()==="check")continue;let o=t.getParent();if(Dt(o)&&o.getListType()==="check")continue;let r=o?.getParent();if(!(Dt(r)&&r.getListType()==="check"))return!1}return!0},key:"checklist",label:({i18n:e})=>e.t("lexical:checklist:label"),onSelect:({editor:e})=>{e.dispatchCommand(yn,void 0)},order:12}])],yc=e=>({clientFeatureProps:e,feature:({featureProviderMap:t})=>{let o=[{Component:xn,position:"normal"}];return!t.has("unorderedList")&&!t.has("orderedList")&&o.push({Component:se,position:"normal"}),{clientFeatureProps:e,markdownTransformers:[hn],nodes:t.has("unorderedList")||t.has("orderedList")?[]:[xc,hc],plugins:o,slashMenu:{groups:[ae([{Icon:Mt,key:"checklist",keywords:["check list","check","checklist","cl"],label:({i18n:r})=>r.t("lexical:checklist:label"),onSelect:({editor:r})=>{r.dispatchCommand(yn,void 0)}}])]},toolbarFixed:{groups:Tn},toolbarInline:{groups:Tn}}}}),Lc=h(yc);import{$isListNode as Ht,INSERT_ORDERED_LIST_COMMAND as En,ListItemNode as vc,ListNode as Fc}from"@lexical/list";import{$isRangeSelection as _c}from"lexical";import{jsx as Le,jsxs as bc}from"react/jsx-runtime";var Ot=()=>bc("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Le("path",{d:"M5.89284 12.479C5.89284 13.368 5.26284 13.788 4.38084 14.236C3.75084 14.558 3.43584 14.789 3.40784 15.062H5.89984V16H2.06384V15.573C2.06384 14.523 2.92484 13.935 3.66684 13.501C4.38084 13.088 4.75184 12.878 4.75184 12.458C4.75184 12.08 4.52084 11.835 4.06584 11.835C3.58984 11.835 3.30984 12.199 3.28184 12.654H2.11284C2.18984 11.681 2.87584 10.918 4.07284 10.918C5.15784 10.918 5.89284 11.555 5.89284 12.479Z",fill:"currentColor"}),Le("path",{d:"M2.68608 4.535V3.737C3.54008 3.737 3.90408 3.513 4.02308 2.995H4.89108V8H3.68008L3.68008 4.535H2.68608Z",fill:"currentColor"}),Le("path",{d:"M8 15L17 15",stroke:"currentColor",strokeWidth:"1.5"}),Le("path",{d:"M8 10L17 10",stroke:"currentColor",strokeWidth:"1.5"}),Le("path",{d:"M8 5L17 5",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as Ec,ListItemNode as kc,ListNode as Nc}from"@lexical/list";var Ln={type:"element",dependencies:[Nc,kc],export:(e,t)=>Ec(e)?te(e,t,0):null,regExp:/^(\s*)(\d+)\.\s/,replace:ce("number")};var bn=[M([{ChildComponent:Ot,isActive:({selection:e})=>{if(!_c(e))return!1;for(let t of e.getNodes()){if(Ht(t)&&t.getListType()==="number")continue;let o=t.getParent();if(Ht(o)&&o.getListType()==="number")continue;let r=o?.getParent();if(!(Ht(r)&&r.getListType()==="number"))return!1}return!0},key:"orderedList",label:({i18n:e})=>e.t("lexical:orderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(En,void 0)},order:10}])],wc=e=>({clientFeatureProps:e,feature:({featureProviderMap:t})=>({clientFeatureProps:e,markdownTransformers:[Ln],nodes:t.has("orderedList")?[]:[Fc,vc],plugins:t.has("orderedList")?[]:[{Component:se,position:"normal"}],slashMenu:{groups:[ae([{Icon:Ot,key:"orderedList",keywords:["ordered list","ol"],label:({i18n:o})=>o.t("lexical:orderedList:label"),onSelect:({editor:o})=>{o.dispatchCommand(En,void 0)}}])]},toolbarFixed:{groups:bn},toolbarInline:{groups:bn}})}),Sc=h(wc);import{$isListNode as Gt,INSERT_UNORDERED_LIST_COMMAND as vn,ListItemNode as Ac,ListNode as Dc}from"@lexical/list";import{$isRangeSelection as Oc}from"lexical";import{jsx as de,jsxs as Rc}from"react/jsx-runtime";var Bt=()=>Rc("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[de("circle",{cx:"4",cy:"5",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),de("circle",{cx:"4",cy:"10",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),de("circle",{cx:"4",cy:"15",fill:"currentColor",r:"1.15",stroke:"currentColor",strokeWidth:"0.3"}),de("path",{d:"M17 5H7",stroke:"currentColor",strokeWidth:"1.5"}),de("path",{d:"M17 10H7",stroke:"currentColor",strokeWidth:"1.5"}),de("path",{d:"M17 15H7",stroke:"currentColor",strokeWidth:"1.5"})]});import{$isListNode as Ic,ListItemNode as Pc,ListNode as Mc}from"@lexical/list";var kn={type:"element",dependencies:[Mc,Pc],export:(e,t)=>Ic(e)?te(e,t,0):null,regExp:/^(\s*)[-*+]\s/,replace:ce("bullet")};var Nn=[M([{ChildComponent:Bt,isActive:({selection:e})=>{if(!Oc(e))return!1;for(let t of e.getNodes()){if(Gt(t)&&t.getListType()==="bullet")continue;let o=t.getParent();if(Gt(o)&&o.getListType()==="bullet")continue;let r=o?.getParent();if(!(Gt(r)&&r.getListType()==="bullet"))return!1}return!0},key:"unorderedList",label:({i18n:e})=>e.t("lexical:unorderedList:label"),onSelect:({editor:e})=>{e.dispatchCommand(vn,void 0)},order:11}])],Hc=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,markdownTransformers:[kn],nodes:[Dc,Ac],plugins:[{Component:se,position:"normal"}],slashMenu:{groups:[ae([{Icon:Bt,key:"unorderedList",keywords:["unordered list","ul"],label:({i18n:t})=>t.t("lexical:unorderedList:label"),onSelect:({editor:t})=>{t.dispatchCommand(vn,void 0)}}])]},toolbarFixed:{groups:Nn},toolbarInline:{groups:Nn}})}),Bc=h(Hc);function Fn({converters:e,lexicalPluginData:t}){return{root:{type:"root",children:_n({converters:e,lexicalPluginNodes:t?.jsonContent?.root?.children||[],parentNodeType:"root"}),direction:t?.jsonContent?.root?.direction||"ltr",format:t?.jsonContent?.root?.format||"",indent:t?.jsonContent?.root?.indent||0,version:1}}}function _n({converters:e,lexicalPluginNodes:t,parentNodeType:o}){if(!t?.length)return[];let r=e.find(n=>n.nodeTypes.includes("unknown"));return t.map((n,i)=>{if(n.type==="paragraph")return Gc(e,n);if(n.type==="text"||!n.type)return n;let l=e.find(a=>a.nodeTypes.includes(n.type));return l?l.converter({childIndex:i,converters:e,lexicalPluginNode:n,parentNodeType:o}):(console.warn("lexicalPluginToLexical > No converter found for node type: "+n.type),r?.converter({childIndex:i,converters:e,lexicalPluginNode:n,parentNodeType:o}))})||[]}function Gc(e,t){return{...t,type:"paragraph",children:_n({converters:e,lexicalPluginNodes:t.children||[],parentNodeType:"paragraph"}),version:1}}import{addClassNamesToElement as $c}from"@lexical/utils";import{DecoratorNode as Uc}from"lexical";import*as wn from"react";import{jsx as Kc}from"react/jsx-runtime";var Wc=wn.lazy(()=>import("./Component-SZVAYRJX.js").then(e=>({default:e.UnknownConvertedNodeComponent}))),be=class e extends Uc{__data;constructor({data:t,key:o}){super(o),this.__data=t}static clone(t){return new e({data:t.__data,key:t.__key})}static getType(){return"unknownConverted"}static importJSON(t){return Vc({data:t.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(t){let o=document.createElement("span");return $c(o,"unknownConverted"),o}decorate(){return Kc(Wc,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(t,o){return!1}};function Vc({data:e}){return new be({data:e})}var zc=e=>({clientFeatureProps:e,feature:({clientFunctions:t,resolvedFeatures:o})=>{let r=Object.values(t);return{clientFeatureProps:e,hooks:{load({incomingEditorState:n}){return!n||!("jsonContent"in n)?n:Fn({converters:r,lexicalPluginData:n})}},nodes:[be]}}}),jc=h(zc);var T={DOM_ELEMENT_TYPE:1,DOM_TEXT_TYPE:3,NO_DIRTY_NODES:0,HAS_DIRTY_NODES:1,FULL_RECONCILE:2,IS_NORMAL:0,IS_TOKEN:1,IS_SEGMENTED:2,IS_INERT:3,IS_BOLD:1,IS_ITALIC:2,IS_STRIKETHROUGH:4,IS_UNDERLINE:8,IS_CODE:16,IS_SUBSCRIPT:32,IS_SUPERSCRIPT:64,IS_HIGHLIGHT:128,IS_DIRECTIONLESS:1,IS_UNMERGEABLE:2,IS_ALIGN_LEFT:1,IS_ALIGN_CENTER:2,IS_ALIGN_RIGHT:3,IS_ALIGN_JUSTIFY:4,IS_ALIGN_START:5,IS_ALIGN_END:6},qh=T.IS_BOLD|T.IS_ITALIC|T.IS_STRIKETHROUGH|T.IS_UNDERLINE|T.IS_CODE|T.IS_SUBSCRIPT|T.IS_SUPERSCRIPT|T.IS_HIGHLIGHT;var Sn="\u0591-\u07FF\uFB1D-\uFDFD\uFE70-\uFEFC",Rn="A-Za-z\xC0-\xD6\xD8-\xF6\xF8-\u02B8\u0300-\u0590\u0800-\u1FFF\u200E\u2C00-\uFB1C\uFE00-\uFE6F\uFEFD-\uFFFF",Qh=new RegExp("^[^"+Rn+"]*["+Sn+"]"),ex=new RegExp("^[^"+Sn+"]*["+Rn+"]"),tx={bold:T.IS_BOLD,code:T.IS_CODE,highlight:T.IS_HIGHLIGHT,italic:T.IS_ITALIC,strikethrough:T.IS_STRIKETHROUGH,subscript:T.IS_SUBSCRIPT,superscript:T.IS_SUPERSCRIPT,underline:T.IS_UNDERLINE},ox={directionless:T.IS_DIRECTIONLESS,unmergeable:T.IS_UNMERGEABLE},rx={center:T.IS_ALIGN_CENTER,end:T.IS_ALIGN_END,justify:T.IS_ALIGN_JUSTIFY,left:T.IS_ALIGN_LEFT,right:T.IS_ALIGN_RIGHT,start:T.IS_ALIGN_START},nx={[T.IS_ALIGN_CENTER]:"center",[T.IS_ALIGN_END]:"end",[T.IS_ALIGN_JUSTIFY]:"justify",[T.IS_ALIGN_LEFT]:"left",[T.IS_ALIGN_RIGHT]:"right",[T.IS_ALIGN_START]:"start"},ix={normal:T.IS_NORMAL,segmented:T.IS_SEGMENTED,token:T.IS_TOKEN},lx={[T.IS_NORMAL]:"normal",[T.IS_SEGMENTED]:"segmented",[T.IS_TOKEN]:"token"};function Pn({converters:e,slateData:t}){return{root:{type:"root",children:Mn({canContainParagraphs:!0,converters:e,parentNodeType:"root",slateNodes:t}),direction:"ltr",format:"",indent:0,version:1}}}function Mn({canContainParagraphs:e,converters:t,parentNodeType:o,slateNodes:r}){if(!t?.length)return[];let n=t.find(i=>i.nodeTypes.includes("unknown"));return r.map((i,l)=>{if(!("type"in i))return e?In(t,i):Zc(i);if(i.type==="p")return In(t,i);let a=t.find(s=>s.nodeTypes.includes(i.type));return a?a.converter({childIndex:l,converters:t,parentNodeType:o,slateNode:i}):(console.warn("slateToLexical > No converter found for node type: "+i.type),n?.converter({childIndex:l,converters:t,parentNodeType:o,slateNode:i}))})||[]}function In(e,t){return{type:"paragraph",children:Mn({canContainParagraphs:!1,converters:e,parentNodeType:"paragraph",slateNodes:t.children||[]}),direction:"ltr",format:"",indent:0,textFormat:0,version:1}}function Zc(e){return{type:"text",detail:0,format:Jc(e),mode:"normal",style:"",text:e.text,version:1}}function Jc(e){let t=0;return e.bold&&(t=t|T.IS_BOLD),e.italic&&(t=t|T.IS_ITALIC),e.strikethrough&&(t=t|T.IS_STRIKETHROUGH),e.underline&&(t=t|T.IS_UNDERLINE),e.subscript&&(t=t|T.IS_SUBSCRIPT),e.superscript&&(t=t|T.IS_SUPERSCRIPT),e.code&&(t=t|T.IS_CODE),t}import{addClassNamesToElement as Xc}from"@lexical/utils";import{DecoratorNode as Yc}from"lexical";import*as An from"react";import{jsx as ed}from"react/jsx-runtime";var qc=An.lazy(()=>import("./Component-6AVANNNR.js").then(e=>({default:e.UnknownConvertedNodeComponent}))),Ee=class e extends Yc{__data;constructor({data:t,key:o}){super(o),this.__data=t}static clone(t){return new e({data:t.__data,key:t.__key})}static getType(){return"unknownConverted"}static importJSON(t){return Qc({data:t.data})}canInsertTextAfter(){return!0}canInsertTextBefore(){return!0}createDOM(t){let o=document.createElement("span");return Xc(o,"unknownConverted"),o}decorate(){return ed(qc,{data:this.__data})}exportJSON(){return{type:this.getType(),data:this.__data,version:1}}isInline(){return!0}updateDOM(t,o){return!1}};function Qc({data:e}){return new Ee({data:e})}var td=e=>({clientFeatureProps:e,feature:({clientFunctions:t})=>{let o=Object.values(t);return{clientFeatureProps:e,hooks:{load({incomingEditorState:r}){return!r||!Array.isArray(r)||"root"in r?r:Pn({converters:o,slateData:r})}},nodes:[Ee]}}}),od=h(td);import{$setBlocksType as Hn}from"@lexical/selection";import{$createParagraphNode as Bn,$getSelection as Gn,$isParagraphNode as Dn,$isRangeSelection as rd}from"lexical";var On=[M([{ChildComponent:xe,isActive:({selection:e})=>{if(!rd(e))return!1;for(let t of e.getNodes())if(!Dn(t)&&!Dn(t.getParent()))return!1;return!0},key:"paragraph",label:({i18n:e})=>e.t("lexical:paragraph:label2"),onSelect:({editor:e})=>{e.update(()=>{let t=Gn();Hn(t,()=>Bn())})},order:1}])],nd=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,slashMenu:{groups:[A([{Icon:xe,key:"paragraph",keywords:["normal","paragraph","p","text"],label:({i18n:t})=>t.t("lexical:paragraph:label"),onSelect:({editor:t})=>{t.update(()=>{let o=Gn();Hn(o,()=>Bn())})}}])]},toolbarFixed:{groups:On},toolbarInline:{groups:On}})}),id=h(nd);import{$isNodeSelection as Ed}from"lexical";import{jsx as ke,jsxs as ld}from"react/jsx-runtime";var $t=()=>ld("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[ke("g",{clipPath:"url(#clip0_4397_10817)",children:ke("path",{d:"M7.75 12.25L15.25 4.75M15.25 4.75H11.5M15.25 4.75V8.5M13 11.5V13.75C13 14.5784 12.3284 15.25 11.5 15.25H6.25C5.42157 15.25 4.75 14.5784 4.75 13.75V8.5C4.75 7.67157 5.42157 7 6.25 7H8.5",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})}),ke("defs",{children:ke("clipPath",{id:"clip0_4397_10817",children:ke("rect",{fill:"currentColor",height:"12",transform:"translate(4 4)",width:"12"})})})]});import{useLexicalComposerContext as md}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as fd}from"@lexical/utils";import{useConfig as Cd}from"@payloadcms/ui/client";import{$getPreviousSelection as gd,$getSelection as hd,$isParagraphNode as Kn,$isRangeSelection as xd,COMMAND_PRIORITY_EDITOR as Td,createCommand as yd}from"lexical";import{useEffect as Ld}from"react";import{useLexicalComposerContext as sd}from"@lexical/react/LexicalComposerContext.js";import{useListDrawer as ad}from"@payloadcms/ui/client";import{$getNodeByKey as cd,COMMAND_PRIORITY_EDITOR as dd}from"lexical";import{useCallback as ud,useEffect as $n,useState as Un}from"react";import{jsx as Qe}from"react/jsx-runtime";var pd=({editor:e,relationTo:t,replaceNodeKey:o,value:r})=>{o?e.update(()=>{let n=cd(o);n&&n.replace(Ae({relationTo:t,value:r}))}):e.dispatchCommand(Ut,{relationTo:t,value:r})},Wn=({enabledCollectionSlugs:e})=>{let[t]=sd(),[o,r]=Un(()=>e[0]),[n,i]=Un(null),[l,a,{closeDrawer:s,isDrawerOpen:c,openDrawer:d}]=ad({collectionSlugs:e,selectedCollection:o});$n(()=>t.registerCommand(fe,u=>(i(u?.replace?u?.replace.nodeKey:null),d(),!0),dd),[t,d]);let p=ud(({collectionSlug:u,docID:m})=>{pd({editor:t,relationTo:u,replaceNodeKey:n,value:m}),s()},[t,s,n]);return $n(()=>{r(e[0])},[c,e]),Qe(l,{onSelect:p})},Vn=e=>e?.enabledCollectionSlugs?.length>0?Qe(Wn,{...e}):Qe(De,{...e,children:Qe(Wn,{...e})});import{jsx as bd}from"react/jsx-runtime";var Ut=yd("INSERT_RELATIONSHIP_COMMAND"),zn=({clientProps:e})=>{let[t]=md(),{collections:o}=Cd(),r=null;return e?.enabledCollections?r=e?.enabledCollections:e?.disabledCollections&&(r=o.filter(({slug:n})=>!e?.disabledCollections?.includes(n)).map(({slug:n})=>n)),Ld(()=>{if(!t.hasNodes([Me]))throw new Error("RelationshipPlugin: RelationshipNode not registered on editor");return t.registerCommand(Ut,n=>{let i=hd()||gd();if(xd(i)){let l=Ae(n);fd(l);let{focus:a}=i,s=a.getNode();Kn(s)&&s.getTextContentSize()===0&&s.getParent().getChildren().filter(c=>Kn(c)).length>1&&s.remove()}return!0},Td)},[t]),bd(Vn,{enabledCollectionSlugs:r})};var kd=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,nodes:[Me],plugins:[{Component:zn,position:"normal"}],slashMenu:{groups:[A([{Icon:$t,key:"relationship",keywords:["relationship","relation","rel"],label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(fe,{replace:!1})}}])]},toolbarFixed:{groups:[ee([{ChildComponent:$t,isActive:({selection:t})=>{if(!Ed(t)||!t.getNodes().length)return!1;let o=t.getNodes()[0];return ro(o)},key:"relationship",label:({i18n:t})=>t.t("lexical:relationship:label"),onSelect:({editor:t})=>{t.dispatchCommand(fe,{replace:!1})}}])]}})}),Nd=h(kd);import{useLexicalComposerContext as Gd}from"@lexical/react/LexicalComposerContext.js";import{useScrollInfo as $d,useThrottledEffect as Ud,useTranslation as Wd}from"@payloadcms/ui/client";import*as U from"react";import{useMemo as Vd}from"react";import{mergeRegister as vd}from"@lexical/utils";import{$getSelection as Fd}from"lexical";import{useCallback as _d,useEffect as et,useState as Wt}from"react";import{jsx as wd}from"react/jsx-runtime";var Vt="toolbar-popup__button",Ne=({children:e,editor:t,item:o})=>{let[r,n]=Wt(!0),[i,l]=Wt(!1),[a,s]=Wt(Vt),c=S(),d=_d(()=>{t.getEditorState().read(()=>{let p=Fd();if(o.isActive){let u=o.isActive({editor:t,editorConfigContext:c,selection:p});i!==u&&l(u)}if(o.isEnabled){let u=o.isEnabled({editor:t,editorConfigContext:c,selection:p});r!==u&&n(u)}})},[i,t,c,r,o]);return et(()=>{d()},[d]),et(()=>(document.addEventListener("mouseup",d),()=>{document.removeEventListener("mouseup",d)}),[d]),et(()=>vd(t.registerUpdateListener(()=>{d()})),[t,d]),et(()=>{s([Vt,r===!1?"disabled":"",i?"active":"",o?.key?`${Vt}-`+o.key:""].filter(Boolean).join(" "))},[r,i,a,o.key]),wd("button",{className:a,onClick:()=>{if(r!==!1)return t._updateTags=new Set([...t._updateTags,"toolbar"]),t.focus(()=>{o.onSelect({editor:t,isActive:i})}),!0},onMouseDown:p=>{p.preventDefault()},type:"button",children:e})};import Yn,{useCallback as Md,useEffect as jt}from"react";import{mergeRegister as Ad}from"@lexical/utils";import{useTranslation as Dd}from"@payloadcms/ui/client";import{$getSelection as Od}from"lexical";import tt,{useCallback as Sd,useEffect as ve,useMemo as Rd,useRef as zt,useState as ot}from"react";import{createPortal as Id}from"react-dom";import{jsx as j,jsxs as jn}from"react/jsx-runtime";var Kt="toolbar-popup__dropdown-item",Zn=tt.createContext(null);function Jn({active:e,children:t,editor:o,enabled:r,item:n,title:i}){let[l,a]=ot(Kt);ve(()=>{a([Kt,r===!1?"disabled":"",e?"active":"",n?.key?`${Kt}-${n.key}`:""].filter(Boolean).join(" "))},[r,e,l,n.key]);let s=zt(null),c=tt.useContext(Zn);if(c===null)throw new Error("DropDownItem must be used within a DropDown");let{registerItem:d}=c;return ve(()=>{s?.current!=null&&d(s)},[s,d]),j("button",{className:l,onClick:()=>{r!==!1&&(o._updateTags=new Set([...o._updateTags,"toolbar"]),o.focus(()=>{n.onSelect({editor:o,isActive:e})}))},onMouseDown:p=>{p.preventDefault()},ref:s,title:i,type:"button",children:t})}function Pd({children:e,dropDownRef:t,itemsContainerClassNames:o,onClose:r}){let[n,i]=ot(),[l,a]=ot(),s=Sd(p=>{i(u=>u!=null?[...u,p]:[p])},[i]),c=p=>{if(n==null)return;let{key:u}=p;["ArrowDown","ArrowUp","Escape","Tab"].includes(u)&&p.preventDefault(),u==="Escape"||u==="Tab"?r():u==="ArrowUp"?a(m=>{if(m==null)return n[0];let f=n.indexOf(m)-1;return n[f===-1?n.length-1:f]}):u==="ArrowDown"&&a(m=>m==null?n[0]:n[n.indexOf(m)+1])},d=Rd(()=>({registerItem:s}),[s]);return ve(()=>{n!=null&&l==null&&a(n[0]),l!=null&&l?.current!=null&&l.current.focus()},[n,l]),j(Zn.Provider,{value:d,children:j("div",{className:(o??["toolbar-popup__dropdown-items"]).join(" "),onKeyDown:c,ref:t,children:e})})}function Xn({Icon:e,buttonAriaLabel:t,buttonClassName:o,children:r,disabled:n=!1,itemsContainerClassNames:i,label:l,stopCloseOnClickSelf:a}){let s=zt(null),c=zt(null),[d,p]=ot(!1),u=()=>{p(!1),c?.current!=null&&c.current.focus()};ve(()=>{let f=c.current,C=s.current;if(d&&f!==null&&C!==null){let{left:y,top:x}=f.getBoundingClientRect(),N=window.scrollY||document.documentElement.scrollTop;C.style.top=`${x+N+f.offsetHeight+5}px`,C.style.left=`${Math.min(y-5,window.innerWidth-C.offsetWidth-20)}px`}},[s,c,d]),ve(()=>{let f=c.current;if(f!==null&&d){let C=y=>{let{target:x}=y;a!=null&&s.current!=null&&s.current.contains(x)||f.contains(x)||p(!1)};return document.addEventListener("click",C),()=>{document.removeEventListener("click",C)}}},[s,c,d,a]);let m=Id(j(Pd,{dropDownRef:s,itemsContainerClassNames:i,onClose:u,children:r}),document.body);return jn(tt.Fragment,{children:[jn("button",{"aria-label":t,className:o+(d?" active":""),disabled:n,onClick:f=>{f.preventDefault(),p(!d)},onMouseDown:f=>{f.preventDefault()},ref:c,type:"button",children:[e&&j(e,{}),l&&j("span",{className:"toolbar-popup__dropdown-label",children:l}),j("i",{className:"toolbar-popup__dropdown-caret"})]}),d&&j(tt.Fragment,{children:m})]})}import{jsx as Fe,jsxs as Bd}from"react/jsx-runtime";var Zt="toolbar-popup__dropdown",Hd=({active:e,anchorElem:t,editor:o,enabled:r,item:n})=>{let{i18n:i}=Dd();if(n.Component)return n?.Component&&Fe(n.Component,{active:e,anchorElem:t,editor:o,enabled:r,item:n},n.key);let l=n.key;return n.label&&(l=typeof n.label=="function"?n.label({i18n:i}):n.label),l.length>25&&(l=l.substring(0,25)+"..."),Bd(Jn,{active:e,editor:o,enabled:r,item:n,children:[n?.ChildComponent&&Fe(n.ChildComponent,{}),Fe("span",{className:"text",children:l})]},n.key)},oe=({Icon:e,anchorElem:t,classNames:o,editor:r,groupKey:n,items:i,itemsContainerClassNames:l,label:a,maxActiveItems:s,onActiveChange:c})=>{let[d,p]=Yn.useState([]),[u,m]=Yn.useState([]),f=S(),C=Md(()=>{r.getEditorState().read(()=>{let y=Od(),x=[],N=[],v=[];for(let g of i)g.isActive&&(!s||x.length<s)&&g.isActive({editor:r,editorConfigContext:f,selection:y})&&(x.push(g.key),N.push(g)),g.isEnabled?g.isEnabled({editor:r,editorConfigContext:f,selection:y})&&v.push(g.key):v.push(g.key);p(x),m(v),c&&c({activeItems:N})})},[r,f,i,s,c]);return jt(()=>{C()},[C]),jt(()=>(document.addEventListener("mouseup",C),()=>{document.removeEventListener("mouseup",C)}),[C]),jt(()=>Ad(r.registerUpdateListener(()=>{C()})),[r,C]),Fe(Xn,{Icon:e,buttonAriaLabel:`${n} dropdown`,buttonClassName:[Zt,`${Zt}-${n}`,...o||[]].filter(Boolean).join(" "),itemsContainerClassNames:[`${Zt}-items`,...l||[]],label:a,children:i.length&&i.map(y=>Fe(Hd,{active:d.includes(y.key),anchorElem:t,editor:r,enabled:u.includes(y.key),item:y},y.key))},n)};import{jsx as H,jsxs as Zd}from"react/jsx-runtime";function Kd({anchorElem:e,editor:t,item:o}){return o.Component?o?.Component&&H(o.Component,{anchorElem:e,editor:t,item:o},o.key):H(Ne,{editor:t,item:o,children:o?.ChildComponent&&H(o.ChildComponent,{})},o.key)}function zd({anchorElem:e,editor:t,editorConfig:o,group:r,index:n}){let{i18n:i}=Wd(),[l,a]=U.useState(null),[s,c]=U.useState(null);U.useEffect(()=>{r?.type==="dropdown"&&r.items.length&&r.ChildComponent?c(()=>r.ChildComponent):c(null)},[r]);let d=({activeItems:p})=>{if(!p.length){r?.type==="dropdown"&&r.items.length&&r.ChildComponent?(c(()=>r.ChildComponent),a(null)):(c(null),a(null));return}let u=p[0],m=u.key;u.label&&(m=typeof u.label=="function"?u.label({i18n:i}):u.label),m.length>25&&(m=m.substring(0,25)+"..."),a(m),c(()=>u.ChildComponent)};return Zd("div",{className:`fixed-toolbar__group fixed-toolbar__group-${r.key}`,children:[r.type==="dropdown"&&r.items.length&&(s?H(oe,{Icon:s,anchorElem:e,editor:t,groupKey:r.key,items:r.items,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:l,maxActiveItems:1,onActiveChange:d}):H(oe,{anchorElem:e,editor:t,groupKey:r.key,items:r.items,itemsContainerClassNames:["fixed-toolbar__dropdown-items"],label:l,maxActiveItems:1,onActiveChange:d})),r.type==="buttons"&&r.items.length&&r.items.map(p=>H(Kd,{anchorElem:e,editor:t,item:p},p.key)),n<o.features.toolbarFixed?.groups.length-1&&H("div",{className:"divider"})]},r.key)}function jd({anchorElem:e,clientProps:t,editor:o,editorConfig:r,parentWithFixedToolbar:n}){let i=U.useRef(null),{y:l}=$d(),a=Vd(()=>{if(!n||t?.disableIfParentHasFixedToolbar)return null;let c=n.editorContainerRef.current.previousElementSibling;for(;c;){if(c.classList.contains("fixed-toolbar"))return c;c=c.previousElementSibling}return null},[t?.disableIfParentHasFixedToolbar,n]);return Ud(()=>{if(!a)return;let s=i.current;if(!s)return;let c=s.getBoundingClientRect(),d=a.getBoundingClientRect();if(!(c.bottom<d.top||c.top>d.bottom))i.current.className="fixed-toolbar fixed-toolbar--overlapping",a.className="fixed-toolbar fixed-toolbar--hide";else{if(!i.current.classList.contains("fixed-toolbar--overlapping"))return;i.current.className="fixed-toolbar",a.className="fixed-toolbar"}},50,[i,a,l]),H("div",{className:"fixed-toolbar",onFocus:s=>{s.stopPropagation()},ref:i,children:o.isEditable()&&H(U.Fragment,{children:r?.features&&r.features?.toolbarFixed?.groups.map((s,c)=>H(zd,{anchorElem:e,editor:o,editorConfig:r,group:s,index:c},s.key))})})}var qn=e=>{if(e.parentEditor?.editorConfig){if(e.parentEditor?.editorConfig.resolvedFeatureMap.has("toolbarFixed"))return e.parentEditor;if(e.parentEditor)return qn(e.parentEditor)}return!1},Qn=({anchorElem:e,clientProps:t})=>{let[o]=Gd(),r=S(),{editorConfig:n}=r,i=t.applyToFocusedEditor&&r.focusedEditor?.editor||o,l=t.applyToFocusedEditor&&r.focusedEditor?.editorConfig||n,a=qn(r);return t?.disableIfParentHasFixedToolbar&&a||!l?.features?.toolbarFixed?.groups?.length?null:H(jd,{anchorElem:e,editor:i,editorConfig:l,parentWithFixedToolbar:a})};var Jd=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,plugins:[{Component:Qn,position:"aboveContainer"}]})}),Xd=h(Jd);import{useLexicalComposerContext as Yd}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as oi}from"@lexical/utils";import{$getSelection as ri,$isRangeSelection as ei,$isTextNode as qd,COMMAND_PRIORITY_LOW as Qd,SELECTION_CHANGE_COMMAND as eu}from"lexical";import{useCallback as _e,useEffect as we,useRef as ti,useState as tu}from"react";import*as ue from"react";import{createPortal as ou}from"react-dom";function Jt(e,t){let o=e.getRangeAt(0),r;if(e.anchorNode===t){let n=t;for(;n.firstElementChild!=null;)n=n.firstElementChild;r=n.getBoundingClientRect()}else r=o.getBoundingClientRect();return r}function rt(e){let{alwaysDisplayOnTop:t=!1,anchorElem:o,anchorFlippedOffset:r=0,floatingElem:n,horizontalOffset:i=5,horizontalPosition:l="left",specialHandlingForCaret:a=!1,targetRect:s,verticalGap:c=10}=e,d=o.parentElement;if(s===null||d==null){n.style.opacity="0",n.style.transform="translate(-10000px, -10000px)";return}let p=n.getBoundingClientRect(),u=o.getBoundingClientRect(),m=d.getBoundingClientRect(),f=s.top-p.height-c,C=s.left-i;l==="center"&&(C=s.left+s.width/2-p.width/2);let y=0;return!t&&f<m.top&&!a&&(y=p.height+s.height+c*2,f+=y),l==="center"?C+p.width>m.right?C=m.right-p.width-i:C<m.left&&(C=m.left+i):C+p.width>m.right&&(C=m.right-p.width-i),C-=u.left,n.style.opacity="1",a&&r!==0?(f-=u.bottom-r+p.height-3,n.style.transform=`translate(${C}px, ${f}px) rotate(180deg)`):(f-=u.top,n.style.transform=`translate(${C}px, ${f}px)`),y}import{jsx as B,jsxs as ii}from"react/jsx-runtime";function ru({anchorElem:e,editor:t,item:o}){return o.Component?o?.Component&&B(o.Component,{anchorElem:e,editor:t,item:o},o.key):B(Ne,{editor:t,item:o,children:o?.ChildComponent&&B(o.ChildComponent,{})},o.key)}function nu({anchorElem:e,editor:t,group:o,index:r}){let{editorConfig:n}=S(),[i,l]=ue.useState(null);ue.useEffect(()=>{o?.type==="dropdown"&&o.items.length&&o.ChildComponent?l(()=>o.ChildComponent):l(null)},[o]);let a=({activeItems:s})=>{if(!s.length){o?.type==="dropdown"&&o.items.length&&o.ChildComponent?l(()=>o.ChildComponent):l(null);return}let c=s[0];l(()=>c.ChildComponent)};return ii("div",{className:`inline-toolbar-popup__group inline-toolbar-popup__group-${o.key}`,children:[o.type==="dropdown"&&o.items.length&&(i?B(oe,{Icon:i,anchorElem:e,editor:t,groupKey:o.key,items:o.items,maxActiveItems:1,onActiveChange:a}):B(oe,{anchorElem:e,editor:t,groupKey:o.key,items:o.items,maxActiveItems:1,onActiveChange:a})),o.type==="buttons"&&o.items.length&&o.items.map(s=>B(ru,{anchorElem:e,editor:t,item:s},s.key)),r<n.features.toolbarInline?.groups.length-1&&B("div",{className:"divider"})]},o.key)}function iu({anchorElem:e,editor:t}){let o=ti(null),r=ti(null),{editorConfig:n}=S(),i=_e(()=>{if(o?.current){let c=o.current.style.opacity==="0",d=o.current.style.pointerEvents==="none";c||(o.current.style.opacity="0"),d||(o.current.style.pointerEvents="none")}},[o]),l=_e(c=>{if(o?.current&&(c.buttons===1||c.buttons===3)){let d=o.current.style.opacity==="0",p=o.current.style.pointerEvents==="none";if(!d||!p){let u=c.clientX,m=c.clientY,f=document.elementFromPoint(u,m);o.current.contains(f)||i()}}},[i]),a=_e(()=>{o?.current&&(o.current.style.opacity!=="1"&&(o.current.style.opacity="1"),o.current.style.pointerEvents!=="auto"&&(o.current.style.pointerEvents="auto"))},[]);we(()=>(document.addEventListener("mousemove",l),document.addEventListener("mouseup",a),()=>{document.removeEventListener("mousemove",l),document.removeEventListener("mouseup",a)}),[o,l,a]);let s=_e(()=>{let c=ri(),d=window.getSelection();if(o.current===null)return;let p=e.querySelector(":scope > .link-editor"),u=p!==null&&"style"in p&&p?.style?.opacity==="1",m=t.getRootElement();if(c!==null&&d!==null&&!d.isCollapsed&&m!==null&&m.contains(d.anchorNode)){let f=Jt(d,m),C=rt({alwaysDisplayOnTop:u,anchorElem:e,floatingElem:o.current,horizontalPosition:"center",targetRect:f});r.current&&rt({anchorElem:o.current,anchorFlippedOffset:C,floatingElem:r.current,horizontalOffset:5,horizontalPosition:"center",specialHandlingForCaret:!0,targetRect:f,verticalGap:10})}else i()},[t,i,e]);return we(()=>{let c=e.parentElement,d=()=>{t.getEditorState().read(()=>{s()})};return window.addEventListener("resize",d),c&&c.addEventListener("scroll",d),()=>{window.removeEventListener("resize",d),c&&c.removeEventListener("scroll",d)}},[t,s,e]),we(()=>(t.getEditorState().read(()=>{s()}),oi(t.registerUpdateListener(({editorState:c})=>{c.read(()=>{s()})}),t.registerCommand(eu,()=>(s(),!1),Qd))),[t,s]),ii("div",{className:"inline-toolbar-popup",ref:o,children:[B("div",{className:"caret",ref:r}),t.isEditable()&&B(ue.Fragment,{children:n?.features&&n.features?.toolbarInline?.groups.map((c,d)=>B(nu,{anchorElem:e,editor:t,group:c,index:d},c.key))})]})}function lu(e,t){let[o,r]=tu(!1),n=_e(()=>{e.getEditorState().read(()=>{if(e.isComposing())return;let i=ri(),l=window.getSelection(),a=e.getRootElement();if(l!==null&&(!ei(i)||a===null||!a.contains(l.anchorNode))){r(!1);return}if(!ei(i))return;if(i.getTextContent()!==""){let c=i.getNodes(),d=!1;for(let p of c)if(qd(p)){r(!0),d=!0;break}d||r(!1)}else r(!1);let s=i.getTextContent().replace(/\n/g,"");if(!i.isCollapsed()&&s===""){r(!1);return}})},[e]);return we(()=>(document.addEventListener("selectionchange",n),document.addEventListener("mouseup",n),()=>{document.removeEventListener("selectionchange",n),document.removeEventListener("mouseup",n)}),[n]),we(()=>oi(e.registerUpdateListener(()=>{n()}),e.registerRootListener(()=>{e.getRootElement()===null&&r(!1)})),[e,n]),o?ou(B(iu,{anchorElem:t,editor:e}),t):null}var ni=({anchorElem:e})=>{let[t]=Yd();return lu(t,e)};var su=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,plugins:[{Component:ni,position:"floatingAnchorElem"}]})}),au=h(su);import{$isNodeSelection as Su}from"lexical";import{jsx as Xt,jsxs as cu}from"react/jsx-runtime";var Yt=()=>cu("svg",{"aria-hidden":"true",className:"icon",fill:"none",focusable:"false",height:"20",viewBox:"0 0 20 20",width:"20",xmlns:"http://www.w3.org/2000/svg",children:[Xt("path",{d:"M14.6667 4H5.33333C4.59695 4 4 4.59695 4 5.33333V14.6667C4 15.403 4.59695 16 5.33333 16H14.6667C15.403 16 16 15.403 16 14.6667V5.33333C16 4.59695 15.403 4 14.6667 4Z",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),Xt("path",{d:"M7.99984 9.33366C8.73622 9.33366 9.33317 8.73671 9.33317 8.00033C9.33317 7.26395 8.73622 6.66699 7.99984 6.66699C7.26346 6.66699 6.6665 7.26395 6.6665 8.00033C6.6665 8.73671 7.26346 9.33366 7.99984 9.33366Z",stroke:"#currentColor",strokeLinecap:"round",strokeLinejoin:"round"}),Xt("path",{d:"M16 11.9995L13.9427 9.94214C13.6926 9.69218 13.3536 9.55176 13 9.55176C12.6464 9.55176 12.3074 9.69218 12.0573 9.94214L6 15.9995",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round"})]});import{useLexicalComposerContext as Tu}from"@lexical/react/LexicalComposerContext.js";import{$insertNodeToNearestRoot as yu,mergeRegister as Lu}from"@lexical/utils";import{useConfig as bu}from"@payloadcms/ui/client";import{$getPreviousSelection as Eu,$getSelection as ku,$isParagraphNode as si,$isRangeSelection as Nu,COMMAND_PRIORITY_EDITOR as vu,createCommand as Fu}from"lexical";import{useEffect as _u}from"react";import{useLexicalComposerContext as du}from"@lexical/react/LexicalComposerContext.js";import{useListDrawer as uu}from"@payloadcms/ui/client";import{$getNodeByKey as pu,COMMAND_PRIORITY_EDITOR as mu}from"lexical";import{useCallback as fu,useEffect as Cu,useState as gu}from"react";import{jsx as qt}from"react/jsx-runtime";var hu=({editor:e,relationTo:t,replaceNodeKey:o,value:r})=>{o?e.update(()=>{let n=pu(o);n&&n.replace(He({data:{fields:null,relationTo:t,value:r}}))}):e.dispatchCommand(Qt,{fields:null,relationTo:t,value:r})},xu=({enabledCollectionSlugs:e})=>{let[t]=du(),[o,r]=gu(null),[n,i,{closeDrawer:l,openDrawer:a}]=uu({collectionSlugs:e,uploads:!0});Cu(()=>t.registerCommand(Ce,c=>(r(c?.replace?c?.replace.nodeKey:null),a(),!0),mu),[t,a]);let s=fu(({collectionSlug:c,docID:d})=>{hu({editor:t,relationTo:c,replaceNodeKey:o,value:d}),l()},[t,l,o]);return qt(n,{onSelect:s})},li=e=>qt(De,{...e,uploads:!0,children:qt(xu,{...e})});import{jsx as wu}from"react/jsx-runtime";var Qt=Fu("INSERT_UPLOAD_COMMAND"),ai=({clientProps:e})=>{let[t]=Tu(),{collections:o}=bu();return _u(()=>{if(!t.hasNodes([Oe]))throw new Error("UploadPlugin: UploadNode not registered on editor");return Lu(t.registerCommand(Qt,r=>(t.update(()=>{let n=ku()||Eu();if(Nu(n)){let i=He({data:{id:r.id,fields:r.fields,relationTo:r.relationTo,value:r.value}});yu(i);let{focus:l}=n,a=l.getNode();si(a)&&a.getTextContentSize()===0&&a.getParent().getChildren().filter(s=>si(s)).length>1&&a.remove()}}),!0),vu))},[t]),wu(li,{enabledCollectionSlugs:o.map(({slug:r})=>r)})};var Ru=e=>({clientFeatureProps:e,feature:()=>({clientFeatureProps:e,nodes:[Oe],plugins:[{Component:ai,position:"normal"}],slashMenu:{groups:[A([{Icon:Yt,key:"upload",keywords:["upload","image","file","img","picture","photo","media"],label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ce,{replace:!1})}}])]},toolbarFixed:{groups:[ee([{ChildComponent:Yt,isActive:({selection:t})=>{if(!Su(t)||!t.getNodes().length)return!1;let o=t.getNodes()[0];return no(o)},key:"upload",label:({i18n:t})=>t.t("lexical:upload:label"),onSelect:({editor:t})=>{t.dispatchCommand(Ce,{replace:!1})}}])]}})}),Iu=h(Ru);import{ShimmerEffect as Pu,useClientFunctions as Mu,useFieldProps as Au}from"@payloadcms/ui/client";import ci,{Suspense as Du,lazy as Ou,useEffect as Hu,useState as eo}from"react";import{jsx as nt,jsxs as $u}from"react/jsx-runtime";var Bu=Ou(()=>import("./Field-U5PHZTST.js").then(e=>({default:e.RichText}))),Gu=e=>{let{admin:t,lexicalEditorConfig:o,richTextComponentMap:r}=e,{schemaPath:n}=Au(),i=Mu(),[l,a]=eo(!1),[s,c]=eo([]),[d,p]=eo(null),u=r.get("features");u=u.sort((f,C)=>f.order-C.order);let m=0;for(let f of u){let C=Array.from(r.keys()).filter(y=>y.startsWith(`feature.${f.key}.components.`));m+=1,m+=C.length}return Hu(()=>{if(!l){let f=[],C=0;if(Object.entries(i).forEach(([y,x])=>{y.startsWith(`lexicalFeature.${n}.`)&&(y.includes(".components.")||f.push(x),C++)}),C===m){c(f),a(!0);let y=Be({clientFunctions:i,schemaPath:n,unSanitizedEditorConfig:{features:f,lexical:o}});p(he(o||ge,y,t))}}},[t,l,i,n,u.length,s,d,o,m]),l?nt(Du,{fallback:nt(Pu,{height:"35vh"}),children:d&&nt(Bu,{...e,editorConfig:d})}):nt(ci.Fragment,{children:Array.isArray(u)&&u.map(f=>{let y=Array.from(r.keys()).filter(x=>x.startsWith(`feature.${f.key}.components.`)).map(x=>r.get(x));return $u(ci.Fragment,{children:[y?.length?y.map(x=>x):null,f.ClientComponent]},f.key)})})};function it(e,t=new WeakMap){if(e===null)return null;if(t.has(e))return t.get(e);if(e instanceof Date)return new Date(e.getTime());if(e instanceof RegExp)return new RegExp(e.source,e.flags);if(e instanceof Map){let o=new Map;t.set(e,o);for(let[r,n]of e.entries())o.set(r,it(n,t));return o}if(e instanceof Set){let o=new Set;t.set(e,o);for(let r of e.values())o.add(it(r,t));return o}if(typeof e=="object"&&e!==null){if("$$typeof"in e&&typeof e.$$typeof=="symbol")return e;let o=Array.isArray(e)?[]:Object.create(Object.getPrototypeOf(e));t.set(e,o);for(let r in e)(e.hasOwnProperty(r)||Object.getOwnPropertySymbols(e).includes(r))&&(o[r]=it(e[r],t));return o}return e}function Uu(...e){return e.filter(Boolean).join(" ")}var lt=new WeakMap;function di(e){let t=e.changedTouches[0];return t===void 0?null:[t.clientX,t.clientY]}function st(e,t){let o=lt.get(e);if(o===void 0){let r=new Set,n=l=>{o!==void 0&&(o.start=di(l))},i=l=>{if(o===void 0)return;let{start:a}=o;if(a===null)return;let s=di(l);for(let c of r)s!==null&&c([s[0]-a[0],s[1]-a[1]],l)};e.addEventListener("touchstart",n),e.addEventListener("touchend",i),o={handleTouchend:i,handleTouchstart:n,listeners:r,start:null},lt.set(e,o)}return o.listeners.add(t),()=>{Wu(e,t)}}function Wu(e,t){let o=lt.get(e);if(o===void 0)return;let{listeners:r}=o;r.delete(t),r.size===0&&(lt.delete(e),e.removeEventListener("touchstart",o.handleTouchstart),e.removeEventListener("touchend",o.handleTouchend))}function Vu(e,t){return st(e,(o,r)=>{let[n,i]=o;n<0&&-n>Math.abs(i)&&t(n,r)})}function Ku(e,t){return st(e,(o,r)=>{let[n,i]=o;n>0&&n>Math.abs(i)&&t(n,r)})}function zu(e,t){return st(e,(o,r)=>{let[n,i]=o;i<0&&-i>Math.abs(n)&&t(n,r)})}function ju(e,t){return st(e,(o,r)=>{let[n,i]=o;i>0&&i>Math.abs(n)&&t(n,r)})}export{Si as AlignFeatureClientComponent,Oi as BlockquoteFeatureClientComponent,gl as BlocksFeatureClientComponent,Bl as BoldFeatureClientComponent,D as CAN_USE_DOM,Lc as ChecklistFeatureClientComponent,ui as EditorConfigProvider,Xd as FixedToolbarFeatureClientComponent,bs as HeadingFeatureClientComponent,Is as HorizontalRuleFeatureClientComponent,Hs as IndentFeatureClientComponent,Vl as InlineCodeFeatureClientComponent,au as InlineToolbarFeatureClientComponent,Zl as ItalicFeatureClientComponent,jc as LexicalPluginToLexicalFeatureClientComponent,ic as LinkFeatureClientComponent,Sc as OrderedListFeatureClientComponent,id as ParagraphFeatureClientComponent,mi as Point,Ci as Rect,Nd as RelationshipFeatureClientComponent,yi as RichTextCell,Gu as RichTextField,od as SlateToLexicalFeatureClientComponent,Ql as StrikethroughFeatureClientComponent,rs as SubscriptFeatureClientComponent,ss as SuperscriptFeatureClientComponent,Sl as TestRecorderFeatureClientComponent,Ne as ToolbarButton,oe as ToolbarDropdown,Al as TreeViewFeatureClientComponent,ps as UnderlineFeatureClientComponent,Bc as UnorderedListFeatureClientComponent,Iu as UploadFeatureClientComponent,ju as addSwipeDownListener,Vu as addSwipeLeftListener,Ku as addSwipeRightListener,zu as addSwipeUpListener,it as cloneDeep,Lt as createBlockNode,h as createClientComponent,ge as defaultEditorLexicalConfig,Jt as getDOMRangeRect,ne as getSelectedNode,Ft as invariant,pi as isHTMLElement,fi as isPoint,Uu as joinClasses,he as sanitizeClientEditorConfig,lo as sanitizeClientFeatures,rt as setFloatingElemPosition,Ye as setFloatingElemPositionForLinkEditor,ee as toolbarAddDropdownGroupWithItems,Et as toolbarFeatureButtonsGroupWithItems,R as toolbarFormatGroupWithItems,M as toolbarTextDropdownGroupWithItems,S as useEditorConfigContext};
36
+ //# sourceMappingURL=index.js.map