@payloadcms/richtext-lexical 3.0.0-beta.9 → 3.0.0-canary.f6e77b8

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 (640) hide show
  1. package/dist/cell/index.d.ts +1 -1
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +2 -4
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/exports/components.d.ts +8 -2
  6. package/dist/exports/components.d.ts.map +1 -1
  7. package/dist/exports/components.js +8 -2
  8. package/dist/exports/components.js.map +1 -1
  9. package/dist/field/Field.d.ts +0 -2
  10. package/dist/field/Field.d.ts.map +1 -1
  11. package/dist/field/Field.js.map +1 -1
  12. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  13. package/dist/field/features/align/feature.client.js +127 -54
  14. package/dist/field/features/align/feature.client.js.map +1 -1
  15. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  16. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  17. package/dist/field/features/align/toolbarAlignGroup.js +12 -0
  18. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  19. package/dist/field/features/blockquote/feature.client.d.ts +1 -1
  20. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  21. package/dist/field/features/blockquote/feature.client.js +53 -40
  22. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  23. package/dist/field/features/blockquote/feature.server.d.ts +1 -1
  24. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  25. package/dist/field/features/blockquote/feature.server.js +7 -7
  26. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  27. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  28. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  29. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  30. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  31. package/dist/field/features/blocks/component/BlockContent.js +3 -5
  32. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  33. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  34. package/dist/field/features/blocks/component/index.js +37 -4
  35. package/dist/field/features/blocks/component/index.js.map +1 -1
  36. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  37. package/dist/field/features/blocks/drawer/index.js +2 -4
  38. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  39. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  40. package/dist/field/features/blocks/feature.client.js +56 -27
  41. package/dist/field/features/blocks/feature.client.js.map +1 -1
  42. package/dist/field/features/blocks/feature.server.d.ts +2 -5
  43. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  44. package/dist/field/features/blocks/feature.server.js +109 -77
  45. package/dist/field/features/blocks/feature.server.js.map +1 -1
  46. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -3
  47. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  48. package/dist/field/features/blocks/nodes/BlocksNode.js +1 -2
  49. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  50. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  51. package/dist/field/features/blocks/plugin/commands.js +1 -2
  52. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  53. package/dist/field/features/blocks/plugin/index.d.ts +3 -2
  54. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  55. package/dist/field/features/blocks/plugin/index.js +5 -8
  56. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  57. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  58. package/dist/field/features/blocks/populationPromise.js +4 -18
  59. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  60. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  61. package/dist/field/features/blocks/validate.js +22 -36
  62. package/dist/field/features/blocks/validate.js.map +1 -1
  63. package/dist/field/features/converters/html/field/index.d.ts +8 -2
  64. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  65. package/dist/field/features/converters/html/field/index.js +6 -3
  66. package/dist/field/features/converters/html/field/index.js.map +1 -1
  67. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts.map +1 -1
  68. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
  69. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts.map +1 -1
  70. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +1 -1
  71. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js.map +1 -1
  72. package/dist/field/features/debug/testRecorder/plugin/index.d.ts +5 -0
  73. package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -0
  74. package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +2 -4
  75. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -0
  76. package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts.map +1 -1
  77. package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
  78. package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts.map +1 -1
  79. package/dist/field/features/debug/{treeview → treeView}/feature.server.js +1 -1
  80. package/dist/field/features/debug/{treeview → treeView}/feature.server.js.map +1 -1
  81. package/dist/field/features/debug/treeView/plugin/index.d.ts +4 -0
  82. package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -0
  83. package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +4 -6
  84. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -0
  85. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  86. package/dist/field/features/format/bold/feature.client.js +26 -23
  87. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  88. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -0
  89. package/dist/field/features/format/inlineCode/feature.client.js +46 -0
  90. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
  91. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts.map +1 -1
  92. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +1 -1
  93. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js.map +1 -1
  94. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
  95. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
  96. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  97. package/dist/field/features/format/italic/feature.client.js +27 -24
  98. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  99. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  100. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  101. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  102. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  103. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  104. package/dist/field/features/format/strikethrough/feature.client.js +27 -24
  105. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  106. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  107. package/dist/field/features/format/subscript/feature.client.js +25 -22
  108. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  109. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  110. package/dist/field/features/format/superscript/feature.client.js +25 -22
  111. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  112. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  113. package/dist/field/features/format/underline/feature.client.js +25 -22
  114. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  115. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  116. package/dist/field/features/heading/feature.client.js +71 -54
  117. package/dist/field/features/heading/feature.client.js.map +1 -1
  118. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  119. package/dist/field/features/heading/feature.server.js +5 -5
  120. package/dist/field/features/heading/feature.server.js.map +1 -1
  121. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  122. package/dist/field/features/heading/markdownTransformer.js +1 -2
  123. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  124. package/dist/field/features/horizontalRule/component/index.d.ts.map +1 -0
  125. package/dist/field/features/{horizontalrule → horizontalRule}/component/index.js +2 -4
  126. package/dist/field/features/horizontalRule/component/index.js.map +1 -0
  127. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
  128. package/dist/field/features/horizontalRule/feature.client.js +76 -0
  129. package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
  130. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
  131. package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.js +4 -3
  132. package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
  133. package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts.map +1 -1
  134. package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js.map +1 -1
  135. package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts +1 -3
  136. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  137. package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js +1 -2
  138. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -0
  139. package/dist/field/features/horizontalRule/plugin/index.d.ts +7 -0
  140. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -0
  141. package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.js +5 -8
  142. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
  143. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  144. package/dist/field/features/indent/feature.client.js +43 -42
  145. package/dist/field/features/indent/feature.client.js.map +1 -1
  146. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  147. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  148. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  149. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  150. package/dist/field/features/link/drawer/baseFields.d.ts +2 -2
  151. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  152. package/dist/field/features/link/drawer/baseFields.js +30 -43
  153. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  154. package/dist/field/features/link/drawer/index.js +3 -2
  155. package/dist/field/features/link/drawer/index.js.map +1 -1
  156. package/dist/field/features/link/drawer/types.d.ts +4 -2
  157. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  158. package/dist/field/features/link/drawer/types.js.map +1 -1
  159. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  160. package/dist/field/features/link/feature.client.js +59 -47
  161. package/dist/field/features/link/feature.client.js.map +1 -1
  162. package/dist/field/features/link/feature.server.d.ts +10 -5
  163. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  164. package/dist/field/features/link/feature.server.js +48 -9
  165. package/dist/field/features/link/feature.server.js.map +1 -1
  166. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  167. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  168. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  169. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  170. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  171. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  172. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  173. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  174. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  175. package/dist/field/features/link/plugins/autoLink/index.js +5 -8
  176. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  177. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  178. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  179. package/dist/field/features/link/plugins/clickableLink/index.js +2 -2
  180. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  181. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  182. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  183. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  184. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  185. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +93 -69
  186. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  187. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  188. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  189. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  190. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +11 -3
  191. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +1 -3
  192. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  193. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +12 -30
  194. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  195. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  196. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  197. package/dist/field/features/link/plugins/link/index.js +5 -14
  198. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  199. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  200. package/dist/field/features/link/populationPromise.js +10 -25
  201. package/dist/field/features/link/populationPromise.js.map +1 -1
  202. package/dist/field/features/link/validate.d.ts +5 -0
  203. package/dist/field/features/link/validate.d.ts.map +1 -0
  204. package/dist/field/features/link/validate.js +32 -0
  205. package/dist/field/features/link/validate.js.map +1 -0
  206. package/dist/field/features/lists/checklist/feature.client.d.ts +1 -1
  207. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  208. package/dist/field/features/lists/checklist/feature.client.js +56 -32
  209. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  210. package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
  211. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  212. package/dist/field/features/lists/checklist/feature.server.js +10 -10
  213. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  214. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  215. package/dist/field/features/lists/checklist/markdownTransformers.js +2 -3
  216. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  217. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  218. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  219. package/dist/field/features/lists/checklist/plugin/index.js +3 -4
  220. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  221. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  222. package/dist/field/features/lists/htmlConverter.js +13 -6
  223. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  224. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -0
  225. package/dist/field/features/lists/orderedList/feature.client.js +96 -0
  226. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
  227. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -0
  228. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +7 -7
  229. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -0
  230. package/dist/field/features/lists/orderedList/markdownTransformer.d.ts.map +1 -0
  231. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +2 -3
  232. package/dist/field/features/lists/orderedList/markdownTransformer.js.map +1 -0
  233. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  234. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  235. package/dist/field/features/lists/plugin/index.js +3 -4
  236. package/dist/field/features/lists/plugin/index.js.map +1 -1
  237. package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
  238. package/dist/field/features/lists/{common → shared}/markdown.js +1 -2
  239. package/dist/field/features/lists/shared/markdown.js.map +1 -0
  240. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
  241. package/dist/field/features/lists/unorderedList/feature.client.js +96 -0
  242. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
  243. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -0
  244. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +7 -7
  245. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -0
  246. package/dist/field/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -0
  247. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +2 -3
  248. package/dist/field/features/lists/unorderedList/markdownTransformer.js.map +1 -0
  249. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  250. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  251. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  252. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  253. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  254. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  255. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  256. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  257. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  258. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  259. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  260. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  261. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  262. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  263. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  264. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  265. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  266. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  267. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  268. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  269. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  270. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  271. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  272. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  273. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  274. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  275. package/dist/field/features/paragraph/feature.client.js +45 -33
  276. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  277. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  278. package/dist/field/features/relationship/drawer/commands.js +1 -2
  279. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  280. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  281. package/dist/field/features/relationship/drawer/index.js +7 -13
  282. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  283. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  284. package/dist/field/features/relationship/feature.client.js +37 -15
  285. package/dist/field/features/relationship/feature.client.js.map +1 -1
  286. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  287. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  288. package/dist/field/features/relationship/feature.server.js +5 -4
  289. package/dist/field/features/relationship/feature.server.js.map +1 -1
  290. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
  291. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  292. package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
  293. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  294. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  295. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +56 -7
  296. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  297. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  298. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  299. package/dist/field/features/relationship/plugins/index.js +9 -12
  300. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  301. package/dist/field/features/relationship/populationPromise.d.ts +2 -1
  302. package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
  303. package/dist/field/features/relationship/populationPromise.js +25 -19
  304. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  305. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  306. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  307. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  308. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  309. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  310. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  311. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  312. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  313. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  314. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  315. package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
  316. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  317. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +4 -0
  318. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  319. package/dist/field/features/toolbars/fixed/Toolbar/index.js +152 -0
  320. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  321. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +81 -0
  322. package/dist/field/features/toolbars/fixed/feature.client.d.ts +3 -0
  323. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  324. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  325. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  326. package/dist/field/features/toolbars/fixed/feature.server.d.ts +3 -0
  327. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  328. package/dist/field/features/toolbars/fixed/feature.server.js +16 -0
  329. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  330. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  331. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  332. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.js +112 -70
  333. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  334. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.scss +7 -11
  335. package/dist/field/features/toolbars/inline/feature.client.d.ts +3 -0
  336. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  337. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  338. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  339. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  340. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  341. package/dist/field/features/toolbars/inline/feature.server.js +16 -0
  342. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  343. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  344. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  345. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +29 -19
  346. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  347. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
  348. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
  349. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  350. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +27 -72
  351. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  352. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  353. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  354. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +139 -0
  355. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  356. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
  357. package/dist/field/features/toolbars/types.d.ts +48 -0
  358. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  359. package/dist/field/features/toolbars/types.js.map +1 -0
  360. package/dist/field/features/typeUtilities.d.ts +8 -0
  361. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  362. package/dist/field/features/typeUtilities.js +8 -0
  363. package/dist/field/features/typeUtilities.js.map +1 -0
  364. package/dist/field/features/types.d.ts +128 -57
  365. package/dist/field/features/types.d.ts.map +1 -1
  366. package/dist/field/features/types.js.map +1 -1
  367. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  368. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +5 -6
  369. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  370. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  371. package/dist/field/features/upload/component/index.js +59 -9
  372. package/dist/field/features/upload/component/index.js.map +1 -1
  373. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  374. package/dist/field/features/upload/drawer/commands.js +1 -2
  375. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  376. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  377. package/dist/field/features/upload/drawer/index.js +8 -12
  378. package/dist/field/features/upload/drawer/index.js.map +1 -1
  379. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  380. package/dist/field/features/upload/feature.client.js +35 -10
  381. package/dist/field/features/upload/feature.client.js.map +1 -1
  382. package/dist/field/features/upload/feature.server.d.ts +10 -3
  383. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  384. package/dist/field/features/upload/feature.server.js +39 -11
  385. package/dist/field/features/upload/feature.server.js.map +1 -1
  386. package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
  387. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  388. package/dist/field/features/upload/nodes/UploadNode.js +24 -11
  389. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  390. package/dist/field/features/upload/plugin/index.d.ts +5 -4
  391. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  392. package/dist/field/features/upload/plugin/index.js +6 -11
  393. package/dist/field/features/upload/plugin/index.js.map +1 -1
  394. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  395. package/dist/field/features/upload/populationPromise.js +15 -9
  396. package/dist/field/features/upload/populationPromise.js.map +1 -1
  397. package/dist/field/features/upload/validate.d.ts +2 -1
  398. package/dist/field/features/upload/validate.d.ts.map +1 -1
  399. package/dist/field/features/upload/validate.js +36 -9
  400. package/dist/field/features/upload/validate.js.map +1 -1
  401. package/dist/field/index.d.ts +1 -1
  402. package/dist/field/index.d.ts.map +1 -1
  403. package/dist/field/index.js.map +1 -1
  404. package/dist/field/lexical/EditorFocusProvider.d.ts +20 -0
  405. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -0
  406. package/dist/field/lexical/EditorFocusProvider.js +78 -0
  407. package/dist/field/lexical/EditorFocusProvider.js.map +1 -0
  408. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  409. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  410. package/dist/field/lexical/EditorPlugin.js +6 -3
  411. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  412. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  413. package/dist/field/lexical/LexicalEditor.js +31 -15
  414. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  415. package/dist/field/lexical/LexicalEditor.scss +3 -19
  416. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  417. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  418. package/dist/field/lexical/LexicalProvider.js +4 -4
  419. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  420. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +2 -3
  421. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  422. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  423. package/dist/field/lexical/config/client/default.d.ts +1 -1
  424. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  425. package/dist/field/lexical/config/client/default.js.map +1 -1
  426. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  427. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  428. package/dist/field/lexical/config/client/sanitize.js +81 -32
  429. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  430. package/dist/field/lexical/config/server/default.d.ts +2 -3
  431. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  432. package/dist/field/lexical/config/server/default.js +11 -11
  433. package/dist/field/lexical/config/server/default.js.map +1 -1
  434. package/dist/field/lexical/config/server/loader.d.ts +5 -2
  435. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  436. package/dist/field/lexical/config/server/loader.js +4 -2
  437. package/dist/field/lexical/config/server/loader.js.map +1 -1
  438. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  439. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  440. package/dist/field/lexical/config/server/sanitize.js +23 -8
  441. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  442. package/dist/field/lexical/config/types.d.ts +1 -1
  443. package/dist/field/lexical/config/types.d.ts.map +1 -1
  444. package/dist/field/lexical/config/types.js.map +1 -1
  445. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  446. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  447. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  448. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +9 -9
  449. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  450. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +74 -77
  451. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  452. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +4 -4
  453. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  454. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +6 -9
  455. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  456. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +17 -25
  457. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  458. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
  459. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  460. package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
  461. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  462. package/dist/field/lexical/plugins/SlashMenu/index.js +72 -67
  463. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  464. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  465. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -4
  466. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  467. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts +1 -1
  468. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  469. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +3 -4
  470. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  471. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  472. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +8 -7
  473. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  474. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +8 -0
  475. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  476. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +25 -6
  477. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  478. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  479. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  480. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  481. package/dist/field/lexical/theme/EditorTheme.scss +13 -14
  482. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  483. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  484. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  485. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  486. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  487. package/dist/field/lexical/ui/icons/Add/index.js +16 -0
  488. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  489. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  490. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  491. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  492. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  493. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  494. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  495. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  496. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  497. package/dist/field/lexical/utils/setFloatingElemPosition.js +16 -13
  498. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  499. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  500. package/dist/field/lexical/utils/url.js +3 -0
  501. package/dist/field/lexical/utils/url.js.map +1 -1
  502. package/dist/forEachNodeRecursively.d.ts +10 -0
  503. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  504. package/dist/forEachNodeRecursively.js +24 -0
  505. package/dist/forEachNodeRecursively.js.map +1 -0
  506. package/dist/generateComponentMap.d.ts.map +1 -1
  507. package/dist/generateComponentMap.js +13 -21
  508. package/dist/generateComponentMap.js.map +1 -1
  509. package/dist/generateSchemaMap.d.ts.map +1 -1
  510. package/dist/generateSchemaMap.js +4 -12
  511. package/dist/generateSchemaMap.js.map +1 -1
  512. package/dist/index.d.ts +24 -20
  513. package/dist/index.d.ts.map +1 -1
  514. package/dist/index.js +275 -184
  515. package/dist/index.js.map +1 -1
  516. package/dist/populate/defaultValue.d.ts.map +1 -1
  517. package/dist/populate/defaultValue.js +1 -0
  518. package/dist/populate/defaultValue.js.map +1 -1
  519. package/dist/populate/populate.d.ts +5 -4
  520. package/dist/populate/populate.d.ts.map +1 -1
  521. package/dist/populate/populate.js +13 -11
  522. package/dist/populate/populate.js.map +1 -1
  523. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  524. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  525. package/dist/populate/populateLexicalPopulationPromises.js +36 -0
  526. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  527. package/dist/populate/recurseNestedFields.d.ts +8 -4
  528. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  529. package/dist/populate/recurseNestedFields.js +4 -5
  530. package/dist/populate/recurseNestedFields.js.map +1 -1
  531. package/dist/types.d.ts +12 -5
  532. package/dist/types.d.ts.map +1 -1
  533. package/dist/types.js.map +1 -1
  534. package/dist/validate/index.d.ts +1 -1
  535. package/dist/validate/index.d.ts.map +1 -1
  536. package/package.json +47 -46
  537. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
  538. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
  539. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +0 -12
  540. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
  541. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
  542. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
  543. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
  544. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
  545. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
  546. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
  547. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +0 -12
  548. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
  549. package/dist/field/features/debug/testrecorder/plugin/index.d.ts +0 -5
  550. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +0 -1
  551. package/dist/field/features/debug/testrecorder/plugin/index.js.map +0 -1
  552. package/dist/field/features/debug/treeview/plugin/index.d.ts +0 -4
  553. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +0 -1
  554. package/dist/field/features/debug/treeview/plugin/index.js.map +0 -1
  555. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
  556. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
  557. package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
  558. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
  559. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +0 -1
  560. package/dist/field/features/format/inlinecode/feature.client.js +0 -43
  561. package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
  562. package/dist/field/features/horizontalrule/component/index.d.ts.map +0 -1
  563. package/dist/field/features/horizontalrule/component/index.js.map +0 -1
  564. package/dist/field/features/horizontalrule/feature.client.d.ts.map +0 -1
  565. package/dist/field/features/horizontalrule/feature.client.js +0 -53
  566. package/dist/field/features/horizontalrule/feature.client.js.map +0 -1
  567. package/dist/field/features/horizontalrule/feature.server.d.ts.map +0 -1
  568. package/dist/field/features/horizontalrule/feature.server.js.map +0 -1
  569. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +0 -1
  570. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +0 -1
  571. package/dist/field/features/horizontalrule/plugin/index.d.ts +0 -6
  572. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +0 -1
  573. package/dist/field/features/horizontalrule/plugin/index.js.map +0 -1
  574. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
  575. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
  576. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
  577. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
  578. package/dist/field/features/indent/index.scss +0 -4
  579. package/dist/field/features/lists/common/markdown.js.map +0 -1
  580. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +0 -1
  581. package/dist/field/features/lists/orderedlist/feature.client.js +0 -72
  582. package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
  583. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +0 -1
  584. package/dist/field/features/lists/orderedlist/feature.server.js.map +0 -1
  585. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +0 -1
  586. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +0 -1
  587. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
  588. package/dist/field/features/lists/unorderedlist/feature.client.js +0 -72
  589. package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
  590. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +0 -1
  591. package/dist/field/features/lists/unorderedlist/feature.server.js.map +0 -1
  592. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +0 -1
  593. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +0 -1
  594. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
  595. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
  596. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
  597. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +0 -17
  598. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
  599. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
  600. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +0 -18
  601. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
  602. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
  603. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
  604. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +0 -6
  605. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
  606. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
  607. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +0 -40
  608. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
  609. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
  610. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  611. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  612. package/dist/populate/richTextRelationshipPromise.js +0 -68
  613. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  614. package/src/index.ts +0 -423
  615. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +0 -0
  616. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
  617. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
  618. /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.scss +0 -0
  619. /package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +0 -0
  620. /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
  621. /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
  622. /package/dist/field/features/debug/{treeview → treeView}/plugin/index.scss +0 -0
  623. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +0 -0
  624. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
  625. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
  626. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
  627. /package/dist/field/features/{horizontalrule → horizontalRule}/component/index.d.ts +0 -0
  628. /package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.d.ts +0 -0
  629. /package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.d.ts +0 -0
  630. /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts +0 -0
  631. /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js +0 -0
  632. /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.scss +0 -0
  633. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +0 -0
  634. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
  635. /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
  636. /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
  637. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +0 -0
  638. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
  639. /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
  640. /package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars}/types.js +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/field/features/toolbars/inline/Toolbar/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { mergeRegister } from '@lexical/utils'\nimport {\n $getSelection,\n $isRangeSelection,\n $isTextNode,\n COMMAND_PRIORITY_LOW,\n SELECTION_CHANGE_COMMAND,\n} from 'lexical'\nimport { useCallback, useEffect, useRef, useState } from 'react'\nimport * as React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { PluginComponentWithAnchor } from '../../../types.js'\nimport type { ToolbarGroup, ToolbarGroupItem } from '../../types.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { getDOMRangeRect } from '../../../../lexical/utils/getDOMRangeRect.js'\nimport { setFloatingElemPosition } from '../../../../lexical/utils/setFloatingElemPosition.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 group,\n index,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n group: ToolbarGroup\n index: number\n}): React.ReactNode {\n const { editorConfig } = useEditorConfigContext()\n\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 } else {\n setDropdownIcon(null)\n }\n return\n }\n const item = activeItems[0]\n setDropdownIcon(() => item.ChildComponent)\n }\n\n return (\n <div\n className={`inline-toolbar-popup__group inline-toolbar-popup__group-${group.key}`}\n key={group.key}\n >\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 maxActiveItems={1}\n onActiveChange={onActiveChange}\n />\n ) : (\n <ToolbarDropdown\n anchorElem={anchorElem}\n editor={editor}\n groupKey={group.key}\n items={group.items}\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.toolbarInline?.groups.length - 1 && (\n <div className=\"divider\" />\n )}\n </div>\n )\n}\n\nfunction InlineToolbar({\n anchorElem,\n editor,\n}: {\n anchorElem: HTMLElement\n editor: LexicalEditor\n}): React.ReactNode {\n const floatingToolbarRef = useRef<HTMLDivElement | null>(null)\n const caretRef = useRef<HTMLDivElement | null>(null)\n\n const { editorConfig } = useEditorConfigContext()\n\n const closeFloatingToolbar = useCallback(() => {\n if (floatingToolbarRef?.current) {\n const isOpacityZero = floatingToolbarRef.current.style.opacity === '0'\n const isPointerEventsNone = floatingToolbarRef.current.style.pointerEvents === 'none'\n\n if (!isOpacityZero) {\n floatingToolbarRef.current.style.opacity = '0'\n }\n if (!isPointerEventsNone) {\n floatingToolbarRef.current.style.pointerEvents = 'none'\n }\n }\n }, [floatingToolbarRef])\n\n const mouseMoveListener = useCallback(\n (e: MouseEvent) => {\n if (floatingToolbarRef?.current && (e.buttons === 1 || e.buttons === 3)) {\n const isOpacityZero = floatingToolbarRef.current.style.opacity === '0'\n const isPointerEventsNone = floatingToolbarRef.current.style.pointerEvents === 'none'\n if (!isOpacityZero || !isPointerEventsNone) {\n // Check if the mouse is not over the popup\n const x = e.clientX\n const y = e.clientY\n const elementUnderMouse = document.elementFromPoint(x, y)\n if (!floatingToolbarRef.current.contains(elementUnderMouse)) {\n // Mouse is not over the target element => not a normal click, but probably a drag\n closeFloatingToolbar()\n }\n }\n }\n },\n [closeFloatingToolbar],\n )\n\n const mouseUpListener = useCallback(() => {\n if (floatingToolbarRef?.current) {\n if (floatingToolbarRef.current.style.opacity !== '1') {\n floatingToolbarRef.current.style.opacity = '1'\n }\n if (floatingToolbarRef.current.style.pointerEvents !== 'auto') {\n floatingToolbarRef.current.style.pointerEvents = 'auto'\n }\n }\n }, [])\n\n useEffect(() => {\n document.addEventListener('mousemove', mouseMoveListener)\n document.addEventListener('mouseup', mouseUpListener)\n\n return () => {\n document.removeEventListener('mousemove', mouseMoveListener)\n document.removeEventListener('mouseup', mouseUpListener)\n }\n }, [floatingToolbarRef, mouseMoveListener, mouseUpListener])\n\n const updateTextFormatFloatingToolbar = useCallback(() => {\n const selection = $getSelection()\n\n const nativeSelection = window.getSelection()\n\n if (floatingToolbarRef.current === null) {\n return\n }\n\n const possibleLinkEditor = anchorElem.querySelector(':scope > .link-editor')\n const isLinkEditorVisible =\n possibleLinkEditor !== null &&\n 'style' in possibleLinkEditor &&\n possibleLinkEditor?.style?.['opacity'] === '1'\n\n const rootElement = editor.getRootElement()\n if (\n selection !== null &&\n nativeSelection !== null &&\n !nativeSelection.isCollapsed &&\n rootElement !== null &&\n rootElement.contains(nativeSelection.anchorNode)\n ) {\n const rangeRect = getDOMRangeRect(nativeSelection, rootElement)\n\n // Position floating toolbar\n const offsetIfFlipped = setFloatingElemPosition({\n alwaysDisplayOnTop: isLinkEditorVisible,\n anchorElem,\n floatingElem: floatingToolbarRef.current,\n horizontalPosition: 'center',\n targetRect: rangeRect,\n })\n\n // Position caret\n if (caretRef.current) {\n setFloatingElemPosition({\n anchorElem: floatingToolbarRef.current,\n anchorFlippedOffset: offsetIfFlipped,\n floatingElem: caretRef.current,\n horizontalOffset: 5,\n horizontalPosition: 'center',\n specialHandlingForCaret: true,\n targetRect: rangeRect,\n verticalGap: 10,\n })\n }\n } else {\n closeFloatingToolbar()\n }\n }, [editor, closeFloatingToolbar, anchorElem])\n\n useEffect(() => {\n const scrollerElem = anchorElem.parentElement\n\n const update = () => {\n editor.getEditorState().read(() => {\n updateTextFormatFloatingToolbar()\n })\n }\n\n window.addEventListener('resize', update)\n if (scrollerElem) {\n scrollerElem.addEventListener('scroll', update)\n }\n\n return () => {\n window.removeEventListener('resize', update)\n if (scrollerElem) {\n scrollerElem.removeEventListener('scroll', update)\n }\n }\n }, [editor, updateTextFormatFloatingToolbar, anchorElem])\n\n useEffect(() => {\n editor.getEditorState().read(() => {\n updateTextFormatFloatingToolbar()\n })\n return mergeRegister(\n editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n updateTextFormatFloatingToolbar()\n })\n }),\n\n editor.registerCommand(\n SELECTION_CHANGE_COMMAND,\n () => {\n updateTextFormatFloatingToolbar()\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n )\n }, [editor, updateTextFormatFloatingToolbar])\n\n return (\n <div className=\"inline-toolbar-popup\" ref={floatingToolbarRef}>\n <div className=\"caret\" ref={caretRef} />\n {editor.isEditable() && (\n <React.Fragment>\n {editorConfig?.features &&\n editorConfig.features?.toolbarInline?.groups.map((group, i) => {\n return (\n <ToolbarGroupComponent\n anchorElem={anchorElem}\n editor={editor}\n group={group}\n index={i}\n key={group.key}\n />\n )\n })}\n </React.Fragment>\n )}\n </div>\n )\n}\n\nfunction useInlineToolbar(\n editor: LexicalEditor,\n anchorElem: HTMLElement,\n): React.ReactElement | null {\n const [isText, setIsText] = useState(false)\n\n const updatePopup = useCallback(() => {\n editor.getEditorState().read(() => {\n // Should not to pop up the floating toolbar when using IME input\n if (editor.isComposing()) {\n return\n }\n const selection = $getSelection()\n const nativeSelection = window.getSelection()\n const rootElement = editor.getRootElement()\n\n if (\n nativeSelection !== null &&\n (!$isRangeSelection(selection) ||\n rootElement === null ||\n !rootElement.contains(nativeSelection.anchorNode))\n ) {\n setIsText(false)\n return\n }\n\n if (!$isRangeSelection(selection)) {\n return\n }\n\n if (selection.getTextContent() !== '') {\n const nodes = selection.getNodes()\n let foundNodeWithText = false\n for (const node of nodes) {\n if ($isTextNode(node)) {\n setIsText(true)\n foundNodeWithText = true\n break\n }\n }\n if (!foundNodeWithText) {\n setIsText(false)\n }\n } else {\n setIsText(false)\n }\n\n const rawTextContent = selection.getTextContent().replace(/\\n/g, '')\n if (!selection.isCollapsed() && rawTextContent === '') {\n setIsText(false)\n return\n }\n })\n }, [editor])\n\n useEffect(() => {\n document.addEventListener('selectionchange', updatePopup)\n document.addEventListener('mouseup', updatePopup)\n return () => {\n document.removeEventListener('selectionchange', updatePopup)\n document.removeEventListener('mouseup', updatePopup)\n }\n }, [updatePopup])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(() => {\n updatePopup()\n }),\n editor.registerRootListener(() => {\n if (editor.getRootElement() === null) {\n setIsText(false)\n }\n }),\n )\n }, [editor, updatePopup])\n\n if (!isText) {\n return null\n }\n\n return createPortal(<InlineToolbar anchorElem={anchorElem} editor={editor} />, anchorElem)\n}\n\nexport const InlineToolbarPlugin: PluginComponentWithAnchor<undefined> = ({ anchorElem }) => {\n const [editor] = useLexicalComposerContext()\n\n return useInlineToolbar(editor, anchorElem)\n}\n"],"names":["useLexicalComposerContext","mergeRegister","$getSelection","$isRangeSelection","$isTextNode","COMMAND_PRIORITY_LOW","SELECTION_CHANGE_COMMAND","useCallback","useEffect","useRef","useState","React","createPortal","useEditorConfigContext","getDOMRangeRect","setFloatingElemPosition","ToolbarButton","ToolbarDropdown","ButtonGroupItem","anchorElem","editor","item","Component","key","ChildComponent","ToolbarGroupComponent","group","index","editorConfig","DropdownIcon","setDropdownIcon","type","items","length","onActiveChange","activeItems","div","className","Icon","groupKey","maxActiveItems","map","features","toolbarInline","groups","InlineToolbar","floatingToolbarRef","caretRef","closeFloatingToolbar","current","isOpacityZero","style","opacity","isPointerEventsNone","pointerEvents","mouseMoveListener","e","buttons","x","clientX","y","clientY","elementUnderMouse","document","elementFromPoint","contains","mouseUpListener","addEventListener","removeEventListener","updateTextFormatFloatingToolbar","selection","nativeSelection","window","getSelection","possibleLinkEditor","querySelector","isLinkEditorVisible","rootElement","getRootElement","isCollapsed","anchorNode","rangeRect","offsetIfFlipped","alwaysDisplayOnTop","floatingElem","horizontalPosition","targetRect","anchorFlippedOffset","horizontalOffset","specialHandlingForCaret","verticalGap","scrollerElem","parentElement","update","getEditorState","read","registerUpdateListener","editorState","registerCommand","ref","isEditable","Fragment","i","useInlineToolbar","isText","setIsText","updatePopup","isComposing","getTextContent","nodes","getNodes","foundNodeWithText","node","rawTextContent","replace","registerRootListener","InlineToolbarPlugin"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SACEC,aAAa,EACbC,iBAAiB,EACjBC,WAAW,EACXC,oBAAoB,EACpBC,wBAAwB,QACnB,UAAS;AAChB,SAASC,WAAW,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAChE,YAAYC,WAAW,QAAO;AAC9B,SAASC,YAAY,QAAQ,YAAW;AAKxC,SAASC,sBAAsB,QAAQ,4DAA2D;AAClG,SAASC,eAAe,QAAQ,+CAA8C;AAC9E,SAASC,uBAAuB,QAAQ,uDAAsD;AAC9F,SAASC,aAAa,QAAQ,sCAAqC;AACnE,SAASC,eAAe,QAAQ,wCAAuC;AACvE,OAAO,eAAc;AAErB,SAASC,gBAAgB,EACvBC,UAAU,EACVC,MAAM,EACNC,IAAI,EAKL;IACC,IAAIA,KAAKC,SAAS,EAAE;QAClB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AAU;gBACZ;YACF,OAAO;gBACLA,UAAU;YACZ;YAEA,MAAMQ,iBAAiB3C,UAAUsC,cAAc,GAAGM,OAAO,CAAC,OAAO;YACjE,IAAI,CAAC5C,UAAUS,WAAW,MAAMkC,mBAAmB,IAAI;gBACrDR,UAAU;gBACV;YACF;QACF;IACF,GAAG;QAACrF;KAAO;IAEXZ,UAAU;QACRuD,SAASI,gBAAgB,CAAC,mBAAmBuC;QAC7C3C,SAASI,gBAAgB,CAAC,WAAWuC;QACrC,OAAO;YACL3C,SAASK,mBAAmB,CAAC,mBAAmBsC;YAChD3C,SAASK,mBAAmB,CAAC,WAAWsC;QAC1C;IACF,GAAG;QAACA;KAAY;IAEhBlG,UAAU;QACR,OAAOP,cACLmB,OAAO4E,sBAAsB,CAAC;YAC5BU;QACF,IACAtF,OAAO+F,oBAAoB,CAAC;YAC1B,IAAI/F,OAAO0D,cAAc,OAAO,MAAM;gBACpC2B,UAAU;YACZ;QACF;IAEJ,GAAG;QAACrF;QAAQsF;KAAY;IAExB,IAAI,CAACF,QAAQ;QACX,OAAO;IACT;IAEA,qBAAO5F,2BAAa,oBAACiC;QAAc1B,YAAYA;QAAYC,QAAQA;QAAYD;AACjF;AAEA,OAAO,MAAMiG,sBAA4D,CAAC,EAAEjG,UAAU,EAAE;IACtF,MAAM,CAACC,OAAO,GAAGpB;IAEjB,OAAOuG,iBAAiBnF,QAAQD;AAClC,EAAC"}
@@ -1,21 +1,21 @@
1
- @import '../../../../scss/styles.scss';
1
+ @import '../../../../../scss/styles';
2
2
 
3
3
  html[data-theme='light'] {
4
- .floating-select-toolbar-popup {
4
+ .inline-toolbar-popup {
5
5
  @include shadow-m;
6
6
  }
7
7
  }
8
8
 
9
- .floating-select-toolbar-popup {
9
+ .inline-toolbar-popup {
10
10
  display: flex;
11
11
  align-items: center;
12
12
  background: var(--color-base-0);
13
- padding: 0px 3.72px 0px 6.25px;
13
+ padding: 0 3.72px 0 6.25px;
14
14
  vertical-align: middle;
15
15
  position: absolute;
16
16
  top: 0;
17
17
  left: 0;
18
- z-index: 10;
18
+ z-index: 2;
19
19
  opacity: 0;
20
20
  border-radius: 6.25px;
21
21
  transition: opacity 0.2s;
@@ -31,9 +31,10 @@ html[data-theme='light'] {
31
31
  border-top-color: var(--color-base-0);
32
32
  }
33
33
 
34
- &__section {
34
+ &__group {
35
35
  display: flex;
36
36
  align-items: center;
37
+ gap: 2px;
37
38
 
38
39
  .icon {
39
40
  min-width: 20px;
@@ -49,9 +50,4 @@ html[data-theme='light'] {
49
50
  }
50
51
  }
51
52
 
52
- @media (max-width: 1024px) {
53
- button.insert-comment {
54
- display: none;
55
- }
56
- }
57
53
  }
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" resolution-mode="require"/>
2
+ export declare const InlineToolbarFeatureClientComponent: import("react").FC<undefined>;
3
+ //# sourceMappingURL=feature.client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/toolbars/inline/feature.client.tsx"],"names":[],"mappings":";AAsBA,eAAO,MAAM,mCAAmC,+BAAoD,CAAA"}
@@ -0,0 +1,20 @@
1
+ 'use client';
2
+ import { createClientComponent } from '../../createClientComponent.js';
3
+ import { InlineToolbarPlugin } from './Toolbar/index.js';
4
+ const InlineToolbarFeatureClient = (props)=>{
5
+ return {
6
+ clientFeatureProps: props,
7
+ feature: ()=>({
8
+ clientFeatureProps: props,
9
+ plugins: [
10
+ {
11
+ Component: InlineToolbarPlugin,
12
+ position: 'floatingAnchorElem'
13
+ }
14
+ ]
15
+ })
16
+ };
17
+ };
18
+ export const InlineToolbarFeatureClientComponent = createClientComponent(InlineToolbarFeatureClient);
19
+
20
+ //# sourceMappingURL=feature.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/toolbars/inline/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport type { FeatureProviderProviderClient } from '../../types.js'\n\nimport { createClientComponent } from '../../createClientComponent.js'\nimport { InlineToolbarPlugin } from './Toolbar/index.js'\n\nconst InlineToolbarFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n plugins: [\n {\n Component: InlineToolbarPlugin,\n position: 'floatingAnchorElem',\n },\n ],\n }),\n }\n}\n\nexport const InlineToolbarFeatureClientComponent = createClientComponent(InlineToolbarFeatureClient)\n"],"names":["createClientComponent","InlineToolbarPlugin","InlineToolbarFeatureClient","props","clientFeatureProps","feature","plugins","Component","position","InlineToolbarFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,qBAAqB,QAAQ,iCAAgC;AACtE,SAASC,mBAAmB,QAAQ,qBAAoB;AAExD,MAAMC,6BAAuE,CAACC;IAC5E,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,SAAS;oBACP;wBACEC,WAAWN;wBACXO,UAAU;oBACZ;iBACD;YACH,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,sCAAsCT,sBAAsBE,4BAA2B"}
@@ -0,0 +1,3 @@
1
+ import type { FeatureProviderProviderServer } from '../../types.js';
2
+ export declare const InlineToolbarFeature: FeatureProviderProviderServer<undefined, undefined>;
3
+ //# sourceMappingURL=feature.server.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/toolbars/inline/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,gBAAgB,CAAA;AAInE,eAAO,MAAM,oBAAoB,EAAE,6BAA6B,CAAC,SAAS,EAAE,SAAS,CAcpF,CAAA"}
@@ -0,0 +1,16 @@
1
+ import { InlineToolbarFeatureClientComponent } from './feature.client.js';
2
+ export const InlineToolbarFeature = (props)=>{
3
+ return {
4
+ feature: ()=>{
5
+ return {
6
+ ClientComponent: InlineToolbarFeatureClientComponent,
7
+ clientFeatureProps: null,
8
+ serverFeatureProps: props
9
+ };
10
+ },
11
+ key: 'toolbarInline',
12
+ serverFeatureProps: props
13
+ };
14
+ };
15
+
16
+ //# sourceMappingURL=feature.server.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/toolbars/inline/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../../types.js'\n\nimport { InlineToolbarFeatureClientComponent } from './feature.client.js'\n\nexport const InlineToolbarFeature: FeatureProviderProviderServer<undefined, undefined> = (\n props,\n) => {\n return {\n feature: () => {\n return {\n ClientComponent: InlineToolbarFeatureClientComponent,\n clientFeatureProps: null,\n serverFeatureProps: props,\n }\n },\n key: 'toolbarInline',\n serverFeatureProps: props,\n }\n}\n"],"names":["InlineToolbarFeatureClientComponent","InlineToolbarFeature","props","feature","ClientComponent","clientFeatureProps","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;","mappings":"AAEA,SAASA,mCAAmC,QAAQ,sBAAqB;AAEzE,OAAO,MAAMC,uBAA4E,CACvFC;IAEA,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBJ;gBACjBK,oBAAoB;gBACpBC,oBAAoBJ;YACtB;QACF;QACAK,KAAK;QACLD,oBAAoBJ;IACtB;AACF,EAAC"}
@@ -0,0 +1,10 @@
1
+ import type { LexicalEditor } from 'lexical';
2
+ import React from 'react';
3
+ import type { ToolbarGroupItem } from '../../types.js';
4
+ import './index.scss';
5
+ export declare const ToolbarButton: ({ children, editor, item, }: {
6
+ children: React.JSX.Element;
7
+ editor: LexicalEditor;
8
+ item: ToolbarGroupItem;
9
+ }) => React.JSX.Element;
10
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/toolbars/shared/ToolbarButton/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAI5C,OAAO,KAA2C,MAAM,OAAO,CAAA;AAE/D,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAGtD,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,aAAa,gCAIvB;IACD,QAAQ,EAAE,MAAM,GAAG,QAAQ,CAAA;IAC3B,MAAM,EAAE,aAAa,CAAA;IACrB,IAAI,EAAE,gBAAgB,CAAA;CACvB,sBAqFA,CAAA"}
@@ -1,33 +1,32 @@
1
1
  'use client';
2
- import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js';
3
- const { useLexicalComposerContext } = lexicalComposerContextImport;
4
- import lexicalUtilsImport from '@lexical/utils';
5
- const { mergeRegister } = lexicalUtilsImport;
6
- import lexicalImport from 'lexical';
7
- const { $getSelection } = lexicalImport;
2
+ import { mergeRegister } from '@lexical/utils';
3
+ import { $getSelection } from 'lexical';
8
4
  import React, { useCallback, useEffect, useState } from 'react';
5
+ import { useEditorFocus } from '../../../../lexical/EditorFocusProvider.js';
9
6
  import './index.scss';
10
- const baseClass = 'floating-select-toolbar-popup__button';
11
- export const ToolbarButton = ({ children, entry })=>{
12
- const [editor] = useLexicalComposerContext();
7
+ const baseClass = 'toolbar-popup__button';
8
+ export const ToolbarButton = ({ children, editor, item })=>{
13
9
  const [enabled, setEnabled] = useState(true);
14
10
  const [active, setActive] = useState(false);
15
11
  const [className, setClassName] = useState(baseClass);
12
+ const editorFocusContext = useEditorFocus();
16
13
  const updateStates = useCallback(()=>{
17
14
  editor.getEditorState().read(()=>{
18
15
  const selection = $getSelection();
19
- if (entry.isActive) {
20
- const isActive = entry.isActive({
16
+ if (item.isActive) {
17
+ const isActive = item.isActive({
21
18
  editor,
19
+ editorFocusContext,
22
20
  selection
23
21
  });
24
22
  if (active !== isActive) {
25
23
  setActive(isActive);
26
24
  }
27
25
  }
28
- if (entry.isEnabled) {
29
- const isEnabled = entry.isEnabled({
26
+ if (item.isEnabled) {
27
+ const isEnabled = item.isEnabled({
30
28
  editor,
29
+ editorFocusContext,
31
30
  selection
32
31
  });
33
32
  if (enabled !== isEnabled) {
@@ -38,8 +37,9 @@ export const ToolbarButton = ({ children, entry })=>{
38
37
  }, [
39
38
  active,
40
39
  editor,
40
+ editorFocusContext,
41
41
  enabled,
42
- entry
42
+ item
43
43
  ]);
44
44
  useEffect(()=>{
45
45
  updateStates();
@@ -67,21 +67,31 @@ export const ToolbarButton = ({ children, entry })=>{
67
67
  baseClass,
68
68
  enabled === false ? 'disabled' : '',
69
69
  active ? 'active' : '',
70
- entry?.key ? `${baseClass}-` + entry.key : ''
70
+ item?.key ? `${baseClass}-` + item.key : ''
71
71
  ].filter(Boolean).join(' '));
72
72
  }, [
73
73
  enabled,
74
74
  active,
75
- className
75
+ className,
76
+ item.key
76
77
  ]);
77
78
  return /*#__PURE__*/ React.createElement("button", {
78
79
  className: className,
79
80
  onClick: ()=>{
80
81
  if (enabled !== false) {
81
- entry.onClick({
82
- editor,
83
- isActive: active
82
+ editor._updateTags = new Set([
83
+ ...editor._updateTags,
84
+ 'toolbar'
85
+ ]) // without setting the tags, our onSelect will not be able to trigger our onChange as focus onChanges are ignored.
86
+ ;
87
+ editor.focus(()=>{
88
+ // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.
89
+ item.onSelect({
90
+ editor,
91
+ isActive: active
92
+ });
84
93
  });
94
+ return true;
85
95
  }
86
96
  },
87
97
  onMouseDown: (e)=>{
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/field/features/toolbars/shared/ToolbarButton/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { mergeRegister } from '@lexical/utils'\nimport { $getSelection } from 'lexical'\nimport React, { useCallback, useEffect, useState } from 'react'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nimport { useEditorFocus } from '../../../../lexical/EditorFocusProvider.js'\nimport './index.scss'\n\nconst baseClass = 'toolbar-popup__button'\n\nexport const ToolbarButton = ({\n children,\n editor,\n item,\n}: {\n children: React.JSX.Element\n editor: LexicalEditor\n item: ToolbarGroupItem\n}) => {\n const [enabled, setEnabled] = useState<boolean>(true)\n const [active, setActive] = useState<boolean>(false)\n const [className, setClassName] = useState<string>(baseClass)\n const editorFocusContext = useEditorFocus()\n\n const updateStates = useCallback(() => {\n editor.getEditorState().read(() => {\n const selection = $getSelection()\n if (item.isActive) {\n const isActive = item.isActive({ editor, editorFocusContext, selection })\n if (active !== isActive) {\n setActive(isActive)\n }\n }\n if (item.isEnabled) {\n const isEnabled = item.isEnabled({ editor, editorFocusContext, selection })\n if (enabled !== isEnabled) {\n setEnabled(isEnabled)\n }\n }\n })\n }, [active, editor, editorFocusContext, enabled, item])\n\n useEffect(() => {\n updateStates()\n }, [updateStates])\n\n useEffect(() => {\n document.addEventListener('mouseup', updateStates)\n return () => {\n document.removeEventListener('mouseup', updateStates)\n }\n }, [updateStates])\n\n useEffect(() => {\n return mergeRegister(\n editor.registerUpdateListener(() => {\n updateStates()\n }),\n )\n }, [editor, updateStates])\n\n useEffect(() => {\n setClassName(\n [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n item?.key ? `${baseClass}-` + item.key : '',\n ]\n .filter(Boolean)\n .join(' '),\n )\n }, [enabled, active, className, item.key])\n\n return (\n <button\n className={className}\n onClick={() => {\n if (enabled !== false) {\n editor._updateTags = new Set([...editor._updateTags, 'toolbar']) // without setting the tags, our onSelect will not be able to trigger our onChange as focus onChanges are ignored.\n\n editor.focus(() => {\n // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.\n item.onSelect({\n editor,\n isActive: active,\n })\n })\n\n return true\n }\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n type=\"button\"\n >\n {children}\n </button>\n )\n}\n"],"names":["mergeRegister","$getSelection","React","useCallback","useEffect","useState","useEditorFocus","baseClass","ToolbarButton","children","editor","item","enabled","setEnabled","active","setActive","className","setClassName","editorFocusContext","updateStates","getEditorState","read","selection","isActive","isEnabled","document","addEventListener","removeEventListener","registerUpdateListener","key","filter","Boolean","join","button","onClick","_updateTags","Set","focus","onSelect","onMouseDown","e","preventDefault","type"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,aAAa,QAAQ,iBAAgB;AAC9C,SAASC,aAAa,QAAQ,UAAS;AACvC,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAI/D,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,OAAO,MAAMC,gBAAgB,CAAC,EAC5BC,QAAQ,EACRC,MAAM,EACNC,IAAI,EAKL;IACC,MAAM,CAACC,SAASC,WAAW,GAAGR,SAAkB;IAChD,MAAM,CAACS,QAAQC,UAAU,GAAGV,SAAkB;IAC9C,MAAM,CAACW,WAAWC,aAAa,GAAGZ,SAAiBE;IACnD,MAAMW,qBAAqBZ;IAE3B,MAAMa,eAAehB,YAAY;QAC/BO,OAAOU,cAAc,GAAGC,IAAI,CAAC;YAC3B,MAAMC,YAAYrB;YAClB,IAAIU,KAAKY,QAAQ,EAAE;gBACjB,MAAMA,WAAWZ,KAAKY,QAAQ,CAAC;oBAAEb;oBAAQQ;oBAAoBI;gBAAU;gBACvE,IAAIR,WAAWS,UAAU;oBACvBR,UAAUQ;gBACZ;YACF;YACA,IAAIZ,KAAKa,SAAS,EAAE;gBAClB,MAAMA,YAAYb,KAAKa,SAAS,CAAC;oBAAEd;oBAAQQ;oBAAoBI;gBAAU;gBACzE,IAAIV,YAAYY,WAAW;oBACzBX,WAAWW;gBACb;YACF;QACF;IACF,GAAG;QAACV;QAAQJ;QAAQQ;QAAoBN;QAASD;KAAK;IAEtDP,UAAU;QACRe;IACF,GAAG;QAACA;KAAa;IAEjBf,UAAU;QACRqB,SAASC,gBAAgB,CAAC,WAAWP;QACrC,OAAO;YACLM,SAASE,mBAAmB,CAAC,WAAWR;QAC1C;IACF,GAAG;QAACA;KAAa;IAEjBf,UAAU;QACR,OAAOJ,cACLU,OAAOkB,sBAAsB,CAAC;YAC5BT;QACF;IAEJ,GAAG;QAACT;QAAQS;KAAa;IAEzBf,UAAU;QACRa,aACE;YACEV;YACAK,YAAY,QAAQ,aAAa;YACjCE,SAAS,WAAW;YACpBH,MAAMkB,MAAM,CAAC,EAAEtB,UAAU,CAAC,CAAC,GAAGI,KAAKkB,GAAG,GAAG;SAC1C,CACEC,MAAM,CAACC,SACPC,IAAI,CAAC;IAEZ,GAAG;QAACpB;QAASE;QAAQE;QAAWL,KAAKkB,GAAG;KAAC;IAEzC,qBACE,oBAACI;QACCjB,WAAWA;QACXkB,SAAS;YACP,IAAItB,YAAY,OAAO;gBACrBF,OAAOyB,WAAW,GAAG,IAAIC,IAAI;uBAAI1B,OAAOyB,WAAW;oBAAE;iBAAU,EAAE,kHAAkH;;gBAEnLzB,OAAO2B,KAAK,CAAC;oBACX,iHAAiH;oBACjH1B,KAAK2B,QAAQ,CAAC;wBACZ5B;wBACAa,UAAUT;oBACZ;gBACF;gBAEA,OAAO;YACT;QACF;QACAyB,aAAa,CAACC;YACZ,8HAA8H;YAC9H,2JAA2J;YAC3J,sKAAsK;YACtKA,EAAEC,cAAc;QAClB;QACAC,MAAK;OAEJjC;AAGP,EAAC"}
@@ -1,4 +1,6 @@
1
- .floating-select-toolbar-popup__button {
1
+ @import '../../../../../scss/styles';
2
+
3
+ .toolbar-popup__button {
2
4
  display: flex;
3
5
  align-items: center;
4
6
  vertical-align: middle;
@@ -0,0 +1,23 @@
1
+ import type { LexicalEditor } from 'lexical';
2
+ import { type ReactNode } from 'react';
3
+ import React from 'react';
4
+ import type { ToolbarGroupItem } from '../../types.js';
5
+ export declare function DropDownItem({ active, children, editor, enabled, item, title, }: {
6
+ active?: boolean;
7
+ children: React.ReactNode;
8
+ editor: LexicalEditor;
9
+ enabled?: boolean;
10
+ item: ToolbarGroupItem;
11
+ title?: string;
12
+ }): React.ReactNode;
13
+ export declare function DropDown({ Icon, buttonAriaLabel, buttonClassName, children, disabled, itemsContainerClassNames, label, stopCloseOnClickSelf, }: {
14
+ Icon?: React.FC;
15
+ buttonAriaLabel?: string;
16
+ buttonClassName: string;
17
+ children: ReactNode;
18
+ disabled?: boolean;
19
+ itemsContainerClassNames?: string[];
20
+ label?: string;
21
+ stopCloseOnClickSelf?: boolean;
22
+ }): React.ReactNode;
23
+ //# sourceMappingURL=DropDown.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"DropDown.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAE5C,OAAO,EAAE,KAAK,SAAS,EAAqD,MAAM,OAAO,CAAA;AACzF,OAAO,KAAK,MAAM,OAAO,CAAA;AAGzB,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAUtD,wBAAgB,YAAY,CAAC,EAC3B,MAAM,EACN,QAAQ,EACR,MAAM,EACN,OAAO,EACP,IAAI,EACJ,KAAK,GACN,EAAE;IACD,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;IACzB,MAAM,EAAE,aAAa,CAAA;IACrB,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,IAAI,EAAE,gBAAgB,CAAA;IACtB,KAAK,CAAC,EAAE,MAAM,CAAA;CACf,GAAG,KAAK,CAAC,SAAS,CA4DlB;AA8ED,wBAAgB,QAAQ,CAAC,EACvB,IAAI,EACJ,eAAe,EACf,eAAe,EACf,QAAQ,EACR,QAAgB,EAChB,wBAAwB,EACxB,KAAK,EACL,oBAAoB,GACrB,EAAE;IACD,IAAI,CAAC,EAAE,KAAK,CAAC,EAAE,CAAA;IACf,eAAe,CAAC,EAAE,MAAM,CAAA;IACxB,eAAe,EAAE,MAAM,CAAA;IACvB,QAAQ,EAAE,SAAS,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAC/B,GAAG,KAAK,CAAC,SAAS,CAqFlB"}
@@ -1,81 +1,23 @@
1
1
  'use client';
2
- import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js';
3
- const { useLexicalComposerContext } = lexicalComposerContextImport;
4
- import lexicalUtilsImport from '@lexical/utils';
5
- const { mergeRegister } = lexicalUtilsImport;
6
- import lexicalImport from 'lexical';
7
- const { $getSelection } = lexicalImport;
8
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
9
3
  import React from 'react';
10
4
  import { createPortal } from 'react-dom';
11
- const baseClass = 'floating-select-toolbar-popup__dropdown-item';
5
+ const baseClass = 'toolbar-popup__dropdown-item';
12
6
  const DropDownContext = /*#__PURE__*/ React.createContext(null);
13
- export function DropDownItem({ children, entry, title }) {
14
- const [editor] = useLexicalComposerContext();
15
- const [enabled, setEnabled] = useState(true);
16
- const [active, setActive] = useState(false);
7
+ export function DropDownItem({ active, children, editor, enabled, item, title }) {
17
8
  const [className, setClassName] = useState(baseClass);
18
- const updateStates = useCallback(()=>{
19
- editor.getEditorState().read(()=>{
20
- const selection = $getSelection();
21
- if (entry.isActive) {
22
- const isActive = entry.isActive({
23
- editor,
24
- selection
25
- });
26
- if (active !== isActive) {
27
- setActive(isActive);
28
- }
29
- }
30
- if (entry.isEnabled) {
31
- const isEnabled = entry.isEnabled({
32
- editor,
33
- selection
34
- });
35
- if (enabled !== isEnabled) {
36
- setEnabled(isEnabled);
37
- }
38
- }
39
- });
40
- }, [
41
- active,
42
- editor,
43
- enabled,
44
- entry
45
- ]);
46
- useEffect(()=>{
47
- updateStates();
48
- }, [
49
- updateStates
50
- ]);
51
- useEffect(()=>{
52
- document.addEventListener('mouseup', updateStates);
53
- return ()=>{
54
- document.removeEventListener('mouseup', updateStates);
55
- };
56
- }, [
57
- updateStates
58
- ]);
59
- useEffect(()=>{
60
- return mergeRegister(editor.registerUpdateListener(()=>{
61
- updateStates();
62
- }));
63
- }, [
64
- editor,
65
- updateStates
66
- ]);
67
9
  useEffect(()=>{
68
10
  setClassName([
69
11
  baseClass,
70
12
  enabled === false ? 'disabled' : '',
71
13
  active ? 'active' : '',
72
- entry?.key ? `${baseClass}-${entry.key}` : ''
14
+ item?.key ? `${baseClass}-${item.key}` : ''
73
15
  ].filter(Boolean).join(' '));
74
16
  }, [
75
17
  enabled,
76
18
  active,
77
19
  className,
78
- entry.key
20
+ item.key
79
21
  ]);
80
22
  const ref = useRef(null);
81
23
  const dropDownContext = React.useContext(DropDownContext);
@@ -95,9 +37,17 @@ export function DropDownItem({ children, entry, title }) {
95
37
  className: className,
96
38
  onClick: ()=>{
97
39
  if (enabled !== false) {
98
- entry.onClick({
99
- editor,
100
- isActive: active
40
+ editor._updateTags = new Set([
41
+ ...editor._updateTags,
42
+ 'toolbar'
43
+ ]) // without setting the tags, our onSelect will not be able to trigger our onChange as focus onChanges are ignored.
44
+ ;
45
+ editor.focus(()=>{
46
+ // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.
47
+ item.onSelect({
48
+ editor,
49
+ isActive: active
50
+ });
101
51
  });
102
52
  }
103
53
  },
@@ -111,7 +61,7 @@ export function DropDownItem({ children, entry, title }) {
111
61
  type: "button"
112
62
  }, children);
113
63
  }
114
- function DropDownItems({ children, dropDownRef, onClose }) {
64
+ function DropDownItems({ children, dropDownRef, itemsContainerClassNames, onClose }) {
115
65
  const [items, setItems] = useState();
116
66
  const [highlightedItem, setHighlightedItem] = useState();
117
67
  const registerItem = useCallback((itemRef)=>{
@@ -159,7 +109,7 @@ function DropDownItems({ children, dropDownRef, onClose }) {
159
109
  if (items != null && highlightedItem == null) {
160
110
  setHighlightedItem(items[0]);
161
111
  }
162
- if (highlightedItem?.current != null) {
112
+ if (highlightedItem != null && highlightedItem?.current != null) {
163
113
  highlightedItem.current.focus();
164
114
  }
165
115
  }, [
@@ -169,12 +119,14 @@ function DropDownItems({ children, dropDownRef, onClose }) {
169
119
  return /*#__PURE__*/ React.createElement(DropDownContext.Provider, {
170
120
  value: contextValue
171
121
  }, /*#__PURE__*/ React.createElement("div", {
172
- className: "floating-select-toolbar-popup__dropdown-items",
122
+ className: (itemsContainerClassNames ?? [
123
+ 'toolbar-popup__dropdown-items'
124
+ ]).join(' '),
173
125
  onKeyDown: handleKeyDown,
174
126
  ref: dropDownRef
175
127
  }, children));
176
128
  }
177
- export function DropDown({ Icon, buttonAriaLabel, buttonClassName, children, disabled = false, stopCloseOnClickSelf }) {
129
+ export function DropDown({ Icon, buttonAriaLabel, buttonClassName, children, disabled = false, itemsContainerClassNames, label, stopCloseOnClickSelf }) {
178
130
  const dropDownRef = useRef(null);
179
131
  const buttonRef = useRef(null);
180
132
  const [showDropDown, setShowDropDown] = useState(false);
@@ -189,7 +141,7 @@ export function DropDown({ Icon, buttonAriaLabel, buttonClassName, children, dis
189
141
  const dropDown = dropDownRef.current;
190
142
  if (showDropDown && button !== null && dropDown !== null) {
191
143
  const { left, top } = button.getBoundingClientRect();
192
- const scrollTopOffset = window.pageYOffset || document.documentElement.scrollTop;
144
+ const scrollTopOffset = window.scrollY || document.documentElement.scrollTop;
193
145
  dropDown.style.top = `${top + scrollTopOffset + button.offsetHeight + 5}px`;
194
146
  dropDown.style.left = `${Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20)}px`;
195
147
  }
@@ -240,10 +192,13 @@ export function DropDown({ Icon, buttonAriaLabel, buttonClassName, children, dis
240
192
  },
241
193
  ref: buttonRef,
242
194
  type: "button"
243
- }, /*#__PURE__*/ React.createElement(Icon, null), /*#__PURE__*/ React.createElement("i", {
244
- className: "floating-select-toolbar-popup__dropdown-caret"
195
+ }, Icon && /*#__PURE__*/ React.createElement(Icon, null), label && /*#__PURE__*/ React.createElement("span", {
196
+ className: "toolbar-popup__dropdown-label"
197
+ }, label), /*#__PURE__*/ React.createElement("i", {
198
+ className: "toolbar-popup__dropdown-caret"
245
199
  })), showDropDown && /*#__PURE__*/ createPortal(/*#__PURE__*/ React.createElement(DropDownItems, {
246
200
  dropDownRef: dropDownRef,
201
+ itemsContainerClassNames: itemsContainerClassNames,
247
202
  onClose: handleClose
248
203
  }, children), document.body));
249
204
  }
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../../src/field/features/toolbars/shared/ToolbarDropdown/DropDown.tsx"],"sourcesContent":["'use client'\nimport type { LexicalEditor } from 'lexical'\n\nimport { type ReactNode, useCallback, useEffect, useMemo, useRef, useState } from 'react'\nimport React from 'react'\nimport { createPortal } from 'react-dom'\n\nimport type { ToolbarGroupItem } from '../../types.js'\n\nconst baseClass = 'toolbar-popup__dropdown-item'\n\ninterface DropDownContextType {\n registerItem: (ref: React.RefObject<HTMLButtonElement>) => void\n}\n\nconst DropDownContext = React.createContext<DropDownContextType | null>(null)\n\nexport function DropDownItem({\n active,\n children,\n editor,\n enabled,\n item,\n title,\n}: {\n active?: boolean\n children: React.ReactNode\n editor: LexicalEditor\n enabled?: boolean\n item: ToolbarGroupItem\n title?: string\n}): React.ReactNode {\n const [className, setClassName] = useState<string>(baseClass)\n\n useEffect(() => {\n setClassName(\n [\n baseClass,\n enabled === false ? 'disabled' : '',\n active ? 'active' : '',\n item?.key ? `${baseClass}-${item.key}` : '',\n ]\n .filter(Boolean)\n .join(' '),\n )\n }, [enabled, active, className, item.key])\n\n const ref = useRef<HTMLButtonElement>(null)\n\n const dropDownContext = React.useContext(DropDownContext)\n\n if (dropDownContext === null) {\n throw new Error('DropDownItem must be used within a DropDown')\n }\n\n const { registerItem } = dropDownContext\n\n useEffect(() => {\n if (ref?.current != null) {\n registerItem(ref)\n }\n }, [ref, registerItem])\n\n return (\n <button\n className={className}\n onClick={() => {\n if (enabled !== false) {\n editor._updateTags = new Set([...editor._updateTags, 'toolbar']) // without setting the tags, our onSelect will not be able to trigger our onChange as focus onChanges are ignored.\n\n editor.focus(() => {\n // We need to wrap the onSelect in the callback, so the editor is properly focused before the onSelect is called.\n item.onSelect({\n editor,\n isActive: active,\n })\n })\n }\n }}\n onMouseDown={(e) => {\n // This is required for Firefox compatibility. Without it, the dropdown will disappear without the onClick being called.\n // This only happens in Firefox. Must be something about how Firefox handles focus events differently.\n e.preventDefault()\n }}\n ref={ref}\n title={title}\n type=\"button\"\n >\n {children}\n </button>\n )\n}\n\nfunction DropDownItems({\n children,\n dropDownRef,\n itemsContainerClassNames,\n onClose,\n}: {\n children: React.ReactNode\n dropDownRef: React.Ref<HTMLDivElement>\n itemsContainerClassNames?: string[]\n onClose: () => void\n}): React.ReactElement {\n const [items, setItems] = useState<Array<React.RefObject<HTMLButtonElement>>>()\n const [highlightedItem, setHighlightedItem] = useState<React.RefObject<HTMLButtonElement>>()\n\n const registerItem = useCallback(\n (itemRef: React.RefObject<HTMLButtonElement>) => {\n setItems((prev) => (prev != null ? [...prev, itemRef] : [itemRef]))\n },\n [setItems],\n )\n\n const handleKeyDown = (event: React.KeyboardEvent<HTMLDivElement>): void => {\n if (items == null) return\n\n const { key } = event\n\n if (['ArrowDown', 'ArrowUp', 'Escape', 'Tab'].includes(key)) {\n event.preventDefault()\n }\n\n if (key === 'Escape' || key === 'Tab') {\n onClose()\n } else if (key === 'ArrowUp') {\n setHighlightedItem((prev) => {\n if (prev == null) return items[0]\n const index = items.indexOf(prev) - 1\n return items[index === -1 ? items.length - 1 : index]\n })\n } else if (key === 'ArrowDown') {\n setHighlightedItem((prev) => {\n if (prev == null) return items[0]\n return items[items.indexOf(prev) + 1]\n })\n }\n }\n\n const contextValue = useMemo(\n () => ({\n registerItem,\n }),\n [registerItem],\n )\n\n useEffect(() => {\n if (items != null && highlightedItem == null) {\n setHighlightedItem(items[0])\n }\n\n if (highlightedItem != null && highlightedItem?.current != null) {\n highlightedItem.current.focus()\n }\n }, [items, highlightedItem])\n\n return (\n <DropDownContext.Provider value={contextValue}>\n <div\n className={(itemsContainerClassNames ?? ['toolbar-popup__dropdown-items']).join(' ')}\n onKeyDown={handleKeyDown}\n ref={dropDownRef}\n >\n {children}\n </div>\n </DropDownContext.Provider>\n )\n}\n\nexport function DropDown({\n Icon,\n buttonAriaLabel,\n buttonClassName,\n children,\n disabled = false,\n itemsContainerClassNames,\n label,\n stopCloseOnClickSelf,\n}: {\n Icon?: React.FC\n buttonAriaLabel?: string\n buttonClassName: string\n children: ReactNode\n disabled?: boolean\n itemsContainerClassNames?: string[]\n label?: string\n stopCloseOnClickSelf?: boolean\n}): React.ReactNode {\n const dropDownRef = useRef<HTMLDivElement>(null)\n const buttonRef = useRef<HTMLButtonElement>(null)\n const [showDropDown, setShowDropDown] = useState(false)\n\n const handleClose = (): void => {\n setShowDropDown(false)\n if (buttonRef?.current != null) {\n buttonRef.current.focus()\n }\n }\n\n useEffect(() => {\n const button = buttonRef.current\n const dropDown = dropDownRef.current\n\n if (showDropDown && button !== null && dropDown !== null) {\n const { left, top } = button.getBoundingClientRect()\n const scrollTopOffset = window.scrollY || document.documentElement.scrollTop\n dropDown.style.top = `${top + scrollTopOffset + button.offsetHeight + 5}px`\n dropDown.style.left = `${Math.min(left - 5, window.innerWidth - dropDown.offsetWidth - 20)}px`\n }\n }, [dropDownRef, buttonRef, showDropDown])\n\n useEffect(() => {\n const button = buttonRef.current\n\n if (button !== null && showDropDown) {\n const handle = (event: MouseEvent): void => {\n const { target } = event\n if (stopCloseOnClickSelf != null) {\n // eslint-disable-next-line @typescript-eslint/prefer-optional-chain\n if (dropDownRef.current != null && dropDownRef.current.contains(target as Node)) {\n return\n }\n }\n if (!button.contains(target as Node)) {\n setShowDropDown(false)\n }\n }\n document.addEventListener('click', handle)\n\n return () => {\n document.removeEventListener('click', handle)\n }\n }\n }, [dropDownRef, buttonRef, showDropDown, stopCloseOnClickSelf])\n\n return (\n <React.Fragment>\n <button\n aria-label={buttonAriaLabel}\n className={buttonClassName + (showDropDown ? ' active' : '')}\n disabled={disabled}\n onClick={(event) => {\n event.preventDefault()\n setShowDropDown(!showDropDown)\n }}\n onMouseDown={(e) => {\n // This fixes a bug where you are unable to click the button if you are in a NESTED editor (editor in blocks field in editor).\n // Thus only happens if you click on the SVG of the button. Clicking on the outside works. Related issue: https://github.com/payloadcms/payload/issues/4025\n // TODO: Find out why exactly it happens and why e.preventDefault() on the mouseDown fixes it. Write that down here, or potentially fix a root cause, if there is any.\n e.preventDefault()\n }}\n ref={buttonRef}\n type=\"button\"\n >\n {Icon && <Icon />}\n {label && <span className=\"toolbar-popup__dropdown-label\">{label}</span>}\n <i className=\"toolbar-popup__dropdown-caret\" />\n </button>\n\n {showDropDown &&\n createPortal(\n <DropDownItems\n dropDownRef={dropDownRef}\n itemsContainerClassNames={itemsContainerClassNames}\n onClose={handleClose}\n >\n {children}\n </DropDownItems>,\n document.body,\n )}\n </React.Fragment>\n )\n}\n"],"names":["useCallback","useEffect","useMemo","useRef","useState","React","createPortal","baseClass","DropDownContext","createContext","DropDownItem","active","children","editor","enabled","item","title","className","setClassName","key","filter","Boolean","join","ref","dropDownContext","useContext","Error","registerItem","current","button","onClick","_updateTags","Set","focus","onSelect","isActive","onMouseDown","e","preventDefault","type","DropDownItems","dropDownRef","itemsContainerClassNames","onClose","items","setItems","highlightedItem","setHighlightedItem","itemRef","prev","handleKeyDown","event","includes","index","indexOf","length","contextValue","Provider","value","div","onKeyDown","DropDown","Icon","buttonAriaLabel","buttonClassName","disabled","label","stopCloseOnClickSelf","buttonRef","showDropDown","setShowDropDown","handleClose","dropDown","left","top","getBoundingClientRect","scrollTopOffset","window","scrollY","document","documentElement","scrollTop","style","offsetHeight","Math","min","innerWidth","offsetWidth","handle","target","contains","addEventListener","removeEventListener","Fragment","aria-label","span","i","body"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAAyBA,WAAW,EAAEC,SAAS,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AACzF,OAAOC,WAAW,QAAO;AACzB,SAASC,YAAY,QAAQ,YAAW;AAIxC,MAAMC,YAAY;AAMlB,MAAMC,gCAAkBH,MAAMI,aAAa,CAA6B;AAExE,OAAO,SAASC,aAAa,EAC3BC,MAAM,EACNC,QAAQ,EACRC,MAAM,EACNC,OAAO,EACPC,IAAI,EACJC,KAAK,EAQN;IACC,MAAM,CAACC,WAAWC,aAAa,GAAGd,SAAiBG;IAEnDN,UAAU;QACRiB,aACE;YACEX;YACAO,YAAY,QAAQ,aAAa;YACjCH,SAAS,WAAW;YACpBI,MAAMI,MAAM,CAAC,EAAEZ,UAAU,CAAC,EAAEQ,KAAKI,GAAG,CAAC,CAAC,GAAG;SAC1C,CACEC,MAAM,CAACC,SACPC,IAAI,CAAC;IAEZ,GAAG;QAACR;QAASH;QAAQM;QAAWF,KAAKI,GAAG;KAAC;IAEzC,MAAMI,MAAMpB,OAA0B;IAEtC,MAAMqB,kBAAkBnB,MAAMoB,UAAU,CAACjB;IAEzC,IAAIgB,oBAAoB,MAAM;QAC5B,MAAM,IAAIE,MAAM;IAClB;IAEA,MAAM,E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ACnB;QACAjC,aAAa,CAACC;YACZ,8HAA8H;YAC9H,2JAA2J;YAC3J,sKAAsK;YACtKA,EAAEC,cAAc;QAClB;QACAf,KAAK6C;QACL7B,MAAK;OAEJuB,sBAAQ,oBAACA,aACTI,uBAAS,oBAAC6B;QAAK9E,WAAU;OAAiCiD,sBAC3D,oBAAC8B;QAAE/E,WAAU;SAGdoD,8BACC/D,2BACE,oBAACkC;QACCC,aAAaA;QACbC,0BAA0BA;QAC1BC,SAAS4B;OAER3D,WAEHmE,SAASkB,IAAI;AAIvB"}
@@ -0,0 +1,23 @@
1
+ import React from 'react';
2
+ import type { LexicalEditor } from 'lexical';
3
+ import type { ToolbarGroupItem } from '../../types.js';
4
+ import './index.scss';
5
+ export declare const ToolbarDropdown: ({ Icon, anchorElem, classNames, editor, groupKey, items, itemsContainerClassNames, label, maxActiveItems, onActiveChange, }: {
6
+ Icon?: React.FC;
7
+ anchorElem: HTMLElement;
8
+ classNames?: string[];
9
+ editor: LexicalEditor;
10
+ groupKey: string;
11
+ items: ToolbarGroupItem[];
12
+ itemsContainerClassNames?: string[];
13
+ label?: string;
14
+ /**
15
+ * Maximum number of active items allowed. This is a performance optimization to prevent
16
+ * unnecessary item active checks when the maximum number of active items is reached.
17
+ */
18
+ maxActiveItems?: number;
19
+ onActiveChange?: ({ activeItems }: {
20
+ activeItems: ToolbarGroupItem[];
21
+ }) => void;
22
+ }) => React.JSX.Element;
23
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/toolbars/shared/ToolbarDropdown/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAiC,MAAM,OAAO,CAAA;AAIrD,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAM5C,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAA;AAItD,OAAO,cAAc,CAAA;AAiDrB,eAAO,MAAM,eAAe,gIAWzB;IACD,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,UAAU,EAAE,WAAW,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,EAAE,CAAA;IACrB,MAAM,EAAE,aAAa,CAAA;IACrB,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,gBAAgB,EAAE,CAAA;IACzB,wBAAwB,CAAC,EAAE,MAAM,EAAE,CAAA;IACnC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd;;;OAGG;IACH,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,cAAc,CAAC,EAAE,CAAC,EAAE,WAAW,EAAE,EAAE;QAAE,WAAW,EAAE,gBAAgB,EAAE,CAAA;KAAE,KAAK,IAAI,CAAA;CAChF,sBAoFA,CAAA"}