@payloadcms/richtext-lexical 4.0.0-internal.e7d4ebc → 4.0.0-internal.ee5d8bd

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 (611) hide show
  1. package/dist/exports/client/Field-334JNLRF.js +2 -0
  2. package/dist/exports/client/Field-334JNLRF.js.map +7 -0
  3. package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js → RelationshipComponent-TVK6I4W4.js} +2 -2
  4. package/dist/exports/client/chunk-BEKGION5.js +2 -0
  5. package/dist/exports/client/chunk-BEKGION5.js.map +7 -0
  6. package/dist/exports/client/{chunk-WSAPGI3Z.js → chunk-EA5BHQ2T.js} +1 -1
  7. package/dist/exports/client/{chunk-WSAPGI3Z.js.map → chunk-EA5BHQ2T.js.map} +1 -1
  8. package/dist/exports/client/chunk-FAJJXXCW.js +2 -0
  9. package/dist/exports/client/chunk-FAJJXXCW.js.map +7 -0
  10. package/dist/exports/client/{chunk-5VIL27GI.js → chunk-IYBYNEKX.js} +1 -1
  11. package/dist/exports/client/{chunk-5VIL27GI.js.map → chunk-IYBYNEKX.js.map} +1 -1
  12. package/dist/exports/client/chunk-SE5IITBK.js +2 -0
  13. package/dist/exports/client/chunk-SE5IITBK.js.map +7 -0
  14. package/dist/exports/client/component-QENB4QTS.js +2 -0
  15. package/dist/exports/client/component-QENB4QTS.js.map +7 -0
  16. package/dist/exports/client/componentInline-AU7IBNY7.js +2 -0
  17. package/dist/exports/client/index.d.ts +1 -1
  18. package/dist/exports/client/index.d.ts.map +1 -1
  19. package/dist/exports/client/index.js +26 -26
  20. package/dist/exports/client/index.js.map +4 -4
  21. package/dist/features/align/client/index.js.map +1 -1
  22. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  23. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  24. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  25. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  26. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  27. package/dist/features/blocks/client/component/components/BlockCollapsible.js.map +1 -1
  28. package/dist/features/blocks/client/component/components/BlockEditButton.js.map +1 -1
  29. package/dist/features/blocks/client/component/components/BlockRemoveButton.js.map +1 -1
  30. package/dist/features/blocks/client/component/index.d.ts +0 -6
  31. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  32. package/dist/features/blocks/client/component/index.js +199 -109
  33. package/dist/features/blocks/client/component/index.js.map +1 -1
  34. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  35. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  36. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  37. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  38. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.js.map +1 -1
  39. package/dist/features/blocks/client/componentInline/components/InlineBlockEditButton.js.map +1 -1
  40. package/dist/features/blocks/client/componentInline/components/InlineBlockLabel.js.map +1 -1
  41. package/dist/features/blocks/client/componentInline/components/InlineBlockRemoveButton.js.map +1 -1
  42. package/dist/features/blocks/client/componentInline/index.css +0 -1
  43. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  44. package/dist/features/blocks/client/componentInline/index.js +32 -30
  45. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  46. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  47. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  48. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  49. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  50. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  51. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  52. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  53. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  54. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +121 -78
  55. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  56. package/dist/features/blocks/premade/CodeBlock/Component/Code.js +142 -87
  57. package/dist/features/blocks/premade/CodeBlock/Component/Code.js.map +1 -1
  58. package/dist/features/blocks/server/index.js +2 -2
  59. package/dist/features/blocks/server/index.js.map +1 -1
  60. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  61. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  62. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  63. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  64. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  65. package/dist/features/blocks/server/schema.d.ts +2 -0
  66. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  67. package/dist/features/blocks/server/schema.js +7 -9
  68. package/dist/features/blocks/server/schema.js.map +1 -1
  69. package/dist/features/blocks/server/validate.js +1 -1
  70. package/dist/features/blocks/server/validate.js.map +1 -1
  71. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  72. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  73. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  74. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  75. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  76. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  77. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  78. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  79. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  80. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  81. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  82. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  83. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  84. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  85. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  86. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  87. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  88. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  89. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  90. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  91. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  92. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  93. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  94. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  95. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  96. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  97. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  98. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  99. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  100. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  101. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  102. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  103. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  104. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  105. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  106. package/dist/features/heading/client/index.js.map +1 -1
  107. package/dist/features/heading/constants.d.ts +2 -0
  108. package/dist/features/heading/constants.d.ts.map +1 -0
  109. package/dist/features/heading/constants.js +2 -0
  110. package/dist/features/heading/constants.js.map +1 -0
  111. package/dist/features/heading/server/index.d.ts.map +1 -1
  112. package/dist/features/heading/server/index.js +5 -1
  113. package/dist/features/heading/server/index.js.map +1 -1
  114. package/dist/features/heading/server/validate.d.ts +6 -0
  115. package/dist/features/heading/server/validate.d.ts.map +1 -0
  116. package/dist/features/heading/server/validate.js +15 -0
  117. package/dist/features/heading/server/validate.js.map +1 -0
  118. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  119. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  120. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  121. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  122. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  123. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  124. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  125. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  126. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  127. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  128. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  129. package/dist/features/horizontalRule/server/schema.js +6 -5
  130. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  131. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  132. package/dist/features/indent/client/IndentPlugin.js +122 -1
  133. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  134. package/dist/features/indent/client/index.d.ts.map +1 -1
  135. package/dist/features/indent/client/index.js +0 -2
  136. package/dist/features/indent/client/index.js.map +1 -1
  137. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  138. package/dist/features/indent/server/i18n.js +74 -37
  139. package/dist/features/indent/server/i18n.js.map +1 -1
  140. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  141. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  142. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +18 -7
  143. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  144. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -2
  145. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  146. package/dist/features/link/markdownTransformer.js +2 -2
  147. package/dist/features/link/markdownTransformer.js.map +1 -1
  148. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  149. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  150. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  151. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  152. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  153. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  154. package/dist/features/link/nodes/LinkNode.js +2 -15
  155. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  156. package/dist/features/link/server/baseFields.js.map +1 -1
  157. package/dist/features/link/server/index.js +2 -2
  158. package/dist/features/link/server/index.js.map +1 -1
  159. package/dist/features/link/server/validate.js +1 -1
  160. package/dist/features/link/server/validate.js.map +1 -1
  161. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  162. package/dist/features/lists/checklist/server/index.js +5 -2
  163. package/dist/features/lists/checklist/server/index.js.map +1 -1
  164. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  165. package/dist/features/lists/orderedList/server/index.js +5 -2
  166. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  167. package/dist/features/lists/shared/constants.d.ts +2 -0
  168. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  169. package/dist/features/lists/shared/constants.js +2 -0
  170. package/dist/features/lists/shared/constants.js.map +1 -0
  171. package/dist/features/lists/shared/schema.d.ts.map +1 -1
  172. package/dist/features/lists/shared/schema.js.map +1 -1
  173. package/dist/features/lists/shared/validate.d.ts +5 -0
  174. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  175. package/dist/features/lists/shared/validate.js +15 -0
  176. package/dist/features/lists/shared/validate.js.map +1 -0
  177. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  178. package/dist/features/lists/unorderedList/server/index.js +5 -2
  179. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  180. package/dist/features/relationship/client/components/index.css +3 -6
  181. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  182. package/dist/features/relationship/client/index.d.ts +2 -2
  183. package/dist/features/relationship/client/index.d.ts.map +1 -1
  184. package/dist/features/relationship/client/index.js.map +1 -1
  185. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  186. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  187. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  188. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  189. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  190. package/dist/features/relationship/client/plugins/index.js +27 -31
  191. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  192. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  193. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  194. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  195. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  196. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  197. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  198. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  199. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  200. package/dist/features/relationship/server/index.d.ts +8 -1
  201. package/dist/features/relationship/server/index.d.ts.map +1 -1
  202. package/dist/features/relationship/server/index.js +28 -11
  203. package/dist/features/relationship/server/index.js.map +1 -1
  204. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  205. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  206. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  207. package/dist/features/relationship/server/schema.d.ts +3 -2
  208. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  209. package/dist/features/relationship/server/schema.js +9 -12
  210. package/dist/features/relationship/server/schema.js.map +1 -1
  211. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  212. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  213. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  214. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  215. package/dist/features/table/client/index.d.ts.map +1 -0
  216. package/dist/features/table/client/index.js.map +1 -0
  217. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  218. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  219. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  220. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  221. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +1 -2
  222. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  223. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  224. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  225. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  226. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +47 -24
  227. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  228. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  229. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  230. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  231. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  232. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  233. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  234. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +54 -18
  235. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  236. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  237. package/dist/features/table/client/utils/debounce.js.map +1 -0
  238. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  239. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  240. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  241. package/dist/features/table/markdownTransformer.js.map +1 -0
  242. package/dist/features/table/server/index.d.ts +3 -0
  243. package/dist/features/table/server/index.d.ts.map +1 -0
  244. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  245. package/dist/features/table/server/index.js.map +1 -0
  246. package/dist/features/table/server/schema.d.ts.map +1 -0
  247. package/dist/features/table/server/schema.js.map +1 -0
  248. package/dist/features/textState/defaultColors.js +1 -1
  249. package/dist/features/textState/defaultColors.js.map +1 -1
  250. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  251. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  252. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  253. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  254. package/dist/features/toolbars/fixed/client/Toolbar/index.css +77 -3
  255. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  256. package/dist/features/toolbars/fixed/client/Toolbar/index.js +145 -71
  257. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  258. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  259. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  260. package/dist/features/toolbars/inline/client/Toolbar/index.js +84 -37
  261. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  262. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  263. package/dist/features/toolbars/shared/ToolbarButton/index.js +27 -2
  264. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  265. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  266. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +199 -81
  267. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  268. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -14
  269. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  270. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +22 -6
  271. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  272. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  273. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  274. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +109 -0
  275. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  276. package/dist/features/typesServer.d.ts +17 -12
  277. package/dist/features/typesServer.d.ts.map +1 -1
  278. package/dist/features/typesServer.js.map +1 -1
  279. package/dist/features/upload/client/component/index.css +0 -2
  280. package/dist/features/upload/client/component/index.js +2 -1
  281. package/dist/features/upload/client/component/index.js.map +1 -1
  282. package/dist/features/upload/client/drawer/index.js.map +1 -1
  283. package/dist/features/upload/client/index.d.ts +3 -2
  284. package/dist/features/upload/client/index.d.ts.map +1 -1
  285. package/dist/features/upload/client/index.js.map +1 -1
  286. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  287. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  288. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  289. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  290. package/dist/features/upload/client/plugin/index.js +50 -53
  291. package/dist/features/upload/client/plugin/index.js.map +1 -1
  292. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  293. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  294. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  295. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  296. package/dist/features/upload/server/index.d.ts +7 -3
  297. package/dist/features/upload/server/index.d.ts.map +1 -1
  298. package/dist/features/upload/server/index.js +20 -16
  299. package/dist/features/upload/server/index.js.map +1 -1
  300. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  301. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  302. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  303. package/dist/features/upload/server/schema.d.ts +4 -16
  304. package/dist/features/upload/server/schema.d.ts.map +1 -1
  305. package/dist/features/upload/server/schema.js +8 -10
  306. package/dist/features/upload/server/schema.js.map +1 -1
  307. package/dist/features/upload/server/validate.d.ts +2 -2
  308. package/dist/features/upload/server/validate.d.ts.map +1 -1
  309. package/dist/features/upload/server/validate.js +4 -1
  310. package/dist/features/upload/server/validate.js.map +1 -1
  311. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  312. package/dist/field/Diff/converters/listitem/index.js +2 -1
  313. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  314. package/dist/field/Diff/converters/relationship/index.css +0 -1
  315. package/dist/field/Diff/converters/unknown/index.css +0 -1
  316. package/dist/field/Diff/converters/upload/index.css +0 -1
  317. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  318. package/dist/field/Diff/index.css +0 -2
  319. package/dist/field/Diff/index.d.ts +3 -2
  320. package/dist/field/Diff/index.d.ts.map +1 -1
  321. package/dist/field/Diff/index.js +3 -2
  322. package/dist/field/Diff/index.js.map +1 -1
  323. package/dist/field/Field.d.ts.map +1 -1
  324. package/dist/field/Field.js +8 -1
  325. package/dist/field/Field.js.map +1 -1
  326. package/dist/field/RenderLexical/index.d.ts +3 -1
  327. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  328. package/dist/field/RenderLexical/index.js +23 -23
  329. package/dist/field/RenderLexical/index.js.map +1 -1
  330. package/dist/field/ViewSelector.d.ts.map +1 -1
  331. package/dist/field/ViewSelector.js +13 -4
  332. package/dist/field/ViewSelector.js.map +1 -1
  333. package/dist/field/bundled.css +1 -1
  334. package/dist/field/index.css +10 -11
  335. package/dist/field/index.js.map +1 -1
  336. package/dist/field/rscEntry.d.ts +2 -2
  337. package/dist/field/rscEntry.d.ts.map +1 -1
  338. package/dist/field/rscEntry.js.map +1 -1
  339. package/dist/i18n.d.ts.map +1 -1
  340. package/dist/i18n.js +112 -0
  341. package/dist/i18n.js.map +1 -1
  342. package/dist/index.d.ts +5 -5
  343. package/dist/index.d.ts.map +1 -1
  344. package/dist/index.js +27 -5
  345. package/dist/index.js.map +1 -1
  346. package/dist/lexical/LexicalEditor.css +21 -10
  347. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  348. package/dist/lexical/LexicalEditor.js +61 -64
  349. package/dist/lexical/LexicalEditor.js.map +1 -1
  350. package/dist/lexical/config/server/loader.d.ts +1 -1
  351. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  352. package/dist/lexical/config/server/loader.js +2 -2
  353. package/dist/lexical/config/server/loader.js.map +1 -1
  354. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  355. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  356. package/dist/lexical/config/server/sanitize.js +2 -2
  357. package/dist/lexical/config/server/sanitize.js.map +1 -1
  358. package/dist/lexical/plugins/ClipboardPlugin/index.js.map +1 -1
  359. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  360. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  361. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  362. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  363. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  364. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  365. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  366. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  367. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  368. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  369. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  370. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +236 -108
  371. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  372. package/dist/lexical/plugins/SlashMenu/index.css +0 -2
  373. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  374. package/dist/lexical/plugins/TextPlugin/index.js.map +1 -1
  375. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  376. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  377. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  378. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +17 -0
  379. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  380. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +139 -37
  381. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  382. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts +7 -0
  383. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.d.ts.map +1 -0
  384. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js +15 -0
  385. package/dist/lexical/plugins/handles/DraggableBlockPlugin/moveBlock.js.map +1 -0
  386. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  387. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  388. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +62 -0
  389. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  390. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  391. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  392. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  393. package/dist/lexical/theme/EditorTheme.css +0 -2
  394. package/dist/lexical/ui/ContentEditable.css +0 -4
  395. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  396. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  397. package/dist/lexical/ui/ContentEditable.js +32 -11
  398. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  399. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  400. package/dist/lexical/ui/icons/H3/index.js +13 -6
  401. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  402. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  403. package/dist/lexical/ui/icons/H4/index.js +13 -6
  404. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  405. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  406. package/dist/lexical/ui/icons/H5/index.js +13 -6
  407. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  408. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  409. package/dist/lexical/ui/icons/H6/index.js +13 -6
  410. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  411. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  412. package/dist/lexical/utils/nodeFormat.js +0 -2
  413. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  414. package/dist/lexical/utils/url.d.ts.map +1 -1
  415. package/dist/lexical/utils/url.js +1 -1
  416. package/dist/lexical/utils/url.js.map +1 -1
  417. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  418. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  419. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  420. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  421. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  422. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  423. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  424. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  425. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  426. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  427. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  428. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  429. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  430. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  431. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  432. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  433. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  434. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  435. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  436. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  437. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  438. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  439. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  440. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  441. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  442. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  443. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  444. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  445. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  446. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  447. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  448. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  449. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  450. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  451. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  452. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  453. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  454. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  455. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  456. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  457. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  458. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  459. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  460. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  461. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  462. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  463. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  464. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  465. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  466. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  467. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  468. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  469. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  470. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  471. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  472. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  473. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  474. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  475. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  476. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  477. package/dist/populateGraphQL/populate.js.map +1 -1
  478. package/dist/presets/llmInstructions.d.ts +2 -0
  479. package/dist/presets/llmInstructions.d.ts.map +1 -0
  480. package/dist/presets/llmInstructions.js +13 -0
  481. package/dist/presets/llmInstructions.js.map +1 -0
  482. package/dist/types/builtInNodes.d.ts +1 -1
  483. package/dist/types/builtInNodes.d.ts.map +1 -1
  484. package/dist/types/builtInNodes.js +8 -3
  485. package/dist/types/builtInNodes.js.map +1 -1
  486. package/dist/types/index.d.ts +4 -7
  487. package/dist/types/index.d.ts.map +1 -1
  488. package/dist/types/index.js.map +1 -1
  489. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  490. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  491. package/dist/types/jsonSchemaHelpers.js +7 -2
  492. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  493. package/dist/types/nodeTypes.d.ts +6 -1
  494. package/dist/types/nodeTypes.d.ts.map +1 -1
  495. package/dist/types/nodeTypes.js.map +1 -1
  496. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  497. package/dist/utilities/buildEditorState.js.map +1 -1
  498. package/dist/utilities/buildInitialState.d.ts +3 -2
  499. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  500. package/dist/utilities/buildInitialState.js +1 -0
  501. package/dist/utilities/buildInitialState.js.map +1 -1
  502. package/dist/utilities/createServerFeature.d.ts +1 -1
  503. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  504. package/dist/utilities/createServerFeature.js +2 -2
  505. package/dist/utilities/createServerFeature.js.map +1 -1
  506. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  507. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  508. package/dist/utilities/editorConfigFactory.js +9 -9
  509. package/dist/utilities/editorConfigFactory.js.map +1 -1
  510. package/dist/utilities/fieldsDrawer/Drawer.js +36 -36
  511. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  512. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  513. package/dist/utilities/fieldsDrawer/DrawerContent.js +6 -9
  514. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  515. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -1
  516. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  517. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -1
  518. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -1
  519. package/dist/utilities/generateImportMap.d.ts +2 -2
  520. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  521. package/dist/utilities/generateImportMap.js.map +1 -1
  522. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  523. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  524. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  525. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  526. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  527. package/dist/utilities/initLexicalFeatures.js +38 -4
  528. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  529. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  530. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  531. package/dist/utilities/useLexicalFeature.js +15 -6
  532. package/dist/utilities/useLexicalFeature.js.map +1 -1
  533. package/dist/utilities/useRunDeprioritized.js.map +1 -1
  534. package/dist/validate/hasText.d.ts +2 -2
  535. package/dist/validate/hasText.d.ts.map +1 -1
  536. package/dist/validate/hasText.js.map +1 -1
  537. package/dist/validate/index.d.ts +1 -1
  538. package/dist/validate/index.d.ts.map +1 -1
  539. package/package.json +125 -54
  540. package/dist/dependencyChecker.spec.js +0 -16
  541. package/dist/dependencyChecker.spec.js.map +0 -1
  542. package/dist/exports/client/Field-QGSHF22S.js +0 -2
  543. package/dist/exports/client/Field-QGSHF22S.js.map +0 -7
  544. package/dist/exports/client/bundled.css +0 -1
  545. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  546. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  547. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  548. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  549. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  550. package/dist/exports/client/chunk-X3D4LZS7.js.map +0 -7
  551. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  552. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  553. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  554. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  555. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  556. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  557. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  558. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  559. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  560. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  561. package/dist/features/experimental_table/client/index.js.map +0 -1
  562. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  563. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  564. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  565. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  566. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  567. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  568. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  569. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  570. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  571. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  572. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  573. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  574. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  575. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  576. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  577. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  578. package/dist/features/experimental_table/server/index.d.ts +0 -3
  579. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  580. package/dist/features/experimental_table/server/index.js.map +0 -1
  581. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  582. package/dist/features/experimental_table/server/schema.js.map +0 -1
  583. package/dist/features/link/markdownTransformer.spec.js +0 -195
  584. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  585. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  586. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  587. package/dist/lexical/utils/url.spec.js +0 -114
  588. package/dist/lexical/utils/url.spec.js.map +0 -1
  589. package/dist/utilities/jsx/jsx.spec.js +0 -178
  590. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  591. /package/dist/exports/client/{RelationshipComponent-YCPAKOL7.js.map → RelationshipComponent-TVK6I4W4.js.map} +0 -0
  592. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-AU7IBNY7.js.map} +0 -0
  593. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  594. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  595. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  596. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  597. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  598. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  599. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  600. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  601. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  602. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  603. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  604. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  605. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  606. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  607. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  608. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  609. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  610. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  611. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -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;
@@ -55,13 +87,55 @@
55
87
  }
56
88
  }
57
89
 
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;
114
+ }
115
+ }
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
+
58
127
  .fixed-toolbar__group {
59
128
  display: flex;
60
- flex-wrap: wrap;
129
+ flex-wrap: nowrap;
61
130
  align-items: center;
62
131
  gap: var(--spacer-2);
63
132
  align-self: stretch;
64
133
  z-index: 1;
134
+ flex-shrink: 0;
135
+
136
+ > * {
137
+ flex-shrink: 0;
138
+ }
65
139
 
66
140
  .divider {
67
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,
@@ -37,85 +40,141 @@ function ButtonGroupItem({
37
40
  children: /*#__PURE__*/_jsx(item.ChildComponent, {})
38
41
  }, item.key);
39
42
  }
40
- function ToolbarGroupComponent({
41
- anchorElem,
42
- editor,
43
- editorConfig,
44
- group,
45
- index,
46
- toolbarStates
47
- }) {
43
+ function ToolbarGroupComponent(t0) {
44
+ const $ = _c(22);
45
+ const {
46
+ anchorElem,
47
+ editor,
48
+ editorConfig,
49
+ group,
50
+ index,
51
+ toolbarStates
52
+ } = t0;
48
53
  const {
49
54
  i18n
50
55
  } = useTranslation();
51
56
  const {
52
- fieldProps: {
53
- featureClientSchemaMap,
54
- schemaPath
55
- }
57
+ fieldProps: t1
56
58
  } = useEditorConfigContext();
57
- const groupState = toolbarStates.groupStates.get(group.key);
58
- const DropdownIcon = useMemo(() => {
59
- if (group.type !== 'dropdown') {
60
- return undefined;
59
+ const {
60
+ featureClientSchemaMap,
61
+ schemaPath
62
+ } = t1;
63
+ let t2;
64
+ if ($[0] !== group.key || $[1] !== toolbarStates.groupStates) {
65
+ t2 = toolbarStates.groupStates.get(group.key);
66
+ $[0] = group.key;
67
+ $[1] = toolbarStates.groupStates;
68
+ $[2] = t2;
69
+ } else {
70
+ t2 = $[2];
71
+ }
72
+ const groupState = t2;
73
+ groupState?.activeItems;
74
+ let t3;
75
+ bb0: {
76
+ if (group.type !== "dropdown") {
77
+ t3 = undefined;
78
+ break bb0;
61
79
  }
62
80
  const activeItem = groupState?.activeItems?.[0];
63
81
  if (activeItem) {
64
- return activeItem.ChildComponent;
65
- }
66
- return group.ChildComponent;
67
- }, [group, groupState?.activeItems]);
68
- const dropdownLabel = useMemo(() => {
69
- if (group.type !== 'dropdown') {
70
- return undefined;
71
- }
72
- const activeItems = groupState?.activeItems;
73
- if (!activeItems?.length) {
74
- return undefined;
75
- }
76
- if (activeItems.length > 1) {
77
- return i18n.t('lexical:general:toolbarItemsActive', {
78
- count: activeItems.length
79
- });
82
+ t3 = activeItem.ChildComponent;
83
+ break bb0;
80
84
  }
81
- const item = activeItems[0];
82
- let label = item.key;
83
- if (item.label) {
84
- label = typeof item.label === 'function' ? item.label({
85
- featureClientSchemaMap,
86
- i18n,
87
- schemaPath
88
- }) : item.label;
89
- }
90
- if (label.length > 25) {
91
- label = label.substring(0, 25) + '...';
92
- }
93
- return label;
94
- }, [group, groupState?.activeItems, i18n, featureClientSchemaMap, schemaPath]);
95
- return /*#__PURE__*/_jsxs("div", {
96
- className: `fixed-toolbar__group fixed-toolbar__group-${group.key}`,
97
- "data-toolbar-group-key": group.key,
98
- children: [group.type === 'dropdown' && group.items.length && groupState ? /*#__PURE__*/_jsx(ToolbarDropdown, {
99
- anchorElem: anchorElem,
100
- editor: editor,
101
- group: group,
102
- groupState: groupState,
103
- Icon: DropdownIcon,
104
- itemsContainerClassNames: ['fixed-toolbar__dropdown-items'],
105
- label: dropdownLabel
106
- }) : null, group.type === 'buttons' && group.items.length ? group.items.map(item_0 => {
107
- const itemState = toolbarStates.itemStates.get(item_0.key);
108
- return /*#__PURE__*/_jsx(ButtonGroupItem, {
109
- active: itemState?.active ?? false,
110
- anchorElem: anchorElem,
111
- editor: editor,
112
- enabled: itemState?.enabled ?? true,
113
- item: item_0
114
- }, item_0.key);
115
- }) : null, index < editorConfig.features.toolbarFixed?.groups.length - 1 && /*#__PURE__*/_jsx("div", {
116
- className: "divider"
117
- })]
118
- }, group.key);
85
+ t3 = group.ChildComponent;
86
+ }
87
+ const DropdownIcon = t3;
88
+ let t4;
89
+ if ($[3] !== featureClientSchemaMap || $[4] !== group.type || $[5] !== groupState?.activeItems || $[6] !== i18n || $[7] !== schemaPath) {
90
+ t4 = () => {
91
+ if (group.type !== "dropdown") {
92
+ return;
93
+ }
94
+ const activeItems = groupState?.activeItems;
95
+ if (!activeItems?.length) {
96
+ return;
97
+ }
98
+ if (activeItems.length > 1) {
99
+ return i18n.t("lexical:general:toolbarItemsActive", {
100
+ count: activeItems.length
101
+ });
102
+ }
103
+ const item = activeItems[0];
104
+ let label = item.key;
105
+ if (item.label) {
106
+ label = typeof item.label === "function" ? item.label({
107
+ featureClientSchemaMap,
108
+ i18n,
109
+ schemaPath
110
+ }) : item.label;
111
+ }
112
+ if (label.length > 25) {
113
+ label = label.substring(0, 25) + "...";
114
+ }
115
+ return label;
116
+ };
117
+ $[3] = featureClientSchemaMap;
118
+ $[4] = group.type;
119
+ $[5] = groupState?.activeItems;
120
+ $[6] = i18n;
121
+ $[7] = schemaPath;
122
+ $[8] = t4;
123
+ } else {
124
+ t4 = $[8];
125
+ }
126
+ groupState?.activeItems;
127
+ let t5;
128
+ if ($[9] !== t4) {
129
+ t5 = t4();
130
+ $[9] = t4;
131
+ $[10] = t5;
132
+ } else {
133
+ t5 = $[10];
134
+ }
135
+ const dropdownLabel = t5;
136
+ const t6 = `fixed-toolbar__group fixed-toolbar__group-${group.key}`;
137
+ let t7;
138
+ if ($[11] !== DropdownIcon || $[12] !== anchorElem || $[13] !== dropdownLabel || $[14] !== editor || $[15] !== editorConfig.features.toolbarFixed?.groups.length || $[16] !== group || $[17] !== groupState || $[18] !== index || $[19] !== t6 || $[20] !== toolbarStates.itemStates) {
139
+ t7 = _jsxs("div", {
140
+ className: t6,
141
+ "data-toolbar-group-key": group.key,
142
+ children: [group.type === "dropdown" && group.items.length && groupState ? _jsx(ToolbarDropdown, {
143
+ anchorElem,
144
+ editor,
145
+ group,
146
+ groupState,
147
+ Icon: DropdownIcon,
148
+ itemsContainerClassNames: ["fixed-toolbar__dropdown-items"],
149
+ label: dropdownLabel
150
+ }) : null, group.type === "buttons" && group.items.length ? group.items.map(item_0 => {
151
+ const itemState = toolbarStates.itemStates.get(item_0.key);
152
+ return _jsx(ButtonGroupItem, {
153
+ active: itemState?.active ?? false,
154
+ anchorElem,
155
+ editor,
156
+ enabled: itemState?.enabled ?? true,
157
+ item: item_0
158
+ }, item_0.key);
159
+ }) : null, index < editorConfig.features.toolbarFixed?.groups.length - 1 && _jsx("div", {
160
+ className: "divider"
161
+ })]
162
+ }, group.key);
163
+ $[11] = DropdownIcon;
164
+ $[12] = anchorElem;
165
+ $[13] = dropdownLabel;
166
+ $[14] = editor;
167
+ $[15] = editorConfig.features.toolbarFixed?.groups.length;
168
+ $[16] = group;
169
+ $[17] = groupState;
170
+ $[18] = index;
171
+ $[19] = t6;
172
+ $[20] = toolbarStates.itemStates;
173
+ $[21] = t7;
174
+ } else {
175
+ t7 = $[21];
176
+ }
177
+ return t7;
119
178
  }
120
179
  function FixedToolbar({
121
180
  anchorElem,
@@ -125,10 +184,21 @@ function FixedToolbar({
125
184
  parentWithFixedToolbar
126
185
  }) {
127
186
  const currentToolbarRef = React.useRef(null);
187
+ const keyboardNavigationOptions = useMemo(() => ({
188
+ toolbarRef: currentToolbarRef
189
+ }), []);
190
+ const {
191
+ fieldProps
192
+ } = useEditorConfigContext();
193
+ const {
194
+ i18n
195
+ } = useTranslation();
196
+ useToolbarKeyboardNavigation(keyboardNavigationOptions);
128
197
  const isEditable = useLexicalEditable();
129
198
  const {
130
199
  y
131
200
  } = useScrollInfo();
201
+ useRedirectVerticalWheelToHorizontalScroll();
132
202
  const toolbarStates = useToolbarStates(editor, editorConfig?.features?.toolbarFixed?.groups);
133
203
  // Memoize the parent toolbar element
134
204
  const parentToolbarElem = useMemo(() => {
@@ -174,6 +244,7 @@ function FixedToolbar({
174
244
  }
175
245
  }, 50, [currentToolbarRef, parentToolbarElem, y]);
176
246
  return /*#__PURE__*/_jsx("div", {
247
+ "aria-label": getTranslation(fieldProps.field.label || fieldProps.path, i18n) || fieldProps.path,
177
248
  className: "fixed-toolbar",
178
249
  onFocus: event => {
179
250
  // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,
@@ -181,7 +252,10 @@ function FixedToolbar({
181
252
  event.stopPropagation();
182
253
  },
183
254
  ref: currentToolbarRef,
184
- children: isEditable && /*#__PURE__*/_jsx(React.Fragment, {
255
+ role: "toolbar",
256
+ children: isEditable && /*#__PURE__*/_jsx("div", {
257
+ className: "fixed-toolbar__scroll",
258
+ tabIndex: -1,
185
259
  children: editorConfig?.features && editorConfig.features?.toolbarFixed?.groups.map((group, i) => {
186
260
  return /*#__PURE__*/_jsx(ToolbarGroupComponent, {
187
261
  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,OAA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AA,IAAA+E,CAAA,QAAAvE,YAAA,IAAAuE,CAAA,QAAAN,mBAAA;IAMOY,EAAA,GAAAC,MAAA,CAAAC,GAAA;IAAAC,GAAA;MAJX,MAAA7C,sBAAA,GAA+B6B,+BAAA,CAAgCC,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","t0","$","editorConfig","group","index","toolbarStates","i18n","fieldProps","t1","featureClientSchemaMap","schemaPath","t2","groupStates","get","groupState","activeItems","t3","bb0","type","undefined","activeItem","DropdownIcon","t4","length","t","count","label","substring","t5","dropdownLabel","t6","t7","features","toolbarFixed","groups","itemStates","_jsxs","className","children","items","Icon","itemsContainerClassNames","map","item_0","itemState","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","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor","Symbol","for","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,EAAY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AAC,GAAA;IAAA3E,GAAA;MAJX,MAAA8B,sBAAA,GAA+BkC,+BAAA,CAAgCC,mBAAA;MAE/D,IAAIpC,WAAA,EAAAS,8BAAa;QACf,IAAIR,sBAAA;UACKpC,EAAA;UAAA,MAAAM,GAAA;QAAA;MACT;MAGF,IAAI,CAACf,YAAA,EAAA8B,QAAwB,EAAAC,YAAc,EAAAC,MAAQ,EAAAX,MAAA;QAC1CZ,EAAA;QAAA,MAAAM,GAAA;MAAA;MAIPT,EAAA,GAAAZ,IAAA,CAACiD,YAAA;QAAAtD,UAAA,EACasG,QAAA,CAAAC,IAAa;QAAAhD,WAAA;QAAAtD,MAAA;QAAAU,YAAA;QAAA6C;;;;;;;;;;;;;;;;SAD3BvC,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({
@@ -41,52 +44,94 @@ function ButtonGroupItem({
41
44
  children: /*#__PURE__*/_jsx(item.ChildComponent, {})
42
45
  }, item.key);
43
46
  }
44
- function ToolbarGroupComponent({
45
- anchorElem,
46
- editor,
47
- group,
48
- index,
49
- toolbarStates
50
- }) {
47
+ function ToolbarGroupComponent(t0) {
48
+ const $ = _c(13);
49
+ const {
50
+ anchorElem,
51
+ editor,
52
+ group,
53
+ index,
54
+ toolbarStates
55
+ } = t0;
51
56
  const {
52
57
  editorConfig
53
58
  } = useEditorConfigContext();
54
- const groupState = toolbarStates.groupStates.get(group.key);
55
- const DropdownIcon = useMemo(() => {
56
- if (group.type !== 'dropdown') {
57
- return undefined;
59
+ let t1;
60
+ if ($[0] !== group.key || $[1] !== toolbarStates.groupStates) {
61
+ t1 = toolbarStates.groupStates.get(group.key);
62
+ $[0] = group.key;
63
+ $[1] = toolbarStates.groupStates;
64
+ $[2] = t1;
65
+ } else {
66
+ t1 = $[2];
67
+ }
68
+ const groupState = t1;
69
+ groupState?.activeItems;
70
+ let t2;
71
+ bb0: {
72
+ if (group.type !== "dropdown") {
73
+ t2 = undefined;
74
+ break bb0;
58
75
  }
59
76
  const activeItem = groupState?.activeItems?.[0];
60
- return activeItem?.ChildComponent ?? group.ChildComponent;
61
- }, [group, groupState?.activeItems]);
62
- return /*#__PURE__*/_jsxs("div", {
63
- className: `inline-toolbar-popup__group inline-toolbar-popup__group-${group.key}`,
64
- "data-toolbar-group-key": group.key,
65
- children: [group.type === 'dropdown' && group.items.length && groupState ? /*#__PURE__*/_jsx(ToolbarDropdown, {
66
- anchorElem: anchorElem,
67
- editor: editor,
68
- group: group,
69
- groupState: groupState,
70
- Icon: DropdownIcon
71
- }) : null, group.type === 'buttons' && group.items.length ? group.items.map(item => {
72
- const itemState = toolbarStates.itemStates.get(item.key);
73
- return /*#__PURE__*/_jsx(ButtonGroupItem, {
74
- active: itemState?.active ?? false,
75
- anchorElem: anchorElem,
76
- editor: editor,
77
- enabled: itemState?.enabled ?? true,
78
- item: item
79
- }, item.key);
80
- }) : null, index < editorConfig.features.toolbarInline?.groups.length - 1 && /*#__PURE__*/_jsx("div", {
81
- className: "divider"
82
- })]
83
- }, group.key);
77
+ t2 = activeItem?.ChildComponent ?? group.ChildComponent;
78
+ }
79
+ const DropdownIcon = t2;
80
+ const t3 = `inline-toolbar-popup__group inline-toolbar-popup__group-${group.key}`;
81
+ let t4;
82
+ if ($[3] !== DropdownIcon || $[4] !== anchorElem || $[5] !== editor || $[6] !== editorConfig.features.toolbarInline?.groups.length || $[7] !== group || $[8] !== groupState || $[9] !== index || $[10] !== t3 || $[11] !== toolbarStates.itemStates) {
83
+ t4 = _jsxs("div", {
84
+ className: t3,
85
+ "data-toolbar-group-key": group.key,
86
+ children: [group.type === "dropdown" && group.items.length && groupState ? _jsx(ToolbarDropdown, {
87
+ anchorElem,
88
+ editor,
89
+ group,
90
+ groupState,
91
+ Icon: DropdownIcon
92
+ }) : null, group.type === "buttons" && group.items.length ? group.items.map(item => {
93
+ const itemState = toolbarStates.itemStates.get(item.key);
94
+ return _jsx(ButtonGroupItem, {
95
+ active: itemState?.active ?? false,
96
+ anchorElem,
97
+ editor,
98
+ enabled: itemState?.enabled ?? true,
99
+ item
100
+ }, item.key);
101
+ }) : null, index < editorConfig.features.toolbarInline?.groups.length - 1 && _jsx("div", {
102
+ className: "divider"
103
+ })]
104
+ }, group.key);
105
+ $[3] = DropdownIcon;
106
+ $[4] = anchorElem;
107
+ $[5] = editor;
108
+ $[6] = editorConfig.features.toolbarInline?.groups.length;
109
+ $[7] = group;
110
+ $[8] = groupState;
111
+ $[9] = index;
112
+ $[10] = t3;
113
+ $[11] = toolbarStates.itemStates;
114
+ $[12] = t4;
115
+ } else {
116
+ t4 = $[12];
117
+ }
118
+ return t4;
84
119
  }
85
120
  function InlineToolbar({
86
121
  anchorElem,
87
122
  editor
88
123
  }) {
89
124
  const floatingToolbarRef = useRef(null);
125
+ const keyboardNavigationOptions = useMemo(() => ({
126
+ toolbarRef: floatingToolbarRef
127
+ }), []);
128
+ const {
129
+ fieldProps
130
+ } = useEditorConfigContext();
131
+ const {
132
+ i18n
133
+ } = useTranslation();
134
+ useToolbarKeyboardNavigation(keyboardNavigationOptions);
90
135
  const caretRef = useRef(null);
91
136
  const {
92
137
  editorConfig
@@ -203,13 +248,15 @@ function InlineToolbar({
203
248
  $updateTextFormatFloatingToolbar();
204
249
  });
205
250
  }), editor.registerCommand(SELECTION_CHANGE_COMMAND, () => {
206
- $updateTextFormatFloatingToolbar();
251
+ $onUpdate(() => editor.read('latest', $updateTextFormatFloatingToolbar));
207
252
  return false;
208
253
  }, COMMAND_PRIORITY_LOW));
209
254
  }, [editor, $updateTextFormatFloatingToolbar]);
210
255
  return /*#__PURE__*/_jsxs("div", {
256
+ "aria-label": getTranslation(fieldProps.field.label || fieldProps.path, i18n) || fieldProps.path,
211
257
  className: "inline-toolbar-popup",
212
258
  ref: floatingToolbarRef,
259
+ role: "toolbar",
213
260
  children: [/*#__PURE__*/_jsx("div", {
214
261
  className: "caret",
215
262
  ref: caretRef