@payloadcms/richtext-lexical 3.0.0-beta.7 → 3.0.0-canary.92e4997

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 (637) 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/features/align/feature.client.d.ts.map +1 -1
  10. package/dist/field/features/align/feature.client.js +127 -54
  11. package/dist/field/features/align/feature.client.js.map +1 -1
  12. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  13. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  14. package/dist/field/features/align/toolbarAlignGroup.js +12 -0
  15. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  16. package/dist/field/features/blockquote/feature.client.d.ts +1 -1
  17. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  18. package/dist/field/features/blockquote/feature.client.js +53 -40
  19. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  20. package/dist/field/features/blockquote/feature.server.d.ts +1 -1
  21. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  22. package/dist/field/features/blockquote/feature.server.js +7 -7
  23. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  24. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  25. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  26. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  27. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  28. package/dist/field/features/blocks/component/BlockContent.js +3 -5
  29. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  30. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  31. package/dist/field/features/blocks/component/index.js +37 -4
  32. package/dist/field/features/blocks/component/index.js.map +1 -1
  33. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  34. package/dist/field/features/blocks/drawer/index.js +2 -4
  35. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  36. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  37. package/dist/field/features/blocks/feature.client.js +56 -27
  38. package/dist/field/features/blocks/feature.client.js.map +1 -1
  39. package/dist/field/features/blocks/feature.server.d.ts +2 -5
  40. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  41. package/dist/field/features/blocks/feature.server.js +109 -77
  42. package/dist/field/features/blocks/feature.server.js.map +1 -1
  43. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -3
  44. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  45. package/dist/field/features/blocks/nodes/BlocksNode.js +1 -2
  46. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  47. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  48. package/dist/field/features/blocks/plugin/commands.js +1 -2
  49. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  50. package/dist/field/features/blocks/plugin/index.d.ts +3 -2
  51. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  52. package/dist/field/features/blocks/plugin/index.js +5 -8
  53. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  54. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  55. package/dist/field/features/blocks/populationPromise.js +4 -18
  56. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  57. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  58. package/dist/field/features/blocks/validate.js +22 -36
  59. package/dist/field/features/blocks/validate.js.map +1 -1
  60. package/dist/field/features/converters/html/field/index.d.ts +8 -2
  61. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  62. package/dist/field/features/converters/html/field/index.js +6 -3
  63. package/dist/field/features/converters/html/field/index.js.map +1 -1
  64. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts.map +1 -1
  65. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
  66. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts.map +1 -1
  67. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +1 -1
  68. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js.map +1 -1
  69. package/dist/field/features/debug/testRecorder/plugin/index.d.ts +5 -0
  70. package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -0
  71. package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +2 -4
  72. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -0
  73. package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts.map +1 -1
  74. package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
  75. package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts.map +1 -1
  76. package/dist/field/features/debug/{treeview → treeView}/feature.server.js +1 -1
  77. package/dist/field/features/debug/{treeview → treeView}/feature.server.js.map +1 -1
  78. package/dist/field/features/debug/treeView/plugin/index.d.ts +4 -0
  79. package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -0
  80. package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +4 -6
  81. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -0
  82. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  83. package/dist/field/features/format/bold/feature.client.js +26 -23
  84. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  85. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -0
  86. package/dist/field/features/format/inlineCode/feature.client.js +46 -0
  87. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
  88. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts.map +1 -1
  89. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +1 -1
  90. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js.map +1 -1
  91. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
  92. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
  93. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  94. package/dist/field/features/format/italic/feature.client.js +27 -24
  95. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  96. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  97. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  98. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  99. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  100. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  101. package/dist/field/features/format/strikethrough/feature.client.js +27 -24
  102. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  103. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  104. package/dist/field/features/format/subscript/feature.client.js +25 -22
  105. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  106. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  107. package/dist/field/features/format/superscript/feature.client.js +25 -22
  108. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  109. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  110. package/dist/field/features/format/underline/feature.client.js +25 -22
  111. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  112. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  113. package/dist/field/features/heading/feature.client.js +71 -54
  114. package/dist/field/features/heading/feature.client.js.map +1 -1
  115. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  116. package/dist/field/features/heading/feature.server.js +5 -5
  117. package/dist/field/features/heading/feature.server.js.map +1 -1
  118. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  119. package/dist/field/features/heading/markdownTransformer.js +1 -2
  120. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  121. package/dist/field/features/horizontalRule/component/index.d.ts.map +1 -0
  122. package/dist/field/features/{horizontalrule → horizontalRule}/component/index.js +2 -4
  123. package/dist/field/features/horizontalRule/component/index.js.map +1 -0
  124. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
  125. package/dist/field/features/horizontalRule/feature.client.js +76 -0
  126. package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
  127. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
  128. package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.js +4 -3
  129. package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
  130. package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts.map +1 -1
  131. package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js.map +1 -1
  132. package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.d.ts +1 -3
  133. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  134. package/dist/field/features/{horizontalrule → horizontalRule}/nodes/HorizontalRuleNode.js +1 -2
  135. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -0
  136. package/dist/field/features/horizontalRule/plugin/index.d.ts +7 -0
  137. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -0
  138. package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.js +5 -8
  139. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
  140. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  141. package/dist/field/features/indent/feature.client.js +43 -42
  142. package/dist/field/features/indent/feature.client.js.map +1 -1
  143. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  144. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  145. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  146. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  147. package/dist/field/features/link/drawer/baseFields.d.ts +2 -2
  148. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  149. package/dist/field/features/link/drawer/baseFields.js +30 -43
  150. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  151. package/dist/field/features/link/drawer/index.js +3 -2
  152. package/dist/field/features/link/drawer/index.js.map +1 -1
  153. package/dist/field/features/link/drawer/types.d.ts +4 -2
  154. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  155. package/dist/field/features/link/drawer/types.js.map +1 -1
  156. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  157. package/dist/field/features/link/feature.client.js +59 -47
  158. package/dist/field/features/link/feature.client.js.map +1 -1
  159. package/dist/field/features/link/feature.server.d.ts +10 -5
  160. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  161. package/dist/field/features/link/feature.server.js +48 -9
  162. package/dist/field/features/link/feature.server.js.map +1 -1
  163. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  164. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  165. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  166. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  167. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  168. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  169. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  170. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  171. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  172. package/dist/field/features/link/plugins/autoLink/index.js +5 -8
  173. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  174. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  175. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  176. package/dist/field/features/link/plugins/clickableLink/index.js +2 -2
  177. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  178. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  179. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  180. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  181. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  182. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +93 -69
  183. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  184. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  185. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  186. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  187. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +11 -3
  188. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +1 -3
  189. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  190. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +12 -30
  191. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  192. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  193. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  194. package/dist/field/features/link/plugins/link/index.js +5 -14
  195. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  196. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  197. package/dist/field/features/link/populationPromise.js +10 -25
  198. package/dist/field/features/link/populationPromise.js.map +1 -1
  199. package/dist/field/features/link/validate.d.ts +5 -0
  200. package/dist/field/features/link/validate.d.ts.map +1 -0
  201. package/dist/field/features/link/validate.js +32 -0
  202. package/dist/field/features/link/validate.js.map +1 -0
  203. package/dist/field/features/lists/checklist/feature.client.d.ts +1 -1
  204. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  205. package/dist/field/features/lists/checklist/feature.client.js +56 -32
  206. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  207. package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
  208. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  209. package/dist/field/features/lists/checklist/feature.server.js +10 -10
  210. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  211. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  212. package/dist/field/features/lists/checklist/markdownTransformers.js +2 -3
  213. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  214. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  215. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  216. package/dist/field/features/lists/checklist/plugin/index.js +3 -4
  217. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  218. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  219. package/dist/field/features/lists/htmlConverter.js +13 -6
  220. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  221. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -0
  222. package/dist/field/features/lists/orderedList/feature.client.js +96 -0
  223. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
  224. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -0
  225. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +7 -7
  226. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -0
  227. package/dist/field/features/lists/orderedList/markdownTransformer.d.ts.map +1 -0
  228. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +2 -3
  229. package/dist/field/features/lists/orderedList/markdownTransformer.js.map +1 -0
  230. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  231. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  232. package/dist/field/features/lists/plugin/index.js +3 -4
  233. package/dist/field/features/lists/plugin/index.js.map +1 -1
  234. package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
  235. package/dist/field/features/lists/{common → shared}/markdown.js +1 -2
  236. package/dist/field/features/lists/shared/markdown.js.map +1 -0
  237. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
  238. package/dist/field/features/lists/unorderedList/feature.client.js +96 -0
  239. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
  240. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -0
  241. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +7 -7
  242. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -0
  243. package/dist/field/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -0
  244. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +2 -3
  245. package/dist/field/features/lists/unorderedList/markdownTransformer.js.map +1 -0
  246. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  247. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  248. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  249. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  250. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  251. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  252. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  253. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  254. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  255. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  256. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  257. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  258. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  259. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  260. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  261. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  262. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  263. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  264. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  265. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  266. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  267. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  268. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  269. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  270. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  271. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  272. package/dist/field/features/paragraph/feature.client.js +45 -33
  273. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  274. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  275. package/dist/field/features/relationship/drawer/commands.js +1 -2
  276. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  277. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  278. package/dist/field/features/relationship/drawer/index.js +7 -13
  279. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  280. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  281. package/dist/field/features/relationship/feature.client.js +37 -15
  282. package/dist/field/features/relationship/feature.client.js.map +1 -1
  283. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  284. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  285. package/dist/field/features/relationship/feature.server.js +5 -4
  286. package/dist/field/features/relationship/feature.server.js.map +1 -1
  287. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
  288. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  289. package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
  290. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  291. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  292. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +56 -7
  293. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  294. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  295. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  296. package/dist/field/features/relationship/plugins/index.js +9 -12
  297. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  298. package/dist/field/features/relationship/populationPromise.d.ts +2 -1
  299. package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
  300. package/dist/field/features/relationship/populationPromise.js +25 -19
  301. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  302. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  303. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  304. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  305. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  306. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  307. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  308. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  309. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  310. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  311. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  312. package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
  313. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  314. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +4 -0
  315. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  316. package/dist/field/features/toolbars/fixed/Toolbar/index.js +152 -0
  317. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  318. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +81 -0
  319. package/dist/field/features/toolbars/fixed/feature.client.d.ts +3 -0
  320. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  321. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  322. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  323. package/dist/field/features/toolbars/fixed/feature.server.d.ts +3 -0
  324. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  325. package/dist/field/features/toolbars/fixed/feature.server.js +16 -0
  326. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  327. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  328. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  329. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.js +112 -70
  330. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  331. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.scss +7 -11
  332. package/dist/field/features/toolbars/inline/feature.client.d.ts +3 -0
  333. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  334. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  335. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  336. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  337. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  338. package/dist/field/features/toolbars/inline/feature.server.js +16 -0
  339. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  340. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  341. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  342. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +29 -19
  343. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  344. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
  345. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
  346. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  347. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +27 -72
  348. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  349. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  350. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  351. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +139 -0
  352. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  353. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
  354. package/dist/field/features/toolbars/types.d.ts +48 -0
  355. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  356. package/dist/field/features/toolbars/types.js.map +1 -0
  357. package/dist/field/features/typeUtilities.d.ts +8 -0
  358. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  359. package/dist/field/features/typeUtilities.js +8 -0
  360. package/dist/field/features/typeUtilities.js.map +1 -0
  361. package/dist/field/features/types.d.ts +128 -57
  362. package/dist/field/features/types.d.ts.map +1 -1
  363. package/dist/field/features/types.js.map +1 -1
  364. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  365. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +5 -6
  366. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  367. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  368. package/dist/field/features/upload/component/index.js +59 -9
  369. package/dist/field/features/upload/component/index.js.map +1 -1
  370. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  371. package/dist/field/features/upload/drawer/commands.js +1 -2
  372. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  373. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  374. package/dist/field/features/upload/drawer/index.js +8 -12
  375. package/dist/field/features/upload/drawer/index.js.map +1 -1
  376. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  377. package/dist/field/features/upload/feature.client.js +35 -10
  378. package/dist/field/features/upload/feature.client.js.map +1 -1
  379. package/dist/field/features/upload/feature.server.d.ts +10 -3
  380. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  381. package/dist/field/features/upload/feature.server.js +39 -11
  382. package/dist/field/features/upload/feature.server.js.map +1 -1
  383. package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
  384. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  385. package/dist/field/features/upload/nodes/UploadNode.js +24 -11
  386. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  387. package/dist/field/features/upload/plugin/index.d.ts +5 -4
  388. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  389. package/dist/field/features/upload/plugin/index.js +6 -11
  390. package/dist/field/features/upload/plugin/index.js.map +1 -1
  391. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  392. package/dist/field/features/upload/populationPromise.js +15 -9
  393. package/dist/field/features/upload/populationPromise.js.map +1 -1
  394. package/dist/field/features/upload/validate.d.ts +2 -1
  395. package/dist/field/features/upload/validate.d.ts.map +1 -1
  396. package/dist/field/features/upload/validate.js +36 -9
  397. package/dist/field/features/upload/validate.js.map +1 -1
  398. package/dist/field/index.d.ts +1 -1
  399. package/dist/field/index.d.ts.map +1 -1
  400. package/dist/field/index.js.map +1 -1
  401. package/dist/field/lexical/EditorFocusProvider.d.ts +20 -0
  402. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -0
  403. package/dist/field/lexical/EditorFocusProvider.js +78 -0
  404. package/dist/field/lexical/EditorFocusProvider.js.map +1 -0
  405. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  406. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  407. package/dist/field/lexical/EditorPlugin.js +6 -3
  408. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  409. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  410. package/dist/field/lexical/LexicalEditor.js +31 -15
  411. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  412. package/dist/field/lexical/LexicalEditor.scss +3 -19
  413. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  414. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  415. package/dist/field/lexical/LexicalProvider.js +4 -4
  416. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  417. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +2 -3
  418. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  419. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  420. package/dist/field/lexical/config/client/default.d.ts +1 -1
  421. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  422. package/dist/field/lexical/config/client/default.js.map +1 -1
  423. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  424. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  425. package/dist/field/lexical/config/client/sanitize.js +81 -32
  426. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  427. package/dist/field/lexical/config/server/default.d.ts +2 -3
  428. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  429. package/dist/field/lexical/config/server/default.js +11 -11
  430. package/dist/field/lexical/config/server/default.js.map +1 -1
  431. package/dist/field/lexical/config/server/loader.d.ts +5 -2
  432. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  433. package/dist/field/lexical/config/server/loader.js +4 -2
  434. package/dist/field/lexical/config/server/loader.js.map +1 -1
  435. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  436. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  437. package/dist/field/lexical/config/server/sanitize.js +23 -8
  438. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  439. package/dist/field/lexical/config/types.d.ts +1 -1
  440. package/dist/field/lexical/config/types.d.ts.map +1 -1
  441. package/dist/field/lexical/config/types.js.map +1 -1
  442. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  443. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  444. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  445. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +9 -9
  446. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  447. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +74 -77
  448. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  449. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +4 -4
  450. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  451. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +6 -9
  452. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  453. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +17 -25
  454. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  455. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
  456. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  457. package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
  458. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  459. package/dist/field/lexical/plugins/SlashMenu/index.js +72 -67
  460. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  461. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  462. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -4
  463. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  464. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts +1 -1
  465. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  466. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +3 -4
  467. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  468. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  469. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +8 -7
  470. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  471. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +8 -0
  472. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  473. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +25 -6
  474. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  475. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  476. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  477. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  478. package/dist/field/lexical/theme/EditorTheme.scss +13 -14
  479. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  480. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  481. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  482. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  483. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  484. package/dist/field/lexical/ui/icons/Add/index.js +16 -0
  485. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  486. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  487. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  488. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  489. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  490. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  491. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  492. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  493. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  494. package/dist/field/lexical/utils/setFloatingElemPosition.js +16 -13
  495. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  496. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  497. package/dist/field/lexical/utils/url.js +3 -0
  498. package/dist/field/lexical/utils/url.js.map +1 -1
  499. package/dist/forEachNodeRecursively.d.ts +10 -0
  500. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  501. package/dist/forEachNodeRecursively.js +24 -0
  502. package/dist/forEachNodeRecursively.js.map +1 -0
  503. package/dist/generateComponentMap.d.ts.map +1 -1
  504. package/dist/generateComponentMap.js +13 -21
  505. package/dist/generateComponentMap.js.map +1 -1
  506. package/dist/generateSchemaMap.d.ts.map +1 -1
  507. package/dist/generateSchemaMap.js +4 -12
  508. package/dist/generateSchemaMap.js.map +1 -1
  509. package/dist/index.d.ts +24 -20
  510. package/dist/index.d.ts.map +1 -1
  511. package/dist/index.js +275 -184
  512. package/dist/index.js.map +1 -1
  513. package/dist/populate/defaultValue.d.ts.map +1 -1
  514. package/dist/populate/defaultValue.js +1 -0
  515. package/dist/populate/defaultValue.js.map +1 -1
  516. package/dist/populate/populate.d.ts +5 -4
  517. package/dist/populate/populate.d.ts.map +1 -1
  518. package/dist/populate/populate.js +13 -11
  519. package/dist/populate/populate.js.map +1 -1
  520. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  521. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  522. package/dist/populate/populateLexicalPopulationPromises.js +36 -0
  523. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  524. package/dist/populate/recurseNestedFields.d.ts +8 -4
  525. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  526. package/dist/populate/recurseNestedFields.js +4 -5
  527. package/dist/populate/recurseNestedFields.js.map +1 -1
  528. package/dist/types.d.ts +12 -5
  529. package/dist/types.d.ts.map +1 -1
  530. package/dist/types.js.map +1 -1
  531. package/dist/validate/index.d.ts +1 -1
  532. package/dist/validate/index.d.ts.map +1 -1
  533. package/package.json +47 -46
  534. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
  535. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
  536. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +0 -12
  537. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
  538. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
  539. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
  540. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
  541. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
  542. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
  543. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
  544. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +0 -12
  545. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
  546. package/dist/field/features/debug/testrecorder/plugin/index.d.ts +0 -5
  547. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +0 -1
  548. package/dist/field/features/debug/testrecorder/plugin/index.js.map +0 -1
  549. package/dist/field/features/debug/treeview/plugin/index.d.ts +0 -4
  550. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +0 -1
  551. package/dist/field/features/debug/treeview/plugin/index.js.map +0 -1
  552. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
  553. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
  554. package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
  555. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
  556. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +0 -1
  557. package/dist/field/features/format/inlinecode/feature.client.js +0 -43
  558. package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
  559. package/dist/field/features/horizontalrule/component/index.d.ts.map +0 -1
  560. package/dist/field/features/horizontalrule/component/index.js.map +0 -1
  561. package/dist/field/features/horizontalrule/feature.client.d.ts.map +0 -1
  562. package/dist/field/features/horizontalrule/feature.client.js +0 -53
  563. package/dist/field/features/horizontalrule/feature.client.js.map +0 -1
  564. package/dist/field/features/horizontalrule/feature.server.d.ts.map +0 -1
  565. package/dist/field/features/horizontalrule/feature.server.js.map +0 -1
  566. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +0 -1
  567. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +0 -1
  568. package/dist/field/features/horizontalrule/plugin/index.d.ts +0 -6
  569. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +0 -1
  570. package/dist/field/features/horizontalrule/plugin/index.js.map +0 -1
  571. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
  572. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
  573. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
  574. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
  575. package/dist/field/features/indent/index.scss +0 -4
  576. package/dist/field/features/lists/common/markdown.js.map +0 -1
  577. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +0 -1
  578. package/dist/field/features/lists/orderedlist/feature.client.js +0 -72
  579. package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
  580. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +0 -1
  581. package/dist/field/features/lists/orderedlist/feature.server.js.map +0 -1
  582. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +0 -1
  583. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +0 -1
  584. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
  585. package/dist/field/features/lists/unorderedlist/feature.client.js +0 -72
  586. package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
  587. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +0 -1
  588. package/dist/field/features/lists/unorderedlist/feature.server.js.map +0 -1
  589. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +0 -1
  590. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +0 -1
  591. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
  592. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
  593. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
  594. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +0 -17
  595. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
  596. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
  597. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +0 -18
  598. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
  599. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
  600. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
  601. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +0 -6
  602. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
  603. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
  604. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +0 -40
  605. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
  606. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
  607. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  608. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  609. package/dist/populate/richTextRelationshipPromise.js +0 -68
  610. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  611. package/src/index.ts +0 -423
  612. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +0 -0
  613. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
  614. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
  615. /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.scss +0 -0
  616. /package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +0 -0
  617. /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
  618. /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
  619. /package/dist/field/features/debug/{treeview → treeView}/plugin/index.scss +0 -0
  620. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +0 -0
  621. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
  622. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
  623. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
  624. /package/dist/field/features/{horizontalrule → horizontalRule}/component/index.d.ts +0 -0
  625. /package/dist/field/features/{horizontalrule → horizontalRule}/feature.client.d.ts +0 -0
  626. /package/dist/field/features/{horizontalrule → horizontalRule}/feature.server.d.ts +0 -0
  627. /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.d.ts +0 -0
  628. /package/dist/field/features/{horizontalrule → horizontalRule}/markdownTransformer.js +0 -0
  629. /package/dist/field/features/{horizontalrule → horizontalRule}/plugin/index.scss +0 -0
  630. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +0 -0
  631. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
  632. /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
  633. /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
  634. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +0 -0
  635. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
  636. /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
  637. /package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars}/types.js +0 -0
@@ -1,4 +1,5 @@
1
1
  import type { NodeValidation } from '../types.js';
2
+ import type { UploadFeatureProps } from './feature.server.js';
2
3
  import type { SerializedUploadNode } from './nodes/UploadNode.js';
3
- export declare const uploadValidation: () => NodeValidation<SerializedUploadNode>;
4
+ export declare const uploadValidation: (props: UploadFeatureProps) => NodeValidation<SerializedUploadNode>;
4
5
  //# sourceMappingURL=validate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/field/features/upload/validate.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAIjE,eAAO,MAAM,gBAAgB,QAAO,eAAe,oBAAoB,CAuBtE,CAAA"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/field/features/upload/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,aAAa,CAAA;AACjD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAA;AAC7D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjE,eAAO,MAAM,gBAAgB,UACpB,kBAAkB,KACxB,eAAe,oBAAoB,CA0DrC,CAAA"}
@@ -1,17 +1,44 @@
1
+ import { buildStateFromSchema } from '@payloadcms/ui/forms/buildStateFromSchema';
1
2
  import { isValidID } from 'payload/utilities';
2
- import { CAN_USE_DOM } from '../../lexical/utils/canUseDOM.js';
3
- export const uploadValidation = ()=>{
4
- const uploadValidation = ({ node, validation: { options: { req: { payload, t } } } })=>{
5
- if (!CAN_USE_DOM) {
6
- const idType = payload.collections[node.relationTo].customIDType || payload.db.defaultIDType;
7
- if (!isValidID(node.value?.id, idType)) {
8
- return t('validation:validUploadID');
3
+ export const uploadValidation = (props)=>{
4
+ return async ({ node, validation: { options: { id, operation, preferences, req, req: { payload, t } } } })=>{
5
+ const idType = payload.collections[node.relationTo].customIDType || payload.db.defaultIDType;
6
+ // @ts-expect-error
7
+ const nodeID = node?.value?.id || node?.value // for backwards-compatibility
8
+ ;
9
+ if (!isValidID(nodeID, idType)) {
10
+ return t('validation:validUploadID');
11
+ }
12
+ if (!props?.collections) {
13
+ return true;
14
+ }
15
+ if (Object.keys(props?.collections).length === 0) {
16
+ return true;
17
+ }
18
+ const collection = props?.collections[node.relationTo];
19
+ if (!collection.fields?.length) {
20
+ return true;
21
+ }
22
+ const result = await buildStateFromSchema({
23
+ id,
24
+ data: node?.fields ?? {},
25
+ fieldSchema: collection.fields,
26
+ operation: operation === 'create' || operation === 'update' ? operation : 'update',
27
+ preferences,
28
+ req,
29
+ siblingData: node?.fields ?? {}
30
+ });
31
+ let errorPaths = [];
32
+ for(const fieldKey in result){
33
+ if (result[fieldKey].errorPaths) {
34
+ errorPaths = errorPaths.concat(result[fieldKey].errorPaths);
9
35
  }
10
36
  }
11
- // TODO: validate upload collection fields
37
+ if (errorPaths.length) {
38
+ return 'Upload fields validation failed: ' + errorPaths.join(', ');
39
+ }
12
40
  return true;
13
41
  };
14
- return uploadValidation;
15
42
  };
16
43
 
17
44
  //# sourceMappingURL=validate.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/upload/validate.ts"],"sourcesContent":["import { isValidID } from 'payload/utilities'\n\nimport type { NodeValidation } from '../types.js'\nimport type { SerializedUploadNode } from './nodes/UploadNode.js'\n\nimport { CAN_USE_DOM } from '../../lexical/utils/canUseDOM.js'\n\nexport const uploadValidation = (): NodeValidation<SerializedUploadNode> => {\n const uploadValidation: NodeValidation<SerializedUploadNode> = ({\n node,\n validation: {\n options: {\n req: { payload, t },\n },\n },\n }) => {\n if (!CAN_USE_DOM) {\n const idType = payload.collections[node.relationTo].customIDType || payload.db.defaultIDType\n\n if (!isValidID(node.value?.id, idType)) {\n return t('validation:validUploadID')\n }\n }\n\n // TODO: validate upload collection fields\n\n return true\n }\n\n return uploadValidation\n}\n"],"names":["isValidID","CAN_USE_DOM","uploadValidation","node","validation","options","req","payload","t","idType","collections","relationTo","customIDType","db","defaultIDType","value","id"],"rangeMappings":";;;;;;;;;;;;;;","mappings":"AAAA,SAASA,SAAS,QAAQ,oBAAmB;AAK7C,SAASC,WAAW,QAAQ,mCAAkC;AAE9D,OAAO,MAAMC,mBAAmB;IAC9B,MAAMA,mBAAyD,CAAC,EAC9DC,IAAI,EACJC,YAAY,EACVC,SAAS,EACPC,KAAK,EAAEC,OAAO,EAAEC,CAAC,EAAE,EACpB,EACF,EACF;QACC,IAAI,CAACP,aAAa;YAChB,MAAMQ,SAASF,QAAQG,WAAW,CAACP,KAAKQ,UAAU,CAAC,CAACC,YAAY,IAAIL,QAAQM,EAAE,CAACC,aAAa;YAE5F,IAAI,CAACd,UAAUG,KAAKY,KAAK,EAAEC,IAAIP,SAAS;gBACtC,OAAOD,EAAE;YACX;QACF;QAEA,0CAA0C;QAE1C,OAAO;IACT;IAEA,OAAON;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/upload/validate.ts"],"sourcesContent":["import { buildStateFromSchema } from '@payloadcms/ui/forms/buildStateFromSchema'\nimport { isValidID } from 'payload/utilities'\n\nimport type { NodeValidation } from '../types.js'\nimport type { UploadFeatureProps } from './feature.server.js'\nimport type { SerializedUploadNode } from './nodes/UploadNode.js'\n\nexport const uploadValidation = (\n props: UploadFeatureProps,\n): NodeValidation<SerializedUploadNode> => {\n return async ({\n node,\n validation: {\n options: {\n id,\n operation,\n preferences,\n req,\n req: { payload, t },\n },\n },\n }) => {\n const idType = payload.collections[node.relationTo].customIDType || payload.db.defaultIDType\n // @ts-expect-error\n const nodeID = node?.value?.id || node?.value // for backwards-compatibility\n\n if (!isValidID(nodeID, idType)) {\n return t('validation:validUploadID')\n }\n\n if (!props?.collections) {\n return true\n }\n\n if (Object.keys(props?.collections).length === 0) {\n return true\n }\n\n const collection = props?.collections[node.relationTo]\n\n if (!collection.fields?.length) {\n return true\n }\n\n const result = await buildStateFromSchema({\n id,\n data: node?.fields ?? {},\n fieldSchema: collection.fields,\n operation: operation === 'create' || operation === 'update' ? operation : 'update',\n preferences,\n req,\n siblingData: node?.fields ?? {},\n })\n\n let errorPaths = []\n for (const fieldKey in result) {\n if (result[fieldKey].errorPaths) {\n errorPaths = errorPaths.concat(result[fieldKey].errorPaths)\n }\n }\n\n if (errorPaths.length) {\n return 'Upload fields validation failed: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"names":["buildStateFromSchema","isValidID","uploadValidation","props","node","validation","options","id","operation","preferences","req","payload","t","idType","collections","relationTo","customIDType","db","defaultIDType","nodeID","value","Object","keys","length","collection","fields","result","data","fieldSchema","siblingData","errorPaths","fieldKey","concat","join"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA,SAASA,oBAAoB,QAAQ,4CAA2C;AAChF,SAASC,SAAS,QAAQ,oBAAmB;AAM7C,OAAO,MAAMC,mBAAmB,CAC9BC;IAEA,OAAO,OAAO,EACZC,IAAI,EACJC,YAAY,EACVC,SAAS,EACPC,EAAE,EACFC,SAAS,EACTC,WAAW,EACXC,GAAG,EACHA,KAAK,EAAEC,OAAO,EAAEC,CAAC,EAAE,EACpB,EACF,EACF;QACC,MAAMC,SAASF,QAAQG,WAAW,CAACV,KAAKW,UAAU,CAAC,CAACC,YAAY,IAAIL,QAAQM,EAAE,CAACC,aAAa;QAC5F,mBAAmB;QACnB,MAAMC,SAASf,MAAMgB,OAAOb,MAAMH,MAAMgB,MAAM,8BAA8B;;QAE5E,IAAI,CAACnB,UAAUkB,QAAQN,SAAS;YAC9B,OAAOD,EAAE;QACX;QAEA,IAAI,CAACT,OAAOW,aAAa;YACvB,OAAO;QACT;QAEA,IAAIO,OAAOC,IAAI,CAACnB,OAAOW,aAAaS,MAAM,KAAK,GAAG;YAChD,OAAO;QACT;QAEA,MAAMC,aAAarB,OAAOW,WAAW,CAACV,KAAKW,UAAU,CAAC;QAEtD,IAAI,CAACS,WAAWC,MAAM,EAAEF,QAAQ;YAC9B,OAAO;QACT;QAEA,MAAMG,SAAS,MAAM1B,qBAAqB;YACxCO;YACAoB,MAAMvB,MAAMqB,UAAU,CAAC;YACvBG,aAAaJ,WAAWC,MAAM;YAC9BjB,WAAWA,cAAc,YAAYA,cAAc,WAAWA,YAAY;YAC1EC;YACAC;YACAmB,aAAazB,MAAMqB,UAAU,CAAC;QAChC;QAEA,IAAIK,aAAa,EAAE;QACnB,IAAK,MAAMC,YAAYL,OAAQ;YAC7B,IAAIA,MAAM,CAACK,SAAS,CAACD,UAAU,EAAE;gBAC/BA,aAAaA,WAAWE,MAAM,CAACN,MAAM,CAACK,SAAS,CAACD,UAAU;YAC5D;QACF;QAEA,IAAIA,WAAWP,MAAM,EAAE;YACrB,OAAO,sCAAsCO,WAAWG,IAAI,CAAC;QAC/D;QAEA,OAAO;IACT;AACF,EAAC"}
@@ -1,5 +1,5 @@
1
1
  import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
2
- import type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js';
2
+ import type { EditorConfig as LexicalEditorConfig } from 'lexical';
3
3
  import React from 'react';
4
4
  export declare const RichTextField: React.FC<FormFieldBase & {
5
5
  lexicalEditorConfig: LexicalEditorConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/field/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAKnF,OAAO,KAA8C,MAAM,OAAO,CAAA;AAclE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC,aAAa,GAAG;IACd,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;CACnD,CA4GF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/field/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlE,OAAO,KAA8C,MAAM,OAAO,CAAA;AAclE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC,aAAa,GAAG;IACd,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;CACnD,CA4GF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/field/index.tsx"],"sourcesContent":["'use client'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js'\n\nimport { ShimmerEffect } from '@payloadcms/ui/elements/ShimmerEffect'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction'\nimport React, { Suspense, lazy, useEffect, useState } from 'react'\n\nimport type { GeneratedFeatureProviderComponent } from '../types.js'\nimport type { FeatureProviderClient } from './features/types.js'\nimport type { SanitizedClientEditorConfig } from './lexical/config/types.js'\n\nimport { defaultEditorLexicalConfig } from './lexical/config/client/default.js'\nimport { loadClientFeatures } from './lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from './lexical/config/client/sanitize.js'\n\nconst RichTextEditor = lazy(() =>\n import('./Field.js').then((module) => ({ default: module.RichText })),\n)\n\nexport const RichTextField: React.FC<\n FormFieldBase & {\n lexicalEditorConfig: LexicalEditorConfig\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n> = (props) => {\n const { lexicalEditorConfig, richTextComponentMap } = props\n const { schemaPath } = useFieldProps()\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 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 }) // TODO: Type better\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 (\n <Suspense fallback={<ShimmerEffect height=\"35vh\" />}>\n {finalSanitizedEditorConfig && (\n <RichTextEditor {...props} editorConfig={finalSanitizedEditorConfig} />\n )}\n </Suspense>\n )\n}\n"],"names":["ShimmerEffect","useFieldProps","useClientFunctions","React","Suspense","lazy","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","RichTextEditor","then","module","default","RichText","RichTextField","props","lexicalEditorConfig","richTextComponentMap","schemaPath","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","Fragment","isArray","map","featureProvider","featureComponentKeys","featureComponents","FeatureComponent","ClientComponent","fallback","height","editorConfig"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
1
+ {"version":3,"sources":["../../src/field/index.tsx"],"sourcesContent":["'use client'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { ShimmerEffect } from '@payloadcms/ui/elements/ShimmerEffect'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction'\nimport React, { Suspense, lazy, useEffect, useState } from 'react'\n\nimport type { GeneratedFeatureProviderComponent } from '../types.js'\nimport type { FeatureProviderClient } from './features/types.js'\nimport type { SanitizedClientEditorConfig } from './lexical/config/types.js'\n\nimport { defaultEditorLexicalConfig } from './lexical/config/client/default.js'\nimport { loadClientFeatures } from './lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from './lexical/config/client/sanitize.js'\n\nconst RichTextEditor = lazy(() =>\n import('./Field.js').then((module) => ({ default: module.RichText })),\n)\n\nexport const RichTextField: React.FC<\n FormFieldBase & {\n lexicalEditorConfig: LexicalEditorConfig\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n> = (props) => {\n const { lexicalEditorConfig, richTextComponentMap } = props\n const { schemaPath } = useFieldProps()\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 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 }) // TODO: Type better\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 (\n <Suspense fallback={<ShimmerEffect height=\"35vh\" />}>\n {finalSanitizedEditorConfig && (\n <RichTextEditor {...props} editorConfig={finalSanitizedEditorConfig} />\n )}\n </Suspense>\n )\n}\n"],"names":["ShimmerEffect","useFieldProps","useClientFunctions","React","Suspense","lazy","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","RichTextEditor","then","module","default","RichText","RichTextField","props","lexicalEditorConfig","richTextComponentMap","schemaPath","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","Fragment","isArray","map","featureProvider","featureComponentKeys","featureComponents","FeatureComponent","ClientComponent","fallback","height","editorConfig"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
@@ -0,0 +1,20 @@
1
+ import type { LexicalEditor } from 'lexical';
2
+ import React from 'react';
3
+ import type { EditorConfigContextType } from './config/client/EditorConfigProvider.js';
4
+ export type EditorFocusContextType = {
5
+ blurEditor: () => void;
6
+ editor: LexicalEditor;
7
+ focusEditor: (_editor?: LexicalEditor, _editorConfigContext?: EditorConfigContextType) => void;
8
+ focusedEditor: LexicalEditor | null;
9
+ focusedEditorConfigContext: EditorConfigContextType;
10
+ isChildEditorFocused: () => boolean;
11
+ isEditorFocused: () => boolean;
12
+ isParentEditorFocused: () => boolean;
13
+ parentEditorConfigContext: EditorConfigContextType;
14
+ parentEditorFocus: EditorFocusContextType;
15
+ };
16
+ export declare const useEditorFocus: () => EditorFocusContextType;
17
+ export declare const EditorFocusProvider: ({ children }: {
18
+ children: any;
19
+ }) => React.JSX.Element;
20
+ //# sourceMappingURL=EditorFocusProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EditorFocusProvider.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/EditorFocusProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAA2D,MAAM,OAAO,CAAA;AAE/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AAItF,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,MAAM,EAAE,aAAa,CAAA;IACrB,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,oBAAoB,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC9F,aAAa,EAAE,aAAa,GAAG,IAAI,CAAA;IACnC,0BAA0B,EAAE,uBAAuB,CAAA;IACnD,oBAAoB,EAAE,MAAM,OAAO,CAAA;IACnC,eAAe,EAAE,MAAM,OAAO,CAAA;IAC9B,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC,yBAAyB,EAAE,uBAAuB,CAAA;IAClD,iBAAiB,EAAE,sBAAsB,CAAA;CAC1C,CAAA;AAeD,eAAO,MAAM,cAAc,QAAO,sBAEjC,CAAA;AAED,eAAO,MAAM,mBAAmB;;uBA4D/B,CAAA"}
@@ -0,0 +1,78 @@
1
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
2
+ import React, { createContext, useCallback, useContext, useState } from 'react';
3
+ import { useEditorConfigContext } from './config/client/EditorConfigProvider.js';
4
+ const EditorFocusContext = /*#__PURE__*/ createContext({
5
+ blurEditor: null,
6
+ editor: null,
7
+ focusEditor: null,
8
+ focusedEditor: null,
9
+ focusedEditorConfigContext: null,
10
+ isChildEditorFocused: null,
11
+ isEditorFocused: null,
12
+ isParentEditorFocused: null,
13
+ parentEditorConfigContext: null,
14
+ parentEditorFocus: null
15
+ });
16
+ export const useEditorFocus = ()=>{
17
+ return useContext(EditorFocusContext);
18
+ };
19
+ export const EditorFocusProvider = ({ children })=>{
20
+ const parentEditorFocus = useEditorFocus();
21
+ const parentEditorConfigContext = useEditorConfigContext() // Is parent, as this EditorFocusProvider sits outside the EditorConfigProvider
22
+ ;
23
+ const [editor] = useLexicalComposerContext();
24
+ const [focusedEditor, setFocusedEditor] = useState(null);
25
+ const [focusedEditorConfigContext, setFocusedEditorConfigContext] = useState(null);
26
+ const focusEditor = useCallback((_editor, _editorConfigContext)=>{
27
+ setFocusedEditor(_editor !== undefined ? _editor : editor);
28
+ setFocusedEditorConfigContext(_editorConfigContext);
29
+ if (parentEditorFocus.focusEditor) {
30
+ parentEditorFocus.focusEditor(_editor !== undefined ? _editor : editor, _editorConfigContext);
31
+ }
32
+ }, [
33
+ editor,
34
+ parentEditorFocus
35
+ ]);
36
+ const blurEditor = useCallback(()=>{
37
+ if (focusedEditor === editor) {
38
+ setFocusedEditor(null);
39
+ setFocusedEditorConfigContext(null);
40
+ }
41
+ }, [
42
+ editor,
43
+ focusedEditor
44
+ ]);
45
+ const isEditorFocused = useCallback(()=>{
46
+ return focusedEditor === editor;
47
+ }, [
48
+ editor,
49
+ focusedEditor
50
+ ]);
51
+ const isParentEditorFocused = useCallback(()=>{
52
+ return parentEditorFocus?.isEditorFocused ? parentEditorFocus.isEditorFocused() : false;
53
+ }, [
54
+ parentEditorFocus
55
+ ]);
56
+ const isChildEditorFocused = useCallback(()=>{
57
+ return focusedEditor !== editor && !!focusedEditor;
58
+ }, [
59
+ editor,
60
+ focusedEditor
61
+ ]);
62
+ return /*#__PURE__*/ React.createElement(EditorFocusContext.Provider, {
63
+ value: {
64
+ blurEditor,
65
+ editor,
66
+ focusEditor,
67
+ focusedEditor,
68
+ focusedEditorConfigContext,
69
+ isChildEditorFocused,
70
+ isEditorFocused,
71
+ isParentEditorFocused,
72
+ parentEditorConfigContext,
73
+ parentEditorFocus
74
+ }
75
+ }, children);
76
+ };
77
+
78
+ //# sourceMappingURL=EditorFocusProvider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../src/field/lexical/EditorFocusProvider.tsx"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport React, { createContext, useCallback, useContext, useState } from 'react'\n\nimport type { EditorConfigContextType } from './config/client/EditorConfigProvider.js'\n\nimport { useEditorConfigContext } from './config/client/EditorConfigProvider.js'\n\nexport type EditorFocusContextType = {\n blurEditor: () => void\n editor: LexicalEditor\n focusEditor: (_editor?: LexicalEditor, _editorConfigContext?: EditorConfigContextType) => void\n focusedEditor: LexicalEditor | null\n focusedEditorConfigContext: EditorConfigContextType\n isChildEditorFocused: () => boolean\n isEditorFocused: () => boolean\n isParentEditorFocused: () => boolean\n parentEditorConfigContext: EditorConfigContextType\n parentEditorFocus: EditorFocusContextType\n}\n\nconst EditorFocusContext = createContext<EditorFocusContextType>({\n blurEditor: null,\n editor: null,\n focusEditor: null,\n focusedEditor: null,\n focusedEditorConfigContext: null,\n isChildEditorFocused: null,\n isEditorFocused: null,\n isParentEditorFocused: null,\n parentEditorConfigContext: null,\n parentEditorFocus: null,\n})\n\nexport const useEditorFocus = (): EditorFocusContextType => {\n return useContext(EditorFocusContext)\n}\n\nexport const EditorFocusProvider = ({ children }) => {\n const parentEditorFocus = useEditorFocus()\n const parentEditorConfigContext = useEditorConfigContext() // Is parent, as this EditorFocusProvider sits outside the EditorConfigProvider\n const [editor] = useLexicalComposerContext()\n\n const [focusedEditor, setFocusedEditor] = useState<LexicalEditor | null>(null)\n const [focusedEditorConfigContext, setFocusedEditorConfigContext] =\n useState<EditorConfigContextType | null>(null)\n\n const focusEditor = useCallback(\n (_editor: LexicalEditor, _editorConfigContext: EditorConfigContextType) => {\n setFocusedEditor(_editor !== undefined ? _editor : editor)\n setFocusedEditorConfigContext(_editorConfigContext)\n if (parentEditorFocus.focusEditor) {\n parentEditorFocus.focusEditor(\n _editor !== undefined ? _editor : editor,\n _editorConfigContext,\n )\n }\n },\n [editor, parentEditorFocus],\n )\n\n const blurEditor = useCallback(() => {\n if (focusedEditor === editor) {\n setFocusedEditor(null)\n setFocusedEditorConfigContext(null)\n }\n }, [editor, focusedEditor])\n\n const isEditorFocused = useCallback(() => {\n return focusedEditor === editor\n }, [editor, focusedEditor])\n\n const isParentEditorFocused = useCallback(() => {\n return parentEditorFocus?.isEditorFocused ? parentEditorFocus.isEditorFocused() : false\n }, [parentEditorFocus])\n\n const isChildEditorFocused = useCallback(() => {\n return focusedEditor !== editor && !!focusedEditor\n }, [editor, focusedEditor])\n\n return (\n <EditorFocusContext.Provider\n value={{\n blurEditor,\n editor,\n focusEditor,\n focusedEditor,\n focusedEditorConfigContext,\n isChildEditorFocused,\n isEditorFocused,\n isParentEditorFocused,\n parentEditorConfigContext,\n parentEditorFocus,\n }}\n >\n {children}\n </EditorFocusContext.Provider>\n )\n}\n"],"names":["useLexicalComposerContext","React","createContext","useCallback","useContext","useState","useEditorConfigContext","EditorFocusContext","blurEditor","editor","focusEditor","focusedEditor","focusedEditorConfigContext","isChildEditorFocused","isEditorFocused","isParentEditorFocused","parentEditorConfigContext","parentEditorFocus","useEditorFocus","EditorFocusProvider","children","setFocusedEditor","setFocusedEditorConfigContext","_editor","_editorConfigContext","undefined","Provider","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,OAAOC,SAASC,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,QAAO;AAI/E,SAASC,sBAAsB,QAAQ,0CAAyC;AAehF,MAAMC,mCAAqBL,cAAsC;IAC/DM,YAAY;IACZC,QAAQ;IACRC,aAAa;IACbC,eAAe;IACfC,4BAA4B;IAC5BC,sBAAsB;IACtBC,iBAAiB;IACjBC,uBAAuB;IACvBC,2BAA2B;IAC3BC,mBAAmB;AACrB;AAEA,OAAO,MAAMC,iBAAiB;IAC5B,OAAOd,WAAWG;AACpB,EAAC;AAED,OAAO,MAAMY,sBAAsB,CAAC,EAAEC,QAAQ,EAAE;IAC9C,MAAMH,oBAAoBC;IAC1B,MAAMF,4BAA4BV,yBAAyB,+EAA+E;;IAC1I,MAAM,CAACG,OAAO,GAAGT;IAEjB,MAAM,CAACW,eAAeU,iBAAiB,GAAGhB,SAA+B;IACzE,MAAM,CAACO,4BAA4BU,8BAA8B,GAC/DjB,SAAyC;IAE3C,MAAMK,cAAcP,YAClB,CAACoB,SAAwBC;QACvBH,iBAAiBE,YAAYE,YAAYF,UAAUd;QACnDa,8BAA8BE;QAC9B,IAAIP,kBAAkBP,WAAW,EAAE;YACjCO,kBAAkBP,WAAW,CAC3Ba,YAAYE,YAAYF,UAAUd,QAClCe;QAEJ;IACF,GACA;QAACf;QAAQQ;KAAkB;IAG7B,MAAMT,aAAaL,YAAY;QAC7B,IAAIQ,kBAAkBF,QAAQ;YAC5BY,iBAAiB;YACjBC,8BAA8B;QAChC;IACF,GAAG;QAACb;QAAQE;KAAc;IAE1B,MAAMG,kBAAkBX,YAAY;QAClC,OAAOQ,kBAAkBF;IAC3B,GAAG;QAACA;QAAQE;KAAc;IAE1B,MAAMI,wBAAwBZ,YAAY;QACxC,OAAOc,mBAAmBH,kBAAkBG,kBAAkBH,eAAe,KAAK;IACpF,GAAG;QAACG;KAAkB;IAEtB,MAAMJ,uBAAuBV,YAAY;QACvC,OAAOQ,kBAAkBF,UAAU,CAAC,CAACE;IACvC,GAAG;QAACF;QAAQE;KAAc;IAE1B,qBACE,oBAACJ,mBAAmBmB,QAAQ;QAC1BC,OAAO;YACLnB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;OAECG;AAGP,EAAC"}
@@ -2,6 +2,7 @@ import * as React from 'react';
2
2
  import type { SanitizedPlugin } from '../features/types.js';
3
3
  export declare const EditorPlugin: React.FC<{
4
4
  anchorElem?: HTMLDivElement;
5
+ clientProps: any;
5
6
  plugin: SanitizedPlugin;
6
7
  }>;
7
8
  //# sourceMappingURL=EditorPlugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditorPlugin.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/EditorPlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,MAAM,EAAE,eAAe,CAAA;CACxB,CAMA,CAAA"}
1
+ {"version":3,"file":"EditorPlugin.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/EditorPlugin.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AAE3D,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC;IAClC,UAAU,CAAC,EAAE,cAAc,CAAA;IAC3B,WAAW,EAAE,GAAG,CAAA;IAChB,MAAM,EAAE,eAAe,CAAA;CACxB,CAQA,CAAA"}
@@ -1,11 +1,14 @@
1
1
  import * as React from 'react';
2
- export const EditorPlugin = ({ anchorElem, plugin })=>{
2
+ export const EditorPlugin = ({ anchorElem, clientProps, plugin })=>{
3
3
  if (plugin.position === 'floatingAnchorElem') {
4
4
  return plugin.Component && /*#__PURE__*/ React.createElement(plugin.Component, {
5
- anchorElem: anchorElem
5
+ anchorElem: anchorElem,
6
+ clientProps: clientProps
6
7
  });
7
8
  }
8
- return plugin.Component && /*#__PURE__*/ React.createElement(plugin.Component, null);
9
+ return plugin.Component && /*#__PURE__*/ React.createElement(plugin.Component, {
10
+ clientProps: clientProps
11
+ });
9
12
  };
10
13
 
11
14
  //# sourceMappingURL=EditorPlugin.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/field/lexical/EditorPlugin.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport type { SanitizedPlugin } from '../features/types.js'\n\nexport const EditorPlugin: React.FC<{\n anchorElem?: HTMLDivElement\n plugin: SanitizedPlugin\n}> = ({ anchorElem, plugin }) => {\n if (plugin.position === 'floatingAnchorElem') {\n return plugin.Component && <plugin.Component anchorElem={anchorElem} />\n }\n\n return plugin.Component && <plugin.Component />\n}\n"],"names":["React","EditorPlugin","anchorElem","plugin","position","Component"],"rangeMappings":";;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAO;AAI9B,OAAO,MAAMC,eAGR,CAAC,EAAEC,UAAU,EAAEC,MAAM,EAAE;IAC1B,IAAIA,OAAOC,QAAQ,KAAK,sBAAsB;QAC5C,OAAOD,OAAOE,SAAS,kBAAI,oBAACF,OAAOE,SAAS;YAACH,YAAYA;;IAC3D;IAEA,OAAOC,OAAOE,SAAS,kBAAI,oBAACF,OAAOE,SAAS;AAC9C,EAAC"}
1
+ {"version":3,"sources":["../../../src/field/lexical/EditorPlugin.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport type { SanitizedPlugin } from '../features/types.js'\n\nexport const EditorPlugin: React.FC<{\n anchorElem?: HTMLDivElement\n clientProps: any\n plugin: SanitizedPlugin\n}> = ({ anchorElem, clientProps, plugin }) => {\n if (plugin.position === 'floatingAnchorElem') {\n return (\n plugin.Component && <plugin.Component anchorElem={anchorElem} clientProps={clientProps} />\n )\n }\n\n return plugin.Component && <plugin.Component clientProps={clientProps} />\n}\n"],"names":["React","EditorPlugin","anchorElem","clientProps","plugin","position","Component"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAO;AAI9B,OAAO,MAAMC,eAIR,CAAC,EAAEC,UAAU,EAAEC,WAAW,EAAEC,MAAM,EAAE;IACvC,IAAIA,OAAOC,QAAQ,KAAK,sBAAsB;QAC5C,OACED,OAAOE,SAAS,kBAAI,oBAACF,OAAOE,SAAS;YAACJ,YAAYA;YAAYC,aAAaA;;IAE/E;IAEA,OAAOC,OAAOE,SAAS,kBAAI,oBAACF,OAAOE,SAAS;QAACH,aAAaA;;AAC5D,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"LexicalEditor.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/LexicalEditor.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAGhE,OAAO,sBAAsB,CAAA;AAQ7B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,UAAU,CAAC,CAgH3F,CAAA"}
1
+ {"version":3,"file":"LexicalEditor.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/LexicalEditor.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAG9B,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAIhE,OAAO,sBAAsB,CAAA;AAQ7B,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAAC,IAAI,CAAC,oBAAoB,EAAE,cAAc,GAAG,UAAU,CAAC,CA6I3F,CAAA"}
@@ -1,20 +1,18 @@
1
1
  'use client';
2
- import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js';
3
- const { useLexicalComposerContext } = lexicalComposerContextImport;
2
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
4
3
  import LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js';
5
- import lexicalHistoryPluginImport from '@lexical/react/LexicalHistoryPlugin.js';
6
- const { HistoryPlugin } = lexicalHistoryPluginImport;
7
- import lexicalOnChangePluginImport from '@lexical/react/LexicalOnChangePlugin.js';
8
- const { OnChangePlugin } = lexicalOnChangePluginImport;
9
- import lexicalRichTextPluginImport from '@lexical/react/LexicalRichTextPlugin.js';
10
- const { RichTextPlugin } = lexicalRichTextPluginImport;
11
- import lexicalTabIndentationPluginImport from '@lexical/react/LexicalTabIndentationPlugin.js';
12
- const { TabIndentationPlugin } = lexicalTabIndentationPluginImport;
4
+ import { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin.js';
5
+ import { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin.js';
6
+ import { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin.js';
7
+ import { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin.js';
8
+ import { mergeRegister } from '@lexical/utils';
9
+ import { BLUR_COMMAND, COMMAND_PRIORITY_LOW, FOCUS_COMMAND } from 'lexical';
13
10
  import * as React from 'react';
14
11
  import { useEffect, useState } from 'react';
12
+ import { useEditorFocus } from './EditorFocusProvider.js';
15
13
  import { EditorPlugin } from './EditorPlugin.js';
16
14
  import './LexicalEditor.scss';
17
- import { FloatingSelectToolbarPlugin } from './plugins/FloatingSelectToolbar/index.js';
15
+ import { useEditorConfigContext } from './config/client/EditorConfigProvider.js';
18
16
  import { MarkdownShortcutPlugin } from './plugins/MarkdownShortcut/index.js';
19
17
  import { SlashMenuPlugin } from './plugins/SlashMenu/index.js';
20
18
  import { AddBlockHandlePlugin } from './plugins/handles/AddBlockHandlePlugin/index.js';
@@ -22,17 +20,33 @@ import { DraggableBlockPlugin } from './plugins/handles/DraggableBlockPlugin/ind
22
20
  import { LexicalContentEditable } from './ui/ContentEditable.js';
23
21
  export const LexicalEditor = (props)=>{
24
22
  const { editorConfig, onChange } = props;
23
+ const editorConfigContext = useEditorConfigContext();
25
24
  const [editor] = useLexicalComposerContext();
25
+ const editorFocus = useEditorFocus();
26
26
  const [floatingAnchorElem, setFloatingAnchorElem] = useState(null);
27
27
  const onRef = (_floatingAnchorElem)=>{
28
28
  if (_floatingAnchorElem !== null) {
29
29
  setFloatingAnchorElem(_floatingAnchorElem);
30
30
  }
31
31
  };
32
+ useEffect(()=>{
33
+ return mergeRegister(editor.registerCommand(FOCUS_COMMAND, ()=>{
34
+ editorFocus.focusEditor(editor, editorConfigContext);
35
+ return true;
36
+ }, COMMAND_PRIORITY_LOW), editor.registerCommand(BLUR_COMMAND, ()=>{
37
+ editorFocus.blurEditor();
38
+ return true;
39
+ }, COMMAND_PRIORITY_LOW));
40
+ }, [
41
+ editor,
42
+ editorConfig,
43
+ editorConfigContext,
44
+ editorFocus
45
+ ]);
32
46
  const [isSmallWidthViewport, setIsSmallWidthViewport] = useState(false);
33
47
  useEffect(()=>{
34
48
  const updateViewPortWidth = ()=>{
35
- const isNextSmallWidthViewport = window.matchMedia('(max-width: 1025px)').matches;
49
+ const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches;
36
50
  if (isNextSmallWidthViewport !== isSmallWidthViewport) {
37
51
  setIsSmallWidthViewport(isNextSmallWidthViewport);
38
52
  }
@@ -49,6 +63,7 @@ export const LexicalEditor = (props)=>{
49
63
  return /*#__PURE__*/ React.createElement(React.Fragment, null, editorConfig.features.plugins.map((plugin)=>{
50
64
  if (plugin.position === 'top') {
51
65
  return /*#__PURE__*/ React.createElement(EditorPlugin, {
66
+ clientProps: plugin.clientProps,
52
67
  key: plugin.key,
53
68
  plugin: plugin
54
69
  });
@@ -84,17 +99,17 @@ export const LexicalEditor = (props)=>{
84
99
  if (plugin.position === 'floatingAnchorElem' && !(plugin.desktopOnly === true && isSmallWidthViewport)) {
85
100
  return /*#__PURE__*/ React.createElement(EditorPlugin, {
86
101
  anchorElem: floatingAnchorElem,
102
+ clientProps: plugin.clientProps,
87
103
  key: plugin.key,
88
104
  plugin: plugin
89
105
  });
90
106
  }
91
- }), editor.isEditable() && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(FloatingSelectToolbarPlugin, {
92
- anchorElem: floatingAnchorElem
93
- }), /*#__PURE__*/ React.createElement(SlashMenuPlugin, {
107
+ }), editor.isEditable() && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(SlashMenuPlugin, {
94
108
  anchorElem: floatingAnchorElem
95
109
  }))), editor.isEditable() && /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(HistoryPlugin, null), editorConfig?.features?.markdownTransformers?.length > 0 && /*#__PURE__*/ React.createElement(MarkdownShortcutPlugin, null)), /*#__PURE__*/ React.createElement(TabIndentationPlugin, null), editorConfig.features.plugins.map((plugin)=>{
96
110
  if (plugin.position === 'normal') {
97
111
  return /*#__PURE__*/ React.createElement(EditorPlugin, {
112
+ clientProps: plugin.clientProps,
98
113
  key: plugin.key,
99
114
  plugin: plugin
100
115
  });
@@ -102,6 +117,7 @@ export const LexicalEditor = (props)=>{
102
117
  }), editorConfig.features.plugins.map((plugin)=>{
103
118
  if (plugin.position === 'bottom') {
104
119
  return /*#__PURE__*/ React.createElement(EditorPlugin, {
120
+ clientProps: plugin.clientProps,
105
121
  key: plugin.key,
106
122
  plugin: plugin
107
123
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/field/lexical/LexicalEditor.tsx"],"sourcesContent":["'use client'\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\n\nimport LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js'\nimport lexicalHistoryPluginImport from '@lexical/react/LexicalHistoryPlugin.js'\nconst { HistoryPlugin } = lexicalHistoryPluginImport\n\nimport lexicalOnChangePluginImport from '@lexical/react/LexicalOnChangePlugin.js'\nconst { OnChangePlugin } = lexicalOnChangePluginImport\n\nimport lexicalRichTextPluginImport from '@lexical/react/LexicalRichTextPlugin.js'\nconst { RichTextPlugin } = lexicalRichTextPluginImport\n\nimport lexicalTabIndentationPluginImport from '@lexical/react/LexicalTabIndentationPlugin.js'\nconst { TabIndentationPlugin } = lexicalTabIndentationPluginImport\n\nimport * as React from 'react'\nimport { useEffect, useState } from 'react'\n\nimport type { LexicalProviderProps } from './LexicalProvider.js'\n\nimport { EditorPlugin } from './EditorPlugin.js'\nimport './LexicalEditor.scss'\nimport { FloatingSelectToolbarPlugin } from './plugins/FloatingSelectToolbar/index.js'\nimport { MarkdownShortcutPlugin } from './plugins/MarkdownShortcut/index.js'\nimport { SlashMenuPlugin } from './plugins/SlashMenu/index.js'\nimport { AddBlockHandlePlugin } from './plugins/handles/AddBlockHandlePlugin/index.js'\nimport { DraggableBlockPlugin } from './plugins/handles/DraggableBlockPlugin/index.js'\nimport { LexicalContentEditable } from './ui/ContentEditable.js'\n\nexport const LexicalEditor: React.FC<Pick<LexicalProviderProps, 'editorConfig' | 'onChange'>> = (\n props,\n) => {\n const { editorConfig, onChange } = props\n const [editor] = useLexicalComposerContext()\n\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLDivElement | null>(null)\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem)\n }\n }\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 1025px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n const ErrorBoundaryComponent = LexicalErrorBoundary.default || LexicalErrorBoundary\n\n return (\n <React.Fragment>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'top') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n <RichTextPlugin\n //@ts-expect-error ts being dumb\n ErrorBoundary={ErrorBoundaryComponent}\n contentEditable={\n <div className=\"editor-scroller\">\n <div className=\"editor\" ref={onRef}>\n <LexicalContentEditable />\n </div>\n </div>\n }\n placeholder={\n <p className=\"editor-placeholder\">Start typing, or press '/' for commands...</p>\n }\n />\n <OnChangePlugin\n // Selection changes can be ignored here, reducing the\n // frequency that the FieldComponent and Payload receive updates.\n // Selection changes are only needed if you are saving selection state\n ignoreSelectionChange\n onChange={(editorState, editor, tags) => {\n // Ignore any onChange event triggered by focus only\n if (!tags.has('focus') || tags.size > 1) {\n if (onChange != null) onChange(editorState, editor, tags)\n }\n }}\n />\n {floatingAnchorElem && (\n <React.Fragment>\n {!isSmallWidthViewport && editor.isEditable() && (\n <React.Fragment>\n <DraggableBlockPlugin anchorElem={floatingAnchorElem} />\n <AddBlockHandlePlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n {editorConfig.features.plugins.map((plugin) => {\n if (\n plugin.position === 'floatingAnchorElem' &&\n !(plugin.desktopOnly === true && isSmallWidthViewport)\n ) {\n return (\n <EditorPlugin anchorElem={floatingAnchorElem} key={plugin.key} plugin={plugin} />\n )\n }\n })}\n {editor.isEditable() && (\n <React.Fragment>\n <FloatingSelectToolbarPlugin anchorElem={floatingAnchorElem} />\n <SlashMenuPlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n </React.Fragment>\n )}\n {editor.isEditable() && (\n <React.Fragment>\n <HistoryPlugin />\n {editorConfig?.features?.markdownTransformers?.length > 0 && <MarkdownShortcutPlugin />}\n </React.Fragment>\n )}\n\n <TabIndentationPlugin />\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'normal') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'bottom') {\n return <EditorPlugin key={plugin.key} plugin={plugin} />\n }\n })}\n </React.Fragment>\n )\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","LexicalErrorBoundary","lexicalHistoryPluginImport","HistoryPlugin","lexicalOnChangePluginImport","OnChangePlugin","lexicalRichTextPluginImport","RichTextPlugin","lexicalTabIndentationPluginImport","TabIndentationPlugin","React","useEffect","useState","EditorPlugin","FloatingSelectToolbarPlugin","MarkdownShortcutPlugin","SlashMenuPlugin","AddBlockHandlePlugin","DraggableBlockPlugin","LexicalContentEditable","LexicalEditor","props","editorConfig","onChange","editor","floatingAnchorElem","setFloatingAnchorElem","onRef","_floatingAnchorElem","isSmallWidthViewport","setIsSmallWidthViewport","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","ErrorBoundaryComponent","default","Fragment","features","plugins","map","plugin","position","key","ErrorBoundary","contentEditable","div","className","ref","placeholder","p","ignoreSelectionChange","editorState","tags","has","size","isEditable","anchorElem","desktopOnly","markdownTransformers","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
1
+ {"version":3,"sources":["../../../src/field/lexical/LexicalEditor.tsx"],"sourcesContent":["'use client'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport LexicalErrorBoundary from '@lexical/react/LexicalErrorBoundary.js'\nimport { HistoryPlugin } from '@lexical/react/LexicalHistoryPlugin.js'\nimport { OnChangePlugin } from '@lexical/react/LexicalOnChangePlugin.js'\nimport { RichTextPlugin } from '@lexical/react/LexicalRichTextPlugin.js'\nimport { TabIndentationPlugin } from '@lexical/react/LexicalTabIndentationPlugin.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { BLUR_COMMAND, COMMAND_PRIORITY_LOW, FOCUS_COMMAND } from 'lexical'\nimport * as React from 'react'\nimport { useEffect, useState } from 'react'\n\nimport type { LexicalProviderProps } from './LexicalProvider.js'\n\nimport { useEditorFocus } from './EditorFocusProvider.js'\nimport { EditorPlugin } from './EditorPlugin.js'\nimport './LexicalEditor.scss'\nimport { useEditorConfigContext } from './config/client/EditorConfigProvider.js'\nimport { MarkdownShortcutPlugin } from './plugins/MarkdownShortcut/index.js'\nimport { SlashMenuPlugin } from './plugins/SlashMenu/index.js'\nimport { AddBlockHandlePlugin } from './plugins/handles/AddBlockHandlePlugin/index.js'\nimport { DraggableBlockPlugin } from './plugins/handles/DraggableBlockPlugin/index.js'\nimport { LexicalContentEditable } from './ui/ContentEditable.js'\n\nexport const LexicalEditor: React.FC<Pick<LexicalProviderProps, 'editorConfig' | 'onChange'>> = (\n props,\n) => {\n const { editorConfig, onChange } = props\n const editorConfigContext = useEditorConfigContext()\n const [editor] = useLexicalComposerContext()\n const editorFocus = useEditorFocus()\n\n const [floatingAnchorElem, setFloatingAnchorElem] = useState<HTMLDivElement | null>(null)\n const onRef = (_floatingAnchorElem: HTMLDivElement) => {\n if (_floatingAnchorElem !== null) {\n setFloatingAnchorElem(_floatingAnchorElem)\n }\n }\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(\n FOCUS_COMMAND,\n () => {\n editorFocus.focusEditor(editor, editorConfigContext)\n return true\n },\n\n COMMAND_PRIORITY_LOW,\n ),\n editor.registerCommand<MouseEvent>(\n BLUR_COMMAND,\n () => {\n editorFocus.blurEditor()\n return true\n },\n\n COMMAND_PRIORITY_LOW,\n ),\n )\n }, [editor, editorConfig, editorConfigContext, editorFocus])\n\n const [isSmallWidthViewport, setIsSmallWidthViewport] = useState<boolean>(false)\n\n useEffect(() => {\n const updateViewPortWidth = () => {\n const isNextSmallWidthViewport = window.matchMedia('(max-width: 768px)').matches\n\n if (isNextSmallWidthViewport !== isSmallWidthViewport) {\n setIsSmallWidthViewport(isNextSmallWidthViewport)\n }\n }\n updateViewPortWidth()\n window.addEventListener('resize', updateViewPortWidth)\n\n return () => {\n window.removeEventListener('resize', updateViewPortWidth)\n }\n }, [isSmallWidthViewport])\n\n const ErrorBoundaryComponent = LexicalErrorBoundary.default || LexicalErrorBoundary\n\n return (\n <React.Fragment>\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'top') {\n return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n }\n })}\n <RichTextPlugin\n //@ts-expect-error ts being dumb\n ErrorBoundary={ErrorBoundaryComponent}\n contentEditable={\n <div className=\"editor-scroller\">\n <div className=\"editor\" ref={onRef}>\n <LexicalContentEditable />\n </div>\n </div>\n }\n placeholder={\n <p className=\"editor-placeholder\">Start typing, or press '/' for commands...</p>\n }\n />\n <OnChangePlugin\n // Selection changes can be ignored here, reducing the\n // frequency that the FieldComponent and Payload receive updates.\n // Selection changes are only needed if you are saving selection state\n ignoreSelectionChange\n onChange={(editorState, editor, tags) => {\n // Ignore any onChange event triggered by focus only\n if (!tags.has('focus') || tags.size > 1) {\n if (onChange != null) onChange(editorState, editor, tags)\n }\n }}\n />\n {floatingAnchorElem && (\n <React.Fragment>\n {!isSmallWidthViewport && editor.isEditable() && (\n <React.Fragment>\n <DraggableBlockPlugin anchorElem={floatingAnchorElem} />\n <AddBlockHandlePlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n {editorConfig.features.plugins.map((plugin) => {\n if (\n plugin.position === 'floatingAnchorElem' &&\n !(plugin.desktopOnly === true && isSmallWidthViewport)\n ) {\n return (\n <EditorPlugin\n anchorElem={floatingAnchorElem}\n clientProps={plugin.clientProps}\n key={plugin.key}\n plugin={plugin}\n />\n )\n }\n })}\n {editor.isEditable() && (\n <React.Fragment>\n <SlashMenuPlugin anchorElem={floatingAnchorElem} />\n </React.Fragment>\n )}\n </React.Fragment>\n )}\n {editor.isEditable() && (\n <React.Fragment>\n <HistoryPlugin />\n {editorConfig?.features?.markdownTransformers?.length > 0 && <MarkdownShortcutPlugin />}\n </React.Fragment>\n )}\n\n <TabIndentationPlugin />\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'normal') {\n return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n }\n })}\n {editorConfig.features.plugins.map((plugin) => {\n if (plugin.position === 'bottom') {\n return <EditorPlugin clientProps={plugin.clientProps} key={plugin.key} plugin={plugin} />\n }\n })}\n </React.Fragment>\n )\n}\n"],"names":["useLexicalComposerContext","LexicalErrorBoundary","HistoryPlugin","OnChangePlugin","RichTextPlugin","TabIndentationPlugin","mergeRegister","BLUR_COMMAND","COMMAND_PRIORITY_LOW","FOCUS_COMMAND","React","useEffect","useState","useEditorFocus","EditorPlugin","useEditorConfigContext","MarkdownShortcutPlugin","SlashMenuPlugin","AddBlockHandlePlugin","DraggableBlockPlugin","LexicalContentEditable","LexicalEditor","props","editorConfig","onChange","editorConfigContext","editor","editorFocus","floatingAnchorElem","setFloatingAnchorElem","onRef","_floatingAnchorElem","registerCommand","focusEditor","blurEditor","isSmallWidthViewport","setIsSmallWidthViewport","updateViewPortWidth","isNextSmallWidthViewport","window","matchMedia","matches","addEventListener","removeEventListener","ErrorBoundaryComponent","default","Fragment","features","plugins","map","plugin","position","clientProps","key","ErrorBoundary","contentEditable","div","className","ref","placeholder","p","ignoreSelectionChange","editorState","tags","has","size","isEditable","anchorElem","desktopOnly","markdownTransformers","length"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
@@ -1,3 +1,5 @@
1
+ @import '../../scss/styles';
2
+
1
3
  .rich-text-lexical {
2
4
  .editor {
3
5
  position: relative;
@@ -23,7 +25,7 @@
23
25
  .editor-placeholder {
24
26
  position: absolute;
25
27
  top: 8px;
26
- left: 0px;
28
+ left: 0;
27
29
  font-size: 15px;
28
30
  color: var(--theme-elevation-500);
29
31
  /* Prevent text selection */
@@ -36,21 +38,3 @@
36
38
  pointer-events: none;
37
39
  }
38
40
  }
39
-
40
- .floating-select-toolbar-popup__section-dropdown-align {
41
- display: flex;
42
- gap: 2px;
43
- }
44
- .floating-select-toolbar-popup__section-features {
45
- display: flex;
46
- gap: 2px;
47
- }
48
- .floating-select-toolbar-popup__section-dropdown-text {
49
- display: flex;
50
- gap: 2px;
51
- }
52
-
53
- .floating-select-toolbar-popup__section-format {
54
- display: flex;
55
- gap: 2px;
56
- }
@@ -1,6 +1,6 @@
1
+ import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
1
2
  import type { EditorState, SerializedEditorState } from 'lexical';
2
3
  import type { LexicalEditor } from 'lexical';
3
- import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
4
4
  import * as React from 'react';
5
5
  import type { SanitizedClientEditorConfig } from './config/types.js';
6
6
  export type LexicalProviderProps = {
@@ -1 +1 @@
1
- {"version":3,"file":"LexicalProvider.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/LexicalProvider.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAM5C,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AAEjE,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAA;AAMpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,2BAA2B,CAAA;IACzC,UAAU,EAAE,aAAa,GAAG;QAC1B,YAAY,EAAE,2BAA2B,CAAA;QACzC,IAAI,EAAE,MAAM,CAAA;QACZ,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;KACnD,CAAA;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACtF,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,qBAAqB,CAAA;CAC7B,CAAA;AACD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA2D1D,CAAA"}
1
+ {"version":3,"file":"LexicalProvider.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/LexicalProvider.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,WAAW,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAA;AACjE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAA;AAE9B,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,mBAAmB,CAAA;AAOpE,MAAM,MAAM,oBAAoB,GAAG;IACjC,YAAY,EAAE,2BAA2B,CAAA;IACzC,UAAU,EAAE,aAAa,GAAG;QAC1B,YAAY,EAAE,2BAA2B,CAAA;QACzC,IAAI,EAAE,MAAM,CAAA;QACZ,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;KACnD,CAAA;IACD,QAAQ,EAAE,CAAC,WAAW,EAAE,WAAW,EAAE,MAAM,EAAE,aAAa,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,KAAK,IAAI,CAAA;IACtF,IAAI,EAAE,MAAM,CAAA;IACZ,QAAQ,EAAE,OAAO,CAAA;IACjB,KAAK,EAAE,qBAAqB,CAAA;CAC7B,CAAA;AACD,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA6D1D,CAAA"}
@@ -1,7 +1,7 @@
1
1
  'use client';
2
- import lexicalComposerImport from '@lexical/react/LexicalComposer.js';
3
- const { LexicalComposer } = lexicalComposerImport;
2
+ import { LexicalComposer } from '@lexical/react/LexicalComposer.js';
4
3
  import * as React from 'react';
4
+ import { EditorFocusProvider } from './EditorFocusProvider.js';
5
5
  import { LexicalEditor as LexicalEditorComponent } from './LexicalEditor.js';
6
6
  import { EditorConfigProvider } from './config/client/EditorConfigProvider.js';
7
7
  import { getEnabledNodes } from './nodes/index.js';
@@ -53,7 +53,7 @@ export const LexicalProvider = (props)=>{
53
53
  return /*#__PURE__*/ React.createElement(LexicalComposer, {
54
54
  initialConfig: initialConfig,
55
55
  key: path
56
- }, /*#__PURE__*/ React.createElement(EditorConfigProvider, {
56
+ }, /*#__PURE__*/ React.createElement(EditorFocusProvider, null, /*#__PURE__*/ React.createElement(EditorConfigProvider, {
57
57
  editorConfig: editorConfig,
58
58
  fieldProps: fieldProps
59
59
  }, /*#__PURE__*/ React.createElement("div", {
@@ -61,7 +61,7 @@ export const LexicalProvider = (props)=>{
61
61
  }, /*#__PURE__*/ React.createElement(LexicalEditorComponent, {
62
62
  editorConfig: editorConfig,
63
63
  onChange: onChange
64
- }))));
64
+ })))));
65
65
  };
66
66
 
67
67
  //# sourceMappingURL=LexicalProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/field/lexical/LexicalProvider.tsx"],"sourcesContent":["'use client'\nimport type { EditorState, SerializedEditorState } from 'lexical'\nimport type { LexicalEditor } from 'lexical'\n\nimport lexicalComposerImport from '@lexical/react/LexicalComposer.js'\nconst { LexicalComposer } = lexicalComposerImport\n\nimport type { InitialConfigType } from '@lexical/react/LexicalComposer.js'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\n\nimport * as React from 'react'\n\nimport type { SanitizedClientEditorConfig } from './config/types.js'\n\nimport { LexicalEditor as LexicalEditorComponent } from './LexicalEditor.js'\nimport { EditorConfigProvider } from './config/client/EditorConfigProvider.js'\nimport { getEnabledNodes } from './nodes/index.js'\n\nexport type LexicalProviderProps = {\n editorConfig: SanitizedClientEditorConfig\n fieldProps: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n onChange: (editorState: EditorState, editor: LexicalEditor, tags: Set<string>) => void\n path: string\n readOnly: boolean\n value: SerializedEditorState\n}\nexport const LexicalProvider: React.FC<LexicalProviderProps> = (props) => {\n const { editorConfig, fieldProps, onChange, path, readOnly } = props\n let { value } = props\n\n const [initialConfig, setInitialConfig] = React.useState<InitialConfigType | null>(null)\n\n // set lexical config in useEffect: // TODO: Is this the most performant way to do this? Prob not\n React.useEffect(() => {\n const newInitialConfig: InitialConfigType = {\n editable: readOnly !== true,\n editorState: value != null ? JSON.stringify(value) : undefined,\n namespace: editorConfig.lexical.namespace,\n nodes: [...getEnabledNodes({ editorConfig })],\n onError: (error: Error) => {\n throw error\n },\n theme: editorConfig.lexical.theme,\n }\n setInitialConfig(newInitialConfig)\n }, [editorConfig, readOnly, value])\n\n if (editorConfig?.features?.hooks?.load?.length) {\n editorConfig.features.hooks.load.forEach((hook) => {\n value = hook({ incomingEditorState: value })\n })\n }\n\n if (value && typeof value !== 'object') {\n throw new Error(\n 'The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: ' +\n JSON.stringify(value),\n )\n }\n\n if (value && Array.isArray(value) && !('root' in value)) {\n throw new Error(\n 'You have tried to pass in data from the old, Slate editor, to the new, Lexical editor. This is not supported. There is no automatic conversion from Slate to Lexical data available yet (coming soon). Please remove the data from the field and start again.',\n )\n }\n\n if (value && 'jsonContent' in value) {\n throw new Error(\n 'You have tried to pass in data from payload-plugin-lexical. This is not supported. The data structure has changed in this editor, compared to the plugin, and there is no automatic conversion available yet (coming soon). Please remove the data from the field and start again.',\n )\n }\n\n if (!initialConfig) {\n return <p>Loading...</p>\n }\n\n return (\n <LexicalComposer initialConfig={initialConfig} key={path}>\n <EditorConfigProvider editorConfig={editorConfig} fieldProps={fieldProps}>\n <div className=\"editor-shell\">\n <LexicalEditorComponent editorConfig={editorConfig} onChange={onChange} />\n </div>\n </EditorConfigProvider>\n </LexicalComposer>\n )\n}\n"],"names":["lexicalComposerImport","LexicalComposer","React","LexicalEditor","LexicalEditorComponent","EditorConfigProvider","getEnabledNodes","LexicalProvider","props","editorConfig","fieldProps","onChange","path","readOnly","value","initialConfig","setInitialConfig","useState","useEffect","newInitialConfig","editable","editorState","JSON","stringify","undefined","namespace","lexical","nodes","onError","error","theme","features","hooks","load","length","forEach","hook","incomingEditorState","Error","Array","isArray","p","key","div","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,OAAOA,2BAA2B,oCAAmC;AACrE,MAAM,EAAEC,eAAe,EAAE,GAAGD;AAK5B,YAAYE,WAAW,QAAO;AAI9B,SAASC,iBAAiBC,sBAAsB,QAAQ,qBAAoB;AAC5E,SAASC,oBAAoB,QAAQ,0CAAyC;AAC9E,SAASC,eAAe,QAAQ,mBAAkB;AAclD,OAAO,MAAMC,kBAAkD,CAACC;IAC9D,MAAM,EAAEC,YAAY,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGL;IAC/D,IAAI,EAAEM,KAAK,EAAE,GAAGN;IAEhB,MAAM,CAACO,eAAeC,iBAAiB,GAAGd,MAAMe,QAAQ,CAA2B;IAEnF,iGAAiG;IACjGf,MAAMgB,SAAS,CAAC;QACd,MAAMC,mBAAsC;YAC1CC,UAAUP,aAAa;YACvBQ,aAAaP,SAAS,OAAOQ,KAAKC,SAAS,CAACT,SAASU;YACrDC,WAAWhB,aAAaiB,OAAO,CAACD,SAAS;YACzCE,OAAO;mBAAIrB,gBAAgB;oBAAEG;gBAAa;aAAG;YAC7CmB,SAAS,CAACC;gBACR,MAAMA;YACR;YACAC,OAAOrB,aAAaiB,OAAO,CAACI,KAAK;QACnC;QACAd,iBAAiBG;IACnB,GAAG;QAACV;QAAcI;QAAUC;KAAM;IAElC,IAAIL,cAAcsB,UAAUC,OAAOC,MAAMC,QAAQ;QAC/CzB,aAAasB,QAAQ,CAACC,KAAK,CAACC,IAAI,CAACE,OAAO,CAAC,CAACC;YACxCtB,QAAQsB,KAAK;gBAAEC,qBAAqBvB;YAAM;QAC5C;IACF;IAEA,IAAIA,SAAS,OAAOA,UAAU,UAAU;QACtC,MAAM,IAAIwB,MACR,kLACEhB,KAAKC,SAAS,CAACT;IAErB;IAEA,IAAIA,SAASyB,MAAMC,OAAO,CAAC1B,UAAU,CAAE,CAAA,UAAUA,KAAI,GAAI;QACvD,MAAM,IAAIwB,MACR;IAEJ;IAEA,IAAIxB,SAAS,iBAAiBA,OAAO;QACnC,MAAM,IAAIwB,MACR;IAEJ;IAEA,IAAI,CAACvB,eAAe;QAClB,qBAAO,oBAAC0B,WAAE;IACZ;IAEA,qBACE,oBAACxC;QAAgBc,eAAeA;QAAe2B,KAAK9B;qBAClD,oBAACP;QAAqBI,cAAcA;QAAcC,YAAYA;qBAC5D,oBAACiC;QAAIC,WAAU;qBACb,oBAACxC;QAAuBK,cAAcA;QAAcE,UAAUA;;AAKxE,EAAC"}
1
+ {"version":3,"sources":["../../../src/field/lexical/LexicalProvider.tsx"],"sourcesContent":["'use client'\nimport type { InitialConfigType } from '@lexical/react/LexicalComposer.js'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { EditorState, SerializedEditorState } from 'lexical'\nimport type { LexicalEditor } from 'lexical'\n\nimport { LexicalComposer } from '@lexical/react/LexicalComposer.js'\nimport * as React from 'react'\n\nimport type { SanitizedClientEditorConfig } from './config/types.js'\n\nimport { EditorFocusProvider } from './EditorFocusProvider.js'\nimport { LexicalEditor as LexicalEditorComponent } from './LexicalEditor.js'\nimport { EditorConfigProvider } from './config/client/EditorConfigProvider.js'\nimport { getEnabledNodes } from './nodes/index.js'\n\nexport type LexicalProviderProps = {\n editorConfig: SanitizedClientEditorConfig\n fieldProps: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n onChange: (editorState: EditorState, editor: LexicalEditor, tags: Set<string>) => void\n path: string\n readOnly: boolean\n value: SerializedEditorState\n}\nexport const LexicalProvider: React.FC<LexicalProviderProps> = (props) => {\n const { editorConfig, fieldProps, onChange, path, readOnly } = props\n let { value } = props\n\n const [initialConfig, setInitialConfig] = React.useState<InitialConfigType | null>(null)\n\n // set lexical config in useEffect: // TODO: Is this the most performant way to do this? Prob not\n React.useEffect(() => {\n const newInitialConfig: InitialConfigType = {\n editable: readOnly !== true,\n editorState: value != null ? JSON.stringify(value) : undefined,\n namespace: editorConfig.lexical.namespace,\n nodes: [...getEnabledNodes({ editorConfig })],\n onError: (error: Error) => {\n throw error\n },\n theme: editorConfig.lexical.theme,\n }\n setInitialConfig(newInitialConfig)\n }, [editorConfig, readOnly, value])\n\n if (editorConfig?.features?.hooks?.load?.length) {\n editorConfig.features.hooks.load.forEach((hook) => {\n value = hook({ incomingEditorState: value })\n })\n }\n\n if (value && typeof value !== 'object') {\n throw new Error(\n 'The value passed to the Lexical editor is not an object. This is not supported. Please remove the data from the field and start again. This is the value that was passed in: ' +\n JSON.stringify(value),\n )\n }\n\n if (value && Array.isArray(value) && !('root' in value)) {\n throw new Error(\n 'You have tried to pass in data from the old, Slate editor, to the new, Lexical editor. This is not supported. There is no automatic conversion from Slate to Lexical data available yet (coming soon). Please remove the data from the field and start again.',\n )\n }\n\n if (value && 'jsonContent' in value) {\n throw new Error(\n 'You have tried to pass in data from payload-plugin-lexical. This is not supported. The data structure has changed in this editor, compared to the plugin, and there is no automatic conversion available yet (coming soon). Please remove the data from the field and start again.',\n )\n }\n\n if (!initialConfig) {\n return <p>Loading...</p>\n }\n\n return (\n <LexicalComposer initialConfig={initialConfig} key={path}>\n <EditorFocusProvider>\n <EditorConfigProvider editorConfig={editorConfig} fieldProps={fieldProps}>\n <div className=\"editor-shell\">\n <LexicalEditorComponent editorConfig={editorConfig} onChange={onChange} />\n </div>\n </EditorConfigProvider>\n </EditorFocusProvider>\n </LexicalComposer>\n )\n}\n"],"names":["LexicalComposer","React","EditorFocusProvider","LexicalEditor","LexicalEditorComponent","EditorConfigProvider","getEnabledNodes","LexicalProvider","props","editorConfig","fieldProps","onChange","path","readOnly","value","initialConfig","setInitialConfig","useState","useEffect","newInitialConfig","editable","editorState","JSON","stringify","undefined","namespace","lexical","nodes","onError","error","theme","features","hooks","load","length","forEach","hook","incomingEditorState","Error","Array","isArray","p","key","div","className"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAMA,SAASA,eAAe,QAAQ,oCAAmC;AACnE,YAAYC,WAAW,QAAO;AAI9B,SAASC,mBAAmB,QAAQ,2BAA0B;AAC9D,SAASC,iBAAiBC,sBAAsB,QAAQ,qBAAoB;AAC5E,SAASC,oBAAoB,QAAQ,0CAAyC;AAC9E,SAASC,eAAe,QAAQ,mBAAkB;AAclD,OAAO,MAAMC,kBAAkD,CAACC;IAC9D,MAAM,EAAEC,YAAY,EAAEC,UAAU,EAAEC,QAAQ,EAAEC,IAAI,EAAEC,QAAQ,EAAE,GAAGL;IAC/D,IAAI,EAAEM,KAAK,EAAE,GAAGN;IAEhB,MAAM,CAACO,eAAeC,iBAAiB,GAAGf,MAAMgB,QAAQ,CAA2B;IAEnF,iGAAiG;IACjGhB,MAAMiB,SAAS,CAAC;QACd,MAAMC,mBAAsC;YAC1CC,UAAUP,aAAa;YACvBQ,aAAaP,SAAS,OAAOQ,KAAKC,SAAS,CAACT,SAASU;YACrDC,WAAWhB,aAAaiB,OAAO,CAACD,SAAS;YACzCE,OAAO;mBAAIrB,gBAAgB;oBAAEG;gBAAa;aAAG;YAC7CmB,SAAS,CAACC;gBACR,MAAMA;YACR;YACAC,OAAOrB,aAAaiB,OAAO,CAACI,KAAK;QACnC;QACAd,iBAAiBG;IACnB,GAAG;QAACV;QAAcI;QAAUC;KAAM;IAElC,IAAIL,cAAcsB,UAAUC,OAAOC,MAAMC,QAAQ;QAC/CzB,aAAasB,QAAQ,CAACC,KAAK,CAACC,IAAI,CAACE,OAAO,CAAC,CAACC;YACxCtB,QAAQsB,KAAK;gBAAEC,qBAAqBvB;YAAM;QAC5C;IACF;IAEA,IAAIA,SAAS,OAAOA,UAAU,UAAU;QACtC,MAAM,IAAIwB,MACR,kLACEhB,KAAKC,SAAS,CAACT;IAErB;IAEA,IAAIA,SAASyB,MAAMC,OAAO,CAAC1B,UAAU,CAAE,CAAA,UAAUA,KAAI,GAAI;QACvD,MAAM,IAAIwB,MACR;IAEJ;IAEA,IAAIxB,SAAS,iBAAiBA,OAAO;QACnC,MAAM,IAAIwB,MACR;IAEJ;IAEA,IAAI,CAACvB,eAAe;QAClB,qBAAO,oBAAC0B,WAAE;IACZ;IAEA,qBACE,oBAACzC;QAAgBe,eAAeA;QAAe2B,KAAK9B;qBAClD,oBAACV,yCACC,oBAACG;QAAqBI,cAAcA;QAAcC,YAAYA;qBAC5D,oBAACiC;QAAIC,WAAU;qBACb,oBAACxC;QAAuBK,cAAcA;QAAcE,UAAUA;;AAM1E,EAAC"}
@@ -1,7 +1,7 @@
1
1
  import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
2
2
  import * as React from 'react';
3
3
  import type { SanitizedClientEditorConfig } from '../types.js';
4
- interface ContextType {
4
+ export interface EditorConfigContextType {
5
5
  editorConfig: SanitizedClientEditorConfig;
6
6
  field: FormFieldBase & {
7
7
  editorConfig: SanitizedClientEditorConfig;
@@ -19,6 +19,5 @@ export declare const EditorConfigProvider: ({ children, editorConfig, fieldProps
19
19
  richTextComponentMap: Map<string, React.ReactNode>;
20
20
  };
21
21
  }) => React.ReactNode;
22
- export declare const useEditorConfigContext: () => ContextType;
23
- export {};
22
+ export declare const useEditorConfigContext: () => EditorConfigContextType;
24
23
  //# sourceMappingURL=EditorConfigProvider.d.ts.map