@payloadcms/richtext-lexical 3.0.0-canary.b8dd0db → 3.0.0-canary.bb00d64

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 (512) hide show
  1. package/dist/cell/rscEntry.d.ts +12 -0
  2. package/dist/cell/rscEntry.d.ts.map +1 -0
  3. package/dist/cell/rscEntry.js +82 -0
  4. package/dist/cell/rscEntry.js.map +1 -0
  5. package/dist/exports/client/Field-LKCJPU2R.js +2 -0
  6. package/dist/exports/client/Field-LKCJPU2R.js.map +7 -0
  7. package/dist/exports/client/RelationshipComponent-IMM4CFBE.js +2 -0
  8. package/dist/exports/client/RelationshipComponent-IMM4CFBE.js.map +7 -0
  9. package/dist/exports/client/bundled.css +1 -1
  10. package/dist/exports/client/chunk-5PBXL4HT.js +2 -0
  11. package/dist/exports/client/chunk-5PBXL4HT.js.map +7 -0
  12. package/dist/exports/client/chunk-NNE6RSU5.js +2 -0
  13. package/dist/exports/client/chunk-NNE6RSU5.js.map +7 -0
  14. package/dist/exports/client/{chunk-LGUXX2QH.js → chunk-O4IOO4EU.js} +2 -2
  15. package/dist/exports/client/{chunk-LGUXX2QH.js.map → chunk-O4IOO4EU.js.map} +2 -2
  16. package/dist/exports/client/chunk-PDAZFJVO.js +2 -0
  17. package/dist/exports/client/chunk-PDAZFJVO.js.map +7 -0
  18. package/dist/exports/client/chunk-PSABE6CO.js +2 -0
  19. package/dist/exports/client/chunk-PSABE6CO.js.map +7 -0
  20. package/dist/exports/client/{chunk-V2LKLT2F.js → chunk-XCEM47RI.js} +3 -3
  21. package/dist/exports/client/{chunk-V2LKLT2F.js.map → chunk-XCEM47RI.js.map} +3 -3
  22. package/dist/exports/client/chunk-ZFVIUTHB.js +2 -0
  23. package/dist/exports/client/chunk-ZFVIUTHB.js.map +7 -0
  24. package/dist/exports/client/{chunk-OKMIHD2R.js → chunk-ZOYGBIAN.js} +2 -2
  25. package/dist/exports/client/{chunk-OKMIHD2R.js.map → chunk-ZOYGBIAN.js.map} +2 -2
  26. package/dist/exports/client/component-4OBXHYCD.js +2 -0
  27. package/dist/exports/client/component-4OBXHYCD.js.map +7 -0
  28. package/dist/exports/client/component-ANB7VZLA.js +2 -0
  29. package/dist/exports/client/component-ANB7VZLA.js.map +7 -0
  30. package/dist/exports/client/component-P25AKAUU.js +2 -0
  31. package/dist/exports/client/component-P25AKAUU.js.map +7 -0
  32. package/dist/exports/client/componentInline-N5LJ2LY2.js +2 -0
  33. package/dist/exports/client/componentInline-N5LJ2LY2.js.map +7 -0
  34. package/dist/exports/client/index.d.ts +3 -4
  35. package/dist/exports/client/index.d.ts.map +1 -1
  36. package/dist/exports/client/index.js +7 -7
  37. package/dist/exports/client/index.js.map +4 -4
  38. package/dist/exports/server/rsc.d.ts +3 -0
  39. package/dist/exports/server/rsc.d.ts.map +1 -0
  40. package/dist/exports/server/rsc.js +3 -0
  41. package/dist/exports/server/rsc.js.map +1 -0
  42. package/dist/features/align/client/index.d.ts +1 -4
  43. package/dist/features/align/client/index.d.ts.map +1 -1
  44. package/dist/features/blockquote/client/index.d.ts +1 -4
  45. package/dist/features/blockquote/client/index.d.ts.map +1 -1
  46. package/dist/features/blockquote/markdownTransformer.js.map +1 -1
  47. package/dist/features/blockquote/server/index.d.ts +1 -1
  48. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  49. package/dist/features/blockquote/server/index.js +5 -1
  50. package/dist/features/blockquote/server/index.js.map +1 -1
  51. package/dist/features/blocks/client/component/BlockContent.d.ts +1 -0
  52. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  53. package/dist/features/blocks/client/component/BlockContent.js +28 -28
  54. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  55. package/dist/features/blocks/client/component/index.d.ts +1 -1
  56. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  57. package/dist/features/blocks/client/component/index.js +94 -55
  58. package/dist/features/blocks/client/component/index.js.map +1 -1
  59. package/dist/features/blocks/client/componentInline/index.d.ts +1 -1
  60. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  61. package/dist/features/blocks/client/componentInline/index.js +27 -29
  62. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  63. package/dist/features/blocks/client/index.d.ts +1 -4
  64. package/dist/features/blocks/client/index.d.ts.map +1 -1
  65. package/dist/features/blocks/client/index.js +35 -23
  66. package/dist/features/blocks/client/index.js.map +1 -1
  67. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
  68. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  69. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  70. package/dist/features/blocks/client/plugin/index.d.ts +2 -2
  71. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  72. package/dist/features/blocks/client/plugin/index.js +96 -93
  73. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  74. package/dist/features/blocks/server/index.d.ts.map +1 -1
  75. package/dist/features/blocks/server/index.js +41 -27
  76. package/dist/features/blocks/server/index.js.map +1 -1
  77. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +11 -5
  78. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  79. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  80. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +3 -3
  81. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  82. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  83. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  84. package/dist/features/blocks/server/validate.js +8 -5
  85. package/dist/features/blocks/server/validate.js.map +1 -1
  86. package/dist/features/converters/html/converter/converters/paragraph.d.ts.map +1 -1
  87. package/dist/features/converters/html/converter/converters/paragraph.js +4 -0
  88. package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
  89. package/dist/features/converters/html/converter/converters/text.d.ts.map +1 -1
  90. package/dist/features/converters/html/converter/converters/text.js +2 -1
  91. package/dist/features/converters/html/converter/converters/text.js.map +1 -1
  92. package/dist/features/converters/html/converter/index.d.ts +11 -7
  93. package/dist/features/converters/html/converter/index.d.ts.map +1 -1
  94. package/dist/features/converters/html/converter/index.js +17 -1
  95. package/dist/features/converters/html/converter/index.js.map +1 -1
  96. package/dist/features/converters/html/converter/types.d.ts +3 -1
  97. package/dist/features/converters/html/converter/types.d.ts.map +1 -1
  98. package/dist/features/converters/html/converter/types.js.map +1 -1
  99. package/dist/features/converters/html/field/index.d.ts.map +1 -1
  100. package/dist/features/converters/html/field/index.js +7 -1
  101. package/dist/features/converters/html/field/index.js.map +1 -1
  102. package/dist/features/debug/testRecorder/client/index.d.ts +1 -4
  103. package/dist/features/debug/testRecorder/client/index.d.ts.map +1 -1
  104. package/dist/features/debug/testRecorder/client/plugin/index.js +180 -345
  105. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  106. package/dist/features/debug/treeView/client/index.d.ts +1 -4
  107. package/dist/features/debug/treeView/client/index.d.ts.map +1 -1
  108. package/dist/features/experimental_table/client/index.d.ts +1 -1
  109. package/dist/features/experimental_table/client/index.d.ts.map +1 -1
  110. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  111. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +250 -488
  112. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  113. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  114. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +39 -39
  115. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  116. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +1 -1
  117. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
  118. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +60 -124
  119. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  120. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  121. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +52 -50
  122. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  123. package/dist/features/experimental_table/client/utils/debounce.js +4 -4
  124. package/dist/features/experimental_table/client/utils/debounce.js.map +1 -1
  125. package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
  126. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  127. package/dist/features/experimental_table/server/index.js +20 -4
  128. package/dist/features/experimental_table/server/index.js.map +1 -1
  129. package/dist/features/format/bold/feature.client.d.ts +1 -4
  130. package/dist/features/format/bold/feature.client.d.ts.map +1 -1
  131. package/dist/features/format/inlineCode/feature.client.d.ts +1 -4
  132. package/dist/features/format/inlineCode/feature.client.d.ts.map +1 -1
  133. package/dist/features/format/italic/feature.client.d.ts +1 -4
  134. package/dist/features/format/italic/feature.client.d.ts.map +1 -1
  135. package/dist/features/format/strikethrough/feature.client.d.ts +1 -4
  136. package/dist/features/format/strikethrough/feature.client.d.ts.map +1 -1
  137. package/dist/features/format/subscript/feature.client.d.ts +1 -4
  138. package/dist/features/format/subscript/feature.client.d.ts.map +1 -1
  139. package/dist/features/format/superscript/feature.client.d.ts +1 -4
  140. package/dist/features/format/superscript/feature.client.d.ts.map +1 -1
  141. package/dist/features/format/underline/feature.client.d.ts +1 -4
  142. package/dist/features/format/underline/feature.client.d.ts.map +1 -1
  143. package/dist/features/heading/client/index.d.ts +1 -4
  144. package/dist/features/heading/client/index.d.ts.map +1 -1
  145. package/dist/features/heading/server/index.d.ts.map +1 -1
  146. package/dist/features/heading/server/index.js +4 -0
  147. package/dist/features/heading/server/index.js.map +1 -1
  148. package/dist/features/horizontalRule/client/component/index.d.ts +1 -1
  149. package/dist/features/horizontalRule/client/component/index.d.ts.map +1 -1
  150. package/dist/features/horizontalRule/client/component/index.js +12 -9
  151. package/dist/features/horizontalRule/client/component/index.js.map +1 -1
  152. package/dist/features/horizontalRule/client/index.d.ts +1 -4
  153. package/dist/features/horizontalRule/client/index.d.ts.map +1 -1
  154. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +2 -2
  155. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  156. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
  157. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  158. package/dist/features/indent/client/index.d.ts +1 -4
  159. package/dist/features/indent/client/index.d.ts.map +1 -1
  160. package/dist/features/indent/client/index.js +2 -1
  161. package/dist/features/indent/client/index.js.map +1 -1
  162. package/dist/features/link/client/index.d.ts +1 -13
  163. package/dist/features/link/client/index.d.ts.map +1 -1
  164. package/dist/features/link/client/index.js +2 -2
  165. package/dist/features/link/client/index.js.map +1 -1
  166. package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
  167. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  168. package/dist/features/link/client/plugins/autoLink/index.js +3 -1
  169. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  170. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  171. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +21 -20
  172. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  173. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  174. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -1
  175. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  176. package/dist/features/link/nodes/AutoLinkNode.js +2 -2
  177. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  178. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  179. package/dist/features/link/nodes/LinkNode.js +12 -7
  180. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  181. package/dist/features/link/nodes/types.d.ts +3 -3
  182. package/dist/features/link/nodes/types.d.ts.map +1 -1
  183. package/dist/features/link/nodes/types.js.map +1 -1
  184. package/dist/features/link/server/baseFields.d.ts +1 -1
  185. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  186. package/dist/features/link/server/baseFields.js +15 -3
  187. package/dist/features/link/server/baseFields.js.map +1 -1
  188. package/dist/features/link/server/index.d.ts.map +1 -1
  189. package/dist/features/link/server/index.js +17 -4
  190. package/dist/features/link/server/index.js.map +1 -1
  191. package/dist/features/link/server/transformExtraFields.d.ts +1 -1
  192. package/dist/features/link/server/transformExtraFields.d.ts.map +1 -1
  193. package/dist/features/link/server/transformExtraFields.js.map +1 -1
  194. package/dist/features/link/server/validate.d.ts.map +1 -1
  195. package/dist/features/link/server/validate.js +8 -5
  196. package/dist/features/link/server/validate.js.map +1 -1
  197. package/dist/features/lists/checklist/client/index.d.ts +1 -4
  198. package/dist/features/lists/checklist/client/index.d.ts.map +1 -1
  199. package/dist/features/lists/htmlConverter.d.ts.map +1 -1
  200. package/dist/features/lists/htmlConverter.js +8 -0
  201. package/dist/features/lists/htmlConverter.js.map +1 -1
  202. package/dist/features/lists/orderedList/client/index.d.ts +1 -4
  203. package/dist/features/lists/orderedList/client/index.d.ts.map +1 -1
  204. package/dist/features/lists/shared/markdown.js.map +1 -1
  205. package/dist/features/lists/unorderedList/client/index.d.ts +1 -4
  206. package/dist/features/lists/unorderedList/client/index.d.ts.map +1 -1
  207. package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +1 -1
  208. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +1 -0
  209. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
  210. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +1 -4
  211. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
  212. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  213. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  214. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  215. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
  216. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
  217. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
  218. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
  219. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
  220. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
  221. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
  222. package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  223. package/dist/features/migrations/slateToLexical/converter/index.js +1 -0
  224. package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
  225. package/dist/features/migrations/slateToLexical/feature.client.d.ts +1 -4
  226. package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
  227. package/dist/features/migrations/slateToLexical/feature.client.js +1 -3
  228. package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
  229. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  230. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  231. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  232. package/dist/features/paragraph/client/index.d.ts +1 -4
  233. package/dist/features/paragraph/client/index.d.ts.map +1 -1
  234. package/dist/features/paragraph/server/index.d.ts +1 -1
  235. package/dist/features/paragraph/server/index.d.ts.map +1 -1
  236. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  237. package/dist/features/relationship/client/components/RelationshipComponent.js +42 -29
  238. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  239. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  240. package/dist/features/relationship/client/drawer/index.js +27 -26
  241. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  242. package/dist/features/relationship/client/index.d.ts +2 -17
  243. package/dist/features/relationship/client/index.d.ts.map +1 -1
  244. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
  245. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  246. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  247. package/dist/features/relationship/client/plugins/index.js +1 -1
  248. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  249. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +1 -1
  250. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
  251. package/dist/features/relationship/server/index.d.ts +1 -1
  252. package/dist/features/relationship/server/index.d.ts.map +1 -1
  253. package/dist/features/relationship/server/index.js +50 -40
  254. package/dist/features/relationship/server/index.js.map +1 -1
  255. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +8 -6
  256. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  257. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  258. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  259. package/dist/features/toolbars/fixed/client/Toolbar/index.js +93 -66
  260. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  261. package/dist/features/toolbars/fixed/client/index.d.ts +1 -4
  262. package/dist/features/toolbars/fixed/client/index.d.ts.map +1 -1
  263. package/dist/features/toolbars/inline/client/Toolbar/index.js +43 -46
  264. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  265. package/dist/features/toolbars/inline/client/index.d.ts +1 -4
  266. package/dist/features/toolbars/inline/client/index.d.ts.map +1 -1
  267. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  268. package/dist/features/toolbars/shared/ToolbarButton/index.js +4 -1
  269. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  270. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +2 -2
  271. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  272. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +12 -6
  273. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  274. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +4 -5
  275. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  276. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +119 -116
  277. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  278. package/dist/features/toolbars/types.d.ts +23 -11
  279. package/dist/features/toolbars/types.d.ts.map +1 -1
  280. package/dist/features/toolbars/types.js.map +1 -1
  281. package/dist/features/typesClient.d.ts +10 -11
  282. package/dist/features/typesClient.d.ts.map +1 -1
  283. package/dist/features/typesClient.js.map +1 -1
  284. package/dist/features/typesServer.d.ts +17 -26
  285. package/dist/features/typesServer.d.ts.map +1 -1
  286. package/dist/features/typesServer.js.map +1 -1
  287. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  288. package/dist/features/upload/client/component/index.js +69 -58
  289. package/dist/features/upload/client/component/index.js.map +1 -1
  290. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  291. package/dist/features/upload/client/drawer/index.js +34 -32
  292. package/dist/features/upload/client/drawer/index.js.map +1 -1
  293. package/dist/features/upload/client/feature.client.d.ts +1 -4
  294. package/dist/features/upload/client/feature.client.d.ts.map +1 -1
  295. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  296. package/dist/features/upload/client/nodes/UploadNode.js +1 -1
  297. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  298. package/dist/features/upload/client/plugin/index.js +1 -1
  299. package/dist/features/upload/client/plugin/index.js.map +1 -1
  300. package/dist/features/upload/server/feature.server.d.ts.map +1 -1
  301. package/dist/features/upload/server/feature.server.js +17 -8
  302. package/dist/features/upload/server/feature.server.js.map +1 -1
  303. package/dist/features/upload/server/nodes/UploadNode.d.ts +9 -7
  304. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  305. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  306. package/dist/features/upload/server/validate.d.ts.map +1 -1
  307. package/dist/features/upload/server/validate.js +7 -4
  308. package/dist/features/upload/server/validate.js.map +1 -1
  309. package/dist/field/Field.d.ts.map +1 -1
  310. package/dist/field/Field.js +29 -44
  311. package/dist/field/Field.js.map +1 -1
  312. package/dist/field/bundled.css +1 -1
  313. package/dist/field/index.d.ts.map +1 -1
  314. package/dist/field/index.js +63 -73
  315. package/dist/field/index.js.map +1 -1
  316. package/dist/field/rscEntry.d.ts +9 -0
  317. package/dist/field/rscEntry.d.ts.map +1 -0
  318. package/dist/field/rscEntry.js +37 -0
  319. package/dist/field/rscEntry.js.map +1 -0
  320. package/dist/index.d.ts +4 -3
  321. package/dist/index.d.ts.map +1 -1
  322. package/dist/index.js +94 -103
  323. package/dist/index.js.map +1 -1
  324. package/dist/lexical/EditorPlugin.d.ts.map +1 -1
  325. package/dist/lexical/EditorPlugin.js +2 -1
  326. package/dist/lexical/EditorPlugin.js.map +1 -1
  327. package/dist/lexical/LexicalEditor.d.ts +1 -1
  328. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  329. package/dist/lexical/LexicalEditor.js +10 -10
  330. package/dist/lexical/LexicalEditor.js.map +1 -1
  331. package/dist/lexical/LexicalProvider.d.ts +2 -2
  332. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  333. package/dist/lexical/LexicalProvider.js +9 -7
  334. package/dist/lexical/LexicalProvider.js.map +1 -1
  335. package/dist/lexical/config/client/EditorConfigProvider.d.ts +6 -5
  336. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  337. package/dist/lexical/config/client/EditorConfigProvider.js +13 -12
  338. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  339. package/dist/lexical/config/client/loader.d.ts +1 -3
  340. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  341. package/dist/lexical/config/client/loader.js +7 -19
  342. package/dist/lexical/config/client/loader.js.map +1 -1
  343. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  344. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  345. package/dist/lexical/config/client/sanitize.js +4 -4
  346. package/dist/lexical/config/client/sanitize.js.map +1 -1
  347. package/dist/lexical/config/server/loader.d.ts +2 -1
  348. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  349. package/dist/lexical/config/server/loader.js +2 -0
  350. package/dist/lexical/config/server/loader.js.map +1 -1
  351. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  352. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  353. package/dist/lexical/config/server/sanitize.js +12 -11
  354. package/dist/lexical/config/server/sanitize.js.map +1 -1
  355. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +4 -4
  356. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  357. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +82 -113
  358. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  359. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +2 -2
  360. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  361. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +2 -2
  362. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  363. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +3 -2
  364. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  365. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  366. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  367. package/dist/lexical/plugins/SlashMenu/index.js +24 -30
  368. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  369. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  370. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +93 -130
  371. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  372. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts +1 -1
  373. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  374. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +1 -1
  375. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
  376. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +1 -1
  377. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
  378. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  379. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +119 -137
  380. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  381. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  382. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +16 -32
  383. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  384. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -1
  385. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +3 -1
  386. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
  387. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
  388. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +3 -4
  389. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
  390. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  391. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +4 -6
  392. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  393. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  394. package/dist/lexical/theme/EditorTheme.js +1 -2
  395. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  396. package/dist/lexical/ui/icons/Caret/index.svg +2 -2
  397. package/dist/lexical/utils/nodeFormat.d.ts +2 -2
  398. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  399. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  400. package/dist/lexical/utils/rect.d.ts +4 -4
  401. package/dist/lexical/utils/rect.d.ts.map +1 -1
  402. package/dist/lexical/utils/rect.js.map +1 -1
  403. package/dist/lexical/utils/setFloatingElemPosition.d.ts +1 -1
  404. package/dist/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  405. package/dist/lexical/utils/setFloatingElemPosition.js +1 -1
  406. package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
  407. package/dist/lexical/utils/url.d.ts +5 -0
  408. package/dist/lexical/utils/url.d.ts.map +1 -1
  409. package/dist/lexical/utils/url.js +25 -5
  410. package/dist/lexical/utils/url.js.map +1 -1
  411. package/dist/populateGraphQL/populate.d.ts +3 -2
  412. package/dist/populateGraphQL/populate.d.ts.map +1 -1
  413. package/dist/populateGraphQL/populate.js +3 -1
  414. package/dist/populateGraphQL/populate.js.map +1 -1
  415. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
  416. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  417. package/dist/populateGraphQL/populateLexicalPopulationPromises.js +5 -4
  418. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  419. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
  420. package/dist/types.d.ts +20 -7
  421. package/dist/types.d.ts.map +1 -1
  422. package/dist/types.js.map +1 -1
  423. package/dist/utilities/createClientFeature.d.ts +3 -5
  424. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  425. package/dist/utilities/createClientFeature.js +1 -4
  426. package/dist/utilities/createClientFeature.js.map +1 -1
  427. package/dist/utilities/createServerFeature.d.ts +1 -0
  428. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  429. package/dist/utilities/createServerFeature.js +2 -0
  430. package/dist/utilities/createServerFeature.js.map +1 -1
  431. package/dist/utilities/fieldsDrawer/Drawer.d.ts +1 -0
  432. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
  433. package/dist/utilities/fieldsDrawer/Drawer.js +68 -27
  434. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  435. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  436. package/dist/utilities/fieldsDrawer/DrawerContent.js +115 -139
  437. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  438. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +13 -0
  439. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -0
  440. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +129 -0
  441. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -0
  442. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts +10 -0
  443. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -0
  444. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js +136 -0
  445. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -0
  446. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts +16 -0
  447. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -0
  448. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +144 -0
  449. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -0
  450. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  451. package/dist/utilities/generateImportMap.js +2 -3
  452. package/dist/utilities/generateImportMap.js.map +1 -1
  453. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  454. package/dist/utilities/generateSchemaMap.js +13 -10
  455. package/dist/utilities/generateSchemaMap.js.map +1 -1
  456. package/dist/utilities/initLexicalFeatures.d.ts +18 -0
  457. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -0
  458. package/dist/utilities/initLexicalFeatures.js +95 -0
  459. package/dist/utilities/initLexicalFeatures.js.map +1 -0
  460. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +1 -1
  461. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +1 -1
  462. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +1 -1
  463. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
  464. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts +1 -1
  465. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  466. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +5 -1
  467. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  468. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  469. package/dist/utilities/useLexicalFeature.js +12 -4
  470. package/dist/utilities/useLexicalFeature.js.map +1 -1
  471. package/dist/validate/index.d.ts.map +1 -1
  472. package/dist/validate/index.js +2 -2
  473. package/dist/validate/index.js.map +1 -1
  474. package/dist/validate/validateNodes.d.ts +2 -2
  475. package/dist/validate/validateNodes.d.ts.map +1 -1
  476. package/dist/validate/validateNodes.js +4 -4
  477. package/dist/validate/validateNodes.js.map +1 -1
  478. package/package.json +51 -49
  479. package/dist/cell/index.d.ts +0 -9
  480. package/dist/cell/index.d.ts.map +0 -1
  481. package/dist/cell/index.js +0 -135
  482. package/dist/cell/index.js.map +0 -1
  483. package/dist/exports/client/Field-63NGLPJB.js +0 -2
  484. package/dist/exports/client/Field-63NGLPJB.js.map +0 -7
  485. package/dist/exports/client/RelationshipComponent-3QWBV4GT.js +0 -2
  486. package/dist/exports/client/RelationshipComponent-3QWBV4GT.js.map +0 -7
  487. package/dist/exports/client/chunk-G5DTIOPI.js +0 -2
  488. package/dist/exports/client/chunk-G5DTIOPI.js.map +0 -7
  489. package/dist/exports/client/chunk-NI6Z4GBD.js +0 -2
  490. package/dist/exports/client/chunk-NI6Z4GBD.js.map +0 -7
  491. package/dist/exports/client/chunk-TO2W7Q2G.js +0 -2
  492. package/dist/exports/client/chunk-TO2W7Q2G.js.map +0 -7
  493. package/dist/exports/client/component-3OFD6Q4Z.js +0 -2
  494. package/dist/exports/client/component-3OFD6Q4Z.js.map +0 -7
  495. package/dist/exports/client/component-LCAAX56T.js +0 -2
  496. package/dist/exports/client/component-LCAAX56T.js.map +0 -7
  497. package/dist/exports/client/component-LLWMZU6K.js +0 -2
  498. package/dist/exports/client/component-LLWMZU6K.js.map +0 -7
  499. package/dist/exports/client/componentInline-72VZAAHP.js +0 -2
  500. package/dist/exports/client/componentInline-72VZAAHP.js.map +0 -7
  501. package/dist/features/createClientComponent.d.ts +0 -7
  502. package/dist/features/createClientComponent.d.ts.map +0 -1
  503. package/dist/features/createClientComponent.js +0 -13
  504. package/dist/features/createClientComponent.js.map +0 -1
  505. package/dist/features/createFeaturePropComponent.d.ts +0 -6
  506. package/dist/features/createFeaturePropComponent.d.ts.map +0 -1
  507. package/dist/features/createFeaturePropComponent.js +0 -19
  508. package/dist/features/createFeaturePropComponent.js.map +0 -1
  509. package/dist/utilities/generateComponentMap.d.ts +0 -6
  510. package/dist/utilities/generateComponentMap.d.ts.map +0 -1
  511. package/dist/utilities/generateComponentMap.js +0 -99
  512. package/dist/utilities/generateComponentMap.js.map +0 -1
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/field/Field.tsx", "../../../src/lexical/LexicalProvider.tsx", "../../../src/lexical/LexicalEditor.tsx", "../../../src/lexical/EditorPlugin.tsx", "../../../src/lexical/plugins/MarkdownShortcut/index.tsx", "../../../src/lexical/plugins/SlashMenu/index.tsx", "../../../src/lexical/plugins/SlashMenu/useMenuTriggerMatch.ts", "../../../src/lexical/plugins/handles/AddBlockHandlePlugin/index.tsx", "../../../src/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.ts", "../../../src/lexical/plugins/handles/utils/getNodeCloseToPoint.ts", "../../../src/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.ts", "../../../src/lexical/plugins/handles/utils/getCollapsedMargins.ts", "../../../src/lexical/plugins/handles/utils/getTopLevelNodeKeys.ts", "../../../src/lexical/plugins/handles/utils/isOnHandleElement.ts", "../../../src/lexical/plugins/handles/utils/doesLineHeightAffectElement.ts", "../../../src/lexical/plugins/handles/utils/setHandlePosition.ts", "../../../src/lexical/plugins/handles/DraggableBlockPlugin/index.tsx", "../../../src/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.ts", "../../../src/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.ts", "../../../src/lexical/ui/ContentEditable.tsx"],
4
- "sourcesContent": ["'use client'\nimport type { SerializedEditorState } from 'lexical'\n\nimport {\n FieldDescription,\n FieldError,\n FieldLabel,\n useField,\n useFieldProps,\n withCondition,\n} from '@payloadcms/ui'\nimport React, { useCallback } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalRichTextFieldProps } from '../types.js'\n\nimport { LexicalProvider } from '../lexical/LexicalProvider.js'\nimport './bundled.css'\nimport './index.scss'\nimport '../lexical/theme/EditorTheme.scss'\n\nconst baseClass = 'rich-text-lexical'\n\nconst RichTextComponent: React.FC<\n {\n readonly editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n } & LexicalRichTextFieldProps\n> = (props) => {\n const {\n descriptionProps,\n editorConfig,\n errorProps,\n field: {\n name,\n _path: pathFromProps,\n admin: {\n className,\n components: { Description, Error, Label },\n readOnly: readOnlyFromAdmin,\n style,\n width,\n } = {},\n label,\n required,\n },\n field,\n labelProps,\n readOnly: readOnlyFromTopLevelProps,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n } = props\n const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin\n\n const memoizedValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n return validate(value, { ...validationOptions, props, required })\n }\n },\n // Important: do not add props to the dependencies array.\n // This would cause an infinite loop and endless re-rendering.\n // Removing props from the dependencies array fixed this issue: https://github.com/payloadcms/payload/issues/3709\n [validate, required],\n )\n const { path: pathFromContext, readOnly: readOnlyFromContext } = useFieldProps()\n\n const fieldType = useField<SerializedEditorState>({\n path: pathFromContext ?? pathFromProps ?? name,\n validate: memoizedValidate,\n })\n\n const { formInitializing, formProcessing, initialValue, path, setValue, showError, value } =\n fieldType\n\n const disabled = readOnlyFromProps || readOnlyFromContext || formProcessing || formInitializing\n\n const classes = [\n baseClass,\n 'field-type',\n className,\n showError && 'error',\n disabled && `${baseClass}--read-only`,\n editorConfig?.admin?.hideGutter !== true ? `${baseClass}--show-gutter` : null,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n className={classes}\n key={path}\n style={{\n ...style,\n width,\n }}\n >\n <FieldError\n CustomError={Error}\n field={field}\n path={path}\n {...(errorProps || {})}\n alignCaret=\"left\"\n />\n <FieldLabel\n Label={Label}\n field={field}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <div className={`${baseClass}__wrap`}>\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n <LexicalProvider\n editorConfig={editorConfig}\n field={field}\n key={JSON.stringify({ initialValue, path })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={(editorState) => {\n let serializedEditorState = editorState.toJSON()\n\n // Transform state through save hooks\n if (editorConfig?.features?.hooks?.save?.length) {\n editorConfig.features.hooks.save.forEach((hook) => {\n serializedEditorState = hook({ incomingEditorState: serializedEditorState })\n })\n }\n\n setValue(serializedEditorState)\n }}\n path={path}\n readOnly={disabled}\n value={value}\n />\n </ErrorBoundary>\n <FieldDescription Description={Description} field={field} {...(descriptionProps || {})} />\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }): React.ReactElement {\n // Call resetErrorBoundary() to reset the error boundary and retry the render.\n\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error.message}</pre>\n </div>\n )\n}\n\nexport const RichText: typeof RichTextComponent = withCondition(RichTextComponent)\n", "'use client'\nimport type { InitialConfigType } from '@lexical/react/LexicalComposer.js'\nimport type { EditorState, LexicalEditor, SerializedEditorState } from 'lexical'\n\nimport { LexicalComposer } from '@lexical/react/LexicalComposer.js'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../types.js'\nimport type { SanitizedClientEditorConfig } from './config/types.js'\n\nimport { LexicalEditor as LexicalEditorComponent } from './LexicalEditor.js'\nimport {\n EditorConfigProvider,\n useEditorConfigContext,\n} from './config/client/EditorConfigProvider.js'\nimport { getEnabledNodes } from './nodes/index.js'\n\nexport type LexicalProviderProps = {\n editorConfig: SanitizedClientEditorConfig\n field: LexicalRichTextFieldProps['field']\n onChange: (editorState: EditorState, editor: LexicalEditor, tags: Set<string>) => void\n path: string\n readOnly: boolean\n value: SerializedEditorState\n}\n\nconst NestProviders = ({ children, providers }) => {\n if (!providers?.length) {\n return children\n }\n const Component = providers[0]\n if (providers.length > 1) {\n return (\n <Component>\n <NestProviders providers={providers.slice(1)}>{children}</NestProviders>\n </Component>\n )\n }\n return <Component>{children}</Component>\n}\n\nexport const LexicalProvider: React.FC<LexicalProviderProps> = (props) => {\n const { editorConfig, field, onChange, path, readOnly, value } = props\n\n const parentContext = useEditorConfigContext()\n\n const editorContainerRef = React.useRef<HTMLDivElement>(null)\n\n const processedValue = useMemo(() => {\n let processed = value\n if (editorConfig?.features?.hooks?.load?.length) {\n editorConfig.features.hooks.load.forEach((hook) => {\n processed = hook({ incomingEditorState: processed })\n })\n }\n return processed\n }, [editorConfig, value])\n\n // useMemo for the initialConfig that depends on readOnly and processedValue\n const initialConfig = useMemo<InitialConfigType>(() => {\n if (processedValue && typeof processedValue !== 'object') {\n throw new Error(\n 'The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: ' +\n JSON.stringify(processedValue),\n )\n }\n\n if (processedValue && Array.isArray(processedValue) && !('root' in processedValue)) {\n throw new Error(\n 'You have tried to pass in data from the old Slate editor to the new Lexical editor. The data structure is different, thus you will have to migrate your data. We offer a one-line migration script which migrates all your rich text fields: https://payloadcms.com/docs/beta/lexical/migration#migration-via-migration-script-recommended',\n )\n }\n\n if (processedValue && 'jsonContent' in processedValue) {\n throw new Error(\n 'You have tried to pass in data from payload-plugin-lexical. The data structure is different, thus you will have to migrate your data. Migration guide: https://payloadcms.com/docs/beta/lexical/migration#migrating-from-payload-plugin-lexical',\n )\n }\n\n return {\n editable: readOnly !== true,\n editorState: processedValue != null ? JSON.stringify(processedValue) : undefined,\n namespace: editorConfig.lexical.namespace,\n nodes: [...getEnabledNodes({ editorConfig })],\n onError: (error: Error) => {\n throw error\n },\n theme: editorConfig.lexical.theme,\n }\n }, [editorConfig, processedValue, readOnly])\n\n if (!initialConfig) {\n return <p>Loading...</p>\n }\n\n return (\n <LexicalComposer initialConfig={initialConfig} key={path}>\n <EditorConfigProvider\n editorConfig={editorConfig}\n editorContainerRef={editorContainerRef}\n field={field}\n parentContext={parentContext}\n >\n <NestProviders providers={editorConfig.features.providers}>\n <LexicalEditorComponent\n editorConfig={editorConfig}\n editorContainerRef={editorContainerRef}\n onChange={onChange}\n />\n </NestProviders>\n </EditorConfigProvider>\n </LexicalComposer>\n )\n}\n", "'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { LexicalErrorBoundary } from '@lexical/react/LexicalErrorBoundary.js'\nimport { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin.js'\nimport { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin.js'\nimport { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin.js'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin.js'\nimport { BLUR_COMMAND, COMMAND_PRIORITY_LOW, FOCUS_COMMAND } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useState } from 'react'\n\nimport type { LexicalProviderProps } from './LexicalProvider.js'\n\nimport { EditorPlugin } from './EditorPlugin.js'\nimport './LexicalEditor.scss'\nimport { useEditorConfigContext } from './config/client/EditorConfigProvider.js'\nimport { MarkdownShortcutPlugin } from './plugins/MarkdownShortcut/index.js'\nimport { SlashMenuPlugin } from './plugins/SlashMenu/index.js'\nimport { AddBlockHandlePlugin } from './plugins/handles/AddBlockHandlePlugin/index.js'\nimport { DraggableBlockPlugin } from './plugins/handles/DraggableBlockPlugin/index.js'\nimport { LexicalContentEditable } from './ui/ContentEditable.js'\n\nexport const LexicalEditor: React.FC<\n {\n editorContainerRef: React.RefObject<HTMLDivElement>\n } & Pick<LexicalProviderProps, 'editorConfig' | 'onChange'>\n> = (props) => {\n const { editorConfig, editorContainerRef, onChange } = props\n const editorConfigContext = useEditorConfigContext()\n const [editor] = useLexicalComposerContext()\n\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLDivElement | null>(null)\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem)\n }\n }\n\n useEffect(() => {\n if (!editorConfigContext?.uuid) {\n console.error('Lexical Editor must be used within an EditorConfigProvider')\n return\n }\n if (editorConfigContext?.parentEditor?.uuid) {\n editorConfigContext.parentEditor?.registerChild(editorConfigContext.uuid, editorConfigContext)\n }\n\n const handleFocus = () => {\n editorConfigContext.focusEditor(editorConfigContext)\n }\n\n const handleBlur = () => {\n editorConfigContext.blurEditor(editorConfigContext)\n }\n\n const unregisterFocus = editor.registerCommand<MouseEvent>(\n FOCUS_COMMAND,\n () => {\n handleFocus()\n return true\n },\n COMMAND_PRIORITY_LOW,\n )\n\n const unregisterBlur = editor.registerCommand<MouseEvent>(\n BLUR_COMMAND,\n () => {\n handleBlur()\n return true\n },\n COMMAND_PRIORITY_LOW,\n )\n\n return () => {\n unregisterFocus()\n unregisterBlur()\n editorConfigContext.parentEditor?.unregisterChild?.(editorConfigContext.uuid)\n }\n }, [editor, editorConfigContext])\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n return (\n <React.Fragment>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'aboveContainer') {\n return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n }\n })}\n <div className=\"editor-container\" ref={editorContainerRef}>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'top') {\n return (\n <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n <RichTextPlugin\n ErrorBoundary={LexicalErrorBoundary}\n contentEditable={\n <div className=\"editor-scroller\">\n <div className=\"editor\" ref={onRef}>\n <LexicalContentEditable />\n </div>\n </div>\n }\n />\n <OnChangePlugin\n // Selection changes can be ignored here, reducing the\n // frequency that the FieldComponent and Payload receive updates.\n // Selection changes are only needed if you are saving selection state\n ignoreSelectionChange\n onChange={(editorState, editor, tags) => {\n // Ignore any onChange event triggered by focus only\n if (!tags.has('focus') || tags.size > 1) {\n if (onChange != null) onChange(editorState, editor, tags)\n }\n }}\n />\n {floatingAnchorElem && (\n <React.Fragment>\n {!isSmallWidthViewport && editor.isEditable() && (\n <React.Fragment>\n <DraggableBlockPlugin anchorElem={floatingAnchorElem} />\n <AddBlockHandlePlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n {editorConfig.features.plugins.map((plugin) => {\n if (\n plugin.position === 'floatingAnchorElem' &&\n !(plugin.desktopOnly === true && isSmallWidthViewport)\n ) {\n return (\n <EditorPlugin\n anchorElem={floatingAnchorElem}\n clientProps={plugin.clientProps}\n key={plugin.key}\n plugin={plugin}\n />\n )\n }\n })}\n {editor.isEditable() && (\n <React.Fragment>\n <SlashMenuPlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n </React.Fragment>\n )}\n {editor.isEditable() && (\n <React.Fragment>\n <HistoryPlugin />\n {editorConfig?.features?.markdownTransformers?.length > 0 && <MarkdownShortcutPlugin />}\n </React.Fragment>\n )}\n\n <TabIndentationPlugin />\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'normal') {\n return (\n <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'bottom') {\n return (\n <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n </div>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'belowContainer') {\n return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n }\n })}\n </React.Fragment>\n )\n}\n", "'use client'\nimport React from 'react'\n\nimport type { SanitizedPlugin } from '../features/typesClient.js'\n\nexport const EditorPlugin: React.FC<{\n anchorElem?: HTMLDivElement\n clientProps: unknown\n plugin: SanitizedPlugin\n}> = ({ anchorElem, clientProps, plugin }) => {\n if (plugin.position === 'floatingAnchorElem') {\n return (\n plugin.Component && <plugin.Component anchorElem={anchorElem} clientProps={clientProps} />\n )\n }\n\n return plugin.Component && <plugin.Component clientProps={clientProps} />\n}\n", "'use client'\n\nimport { MarkdownShortcutPlugin as LexicalMarkdownShortcutPlugin } from '@lexical/react/LexicalMarkdownShortcutPlugin.js'\nimport * as React from 'react'\n\nimport { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'\n\nexport const MarkdownShortcutPlugin: React.FC = () => {\n const { editorConfig } = useEditorConfigContext()\n\n return <LexicalMarkdownShortcutPlugin transformers={editorConfig.features.markdownTransformers} />\n}\n", "'use client'\nimport type { TextNode } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useFieldProps, useTranslation } from '@payloadcms/ui'\nimport { useCallback, useMemo, useState } from 'react'\nimport * as React from 'react'\nimport * as ReactDOM from 'react-dom'\n\nimport type {\n SlashMenuGroup,\n SlashMenuGroupInternal,\n SlashMenuItemInternal,\n SlashMenuItem as SlashMenuItemType,\n} from './LexicalTypeaheadMenuPlugin/types.js'\n\nimport { useEditorConfigContext } from '../../config/client/EditorConfigProvider.js'\nimport { LexicalTypeaheadMenuPlugin } from './LexicalTypeaheadMenuPlugin/index.js'\nimport './index.scss'\nimport { useMenuTriggerMatch } from './useMenuTriggerMatch.js'\n\nconst baseClass = 'slash-menu-popup'\n\nfunction SlashMenuItem({\n isSelected,\n item,\n onClick,\n onMouseEnter,\n}: {\n index: number\n isSelected: boolean\n item: SlashMenuItemInternal\n onClick: () => void\n onMouseEnter: () => void\n}) {\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n const { schemaPath } = useFieldProps()\n\n const { i18n } = useTranslation()\n\n let className = `${baseClass}__item ${baseClass}__item-${item.key}`\n if (isSelected) {\n className += ` ${baseClass}__item--selected`\n }\n\n let title = item.key\n if (item.label) {\n title =\n typeof item.label === 'function'\n ? item.label({ i18n, richTextComponentMap, schemaPath })\n : item.label\n }\n // Crop title to max. 25 characters\n if (title.length > 25) {\n title = title.substring(0, 25) + '...'\n }\n\n return (\n <button\n aria-selected={isSelected}\n className={className}\n id={baseClass + '__item-' + item.key}\n key={item.key}\n onClick={onClick}\n onMouseEnter={onMouseEnter}\n ref={(element) => {\n item.ref = { current: element }\n }}\n role=\"option\"\n tabIndex={-1}\n type=\"button\"\n >\n {item?.Icon && <item.Icon />}\n\n <span className={`${baseClass}__item-text`}>{title}</span>\n </button>\n )\n}\n\nexport function SlashMenuPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n const [queryString, setQueryString] = useState<null | string>(null)\n const { editorConfig } = useEditorConfigContext()\n const { i18n } = useTranslation()\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n const { schemaPath } = useFieldProps()\n\n const checkForTriggerMatch = useMenuTriggerMatch('/', {\n minLength: 0,\n })\n\n const getDynamicItems = useCallback(() => {\n let groupWithItems: Array<SlashMenuGroup> = []\n\n for (const dynamicItem of editorConfig.features.slashMenu.dynamicGroups) {\n const dynamicGroupWithItems = dynamicItem({\n editor,\n queryString,\n })\n groupWithItems = groupWithItems.concat(dynamicGroupWithItems)\n }\n\n return groupWithItems\n }, [editor, queryString, editorConfig?.features])\n\n const groups: SlashMenuGroup[] = useMemo(() => {\n let groupsWithItems: SlashMenuGroup[] = []\n for (const groupWithItem of editorConfig?.features.slashMenu.groups ?? []) {\n groupsWithItems.push(groupWithItem)\n }\n\n if (queryString) {\n // Filter current groups first\n groupsWithItems = groupsWithItems.map((group) => {\n const filteredItems = group.items.filter((item) => {\n let itemTitle = item.key\n if (item.label) {\n itemTitle =\n typeof item.label === 'function'\n ? item.label({ i18n, richTextComponentMap, schemaPath })\n : item.label\n }\n\n if (new RegExp(queryString, 'gi').exec(itemTitle)) {\n return true\n }\n if (item.keywords != null) {\n return item.keywords.some((keyword) => new RegExp(queryString, 'gi').exec(keyword))\n }\n return false\n })\n if (filteredItems.length) {\n return {\n ...group,\n items: filteredItems,\n }\n }\n return null\n })\n\n groupsWithItems = groupsWithItems.filter((group) => group != null)\n\n // Now add dynamic groups\n const dynamicItemGroups = getDynamicItems()\n\n // merge dynamic items into groups\n for (const dynamicGroup of dynamicItemGroups) {\n // 1. find the group with the same name or create new one\n let group = groupsWithItems.find((group) => group.key === dynamicGroup.key)\n if (!group) {\n group = {\n ...dynamicGroup,\n items: [],\n }\n } else {\n groupsWithItems = groupsWithItems.filter((group) => group.key !== dynamicGroup.key)\n }\n\n // 2. Add items to group items array and add to sanitized.slashMenu.groupsWithItems\n if (group?.items?.length) {\n group.items = group.items.concat(group.items)\n }\n groupsWithItems.push(group)\n }\n }\n\n return groupsWithItems\n }, [getDynamicItems, queryString, editorConfig?.features, i18n])\n\n const onSelectItem = useCallback(\n (\n selectedItem: SlashMenuItemType,\n nodeToRemove: TextNode | null,\n closeMenu: () => void,\n matchingString: string,\n ) => {\n if (nodeToRemove) {\n editor.update(() => {\n nodeToRemove.remove()\n })\n }\n selectedItem.onSelect({ editor, queryString: matchingString })\n\n closeMenu()\n },\n [editor],\n )\n\n return (\n <LexicalTypeaheadMenuPlugin\n anchorElem={anchorElem}\n groups={groups as SlashMenuGroupInternal[]}\n menuRenderFn={(\n anchorElementRef,\n { selectItemAndCleanUp, selectedItemKey, setSelectedItemKey },\n ) =>\n anchorElementRef.current && groups.length\n ? ReactDOM.createPortal(\n <div className={baseClass}>\n {groups.map((group) => {\n let groupTitle = group.key\n if (group.label) {\n groupTitle =\n typeof group.label === 'function'\n ? group.label({ i18n, richTextComponentMap, schemaPath })\n : group.label\n }\n\n return (\n <div\n className={`${baseClass}__group ${baseClass}__group-${group.key}`}\n key={group.key}\n >\n <div className={`${baseClass}__group-title`}>{groupTitle}</div>\n {group.items.map((item, oi: number) => (\n <SlashMenuItem\n index={oi}\n isSelected={selectedItemKey === item.key}\n item={item as SlashMenuItemInternal}\n key={item.key}\n onClick={() => {\n setSelectedItemKey(item.key)\n selectItemAndCleanUp(item)\n }}\n onMouseEnter={() => {\n setSelectedItemKey(item.key)\n }}\n />\n ))}\n </div>\n )\n })}\n </div>,\n anchorElementRef.current,\n )\n : null\n }\n onQueryChange={setQueryString}\n onSelectItem={onSelectItem}\n triggerFn={checkForTriggerMatch}\n />\n )\n}\n", "'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useCallback } from 'react'\n\nimport { PUNCTUATION } from './LexicalTypeaheadMenuPlugin/index.js'\n\nexport type TriggerFn = ({\n editor,\n query,\n}: {\n editor: LexicalEditor\n /** The query string is the POTENTIAL trigger AND the text after the trigger text. */\n query: string\n}) => MenuTextMatch | null\n\nexport type MenuTextMatch = {\n leadOffset: number\n matchingString: string\n replaceableString: string\n}\n\n/**\n * Returns a function which checks if the trigger (e.g. '/') is present in the query and, if so, returns the matching string (text after the trigger)\n */\nexport function useMenuTriggerMatch(\n /**\n * Text which triggers the menu. Everything after this text will be used as the query.\n */\n trigger: string,\n { maxLength = 75, minLength = 1 }: { maxLength?: number; minLength?: number },\n): TriggerFn {\n return useCallback(\n ({ query }) => {\n const validChars = '[^' + trigger + PUNCTUATION + '\\\\s]'\n const TypeaheadTriggerRegex = new RegExp(\n '(^|\\\\s|\\\\()(' +\n '[' +\n trigger +\n ']' +\n '((?:' +\n validChars +\n '){0,' +\n maxLength +\n '})' +\n ')$',\n )\n const match = TypeaheadTriggerRegex.exec(query)\n if (match !== null) {\n const maybeLeadingWhitespace = match[1]\n\n /**\n * matchingString is only the text AFTER the trigger text. (So everything after the /)\n */\n const matchingString = match[3]\n\n if (matchingString.length >= minLength) {\n return {\n leadOffset: match.index + maybeLeadingWhitespace.length,\n matchingString,\n replaceableString: match[2], // replaceableString is the trigger text + the matching string\n }\n }\n }\n return null\n },\n [maxLength, minLength, trigger],\n )\n}\n", "'use client'\nimport type { LexicalEditor, LexicalNode, ParagraphNode } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $createParagraphNode } from 'lexical'\nimport * as React from 'react'\nimport { type JSX, useCallback, useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { isHTMLElement } from '../../../utils/guard.js'\nimport { Point } from '../../../utils/point.js'\nimport { ENABLE_SLASH_MENU_COMMAND } from '../../SlashMenu/LexicalTypeaheadMenuPlugin/index.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport './index.scss'\n\nconst ADD_BLOCK_MENU_CLASSNAME = 'add-block-menu'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction useAddBlockHandle(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const { editorConfig } = useEditorConfigContext()\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -24 : 12\n\n const menuRef = useRef<HTMLButtonElement>(null)\n const [hoveredElement, setHoveredElement] = useState<{\n elem: HTMLElement\n node: LexicalNode\n } | null>(null)\n\n useEffect(() => {\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n\n if (distanceFromScrollerElem === -1) {\n setHoveredElement(null)\n return\n }\n\n if (isOnHandleElement(target, ADD_BLOCK_MENU_CLASSNAME)) {\n return\n }\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _emptyBlockElem,\n blockNode,\n foundAtIndex,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n returnEmptyParagraphs: true,\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n })\n\n prevIndex = foundAtIndex\n\n if (!_emptyBlockElem) {\n return\n }\n if (hoveredElement?.node !== blockNode || hoveredElement?.elem !== _emptyBlockElem) {\n setHoveredElement({\n elem: _emptyBlockElem,\n node: blockNode,\n })\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, hoveredElement])\n\n useEffect(() => {\n if (menuRef.current && hoveredElement?.node) {\n setHandlePosition(\n hoveredElement?.elem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, hoveredElement, blockHandleHorizontalOffset])\n\n const handleAddClick = useCallback(\n (event) => {\n let hoveredElementToUse = hoveredElement\n if (!hoveredElementToUse?.node) {\n return\n }\n\n // 1. Update hoveredElement.node to a new paragraph node if the hoveredElement.node is not a paragraph node\n editor.update(() => {\n // Check if blockNode is an empty text node\n let isEmptyParagraph = true\n if (\n hoveredElementToUse.node.getType() !== 'paragraph' ||\n hoveredElementToUse.node.getTextContent() !== ''\n ) {\n isEmptyParagraph = false\n }\n\n if (!isEmptyParagraph) {\n const newParagraph = $createParagraphNode()\n hoveredElementToUse.node.insertAfter(newParagraph)\n\n setTimeout(() => {\n hoveredElementToUse = {\n elem: editor.getElementByKey(newParagraph.getKey()),\n node: newParagraph,\n }\n setHoveredElement(hoveredElementToUse)\n }, 0)\n }\n })\n\n // 2. Focus on the new paragraph node\n setTimeout(() => {\n editor.update(() => {\n editor.focus()\n\n if (\n hoveredElementToUse.node &&\n 'select' in hoveredElementToUse.node &&\n typeof hoveredElementToUse.node.select === 'function'\n ) {\n hoveredElementToUse.node.select()\n }\n })\n }, 1)\n\n // Make sure this is called AFTER the focusing has been processed by the browser\n // Otherwise, this won't work\n setTimeout(() => {\n editor.dispatchCommand(ENABLE_SLASH_MENU_COMMAND, {\n node: hoveredElementToUse.node as ParagraphNode,\n })\n }, 2)\n\n event.stopPropagation()\n event.preventDefault()\n },\n [editor, hoveredElement],\n )\n\n return createPortal(\n <React.Fragment>\n <button\n className=\"icon add-block-menu\"\n onClick={(event) => {\n handleAddClick(event)\n }}\n ref={menuRef}\n type=\"button\"\n >\n <div className={isEditable ? 'icon' : ''} />\n </button>\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function AddBlockHandlePlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useAddBlockHandle(editor, anchorElem, editor._editable)\n}\n", "'use client'\n/**\n * Calculate distance between scrollerElem and target if target is not in scrollerElem\n */\nexport const calculateDistanceFromScrollerElem = (\n scrollerElem: HTMLElement | null,\n pageX: number,\n pageY: number,\n target: HTMLElement,\n horizontalBuffer: number = 50,\n verticalBuffer: number = 25,\n): number => {\n let distanceFromScrollerElem = 0\n if (scrollerElem && !scrollerElem.contains(target)) {\n const { bottom, left, right, top } = scrollerElem.getBoundingClientRect()\n\n const adjustedTop = top + window.scrollY\n const adjustedBottom = bottom + window.scrollY\n\n if (\n pageY < adjustedTop - verticalBuffer ||\n pageY > adjustedBottom + verticalBuffer ||\n pageX < left - horizontalBuffer ||\n pageX > right + horizontalBuffer\n ) {\n return -1\n }\n\n // This is used to allow the _draggableBlockElem to be found when the mouse is in the\n // buffer zone around the scrollerElem.\n if (pageX < left || pageX > right) {\n distanceFromScrollerElem = pageX < left ? pageX - left : pageX - right\n }\n }\n return distanceFromScrollerElem\n}\n", "'use client'\nimport type { LexicalEditor, LexicalNode } from 'lexical'\n\nimport { $getNodeByKey } from 'lexical'\n\nimport { Point } from '../../../utils/point.js'\nimport { Rect } from '../../../utils/rect.js'\nimport { getBoundingClientRectWithoutTransform } from '../DraggableBlockPlugin/getBoundingRectWithoutTransform.js'\nimport { getCollapsedMargins } from '../utils/getCollapsedMargins.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\n\n// Directions\nconst Downward = 1\nconst Upward = -1\nconst Indeterminate = 0\n\ntype Props = {\n anchorElem: HTMLElement\n cache_threshold?: number\n editor: LexicalEditor\n /** fuzzy makes the search not exact. If no exact match found, find the closes node instead of returning null */\n fuzzy?: boolean\n horizontalOffset?: number\n point: Point\n /**\n * By default, empty paragraphs are not returned. Set this to true to return empty paragraphs. @default false\n */\n returnEmptyParagraphs?: boolean\n /**\n * The index to start searching from. It can be a considerable performance optimization to start searching from the index of the\n * previously found node, as the node is likely to be close to the next node.\n */\n startIndex?: number\n useEdgeAsDefault?: boolean\n verbose?: boolean\n}\n\ntype Output = {\n blockElem: HTMLElement | null\n blockNode: LexicalNode | null\n foundAtIndex: number\n isFoundNodeEmptyParagraph: boolean\n}\n\nconst cache = {\n props: null as Props | null,\n result: null as Output | null,\n}\n\nfunction isPointClose(previous: Point, current: Point, threshold: number = 20): boolean {\n const dx = previous.x - current.x\n const dy = previous.y - current.y\n return dx * dx + dy * dy <= threshold * threshold\n}\n\nexport function getNodeCloseToPoint(props: Props): Output {\n const {\n anchorElem,\n cache_threshold = 20,\n editor,\n fuzzy = false,\n horizontalOffset = 0,\n point: { x, y },\n startIndex = 0,\n useEdgeAsDefault = false,\n verbose = false,\n } = props\n\n // Use cache\n if (\n cache_threshold > 0 &&\n cache.props &&\n cache.result &&\n cache.props.fuzzy === props.fuzzy &&\n cache.props.horizontalOffset === props.horizontalOffset &&\n cache.props.useEdgeAsDefault === props.useEdgeAsDefault &&\n isPointClose(cache.props.point, props.point, cache_threshold)\n ) {\n return cache.result\n }\n\n const anchorElementRect = anchorElem.getBoundingClientRect()\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const closestBlockElem: {\n blockElem: HTMLElement | null\n blockNode: LexicalNode | null\n distance: number\n foundAtIndex: number\n isFoundNodeEmptyParagraph: boolean\n } = {\n blockElem: null,\n blockNode: null,\n distance: Infinity,\n foundAtIndex: -1,\n isFoundNodeEmptyParagraph: false,\n }\n\n // Return null if matching block element is the first or last node\n editor.getEditorState().read(() => {\n if (useEdgeAsDefault) {\n const [firstNode, lastNode] = [\n editor.getElementByKey(topLevelNodeKeys[0]),\n editor.getElementByKey(topLevelNodeKeys[topLevelNodeKeys.length - 1]),\n ]\n\n const [firstNodeRect, lastNodeRect] = [\n getBoundingClientRectWithoutTransform(firstNode),\n getBoundingClientRectWithoutTransform(lastNode),\n ]\n\n if (firstNodeRect && lastNodeRect) {\n if (y < firstNodeRect.top) {\n closestBlockElem.blockElem = firstNode\n closestBlockElem.distance = firstNodeRect.top - y\n closestBlockElem.blockNode = $getNodeByKey(topLevelNodeKeys[0])\n closestBlockElem.foundAtIndex = 0\n } else if (y > lastNodeRect.bottom) {\n closestBlockElem.distance = y - lastNodeRect.bottom\n closestBlockElem.blockNode = $getNodeByKey(topLevelNodeKeys[topLevelNodeKeys.length - 1])\n closestBlockElem.blockElem = lastNode\n closestBlockElem.foundAtIndex = topLevelNodeKeys.length - 1\n }\n\n if (closestBlockElem?.blockElem) {\n return {\n blockElem: null,\n isFoundNodeEmptyParagraph: false,\n } as Output\n }\n }\n }\n\n // Find matching block element\n let index = startIndex\n let direction = Indeterminate\n\n while (index >= 0 && index < topLevelNodeKeys.length) {\n const key = topLevelNodeKeys[index]\n const elem = editor.getElementByKey(key)\n if (elem === null) {\n break\n }\n const point = new Point(x + horizontalOffset, y)\n //const domRect = Rect.fromDOM(elem)\n // Do not consider transform of blocks when calculating distance\n const domRect = Rect.fromDOMRect(getBoundingClientRectWithoutTransform(elem))\n\n const { marginBottom, marginTop } = getCollapsedMargins(elem)\n\n const rect = domRect.generateNewRect({\n bottom: domRect.bottom + marginBottom,\n left: anchorElementRect.left,\n right: anchorElementRect.right,\n top: domRect.top - marginTop,\n })\n\n const { distance, isOnBottomSide, isOnTopSide } = rect.distanceFromPoint(point)\n\n if (distance === 0) {\n closestBlockElem.blockElem = elem\n closestBlockElem.blockNode = $getNodeByKey(key)\n closestBlockElem.foundAtIndex = index\n closestBlockElem.distance = distance\n\n // Check if blockNode is an empty text node\n if (\n closestBlockElem.blockNode &&\n closestBlockElem.blockNode.getType() === 'paragraph' &&\n closestBlockElem.blockNode.getTextContent() === ''\n ) {\n if (!fuzzy && !props.returnEmptyParagraphs) {\n closestBlockElem.blockElem = null\n closestBlockElem.blockNode = null\n }\n\n closestBlockElem.isFoundNodeEmptyParagraph = true\n }\n break\n } else if (fuzzy) {\n if (distance < closestBlockElem.distance) {\n closestBlockElem.blockElem = elem\n closestBlockElem.blockNode = $getNodeByKey(key)\n closestBlockElem.distance = distance\n closestBlockElem.foundAtIndex = index\n }\n }\n\n if (direction === Indeterminate) {\n if (isOnTopSide) {\n direction = Upward\n } else if (isOnBottomSide) {\n direction = Downward\n } else {\n // stop search block element\n direction = Infinity\n }\n }\n\n index += direction\n }\n })\n\n // Store in cache before returning\n cache.props = props\n cache.result = {\n blockElem: closestBlockElem.blockElem,\n blockNode: closestBlockElem.blockNode,\n foundAtIndex: closestBlockElem.foundAtIndex,\n isFoundNodeEmptyParagraph: closestBlockElem.isFoundNodeEmptyParagraph,\n }\n\n return {\n blockElem: closestBlockElem.blockElem,\n blockNode: closestBlockElem.blockNode,\n foundAtIndex: closestBlockElem.foundAtIndex,\n isFoundNodeEmptyParagraph: closestBlockElem.isFoundNodeEmptyParagraph,\n }\n}\n", "'use client'\nexport function getBoundingClientRectWithoutTransform(elem: HTMLElement): DOMRect {\n const rect = elem.getBoundingClientRect()\n\n // Extract the translation value from the transform style\n const transformValue = getComputedStyle(elem).getPropertyValue('transform')\n if (!transformValue || transformValue === 'none') {\n return rect\n }\n\n const lastNumberOfTransformValue = transformValue.split(',').pop()\n rect.y = rect.y - Number(lastNumberOfTransformValue.replace(')', ''))\n\n // Return the original bounding rect if no translation is applied\n return rect\n}\n", "'use client'\nexport function getCollapsedMargins(elem: HTMLElement): {\n marginBottom: number\n marginTop: number\n} {\n const getMargin = (element: Element | null, margin: 'marginBottom' | 'marginTop'): number =>\n element ? parseFloat(window.getComputedStyle(element)[margin]) : 0\n\n const { marginBottom, marginTop } = window.getComputedStyle(elem)\n const prevElemSiblingMarginBottom = getMargin(elem.previousElementSibling, 'marginBottom')\n const nextElemSiblingMarginTop = getMargin(elem.nextElementSibling, 'marginTop')\n const collapsedTopMargin = Math.max(parseFloat(marginTop), prevElemSiblingMarginBottom)\n const collapsedBottomMargin = Math.max(parseFloat(marginBottom), nextElemSiblingMarginTop)\n\n return { marginBottom: collapsedBottomMargin, marginTop: collapsedTopMargin }\n}\n", "'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { $getRoot } from 'lexical'\n\nexport function getTopLevelNodeKeys(editor: LexicalEditor): string[] {\n return editor.getEditorState().read(() => $getRoot().getChildrenKeys())\n}\n", "'use client'\nexport function isOnHandleElement(element: HTMLElement, handleElementClassName: string): boolean {\n return !!element.closest(`.${handleElementClassName}`)\n}\n", "'use client'\nconst replacedElements = [\n 'IMG',\n 'INPUT',\n 'TEXTAREA',\n 'SELECT',\n 'BUTTON',\n 'VIDEO',\n 'OBJECT',\n 'EMBED',\n 'IFRAME',\n 'HR',\n]\n\n/**\n * From ChatGPT, only that verified it works for HR elements.\n *\n * HTML Elements can have CSS lineHeight applied to them, but it doesn't always affect the visual layout.\n * This function checks if the line-height property has an effect on the element's layout.\n * @param htmlElem\n */\nexport function doesLineHeightAffectElement(htmlElem: HTMLElement) {\n if (!htmlElem) return false\n\n // Check for replaced elements, elements that typically don't support line-height adjustments,\n // and elements without visible content\n\n if (\n replacedElements.includes(htmlElem.tagName) ||\n htmlElem.offsetHeight === 0 ||\n htmlElem.offsetWidth === 0\n ) {\n return false\n }\n\n // Check for specific CSS properties that negate line-height's visual effects\n const style = window.getComputedStyle(htmlElem)\n if (\n style.display === 'table-cell' ||\n style.position === 'absolute' ||\n style.visibility === 'hidden' ||\n style.opacity === '0'\n ) {\n return false\n }\n\n // This is a basic check, and there can be more complex scenarios where line-height doesn't have an effect.\n return true\n}\n", "'use client'\nimport { doesLineHeightAffectElement } from './doesLineHeightAffectElement.js'\n\nexport function setHandlePosition(\n targetElem: HTMLElement | null,\n handleElem: HTMLElement,\n anchorElem: HTMLElement,\n leftOffset: number = 0, // SPACE\n) {\n if (!targetElem) {\n handleElem.style.opacity = '0'\n handleElem.style.transform = 'translate(-10000px, -10000px)'\n return\n }\n\n const targetRect = targetElem.getBoundingClientRect()\n const targetStyle = window.getComputedStyle(targetElem)\n const floatingElemRect = handleElem.getBoundingClientRect()\n const anchorElementRect = anchorElem.getBoundingClientRect()\n\n let top: number\n\n const shouldDisplayHandleInCenter = targetRect.height < 60\n\n if (!shouldDisplayHandleInCenter) {\n // No need to let line height affect the re-positioning of the floating element if line height has no\n // visual effect on the element. Otherwise, the floating element will be positioned incorrectly.\n const actualLineHeight = doesLineHeightAffectElement(targetElem)\n ? parseInt(targetStyle.lineHeight, 10)\n : 0\n\n top =\n targetRect.top + (actualLineHeight - floatingElemRect.height) / 2 - anchorElementRect.top - 1 // 1px inaccuracy\n } else {\n top =\n targetRect.top -\n floatingElemRect.height / 2 -\n anchorElementRect.top +\n targetRect.height / 2 -\n 1 // 1px inaccuracy\n }\n\n const left = leftOffset\n\n handleElem.style.opacity = '1'\n handleElem.style.transform = `translate(${left}px, ${top}px)`\n}\n", "'use client'\nimport type { LexicalEditor } from 'lexical'\nimport type { DragEvent as ReactDragEvent } from 'react'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { eventFiles } from '@lexical/rich-text'\nimport { $getNearestNodeFromDOMNode, $getNodeByKey } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport { useEditorConfigContext } from '../../../config/client/EditorConfigProvider.js'\nimport { isHTMLElement } from '../../../utils/guard.js'\nimport { Point } from '../../../utils/point.js'\nimport { calculateDistanceFromScrollerElem } from '../utils/calculateDistanceFromScrollerElem.js'\nimport { getNodeCloseToPoint } from '../utils/getNodeCloseToPoint.js'\nimport { getTopLevelNodeKeys } from '../utils/getTopLevelNodeKeys.js'\nimport { isOnHandleElement } from '../utils/isOnHandleElement.js'\nimport { setHandlePosition } from '../utils/setHandlePosition.js'\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\nimport './index.scss'\nimport { setTargetLine } from './setTargetLine.js'\n\nconst DRAGGABLE_BLOCK_MENU_CLASSNAME = 'draggable-block-menu'\nconst DRAG_DATA_FORMAT = 'application/x-lexical-drag-block'\n\nlet prevIndex = Infinity\n\nfunction getCurrentIndex(keysLength: number): number {\n if (keysLength === 0) {\n return Infinity\n }\n if (prevIndex >= 0 && prevIndex < keysLength) {\n return prevIndex\n }\n\n return Math.floor(keysLength / 2)\n}\n\nfunction setDragImage(dataTransfer: DataTransfer, draggableBlockElem: HTMLElement) {\n const { transform } = draggableBlockElem.style\n\n // Remove dragImage borders\n dataTransfer.setDragImage(draggableBlockElem, 0, 0)\n\n setTimeout(() => {\n draggableBlockElem.style.transform = transform\n })\n}\n\nfunction hideTargetLine(\n targetLineElem: HTMLElement | null,\n lastTargetBlockElem: HTMLElement | null,\n) {\n if (targetLineElem) {\n targetLineElem.style.opacity = '0'\n }\n if (lastTargetBlockElem) {\n lastTargetBlockElem.style.opacity = ''\n // Delete marginBottom and marginTop values we set\n lastTargetBlockElem.style.marginBottom = ''\n lastTargetBlockElem.style.marginTop = ''\n //lastTargetBlock.style.border = 'none'\n }\n}\n\nfunction useDraggableBlockMenu(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n isEditable: boolean,\n): React.ReactElement {\n const scrollerElem = anchorElem.parentElement\n\n const menuRef = useRef<HTMLDivElement>(null)\n const targetLineRef = useRef<HTMLDivElement>(null)\n const debugHighlightRef = useRef<HTMLDivElement>(null)\n const isDraggingBlockRef = useRef<boolean>(false)\n const [draggableBlockElem, setDraggableBlockElem] = useState<HTMLElement | null>(null)\n const [lastTargetBlock, setLastTargetBlock] = useState<{\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n }>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const blockHandleHorizontalOffset = editorConfig?.admin?.hideGutter ? -44 : -8\n\n useEffect(() => {\n /**\n * Handles positioning of the drag handle\n */\n function onDocumentMouseMove(event: MouseEvent) {\n const target = event.target\n if (!isHTMLElement(target)) {\n return\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n )\n if (distanceFromScrollerElem === -1) {\n setDraggableBlockElem(null)\n return\n }\n\n if (isOnHandleElement(target, DRAGGABLE_BLOCK_MENU_CLASSNAME)) {\n return\n }\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: _draggableBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n cache_threshold: 0,\n editor,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: false,\n verbose: false,\n })\n\n prevIndex = foundAtIndex\n\n //if (DEBUG && _draggableBlockElem) {\n //targetBlockElem.style.border = '3px solid red'\n // highlightElemOriginalPosition(debugHighlightRef, _draggableBlockElem, anchorElem)\n //}\n\n if (!_draggableBlockElem && !isFoundNodeEmptyParagraph) {\n return\n }\n\n if (draggableBlockElem !== _draggableBlockElem) {\n setDraggableBlockElem(_draggableBlockElem)\n }\n }\n\n // Since the draggableBlockElem is outside the actual editor, we need to listen to the document\n // to be able to detect when the mouse is outside the editor and respect a buffer around\n // the scrollerElem to avoid the draggableBlockElem disappearing too early.\n document?.addEventListener('mousemove', onDocumentMouseMove)\n\n return () => {\n document?.removeEventListener('mousemove', onDocumentMouseMove)\n }\n }, [scrollerElem, anchorElem, editor, draggableBlockElem])\n\n useEffect(() => {\n if (menuRef.current) {\n setHandlePosition(\n draggableBlockElem,\n menuRef.current,\n anchorElem,\n blockHandleHorizontalOffset,\n )\n }\n }, [anchorElem, draggableBlockElem, blockHandleHorizontalOffset])\n\n useEffect(() => {\n function onDragover(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n\n const { pageY, target } = event\n if (!isHTMLElement(target)) {\n return false\n }\n\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const topLevelNodeKeys = getTopLevelNodeKeys(editor)\n\n const {\n blockElem: targetBlockElem,\n foundAtIndex,\n isFoundNodeEmptyParagraph,\n } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n startIndex: getCurrentIndex(topLevelNodeKeys.length),\n useEdgeAsDefault: true,\n verbose: true,\n })\n\n prevIndex = foundAtIndex\n\n const targetLineElem = targetLineRef.current\n // targetBlockElem === null shouldn't happen\n if (targetBlockElem === null || targetLineElem === null) {\n return false\n }\n\n if (draggableBlockElem !== targetBlockElem) {\n const { isBelow, willStayInSamePosition } = setTargetLine(\n editorConfig?.admin?.hideGutter ? '0px' : '3rem',\n blockHandleHorizontalOffset +\n (editorConfig?.admin?.hideGutter\n ? menuRef?.current?.getBoundingClientRect()?.width ?? 0\n : -(menuRef?.current?.getBoundingClientRect()?.width ?? 0)),\n targetLineElem,\n targetBlockElem,\n lastTargetBlock,\n pageY,\n anchorElem,\n event,\n debugHighlightRef,\n isFoundNodeEmptyParagraph,\n )\n\n // Prevent default event to be able to trigger onDrop events\n // Calling preventDefault() adds the green plus icon to the cursor,\n // indicating that the drop is allowed.\n event.preventDefault()\n\n if (!willStayInSamePosition) {\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow,\n })\n }\n } else {\n hideTargetLine(targetLineElem, lastTargetBlock?.elem)\n setLastTargetBlock({\n boundingBox: targetBlockElem.getBoundingClientRect(),\n elem: targetBlockElem,\n isBelow: false,\n })\n }\n\n return true\n }\n\n function onDrop(event: DragEvent): boolean {\n if (!isDraggingBlockRef.current) {\n return false\n }\n const [isFileTransfer] = eventFiles(event)\n if (isFileTransfer) {\n return false\n }\n const { dataTransfer, pageY, target } = event\n const dragData = dataTransfer?.getData(DRAG_DATA_FORMAT) || ''\n\n editor.update(() => {\n const draggedNode = $getNodeByKey(dragData)\n if (!draggedNode) {\n return false\n }\n if (!isHTMLElement(target)) {\n return false\n }\n const distanceFromScrollerElem = calculateDistanceFromScrollerElem(\n scrollerElem,\n event.pageX,\n event.pageY,\n target,\n 100,\n 50,\n )\n\n const { blockElem: targetBlockElem, isFoundNodeEmptyParagraph } = getNodeCloseToPoint({\n anchorElem,\n editor,\n fuzzy: true,\n horizontalOffset: -distanceFromScrollerElem,\n point: new Point(event.x, event.y),\n useEdgeAsDefault: true,\n })\n\n if (!targetBlockElem) {\n return false\n }\n const targetNode = $getNearestNodeFromDOMNode(targetBlockElem)\n if (!targetNode) {\n return false\n }\n if (targetNode === draggedNode) {\n return true\n }\n\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n getBoundingClientRectWithoutTransform(targetBlockElem)\n\n const mouseY = pageY\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n targetNode.insertAfter(draggedNode)\n } else {\n // above targetBlockElem\n targetNode.insertBefore(draggedNode)\n }\n } else {\n //\n targetNode.insertBefore(draggedNode)\n targetNode.remove()\n }\n\n /*\n if (pageY >= targetBlockElemTop + targetBlockElemHeight / 2) {\n targetNode.insertAfter(draggedNode)\n } else {\n targetNode.insertBefore(draggedNode)\n }*/\n if (draggableBlockElem !== null) {\n setDraggableBlockElem(null)\n }\n\n // find all previous elements with lexical-block-highlighter class and remove them\n const allPrevHighlighters = document.querySelectorAll('.lexical-block-highlighter')\n allPrevHighlighters.forEach((highlighter) => {\n highlighter.remove()\n })\n\n const newInsertedElem = editor.getElementByKey(draggedNode.getKey())\n setTimeout(() => {\n // add new temp html element to newInsertedElem with the same height and width and the class block-selected\n // to highlight the new inserted element\n const newInsertedElemRect = newInsertedElem.getBoundingClientRect()\n\n const highlightElem = document.createElement('div')\n highlightElem.className = 'lexical-block-highlighter'\n\n // if html data-theme is dark, set the highlighter color to white\n if (document.documentElement.getAttribute('data-theme') === 'dark') {\n highlightElem.style.backgroundColor = 'white'\n } else {\n highlightElem.style.backgroundColor = 'black'\n }\n\n highlightElem.style.transition = 'opacity 0.1s ease-in-out'\n highlightElem.style.zIndex = '1'\n highlightElem.style.pointerEvents = 'none'\n highlightElem.style.boxSizing = 'border-box'\n highlightElem.style.borderRadius = '4px'\n highlightElem.style.position = 'absolute'\n document.body.appendChild(highlightElem)\n\n highlightElem.style.opacity = '0.1'\n\n highlightElem.style.height = `${newInsertedElemRect.height + 8}px`\n highlightElem.style.width = `${newInsertedElemRect.width + 8}px`\n highlightElem.style.top = `${newInsertedElemRect.top + window.scrollY - 4}px`\n highlightElem.style.left = `${newInsertedElemRect.left - 4}px`\n\n setTimeout(() => {\n highlightElem.style.opacity = '0'\n setTimeout(() => {\n highlightElem.remove()\n }, 1000)\n }, 3000)\n }, 120)\n })\n\n return true\n }\n\n // register onDragover event listeners:\n document.addEventListener('dragover', onDragover)\n // register onDrop event listeners:\n document.addEventListener('drop', onDrop)\n\n return () => {\n document.removeEventListener('dragover', onDragover)\n document.removeEventListener('drop', onDrop)\n }\n }, [\n scrollerElem,\n blockHandleHorizontalOffset,\n anchorElem,\n editor,\n lastTargetBlock,\n draggableBlockElem,\n editorConfig?.admin?.hideGutter,\n ])\n\n function onDragStart(event: ReactDragEvent<HTMLDivElement>): void {\n const dataTransfer = event.dataTransfer\n if (!dataTransfer || !draggableBlockElem) {\n return\n }\n setDragImage(dataTransfer, draggableBlockElem)\n let nodeKey = ''\n editor.update(() => {\n const node = $getNearestNodeFromDOMNode(draggableBlockElem)\n if (node) {\n nodeKey = node.getKey()\n }\n })\n isDraggingBlockRef.current = true\n dataTransfer.setData(DRAG_DATA_FORMAT, nodeKey)\n }\n\n function onDragEnd(): void {\n isDraggingBlockRef.current = false\n hideTargetLine(targetLineRef.current, lastTargetBlock?.elem)\n }\n\n return createPortal(\n <React.Fragment>\n <div\n className=\"icon draggable-block-menu\"\n draggable\n onDragEnd={onDragEnd}\n onDragStart={onDragStart}\n ref={menuRef}\n >\n <div className={isEditable ? 'icon' : ''} />\n </div>\n <div className=\"draggable-block-target-line\" ref={targetLineRef} />\n <div className=\"debug-highlight\" ref={debugHighlightRef} />\n </React.Fragment>,\n anchorElem,\n )\n}\n\nexport function DraggableBlockPlugin({\n anchorElem = document.body,\n}: {\n anchorElem?: HTMLElement\n}): React.ReactElement {\n const [editor] = useLexicalComposerContext()\n return useDraggableBlockMenu(editor, anchorElem, editor._editable)\n}\n", "'use client'\nimport type React from 'react'\n\nimport { getBoundingClientRectWithoutTransform } from './getBoundingRectWithoutTransform.js'\n\nexport function highlightElemOriginalPosition(\n debugHighlightRef: React.RefObject<HTMLDivElement | null>,\n htmlElem: HTMLElement,\n anchorElem: HTMLElement,\n) {\n if (!debugHighlightRef.current) {\n // If the ref doesn't point to an existing element, we can't set styles\n return\n }\n\n const { left: anchorLeft, top: anchorTop } = anchorElem.getBoundingClientRect()\n\n // Get computed styles of the given element\n const boundingRect = getBoundingClientRectWithoutTransform(htmlElem)\n\n // Extract necessary styles (ignoring transform)\n const width = boundingRect.width\n const height = boundingRect.height\n const top = boundingRect.top - anchorTop\n const left = boundingRect.left - anchorLeft\n\n debugHighlightRef.current.style.border = '2px solid green'\n debugHighlightRef.current.style.boxSizing = 'border-box'\n debugHighlightRef.current.style.height = height + 'px'\n debugHighlightRef.current.style.pointerEvents = 'none'\n debugHighlightRef.current.style.position = 'absolute'\n debugHighlightRef.current.style.top = top + 'px'\n debugHighlightRef.current.style.left = left + 'px'\n debugHighlightRef.current.style.width = width + 'px'\n debugHighlightRef.current.style.zIndex = '1000'\n debugHighlightRef.current.style.opacity = '0.5'\n}\n", "'use client'\nimport { getCollapsedMargins } from '../utils/getCollapsedMargins.js'\nimport { highlightElemOriginalPosition } from './highlightElemOriginalPosition.js'\nconst TARGET_LINE_HALF_HEIGHT = 25\nconst TEXT_BOX_HORIZONTAL_PADDING = -24\nconst DEBUG = false\n\nlet animationTimer = 0\n\nexport function setTargetLine(\n offsetWidth: string,\n offsetLeft: number,\n targetLineElem: HTMLElement,\n targetBlockElem: HTMLElement,\n lastTargetBlock: {\n boundingBox?: DOMRect\n elem: HTMLElement | null\n isBelow: boolean\n },\n mouseY: number,\n anchorElem: HTMLElement,\n event: DragEvent,\n debugHighlightRef: React.RefObject<HTMLDivElement | null>,\n isFoundNodeEmptyParagraph: boolean = false,\n) {\n const { height: targetBlockElemHeight, top: targetBlockElemTop } =\n targetBlockElem.getBoundingClientRect() // used to be getBoundingClientRectWithoutTransform. Not sure what's better, but the normal getBoundingClientRect seems to work fine\n const { top: anchorTop, width: anchorWidth } = anchorElem.getBoundingClientRect()\n\n const { marginBottom, marginTop } = getCollapsedMargins(targetBlockElem)\n let lineTop = targetBlockElemTop\n\n const isBelow = mouseY >= targetBlockElemTop + targetBlockElemHeight / 2 + window.scrollY\n\n let willStayInSamePosition = false\n\n /**\n * Do not run any transform or changes if the actual new line position would be the same (even if it's now inserted BEFORE rather than AFTER - position would still be the same)\n * This prevents unnecessary flickering.\n *\n * We still need to let it run even if the position (IGNORING the transform) would not change, as the transform animation is not finished yet. This is what animationTimer does. Otherwise, the positioning will be inaccurate\n */\n if (lastTargetBlock?.elem) {\n if (targetBlockElem !== lastTargetBlock?.elem) {\n if (\n isBelow &&\n lastTargetBlock?.elem &&\n lastTargetBlock?.elem === targetBlockElem.nextElementSibling\n ) {\n animationTimer++\n\n if (animationTimer < 200) {\n willStayInSamePosition = true\n }\n } else if (\n !isBelow &&\n lastTargetBlock?.elem &&\n lastTargetBlock?.elem === targetBlockElem.previousElementSibling\n ) {\n animationTimer++\n if (animationTimer < 200) {\n willStayInSamePosition = true\n }\n }\n } else {\n animationTimer++\n\n const lastBoundingBoxPosition = lastTargetBlock?.boundingBox?.y\n const currentBoundingBoxPosition = targetBlockElem.getBoundingClientRect().y\n\n if (\n (isBelow === lastTargetBlock?.isBelow &&\n lastBoundingBoxPosition === currentBoundingBoxPosition) ||\n animationTimer < 200\n ) {\n willStayInSamePosition = false\n }\n }\n }\n if (willStayInSamePosition) {\n return {\n isBelow,\n willStayInSamePosition,\n }\n }\n\n /**\n * Paragraphs need no isBelow/above handling,\n */\n if (!isFoundNodeEmptyParagraph) {\n //if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n // below targetBlockElem\n lineTop += targetBlockElemHeight + marginBottom / 2\n } else {\n // above targetBlockElem\n lineTop -= marginTop / 2\n }\n } else {\n lineTop += targetBlockElemHeight / 2\n }\n\n let targetElemTranslate2 = 0\n\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n targetElemTranslate2 = -TARGET_LINE_HALF_HEIGHT\n } else {\n targetElemTranslate2 = TARGET_LINE_HALF_HEIGHT\n }\n }\n\n const top = lineTop - anchorTop + targetElemTranslate2\n\n const left = TEXT_BOX_HORIZONTAL_PADDING - offsetLeft\n\n targetLineElem.style.width = `calc(${anchorWidth}px - ${offsetWidth})`\n targetLineElem.style.opacity = '.4'\n\n /**\n * Move around element below or above the line (= the target / targetBlockElem). Creates \"space\" for the targetLineElem\n *\n * Not needed for empty paragraphs, as an empty paragraph is enough space for the targetLineElem anyways.\n */\n //targetBlockElem.style.opacity = '0.4'\n const buffer = 12 // creates more spacing/padding so target line is not directly next to the targetBlockElem\n if (!isFoundNodeEmptyParagraph) {\n if (isBelow) {\n targetBlockElem.style.marginBottom = TARGET_LINE_HALF_HEIGHT * 2 + buffer + 'px'\n targetLineElem.style.transform = `translate(${left}px, calc(${top}px - ${'0px'}))`\n } else {\n targetBlockElem.style.marginTop = TARGET_LINE_HALF_HEIGHT * 2 + buffer + 'px'\n targetLineElem.style.transform = `translate(${left}px, calc(${top - TARGET_LINE_HALF_HEIGHT * 2}px - ${'0px'}))`\n }\n } else {\n targetLineElem.style.transform = `translate(${left}px, ${top - TARGET_LINE_HALF_HEIGHT}px)`\n }\n\n if (DEBUG) {\n //targetBlockElem.style.border = '3px solid red'\n highlightElemOriginalPosition(debugHighlightRef, targetBlockElem, anchorElem)\n }\n\n /**\n * Properly reset previous targetBlockElem styles\n */\n lastTargetBlock.elem.style.opacity = ''\n\n if (lastTargetBlock?.elem === targetBlockElem) {\n if (isBelow) {\n lastTargetBlock.elem.style.marginTop = ''\n } else {\n lastTargetBlock.elem.style.marginBottom = ''\n }\n } else {\n lastTargetBlock.elem.style.marginBottom = ''\n lastTargetBlock.elem.style.marginTop = ''\n }\n animationTimer = 0\n return {\n isBelow,\n willStayInSamePosition,\n }\n}\n", "'use client'\nimport type { JSX } from 'react'\n\nimport { ContentEditable } from '@lexical/react/LexicalContentEditable.js'\nimport { useTranslation } from '@payloadcms/ui'\nimport * as React from 'react'\n\nimport './ContentEditable.scss'\n\nexport function LexicalContentEditable({ className }: { className?: string }): JSX.Element {\n const { t } = useTranslation<{}, string>()\n\n return (\n <ContentEditable\n aria-placeholder={t('lexical:general:placeholder')}\n className={className ?? 'ContentEditable__root'}\n placeholder={<p className=\"editor-placeholder\">{t('lexical:general:placeholder')}</p>}\n />\n )\n}\n"],
5
- "mappings": "uMAGA,OACEA,oBAAAA,GACAC,cAAAA,GACAC,cAAAA,GACAC,YAAAA,GACAC,iBAAAA,GACAC,iBAAAA,OACK,iBACP,OAAgBC,eAAAA,OAAmB,QACnC,OAASC,iBAAAA,OAAqB,+DCR9B,OAASC,mBAAAA,OAAuB,oCAChC,UAAYC,OAAW,QACvB,OAASC,WAAAA,OAAe,QCNxB,OAAAC,KAAAC,OAAA,4EACA,OAASC,6BAAAA,OAAiC,2CAC1C,OAASC,wBAAAA,OAA4B,yCACrC,OAASC,iBAAAA,OAAqB,yCAC9B,OAASC,kBAAAA,OAAsB,0CAC/B,OAASC,kBAAAA,OAAsB,0CAC/B,OAASC,wBAAAA,OAA4B,gDACrC,OAASC,gBAAAA,GAAcC,wBAAAA,GAAsBC,iBAAAA,OAAqB,UAClE,UAAYC,OAAW,QACvB,OAASC,aAAAA,GAAWC,YAAAA,OAAgB,iDCRpC,MAAkB,QAIX,IAAMC,EAIRA,CAAC,CAAEC,WAAAA,EAAYC,YAAAA,EAAaC,OAAAA,CAAM,IACjCA,EAAOC,WAAa,qBAEpBD,EAAOE,WAAaC,GAACH,EAAOE,UAAS,CAACJ,WAAYA,EAAYC,YAAaA,IAIxEC,EAAOE,WAAaC,GAACH,EAAOE,UAAS,CAACH,YAAaA,IChB5D,OAAAK,KAAAC,OAAA,kEAEA,OAASC,0BAA0BC,OAAqC,kDACxE,MAAuB,QAIhB,IAAMC,GAAmCA,IAAA,CAAA,IAAAC,EAAAC,GAAA,CAAA,EAC9C,CAAAC,aAAAA,CAAA,EAAyBC,EAAA,EAAAC,EAAA,OAAAJ,EAAA,CAAA,IAAAE,EAAAG,SAAAC,sBAElBF,EAAAG,GAAAC,GAAA,CAAAC,aAA6CP,EA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AIF,EAAMG,YAG3C,CAEO,IAAMC,GAAqCC,GAAc3E,EAAA",
6
- "names": ["FieldDescription", "FieldError", "FieldLabel", "useField", "useFieldProps", "withCondition", "useCallback", "ErrorBoundary", "LexicalComposer", "React", "useMemo", "c", "_c", "useLexicalComposerContext", "LexicalErrorBoundary", "HistoryPlugin", "OnChangePlugin", "RichTextPlugin", "TabIndentationPlugin", "BLUR_COMMAND", "COMMAND_PRIORITY_LOW", "FOCUS_COMMAND", "React", "useEffect", "useState", "EditorPlugin", "anchorElem", "clientProps", "plugin", "position", "Component", "_jsx", "c", "_c", "MarkdownShortcutPlugin", "LexicalMarkdownShortcutPlugin", "MarkdownShortcutPlugin", "$", "_c", "editorConfig", "useEditorConfigContext", "t0", "features", "markdownTransformers", "_jsx", "LexicalMarkdownShortcutPlugin", "transformers", "useLexicalComposerContext", "useFieldProps", "useTranslation", "useCallback", "useMemo", "useState", "ReactDOM", "c", "_c", "useMenuTriggerMatch", "trigger", "t0", "$", "_c", "maxLength", "t1", "minLength", "t2", "undefined", "t3", "t4", "query", "validChars", "PUNCTUATION", "match", "RegExp", "exec", "maybeLeadingWhitespace", "matchingString", "length", "leadOffset", "index", "replaceableString", "baseClass", "SlashMenuItem", "isSelected", "item", "onClick", "onMouseEnter", "field", "richTextComponentMap", "useEditorConfigContext", "schemaPath", "useFieldProps", "i18n", "useTranslation", "className", "key", "title", "label", "length", "substring", "_jsxs", "id", "ref", "element", "current", "role", "tabIndex", "type", "Icon", "_jsx", "SlashMenuPlugin", "anchorElem", "document", "body", "editor", "useLexicalComposerContext", "queryString", "setQueryString", "useState", "editorConfig", "checkForTriggerMatch", "useMenuTriggerMatch", "minLength", "getDynamicItems", "useCallback", "groupWithItems", "dynamicItem", "features", "slashMenu", "dynamicGroups", "dynamicGroupWithItems", "concat", "groups", "useMemo", "groupsWithItems", "groupWithItem", "push", "map", "group", "filteredItems", "items", "filter", "itemTitle", "RegExp", "exec", "keywords", "some", "keyword", "dynamicItemGroups", "dynamicGroup", "find", "onSelectItem", "selectedItem", "nodeToRemove", "closeMenu", "matchingString", "update", "remove", "onSelect", "LexicalTypeaheadMenuPlugin", "menuRenderFn", "anchorElementRef", "selectItemAndCleanUp", "selectedItemKey", "setSelectedItemKey", "createPortal", "groupTitle", "oi", "index", "onQueryChange", "triggerFn", "c", "_c", "useLexicalComposerContext", "$createParagraphNode", "React", "useEffect", "useRef", "useState", "createPortal", "calculateDistanceFromScrollerElem", "scrollerElem", "pageX", "pageY", "target", "horizontalBuffer", "verticalBuffer", "distanceFromScrollerElem", "contains", "bottom", "left", "right", "top", "getBoundingClientRect", "adjustedTop", "window", "scrollY", "adjustedBottom", "$getNodeByKey", "getBoundingClientRectWithoutTransform", "elem", "rect", "getBoundingClientRect", "transformValue", "getComputedStyle", "getPropertyValue", "lastNumberOfTransformValue", "split", "pop", "y", "Number", "replace", "getCollapsedMargins", "elem", "getMargin", "element", "margin", "parseFloat", "window", "getComputedStyle", "marginBottom", "marginTop", "prevElemSiblingMarginBottom", "previousElementSibling", "nextElemSiblingMarginTop", "nextElementSibling", "collapsedTopMargin", "Math", "max", "$getRoot", "getTopLevelNodeKeys", "editor", "getEditorState", "read", "getChildrenKeys", "Downward", "Upward", "Indeterminate", "cache", "props", "result", "isPointClose", "previous", "current", "threshold", "dx", "x", "dy", "y", "getNodeCloseToPoint", "anchorElem", "cache_threshold", "editor", "fuzzy", "horizontalOffset", "point", "startIndex", "useEdgeAsDefault", "verbose", "anchorElementRect", "getBoundingClientRect", "topLevelNodeKeys", "getTopLevelNodeKeys", "closestBlockElem", "blockElem", "blockNode", "distance", "Infinity", "foundAtIndex", "isFoundNodeEmptyParagraph", "getEditorState", "read", "firstNode", "lastNode", "getElementByKey", "length", "firstNodeRect", "lastNodeRect", "getBoundingClientRectWithoutTransform", "top", "$getNodeByKey", "bottom", "index", "direction", "key", "elem", "Point", "domRect", "Rect", "fromDOMRect", "marginBottom", "marginTop", "getCollapsedMargins", "rect", "generateNewRect", "left", "right", "isOnBottomSide", "isOnTopSide", "distanceFromPoint", "getType", "getTextContent", "returnEmptyParagraphs", "isOnHandleElement", "element", "handleElementClassName", "closest", "replacedElements", "doesLineHeightAffectElement", "htmlElem", "includes", "tagName", "offsetHeight", "offsetWidth", "style", "window", "getComputedStyle", "display", "position", "visibility", "opacity", "setHandlePosition", "targetElem", "handleElem", "anchorElem", "leftOffset", "style", "opacity", "transform", "targetRect", "getBoundingClientRect", "targetStyle", "window", "getComputedStyle", "floatingElemRect", "anchorElementRect", "top", "height", "actualLineHeight", "doesLineHeightAffectElement", "parseInt", "lineHeight", "left", "ADD_BLOCK_MENU_CLASSNAME", "prevIndex", "Infinity", "getCurrentIndex", "keysLength", "Math", "floor", "useAddBlockHandle", "editor", "anchorElem", "isEditable", "$", "_c", "scrollerElem", "parentElement", "editorConfig", "useEditorConfigContext", "blockHandleHorizontalOffset", "admin", "hideGutter", "menuRef", "useRef", "hoveredElement", "setHoveredElement", "useState", "t0", "t1", "onDocumentMouseMove", "event", "target", "isHTMLElement", "distanceFromScrollerElem", "calculateDistanceFromScrollerElem", "pageX", "pageY", "isOnHandleElement", "topLevelNodeKeys", "getTopLevelNodeKeys", "blockElem", "_emptyBlockElem", "blockNode", "foundAtIndex", "getNodeCloseToPoint", "cache_threshold", "horizontalOffset", "point", "Point", "x", "y", "returnEmptyParagraphs", "startIndex", "length", "useEdgeAsDefault", "node", "elem", "document", "addEventListener", "removeEventListener", "useEffect", "t2", "current", "setHandlePosition", "t3", "event_0", "hoveredElementToUse", "update", "isEmptyParagraph", "getType", "getTextContent", "newParagraph", "$createParagraphNode", "insertAfter", "setTimeout", "getElementByKey", "getKey", "focus", "select", "dispatchCommand", "ENABLE_SLASH_MENU_COMMAND", "stopPropagation", "preventDefault", "handleAddClick", "t4", "event_1", "createPortal", "_jsx", "Fragment", "children", "className", "onClick", "ref", "type", "AddBlockHandlePlugin", "undefined", "body", "useLexicalComposerContext", "_editable", "c", "_c", "useLexicalComposerContext", "eventFiles", "$getNearestNodeFromDOMNode", "$getNodeByKey", "React", "useEffect", "useRef", "useState", "createPortal", "highlightElemOriginalPosition", "debugHighlightRef", "htmlElem", "anchorElem", "current", "left", "anchorLeft", "top", "anchorTop", "getBoundingClientRect", "boundingRect", "getBoundingClientRectWithoutTransform", "width", "height", "style", "border", "boxSizing", "pointerEvents", "position", "zIndex", "opacity", "TARGET_LINE_HALF_HEIGHT", "TEXT_BOX_HORIZONTAL_PADDING", "DEBUG", "animationTimer", "setTargetLine", "offsetWidth", "offsetLeft", "targetLineElem", "targetBlockElem", "lastTargetBlock", "mouseY", "anchorElem", "event", "debugHighlightRef", "isFoundNodeEmptyParagraph", "height", "targetBlockElemHeight", "top", "targetBlockElemTop", "getBoundingClientRect", "anchorTop", "width", "anchorWidth", "marginBottom", "marginTop", "getCollapsedMargins", "lineTop", "isBelow", "window", "scrollY", "willStayInSamePosition", "elem", "nextElementSibling", "previousElementSibling", "lastBoundingBoxPosition", "boundingBox", "y", "currentBoundingBoxPosition", "targetElemTranslate2", "left", "style", "opacity", "buffer", "transform", "highlightElemOriginalPosition", "DRAGGABLE_BLOCK_MENU_CLASSNAME", "DRAG_DATA_FORMAT", "prevIndex", "Infinity", "getCurrentIndex", "keysLength", "Math", "floor", "setDragImage", "dataTransfer", "draggableBlockElem", "transform", "style", "setTimeout", "hideTargetLine", "targetLineElem", "lastTargetBlockElem", "opacity", "marginBottom", "marginTop", "useDraggableBlockMenu", "editor", "anchorElem", "isEditable", "$", "_c", "scrollerElem", "parentElement", "menuRef", "useRef", "targetLineRef", "debugHighlightRef", "isDraggingBlockRef", "setDraggableBlockElem", "useState", "lastTargetBlock", "setLastTargetBlock", "editorConfig", "useEditorConfigContext", "blockHandleHorizontalOffset", "admin", "hideGutter", "t0", "t1", "onDocumentMouseMove", "event", "target", "isHTMLElement", "distanceFromScrollerElem", "calculateDistanceFromScrollerElem", "pageX", "pageY", "isOnHandleElement", "topLevelNodeKeys", "getTopLevelNodeKeys", "blockElem", "_draggableBlockElem", "foundAtIndex", "isFoundNodeEmptyParagraph", "getNodeCloseToPoint", "cache_threshold", "horizontalOffset", "point", "Point", "x", "y", "startIndex", "length", "useEdgeAsDefault", "verbose", "document", "addEventListener", "removeEventListener", "useEffect", "t2", "t3", "current", "setHandlePosition", "t4", "t5", "onDragover", "event_0", "isFileTransfer", "eventFiles", "target_0", "distanceFromScrollerElem_0", "topLevelNodeKeys_0", "targetBlockElem", "foundAtIndex_0", "isFoundNodeEmptyParagraph_0", "fuzzy", "isBelow", "willStayInSamePosition", "setTargetLine", "getBoundingClientRect", "width", "preventDefault", "boundingBox", "elem", "onDrop", "event_1", "isFileTransfer_0", "pageY_0", "target_1", "dragData", "getData", "update", "draggedNode", "$getNodeByKey", "distanceFromScrollerElem_1", "targetBlockElem_0", "isFoundNodeEmptyParagraph_1", "targetNode", "$getNearestNodeFromDOMNode", "height", "targetBlockElemHeight", "top", "targetBlockElemTop", "getBoundingClientRectWithoutTransform", "isBelow_0", "window", "scrollY", "insertBefore", "remove", "insertAfter", "querySelectorAll", "forEach", "highlighter", "newInsertedElem", "getElementByKey", "getKey", "newInsertedElemRect", "highlightElem", "createElement", "className", "documentElement", "getAttribute", "backgroundColor", "transition", "zIndex", "pointerEvents", "boxSizing", "borderRadius", "position", "body", "appendChild", "left", "createPortal", "_jsxs", "Fragment", "children", "_jsx", "draggable", "onDragEnd", "onDragStart", "event_2", "dataTransfer_0", "nodeKey", "node", "setData", "ref", "DraggableBlockPlugin", "undefined", "useLexicalComposerContext", "_editable", "c", "_c", "ContentEditable", "useTranslation", "LexicalContentEditable", "t0", "$", "className", "t", "t1", "_jsx", "placeholder", "children", "LexicalEditor", "props", "$", "_c", "editorConfig", "editorContainerRef", "onChange", "editorConfigContext", "useEditorConfigContext", "editor", "useLexicalComposerContext", "floatingAnchorElem", "setFloatingAnchorElem", "useState", "t0", "Symbol", "for", "_floatingAnchorElem", "onRef", "t1", "t2", "uuid", "console", "error", "parentEditor", "registerChild", "handleFocus", "focusEditor", "handleBlur", "blurEditor", "unregisterFocus", "registerCommand", "FOCUS_COMMAND", "COMMAND_PRIORITY_LOW", "unregisterBlur", "BLUR_COMMAND", "unregisterChild", "useEffect", "isSmallWidthViewport", "setIsSmallWidthViewport", "t3", "t4", "updateViewPortWidth", "isNextSmallWidthViewport", "window", "matchMedia", "matches", "addEventListener", "removeEventListener", "t5", "features", "t6", "editorState", "editor_0", "tags", "has", "size", "t7", "_jsxs", "Fragment", "children", "isEditable", "_jsx", "DraggableBlockPlugin", "anchorElem", "AddBlockHandlePlugin", "plugins", "map", "plugin_1", "plugin", "position", "desktopOnly", "EditorPlugin", "clientProps", "key", "SlashMenuPlugin", "_temp", "className", "ref", "_temp2", "RichTextPlugin", "ErrorBoundary", "LexicalErrorBoundary", "contentEditable", "LexicalContentEditable", "OnChangePlugin", "ignoreSelectionChange", "HistoryPlugin", "markdownTransformers", "length", "MarkdownShortcutPlugin", "TabIndentationPlugin", "_temp3", "_temp4", "_temp5", "plugin_0", "plugin_2", "plugin_3", "plugin_4", "NestProviders", "children", "providers", "length", "Component", "_jsx", "slice", "LexicalProvider", "props", "editorConfig", "field", "onChange", "path", "readOnly", "value", "parentContext", "useEditorConfigContext", "editorContainerRef", "useRef", "processedValue", "useMemo", "processed", "features", "hooks", "load", "forEach", "hook", "incomingEditorState", "initialConfig", "Error", "JSON", "stringify", "Array", "isArray", "editable", "editorState", "undefined", "namespace", "lexical", "nodes", "getEnabledNodes", "onError", "error", "theme", "LexicalComposer", "EditorConfigProvider", "LexicalEditorComponent", "baseClass", "RichTextComponent", "props", "descriptionProps", "editorConfig", "errorProps", "field", "name", "_path", "pathFromProps", "admin", "className", "components", "Description", "Error", "Label", "readOnly", "readOnlyFromAdmin", "style", "width", "label", "required", "labelProps", "readOnlyFromTopLevelProps", "validate", "readOnlyFromProps", "memoizedValidate", "useCallback", "value", "validationOptions", "path", "pathFromContext", "readOnlyFromContext", "useFieldProps", "fieldType", "useField", "formInitializing", "formProcessing", "initialValue", "setValue", "showError", "disabled", "classes", "hideGutter", "filter", "Boolean", "join", "_jsxs", "_jsx", "FieldError", "CustomError", "alignCaret", "FieldLabel", "ErrorBoundary", "fallbackRender", "onReset", "LexicalProvider", "onChange", "editorState", "serializedEditorState", "toJSON", "features", "hooks", "save", "length", "forEach", "hook", "incomingEditorState", "JSON", "stringify", "FieldDescription", "error", "role", "color", "message", "RichText", "withCondition"]
7
- }
@@ -1,2 +0,0 @@
1
- "use client";import{a as S,d as x}from"./chunk-LGUXX2QH.js";import{b as E}from"./chunk-NI6Z4GBD.js";import{jsx as i,jsxs as C}from"react/jsx-runtime";import{useLexicalComposerContext as W}from"@lexical/react/LexicalComposerContext.js";import{useLexicalNodeSelection as Y}from"@lexical/react/useLexicalNodeSelection.js";import{mergeRegister as H}from"@lexical/utils";import{getTranslation as U}from"@payloadcms/translations";import{Button as A,useConfig as q,useDocumentDrawer as z,usePayloadAPI as F,useTranslation as G}from"@payloadcms/ui";import{$getNodeByKey as M,$getSelection as J,$isNodeSelection as Q,CLICK_COMMAND as V,COMMAND_PRIORITY_LOW as _,KEY_BACKSPACE_COMMAND as X,KEY_DELETE_COMMAND as Z}from"lexical";import ee,{useCallback as g,useEffect as te,useReducer as oe,useRef as se,useState as ne}from"react";var t="lexical-relationship",O={depth:0},ie=d=>{let{data:{relationTo:T,value:l},nodeKey:s}=d,m=se(null),[o]=W(),[n,a,u]=Y(s),{field:h}=E(),{config:{collections:w,routes:{api:y},serverURL:B}}=q(),[r,le]=ne(()=>w.find(e=>e.slug===T)),{i18n:I,t:p}=G(),[R,K]=oe(e=>e+1,0),[{data:N},{setParams:v}]=F(`${B}${y}/${r.slug}/${l}`,{initialParams:O}),[L,P,{closeDrawer:D}]=z({id:l,collectionSlug:r.slug}),j=g(()=>{o.update(()=>{M(s).remove()})},[o,s]),k=ee.useCallback(({doc:e})=>{v({...O,cacheBust:R}),D(),K()},[R,v,D]),f=g(e=>{if(n&&Q(J())){e.preventDefault();let b=M(s);if(x(b))return b.remove(),!0}return!1},[n,s]),$=g(e=>{let c=e;return c.target===m.current||m.current?.contains(c.target)?(c.shiftKey?a(!n):n||(u(),a(!0)),!0):!1},[n,a,u]);return te(()=>H(o.registerCommand(V,$,_),o.registerCommand(Z,f,_),o.registerCommand(X,f,_)),[u,o,n,s,f,a,$]),C("div",{className:[t,n&&`${t}--selected`].filter(Boolean).join(" "),contentEditable:!1,ref:m,children:[C("div",{className:`${t}__wrap`,children:[i("p",{className:`${t}__label`,children:p("fields:labelRelationship",{label:U(r.labels.singular,I)})}),i(P,{className:`${t}__doc-drawer-toggler`,children:i("p",{className:`${t}__title`,children:N?N[r?.admin?.useAsTitle||"id"]:l})})]}),o.isEditable()&&C("div",{className:`${t}__actions`,children:[i(A,{buttonStyle:"icon-label",className:`${t}__swapButton`,disabled:h?.admin?.readOnly,el:"div",icon:"swap",onClick:()=>{o.dispatchCommand(S,{replace:{nodeKey:s}})},round:!0,tooltip:p("fields:swapRelationship")}),i(A,{buttonStyle:"icon-label",className:`${t}__removeButton`,disabled:h?.admin?.readOnly,icon:"x",onClick:e=>{e.preventDefault(),j()},round:!0,tooltip:p("fields:removeRelationship")})]}),l&&i(L,{onSave:k})]})},he=d=>i(ie,{...d});export{he as RelationshipComponent};
2
- //# sourceMappingURL=RelationshipComponent-3QWBV4GT.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/features/relationship/client/components/RelationshipComponent.tsx"],
4
- "sourcesContent": ["'use client'\nimport type { ElementFormatType } from 'lexical'\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 { Button, useConfig, useDocumentDrawer, usePayloadAPI, useTranslation } from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'\n\nimport type { RelationshipData } from '../../server/nodes/RelationshipNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isRelationshipNode } from '../nodes/RelationshipNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-relationship'\n\nconst initialParams = {\n depth: 0,\n}\n\ntype Props = {\n className?: string\n data: RelationshipData\n format?: ElementFormatType\n nodeKey?: string\n}\n\nconst Component: React.FC<Props> = (props) => {\n const {\n data: { relationTo, value: id },\n nodeKey,\n } = props\n\n const relationshipElemRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n const { field } = useEditorConfigContext()\n const {\n config: {\n collections,\n routes: { api },\n serverURL,\n },\n } = useConfig()\n\n const [relatedCollection, setRelatedCollection] = useState(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${id}`,\n { initialParams },\n )\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id,\n collectionSlug: relatedCollection.slug,\n })\n\n const removeRelationship = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateRelationship = React.useCallback(\n ({ doc }) => {\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 closeDrawer()\n dispatchCacheBust()\n },\n [cacheBust, setParams, 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 ($isRelationshipNode(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 relationshipElemRef.target or anything WITHIN relationshipElemRef.target was clicked\n if (\n event.target === relationshipElemRef.current ||\n relationshipElemRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick])\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={relationshipElemRef}\n >\n <div className={`${baseClass}__wrap`}>\n <p className={`${baseClass}__label`}>\n {t('fields:labelRelationship', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n </p>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <p className={`${baseClass}__title`}>\n {data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : id}\n </p>\n </DocumentDrawerToggler>\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swapButton`}\n disabled={field?.admin?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapRelationship')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.admin?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeRelationship()\n }}\n round\n tooltip={t('fields:removeRelationship')}\n />\n </div>\n )}\n\n {id && <DocumentDrawer onSave={updateRelationship} />}\n </div>\n )\n}\n\nexport const RelationshipComponent = (props: Props): React.ReactNode => {\n return <Component {...props} />\n}\n"],
5
- "mappings": "sJAGA,OAASA,6BAAAA,MAAiC,2CAC1C,OAASC,2BAAAA,MAA+B,4CACxC,OAASC,iBAAAA,MAAqB,iBAC9B,OAASC,kBAAAA,MAAsB,2BAC/B,OAASC,UAAAA,EAAQC,aAAAA,EAAWC,qBAAAA,EAAmBC,iBAAAA,EAAeC,kBAAAA,MAAsB,iBACpF,OACEC,iBAAAA,EACAC,iBAAAA,EACAC,oBAAAA,EACAC,iBAAAA,EACAC,wBAAAA,EACAC,yBAAAA,EACAC,sBAAAA,MACK,UACP,OAAOC,IAASC,eAAAA,EAAaC,aAAAA,GAAWC,cAAAA,GAAYC,UAAAA,GAAQC,YAAAA,OAAgB,QAS5E,IAAMC,EAAY,uBAEZC,EAAgB,CACpBC,MAAO,CACT,EASMC,GAA8BC,GAAA,CAClC,GAAM,CACJC,KAAM,CAAEC,WAAAA,EAAYC,MAAOC,CAAE,EAC7BC,QAAAA,CAAO,EACLL,EAEEM,EAAsBC,GAA8B,IAAA,EAEpD,CAACC,CAAA,EAAUC,EAAA,EACX,CAACC,EAAYC,EAAaC,CAAA,EAAkBC,EAAwBR,CAAA,EACpE,CAAES,MAAAA,CAAK,EAAKC,EAAA,EACZ,CACJC,OAAQ,CACNC,YAAAA,EACAC,OAAQ,CAAEC,IAAAA,CAAG,EACbC,UAAAA,CAAS,CACV,EACCC,EAAA,EAEE,CAACC,EAAmBC,EAAA,EAAwBC,GAAS,IACzDP,EAAYQ,KA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OoE,OAAOM,SACxBE,KAAK,IACLjC,QAAUuC,GAAA,CACRA,EAAE1C,eAAc,EAChBZ,EAAA,CACF,EACAoD,MAAK,GACLC,QAASlE,EAAE,2BAAA,OAKhBzB,GAAMyE,EAACxC,EAAA,CAAe4D,OAAQlD,MAGrC,EAEamD,GAAyBlG,GAC7B6E,EAAC9E,GAAA,CAAW,GAAGC",
6
- "names": ["useLexicalComposerContext", "useLexicalNodeSelection", "mergeRegister", "getTranslation", "Button", "useConfig", "useDocumentDrawer", "usePayloadAPI", "useTranslation", "$getNodeByKey", "$getSelection", "$isNodeSelection", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_BACKSPACE_COMMAND", "KEY_DELETE_COMMAND", "React", "useCallback", "useEffect", "useReducer", "useRef", "useState", "baseClass", "initialParams", "depth", "Component", "props", "data", "relationTo", "value", "id", "nodeKey", "relationshipElemRef", "useRef", "editor", "useLexicalComposerContext", "isSelected", "setSelected", "clearSelection", "useLexicalNodeSelection", "field", "useEditorConfigContext", "config", "collections", "routes", "api", "serverURL", "useConfig", "relatedCollection", "setRelatedCollection", "useState", "find", "coll", "slug", "i18n", "t", "useTranslation", "cacheBust", "dispatchCacheBust", "useReducer", "state", "setParams", "usePayloadAPI", "DocumentDrawer", "DocumentDrawerToggler", "closeDrawer", "useDocumentDrawer", "collectionSlug", "removeRelationship", "useCallback", "update", "$getNodeByKey", "remove", "updateRelationship", "React", "doc", "$onDelete", "payload", "$isNodeSelection", "$getSelection", "preventDefault", "node", "$isRelationshipNode", "onClick", "event", "target", "current", "contains", "shiftKey", "useEffect", "mergeRegister", "registerCommand", "CLICK_COMMAND", "COMMAND_PRIORITY_LOW", "KEY_DELETE_COMMAND", "KEY_BACKSPACE_COMMAND", "_jsxs", "className", "filter", "Boolean", "join", "contentEditable", "ref", "_jsx", "label", "getTranslation", "labels", "singular", "admin", "useAsTitle", "isEditable", "Button", "buttonStyle", "disabled", "readOnly", "el", "icon", "dispatchCommand", "INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND", "replace", "round", "tooltip", "e", "onSave", "RelationshipComponent"]
7
- }
@@ -1,2 +0,0 @@
1
- import{b as E}from"./chunk-NI6Z4GBD.js";import{jsx as L}from"react/jsx-runtime";import{Drawer as z}from"@payloadcms/ui";import"react";import{c as H}from"react/compiler-runtime";import{jsx as T,jsxs as J}from"react/jsx-runtime";import{Form as K,FormSubmit as B,RenderFields as G,useConfig as V,useDocumentInfo as q,useFieldProps as Q,useTranslation as X}from"@payloadcms/ui";import{getFormState as I}from"@payloadcms/ui/shared";import{useEffect as Y,useState as Z}from"react";import{v4 as N}from"uuid";var F=e=>{let t=H(27),{data:a,featureKey:r,fieldMapOverride:o,handleDrawerSubmit:c,schemaFieldsPathOverride:v,schemaPathSuffix:s}=e,{t:f}=X(),{id:i}=q(),{schemaPath:x}=Q(),{config:n}=V(),[p,m]=Z(!1),{field:O}=E(),{richTextComponentMap:w}=O,U=`lexical_internal_feature.${r}.fields${s?`.${s}`:""}`,l=v??`${x}.lexical_internal_feature.${r}${s?`.${s}`:""}`,g;t[0]!==o||t[1]!==w||t[2]!==U?(g=o??w.get(U),t[0]=o,t[1]=w,t[2]=U,t[3]=g):g=t[3];let u=g,S,b;t[4]!==n.routes.api||t[5]!==n.serverURL||t[6]!==i||t[7]!==a||t[8]!==l?(S=()=>{(async()=>{let d=await I({apiRoute:n.routes.api,body:{id:i,data:a??{},operation:"update",schemaPath:l},serverURL:n.serverURL});m(d)})()},b=[n.routes.api,n.serverURL,l,i,a],t[4]=n.routes.api,t[5]=n.serverURL,t[6]=i,t[7]=a,t[8]=l,t[9]=S,t[10]=b):(S=t[9],b=t[10]),Y(S,b);let R;t[11]!==n.routes.api||t[12]!==n.serverURL||t[13]!==i||t[14]!==l?(R=async h=>{let{formState:d}=h;return await I({apiRoute:n.routes.api,body:{id:i,formState:d,operation:"update",schemaPath:l},serverURL:n.serverURL})},t[11]=n.routes.api,t[12]=n.serverURL,t[13]=i,t[14]=l,t[15]=R):R=t[15];let y=R;if(p===!1)return null;let D;if(t[16]!==y||t[17]!==u||t[18]!==l||t[19]!==f||t[20]!==p||t[21]!==c){let h;t[23]!==u?(h=Array.isArray(u)?u:[],t[23]=u,t[24]=h):h=t[24];let d;t[25]!==u?(d=Array.isArray(u)?u:[],t[25]=u,t[26]=d):d=t[26],D=J(K,{beforeSubmit:[y],disableValidationOnSubmit:!0,fields:h,initialState:p,onChange:[y],onSubmit:c,uuid:N(),children:[T(G,{fields:d,forceRender:!0,path:"",readOnly:!1,schemaPath:l}),T(B,{children:f("fields:saveChanges")})]}),t[16]=y,t[17]=u,t[18]=l,t[19]=f,t[20]=p,t[21]=c,t[22]=D}else D=t[22];return D};var Ut=({className:e,data:t,drawerSlug:a,drawerTitle:r,featureKey:o,fieldMapOverride:c,handleDrawerSubmit:v,schemaFieldsPathOverride:s,schemaPathSuffix:f})=>L(z,{className:e,slug:a,title:r??"",children:L(F,{data:t,featureKey:o,fieldMapOverride:c,handleDrawerSubmit:v,schemaFieldsPathOverride:s,schemaPathSuffix:f})});import{c as tt}from"react/compiler-runtime";import{useAuth as et,useConfig as rt,useEntityVisibility as at}from"@payloadcms/ui";import*as A from"react";var nt=(e,t)=>e.filter(({slug:a,admin:{enableRichTextRelationship:r},upload:o})=>t.visibleEntities.collections.includes(a)?t?.uploads?r&&!!o:o?!1:r:!1),It=e=>{let t=tt(16),a,r,o;t[0]!==e?({children:o,uploads:a,...r}=e,t[0]=e,t[1]=a,t[2]=r,t[3]=o):(a=t[1],r=t[2],o=t[3]);let c=a===void 0?!1:a,{config:v}=rt(),{collections:s}=v,{user:f}=et(),{visibleEntities:i}=at(),x;t[4]!==s||t[5]!==c||t[6]!==f||t[7]!==i?(x=()=>nt(s,{uploads:c,user:f,visibleEntities:i}).map(m=>{let{slug:O}=m;return O}),t[4]=s,t[5]=c,t[6]=f,t[7]=i,t[8]=x):x=t[8];let[n]=A.useState(x);if(!n.length)return null;let p;if(t[9]!==r||t[10]!==n||t[11]!==o){let m;t[13]!==r||t[14]!==n?(m={...r,enabledCollectionSlugs:n},t[13]=r,t[14]=n,t[15]=m):m=t[15],p=A.cloneElement(o,m),t[9]=r,t[10]=n,t[11]=o,t[12]=p}else p=t[12];return p};import{createCommand as ot}from"lexical";var Pt=ot("INSERT_UPLOAD_WITH_DRAWER_COMMAND");import{jsx as ct}from"react/jsx-runtime";import M from"bson-objectid";import{$applyNodeReplacement as ft}from"lexical";import*as k from"react";import{jsx as it}from"react/jsx-runtime";import{DecoratorBlockNode as st}from"@lexical/react/LexicalDecoratorBlockNode.js";import P from"bson-objectid";import{$applyNodeReplacement as lt}from"lexical";import"react";function $(e){return e.parentElement!=null&&e.parentElement.tagName==="LI"&&e.previousSibling===null&&e.getAttribute("aria-roledescription")==="checkbox"}function ut(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id"),r=e.getAttribute("data-lexical-upload-relation-to");if(a!=null&&r!=null)return{node:j({data:{fields:{},relationTo:r,value:a}})}}let t=e;return t.src.startsWith("file:///")||$(t),null}var _=class extends st{__data;constructor({data:t,format:a,key:r}){super(a,r),this.__data=t}static clone(t){return new this({data:t.__data,format:t.__format,key:t.__key})}static getType(){return"upload"}static importDOM(){return{img:t=>({conversion:ut,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new P.default().toHexString(),t.version=3);let a={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},r=j({data:a});return r.setFormat(t.format),r}static isInline(){return!1}decorate(){return it(RawUploadComponent,{data:this.__data,format:this.__format,nodeKey:this.getKey()})}exportDOM(){let t=document.createElement("img");return t.setAttribute("data-lexical-upload-id",String(this.__data?.value)),t.setAttribute("data-lexical-upload-relation-to",this.__data?.relationTo),{element:t}}exportJSON(){return{...super.exportJSON(),...this.getData(),type:"upload",version:3}}getData(){return this.getLatest().__data}setData(t){let a=this.getWritable();a.__data=t}updateDOM(){return!1}};function j({data:e}){return e?.id||(e.id=new P.default().toHexString()),lt(new _({data:e}))}var pt=k.lazy(()=>import("./component-3OFD6Q4Z.js").then(e=>({default:e.UploadComponent})));function mt(e){if(e.hasAttribute("data-lexical-upload-relation-to")&&e.hasAttribute("data-lexical-upload-id")){let a=e.getAttribute("data-lexical-upload-id"),r=e.getAttribute("data-lexical-upload-relation-to");if(a!=null&&r!=null)return{node:W({data:{fields:{},relationTo:r,value:a}})}}let t=e;return t.src.startsWith("file:///")||$(t),null}var C=class extends _{static clone(t){return super.clone(t)}static getType(){return super.getType()}static importDOM(){return{img:t=>({conversion:mt,priority:0})}}static importJSON(t){t.version===1&&t?.value?.id&&(t.value=t.value.id),t.version===2&&!t?.id&&(t.id=new M.default().toHexString(),t.version=3);let a={id:t.id,fields:t.fields,relationTo:t.relationTo,value:t.value},r=W({data:a});return r.setFormat(t.format),r}decorate(){return ct(pt,{data:this.__data,nodeKey:this.getKey()})}exportJSON(){return super.exportJSON()}};function W({data:e}){return e?.id||(e.id=new M.default().toHexString()),ft(new C({data:e}))}function Qt(e){return e instanceof C}export{Ut as a,It as b,Pt as c,C as d,W as e,Qt as f};
2
- //# sourceMappingURL=chunk-G5DTIOPI.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/utilities/fieldsDrawer/Drawer.tsx", "../../../src/utilities/fieldsDrawer/DrawerContent.tsx", "../../../src/features/relationship/client/utils/EnabledRelationshipsCondition.tsx", "../../../src/features/upload/client/drawer/commands.ts", "../../../src/features/upload/client/nodes/UploadNode.tsx", "../../../src/features/upload/server/nodes/UploadNode.tsx"],
4
- "sourcesContent": ["'use client'\nimport type { ClientField, Data, FormState, JsonObject } from 'payload'\n\nimport { Drawer } from '@payloadcms/ui'\nimport React from 'react'\n\nimport { DrawerContent } from './DrawerContent.js'\n\nexport type FieldsDrawerProps = {\n readonly className?: string\n readonly data?: Data\n readonly drawerSlug: string\n readonly drawerTitle?: string\n readonly featureKey: string\n readonly fieldMapOverride?: ClientField[]\n readonly handleDrawerSubmit: (fields: FormState, data: JsonObject) => void\n readonly schemaFieldsPathOverride?: string\n readonly schemaPathSuffix?: string\n}\n\n/**\n * This FieldsDrawer component can be used to easily create a Drawer that contains a form with fields within your feature.\n * The fields are taken directly from the schema map based on your `featureKey` and `schemaPathSuffix`. Thus, this can only\n * be used if you provide your field schema inside the `generateSchemaMap` prop of your feature.server.ts.\n */\nexport const FieldsDrawer: React.FC<FieldsDrawerProps> = ({\n className,\n data,\n drawerSlug,\n drawerTitle,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPathSuffix,\n}) => {\n // The Drawer only renders its children (and itself) if it's open. Thus, by extracting the main content\n // to DrawerContent, this should be faster\n return (\n <Drawer className={className} slug={drawerSlug} title={drawerTitle ?? ''}>\n <DrawerContent\n data={data}\n featureKey={featureKey}\n fieldMapOverride={fieldMapOverride}\n handleDrawerSubmit={handleDrawerSubmit}\n schemaFieldsPathOverride={schemaFieldsPathOverride}\n schemaPathSuffix={schemaPathSuffix}\n />\n </Drawer>\n )\n}\n", "'use client'\nimport type { FormProps } from '@payloadcms/ui'\nimport type { ClientField, FormState } from 'payload'\n\nimport {\n Form,\n FormSubmit,\n RenderFields,\n useConfig,\n useDocumentInfo,\n useFieldProps,\n useTranslation,\n} from '@payloadcms/ui'\nimport { getFormState } from '@payloadcms/ui/shared'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { FieldsDrawerProps } from './Drawer.js'\n\nimport { useEditorConfigContext } from '../../lexical/config/client/EditorConfigProvider.js'\n\nexport const DrawerContent: React.FC<Omit<FieldsDrawerProps, 'drawerSlug' | 'drawerTitle'>> = ({\n data,\n featureKey,\n fieldMapOverride,\n handleDrawerSubmit,\n schemaFieldsPathOverride,\n schemaPathSuffix,\n}) => {\n const { 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 = `lexical_internal_feature.${featureKey}.fields${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n const schemaFieldsPath =\n schemaFieldsPathOverride ??\n `${schemaPath}.lexical_internal_feature.${featureKey}${schemaPathSuffix ? `.${schemaPathSuffix}` : ''}`\n\n const fields: any =\n fieldMapOverride ?? (richTextComponentMap.get(componentMapRenderedFieldsPath) as ClientField[]) // 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: data ?? {},\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, data])\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 if (initialState === false) {\n return null\n }\n\n return (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n fields={Array.isArray(fields) ? fields : []}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleDrawerSubmit}\n uuid={uuid()}\n >\n <RenderFields\n fields={Array.isArray(fields) ? fields : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )\n}\n", "'use client'\nimport type { ClientCollectionConfig, ClientUser, VisibleEntities } from 'payload'\n\nimport { useAuth, useConfig, useEntityVisibility } from '@payloadcms/ui'\nimport * as React from 'react'\n\ntype Options = {\n uploads: boolean\n user: ClientUser\n visibleEntities: VisibleEntities\n}\n\ntype FilteredCollectionsT = (\n collections: ClientCollectionConfig[],\n options?: Options,\n) => ClientCollectionConfig[]\n\nconst filterRichTextCollections: FilteredCollectionsT = (collections, options) => {\n return collections.filter(({ slug, admin: { enableRichTextRelationship }, upload }) => {\n if (!options.visibleEntities.collections.includes(slug)) {\n return false\n }\n\n if (options?.uploads) {\n return enableRichTextRelationship && Boolean(upload) === true\n }\n\n return upload ? false : enableRichTextRelationship\n })\n}\n\nexport const EnabledRelationshipsCondition: React.FC<any> = (props) => {\n const { children, uploads = false, ...rest } = props\n const {\n config: { collections },\n } = useConfig()\n const { user } = useAuth()\n const { visibleEntities } = useEntityVisibility()\n\n const [enabledCollectionSlugs] = React.useState(() =>\n filterRichTextCollections(collections, { uploads, user, visibleEntities }).map(\n ({ slug }) => slug,\n ),\n )\n\n if (!enabledCollectionSlugs.length) {\n return null\n }\n\n return React.cloneElement(children, { ...rest, enabledCollectionSlugs })\n}\n", "'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nexport const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND')\n", "'use client'\nimport type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type { DOMConversionMap, DOMConversionOutput, LexicalNode, Spread } from 'lexical'\nimport type { JSX } from 'react'\n\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\n\nimport { UploadServerNode, isGoogleDocCheckboxImg } from '../../server/nodes/UploadNode.js'\n\nconst RawUploadComponent = React.lazy(() =>\n import('../../client/component/index.js').then((module) => ({ default: module.UploadComponent })),\n)\n\nfunction $convertUploadElement(domNode: HTMLImageElement): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createUploadNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n const img = domNode\n if (img.src.startsWith('file:///') || isGoogleDocCheckboxImg(img)) {\n return null\n }\n // TODO: Auto-upload functionality here!\n //}\n return null\n}\n\nexport type SerializedUploadNode = {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'upload'\n} & Spread<UploadData, SerializedDecoratorBlockNode>\n\nexport class UploadNode extends UploadServerNode {\n static clone(node: UploadServerNode): UploadServerNode {\n return super.clone(node)\n }\n\n static getType(): string {\n return super.getType()\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n decorate(): JSX.Element {\n return <RawUploadComponent data={this.__data} nodeKey={this.getKey()} />\n }\n\n exportJSON(): SerializedUploadNode {\n return super.exportJSON()\n }\n}\n\nexport function $createUploadNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadNode({ data: data as UploadData }))\n}\n\nexport function $isUploadNode(node: LexicalNode | null | undefined): node is UploadNode {\n return node instanceof UploadNode\n}\n", "import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n Spread,\n} from 'lexical'\nimport type { CollectionSlug, JsonObject } from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nexport type UploadData = {\n fields: JsonObject\n id: string\n relationTo: CollectionSlug\n value: number | string\n}\n\nexport function isGoogleDocCheckboxImg(img: HTMLImageElement): boolean {\n return (\n img.parentElement != null &&\n img.parentElement.tagName === 'LI' &&\n img.previousSibling === null &&\n img.getAttribute('aria-roledescription') === 'checkbox'\n )\n}\n\nfunction $convertUploadServerElement(domNode: HTMLImageElement): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createUploadServerNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n const img = domNode\n if (img.src.startsWith('file:///') || isGoogleDocCheckboxImg(img)) {\n return null\n }\n // TODO: Auto-upload functionality here!\n //}\n return null\n}\n\nexport type SerializedUploadNode = {\n children?: never // required so that our typed editor state doesn't automatically add children\n type: 'upload'\n} & Spread<UploadData, SerializedDecoratorBlockNode>\n\nexport class UploadServerNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: UploadServerNode): UploadServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'upload'\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadServerElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadServerNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadServerNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n decorate(): JSX.Element {\n // @ts-expect-error\n return <RawUploadComponent data={this.__data} format={this.__format} nodeKey={this.getKey()} />\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n element.setAttribute('data-lexical-upload-id', String(this.__data?.value))\n element.setAttribute('data-lexical-upload-relation-to', this.__data?.relationTo)\n\n return { element }\n }\n\n exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'upload',\n version: 3,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadServerNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadServerNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadServerNode({ data: data as UploadData }))\n}\n\nexport function $isUploadServerNode(\n node: LexicalNode | null | undefined,\n): node is UploadServerNode {\n return node instanceof U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AEvCU,GAAsB,IAAIrB,EAAW,CAAEP,KAAMA,CAAmB,CAAA,CAAA,CACzE,CAEO,SAAS6B,GAAc/B,EAAoC,CAChE,OAAOA,aAAgBS,CACzB",
6
- "names": ["Drawer", "c", "_c", "Form", "FormSubmit", "RenderFields", "useConfig", "useDocumentInfo", "useFieldProps", "useTranslation", "getFormState", "useEffect", "useState", "v4", "uuid", "DrawerContent", "t0", "$", "_c", "data", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPathSuffix", "t", "useTranslation", "id", "useDocumentInfo", "schemaPath", "useFieldProps", "config", "useConfig", "initialState", "setInitialState", "useState", "field", "t1", "useEditorConfigContext", "richTextComponentMap", "componentMapRenderedFieldsPath", "schemaFieldsPath", "t2", "get", "fields", "t3", "state", "getFormState", "apiRoute", "routes", "api", "body", "operation", "serverURL", "t4", "useEffect", "t5", "t6", "formState", "prevFormState", "onChange", "t7", "Array", "isArray", "t8", "_jsxs", "Form", "beforeSubmit", "disableValidationOnSubmit", "onSubmit", "uuid", "children", "_jsx", "RenderFields", "forceRender", "path", "readOnly", "FormSubmit", "FieldsDrawer", "className", "data", "drawerSlug", "drawerTitle", "featureKey", "fieldMapOverride", "handleDrawerSubmit", "schemaFieldsPathOverride", "schemaPathSuffix", "_jsx", "Drawer", "slug", "title", "DrawerContent", "c", "_c", "useAuth", "useConfig", "useEntityVisibility", "React", "filterRichTextCollections", "collections", "options", "filter", "slug", "admin", "enableRichTextRelationship", "upload", "visibleEntities", "includes", "uploads", "Boolean", "EnabledRelationshipsCondition", "props", "$", "t0", "rest", "children", "undefined", "config", "t1", "user", "t2", "map", "t3", "enabledCollectionSlugs", "useState", "length", "t4", "cloneElement", "createCommand", "INSERT_UPLOAD_WITH_DRAWER_COMMAND", "ObjectID", "$applyNodeReplacement", "React", "DecoratorBlockNode", "ObjectID", "$applyNodeReplacement", "isGoogleDocCheckboxImg", "img", "parentElement", "tagName", "previousSibling", "getAttribute", "$convertUploadServerElement", "domNode", "hasAttribute", "id", "relationTo", "node", "$createUploadServerNode", "data", "fields", "value", "src", "startsWith", "UploadServerNode", "__data", "constructor", "format", "key", "clone", "__format", "__key", "getType", "importDOM", "conversion", "priority", "importJSON", "serializedNode", "version", "default", "toHexString", "importedData", "setFormat", "isInline", "decorate", "_jsx", "RawUploadComponent", "nodeKey", "getKey", "exportDOM", "element", "document", "createElement", "setAttribute", "String", "exportJSON", "getData", "type", "getLatest", "setData", "writable", "getWritable", "updateDOM", "RawUploadComponent", "lazy", "then", "module", "default", "UploadComponent", "$convertUploadElement", "domNode", "hasAttribute", "id", "getAttribute", "relationTo", "node", "$createUploadNode", "data", "fields", "value", "img", "src", "startsWith", "isGoogleDocCheckboxImg", "UploadNode", "UploadServerNode", "clone", "getType", "importDOM", "conversion", "priority", "importJSON", "serializedNode", "version", "ObjectID", "toHexString", "importedData", "setFormat", "format", "decorate", "_jsx", "__data", "nodeKey", "getKey", "exportJSON", "$applyNodeReplacement", "$isUploadNode"]
7
- }
@@ -1,2 +0,0 @@
1
- import{jsx as w}from"react/jsx-runtime";import{useLexicalComposerContext as x}from"@lexical/react/LexicalComposerContext.js";import"react";import{createContext as C,useContext as M,useMemo as b,useRef as E,useState as m}from"react";function v(){return Math.random().toString(36).substring(2,12)+Math.random().toString(36).substring(2,12)}var g=C({editorConfig:null,field:null,uuid:null}),F=({children:o,editorConfig:s,editorContainerRef:c,field:d,parentContext:n})=>{let[a]=x(),[f]=m(v()),t=E(new Map),[l,h]=m(null),u=E(new Set),p=b(()=>({blurEditor:r=>{u.current.clear()},childrenEditors:t,editor:a,editorConfig:s,editorContainerRef:c,field:d,focusEditor:r=>{let e=r.uuid;u.current.has(e)||(u.current.add(e),h(r),n?.uuid&&n.focusEditor(r),t.current.forEach((i,S)=>{i.focusEditor(r)}),u.current.clear())},focusedEditor:l,parentEditor:n,registerChild:(r,e)=>{if(!t.current.has(r)){let i=new Map(t.current);i.set(r,e),t.current=i}},unregisterChild:r=>{if(t.current.has(r)){let e=new Map(t.current);e.delete(r),t.current=e}},uuid:f}),[a,t,s,c,d,l,n,f]);return w(g.Provider,{value:p,children:o})},G=()=>{let o=M(g);if(o===void 0)throw new Error("useEditorConfigContext must be used within an EditorConfigProvider");return o};export{F as a,G as b};
2
- //# sourceMappingURL=chunk-NI6Z4GBD.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/lexical/config/client/EditorConfigProvider.tsx"],
4
- "sourcesContent": ["'use client'\n\nimport type { LexicalEditor } from 'lexical'\nimport type { RichTextFieldClient } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport * as React from 'react'\nimport { createContext, useContext, useMemo, useRef, useState } from 'react'\n\nimport type { LexicalRichTextFieldProps } from '../../../types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\n// Should always produce a 20 character pseudo-random string\nfunction generateQuickGuid(): string {\n return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12)\n}\n\nexport interface EditorConfigContextType {\n // Editor focus handling\n blurEditor: (editorContext: EditorConfigContextType) => void\n childrenEditors: React.RefObject<Map<string, EditorConfigContextType>>\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: LexicalRichTextFieldProps['field']\n // Editor focus handling\n focusEditor: (editorContext: EditorConfigContextType) => void\n focusedEditor: EditorConfigContextType | null\n parentEditor: EditorConfigContextType\n registerChild: (uuid: string, editorContext: EditorConfigContextType) => void\n unregisterChild?: (uuid: string) => void\n uuid: string\n}\n\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n field: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n field,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: LexicalRichTextFieldProps['field']\n parentContext?: EditorConfigContextType\n}): React.ReactNode => {\n const [editor] = useLexicalComposerContext()\n // State to store the UUID\n const [uuid] = useState(generateQuickGuid())\n\n const childrenEditors = useRef<Map<string, EditorConfigContextType>>(new Map())\n const [focusedEditor, setFocusedEditor] = useState<EditorConfigContextType | null>(null)\n const focusHistory = useRef<Set<string>>(new Set())\n\n const editorContext = useMemo(\n () =>\n ({\n blurEditor: (editorContext: EditorConfigContextType) => {\n //setFocusedEditor(null) // Clear focused editor\n focusHistory.current.clear() // Reset focus history when focus is lost\n },\n childrenEditors,\n editor,\n editorConfig,\n editorContainerRef,\n field,\n focusEditor: (editorContext: EditorConfigContextType) => {\n const editorUUID = editorContext.uuid\n\n // Avoid recursion by checking if this editor is already focused in this cycle\n if (focusHistory.current.has(editorUUID)) {\n return\n }\n\n // Add this editor to the history to prevent future recursions in this cycle\n focusHistory.current.add(editorUUID)\n setFocusedEditor(editorContext)\n\n // Propagate focus event to parent and children, ensuring they do not refocus this editor\n if (parentContext?.uuid) {\n parentContext.focusEditor(editorContext)\n }\n childrenEditors.current.forEach((childEditor, childUUID) => {\n childEditor.focusEditor(editorContext)\n })\n\n focusHistory.current.clear()\n },\n focusedEditor,\n parentEditor: parentContext,\n registerChild: (childUUID, childEditorContext) => {\n if (!childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.set(childUUID, childEditorContext)\n childrenEditors.current = newMap\n }\n },\n unregisterChild: (childUUID) => {\n if (childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.delete(childUUID)\n childrenEditors.current = newMap\n }\n },\n\n uuid,\n }) as EditorConfigContextType,\n [\n editor,\n childrenEditors,\n editorConfig,\n editorContainerRef,\n field,\n focusedEditor,\n parentContext,\n uuid,\n ],\n )\n\n return <Context.Provider value={editorContext}>{children}</Context.Provider>\n}\n\nexport const useEditorConfigContext = (): EditorConfigContextType => {\n const context = useContext(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProv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WG,IAAA,CACzB,GAAI,CAACnB,EAAgBQ,QAAQI,IAAII,CAAA,EAAY,CAC3C,IAAMI,EAAS,IAAInB,IAAID,EAAgBQ,OAAO,EAC9CY,EAAOC,IAAIL,EAAWG,CAAA,EACtBnB,EAAgBQ,QAAUY,CAC5B,CACF,EACAE,gBAAkBN,GAAA,CAChB,GAAIhB,EAAgBQ,QAAQI,IAAII,CAAA,EAAY,CAC1C,IAAMI,EAAS,IAAInB,IAAID,EAAgBQ,OAAO,EAC9CY,EAAOG,OAAOP,CAAA,EACdhB,EAAgBQ,QAAUY,CAC5B,CACF,EAEA1B,KAAAA,CACF,GACF,CACEK,EACAC,EACAR,EACAK,EACAJ,EACAS,EACAJ,EACAJ,CAAA,CACD,EAGH,OAAO8B,EAACjC,EAAQkC,SAAQ,CAACC,MAAOpB,WAAgBV,GAClD,EAEa+B,EAAyBA,IAAA,CACpC,IAAAC,EAAgB9C,EAAAS,CAAW,EAAA,GACvBqC,IAAAC,OAAY,MAAA,IAAAC,MACE,oEAAA,EAAA,OAEXF,CAAA",
6
- "names": ["useLexicalComposerContext", "createContext", "useContext", "useMemo", "useRef", "useState", "generateQuickGuid", "Math", "random", "toString", "substring", "Context", "editorConfig", "field", "uuid", "EditorConfigProvider", "children", "editorContainerRef", "parentContext", "editor", "childrenEditors", "Map", "focusedEditor", "setFocusedEditor", "focusHistory", "Set", "editorContext", "blurEditor", "current", "clear", "focusEditor", "editorUUID", "has", "add", "forEach", "childEditor", "childUUID", "parentEditor", "registerChild", "childEditorContext", "newMap", "set", "unregisterChild", "delete", "_jsx", "Provider", "value", "useEditorConfigContext", "context", "undefined", "Error"]
7
- }
@@ -1,2 +0,0 @@
1
- function Mt({editorConfig:i}){return i.features.nodes.map(t=>"node"in t?t.node:t)}import{c as gt}from"react/compiler-runtime";import{jsx as pt}from"react/jsx-runtime";import{useLexicalComposerContext as _t}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as xt}from"@lexical/utils";import{$getSelection as P,$isRangeSelection as B,$isTextNode as St,COMMAND_PRIORITY_LOW as Ot,createCommand as wt}from"lexical";import{useEffect as F,useState as yt}from"react";import*as D from"react";import{c as U}from"react/compiler-runtime";import{useLexicalComposerContext as X}from"@lexical/react/LexicalComposerContext.js";import{mergeRegister as $}from"@lexical/utils";import{$getSelection as J,$isRangeSelection as Z,COMMAND_PRIORITY_LOW as E,KEY_ARROW_DOWN_COMMAND as tt,KEY_ARROW_UP_COMMAND as et,KEY_ENTER_COMMAND as nt,KEY_ESCAPE_COMMAND as ot,KEY_TAB_COMMAND as it,createCommand as st}from"lexical";import{useCallback as v,useEffect as N,useLayoutEffect as rt,useMemo as lt,useRef as ct,useState as at}from"react";var ut="slash-menu-popup",W=i=>{let t=document.getElementById("slash-menu");if(!t)return;let n=t.getBoundingClientRect();n.top+n.height>window.innerHeight&&t.scrollIntoView({block:"center"}),n.top<0&&t.scrollIntoView({block:"center"}),i.scrollIntoView({block:"nearest"})};function ft(i,t,n){let o=n;for(let e=o;e<=t.length;e++)i.substring(i.length-e)===t.substring(0,e)&&(o=e);return o}function ht(i){let t=J();if(!Z(t)||!t.isCollapsed())return null;let n=t.anchor;if(n.type!=="text")return null;let o=n.getNode();if(!o.isSimpleText())return null;let e=n.offset,r=o.getTextContent().slice(0,e),a=i.replaceableString.length,f=ft(r,i.matchingString,a),c=e-f;if(c<0)return null;let m;return c===0?[m]=o.splitText(e):[,m]=o.splitText(c,e),m}function mt(i,t){let n=getComputedStyle(i),o=n.position==="absolute",e=t?/(auto|scroll|hidden)/:/(auto|scroll)/;if(n.position==="fixed")return document.body;for(let r=i;r=r.parentElement;)if(n=getComputedStyle(r),!(o&&n.position==="static")&&e.test(n.overflow+n.overflowY+n.overflowX))return r;return document.body}function H(i,t){let n=i.getBoundingClientRect(),o=t.getBoundingClientRect();return n.top>o.top&&n.top<o.bottom}function dt(i,t,n,o){let e=U(7),[r]=X(),a,f;e[0]!==t||e[1]!==i||e[2]!==r||e[3]!==n||e[4]!==o?(a=()=>{if(t!=null&&i!=null){let c=r.getRootElement(),m=c!=null?mt(c,!1):document.body,d;d=!1;let l;l=H(t,m);let h=function(){d||(window.requestAnimationFrame(function(){n(),d=!1}),d=!0);let x=H(t,m);x!==l&&(l=x,o?.(x))},O=new ResizeObserver(n);return window.addEventListener("resize",n),document.addEventListener("scroll",h,{capture:!0,passive:!0}),O.observe(t),()=>{O.unobserve(t),window.removeEventListener("resize",n),document.removeEventListener("scroll",h,!0)}}},f=[t,r,o,n,i],e[0]=t,e[1]=i,e[2]=r,e[3]=n,e[4]=o,e[5]=a,e[6]=f):(a=e[5],f=e[6]),N(a,f)}var k=st("SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND");function K({anchorElementRef:i,close:t,editor:n,groups:o,menuRenderFn:e,onSelectItem:r,resolution:a,shouldSplitNodeWithQuery:f=!1}){let[c,m]=at(null),d=a.match&&a.match.matchingString||"",l=v(s=>{let u=n.getRootElement();u!==null&&(u.setAttribute("aria-activedescendant",`${ut}__item-${s.key}`),m(s.key))},[n]),h=v(()=>{if(o!==null&&d!=null){let s=o.flatMap(u=>u.items);if(s.length){let u=s[0];l(u)}}},[o,l,d]);N(()=>{h()},[d,h]);let O=v(s=>{n.update(()=>{let u=a.match!=null&&f?ht(a.match):null;r(s,u,t,a.match?a.match.matchingString:"")})},[n,f,a.match,r,t]);N(()=>()=>{let s=n.getRootElement();s!==null&&s.removeAttribute("aria-activedescendant")},[n]),rt(()=>{o===null?m(null):c===null&&h()},[o,c,l,h]),N(()=>$(n.registerCommand(k,({item:s})=>s.ref&&s.ref.current!=null?(W(s.ref.current),!0):!1,E)),[n,l]),N(()=>$(n.registerCommand(tt,s=>{let u=s;if(o!==null&&o.length&&c!==null){let _=o.flatMap(w=>w.items),g=_.findIndex(w=>w.key===c),S=g!==_.length-1?g+1:0,p=_[S];l(p),p.ref!=null&&p.ref.current&&n.dispatchCommand(k,{index:S,item:p}),u.preventDefault(),u.stopImmediatePropagation()}return!0},E),n.registerCommand(et,s=>{let u=s;if(o!==null&&o.length&&c!==null){let _=o.flatMap(w=>w.items),g=_.findIndex(w=>w.key===c),S=g!==0?g-1:_.length-1,p=_[S];l(p),p.ref!=null&&p.ref.current&&W(p.ref.current),u.preventDefault(),u.stopImmediatePropagation()}return!0},E),n.registerCommand(ot,s=>{let u=s;return u.preventDefault(),u.stopImmediatePropagation(),t(),!0},E),n.registerCommand(it,s=>{let u=s;if(o===null||c===null)return!1;let g=o.flatMap(S=>S.items).find(S=>S.key===c);return g?(u.preventDefault(),u.stopImmediatePropagation(),O(g),!0):!1},E),n.registerCommand(nt,s=>{if(o===null||c===null)return!1;let _=o.flatMap(g=>g.items).find(g=>g.key===c);return _?(s!==null&&(s.preventDefault(),s.stopImmediatePropagation()),O(_),!0):!1},E)),[O,t,n,o,c,l]);let x=lt(()=>({groups:o,selectItemAndCleanUp:O,selectedItemKey:c,setSelectedItemKey:m}),[O,c,o]);return e(i,x,a.match?a.match.matchingString:"")}function q(i,t,n,o){let e=U(14),[r]=X(),a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a=document.createElement("div"),e[0]=a):a=e[0];let f=ct(a),c;e[1]!==r||e[2]!==t||e[3]!==i||e[4]!==o?(c=()=>{let x=r.getRootElement(),s=f.current,u=s.firstChild;if(x!==null&&t!==null){let{height:_,width:g}=t.getRect(),{left:S,top:p}=t.getRect(),w=p;if(p=p-(i.getBoundingClientRect().top+window.scrollY),S=S-(i.getBoundingClientRect().left+window.scrollX),s.style.left=`${S+window.scrollX}px`,s.style.height=`${_}px`,s.style.width=`${g}px`,u!==null){let T=u.getBoundingClientRect(),I=T.height,y=T.width,M=x.getBoundingClientRect();S+y>M.right&&(s.style.left=`${M.right-y+window.scrollX}px`);let R=w+I+32>window.innerHeight,C=w<0;R&&!C?s.style.top=`${p+32-I+window.scrollY-(_+24)}px`:s.style.top=`${p+window.scrollY+32}px`}s.isConnected||(o!=null&&(s.className=o),s.setAttribute("aria-label","Slash menu"),s.setAttribute("id","slash-menu"),s.setAttribute("role","listbox"),s.style.display="block",s.style.position="absolute",i.append(s)),f.current=s,x.setAttribute("aria-controls","slash-menu")}},e[1]=r,e[2]=t,e[3]=i,e[4]=o,e[5]=c):c=e[5];let m=c,d,l;e[6]!==r||e[7]!==t||e[8]!==m?(d=()=>{let x=r.getRootElement();if(t!==null)return m(),()=>{x!==null&&x.removeAttribute("aria-controls");let s=f.current;s!==null&&s.isConnected&&s.remove()}},l=[r,m,t],e[6]=r,e[7]=t,e[8]=m,e[9]=d,e[10]=l):(d=e[9],l=e[10]),N(d,l);let h;e[11]!==t||e[12]!==n?(h=x=>{t!==null&&(x||n(null))},e[11]=t,e[12]=n,e[13]=h):h=e[13];let O=h;return dt(t,f.current,m,O),f}var Xt=`\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'"~=<>_:;`;function Rt(i){let t=i.anchor;if(t.type!=="text")return null;let n=t.getNode();if(!n.isSimpleText())return null;let o=t.offset;return n.getTextContent().slice(0,o)}function V(i,t,n){let o=n.getSelection();if(o===null||!o.isCollapsed)return!1;let e=o.anchorNode,r=i,a=o.anchorOffset;if(e==null||a==null)return!1;try{t.setStart(e,r),t.setEnd(e,a>1?a:1)}catch{return!1}return!0}function Ct(i){let t=null;return i.getEditorState().read(()=>{let n=P();B(n)&&(t=Rt(n))}),t}function z(i,t){return t!==0?!1:i.getEditorState().read(()=>{let n=P();if(B(n)){let r=n.anchor.getNode().getPreviousSibling();return St(r)&&r.isTextEntity()}return!1})}function Q(i){D.startTransition?D.startTransition(i):i()}var Tt=wt("ENABLE_SLASH_MENU_COMMAND");function Kt(i){let t=gt(31),{anchorClassName:n,anchorElem:o,groups:e,menuRenderFn:r,onClose:a,onOpen:f,onQueryChange:c,onSelectItem:m,triggerFn:d}=i,[l]=_t(),[h,O]=yt(null),x=q(o,h,O,n),s;t[0]!==a||t[1]!==h?(s=()=>{O(null),a!=null&&h!==null&&a()},t[0]=a,t[1]=h,t[2]=s):s=t[2];let u=s,_;t[3]!==f||t[4]!==h?(_=y=>{O(y),f!=null&&h===null&&f(y)},t[3]=f,t[4]=h,t[5]=_):_=t[5];let g=_,S,p;t[6]!==l||t[7]!==g?(S=()=>xt(l.registerCommand(Tt,y=>{let{node:M}=y;return l.getEditorState().read(()=>{let R={leadOffset:0,matchingString:"",replaceableString:""};if(!z(l,R.leadOffset)&&M!==null){let C=l._window??window,A=C.document.createRange();V(R.leadOffset,A,C)!==null&&Q(()=>g({getRect:()=>A.getBoundingClientRect(),match:R}));return}}),!0},Ot)),p=[l,g],t[6]=l,t[7]=g,t[8]=S,t[9]=p):(S=t[8],p=t[9]),F(S,p);let w;t[10]!==l||t[11]!==u||t[12]!==d||t[13]!==c||t[14]!==g?(w=()=>{let y=()=>{l.getEditorState().read(()=>{let R=l._window??window,C=R.document.createRange(),A=P(),L=Ct(l);if(!B(A)||!A.isCollapsed()||L===null||C===null){u();return}let b=d({editor:l,query:L});if(c(b?b.matchingString:null),b!==null&&!z(l,b.leadOffset)&&V(b.leadOffset,C,R)!==null){Q(()=>g({getRect:()=>C.getBoundingClientRect(),match:b}));return}u()})},M=l.registerUpdateListener(y);return()=>{M()}},t[10]=l,t[11]=u,t[12]=d,t[13]=c,t[14]=g,t[15]=w):w=t[15];let T;t[16]!==l||t[17]!==d||t[18]!==c||t[19]!==h||t[20]!==u||t[21]!==g?(T=[l,d,c,h,u,g],t[16]=l,t[17]=d,t[18]=c,t[19]=h,t[20]=u,t[21]=g,t[22]=T):T=t[22],F(w,T);let I;return t[23]!==h||t[24]!==l||t[25]!==x||t[26]!==u||t[27]!==e||t[28]!==r||t[29]!==m?(I=h===null||l===null?null:pt(K,{anchorElementRef:x,close:u,editor:l,groups:e,menuRenderFn:r,onSelectItem:m,resolution:h,shouldSplitNodeWithQuery:!0}),t[23]=h,t[24]=l,t[25]=x,t[26]=u,t[27]=e,t[28]=r,t[29]=m,t[30]=I):I=t[30],I}function Ft(i){return i instanceof HTMLElement}var Y=class{_x;_y;constructor(t,n){this._x=t,this._y=n}calcDeltaXTo({x:t}){return this.x-t}calcDeltaYTo({y:t}){return this.y-t}calcDistanceTo(t){return Math.sqrt(Math.pow(this.calcDeltaXTo(t),2)+Math.pow(this.calcDeltaYTo(t),2))}calcHorizontalDistanceTo(t){return Math.abs(this.calcDeltaXTo(t))}calcVerticalDistance(t){return Math.abs(this.calcDeltaYTo(t))}equals({x:t,y:n}){return this.x===t&&this.y===n}get x(){return this._x}get y(){return this._y}};function j(i){return i instanceof Y}var G=class i{_bottom;_left;_right;_top;constructor(t,n,o,e){let[r,a]=n<=e?[n,e]:[e,n],[f,c]=t<=o?[t,o]:[o,t];this._top=r,this._right=c,this._left=f,this._bottom=a}static fromDOM(t){let{height:n,left:o,top:e,width:r}=t.getBoundingClientRect();return i.fromLWTH(o,r,e,n)}static fromDOMRect(t){let{height:n,left:o,top:e,width:r}=t;return i.fromLWTH(o,r,e,n)}static fromLTRB(t,n,o,e){return new i(t,n,o,e)}static fromLWTH(t,n,o,e){return new i(t,o,t+n,o+e)}static fromPoints(t,n){let{x:o,y:e}=t,{x:r,y:a}=n;return i.fromLTRB(o,e,r,a)}contains(t){if(j(t)){let{x:a,y:f}=t,c=f<this._top,m=f>this._bottom,d=a<this._left,l=a>this._right;return{reason:{isOnBottomSide:m,isOnLeftSide:d,isOnRightSide:l,isOnTopSide:c},result:!c&&!m&&!d&&!l}}let{bottom:n,left:o,right:e,top:r}=t;return r>=this._top&&r<=this._bottom&&n>=this._top&&n<=this._bottom&&o>=this._left&&o<=this._right&&e>=this._left&&e<=this._right}distanceFromPoint(t){let n=this.contains(t);if(n.result)return{distance:0,isOnBottomSide:n.reason.isOnBottomSide,isOnLeftSide:n.reason.isOnLeftSide,isOnRightSide:n.reason.isOnRightSide,isOnTopSide:n.reason.isOnTopSide};let o=0,e=0;return t.x<this._left?o=this._left-t.x:t.x>this._right&&(o=t.x-this._right),t.y<this._top?e=this._top-t.y:t.y>this._bottom&&(e=t.y-this._bottom),{distance:Math.sqrt(o*o+e*e),isOnBottomSide:t.y>this._bottom,isOnLeftSide:t.x<this._left,isOnRightSide:t.x>this._right,isOnTopSide:t.y<this._top}}equals({bottom:t,left:n,right:o,top:e}){return e===this._top&&t===this._bottom&&n===this._left&&o===this._right}generateNewRect({bottom:t=this.bottom,left:n=this.left,right:o=this.right,top:e=this.top}){return new i(n,e,o,t)}intersectsWith(t){let{height:n,left:o,top:e,width:r}=t,{height:a,left:f,top:c,width:m}=this,d=o+r>=f+m?o+r:f+m,l=e+n>=c+a?e+n:c+a,h=o<=f?o:f,O=e<=c?e:c;return d-h<=r+m&&l-O<=n+a}get bottom(){return this._bottom}get height(){return Math.abs(this._bottom-this._top)}get left(){return this._left}get right(){return this._right}get top(){return this._top}get width(){return Math.abs(this._left-this._right)}};export{Mt as a,Xt as b,Tt as c,Kt as d,Ft as e,Y as f,j as g,G as h};
2
- //# sourceMappingURL=chunk-TO2W7Q2G.js.map