@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 +1 @@
1
- {"version":3,"file":"DropDown.js","names":["Button","$addUpdateTag","isDOMNode","React","useCallback","useEffect","useMemo","useRef","useState","createPortal","baseClass","DropDownContext","createContext","DropDownItem","active","children","editor","enabled","Icon","item","itemKey","tooltip","className","key","filter","Boolean","join","ref","dropDownContext","use","Error","registerItem","current","_jsx","buttonStyle","disabled","extraButtonProps","icon","iconPosition","onClick","focus","update","onSelect","isActive","onMouseDown","e","preventDefault","type","DropDownItems","dropdownKey","dropDownRef","itemsContainerClassNames","onClose","items","setItems","highlightedItem","setHighlightedItem","itemRef","prev","handleKeyDown","event","includes","index","indexOf","length","contextValue","value","onKeyDown","DropDown","buttonAriaLabel","buttonClassName","label","stopCloseOnClickSelf","buttonRef","showDropDown","setShowDropDown","handleClose","button","dropDown","left","top","getBoundingClientRect","scrollTopOffset","window","scrollY","document","documentElement","scrollTop","style","offsetHeight","Math","min","innerWidth","offsetWidth","handle","target","contains","addEventListener","removeEventListener","portal","body","_jsxs","Fragment"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"sourcesContent":["'use client'\nimport { Button } from '@payloadcms/ui'\nimport { $addUpdateTag, isDOMNode, type LexicalEditor } from 'lexical'\nimport React, { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nconst baseClass = 'toolbar-popup__dropdown-item'\n\ninterface DropDownContextType {\n registerItem: (ref: React.RefObject<HTMLButtonElement | null>) => void\n}\n\nconst DropDownContext = React.createContext<DropDownContextType | null>(null)\n\nexport function DropDownItem({\n active,\n children,\n editor,\n enabled,\n Icon,\n item,\n itemKey,\n tooltip,\n}: {\n active?: boolean\n children: React.ReactNode\n editor: LexicalEditor\n enabled?: boolean\n Icon: React.ReactNode\n item: ToolbarGroupItem\n itemKey: string\n tooltip?: string\n}): React.ReactNode {\n const className = useMemo(() => {\n return [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n item?.key ? `${baseClass}-${item.key}` : '',\n ]\n .filter(Boolean)\n .join(' ')\n }, [enabled, active, item.key])\n\n const ref = useRef<HTMLButtonElement>(null)\n\n const dropDownContext = React.use(DropDownContext)\n\n if (dropDownContext === null) {\n throw new Error('DropDownItem must be used within a DropDown')\n }\n\n const { registerItem } = dropDownContext\n\n useEffect(() => {\n if (ref?.current != null) {\n registerItem(ref)\n }\n }, [ref, registerItem])\n\n return (\n <Button\n aria-label={tooltip}\n buttonStyle=\"ghost\"\n className={className}\n disabled={enabled === false}\n extraButtonProps={{\n 'data-item-key': itemKey,\n }}\n icon={Icon}\n iconPosition=\"left\"\n onClick={() => {\n if (enabled !== false) {\n editor.focus(() => {\n editor.update(() => {\n $addUpdateTag('toolbar')\n })\n // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.\n item.onSelect?.({\n editor,\n isActive: active!,\n })\n })\n }\n }}\n onMouseDown={(e) => {\n // This is required for Firefox compatibility. Without it, the dropdown will disappear without the onClick being called.\n // This only happens in Firefox. Must be something about how Firefox handles focus events differently.\n e.preventDefault()\n }}\n ref={ref}\n tooltip={tooltip}\n type=\"button\"\n >\n {children}\n </Button>\n )\n}\n\nfunction DropDownItems({\n children,\n dropdownKey,\n dropDownRef,\n itemsContainerClassNames,\n onClose,\n}: {\n children: React.ReactNode\n dropdownKey?: string\n dropDownRef: React.Ref<HTMLDivElement>\n itemsContainerClassNames?: string[]\n onClose: () => void\n}): React.ReactElement {\n const [items, setItems] = useState<Array<React.RefObject<HTMLButtonElement | null>>>()\n const [highlightedItem, setHighlightedItem] =\n useState<React.RefObject<HTMLButtonElement | null>>()\n\n const registerItem = useCallback(\n (itemRef: React.RefObject<HTMLButtonElement | null>) => {\n setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]))\n },\n [setItems],\n )\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (items == null) {\n return\n }\n\n const { key } = event\n\n if (['ArrowDown', 'ArrowUp', 'Escape', 'Tab'].includes(key)) {\n event.preventDefault()\n }\n\n if (key === 'Escape' || key === 'Tab') {\n onClose()\n } else if (key === 'ArrowUp') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n const index = items.indexOf(prev) - 1\n return items[index === -1 ? items.length - 1 : index]\n })\n } else if (key === 'ArrowDown') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return items[0]\n }\n return items[items.indexOf(prev) + 1]\n })\n }\n }\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n )\n\n useEffect(() => {\n if (items != null && highlightedItem == null) {\n setHighlightedItem(items[0])\n }\n\n if (highlightedItem != null && highlightedItem?.current != null) {\n highlightedItem.current.focus()\n }\n }, [items, highlightedItem])\n\n return (\n <DropDownContext value={contextValue}>\n <div\n className={(itemsContainerClassNames ?? ['toolbar-popup__dropdown-items']).join(' ')}\n data-dropdown-key={dropdownKey}\n data-theme=\"dark\"\n onKeyDown={handleKeyDown}\n ref={dropDownRef}\n >\n {children}\n </div>\n </DropDownContext>\n )\n}\n\nexport function DropDown({\n buttonAriaLabel,\n buttonClassName,\n children,\n disabled = false,\n dropdownKey,\n Icon,\n itemsContainerClassNames,\n label,\n stopCloseOnClickSelf,\n}: {\n buttonAriaLabel?: string\n buttonClassName: string\n children: ReactNode\n disabled?: boolean\n dropdownKey: string\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n stopCloseOnClickSelf?: boolean\n}): React.ReactNode {\n const dropDownRef = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const [showDropDown, setShowDropDown] = useState(false)\n\n const handleClose = (): void => {\n setShowDropDown(false)\n if (buttonRef?.current != null) {\n buttonRef.current.focus()\n }\n }\n\n useEffect(() => {\n const button = buttonRef.current\n const dropDown = dropDownRef.current\n\n if (showDropDown && button !== null && dropDown !== null) {\n const { left, top } = button.getBoundingClientRect()\n const scrollTopOffset = window.scrollY || document.documentElement.scrollTop\n dropDown.style.top = `${top + scrollTopOffset + button.offsetHeight + 5}px`\n dropDown.style.left = `${Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20)}px`\n }\n }, [dropDownRef, buttonRef, showDropDown])\n\n useEffect(() => {\n const button = buttonRef.current\n\n if (button !== null && showDropDown) {\n const handle = (event: MouseEvent): void => {\n const target = event.target\n if (!isDOMNode(target)) {\n return\n }\n if (stopCloseOnClickSelf) {\n if (dropDownRef.current && dropDownRef.current.contains(target)) {\n return\n }\n }\n if (!button.contains(target)) {\n setShowDropDown(false)\n }\n }\n document.addEventListener('click', handle)\n\n return () => {\n document.removeEventListener('click', handle)\n }\n }\n }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf])\n\n const portal = createPortal(\n <DropDownItems\n dropdownKey={dropdownKey}\n dropDownRef={dropDownRef}\n itemsContainerClassNames={itemsContainerClassNames}\n onClose={handleClose}\n >\n {children}\n </DropDownItems>,\n document.body,\n )\n\n return (\n <React.Fragment>\n <button\n aria-label={buttonAriaLabel}\n className={buttonClassName + (showDropDown ? ' active' : '')}\n data-dropdown-key={dropdownKey}\n disabled={disabled}\n onClick={(event) => {\n event.preventDefault()\n setShowDropDown(!showDropDown)\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n ref={buttonRef}\n type=\"button\"\n >\n {Icon && <Icon />}\n {label && <span className=\"toolbar-popup__dropdown-label\">{label}</span>}\n <i className=\"toolbar-popup__dropdown-caret\" />\n </button>\n\n {showDropDown && <React.Fragment>{portal}</React.Fragment>}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;;AACA,SAASA,MAAM,QAAQ;AACvB,SAASC,aAAa,EAAEC,SAAS,QAA4B;AAC7D,OAAOC,KAAA,IAAyBC,W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+ {"version":3,"file":"DropDown.js","names":["c","_c","Button","$addUpdateTag","isDOMNode","React","useCallback","useEffect","useId","useMemo","useRef","useState","baseClass","DropDownContext","createContext","DropDownItem","active","children","editor","enabled","Icon","item","itemKey","tooltip","className","key","filter","Boolean","join","ref","dropDownContext","use","Error","registerItem","current","_jsx","buttonStyle","disabled","extraButtonProps","isActive","undefined","role","tabIndex","icon","iconPosition","onClick","focus","update","onSelect","onMouseDown","e","preventDefault","type","DropDownItems","t0","$","id","dropdownKey","dropDownRef","itemsContainerClassNames","onClose","shouldAutoFocus","items","setItems","highlightedItem","setHighlightedItem","t1","Symbol","for","itemRef","prev","t2","event","enabledItems","_temp","includes","setTimeout","restoreFocus","prev_0","index","indexOf","length","prev_1","index_0","handleKeyDown","t3","contextValue","t4","t5","find","_temp2","t6","value","onKeyDown","popover","item_0","DropDown","buttonAriaLabel","buttonClassName","label","stopCloseOnClickSelf","buttonRef","openedViaKeyboardRef","generatedId","menuId","showDropDown","setShowDropDown","handleClose","button","dropDown","matches","showPopover","updatePosition","bottom","left","top","getBoundingClientRect","offset","gap","below","above","offsetHeight","maxTop","Math","max","window","innerHeight","preferredTop","style","position","min","innerWidth","offsetWidth","addEventListener","capture","passive","removeEventListener","handle","target","contains","document","_jsxs","Fragment"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"sourcesContent":["'use client'\nimport { Button } from '@payloadcms/ui'\nimport { $addUpdateTag, isDOMNode, type LexicalEditor } from 'lexical'\nimport React, {\n type ReactNode,\n useCallback,\n useEffect,\n useId,\n useMemo,\n useRef,\n useState,\n} from 'react'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nconst baseClass = 'toolbar-popup__dropdown-item'\n\ninterface DropDownContextType {\n registerItem: (ref: React.RefObject<HTMLButtonElement | null>) => void\n}\n\nconst DropDownContext = React.createContext<DropDownContextType | null>(null)\n\nexport function DropDownItem({\n active,\n children,\n editor,\n enabled,\n Icon,\n item,\n itemKey,\n tooltip,\n}: {\n active?: boolean\n children: React.ReactNode\n editor: LexicalEditor\n enabled?: boolean\n Icon: React.ReactNode\n item: ToolbarGroupItem\n itemKey: string\n tooltip?: string\n}): React.ReactNode {\n const className = useMemo(() => {\n return [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n item?.key ? `${baseClass}-${item.key}` : '',\n ]\n .filter(Boolean)\n .join(' ')\n }, [enabled, active, item.key])\n\n const ref = useRef<HTMLButtonElement>(null)\n\n const dropDownContext = React.use(DropDownContext)\n\n if (dropDownContext === null) {\n throw new Error('DropDownItem must be used within a DropDown')\n }\n\n const { registerItem } = dropDownContext\n\n useEffect(() => {\n if (ref?.current != null) {\n registerItem(ref)\n }\n }, [ref, registerItem])\n\n return (\n <Button\n aria-label={tooltip}\n buttonStyle=\"ghost\"\n className={className}\n disabled={enabled === false}\n extraButtonProps={{\n 'aria-checked': item.isActive ? Boolean(active) : undefined,\n 'data-item-key': itemKey,\n role: item.isActive ? 'menuitemcheckbox' : 'menuitem',\n tabIndex: -1,\n }}\n icon={Icon}\n iconPosition=\"left\"\n onClick={() => {\n if (enabled !== false) {\n editor.focus(() => {\n editor.update(() => {\n $addUpdateTag('toolbar')\n })\n // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.\n item.onSelect?.({\n editor,\n isActive: active!,\n })\n })\n }\n }}\n onMouseDown={(e: React.MouseEvent) => {\n // This is required for Firefox compatibility. Without it, the dropdown will disappear without the onClick being called.\n // This only happens in Firefox. Must be something about how Firefox handles focus events differently.\n e.preventDefault()\n }}\n ref={ref}\n tooltip={tooltip}\n type=\"button\"\n >\n {children}\n </Button>\n )\n}\n\nfunction DropDownItems({\n id,\n children,\n dropdownKey,\n dropDownRef,\n itemsContainerClassNames,\n onClose,\n shouldAutoFocus,\n}: {\n children: React.ReactNode\n dropdownKey?: string\n dropDownRef: React.Ref<HTMLDivElement>\n id: string\n itemsContainerClassNames?: string[]\n onClose: (options?: { restoreFocus?: boolean }) => void\n shouldAutoFocus: boolean\n}): React.ReactElement {\n const [items, setItems] = useState<Array<React.RefObject<HTMLButtonElement | null>>>()\n const [highlightedItem, setHighlightedItem] =\n useState<React.RefObject<HTMLButtonElement | null>>()\n\n const registerItem = useCallback(\n (itemRef: React.RefObject<HTMLButtonElement | null>) => {\n setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]))\n },\n [setItems],\n )\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (items == null) {\n return\n }\n\n const { key } = event\n const enabledItems = items.filter((item) => !item.current?.disabled)\n\n if (['ArrowDown', 'ArrowUp', 'Escape'].includes(key)) {\n event.preventDefault()\n }\n\n if (key === 'Escape') {\n onClose()\n } else if (key === 'Tab') {\n setTimeout(() => onClose({ restoreFocus: false }))\n } else if (key === 'ArrowUp') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return enabledItems[0]\n }\n const index = enabledItems.indexOf(prev) - 1\n return enabledItems[index === -1 ? enabledItems.length - 1 : index]\n })\n } else if (key === 'ArrowDown') {\n setHighlightedItem((prev) => {\n if (prev == null) {\n return enabledItems[0]\n }\n const index = enabledItems.indexOf(prev)\n return enabledItems[index === enabledItems.length - 1 ? 0 : index + 1]\n })\n }\n }\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n )\n\n useEffect(() => {\n if (shouldAutoFocus && items != null && highlightedItem == null) {\n setHighlightedItem(items.find((item) => !item.current?.disabled))\n }\n\n if (highlightedItem != null && highlightedItem?.current != null) {\n highlightedItem.current.focus()\n }\n }, [items, highlightedItem, shouldAutoFocus])\n\n return (\n <DropDownContext value={contextValue}>\n <div\n className={(itemsContainerClassNames ?? ['toolbar-popup__dropdown-items']).join(' ')}\n data-dropdown-key={dropdownKey}\n data-theme=\"dark\"\n id={id}\n onKeyDown={handleKeyDown}\n popover=\"manual\"\n ref={dropDownRef}\n role=\"menu\"\n tabIndex={-1}\n >\n {children}\n </div>\n </DropDownContext>\n )\n}\n\nexport function DropDown({\n buttonAriaLabel,\n buttonClassName,\n children,\n disabled = false,\n dropdownKey,\n Icon,\n itemsContainerClassNames,\n label,\n stopCloseOnClickSelf,\n}: {\n buttonAriaLabel?: string\n buttonClassName: string\n children: ReactNode\n disabled?: boolean\n dropdownKey: string\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n stopCloseOnClickSelf?: boolean\n}): React.ReactNode {\n const dropDownRef = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const openedViaKeyboardRef = useRef(false)\n const generatedId = useId()\n const menuId = `toolbar-dropdown-${dropdownKey}-${generatedId}`\n const [showDropDown, setShowDropDown] = useState(false)\n\n const handleClose = ({ restoreFocus = true }: { restoreFocus?: boolean } = {}): void => {\n setShowDropDown(false)\n if (restoreFocus && buttonRef?.current != null) {\n buttonRef.current.focus()\n }\n }\n\n useEffect(() => {\n const button = buttonRef.current\n const dropDown = dropDownRef.current\n\n if (showDropDown && button !== null && dropDown !== null) {\n if (!dropDown.matches(':popover-open')) {\n dropDown.showPopover()\n }\n\n const updatePosition = (): void => {\n const { bottom, left, top } = button.getBoundingClientRect()\n const offset = 8\n const gap = 5\n const below = bottom + gap\n const above = top - dropDown.offsetHeight - gap\n const maxTop = Math.max(offset, window.innerHeight - dropDown.offsetHeight - offset)\n const preferredTop =\n below + dropDown.offsetHeight + offset <= window.innerHeight\n ? below\n : above >= offset\n ? above\n : below\n\n dropDown.style.position = 'fixed'\n dropDown.style.top = `${Math.max(offset, Math.min(preferredTop, maxTop))}px`\n dropDown.style.left = `${Math.max(8, Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20))}px`\n }\n\n updatePosition()\n window.addEventListener('resize', updatePosition)\n window.addEventListener('scroll', updatePosition, { capture: true, passive: true })\n\n return () => {\n window.removeEventListener('resize', updatePosition)\n window.removeEventListener('scroll', updatePosition, { capture: true })\n }\n }\n }, [dropDownRef, buttonRef, showDropDown])\n\n useEffect(() => {\n const button = buttonRef.current\n\n if (button !== null && showDropDown) {\n const handle = (event: MouseEvent): void => {\n const target = event.target\n if (!isDOMNode(target)) {\n return\n }\n if (stopCloseOnClickSelf) {\n if (dropDownRef.current && dropDownRef.current.contains(target)) {\n return\n }\n }\n if (!button.contains(target)) {\n setShowDropDown(false)\n }\n }\n document.addEventListener('click', handle)\n\n return () => {\n document.removeEventListener('click', handle)\n }\n }\n }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf])\n\n return (\n <React.Fragment>\n <button\n aria-controls={menuId}\n aria-expanded={showDropDown}\n aria-haspopup=\"menu\"\n aria-label={buttonAriaLabel}\n className={buttonClassName + (showDropDown ? ' active' : '')}\n data-dropdown-key={dropdownKey}\n disabled={disabled}\n onClick={(event) => {\n event.preventDefault()\n openedViaKeyboardRef.current = false\n setShowDropDown(!showDropDown)\n }}\n onKeyDown={(event) => {\n if (event.key === 'Enter' || event.key === ' ') {\n event.preventDefault()\n openedViaKeyboardRef.current = true\n setShowDropDown(!showDropDown)\n }\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n ref={buttonRef}\n type=\"button\"\n >\n {Icon && <Icon />}\n {label && <span className=\"toolbar-popup__dropdown-label\">{label}</span>}\n <i className=\"toolbar-popup__dropdown-caret\" />\n </button>\n\n {showDropDown && (\n <DropDownItems\n dropdownKey={dropdownKey}\n dropDownRef={dropDownRef}\n id={menuId}\n itemsContainerClassNames={itemsContainerClassNames}\n onClose={handleClose}\n shouldAutoFocus={openedViaKeyboardRef.current}\n >\n {children}\n </DropDownItems>\n )}\n </React.Fragment>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,SAASC,MAAM,Q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QAAA;MACVQ,OAAA,EAAU2B,OAAA;QACRA,OAAA,CAAMrB,cAAc;QACpBmD,oBAAA,CAAqBpE,OAAO,GAAG;QAC/BwE,eAAA,CAAgB,CAACD,YAAA;MACnB;MACAZ,SAAA,EAAYrB,OAAA;QACV,IAAIA,OAAA,CAAM/C,GAAG,KAAK,WAAW+C,OAAA,CAAM/C,GAAG,KAAK,KAAK;UAC9C+C,OAAA,CAAMrB,cAAc;UACpBmD,oBAAA,CAAqBpE,OAAO,GAAG;UAC/BwE,eAAA,CAAgB,CAACD,YAAA;QACnB;MACF;MACAxD,WAAA,EAAcC,CAAA;QACZ;QACA;QACA;QACAA,CAAA,CAAEC,cAAc;MAClB;MACAtB,GAAA,EAAKwE,SAAA;MACLjD,IAAA,EAAK;iBAEJhC,IAAA,iBAAQe,IAAA,CAACf,IAAA,OACT+E,KAAA,iBAAShE,IAAA,CAAC;QAAKX,SAAA,EAAU;kBAAiC2E;uBAC3DhE,IAAA,CAAC;QAAEX,SAAA,EAAU;;QAGdiF,YAAA,iBACCtE,IAAA,CAACkB,aAAA;MACCI,WAAA,EAAaA,WAAA;MACbC,WAAA,EAAaA,WAAA;MACbF,EAAA,EAAIgD,MAAA;MACJ7C,wBAAA,EAA0BA,wBAAA;MAC1BC,OAAA,EAAS+C,WAAA;MACT9C,eAAA,EAAiByC,oBAAA,CAAqBpE,OAAO;gBAE5CjB;;;AAKX","ignoreList":[]}
@@ -70,11 +70,15 @@
70
70
  .toolbar-popup__dropdown-items {
71
71
  --dropdown-min-width: 5rem;
72
72
  position: absolute;
73
+ inset: auto;
74
+ margin: 0;
73
75
  background: var(--color-bg-elevated);
74
76
  color: var(--color-text);
75
77
  border-radius: var(--radius-large);
76
78
  padding: var(--spacer-2);
77
79
  min-width: var(--dropdown-min-width);
80
+ max-height: calc(100vh - var(--spacer-3));
81
+ overflow-y: auto;
78
82
  z-index: 100;
79
83
  box-shadow: var(--elevation-300-tooltip);
80
84
 
@@ -83,7 +87,6 @@
83
87
  cursor: pointer;
84
88
  color: var(--color-text);
85
89
  position: relative;
86
- font-family: var(--text-body-medium-font-family);
87
90
  font-size: var(--text-body-medium-font-size);
88
91
  font-weight: var(--text-body-medium-font-weight);
89
92
  line-height: var(--text-body-medium-line-height);
@@ -185,20 +188,21 @@
185
188
  }
186
189
 
187
190
  [data-dropdown-key='text'] {
188
- & .toolbar-popup__dropdown-item {
189
- padding: 0 var(--spacer-4);
191
+ /* Reserved on every item, not just the active one, so the checkmark never overlaps the item icon. */
192
+ & .toolbar-popup__dropdown-item::before {
193
+ content: '';
194
+ flex-shrink: 0;
195
+ width: var(--spacer-3);
196
+ height: var(--spacer-3);
197
+ background-color: currentColor;
198
+ mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3E%3Cpath d='M12.277 3.584a.5.5 0 0 1 .139.693l-5 7.5a.5.5 0 0 1-.77.077l-3-3a.5.5 0 0 1 .708-.708l2.568 2.57 4.662-6.993a.5.5 0 0 1 .693-.139' fill='black'/%3E%3C/svg%3E");
199
+ mask-size: contain;
200
+ mask-repeat: no-repeat;
201
+ visibility: hidden;
190
202
  }
191
203
 
192
204
  & .toolbar-popup__dropdown-item.active::before {
193
- content: '';
194
- position: absolute;
195
- inset-inline-start: var(--spacer-2-5);
196
- top: 50%;
197
- width: var(--spacer-1);
198
- height: var(--spacer-2);
199
- border: solid var(--color-text-onselected-strong);
200
- border-width: 0 1px 1px 0;
201
- transform: translateY(-60%) rotate(45deg);
205
+ visibility: visible;
202
206
  }
203
207
 
204
208
  .btn__icon {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAItC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,aAAa,CAAA;AAsEpB,eAAO,MAAM,eAAe,kGASzB;IACD,UAAU,EAAE,WAAW,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,oBAAoB,CAAA;IAC3B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACf,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,sBAmCA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAkB,MAAM,OAAO,CAAA;AAItC,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAAK,EAAE,oBAAoB,EAAoB,MAAM,gBAAgB,CAAA;AAC5E,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAA;AAG/D,OAAO,aAAa,CAAA;AAsEpB,eAAO,MAAM,eAAe,kGASzB;IACD,UAAU,EAAE,WAAW,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,MAAM,EAAE,aAAa,CAAA;IACrB,KAAK,EAAE,oBAAoB,CAAA;IAC3B,UAAU,EAAE,iBAAiB,CAAA;IAC7B,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACf,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,sBA+CA,CAAA"}
@@ -107,18 +107,34 @@ export const ToolbarDropdown = ({
107
107
  items,
108
108
  key: groupKey
109
109
  } = group;
110
+ const {
111
+ i18n
112
+ } = useTranslation();
113
+ const {
114
+ fieldProps: {
115
+ featureClientSchemaMap,
116
+ schemaPath
117
+ }
118
+ } = useEditorConfigContext();
119
+ const activeItemLabels = groupState.activeItems.map(item => typeof item.label === 'function' ? item.label({
120
+ featureClientSchemaMap,
121
+ i18n,
122
+ schemaPath
123
+ }) : item.label || item.key);
124
+ const dropdownLabel = groupKey === 'text' ? i18n.t('lexical:general:textStyle') : undefined;
125
+ const buttonAriaLabel = [...new Set([label, ...activeItemLabels, dropdownLabel].filter(Boolean))].join(', ') || groupKey;
110
126
  const renderedItems = useMemo(() => {
111
- return items?.length ? items.map(item => /*#__PURE__*/_jsx(MemoToolbarItem, {
112
- active: groupState.activeItemKeys.includes(item.key),
127
+ return items?.length ? items.map(item_0 => /*#__PURE__*/_jsx(MemoToolbarItem, {
128
+ active: groupState.activeItemKeys.includes(item_0.key),
113
129
  anchorElem: anchorElem,
114
130
  editor: editor,
115
- enabled: groupState.enabledItemKeys.includes(item.key),
131
+ enabled: groupState.enabledItemKeys.includes(item_0.key),
116
132
  iconOnly: group.iconOnly,
117
- item: item
118
- }, item.key)) : null;
133
+ item: item_0
134
+ }, item_0.key)) : null;
119
135
  }, [items, groupState.activeItemKeys, groupState.enabledItemKeys, anchorElem, editor]);
120
136
  return /*#__PURE__*/_jsx(DropDown, {
121
- buttonAriaLabel: `${groupKey} dropdown`,
137
+ buttonAriaLabel: buttonAriaLabel,
122
138
  buttonClassName: [baseClass, `${baseClass}-${groupKey}`, ...(classNames || [])].filter(Boolean).join(' '),
123
139
  disabled: !groupState.enabledGroup,
124
140
  dropdownKey: groupKey,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","React","useMemo","baseClass","useTranslation","useEditorConfigContext","DropDown","DropDownItem","ToolbarItem","t0","$","active","anchorElem","editor","enabled","iconOnly","item","i18n","fieldProps","t1","featureClientSchemaMap","schemaPath","Component","t2","_jsx","title","key","croppedTitle","label","length","substring","Icon","ChildComponent","undefined","itemKey","tooltip","children","className","MemoToolbarItem","memo","ToolbarDropdown","classNames","group","groupState","itemsContainerClassNames","items","groupKey","renderedItems","map","activeItemKeys","includes","enabledItemKeys","buttonAriaLabel","buttonClassName","filter","Boolean","join","disabled","enabledGroup","dropdownKey"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/index.tsx"],"sourcesContent":["'use client'\nimport React, { useMemo } from 'react'\n\nconst baseClass = 'toolbar-popup__dropdown'\n\nimport type { LexicalEditor } from 'lexical'\n\nimport { useTranslation } from '@payloadcms/ui'\n\nimport type { ToolbarDropdownGroup, ToolbarGroupItem } from '../../types.js'\nimport type { ToolbarGroupState } from '../useToolbarStates.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport './index.css'\nimport { DropDown, DropDownItem } from './DropDown.js'\n\nconst ToolbarItem = ({\n active,\n anchorElem,\n editor,\n enabled,\n iconOnly,\n item,\n}: {\n active?: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled?: boolean\n iconOnly?: boolean\n item: ToolbarGroupItem\n}) => {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component\n active={active}\n anchorElem={anchorElem}\n editor={editor}\n enabled={enabled}\n item={item}\n key={item.key}\n />\n )\n )\n }\n\n let title = item.key\n let croppedTitle = item.key\n if (item.label) {\n title =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n if (title.length > 25) {\n croppedTitle = title.substring(0, 25) + '...'\n } else {\n croppedTitle = title\n }\n\n return (\n <DropDownItem\n active={active}\n editor={editor}\n enabled={enabled}\n Icon={item?.ChildComponent ? <item.ChildComponent /> : undefined}\n item={item}\n itemKey={item.key}\n key={item.key}\n tooltip={iconOnly ? title : undefined}\n >\n <span className=\"text\">{croppedTitle}</span>\n </DropDownItem>\n )\n}\n\nconst MemoToolbarItem = React.memo(ToolbarItem)\n\nexport const ToolbarDropdown = ({\n anchorElem,\n classNames,\n editor,\n group,\n groupState,\n Icon,\n itemsContainerClassNames,\n label,\n}: {\n anchorElem: HTMLElement\n classNames?: string[]\n editor: LexicalEditor\n group: ToolbarDropdownGroup\n groupState: ToolbarGroupState\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n}) => {\n const { items, key: groupKey } = group\n\n const renderedItems = useMemo(() => {\n return items?.length\n ? items.map((item) => (\n <MemoToolbarItem\n active={groupState.activeItemKeys.includes(item.key)}\n anchorElem={anchorElem}\n editor={editor}\n enabled={groupState.enabledItemKeys.includes(item.key)}\n iconOnly={group.iconOnly}\n item={item}\n key={item.key}\n />\n ))\n : null\n }, [items, groupState.activeItemKeys, groupState.enabledItemKeys, anchorElem, editor])\n\n return (\n <DropDown\n buttonAriaLabel={`${groupKey} dropdown`}\n buttonClassName={[baseClass, `${baseClass}-${groupKey}`, ...(classNames || [])]\n .filter(Boolean)\n .join(' ')}\n disabled={!groupState.enabledGroup}\n dropdownKey={groupKey}\n Icon={Icon}\n itemsContainerClassNames={[`${baseClass}-items`, ...(itemsContainerClassNames || [])]}\n key={groupKey}\n label={label}\n >\n {renderedItems}\n </DropDown>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,IAASC,OAAO,QAAQ;AAE/B,MAAMC,SAAA,GAAY;AAIlB,SAASC,cAAc,QAAQ;AAK/B,SAASC,sBAAsB,QAAQ;AACvC,OAAO;AACP,SAASC,QAAQ,EAAEC,YAAY,QAAQ;AAEvC,MAAMC,WAAA,GAAcC,EAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EAAC;IAAAW,MAAA;IAAAC,UAAA;IAAAC,MAAA;IAAAC,OAAA;IAAAC,QAAA;IAAAC;EAAA,IAAAP,EAcpB;EACC;IAAAQ;EAAA,IAAiBb,cAAA;EACjB;IAAAc,UAAA,EAAAC;E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IAAA,iBACTQ,IAAA,CAACc,eAAA;MACC3B,MAAA,EAAQgC,UAAA,CAAWM,cAAc,CAACC,QAAQ,CAAClC,IAAA,CAAKU,GAAG;MACnDd,UAAA,EAAYA,UAAA;MACZC,MAAA,EAAQA,MAAA;MACRC,OAAA,EAAS6B,UAAA,CAAWQ,eAAe,CAACD,QAAQ,CAAClC,IAAA,CAAKU,GAAG;MACrDX,QAAA,EAAU2B,KAAA,CAAM3B,QAAQ;MACxBC,IAAA,EAAMA;OACDA,IAAA,CAAKU,GAAG,KAGjB;EACN,GAAG,CAACmB,KAAA,EAAOF,UAAA,CAAWM,cAAc,EAAEN,UAAA,CAAWQ,eAAe,EAAEvC,UAAA,EAAYC,MAAA,CAAO;EAErF,oBACEW,IAAA,CAAClB,QAAA;IACC8C,eAAA,EAAiB,GAAGN,QAAA,WAAmB;IACvCO,eAAA,EAAiB,CAAClD,SAAA,EAAW,GAAGA,SAAA,IAAa2C,QAAA,EAAU,E,IAAML,UAAA,IAAc,EAAE,EAAE,CAC5Ea,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;IACRC,QAAA,EAAU,CAACd,UAAA,CAAWe,YAAY;IAClCC,WAAA,EAAab,QAAA;IACbf,IAAA,EAAMA,IAAA;IACNa,wBAAA,EAA0B,CAAC,GAAGzC,SAAA,QAAiB,E,IAAMyC,wBAAA,IAA4B,EAAE,EAAE;IAErFhB,KAAA,EAAOA,KAAA;cAENmB;KAHID,QAAA;AAMX","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","React","useMemo","baseClass","useTranslation","useEditorConfigContext","DropDown","DropDownItem","ToolbarItem","t0","$","active","anchorElem","editor","enabled","iconOnly","item","i18n","fieldProps","t1","featureClientSchemaMap","schemaPath","Component","t2","_jsx","title","key","croppedTitle","label","length","substring","Icon","ChildComponent","undefined","itemKey","tooltip","children","className","MemoToolbarItem","memo","ToolbarDropdown","classNames","group","groupState","itemsContainerClassNames","items","groupKey","activeItemLabels","activeItems","map","dropdownLabel","t","buttonAriaLabel","Set","filter","Boolean","join","renderedItems","activeItemKeys","includes","enabledItemKeys","buttonClassName","disabled","enabledGroup","dropdownKey"],"sources":["../../../../../src/features/toolbars/shared/ToolbarDropdown/index.tsx"],"sourcesContent":["'use client'\nimport React, { useMemo } from 'react'\n\nconst baseClass = 'toolbar-popup__dropdown'\n\nimport type { LexicalEditor } from 'lexical'\n\nimport { useTranslation } from '@payloadcms/ui'\n\nimport type { ToolbarDropdownGroup, ToolbarGroupItem } from '../../types.js'\nimport type { ToolbarGroupState } from '../useToolbarStates.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport './index.css'\nimport { DropDown, DropDownItem } from './DropDown.js'\n\nconst ToolbarItem = ({\n active,\n anchorElem,\n editor,\n enabled,\n iconOnly,\n item,\n}: {\n active?: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled?: boolean\n iconOnly?: boolean\n item: ToolbarGroupItem\n}) => {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component\n active={active}\n anchorElem={anchorElem}\n editor={editor}\n enabled={enabled}\n item={item}\n key={item.key}\n />\n )\n )\n }\n\n let title = item.key\n let croppedTitle = item.key\n if (item.label) {\n title =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n if (title.length > 25) {\n croppedTitle = title.substring(0, 25) + '...'\n } else {\n croppedTitle = title\n }\n\n return (\n <DropDownItem\n active={active}\n editor={editor}\n enabled={enabled}\n Icon={item?.ChildComponent ? <item.ChildComponent /> : undefined}\n item={item}\n itemKey={item.key}\n key={item.key}\n tooltip={iconOnly ? title : undefined}\n >\n <span className=\"text\">{croppedTitle}</span>\n </DropDownItem>\n )\n}\n\nconst MemoToolbarItem = React.memo(ToolbarItem)\n\nexport const ToolbarDropdown = ({\n anchorElem,\n classNames,\n editor,\n group,\n groupState,\n Icon,\n itemsContainerClassNames,\n label,\n}: {\n anchorElem: HTMLElement\n classNames?: string[]\n editor: LexicalEditor\n group: ToolbarDropdownGroup\n groupState: ToolbarGroupState\n Icon?: React.FC\n itemsContainerClassNames?: string[]\n label?: string\n}) => {\n const { items, key: groupKey } = group\n const { i18n } = useTranslation<Record<string, never>, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n const activeItemLabels = groupState.activeItems.map((item) =>\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label || item.key,\n )\n const dropdownLabel = groupKey === 'text' ? i18n.t('lexical:general:textStyle') : undefined\n const buttonAriaLabel =\n [...new Set([label, ...activeItemLabels, dropdownLabel].filter(Boolean))].join(', ') || groupKey\n\n const renderedItems = useMemo(() => {\n return items?.length\n ? items.map((item) => (\n <MemoToolbarItem\n active={groupState.activeItemKeys.includes(item.key)}\n anchorElem={anchorElem}\n editor={editor}\n enabled={groupState.enabledItemKeys.includes(item.key)}\n iconOnly={group.iconOnly}\n item={item}\n key={item.key}\n />\n ))\n : null\n }, [items, groupState.activeItemKeys, groupState.enabledItemKeys, anchorElem, editor])\n\n return (\n <DropDown\n buttonAriaLabel={buttonAriaLabel}\n buttonClassName={[baseClass, `${baseClass}-${groupKey}`, ...(classNames || [])]\n .filter(Boolean)\n .join(' ')}\n disabled={!groupState.enabledGroup}\n dropdownKey={groupKey}\n Icon={Icon}\n itemsContainerClassNames={[`${baseClass}-items`, ...(itemsContainerClassNames || [])]}\n key={groupKey}\n label={label}\n >\n {renderedItems}\n </DropDown>\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AACA,OAAOC,KAAA,IAASC,OAAO,QAAQ;AAE/B,MAAMC,SAAA,GAAY;AAIlB,SAASC,cAAc,QAAQ;AAK/B,SAASC,sBAAsB,QAAQ;AACvC,OAAO;AACP,SAASC,QAAQ,EAAE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AGjB;EACN,GAAG,CAACmB,KAAA,EAAOF,UAAA,CAAWe,cAAc,EAAEf,UAAA,CAAWiB,eAAe,EAAEhD,UAAA,EAAYC,MAAA,CAAO;EAErF,oBACEW,IAAA,CAAClB,QAAA;IACC8C,eAAA,EAAiBA,eAAA;IACjBS,eAAA,EAAiB,CAAC1D,SAAA,EAAW,GAAGA,SAAA,IAAa2C,QAAA,EAAU,E,IAAML,UAAA,IAAc,EAAE,EAAE,CAC5Ea,MAAM,CAACC,OAAA,EACPC,IAAI,CAAC;IACRM,QAAA,EAAU,CAACnB,UAAA,CAAWoB,YAAY;IAClCC,WAAA,EAAalB,QAAA;IACbf,IAAA,EAAMA,IAAA;IACNa,wBAAA,EAA0B,CAAC,GAAGzC,SAAA,QAAiB,E,IAAMyC,wBAAA,IAA4B,EAAE,EAAE;IAErFhB,KAAA,EAAOA,KAAA;cAEN6B;KAHIX,QAAA;AAMX","ignoreList":[]}
@@ -0,0 +1,5 @@
1
+ import type { RefObject } from 'react';
2
+ export declare function useToolbarKeyboardNavigation({ toolbarRef, }: {
3
+ toolbarRef: RefObject<HTMLDivElement | null>;
4
+ }): void;
5
+ //# sourceMappingURL=useToolbarKeyboardNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToolbarKeyboardNavigation.d.ts","sourceRoot":"","sources":["../../../../src/features/toolbars/shared/useToolbarKeyboardNavigation.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAItC,wBAAgB,4BAA4B,CAAC,EAC3C,UAAU,GACX,EAAE;IACD,UAAU,EAAE,SAAS,CAAC,cAAc,GAAG,IAAI,CAAC,CAAA;CAC7C,QAwFA"}
@@ -0,0 +1,109 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { useEffect } from 'react';
5
+ export function useToolbarKeyboardNavigation(t0) {
6
+ const $ = _c(3);
7
+ const {
8
+ toolbarRef
9
+ } = t0;
10
+ let t1;
11
+ let t2;
12
+ if ($[0] !== toolbarRef) {
13
+ t1 = () => {
14
+ const toolbar = toolbarRef.current;
15
+ if (!toolbar) {
16
+ return;
17
+ }
18
+ let activeButton;
19
+ const getButtons = () => Array.from(toolbar.querySelectorAll("button")).filter(button => !button.closest("[role=\"menu\"]") && button.closest("[role=\"toolbar\"]") === toolbar);
20
+ const updateTabStops = () => {
21
+ const buttons = getButtons();
22
+ const enabledButtons = buttons.filter(_temp);
23
+ if (!activeButton || !enabledButtons.includes(activeButton)) {
24
+ activeButton = enabledButtons[0];
25
+ }
26
+ for (const button_1 of buttons) {
27
+ button_1.tabIndex = button_1 === activeButton ? 0 : -1;
28
+ }
29
+ };
30
+ const handleFocus = event => {
31
+ const button_3 = getButtons().find(button_2 => button_2 === event.target);
32
+ if (button_3) {
33
+ activeButton = button_3;
34
+ updateTabStops();
35
+ }
36
+ };
37
+ const handleKeyDown = event_0 => {
38
+ if (event_0.altKey || event_0.ctrlKey || event_0.metaKey || event_0.shiftKey) {
39
+ return;
40
+ }
41
+ const buttons_0 = getButtons().filter(_temp2);
42
+ const index = buttons_0.findIndex(button_5 => button_5 === event_0.target);
43
+ if (index === -1) {
44
+ return;
45
+ }
46
+ const isRTL = getComputedStyle(toolbar).direction === "rtl";
47
+ let nextIndex;
48
+ bb58: switch (event_0.key) {
49
+ case "ArrowLeft":
50
+ {
51
+ nextIndex = index + (isRTL ? 1 : -1);
52
+ break bb58;
53
+ }
54
+ case "ArrowRight":
55
+ {
56
+ nextIndex = index + (isRTL ? -1 : 1);
57
+ break bb58;
58
+ }
59
+ case "End":
60
+ {
61
+ nextIndex = buttons_0.length - 1;
62
+ break bb58;
63
+ }
64
+ case "Home":
65
+ {
66
+ nextIndex = 0;
67
+ break bb58;
68
+ }
69
+ default:
70
+ {
71
+ return;
72
+ }
73
+ }
74
+ event_0.preventDefault();
75
+ event_0.stopPropagation();
76
+ buttons_0[(nextIndex + buttons_0.length) % buttons_0.length]?.focus();
77
+ };
78
+ updateTabStops();
79
+ const observer = new MutationObserver(updateTabStops);
80
+ observer.observe(toolbar, {
81
+ attributeFilter: ["disabled"],
82
+ childList: true,
83
+ subtree: true
84
+ });
85
+ toolbar.addEventListener("focusin", handleFocus);
86
+ toolbar.addEventListener("keydown", handleKeyDown);
87
+ return () => {
88
+ observer.disconnect();
89
+ toolbar.removeEventListener("focusin", handleFocus);
90
+ toolbar.removeEventListener("keydown", handleKeyDown);
91
+ };
92
+ };
93
+ t2 = [toolbarRef];
94
+ $[0] = toolbarRef;
95
+ $[1] = t1;
96
+ $[2] = t2;
97
+ } else {
98
+ t1 = $[1];
99
+ t2 = $[2];
100
+ }
101
+ useEffect(t1, t2);
102
+ }
103
+ function _temp2(button_4) {
104
+ return !button_4.disabled;
105
+ }
106
+ function _temp(button_0) {
107
+ return !button_0.disabled;
108
+ }
109
+ //# sourceMappingURL=useToolbarKeyboardNavigation.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useToolbarKeyboardNavigation.js","names":["c","_c","useEffect","useToolbarKeyboardNavigation","t0","$","toolbarRef","t1","t2","toolbar","current","activeButton","getButtons","Array","from","querySelectorAll","filter","button","closest","updateTabStops","buttons","enabledButtons","_temp","includes","button_1","tabIndex","handleFocus","event","button_3","find","button_2","target","handleKeyDown","event_0","altKey","ctrlKey","metaKey","shiftKey","buttons_0","_temp2","index","findIndex","button_5","isRTL","getComputedStyle","direction","nextIndex","bb58","key","length","preventDefault","stopPropagation","focus","observer","MutationObserver","observe","attributeFilter","childList","subtree","addEventListener","disconnect","removeEventListener","button_4","disabled","button_0"],"sources":["../../../../src/features/toolbars/shared/useToolbarKeyboardNavigation.ts"],"sourcesContent":["'use client'\n\nimport type { RefObject } from 'react'\n\nimport { useEffect } from 'react'\n\nexport function useToolbarKeyboardNavigation({\n toolbarRef,\n}: {\n toolbarRef: RefObject<HTMLDivElement | null>\n}) {\n useEffect(() => {\n const toolbar = toolbarRef.current\n\n if (!toolbar) {\n return\n }\n\n let activeButton: HTMLButtonElement | undefined\n const getButtons = () =>\n Array.from(toolbar.querySelectorAll<HTMLButtonElement>('button')).filter(\n (button) =>\n !button.closest('[role=\"menu\"]') && button.closest('[role=\"toolbar\"]') === toolbar,\n )\n\n const updateTabStops = () => {\n const buttons = getButtons()\n const enabledButtons = buttons.filter((button) => !button.disabled)\n\n if (!activeButton || !enabledButtons.includes(activeButton)) {\n activeButton = enabledButtons[0]\n }\n\n for (const button of buttons) {\n button.tabIndex = button === activeButton ? 0 : -1\n }\n }\n\n const handleFocus = (event: FocusEvent) => {\n const button = getButtons().find((button) => button === event.target)\n\n if (button) {\n activeButton = button\n updateTabStops()\n }\n }\n\n const handleKeyDown = (event: KeyboardEvent) => {\n if (event.altKey || event.ctrlKey || event.metaKey || event.shiftKey) {\n return\n }\n\n const buttons = getButtons().filter((button) => !button.disabled)\n const index = buttons.findIndex((button) => button === event.target)\n\n // Dropdown menus and custom inputs retain their own keyboard behavior.\n if (index === -1) {\n return\n }\n\n const isRTL = getComputedStyle(toolbar).direction === 'rtl'\n let nextIndex: number\n\n switch (event.key) {\n case 'ArrowLeft':\n nextIndex = index + (isRTL ? 1 : -1)\n break\n case 'ArrowRight':\n nextIndex = index + (isRTL ? -1 : 1)\n break\n case 'End':\n nextIndex = buttons.length - 1\n break\n case 'Home':\n nextIndex = 0\n break\n default:\n return\n }\n\n event.preventDefault()\n event.stopPropagation()\n buttons[(nextIndex + buttons.length) % buttons.length]?.focus()\n }\n\n updateTabStops()\n const observer = new MutationObserver(updateTabStops)\n\n observer.observe(toolbar, { attributeFilter: ['disabled'], childList: true, subtree: true })\n toolbar.addEventListener('focusin', handleFocus)\n toolbar.addEventListener('keydown', handleKeyDown)\n\n return () => {\n observer.disconnect()\n toolbar.removeEventListener('focusin', handleFocus)\n toolbar.removeEventListener('keydown', handleKeyDown)\n }\n }, [toolbarRef])\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AAIA,SAASC,SAAS,QAAQ;AA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,OAAA,EAAe;MAAK;MAC1FjD,OAAA,CAAAkD,gBAAwB,CAAC,WAAWjC,WAAA;MACpCjB,OAAA,CAAAkD,gBAAwB,CAAC,WAAW3B,aAAA;MAAA,OAE7B;QACLqB,QAAA,CAAAO,UAAmB;QACnBnD,OAAA,CAAAoD,mBAA2B,CAAC,WAAWnC,WAAA;QACvCjB,OAAA,CAAAoD,mBAA2B,CAAC,WAAW7B,aAAA;MAAA,CACzC;IAAA,CACF;IAAGxB,EAAA,IAACF,UAAA,CAAW;IAAAD,CAAA,MAAAC,UAAA;IAAAD,CAAA,MAAAE,EAAA;IAAAF,CAAA,MAAAG,EAAA;EAAA;IAAAD,EAAA,GAAAF,CAAA;IAAAG,EAAA,GAAAH,CAAA;EAAA;EAtFfH,SAAA,CAAUK,EAsFV,EAAGC,EAAY;AAAA;AA3FV,SAAA+B,OAAAuB,QAAA;EAAA,OA8C+C,CAAC7C,QAAA,CAAA8C,QAAe;AAAA;AA9C/D,SAAAzC,MAAA0C,QAAA;EAAA,OAqBiD,CAAC/C,QAAA,CAAA8C,QAAe;AAAA","ignoreList":[]}
@@ -2,7 +2,7 @@ import type { Transformer } from '@lexical/markdown';
2
2
  import type { GenericLanguages, I18nClient } from '@payloadcms/translations';
3
3
  import type { JSONSchema4 } from 'json-schema';
4
4
  import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState, SerializedLexicalNode } from 'lexical';
5
- import type { Field, FieldSchemaMap, FieldsToJSONSchemaArgs, ImportMapGenerators, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, TypedFallbackLocale, ValidateOptions, ValidationFieldError } from 'payload';
5
+ import type { Field, FieldOperation, FieldSchemaMap, FieldsToJSONSchemaArgs, ImportMapGenerators, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, TypedFallbackLocale, ValidateOptions, ValidationFieldError } from 'payload';
6
6
  import type { ServerEditorConfig } from '../lexical/config/types.js';
7
7
  import type { LexicalRichTextField } from '../types/index.js';
8
8
  import type { ElementNodeSchemaFn } from '../types/jsonSchemaHelpers.js';
@@ -116,7 +116,7 @@ export type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {
116
116
  };
117
117
  export type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {
118
118
  /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */
119
- operation: 'create' | 'delete' | 'read' | 'update';
119
+ operation: FieldOperation;
120
120
  /** The value of the node before any changes. Not available in afterRead hooks */
121
121
  originalNode: T;
122
122
  overrideAccess: boolean;
@@ -128,7 +128,7 @@ export type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {
128
128
  errors: ValidationFieldError[];
129
129
  mergeLocaleActions: (() => Promise<void> | void)[];
130
130
  /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */
131
- operation: 'create' | 'delete' | 'read' | 'update';
131
+ operation: FieldOperation;
132
132
  /** The value of the node before any changes. Not available in afterRead hooks */
133
133
  originalNode: T;
134
134
  /**
@@ -159,6 +159,10 @@ export type JSONSchemaArgs = {
159
159
  nodeUnionName: string;
160
160
  } & Pick<FieldsToJSONSchemaArgs, 'collectionIDFieldTypes' | 'config' | 'i18n' | 'interfaceNameDefinitions' | 'typeStringDefinitions' | 'variant'>;
161
161
  export type JSONSchemaFn = (args: JSONSchemaArgs) => JSONSchema4;
162
+ type SerializedNodeJSON<T extends LexicalNode> = T['exportJSON'] extends {
163
+ (compact?: false): infer Serialized extends SerializedLexicalNode;
164
+ (compact: boolean): unknown;
165
+ } ? Serialized : never;
162
166
  export type NodeWithHooks<T extends LexicalNode = any> = {
163
167
  /**
164
168
  * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload
@@ -168,14 +172,14 @@ export type NodeWithHooks<T extends LexicalNode = any> = {
168
172
  /**
169
173
  * Optional. If not provided, all possible sub-fields should be returned.
170
174
  */
171
- node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>;
175
+ node?: SerializedNodeJSON<ReplaceAny<T, LexicalNode>>;
172
176
  req?: PayloadRequest;
173
177
  }) => Field[] | null;
174
178
  /**
175
179
  * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.
176
180
  */
177
181
  getSubFieldsData?: (args: {
178
- node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>;
182
+ node: SerializedNodeJSON<ReplaceAny<T, LexicalNode>>;
179
183
  req: PayloadRequest;
180
184
  }) => JsonObject;
181
185
  /**
@@ -184,15 +188,15 @@ export type NodeWithHooks<T extends LexicalNode = any> = {
184
188
  * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.
185
189
  * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.
186
190
  */
187
- graphQLPopulationPromises?: Array<PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
191
+ graphQLPopulationPromises?: Array<PopulationPromise<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>;
188
192
  /**
189
193
  * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.
190
194
  */
191
195
  hooks?: {
192
- afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
193
- afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
194
- beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
195
- beforeValidate?: Array<BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
196
+ afterChange?: Array<AfterChangeNodeHook<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>;
197
+ afterRead?: Array<AfterReadNodeHook<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>;
198
+ beforeChange?: Array<BeforeChangeNodeHook<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>;
199
+ beforeValidate?: Array<BeforeValidateNodeHook<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>;
196
200
  };
197
201
  /**
198
202
  * Returns the JSON Schema for this node, plus optional standalone TS
@@ -208,7 +212,7 @@ export type NodeWithHooks<T extends LexicalNode = any> = {
208
212
  * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.
209
213
  * You can use it to throw a validation error for a specific node in case its data is incorrect.
210
214
  */
211
- validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
215
+ validations?: Array<NodeValidation<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>;
212
216
  };
213
217
  export type ServerFeature<ServerProps, ClientFeatureProps> = {
214
218
  ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>;
@@ -289,4 +293,5 @@ export type SanitizedServerFeatures = {
289
293
  /** The node types mapped to their validations */
290
294
  validations: Map<string, Array<NodeValidation>>;
291
295
  } & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>;
296
+ export {};
292
297
  //# sourceMappingURL=typesServer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.d.ts","sourceRoot":"","sources":["../../src/features/typesServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAA;AACpD,OAAO,KAAK,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAC5E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,KAAK,EACL,cAAc,EACd,sBAAsB,EACtB,mBAAmB,EACnB,UAAU,EACV,gBA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AAA;IACnC,SAAS,CAAC,EAAE;QACV,WAAW,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,mBAAmB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC5E,SAAS,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACxE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9E,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;KACnF,CAAA,CAAC,yDAAyD;IAC3D,kDAAkD;IAClD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;CAChD,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { GenericLanguages, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Field,\n FieldSchemaMap,\n FieldsToJSONSchemaArgs,\n ImportMapGenerators,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n TypedFallbackLocale,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalRichTextField } from '../types/index.js'\nimport type { ElementNodeSchemaFn } from '../types/jsonSchemaHelpers.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: LexicalRichTextField\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) => ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n/** Arguments passed to each node's `jsonSchema` function. */\nexport type JSONSchemaArgs = {\n elementNodeSchema: ElementNodeSchemaFn\n field: LexicalRichTextField\n /** TS name of the node union - use in `tsType` annotations. */\n nodeUnionName: string\n} & Pick<\n FieldsToJSONSchemaArgs,\n | 'collectionIDFieldTypes'\n | 'config'\n | 'i18n'\n | 'interfaceNameDefinitions'\n | 'typeStringDefinitions'\n | 'variant'\n>\n\nexport type JSONSchemaFn = (args: JSONSchemaArgs) => JSONSchema4\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * Returns the JSON Schema for this node, plus optional standalone TS\n * source for helper types its `tsType` annotations reference. Nodes\n * without this function are omitted from the strictly-typed union.\n */\n jsonSchema?: JSONSchemaFn\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n | ImportMapGenerators[0]\n | PayloadComponent[]\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AA0WA","ignoreList":[]}
1
+ {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { GenericLanguages, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Field,\n FieldOperation,\n FieldSchemaMap,\n FieldsToJSONSchemaArgs,\n ImportMapGenerators,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n TypedFallbackLocale,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalRichTextField } from '../types/index.js'\nimport type { ElementNodeSchemaFn } from '../types/jsonSchemaHelpers.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: LexicalRichTextField\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) => ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: FieldOperation\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: FieldOperation\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n/** Arguments passed to each node's `jsonSchema` function. */\nexport type JSONSchemaArgs = {\n elementNodeSchema: ElementNodeSchemaFn\n field: LexicalRichTextField\n /** TS name of the node union - use in `tsType` annotations. */\n nodeUnionName: string\n} & Pick<\n FieldsToJSONSchemaArgs,\n | 'collectionIDFieldTypes'\n | 'config'\n | 'i18n'\n | 'interfaceNameDefinitions'\n | 'typeStringDefinitions'\n | 'variant'\n>\n\nexport type JSONSchemaFn = (args: JSONSchemaArgs) => JSONSchema4\n\n// Match both overloads to infer the full JSON format. ReturnType selects the compact\n// overload, and LexicalExportJSON widens custom nodes' serialized type discriminants.\ntype SerializedNodeJSON<T extends LexicalNode> = T['exportJSON'] extends {\n (compact?: false): infer Serialized extends SerializedLexicalNode\n // eslint-disable-next-line perfectionist/sort-object-types -- Overload order determines inference.\n (compact: boolean): unknown\n}\n ? Serialized\n : never\n\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: SerializedNodeJSON<ReplaceAny<T, LexicalNode>>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: SerializedNodeJSON<ReplaceAny<T, LexicalNode>>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>\n afterRead?: Array<AfterReadNodeHook<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>\n beforeChange?: Array<BeforeChangeNodeHook<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>\n beforeValidate?: Array<BeforeValidateNodeHook<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>\n }\n /**\n * Returns the JSON Schema for this node, plus optional standalone TS\n * source for helper types its `tsType` annotations reference. Nodes\n * without this function are omitted from the strictly-typed union.\n */\n jsonSchema?: JSONSchemaFn\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<SerializedNodeJSON<ReplaceAny<T, LexicalNode>>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n | ImportMapGenerators[0]\n | PayloadComponent[]\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AAkXA","ignoreList":[]}