@payloadcms/richtext-lexical 3.0.0-beta.3 → 3.0.0-beta.30

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 (645) 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 +10 -0
  125. package/dist/field/features/horizontalRule/component/index.d.ts.map +1 -0
  126. package/dist/field/features/horizontalRule/component/index.js +62 -0
  127. package/dist/field/features/horizontalRule/component/index.js.map +1 -0
  128. package/dist/field/features/horizontalRule/feature.client.d.ts +3 -0
  129. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
  130. package/dist/field/features/horizontalRule/feature.client.js +76 -0
  131. package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
  132. package/dist/field/features/horizontalRule/feature.server.d.ts +3 -0
  133. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
  134. package/dist/field/features/horizontalRule/feature.server.js +37 -0
  135. package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
  136. package/dist/field/features/horizontalRule/markdownTransformer.d.ts +3 -0
  137. package/dist/field/features/horizontalRule/markdownTransformer.d.ts.map +1 -0
  138. package/dist/field/features/horizontalRule/markdownTransformer.js +23 -0
  139. package/dist/field/features/horizontalRule/markdownTransformer.js.map +1 -0
  140. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts +53 -0
  141. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  142. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +88 -0
  143. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -0
  144. package/dist/field/features/horizontalRule/plugin/index.d.ts +7 -0
  145. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -0
  146. package/dist/field/features/horizontalRule/plugin/index.js +31 -0
  147. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
  148. package/dist/field/features/horizontalRule/plugin/index.scss +20 -0
  149. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  150. package/dist/field/features/indent/feature.client.js +43 -42
  151. package/dist/field/features/indent/feature.client.js.map +1 -1
  152. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  153. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  154. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  155. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  156. package/dist/field/features/link/drawer/baseFields.d.ts +2 -2
  157. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  158. package/dist/field/features/link/drawer/baseFields.js +30 -43
  159. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  160. package/dist/field/features/link/drawer/index.js +3 -2
  161. package/dist/field/features/link/drawer/index.js.map +1 -1
  162. package/dist/field/features/link/drawer/types.d.ts +4 -2
  163. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  164. package/dist/field/features/link/drawer/types.js.map +1 -1
  165. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  166. package/dist/field/features/link/feature.client.js +59 -47
  167. package/dist/field/features/link/feature.client.js.map +1 -1
  168. package/dist/field/features/link/feature.server.d.ts +10 -5
  169. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  170. package/dist/field/features/link/feature.server.js +48 -9
  171. package/dist/field/features/link/feature.server.js.map +1 -1
  172. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  173. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  174. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  175. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  176. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  177. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  178. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  179. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  180. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  181. package/dist/field/features/link/plugins/autoLink/index.js +5 -8
  182. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  183. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  184. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  185. package/dist/field/features/link/plugins/clickableLink/index.js +2 -2
  186. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  187. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  188. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  189. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  190. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  191. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +93 -69
  192. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  193. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  194. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  195. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  196. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +11 -3
  197. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +1 -3
  198. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  199. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +12 -30
  200. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  201. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  202. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  203. package/dist/field/features/link/plugins/link/index.js +5 -14
  204. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  205. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  206. package/dist/field/features/link/populationPromise.js +10 -25
  207. package/dist/field/features/link/populationPromise.js.map +1 -1
  208. package/dist/field/features/link/validate.d.ts +5 -0
  209. package/dist/field/features/link/validate.d.ts.map +1 -0
  210. package/dist/field/features/link/validate.js +32 -0
  211. package/dist/field/features/link/validate.js.map +1 -0
  212. package/dist/field/features/lists/checklist/feature.client.d.ts +1 -1
  213. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  214. package/dist/field/features/lists/checklist/feature.client.js +56 -32
  215. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  216. package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
  217. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  218. package/dist/field/features/lists/checklist/feature.server.js +10 -10
  219. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  220. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  221. package/dist/field/features/lists/checklist/markdownTransformers.js +2 -3
  222. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  223. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  224. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  225. package/dist/field/features/lists/checklist/plugin/index.js +3 -4
  226. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  227. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  228. package/dist/field/features/lists/htmlConverter.js +13 -6
  229. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  230. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -0
  231. package/dist/field/features/lists/orderedList/feature.client.js +96 -0
  232. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
  233. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -0
  234. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +7 -7
  235. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -0
  236. package/dist/field/features/lists/orderedList/markdownTransformer.d.ts.map +1 -0
  237. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +2 -3
  238. package/dist/field/features/lists/orderedList/markdownTransformer.js.map +1 -0
  239. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  240. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  241. package/dist/field/features/lists/plugin/index.js +3 -4
  242. package/dist/field/features/lists/plugin/index.js.map +1 -1
  243. package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
  244. package/dist/field/features/lists/{common → shared}/markdown.js +1 -2
  245. package/dist/field/features/lists/shared/markdown.js.map +1 -0
  246. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
  247. package/dist/field/features/lists/unorderedList/feature.client.js +96 -0
  248. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
  249. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -0
  250. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +7 -7
  251. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -0
  252. package/dist/field/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -0
  253. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +2 -3
  254. package/dist/field/features/lists/unorderedList/markdownTransformer.js.map +1 -0
  255. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  256. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  257. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  258. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  259. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  260. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  261. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  262. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  263. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  264. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  265. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  266. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  267. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  268. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  269. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  270. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  271. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  272. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  273. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  274. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  275. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  276. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  277. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  278. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  279. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  280. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  281. package/dist/field/features/paragraph/feature.client.js +45 -33
  282. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  283. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  284. package/dist/field/features/relationship/drawer/commands.js +1 -2
  285. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  286. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  287. package/dist/field/features/relationship/drawer/index.js +7 -13
  288. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  289. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  290. package/dist/field/features/relationship/feature.client.js +37 -15
  291. package/dist/field/features/relationship/feature.client.js.map +1 -1
  292. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  293. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  294. package/dist/field/features/relationship/feature.server.js +5 -4
  295. package/dist/field/features/relationship/feature.server.js.map +1 -1
  296. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
  297. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  298. package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
  299. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  300. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  301. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +56 -7
  302. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  303. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  304. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  305. package/dist/field/features/relationship/plugins/index.js +9 -12
  306. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  307. package/dist/field/features/relationship/populationPromise.d.ts +2 -1
  308. package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
  309. package/dist/field/features/relationship/populationPromise.js +25 -19
  310. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  311. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  312. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  313. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  314. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  315. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  316. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  317. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  318. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  319. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  320. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  321. package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
  322. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  323. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +4 -0
  324. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  325. package/dist/field/features/toolbars/fixed/Toolbar/index.js +152 -0
  326. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  327. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +81 -0
  328. package/dist/field/features/toolbars/fixed/feature.client.d.ts +3 -0
  329. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  330. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  331. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  332. package/dist/field/features/toolbars/fixed/feature.server.d.ts +3 -0
  333. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  334. package/dist/field/features/toolbars/fixed/feature.server.js +16 -0
  335. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  336. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  337. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  338. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.js +112 -70
  339. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  340. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.scss +7 -11
  341. package/dist/field/features/toolbars/inline/feature.client.d.ts +3 -0
  342. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  343. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  344. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  345. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  346. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  347. package/dist/field/features/toolbars/inline/feature.server.js +16 -0
  348. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  349. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  350. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  351. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +29 -19
  352. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  353. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
  354. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
  355. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  356. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +27 -72
  357. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  358. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  359. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  360. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +139 -0
  361. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  362. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
  363. package/dist/field/features/toolbars/types.d.ts +48 -0
  364. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  365. package/dist/field/features/toolbars/types.js.map +1 -0
  366. package/dist/field/features/typeUtilities.d.ts +8 -0
  367. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  368. package/dist/field/features/typeUtilities.js +8 -0
  369. package/dist/field/features/typeUtilities.js.map +1 -0
  370. package/dist/field/features/types.d.ts +128 -57
  371. package/dist/field/features/types.d.ts.map +1 -1
  372. package/dist/field/features/types.js.map +1 -1
  373. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  374. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +5 -6
  375. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  376. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  377. package/dist/field/features/upload/component/index.js +59 -9
  378. package/dist/field/features/upload/component/index.js.map +1 -1
  379. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  380. package/dist/field/features/upload/drawer/commands.js +1 -2
  381. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  382. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  383. package/dist/field/features/upload/drawer/index.js +8 -12
  384. package/dist/field/features/upload/drawer/index.js.map +1 -1
  385. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  386. package/dist/field/features/upload/feature.client.js +35 -10
  387. package/dist/field/features/upload/feature.client.js.map +1 -1
  388. package/dist/field/features/upload/feature.server.d.ts +10 -3
  389. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  390. package/dist/field/features/upload/feature.server.js +39 -11
  391. package/dist/field/features/upload/feature.server.js.map +1 -1
  392. package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
  393. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  394. package/dist/field/features/upload/nodes/UploadNode.js +24 -11
  395. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  396. package/dist/field/features/upload/plugin/index.d.ts +5 -4
  397. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  398. package/dist/field/features/upload/plugin/index.js +6 -11
  399. package/dist/field/features/upload/plugin/index.js.map +1 -1
  400. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  401. package/dist/field/features/upload/populationPromise.js +15 -9
  402. package/dist/field/features/upload/populationPromise.js.map +1 -1
  403. package/dist/field/features/upload/validate.d.ts +2 -1
  404. package/dist/field/features/upload/validate.d.ts.map +1 -1
  405. package/dist/field/features/upload/validate.js +37 -12
  406. package/dist/field/features/upload/validate.js.map +1 -1
  407. package/dist/field/index.d.ts +1 -1
  408. package/dist/field/index.d.ts.map +1 -1
  409. package/dist/field/index.js.map +1 -1
  410. package/dist/field/lexical/EditorFocusProvider.d.ts +20 -0
  411. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -0
  412. package/dist/field/lexical/EditorFocusProvider.js +78 -0
  413. package/dist/field/lexical/EditorFocusProvider.js.map +1 -0
  414. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  415. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  416. package/dist/field/lexical/EditorPlugin.js +6 -3
  417. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  418. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  419. package/dist/field/lexical/LexicalEditor.js +31 -15
  420. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  421. package/dist/field/lexical/LexicalEditor.scss +3 -19
  422. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  423. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  424. package/dist/field/lexical/LexicalProvider.js +4 -4
  425. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  426. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +2 -3
  427. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  428. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  429. package/dist/field/lexical/config/client/default.d.ts +1 -1
  430. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  431. package/dist/field/lexical/config/client/default.js.map +1 -1
  432. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  433. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  434. package/dist/field/lexical/config/client/sanitize.js +81 -32
  435. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  436. package/dist/field/lexical/config/server/default.d.ts +2 -3
  437. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  438. package/dist/field/lexical/config/server/default.js +12 -10
  439. package/dist/field/lexical/config/server/default.js.map +1 -1
  440. package/dist/field/lexical/config/server/loader.d.ts +5 -2
  441. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  442. package/dist/field/lexical/config/server/loader.js +4 -2
  443. package/dist/field/lexical/config/server/loader.js.map +1 -1
  444. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  445. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  446. package/dist/field/lexical/config/server/sanitize.js +23 -8
  447. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  448. package/dist/field/lexical/config/types.d.ts +1 -1
  449. package/dist/field/lexical/config/types.d.ts.map +1 -1
  450. package/dist/field/lexical/config/types.js.map +1 -1
  451. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  452. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  453. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  454. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +9 -9
  455. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  456. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +74 -77
  457. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  458. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +4 -4
  459. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  460. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +6 -9
  461. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  462. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +17 -25
  463. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  464. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
  465. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  466. package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
  467. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  468. package/dist/field/lexical/plugins/SlashMenu/index.js +72 -67
  469. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  470. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  471. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +13 -10
  472. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  473. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts +1 -1
  474. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  475. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +3 -4
  476. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  477. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  478. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -10
  479. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  480. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +8 -0
  481. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  482. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +25 -6
  483. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  484. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
  485. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
  486. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
  487. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
  488. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  489. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  490. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  491. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
  492. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  493. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +17 -7
  494. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  495. package/dist/field/lexical/theme/EditorTheme.scss +13 -14
  496. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  497. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  498. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  499. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  500. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  501. package/dist/field/lexical/ui/icons/Add/index.js +16 -0
  502. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  503. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
  504. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
  505. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +19 -0
  506. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
  507. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  508. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  509. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  510. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  511. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  512. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  513. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  514. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  515. package/dist/field/lexical/utils/setFloatingElemPosition.js +16 -13
  516. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  517. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  518. package/dist/field/lexical/utils/url.js +3 -0
  519. package/dist/field/lexical/utils/url.js.map +1 -1
  520. package/dist/forEachNodeRecursively.d.ts +10 -0
  521. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  522. package/dist/forEachNodeRecursively.js +24 -0
  523. package/dist/forEachNodeRecursively.js.map +1 -0
  524. package/dist/generateComponentMap.d.ts.map +1 -1
  525. package/dist/generateComponentMap.js +16 -22
  526. package/dist/generateComponentMap.js.map +1 -1
  527. package/dist/generateSchemaMap.d.ts.map +1 -1
  528. package/dist/generateSchemaMap.js +4 -12
  529. package/dist/generateSchemaMap.js.map +1 -1
  530. package/dist/index.d.ts +24 -20
  531. package/dist/index.d.ts.map +1 -1
  532. package/dist/index.js +275 -184
  533. package/dist/index.js.map +1 -1
  534. package/dist/populate/defaultValue.d.ts.map +1 -1
  535. package/dist/populate/defaultValue.js +1 -0
  536. package/dist/populate/defaultValue.js.map +1 -1
  537. package/dist/populate/populate.d.ts +5 -4
  538. package/dist/populate/populate.d.ts.map +1 -1
  539. package/dist/populate/populate.js +13 -11
  540. package/dist/populate/populate.js.map +1 -1
  541. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  542. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  543. package/dist/populate/populateLexicalPopulationPromises.js +36 -0
  544. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  545. package/dist/populate/recurseNestedFields.d.ts +8 -4
  546. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  547. package/dist/populate/recurseNestedFields.js +4 -5
  548. package/dist/populate/recurseNestedFields.js.map +1 -1
  549. package/dist/scss/app.scss +2 -3
  550. package/dist/scss/vars.scss +0 -7
  551. package/dist/types.d.ts +12 -5
  552. package/dist/types.d.ts.map +1 -1
  553. package/dist/types.js.map +1 -1
  554. package/dist/validate/index.d.ts +1 -1
  555. package/dist/validate/index.d.ts.map +1 -1
  556. package/package.json +48 -47
  557. package/components.d.ts +0 -6
  558. package/components.js +0 -7
  559. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
  560. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
  561. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +0 -12
  562. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
  563. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
  564. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
  565. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
  566. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
  567. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
  568. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
  569. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +0 -12
  570. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
  571. package/dist/field/features/debug/testrecorder/plugin/index.d.ts +0 -5
  572. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +0 -1
  573. package/dist/field/features/debug/testrecorder/plugin/index.js.map +0 -1
  574. package/dist/field/features/debug/treeview/plugin/index.d.ts +0 -4
  575. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +0 -1
  576. package/dist/field/features/debug/treeview/plugin/index.js.map +0 -1
  577. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
  578. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
  579. package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
  580. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
  581. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +0 -1
  582. package/dist/field/features/format/inlinecode/feature.client.js +0 -43
  583. package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
  584. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
  585. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
  586. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
  587. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
  588. package/dist/field/features/indent/index.scss +0 -4
  589. package/dist/field/features/lists/common/markdown.js.map +0 -1
  590. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +0 -1
  591. package/dist/field/features/lists/orderedlist/feature.client.js +0 -72
  592. package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
  593. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +0 -1
  594. package/dist/field/features/lists/orderedlist/feature.server.js.map +0 -1
  595. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +0 -1
  596. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +0 -1
  597. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
  598. package/dist/field/features/lists/unorderedlist/feature.client.js +0 -72
  599. package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
  600. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +0 -1
  601. package/dist/field/features/lists/unorderedlist/feature.server.js.map +0 -1
  602. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +0 -1
  603. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +0 -1
  604. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
  605. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
  606. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
  607. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +0 -17
  608. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
  609. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
  610. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +0 -18
  611. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
  612. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
  613. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
  614. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +0 -6
  615. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
  616. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
  617. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +0 -40
  618. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
  619. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
  620. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  621. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  622. package/dist/populate/richTextRelationshipPromise.js +0 -68
  623. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  624. package/dist/scss/fonts.scss +0 -75
  625. package/src/index.ts +0 -423
  626. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +0 -0
  627. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
  628. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
  629. /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.scss +0 -0
  630. /package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +0 -0
  631. /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
  632. /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
  633. /package/dist/field/features/debug/{treeview → treeView}/plugin/index.scss +0 -0
  634. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +0 -0
  635. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
  636. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
  637. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
  638. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +0 -0
  639. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
  640. /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
  641. /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
  642. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +0 -0
  643. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
  644. /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
  645. /package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars}/types.js +0 -0
@@ -1,4 +1,4 @@
1
- import type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js';
1
+ import type { EditorConfig as LexicalEditorConfig } from 'lexical';
2
2
  import React from 'react';
3
3
  export declare const RichTextCell: React.FC<{
4
4
  lexicalEditorConfig: LexicalEditorConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AASnF,OAAO,KAA8B,MAAM,OAAO,CAAA;AAWlD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,mBAAmB,EAAE,mBAAmB,CAAA;CACzC,CA0JA,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cell/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAOlE,OAAO,KAA8B,MAAM,OAAO,CAAA;AAWlD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,mBAAmB,EAAE,mBAAmB,CAAA;CACzC,CA0JA,CAAA"}
@@ -1,11 +1,9 @@
1
1
  'use client';
2
- import lexicalHeadlessImport from '@lexical/headless';
3
- const { createHeadlessEditor } = lexicalHeadlessImport;
4
- import lexicalImport from 'lexical';
5
- const { $getRoot } = lexicalImport;
2
+ import { createHeadlessEditor } from '@lexical/headless';
6
3
  import { useTableCell } from '@payloadcms/ui/elements/Table';
7
4
  import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
8
5
  import { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction';
6
+ import { $getRoot } from 'lexical';
9
7
  import React, { useEffect, useState } from 'react';
10
8
  import { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js';
11
9
  import { loadClientFeatures } from '../field/lexical/config/client/loader.js';
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/cell/index.tsx"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js'\n\nimport lexicalHeadlessImport from '@lexical/headless'\nconst { createHeadlessEditor } = lexicalHeadlessImport\nimport lexicalImport from 'lexical'\nconst { $getRoot } = lexicalImport\nimport { useTableCell } from '@payloadcms/ui/elements/Table'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction'\nimport React, { useEffect, useState } from 'react'\n\nimport type { FeatureProviderClient } from '../field/features/types.js'\nimport type { SanitizedClientEditorConfig } from '../field/lexical/config/types.js'\nimport type { GeneratedFeatureProviderComponent } from '../types.js'\n\nimport { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js'\nimport { loadClientFeatures } from '../field/lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from '../field/lexical/config/client/sanitize.js'\nimport { getEnabledNodes } from '../field/lexical/nodes/index.js'\n\nexport const RichTextCell: React.FC<{\n lexicalEditorConfig: LexicalEditorConfig\n}> = (props) => {\n const { lexicalEditorConfig } = props\n\n const [preview, setPreview] = React.useState('Loading...')\n const { schemaPath } = useFieldProps()\n\n const { cellData, richTextComponentMap } = useTableCell()\n\n const clientFunctions = useClientFunctions()\n const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false)\n\n const [featureProviders, setFeatureProviders] = useState<FeatureProviderClient<unknown>[]>([])\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<SanitizedClientEditorConfig>(null)\n\n let featureProviderComponents: GeneratedFeatureProviderComponent[] = richTextComponentMap.get(\n 'features',\n ) as GeneratedFeatureProviderComponent[] // TODO: Type better\n // order by order\n featureProviderComponents = featureProviderComponents.sort((a, b) => a.order - b.order)\n\n const featureComponentsWithFeaturesLength =\n Array.from(richTextComponentMap.keys()).filter(\n (key) => key.startsWith(`feature.`) && !key.includes('.fields.'),\n ).length + featureProviderComponents.length\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n const featureProvidersLocal: FeatureProviderClient<unknown>[] = []\n let featureProvidersAndComponentsLoaded = 0\n\n Object.entries(clientFunctions).forEach(([key, plugin]) => {\n if (key.startsWith(`lexicalFeature.${schemaPath}.`)) {\n if (!key.includes('.components.')) {\n featureProvidersLocal.push(plugin)\n }\n featureProvidersAndComponentsLoaded++\n }\n })\n\n if (featureProvidersAndComponentsLoaded === featureComponentsWithFeaturesLength) {\n setFeatureProviders(featureProvidersLocal)\n setHasLoadedFeatures(true)\n\n /**\n * Loaded feature provided => create the final sanitized editor config\n */\n\n const resolvedClientFeatures = loadClientFeatures({\n clientFunctions,\n schemaPath,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: lexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig,\n resolvedClientFeatures,\n ),\n )\n }\n }\n }, [\n hasLoadedFeatures,\n clientFunctions,\n schemaPath,\n featureProviderComponents.length,\n featureProviders,\n finalSanitizedEditorConfig,\n lexicalEditorConfig,\n featureComponentsWithFeaturesLength,\n ])\n\n useEffect(() => {\n let dataToUse = cellData\n if (dataToUse == null || !hasLoadedFeatures || !finalSanitizedEditorConfig) {\n setPreview('')\n return\n }\n\n // Transform data through load hooks\n if (finalSanitizedEditorConfig?.features?.hooks?.load?.length) {\n finalSanitizedEditorConfig.features.hooks.load.forEach((hook) => {\n dataToUse = hook({ incomingEditorState: dataToUse })\n })\n }\n\n if (!dataToUse || typeof dataToUse !== 'object') {\n setPreview('')\n return\n }\n\n // If data is from Slate and not Lexical\n if (Array.isArray(dataToUse) && !('root' in dataToUse)) {\n setPreview('')\n return\n }\n\n // If data is from payload-plugin-lexical\n if ('jsonContent' in dataToUse) {\n setPreview('')\n return\n }\n\n // initialize headless editor\n const headlessEditor = createHeadlessEditor({\n namespace: finalSanitizedEditorConfig.lexical.namespace,\n nodes: getEnabledNodes({ editorConfig: finalSanitizedEditorConfig }),\n theme: finalSanitizedEditorConfig.lexical.theme,\n })\n headlessEditor.setEditorState(headlessEditor.parseEditorState(dataToUse))\n\n const textContent =\n headlessEditor.getEditorState().read(() => {\n return $getRoot().getTextContent()\n }) || ''\n\n // Limiting the number of characters shown is done in a CSS rule\n setPreview(textContent)\n }, [cellData, lexicalEditorConfig, hasLoadedFeatures, finalSanitizedEditorConfig])\n\n if (!hasLoadedFeatures) {\n return (\n <React.Fragment>\n {Array.isArray(featureProviderComponents) &&\n featureProviderComponents.map((featureProvider) => {\n // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(`feature.${featureProvider.key}.components.`),\n )\n const featureComponents: React.ReactNode[] = featureComponentKeys.map((key) => {\n return richTextComponentMap.get(key)\n })\n\n return (\n <React.Fragment key={featureProvider.key}>\n {featureComponents?.length\n ? featureComponents.map((FeatureComponent) => {\n return FeatureComponent\n })\n : null}\n {featureProvider.ClientComponent}\n </React.Fragment>\n )\n })}\n </React.Fragment>\n )\n }\n\n return <span>{preview}</span>\n}\n"],"names":["lexicalHeadlessImport","createHeadlessEditor","lexicalImport","$getRoot","useTableCell","useFieldProps","useClientFunctions","React","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","getEnabledNodes","RichTextCell","props","lexicalEditorConfig","preview","setPreview","schemaPath","cellData","richTextComponentMap","clientFunctions","hasLoadedFeatures","setHasLoadedFeatures","featureProviders","setFeatureProviders","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","featureProviderComponents","get","sort","a","b","order","featureComponentsWithFeaturesLength","Array","from","keys","filter","key","startsWith","includes","length","featureProvidersLocal","featureProvidersAndComponentsLoaded","Object","entries","forEach","plugin","push","resolvedClientFeatures","unSanitizedEditorConfig","features","lexical","dataToUse","hooks","load","hook","incomingEditorState","isArray","headlessEditor","namespace","nodes","editorConfig","theme","setEditorState","parseEditorState","textContent","getEditorState","read","getTextContent","Fragment","map","featureProvider","featureComponentKeys","featureComponents","FeatureComponent","ClientComponent","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,OAAOA,2BAA2B,oBAAmB;AACrD,MAAM,EAAEC,oBAAoB,EAAE,GAAGD;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BAAqB;YAC1C6D,WAAWnC,2BAA2B2B,OAAO,CAACQ,SAAS;YACvDC,OAAOlD,gBAAgB;gBAAEmD,cAAcrC;YAA2B;YAClEsC,OAAOtC,2BAA2B2B,OAAO,CAACW,KAAK;QACjD;QACAJ,eAAeK,cAAc,CAACL,eAAeM,gBAAgB,CAACZ;QAE9D,MAAMa,cACJP,eAAeQ,cAAc,GAAGC,IAAI,CAAC;YACnC,OAAOnE,WAAWoE,cAAc;QAClC,MAAM;QAER,gEAAgE;QAChErD,WAAWkD;IACb,GAAG;QAAChD;QAAUJ;QAAqBO;QAAmBI;KAA2B;IAEjF,IAAI,CAACJ,mBAAmB;QACtB,qBACE,oBAAChB,MAAMiE,QAAQ,QACZpC,MAAMwB,OAAO,CAAC/B,8BACbA,0BAA0B4C,GAAG,CAAC,CAACC;YAC7B,uGAAuG;YACvG,MAAMC,uBAAuBvC,MAAMC,IAAI,CAAChB,qBAAqBiB,IAAI,IAAIC,MAAM,CAAC,CAACC,MAC3EA,IAAIC,UAAU,CAAC,CAAC,QAAQ,EAAEiC,gBAAgBlC,GAAG,CAAC,YAAY,CAAC;YAE7D,MAAMoC,oBAAuCD,qBAAqBF,GAAG,CAAC,CAACjC;gBACrE,OAAOnB,qBAAqBS,GAAG,CAACU;YAClC;YAEA,qBACE,oBAACjC,MAAMiE,QAAQ;gBAAChC,KAAKkC,gBAAgBlC,GAAG;eACrCoC,mBAAmBjC,SAChBiC,kBAAkBH,GAAG,CAAC,CAACI;gBACrB,OAAOA;YACT,KACA,MACHH,gBAAgBI,eAAe;QAGtC;IAGR;IAEA,qBAAO,oBAACC,cAAM9D;AAChB,EAAC"}
1
+ {"version":3,"sources":["../../src/cell/index.tsx"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { createHeadlessEditor } from '@lexical/headless'\nimport { useTableCell } from '@payloadcms/ui/elements/Table'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction'\nimport { $getRoot } from 'lexical'\nimport React, { useEffect, useState } from 'react'\n\nimport type { FeatureProviderClient } from '../field/features/types.js'\nimport type { SanitizedClientEditorConfig } from '../field/lexical/config/types.js'\nimport type { GeneratedFeatureProviderComponent } from '../types.js'\n\nimport { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js'\nimport { loadClientFeatures } from '../field/lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from '../field/lexical/config/client/sanitize.js'\nimport { getEnabledNodes } from '../field/lexical/nodes/index.js'\n\nexport const RichTextCell: React.FC<{\n lexicalEditorConfig: LexicalEditorConfig\n}> = (props) => {\n const { lexicalEditorConfig } = props\n\n const [preview, setPreview] = React.useState('Loading...')\n const { schemaPath } = useFieldProps()\n\n const { cellData, richTextComponentMap } = useTableCell()\n\n const clientFunctions = useClientFunctions()\n const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false)\n\n const [featureProviders, setFeatureProviders] = useState<FeatureProviderClient<unknown>[]>([])\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<SanitizedClientEditorConfig>(null)\n\n let featureProviderComponents: GeneratedFeatureProviderComponent[] = richTextComponentMap.get(\n 'features',\n ) as GeneratedFeatureProviderComponent[] // TODO: Type better\n // order by order\n featureProviderComponents = featureProviderComponents.sort((a, b) => a.order - b.order)\n\n const featureComponentsWithFeaturesLength =\n Array.from(richTextComponentMap.keys()).filter(\n (key) => key.startsWith(`feature.`) && !key.includes('.fields.'),\n ).length + featureProviderComponents.length\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n const featureProvidersLocal: FeatureProviderClient<unknown>[] = []\n let featureProvidersAndComponentsLoaded = 0\n\n Object.entries(clientFunctions).forEach(([key, plugin]) => {\n if (key.startsWith(`lexicalFeature.${schemaPath}.`)) {\n if (!key.includes('.components.')) {\n featureProvidersLocal.push(plugin)\n }\n featureProvidersAndComponentsLoaded++\n }\n })\n\n if (featureProvidersAndComponentsLoaded === featureComponentsWithFeaturesLength) {\n setFeatureProviders(featureProvidersLocal)\n setHasLoadedFeatures(true)\n\n /**\n * Loaded feature provided => create the final sanitized editor config\n */\n\n const resolvedClientFeatures = loadClientFeatures({\n clientFunctions,\n schemaPath,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: lexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig,\n resolvedClientFeatures,\n ),\n )\n }\n }\n }, [\n hasLoadedFeatures,\n clientFunctions,\n schemaPath,\n featureProviderComponents.length,\n featureProviders,\n finalSanitizedEditorConfig,\n lexicalEditorConfig,\n featureComponentsWithFeaturesLength,\n ])\n\n useEffect(() => {\n let dataToUse = cellData\n if (dataToUse == null || !hasLoadedFeatures || !finalSanitizedEditorConfig) {\n setPreview('')\n return\n }\n\n // Transform data through load hooks\n if (finalSanitizedEditorConfig?.features?.hooks?.load?.length) {\n finalSanitizedEditorConfig.features.hooks.load.forEach((hook) => {\n dataToUse = hook({ incomingEditorState: dataToUse })\n })\n }\n\n if (!dataToUse || typeof dataToUse !== 'object') {\n setPreview('')\n return\n }\n\n // If data is from Slate and not Lexical\n if (Array.isArray(dataToUse) && !('root' in dataToUse)) {\n setPreview('')\n return\n }\n\n // If data is from payload-plugin-lexical\n if ('jsonContent' in dataToUse) {\n setPreview('')\n return\n }\n\n // initialize headless editor\n const headlessEditor = createHeadlessEditor({\n namespace: finalSanitizedEditorConfig.lexical.namespace,\n nodes: getEnabledNodes({ editorConfig: finalSanitizedEditorConfig }),\n theme: finalSanitizedEditorConfig.lexical.theme,\n })\n headlessEditor.setEditorState(headlessEditor.parseEditorState(dataToUse))\n\n const textContent =\n headlessEditor.getEditorState().read(() => {\n return $getRoot().getTextContent()\n }) || ''\n\n // Limiting the number of characters shown is done in a CSS rule\n setPreview(textContent)\n }, [cellData, lexicalEditorConfig, hasLoadedFeatures, finalSanitizedEditorConfig])\n\n if (!hasLoadedFeatures) {\n return (\n <React.Fragment>\n {Array.isArray(featureProviderComponents) &&\n featureProviderComponents.map((featureProvider) => {\n // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(`feature.${featureProvider.key}.components.`),\n )\n const featureComponents: React.ReactNode[] = featureComponentKeys.map((key) => {\n return richTextComponentMap.get(key)\n })\n\n return (\n <React.Fragment key={featureProvider.key}>\n {featureComponents?.length\n ? featureComponents.map((FeatureComponent) => {\n return FeatureComponent\n })\n : null}\n {featureProvider.ClientComponent}\n </React.Fragment>\n )\n })}\n </React.Fragment>\n )\n }\n\n return <span>{preview}</span>\n}\n"],"names":["createHeadlessEditor","useTableCell","useFieldProps","useClientFunctions","$getRoot","React","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","getEnabledNodes","RichTextCell","props","lexicalEditorConfig","preview","setPreview","schemaPath","cellData","richTextComponentMap","clientFunctions","hasLoadedFeatures","setHasLoadedFeatures","featureProviders","setFeatureProviders","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","featureProviderComponents","get","sort","a","b","order","featureComponentsWithFeaturesLength","Array","from","keys","filter","key","startsWith","includes","length","featureProvidersLocal","featureProvidersAndComponentsLoaded","Object","entries","forEach","plugin","push","resolvedClientFeatures","unSanitizedEditorConfig","features","lexical","dataToUse","hooks","load","hook","incomingEditorState","isArray","headlessEditor","namespace","nodes","editorConfig","theme","setEditorState","parseEditorState","textContent","getEditorState","read","getTextContent","Fragment","map","featureProvider","featureComponentKeys","featureComponents","FeatureComponent","ClientComponent","span"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,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qB;YAC1C4D,WAAWnC,2BAA2B2B,OAAO,CAACQ,SAAS;YACvDC,OAAOlD,gBAAgB;gBAAEmD,cAAcrC;YAA2B;YAClEsC,OAAOtC,2BAA2B2B,OAAO,CAACW,KAAK;QACjD;QACAJ,eAAeK,cAAc,CAACL,eAAeM,gBAAgB,CAACZ;QAE9D,MAAMa,cACJP,eAAeQ,cAAc,GAAGC,IAAI,CAAC;YACnC,OAAOhE,WAAWiE,cAAc;QAClC,MAAM;QAER,gEAAgE;QAChErD,WAAWkD;IACb,GAAG;QAAChD;QAAUJ;QAAqBO;QAAmBI;KAA2B;IAEjF,IAAI,CAACJ,mBAAmB;QACtB,qBACE,oBAAChB,MAAMiE,QAAQ,QACZpC,MAAMwB,OAAO,CAAC/B,8BACbA,0BAA0B4C,GAAG,CAAC,CAACC;YAC7B,uGAAuG;YACvG,MAAMC,uBAAuBvC,MAAMC,IAAI,CAAChB,qBAAqBiB,IAAI,IAAIC,MAAM,CAAC,CAACC,MAC3EA,IAAIC,UAAU,CAAC,CAAC,QAAQ,EAAEiC,gBAAgBlC,GAAG,CAAC,YAAY,CAAC;YAE7D,MAAMoC,oBAAuCD,qBAAqBF,GAAG,CAAC,CAACjC;gBACrE,OAAOnB,qBAAqBS,GAAG,CAACU;YAClC;YAEA,qBACE,oBAACjC,MAAMiE,QAAQ;gBAAChC,KAAKkC,gBAAgBlC,GAAG;eACrCoC,mBAAmBjC,SAChBiC,kBAAkBH,GAAG,CAAC,CAACI;gBACrB,OAAOA;YACT,KACA,MACHH,gBAAgBI,eAAe;QAGtC;IAGR;IAEA,qBAAO,oBAACC,cAAM9D;AAChB,EAAC"}
@@ -1,6 +1,12 @@
1
1
  export { RichTextCell } from '../cell/index.js';
2
+ export { createClientComponent } from '../field/features/createClientComponent.js';
3
+ export { toolbarFormatGroupWithItems } from '../field/features/format/shared/toolbarFormatGroup.js';
4
+ export { toolbarAddDropdownGroupWithItems } from '../field/features/shared/toolbar/addDropdownGroup.js';
5
+ export { toolbarFeatureButtonsGroupWithItems } from '../field/features/shared/toolbar/featureButtonsGroup.js';
6
+ export { toolbarTextDropdownGroupWithItems } from '../field/features/shared/toolbar/textDropdownGroup.js';
7
+ export { ToolbarButton } from '../field/features/toolbars/shared/ToolbarButton/index.js';
8
+ export { ToolbarDropdown } from '../field/features/toolbars/shared/ToolbarDropdown/index.js';
2
9
  export { RichTextField } from '../field/index.js';
10
+ export { type EditorFocusContextType, EditorFocusProvider, useEditorFocus, } from '../field/lexical/EditorFocusProvider.js';
3
11
  export { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js';
4
- export { ToolbarButton } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js';
5
- export { ToolbarDropdown } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js';
6
12
  //# sourceMappingURL=components.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/exports/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AAEjD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAA;AACtF,OAAO,EAAE,aAAa,EAAE,MAAM,uEAAuE,CAAA;AACrG,OAAO,EAAE,eAAe,EAAE,MAAM,yEAAyE,CAAA"}
1
+ {"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/exports/components.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAA;AAC/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,4CAA4C,CAAA;AAElF,OAAO,EAAE,2BAA2B,EAAE,MAAM,uDAAuD,CAAA;AACnG,OAAO,EAAE,gCAAgC,EAAE,MAAM,sDAAsD,CAAA;AACvG,OAAO,EAAE,mCAAmC,EAAE,MAAM,yDAAyD,CAAA;AAC7G,OAAO,EAAE,iCAAiC,EAAE,MAAM,uDAAuD,CAAA;AACzG,OAAO,EAAE,aAAa,EAAE,MAAM,0DAA0D,CAAA;AACxF,OAAO,EAAE,eAAe,EAAE,MAAM,4DAA4D,CAAA;AAE5F,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAA;AACjD,OAAO,EACL,KAAK,sBAAsB,EAC3B,mBAAmB,EACnB,cAAc,GACf,MAAM,yCAAyC,CAAA;AAChD,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAA"}
@@ -1,7 +1,13 @@
1
1
  export { RichTextCell } from '../cell/index.js';
2
+ export { createClientComponent } from '../field/features/createClientComponent.js';
3
+ export { toolbarFormatGroupWithItems } from '../field/features/format/shared/toolbarFormatGroup.js';
4
+ export { toolbarAddDropdownGroupWithItems } from '../field/features/shared/toolbar/addDropdownGroup.js';
5
+ export { toolbarFeatureButtonsGroupWithItems } from '../field/features/shared/toolbar/featureButtonsGroup.js';
6
+ export { toolbarTextDropdownGroupWithItems } from '../field/features/shared/toolbar/textDropdownGroup.js';
7
+ export { ToolbarButton } from '../field/features/toolbars/shared/ToolbarButton/index.js';
8
+ export { ToolbarDropdown } from '../field/features/toolbars/shared/ToolbarDropdown/index.js';
2
9
  export { RichTextField } from '../field/index.js';
10
+ export { EditorFocusProvider, useEditorFocus } from '../field/lexical/EditorFocusProvider.js';
3
11
  export { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js';
4
- export { ToolbarButton } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js';
5
- export { ToolbarDropdown } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js';
6
12
 
7
13
  //# sourceMappingURL=components.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/exports/components.ts"],"sourcesContent":["export { RichTextCell } from '../cell/index.js'\nexport { RichTextField } from '../field/index.js'\n\nexport { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js'\nexport { ToolbarButton } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js'\nexport { ToolbarDropdown } from '../field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js'\n"],"names":["RichTextCell","RichTextField","defaultEditorLexicalConfig","ToolbarButton","ToolbarDropdown"],"rangeMappings":";;;;","mappings":"AAAA,SAASA,YAAY,QAAQ,mBAAkB;AAC/C,SAASC,aAAa,QAAQ,oBAAmB;AAEjD,SAASC,0BAA0B,QAAQ,4CAA2C;AACtF,SAASC,aAAa,QAAQ,wEAAuE;AACrG,SAASC,eAAe,QAAQ,0EAAyE"}
1
+ {"version":3,"sources":["../../src/exports/components.ts"],"sourcesContent":["export { RichTextCell } from '../cell/index.js'\nexport { createClientComponent } from '../field/features/createClientComponent.js'\n\nexport { toolbarFormatGroupWithItems } from '../field/features/format/shared/toolbarFormatGroup.js'\nexport { toolbarAddDropdownGroupWithItems } from '../field/features/shared/toolbar/addDropdownGroup.js'\nexport { toolbarFeatureButtonsGroupWithItems } from '../field/features/shared/toolbar/featureButtonsGroup.js'\nexport { toolbarTextDropdownGroupWithItems } from '../field/features/shared/toolbar/textDropdownGroup.js'\nexport { ToolbarButton } from '../field/features/toolbars/shared/ToolbarButton/index.js'\nexport { ToolbarDropdown } from '../field/features/toolbars/shared/ToolbarDropdown/index.js'\n\nexport { RichTextField } from '../field/index.js'\nexport {\n type EditorFocusContextType,\n EditorFocusProvider,\n useEditorFocus,\n} from '../field/lexical/EditorFocusProvider.js'\nexport { defaultEditorLexicalConfig } from '../field/lexical/config/client/default.js'\n"],"names":["RichTextCell","createClientComponent","toolbarFormatGroupWithItems","toolbarAddDropdownGroupWithItems","toolbarFeatureButtonsGroupWithItems","toolbarTextDropdownGroupWithItems","ToolbarButton","ToolbarDropdown","RichTextField","EditorFocusProvider","useEditorFocus","defaultEditorLexicalConfig"],"rangeMappings":";;;;;;;;;;","mappings":"AAAA,SAASA,YAAY,QAAQ,mBAAkB;AAC/C,SAASC,qBAAqB,QAAQ,6CAA4C;AAElF,SAASC,2BAA2B,QAAQ,wDAAuD;AACnG,SAASC,gCAAgC,QAAQ,uDAAsD;AACvG,SAASC,mCAAmC,QAAQ,0DAAyD;AAC7G,SAASC,iCAAiC,QAAQ,wDAAuD;AACzG,SAASC,aAAa,QAAQ,2DAA0D;AACxF,SAASC,eAAe,QAAQ,6DAA4D;AAE5F,SAASC,aAAa,QAAQ,oBAAmB;AACjD,SAEEC,mBAAmB,EACnBC,cAAc,QACT,0CAAyC;AAChD,SAASC,0BAA0B,QAAQ,4CAA2C"}
@@ -1,11 +1,9 @@
1
1
  import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
2
- import type { FieldBase } from 'payload/types';
3
2
  import React from 'react';
4
3
  import type { SanitizedClientEditorConfig } from './lexical/config/types.js';
5
4
  import './index.scss';
6
5
  export declare const RichText: React.FC<FormFieldBase & {
7
6
  editorConfig: SanitizedClientEditorConfig;
8
- label?: FieldBase['label'];
9
7
  name: string;
10
8
  richTextComponentMap: Map<string, React.ReactNode>;
11
9
  width?: string;
@@ -1 +1 @@
1
- {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,eAAe,CAAA;AAQ9C,OAAO,KAAsB,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA;AAE5E,OAAO,cAAc,CAAA;AA2HrB,eAAO,MAAM,QAAQ;kBApHH,2BAA2B;YACjC,SAAS,CAAC,OAAO,CAAC;UACpB,MAAM;0BACU,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC;YAC1C,MAAM;EAgH8B,CAAA"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AASjE,OAAO,KAAsB,MAAM,OAAO,CAAA;AAG1C,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAA;AAE5E,OAAO,cAAc,CAAA;AA0HrB,eAAO,MAAM,QAAQ;kBAnHH,2BAA2B;UACnC,MAAM;0BACU,IAAI,MAAM,EAAE,MAAM,SAAS,CAAC;YAC1C,MAAM;EAgH8B,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { SerializedEditorState } from 'lexical'\nimport type { FieldBase } from 'payload/types'\n\nimport { FieldDescription } from '@payloadcms/ui/forms/FieldDescription'\nimport { FieldError } from '@payloadcms/ui/forms/FieldError'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useField } from '@payloadcms/ui/forms/useField'\nimport { withCondition } from '@payloadcms/ui/forms/withCondition'\nimport React, { useCallback } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from './lexical/config/types.js'\n\nimport './index.scss'\nimport { LexicalProvider } from './lexical/LexicalProvider.js'\n\nconst baseClass = 'rich-text-lexical'\n\nconst _RichText: React.FC<\n FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n label?: FieldBase['label']\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n width?: string\n }\n> = (props) => {\n const {\n name,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n editorConfig,\n errorProps,\n label,\n labelProps,\n path: pathFromProps,\n readOnly,\n required,\n style,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n width,\n } = props\n\n const memoizedValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n return validate(value, { ...validationOptions, props, required })\n }\n },\n // Important: do not add props to the dependencies array.\n // This would cause an infinite loop and endless re-rendering.\n // Removing props from the dependencies array fixed this issue: https://github.com/payloadcms/payload/issues/3709\n [validate, required],\n )\n const { path: pathFromContext } = useFieldProps()\n\n const fieldType = useField<SerializedEditorState>({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const { errorMessage, initialValue, path, schemaPath, setValue, showError, value } = fieldType\n\n const classes = [\n baseClass,\n 'field-type',\n className,\n showError && 'error',\n readOnly && `${baseClass}--read-only`,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n className={classes}\n key={path}\n style={{\n ...style,\n width,\n }}\n >\n <div className={`${baseClass}__wrap`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n <LexicalProvider\n editorConfig={editorConfig}\n fieldProps={props}\n key={JSON.stringify({ initialValue, path })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={(editorState) => {\n let serializedEditorState = editorState.toJSON()\n\n // Transform state through save hooks\n if (editorConfig?.features?.hooks?.save?.length) {\n editorConfig.features.hooks.save.forEach((hook) => {\n serializedEditorState = hook({ incomingEditorState: serializedEditorState })\n })\n }\n\n setValue(serializedEditorState)\n }}\n path={path}\n readOnly={readOnly}\n value={value}\n />\n </ErrorBoundary>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }): React.ReactElement {\n // Call resetErrorBoundary() to reset the error boundary and retry the render.\n\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error.message}</pre>\n </div>\n )\n}\n\nexport const RichText = withCondition(_RichText)\n"],"names":["FieldDescription","FieldError","FieldLabel","useFieldProps","useField","withCondition","React","useCallback","ErrorBoundary","LexicalProvider","baseClass","_RichText","props","name","CustomDescription","CustomError","CustomLabel","className","descriptionProps","editorConfig","errorProps","label","labelProps","path","pathFromProps","readOnly","required","style","validate","width","memoizedValidate","value","validationOptions","pathFromContext","fieldType","errorMessage","initialValue","schemaPath","setValue","showError","classes","filter","Boolean","join","div","key","fallbackRender","onReset","fieldProps","JSON","stringify","onChange","editorState","serializedEditorState","toJSON","features","hooks","save","length","forEach","hook","incomingEditorState","undefined","error","role","p","pre","color","message","RichText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAKA,SAASA,gBAAgB,QAAQ,wCAAuC;AACxE,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAC1C,SAASC,aAAa,QAAQ,uBAAsB;AAIpD,OAAO,eAAc;AACrB,SAASC,eAAe,QAAQ,+BAA8B;AAE9D,MAAMC,YAAY;AAElB,MAAMC,YAQF,CAACC;IACH,MAAM,EACJC,IAAI,EACJC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,YAAY,EACZC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGjB;IAEJ,MAAMkB,mBAAmBvB,YACvB,CAACwB,OAAOC;QACN,IAAI,OAAOJ,aAAa,YAAY;YAClC,OAAOA,SAASG,OAAO;gBAAE,GAAGC,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Af,SAASe;QACX;QACA9B,MAAMA;QACNE,UAAUA;QACVM,OAAOA;SAGVjB,sBAAsBgD,YACrBhD,kCAEA,oBAACd,kBAAsBkB,oBAAoB,CAAC;AAKtD;AAEA,SAAS4B,eAAe,EAAEiB,KAAK,EAAE;IAC/B,8EAA8E;IAE9E,qBACE,oBAACnB;QAAI3B,WAAU;QAAgB+C,MAAK;qBAClC,oBAACC,WAAE,wCACH,oBAACC;QAAIvC,OAAO;YAAEwC,OAAO;QAAM;OAAIJ,MAAMK,OAAO;AAGlD;AAEA,OAAO,MAAMC,WAAWhE,cAAcM,WAAU"}
1
+ {"version":3,"sources":["../../src/field/Field.tsx"],"sourcesContent":["'use client'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { SerializedEditorState } from 'lexical'\n\nimport { FieldDescription } from '@payloadcms/ui/forms/FieldDescription'\nimport { FieldError } from '@payloadcms/ui/forms/FieldError'\nimport { FieldLabel } from '@payloadcms/ui/forms/FieldLabel'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useField } from '@payloadcms/ui/forms/useField'\nimport { withCondition } from '@payloadcms/ui/forms/withCondition'\nimport React, { useCallback } from 'react'\nimport { ErrorBoundary } from 'react-error-boundary'\n\nimport type { SanitizedClientEditorConfig } from './lexical/config/types.js'\n\nimport './index.scss'\nimport { LexicalProvider } from './lexical/LexicalProvider.js'\n\nconst baseClass = 'rich-text-lexical'\n\nconst _RichText: React.FC<\n FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n width?: string\n }\n> = (props) => {\n const {\n name,\n CustomDescription,\n CustomError,\n CustomLabel,\n className,\n descriptionProps,\n editorConfig,\n errorProps,\n label,\n labelProps,\n path: pathFromProps,\n readOnly,\n required,\n style,\n validate, // Users can pass in client side validation if they WANT to, but it's not required anymore\n width,\n } = props\n\n const memoizedValidate = useCallback(\n (value, validationOptions) => {\n if (typeof validate === 'function') {\n return validate(value, { ...validationOptions, props, required })\n }\n },\n // Important: do not add props to the dependencies array.\n // This would cause an infinite loop and endless re-rendering.\n // Removing props from the dependencies array fixed this issue: https://github.com/payloadcms/payload/issues/3709\n [validate, required],\n )\n const { path: pathFromContext } = useFieldProps()\n\n const fieldType = useField<SerializedEditorState>({\n path: pathFromContext || pathFromProps || name,\n validate: memoizedValidate,\n })\n\n const { errorMessage, initialValue, path, schemaPath, setValue, showError, value } = fieldType\n\n const classes = [\n baseClass,\n 'field-type',\n className,\n showError && 'error',\n readOnly && `${baseClass}--read-only`,\n ]\n .filter(Boolean)\n .join(' ')\n\n return (\n <div\n className={classes}\n key={path}\n style={{\n ...style,\n width,\n }}\n >\n <div className={`${baseClass}__wrap`}>\n <FieldError CustomError={CustomError} path={path} {...(errorProps || {})} />\n <FieldLabel\n CustomLabel={CustomLabel}\n label={label}\n required={required}\n {...(labelProps || {})}\n />\n <ErrorBoundary fallbackRender={fallbackRender} onReset={() => {}}>\n <LexicalProvider\n editorConfig={editorConfig}\n fieldProps={props}\n key={JSON.stringify({ initialValue, path })} // makes sure lexical is completely re-rendered when initialValue changes, bypassing the lexical-internal value memoization. That way, external changes to the form will update the editor. More infos in PR description (https://github.com/payloadcms/payload/pull/5010)\n onChange={(editorState) => {\n let serializedEditorState = editorState.toJSON()\n\n // Transform state through save hooks\n if (editorConfig?.features?.hooks?.save?.length) {\n editorConfig.features.hooks.save.forEach((hook) => {\n serializedEditorState = hook({ incomingEditorState: serializedEditorState })\n })\n }\n\n setValue(serializedEditorState)\n }}\n path={path}\n readOnly={readOnly}\n value={value}\n />\n </ErrorBoundary>\n {CustomDescription !== undefined ? (\n CustomDescription\n ) : (\n <FieldDescription {...(descriptionProps || {})} />\n )}\n </div>\n </div>\n )\n}\n\nfunction fallbackRender({ error }): React.ReactElement {\n // Call resetErrorBoundary() to reset the error boundary and retry the render.\n\n return (\n <div className=\"errorBoundary\" role=\"alert\">\n <p>Something went wrong:</p>\n <pre style={{ color: 'red' }}>{error.message}</pre>\n </div>\n )\n}\n\nexport const RichText = withCondition(_RichText)\n"],"names":["FieldDescription","FieldError","FieldLabel","useFieldProps","useField","withCondition","React","useCallback","ErrorBoundary","LexicalProvider","baseClass","_RichText","props","name","CustomDescription","CustomError","CustomLabel","className","descriptionProps","editorConfig","errorProps","label","labelProps","path","pathFromProps","readOnly","required","style","validate","width","memoizedValidate","value","validationOptions","pathFromContext","fieldType","errorMessage","initialValue","schemaPath","setValue","showError","classes","filter","Boolean","join","div","key","fallbackRender","onReset","fieldProps","JSON","stringify","onChange","editorState","serializedEditorState","toJSON","features","hooks","save","length","forEach","hook","incomingEditorState","undefined","error","role","p","pre","color","message","RichText"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,gBAAgB,QAAQ,wCAAuC;AACxE,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,UAAU,QAAQ,kCAAiC;AAC5D,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,aAAa,QAAQ,qCAAoC;AAClE,OAAOC,SAASC,WAAW,QAAQ,QAAO;AAC1C,SAASC,aAAa,QAAQ,uBAAsB;AAIpD,OAAO,eAAc;AACrB,SAASC,eAAe,QAAQ,+BAA8B;AAE9D,MAAMC,YAAY;AAElB,MAAMC,YAOF,CAACC;IACH,MAAM,EACJC,IAAI,EACJC,iBAAiB,EACjBC,WAAW,EACXC,WAAW,EACXC,SAAS,EACTC,gBAAgB,EAChBC,YAAY,EACZC,UAAU,EACVC,KAAK,EACLC,UAAU,EACVC,MAAMC,aAAa,EACnBC,QAAQ,EACRC,QAAQ,EACRC,KAAK,EACLC,QAAQ,EACRC,KAAK,EACN,GAAGjB;IAEJ,MAAMkB,mBAAmBvB,YACvB,CAACwB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CAAC,CAACC;oBACxCP,wBAAwBO,KAAK;wBAAEC,qBAAqBR;oBAAsB;gBAC5E;YACF;YAEAf,SAASe;QACX;QACA9B,MAAMA;QACNE,UAAUA;QACVM,OAAOA;SAGVjB,sBAAsBgD,YACrBhD,kCAEA,oBAACd,kBAAsBkB,oBAAoB,CAAC;AAKtD;AAEA,SAAS4B,eAAe,EAAEiB,KAAK,EAAE;IAC/B,8EAA8E;IAE9E,qBACE,oBAACnB;QAAI3B,WAAU;QAAgB+C,MAAK;qBAClC,oBAACC,WAAE,wCACH,oBAACC;QAAIvC,OAAO;YAAEwC,OAAO;QAAM;OAAIJ,MAAMK,OAAO;AAGlD;AAEA,OAAO,MAAMC,WAAWhE,cAAcM,WAAU"}
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/feature.client.tsx"],"names":[],"mappings":";AA2EA,eAAO,MAAM,2BAA2B,+BAA4C,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/feature.client.tsx"],"names":[],"mappings":";AA8JA,eAAO,MAAM,2BAA2B,+BAA4C,CAAA"}
@@ -1,68 +1,141 @@
1
1
  'use client';
2
- import lexicalImport from 'lexical';
3
- const { FORMAT_ELEMENT_COMMAND } = lexicalImport;
2
+ import { $isElementNode, $isRangeSelection, FORMAT_ELEMENT_COMMAND } from 'lexical';
4
3
  import { AlignCenterIcon } from '../../lexical/ui/icons/AlignCenter/index.js';
5
4
  import { AlignJustifyIcon } from '../../lexical/ui/icons/AlignJustify/index.js';
6
5
  import { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js';
7
6
  import { AlignRightIcon } from '../../lexical/ui/icons/AlignRight/index.js';
8
7
  import { createClientComponent } from '../createClientComponent.js';
9
- import { AlignDropdownSectionWithEntries } from './floatingSelectToolbarAlignDropdownSection.js';
8
+ import { toolbarAlignGroupWithItems } from './toolbarAlignGroup.js';
9
+ const toolbarGroups = [
10
+ toolbarAlignGroupWithItems([
11
+ {
12
+ ChildComponent: AlignLeftIcon,
13
+ isActive: ({ selection })=>{
14
+ if (!$isRangeSelection(selection)) {
15
+ return false;
16
+ }
17
+ for (const node of selection.getNodes()){
18
+ if ($isElementNode(node)) {
19
+ if (node.getFormatType() === 'left') {
20
+ continue;
21
+ }
22
+ }
23
+ const parent = node.getParent();
24
+ if ($isElementNode(parent)) {
25
+ if (parent.getFormatType() === 'left') {
26
+ continue;
27
+ }
28
+ }
29
+ return false;
30
+ }
31
+ return true;
32
+ },
33
+ key: 'alignLeft',
34
+ label: `Align Left`,
35
+ onSelect: ({ editor })=>{
36
+ editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left');
37
+ },
38
+ order: 1
39
+ },
40
+ {
41
+ ChildComponent: AlignCenterIcon,
42
+ isActive: ({ selection })=>{
43
+ if (!$isRangeSelection(selection)) {
44
+ return false;
45
+ }
46
+ for (const node of selection.getNodes()){
47
+ if ($isElementNode(node)) {
48
+ if (node.getFormatType() === 'center') {
49
+ continue;
50
+ }
51
+ }
52
+ const parent = node.getParent();
53
+ if ($isElementNode(parent)) {
54
+ if (parent.getFormatType() === 'center') {
55
+ continue;
56
+ }
57
+ }
58
+ return false;
59
+ }
60
+ return true;
61
+ },
62
+ key: 'alignCenter',
63
+ label: `Align Center`,
64
+ onSelect: ({ editor })=>{
65
+ editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center');
66
+ },
67
+ order: 2
68
+ },
69
+ {
70
+ ChildComponent: AlignRightIcon,
71
+ isActive: ({ selection })=>{
72
+ if (!$isRangeSelection(selection)) {
73
+ return false;
74
+ }
75
+ for (const node of selection.getNodes()){
76
+ if ($isElementNode(node)) {
77
+ if (node.getFormatType() === 'right') {
78
+ continue;
79
+ }
80
+ }
81
+ const parent = node.getParent();
82
+ if ($isElementNode(parent)) {
83
+ if (parent.getFormatType() === 'right') {
84
+ continue;
85
+ }
86
+ }
87
+ return false;
88
+ }
89
+ return true;
90
+ },
91
+ key: 'alignRight',
92
+ label: `Align Right`,
93
+ onSelect: ({ editor })=>{
94
+ editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right');
95
+ },
96
+ order: 3
97
+ },
98
+ {
99
+ ChildComponent: AlignJustifyIcon,
100
+ isActive: ({ selection })=>{
101
+ if (!$isRangeSelection(selection)) {
102
+ return false;
103
+ }
104
+ for (const node of selection.getNodes()){
105
+ if ($isElementNode(node)) {
106
+ if (node.getFormatType() === 'justify') {
107
+ continue;
108
+ }
109
+ }
110
+ const parent = node.getParent();
111
+ if ($isElementNode(parent)) {
112
+ if (parent.getFormatType() === 'justify') {
113
+ continue;
114
+ }
115
+ }
116
+ return false;
117
+ }
118
+ return true;
119
+ },
120
+ key: 'alignJustify',
121
+ label: `Align Justify`,
122
+ onSelect: ({ editor })=>{
123
+ editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify');
124
+ },
125
+ order: 4
126
+ }
127
+ ])
128
+ ];
10
129
  const AlignFeatureClient = (props)=>{
11
130
  return {
12
131
  clientFeatureProps: props,
13
132
  feature: ()=>({
14
133
  clientFeatureProps: props,
15
- floatingSelectToolbar: {
16
- sections: [
17
- AlignDropdownSectionWithEntries([
18
- {
19
- ChildComponent: AlignLeftIcon,
20
- isActive: ()=>false,
21
- key: 'align-left',
22
- label: `Align Left`,
23
- onClick: ({ editor })=>{
24
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left');
25
- },
26
- order: 1
27
- }
28
- ]),
29
- AlignDropdownSectionWithEntries([
30
- {
31
- ChildComponent: AlignCenterIcon,
32
- isActive: ()=>false,
33
- key: 'align-center',
34
- label: `Align Center`,
35
- onClick: ({ editor })=>{
36
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center');
37
- },
38
- order: 2
39
- }
40
- ]),
41
- AlignDropdownSectionWithEntries([
42
- {
43
- ChildComponent: AlignRightIcon,
44
- isActive: ()=>false,
45
- key: 'align-right',
46
- label: `Align Right`,
47
- onClick: ({ editor })=>{
48
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right');
49
- },
50
- order: 3
51
- }
52
- ]),
53
- AlignDropdownSectionWithEntries([
54
- {
55
- ChildComponent: AlignJustifyIcon,
56
- isActive: ()=>false,
57
- key: 'align-justify',
58
- label: `Align Justify`,
59
- onClick: ({ editor })=>{
60
- editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify');
61
- },
62
- order: 4
63
- }
64
- ])
65
- ]
134
+ toolbarFixed: {
135
+ groups: toolbarGroups
136
+ },
137
+ toolbarInline: {
138
+ groups: toolbarGroups
66
139
  }
67
140
  })
68
141
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/align/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport lexicalImport from 'lexical'\nconst { FORMAT_ELEMENT_COMMAND } = lexicalImport\n\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { AlignCenterIcon } from '../../lexical/ui/icons/AlignCenter/index.js'\nimport { AlignJustifyIcon } from '../../lexical/ui/icons/AlignJustify/index.js'\nimport { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js'\nimport { AlignRightIcon } from '../../lexical/ui/icons/AlignRight/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { AlignDropdownSectionWithEntries } from './floatingSelectToolbarAlignDropdownSection.js'\n\nconst AlignFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n floatingSelectToolbar: {\n sections: [\n AlignDropdownSectionWithEntries([\n {\n ChildComponent: AlignLeftIcon,\n isActive: () => false,\n key: 'align-left',\n label: `Align Left`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')\n },\n order: 1,\n },\n ]),\n AlignDropdownSectionWithEntries([\n {\n ChildComponent: AlignCenterIcon,\n isActive: () => false,\n key: 'align-center',\n label: `Align Center`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')\n },\n order: 2,\n },\n ]),\n AlignDropdownSectionWithEntries([\n {\n ChildComponent: AlignRightIcon,\n isActive: () => false,\n key: 'align-right',\n label: `Align Right`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')\n },\n order: 3,\n },\n ]),\n AlignDropdownSectionWithEntries([\n {\n ChildComponent: AlignJustifyIcon,\n isActive: () => false,\n key: 'align-justify',\n label: `Align Justify`,\n onClick: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')\n },\n order: 4,\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const AlignFeatureClientComponent = createClientComponent(AlignFeatureClient)\n"],"names":["lexicalImport","FORMAT_ELEMENT_COMMAND","AlignCenterIcon","AlignJustifyIcon","AlignLeftIcon","AlignRightIcon","createClientComponent","AlignDropdownSectionWithEntries","AlignFeatureClient","props","clientFeatureProps","feature","floatingSelectToolbar","sections","ChildComponent","isActive","key","label","onClick","editor","dispatchCommand","order","AlignFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,sBAAsB,EAAE,GAAGD;AAInC,SAASE,eAAe,QAAQ,8CAA6C;AAC7E,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,aAAa,QAAQ,4CAA2C;AACzE,SAASC,cAAc,QAAQ,6CAA4C;AAC3E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,+BAA+B,QAAQ,iDAAgD;AAEhG,MAAMC,qBAA+D,CAACC;IACpE,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,uBAAuB;oBACrBC,UAAU;wBACRN,gCAAgC;4BAC9B;gCACEO,gBAAgBV;gCAChBW,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,UAAU,CAAC;gCACnBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;yBACD;wBACDd,gCAAgC;4BAC9B;gCACEO,gBAAgBZ;gCAChBa,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,YAAY,CAAC;gCACrBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;yBACD;wBACDd,gCAAgC;4BAC9B;gCACEO,gBAAgBT;gCAChBU,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,WAAW,CAAC;gCACpBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;yBACD;wBACDd,gCAAgC;4BAC9B;gCACEO,gBAAgBX;gCAChBY,UAAU,IAAM;gCAChBC,KAAK;gCACLC,OAAO,CAAC,aAAa,CAAC;gCACtBC,SAAS,CAAC,EAAEC,MAAM,EAAE;oCAClBA,OAAOC,eAAe,CAACnB,wBAAwB;gCACjD;gCACAoB,OAAO;4BACT;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMC,8BAA8BhB,sBAAsBE,oBAAmB"}
1
+ {"version":3,"sources":["../../../../src/field/features/align/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isElementNode, $isRangeSelection, FORMAT_ELEMENT_COMMAND } from 'lexical'\n\nimport type { ToolbarGroup } from '../toolbars/types.js'\nimport type { FeatureProviderProviderClient } from '../types.js'\n\nimport { AlignCenterIcon } from '../../lexical/ui/icons/AlignCenter/index.js'\nimport { AlignJustifyIcon } from '../../lexical/ui/icons/AlignJustify/index.js'\nimport { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js'\nimport { AlignRightIcon } from '../../lexical/ui/icons/AlignRight/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarAlignGroupWithItems } from './toolbarAlignGroup.js'\n\nconst toolbarGroups: ToolbarGroup[] = [\n toolbarAlignGroupWithItems([\n {\n ChildComponent: AlignLeftIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'left') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'left') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignLeft',\n label: `Align Left`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'left')\n },\n order: 1,\n },\n {\n ChildComponent: AlignCenterIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'center') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'center') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignCenter',\n label: `Align Center`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'center')\n },\n order: 2,\n },\n {\n ChildComponent: AlignRightIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'right') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'right') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignRight',\n label: `Align Right`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'right')\n },\n order: 3,\n },\n {\n ChildComponent: AlignJustifyIcon,\n isActive: ({ selection }) => {\n if (!$isRangeSelection(selection)) {\n return false\n }\n for (const node of selection.getNodes()) {\n if ($isElementNode(node)) {\n if (node.getFormatType() === 'justify') {\n continue\n }\n }\n\n const parent = node.getParent()\n if ($isElementNode(parent)) {\n if (parent.getFormatType() === 'justify') {\n continue\n }\n }\n\n return false\n }\n return true\n },\n key: 'alignJustify',\n label: `Align Justify`,\n onSelect: ({ editor }) => {\n editor.dispatchCommand(FORMAT_ELEMENT_COMMAND, 'justify')\n },\n order: 4,\n },\n ]),\n]\n\nconst AlignFeatureClient: FeatureProviderProviderClient<undefined> = (props) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n toolbarFixed: {\n groups: toolbarGroups,\n },\n toolbarInline: {\n groups: toolbarGroups,\n },\n }),\n }\n}\n\nexport const AlignFeatureClientComponent = createClientComponent(AlignFeatureClient)\n"],"names":["$isElementNode","$isRangeSelection","FORMAT_ELEMENT_COMMAND","AlignCenterIcon","AlignJustifyIcon","AlignLeftIcon","AlignRightIcon","createClientComponent","toolbarAlignGroupWithItems","toolbarGroups","ChildComponent","isActive","selection","node","getNodes","getFormatType","parent","getParent","key","label","onSelect","editor","dispatchCommand","order","AlignFeatureClient","props","clientFeatureProps","feature","toolbarFixed","groups","toolbarInline","AlignFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,cAAc,EAAEC,iBAAiB,EAAEC,sBAAsB,QAAQ,UAAS;AAKnF,SAASC,eAAe,QAAQ,8CAA6C;AAC7E,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,aAAa,QAAQ,4CAA2C;AACzE,SAASC,cAAc,QAA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,eAAe;oBACbD,QAAQpB;gBACV;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMsB,8BAA8BxB,sBAAsBiB,oBAAmB"}
@@ -0,0 +1,3 @@
1
+ import type { ToolbarGroup, ToolbarGroupItem } from '../toolbars/types.js';
2
+ export declare const toolbarAlignGroupWithItems: (items: ToolbarGroupItem[]) => ToolbarGroup;
3
+ //# sourceMappingURL=toolbarAlignGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toolbarAlignGroup.d.ts","sourceRoot":"","sources":["../../../../src/field/features/align/toolbarAlignGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAA;AAI1E,eAAO,MAAM,0BAA0B,UAAW,gBAAgB,EAAE,KAAG,YAQtE,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js';
2
+ export const toolbarAlignGroupWithItems = (items)=>{
3
+ return {
4
+ type: 'dropdown',
5
+ ChildComponent: AlignLeftIcon,
6
+ items,
7
+ key: 'align',
8
+ order: 30
9
+ };
10
+ };
11
+
12
+ //# sourceMappingURL=toolbarAlignGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/align/toolbarAlignGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../toolbars/types.js'\n\nimport { AlignLeftIcon } from '../../lexical/ui/icons/AlignLeft/index.js'\n\nexport const toolbarAlignGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'dropdown',\n ChildComponent: AlignLeftIcon,\n items,\n key: 'align',\n order: 30,\n }\n}\n"],"names":["AlignLeftIcon","toolbarAlignGroupWithItems","items","type","ChildComponent","key","order"],"rangeMappings":";;;;;;;;;","mappings":"AAEA,SAASA,aAAa,QAAQ,4CAA2C;AAEzE,OAAO,MAAMC,6BAA6B,CAACC;IACzC,OAAO;QACLC,MAAM;QACNC,gBAAgBJ;QAChBE;QACAG,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -1,3 +1,3 @@
1
1
  /// <reference types="react" resolution-mode="require"/>
2
- export declare const BlockQuoteFeatureClientComponent: import("react").FC<undefined>;
2
+ export declare const BlockquoteFeatureClientComponent: import("react").FC<undefined>;
3
3
  //# sourceMappingURL=feature.client.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/blockquote/feature.client.tsx"],"names":[],"mappings":";AAqEA,eAAO,MAAM,gCAAgC,+BAAiD,CAAA"}
1
+ {"version":3,"file":"feature.client.d.ts","sourceRoot":"","sources":["../../../../src/field/features/blockquote/feature.client.tsx"],"names":[],"mappings":";AAkFA,eAAO,MAAM,gCAAgC,+BAAiD,CAAA"}
@@ -1,39 +1,43 @@
1
1
  'use client';
2
- import lexicalRichTextImport from '@lexical/rich-text';
3
- const { $createQuoteNode, QuoteNode } = lexicalRichTextImport;
4
- import lexicalSelectionImport from '@lexical/selection';
5
- const { $setBlocksType } = lexicalSelectionImport;
6
- import lexicalImport from 'lexical';
7
- const { $getSelection } = lexicalImport;
8
- import { SlashMenuOption } from '../../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
2
+ import { $createQuoteNode, $isQuoteNode, QuoteNode } from '@lexical/rich-text';
3
+ import { $setBlocksType } from '@lexical/selection';
4
+ import { $getSelection, $isRangeSelection } from 'lexical';
9
5
  import { BlockquoteIcon } from '../../lexical/ui/icons/Blockquote/index.js';
10
- import { TextDropdownSectionWithEntries } from '../common/floatingSelectToolbarTextDropdownSection/index.js';
11
6
  import { createClientComponent } from '../createClientComponent.js';
7
+ import { toolbarTextDropdownGroupWithItems } from '../shared/toolbar/textDropdownGroup.js';
12
8
  import { MarkdownTransformer } from './markdownTransformer.js';
13
- const BlockQuoteFeatureClient = (props)=>{
9
+ const toolbarGroups = [
10
+ toolbarTextDropdownGroupWithItems([
11
+ {
12
+ ChildComponent: BlockquoteIcon,
13
+ isActive: ({ selection })=>{
14
+ if (!$isRangeSelection(selection)) {
15
+ return false;
16
+ }
17
+ for (const node of selection.getNodes()){
18
+ if (!$isQuoteNode(node) && !$isQuoteNode(node.getParent())) {
19
+ return false;
20
+ }
21
+ }
22
+ return true;
23
+ },
24
+ key: 'blockquote',
25
+ label: `Blockquote`,
26
+ onSelect: ({ editor })=>{
27
+ editor.update(()=>{
28
+ const selection = $getSelection();
29
+ $setBlocksType(selection, ()=>$createQuoteNode());
30
+ });
31
+ },
32
+ order: 20
33
+ }
34
+ ])
35
+ ];
36
+ const BlockquoteFeatureClient = (props)=>{
14
37
  return {
15
38
  clientFeatureProps: props,
16
39
  feature: ()=>({
17
40
  clientFeatureProps: props,
18
- floatingSelectToolbar: {
19
- sections: [
20
- TextDropdownSectionWithEntries([
21
- {
22
- ChildComponent: BlockquoteIcon,
23
- isActive: ()=>false,
24
- key: 'blockquote',
25
- label: `Blockquote`,
26
- onClick: ({ editor })=>{
27
- editor.update(()=>{
28
- const selection = $getSelection();
29
- $setBlocksType(selection, ()=>$createQuoteNode());
30
- });
31
- },
32
- order: 20
33
- }
34
- ])
35
- ]
36
- },
37
41
  markdownTransformers: [
38
42
  MarkdownTransformer
39
43
  ],
@@ -41,30 +45,39 @@ const BlockQuoteFeatureClient = (props)=>{
41
45
  QuoteNode
42
46
  ],
43
47
  slashMenu: {
44
- options: [
48
+ groups: [
45
49
  {
46
- displayName: 'Basic',
47
- key: 'basic',
48
- options: [
49
- new SlashMenuOption(`blockquote`, {
50
+ items: [
51
+ {
50
52
  Icon: BlockquoteIcon,
51
- displayName: `Blockquote`,
53
+ key: 'blockquote',
52
54
  keywords: [
53
55
  'quote',
54
56
  'blockquote'
55
57
  ],
56
- onSelect: ()=>{
57
- const selection = $getSelection();
58
- $setBlocksType(selection, ()=>$createQuoteNode());
58
+ label: 'Blockquote',
59
+ onSelect: ({ editor })=>{
60
+ editor.update(()=>{
61
+ const selection = $getSelection();
62
+ $setBlocksType(selection, ()=>$createQuoteNode());
63
+ });
59
64
  }
60
- })
61
- ]
65
+ }
66
+ ],
67
+ key: 'basic',
68
+ label: 'Basic'
62
69
  }
63
70
  ]
71
+ },
72
+ toolbarFixed: {
73
+ groups: toolbarGroups
74
+ },
75
+ toolbarInline: {
76
+ groups: toolbarGroups
64
77
  }
65
78
  })
66
79
  };
67
80
  };
68
- export const BlockQuoteFeatureClientComponent = createClientComponent(BlockQuoteFeatureClient);
81
+ export const BlockquoteFeatureClientComponent = createClientComponent(BlockquoteFeatureClient);
69
82
 
70
83
  //# sourceMappingURL=feature.client.js.map