@payloadcms/richtext-lexical 3.0.0-beta.85 → 3.0.0-beta.87

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 (758) hide show
  1. package/dist/cell/index.d.ts +2 -2
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +117 -127
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/exports/client/Component-DOSSWC76.js +2 -0
  6. package/dist/exports/client/Component-DOSSWC76.js.map +7 -0
  7. package/dist/exports/client/Component-MBLHTKDK.js +2 -0
  8. package/dist/exports/client/Component-MBLHTKDK.js.map +7 -0
  9. package/dist/exports/client/Field-63NGLPJB.js +2 -0
  10. package/dist/exports/client/Field-63NGLPJB.js.map +7 -0
  11. package/dist/exports/client/RelationshipComponent-3QWBV4GT.js +2 -0
  12. package/dist/exports/client/RelationshipComponent-3QWBV4GT.js.map +7 -0
  13. package/dist/exports/client/bundled.css +1 -1
  14. package/dist/exports/client/chunk-G5DTIOPI.js +2 -0
  15. package/dist/exports/client/chunk-G5DTIOPI.js.map +7 -0
  16. package/dist/exports/client/chunk-LGUXX2QH.js +2 -0
  17. package/dist/exports/client/chunk-LGUXX2QH.js.map +7 -0
  18. package/dist/exports/client/chunk-NI6Z4GBD.js +2 -0
  19. package/dist/exports/client/{chunk-SQHN3N6E.js.map → chunk-NI6Z4GBD.js.map} +2 -2
  20. package/dist/exports/client/chunk-OKMIHD2R.js +2 -0
  21. package/dist/exports/client/chunk-OKMIHD2R.js.map +7 -0
  22. package/dist/exports/client/chunk-TO2W7Q2G.js +2 -0
  23. package/dist/exports/client/chunk-TO2W7Q2G.js.map +7 -0
  24. package/dist/exports/client/chunk-V2LKLT2F.js +3 -0
  25. package/dist/exports/client/chunk-V2LKLT2F.js.map +7 -0
  26. package/dist/exports/client/component-3OFD6Q4Z.js +2 -0
  27. package/dist/exports/client/component-3OFD6Q4Z.js.map +7 -0
  28. package/dist/exports/client/component-LCAAX56T.js +2 -0
  29. package/dist/exports/client/component-LCAAX56T.js.map +7 -0
  30. package/dist/exports/client/component-LLWMZU6K.js +2 -0
  31. package/dist/exports/client/component-LLWMZU6K.js.map +7 -0
  32. package/dist/exports/client/componentInline-72VZAAHP.js +2 -0
  33. package/dist/exports/client/componentInline-72VZAAHP.js.map +7 -0
  34. package/dist/exports/client/index.js +9 -9
  35. package/dist/exports/client/index.js.map +3 -3
  36. package/dist/exports/server/migrate.js +0 -1
  37. package/dist/exports/server/migrate.js.map +1 -1
  38. package/dist/features/align/client/index.js +151 -134
  39. package/dist/features/align/client/index.js.map +1 -1
  40. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  41. package/dist/features/align/client/toolbarAlignGroup.js +10 -9
  42. package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
  43. package/dist/features/align/server/i18n.js +192 -193
  44. package/dist/features/align/server/i18n.js.map +1 -1
  45. package/dist/features/align/server/index.js +5 -6
  46. package/dist/features/align/server/index.js.map +1 -1
  47. package/dist/features/blockquote/client/index.js +60 -65
  48. package/dist/features/blockquote/client/index.js.map +1 -1
  49. package/dist/features/blockquote/markdownTransformer.js +28 -34
  50. package/dist/features/blockquote/markdownTransformer.js.map +1 -1
  51. package/dist/features/blockquote/server/i18n.js +96 -97
  52. package/dist/features/blockquote/server/i18n.js.map +1 -1
  53. package/dist/features/blockquote/server/index.js +38 -37
  54. package/dist/features/blockquote/server/index.js.map +1 -1
  55. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  56. package/dist/features/blocks/client/component/BlockContent.js +166 -172
  57. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  58. package/dist/features/blocks/client/component/FormSavePlugin.d.ts.map +1 -1
  59. package/dist/features/blocks/client/component/FormSavePlugin.js +46 -22
  60. package/dist/features/blocks/client/component/FormSavePlugin.js.map +1 -1
  61. package/dist/features/blocks/client/component/index.js +130 -142
  62. package/dist/features/blocks/client/component/index.js.map +1 -1
  63. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +1 -1
  64. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +12 -8
  65. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +1 -1
  66. package/dist/features/blocks/client/componentInline/index.js +106 -122
  67. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  68. package/dist/features/blocks/client/index.js +149 -142
  69. package/dist/features/blocks/client/index.js.map +1 -1
  70. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  71. package/dist/features/blocks/client/nodes/BlocksNode.js +41 -40
  72. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  73. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  74. package/dist/features/blocks/client/nodes/InlineBlocksNode.js +31 -30
  75. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  76. package/dist/features/blocks/client/plugin/commands.d.ts.map +1 -1
  77. package/dist/features/blocks/client/plugin/commands.js +2 -1
  78. package/dist/features/blocks/client/plugin/commands.js.map +1 -1
  79. package/dist/features/blocks/client/plugin/index.js +179 -106
  80. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  81. package/dist/features/blocks/server/graphQLPopulationPromise.js +41 -28
  82. package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
  83. package/dist/features/blocks/server/i18n.js +288 -289
  84. package/dist/features/blocks/server/i18n.js.map +1 -1
  85. package/dist/features/blocks/server/index.js +149 -151
  86. package/dist/features/blocks/server/index.js.map +1 -1
  87. package/dist/features/blocks/server/nodes/BlocksNode.js +76 -73
  88. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  89. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +78 -76
  90. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  91. package/dist/features/blocks/server/validate.js +45 -34
  92. package/dist/features/blocks/server/validate.js.map +1 -1
  93. package/dist/features/converters/html/converter/converters/linebreak.js +4 -7
  94. package/dist/features/converters/html/converter/converters/linebreak.js.map +1 -1
  95. package/dist/features/converters/html/converter/converters/paragraph.js +24 -19
  96. package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
  97. package/dist/features/converters/html/converter/converters/text.js +28 -29
  98. package/dist/features/converters/html/converter/converters/text.js.map +1 -1
  99. package/dist/features/converters/html/converter/defaultConverters.js +1 -6
  100. package/dist/features/converters/html/converter/defaultConverters.js.map +1 -1
  101. package/dist/features/converters/html/converter/index.js +66 -51
  102. package/dist/features/converters/html/converter/index.js.map +1 -1
  103. package/dist/features/converters/html/converter/types.js +1 -2
  104. package/dist/features/converters/html/converter/types.js.map +1 -1
  105. package/dist/features/converters/html/field/index.js +134 -139
  106. package/dist/features/converters/html/field/index.js.map +1 -1
  107. package/dist/features/converters/html/index.js +2 -3
  108. package/dist/features/converters/html/index.js.map +1 -1
  109. package/dist/features/createClientComponent.js +7 -6
  110. package/dist/features/createClientComponent.js.map +1 -1
  111. package/dist/features/createFeaturePropComponent.js +14 -13
  112. package/dist/features/createFeaturePropComponent.js.map +1 -1
  113. package/dist/features/debug/testRecorder/client/index.js +5 -7
  114. package/dist/features/debug/testRecorder/client/index.js.map +1 -1
  115. package/dist/features/debug/testRecorder/client/plugin/index.js +518 -402
  116. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  117. package/dist/features/debug/testRecorder/server/index.js +4 -5
  118. package/dist/features/debug/testRecorder/server/index.js.map +1 -1
  119. package/dist/features/debug/treeView/client/index.js +5 -7
  120. package/dist/features/debug/treeView/client/index.js.map +1 -1
  121. package/dist/features/debug/treeView/client/plugin/index.js +21 -11
  122. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  123. package/dist/features/debug/treeView/server/index.js +4 -5
  124. package/dist/features/debug/treeView/server/index.js.map +1 -1
  125. package/dist/features/experimental_table/client/index.js +41 -58
  126. package/dist/features/experimental_table/client/index.js.map +1 -1
  127. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +714 -560
  128. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  129. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +295 -301
  130. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  131. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -7
  132. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
  133. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +228 -159
  134. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  135. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
  136. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  137. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +129 -82
  138. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  139. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +1 -1
  140. package/dist/features/experimental_table/client/utils/debounce.js +108 -89
  141. package/dist/features/experimental_table/client/utils/debounce.js.map +1 -1
  142. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +1 -1
  143. package/dist/features/experimental_table/client/utils/useDebounce.js +11 -13
  144. package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
  145. package/dist/features/experimental_table/server/index.js +127 -114
  146. package/dist/features/experimental_table/server/index.js.map +1 -1
  147. package/dist/features/format/bold/feature.client.js +34 -35
  148. package/dist/features/format/bold/feature.client.js.map +1 -1
  149. package/dist/features/format/bold/feature.server.js +14 -18
  150. package/dist/features/format/bold/feature.server.js.map +1 -1
  151. package/dist/features/format/bold/markdownTransformers.js +14 -25
  152. package/dist/features/format/bold/markdownTransformers.js.map +1 -1
  153. package/dist/features/format/inlineCode/feature.client.js +26 -28
  154. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  155. package/dist/features/format/inlineCode/feature.server.js +5 -8
  156. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  157. package/dist/features/format/inlineCode/markdownTransformers.js +3 -6
  158. package/dist/features/format/inlineCode/markdownTransformers.js.map +1 -1
  159. package/dist/features/format/italic/feature.client.js +26 -29
  160. package/dist/features/format/italic/feature.client.js.map +1 -1
  161. package/dist/features/format/italic/feature.server.js +5 -9
  162. package/dist/features/format/italic/feature.server.js.map +1 -1
  163. package/dist/features/format/italic/markdownTransformers.js +7 -12
  164. package/dist/features/format/italic/markdownTransformers.js.map +1 -1
  165. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  166. package/dist/features/format/shared/toolbarFormatGroup.js +9 -8
  167. package/dist/features/format/shared/toolbarFormatGroup.js.map +1 -1
  168. package/dist/features/format/strikethrough/feature.client.js +26 -28
  169. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  170. package/dist/features/format/strikethrough/feature.server.js +5 -8
  171. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  172. package/dist/features/format/strikethrough/markdownTransformers.js +3 -6
  173. package/dist/features/format/strikethrough/markdownTransformers.js.map +1 -1
  174. package/dist/features/format/subscript/feature.client.js +25 -25
  175. package/dist/features/format/subscript/feature.client.js.map +1 -1
  176. package/dist/features/format/subscript/feature.server.js +4 -5
  177. package/dist/features/format/subscript/feature.server.js.map +1 -1
  178. package/dist/features/format/superscript/feature.client.js +25 -25
  179. package/dist/features/format/superscript/feature.client.js.map +1 -1
  180. package/dist/features/format/superscript/feature.server.js +4 -5
  181. package/dist/features/format/superscript/feature.server.js.map +1 -1
  182. package/dist/features/format/underline/feature.client.js +25 -25
  183. package/dist/features/format/underline/feature.client.js.map +1 -1
  184. package/dist/features/format/underline/feature.server.js +4 -5
  185. package/dist/features/format/underline/feature.server.js.map +1 -1
  186. package/dist/features/heading/client/index.js +86 -90
  187. package/dist/features/heading/client/index.js.map +1 -1
  188. package/dist/features/heading/markdownTransformer.js +22 -25
  189. package/dist/features/heading/markdownTransformer.js.map +1 -1
  190. package/dist/features/heading/server/i18n.js +96 -97
  191. package/dist/features/heading/server/i18n.js.map +1 -1
  192. package/dist/features/heading/server/index.js +49 -51
  193. package/dist/features/heading/server/index.js.map +1 -1
  194. package/dist/features/horizontalRule/client/component/index.js +81 -51
  195. package/dist/features/horizontalRule/client/component/index.js.map +1 -1
  196. package/dist/features/horizontalRule/client/index.js +48 -57
  197. package/dist/features/horizontalRule/client/index.js.map +1 -1
  198. package/dist/features/horizontalRule/client/markdownTransformer.js +15 -18
  199. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  200. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  201. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +33 -30
  202. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  203. package/dist/features/horizontalRule/client/plugin/index.js +31 -20
  204. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  205. package/dist/features/horizontalRule/server/i18n.js +96 -97
  206. package/dist/features/horizontalRule/server/i18n.js.map +1 -1
  207. package/dist/features/horizontalRule/server/index.js +17 -24
  208. package/dist/features/horizontalRule/server/index.js.map +1 -1
  209. package/dist/features/horizontalRule/server/markdownTransformer.js +15 -18
  210. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  211. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +71 -66
  212. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  213. package/dist/features/indent/client/index.js +52 -47
  214. package/dist/features/indent/client/index.js.map +1 -1
  215. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  216. package/dist/features/indent/client/toolbarIndentGroup.js +9 -8
  217. package/dist/features/indent/client/toolbarIndentGroup.js.map +1 -1
  218. package/dist/features/indent/server/i18n.js +128 -129
  219. package/dist/features/indent/server/i18n.js.map +1 -1
  220. package/dist/features/indent/server/index.js +5 -6
  221. package/dist/features/indent/server/index.js.map +1 -1
  222. package/dist/features/link/client/index.js +78 -83
  223. package/dist/features/link/client/index.js.map +1 -1
  224. package/dist/features/link/client/plugins/autoLink/index.js +267 -271
  225. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  226. package/dist/features/link/client/plugins/clickableLink/index.js +3 -3
  227. package/dist/features/link/client/plugins/clickableLink/index.js.map +1 -1
  228. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  229. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js +2 -1
  230. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  231. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +254 -276
  232. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  233. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +8 -6
  234. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  235. package/dist/features/link/client/plugins/floatingLinkEditor/types.js +1 -2
  236. package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
  237. package/dist/features/link/client/plugins/link/index.js +50 -41
  238. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  239. package/dist/features/link/markdownTransformer.js +38 -39
  240. package/dist/features/link/markdownTransformer.js.map +1 -1
  241. package/dist/features/link/nodes/AutoLinkNode.js +57 -56
  242. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  243. package/dist/features/link/nodes/LinkNode.js +277 -276
  244. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  245. package/dist/features/link/nodes/types.js +1 -2
  246. package/dist/features/link/nodes/types.js.map +1 -1
  247. package/dist/features/link/server/baseFields.js +118 -88
  248. package/dist/features/link/server/baseFields.js.map +1 -1
  249. package/dist/features/link/server/graphQLPopulationPromise.js +42 -28
  250. package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
  251. package/dist/features/link/server/i18n.js +96 -97
  252. package/dist/features/link/server/i18n.js.map +1 -1
  253. package/dist/features/link/server/index.js +120 -114
  254. package/dist/features/link/server/index.js.map +1 -1
  255. package/dist/features/link/server/transformExtraFields.js +15 -15
  256. package/dist/features/link/server/transformExtraFields.js.map +1 -1
  257. package/dist/features/link/server/validate.js +37 -26
  258. package/dist/features/link/server/validate.js.map +1 -1
  259. package/dist/features/lists/checklist/client/index.js +77 -85
  260. package/dist/features/lists/checklist/client/index.js.map +1 -1
  261. package/dist/features/lists/checklist/client/plugin/index.js +3 -3
  262. package/dist/features/lists/checklist/client/plugin/index.js.map +1 -1
  263. package/dist/features/lists/checklist/markdownTransformers.js +7 -11
  264. package/dist/features/lists/checklist/markdownTransformers.js.map +1 -1
  265. package/dist/features/lists/checklist/server/i18n.js +96 -97
  266. package/dist/features/lists/checklist/server/i18n.js.map +1 -1
  267. package/dist/features/lists/checklist/server/index.js +21 -25
  268. package/dist/features/lists/checklist/server/index.js.map +1 -1
  269. package/dist/features/lists/htmlConverter.js +54 -43
  270. package/dist/features/lists/htmlConverter.js.map +1 -1
  271. package/dist/features/lists/orderedList/client/index.js +71 -77
  272. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  273. package/dist/features/lists/orderedList/markdownTransformer.js +7 -11
  274. package/dist/features/lists/orderedList/markdownTransformer.js.map +1 -1
  275. package/dist/features/lists/orderedList/server/i18n.js +96 -97
  276. package/dist/features/lists/orderedList/server/i18n.js.map +1 -1
  277. package/dist/features/lists/orderedList/server/index.js +21 -25
  278. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  279. package/dist/features/lists/plugin/index.js +3 -3
  280. package/dist/features/lists/plugin/index.js.map +1 -1
  281. package/dist/features/lists/shared/markdown.js +48 -49
  282. package/dist/features/lists/shared/markdown.js.map +1 -1
  283. package/dist/features/lists/shared/slashMenuListGroup.js +9 -8
  284. package/dist/features/lists/shared/slashMenuListGroup.js.map +1 -1
  285. package/dist/features/lists/unorderedList/client/index.js +68 -76
  286. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  287. package/dist/features/lists/unorderedList/markdownTransformer.js +7 -11
  288. package/dist/features/lists/unorderedList/markdownTransformer.js.map +1 -1
  289. package/dist/features/lists/unorderedList/server/i18n.js +96 -97
  290. package/dist/features/lists/unorderedList/server/i18n.js.map +1 -1
  291. package/dist/features/lists/unorderedList/server/index.js +17 -23
  292. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  293. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +18 -17
  294. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +1 -1
  295. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +30 -29
  296. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +1 -1
  297. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +21 -20
  298. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +1 -1
  299. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +21 -19
  300. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +1 -1
  301. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +18 -17
  302. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +1 -1
  303. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +24 -23
  304. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +1 -1
  305. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +20 -21
  306. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  307. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +1 -10
  308. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +1 -1
  309. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +69 -61
  310. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
  311. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +1 -2
  312. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +1 -1
  313. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +5 -7
  314. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +1 -1
  315. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +42 -43
  316. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +1 -1
  317. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +1 -1
  318. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +11 -11
  319. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  320. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +64 -59
  321. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  322. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +19 -19
  323. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
  324. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +20 -25
  325. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
  326. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +28 -30
  327. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +1 -1
  328. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +26 -26
  329. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
  330. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +22 -21
  331. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
  332. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +22 -22
  333. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
  334. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +12 -13
  335. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  336. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +23 -23
  337. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
  338. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +22 -22
  339. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
  340. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +15 -16
  341. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  342. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +1 -13
  343. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +1 -1
  344. package/dist/features/migrations/slateToLexical/converter/index.js +105 -98
  345. package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
  346. package/dist/features/migrations/slateToLexical/converter/types.js +1 -2
  347. package/dist/features/migrations/slateToLexical/converter/types.js.map +1 -1
  348. package/dist/features/migrations/slateToLexical/feature.client.js +7 -7
  349. package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
  350. package/dist/features/migrations/slateToLexical/feature.server.js +43 -44
  351. package/dist/features/migrations/slateToLexical/feature.server.js.map +1 -1
  352. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +1 -1
  353. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +11 -11
  354. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  355. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +64 -59
  356. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  357. package/dist/features/paragraph/client/index.js +58 -61
  358. package/dist/features/paragraph/client/index.js.map +1 -1
  359. package/dist/features/paragraph/server/i18n.js +128 -129
  360. package/dist/features/paragraph/server/i18n.js.map +1 -1
  361. package/dist/features/paragraph/server/index.js +6 -7
  362. package/dist/features/paragraph/server/index.js.map +1 -1
  363. package/dist/features/relationship/client/components/RelationshipComponent.js +141 -149
  364. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  365. package/dist/features/relationship/client/drawer/commands.js +0 -1
  366. package/dist/features/relationship/client/drawer/commands.js.map +1 -1
  367. package/dist/features/relationship/client/drawer/index.js +138 -67
  368. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  369. package/dist/features/relationship/client/index.js +53 -59
  370. package/dist/features/relationship/client/index.js.map +1 -1
  371. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  372. package/dist/features/relationship/client/nodes/RelationshipNode.js +60 -59
  373. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  374. package/dist/features/relationship/client/plugins/index.js +90 -35
  375. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  376. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.d.ts.map +1 -1
  377. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +97 -26
  378. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
  379. package/dist/features/relationship/server/graphQLPopulationPromise.js +34 -26
  380. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  381. package/dist/features/relationship/server/i18n.js +96 -97
  382. package/dist/features/relationship/server/i18n.js.map +1 -1
  383. package/dist/features/relationship/server/index.js +48 -44
  384. package/dist/features/relationship/server/index.js.map +1 -1
  385. package/dist/features/relationship/server/nodes/RelationshipNode.js +90 -87
  386. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  387. package/dist/features/shared/slashMenu/basicGroup.js +9 -8
  388. package/dist/features/shared/slashMenu/basicGroup.js.map +1 -1
  389. package/dist/features/shared/toolbar/addDropdownGroup.js +8 -9
  390. package/dist/features/shared/toolbar/addDropdownGroup.js.map +1 -1
  391. package/dist/features/shared/toolbar/featureButtonsGroup.js +7 -8
  392. package/dist/features/shared/toolbar/featureButtonsGroup.js.map +1 -1
  393. package/dist/features/shared/toolbar/textDropdownGroup.js +8 -9
  394. package/dist/features/shared/toolbar/textDropdownGroup.js.map +1 -1
  395. package/dist/features/toolbars/fixed/client/Toolbar/index.js +264 -187
  396. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  397. package/dist/features/toolbars/fixed/client/index.js +5 -7
  398. package/dist/features/toolbars/fixed/client/index.js.map +1 -1
  399. package/dist/features/toolbars/fixed/server/index.js +14 -13
  400. package/dist/features/toolbars/fixed/server/index.js.map +1 -1
  401. package/dist/features/toolbars/inline/client/Toolbar/index.js +374 -286
  402. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  403. package/dist/features/toolbars/inline/client/index.js +5 -7
  404. package/dist/features/toolbars/inline/client/index.js.map +1 -1
  405. package/dist/features/toolbars/inline/server/index.js +4 -5
  406. package/dist/features/toolbars/inline/server/index.js.map +1 -1
  407. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  408. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  409. package/dist/features/toolbars/shared/ToolbarButton/index.js +75 -97
  410. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  411. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +190 -211
  412. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  413. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  414. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  415. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +289 -124
  416. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  417. package/dist/features/toolbars/types.js +1 -2
  418. package/dist/features/toolbars/types.js.map +1 -1
  419. package/dist/features/typeUtilities.js +2 -3
  420. package/dist/features/typeUtilities.js.map +1 -1
  421. package/dist/features/typesClient.js +1 -2
  422. package/dist/features/typesClient.js.map +1 -1
  423. package/dist/features/typesServer.js +1 -2
  424. package/dist/features/typesServer.js.map +1 -1
  425. package/dist/features/upload/client/component/index.js +208 -224
  426. package/dist/features/upload/client/component/index.js.map +1 -1
  427. package/dist/features/upload/client/drawer/commands.js +1 -1
  428. package/dist/features/upload/client/drawer/commands.js.map +1 -1
  429. package/dist/features/upload/client/drawer/index.js +107 -58
  430. package/dist/features/upload/client/drawer/index.js.map +1 -1
  431. package/dist/features/upload/client/feature.client.js +51 -61
  432. package/dist/features/upload/client/feature.client.js.map +1 -1
  433. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  434. package/dist/features/upload/client/nodes/UploadNode.js +76 -73
  435. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  436. package/dist/features/upload/client/plugin/index.js +67 -39
  437. package/dist/features/upload/client/plugin/index.js.map +1 -1
  438. package/dist/features/upload/server/feature.server.js +190 -171
  439. package/dist/features/upload/server/feature.server.js.map +1 -1
  440. package/dist/features/upload/server/graphQLPopulationPromise.js +60 -47
  441. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  442. package/dist/features/upload/server/i18n.js +96 -97
  443. package/dist/features/upload/server/i18n.js.map +1 -1
  444. package/dist/features/upload/server/nodes/UploadNode.js +113 -108
  445. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  446. package/dist/features/upload/server/validate.js +53 -40
  447. package/dist/features/upload/server/validate.js.map +1 -1
  448. package/dist/field/Field.d.ts.map +1 -1
  449. package/dist/field/Field.js +127 -105
  450. package/dist/field/Field.js.map +1 -1
  451. package/dist/field/bundled.css +1 -0
  452. package/dist/field/index.js +92 -36
  453. package/dist/field/index.js.map +1 -1
  454. package/dist/i18n.js +160 -161
  455. package/dist/i18n.js.map +1 -1
  456. package/dist/index.js +670 -623
  457. package/dist/index.js.map +1 -1
  458. package/dist/lexical/EditorPlugin.d.ts.map +1 -1
  459. package/dist/lexical/EditorPlugin.js +15 -10
  460. package/dist/lexical/EditorPlugin.js.map +1 -1
  461. package/dist/lexical/LexicalEditor.js +206 -161
  462. package/dist/lexical/LexicalEditor.js.map +1 -1
  463. package/dist/lexical/LexicalProvider.js +83 -82
  464. package/dist/lexical/LexicalProvider.js.map +1 -1
  465. package/dist/lexical/config/client/EditorConfigProvider.js +76 -79
  466. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  467. package/dist/lexical/config/client/default.js +3 -3
  468. package/dist/lexical/config/client/default.js.map +1 -1
  469. package/dist/lexical/config/client/loader.js +42 -39
  470. package/dist/lexical/config/client/loader.js.map +1 -1
  471. package/dist/lexical/config/client/sanitize.js +165 -165
  472. package/dist/lexical/config/client/sanitize.js.map +1 -1
  473. package/dist/lexical/config/server/default.js +5 -27
  474. package/dist/lexical/config/server/default.js.map +1 -1
  475. package/dist/lexical/config/server/loader.js +103 -103
  476. package/dist/lexical/config/server/loader.js.map +1 -1
  477. package/dist/lexical/config/server/sanitize.js +98 -99
  478. package/dist/lexical/config/server/sanitize.js.map +1 -1
  479. package/dist/lexical/config/types.js +1 -2
  480. package/dist/lexical/config/types.js.map +1 -1
  481. package/dist/lexical/nodes/index.js +9 -8
  482. package/dist/lexical/nodes/index.js.map +1 -1
  483. package/dist/lexical/plugins/MarkdownShortcut/index.js +17 -5
  484. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  485. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +384 -361
  486. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  487. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +223 -160
  488. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  489. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -2
  490. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  491. package/dist/lexical/plugins/SlashMenu/index.js +191 -179
  492. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  493. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.d.ts.map +1 -1
  494. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js +41 -26
  495. package/dist/lexical/plugins/SlashMenu/useMenuTriggerMatch.js.map +1 -1
  496. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +164 -129
  497. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  498. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  499. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +11 -10
  500. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
  501. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.d.ts.map +1 -1
  502. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +11 -10
  503. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
  504. package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  505. package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js +27 -23
  506. package/dist/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  507. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +331 -300
  508. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  509. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +110 -97
  510. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  511. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  512. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +23 -16
  513. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -1
  514. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -1
  515. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +18 -27
  516. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
  517. package/dist/lexical/plugins/handles/utils/getCollapsedMargins.d.ts.map +1 -1
  518. package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js +15 -11
  519. package/dist/lexical/plugins/handles/utils/getCollapsedMargins.js.map +1 -1
  520. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
  521. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +133 -118
  522. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
  523. package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  524. package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +3 -2
  525. package/dist/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  526. package/dist/lexical/plugins/handles/utils/isOnHandleElement.d.ts.map +1 -1
  527. package/dist/lexical/plugins/handles/utils/isOnHandleElement.js +3 -2
  528. package/dist/lexical/plugins/handles/utils/isOnHandleElement.js.map +1 -1
  529. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  530. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +26 -25
  531. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  532. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  533. package/dist/lexical/theme/EditorTheme.js +97 -102
  534. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  535. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  536. package/dist/lexical/ui/ContentEditable.js +27 -10
  537. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  538. package/dist/lexical/ui/icons/AI/index.d.ts.map +1 -1
  539. package/dist/lexical/ui/icons/AI/index.js +31 -33
  540. package/dist/lexical/ui/icons/AI/index.js.map +1 -1
  541. package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
  542. package/dist/lexical/ui/icons/Add/index.js +16 -18
  543. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  544. package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
  545. package/dist/lexical/ui/icons/AlignCenter/index.js +25 -28
  546. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  547. package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
  548. package/dist/lexical/ui/icons/AlignJustify/index.js +25 -28
  549. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  550. package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
  551. package/dist/lexical/ui/icons/AlignLeft/index.js +25 -28
  552. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  553. package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
  554. package/dist/lexical/ui/icons/AlignRight/index.js +25 -28
  555. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  556. package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
  557. package/dist/lexical/ui/icons/Block/index.js +34 -37
  558. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  559. package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
  560. package/dist/lexical/ui/icons/Blockquote/index.js +16 -15
  561. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  562. package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
  563. package/dist/lexical/ui/icons/Bold/index.js +16 -15
  564. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  565. package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
  566. package/dist/lexical/ui/icons/Checklist/index.js +24 -26
  567. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  568. package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
  569. package/dist/lexical/ui/icons/Code/index.js +19 -21
  570. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  571. package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
  572. package/dist/lexical/ui/icons/CodeBlock/index.js +19 -21
  573. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  574. package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
  575. package/dist/lexical/ui/icons/H1/index.js +16 -15
  576. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  577. package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
  578. package/dist/lexical/ui/icons/H2/index.js +16 -15
  579. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  580. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  581. package/dist/lexical/ui/icons/H3/index.js +16 -15
  582. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  583. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  584. package/dist/lexical/ui/icons/H4/index.js +16 -15
  585. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  586. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  587. package/dist/lexical/ui/icons/H5/index.js +16 -15
  588. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  589. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  590. package/dist/lexical/ui/icons/H6/index.js +16 -15
  591. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  592. package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
  593. package/dist/lexical/ui/icons/HorizontalRule/index.js +19 -18
  594. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  595. package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
  596. package/dist/lexical/ui/icons/IndentDecrease/index.js +28 -32
  597. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  598. package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
  599. package/dist/lexical/ui/icons/IndentIncrease/index.js +28 -32
  600. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  601. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
  602. package/dist/lexical/ui/icons/InlineBlocks/index.js +18 -17
  603. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
  604. package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
  605. package/dist/lexical/ui/icons/Italic/index.js +16 -15
  606. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  607. package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
  608. package/dist/lexical/ui/icons/Link/index.js +17 -16
  609. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  610. package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
  611. package/dist/lexical/ui/icons/Meatballs/index.js +19 -22
  612. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
  613. package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
  614. package/dist/lexical/ui/icons/OrderedList/index.js +31 -36
  615. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  616. package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
  617. package/dist/lexical/ui/icons/Relationship/index.js +31 -33
  618. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  619. package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
  620. package/dist/lexical/ui/icons/Strikethrough/index.js +19 -21
  621. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  622. package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
  623. package/dist/lexical/ui/icons/Subscript/index.js +16 -15
  624. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  625. package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
  626. package/dist/lexical/ui/icons/Superscript/index.js +16 -15
  627. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  628. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
  629. package/dist/lexical/ui/icons/Table/index.js +17 -16
  630. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  631. package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
  632. package/dist/lexical/ui/icons/Text/index.js +16 -15
  633. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  634. package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
  635. package/dist/lexical/ui/icons/Underline/index.js +19 -21
  636. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  637. package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
  638. package/dist/lexical/ui/icons/UnorderedList/index.js +46 -52
  639. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  640. package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
  641. package/dist/lexical/ui/icons/Upload/index.js +28 -31
  642. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  643. package/dist/lexical/utils/canUseDOM.d.ts.map +1 -1
  644. package/dist/lexical/utils/canUseDOM.js +2 -1
  645. package/dist/lexical/utils/canUseDOM.js.map +1 -1
  646. package/dist/lexical/utils/environment.d.ts.map +1 -1
  647. package/dist/lexical/utils/environment.js +2 -1
  648. package/dist/lexical/utils/environment.js.map +1 -1
  649. package/dist/lexical/utils/getDOMRangeRect.d.ts.map +1 -1
  650. package/dist/lexical/utils/getDOMRangeRect.js +13 -12
  651. package/dist/lexical/utils/getDOMRangeRect.js.map +1 -1
  652. package/dist/lexical/utils/getSelectedNode.d.ts.map +1 -1
  653. package/dist/lexical/utils/getSelectedNode.js +18 -13
  654. package/dist/lexical/utils/getSelectedNode.js.map +1 -1
  655. package/dist/lexical/utils/guard.d.ts.map +1 -1
  656. package/dist/lexical/utils/guard.js +3 -2
  657. package/dist/lexical/utils/guard.js.map +1 -1
  658. package/dist/lexical/utils/joinClasses.d.ts.map +1 -1
  659. package/dist/lexical/utils/joinClasses.js +3 -2
  660. package/dist/lexical/utils/joinClasses.js.map +1 -1
  661. package/dist/lexical/utils/markdown/createBlockNode.js +9 -10
  662. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  663. package/dist/lexical/utils/nodeFormat.js +58 -59
  664. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  665. package/dist/lexical/utils/point.d.ts.map +1 -1
  666. package/dist/lexical/utils/point.js +40 -32
  667. package/dist/lexical/utils/point.js.map +1 -1
  668. package/dist/lexical/utils/rect.d.ts.map +1 -1
  669. package/dist/lexical/utils/rect.js +167 -134
  670. package/dist/lexical/utils/rect.js.map +1 -1
  671. package/dist/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  672. package/dist/lexical/utils/setFloatingElemPosition.js +56 -45
  673. package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
  674. package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.d.ts.map +1 -1
  675. package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js +23 -22
  676. package/dist/lexical/utils/setFloatingElemPositionForLinkEditor.js.map +1 -1
  677. package/dist/lexical/utils/swipe.d.ts.map +1 -1
  678. package/dist/lexical/utils/swipe.js +82 -83
  679. package/dist/lexical/utils/swipe.js.map +1 -1
  680. package/dist/lexical/utils/url.js +23 -22
  681. package/dist/lexical/utils/url.js.map +1 -1
  682. package/dist/nodeTypes.js +1 -2
  683. package/dist/nodeTypes.js.map +1 -1
  684. package/dist/populateGraphQL/defaultValue.js +24 -29
  685. package/dist/populateGraphQL/defaultValue.js.map +1 -1
  686. package/dist/populateGraphQL/populate.js +35 -25
  687. package/dist/populateGraphQL/populate.js.map +1 -1
  688. package/dist/populateGraphQL/populateLexicalPopulationPromises.js +47 -32
  689. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  690. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js +39 -25
  691. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
  692. package/dist/types.js +1 -2
  693. package/dist/types.js.map +1 -1
  694. package/dist/utilities/createClientFeature.js +40 -36
  695. package/dist/utilities/createClientFeature.js.map +1 -1
  696. package/dist/utilities/createServerFeature.js +46 -35
  697. package/dist/utilities/createServerFeature.js.map +1 -1
  698. package/dist/utilities/fieldsDrawer/Drawer.js +28 -17
  699. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  700. package/dist/utilities/fieldsDrawer/DrawerContent.js +149 -78
  701. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  702. package/dist/utilities/forEachNodeRecursively.js +24 -19
  703. package/dist/utilities/forEachNodeRecursively.js.map +1 -1
  704. package/dist/utilities/generateComponentMap.d.ts.map +1 -1
  705. package/dist/utilities/generateComponentMap.js +92 -82
  706. package/dist/utilities/generateComponentMap.js.map +1 -1
  707. package/dist/utilities/generateImportMap.js +53 -47
  708. package/dist/utilities/generateImportMap.js.map +1 -1
  709. package/dist/utilities/generateSchemaMap.js +35 -30
  710. package/dist/utilities/generateSchemaMap.js.map +1 -1
  711. package/dist/utilities/migrateSlateToLexical/index.js +99 -86
  712. package/dist/utilities/migrateSlateToLexical/index.js.map +1 -1
  713. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +73 -66
  714. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
  715. package/dist/utilities/recurseNodeTree.js +25 -22
  716. package/dist/utilities/recurseNodeTree.js.map +1 -1
  717. package/dist/utilities/upgradeLexicalData/index.js +99 -86
  718. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  719. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +71 -66
  720. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  721. package/dist/utilities/useLexicalFeature.js +9 -8
  722. package/dist/utilities/useLexicalFeature.js.map +1 -1
  723. package/dist/validate/index.js +32 -26
  724. package/dist/validate/index.js.map +1 -1
  725. package/dist/validate/validateNodes.js +31 -28
  726. package/dist/validate/validateNodes.js.map +1 -1
  727. package/package.json +22 -11
  728. package/dist/exports/client/Component-7HS6FEJS.js +0 -2
  729. package/dist/exports/client/Component-7HS6FEJS.js.map +0 -7
  730. package/dist/exports/client/Component-LAKSCIDX.js +0 -2
  731. package/dist/exports/client/Component-LAKSCIDX.js.map +0 -7
  732. package/dist/exports/client/Field-BYB3WX7J.js +0 -2
  733. package/dist/exports/client/Field-BYB3WX7J.js.map +0 -7
  734. package/dist/exports/client/RelationshipComponent-GYUTPDNG.js +0 -2
  735. package/dist/exports/client/RelationshipComponent-GYUTPDNG.js.map +0 -7
  736. package/dist/exports/client/chunk-4EX7W4UX.js +0 -2
  737. package/dist/exports/client/chunk-4EX7W4UX.js.map +0 -7
  738. package/dist/exports/client/chunk-E4HH5PS6.js +0 -2
  739. package/dist/exports/client/chunk-E4HH5PS6.js.map +0 -7
  740. package/dist/exports/client/chunk-EBB2CEB6.js +0 -2
  741. package/dist/exports/client/chunk-EBB2CEB6.js.map +0 -7
  742. package/dist/exports/client/chunk-LTR7V74A.js +0 -2
  743. package/dist/exports/client/chunk-LTR7V74A.js.map +0 -7
  744. package/dist/exports/client/chunk-SQHN3N6E.js +0 -2
  745. package/dist/exports/client/chunk-VMCQSR3T.js +0 -3
  746. package/dist/exports/client/chunk-VMCQSR3T.js.map +0 -7
  747. package/dist/exports/client/component-6C5JERGA.js +0 -2
  748. package/dist/exports/client/component-6C5JERGA.js.map +0 -7
  749. package/dist/exports/client/component-GUWIGB77.js +0 -2
  750. package/dist/exports/client/component-GUWIGB77.js.map +0 -7
  751. package/dist/exports/client/component-UQ2BKD5X.js +0 -2
  752. package/dist/exports/client/component-UQ2BKD5X.js.map +0 -7
  753. package/dist/exports/client/componentInline-C2XIK5VZ.js +0 -2
  754. package/dist/exports/client/componentInline-C2XIK5VZ.js.map +0 -7
  755. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts +0 -12
  756. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  757. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js +0 -181
  758. package/dist/features/experimental_table/plugins/TableHoverActionsPlugin/index.js.map +0 -1
@@ -1,4 +1,6 @@
1
1
  'use client';
2
+
3
+ import { c as _c } from "react/compiler-runtime";
2
4
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
5
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
4
6
  import { useScrollInfo, useThrottledEffect, useTranslation } from '@payloadcms/ui';
@@ -7,203 +9,278 @@ import { useMemo } from 'react';
7
9
  import { useEditorConfigContext } from '../../../../../lexical/config/client/EditorConfigProvider.js';
8
10
  import { ToolbarButton } from '../../../shared/ToolbarButton/index.js';
9
11
  import { ToolbarDropdown } from '../../../shared/ToolbarDropdown/index.js';
10
- function ButtonGroupItem({ anchorElem, editor, item }) {
11
- if (item.Component) {
12
- return item?.Component && /*#__PURE__*/ _jsx(item.Component, {
13
- anchorElem: anchorElem,
14
- editor: editor,
15
- item: item
16
- }, item.key);
17
- }
18
- return /*#__PURE__*/ _jsx(ToolbarButton, {
19
- editor: editor,
20
- item: item,
21
- children: item?.ChildComponent && /*#__PURE__*/ _jsx(item.ChildComponent, {})
12
+ function ButtonGroupItem({
13
+ anchorElem,
14
+ editor,
15
+ item
16
+ }) {
17
+ if (item.Component) {
18
+ return item?.Component && /*#__PURE__*/_jsx(item.Component, {
19
+ anchorElem: anchorElem,
20
+ editor: editor,
21
+ item: item
22
22
  }, item.key);
23
+ }
24
+ return /*#__PURE__*/_jsx(ToolbarButton, {
25
+ editor: editor,
26
+ item: item,
27
+ children: item?.ChildComponent && /*#__PURE__*/_jsx(item.ChildComponent, {})
28
+ }, item.key);
23
29
  }
24
- function ToolbarGroupComponent({ anchorElem, editor, editorConfig, group, index }) {
25
- const { i18n } = useTranslation();
26
- const { field: { richTextComponentMap } } = useEditorConfigContext();
27
- const [dropdownLabel, setDropdownLabel] = React.useState(null);
28
- const [DropdownIcon, setDropdownIcon] = React.useState(null);
29
- React.useEffect(()=>{
30
- if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {
31
- setDropdownIcon(()=>group.ChildComponent);
30
+ function ToolbarGroupComponent(t0) {
31
+ const $ = _c(27);
32
+ const {
33
+ anchorElem,
34
+ editor,
35
+ editorConfig,
36
+ group,
37
+ index
38
+ } = t0;
39
+ const {
40
+ i18n
41
+ } = useTranslation();
42
+ const {
43
+ field: t1
44
+ } = useEditorConfigContext();
45
+ const {
46
+ richTextComponentMap
47
+ } = t1;
48
+ const [dropdownLabel, setDropdownLabel] = React.useState(null);
49
+ const [DropdownIcon, setDropdownIcon] = React.useState(null);
50
+ let t2;
51
+ let t3;
52
+ if ($[0] !== group) {
53
+ t2 = () => {
54
+ if (group?.type === "dropdown" && group.items.length && group.ChildComponent) {
55
+ setDropdownIcon(() => group.ChildComponent);
56
+ } else {
57
+ setDropdownIcon(null);
58
+ }
59
+ };
60
+ t3 = [group];
61
+ $[0] = group;
62
+ $[1] = t2;
63
+ $[2] = t3;
64
+ } else {
65
+ t2 = $[1];
66
+ t3 = $[2];
67
+ }
68
+ React.useEffect(t2, t3);
69
+ let t4;
70
+ if ($[3] !== group || $[4] !== i18n || $[5] !== richTextComponentMap) {
71
+ t4 = t5 => {
72
+ const {
73
+ activeItems
74
+ } = t5;
75
+ if (!activeItems.length) {
76
+ if (group?.type === "dropdown" && group.items.length && group.ChildComponent) {
77
+ setDropdownIcon(() => group.ChildComponent);
78
+ setDropdownLabel(null);
32
79
  } else {
33
- setDropdownIcon(null);
34
- }
35
- }, [
36
- group
37
- ]);
38
- const onActiveChange = ({ activeItems })=>{
39
- if (!activeItems.length) {
40
- if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {
41
- setDropdownIcon(()=>group.ChildComponent);
42
- setDropdownLabel(null);
43
- } else {
44
- setDropdownIcon(null);
45
- setDropdownLabel(null);
46
- }
47
- return;
48
- }
49
- const item = activeItems[0];
50
- let label = item.key;
51
- if (item.label) {
52
- label = typeof item.label === 'function' ? item.label({
53
- i18n,
54
- richTextComponentMap
55
- }) : item.label;
56
- }
57
- // Crop title to max. 25 characters
58
- if (label.length > 25) {
59
- label = label.substring(0, 25) + '...';
80
+ setDropdownIcon(null);
81
+ setDropdownLabel(null);
60
82
  }
61
- setDropdownLabel(label);
62
- setDropdownIcon(()=>item.ChildComponent);
83
+ return;
84
+ }
85
+ const item = activeItems[0];
86
+ let label = item.key;
87
+ if (item.label) {
88
+ label = typeof item.label === "function" ? item.label({
89
+ i18n,
90
+ richTextComponentMap
91
+ }) : item.label;
92
+ }
93
+ if (label.length > 25) {
94
+ label = label.substring(0, 25) + "...";
95
+ }
96
+ setDropdownLabel(label);
97
+ setDropdownIcon(() => item.ChildComponent);
63
98
  };
64
- return /*#__PURE__*/ _jsxs("div", {
65
- className: `fixed-toolbar__group fixed-toolbar__group-${group.key}`,
66
- children: [
67
- group.type === 'dropdown' && group.items.length && (DropdownIcon ? /*#__PURE__*/ _jsx(ToolbarDropdown, {
68
- Icon: DropdownIcon,
69
- anchorElem: anchorElem,
70
- editor: editor,
71
- groupKey: group.key,
72
- items: group.items,
73
- itemsContainerClassNames: [
74
- 'fixed-toolbar__dropdown-items'
75
- ],
76
- label: dropdownLabel,
77
- maxActiveItems: 1,
78
- onActiveChange: onActiveChange
79
- }) : /*#__PURE__*/ _jsx(ToolbarDropdown, {
80
- anchorElem: anchorElem,
81
- editor: editor,
82
- groupKey: group.key,
83
- items: group.items,
84
- itemsContainerClassNames: [
85
- 'fixed-toolbar__dropdown-items'
86
- ],
87
- label: dropdownLabel,
88
- maxActiveItems: 1,
89
- onActiveChange: onActiveChange
90
- })),
91
- group.type === 'buttons' && group.items.length && group.items.map((item)=>{
92
- return /*#__PURE__*/ _jsx(ButtonGroupItem, {
93
- anchorElem: anchorElem,
94
- editor: editor,
95
- item: item
96
- }, item.key);
97
- }),
98
- index < editorConfig.features.toolbarFixed?.groups.length - 1 && /*#__PURE__*/ _jsx("div", {
99
- className: "divider"
100
- })
101
- ]
99
+ $[3] = group;
100
+ $[4] = i18n;
101
+ $[5] = richTextComponentMap;
102
+ $[6] = t4;
103
+ } else {
104
+ t4 = $[6];
105
+ }
106
+ const onActiveChange = t4;
107
+ const t5 = `fixed-toolbar__group fixed-toolbar__group-${group.key}`;
108
+ let t6;
109
+ if ($[7] !== group.type || $[8] !== group.items || $[9] !== group.key || $[10] !== DropdownIcon || $[11] !== anchorElem || $[12] !== editor || $[13] !== dropdownLabel || $[14] !== onActiveChange) {
110
+ t6 = group.type === "dropdown" && group.items.length && (DropdownIcon ? _jsx(ToolbarDropdown, {
111
+ Icon: DropdownIcon,
112
+ anchorElem,
113
+ editor,
114
+ groupKey: group.key,
115
+ items: group.items,
116
+ itemsContainerClassNames: ["fixed-toolbar__dropdown-items"],
117
+ label: dropdownLabel,
118
+ maxActiveItems: 1,
119
+ onActiveChange
120
+ }) : _jsx(ToolbarDropdown, {
121
+ anchorElem,
122
+ editor,
123
+ groupKey: group.key,
124
+ items: group.items,
125
+ itemsContainerClassNames: ["fixed-toolbar__dropdown-items"],
126
+ label: dropdownLabel,
127
+ maxActiveItems: 1,
128
+ onActiveChange
129
+ }));
130
+ $[7] = group.type;
131
+ $[8] = group.items;
132
+ $[9] = group.key;
133
+ $[10] = DropdownIcon;
134
+ $[11] = anchorElem;
135
+ $[12] = editor;
136
+ $[13] = dropdownLabel;
137
+ $[14] = onActiveChange;
138
+ $[15] = t6;
139
+ } else {
140
+ t6 = $[15];
141
+ }
142
+ let t7;
143
+ if ($[16] !== group || $[17] !== anchorElem || $[18] !== editor) {
144
+ t7 = group.type === "buttons" && group.items.length && group.items.map(item_0 => _jsx(ButtonGroupItem, {
145
+ anchorElem,
146
+ editor,
147
+ item: item_0
148
+ }, item_0.key));
149
+ $[16] = group;
150
+ $[17] = anchorElem;
151
+ $[18] = editor;
152
+ $[19] = t7;
153
+ } else {
154
+ t7 = $[19];
155
+ }
156
+ let t8;
157
+ if ($[20] !== editorConfig.features.toolbarFixed || $[21] !== index || $[22] !== t6 || $[23] !== t7 || $[24] !== t5 || $[25] !== group.key) {
158
+ t8 = _jsxs("div", {
159
+ className: t5,
160
+ children: [t6, t7, index < editorConfig.features.toolbarFixed?.groups.length - 1 && _jsx("div", {
161
+ className: "divider"
162
+ })]
102
163
  }, group.key);
164
+ $[20] = editorConfig.features.toolbarFixed;
165
+ $[21] = index;
166
+ $[22] = t6;
167
+ $[23] = t7;
168
+ $[24] = t5;
169
+ $[25] = group.key;
170
+ $[26] = t8;
171
+ } else {
172
+ t8 = $[26];
173
+ }
174
+ return t8;
103
175
  }
104
- function FixedToolbar({ anchorElem, clientProps, editor, editorConfig, parentWithFixedToolbar }) {
105
- const currentToolbarRef = React.useRef(null);
106
- const { y } = useScrollInfo();
107
- // Memoize the parent toolbar element
108
- const parentToolbarElem = useMemo(()=>{
109
- if (!parentWithFixedToolbar || clientProps?.disableIfParentHasFixedToolbar) {
110
- return null;
111
- }
112
- const parentEditorElem = parentWithFixedToolbar.editorContainerRef.current;
113
- let sibling = parentEditorElem.previousElementSibling;
114
- while(sibling){
115
- if (sibling.classList.contains('fixed-toolbar')) {
116
- return sibling;
117
- }
118
- sibling = sibling.previousElementSibling;
119
- }
120
- return null;
121
- }, [
122
- clientProps?.disableIfParentHasFixedToolbar,
123
- parentWithFixedToolbar
124
- ]);
125
- useThrottledEffect(()=>{
126
- if (!parentToolbarElem) {
127
- // this also checks for clientProps?.disableIfParentHasFixedToolbar indirectly, see the parentToolbarElem useMemo
128
- return;
129
- }
130
- const currentToolbarElem = currentToolbarRef.current;
131
- if (!currentToolbarElem) {
132
- return;
133
- }
134
- const currentRect = currentToolbarElem.getBoundingClientRect();
135
- const parentRect = parentToolbarElem.getBoundingClientRect();
136
- // we only need to check for vertical overlap
137
- const overlapping = !(currentRect.bottom < parentRect.top || currentRect.top > parentRect.bottom);
138
- if (overlapping) {
139
- currentToolbarRef.current.className = 'fixed-toolbar fixed-toolbar--overlapping';
140
- parentToolbarElem.className = 'fixed-toolbar fixed-toolbar--hide';
141
- } else {
142
- if (!currentToolbarRef.current.classList.contains('fixed-toolbar--overlapping')) {
143
- return;
144
- }
145
- currentToolbarRef.current.className = 'fixed-toolbar';
146
- parentToolbarElem.className = 'fixed-toolbar';
147
- }
148
- }, 50, [
149
- currentToolbarRef,
150
- parentToolbarElem,
151
- y
152
- ]);
153
- return /*#__PURE__*/ _jsx("div", {
154
- className: "fixed-toolbar",
155
- onFocus: (event)=>{
156
- // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,
157
- // the parent editor will be focused, and the child editor will lose focus.
158
- event.stopPropagation();
159
- },
160
- ref: currentToolbarRef,
161
- children: editor.isEditable() && /*#__PURE__*/ _jsx(React.Fragment, {
162
- children: editorConfig?.features && editorConfig.features?.toolbarFixed?.groups.map((group, i)=>{
163
- return /*#__PURE__*/ _jsx(ToolbarGroupComponent, {
164
- anchorElem: anchorElem,
165
- editor: editor,
166
- editorConfig: editorConfig,
167
- group: group,
168
- index: i
169
- }, group.key);
170
- })
171
- })
172
- });
176
+ function FixedToolbar({
177
+ anchorElem,
178
+ clientProps,
179
+ editor,
180
+ editorConfig,
181
+ parentWithFixedToolbar
182
+ }) {
183
+ const currentToolbarRef = React.useRef(null);
184
+ const {
185
+ y
186
+ } = useScrollInfo();
187
+ // Memoize the parent toolbar element
188
+ const parentToolbarElem = useMemo(() => {
189
+ if (!parentWithFixedToolbar || clientProps?.disableIfParentHasFixedToolbar) {
190
+ return null;
191
+ }
192
+ const parentEditorElem = parentWithFixedToolbar.editorContainerRef.current;
193
+ let sibling = parentEditorElem.previousElementSibling;
194
+ while (sibling) {
195
+ if (sibling.classList.contains('fixed-toolbar')) {
196
+ return sibling;
197
+ }
198
+ sibling = sibling.previousElementSibling;
199
+ }
200
+ return null;
201
+ }, [clientProps?.disableIfParentHasFixedToolbar, parentWithFixedToolbar]);
202
+ useThrottledEffect(() => {
203
+ if (!parentToolbarElem) {
204
+ // this also checks for clientProps?.disableIfParentHasFixedToolbar indirectly, see the parentToolbarElem useMemo
205
+ return;
206
+ }
207
+ const currentToolbarElem = currentToolbarRef.current;
208
+ if (!currentToolbarElem) {
209
+ return;
210
+ }
211
+ const currentRect = currentToolbarElem.getBoundingClientRect();
212
+ const parentRect = parentToolbarElem.getBoundingClientRect();
213
+ // we only need to check for vertical overlap
214
+ const overlapping = !(currentRect.bottom < parentRect.top || currentRect.top > parentRect.bottom);
215
+ if (overlapping) {
216
+ currentToolbarRef.current.className = 'fixed-toolbar fixed-toolbar--overlapping';
217
+ parentToolbarElem.className = 'fixed-toolbar fixed-toolbar--hide';
218
+ } else {
219
+ if (!currentToolbarRef.current.classList.contains('fixed-toolbar--overlapping')) {
220
+ return;
221
+ }
222
+ currentToolbarRef.current.className = 'fixed-toolbar';
223
+ parentToolbarElem.className = 'fixed-toolbar';
224
+ }
225
+ }, 50, [currentToolbarRef, parentToolbarElem, y]);
226
+ return /*#__PURE__*/_jsx("div", {
227
+ className: "fixed-toolbar",
228
+ onFocus: event => {
229
+ // Prevent other focus events being triggered. Otherwise, if this was to be clicked while in a child editor,
230
+ // the parent editor will be focused, and the child editor will lose focus.
231
+ event.stopPropagation();
232
+ },
233
+ ref: currentToolbarRef,
234
+ children: editor.isEditable() && /*#__PURE__*/_jsx(React.Fragment, {
235
+ children: editorConfig?.features && editorConfig.features?.toolbarFixed?.groups.map((group, i) => {
236
+ return /*#__PURE__*/_jsx(ToolbarGroupComponent, {
237
+ anchorElem: anchorElem,
238
+ editor: editor,
239
+ editorConfig: editorConfig,
240
+ group: group,
241
+ index: i
242
+ }, group.key);
243
+ })
244
+ })
245
+ });
173
246
  }
174
- const getParentEditorWithFixedToolbar = (editorConfigContext)=>{
175
- if (editorConfigContext.parentEditor?.editorConfig) {
176
- if (editorConfigContext.parentEditor?.editorConfig.resolvedFeatureMap.has('toolbarFixed')) {
177
- return editorConfigContext.parentEditor;
178
- } else {
179
- if (editorConfigContext.parentEditor) {
180
- return getParentEditorWithFixedToolbar(editorConfigContext.parentEditor);
181
- }
182
- }
247
+ const getParentEditorWithFixedToolbar = editorConfigContext => {
248
+ if (editorConfigContext.parentEditor?.editorConfig) {
249
+ if (editorConfigContext.parentEditor?.editorConfig.resolvedFeatureMap.has('toolbarFixed')) {
250
+ return editorConfigContext.parentEditor;
251
+ } else {
252
+ if (editorConfigContext.parentEditor) {
253
+ return getParentEditorWithFixedToolbar(editorConfigContext.parentEditor);
254
+ }
183
255
  }
184
- return false;
256
+ }
257
+ return false;
185
258
  };
186
- export const FixedToolbarPlugin = ({ anchorElem, clientProps })=>{
187
- const [currentEditor] = useLexicalComposerContext();
188
- const editorConfigContext = useEditorConfigContext();
189
- const { editorConfig: currentEditorConfig } = editorConfigContext;
190
- const editor = clientProps.applyToFocusedEditor ? editorConfigContext.focusedEditor?.editor || currentEditor : currentEditor;
191
- const editorConfig = clientProps.applyToFocusedEditor ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig : currentEditorConfig;
192
- const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext);
193
- if (clientProps?.disableIfParentHasFixedToolbar) {
194
- if (parentWithFixedToolbar) {
195
- return null;
196
- }
259
+ export const FixedToolbarPlugin = ({
260
+ anchorElem,
261
+ clientProps
262
+ }) => {
263
+ const [currentEditor] = useLexicalComposerContext();
264
+ const editorConfigContext = useEditorConfigContext();
265
+ const {
266
+ editorConfig: currentEditorConfig
267
+ } = editorConfigContext;
268
+ const editor = clientProps.applyToFocusedEditor ? editorConfigContext.focusedEditor?.editor || currentEditor : currentEditor;
269
+ const editorConfig = clientProps.applyToFocusedEditor ? editorConfigContext.focusedEditor?.editorConfig || currentEditorConfig : currentEditorConfig;
270
+ const parentWithFixedToolbar = getParentEditorWithFixedToolbar(editorConfigContext);
271
+ if (clientProps?.disableIfParentHasFixedToolbar) {
272
+ if (parentWithFixedToolbar) {
273
+ return null;
197
274
  }
198
- if (!editorConfig?.features?.toolbarFixed?.groups?.length) {
199
- return null;
200
- }
201
- return /*#__PURE__*/ _jsx(FixedToolbar, {
202
- anchorElem: anchorElem,
203
- editor: editor,
204
- editorConfig: editorConfig,
205
- parentWithFixedToolbar: parentWithFixedToolbar
206
- });
275
+ }
276
+ if (!editorConfig?.features?.toolbarFixed?.groups?.length) {
277
+ return null;
278
+ }
279
+ return /*#__PURE__*/_jsx(FixedToolbar, {
280
+ anchorElem: anchorElem,
281
+ editor: editor,
282
+ editorConfig: editorConfig,
283
+ parentWithFixedToolbar: parentWithFixedToolbar
284
+ });
207
285
  };
208
-
209
286
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"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 { 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 { PluginComponentWithAnchor } from '../../../../typesClient.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 './index.scss'\n\nfunction ButtonGroupItem({\n anchorElem,\n editor,\n item,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\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 return (\n <ToolbarButton editor={editor} item={item} key={item.key}>\n {item?.ChildComponent && <item.ChildComponent />}\n </ToolbarButton>\n )\n}\n\nfunction ToolbarGroupComponent({\n anchorElem,\n editor,\n editorConfig,\n group,\n index,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n group: ToolbarGroup\n index: number\n}): React.ReactNode {\n const { i18n } = useTranslation()\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n const [dropdownLabel, setDropdownLabel] = React.useState<null | string>(null)\n const [DropdownIcon, setDropdownIcon] = React.useState<React.FC | null>(null)\n\n React.useEffect(() => {\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent)\n } else {\n setDropdownIcon(null)\n }\n }, [group])\n\n const onActiveChange = ({ activeItems }: { activeItems: ToolbarGroupItem[] }) => {\n if (!activeItems.length) {\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent)\n setDropdownLabel(null)\n } else {\n setDropdownIcon(null)\n setDropdownLabel(null)\n }\n return\n }\n const item = activeItems[0]\n\n let label = item.key\n if (item.label) {\n label =\n typeof item.label === 'function' ? item.label({ i18n, richTextComponentMap }) : item.label\n }\n // Crop title to max. 25 characters\n if (label.length > 25) {\n label = label.substring(0, 25) + '...'\n }\n setDropdownLabel(label)\n setDropdownIcon(() => item.ChildComponent)\n }\n\n return (\n <div className={`fixed-toolbar__group fixed-toolbar__group-${group.key}`} key={group.key}>\n {group.type === 'dropdown' &&\n group.items.length &&\n (DropdownIcon ? (\n <ToolbarDropdown\n Icon={DropdownIcon}\n anchorElem={anchorElem}\n editor={editor}\n groupKey={group.key}\n items={group.items}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n maxActiveItems={1}\n onActiveChange={onActiveChange}\n />\n ) : (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n groupKey={group.key}\n items={group.items}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n maxActiveItems={1}\n onActiveChange={onActiveChange}\n />\n ))}\n {group.type === 'buttons' &&\n group.items.length &&\n group.items.map((item) => {\n return (\n <ButtonGroupItem anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n })}\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\n const { y } = useScrollInfo()\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 currentToolbarRef.current.className = 'fixed-toolbar fixed-toolbar--overlapping'\n parentToolbarElem.className = 'fixed-toolbar fixed-toolbar--hide'\n } else {\n if (!currentToolbarRef.current.classList.contains('fixed-toolbar--overlapping')) {\n return\n }\n currentToolbarRef.current.className = 'fixed-toolbar'\n parentToolbarElem.className = '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 {editor.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 />\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: PluginComponentWithAnchor<FixedToolbarFeatureProps> = ({\n anchorElem,\n clientProps,\n}) => {\n const [currentEditor] = useLexicalComposerContext()\n const editorConfigContext = useEditorConfigContext()\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={anchorElem}\n editor={editor}\n editorConfig={editorConfig}\n parentWithFixedToolbar={parentWithFixedToolbar}\n />\n )\n}\n"],"names":["useLexicalComposerContext","useScrollInfo","useThrottledEffect","useTranslation","React","useMemo","useEditorConfigContext","ToolbarButton","ToolbarDropdown","ButtonGroupItem","anchorElem","editor","item","Component","key","ChildComponent","ToolbarGroupComponent","editorConfig","group","index","i18n","field","richTextComponentMap","dropdownLabel","setDropdownLabel","useState","DropdownIcon","setDropdownIcon","useEffect","type","items","length","onActiveChange","activeItems","label","substring","div","className","Icon","groupKey","itemsContainerClassNames","maxActiveItems","map","features","toolbarFixed","groups","FixedToolbar","clientProps","parentWithFixedToolbar","currentToolbarRef","useRef","y","parentToolbarElem","disableIfParentHasFixedToolbar","parentEditorElem","editorContainerRef","current","sibling","previousElementSibling","classList","contains","currentToolbarElem","currentRect","getBoundingClientRect","parentRect","overlapping","bottom","top","onFocus","event","stopPropagation","ref","isEditable","Fragment","i","getParentEditorWithFixedToolbar","editorConfigContext","parentEditor","resolvedFeatureMap","has","FixedToolbarPlugin","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor"],"mappings":"AAAA;;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,aAAa,EAAEC,kBAAkB,EAAEC,cAAc,QAAQ,iBAAgB;AAClF,YAAYC,WAAW,QAAO;AAC9B,SAASC,OAAO,QAAQ,QAAO;AAQ/B,SAASC,sBAAsB,QAAQ,+DAA8D;AACrG,SAASC,aAAa,QAAQ,yCAAwC;AACtE,SAASC,eAAe,QAAQ,2CAA0C;AAG1E,SAASC,gBAAgB,EACvBC,UAAU,EACVC,MAAM,EACNC,IAAI,EAKL;IACC,IAAIA,KAAKC,SAAS,EAAE;QAClB,OACED,MAAMC,2BACJ,KAACD,KAAKC,SAAS;YAACH,YAAYA;YAAYC,QAAQA;YAAQC,MAAMA;WAAWA,KAAKE,GAAG;IAGvF;IAEA,qBACE,KAACP;QAAcI,QAAQA;QAAQC,MAAMA;kBAClCA,MAAMG,gCAAkB,KAACH,KAAKG,cAAc;OADCH,KAAKE,GAAG;AAI5D;AAEA,SAASE,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,MAAM6D,kCAAkC,CACtCC;IAEA,IAAIA,oBAAoBC,YAAY,EAAE5D,cAAc;QAClD,IAAI2D,oBAAoBC,YAAY,EAAE5D,aAAa6D,mBAAmBC,IAAI,iBAAiB;YACzF,OAAOH,oBAAoBC,YAAY;QACzC,OAAO;YACL,IAAID,oBAAoBC,YAAY,EAAE;gBACpC,OAAOF,gCAAgCC,oBAAoBC,YAAY;YACzE;QACF;IACF;IACA,OAAO;AACT;AAEA,OAAO,MAAMG,qBAA0E,CAAC,EACtFtE,UAAU,EACVqC,WAAW,EACZ;IACC,MAAM,CAACkC,cAAc,GAAGjF;IACxB,MAAM4E,sBAAsBtE;IAE5B,MAAM,EAAEW,cAAciE,mBAAmB,EAAE,GAAGN;IAE9C,MAAMjE,SAASoC,YAAYoC,oBAAoB,GAC3CP,oBAAoBQ,aAAa,EAAEzE,UAAUsE,gBAC7CA;IAEJ,MAAMhE,eAAe8B,YAAYoC,oBAAoB,GACjDP,oBAAoBQ,aAAa,EAAEnE,gBAAgBiE,sBACnDA;IAEJ,MAAMlC,yBAAyB2B,gCAAgCC;IAE/D,IAAI7B,aAAaM,gCAAgC;QAC/C,IAAIL,wBAAwB;YAC1B,OAAO;QACT;IACF;IAEA,IAAI,CAAC/B,cAAc0B,UAAUC,cAAcC,QAAQd,QAAQ;QACzD,OAAO;IACT;IAEA,qBACE,KAACe;QACCpC,YAAYA;QACZC,QAAQA;QACRM,cAAcA;QACd+B,wBAAwBA;;AAG9B,EAAC"}
1
+ {"version":3,"file":"index.js","names":["c","_c","useLexicalComposerContext","useScrollInfo","useThrottledEffect","useTranslation","React","useMemo","useEditorConfigContext","ToolbarButton","ToolbarDropdown","ButtonGroupItem","anchorElem","editor","item","Component","_jsx","key","ChildComponent","ToolbarGroupComponent","t0","$","editorConfig","group","index","i18n","field","t1","richTextComponentMap","dropdownLabel","setDropdownLabel","useState","DropdownIcon","setDropdownIcon","t2","t3","type","items","length","useEffect","t4","t5","activeItems","label","substring","onActiveChange","t6","Icon","groupKey","itemsContainerClassNames","maxActiveItems","t7","map","item_0","t8","features","toolbarFixed","_jsxs","className","children","groups","FixedToolbar","clientProps","parentWithFixedToolbar","currentToolbarRef","useRef","y","parentToolbarElem","disableIfParentHasFixedToolbar","parentEditorElem","editorContainerRef","current","sibling","previousElementSibling","classList","contains","currentToolbarElem","currentRect","getBoundingClientRect","parentRect","overlapping","bottom","top","onFocus","event","stopPropagation","ref","isEditable","Fragment","i","getParentEditorWithFixedToolbar","editorConfigContext","parentEditor","resolvedFeatureMap","has","FixedToolbarPlugin","currentEditor","currentEditorConfig","applyToFocusedEditor","focusedEditor"],"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 { 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 { PluginComponentWithAnchor } from '../../../../typesClient.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 './index.scss'\n\nfunction ButtonGroupItem({\n anchorElem,\n editor,\n item,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\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 return (\n <ToolbarButton editor={editor} item={item} key={item.key}>\n {item?.ChildComponent && <item.ChildComponent />}\n </ToolbarButton>\n )\n}\n\nfunction ToolbarGroupComponent({\n anchorElem,\n editor,\n editorConfig,\n group,\n index,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n group: ToolbarGroup\n index: number\n}): React.ReactNode {\n const { i18n } = useTranslation()\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n const [dropdownLabel, setDropdownLabel] = React.useState<null | string>(null)\n const [DropdownIcon, setDropdownIcon] = React.useState<React.FC | null>(null)\n\n React.useEffect(() => {\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent)\n } else {\n setDropdownIcon(null)\n }\n }, [group])\n\n const onActiveChange = ({ activeItems }: { activeItems: ToolbarGroupItem[] }) => {\n if (!activeItems.length) {\n if (group?.type === 'dropdown' && group.items.length && group.ChildComponent) {\n setDropdownIcon(() => group.ChildComponent)\n setDropdownLabel(null)\n } else {\n setDropdownIcon(null)\n setDropdownLabel(null)\n }\n return\n }\n const item = activeItems[0]\n\n let label = item.key\n if (item.label) {\n label =\n typeof item.label === 'function' ? item.label({ i18n, richTextComponentMap }) : item.label\n }\n // Crop title to max. 25 characters\n if (label.length > 25) {\n label = label.substring(0, 25) + '...'\n }\n setDropdownLabel(label)\n setDropdownIcon(() => item.ChildComponent)\n }\n\n return (\n <div className={`fixed-toolbar__group fixed-toolbar__group-${group.key}`} key={group.key}>\n {group.type === 'dropdown' &&\n group.items.length &&\n (DropdownIcon ? (\n <ToolbarDropdown\n Icon={DropdownIcon}\n anchorElem={anchorElem}\n editor={editor}\n groupKey={group.key}\n items={group.items}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n maxActiveItems={1}\n onActiveChange={onActiveChange}\n />\n ) : (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n groupKey={group.key}\n items={group.items}\n itemsContainerClassNames={['fixed-toolbar__dropdown-items']}\n label={dropdownLabel}\n maxActiveItems={1}\n onActiveChange={onActiveChange}\n />\n ))}\n {group.type === 'buttons' &&\n group.items.length &&\n group.items.map((item) => {\n return (\n <ButtonGroupItem anchorElem={anchorElem} editor={editor} item={item} key={item.key} />\n )\n })}\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\n const { y } = useScrollInfo()\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 currentToolbarRef.current.className = 'fixed-toolbar fixed-toolbar--overlapping'\n parentToolbarElem.className = 'fixed-toolbar fixed-toolbar--hide'\n } else {\n if (!currentToolbarRef.current.classList.contains('fixed-toolbar--overlapping')) {\n return\n }\n currentToolbarRef.current.className = 'fixed-toolbar'\n parentToolbarElem.className = '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 {editor.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 />\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: PluginComponentWithAnchor<FixedToolbarFeatureProps> = ({\n anchorElem,\n clientProps,\n}) => {\n const [currentEditor] = useLexicalComposerContext()\n const editorConfigContext = useEditorConfigContext()\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 <Fixed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13 +1,11 @@
1
1
  'use client';
2
+
2
3
  import { createClientFeature } from '../../../../utilities/createClientFeature.js';
3
4
  import { FixedToolbarPlugin } from './Toolbar/index.js';
4
5
  export const FixedToolbarFeatureClient = createClientFeature({
5
- plugins: [
6
- {
7
- Component: FixedToolbarPlugin,
8
- position: 'aboveContainer'
9
- }
10
- ]
6
+ plugins: [{
7
+ Component: FixedToolbarPlugin,
8
+ position: 'aboveContainer'
9
+ }]
11
10
  });
12
-
13
11
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/features/toolbars/fixed/client/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FixedToolbarFeatureProps } from '../server/index.js'\n\nimport { createClientFeature } from '../../../../utilities/createClientFeature.js'\nimport { FixedToolbarPlugin } from './Toolbar/index.js'\n\nexport const FixedToolbarFeatureClient = createClientFeature<FixedToolbarFeatureProps>({\n plugins: [\n {\n Component: FixedToolbarPlugin,\n position: 'aboveContainer',\n },\n ],\n})\n"],"names":["createClientFeature","FixedToolbarPlugin","FixedToolbarFeatureClient","plugins","Component","position"],"mappings":"AAAA;AAIA,SAASA,mBAAmB,QAAQ,+CAA8C;AAClF,SAASC,kBAAkB,QAAQ,qBAAoB;AAEvD,OAAO,MAAMC,4BAA4BF,oBAA8C;IACrFG,SAAS;QACP;YACEC,WAAWH;YACXI,UAAU;QACZ;KACD;AACH,GAAE"}
1
+ {"version":3,"file":"index.js","names":["createClientFeature","FixedToolbarPlugin","FixedToolbarFeatureClient","plugins","Component","position"],"sources":["../../../../../src/features/toolbars/fixed/client/index.tsx"],"sourcesContent":["'use client'\n\nimport type { FixedToolbarFeatureProps } from '../server/index.js'\n\nimport { createClientFeature } from '../../../../utilities/createClientFeature.js'\nimport { FixedToolbarPlugin } from './Toolbar/index.js'\n\nexport const FixedToolbarFeatureClient = createClientFeature<FixedToolbarFeatureProps>({\n plugins: [\n {\n Component: FixedToolbarPlugin,\n position: 'aboveContainer',\n },\n ],\n})\n"],"mappings":"AAAA;;AAIA,SAASA,mBAAmB,QAAQ;AACpC,SAASC,kBAAkB,QAAQ;AAEnC,OAAO,MAAMC,yBAAA,GAA4BF,mBAAA,CAA8C;EACrFG,OAAA,EAAS,CACP;IACEC,SAAA,EAAWH,kBAAA;IACXI,QAAA,EAAU;EACZ;AAEJ","ignoreList":[]}
@@ -1,17 +1,18 @@
1
1
  import { createServerFeature } from '../../../../utilities/createServerFeature.js';
2
2
  export const FixedToolbarFeature = createServerFeature({
3
- feature: ({ props })=>{
4
- const sanitizedProps = {
5
- applyToFocusedEditor: props?.applyToFocusedEditor === undefined ? false : props.applyToFocusedEditor,
6
- disableIfParentHasFixedToolbar: props?.disableIfParentHasFixedToolbar === undefined ? false : props.disableIfParentHasFixedToolbar
7
- };
8
- return {
9
- ClientFeature: '@payloadcms/richtext-lexical/client#FixedToolbarFeatureClient',
10
- clientFeatureProps: sanitizedProps,
11
- sanitizedServerFeatureProps: sanitizedProps
12
- };
13
- },
14
- key: 'toolbarFixed'
3
+ feature: ({
4
+ props
5
+ }) => {
6
+ const sanitizedProps = {
7
+ applyToFocusedEditor: props?.applyToFocusedEditor === undefined ? false : props.applyToFocusedEditor,
8
+ disableIfParentHasFixedToolbar: props?.disableIfParentHasFixedToolbar === undefined ? false : props.disableIfParentHasFixedToolbar
9
+ };
10
+ return {
11
+ ClientFeature: '@payloadcms/richtext-lexical/client#FixedToolbarFeatureClient',
12
+ clientFeatureProps: sanitizedProps,
13
+ sanitizedServerFeatureProps: sanitizedProps
14
+ };
15
+ },
16
+ key: 'toolbarFixed'
15
17
  });
16
-
17
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/features/toolbars/fixed/server/index.ts"],"sourcesContent":["import { createServerFeature } from '../../../../utilities/createServerFeature.js'\n\nexport type FixedToolbarFeatureProps = {\n /**\n * @default false\n *\n * If this is enabled, the toolbar will apply to the focused editor, not the editor with the FixedToolbarFeature.\n *\n * This means that if the editor has a child-editor, and the child-editor is focused, the toolbar will apply to the child-editor, not the parent editor with this feature added.\n */\n applyToFocusedEditor?: boolean\n /**\n * @default false\n *\n * If there is a parent editor with a fixed toolbar, this will disable the toolbar for this editor.\n */\n disableIfParentHasFixedToolbar?: boolean\n}\n\nexport const FixedToolbarFeature = createServerFeature<\n FixedToolbarFeatureProps,\n FixedToolbarFeatureProps,\n FixedToolbarFeatureProps\n>({\n feature: ({ props }) => {\n const sanitizedProps: FixedToolbarFeatureProps = {\n applyToFocusedEditor:\n props?.applyToFocusedEditor === undefined ? false : props.applyToFocusedEditor,\n disableIfParentHasFixedToolbar:\n props?.disableIfParentHasFixedToolbar === undefined\n ? false\n : props.disableIfParentHasFixedToolbar,\n }\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#FixedToolbarFeatureClient',\n clientFeatureProps: sanitizedProps,\n sanitizedServerFeatureProps: sanitizedProps,\n }\n },\n key: 'toolbarFixed',\n})\n"],"names":["createServerFeature","FixedToolbarFeature","feature","props","sanitizedProps","applyToFocusedEditor","undefined","disableIfParentHasFixedToolbar","ClientFeature","clientFeatureProps","sanitizedServerFeatureProps","key"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,+CAA8C;AAmBlF,OAAO,MAAMC,sBAAsBD,oBAIjC;IACAE,SAAS,CAAC,EAAEC,KAAK,EAAE;QACjB,MAAMC,iBAA2C;YAC/CC,sBACEF,OAAOE,yBAAyBC,YAAY,QAAQH,MAAME,oBAAoB;YAChFE,gCACEJ,OAAOI,mCAAmCD,YACtC,QACAH,MAAMI,8BAA8B;QAC5C;QAEA,OAAO;YACLC,eAAe;YACfC,oBAAoBL;YACpBM,6BAA6BN;QAC/B;IACF;IACAO,KAAK;AACP,GAAE"}
1
+ {"version":3,"file":"index.js","names":["createServerFeature","FixedToolbarFeature","feature","props","sanitizedProps","applyToFocusedEditor","undefined","disableIfParentHasFixedToolbar","ClientFeature","clientFeatureProps","sanitizedServerFeatureProps","key"],"sources":["../../../../../src/features/toolbars/fixed/server/index.ts"],"sourcesContent":["import { createServerFeature } from '../../../../utilities/createServerFeature.js'\n\nexport type FixedToolbarFeatureProps = {\n /**\n * @default false\n *\n * If this is enabled, the toolbar will apply to the focused editor, not the editor with the FixedToolbarFeature.\n *\n * This means that if the editor has a child-editor, and the child-editor is focused, the toolbar will apply to the child-editor, not the parent editor with this feature added.\n */\n applyToFocusedEditor?: boolean\n /**\n * @default false\n *\n * If there is a parent editor with a fixed toolbar, this will disable the toolbar for this editor.\n */\n disableIfParentHasFixedToolbar?: boolean\n}\n\nexport const FixedToolbarFeature = createServerFeature<\n FixedToolbarFeatureProps,\n FixedToolbarFeatureProps,\n FixedToolbarFeatureProps\n>({\n feature: ({ props }) => {\n const sanitizedProps: FixedToolbarFeatureProps = {\n applyToFocusedEditor:\n props?.applyToFocusedEditor === undefined ? false : props.applyToFocusedEditor,\n disableIfParentHasFixedToolbar:\n props?.disableIfParentHasFixedToolbar === undefined\n ? false\n : props.disableIfParentHasFixedToolbar,\n }\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#FixedToolbarFeatureClient',\n clientFeatureProps: sanitizedProps,\n sanitizedServerFeatureProps: sanitizedProps,\n }\n },\n key: 'toolbarFixed',\n})\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ;AAmBpC,OAAO,MAAMC,mBAAA,GAAsBD,mBAAA,CAIjC;EACAE,OAAA,EAASA,CAAC;IAAEC;EAAK,CAAE;IACjB,MAAMC,cAAA,GAA2C;MAC/CC,oBAAA,EACEF,KAAA,EAAOE,oBAAA,KAAyBC,SAAA,GAAY,QAAQH,KAAA,CAAME,oBAAoB;MAChFE,8BAAA,EACEJ,KAAA,EAAOI,8BAAA,KAAmCD,SAAA,GACtC,QACAH,KAAA,CAAMI;IACd;IAEA,OAAO;MACLC,aAAA,EAAe;MACfC,kBAAA,EAAoBL,cAAA;MACpBM,2BAAA,EAA6BN;IAC/B;EACF;EACAO,GAAA,EAAK;AACP","ignoreList":[]}