@payloadcms/richtext-lexical 4.0.0-internal.45cfa3d → 4.0.0-internal.4a6b4c3

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 (584) hide show
  1. package/dist/exports/client/Field-W2ABOM7M.js +2 -0
  2. package/dist/exports/client/Field-W2ABOM7M.js.map +7 -0
  3. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  4. package/dist/exports/client/{chunk-X3D4LZS7.js.map → chunk-3LRZDIIG.js.map} +4 -4
  5. package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
  6. package/dist/exports/client/chunk-E6LSRRP2.js.map +7 -0
  7. package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
  8. package/dist/exports/client/chunk-ZQX5HXUL.js.map +7 -0
  9. package/dist/exports/client/component-6DQLENIE.js +2 -0
  10. package/dist/exports/client/component-6DQLENIE.js.map +7 -0
  11. package/dist/exports/client/componentInline-HNE5G4TE.js +2 -0
  12. package/dist/exports/client/index.d.ts +1 -1
  13. package/dist/exports/client/index.d.ts.map +1 -1
  14. package/dist/exports/client/index.js +28 -28
  15. package/dist/exports/client/index.js.map +4 -4
  16. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  17. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  18. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  19. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  20. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  21. package/dist/features/blocks/client/component/index.d.ts +0 -6
  22. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  23. package/dist/features/blocks/client/component/index.js +169 -101
  24. package/dist/features/blocks/client/component/index.js.map +1 -1
  25. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  26. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  27. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  28. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  29. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  30. package/dist/features/blocks/client/componentInline/index.css +0 -1
  31. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  32. package/dist/features/blocks/client/componentInline/index.js +30 -22
  33. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  34. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  35. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  36. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  37. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  38. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  39. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  40. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  41. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  42. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  43. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  44. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  45. package/dist/features/blocks/server/index.js +2 -2
  46. package/dist/features/blocks/server/index.js.map +1 -1
  47. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  48. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  49. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  50. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  51. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  52. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  53. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  54. package/dist/features/blocks/server/schema.d.ts +2 -0
  55. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  56. package/dist/features/blocks/server/schema.js +7 -9
  57. package/dist/features/blocks/server/schema.js.map +1 -1
  58. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  59. package/dist/features/blocks/server/validate.js +1 -1
  60. package/dist/features/blocks/server/validate.js.map +1 -1
  61. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  62. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  63. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  64. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  65. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  66. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  67. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  68. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  69. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  70. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  71. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  72. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.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/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  81. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  82. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  83. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  84. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  85. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  86. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  87. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  88. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  89. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  90. package/dist/features/converters/markdownToLexical/index.d.ts.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/testRecorder/client/plugin/index.css +0 -1
  95. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  96. package/dist/features/heading/constants.d.ts +2 -0
  97. package/dist/features/heading/constants.d.ts.map +1 -0
  98. package/dist/features/heading/constants.js +2 -0
  99. package/dist/features/heading/constants.js.map +1 -0
  100. package/dist/features/heading/server/index.d.ts.map +1 -1
  101. package/dist/features/heading/server/index.js +5 -1
  102. package/dist/features/heading/server/index.js.map +1 -1
  103. package/dist/features/heading/server/schema.d.ts.map +1 -1
  104. package/dist/features/heading/server/validate.d.ts +6 -0
  105. package/dist/features/heading/server/validate.d.ts.map +1 -0
  106. package/dist/features/heading/server/validate.js +15 -0
  107. package/dist/features/heading/server/validate.js.map +1 -0
  108. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  109. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  110. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  111. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  112. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  113. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  114. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  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/toolbarIndentGroup.d.ts.map +1 -1
  124. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  125. package/dist/features/indent/server/i18n.js +74 -37
  126. package/dist/features/indent/server/i18n.js.map +1 -1
  127. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  128. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  129. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  130. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  131. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -2
  132. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  133. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  134. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  135. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  136. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  137. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  138. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  139. package/dist/features/link/nodes/LinkNode.js +2 -15
  140. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  141. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  142. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  143. package/dist/features/link/server/index.js +2 -2
  144. package/dist/features/link/server/index.js.map +1 -1
  145. package/dist/features/link/server/schema.d.ts.map +1 -1
  146. package/dist/features/link/server/validate.d.ts.map +1 -1
  147. package/dist/features/link/server/validate.js +1 -1
  148. package/dist/features/link/server/validate.js.map +1 -1
  149. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  150. package/dist/features/lists/checklist/server/index.js +5 -2
  151. package/dist/features/lists/checklist/server/index.js.map +1 -1
  152. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  153. package/dist/features/lists/orderedList/server/index.js +5 -2
  154. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  155. package/dist/features/lists/shared/constants.d.ts +2 -0
  156. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  157. package/dist/features/lists/shared/constants.js +2 -0
  158. package/dist/features/lists/shared/constants.js.map +1 -0
  159. package/dist/features/lists/shared/validate.d.ts +5 -0
  160. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  161. package/dist/features/lists/shared/validate.js +15 -0
  162. package/dist/features/lists/shared/validate.js.map +1 -0
  163. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  164. package/dist/features/lists/unorderedList/server/index.js +5 -2
  165. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  166. package/dist/features/relationship/client/components/index.css +3 -6
  167. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  168. package/dist/features/relationship/client/index.d.ts +2 -2
  169. package/dist/features/relationship/client/index.d.ts.map +1 -1
  170. package/dist/features/relationship/client/index.js.map +1 -1
  171. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  172. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  173. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  174. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  175. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  176. package/dist/features/relationship/client/plugins/index.js +27 -31
  177. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  178. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  179. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  180. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  181. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  182. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  183. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  184. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  185. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  186. package/dist/features/relationship/server/index.d.ts +8 -1
  187. package/dist/features/relationship/server/index.d.ts.map +1 -1
  188. package/dist/features/relationship/server/index.js +28 -11
  189. package/dist/features/relationship/server/index.js.map +1 -1
  190. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  191. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  192. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  193. package/dist/features/relationship/server/schema.d.ts +3 -2
  194. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  195. package/dist/features/relationship/server/schema.js +9 -12
  196. package/dist/features/relationship/server/schema.js.map +1 -1
  197. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  198. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  199. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  200. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  201. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  202. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  203. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  204. package/dist/features/table/client/index.d.ts.map +1 -0
  205. package/dist/features/table/client/index.js.map +1 -0
  206. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  207. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  208. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  209. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  210. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -1
  211. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  212. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  213. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  214. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  215. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  216. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  217. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  218. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  219. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  220. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  221. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  222. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  223. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  224. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  225. package/dist/features/table/client/utils/debounce.js.map +1 -0
  226. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  227. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  228. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  229. package/dist/features/table/markdownTransformer.js.map +1 -0
  230. package/dist/features/table/server/index.d.ts +3 -0
  231. package/dist/features/table/server/index.d.ts.map +1 -0
  232. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  233. package/dist/features/table/server/index.js.map +1 -0
  234. package/dist/features/table/server/schema.d.ts.map +1 -0
  235. package/dist/features/table/server/schema.js.map +1 -0
  236. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  237. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  238. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  239. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  240. package/dist/features/toolbars/fixed/client/Toolbar/index.css +78 -6
  241. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  242. package/dist/features/toolbars/fixed/client/Toolbar/index.js +19 -1
  243. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  244. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  245. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  246. package/dist/features/toolbars/inline/client/Toolbar/index.js +17 -2
  247. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  248. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  249. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  250. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  251. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  252. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  253. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  254. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -14
  255. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  256. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  257. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  258. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
  259. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  260. package/dist/features/typesServer.d.ts +17 -12
  261. package/dist/features/typesServer.d.ts.map +1 -1
  262. package/dist/features/typesServer.js.map +1 -1
  263. package/dist/features/upload/client/component/index.css +0 -2
  264. package/dist/features/upload/client/component/index.js +2 -1
  265. package/dist/features/upload/client/component/index.js.map +1 -1
  266. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  267. package/dist/features/upload/client/index.d.ts +3 -2
  268. package/dist/features/upload/client/index.d.ts.map +1 -1
  269. package/dist/features/upload/client/index.js.map +1 -1
  270. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  271. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  272. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  273. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  274. package/dist/features/upload/client/plugin/index.js +50 -53
  275. package/dist/features/upload/client/plugin/index.js.map +1 -1
  276. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  277. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  278. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  279. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  280. package/dist/features/upload/server/index.d.ts +7 -3
  281. package/dist/features/upload/server/index.d.ts.map +1 -1
  282. package/dist/features/upload/server/index.js +20 -16
  283. package/dist/features/upload/server/index.js.map +1 -1
  284. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  285. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  286. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  287. package/dist/features/upload/server/schema.d.ts +4 -16
  288. package/dist/features/upload/server/schema.d.ts.map +1 -1
  289. package/dist/features/upload/server/schema.js +8 -10
  290. package/dist/features/upload/server/schema.js.map +1 -1
  291. package/dist/features/upload/server/validate.d.ts +2 -2
  292. package/dist/features/upload/server/validate.d.ts.map +1 -1
  293. package/dist/features/upload/server/validate.js +4 -1
  294. package/dist/features/upload/server/validate.js.map +1 -1
  295. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  296. package/dist/field/Diff/converters/listitem/index.js +2 -1
  297. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  298. package/dist/field/Diff/converters/relationship/index.css +0 -1
  299. package/dist/field/Diff/converters/unknown/index.css +0 -1
  300. package/dist/field/Diff/converters/upload/index.css +0 -1
  301. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  302. package/dist/field/Diff/index.css +0 -2
  303. package/dist/field/Diff/index.d.ts +3 -2
  304. package/dist/field/Diff/index.d.ts.map +1 -1
  305. package/dist/field/Diff/index.js +3 -2
  306. package/dist/field/Diff/index.js.map +1 -1
  307. package/dist/field/Field.d.ts.map +1 -1
  308. package/dist/field/Field.js +26 -16
  309. package/dist/field/Field.js.map +1 -1
  310. package/dist/field/RenderLexical/index.d.ts +3 -1
  311. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  312. package/dist/field/RenderLexical/index.js +23 -23
  313. package/dist/field/RenderLexical/index.js.map +1 -1
  314. package/dist/field/ViewSelector.d.ts.map +1 -1
  315. package/dist/field/ViewSelector.js +1 -0
  316. package/dist/field/ViewSelector.js.map +1 -1
  317. package/dist/field/bundled.css +1 -1
  318. package/dist/field/index.css +10 -11
  319. package/dist/field/rscEntry.d.ts +2 -2
  320. package/dist/field/rscEntry.d.ts.map +1 -1
  321. package/dist/field/rscEntry.js.map +1 -1
  322. package/dist/i18n.d.ts.map +1 -1
  323. package/dist/i18n.js +68 -0
  324. package/dist/i18n.js.map +1 -1
  325. package/dist/index.d.ts +5 -5
  326. package/dist/index.d.ts.map +1 -1
  327. package/dist/index.js +27 -5
  328. package/dist/index.js.map +1 -1
  329. package/dist/lexical/LexicalEditor.css +30 -19
  330. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  331. package/dist/lexical/LexicalEditor.js +61 -64
  332. package/dist/lexical/LexicalEditor.js.map +1 -1
  333. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  334. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  335. package/dist/lexical/config/server/loader.d.ts +1 -1
  336. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  337. package/dist/lexical/config/server/loader.js +2 -2
  338. package/dist/lexical/config/server/loader.js.map +1 -1
  339. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  340. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  341. package/dist/lexical/config/server/sanitize.js +2 -2
  342. package/dist/lexical/config/server/sanitize.js.map +1 -1
  343. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  344. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  345. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  346. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  347. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  348. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  349. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  350. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  351. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  352. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  353. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  354. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  355. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  356. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  357. package/dist/lexical/plugins/SlashMenu/index.css +0 -2
  358. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  359. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  360. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  361. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  362. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +2 -0
  363. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  364. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  365. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  366. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  367. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  368. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  369. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  370. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  371. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  372. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  373. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  374. package/dist/lexical/theme/EditorTheme.css +0 -2
  375. package/dist/lexical/ui/ContentEditable.css +19 -14
  376. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  377. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  378. package/dist/lexical/ui/ContentEditable.js +32 -11
  379. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  380. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  381. package/dist/lexical/ui/icons/H3/index.js +13 -6
  382. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  383. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  384. package/dist/lexical/ui/icons/H4/index.js +13 -6
  385. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  386. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  387. package/dist/lexical/ui/icons/H5/index.js +13 -6
  388. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  389. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  390. package/dist/lexical/ui/icons/H6/index.js +13 -6
  391. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  392. package/dist/lexical/utils/markdown/createBlockNode.d.ts +1 -1
  393. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  394. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  395. package/dist/lexical/utils/point.d.ts.map +1 -1
  396. package/dist/lexical/utils/rect.d.ts.map +1 -1
  397. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  398. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  399. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  400. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  401. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  402. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  403. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  404. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  405. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  406. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  407. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  408. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  409. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  410. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  411. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  412. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  413. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  414. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  415. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  416. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  417. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  418. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  419. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  420. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  421. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  422. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  423. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  424. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  425. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  426. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  427. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  428. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  429. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  430. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  431. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  432. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  433. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  434. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  435. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  436. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  437. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  438. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  439. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  440. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  441. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  442. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  443. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  444. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  445. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  446. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  447. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  448. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  449. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  450. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  451. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  452. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  453. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  454. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  455. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  456. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  457. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  458. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  459. package/dist/presets/llmInstructions.d.ts +2 -0
  460. package/dist/presets/llmInstructions.d.ts.map +1 -0
  461. package/dist/presets/llmInstructions.js +13 -0
  462. package/dist/presets/llmInstructions.js.map +1 -0
  463. package/dist/types/builtInNodes.d.ts +1 -1
  464. package/dist/types/builtInNodes.d.ts.map +1 -1
  465. package/dist/types/builtInNodes.js +8 -3
  466. package/dist/types/builtInNodes.js.map +1 -1
  467. package/dist/types/index.d.ts +4 -7
  468. package/dist/types/index.d.ts.map +1 -1
  469. package/dist/types/index.js.map +1 -1
  470. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  471. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  472. package/dist/types/jsonSchemaHelpers.js +7 -2
  473. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  474. package/dist/types/nodeTypes.d.ts +6 -1
  475. package/dist/types/nodeTypes.d.ts.map +1 -1
  476. package/dist/types/nodeTypes.js.map +1 -1
  477. package/dist/utilities/buildInitialState.d.ts +3 -2
  478. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  479. package/dist/utilities/buildInitialState.js +1 -0
  480. package/dist/utilities/buildInitialState.js.map +1 -1
  481. package/dist/utilities/createServerFeature.d.ts +1 -1
  482. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  483. package/dist/utilities/createServerFeature.js +2 -2
  484. package/dist/utilities/createServerFeature.js.map +1 -1
  485. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  486. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  487. package/dist/utilities/editorConfigFactory.js +9 -9
  488. package/dist/utilities/editorConfigFactory.js.map +1 -1
  489. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  490. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  491. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  492. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  493. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  494. package/dist/utilities/generateImportMap.d.ts +3 -3
  495. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  496. package/dist/utilities/generateImportMap.js.map +1 -1
  497. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  498. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  499. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  500. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  501. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  502. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  503. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  504. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  505. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  506. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  507. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  508. package/dist/validate/hasText.d.ts +2 -2
  509. package/dist/validate/hasText.d.ts.map +1 -1
  510. package/dist/validate/hasText.js.map +1 -1
  511. package/dist/validate/index.d.ts +1 -1
  512. package/dist/validate/index.d.ts.map +1 -1
  513. package/package.json +100 -27
  514. package/dist/dependencyChecker.spec.js +0 -16
  515. package/dist/dependencyChecker.spec.js.map +0 -1
  516. package/dist/exports/client/Field-XH5C4HFU.js +0 -2
  517. package/dist/exports/client/Field-XH5C4HFU.js.map +0 -7
  518. package/dist/exports/client/bundled.css +0 -1
  519. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  520. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  521. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  522. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  523. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  524. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  525. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  526. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  527. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  528. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  529. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  530. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  531. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  532. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  533. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  534. package/dist/features/experimental_table/client/index.js.map +0 -1
  535. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  536. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  537. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  538. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  539. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  540. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  541. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  542. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  543. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  544. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  545. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  546. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  547. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  548. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  549. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  550. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  551. package/dist/features/experimental_table/server/index.d.ts +0 -3
  552. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  553. package/dist/features/experimental_table/server/index.js.map +0 -1
  554. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  555. package/dist/features/experimental_table/server/schema.js.map +0 -1
  556. package/dist/features/link/markdownTransformer.spec.js +0 -195
  557. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  558. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  559. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  560. package/dist/lexical/utils/url.spec.js +0 -114
  561. package/dist/lexical/utils/url.spec.js.map +0 -1
  562. package/dist/utilities/jsx/jsx.spec.js +0 -178
  563. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  564. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
  565. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  566. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  567. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  568. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  569. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  570. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  571. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  572. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  573. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  574. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  575. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  576. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  577. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  578. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  579. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  580. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  581. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  582. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  583. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  584. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownTransformer.d.ts","sourceRoot":"","sources":["../../../src/features/table/markdownTransformer.ts"],"names":[],"mappings":"AAEA,OAAO,EAEL,KAAK,kBAAkB,EACvB,KAAK,WAAW,EACjB,MAAM,mBAAmB,CAAA;AAsB1B,eAAO,MAAM,aAAa,EAAE,CAAC,KAAK,EAAE;IAAE,eAAe,EAAE,WAAW,EAAE,CAAA;CAAE,KAAK,kBAmIzE,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"markdownTransformer.js","names":["$convertToMarkdownString","$createTableCellNode","$createTableNode","$createTableRowNode","$isTableCellNode","$isTableNode","$isTableRowNode","TableCellHeaderStates","TableCellNode","TableNode","TableRowNode","$isParagraphNode","$isTextNode","$convertFromMarkdownString","TABLE_ROW_REG_EXP","TABLE_ROW_DIVIDER_REG_EXP","PAYLOAD_TABLE","allTransformers","type","dependencies","export","node","output","row","getChildren","rowOutput","isHeaderRow","cell","push","replace","trim","__headerState","ROW","join","map","_","regExp","parentNode","_1","match","match0","test","table","getPreviousSibling","rows","lastRow","length","forEach","setHeaderStyles","remove","matchCells","mapToTableCells","sibling","maxCells","getChildrenSize","firstChild","getFirstChild","cells","getTextContent","Math","max","unshift","previousSibling","tableRow","append","i","$createTableCell","getTableColumnsSize","selectEnd","textContent","NO_STATUS","split","text"],"sources":["../../../src/features/table/markdownTransformer.ts"],"sourcesContent":["import type { LexicalNode } from 'lexical'\n\nimport {\n $convertToMarkdownString,\n type ElementTransformer,\n type Transformer,\n} from '@lexical/markdown'\nimport {\n $createTableCellNode,\n $createTableNode,\n $createTableRowNode,\n $isTableCellNode,\n $isTableNode,\n $isTableRowNode,\n TableCellHeaderStates,\n TableCellNode,\n TableNode,\n TableRowNode,\n} from '@lexical/table'\nimport { $isParagraphNode, $isTextNode } from 'lexical'\n\nimport { $convertFromMarkdownString } from '../../lexical/utils/markdown/convertFromMarkdownString.js'\n\n// Very primitive table setup\nconst TABLE_ROW_REG_EXP = /^\\|(.+)\\|\\s?$/\n// eslint-disable-next-line regexp/no-unused-capturing-group\nconst TABLE_ROW_DIVIDER_REG_EXP = /^(\\| ?:?-*:? ?)+\\|\\s?$/\n\nexport const PAYLOAD_TABLE: (props: { allTransformers: Transformer[] }) => ElementTransformer = ({\n allTransformers,\n}) => ({\n type: 'element',\n dependencies: [TableNode, TableRowNode, TableCellNode],\n export: (node: LexicalNode) => {\n if (!$isTableNode(node)) {\n return null\n }\n\n const output: string[] = []\n\n for (const row of node.getChildren()) {\n const rowOutput: string[] = []\n if (!$isTableRowNode(row)) {\n continue\n }\n\n let isHeaderRow = false\n for (const cell of row.getChildren()) {\n // It's TableCellNode, so it's just to make flow happy\n if ($isTableCellNode(cell)) {\n rowOutput.push(\n $convertToMarkdownString(allTransformers, cell).replace(/\\n/g, '\\\\n').trim(),\n )\n\n if (cell.__headerState === TableCellHeaderStates.ROW) {\n isHeaderRow = true\n }\n }\n }\n\n output.push(`| ${rowOutput.join(' | ')} |`)\n if (isHeaderRow) {\n output.push(`| ${rowOutput.map((_) => '---').join(' | ')} |`)\n }\n }\n\n return output.join('\\n')\n },\n regExp: TABLE_ROW_REG_EXP,\n replace: (parentNode, _1, match) => {\n const match0 = match[0]\n if (!match0) {\n return\n }\n // Header row\n if (TABLE_ROW_DIVIDER_REG_EXP.test(match0)) {\n const table = parentNode.getPreviousSibling()\n if (!table || !$isTableNode(table)) {\n return\n }\n\n const rows = table.getChildren()\n const lastRow = rows[rows.length - 1]\n if (!lastRow || !$isTableRowNode(lastRow)) {\n return\n }\n\n // Add header state to row cells\n lastRow.getChildren().forEach((cell) => {\n if (!$isTableCellNode(cell)) {\n return\n }\n cell.setHeaderStyles(TableCellHeaderStates.ROW, TableCellHeaderStates.ROW)\n })\n\n // Remove line\n parentNode.remove()\n return\n }\n\n const matchCells = mapToTableCells(match0, allTransformers)\n\n if (matchCells == null) {\n return\n }\n\n const rows = [matchCells]\n let sibling = parentNode.getPreviousSibling()\n let maxCells = matchCells.length\n\n while (sibling) {\n if (!$isParagraphNode(sibling)) {\n break\n }\n\n if (sibling.getChildrenSize() !== 1) {\n break\n }\n\n const firstChild = sibling.getFirstChild()\n\n if (!$isTextNode(firstChild)) {\n break\n }\n\n const cells = mapToTableCells(firstChild.getTextContent(), allTransformers)\n\n if (cells == null) {\n break\n }\n\n maxCells = Math.max(maxCells, cells.length)\n rows.unshift(cells)\n const previousSibling = sibling.getPreviousSibling()\n sibling.remove()\n sibling = previousSibling\n }\n\n const table = $createTableNode()\n\n for (const cells of rows) {\n const tableRow = $createTableRowNode()\n table.append(tableRow)\n\n for (let i = 0; i < maxCells; i++) {\n tableRow.append(i < cells.length ? cells[i]! : $createTableCell('', allTransformers))\n }\n }\n\n const previousSibling = parentNode.getPreviousSibling()\n if ($isTableNode(previousSibling) && getTableColumnsSize(previousSibling) === maxCells) {\n previousSibling.append(...table.getChildren())\n parentNode.remove()\n } else {\n parentNode.replace(table)\n }\n\n table.selectEnd()\n },\n})\n\nfunction getTableColumnsSize(table: TableNode) {\n const row = table.getFirstChild()\n return $isTableRowNode(row) ? row.getChildrenSize() : 0\n}\n\nconst $createTableCell = (textContent: string, allTransformers: Transformer[]): TableCellNode => {\n textContent = textContent.replace(/\\\\n/g, '\\n')\n const cell = $createTableCellNode(TableCellHeaderStates.NO_STATUS)\n // shouldMergeAdjacentLines is true to preserve how cell content was parsed\n // before the exported $convertFromMarkdownString default changed to false.\n $convertFromMarkdownString(textContent, allTransformers, cell, false, true)\n return cell\n}\n\nconst mapToTableCells = (\n textContent: string,\n allTransformers: Transformer[],\n): Array<TableCellNode> | null => {\n const match = textContent.match(TABLE_ROW_REG_EXP)\n if (!match || !match[1]) {\n return null\n }\n return match[1].split('|').map((text) => $createTableCell(text, allTransformers))\n}\n"],"mappings":"AAEA,SACEA,wBAAwB,QAGnB;AACP,SACEC,oBAAoB,EACpBC,gBAAgB,EAChBC,mBAAmB,EACnBC,gBAAgB,EAChBC,YAAY,EACZC,eAAe,EACfC,qBAAqB,EACrBC,aAAa,EACbC,SAAS,EACTC,YAAY,QACP;AACP,SAASC,gBAAgB,EAAEC,WAAW,QAAQ;AAE9C,SAASC,0BAA0B,QAAQ;AAE3C;AACA,MAAMC,iBAAA,GAAoB;AAC1B;AACA,MAAMC,yBAAA,GAA4B;AAElC,OAAO,MAAMC,aAAA,GAAmFA,CAAC;EAC/FC;AAAe,CAChB,MAAM;EACLC,IAAA,EAAM;EACNC,YAAA,EAAc,CAACV,SAAA,EAAWC,YAAA,EAAcF,aAAA,CAAc;EACtDY,MAAA,EAASC,IAAA;IACP,IAAI,CAAChB,YAAA,CAAagB,IAAA,GAAO;MACvB,OAAO;IACT;IAEA,MAAMC,MAAA,GAAmB,EAAE;IAE3B,KAAK,MAAMC,GAAA,IAAOF,IAAA,CAAKG,WAAW,IAAI;MACpC,MAAMC,SAAA,GAAsB,EAAE;MAC9B,IAAI,CAACnB,eAAA,CAAgBiB,GAAA,GAAM;QACzB;MACF;MAEA,IAAIG,WAAA,GAAc;MAClB,KAAK,MAAMC,IAAA,IAAQJ,GAAA,CAAIC,WAAW,IAAI;QACpC;QACA,IAAIpB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 export declare const TableFeature: import("../../typesServer.js").FeatureProviderProviderServer<undefined, undefined, undefined>;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/table/server/index.ts"],"names":[],"mappings":"AAUA,YAAY,EACV,uBAAuB,EACvB,mBAAmB,EACnB,sBAAsB,GACvB,MAAM,aAAa,CAAA;AAiBpB,eAAO,MAAM,YAAY,+FAwCvB,CAAA"}
@@ -15,14 +15,14 @@ const fields = [{
15
15
  defaultValue: 5,
16
16
  required: true
17
17
  }];
18
- export const EXPERIMENTAL_TableFeature = createServerFeature({
19
- feature: async ({
18
+ export const TableFeature = createServerFeature({
19
+ feature: ({
20
20
  config,
21
21
  isRoot,
22
22
  parentIsLocalized
23
23
  }) => {
24
24
  const validRelationships = config.collections.map(c => c.slug) || [];
25
- const sanitizedFields = await sanitizeFields({
25
+ const sanitizedFields = sanitizeFields({
26
26
  config: config,
27
27
  fields,
28
28
  parentIsLocalized,
@@ -51,6 +51,6 @@ export const EXPERIMENTAL_TableFeature = createServerFeature({
51
51
  })]
52
52
  };
53
53
  },
54
- key: 'experimental_table'
54
+ key: 'table'
55
55
  });
56
56
  //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":["TableCellNode","TableNode","TableRowNode","sanitizeFields","createServerFeature","createNode","PAYLOAD_TABLE","tableCellNodeJSONSchema","tableNodeJSONSchema","tableRowNodeJSONSchema","fields","name","type","defaultValue","required","TableFeature","feature","config","isRoot","parentIsLocalized","validRelationships","collections","map","c","slug","sanitizedFields","requireFieldLevelRichTextEditor","ClientFeature","generateSchemaMap","schemaMap","Map","set","markdownTransformers","nodes","jsonSchema","node","key"],"sources":["../../../../src/features/table/server/index.ts"],"sourcesContent":["import type { Config, Field, FieldSchemaMap } from 'payload'\n\nimport { TableCellNode, TableNode, TableRowNode } from '@lexical/table'\nimport { sanitizeFields } from 'payload'\n\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { PAYLOAD_TABLE } from '../markdownTransformer.js'\nimport { tableCellNodeJSONSchema, tableNodeJSONSchema, tableRowNodeJSONSchema } from './schema.js'\n\nexport type {\n SerializedTableCellNode,\n SerializedTableNode,\n SerializedTableRowNode,\n} from './schema.js'\n\nconst fields: Field[] = [\n {\n name: 'rows',\n type: 'number',\n defaultValue: 5,\n required: true,\n },\n {\n name: 'columns',\n type: 'number',\n defaultValue: 5,\n required: true,\n },\n]\n\nexport const TableFeature = createServerFeature({\n feature: ({ config, isRoot, parentIsLocalized }) => {\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n const sanitizedFields = sanitizeFields({\n config: config as unknown as Config,\n fields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#TableFeatureClient',\n generateSchemaMap: () => {\n const schemaMap: FieldSchemaMap = new Map()\n\n schemaMap.set('fields', {\n fields: sanitizedFields,\n })\n\n return schemaMap\n },\n markdownTransformers: [PAYLOAD_TABLE],\n nodes: [\n createNode({\n jsonSchema: tableNodeJSONSchema,\n node: TableNode,\n }),\n createNode({\n jsonSchema: tableCellNodeJSONSchema,\n node: TableCellNode,\n }),\n createNode({\n jsonSchema: tableRowNodeJSONSchema,\n node: TableRowNode,\n }),\n ],\n }\n },\n key: 'table',\n})\n"],"mappings":"AAEA,SAASA,aAAa,EAAEC,SAAS,EAAEC,YAAY,QAAQ;AACvD,SAASC,cAAc,QAAQ;AAE/B,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,aAAa,QAAQ;AAC9B,SAASC,uBAAuB,EAAEC,mBAAmB,EAAEC,sBAAsB,QAAQ;AAQrF,MAAMC,MAAA,GAAkB,CACtB;EACEC,IAAA,EAAM;EACNC,IAAA,EAAM;EACNC,YAAA,EAAc;EACdC,QAAA,EAAU;AACZ,GACA;EACEH,IAAA,EAAM;EACNC,IAAA,EAAM;EACNC,YAAA,EAAc;EACdC,QAAA,EAAU;AACZ,EACD;AAED,OAAO,MAAMC,YAAA,GAAeX,mBAAA,CAAoB;EAC9CY,OAAA,EAASA,CAAC;IAAEC,MAAM;IAAEC,MAAM;IAAEC;EAAiB,CAAE;IAC7C,MAAMC,kBAAA,GAAqBH,MAAA,CAAOI,WAAW,CAACC,GAAG,CAAEC,CAAA,IAAMA,CAAA,CAAEC,IAAI,KAAK,EAAE;IAEtE,MAAMC,eAAA,GAAkBtB,cAAA,CAAe;MACrCc,MAAA,EAAQA,MAAA;MACRP,MAAA;MACAS,iBAAA;MACAO,+BAAA,EAAiCR,MAAA;MACjCE;IACF;IACA,OAAO;MACLO,aAAA,EAAe;MACfC,iBAAA,EAAmBA,CAAA;QACjB,MAAMC,SAAA,GAA4B,IAAIC,GAAA;QAEtCD,SAAA,CAAUE,GAAG,CAAC,UAAU;UACtBrB,MAAA,EAAQe;QACV;QAEA,OAAOI,SAAA;MACT;MACAG,oBAAA,EAAsB,CAAC1B,aAAA,CAAc;MACrC2B,KAAA,EAAO,CACL5B,UAAA,CAAW;QACT6B,UAAA,EAAY1B,mBAAA;QACZ2B,IAAA,EAAMlC;MACR,IACAI,UAAA,CAAW;QACT6B,UAAA,EAAY3B,uBAAA;QACZ4B,IAAA,EAAMnC;MACR,IACAK,UAAA,CAAW;QACT6B,UAAA,EAAYzB,sBAAA;QACZ0B,IAAA,EAAMjC;MACR;IAEJ;EACF;EACAkC,GAAA,EAAK;AACP","ignoreList":[]}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/features/table/server/schema.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AAEpD,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6BAA6B,CAAA;AAC/E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AAExD,MAAM,WAAW,uBAAuB,CACtC,SAAS,SAAS,qBAAqB,GAAG,qBAAqB,CAC/D,SAAQ,4BAA4B,CAAC,SAAS,CAAC;IAC/C,eAAe,CAAC,EAAE,IAAI,GAAG,MAAM,CAAA;IAC/B,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,IAAI,EAAE,WAAW,CAAA;IACjB,aAAa,CAAC,EAAE,MAAM,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf;AAED,MAAM,WAAW,mBAAmB,CAClC,SAAS,SAAS,qBAAqB,GAAG,qBAAqB,CAC/D,SAAQ,4BAA4B,CAAC,SAAS,CAAC;IAC/C,SAAS,CAAC,EAAE,MAAM,EAAE,CAAA;IACpB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,OAAO,CAAA;IACrB,IAAI,EAAE,OAAO,CAAA;CACd;AAED,MAAM,WAAW,sBAAsB,CACrC,SAAS,SAAS,qBAAqB,GAAG,qBAAqB,CAC/D,SAAQ,4BAA4B,CAAC,SAAS,CAAC;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,EAAE,UAAU,CAAA;CACjB;AA2BD,eAAO,MAAM,mBAAmB,EAAE,YAgBjC,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,YAuBrC,CAAA;AAED,eAAO,MAAM,sBAAsB,EAAE,YAWpC,CAAA"}
@@ -0,0 +1 @@
1
+ {"version":3,"file":"schema.js","names":["TABLE_NODES_TS","tableNodeJSONSchema","elementNodeSchema","nodeUnionName","typeStringDefinitions","add","nodeType","properties","colWidths","type","items","frozenColumnCount","frozenRowCount","rowStriping","tsType","tableCellNodeJSONSchema","backgroundColor","oneOf","colSpan","description","headerState","rowSpan","verticalAlign","width","required","tableRowNodeJSONSchema","height"],"sources":["../../../../src/features/table/server/schema.ts"],"sourcesContent":["import type { SerializedLexicalNode } from 'lexical'\n\nimport type { SerializedLexicalElementBase } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\n\nexport interface SerializedTableCellNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n backgroundColor?: null | string\n colSpan?: number\n headerState: number\n rowSpan?: number\n type: 'tablecell'\n verticalAlign?: string\n width?: number\n}\n\nexport interface SerializedTableNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n colWidths?: number[]\n frozenColumnCount?: number\n frozenRowCount?: number\n rowStriping?: boolean\n type: 'table'\n}\n\nexport interface SerializedTableRowNode<\n TChildren extends SerializedLexicalNode = SerializedLexicalNode,\n> extends SerializedLexicalElementBase<TChildren> {\n height?: number\n type: 'tablerow'\n}\n\n/**\n * MUST stay byte-for-byte in sync with the runtime `SerializedTableNode`,\n * `SerializedTableRowNode`, and `SerializedTableCellNode` declared above.\n */\nconst TABLE_NODES_TS = `export interface SerializedTableNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'table';\n colWidths?: number[];\n frozenColumnCount?: number;\n frozenRowCount?: number;\n rowStriping?: boolean;\n}\nexport interface SerializedTableRowNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'tablerow';\n height?: number;\n}\nexport interface SerializedTableCellNode<TChildren> extends SerializedLexicalElementBase<TChildren> {\n type: 'tablecell';\n backgroundColor?: string | null;\n colSpan?: number;\n headerState: number;\n rowSpan?: number;\n verticalAlign?: string;\n width?: number;\n}`\n\nexport const tableNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(TABLE_NODES_TS)\n return elementNodeSchema({\n nodeType: 'table',\n properties: {\n colWidths: { type: 'array', items: { type: 'number' } },\n frozenColumnCount: { type: 'integer' },\n frozenRowCount: { type: 'integer' },\n rowStriping: { type: 'boolean' },\n },\n tsType: `SerializedTableNode<${nodeUnionName}>`,\n })\n}\n\nexport const tableCellNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(TABLE_NODES_TS)\n return elementNodeSchema({\n nodeType: 'tablecell',\n properties: {\n backgroundColor: { oneOf: [{ type: 'string' }, { type: 'null' }] },\n colSpan: { type: 'integer', description: 'How many columns this cell spans (default 1).' },\n headerState: {\n type: 'integer',\n description:\n 'Header bitmask: 0 = normal cell, 1 = row header, 2 = column header, 3 = both.',\n },\n rowSpan: { type: 'integer', description: 'How many rows this cell spans (default 1).' },\n verticalAlign: { type: 'string' },\n width: { type: 'integer' },\n },\n required: ['headerState'],\n tsType: `SerializedTableCellNode<${nodeUnionName}>`,\n })\n}\n\nexport const tableRowNodeJSONSchema: JSONSchemaFn = ({\n elementNodeSchema,\n nodeUnionName,\n typeStringDefinitions,\n}) => {\n typeStringDefinitions.add(TABLE_NODES_TS)\n return elementNodeSchema({\n nodeType: 'tablerow',\n properties: { height: { type: 'integer' } },\n tsType: `SerializedTableRowNode<${nodeUnionName}>`,\n })\n}\n"],"mappings":"AAkCA;;;GAIA,MAAMA,cAAA,GAAiB;;;;;;;;;;;;;;;;;;;EAmBrB;AAEF,OAAO,MAAMC,mBAAA,GAAoCA,CAAC;EAChDC,iBAAiB;EACjBC,aAAa;EACbC;AAAqB,CACtB;EACCA,qBAAA,CAAsBC,GAAG,CAACL,cAAA;EAC1B,OAAOE,iBAAA,CAAkB;IACvBI,QAAA,EAAU;IACVC,UAAA,EAAY;MACVC,SAAA,EAAW;QAAEC,IAAA,EAAM;QAASC,KAAA,EAAO;UAAED,IAAA,EAAM;QAAS;MAAE;MACtDE,iBAAA,EAAmB;QAAEF,IAAA,EAAM;MAAU;MACrCG,cAAA,EAAgB;QAAEH,IAAA,EAAM;MAAU;MAClCI,WAAA,EAAa;QAAEJ,IAAA,EAAM;MAAU;IACjC;IACAK,MAAA,EAAQ,uBAAuBX,aAAA;EACjC;AACF;AAEA,OAAO,MAAMY,uBAAA,GAAwCA,CAAC;EACpDb,iBAAiB;EACjBC,aAAa;EACbC;AAAqB,CACtB;EACCA,qBAAA,CAAsBC,GAAG,CAACL,cAAA;EAC1B,OAAOE,iBAAA,CAAkB;IACvBI,QAAA,EAAU;IACVC,UAAA,EAAY;MACVS,eAAA,EAAiB;QAAEC,KAAA,EAAO,CAAC;UAAER,IAAA,EAAM;QAAS,GAAG;UAAEA,IAAA,EAAM;QAAO;MAAG;MACjES,OAAA,EAAS;QAAET,IAAA,EAAM;QAAWU,WAAA,EAAa;MAAgD;MACzFC,WAAA,EAAa;QACXX,IAAA,EAAM;QACNU,WAAA,EACE;MACJ;MACAE,OAAA,EAAS;QAAEZ,IAAA,EAAM;QAAWU,WAAA,EAAa;MAA6C;MACtFG,aAAA,EAAe;QAAEb,IAAA,EAAM;MAAS;MAChCc,KAAA,EAAO;QAAEd,IAAA,EAAM;MAAU;IAC3B;IACAe,QAAA,EAAU,CAAC,cAAc;IACzBV,MAAA,EAAQ,2BAA2BX,aAAA;EACrC;AACF;AAEA,OAAO,MAAMsB,sBAAA,GAAuCA,CAAC;EACnDvB,iBAAiB;EACjBC,aAAa;EACbC;AAAqB,CACtB;EACCA,qBAAA,CAAsBC,GAAG,CAACL,cAAA;EAC1B,OAAOE,iBAAA,CAAkB;IACvBI,QAAA,EAAU;IACVC,UAAA,EAAY;MAAEmB,MAAA,EAAQ;QAAEjB,IAAA,EAAM;MAAU;IAAE;IAC1CK,MAAA,EAAQ,0BAA0BX,aAAA;EACpC;AACF","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ export declare function getHorizontalScrollDelta({ clientWidth, deltaMode, deltaY, isRightToLeft, }: {
2
+ clientWidth: number;
3
+ deltaMode: number;
4
+ deltaY: number;
5
+ isRightToLeft: boolean;
6
+ }): number;
7
+ export declare function useRedirectVerticalWheelToHorizontalScroll(): void;
8
+ //# sourceMappingURL=horizontalWheelScroll.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"horizontalWheelScroll.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.ts"],"names":[],"mappings":"AASA,wBAAgB,wBAAwB,CAAC,EACvC,WAAW,EACX,SAAS,EACT,MAAM,EACN,aAAa,GACd,EAAE;IACD,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE,MAAM,CAAA;IACd,aAAa,EAAE,OAAO,CAAA;CACvB,GAAG,MAAM,CAOT;AA0CD,wBAAgB,0CAA0C,IAAI,IAAI,CAgBjE"}
@@ -0,0 +1,80 @@
1
+ 'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
4
+ import { useEffect } from 'react';
5
+ const scrollContainerSelector = '.fixed-toolbar__scroll';
6
+ // A single notch on a classic (non-trackpad) wheel mouse reports deltaMode 1 with a
7
+ // deltaY of only 1-3, so it must be scaled up to a pixel value that actually moves the scroll.
8
+ const PIXELS_PER_LINE = 40;
9
+ export function getHorizontalScrollDelta({
10
+ clientWidth,
11
+ deltaMode,
12
+ deltaY,
13
+ isRightToLeft
14
+ }) {
15
+ const deltaInPixels = deltaMode === 1 ? deltaY * PIXELS_PER_LINE : deltaMode === 2 ? deltaY * clientWidth : deltaY;
16
+ // scrollLeft moves toward the inline-start edge for a given positive delta in RTL,
17
+ // the opposite of LTR, so the delta must be negated to keep the scroll direction consistent.
18
+ return isRightToLeft ? -deltaInPixels : deltaInPixels;
19
+ }
20
+ function redirectVerticalWheelToHorizontalScroll(event) {
21
+ const isPrimarilyVerticalWheelInput = Math.abs(event.deltaY) > Math.abs(event.deltaX);
22
+ if (!isPrimarilyVerticalWheelInput) {
23
+ return;
24
+ }
25
+ const target = event.target;
26
+ if (!(target instanceof Element)) {
27
+ return;
28
+ }
29
+ const scrollContainer = target.closest(scrollContainerSelector);
30
+ if (!scrollContainer) {
31
+ return;
32
+ }
33
+ const canScrollHorizontally = scrollContainer.scrollWidth > scrollContainer.clientWidth;
34
+ if (!canScrollHorizontally) {
35
+ return;
36
+ }
37
+ event.preventDefault();
38
+ scrollContainer.scrollLeft += getHorizontalScrollDelta({
39
+ clientWidth: scrollContainer.clientWidth,
40
+ deltaMode: event.deltaMode,
41
+ deltaY: event.deltaY,
42
+ isRightToLeft: getComputedStyle(scrollContainer).direction === 'rtl'
43
+ });
44
+ }
45
+ // A single page can render many fixed toolbars at once (e.g. rich text nested several
46
+ // layers deep inside blocks), so this listener is delegated to `document` and shared
47
+ // across every toolbar instance instead of being attached per instance. A wheel listener
48
+ // that can call preventDefault() must be non-passive, and non-passive listeners make the
49
+ // browser treat their element as a "non-fast-scrollable region" that every scroll gesture
50
+ // on the page has to be checked against, even ones nowhere near it. Attaching one instance
51
+ // per toolbar would multiply that bookkeeping by however many toolbars happen to be on the
52
+ // page; a single delegated listener keeps that cost constant no matter how many there are.
53
+ let toolbarsListeningForWheelEvents = 0;
54
+ export function useRedirectVerticalWheelToHorizontalScroll() {
55
+ const $ = _c(1);
56
+ let t0;
57
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
58
+ t0 = [];
59
+ $[0] = t0;
60
+ } else {
61
+ t0 = $[0];
62
+ }
63
+ useEffect(_temp2, t0);
64
+ }
65
+ function _temp2() {
66
+ if (toolbarsListeningForWheelEvents === 0) {
67
+ document.addEventListener("wheel", redirectVerticalWheelToHorizontalScroll, {
68
+ passive: false
69
+ });
70
+ }
71
+ toolbarsListeningForWheelEvents = toolbarsListeningForWheelEvents + 1;
72
+ return _temp;
73
+ }
74
+ function _temp() {
75
+ toolbarsListeningForWheelEvents = toolbarsListeningForWheelEvents - 1;
76
+ if (toolbarsListeningForWheelEvents === 0) {
77
+ document.removeEventListener("wheel", redirectVerticalWheelToHorizontalScroll);
78
+ }
79
+ }
80
+ //# sourceMappingURL=horizontalWheelScroll.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"horizontalWheelScroll.js","names":["c","_c","useEffect","scrollContainerSelector","PIXELS_PER_LINE","getHorizontalScrollDelta","clientWidth","deltaMode","deltaY","isRightToLeft","deltaInPixels","redirectVerticalWheelToHorizontalScroll","event","isPrimarilyVerticalWheelInput","Math","abs","deltaX","target","Element","scrollContainer","closest","canScrollHorizontally","scrollWidth","preventDefault","scrollLeft","getComputedStyle","direction","toolbarsListeningForWheelEvents","useRedirectVerticalWheelToHorizontalScroll","$","t0","Symbol","for","_temp2","document","addEventListener","passive","_temp","removeEventListener"],"sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.ts"],"sourcesContent":["'use client'\nimport { useEffect } from 'react'\n\nconst scrollContainerSelector = '.fixed-toolbar__scroll'\n\n// A single notch on a classic (non-trackpad) wheel mouse reports deltaMode 1 with a\n// deltaY of only 1-3, so it must be scaled up to a pixel value that actually moves the scroll.\nconst PIXELS_PER_LINE = 40\n\nexport function getHorizontalScrollDelta({\n clientWidth,\n deltaMode,\n deltaY,\n isRightToLeft,\n}: {\n clientWidth: number\n deltaMode: number\n deltaY: number\n isRightToLeft: boolean\n}): number {\n const deltaInPixels =\n deltaMode === 1 ? deltaY * PIXELS_PER_LINE : deltaMode === 2 ? deltaY * clientWidth : deltaY\n\n // scrollLeft moves toward the inline-start edge for a given positive delta in RTL,\n // the opposite of LTR, so the delta must be negated to keep the scroll direction consistent.\n return isRightToLeft ? -deltaInPixels : deltaInPixels\n}\n\nfunction redirectVerticalWheelToHorizontalScroll(event: WheelEvent): void {\n const isPrimarilyVerticalWheelInput = Math.abs(event.deltaY) > Math.abs(event.deltaX)\n if (!isPrimarilyVerticalWheelInput) {\n return\n }\n\n const target = event.target\n if (!(target instanceof Element)) {\n return\n }\n\n const scrollContainer = target.closest<HTMLElement>(scrollContainerSelector)\n if (!scrollContainer) {\n return\n }\n\n const canScrollHorizontally = scrollContainer.scrollWidth > scrollContainer.clientWidth\n if (!canScrollHorizontally) {\n return\n }\n\n event.preventDefault()\n scrollContainer.scrollLeft += getHorizontalScrollDelta({\n clientWidth: scrollContainer.clientWidth,\n deltaMode: event.deltaMode,\n deltaY: event.deltaY,\n isRightToLeft: getComputedStyle(scrollContainer).direction === 'rtl',\n })\n}\n\n// A single page can render many fixed toolbars at once (e.g. rich text nested several\n// layers deep inside blocks), so this listener is delegated to `document` and shared\n// across every toolbar instance instead of being attached per instance. A wheel listener\n// that can call preventDefault() must be non-passive, and non-passive listeners make the\n// browser treat their element as a \"non-fast-scrollable region\" that every scroll gesture\n// on the page has to be checked against, even ones nowhere near it. Attaching one instance\n// per toolbar would multiply that bookkeeping by however many toolbars happen to be on the\n// page; a single delegated listener keeps that cost constant no matter how many there are.\nlet toolbarsListeningForWheelEvents = 0\n\nexport function useRedirectVerticalWheelToHorizontalScroll(): void {\n useEffect(() => {\n if (toolbarsListeningForWheelEvents === 0) {\n document.addEventListener('wheel', redirectVerticalWheelToHorizontalScroll, {\n passive: false,\n })\n }\n toolbarsListeningForWheelEvents += 1\n\n return () => {\n toolbarsListeningForWheelEvents -= 1\n if (toolbarsListeningForWheelEvents === 0) {\n document.removeEventListener('wheel', redirectVerticalWheelToHorizontalScroll)\n }\n }\n }, [])\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;AACA,SAASC,SAAS,QAAQ;AAE1B,MAAMC,uBAAA,GAA0B;AAEhC;AACA;AACA,MAAMC,eAAA,GAAkB;AAExB,OAAO,SAASC,yBAAyB;EACvCC,WAAW;EACXC,SAAS;EACTC,MAAM;EACNC;AAAa,CAMd;EACC,MAAMC,aAAA,GACJH,SAAA,KAAc,IAAIC,MAAA,GAASJ,eAAA,GAAkBG,SAAA,KAAc,IAAIC,MAAA,GAASF,WAAA,GAAcE,MAAA;EAExF;EACA;EACA,OAAOC,aAAA,GAAgB,CAACC,aAAA,GAAgBA,aAAA;AAC1C;AAEA,SAASC,wCAAwCC,KA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BAAA,GAEFA,+BAAA,IAAmC;EAAA,OAAAU,KAAA;AAAA;AAPhC,SAAAA,MAAA;EAAAV,+BAAA,GAUDA,+BAAA,IAAmC;EAAA,IAC/BA,+BAAA,MAAoC;IACtCO,QAAA,CAAAI,mBAAA,CAA6B,SAAA3B,uCAAS;EAAA;AAAA","ignoreList":[]}
@@ -1,3 +1,37 @@
1
+ @property --fixed-toolbar-fade-start {
2
+ syntax: '<length>';
3
+ inherits: false;
4
+ initial-value: 0px;
5
+ }
6
+
7
+ @property --fixed-toolbar-fade-end {
8
+ syntax: '<length>';
9
+ inherits: false;
10
+ initial-value: 0px;
11
+ }
12
+
13
+ /*
14
+ * Drives the fade widths off the toolbar's own scroll position: fully opaque at rest,
15
+ * fading in on whichever edge still has scrolled-off content once it overflows.
16
+ * Unsupported browsers (no animation-timeline) simply keep the initial 0px fade, i.e. no fade at all.
17
+ */
18
+ @keyframes fixed-toolbar-scroll-fade {
19
+ 0% {
20
+ --fixed-toolbar-fade-start: 0px;
21
+ }
22
+ 10%,
23
+ 100% {
24
+ --fixed-toolbar-fade-start: var(--spacer-5);
25
+ }
26
+ 0%,
27
+ 90% {
28
+ --fixed-toolbar-fade-end: var(--spacer-5);
29
+ }
30
+ 100% {
31
+ --fixed-toolbar-fade-end: 0px;
32
+ }
33
+ }
34
+
1
35
  @layer payload-default {
2
36
  .fixed-toolbar.fixed-toolbar--hide {
3
37
  visibility: hidden;
@@ -7,10 +41,8 @@
7
41
 
8
42
  .fixed-toolbar {
9
43
  display: flex;
10
- flex-wrap: wrap;
11
44
  align-items: center;
12
45
  padding: 0 var(--spacer-2);
13
- gap: var(--spacer-2);
14
46
  vertical-align: middle;
15
47
  position: sticky;
16
48
  z-index: 2;
@@ -46,24 +78,64 @@
46
78
  border-radius: 0 0 var(--radius-medium) var(--radius-medium) !important;
47
79
 
48
80
  > .editor-scroller > .editor {
81
+ --content-editable-padding-block-start: var(--spacer-2);
82
+
49
83
  > .ContentEditable__root {
50
84
  padding-top: var(--spacer-2);
51
85
  }
52
86
  }
87
+ }
88
+ }
53
89
 
54
- > .editor-scroller > .editor > div > .LexicalEditorTheme__placeholder {
55
- top: var(--spacer-4);
56
- }
90
+ .fixed-toolbar__scroll {
91
+ display: flex;
92
+ flex: 1 1 auto;
93
+ flex-wrap: nowrap;
94
+ align-items: center;
95
+ gap: var(--spacer-2);
96
+ min-width: 0;
97
+ overflow-x: auto;
98
+ scrollbar-width: none;
99
+ -ms-overflow-style: none;
100
+ position: relative;
101
+ z-index: 1;
102
+ animation: fixed-toolbar-scroll-fade linear;
103
+ animation-timeline: scroll(self inline);
104
+ mask: linear-gradient(
105
+ to right,
106
+ transparent,
107
+ black var(--fixed-toolbar-fade-start),
108
+ black calc(100% - var(--fixed-toolbar-fade-end)),
109
+ transparent
110
+ );
111
+
112
+ &::-webkit-scrollbar {
113
+ display: none;
57
114
  }
58
115
  }
59
116
 
117
+ [dir='rtl'] .fixed-toolbar__scroll {
118
+ mask: linear-gradient(
119
+ to left,
120
+ transparent,
121
+ black var(--fixed-toolbar-fade-start),
122
+ black calc(100% - var(--fixed-toolbar-fade-end)),
123
+ transparent
124
+ );
125
+ }
126
+
60
127
  .fixed-toolbar__group {
61
128
  display: flex;
62
- flex-wrap: wrap;
129
+ flex-wrap: nowrap;
63
130
  align-items: center;
64
131
  gap: var(--spacer-2);
65
132
  align-self: stretch;
66
133
  z-index: 1;
134
+ flex-shrink: 0;
135
+
136
+ > * {
137
+ flex-shrink: 0;
138
+ }
67
139
 
68
140
  .divider {
69
141
  width: var(--stroke-width-small);
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAMrE,OAAO,aAAa,CAAA;AA2PpB,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,wBAAwB,CAuCxE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,4BAA4B,CAAA;AAGjE,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAA;AAQrE,OAAO,aAAa,CAAA;AAuQpB,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,wBAAwB,CAuCxE,CAAA"}
@@ -4,13 +4,16 @@ import { c as _c } from "react/compiler-runtime";
4
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
6
6
  import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
7
+ import { getTranslation } from '@payloadcms/translations';
7
8
  import { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui';
8
9
  import * as React from 'react';
9
10
  import { useMemo } from 'react';
10
11
  import { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js';
11
12
  import { ToolbarButton } from '../../../shared/ToolbarButton/index.js';
12
13
  import { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js';
14
+ import { useToolbarKeyboardNavigation } from '../../../shared/useToolbarKeyboardNavigation.js';
13
15
  import { useToolbarStates } from '../../../shared/useToolbarStates.js';
16
+ import { useRedirectVerticalWheelToHorizontalScroll } from './horizontalWheelScroll.js';
14
17
  import './index.css';
15
18
  function ButtonGroupItem({
16
19
  active,
@@ -125,10 +128,21 @@ function FixedToolbar({
125
128
  parentWithFixedToolbar
126
129
  }) {
127
130
  const currentToolbarRef = React.useRef(null);
131
+ const keyboardNavigationOptions = useMemo(() => ({
132
+ toolbarRef: currentToolbarRef
133
+ }), []);
134
+ const {
135
+ fieldProps
136
+ } = useEditorConfigContext();
137
+ const {
138
+ i18n
139
+ } = useTranslation();
140
+ useToolbarKeyboardNavigation(keyboardNavigationOptions);
128
141
  const isEditable = useLexicalEditable();
129
142
  const {
130
143
  y
131
144
  } = useScrollInfo();
145
+ useRedirectVerticalWheelToHorizontalScroll();
132
146
  const toolbarStates = useToolbarStates(editor, editorConfig?.features?.toolbarFixed?.groups);
133
147
  // Memoize the parent toolbar element
134
148
  const parentToolbarElem = useMemo(() => {
@@ -174,6 +188,7 @@ function FixedToolbar({
174
188
  }
175
189
  }, 50, [currentToolbarRef, parentToolbarElem, y]);
176
190
  return /*#__PURE__*/_jsx("div", {
191
+ "aria-label": getTranslation(fieldProps.field.label || fieldProps.path, i18n) || fieldProps.path,
177
192
  className: "fixed-toolbar",
178
193
  onFocus: event => {
179
194
  // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,
@@ -181,7 +196,10 @@ function FixedToolbar({
181
196
  event.stopPropagation();
182
197
  },
183
198
  ref: currentToolbarRef,
184
- children: isEditable && /*#__PURE__*/_jsx(React.Fragment, {
199
+ role: "toolbar",
200
+ children: isEditable && /*#__PURE__*/_jsx("div", {
201
+ className: "fixed-toolbar__scroll",
202
+ tabIndex: -1,
185
203
  children: editorConfig?.features && editorConfig.features?.toolbarFixed?.groups.map((group, i) => {
186
204
  return /*#__PURE__*/_jsx(ToolbarGroupComponent, {
187
205
  anchorElem: anchorElem,
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useLexicalEditable","useScrollInfo","useThrottledEffect","useTranslation","React","useMemo","useEditorConfigContext","ToolbarButton","ToolbarDropdown","useToolbarStates","ButtonGroupItem","active","anchorElem","editor","enabled","item","Component","_jsx","key","ChildComponent","ToolbarGroupComponent","editorConfig","group","index","toolbarStates","i18n","fieldProps","featureClientSchemaMap","schemaPath","groupState","groupStates","get","DropdownIcon","type","undefined","activeItem","activeItems","dropdownLabel","length","t","count","label","substring","_jsxs","className","items","Icon","itemsContainerClassNames","map","itemState","itemStates","features","toolbarFixed","groups","FixedToolbar","clientProps","parentWithFixedToolbar","currentToolbarRef","useRef","isEditable","y","parentToolbarElem","disableIfParentHasFixedToolbar","parentEditorElem","editorContainerRef","current","sibling","previousElementSibling","classList","contains","currentToolbarElem","currentRect","getBoundingClientRect","parentRect","overlapping","bottom","top","remove","add","onFocus","event","stopPropagation","ref","Fragment","i","getParentEditorWithFixedToolbar","editorConfigContext","parentEditor","resolvedFeatureMap","has","FixedToolbarPlugin","t0","$","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor","t1","t2","Symbol","for","bb0","document","body"],"sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { EditorConfigContextType } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport type { SanitizedClientEditorConfig } from '../../../../../lexical/config/types.js'\nimport type { PluginComponent } from '../../../../typesClient.js'\nimport type { ToolbarStates } from '../../../shared/useToolbarStates.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../../types.js'\nimport type { FixedToolbarFeatureProps } from '../../server/index.js'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { ToolbarButton } from '../../../shared/ToolbarButton/index.js'\nimport { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js'\nimport { useToolbarStates } from '../../../shared/useToolbarStates.js'\nimport './index.css'\n\nfunction ButtonGroupItem({\n active,\n anchorElem,\n editor,\n enabled,\n item,\n}: {\n active: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled: boolean\n item: ToolbarGroupItem\n}): React.ReactNode {\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n )\n }\n\n if (!item.ChildComponent) {\n return null\n }\n\n return (\n <ToolbarButton active={active} editor={editor} enabled={enabled} item={item} key={item.key}>\n <item.ChildComponent />\n </ToolbarButton>\n )\n}\n\nfunction ToolbarGroupComponent({\n anchorElem,\n editor,\n editorConfig,\n group,\n index,\n toolbarStates,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n group: ToolbarGroup\n index: number\n toolbarStates: ToolbarStates\n}): React.ReactNode {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n\n const groupState = toolbarStates.groupStates.get(group.key)\n\n const DropdownIcon = useMemo(() => {\n if (group.type !== 'dropdown') {\n return undefined\n }\n const activeItem = groupState?.activeItems?.[0]\n if (activeItem) {\n return activeItem.ChildComponent\n }\n return group.ChildComponent\n }, [group, groupState?.activeItems])\n\n const dropdownLabel = useMemo(() => {\n if (group.type !== 'dropdown') {\n return undefined\n }\n const activeItems = groupState?.activeItems\n if (!activeItems?.length) {\n return undefined\n }\n if (activeItems.length > 1) {\n return i18n.t('lexical:general:toolbarItemsActive', { count: activeItems.length })\n }\n const item = activeItems[0]!\n let label = item.key\n if (item.label) {\n label =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n if (label.length > 25) {\n label = label.substring(0, 25) + '...'\n }\n return label\n }, [group, groupState?.activeItems, i18n, featureClientSchemaMap, schemaPath])\n\n return (\n <div\n className={`fixed-toolbar__group fixed-toolbar__group-${group.key}`}\n data-toolbar-group-key={group.key}\n key={group.key}\n >\n {group.type === 'dropdown' && group.items.length && groupState ? (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n groupState={groupState}\n Icon={DropdownIcon}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n />\n ) : null}\n {group.type === 'buttons' && group.items.length\n ? group.items.map((item) => {\n const itemState = toolbarStates.itemStates.get(item.key)\n return (\n <ButtonGroupItem\n active={itemState?.active ?? false}\n anchorElem={anchorElem}\n editor={editor}\n enabled={itemState?.enabled ?? true}\n item={item}\n key={item.key}\n />\n )\n })\n : null}\n {index < editorConfig.features.toolbarFixed?.groups.length - 1 && <div className=\"divider\" />}\n </div>\n )\n}\n\nfunction FixedToolbar({\n anchorElem,\n clientProps,\n editor,\n editorConfig,\n parentWithFixedToolbar,\n}: {\n anchorElem: HTMLElement\n clientProps?: FixedToolbarFeatureProps\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n parentWithFixedToolbar: EditorConfigContextType | false\n}): React.ReactNode {\n const currentToolbarRef = React.useRef<HTMLDivElement>(null)\n const isEditable = useLexicalEditable()\n\n const { y } = useScrollInfo()\n\n const toolbarStates = useToolbarStates(editor, editorConfig?.features?.toolbarFixed?.groups)\n\n // Memoize the parent toolbar element\n const parentToolbarElem = useMemo(() => {\n if (!parentWithFixedToolbar || clientProps?.disableIfParentHasFixedToolbar) {\n return null\n }\n\n const parentEditorElem = parentWithFixedToolbar.editorContainerRef.current\n let sibling = parentEditorElem.previousElementSibling\n while (sibling) {\n if (sibling.classList.contains('fixed-toolbar')) {\n return sibling\n }\n sibling = sibling.previousElementSibling\n }\n return null\n }, [clientProps?.disableIfParentHasFixedToolbar, parentWithFixedToolbar])\n\n useThrottledEffect(\n () => {\n if (!parentToolbarElem) {\n // this also checks for clientProps?.disableIfParentHasFixedToolbar indirectly, see the parentToolbarElem useMemo\n return\n }\n const currentToolbarElem = currentToolbarRef.current\n if (!currentToolbarElem) {\n return\n }\n\n const currentRect = currentToolbarElem.getBoundingClientRect()\n const parentRect = parentToolbarElem.getBoundingClientRect()\n\n // we only need to check for vertical overlap\n const overlapping = !(\n currentRect.bottom < parentRect.top || currentRect.top > parentRect.bottom\n )\n\n if (overlapping) {\n currentToolbarElem.classList.remove('fixed-toolbar')\n currentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--overlapping')\n parentToolbarElem.classList.remove('fixed-toolbar')\n parentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--hide')\n } else {\n if (!currentToolbarElem.classList.contains('fixed-toolbar--overlapping')) {\n return\n }\n currentToolbarElem.classList.remove('fixed-toolbar--overlapping')\n currentToolbarElem.classList.add('fixed-toolbar')\n parentToolbarElem.classList.remove('fixed-toolbar--hide')\n parentToolbarElem.classList.add('fixed-toolbar')\n }\n },\n 50,\n [currentToolbarRef, parentToolbarElem, y],\n )\n\n return (\n <div\n className=\"fixed-toolbar\"\n onFocus={(event) => {\n // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,\n // the parent editor will be focused, and the child editor will lose focus.\n event.stopPropagation()\n }}\n ref={currentToolbarRef}\n >\n {isEditable && (\n <React.Fragment>\n {editorConfig?.features &&\n editorConfig.features?.toolbarFixed?.groups.map((group, i) => {\n return (\n <ToolbarGroupComponent\n anchorElem={anchorElem}\n editor={editor}\n editorConfig={editorConfig}\n group={group}\n index={i}\n key={group.key}\n toolbarStates={toolbarStates}\n />\n )\n })}\n </React.Fragment>\n )}\n </div>\n )\n}\n\nconst getParentEditorWithFixedToolbar = (\n editorConfigContext: EditorConfigContextType,\n): EditorConfigContextType | false => {\n if (editorConfigContext.parentEditor?.editorConfig) {\n if (editorConfigContext.parentEditor?.editorConfig.resolvedFeatureMap.has('toolbarFixed')) {\n return editorConfigContext.parentEditor\n } else {\n if (editorConfigContext.parentEditor) {\n return getParentEditorWithFixedToolbar(editorConfigContext.parentEditor)\n }\n }\n }\n return false\n}\n\nexport const FixedToolbarPlugin: PluginComponent<FixedToolbarFeatureProps> = ({ clientProps }) => {\n const [currentEditor] = useLexicalComposerContext()\n const editorConfigContext = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n if (!isEditable) {\n return null\n }\n\n const { editorConfig: currentEditorConfig } = editorConfigContext\n\n const editor = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editor || currentEditor\n : currentEditor\n\n const editorConfig = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig\n : currentEditorConfig\n\n const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext)\n\n if (clientProps?.disableIfParentHasFixedToolbar) {\n if (parentWithFixedToolbar) {\n return null\n }\n }\n\n if (!editorConfig?.features?.toolbarFixed?.groups?.length) {\n return null\n }\n\n return (\n <FixedToolbar\n anchorElem={document.body}\n clientProps={clientProps}\n editor={editor}\n editorConfig={editorConfig}\n parentWithFixedToolbar={parentWithFixedToolbar}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,cAAc,QAAQ;AAClE,YAAYC,KAAA,MAAW;AACvB,SAASC,OAAO,QAAQ;AASxB,SAASC,sBAAsB,QAAQ;AACvC,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,gBAAgB,QAAQ;AACjC,OAAO;AAEP,SAASC,gBAAgB;EACvBC,MAAM;EACNC,UAAU;EACVC,MAAM;EACNC,OAAO;EACPC;AAAI,CAOL;EACC,IAAIA,IAAA,CAAKC,SAAS,EAAE;IAClB,OACED,IAAA,EAAMC,SAAA,iBACJC,IAAA,CAACF,IAAA,CAAKC,SAAS;MAACJ,UAAA,EAAYA,UAAA;MAAYC,MAAA,EAAQA,MAAA;MAAQE,IAAA,EAAMA;OAAWA,IAAA,CAAKG,GAAG;EAGvF;EAEA,IAAI,CAACH,IAAA,CAAKI,cAAc,EAAE;IACxB,OAAO;EACT;EAEA,oBACEF,IAAA,CAACV,aAAA;IAAcI,MAAA,EAAQA,MAAA;IAAQE,MAAA,EAAQA,MAAA;IAAQC,OAAA,EAASA,OAAA;IAASC,IAAA,EAAMA,IAAA;cACrE,aAAAE,IAAA,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mBAAA;MAAA,IAE3D/B,WAAA,EAAAO,8BAAA;QAAA,IACEN,sBAAA;UACK0C,EAAA;UAAA,MAAAG,GAAA;QAAA;MAAA;MAAA,KAINhF,YAAA,EAAA8B,QAAA,EAAAC,YAAA,EAAAC,MAAA,EAAAf,MAAA;QACI4D,EAAA;QAAA,MAAAG,GAAA;MAAA;MAIPJ,EAAA,GAAAhF,IAAA,CAAAqC,YAAA;QAAA1C,UAAA,EAAA0F,QAAA,CAAAC,IAAA;QAAAhD,WAAA;QAAA1C,MAAA;QAAAQ,YAAA;QAAAmC;MAAA,C;;;;;;;;;;;;;;;SAAAyC,E;CAQJ","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useLexicalEditable","getTranslation","useScrollInfo","useThrottledEffect","useTranslation","React","useMemo","useEditorConfigContext","ToolbarButton","ToolbarDropdown","useToolbarKeyboardNavigation","useToolbarStates","useRedirectVerticalWheelToHorizontalScroll","ButtonGroupItem","active","anchorElem","editor","enabled","item","Component","_jsx","key","ChildComponent","ToolbarGroupComponent","editorConfig","group","index","toolbarStates","i18n","fieldProps","featureClientSchemaMap","schemaPath","groupState","groupStates","get","DropdownIcon","type","undefined","activeItem","activeItems","dropdownLabel","length","t","count","label","substring","_jsxs","className","items","Icon","itemsContainerClassNames","map","itemState","itemStates","features","toolbarFixed","groups","FixedToolbar","clientProps","parentWithFixedToolbar","currentToolbarRef","useRef","keyboardNavigationOptions","toolbarRef","isEditable","y","parentToolbarElem","disableIfParentHasFixedToolbar","parentEditorElem","editorContainerRef","current","sibling","previousElementSibling","classList","contains","currentToolbarElem","currentRect","getBoundingClientRect","parentRect","overlapping","bottom","top","remove","add","field","path","onFocus","event","stopPropagation","ref","role","tabIndex","i","getParentEditorWithFixedToolbar","editorConfigContext","parentEditor","resolvedFeatureMap","has","FixedToolbarPlugin","t0","$","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor","t1","t2","Symbol","for","bb0","document","body"],"sources":["../../../../../../src/features/toolbars/fixed/client/Toolbar/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { useMemo } from 'react'\n\nimport type { EditorConfigContextType } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport type { SanitizedClientEditorConfig } from '../../../../../lexical/config/types.js'\nimport type { PluginComponent } from '../../../../typesClient.js'\nimport type { ToolbarStates } from '../../../shared/useToolbarStates.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../../types.js'\nimport type { FixedToolbarFeatureProps } from '../../server/index.js'\n\nimport { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js'\nimport { ToolbarButton } from '../../../shared/ToolbarButton/index.js'\nimport { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js'\nimport { useToolbarKeyboardNavigation } from '../../../shared/useToolbarKeyboardNavigation.js'\nimport { useToolbarStates } from '../../../shared/useToolbarStates.js'\nimport { useRedirectVerticalWheelToHorizontalScroll } from './horizontalWheelScroll.js'\nimport './index.css'\n\nfunction ButtonGroupItem({\n active,\n anchorElem,\n editor,\n enabled,\n item,\n}: {\n active: boolean\n anchorElem: HTMLElement\n editor: LexicalEditor\n enabled: boolean\n item: ToolbarGroupItem\n}): React.ReactNode {\n if (item.Component) {\n return (\n item?.Component && (\n <item.Component anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n )\n }\n\n if (!item.ChildComponent) {\n return null\n }\n\n return (\n <ToolbarButton active={active} editor={editor} enabled={enabled} item={item} key={item.key}>\n <item.ChildComponent />\n </ToolbarButton>\n )\n}\n\nfunction ToolbarGroupComponent({\n anchorElem,\n editor,\n editorConfig,\n group,\n index,\n toolbarStates,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n group: ToolbarGroup\n index: number\n toolbarStates: ToolbarStates\n}): React.ReactNode {\n const { i18n } = useTranslation<{}, string>()\n const {\n fieldProps: { featureClientSchemaMap, schemaPath },\n } = useEditorConfigContext()\n\n const groupState = toolbarStates.groupStates.get(group.key)\n\n const DropdownIcon = useMemo(() => {\n if (group.type !== 'dropdown') {\n return undefined\n }\n const activeItem = groupState?.activeItems?.[0]\n if (activeItem) {\n return activeItem.ChildComponent\n }\n return group.ChildComponent\n }, [group, groupState?.activeItems])\n\n const dropdownLabel = useMemo(() => {\n if (group.type !== 'dropdown') {\n return undefined\n }\n const activeItems = groupState?.activeItems\n if (!activeItems?.length) {\n return undefined\n }\n if (activeItems.length > 1) {\n return i18n.t('lexical:general:toolbarItemsActive', { count: activeItems.length })\n }\n const item = activeItems[0]!\n let label = item.key\n if (item.label) {\n label =\n typeof item.label === 'function'\n ? item.label({ featureClientSchemaMap, i18n, schemaPath })\n : item.label\n }\n if (label.length > 25) {\n label = label.substring(0, 25) + '...'\n }\n return label\n }, [group, groupState?.activeItems, i18n, featureClientSchemaMap, schemaPath])\n\n return (\n <div\n className={`fixed-toolbar__group fixed-toolbar__group-${group.key}`}\n data-toolbar-group-key={group.key}\n key={group.key}\n >\n {group.type === 'dropdown' && group.items.length && groupState ? (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n groupState={groupState}\n Icon={DropdownIcon}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n />\n ) : null}\n {group.type === 'buttons' && group.items.length\n ? group.items.map((item) => {\n const itemState = toolbarStates.itemStates.get(item.key)\n return (\n <ButtonGroupItem\n active={itemState?.active ?? false}\n anchorElem={anchorElem}\n editor={editor}\n enabled={itemState?.enabled ?? true}\n item={item}\n key={item.key}\n />\n )\n })\n : null}\n {index < editorConfig.features.toolbarFixed?.groups.length - 1 && <div className=\"divider\" />}\n </div>\n )\n}\n\nfunction FixedToolbar({\n anchorElem,\n clientProps,\n editor,\n editorConfig,\n parentWithFixedToolbar,\n}: {\n anchorElem: HTMLElement\n clientProps?: FixedToolbarFeatureProps\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n parentWithFixedToolbar: EditorConfigContextType | false\n}): React.ReactNode {\n const currentToolbarRef = React.useRef<HTMLDivElement>(null)\n const keyboardNavigationOptions = useMemo(() => ({ toolbarRef: currentToolbarRef }), [])\n const { fieldProps } = useEditorConfigContext()\n const { i18n } = useTranslation()\n\n useToolbarKeyboardNavigation(keyboardNavigationOptions)\n\n const isEditable = useLexicalEditable()\n\n const { y } = useScrollInfo()\n\n useRedirectVerticalWheelToHorizontalScroll()\n\n const toolbarStates = useToolbarStates(editor, editorConfig?.features?.toolbarFixed?.groups)\n\n // Memoize the parent toolbar element\n const parentToolbarElem = useMemo(() => {\n if (!parentWithFixedToolbar || clientProps?.disableIfParentHasFixedToolbar) {\n return null\n }\n\n const parentEditorElem = parentWithFixedToolbar.editorContainerRef.current\n let sibling = parentEditorElem.previousElementSibling\n while (sibling) {\n if (sibling.classList.contains('fixed-toolbar')) {\n return sibling\n }\n sibling = sibling.previousElementSibling\n }\n return null\n }, [clientProps?.disableIfParentHasFixedToolbar, parentWithFixedToolbar])\n\n useThrottledEffect(\n () => {\n if (!parentToolbarElem) {\n // this also checks for clientProps?.disableIfParentHasFixedToolbar indirectly, see the parentToolbarElem useMemo\n return\n }\n const currentToolbarElem = currentToolbarRef.current\n if (!currentToolbarElem) {\n return\n }\n\n const currentRect = currentToolbarElem.getBoundingClientRect()\n const parentRect = parentToolbarElem.getBoundingClientRect()\n\n // we only need to check for vertical overlap\n const overlapping = !(\n currentRect.bottom < parentRect.top || currentRect.top > parentRect.bottom\n )\n\n if (overlapping) {\n currentToolbarElem.classList.remove('fixed-toolbar')\n currentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--overlapping')\n parentToolbarElem.classList.remove('fixed-toolbar')\n parentToolbarElem.classList.add('fixed-toolbar', 'fixed-toolbar--hide')\n } else {\n if (!currentToolbarElem.classList.contains('fixed-toolbar--overlapping')) {\n return\n }\n currentToolbarElem.classList.remove('fixed-toolbar--overlapping')\n currentToolbarElem.classList.add('fixed-toolbar')\n parentToolbarElem.classList.remove('fixed-toolbar--hide')\n parentToolbarElem.classList.add('fixed-toolbar')\n }\n },\n 50,\n [currentToolbarRef, parentToolbarElem, y],\n )\n\n return (\n <div\n aria-label={\n getTranslation(fieldProps.field.label || fieldProps.path, i18n) || fieldProps.path\n }\n className=\"fixed-toolbar\"\n onFocus={(event) => {\n // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,\n // the parent editor will be focused, and the child editor will lose focus.\n event.stopPropagation()\n }}\n ref={currentToolbarRef}\n role=\"toolbar\"\n >\n {isEditable && (\n <div className=\"fixed-toolbar__scroll\" tabIndex={-1}>\n {editorConfig?.features &&\n editorConfig.features?.toolbarFixed?.groups.map((group, i) => {\n return (\n <ToolbarGroupComponent\n anchorElem={anchorElem}\n editor={editor}\n editorConfig={editorConfig}\n group={group}\n index={i}\n key={group.key}\n toolbarStates={toolbarStates}\n />\n )\n })}\n </div>\n )}\n </div>\n )\n}\n\nconst getParentEditorWithFixedToolbar = (\n editorConfigContext: EditorConfigContextType,\n): EditorConfigContextType | false => {\n if (editorConfigContext.parentEditor?.editorConfig) {\n if (editorConfigContext.parentEditor?.editorConfig.resolvedFeatureMap.has('toolbarFixed')) {\n return editorConfigContext.parentEditor\n } else {\n if (editorConfigContext.parentEditor) {\n return getParentEditorWithFixedToolbar(editorConfigContext.parentEditor)\n }\n }\n }\n return false\n}\n\nexport const FixedToolbarPlugin: PluginComponent<FixedToolbarFeatureProps> = ({ clientProps }) => {\n const [currentEditor] = useLexicalComposerContext()\n const editorConfigContext = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n if (!isEditable) {\n return null\n }\n\n const { editorConfig: currentEditorConfig } = editorConfigContext\n\n const editor = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editor || currentEditor\n : currentEditor\n\n const editorConfig = clientProps.applyToFocusedEditor\n ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig\n : currentEditorConfig\n\n const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext)\n\n if (clientProps?.disableIfParentHasFixedToolbar) {\n if (parentWithFixedToolbar) {\n return null\n }\n }\n\n if (!editorConfig?.features?.toolbarFixed?.groups?.length) {\n return null\n }\n\n return (\n <FixedToolbar\n anchorElem={document.body}\n clientProps={clientProps}\n editor={editor}\n editorConfig={editorConfig}\n parentWithFixedToolbar={parentWithFixedToolbar}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,cAAc,QAAQ;AAClE,YAAYC,KAAA,MAAW;AACvB,SAASC,OAAO,QAAQ;AASxB,SAASC,sBAAsB,QAAQ;AACvC,SAASC,aAAa,QAAQ;AAC9B,SAASC,eAAe,QAAQ;AAChC,SAASC,4BAA4B,QAAQ;AAC7C,SAASC,gBAAgB,QAAQ;AACjC,SAASC,0CAA0C,QAAQ;AAC3D,OAAO;AAEP,SAASC,gBAAgB;EACvBC,MAAM;EACNC,UAAU;EACVC,MAAM;EACNC,OAAO;EACPC;AAAI,CAOL;EACC,IAAIA,IAAA,CAAKC,SAAS,EAAE;IAClB,OACED,IAAA,EAAMC,SAAA,iBACJC,IAAA,CAACF,IAAA,CAAKC,SAAS;MAACJ,UAAA,EAAYA,UAAA;MAAYC,MAAA,EAAQA,MAAA;MAAQE,IAAA,EAAMA;OAAWA,IAAA,CAAKG,GAAG;EAGvF;EAEA,IAAI,CAACH,IAAA,CAAKI,cAAc,EAAE;IACxB,OAAO;EACT;EAEA,oBACEF,IAAA,CAACZ,aAAA;IAAc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IAA8CR,mBAAA;EAE9C,MAAA9E,MAAA,GAAe0C,WAAA,CAAA6C,oBAAA,GACXT,mBAAA,CAAAU,aAAA,EAAAxF,MAAA,IAA6CqF,aAAA,GAC7CA,aAAA;EAEJ,MAAA7E,YAAA,GAAqBkC,WAAA,CAAA6C,oBAAA,GACjBT,mBAAA,CAAAU,aAAA,EAAAhF,YAAA,IAAmD8E,mBAAA,GACnDA,mBAAA;EAAA,IAAAG,EAAA;EAAA,IAAAC,EAAA;EAAA,IAAAN,CAAA,QAAA1C,WAAA,IAAA0C,CAAA,QAAApF,MAAA,IAAAoF,CAAA,QAAA5E,YAAA,IAAA4E,CAAA,QAAAN,mBAAA;IAMOY,EAAA,GAAAC,MAAA,CAAAC,GAAA;IAAAC,GAAA;MAJX,MAAAlD,sBAAA,GAA+BkC,+BAAA,CAAgCC,mBAAA;MAAA,IAE3DpC,WAAA,EAAAS,8BAAA;QAAA,IACER,sBAAA;UACK+C,EAAA;UAAA,MAAAG,GAAA;QAAA;MAAA;MAAA,KAINrF,YAAA,EAAA8B,QAAA,EAAAC,YAAA,EAAAC,MAAA,EAAAf,MAAA;QACIiE,EAAA;QAAA,MAAAG,GAAA;MAAA;MAIPJ,EAAA,GAAArF,IAAA,CAAAqC,YAAA;QAAA1C,UAAA,EAAA+F,QAAA,CAAAC,IAAA;QAAArD,WAAA;QAAA1C,MAAA;QAAAQ,YAAA;QAAAmC;MAAA,C;;;;;;;;;;;;;;;SAAA8C,E;CAQJ","ignoreList":[]}
@@ -12,7 +12,6 @@
12
12
  z-index: 2;
13
13
  opacity: 0;
14
14
  border-radius: var(--radius-medium);
15
- transition: opacity 0.2s;
16
15
  will-change: transform;
17
16
  box-shadow: var(--elevation-300-tooltip);
18
17
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/inline/client/Toolbar/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAU3E,OAAO,aAAa,CAAA;AA6WpB,eAAO,MAAM,mBAAmB,EAAE,yBAAyB,CAAC,SAAS,CAIpE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/toolbars/inline/client/Toolbar/index.tsx"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4BAA4B,CAAA;AAW3E,OAAO,aAAa,CAAA;AA0XpB,eAAO,MAAM,mBAAmB,EAAE,yBAAyB,CAAC,SAAS,CAIpE,CAAA"}
@@ -5,7 +5,9 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
5
5
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
6
6
  import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
7
7
  import { mergeRegister } from '@lexical/utils';
8
- import { $getSelection, $isRangeSelection, $isTextNode, COMMAND_PRIORITY_LOW, getDOMSelection, SELECTION_CHANGE_COMMAND } from 'lexical';
8
+ import { getTranslation } from '@payloadcms/translations';
9
+ import { useTranslation } from '@payloadcms/ui';
10
+ import { $getSelection, $isRangeSelection, $isTextNode, $onUpdate, COMMAND_PRIORITY_LOW, getDOMSelection, SELECTION_CHANGE_COMMAND } from 'lexical';
9
11
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
10
12
  import * as React from 'react';
11
13
  import { createPortal } from 'react-dom';
@@ -14,6 +16,7 @@ import { getDOMRangeRect } from '../../../../../lexical/utils/getDOMRangeRect.js
14
16
  import { setFloatingElemPosition } from '../../../../../lexical/utils/setFloatingElemPosition.js';
15
17
  import { ToolbarButton } from '../../../shared/ToolbarButton/index.js';
16
18
  import { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js';
19
+ import { useToolbarKeyboardNavigation } from '../../../shared/useToolbarKeyboardNavigation.js';
17
20
  import { useToolbarStates } from '../../../shared/useToolbarStates.js';
18
21
  import './index.css';
19
22
  function ButtonGroupItem({
@@ -87,6 +90,16 @@ function InlineToolbar({
87
90
  editor
88
91
  }) {
89
92
  const floatingToolbarRef = useRef(null);
93
+ const keyboardNavigationOptions = useMemo(() => ({
94
+ toolbarRef: floatingToolbarRef
95
+ }), []);
96
+ const {
97
+ fieldProps
98
+ } = useEditorConfigContext();
99
+ const {
100
+ i18n
101
+ } = useTranslation();
102
+ useToolbarKeyboardNavigation(keyboardNavigationOptions);
90
103
  const caretRef = useRef(null);
91
104
  const {
92
105
  editorConfig
@@ -203,13 +216,15 @@ function InlineToolbar({
203
216
  $updateTextFormatFloatingToolbar();
204
217
  });
205
218
  }), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
206
- $updateTextFormatFloatingToolbar();
219
+ $onUpdate(() => editor.read('latest', $updateTextFormatFloatingToolbar));
207
220
  return false;
208
221
  }, COMMAND_PRIORITY_LOW));
209
222
  }, [editor, $updateTextFormatFloatingToolbar]);
210
223
  return /*#__PURE__*/_jsxs("div", {
224
+ "aria-label": getTranslation(fieldProps.field.label || fieldProps.path, i18n) || fieldProps.path,
211
225
  className: "inline-toolbar-popup",
212
226
  ref: floatingToolbarRef,
227
+ role: "toolbar",
213
228
  children: [/*#__PURE__*/_jsx("div", {
214
229
  className: "caret",
215
230
  ref: caretRef