@payloadcms/richtext-lexical 4.0.0-internal.a1317b2 → 4.0.0-internal.a2d053c

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 (448) hide show
  1. package/dist/exports/client/Field-334JNLRF.js +2 -0
  2. package/dist/exports/client/Field-334JNLRF.js.map +7 -0
  3. package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js → RelationshipComponent-TVK6I4W4.js} +2 -2
  4. package/dist/exports/client/chunk-BEKGION5.js +2 -0
  5. package/dist/exports/client/chunk-BEKGION5.js.map +7 -0
  6. package/dist/exports/client/{chunk-WSAPGI3Z.js → chunk-EA5BHQ2T.js} +1 -1
  7. package/dist/exports/client/{chunk-WSAPGI3Z.js.map → chunk-EA5BHQ2T.js.map} +1 -1
  8. package/dist/exports/client/chunk-FAJJXXCW.js +2 -0
  9. package/dist/exports/client/chunk-FAJJXXCW.js.map +7 -0
  10. package/dist/exports/client/{chunk-5VIL27GI.js → chunk-IYBYNEKX.js} +1 -1
  11. package/dist/exports/client/{chunk-5VIL27GI.js.map → chunk-IYBYNEKX.js.map} +1 -1
  12. package/dist/exports/client/chunk-SE5IITBK.js +2 -0
  13. package/dist/exports/client/chunk-SE5IITBK.js.map +7 -0
  14. package/dist/exports/client/{component-D5QLYS7W.js → component-QENB4QTS.js} +2 -2
  15. package/dist/exports/client/componentInline-AU7IBNY7.js +2 -0
  16. package/dist/exports/client/index.js +28 -28
  17. package/dist/exports/client/index.js.map +4 -4
  18. package/dist/features/align/client/index.js.map +1 -1
  19. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  20. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  21. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  22. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  23. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  24. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
  25. package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
  26. package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
  27. package/dist/features/blocks/client/component/index.d.ts +0 -6
  28. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  29. package/dist/features/blocks/client/component/index.js +199 -109
  30. package/dist/features/blocks/client/component/index.js.map +1 -1
  31. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  32. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  33. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  34. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  35. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
  36. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
  37. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
  38. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
  39. package/dist/features/blocks/client/componentInline/index.css +0 -1
  40. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  41. package/dist/features/blocks/client/componentInline/index.js +32 -30
  42. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  43. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  44. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  45. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  46. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  47. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  48. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  49. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  50. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  51. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +121 -78
  52. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  53. package/dist/features/blocks/premade/CodeBlock/Component/Code.js +142 -87
  54. package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
  55. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  56. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  57. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  58. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  59. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  60. package/dist/features/blocks/server/schema.d.ts +2 -0
  61. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  62. package/dist/features/blocks/server/schema.js +7 -9
  63. package/dist/features/blocks/server/schema.js.map +1 -1
  64. package/dist/features/blocks/server/validate.js +1 -1
  65. package/dist/features/blocks/server/validate.js.map +1 -1
  66. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  67. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  68. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  69. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  70. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  71. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  72. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  73. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  74. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  75. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  76. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  77. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  78. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  79. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  80. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  81. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  82. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  83. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  84. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  85. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  86. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  87. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  88. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  89. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  90. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  91. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  92. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  93. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  94. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  95. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  96. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  97. package/dist/features/heading/client/index.js.map +1 -1
  98. package/dist/features/heading/constants.d.ts +2 -0
  99. package/dist/features/heading/constants.d.ts.map +1 -0
  100. package/dist/features/heading/constants.js +2 -0
  101. package/dist/features/heading/constants.js.map +1 -0
  102. package/dist/features/heading/server/index.d.ts.map +1 -1
  103. package/dist/features/heading/server/index.js +5 -1
  104. package/dist/features/heading/server/index.js.map +1 -1
  105. package/dist/features/heading/server/validate.d.ts +6 -0
  106. package/dist/features/heading/server/validate.d.ts.map +1 -0
  107. package/dist/features/heading/server/validate.js +15 -0
  108. package/dist/features/heading/server/validate.js.map +1 -0
  109. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +11 -1
  110. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  111. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +17 -0
  112. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  113. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  114. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +2 -2
  115. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  116. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  117. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  118. package/dist/features/horizontalRule/server/schema.js +6 -5
  119. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  120. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  121. package/dist/features/indent/client/IndentPlugin.js +122 -1
  122. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  123. package/dist/features/indent/client/index.d.ts.map +1 -1
  124. package/dist/features/indent/client/index.js +0 -2
  125. package/dist/features/indent/client/index.js.map +1 -1
  126. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  127. package/dist/features/indent/server/i18n.js +74 -37
  128. package/dist/features/indent/server/i18n.js.map +1 -1
  129. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  130. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  131. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +18 -7
  132. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  133. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -1
  134. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  135. package/dist/features/link/markdownTransformer.js +2 -2
  136. package/dist/features/link/markdownTransformer.js.map +1 -1
  137. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  138. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  139. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  140. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  141. package/dist/features/link/nodes/LinkNode.js +2 -15
  142. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  143. package/dist/features/link/server/baseFields.js.map +1 -1
  144. package/dist/features/link/server/validate.js +1 -1
  145. package/dist/features/link/server/validate.js.map +1 -1
  146. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  147. package/dist/features/lists/checklist/server/index.js +5 -2
  148. package/dist/features/lists/checklist/server/index.js.map +1 -1
  149. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  150. package/dist/features/lists/orderedList/server/index.js +5 -2
  151. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  152. package/dist/features/lists/shared/constants.d.ts +2 -0
  153. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  154. package/dist/features/lists/shared/constants.js +2 -0
  155. package/dist/features/lists/shared/constants.js.map +1 -0
  156. package/dist/features/lists/shared/schema.d.ts.map +1 -1
  157. package/dist/features/lists/shared/schema.js.map +1 -1
  158. package/dist/features/lists/shared/validate.d.ts +5 -0
  159. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  160. package/dist/features/lists/shared/validate.js +15 -0
  161. package/dist/features/lists/shared/validate.js.map +1 -0
  162. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  163. package/dist/features/lists/unorderedList/server/index.js +5 -2
  164. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  165. package/dist/features/relationship/client/components/index.css +3 -6
  166. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  167. package/dist/features/relationship/client/index.d.ts +2 -2
  168. package/dist/features/relationship/client/index.d.ts.map +1 -1
  169. package/dist/features/relationship/client/index.js.map +1 -1
  170. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  171. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  172. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  173. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  174. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  175. package/dist/features/relationship/client/plugins/index.js +27 -31
  176. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  177. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  178. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  179. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  180. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  181. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  182. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  183. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  184. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  185. package/dist/features/relationship/server/index.d.ts +8 -1
  186. package/dist/features/relationship/server/index.d.ts.map +1 -1
  187. package/dist/features/relationship/server/index.js +28 -11
  188. package/dist/features/relationship/server/index.js.map +1 -1
  189. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  190. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  191. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  192. package/dist/features/relationship/server/schema.d.ts +3 -2
  193. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  194. package/dist/features/relationship/server/schema.js +9 -12
  195. package/dist/features/relationship/server/schema.js.map +1 -1
  196. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  197. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  198. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  199. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  200. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  201. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  202. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  203. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  204. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.css +1 -2
  205. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  206. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js +17 -44
  207. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  208. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  209. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js +47 -24
  210. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  211. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  212. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  213. package/dist/features/table/client/plugins/TablePlugin/index.js +54 -18
  214. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -1
  215. package/dist/features/table/client/utils/useDebounce.js.map +1 -1
  216. package/dist/features/textState/defaultColors.js +1 -1
  217. package/dist/features/textState/defaultColors.js.map +1 -1
  218. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -1
  219. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  220. package/dist/features/toolbars/fixed/client/Toolbar/index.js +141 -70
  221. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  222. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  223. package/dist/features/toolbars/inline/client/Toolbar/index.js +84 -37
  224. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  225. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  226. package/dist/features/toolbars/shared/ToolbarButton/index.js +27 -2
  227. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  228. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  229. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +199 -81
  230. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  231. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -12
  232. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  233. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +22 -6
  234. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  235. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  236. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  237. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +109 -0
  238. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  239. package/dist/features/typesServer.d.ts +16 -11
  240. package/dist/features/typesServer.d.ts.map +1 -1
  241. package/dist/features/typesServer.js.map +1 -1
  242. package/dist/features/upload/client/component/index.css +0 -2
  243. package/dist/features/upload/client/drawer/index.js.map +1 -1
  244. package/dist/features/upload/client/index.d.ts +3 -2
  245. package/dist/features/upload/client/index.d.ts.map +1 -1
  246. package/dist/features/upload/client/index.js.map +1 -1
  247. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  248. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  249. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  250. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  251. package/dist/features/upload/client/plugin/index.js +50 -53
  252. package/dist/features/upload/client/plugin/index.js.map +1 -1
  253. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  254. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  255. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  256. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  257. package/dist/features/upload/server/index.d.ts +7 -3
  258. package/dist/features/upload/server/index.d.ts.map +1 -1
  259. package/dist/features/upload/server/index.js +18 -14
  260. package/dist/features/upload/server/index.js.map +1 -1
  261. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  262. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  263. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  264. package/dist/features/upload/server/schema.d.ts +4 -16
  265. package/dist/features/upload/server/schema.d.ts.map +1 -1
  266. package/dist/features/upload/server/schema.js +8 -10
  267. package/dist/features/upload/server/schema.js.map +1 -1
  268. package/dist/features/upload/server/validate.d.ts +2 -2
  269. package/dist/features/upload/server/validate.d.ts.map +1 -1
  270. package/dist/features/upload/server/validate.js +4 -1
  271. package/dist/features/upload/server/validate.js.map +1 -1
  272. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  273. package/dist/field/Diff/converters/listitem/index.js +2 -1
  274. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  275. package/dist/field/Diff/converters/relationship/index.css +0 -1
  276. package/dist/field/Diff/converters/unknown/index.css +0 -1
  277. package/dist/field/Diff/converters/upload/index.css +0 -1
  278. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  279. package/dist/field/Diff/index.css +0 -2
  280. package/dist/field/Diff/index.d.ts +3 -2
  281. package/dist/field/Diff/index.d.ts.map +1 -1
  282. package/dist/field/Diff/index.js +3 -2
  283. package/dist/field/Diff/index.js.map +1 -1
  284. package/dist/field/Field.d.ts.map +1 -1
  285. package/dist/field/Field.js +8 -1
  286. package/dist/field/Field.js.map +1 -1
  287. package/dist/field/RenderLexical/index.d.ts +3 -1
  288. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  289. package/dist/field/RenderLexical/index.js +23 -23
  290. package/dist/field/RenderLexical/index.js.map +1 -1
  291. package/dist/field/ViewSelector.d.ts.map +1 -1
  292. package/dist/field/ViewSelector.js +13 -4
  293. package/dist/field/ViewSelector.js.map +1 -1
  294. package/dist/field/bundled.css +1 -1
  295. package/dist/field/index.css +0 -1
  296. package/dist/field/index.js.map +1 -1
  297. package/dist/field/rscEntry.d.ts +2 -2
  298. package/dist/field/rscEntry.d.ts.map +1 -1
  299. package/dist/field/rscEntry.js.map +1 -1
  300. package/dist/i18n.d.ts.map +1 -1
  301. package/dist/i18n.js +44 -0
  302. package/dist/i18n.js.map +1 -1
  303. package/dist/index.d.ts +4 -4
  304. package/dist/index.d.ts.map +1 -1
  305. package/dist/index.js +23 -1
  306. package/dist/index.js.map +1 -1
  307. package/dist/lexical/LexicalEditor.css +21 -10
  308. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  309. package/dist/lexical/LexicalEditor.js +61 -64
  310. package/dist/lexical/LexicalEditor.js.map +1 -1
  311. package/dist/lexical/plugins/ClipboardPlugin/index.js.map +1 -1
  312. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  313. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  314. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  315. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +2 -1
  316. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  317. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  318. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  319. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +235 -88
  320. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  321. package/dist/lexical/plugins/SlashMenu/index.css +0 -1
  322. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  323. package/dist/lexical/plugins/TextPlugin/index.js.map +1 -1
  324. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  325. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  326. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  327. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +17 -0
  328. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  329. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +139 -37
  330. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  331. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts +7 -0
  332. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts.map +1 -0
  333. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js +15 -0
  334. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js.map +1 -0
  335. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  336. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  337. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +62 -0
  338. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  339. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  340. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  341. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  342. package/dist/lexical/theme/EditorTheme.css +0 -2
  343. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  344. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  345. package/dist/lexical/ui/ContentEditable.js +32 -11
  346. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  347. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  348. package/dist/lexical/ui/icons/H3/index.js +13 -6
  349. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  350. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  351. package/dist/lexical/ui/icons/H4/index.js +13 -6
  352. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  353. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  354. package/dist/lexical/ui/icons/H5/index.js +13 -6
  355. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  356. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  357. package/dist/lexical/ui/icons/H6/index.js +13 -6
  358. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  359. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  360. package/dist/lexical/utils/nodeFormat.js +0 -2
  361. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  362. package/dist/lexical/utils/url.d.ts.map +1 -1
  363. package/dist/lexical/utils/url.js +1 -1
  364. package/dist/lexical/utils/url.js.map +1 -1
  365. package/dist/populateGraphQL/populate.js.map +1 -1
  366. package/dist/presets/llmInstructions.d.ts +2 -0
  367. package/dist/presets/llmInstructions.d.ts.map +1 -0
  368. package/dist/presets/llmInstructions.js +13 -0
  369. package/dist/presets/llmInstructions.js.map +1 -0
  370. package/dist/types/builtInNodes.d.ts +1 -1
  371. package/dist/types/builtInNodes.d.ts.map +1 -1
  372. package/dist/types/builtInNodes.js +8 -3
  373. package/dist/types/builtInNodes.js.map +1 -1
  374. package/dist/types/index.d.ts +3 -6
  375. package/dist/types/index.d.ts.map +1 -1
  376. package/dist/types/index.js.map +1 -1
  377. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  378. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  379. package/dist/types/jsonSchemaHelpers.js +7 -2
  380. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  381. package/dist/types/nodeTypes.d.ts +5 -0
  382. package/dist/types/nodeTypes.d.ts.map +1 -1
  383. package/dist/types/nodeTypes.js.map +1 -1
  384. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  385. package/dist/utilities/buildEditorState.js.map +1 -1
  386. package/dist/utilities/buildInitialState.d.ts +3 -2
  387. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  388. package/dist/utilities/buildInitialState.js +1 -0
  389. package/dist/utilities/buildInitialState.js.map +1 -1
  390. package/dist/utilities/fieldsDrawer/Drawer.js +36 -36
  391. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  392. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  393. package/dist/utilities/fieldsDrawer/DrawerContent.js +6 -9
  394. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  395. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -1
  396. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  397. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -1
  398. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
  399. package/dist/utilities/generateImportMap.d.ts +2 -2
  400. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  401. package/dist/utilities/generateImportMap.js.map +1 -1
  402. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  403. package/dist/utilities/initLexicalFeatures.js +38 -4
  404. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  405. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  406. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  407. package/dist/utilities/useLexicalFeature.js +15 -6
  408. package/dist/utilities/useLexicalFeature.js.map +1 -1
  409. package/dist/utilities/useRunDeprioritized.js.map +1 -1
  410. package/dist/validate/hasText.d.ts +2 -2
  411. package/dist/validate/hasText.d.ts.map +1 -1
  412. package/dist/validate/hasText.js.map +1 -1
  413. package/dist/validate/index.d.ts +1 -1
  414. package/dist/validate/index.d.ts.map +1 -1
  415. package/package.json +50 -53
  416. package/dist/dependencyChecker.spec.js +0 -16
  417. package/dist/dependencyChecker.spec.js.map +0 -1
  418. package/dist/exports/client/Field-F22V5L4V.js +0 -2
  419. package/dist/exports/client/Field-F22V5L4V.js.map +0 -7
  420. package/dist/exports/client/bundled.css +0 -1
  421. package/dist/exports/client/chunk-43E5QYAA.js +0 -2
  422. package/dist/exports/client/chunk-43E5QYAA.js.map +0 -7
  423. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  424. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  425. package/dist/exports/client/chunk-LN6VX25I.js +0 -2
  426. package/dist/exports/client/chunk-LN6VX25I.js.map +0 -7
  427. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  428. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  429. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  430. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  431. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  432. package/dist/features/converters/lexicalToHtml/sync/alignment.spec.js +0 -92
  433. package/dist/features/converters/lexicalToHtml/sync/alignment.spec.js.map +0 -1
  434. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  435. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  436. package/dist/features/link/markdownTransformer.spec.js +0 -195
  437. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  438. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.spec.js +0 -65
  439. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.spec.js.map +0 -1
  440. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  441. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  442. package/dist/lexical/utils/url.spec.js +0 -114
  443. package/dist/lexical/utils/url.spec.js.map +0 -1
  444. package/dist/utilities/jsx/jsx.spec.js +0 -178
  445. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  446. /package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js.map → RelationshipComponent-TVK6I4W4.js.map} +0 -0
  447. /package/dist/exports/client/{component-D5QLYS7W.js.map → component-QENB4QTS.js.map} +0 -0
  448. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-AU7IBNY7.js.map} +0 -0
@@ -1,20 +1,29 @@
1
1
  'use client';
2
2
 
3
+ import { c as _c } from "react/compiler-runtime";
3
4
  import { useAddClientFunction } from '@payloadcms/ui';
4
5
  import { useEditorConfigContext } from '../lexical/config/client/EditorConfigProvider.js';
5
6
  export const useLexicalFeature = (featureKey, feature) => {
7
+ const $ = _c(1);
6
8
  const {
7
9
  fieldProps: t0
8
10
  } = useEditorConfigContext();
9
11
  const {
10
12
  schemaPath: schemaPathFromFieldProps
11
13
  } = t0;
12
- const tableCell = {
13
- cellProps: {
14
- schemaPath: []
15
- }
16
- };
17
- const schemaPathFromCellProps = tableCell?.cellProps?.schemaPath ? tableCell?.cellProps?.schemaPath.join(".") : null;
14
+ let t1;
15
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
16
+ const tableCell = {
17
+ cellProps: {
18
+ schemaPath: []
19
+ }
20
+ };
21
+ t1 = tableCell?.cellProps?.schemaPath ? tableCell?.cellProps?.schemaPath.join(".") : null;
22
+ $[0] = t1;
23
+ } else {
24
+ t1 = $[0];
25
+ }
26
+ const schemaPathFromCellProps = t1;
18
27
  const schemaPath = schemaPathFromCellProps || schemaPathFromFieldProps;
19
28
  useAddClientFunction(`lexicalFeature.${schemaPath}.${featureKey}`, feature);
20
29
  };
@@ -1 +1 @@
1
- {"version":3,"file":"useLexicalFeature.js","names":["useAddClientFunction","useEditorConfigContext","useLexicalFeature","featureKey","feature","fieldProps","t0","schemaPath","schemaPathFromFieldProps","tableCell","cellProps","schemaPathFromCellProps","join"],"sources":["../../src/utilities/useLexicalFeature.tsx"],"sourcesContent":["'use client'\n\nimport { useAddClientFunction } from '@payloadcms/ui'\n\nimport type { FeatureProviderClient } from '../features/typesClient.js'\n\nimport { useEditorConfigContext } from '../lexical/config/client/EditorConfigProvider.js'\n\nexport const useLexicalFeature = <ClientFeatureProps,>(\n featureKey: string,\n feature: FeatureProviderClient<ClientFeatureProps>,\n) => {\n const {\n fieldProps: { schemaPath: schemaPathFromFieldProps },\n } = useEditorConfigContext()\n const tableCell = { cellProps: { schemaPath: [] } } // TODO: get tableCell from props\n // const tableCell = useTableCell()\n\n const schemaPathFromCellProps = tableCell?.cellProps?.schemaPath\n ? tableCell?.cellProps?.schemaPath.join('.')\n : null\n\n const schemaPath = schemaPathFromCellProps || schemaPathFromFieldProps // schemaPathFromCellProps needs to have priority, as there can be cells within fields (e.g. list drawers) and the cell schemaPath needs to be used there - not the parent field schemaPath. There cannot be fields within cells.\n\n useAddClientFunction(`lexicalFeature.${schemaPath}.${featureKey}`, feature)\n}\n"],"mappings":"AAAA;;AAEA,SAASA,oBAAoB,QAAQ;AAIrC,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,iBAAA,GAAoBA,CAAAC,UAAA,EAAAC,OAAA;EAI/B;IAAAC,UAAA,EAAAC;EAAA,IAEIL,sBAAA;EADU;IAAAM,UAAA,EAAAC;EAAA,IAAAF,EAAwC;EAEtD,MAAAG,SAAA;IAAAC,SAAA;MAAAH,UAAA;IAAA;EAAA;EAGA,MAAAI,uBAAA,GAAgCF,SAAA,EAAAC,SAAA,EAAAH,UAAA,GAC5BE,SAAA,EAAAC,SAAA,EAAAH,UAAA,CAAAK,IAAA,CAAsC,WACtC;EAEJ,MAAAL,UAAA,GAAmBI,uBAAA,IAA2BH,wBAAA;EAE9CR,oBAAA,CAAqB,kBAAkBO,UAAA,IAAcJ,UAAA,EAAY,EAAEC,OAAA;AAAA,CACrE","ignoreList":[]}
1
+ {"version":3,"file":"useLexicalFeature.js","names":["c","_c","useAddClientFunction","useEditorConfigContext","useLexicalFeature","featureKey","feature","$","fieldProps","t0","schemaPath","schemaPathFromFieldProps","t1","Symbol","for","tableCell","cellProps","join","schemaPathFromCellProps"],"sources":["../../src/utilities/useLexicalFeature.tsx"],"sourcesContent":["'use client'\n\nimport { useAddClientFunction } from '@payloadcms/ui'\n\nimport type { FeatureProviderClient } from '../features/typesClient.js'\n\nimport { useEditorConfigContext } from '../lexical/config/client/EditorConfigProvider.js'\n\nexport const useLexicalFeature = <ClientFeatureProps,>(\n featureKey: string,\n feature: FeatureProviderClient<ClientFeatureProps>,\n) => {\n const {\n fieldProps: { schemaPath: schemaPathFromFieldProps },\n } = useEditorConfigContext()\n const tableCell = { cellProps: { schemaPath: [] } } // TODO: get tableCell from props\n // const tableCell = useTableCell()\n\n const schemaPathFromCellProps = tableCell?.cellProps?.schemaPath\n ? tableCell?.cellProps?.schemaPath.join('.')\n : null\n\n const schemaPath = schemaPathFromCellProps || schemaPathFromFieldProps // schemaPathFromCellProps needs to have priority, as there can be cells within fields (e.g. list drawers) and the cell schemaPath needs to be used there - not the parent field schemaPath. There cannot be fields within cells.\n\n useAddClientFunction(`lexicalFeature.${schemaPath}.${featureKey}`, feature)\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAEA,SAASC,oBAAoB,QAAQ;AAIrC,SAASC,sBAAsB,QAAQ;AAEvC,OAAO,MAAMC,iBAAA,GAAoBA,CAAAC,UAAA,EAAAC,OAAA;EAAA,MAAAC,CAAA,GAAAN,EAAA;EAI/B;IAAAO,UAAA,EAAAC;EAAA,IAEIN,sBAAA;EADU;IAAAO,UAAA,EAAAC;EAAA,IAAAF,EAAwC;EAAA,IAAAG,EAAA;EAAA,IAAAL,CAAA,QAAAM,MAAA,CAAAC,GAAA;IAEtD,MAAAC,SAAA,GAAkB;MAAAC,SAAA,EAAa;QAAAN,UAAA,EAAc;MAAG;IAAE;IAGlBE,EAAA,GAAAG,SAAA,EAAAC,SAAsB,EAAAN,UAElD,GADAK,SAAA,EAAAC,SAAsB,EAAAN,UAAW,CAAAO,IAAK,IACtC,IAF4B,IAE5B;IAAAV,CAAA,MAAAK,EAAA;EAAA;IAAAA,EAAA,GAAAL,CAAA;EAAA;EAFJ,MAAAW,uBAAA,GAAgCN,EAE5B;EAEJ,MAAAF,UAAA,GAAmBQ,uBAA2B,IAA3BP,wBAA2B;EAE9CT,oBAAA,CAAqB,kBAAkBQ,UAAA,IAAcL,UAAA,EAAY,EAAEC,OAAA;AAAA,CACrE","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"useRunDeprioritized.js","names":["c","_c","useCallback","useRef","useRunDeprioritized","t0","$","timeout","undefined","idleHandleRef","t1","fn","Promise","resolve","exec","window","current","cancelIdleCallback","requestIdleCallback","interactionResponse","then","runDeprioritized","setTimeout","requestAnimationFrame"],"sources":["../../src/utilities/useRunDeprioritized.ts"],"sourcesContent":["'use client'\nimport { useCallback, useRef } from 'react'\n\n/**\n * Simple hook that lets you run any callback once the main thread is idle\n * (via `requestIdleCallback`) or when that API is missing (Safari) - after the\n * next animation frame (`interactionResponse`).\n *\n * This will help you to avoid blocking the main thread with heavy work.\n *\n * The latest invocation wins: if a new run is queued before the previous one\n * executes, the previous task is cancelled.\n *\n * Usage:\n * ```ts\n * const runDeprioritized = useRunDeprioritized();\n *\n * const onEditorChange = (state: EditorState) => {\n * runDeprioritized(() => {\n * // heavy work here …\n * });\n * };\n * ```\n *\n * @param timeout Optional timeout (ms) for `requestIdleCallback`; defaults to 500 ms.\n * @returns A `runDeprioritized(fn)` helper.\n */\n\nexport function useRunDeprioritized(timeout = 500) {\n const idleHandleRef = useRef<number>(undefined)\n\n /**\n * Schedule `fn` and resolve when it has executed.\n */\n const runDeprioritized = useCallback(\n (fn: () => void): Promise<void> => {\n return new Promise<void>((resolve) => {\n const exec = () => {\n fn()\n resolve()\n }\n\n if ('requestIdleCallback' in window) {\n // Cancel any previously queued task so only the latest runs.\n if ('cancelIdleCallback' in window && idleHandleRef.current !== undefined) {\n // Cancel earlier scheduled value updates,\n // so that a CPU-limited event loop isn't flooded with n callbacks for n keystrokes into the rich text field,\n // but that there's only ever the latest one state update\n // dispatch task, to be executed with the next idle time,\n // or the deadline of 500ms.\n cancelIdleCallback(idleHandleRef.current)\n }\n // Schedule the state update to happen the next time the browser has sufficient resources,\n // or the latest after 500ms.\n idleHandleRef.current = requestIdleCallback(exec, { timeout })\n } else {\n // Safari fallback: rAF + setTimeout shim.\n void interactionResponse().then(exec)\n }\n })\n },\n [timeout],\n )\n\n return runDeprioritized\n}\n\nfunction interactionResponse(): Promise<unknown> {\n // Taken from https://github.com/vercel-labs/await-interaction-response/tree/main/packages/await-interaction-response/src\n\n return new Promise((resolve) => {\n setTimeout(resolve, 100) // Fallback for the case where the animation frame never fires.\n requestAnimationFrame(() => {\n setTimeout(resolve, 0)\n })\n })\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAASC,WAAW,EAAEC,MAAM,QAAQ;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,SAAAC,oBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EAA6B,MAAAM,OAAA,GAAAF,EAAa,KAAAG,SAAA,SAAbH,EAAa;EAC/C,MAAAI,aAAA,GAAsBN,MAAA,CAAAK,SAAe;EAAA,IAAAE,EAAA;EAAA,IAAAJ,CAAA,QAAAC,OAAA;IAMnCG,EAAA,GAAAC,EAAA,QAAAC,OAAA,CAAAC,OAAA;MAEI,MAAAC,IAAA,GAAAA,CAAA;QACEH,EAAA;QACAE,OAAA;MAAA;MACF,IAEI,yBAAAE,MAAyB;QAAA,IAEvB,wBAAAA,MAAwB,IAAUN,aAAA,CAAAO,OAAA,KAAAR,SAA0B;UAM9DS,kBAAA,CAAmBR,aAAA,CAAAO,OAAqB;QAAA;QAI1CP,aAAA,CAAAO,OAAA,GAAwBE,mBAAA,CAAoBJ,IAAA;UAAAP;QAAA,CAAgB;MAAA;QAGvDY,mBAAA,GAAAC,IAAA,CAA2BN,IAAA;MAAA;IAAA;IAGtCR,CAAA,MAAAC,OAAA;IAAAD,CAAA,MAAAI,EAAA;EAAA;IAAAA,EAAA,GAAAJ,CAAA;EAAA;EA1BF,MAAAe,gBAAA,GAAyBX,EA2Bd;EAAA,OAGJW,gBAAA;AAAA;AAGT,SAASF,oBAAA;EACP;EAEA,OAAO,IAAIP,OAAA,CAASC,OAAA;IAClBS,UAAA,CAAWT,OAAA,EAAS,MAAK;IACzBU,qBAAA,CAAsB;MACpBD,UAAA,CAAWT,OAAA,EAAS;IACtB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"useRunDeprioritized.js","names":["c","_c","useCallback","useRef","useRunDeprioritized","t0","$","timeout","undefined","idleHandleRef","t1","fn","Promise","resolve","exec","window","current","cancelIdleCallback","requestIdleCallback","interactionResponse","then","runDeprioritized","setTimeout","requestAnimationFrame"],"sources":["../../src/utilities/useRunDeprioritized.ts"],"sourcesContent":["'use client'\nimport { useCallback, useRef } from 'react'\n\n/**\n * Simple hook that lets you run any callback once the main thread is idle\n * (via `requestIdleCallback`) or when that API is missing (Safari) - after the\n * next animation frame (`interactionResponse`).\n *\n * This will help you to avoid blocking the main thread with heavy work.\n *\n * The latest invocation wins: if a new run is queued before the previous one\n * executes, the previous task is cancelled.\n *\n * Usage:\n * ```ts\n * const runDeprioritized = useRunDeprioritized();\n *\n * const onEditorChange = (state: EditorState) => {\n * runDeprioritized(() => {\n * // heavy work here …\n * });\n * };\n * ```\n *\n * @param timeout Optional timeout (ms) for `requestIdleCallback`; defaults to 500 ms.\n * @returns A `runDeprioritized(fn)` helper.\n */\n\nexport function useRunDeprioritized(timeout = 500) {\n const idleHandleRef = useRef<number>(undefined)\n\n /**\n * Schedule `fn` and resolve when it has executed.\n */\n const runDeprioritized = useCallback(\n (fn: () => void): Promise<void> => {\n return new Promise<void>((resolve) => {\n const exec = () => {\n fn()\n resolve()\n }\n\n if ('requestIdleCallback' in window) {\n // Cancel any previously queued task so only the latest runs.\n if ('cancelIdleCallback' in window && idleHandleRef.current !== undefined) {\n // Cancel earlier scheduled value updates,\n // so that a CPU-limited event loop isn't flooded with n callbacks for n keystrokes into the rich text field,\n // but that there's only ever the latest one state update\n // dispatch task, to be executed with the next idle time,\n // or the deadline of 500ms.\n cancelIdleCallback(idleHandleRef.current)\n }\n // Schedule the state update to happen the next time the browser has sufficient resources,\n // or the latest after 500ms.\n idleHandleRef.current = requestIdleCallback(exec, { timeout })\n } else {\n // Safari fallback: rAF + setTimeout shim.\n void interactionResponse().then(exec)\n }\n })\n },\n [timeout],\n )\n\n return runDeprioritized\n}\n\nfunction interactionResponse(): Promise<unknown> {\n // Taken from https://github.com/vercel-labs/await-interaction-response/tree/main/packages/await-interaction-response/src\n\n return new Promise((resolve) => {\n setTimeout(resolve, 100) // Fallback for the case where the animation frame never fires.\n requestAnimationFrame(() => {\n setTimeout(resolve, 0)\n })\n })\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAASC,WAAW,EAAEC,MAAM,QAAQ;AAEpC;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,OAAO,SAAAC,oBAAAC,EAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EAA6B,MAAAM,OAAA,GAAAF,EAAa,KAAbG,SAAa,GAAb,GAAa,GAAbH,EAAa;EAC/C,MAAAI,aAAA,GAAsBN,MAAA,CAAeK,SAAA;EAAA,IAAAE,EAAA;EAAA,IAAAJ,CAAA,QAAAC,OAAA;IAMnCG,EAAA,GAAAC,EAAA,IACS,IAAIC,OAAA,CAAcC,OAAA;MACvB,MAAAC,IAAA,GAAaA,CAAA;QACXH,EAAA;QACAE,OAAA;MAAA,CACF;MAEA,IAAI,yBAAyBE,MAAA;QAE3B,IAAI,wBAAwBA,MAAoC,IAA1BN,aAAA,CAAAO,OAAqB,KAAKR,SAAA;UAM9DS,kBAAA,CAAmBR,aAAA,CAAAO,OAAqB;QAAA;QAI1CP,aAAA,CAAAO,OAAA,GAAwBE,mBAAA,CAAoBJ,IAAA,EAAM;UAAAP;QAAU,EAAvC;MAAA;QAGhBY,mBAAA,GAAAC,IAA0B,CAACN,IAAA;MAAA;IAClC,CACF,CACF;IAAAR,CAAA,MAAAC,OAAA;IAAAD,CAAA,MAAAI,EAAA;EAAA;IAAAA,EAAA,GAAAJ,CAAA;EAAA;EA1BF,MAAAe,gBAAA,GAAyBX,EA2Bd;EAAA,OAGJW,gBAAA;AAAA;AAGT,SAASF,oBAAA;EACP;EAEA,OAAO,IAAIP,OAAA,CAASC,OAAA;IAClBS,UAAA,CAAWT,OAAA,EAAS,MAAK;IACzBU,qBAAA,CAAsB;MACpBD,UAAA,CAAWT,OAAA,EAAS;IACtB;EACF;AACF","ignoreList":[]}
@@ -1,8 +1,8 @@
1
- import type { SerializedEditorState, SerializedLexicalNode } from 'lexical';
1
+ import type { SerializedEditorState } from 'lexical';
2
2
  /**
3
3
  * This function checks if the editor state is empty (has any text). If the editor state has no nodes,
4
4
  * or only an empty paragraph node (no TextNode with length > 0), it returns false.
5
5
  * Otherwise, it returns true.
6
6
  */
7
- export declare function hasText(value: null | SerializedEditorState<SerializedLexicalNode> | undefined): value is SerializedEditorState<SerializedLexicalNode>;
7
+ export declare function hasText(value: null | SerializedEditorState | undefined): value is SerializedEditorState;
8
8
  //# sourceMappingURL=hasText.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"hasText.d.ts","sourceRoot":"","sources":["../../src/validate/hasText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,qBAAqB,EAGtB,MAAM,SAAS,CAAA;AAEhB;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,IAAI,GAAG,qBAAqB,CAAC,qBAAqB,CAAC,GAAG,SAAS,GACrE,KAAK,IAAI,qBAAqB,CAAC,qBAAqB,CAAC,CA6BvD"}
1
+ {"version":3,"file":"hasText.d.ts","sourceRoot":"","sources":["../../src/validate/hasText.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAA+C,MAAM,SAAS,CAAA;AAEjG;;;;GAIG;AACH,wBAAgB,OAAO,CACrB,KAAK,EAAE,IAAI,GAAG,qBAAqB,GAAG,SAAS,GAC9C,KAAK,IAAI,qBAAqB,CA6BhC"}
@@ -1 +1 @@
1
- {"version":3,"file":"hasText.js","names":["hasText","value","hasChildren","root","children","length","hasOnlyEmptyParagraph","type","paragraphNode","paragraphNodeChild"],"sources":["../../src/validate/hasText.ts"],"sourcesContent":["import type {\n SerializedEditorState,\n SerializedLexicalNode,\n SerializedParagraphNode,\n SerializedTextNode,\n} from 'lexical'\n\n/**\n * This function checks if the editor state is empty (has any text). If the editor state has no nodes,\n * or only an empty paragraph node (no TextNode with length > 0), it returns false.\n * Otherwise, it returns true.\n */\nexport function hasText(\n value: null | SerializedEditorState<SerializedLexicalNode> | undefined,\n): value is SerializedEditorState<SerializedLexicalNode> {\n const hasChildren = !!value?.root?.children?.length\n if (!hasChildren) {\n return false\n }\n\n let hasOnlyEmptyParagraph = false\n if (value?.root?.children?.length === 1) {\n if (value?.root?.children[0]?.type === 'paragraph') {\n const paragraphNode = value?.root?.children[0] as SerializedParagraphNode\n\n if (!paragraphNode?.children || paragraphNode?.children?.length === 0) {\n hasOnlyEmptyParagraph = true\n } else if (paragraphNode?.children?.length === 1) {\n const paragraphNodeChild = paragraphNode?.children[0]\n if (paragraphNodeChild?.type === 'text') {\n if (!(paragraphNodeChild as SerializedTextNode | undefined)?.['text']?.length) {\n hasOnlyEmptyParagraph = true\n }\n }\n }\n }\n }\n\n if (hasOnlyEmptyParagraph) {\n return false\n }\n\n return true\n}\n"],"mappings":"AAOA;;;;GAKA,OAAO,SAASA,QACdC,KAAsE;EAEtE,MAAMC,WAAA,GAAc,CAAC,CAACD,KAAA,EAAOE,IAAA,EAAMC,QAAA,EAAUC,MAAA;EAC7C,IAAI,CAACH,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAII,qBAAA,GAAwB;EAC5B,IAAIL,KAAA,EAAOE,IAAA,EAAMC,QAAA,EAAUC,MAAA,KAAW,GAAG;IACvC,IAAIJ,KAAA,EAAOE,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAAEG,IAAA,KAAS,aAAa;MAClD,MAAMC,aAAA,GAAgBP,KAAA,EAAOE,IAAA,EAAMC,QAAQ,CAAC,EAAE;MAE9C,IAAI,CAACI,aAAA,EAAeJ,QAAA,IAAYI,aAAA,EAAeJ,QAAA,EAAUC,MAAA,KAAW,GAAG;QACrEC,qBAAA,GAAwB;MAC1B,OAAO,IAAIE,aAAA,EAAeJ,QAAA,EAAUC,MAAA,KAAW,GAAG;QAChD,MAAMI,kBAAA,GAAqBD,aAAA,EAAeJ,QAAQ,CAAC,EAAE;QACrD,IAAIK,kBAAA,EAAoBF,IAAA,KAAS,QAAQ;UACvC,IAAI,CAAEE,kBAAA,GAAwD,OAAO,EAAEJ,MAAA,EAAQ;YAC7EC,qBAAA,GAAwB;UAC1B;QACF;MACF;IACF;EACF;EAEA,IAAIA,qBAAA,EAAuB;IACzB,OAAO;EACT;EAEA,OAAO;AACT","ignoreList":[]}
1
+ {"version":3,"file":"hasText.js","names":["hasText","value","hasChildren","root","children","length","hasOnlyEmptyParagraph","type","paragraphNode","paragraphNodeChild"],"sources":["../../src/validate/hasText.ts"],"sourcesContent":["import type { SerializedEditorState, SerializedParagraphNode, SerializedTextNode } from 'lexical'\n\n/**\n * This function checks if the editor state is empty (has any text). If the editor state has no nodes,\n * or only an empty paragraph node (no TextNode with length > 0), it returns false.\n * Otherwise, it returns true.\n */\nexport function hasText(\n value: null | SerializedEditorState | undefined,\n): value is SerializedEditorState {\n const hasChildren = !!value?.root?.children?.length\n if (!hasChildren) {\n return false\n }\n\n let hasOnlyEmptyParagraph = false\n if (value?.root?.children?.length === 1) {\n if (value?.root?.children[0]?.type === 'paragraph') {\n const paragraphNode = value?.root?.children[0] as SerializedParagraphNode\n\n if (!paragraphNode?.children || paragraphNode?.children?.length === 0) {\n hasOnlyEmptyParagraph = true\n } else if (paragraphNode?.children?.length === 1) {\n const paragraphNodeChild = paragraphNode?.children[0]\n if (paragraphNodeChild?.type === 'text') {\n if (!(paragraphNodeChild as SerializedTextNode | undefined)?.['text']?.length) {\n hasOnlyEmptyParagraph = true\n }\n }\n }\n }\n }\n\n if (hasOnlyEmptyParagraph) {\n return false\n }\n\n return true\n}\n"],"mappings":"AAEA;;;;GAKA,OAAO,SAASA,QACdC,KAA+C;EAE/C,MAAMC,WAAA,GAAc,CAAC,CAACD,KAAA,EAAOE,IAAA,EAAMC,QAAA,EAAUC,MAAA;EAC7C,IAAI,CAACH,WAAA,EAAa;IAChB,OAAO;EACT;EAEA,IAAII,qBAAA,GAAwB;EAC5B,IAAIL,KAAA,EAAOE,IAAA,EAAMC,QAAA,EAAUC,MAAA,KAAW,GAAG;IACvC,IAAIJ,KAAA,EAAOE,IAAA,EAAMC,QAAQ,CAAC,EAAE,EAAEG,IAAA,KAAS,aAAa;MAClD,MAAMC,aAAA,GAAgBP,KAAA,EAAOE,IAAA,EAAMC,QAAQ,CAAC,EAAE;MAE9C,IAAI,CAACI,aAAA,EAAeJ,QAAA,IAAYI,aAAA,EAAeJ,QAAA,EAAUC,MAAA,KAAW,GAAG;QACrEC,qBAAA,GAAwB;MAC1B,OAAO,IAAIE,aAAA,EAAeJ,QAAA,EAAUC,MAAA,KAAW,GAAG;QAChD,MAAMI,kBAAA,GAAqBD,aAAA,EAAeJ,QAAQ,CAAC,EAAE;QACrD,IAAIK,kBAAA,EAAoBF,IAAA,KAAS,QAAQ;UACvC,IAAI,CAAEE,kBAAA,GAAwD,OAAO,EAAEJ,MAAA,EAAQ;YAC7EC,qBAAA,GAAwB;UAC1B;QACF;MACF;IACF;EACF;EAEA,IAAIA,qBAAA,EAAuB;IACzB,OAAO;EACT;EAEA,OAAO;AACT","ignoreList":[]}
@@ -3,5 +3,5 @@ import type { RichTextField, Validate } from 'payload';
3
3
  import type { SanitizedServerEditorConfig } from '../lexical/config/types.js';
4
4
  export declare const richTextValidateHOC: ({ editorConfig, }: {
5
5
  editorConfig: SanitizedServerEditorConfig;
6
- }) => Validate<SerializedEditorState<import("lexical").SerializedLexicalNode>, unknown, unknown, RichTextField>;
6
+ }) => Validate<SerializedEditorState, unknown, unknown, RichTextField>;
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAK7E,eAAO,MAAM,mBAAmB,sBAE7B;IACD,YAAY,EAAE,2BAA2B,CAAA;CAC1C,8GAiCA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/validate/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACpD,OAAO,KAAK,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAEtD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAK7E,eAAO,MAAM,mBAAmB,sBAE7B;IACD,YAAY,EAAE,2BAA2B,CAAA;CAC1C,qEAiCA,CAAA"}
package/package.json CHANGED
@@ -1,13 +1,8 @@
1
1
  {
2
2
  "name": "@payloadcms/richtext-lexical",
3
- "version": "4.0.0-internal.a1317b2",
3
+ "version": "4.0.0-internal.a2d053c",
4
4
  "description": "The officially supported Lexical richtext adapter for Payload",
5
5
  "homepage": "https://payloadcms.com",
6
- "repository": {
7
- "type": "git",
8
- "url": "https://github.com/payloadcms/payload.git",
9
- "directory": "packages/richtext-lexical"
10
- },
11
6
  "license": "MIT",
12
7
  "author": "Payload <dev@payloadcms.com> (https://payloadcms.com)",
13
8
  "maintainers": [
@@ -17,10 +12,20 @@
17
12
  "url": "https://payloadcms.com"
18
13
  }
19
14
  ],
15
+ "repository": {
16
+ "type": "git",
17
+ "url": "https://github.com/payloadcms/payload.git",
18
+ "directory": "packages/richtext-lexical"
19
+ },
20
+ "files": [
21
+ "dist"
22
+ ],
23
+ "type": "module",
20
24
  "sideEffects": [
21
25
  "*.css"
22
26
  ],
23
- "type": "module",
27
+ "main": "./dist/index.js",
28
+ "types": "./dist/index.d.ts",
24
29
  "exports": {
25
30
  ".": {
26
31
  "import": "./dist/index.js",
@@ -403,48 +408,38 @@
403
408
  "default": "./dist/exports/shared.js"
404
409
  }
405
410
  },
406
- "main": "./dist/index.js",
407
- "types": "./dist/index.d.ts",
408
- "files": [
409
- "dist"
410
- ],
411
- "lint-staged": {
412
- "**/package.json": "sort-package-json",
413
- "*.{md,mdx,yml,json}": "prettier --write",
414
- "*.{js,jsx,ts,tsx}": [
415
- "eslint --flag v10_config_lookup_from_file --cache --fix",
416
- "prettier --write"
417
- ]
411
+ "publishConfig": {
412
+ "registry": "https://registry.npmjs.org/"
418
413
  },
419
414
  "dependencies": {
420
- "@lexical/clipboard": "0.48.0",
421
- "@lexical/headless": "0.48.0",
422
- "@lexical/html": "0.48.0",
423
- "@lexical/link": "0.48.0",
424
- "@lexical/list": "0.48.0",
425
- "@lexical/mark": "0.48.0",
426
- "@lexical/markdown": "0.48.0",
427
- "@lexical/react": "0.48.0",
428
- "@lexical/rich-text": "0.48.0",
429
- "@lexical/selection": "0.48.0",
430
- "@lexical/table": "0.48.0",
431
- "@lexical/utils": "0.48.0",
415
+ "@lexical/clipboard": "0.52.0",
416
+ "@lexical/headless": "0.52.0",
417
+ "@lexical/html": "0.52.0",
418
+ "@lexical/link": "0.52.0",
419
+ "@lexical/list": "0.52.0",
420
+ "@lexical/mark": "0.52.0",
421
+ "@lexical/markdown": "0.52.0",
422
+ "@lexical/react": "0.52.0",
423
+ "@lexical/rich-text": "0.52.0",
424
+ "@lexical/selection": "0.52.0",
425
+ "@lexical/table": "0.52.0",
426
+ "@lexical/utils": "0.52.0",
427
+ "@payloadcms/translations": "4.0.0-internal.a2d053c",
428
+ "@payloadcms/ui": "4.0.0-internal.a2d053c",
432
429
  "acorn": "8.16.0",
433
430
  "bson-objectid": "2.0.4",
434
431
  "csstype": "3.2.3",
435
432
  "dequal": "2.0.3",
436
433
  "escape-html": "1.0.3",
437
434
  "jsox": "1.2.125",
438
- "lexical": "0.48.0",
435
+ "lexical": "0.52.0",
439
436
  "mdast-util-from-markdown": "2.0.3",
440
437
  "mdast-util-mdx-jsx": "3.2.0",
441
438
  "micromark-extension-mdx-jsx": "3.0.2",
442
439
  "qs-esm": "8.0.1",
443
440
  "react-error-boundary": "6.1.1",
444
441
  "ts-essentials": "10.0.3",
445
- "uuid": "14.0.0",
446
- "@payloadcms/translations": "4.0.0-internal.a1317b2",
447
- "@payloadcms/ui": "4.0.0-internal.a1317b2"
442
+ "uuid": "14.0.0"
448
443
  },
449
444
  "devDependencies": {
450
445
  "@babel/cli": "7.27.2",
@@ -452,32 +447,36 @@
452
447
  "@babel/preset-env": "7.27.2",
453
448
  "@babel/preset-react": "7.27.1",
454
449
  "@babel/preset-typescript": "7.27.1",
455
- "@lexical/eslint-plugin": "0.48.0",
450
+ "@lexical/eslint-plugin": "0.52.0",
456
451
  "@types/escape-html": "1.0.4",
457
452
  "@types/json-schema": "7.0.15",
458
453
  "@types/node": "24.12.3",
459
- "@types/react": "19.2.14",
460
- "@types/react-dom": "19.2.3",
461
- "babel-plugin-react-compiler": "19.1.0-rc.3",
454
+ "@types/react": "19.3.0",
455
+ "@types/react-dom": "19.3.0",
456
+ "babel-plugin-react-compiler": "1.0.0",
462
457
  "babel-plugin-transform-remove-imports": "^1.8.0",
463
458
  "esbuild": "0.27.1",
464
459
  "esbuild-sass-plugin": "3.3.1",
465
- "swc-plugin-transform-remove-imports": "8.3.0",
466
- "@payloadcms/eslint-config": "3.28.0",
467
- "payload": "4.0.0-internal.a1317b2"
460
+ "payload": "4.0.0-internal.a2d053c",
461
+ "swc-plugin-transform-remove-imports": "8.3.0"
468
462
  },
469
463
  "peerDependencies": {
470
- "@faceless-ui/modal": "3.0.1",
464
+ "@faceless-ui/modal": "3.0.2",
471
465
  "@faceless-ui/scroll-info": "2.0.0",
466
+ "payload": "4.0.0-internal.a2d053c",
472
467
  "react": "^19.0.1 || ^19.1.2 || ^19.2.1",
473
- "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1",
474
- "payload": "4.0.0-internal.a1317b2"
468
+ "react-dom": "^19.0.1 || ^19.1.2 || ^19.2.1"
475
469
  },
476
- "engines": {
477
- "node": ">=24.15.0"
470
+ "lint-staged": {
471
+ "*.{cjs,css,cts,graphql,html,json,jsonc,md,mdx,mjs,mts,scss,toml,yaml,yml}": "oxfmt --no-error-on-unmatched-pattern",
472
+ ".swcrc": "oxfmt --no-error-on-unmatched-pattern",
473
+ "*.{js,jsx,ts,tsx}": [
474
+ "oxlint -c ../../oxlint.config.ts --fix --no-error-on-unmatched-pattern",
475
+ "oxfmt --no-error-on-unmatched-pattern"
476
+ ]
478
477
  },
479
- "publishConfig": {
480
- "registry": "https://registry.npmjs.org/"
478
+ "engines": {
479
+ "node": ">=24.22.1"
481
480
  },
482
481
  "scripts": {
483
482
  "build": "pnpm build:reactcompiler",
@@ -493,9 +492,7 @@
493
492
  "build:types": "tsc --emitDeclarationOnly --outDir dist",
494
493
  "build:without_reactcompiler": "rm -rf dist && rm -rf tsconfig.tsbuildinfo && pnpm copyfiles && pnpm build:types && pnpm build:swc && pnpm build:esbuild && pnpm build:esbuild:postproces && rm -rf dist/exports/client && mv dist/exports/client_unoptimized dist/exports/client",
495
494
  "clean": "rimraf -g {dist,*.tsbuildinfo,esbuild}",
496
- "copyfiles": "copyfiles -u 1 \"src/**/*.{html,css,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
497
- "copyfiles:debug": "copyfiles -u 1 \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
498
- "lint": "eslint .",
499
- "lint:fix": "eslint . --fix"
495
+ "copyfiles": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/",
496
+ "copyfiles:debug": "copyfiles -u 1 -e \"**/*.spec.*\" \"src/**/*.{html,css,scss,ttf,woff,woff2,eot,svg,jpg,png,json}\" dist/"
500
497
  }
501
498
  }
@@ -1,16 +0,0 @@
1
- import { lexicalTargetVersion } from './index';
2
- import { fileURLToPath } from 'url';
3
- import path from 'path';
4
- import fs from 'fs/promises';
5
- import { describe, it, expect } from 'vitest';
6
- const filename = fileURLToPath(import.meta.url);
7
- const dirname = path.dirname(filename);
8
- describe('Lexical dependency checker', () => {
9
- it('ensure lexical version installed in package.json matches dependency checker version', async () => {
10
- const packageJsonString = await fs.readFile(path.resolve(dirname, '../package.json'), 'utf-8');
11
- const packageJson = JSON.parse(packageJsonString);
12
- const packageJsonLexicalVersion = packageJson.dependencies['lexical'];
13
- expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion);
14
- });
15
- });
16
- //# sourceMappingURL=dependencyChecker.spec.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dependencyChecker.spec.js","names":["lexicalTargetVersion","fileURLToPath","path","fs","describe","it","expect","filename","import","meta","url","dirname","packageJsonString","readFile","resolve","packageJson","JSON","parse","packageJsonLexicalVersion","dependencies","toBe"],"sources":["../src/dependencyChecker.spec.ts"],"sourcesContent":["import { lexicalTargetVersion } from './index'\nimport { fileURLToPath } from 'url'\nimport path from 'path'\nimport fs from 'fs/promises'\nimport { describe, it, expect } from 'vitest'\n\nconst filename = fileURLToPath(import.meta.url)\nconst dirname = path.dirname(filename)\n\ndescribe('Lexical dependency checker', () => {\n it('ensure lexical version installed in package.json matches dependency checker version', async () => {\n const packageJsonString = await fs.readFile(path.resolve(dirname, '../package.json'), 'utf-8')\n const packageJson = JSON.parse(packageJsonString)\n const packageJsonLexicalVersion = packageJson.dependencies['lexical']\n\n expect(packageJsonLexicalVersion).toBe(lexicalTargetVersion)\n })\n})\n"],"mappings":"AAAA,SAASA,oBAAoB,QAAQ;AACrC,SAASC,aAAa,QAAQ;AAC9B,OAAOC,IAAA,MAAU;AACjB,OAAOC,EAAA,MAAQ;AACf,SAASC,QAAQ,EAAEC,EAAE,EAAEC,MAAM,QAAQ;AAErC,MAAMC,QAAA,GAAWN,aAAA,CAAcO,MAAA,CAAAC,IAAA,CAAYC,GAAG;AAC9C,MAAMC,OAAA,GAAUT,IAAA,CAAKS,OAAO,CAACJ,QAAA;AAE7BH,QAAA,CAAS,8BAA8B;EACrCC,EAAA,CAAG,uFAAuF;IACxF,MAAMO,iBAAA,GAAoB,MAAMT,EAAA,CAAGU,QAAQ,CAACX,IAAA,CAAKY,OAAO,CAACH,OAAA,EAAS,oBAAoB;IACtF,MAAMI,WAAA,GAAcC,IAAA,CAAKC,KAAK,CAACL,iBAAA;IAC/B,MAAMM,yBAAA,GAA4BH,WAAA,CAAYI,YAAY,CAAC,UAAU;IAErEb,MAAA,CAAOY,yBAAA,EAA2BE,IAAI,CAACpB,oBAAA;EACzC;AACF","ignoreList":[]}
@@ -1,2 +0,0 @@
1
- "use client";import{b as Be,c as Oe,e as $,f as K,h as Ie,i as Fe,j as $e,k as Ke,l as Se,m as Pe,n as ze}from"./chunk-LN6VX25I.js";import{a as Ae,b as P}from"./chunk-RJ5MAOKZ.js";import{jsx as D,jsxs as le}from"react/jsx-runtime";import{BulkUploadProvider as rn,FieldDescription as nn,FieldError as sn,FieldLabel as ln,isFieldRTL as an,RenderCustomComponent as At,useConfig as cn,useEditDepth as un,useEffectEvent as dn,useField as fn,useLocale as mn}from"@payloadcms/ui";import{mergeFieldStyles as pn}from"@payloadcms/ui/shared";import{dequal as gn}from"dequal/lite";import Bt,{useCallback as Ot,useEffect as It,useMemo as hn,useState as Ft}from"react";import{ErrorBoundary as yn}from"react-error-boundary";import"./bundled.css";import{jsx as z}from"react/jsx-runtime";import{LexicalComposer as Ur}from"@lexical/react/LexicalComposer.js";import{useEditDepth as Jr}from"@payloadcms/ui";import*as _t from"react";import{useMemo as qr}from"react";import{c as Lr}from"react/compiler-runtime";import{jsx as E,jsxs as se}from"react/jsx-runtime";import{useLexicalComposerContext as Mr}from"@lexical/react/LexicalComposerContext.js";import{LexicalErrorBoundary as Ar}from"@lexical/react/LexicalErrorBoundary.js";import{HistoryPlugin as Br}from"@lexical/react/LexicalHistoryPlugin.js";import{OnChangePlugin as Or}from"@lexical/react/LexicalOnChangePlugin.js";import{RichTextPlugin as Ir}from"@lexical/react/LexicalRichTextPlugin.js";import{useLexicalEditable as Fr}from"@lexical/react/useLexicalEditable";import{BLUR_COMMAND as $r,COMMAND_PRIORITY_LOW as Rt,FOCUS_COMMAND as Kr}from"lexical";import*as Q from"react";import{useEffect as zr,useState as jr}from"react";import{jsx as je}from"react/jsx-runtime";import"react";var j=({anchorElem:e,clientProps:t,plugin:o})=>o.position==="floatingAnchorElem"&&e?o.Component&&je(o.Component,{anchorElem:e,clientProps:t}):o.Component&&je(o.Component,{clientProps:t});import{c as jt}from"react/compiler-runtime";import{copyToClipboard as He}from"@lexical/clipboard";import{useLexicalComposerContext as Ht}from"@lexical/react/LexicalComposerContext.js";import{objectKlassEquals as Vt}from"@lexical/utils";import Ve from"bson-objectid";import{$getSelection as Wt,$isNodeSelection as Yt,COMMAND_PRIORITY_LOW as Gt,COPY_COMMAND as Ut}from"lexical";import{useEffect as Jt}from"react";var Te=e=>{if("fields"in e&&typeof e.fields=="object"&&e.fields!==null&&"id"in e.fields?e.fields.id=new Ve.default().toHexString():"id"in e&&(e.id=new Ve.default().toHexString()),e.children)for(let t of e.children)Te(t)};function We(){let e=jt(3),[t]=Ht(),o,n;return e[0]!==t?(o=()=>t.registerCommand(Ut,r=>{let a=Wt();if(Yt(a)){let l=a.getNodes()[0]?.exportJSON(),u=JSON.parse(JSON.stringify(l));Te(u);let d={namespace:t._config.namespace,nodes:[u]},m=JSON.stringify(d);return He(t,null,{"application/x-lexical-editor":m,"text/plain":""}).catch(qt),!0}return He(t,Vt(r,ClipboardEvent)?r:null).then(()=>{if(!(r instanceof ClipboardEvent)||!r.clipboardData)throw new Error("No clipboard event");let s=r.clipboardData.getData("application/x-lexical-editor");if(!s)return!0;let l=JSON.parse(s);for(let d of l.nodes)Te(d);let u=JSON.stringify(l);r.clipboardData.setData("application/x-lexical-editor",u)}).catch(s=>{throw r instanceof ClipboardEvent&&r.clipboardData?.setData("application/x-lexical-editor",""),s}),!0},Gt),n=[t],e[0]=t,e[1]=o,e[2]=n):(o=e[1],n=e[2]),Jt(o,n),null}function qt(e){throw e}import{c as Qt}from"react/compiler-runtime";import{useLexicalComposerContext as Xt}from"@lexical/react/LexicalComposerContext";import{$findMatchingParent as fe,mergeRegister as Zt}from"@lexical/utils";import{$createNodeSelection as eo,$getEditor as oe,$getNearestNodeFromDOMNode as to,$getSelection as me,$isDecoratorNode as H,$isElementNode as Re,$isLineBreakNode as oo,$isNodeSelection as pe,$isRangeSelection as Ye,$isRootOrShadowRoot as ro,$isTextNode as no,$setSelection as Ge,CLICK_COMMAND as io,COMMAND_PRIORITY_LOW as Y,KEY_ARROW_DOWN_COMMAND as so,KEY_ARROW_UP_COMMAND as lo,KEY_BACKSPACE_COMMAND as ao,KEY_DELETE_COMMAND as co,SELECTION_CHANGE_COMMAND as uo}from"lexical";import{useEffect as fo}from"react";function Ue(){let e=Qt(3),[t]=Xt(),o=Co,n,r;return e[0]!==t?(n=()=>Zt(t.registerCommand(io,xo,Y),t.registerCommand(co,o,Y),t.registerCommand(ao,o,Y),t.registerCommand(uo,yo,Y),t.registerCommand(lo,go,Y),t.registerCommand(so,mo,Y)),r=[t],e[0]=t,e[1]=n,e[2]=r):(n=e[1],r=e[2]),fo(n,r),null}function mo(e){let t=me();if(pe(t)){e.preventDefault();let s=t.getNodes()[0]?.getNextSibling();if(H(s)){let d=oe().getElementByKey(s.getKey());return d&&re({element:d,node:s}),!0}if(!Re(s))return!0;let l=s.getFirstDescendant()??s;return l&&(fe(l,ge)?.selectEnd(),e.preventDefault()),!0}if(!Ye(t))return!1;let n=(t.isBackward()?t.anchor:t.focus).getNode(),r=fe(n,po),a=r?.getNextSibling();if(!r||a!==Je(r))return!1;if(H(a)){let s=oe().getElementByKey(a.getKey());if(s)return re({element:s,node:a}),e.preventDefault(),!0}return!1}function po(e){return Je(e)!==null}function go(e){let t=me();if(pe(t)){let s=t.getNodes()[0]?.getPreviousSibling();if(H(s)){let d=oe().getElementByKey(s.getKey());return d?(re({element:d,node:s}),e.preventDefault(),!0):!1}if(!Re(s))return!1;let l=s.getLastDescendant()??s;return l?(fe(l,ge)?.selectStart(),e.preventDefault(),!0):!1}if(!Ye(t))return!1;let n=(t.isBackward()?t.anchor:t.focus).getNode(),r=fe(n,ho),a=r?.getPreviousSibling();if(!r||a!==qe(r))return!1;if(H(a)){let s=oe().getElementByKey(a.getKey());if(s)return re({element:s,node:a}),e.preventDefault(),!0}return!1}function ho(e){return qe(e)!==null}function yo(){let e=No();return document.querySelector(".decorator-selected")?.classList.remove("decorator-selected"),e?(e.element?.classList.add("decorator-selected"),!0):!1}function xo(e){document.querySelector(".decorator-selected")?.classList.remove("decorator-selected");let t=bo(e);if(!t)return!0;let{target:o}=e;return!(o instanceof HTMLElement)||o.isContentEditable||o.closest('button, textarea, input, .react-select, .code-editor, .no-select-decorator, [role="button"]')?Ge(null):re(t),!0}function Co(e){let t=me();return pe(t)?(e.preventDefault(),t.getNodes().forEach(Eo),!0):!1}function Eo(e){e.remove()}function bo(e){if(!(e.target instanceof HTMLElement))return;let t=e.target.closest('[data-lexical-decorator="true"]');if(!(t instanceof HTMLElement))return;let o=to(t);return H(o)?{element:t,node:o}:void 0}function No(){let e=me();if(!pe(e))return;let t=e.getNodes();if(t.length!==1)return;let o=t[0];return H(o)?{decorator:o,element:oe().getElementByKey(o.getKey())}:void 0}function re({element:e,node:t}){document.querySelector(".decorator-selected")?.classList.remove("decorator-selected");let o=eo();o.add(t.getKey()),Ge(o),e.scrollIntoView({behavior:"smooth",block:"nearest"}),e.classList.add("decorator-selected")}function ge(e){if(H(e)&&!e.isInline())return!0;if(!Re(e)||ro(e))return!1;let t=e.getFirstChild(),o=t===null||oo(t)||no(t)||t.isInline();return!e.isInline()&&e.canBeEmpty()!==!1&&o}function Je(e){let t=e.getNextSibling();for(;t!==null;){if(ge(t))return t;t=t.getNextSibling()}return null}function qe(e){let t=e.getPreviousSibling();for(;t!==null;){if(ge(t))return t;t=t.getPreviousSibling()}return null}import{jsx as ke}from"react/jsx-runtime";import{useLexicalComposerContext as ko}from"@lexical/react/LexicalComposerContext.js";import{$createParagraphNode as _o,isHTMLElement as vo}from"lexical";import*as et from"react";import{useCallback as Do,useEffect as Ze,useRef as Lo,useState as Mo}from"react";import{createPortal as Ao}from"react-dom";var G=(e,t,o,n,r=50,a=25)=>{let s=0;if(e&&!e.contains(n)){let{bottom:l,left:u,right:d,top:m}=e.getBoundingClientRect(),c=m+window.scrollY,i=l+window.scrollY;if(o<c-a||o>i+a||t<u-r||t>d+r)return-1;(t<u||t>d)&&(s=t<u?t-u:t-d)}return s};import{$getNodeByKey as ye}from"lexical";function U(e){let t=e.getBoundingClientRect(),o=getComputedStyle(e).getPropertyValue("transform");if(!o||o==="none")return t;let n=o.split(",").pop();return t.y=t.y-Number(n?.replace(")","")),t}function he(e){let t=(u,d)=>u?parseFloat(window.getComputedStyle(u)[d]):0,{marginBottom:o,marginTop:n}=window.getComputedStyle(e),r=t(e.previousElementSibling,"marginBottom"),a=t(e.nextElementSibling,"marginTop"),s=Math.max(parseFloat(n),r);return{marginBottom:Math.max(parseFloat(o),a),marginTop:s}}import{$getRoot as wo}from"lexical";function V(e){return e.getEditorState().read(()=>wo().getChildrenKeys())}var So=1,Po=-1,Qe=0,B={props:null,result:null};function To(e,t,o=20){let n=e.x-t.x,r=e.y-t.y;return n*n+r*r<=o*o}function J(e){let{anchorElem:t,cache_threshold:o=20,editor:n,fuzzy:r=!1,horizontalOffset:a=0,point:{x:s,y:l},startIndex:u=0,useEdgeAsDefault:d=!1}=e;if(o>0&&B.props&&B.result&&B.props.fuzzy===e.fuzzy&&B.props.horizontalOffset===e.horizontalOffset&&B.props.useEdgeAsDefault===e.useEdgeAsDefault&&To(B.props.point,e.point,o))return B.result;let m=t.getBoundingClientRect(),c=V(n),i={blockElem:null,blockNode:null,distance:1/0,foundAtIndex:-1,isFoundNodeEmptyParagraph:!1};return n.getEditorState().read(()=>{if(d){let p=n.getElementByKey(c[0]),g=n.getElementByKey(c[c.length-1]);if(p&&g){let[f,C]=[U(p),U(g)];if(l<f.top?(i.blockElem=p,i.distance=f.top-l,i.blockNode=ye(c[0]),i.foundAtIndex=0):l>C.bottom&&(i.distance=l-C.bottom,i.blockNode=ye(c[c.length-1]),i.blockElem=g,i.foundAtIndex=c.length-1),i?.blockElem)return{blockElem:null,isFoundNodeEmptyParagraph:!1}}}let x=u,y=Qe;for(;x>=0&&x<c.length;){let p=c[x],g=n.getElementByKey(p);if(g===null)break;let f=new K(s+a,l),C=Ke.fromDOMRect(U(g)),{marginBottom:h,marginTop:b}=he(g),_=C.generateNewRect({bottom:C.bottom+h,left:m.left,right:m.right,top:C.top-b}),{distance:w,isOnBottomSide:k,isOnTopSide:L}=_.distanceFromPoint(f);if(w===0){i.blockElem=g,i.blockNode=ye(p),i.foundAtIndex=x,i.distance=w,i.blockNode&&i.blockNode.getType()==="paragraph"&&i.blockNode.getTextContent()===""&&(!r&&!e.returnEmptyParagraphs&&(i.blockElem=null,i.blockNode=null),i.isFoundNodeEmptyParagraph=!0);break}else r&&w<i.distance&&(i.blockElem=g,i.blockNode=ye(p),i.distance=w,i.foundAtIndex=x);y===Qe&&(L?y=Po:k?y=So:y=1/0),x+=y}}),B.props=e,B.result={blockElem:i.blockElem,blockNode:i.blockNode,foundAtIndex:i.foundAtIndex,isFoundNodeEmptyParagraph:i.isFoundNodeEmptyParagraph},{blockElem:i.blockElem,blockNode:i.blockNode,foundAtIndex:i.foundAtIndex,isFoundNodeEmptyParagraph:i.isFoundNodeEmptyParagraph}}function xe(e,t){return!!e.closest(`.${t}`)}var Ro=["IMG","INPUT","TEXTAREA","SELECT","BUTTON","VIDEO","OBJECT","EMBED","IFRAME","HR"];function Xe(e){if(!e||Ro.includes(e.tagName)||e.offsetHeight===0||e.offsetWidth===0)return!1;let t=window.getComputedStyle(e);return!(t.display==="table-cell"||t.position==="absolute"||t.visibility==="hidden"||t.opacity==="0")}function Ce(e,t,o,n=0){if(!e){t.style.opacity="0",t.style.transform="translate(-10000px, -10000px)";return}let r=e.getBoundingClientRect(),a=window.getComputedStyle(e),s=t.getBoundingClientRect(),l=o.getBoundingClientRect(),u;if(["LexicalEditorTheme__block","LexicalEditorTheme__upload","LexicalEditorTheme__relationship"].some(c=>e.classList.contains(c)||e.firstElementChild?.classList.contains(c)))u=r.top+8-l.top;else{let c=Xe(e)?parseInt(a.lineHeight,10):0;u=r.top+(c-s.height)/2-l.top}let m=n;t.style.opacity="1",t.style.transform=`translate(${m}px, ${u}px)`}var Bo="add-block-menu",Ee=1/0;function Oo(e){return e===0?1/0:Ee>=0&&Ee<e?Ee:Math.floor(e/2)}function Io(e,t,o){let n=t.parentElement,{editorConfig:r}=P(),a=r?.admin?.hideGutter?-24:12,s=Lo(null),[l,u]=Mo(null);Ze(()=>{function m(c){let i=c.target;if(!vo(i))return;let x=G(n,c.pageX,c.pageY,i);if(x===-1){u(null);return}if(xe(i,Bo))return;let y=V(e),{blockElem:p,blockNode:g,foundAtIndex:f}=J({anchorElem:t,cache_threshold:0,editor:e,horizontalOffset:-x,point:new K(c.x,c.y),returnEmptyParagraphs:!0,startIndex:Oo(y.length),useEdgeAsDefault:!1});Ee=f,p&&g&&(l?.node!==g||l?.elem!==p)&&u({elem:p,node:g})}return document?.addEventListener("mousemove",m),()=>{document?.removeEventListener("mousemove",m)}},[n,t,e,l]),Ze(()=>{s.current&&l?.node&&Ce(l?.elem,s.current,t,a)},[t,l,a]);let d=Do(m=>{let c=l;c?.node&&(e.update(()=>{let i=!0;if((c?.node.getType()!=="paragraph"||c.node.getTextContent()!=="")&&(i=!1),!i){let x=_o();c?.node.insertAfter(x),setTimeout(()=>{c={elem:e.getElementByKey(x.getKey()),node:x},u(c)},0)}}),setTimeout(()=>{e.update(()=>{e.focus(),c?.node&&"select"in c.node&&typeof c.node.select=="function"&&c.node.select()})},1),setTimeout(()=>{e.dispatchCommand(Fe,{node:c?.node})},2),m.stopPropagation(),m.preventDefault())},[e,l]);return Ao(ke(et.Fragment,{children:ke("button",{"aria-label":"Add block",className:"icon add-block-menu",onClick:m=>{d(m)},ref:s,type:"button",children:ke("div",{className:o?"icon":""})})}),t)}function tt(e){let{anchorElem:t}=e,o=t===void 0?document.body:t,[n]=ko();return Io(n,o,n._editable)}import{jsx as be,jsxs as $o}from"react/jsx-runtime";import{useLexicalComposerContext as Ko}from"@lexical/react/LexicalComposerContext.js";import{eventFiles as nt}from"@lexical/rich-text";import{$getNearestNodeFromDOMNode as it,$getNodeByKey as zo,isHTMLElement as _e}from"lexical";import*as ut from"react";import{useEffect as ve,useRef as ne,useState as st}from"react";import{createPortal as jo}from"react-dom";var ot=0,Fo=-24;var W=0;function rt(e,t,o,n,r,a,s,l,u,d=!1){let{height:m,top:c}=n.getBoundingClientRect(),{top:i,width:x}=s.getBoundingClientRect(),{marginBottom:y,marginTop:p}=he(n),g=c,f=a>=c+m/2+window.scrollY,C=!1;if(r?.elem)if(n!==r?.elem)(f&&r?.elem&&r?.elem===n.nextElementSibling||!f&&r?.elem&&r?.elem===n.previousElementSibling)&&(W++,W<200&&(C=!0));else{W++;let w=r?.boundingBox?.y,k=n.getBoundingClientRect().y;(f===r?.isBelow&&w===k||W<200)&&(C=!1)}if(C)return{isBelow:f,willStayInSamePosition:C};d?g+=m/2:f?g+=m+y/2:g-=p/2;let h=0;d||(f?h=-ot:h=ot);let b=g-i+h,_=Fo-t;return o.style.width=`calc(${x}px - ${e} - var(--spacer-5))`,o.style.opacity=".8",o.style.transform=`translate(${_}px, calc(${b}px - 2px))`,r?.elem&&(r.elem.style.opacity="",r?.elem===n?f?r.elem.style.marginTop="":r.elem.style.marginBottom="":(r.elem.style.marginBottom="",r.elem.style.marginTop="")),W=0,{isBelow:f,willStayInSamePosition:C}}var Ho="draggable-block-menu",lt="application/x-lexical-drag-block",ie=1/0;function at(e){return e===0?1/0:ie>=0&&ie<e?ie:Math.floor(e/2)}function Vo(e,t){let{transform:o}=t.style;e.setDragImage(t,0,0),setTimeout(()=>{t.style.transform=o})}function ct(e,t){e&&(e.style.opacity="0"),t&&(t.style.opacity="",t.style.marginBottom="",t.style.marginTop="")}function Wo(e,t,o){let n=t.parentElement,r=ne(null),a=ne(null),s=ne(null),l=ne(!1),u=ne([]),[d,m]=st(null),[c,i]=st(null),{editorConfig:x}=P(),y=x?.admin?.hideGutter?-44:-8;ve(()=>{function f(C){let h=C.target;if(!_e(h))return;let b=G(n,C.pageX,C.pageY,h);if(b===-1){m(null);return}if(xe(h,Ho))return;let _=V(e),{blockElem:w,foundAtIndex:k,isFoundNodeEmptyParagraph:L}=J({anchorElem:t,cache_threshold:0,editor:e,horizontalOffset:-b,point:new K(C.x,C.y),startIndex:at(_.length),useEdgeAsDefault:!1,verbose:!1});ie=k,!(!w&&!L)&&d!==w&&m(w)}return document?.addEventListener("mousemove",f),()=>{document?.removeEventListener("mousemove",f)}},[n,t,e,d]),ve(()=>{r.current&&Ce(d,r.current,t,y)},[t,d,y]),ve(()=>{function f(h){if(!l.current)return!1;let[b]=nt(h);if(b)return!1;let{pageY:_,target:w}=h;if(!_e(w))return!1;let k=G(n,h.pageX,h.pageY,w,100,50),L=V(e),{blockElem:S,foundAtIndex:I,isFoundNodeEmptyParagraph:R}=J({anchorElem:t,editor:e,fuzzy:!0,horizontalOffset:-k,point:new K(h.x,h.y),startIndex:at(L.length),useEdgeAsDefault:!0,verbose:!0});ie=I;let F=a.current;if(S===null||F===null)return!1;if(h.preventDefault(),h.dataTransfer.dropEffect="move",d!==S){let{isBelow:v,willStayInSamePosition:M}=rt(x?.admin?.hideGutter?"0px":"var(--spacer-5)",y+(x?.admin?.hideGutter?r?.current?.getBoundingClientRect()?.width??0:-(r?.current?.getBoundingClientRect()?.width??0)),F,S,c,_,t,h,s,R);M||i({boundingBox:S.getBoundingClientRect(),elem:S,isBelow:v})}else c?.elem&&(ct(F,c.elem),i({boundingBox:S.getBoundingClientRect(),elem:S,isBelow:!1}));return!0}function C(h){if(!l.current)return!1;let[b]=nt(h);if(b)return!1;let{dataTransfer:_,pageY:w,target:k}=h,L=_?.getData(lt)||"";return e.update(()=>{let S=zo(L);if(!S||!_e(k))return!1;let I=G(n,h.pageX,h.pageY,k,100,50),{blockElem:R,isFoundNodeEmptyParagraph:F}=J({anchorElem:t,editor:e,fuzzy:!0,horizontalOffset:-I,point:new K(h.x,h.y),useEdgeAsDefault:!0});if(!R)return!1;let v=it(R);if(!v)return!1;if(v===S)return!0;let{height:M,top:ae}=U(R),Ne=w>=ae+M/2+window.scrollY;F?(v.insertBefore(S),v.remove()):Ne?v.insertAfter(S):v.insertBefore(S),d!==null&&m(null),document.querySelectorAll(".lexical-block-highlighter").forEach(T=>{T.remove()});let we=e.getElementByKey(S.getKey()),ce=setTimeout(()=>{let T=we?.getBoundingClientRect();if(!T)return;let N=document.createElement("div");N.className="lexical-block-highlighter",N.style.backgroundColor="var(--color-bg-inverse)",N.style.transition="opacity 0.5s ease-in-out",N.style.zIndex="1",N.style.pointerEvents="none",N.style.boxSizing="border-box",N.style.borderRadius="4px",N.style.position="absolute",document.body.appendChild(N),N.style.opacity="0.1",N.style.height=`${T.height+8}px`,N.style.width=`${T.width+8}px`,N.style.top=`${T.top+window.scrollY-4}px`,N.style.left=`${T.left-4}px`;let ue=setTimeout(()=>{N.style.opacity="0";let de=setTimeout(()=>{N.remove()},500);u.current.push(de)},1e3);u.current.push(ue)},120);u.current.push(ce)}),!0}return document.addEventListener("dragover",f),document.addEventListener("drop",C),()=>{document.removeEventListener("dragover",f),document.removeEventListener("drop",C),u.current.forEach(clearTimeout),u.current=[]}},[n,y,t,e,c,d,x?.admin?.hideGutter]);function p(f){let C=f.dataTransfer;if(!C||!d)return;Vo(C,d),C.effectAllowed="move";let h="";e.update(()=>{let b=it(d);b&&(h=b.getKey())}),l.current=!0,C.setData(lt,h)}function g(){l.current=!1,c?.elem&&ct(a.current,c?.elem)}return jo($o(ut.Fragment,{children:[be("button",{"aria-label":"Drag to move",className:"icon draggable-block-menu",draggable:!0,onDragEnd:g,onDragStart:p,ref:r,type:"button",children:be("div",{className:o?"icon":""})}),be("div",{className:"draggable-block-target-line",ref:a}),be("div",{className:"debug-highlight",ref:s})]}),t)}function dt(e){let{anchorElem:t}=e,o=t===void 0?document.body:t,[n]=Ko();return Wo(n,o,n._editable)}import{c as Yo}from"react/compiler-runtime";import{jsx as De}from"react/jsx-runtime";import{useLexicalComposerContext as Go}from"@lexical/react/LexicalComposerContext";import{useTranslation as Uo}from"@payloadcms/ui";import{$createParagraphNode as Jo,$getRoot as qo}from"lexical";import"react";var ft="insert-paragraph-at-end",mt=()=>{let e=Yo(5),[t]=Go(),{editorConfig:o}=P(),{t:n}=Uo();if(o?.admin?.hideInsertParagraphAtEnd)return null;let r;e[0]!==t?(r=()=>{t.update(Qo)},e[0]=t,e[1]=r):r=e[1];let a=r,s;return e[2]!==a||e[3]!==n?(s=De("button",{"aria-label":n("lexical:general:insertParagraph"),className:ft,onClick:a,type:"button",children:De("span",{className:`${ft}-inside`,children:De(Be,{size:16})})}),e[2]=a,e[3]=n,e[4]=s):s=e[4],s};function Qo(){let e=Jo();qo().append(e),e.select()}import{c as Xo}from"react/compiler-runtime";import{registerMarkdownShortcuts as Zo}from"@lexical/markdown";import{useLexicalComposerContext as er}from"@lexical/react/LexicalComposerContext";import*as pt from"react";var gt=()=>{let e=Xo(4),{editorConfig:t}=P(),[o]=er(),n,r;return e[0]!==o||e[1]!==t.features.markdownTransformers?(n=()=>Zo(o,t.features.markdownTransformers??[]),r=[o,t.features.markdownTransformers],e[0]=o,e[1]=t.features.markdownTransformers,e[2]=n,e[3]=r):(n=e[2],r=e[3]),pt.useEffect(n,r),null};import{c as tr}from"react/compiler-runtime";import{useLexicalComposerContext as or}from"@lexical/react/LexicalComposerContext.js";import{$getRoot as rr}from"lexical";import{useEffect as nr}from"react";function ir(e){e.update(()=>{let t=o=>{let n=o.getType();if((n==="block"||n==="inlineBlock")&&o.markDirty(),"getChildren"in o&&typeof o.getChildren=="function")for(let r of o.getChildren())t(r)};t(rr())})}function ht(){let e=tr(5),[t]=or(),{currentView:o,views:n}=$(),r,a;return e[0]!==o||e[1]!==t||e[2]!==n?(r=()=>{n&&(o==="default"?n.default?Se(t,n.default?.nodes):Pe(t):n[o]&&(Pe(t),Se(t,n[o]?.nodes)),ir(t))},a=[t,n,o],e[0]=o,e[1]=t,e[2]=n,e[3]=r,e[4]=a):(r=e[3],a=e[4]),nr(r,a),null}import{useLexicalComposerContext as sr}from"@lexical/react/LexicalComposerContext";import{$getSelection as lr,$isRangeSelection as ar,RootNode as cr}from"lexical";import{useEffect as ur}from"react";function yt(){let[e]=sr();return ur(()=>e.registerNodeTransform(cr,t=>{let o=lr();if(ar(o)){let n=o.anchor.getNode(),r=o.focus.getNode();(!n.isAttached()||!r.isAttached())&&(t.selectEnd(),console.warn("updateEditor: selection has been moved to the end of the editor because the previously selected nodes have been removed and selection wasn't moved to another node. Ensure selection changes after removing/replacing a selected node."))}return!1}),[e]),null}import{useLexicalComposerContext as dr}from"@lexical/react/LexicalComposerContext";import{$getSelection as fr,COMMAND_PRIORITY_LOW as mr,SELECT_ALL_COMMAND as pr}from"lexical";import{useEffect as gr}from"react";function xt(){let[e]=dr();return gr(()=>e.registerCommand(pr,()=>{if(fr())return!1;let o=document.activeElement;return o instanceof HTMLInputElement&&o.select(),!0},mr),[e]),null}import{jsx as q,jsxs as Et}from"react/jsx-runtime";import{useLexicalComposerContext as yr}from"@lexical/react/LexicalComposerContext.js";import{useTranslation as bt}from"@payloadcms/ui";import{useCallback as xr,useMemo as Cr,useState as Er}from"react";import"react";import*as Nt from"react-dom";import{c as hr}from"react/compiler-runtime";import"react";function Ct(e,t){let o=hr(4),{maxLength:n,minLength:r}=t,a=n===void 0?75:n,s=r===void 0?1:r,l;return o[0]!==a||o[1]!==s||o[2]!==e?(l=u=>{let{query:d}=u,m="[^"+e+Ie+"\\s]",i=new RegExp("(^|\\s|\\()(["+e+"]((?:"+m+"){0,"+a+"}))$").exec(d);if(i!==null){let x=i[1],y=i[3];if(y.length>=s)return{leadOffset:i.index+x.length,matchingString:y,replaceableString:i[2]}}return null},o[0]=a,o[1]=s,o[2]=e,o[3]=l):l=o[3],l}var O="slash-menu-popup";function br({isSelected:e,item:t,onClick:o,onMouseEnter:n,ref:r}){let{fieldProps:{featureClientSchemaMap:a,schemaPath:s}}=P(),{i18n:l}=bt(),u=`${O}__item ${O}__item-${t.key}`;e&&(u+=` ${O}__item--selected`);let d=t.key;return t.label&&(d=typeof t.label=="function"?t.label({featureClientSchemaMap:a,i18n:l,schemaPath:s}):t.label),d.length>25&&(d=d.substring(0,25)+"..."),Et("button",{"aria-selected":e,className:u,id:O+"__item-"+t.key,onClick:o,onMouseEnter:n,ref:r,role:"option",tabIndex:-1,type:"button",children:[t?.Icon&&q(t.Icon,{}),q("span",{className:`${O}__item-text`,children:d})]},t.key)}function wt({anchorElem:e=document.body}){let[t]=yr(),[o,n]=Er(null),{editorConfig:r}=P(),{i18n:a}=bt(),{fieldProps:{featureClientSchemaMap:s,schemaPath:l}}=P(),u=Ct("/",{minLength:0}),d=xr(()=>{let c=[];for(let i of r.features.slashMenu.dynamicGroups)if(o){let x=i({editor:t,queryString:o});c=c.concat(x)}return c},[t,o,r?.features]),m=Cr(()=>{let c=[];for(let i of r?.features.slashMenu.groups??[])c.push(i);if(o){let i=o.toLowerCase().replace(/[\s\-_]/g,"");c=c.map(y=>{let p=y.items.filter(g=>{let f=g.key;return g.label&&(f=typeof g.label=="function"?g.label({featureClientSchemaMap:s,i18n:a,schemaPath:l}):g.label),new RegExp(o,"gi").exec(f)||f.toLowerCase().replace(/[\s\-_]/g,"").includes(i)?!0:g.keywords!=null?g.keywords.some(h=>new RegExp(o,"gi").exec(h)?!0:h.toLowerCase().replace(/[\s\-_]/g,"").includes(i)):!1});return p.length?{...y,items:p}:null}),c=c.filter(y=>y!=null);let x=d();for(let y of x){let p=c.find(g=>g.key===y.key);p?c=c.filter(g=>g.key!==y.key):p={...y,items:[]},p?.items?.length&&(p.items=p.items.concat(p.items)),c.push(p)}}return c},[o,r?.features.slashMenu.groups,d,s,a,l]);return q($e,{anchorElem:e,groups:m,menuRenderFn:(c,{selectedItemKey:i,selectItemAndCleanUp:x,setSelectedItemKey:y})=>c.current&&m.length?Nt.createPortal(q("div",{className:O,"data-theme":"dark",children:m.map(p=>{let g=p.key;return p.label&&s&&(g=typeof p.label=="function"?p.label({featureClientSchemaMap:s,i18n:a,schemaPath:l}):p.label),Et("div",{className:`${O}__group ${O}__group-${p.key}`,children:[q("div",{className:`${O}__group-title`,children:g}),p.items.map((f,C)=>q(br,{index:C,isSelected:i===f.key,item:f,onClick:()=>{y(f.key),x(f)},onMouseEnter:()=>{y(f.key)},ref:h=>{f.ref={current:h}}},f.key))]},p.key)})}),c.current):null,onQueryChange:n,triggerFn:u})}import{c as Nr}from"react/compiler-runtime";import{useLexicalComposerContext as wr}from"@lexical/react/LexicalComposerContext";import{TEXT_TYPE_TO_FORMAT as Sr,TextNode as Pr}from"lexical";import{useEffect as Tr}from"react";function St(e){let t=Nr(6),{features:o}=e,[n]=wr(),r;t[0]!==n||t[1]!==o.enabledFormats?(r=()=>{let s=Rr(o.enabledFormats);if(s.length!==0)return n.registerNodeTransform(Pr,l=>{s.forEach(u=>{l.hasFormat(u)&&l.toggleFormat(u)})})},t[0]=n,t[1]=o.enabledFormats,t[2]=r):r=t[2];let a;return t[3]!==n||t[4]!==o?(a=[n,o],t[3]=n,t[4]=o,t[5]=a):a=t[5],Tr(r,a),null}function Rr(e){let t=Object.keys(Sr),o=new Set(e);return t.filter(n=>!o.has(n))}import{c as kr}from"react/compiler-runtime";import{jsx as Pt}from"react/jsx-runtime";import{useLexicalComposerContext as _r}from"@lexical/react/LexicalComposerContext";import{ContentEditable as vr}from"@lexical/react/LexicalContentEditable.js";import{useTranslation as Dr}from"@payloadcms/ui";import"react";function Tt(e){let t=kr(5),{className:o,editorConfig:n}=e,{t:r}=Dr(),[,a]=_r(),{getTheme:s}=a,l;if(t[0]!==o||t[1]!==n?.admin?.placeholder||t[2]!==s||t[3]!==r){let u=s();l=Pt(vr,{"aria-placeholder":r("lexical:general:placeholder"),className:o??"ContentEditable__root",placeholder:Pt("p",{className:u?.placeholder,children:n?.admin?.placeholder??r("lexical:general:placeholder")})}),t[0]=o,t[1]=n?.admin?.placeholder,t[2]=s,t[3]=r,t[4]=l}else l=t[4];return l}var kt=e=>{let t=Lr(13),{editorConfig:o,editorContainerRef:n,isSmallWidthViewport:r,onChange:a,rtl:s}=e,l=P(),[u]=Mr(),d=Fr(),[m,c]=jr(null),i;t[0]===Symbol.for("react.memo_cache_sentinel")?(i=f=>{f!==null&&c(f)},t[0]=i):i=t[0];let x=i,y,p;t[1]!==u||t[2]!==l?(y=()=>{if(!l?.uuid){console.error("Lexical Editor must be used within an EditorConfigProvider");return}l?.parentEditor?.uuid&&l.parentEditor?.registerChild(l.uuid,l);let f=()=>{l.focusEditor(l)},C=()=>{l.blurEditor(l)},h=u.registerCommand(Kr,()=>(f(),!0),Rt),b=u.registerCommand($r,()=>(C(),!0),Rt);return()=>{h(),b(),l.parentEditor?.unregisterChild?.(l.uuid)}},p=[u,l],t[1]=u,t[2]=l,t[3]=y,t[4]=p):(y=t[3],p=t[4]),zr(y,p);let g;return t[5]!==o||t[6]!==n||t[7]!==m||t[8]!==d||t[9]!==r||t[10]!==a||t[11]!==s?(g=se(Q.Fragment,{children:[o.features.plugins?.map(Hr),se("div",{className:"editor-container",dir:s?"rtl":void 0,ref:n,children:[o.features.plugins?.map(Vr),E(Ir,{contentEditable:E("div",{className:"editor-scroller",children:E("div",{className:"editor",ref:x,children:E(Tt,{editorConfig:o})})}),ErrorBoundary:Ar}),E(yt,{}),d&&E(mt,{}),E(Ue,{}),E(We,{}),E(St,{features:o.features}),E(xt,{}),E(ht,{}),d&&E(Or,{ignoreSelectionChange:!0,onChange:(f,C,h)=>{(!h.has("focus")||h.size>1)&&a?.(f,C,h)}}),m&&se(Q.Fragment,{children:[!r&&d&&se(Q.Fragment,{children:[o.admin?.hideDraggableBlockElement?null:E(dt,{anchorElem:m}),o.admin?.hideAddBlockButton?null:E(tt,{anchorElem:m})]}),o.features.plugins?.map(f=>{if(f.position==="floatingAnchorElem"&&!(f.desktopOnly===!0&&r))return E(j,{anchorElem:m,clientProps:f.clientProps,plugin:f},f.key)}),d&&E(Q.Fragment,{children:E(wt,{anchorElem:m})})]}),d&&se(Q.Fragment,{children:[E(Br,{}),o?.features?.markdownTransformers?.length>0&&E(gt,{})]}),o.features.plugins?.map(Wr),o.features.plugins?.map(Yr)]}),o.features.plugins?.map(Gr)]}),t[5]=o,t[6]=n,t[7]=m,t[8]=d,t[9]=r,t[10]=a,t[11]=s,t[12]=g):g=t[12],g};function Hr(e){if(e.position==="aboveContainer")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}function Vr(e){if(e.position==="top")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}function Wr(e){if(e.position==="normal")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}function Yr(e){if(e.position==="bottom")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}function Gr(e){if(e.position==="belowContainer")return E(j,{clientProps:e.clientProps,plugin:e},e.key)}var vt=({children:e,providers:t})=>{if(!t?.length)return e;let o=t[0];return t.length>1?z(o,{children:z(vt,{providers:t.slice(1),children:e})}):z(o,{children:e})},Dt=e=>{let{composerKey:t,editorConfig:o,fieldProps:n,isSmallWidthViewport:r,onChange:a,readOnly:s,rtl:l,value:u}=e,{currentView:d,views:m}=$(),c=P(),i=Jr(),x=_t.useRef(null),y=qr(()=>{if(u&&typeof u!="object")throw new Error("The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: "+JSON.stringify(u));if(u&&Array.isArray(u)&&!("root"in u))throw new Error("You have tried to pass in data from the old Slate editor to the new Lexical editor. The data structure is different, thus you will have to migrate your data. We offer a one-line migration script which migrates all your rich text fields: https://payloadcms.com/docs/lexical/migration#migration-via-migration-script-recommended");if(u&&"jsonContent"in u)throw new Error("You have tried to pass in data from payload-plugin-lexical. The data structure is different, thus you will have to migrate your data. Migration guide: https://payloadcms.com/docs/lexical/migration#migrating-from-payload-plugin-lexical");let p=m?.[d]?.nodes;return{editable:s!==!0,editorState:u!=null?JSON.stringify(u):void 0,namespace:o.lexical.namespace,nodes:ze({editorConfig:o,nodeViews:p}),onError:g=>{throw g},theme:o.lexical.theme}},[o,m,d]);return y?z(Ur,{initialConfig:y,children:z(Ae,{editorConfig:o,editorContainerRef:x,fieldProps:n,parentContext:c?.editDepth===i?c:void 0,children:z(vt,{providers:o.features.providers,children:z(kt,{editorConfig:o,editorContainerRef:x,isSmallWidthViewport:r,onChange:a,rtl:l})})})},t+y.editable+d):z("p",{children:"Loading..."})};import{c as Qr}from"react/compiler-runtime";import{jsx as X,jsxs as Xr}from"react/jsx-runtime";import{ChevronIcon as Zr,Popup as en,PopupList as Lt}from"@payloadcms/ui";import"react";function Mt(){let e=Qr(5),{currentView:t,setCurrentView:o,views:n}=$();if(!n||Object.keys(n).length===0)return null;let r,a;if(e[0]!==t||e[1]!==o||e[2]!==n){a=Symbol.for("react.early_return_sentinel");e:{let s=Object.keys(n);if(!s.some(on)){a=null;break e}let u=["default",...s.filter(tn)],d=t.charAt(0).toUpperCase()+t.slice(1);r=X("div",{className:"lexical-view-selector",children:X(en,{button:Xr("button",{className:"lexical-view-selector__button",type:"button",children:[X("span",{className:"lexical-view-selector__label",children:d}),X(Zr,{className:"lexical-view-selector__icon"})]}),buttonType:"custom",horizontalAlign:"left",render:m=>{let{close:c}=m;return X(Lt.ButtonGroup,{children:u.map(i=>{let x=i.charAt(0).toUpperCase()+i.slice(1);return X(Lt.Button,{active:i===t,disabled:i===t,onClick:()=>{o?.(i),c()},children:x},i)})})},size:"large"})})}e[0]=t,e[1]=o,e[2]=n,e[3]=r,e[4]=a}else r=e[3],a=e[4];return a!==Symbol.for("react.early_return_sentinel")?a:r}function tn(e){return e!=="default"}function on(e){return e!=="default"}var Z="rich-text-lexical",xn=e=>{let{editorConfig:t,field:o,field:{admin:{className:n,description:r,readOnly:a}={},label:s,localized:l,required:u},path:d,readOnly:m,schemaPath:c,validate:i}=e,x=m||a,y=mn(),{config:{localization:p}}=cn(),g=an({fieldLocalized:l,locale:y,localizationConfig:p||void 0}),f=un(),{isControlledByParent:C}=$(),h=Ot((A,te)=>typeof i=="function"?i(A,{...te,required:u}):!0,[i,u]),{customComponents:{AfterInput:b,BeforeInput:_,Description:w,Error:k,Label:L}={},disabled:S,initialValue:I,path:R,setValue:F,showError:v,value:M}=fn({potentiallyStalePath:d,validate:h}),ae=x||S,[ee,Ne]=Ft(!1),[Le,we]=Ft(),ce=Bt.useRef(I),T=Bt.useRef(M);It(()=>{let A=()=>{let te=window.matchMedia("(max-width: 768px)").matches;te!==ee&&Ne(te)};return A(),window.addEventListener("resize",A),()=>{window.removeEventListener("resize",A)}},[ee]);let N=["field-type",Z,n,v&&"error",ae&&`${Z}--read-only`,t?.admin?.hideGutter!==!0&&!ee?`${Z}--show-gutter`:null].filter(Boolean).join(" "),ue=`${R}.${f}`,de=Oe(),$t=Ot(A=>{de(()=>{let Me=A.toJSON();T.current=Me,F(Me)})},[F,de]),Kt=hn(()=>pn(o),[o]),zt=dn(A=>{T.current!==M&&!gn(T.current!=null?JSON.parse(JSON.stringify(T.current)):T.current,M)&&(ce.current=A,T.current=M,we(new Date))});return It(()=>{Object.is(I,ce.current)||zt(I)},[I]),le("div",{className:N,"data-field-path":R,"data-field-schemapath":c,"data-lexical-view":t?.view,style:Kt,children:[le("div",{className:`${Z}__label-row`,children:[L||D(ln,{label:s,localized:l,path:R,required:u}),!C&&D(Mt,{})]}),le("div",{className:`${Z}__wrap`,children:[D(At,{CustomComponent:k,Fallback:D(sn,{path:R,showError:v})}),le(yn,{fallbackRender:Cn,onReset:()=>{},children:[_,D("div",{className:`${Z}__editor-content`,children:D(rn,{modalSlugPrefix:`lexical-${R}`,children:D(Dt,{composerKey:ue,editorConfig:t,fieldProps:e,isSmallWidthViewport:ee,onChange:$t,readOnly:ae,rtl:g,value:M},JSON.stringify({path:R,rerenderProviderKey:Le}))})}),b]}),D(At,{CustomComponent:w,Fallback:D(nn,{description:r,path:R})})]})]},ue)};function Cn({error:e}){return le("div",{className:"errorBoundary",role:"alert",children:[D("p",{children:"Something went wrong:"}),D("pre",{style:{color:"red"},children:e instanceof Error?e.message:String(e)})]})}var Ll=xn;export{Ll as RichText};
2
- //# sourceMappingURL=Field-F22V5L4V.js.map