@payloadcms/richtext-lexical 3.0.0-beta.4 → 3.0.0-beta.40

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 (837) hide show
  1. package/dist/cell/index.d.ts +5 -2
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +44 -29
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/exports/components.d.ts +7 -2
  6. package/dist/exports/components.d.ts.map +1 -1
  7. package/dist/exports/components.js +7 -2
  8. package/dist/exports/components.js.map +1 -1
  9. package/dist/field/Field.d.ts +0 -2
  10. package/dist/field/Field.d.ts.map +1 -1
  11. package/dist/field/Field.js +66 -47
  12. package/dist/field/Field.js.map +1 -1
  13. package/dist/field/features/align/feature.client.d.ts +4 -1
  14. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  15. package/dist/field/features/align/feature.client.js +135 -54
  16. package/dist/field/features/align/feature.client.js.map +1 -1
  17. package/dist/field/features/align/feature.server.d.ts.map +1 -1
  18. package/dist/field/features/align/feature.server.js +2 -0
  19. package/dist/field/features/align/feature.server.js.map +1 -1
  20. package/dist/field/features/align/i18n.d.ts +3 -0
  21. package/dist/field/features/align/i18n.d.ts.map +1 -0
  22. package/dist/field/features/align/i18n.js +196 -0
  23. package/dist/field/features/align/i18n.js.map +1 -0
  24. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  25. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  26. package/dist/field/features/align/toolbarAlignGroup.js +12 -0
  27. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  28. package/dist/field/features/blockquote/feature.client.d.ts +4 -1
  29. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  30. package/dist/field/features/blockquote/feature.client.js +60 -46
  31. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  32. package/dist/field/features/blockquote/feature.server.d.ts +1 -1
  33. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  34. package/dist/field/features/blockquote/feature.server.js +9 -7
  35. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  36. package/dist/field/features/blockquote/i18n.d.ts +3 -0
  37. package/dist/field/features/blockquote/i18n.d.ts.map +1 -0
  38. package/dist/field/features/blockquote/i18n.js +100 -0
  39. package/dist/field/features/blockquote/i18n.js.map +1 -0
  40. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  41. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  42. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  43. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  44. package/dist/field/features/blocks/component/BlockContent.js +65 -50
  45. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  46. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  47. package/dist/field/features/blocks/component/index.js +60 -17
  48. package/dist/field/features/blocks/component/index.js.map +1 -1
  49. package/dist/field/features/blocks/component/index.scss +0 -4
  50. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  51. package/dist/field/features/blocks/drawer/index.js +4 -5
  52. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  53. package/dist/field/features/blocks/feature.client.d.ts +4 -1
  54. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  55. package/dist/field/features/blocks/feature.client.js +58 -27
  56. package/dist/field/features/blocks/feature.client.js.map +1 -1
  57. package/dist/field/features/blocks/feature.server.d.ts +2 -5
  58. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  59. package/dist/field/features/blocks/feature.server.js +111 -77
  60. package/dist/field/features/blocks/feature.server.js.map +1 -1
  61. package/dist/field/features/blocks/i18n.d.ts +3 -0
  62. package/dist/field/features/blocks/i18n.d.ts.map +1 -0
  63. package/dist/field/features/blocks/i18n.js +100 -0
  64. package/dist/field/features/blocks/i18n.js.map +1 -0
  65. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +2 -4
  66. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  67. package/dist/field/features/blocks/nodes/BlocksNode.js +3 -3
  68. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  69. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  70. package/dist/field/features/blocks/plugin/commands.js +1 -2
  71. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  72. package/dist/field/features/blocks/plugin/index.d.ts +3 -2
  73. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  74. package/dist/field/features/blocks/plugin/index.js +10 -11
  75. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  76. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  77. package/dist/field/features/blocks/populationPromise.js +5 -19
  78. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  79. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  80. package/dist/field/features/blocks/validate.js +22 -36
  81. package/dist/field/features/blocks/validate.js.map +1 -1
  82. package/dist/field/features/converters/html/field/index.d.ts +8 -2
  83. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  84. package/dist/field/features/converters/html/field/index.js +36 -5
  85. package/dist/field/features/converters/html/field/index.js.map +1 -1
  86. package/dist/field/features/createFeaturePropComponent.d.ts.map +1 -1
  87. package/dist/field/features/createFeaturePropComponent.js +6 -1
  88. package/dist/field/features/createFeaturePropComponent.js.map +1 -1
  89. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.d.ts +4 -1
  90. package/dist/field/features/debug/testRecorder/feature.client.d.ts.map +1 -0
  91. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js.map +1 -1
  92. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts.map +1 -1
  93. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js +1 -1
  94. package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.js.map +1 -1
  95. package/dist/field/features/debug/testRecorder/plugin/index.d.ts +5 -0
  96. package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -0
  97. package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.js +68 -44
  98. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -0
  99. package/dist/field/features/debug/{treeview → treeView}/feature.client.d.ts +4 -1
  100. package/dist/field/features/debug/treeView/feature.client.d.ts.map +1 -0
  101. package/dist/field/features/debug/{treeview → treeView}/feature.client.js.map +1 -1
  102. package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts.map +1 -1
  103. package/dist/field/features/debug/{treeview → treeView}/feature.server.js +1 -1
  104. package/dist/field/features/debug/{treeview → treeView}/feature.server.js.map +1 -1
  105. package/dist/field/features/debug/treeView/plugin/index.d.ts +4 -0
  106. package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -0
  107. package/dist/field/features/debug/{treeview → treeView}/plugin/index.js +6 -7
  108. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -0
  109. package/dist/field/features/format/bold/feature.client.d.ts +4 -1
  110. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  111. package/dist/field/features/format/bold/feature.client.js +26 -23
  112. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  113. package/dist/field/features/format/{inlinecode → inlineCode}/feature.client.d.ts +4 -1
  114. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -0
  115. package/dist/field/features/format/inlineCode/feature.client.js +46 -0
  116. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -0
  117. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts.map +1 -1
  118. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js +1 -1
  119. package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.js.map +1 -1
  120. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts.map +1 -1
  121. package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js.map +1 -1
  122. package/dist/field/features/format/italic/feature.client.d.ts +4 -1
  123. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  124. package/dist/field/features/format/italic/feature.client.js +27 -24
  125. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  126. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  127. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  128. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  129. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  130. package/dist/field/features/format/strikethrough/feature.client.d.ts +4 -1
  131. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  132. package/dist/field/features/format/strikethrough/feature.client.js +27 -24
  133. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  134. package/dist/field/features/format/subscript/feature.client.d.ts +4 -1
  135. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  136. package/dist/field/features/format/subscript/feature.client.js +25 -22
  137. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  138. package/dist/field/features/format/superscript/feature.client.d.ts +4 -1
  139. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  140. package/dist/field/features/format/superscript/feature.client.js +25 -22
  141. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  142. package/dist/field/features/format/underline/feature.client.d.ts +4 -1
  143. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  144. package/dist/field/features/format/underline/feature.client.js +25 -22
  145. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  146. package/dist/field/features/heading/feature.client.d.ts +4 -1
  147. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  148. package/dist/field/features/heading/feature.client.js +76 -54
  149. package/dist/field/features/heading/feature.client.js.map +1 -1
  150. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  151. package/dist/field/features/heading/feature.server.js +7 -5
  152. package/dist/field/features/heading/feature.server.js.map +1 -1
  153. package/dist/field/features/heading/i18n.d.ts +3 -0
  154. package/dist/field/features/heading/i18n.d.ts.map +1 -0
  155. package/dist/field/features/heading/i18n.js +100 -0
  156. package/dist/field/features/heading/i18n.js.map +1 -0
  157. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  158. package/dist/field/features/heading/markdownTransformer.js +1 -2
  159. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  160. package/dist/field/features/horizontalRule/component/index.d.ts +10 -0
  161. package/dist/field/features/horizontalRule/component/index.d.ts.map +1 -0
  162. package/dist/field/features/horizontalRule/component/index.js +62 -0
  163. package/dist/field/features/horizontalRule/component/index.js.map +1 -0
  164. package/dist/field/features/horizontalRule/feature.client.d.ts +6 -0
  165. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -0
  166. package/dist/field/features/horizontalRule/feature.client.js +77 -0
  167. package/dist/field/features/horizontalRule/feature.client.js.map +1 -0
  168. package/dist/field/features/horizontalRule/feature.server.d.ts +3 -0
  169. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -0
  170. package/dist/field/features/horizontalRule/feature.server.js +38 -0
  171. package/dist/field/features/horizontalRule/feature.server.js.map +1 -0
  172. package/dist/field/features/horizontalRule/i18n.d.ts +3 -0
  173. package/dist/field/features/horizontalRule/i18n.d.ts.map +1 -0
  174. package/dist/field/features/horizontalRule/i18n.js +100 -0
  175. package/dist/field/features/horizontalRule/i18n.js.map +1 -0
  176. package/dist/field/features/horizontalRule/markdownTransformer.d.ts +3 -0
  177. package/dist/field/features/horizontalRule/markdownTransformer.d.ts.map +1 -0
  178. package/dist/field/features/horizontalRule/markdownTransformer.js +23 -0
  179. package/dist/field/features/horizontalRule/markdownTransformer.js.map +1 -0
  180. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts +53 -0
  181. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  182. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +89 -0
  183. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -0
  184. package/dist/field/features/horizontalRule/plugin/index.d.ts +7 -0
  185. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -0
  186. package/dist/field/features/horizontalRule/plugin/index.js +31 -0
  187. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -0
  188. package/dist/field/features/horizontalRule/plugin/index.scss +20 -0
  189. package/dist/field/features/indent/feature.client.d.ts +4 -1
  190. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  191. package/dist/field/features/indent/feature.client.js +47 -42
  192. package/dist/field/features/indent/feature.client.js.map +1 -1
  193. package/dist/field/features/indent/feature.server.d.ts.map +1 -1
  194. package/dist/field/features/indent/feature.server.js +2 -0
  195. package/dist/field/features/indent/feature.server.js.map +1 -1
  196. package/dist/field/features/indent/i18n.d.ts +3 -0
  197. package/dist/field/features/indent/i18n.d.ts.map +1 -0
  198. package/dist/field/features/indent/i18n.js +132 -0
  199. package/dist/field/features/indent/i18n.js.map +1 -0
  200. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  201. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  202. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  203. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  204. package/dist/field/features/link/drawer/baseFields.d.ts +2 -2
  205. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  206. package/dist/field/features/link/drawer/baseFields.js +30 -43
  207. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  208. package/dist/field/features/link/drawer/index.js +30 -21
  209. package/dist/field/features/link/drawer/index.js.map +1 -1
  210. package/dist/field/features/link/drawer/types.d.ts +4 -2
  211. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  212. package/dist/field/features/link/drawer/types.js.map +1 -1
  213. package/dist/field/features/link/feature.client.d.ts +13 -1
  214. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  215. package/dist/field/features/link/feature.client.js +65 -47
  216. package/dist/field/features/link/feature.client.js.map +1 -1
  217. package/dist/field/features/link/feature.server.d.ts +10 -5
  218. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  219. package/dist/field/features/link/feature.server.js +58 -11
  220. package/dist/field/features/link/feature.server.js.map +1 -1
  221. package/dist/field/features/link/i18n.d.ts +3 -0
  222. package/dist/field/features/link/i18n.d.ts.map +1 -0
  223. package/dist/field/features/link/i18n.js +100 -0
  224. package/dist/field/features/link/i18n.js.map +1 -0
  225. package/dist/field/features/link/markdownTransformer.d.ts +6 -0
  226. package/dist/field/features/link/markdownTransformer.d.ts.map +1 -0
  227. package/dist/field/features/link/markdownTransformer.js +50 -0
  228. package/dist/field/features/link/markdownTransformer.js.map +1 -0
  229. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  230. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  231. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  232. package/dist/field/features/link/nodes/LinkNode.d.ts +4 -4
  233. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  234. package/dist/field/features/link/nodes/LinkNode.js +6 -7
  235. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  236. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  237. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  238. package/dist/field/features/link/plugins/autoLink/index.js +11 -12
  239. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  240. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  241. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  242. package/dist/field/features/link/plugins/clickableLink/index.js +4 -3
  243. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  244. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  245. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  246. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  247. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  248. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +177 -135
  249. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  250. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  251. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  252. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -1
  253. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  254. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +11 -3
  255. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +1 -3
  256. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  257. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +12 -30
  258. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  259. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  260. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  261. package/dist/field/features/link/plugins/link/index.js +5 -14
  262. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  263. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  264. package/dist/field/features/link/populationPromise.js +11 -26
  265. package/dist/field/features/link/populationPromise.js.map +1 -1
  266. package/dist/field/features/link/validate.d.ts +5 -0
  267. package/dist/field/features/link/validate.d.ts.map +1 -0
  268. package/dist/field/features/link/validate.js +32 -0
  269. package/dist/field/features/link/validate.js.map +1 -0
  270. package/dist/field/features/lists/checklist/feature.client.d.ts +4 -1
  271. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  272. package/dist/field/features/lists/checklist/feature.client.js +69 -44
  273. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  274. package/dist/field/features/lists/checklist/feature.server.d.ts +1 -1
  275. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  276. package/dist/field/features/lists/checklist/feature.server.js +12 -10
  277. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  278. package/dist/field/features/lists/checklist/i18n.d.ts +3 -0
  279. package/dist/field/features/lists/checklist/i18n.d.ts.map +1 -0
  280. package/dist/field/features/lists/checklist/i18n.js +100 -0
  281. package/dist/field/features/lists/checklist/i18n.js.map +1 -0
  282. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  283. package/dist/field/features/lists/checklist/markdownTransformers.js +2 -3
  284. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  285. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  286. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  287. package/dist/field/features/lists/checklist/plugin/index.js +5 -5
  288. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  289. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  290. package/dist/field/features/lists/htmlConverter.js +13 -6
  291. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  292. package/dist/field/features/lists/{orderedlist → orderedList}/feature.client.d.ts +4 -1
  293. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -0
  294. package/dist/field/features/lists/orderedList/feature.client.js +97 -0
  295. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -0
  296. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -0
  297. package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.js +10 -8
  298. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -0
  299. package/dist/field/features/lists/orderedList/i18n.d.ts +3 -0
  300. package/dist/field/features/lists/orderedList/i18n.d.ts.map +1 -0
  301. package/dist/field/features/lists/orderedList/i18n.js +100 -0
  302. package/dist/field/features/lists/orderedList/i18n.js.map +1 -0
  303. package/dist/field/features/lists/orderedList/markdownTransformer.d.ts.map +1 -0
  304. package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.js +2 -3
  305. package/dist/field/features/lists/orderedList/markdownTransformer.js.map +1 -0
  306. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  307. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  308. package/dist/field/features/lists/plugin/index.js +5 -5
  309. package/dist/field/features/lists/plugin/index.js.map +1 -1
  310. package/dist/field/features/lists/{common → shared}/markdown.d.ts.map +1 -1
  311. package/dist/field/features/lists/{common → shared}/markdown.js +1 -2
  312. package/dist/field/features/lists/shared/markdown.js.map +1 -0
  313. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts +3 -0
  314. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts.map +1 -0
  315. package/dist/field/features/lists/shared/slashMenuListGroup.js +11 -0
  316. package/dist/field/features/lists/shared/slashMenuListGroup.js.map +1 -0
  317. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.client.d.ts +4 -1
  318. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -0
  319. package/dist/field/features/lists/unorderedList/feature.client.js +97 -0
  320. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -0
  321. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -0
  322. package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.js +9 -7
  323. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -0
  324. package/dist/field/features/lists/unorderedList/i18n.d.ts +3 -0
  325. package/dist/field/features/lists/unorderedList/i18n.d.ts.map +1 -0
  326. package/dist/field/features/lists/unorderedList/i18n.js +100 -0
  327. package/dist/field/features/lists/unorderedList/i18n.js.map +1 -0
  328. package/dist/field/features/lists/unorderedList/markdownTransformer.d.ts.map +1 -0
  329. package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.js +2 -3
  330. package/dist/field/features/lists/unorderedList/markdownTransformer.js.map +1 -0
  331. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  332. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  333. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  334. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts +4 -1
  335. package/dist/field/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
  336. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  337. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  338. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +2 -4
  339. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  340. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +4 -5
  341. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  342. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  343. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  344. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  345. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  346. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  347. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  348. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  349. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  350. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  351. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  352. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  353. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  354. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  355. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  356. package/dist/field/features/migrations/slateToLexical/feature.client.d.ts +4 -1
  357. package/dist/field/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
  358. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  359. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  360. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +2 -4
  361. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  362. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +4 -5
  363. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  364. package/dist/field/features/paragraph/feature.client.d.ts +4 -1
  365. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  366. package/dist/field/features/paragraph/feature.client.js +54 -41
  367. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  368. package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
  369. package/dist/field/features/paragraph/feature.server.js +2 -0
  370. package/dist/field/features/paragraph/feature.server.js.map +1 -1
  371. package/dist/field/features/paragraph/i18n.d.ts +3 -0
  372. package/dist/field/features/paragraph/i18n.d.ts.map +1 -0
  373. package/dist/field/features/paragraph/i18n.js +132 -0
  374. package/dist/field/features/paragraph/i18n.js.map +1 -0
  375. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  376. package/dist/field/features/relationship/drawer/commands.js +1 -2
  377. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  378. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  379. package/dist/field/features/relationship/drawer/index.js +17 -15
  380. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  381. package/dist/field/features/relationship/feature.client.d.ts +17 -2
  382. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  383. package/dist/field/features/relationship/feature.client.js +51 -28
  384. package/dist/field/features/relationship/feature.client.js.map +1 -1
  385. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  386. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  387. package/dist/field/features/relationship/feature.server.js +7 -4
  388. package/dist/field/features/relationship/feature.server.js.map +1 -1
  389. package/dist/field/features/relationship/i18n.d.ts +3 -0
  390. package/dist/field/features/relationship/i18n.d.ts.map +1 -0
  391. package/dist/field/features/relationship/i18n.js +100 -0
  392. package/dist/field/features/relationship/i18n.js.map +1 -0
  393. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +4 -9
  394. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  395. package/dist/field/features/relationship/nodes/RelationshipNode.js +12 -11
  396. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  397. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  398. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +119 -50
  399. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  400. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  401. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  402. package/dist/field/features/relationship/plugins/index.js +14 -15
  403. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  404. package/dist/field/features/relationship/populationPromise.d.ts +2 -1
  405. package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
  406. package/dist/field/features/relationship/populationPromise.js +25 -19
  407. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  408. package/dist/field/features/shared/slashMenu/basicGroup.d.ts +3 -0
  409. package/dist/field/features/shared/slashMenu/basicGroup.d.ts.map +1 -0
  410. package/dist/field/features/shared/slashMenu/basicGroup.js +11 -0
  411. package/dist/field/features/shared/slashMenu/basicGroup.js.map +1 -0
  412. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  413. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  414. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  415. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  416. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  417. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  418. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  419. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  420. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  421. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  422. package/dist/field/features/shared/toolbar/textDropdownGroup.js +12 -0
  423. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  424. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +5 -0
  425. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  426. package/dist/field/features/toolbars/fixed/Toolbar/index.js +211 -0
  427. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  428. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +119 -0
  429. package/dist/field/features/toolbars/fixed/feature.client.d.ts +7 -0
  430. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  431. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  432. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  433. package/dist/field/features/toolbars/fixed/feature.server.d.ts +19 -0
  434. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  435. package/dist/field/features/toolbars/fixed/feature.server.js +20 -0
  436. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  437. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  438. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  439. package/dist/field/features/toolbars/inline/Toolbar/index.js +320 -0
  440. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  441. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/inline/Toolbar}/index.scss +7 -11
  442. package/dist/field/features/toolbars/inline/feature.client.d.ts +6 -0
  443. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  444. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  445. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  446. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  447. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  448. package/dist/field/features/toolbars/inline/feature.server.js +15 -0
  449. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  450. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  451. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  452. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.js +34 -22
  453. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  454. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
  455. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
  456. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  457. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/DropDown.js +74 -100
  458. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  459. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  460. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  461. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +142 -0
  462. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  463. package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
  464. package/dist/field/features/toolbars/types.d.ts +48 -0
  465. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  466. package/dist/field/features/toolbars/types.js.map +1 -0
  467. package/dist/field/features/typeUtilities.d.ts +8 -0
  468. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  469. package/dist/field/features/typeUtilities.js +8 -0
  470. package/dist/field/features/typeUtilities.js.map +1 -0
  471. package/dist/field/features/types.d.ts +172 -63
  472. package/dist/field/features/types.d.ts.map +1 -1
  473. package/dist/field/features/types.js.map +1 -1
  474. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  475. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +32 -25
  476. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  477. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  478. package/dist/field/features/upload/component/index.js +159 -76
  479. package/dist/field/features/upload/component/index.js.map +1 -1
  480. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  481. package/dist/field/features/upload/drawer/commands.js +1 -2
  482. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  483. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  484. package/dist/field/features/upload/drawer/index.js +16 -16
  485. package/dist/field/features/upload/drawer/index.js.map +1 -1
  486. package/dist/field/features/upload/feature.client.d.ts +4 -1
  487. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  488. package/dist/field/features/upload/feature.client.js +52 -26
  489. package/dist/field/features/upload/feature.client.js.map +1 -1
  490. package/dist/field/features/upload/feature.server.d.ts +10 -3
  491. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  492. package/dist/field/features/upload/feature.server.js +41 -11
  493. package/dist/field/features/upload/feature.server.js.map +1 -1
  494. package/dist/field/features/upload/i18n.d.ts +3 -0
  495. package/dist/field/features/upload/i18n.d.ts.map +1 -0
  496. package/dist/field/features/upload/i18n.js +100 -0
  497. package/dist/field/features/upload/i18n.js.map +1 -0
  498. package/dist/field/features/upload/nodes/UploadNode.d.ts +3 -15
  499. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  500. package/dist/field/features/upload/nodes/UploadNode.js +28 -14
  501. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  502. package/dist/field/features/upload/plugin/index.d.ts +5 -4
  503. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  504. package/dist/field/features/upload/plugin/index.js +16 -19
  505. package/dist/field/features/upload/plugin/index.js.map +1 -1
  506. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  507. package/dist/field/features/upload/populationPromise.js +16 -10
  508. package/dist/field/features/upload/populationPromise.js.map +1 -1
  509. package/dist/field/features/upload/validate.d.ts +2 -1
  510. package/dist/field/features/upload/validate.d.ts.map +1 -1
  511. package/dist/field/features/upload/validate.js +36 -9
  512. package/dist/field/features/upload/validate.js.map +1 -1
  513. package/dist/field/index.d.ts +3 -1
  514. package/dist/field/index.d.ts.map +1 -1
  515. package/dist/field/index.js +39 -26
  516. package/dist/field/index.js.map +1 -1
  517. package/dist/field/index.scss +1 -22
  518. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  519. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  520. package/dist/field/lexical/EditorPlugin.js +8 -4
  521. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  522. package/dist/field/lexical/LexicalEditor.d.ts +3 -1
  523. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  524. package/dist/field/lexical/LexicalEditor.js +157 -74
  525. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  526. package/dist/field/lexical/LexicalEditor.scss +13 -20
  527. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  528. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  529. package/dist/field/lexical/LexicalProvider.js +52 -41
  530. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  531. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +15 -4
  532. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  533. package/dist/field/lexical/config/client/EditorConfigProvider.js +61 -11
  534. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  535. package/dist/field/lexical/config/client/default.d.ts +1 -1
  536. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  537. package/dist/field/lexical/config/client/default.js.map +1 -1
  538. package/dist/field/lexical/config/client/sanitize.d.ts +3 -2
  539. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  540. package/dist/field/lexical/config/client/sanitize.js +83 -33
  541. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  542. package/dist/field/lexical/config/server/default.d.ts +2 -3
  543. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  544. package/dist/field/lexical/config/server/default.js +12 -10
  545. package/dist/field/lexical/config/server/default.js.map +1 -1
  546. package/dist/field/lexical/config/server/loader.d.ts +5 -2
  547. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  548. package/dist/field/lexical/config/server/loader.js +4 -2
  549. package/dist/field/lexical/config/server/loader.js.map +1 -1
  550. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  551. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  552. package/dist/field/lexical/config/server/sanitize.js +32 -6
  553. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  554. package/dist/field/lexical/config/types.d.ts +3 -1
  555. package/dist/field/lexical/config/types.d.ts.map +1 -1
  556. package/dist/field/lexical/config/types.js.map +1 -1
  557. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  558. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +3 -3
  559. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  560. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +10 -10
  561. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  562. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +74 -77
  563. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  564. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +5 -5
  565. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  566. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +8 -10
  567. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  568. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +19 -27
  569. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  570. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js +1 -37
  571. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  572. package/dist/field/lexical/plugins/SlashMenu/index.d.ts +2 -2
  573. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  574. package/dist/field/lexical/plugins/SlashMenu/index.js +108 -92
  575. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  576. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  577. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  578. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +47 -125
  579. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  580. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +2 -2
  581. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  582. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  583. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  584. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  585. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  586. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +116 -66
  587. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  588. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +20 -3
  589. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  590. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  591. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +83 -16
  592. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  593. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  594. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  595. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  596. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  597. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
  598. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
  599. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
  600. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
  601. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +5 -1
  602. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  603. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +5 -18
  604. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  605. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  606. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  607. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  608. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
  609. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  610. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +19 -7
  611. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  612. package/dist/field/lexical/theme/EditorTheme.scss +18 -14
  613. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  614. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  615. package/dist/field/lexical/ui/ContentEditable.js +3 -3
  616. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  617. package/dist/field/lexical/ui/ContentEditable.scss +55 -4
  618. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  619. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  620. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  621. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  622. package/dist/field/lexical/ui/icons/Add/index.js +21 -0
  623. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  624. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  625. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  626. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  627. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  628. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  629. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  630. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  631. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  632. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  633. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  634. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  635. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  636. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  637. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  638. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  639. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  640. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  641. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  642. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  643. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  644. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  645. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  646. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  647. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  648. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  649. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  650. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  651. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  652. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  653. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  654. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  655. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  656. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  657. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  658. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
  659. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
  660. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +21 -0
  661. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
  662. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  663. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  664. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  665. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  666. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  667. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  668. package/dist/field/lexical/ui/icons/Link/index.d.ts.map +1 -1
  669. package/dist/field/lexical/ui/icons/Link/index.js +10 -18
  670. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  671. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  672. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  673. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  674. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  675. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  676. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  677. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  678. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  679. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  680. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  681. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  682. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  683. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  684. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  685. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  686. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  687. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  688. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  689. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  690. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  691. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  692. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  693. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  694. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  695. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  696. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  697. package/dist/field/lexical/utils/setFloatingElemPosition.js +16 -13
  698. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  699. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  700. package/dist/field/lexical/utils/url.js +13 -2
  701. package/dist/field/lexical/utils/url.js.map +1 -1
  702. package/dist/forEachNodeRecursively.d.ts +10 -0
  703. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  704. package/dist/forEachNodeRecursively.js +24 -0
  705. package/dist/forEachNodeRecursively.js.map +1 -0
  706. package/dist/generateComponentMap.d.ts.map +1 -1
  707. package/dist/generateComponentMap.js +21 -29
  708. package/dist/generateComponentMap.js.map +1 -1
  709. package/dist/generateSchemaMap.d.ts.map +1 -1
  710. package/dist/generateSchemaMap.js +4 -12
  711. package/dist/generateSchemaMap.js.map +1 -1
  712. package/dist/i18n.d.ts +3 -0
  713. package/dist/i18n.d.ts.map +1 -0
  714. package/dist/i18n.js +164 -0
  715. package/dist/i18n.js.map +1 -0
  716. package/dist/index.d.ts +25 -21
  717. package/dist/index.d.ts.map +1 -1
  718. package/dist/index.js +296 -183
  719. package/dist/index.js.map +1 -1
  720. package/dist/populate/defaultValue.d.ts +0 -1
  721. package/dist/populate/defaultValue.d.ts.map +1 -1
  722. package/dist/populate/defaultValue.js +1 -19
  723. package/dist/populate/defaultValue.js.map +1 -1
  724. package/dist/populate/populate.d.ts +5 -4
  725. package/dist/populate/populate.d.ts.map +1 -1
  726. package/dist/populate/populate.js +13 -11
  727. package/dist/populate/populate.js.map +1 -1
  728. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  729. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  730. package/dist/populate/populateLexicalPopulationPromises.js +36 -0
  731. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  732. package/dist/populate/recurseNestedFields.d.ts +8 -4
  733. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  734. package/dist/populate/recurseNestedFields.js +4 -5
  735. package/dist/populate/recurseNestedFields.js.map +1 -1
  736. package/dist/scss/app.scss +2 -3
  737. package/dist/scss/vars.scss +0 -7
  738. package/dist/types.d.ts +45 -6
  739. package/dist/types.d.ts.map +1 -1
  740. package/dist/types.js.map +1 -1
  741. package/dist/useLexicalFeature.d.ts.map +1 -1
  742. package/dist/useLexicalFeature.js +6 -1
  743. package/dist/useLexicalFeature.js.map +1 -1
  744. package/dist/validate/index.d.ts +1 -1
  745. package/dist/validate/index.d.ts.map +1 -1
  746. package/dist/validate/index.js +3 -2
  747. package/dist/validate/index.js.map +1 -1
  748. package/dist/validate/validateNodes.js +1 -1
  749. package/dist/validate/validateNodes.js.map +1 -1
  750. package/package.json +70 -50
  751. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts +0 -3
  752. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.d.ts.map +0 -1
  753. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js +0 -12
  754. package/dist/field/features/align/floatingSelectToolbarAlignDropdownSection.js.map +0 -1
  755. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts +0 -3
  756. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.d.ts.map +0 -1
  757. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js +0 -10
  758. package/dist/field/features/common/floatingSelectToolbarFeaturesButtonsSection/index.js.map +0 -1
  759. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts +0 -3
  760. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.d.ts.map +0 -1
  761. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js +0 -12
  762. package/dist/field/features/common/floatingSelectToolbarTextDropdownSection/index.js.map +0 -1
  763. package/dist/field/features/debug/testrecorder/feature.client.d.ts.map +0 -1
  764. package/dist/field/features/debug/testrecorder/plugin/index.d.ts +0 -5
  765. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +0 -1
  766. package/dist/field/features/debug/testrecorder/plugin/index.js.map +0 -1
  767. package/dist/field/features/debug/treeview/feature.client.d.ts.map +0 -1
  768. package/dist/field/features/debug/treeview/plugin/index.d.ts +0 -4
  769. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +0 -1
  770. package/dist/field/features/debug/treeview/plugin/index.js.map +0 -1
  771. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts +0 -3
  772. package/dist/field/features/format/common/floatingSelectToolbarSection.d.ts.map +0 -1
  773. package/dist/field/features/format/common/floatingSelectToolbarSection.js +0 -10
  774. package/dist/field/features/format/common/floatingSelectToolbarSection.js.map +0 -1
  775. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +0 -1
  776. package/dist/field/features/format/inlinecode/feature.client.js +0 -43
  777. package/dist/field/features/format/inlinecode/feature.client.js.map +0 -1
  778. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts +0 -3
  779. package/dist/field/features/indent/floatingSelectToolbarIndentSection.d.ts.map +0 -1
  780. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js +0 -10
  781. package/dist/field/features/indent/floatingSelectToolbarIndentSection.js.map +0 -1
  782. package/dist/field/features/indent/index.scss +0 -4
  783. package/dist/field/features/lists/common/markdown.js.map +0 -1
  784. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +0 -1
  785. package/dist/field/features/lists/orderedlist/feature.client.js +0 -72
  786. package/dist/field/features/lists/orderedlist/feature.client.js.map +0 -1
  787. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +0 -1
  788. package/dist/field/features/lists/orderedlist/feature.server.js.map +0 -1
  789. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +0 -1
  790. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +0 -1
  791. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +0 -1
  792. package/dist/field/features/lists/unorderedlist/feature.client.js +0 -72
  793. package/dist/field/features/lists/unorderedlist/feature.client.js.map +0 -1
  794. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +0 -1
  795. package/dist/field/features/lists/unorderedlist/feature.server.js.map +0 -1
  796. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +0 -1
  797. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +0 -1
  798. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts +0 -8
  799. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +0 -1
  800. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +0 -1
  801. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts +0 -17
  802. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +0 -1
  803. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +0 -1
  804. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts +0 -18
  805. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.d.ts.map +0 -1
  806. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js +0 -42
  807. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/index.js.map +0 -1
  808. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts +0 -6
  809. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +0 -1
  810. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +0 -270
  811. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +0 -1
  812. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts +0 -40
  813. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.d.ts.map +0 -1
  814. package/dist/field/lexical/plugins/FloatingSelectToolbar/types.js.map +0 -1
  815. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  816. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
  817. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  818. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  819. package/dist/populate/richTextRelationshipPromise.js +0 -68
  820. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  821. package/dist/scss/fonts.scss +0 -75
  822. package/src/index.ts +0 -423
  823. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.client.js +0 -0
  824. /package/dist/field/features/debug/{testrecorder → testRecorder}/feature.server.d.ts +0 -0
  825. /package/dist/field/features/debug/{testrecorder → testRecorder}/plugin/index.scss +0 -0
  826. /package/dist/field/features/debug/{treeview → treeView}/feature.client.js +0 -0
  827. /package/dist/field/features/debug/{treeview → treeView}/feature.server.d.ts +0 -0
  828. /package/dist/field/features/debug/{treeview → treeView}/plugin/index.scss +0 -0
  829. /package/dist/field/features/format/{inlinecode → inlineCode}/feature.server.d.ts +0 -0
  830. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.d.ts +0 -0
  831. /package/dist/field/features/format/{inlinecode → inlineCode}/markdownTransformers.js +0 -0
  832. /package/dist/field/features/lists/{orderedlist → orderedList}/feature.server.d.ts +0 -0
  833. /package/dist/field/features/lists/{orderedlist → orderedList}/markdownTransformer.d.ts +0 -0
  834. /package/dist/field/features/lists/{common → shared}/markdown.d.ts +0 -0
  835. /package/dist/field/features/lists/{unorderedlist → unorderedList}/feature.server.d.ts +0 -0
  836. /package/dist/field/features/lists/{unorderedlist → unorderedList}/markdownTransformer.d.ts +0 -0
  837. /package/dist/field/{lexical/plugins/FloatingSelectToolbar → features/toolbars}/types.js +0 -0
@@ -1,6 +1,8 @@
1
1
  'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
3
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
2
4
  import * as React from 'react';
3
- import { createContext, useContext, useEffect, useMemo, useState } from 'react';
5
+ import { createContext, useContext, useMemo, useRef, useState } from 'react';
4
6
  // Should always produce a 20 character pseudo-random string
5
7
  function generateQuickGuid() {
6
8
  return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12);
@@ -8,27 +10,75 @@ function generateQuickGuid() {
8
10
  const Context = /*#__PURE__*/ createContext({
9
11
  editorConfig: null,
10
12
  field: null,
11
- uuid: generateQuickGuid()
13
+ uuid: null
12
14
  });
13
- export const EditorConfigProvider = ({ children, editorConfig, fieldProps })=>{
15
+ export const EditorConfigProvider = ({ children, editorConfig, editorContainerRef, fieldProps, parentContext })=>{
16
+ const [editor] = useLexicalComposerContext();
14
17
  // State to store the UUID
15
- const [uuid, setUuid] = useState(generateQuickGuid());
16
- // When the component mounts, generate a new UUID only once
17
- useEffect(()=>{
18
- setUuid(generateQuickGuid());
19
- }, []);
18
+ const [uuid] = useState(generateQuickGuid());
19
+ const childrenEditors = useRef(new Map());
20
+ const [focusedEditor, setFocusedEditor] = useState(null);
21
+ const focusHistory = useRef(new Set());
20
22
  const editorContext = useMemo(()=>({
23
+ blurEditor: (editorContext)=>{
24
+ //setFocusedEditor(null) // Clear focused editor
25
+ focusHistory.current.clear() // Reset focus history when focus is lost
26
+ ;
27
+ },
28
+ childrenEditors,
29
+ editor,
21
30
  editorConfig,
31
+ editorContainerRef,
22
32
  field: fieldProps,
33
+ focusEditor: (editorContext)=>{
34
+ const editorUUID = editorContext.uuid;
35
+ // Avoid recursion by checking if this editor is already focused in this cycle
36
+ if (focusHistory.current.has(editorUUID)) {
37
+ return;
38
+ }
39
+ // Add this editor to the history to prevent future recursions in this cycle
40
+ focusHistory.current.add(editorUUID);
41
+ setFocusedEditor(editorContext);
42
+ // Propagate focus event to parent and children, ensuring they do not refocus this editor
43
+ if (parentContext?.uuid) {
44
+ parentContext.focusEditor(editorContext);
45
+ }
46
+ childrenEditors.current.forEach((childEditor, childUUID)=>{
47
+ childEditor.focusEditor(editorContext);
48
+ });
49
+ focusHistory.current.clear();
50
+ },
51
+ focusedEditor,
52
+ parentEditor: parentContext,
53
+ registerChild: (childUUID, childEditorContext)=>{
54
+ if (!childrenEditors.current.has(childUUID)) {
55
+ const newMap = new Map(childrenEditors.current);
56
+ newMap.set(childUUID, childEditorContext);
57
+ childrenEditors.current = newMap;
58
+ }
59
+ },
60
+ unregisterChild: (childUUID)=>{
61
+ if (childrenEditors.current.has(childUUID)) {
62
+ const newMap = new Map(childrenEditors.current);
63
+ newMap.delete(childUUID);
64
+ childrenEditors.current = newMap;
65
+ }
66
+ },
23
67
  uuid
24
68
  }), [
69
+ editor,
70
+ childrenEditors,
25
71
  editorConfig,
72
+ editorContainerRef,
26
73
  fieldProps,
74
+ focusedEditor,
75
+ parentContext,
27
76
  uuid
28
77
  ]);
29
- return /*#__PURE__*/ React.createElement(Context.Provider, {
30
- value: editorContext
31
- }, children);
78
+ return /*#__PURE__*/ _jsx(Context.Provider, {
79
+ value: editorContext,
80
+ children: children
81
+ });
32
82
  };
33
83
  export const useEditorConfigContext = ()=>{
34
84
  const context = useContext(Context);
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/lexical/config/client/EditorConfigProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\n\nimport * as React from 'react'\nimport { createContext, useContext, useEffect, useMemo, useState } from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\n// Should always produce a 20 character pseudo-random string\nfunction generateQuickGuid(): string {\n return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12)\n}\ninterface ContextType {\n editorConfig: SanitizedClientEditorConfig\n field: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n uuid: string\n}\n\nconst Context: React.Context<ContextType> = createContext({\n editorConfig: null,\n field: null,\n uuid: generateQuickGuid(),\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n fieldProps,\n}: {\n children: React.ReactNode\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}): React.ReactNode => {\n // State to store the UUID\n const [uuid, setUuid] = useState(generateQuickGuid())\n\n // When the component mounts, generate a new UUID only once\n useEffect(() => {\n setUuid(generateQuickGuid())\n }, [])\n\n const editorContext = useMemo(\n () => ({ editorConfig, field: fieldProps, uuid }),\n [editorConfig, fieldProps, uuid],\n )\n\n return <Context.Provider value={editorContext}>{children}</Context.Provider>\n}\n\nexport const useEditorConfigContext = (): ContextType => {\n const context = useContext(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProvider')\n }\n return context\n}\n"],"names":["React","createContext","useContext","useEffect","useMemo","useState","generateQuickGuid","Math","random","toString","substring","Context","editorConfig","field","uuid","EditorConfigProvider","children","fieldProps","setUuid","editorContext","Provider","value","useEditorConfigContext","context","undefined","Error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,YAAYA,WAAW,QAAO;AAC9B,SAASC,aAAa,EAAEC,UAAU,EAAEC,SAAS,EAAEC,OAAO,EAAEC,QAAQ,QAAQ,QAAO;AAI/E,4DAA4D;AAC5D,SAASC;IACP,OAAOC,KAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG,MAAMH,KAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG;AAC/F;AAWA,MAAMC,wBAAsCV,cAAc;IACxDW,cAAc;IACdC,OAAO;IACPC,MAAMR;AACR;AAEA,OAAO,MAAMS,uBAAuB,CAAC,EACnCC,QAAQ,EACRJ,YAAY,EACZK,UAAU,EASX;IACC,0BAA0B;IAC1B,MAAM,CAACH,MAAMI,QAAQ,GAAGb,SAASC;IAEjC,2DAA2D;IAC3DH,UAAU;QACRe,QAAQZ;IACV,GAAG,EAAE;IAEL,MAAMa,gBAAgBf,QACpB,IAAO,CAAA;YAAEQ;YAAcC,OAAOI;YAAYH;QAAK,CAAA,GAC/C;QAACF;QAAcK;QAAYH;KAAK;IAGlC,qBAAO,oBAACH,QAAQS,QAAQ;QAACC,OAAOF;OAAgBH;AAClD,EAAC;AAED,OAAO,MAAMM,yBAAyB;IACpC,MAAMC,UAAUrB,WAAWS;IAC3B,IAAIY,YAAYC,WAAW;QACzB,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOF;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/lexical/config/client/EditorConfigProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport * as React from 'react'\nimport { createContext, useContext, useMemo, useRef, useState } from 'react'\n\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\n// Should always produce a 20 character pseudo-random string\nfunction generateQuickGuid(): string {\n return Math.random().toString(36).substring(2, 12) + Math.random().toString(36).substring(2, 12)\n}\n\nexport interface EditorConfigContextType {\n // Editor focus handling\n blurEditor: (editorContext: EditorConfigContextType) => void\n childrenEditors: React.RefObject<Map<string, EditorConfigContextType>>\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n field: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n // Editor focus handling\n focusEditor: (editorContext: EditorConfigContextType) => void\n focusedEditor: EditorConfigContextType | null\n parentEditor: EditorConfigContextType\n registerChild: (uuid: string, editorContext: EditorConfigContextType) => void\n unregisterChild?: (uuid: string) => void\n uuid: string\n}\n\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n field: null,\n uuid: null,\n})\n\nexport const EditorConfigProvider = ({\n children,\n editorConfig,\n editorContainerRef,\n fieldProps,\n parentContext,\n}: {\n children: React.ReactNode\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n fieldProps: FormFieldBase & {\n editorConfig: SanitizedClientEditorConfig // With rendered features n stuff\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n parentContext?: EditorConfigContextType\n}): React.ReactNode => {\n const [editor] = useLexicalComposerContext()\n // State to store the UUID\n const [uuid] = useState(generateQuickGuid())\n\n const childrenEditors = useRef<Map<string, EditorConfigContextType>>(new Map())\n const [focusedEditor, setFocusedEditor] = useState<EditorConfigContextType | null>(null)\n const focusHistory = useRef<Set<string>>(new Set())\n\n const editorContext = useMemo(\n () =>\n ({\n blurEditor: (editorContext: EditorConfigContextType) => {\n //setFocusedEditor(null) // Clear focused editor\n focusHistory.current.clear() // Reset focus history when focus is lost\n },\n childrenEditors,\n editor,\n editorConfig,\n editorContainerRef,\n field: fieldProps,\n focusEditor: (editorContext: EditorConfigContextType) => {\n const editorUUID = editorContext.uuid\n\n // Avoid recursion by checking if this editor is already focused in this cycle\n if (focusHistory.current.has(editorUUID)) {\n return\n }\n\n // Add this editor to the history to prevent future recursions in this cycle\n focusHistory.current.add(editorUUID)\n setFocusedEditor(editorContext)\n\n // Propagate focus event to parent and children, ensuring they do not refocus this editor\n if (parentContext?.uuid) {\n parentContext.focusEditor(editorContext)\n }\n childrenEditors.current.forEach((childEditor, childUUID) => {\n childEditor.focusEditor(editorContext)\n })\n\n focusHistory.current.clear()\n },\n focusedEditor,\n parentEditor: parentContext,\n registerChild: (childUUID, childEditorContext) => {\n if (!childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.set(childUUID, childEditorContext)\n childrenEditors.current = newMap\n }\n },\n unregisterChild: (childUUID) => {\n if (childrenEditors.current.has(childUUID)) {\n const newMap = new Map(childrenEditors.current)\n newMap.delete(childUUID)\n childrenEditors.current = newMap\n }\n },\n\n uuid,\n }) as EditorConfigContextType,\n [\n editor,\n childrenEditors,\n editorConfig,\n editorContainerRef,\n fieldProps,\n focusedEditor,\n parentContext,\n uuid,\n ],\n )\n\n return <Context.Provider value={editorContext}>{children}</Context.Provider>\n}\n\nexport const useEditorConfigContext = (): EditorConfigContextType => {\n const context = useContext(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProvider')\n }\n return context\n}\n"],"names":["useLexicalComposerContext","React","createContext","useContext","useMemo","useRef","useState","generateQuickGuid","Math","random","toString","substring","Context","editorConfig","field","uuid","EditorConfigProvider","children","editorContainerRef","fieldProps","parentContext","editor","childrenEditors","Map","focusedEditor","setFocusedEditor","focusHistory","Set","editorContext","blurEditor","current","clear","focusEditor","editorUUID","has","add","forEach","childEditor","childUUID","parentEditor","registerChild","childEditorContext","newMap","set","unregisterChild","delete","Provider","value","useEditorConfigContext","context","undefined","Error"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAKA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,YAAYC,WAAW,QAAO;AAC9B,SAASC,aAAa,EAAEC,UAAU,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAI5E,4DAA4D;AAC5D,SAASC;IACP,OAAOC,KAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG,MAAMH,KAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG;AAC/F;AAuBA,MAAMC,wBAAkDV,cAAc;IACp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gBAAgBQ,OAAO,CAACI,GAAG,CAACI,YAAY;oBAC1C,MAAMI,SAAS,IAAInB,IAAID,gBAAgBQ,OAAO;oBAC9CY,OAAOG,MAAM,CAACP;oBACdhB,gBAAgBQ,OAAO,GAAGY;gBAC5B;YACF;YAEA3B;QACF,CAAA,GACF;QACEM;QACAC;QACAT;QACAK;QACAC;QACAK;QACAJ;QACAL;KACD;IAGH,qBAAO,KAACH,QAAQkC,QAAQ;QAACC,OAAOnB;kBAAgBX;;AAClD,EAAC;AAED,OAAO,MAAM+B,yBAAyB;IACpC,MAAMC,UAAU9C,WAAWS;IAC3B,IAAIqC,YAAYC,WAAW;QACzB,MAAM,IAAIC,MAAM;IAClB;IACA,OAAOF;AACT,EAAC"}
@@ -1,3 +1,3 @@
1
- import type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js';
1
+ import type { EditorConfig as LexicalEditorConfig } from 'lexical';
2
2
  export declare const defaultEditorLexicalConfig: LexicalEditorConfig;
3
3
  //# sourceMappingURL=default.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/default.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAInF,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAA"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/default.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAIlE,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/lexical/config/client/default.ts"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js'\n\nimport { LexicalEditorTheme } from '../../theme/EditorTheme.js'\n\nexport const defaultEditorLexicalConfig: LexicalEditorConfig = {\n namespace: 'lexical',\n theme: LexicalEditorTheme,\n}\n"],"names":["LexicalEditorTheme","defaultEditorLexicalConfig","namespace","theme"],"rangeMappings":";;;;;","mappings":"AAAA;AAGA,SAASA,kBAAkB,QAAQ,6BAA4B;AAE/D,OAAO,MAAMC,6BAAkD;IAC7DC,WAAW;IACXC,OAAOH;AACT,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/lexical/config/client/default.ts"],"sourcesContent":["'use client'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { LexicalEditorTheme } from '../../theme/EditorTheme.js'\n\nexport const defaultEditorLexicalConfig: LexicalEditorConfig = {\n namespace: 'lexical',\n theme: LexicalEditorTheme,\n}\n"],"names":["LexicalEditorTheme","defaultEditorLexicalConfig","namespace","theme"],"rangeMappings":";;;;;","mappings":"AAAA;AAGA,SAASA,kBAAkB,QAAQ,6BAA4B;AAE/D,OAAO,MAAMC,6BAAkD;IAC7DC,WAAW;IACXC,OAAOH;AACT,EAAC"}
@@ -1,6 +1,7 @@
1
- import type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js';
1
+ import type { EditorConfig as LexicalEditorConfig } from 'lexical';
2
+ import type { LexicalFieldAdminProps } from '../../../../types.js';
2
3
  import type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/types.js';
3
4
  import type { SanitizedClientEditorConfig } from '../types.js';
4
5
  export declare const sanitizeClientFeatures: (features: ResolvedClientFeatureMap) => SanitizedClientFeatures;
5
- export declare function sanitizeClientEditorConfig(lexical: LexicalEditorConfig, resolvedClientFeatureMap: ResolvedClientFeatureMap): SanitizedClientEditorConfig;
6
+ export declare function sanitizeClientEditorConfig(lexical: LexicalEditorConfig, resolvedClientFeatureMap: ResolvedClientFeatureMap, admin?: LexicalFieldAdminProps): SanitizedClientEditorConfig;
6
7
  //# sourceMappingURL=sanitize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnF,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,0CAEhC,uBA4IF,CAAA;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,mBAAmB,EAC5B,wBAAwB,EAAE,wBAAwB,GACjD,2BAA2B,CAM7B"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAA;AAClE,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,0CAEhC,uBAiMF,CAAA;AAED,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,mBAAmB,EAC5B,wBAAwB,EAAE,wBAAwB,EAClD,KAAK,CAAC,EAAE,sBAAsB,GAC7B,2BAA2B,CAO7B"}
@@ -2,9 +2,6 @@
2
2
  export const sanitizeClientFeatures = (features)=>{
3
3
  const sanitized = {
4
4
  enabledFeatures: [],
5
- floatingSelectToolbar: {
6
- sections: []
7
- },
8
5
  hooks: {
9
6
  load: [],
10
7
  save: []
@@ -13,8 +10,14 @@ export const sanitizeClientFeatures = (features)=>{
13
10
  nodes: [],
14
11
  plugins: [],
15
12
  slashMenu: {
16
- dynamicOptions: [],
17
- groupsWithOptions: []
13
+ dynamicGroups: [],
14
+ groups: []
15
+ },
16
+ toolbarFixed: {
17
+ groups: []
18
+ },
19
+ toolbarInline: {
20
+ groups: []
18
21
  }
19
22
  };
20
23
  if (!features?.size) {
@@ -36,50 +39,70 @@ export const sanitizeClientFeatures = (features)=>{
36
39
  feature.plugins.forEach((plugin, i)=>{
37
40
  sanitized.plugins.push({
38
41
  Component: plugin.Component,
42
+ clientProps: feature.clientFeatureProps,
39
43
  key: feature.key + i,
40
44
  position: plugin.position
41
45
  });
42
46
  });
43
47
  }
44
- if (feature.floatingSelectToolbar?.sections?.length) {
45
- for (const section of feature.floatingSelectToolbar.sections){
46
- // 1. find the section with the same key or create new one
47
- let foundSection = sanitized.floatingSelectToolbar.sections.find((sanitizedSection)=>sanitizedSection.key === section.key);
48
- if (!foundSection) {
49
- foundSection = {
50
- ...section,
51
- entries: []
48
+ if (feature.toolbarInline?.groups?.length) {
49
+ for (const group of feature.toolbarInline.groups){
50
+ // 1. find the group with the same key or create new one
51
+ let foundGroup = sanitized.toolbarInline.groups.find((sanitizedGroup)=>sanitizedGroup.key === group.key);
52
+ if (!foundGroup) {
53
+ foundGroup = {
54
+ ...group,
55
+ items: []
56
+ };
57
+ } else {
58
+ sanitized.toolbarInline.groups = sanitized.toolbarInline.groups.filter((sanitizedGroup)=>sanitizedGroup.key !== group.key);
59
+ }
60
+ // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
61
+ if (group?.items?.length) {
62
+ foundGroup.items = foundGroup.items.concat(group.items);
63
+ }
64
+ sanitized.toolbarInline?.groups.push(foundGroup);
65
+ }
66
+ }
67
+ if (feature.toolbarFixed?.groups?.length) {
68
+ for (const group of feature.toolbarFixed.groups){
69
+ // 1. find the group with the same key or create new one
70
+ let foundGroup = sanitized.toolbarFixed.groups.find((sanitizedGroup)=>sanitizedGroup.key === group.key);
71
+ if (!foundGroup) {
72
+ foundGroup = {
73
+ ...group,
74
+ items: []
52
75
  };
53
76
  } else {
54
- sanitized.floatingSelectToolbar.sections = sanitized.floatingSelectToolbar.sections.filter((sanitizedSection)=>sanitizedSection.key !== section.key);
77
+ sanitized.toolbarFixed.groups = sanitized.toolbarFixed.groups.filter((sanitizedGroup)=>sanitizedGroup.key !== group.key);
55
78
  }
56
79
  // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
57
- if (section?.entries?.length) {
58
- foundSection.entries = foundSection.entries.concat(section.entries);
80
+ if (group?.items?.length) {
81
+ foundGroup.items = foundGroup.items.concat(group.items);
59
82
  }
60
- sanitized.floatingSelectToolbar?.sections.push(foundSection);
83
+ sanitized.toolbarFixed?.groups.push(foundGroup);
61
84
  }
62
85
  }
63
- if (feature.slashMenu?.options) {
64
- if (feature.slashMenu.dynamicOptions?.length) {
65
- sanitized.slashMenu.dynamicOptions = sanitized.slashMenu.dynamicOptions.concat(feature.slashMenu.dynamicOptions);
86
+ if (feature.slashMenu?.groups) {
87
+ if (feature.slashMenu.dynamicGroups?.length) {
88
+ sanitized.slashMenu.dynamicGroups = sanitized.slashMenu.dynamicGroups.concat(feature.slashMenu.dynamicGroups);
66
89
  }
67
- for (const optionGroup of feature.slashMenu.options){
90
+ for (const optionGroup of feature.slashMenu.groups){
68
91
  // 1. find the group with the same name or create new one
69
- let group = sanitized.slashMenu.groupsWithOptions.find((group)=>group.key === optionGroup.key);
92
+ let group = sanitized.slashMenu.groups.find((group)=>group.key === optionGroup.key);
70
93
  if (!group) {
71
94
  group = {
72
95
  ...optionGroup,
73
- options: []
96
+ items: []
74
97
  };
75
98
  } else {
76
- sanitized.slashMenu.groupsWithOptions = sanitized.slashMenu.groupsWithOptions.filter((group)=>group.key !== optionGroup.key);
99
+ sanitized.slashMenu.groups = sanitized.slashMenu.groups.filter((group)=>group.key !== optionGroup.key);
77
100
  }
78
101
  // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions
79
- if (optionGroup?.options?.length) {
80
- group.options = group.options.concat(optionGroup.options);
102
+ if (optionGroup?.items?.length) {
103
+ group.items = group.items.concat(optionGroup.items);
81
104
  }
82
- sanitized.slashMenu.groupsWithOptions.push(group);
105
+ sanitized.slashMenu.groups.push(group);
83
106
  }
84
107
  }
85
108
  if (feature.markdownTransformers?.length) {
@@ -87,8 +110,8 @@ export const sanitizeClientFeatures = (features)=>{
87
110
  }
88
111
  sanitized.enabledFeatures.push(feature.key);
89
112
  });
90
- // Sort sanitized.floatingSelectToolbar.sections by order property
91
- sanitized.floatingSelectToolbar.sections.sort((a, b)=>{
113
+ // Sort sanitized.toolbarInline.groups by order property
114
+ sanitized.toolbarInline.groups.sort((a, b)=>{
92
115
  if (a.order && b.order) {
93
116
  return a.order - b.order;
94
117
  } else if (a.order) {
@@ -99,9 +122,35 @@ export const sanitizeClientFeatures = (features)=>{
99
122
  return 0;
100
123
  }
101
124
  });
102
- // Sort sanitized.floatingSelectToolbar.sections.[section].entries by order property
103
- for (const section of sanitized.floatingSelectToolbar.sections){
104
- section.entries.sort((a, b)=>{
125
+ // Sort sanitized.toolbarFixed.groups by order property
126
+ sanitized.toolbarFixed.groups.sort((a, b)=>{
127
+ if (a.order && b.order) {
128
+ return a.order - b.order;
129
+ } else if (a.order) {
130
+ return -1;
131
+ } else if (b.order) {
132
+ return 1;
133
+ } else {
134
+ return 0;
135
+ }
136
+ });
137
+ // Sort sanitized.toolbarInline.groups.[group].entries by order property
138
+ for (const group of sanitized.toolbarInline.groups){
139
+ group.items.sort((a, b)=>{
140
+ if (a.order && b.order) {
141
+ return a.order - b.order;
142
+ } else if (a.order) {
143
+ return -1;
144
+ } else if (b.order) {
145
+ return 1;
146
+ } else {
147
+ return 0;
148
+ }
149
+ });
150
+ }
151
+ // Sort sanitized.toolbarFixed.groups.[group].entries by order property
152
+ for (const group of sanitized.toolbarFixed.groups){
153
+ group.items.sort((a, b)=>{
105
154
  if (a.order && b.order) {
106
155
  return a.order - b.order;
107
156
  } else if (a.order) {
@@ -115,8 +164,9 @@ export const sanitizeClientFeatures = (features)=>{
115
164
  }
116
165
  return sanitized;
117
166
  };
118
- export function sanitizeClientEditorConfig(lexical, resolvedClientFeatureMap) {
167
+ export function sanitizeClientEditorConfig(lexical, resolvedClientFeatureMap, admin) {
119
168
  return {
169
+ admin,
120
170
  features: sanitizeClientFeatures(resolvedClientFeatureMap),
121
171
  lexical,
122
172
  resolvedFeatureMap: resolvedClientFeatureMap
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js'\n\nimport type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\nexport const sanitizeClientFeatures = (\n features: ResolvedClientFeatureMap,\n): SanitizedClientFeatures => {\n const sanitized: SanitizedClientFeatures = {\n enabledFeatures: [],\n floatingSelectToolbar: {\n sections: [],\n },\n hooks: {\n load: [],\n save: [],\n },\n markdownTransformers: [],\n nodes: [],\n plugins: [],\n slashMenu: {\n dynamicOptions: [],\n groupsWithOptions: [],\n },\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature.hooks) {\n if (feature.hooks?.load?.length) {\n sanitized.hooks.load = sanitized.hooks.load.concat(feature.hooks.load)\n }\n if (feature.hooks?.save?.length) {\n sanitized.hooks.save = sanitized.hooks.save.concat(feature.hooks.save)\n }\n }\n\n if (feature.nodes?.length) {\n sanitized.nodes = sanitized.nodes.concat(feature.nodes)\n }\n if (feature.plugins?.length) {\n feature.plugins.forEach((plugin, i) => {\n sanitized.plugins.push({\n Component: plugin.Component,\n key: feature.key + i,\n position: plugin.position,\n })\n })\n }\n\n if (feature.floatingSelectToolbar?.sections?.length) {\n for (const section of feature.floatingSelectToolbar.sections) {\n // 1. find the section with the same key or create new one\n let foundSection = sanitized.floatingSelectToolbar.sections.find(\n (sanitizedSection) => sanitizedSection.key === section.key,\n )\n if (!foundSection) {\n foundSection = {\n ...section,\n entries: [],\n }\n } else {\n sanitized.floatingSelectToolbar.sections =\n sanitized.floatingSelectToolbar.sections.filter(\n (sanitizedSection) => sanitizedSection.key !== section.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (section?.entries?.length) {\n foundSection.entries = foundSection.entries.concat(section.entries)\n }\n sanitized.floatingSelectToolbar?.sections.push(foundSection)\n }\n }\n\n if (feature.slashMenu?.options) {\n if (feature.slashMenu.dynamicOptions?.length) {\n sanitized.slashMenu.dynamicOptions = sanitized.slashMenu.dynamicOptions.concat(\n feature.slashMenu.dynamicOptions,\n )\n }\n\n for (const optionGroup of feature.slashMenu.options) {\n // 1. find the group with the same name or create new one\n let group = sanitized.slashMenu.groupsWithOptions.find(\n (group) => group.key === optionGroup.key,\n )\n if (!group) {\n group = {\n ...optionGroup,\n options: [],\n }\n } else {\n sanitized.slashMenu.groupsWithOptions = sanitized.slashMenu.groupsWithOptions.filter(\n (group) => group.key !== optionGroup.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (optionGroup?.options?.length) {\n group.options = group.options.concat(optionGroup.options)\n }\n sanitized.slashMenu.groupsWithOptions.push(group)\n }\n }\n\n if (feature.markdownTransformers?.length) {\n sanitized.markdownTransformers = sanitized.markdownTransformers.concat(\n feature.markdownTransformers,\n )\n }\n sanitized.enabledFeatures.push(feature.key)\n })\n\n // Sort sanitized.floatingSelectToolbar.sections by order property\n sanitized.floatingSelectToolbar.sections.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n\n // Sort sanitized.floatingSelectToolbar.sections.[section].entries by order property\n for (const section of sanitized.floatingSelectToolbar.sections) {\n section.entries.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n return sanitized\n}\n\nexport function sanitizeClientEditorConfig(\n lexical: LexicalEditorConfig,\n resolvedClientFeatureMap: ResolvedClientFeatureMap,\n): SanitizedClientEditorConfig {\n return {\n features: sanitizeClientFeatures(resolvedClientFeatureMap),\n lexical,\n resolvedFeatureMap: resolvedClientFeatureMap,\n }\n}\n"],"names":["sanitizeClientFeatures","features","sanitized","enabledFeatures","floatingSelectToolbar","sections","hooks","load","save","markdownTransformers","nodes","plugins","slashMenu","dynamicOptions","groupsWithOptions","size","forEach","feature","length","concat","plugin","i","push","Component","key","position","section","foundSection","find","sanitizedSection","entries","filter","options","optionGroup","group","sort","a","b","order","sanitizeClientEditorConfig","lexical","resolvedClientFeatureMap","resolvedFeatureMap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAOA,OAAO,MAAMA,yBAAyB,CACpCC;IAEA,MAAMC,YAAqC;QACzCC,iBAAiB,EAAE;QACnBC,uBAAuB;YACrBC,UAAU,EAAE;QACd;QACAC,OAAO;YACLC,MAAM,EAAE;YACRC,MAAM,EAAE;QACV;QACAC,sBAAsB,EAAE;QACxBC,OAAO,EAAE;QACTC,SAAS,EAAE;QACXC,WAAW;YACTC,gBAAgB,EAAE;YAClBC,mBAAmB,EAAE;QACvB;IACF;IAEA,IAAI,CAACb,UAAUc,MAAM;QACnB,OAAOb;IACT;IAEAD,SAASe,OAAO,CAAC,CAACC;QAChB,IAAIA,QAAQX,KAAK,EAAE;YACjB,IAAIW,QAAQX,KAAK,EAAEC,MAAMW,QAAQ;gBAC/BhB,UAAUI,KAAK,CAACC,IAAI,GAAGL,UAAUI,KAAK,CAACC,IAAI,CAACY,MAAM,CAACF,QAAQX,KAAK,CAACC,IAAI;YACvE;YACA,IAAIU,QAAQX,KAAK,EAAEE,MAAMU,QAAQ;gBAC/BhB,UAAUI,KA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O,IAAID,EAAEC,KAAK,EAAE;YAClB,OAAO;QACT,OAAO;YACL,OAAO;QACT;IACF;IAEA,oFAAoF;IACpF,KAAK,MAAMZ,WAAWxB,UAAUE,qBAAqB,CAACC,QAAQ,CAAE;QAC9DqB,QAAQI,OAAO,CAACK,IAAI,CAAC,CAACC,GAAGC;YACvB,IAAID,EAAEE,KAAK,IAAID,EAAEC,KAAK,EAAE;gBACtB,OAAOF,EAAEE,KAAK,GAAGD,EAAEC,KAAK;YAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;gBAClB,OAAO,CAAC;YACV,OAAO,IAAID,EAAEC,KAAK,EAAE;gBAClB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF;IAEA,OAAOpC;AACT,EAAC;AAED,OAAO,SAASqC,2BACdC,OAA4B,EAC5BC,wBAAkD;IAElD,OAAO;QACLxC,UAAUD,uBAAuByC;QACjCD;QACAE,oBAAoBD;IACtB;AACF"}
1
+ {"version":3,"sources":["../../../../../src/field/lexical/config/client/sanitize.ts"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type { LexicalFieldAdminProps } from '../../../../types.js'\nimport type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\nexport const sanitizeClientFeatures = (\n features: ResolvedClientFeatureMap,\n): SanitizedClientFeatures => {\n const sanitized: SanitizedClientFeatures = {\n enabledFeatures: [],\n hooks: {\n load: [],\n save: [],\n },\n markdownTransformers: [],\n nodes: [],\n plugins: [],\n slashMenu: {\n dynamicGroups: [],\n groups: [],\n },\n toolbarFixed: {\n groups: [],\n },\n toolbarInline: {\n groups: [],\n },\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature.hooks) {\n if (feature.hooks?.load?.length) {\n sanitized.hooks.load = sanitized.hooks.load.concat(feature.hooks.load)\n }\n if (feature.hooks?.save?.length) {\n sanitized.hooks.save = sanitized.hooks.save.concat(feature.hooks.save)\n }\n }\n\n if (feature.nodes?.length) {\n sanitized.nodes = sanitized.nodes.concat(feature.nodes)\n }\n if (feature.plugins?.length) {\n feature.plugins.forEach((plugin, i) => {\n sanitized.plugins.push({\n Component: plugin.Component,\n clientProps: feature.clientFeatureProps,\n key: feature.key + i,\n position: plugin.position,\n })\n })\n }\n\n if (feature.toolbarInline?.groups?.length) {\n for (const group of feature.toolbarInline.groups) {\n // 1. find the group with the same key or create new one\n let foundGroup = sanitized.toolbarInline.groups.find(\n (sanitizedGroup) => sanitizedGroup.key === group.key,\n )\n if (!foundGroup) {\n foundGroup = {\n ...group,\n items: [],\n }\n } else {\n sanitized.toolbarInline.groups = sanitized.toolbarInline.groups.filter(\n (sanitizedGroup) => sanitizedGroup.key !== group.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (group?.items?.length) {\n foundGroup.items = foundGroup.items.concat(group.items)\n }\n sanitized.toolbarInline?.groups.push(foundGroup)\n }\n }\n\n if (feature.toolbarFixed?.groups?.length) {\n for (const group of feature.toolbarFixed.groups) {\n // 1. find the group with the same key or create new one\n let foundGroup = sanitized.toolbarFixed.groups.find(\n (sanitizedGroup) => sanitizedGroup.key === group.key,\n )\n if (!foundGroup) {\n foundGroup = {\n ...group,\n items: [],\n }\n } else {\n sanitized.toolbarFixed.groups = sanitized.toolbarFixed.groups.filter(\n (sanitizedGroup) => sanitizedGroup.key !== group.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (group?.items?.length) {\n foundGroup.items = foundGroup.items.concat(group.items)\n }\n sanitized.toolbarFixed?.groups.push(foundGroup)\n }\n }\n\n if (feature.slashMenu?.groups) {\n if (feature.slashMenu.dynamicGroups?.length) {\n sanitized.slashMenu.dynamicGroups = sanitized.slashMenu.dynamicGroups.concat(\n feature.slashMenu.dynamicGroups,\n )\n }\n\n for (const optionGroup of feature.slashMenu.groups) {\n // 1. find the group with the same name or create new one\n let group = sanitized.slashMenu.groups.find((group) => group.key === optionGroup.key)\n if (!group) {\n group = {\n ...optionGroup,\n items: [],\n }\n } else {\n sanitized.slashMenu.groups = sanitized.slashMenu.groups.filter(\n (group) => group.key !== optionGroup.key,\n )\n }\n\n // 2. Add options to group options array and add to sanitized.slashMenu.groupsWithOptions\n if (optionGroup?.items?.length) {\n group.items = group.items.concat(optionGroup.items)\n }\n sanitized.slashMenu.groups.push(group)\n }\n }\n\n if (feature.markdownTransformers?.length) {\n sanitized.markdownTransformers = sanitized.markdownTransformers.concat(\n feature.markdownTransformers,\n )\n }\n sanitized.enabledFeatures.push(feature.key)\n })\n\n // Sort sanitized.toolbarInline.groups by order property\n sanitized.toolbarInline.groups.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n // Sort sanitized.toolbarFixed.groups by order property\n sanitized.toolbarFixed.groups.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n\n // Sort sanitized.toolbarInline.groups.[group].entries by order property\n for (const group of sanitized.toolbarInline.groups) {\n group.items.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n // Sort sanitized.toolbarFixed.groups.[group].entries by order property\n for (const group of sanitized.toolbarFixed.groups) {\n group.items.sort((a, b) => {\n if (a.order && b.order) {\n return a.order - b.order\n } else if (a.order) {\n return -1\n } else if (b.order) {\n return 1\n } else {\n return 0\n }\n })\n }\n\n return sanitized\n}\n\nexport function sanitizeClientEditorConfig(\n lexical: LexicalEditorConfig,\n resolvedClientFeatureMap: ResolvedClientFeatureMap,\n admin?: LexicalFieldAdminProps,\n): SanitizedClientEditorConfig {\n return {\n admin,\n features: sanitizeClientFeatures(resolvedClientFeatureMap),\n lexical,\n resolvedFeatureMap: resolvedClientFeatureMap,\n }\n}\n"],"names":["sanitizeClientFeatures","features","sanitized","enabledFeatures","hooks","load","save","markdownTransformers","nodes","plugins","slashMenu","dynamicGroups","groups","toolbarFixed","toolbarInline","size","forEach","feature","length","concat","plugin","i","push","Component","clientProps","clientFeatureProps","key","position","group","foundGroup","find","sanitizedGroup","items","filter","optionGroup","sort","a","b","order","sanitizeClientEditorConfig","lexical","resolvedClientFeatureMap","admin","resolvedFeatureMap"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAQA,OAAO,MAAMA,yBAAyB,CACpCC;IAEA,MAAMC,YAAqC;QACzCC,iBAAiB,EAAE;QACnBC,OAAO;YACLC,MAAM,EAAE;YACRC,MAAM,EAAE;QACV;QACAC,sBAAsB,EAAE;QACxBC,OAAO,EAAE;QACTC,SAAS,EAAE;QACXC,WAAW;YACTC,eAAe,EAAE;YACjBC,QAAQ,EAAE;QACZ;QACAC,cAAc;YACZD,QAAQ,EAAE;QACZ;QACAE,eAAe;YACbF,QAAQ,EAAE;QACZ;IACF;IAEA,IAAI,CAACX,UAAUc,MAAM;QACnB,OAAOb;IACT;IAEAD,SAASe,OAAO,CAAC,CAACC;QAChB,IAAIA,QAAQb,KAAK,EAAE;YACjB,IAAIa,QAAQb,KAAK,EAAEC,MAAMa,QAAQ;gBAC/BhB,UAAUE,KAAK,CAACC,IAAI,GAAGH,UAAUE,KAAK,CAACC,IAAI,CAACc,MAAM,CAACF,QAAQb,KAAK,CAACC,IAAI;YACvE;YACA,IAAIY,QAAQb,KAAK,EAAEE,MAAMY,QAAQ;gBAC/BhB,UAAUE,KAAK,CAACE,IA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AAK,GAAGD,EAAEC,KAAK;YAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;gBAClB,OAAO,CAAC;YACV,OAAO,IAAID,EAAEC,KAAK,EAAE;gBAClB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF;IAEA,uEAAuE;IACvE,KAAK,MAAMV,SAAS1B,UAAUW,YAAY,CAACD,MAAM,CAAE;QACjDgB,MAAMI,KAAK,CAACG,IAAI,CAAC,CAACC,GAAGC;YACnB,IAAID,EAAEE,KAAK,IAAID,EAAEC,KAAK,EAAE;gBACtB,OAAOF,EAAEE,KAAK,GAAGD,EAAEC,KAAK;YAC1B,OAAO,IAAIF,EAAEE,KAAK,EAAE;gBAClB,OAAO,CAAC;YACV,OAAO,IAAID,EAAEC,KAAK,EAAE;gBAClB,OAAO;YACT,OAAO;gBACL,OAAO;YACT;QACF;IACF;IAEA,OAAOpC;AACT,EAAC;AAED,OAAO,SAASqC,2BACdC,OAA4B,EAC5BC,wBAAkD,EAClDC,KAA8B;IAE9B,OAAO;QACLA;QACAzC,UAAUD,uBAAuByC;QACjCD;QACAG,oBAAoBF;IACtB;AACF"}
@@ -1,8 +1,7 @@
1
- import type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js';
1
+ import type { EditorConfig as LexicalEditorConfig } from 'lexical';
2
2
  import type { FeatureProviderServer } from '../../../features/types.js';
3
- import type { SanitizedServerEditorConfig, ServerEditorConfig } from '../types.js';
3
+ import type { ServerEditorConfig } from '../types.js';
4
4
  export declare const defaultEditorLexicalConfig: LexicalEditorConfig;
5
5
  export declare const defaultEditorFeatures: FeatureProviderServer<unknown, unknown>[];
6
6
  export declare const defaultEditorConfig: ServerEditorConfig;
7
- export declare const defaultSanitizedServerEditorConfig: SanitizedServerEditorConfig;
8
7
  //# sourceMappingURL=default.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,0BAA0B,CAAA;AAEnF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAuBlF,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAmB1E,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAGjC,CAAA;AAED,eAAO,MAAM,kCAAkC,EAAE,2BACA,CAAA"}
1
+ {"version":3,"file":"default.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/default.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAElE,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAwBrD,eAAO,MAAM,0BAA0B,EAAE,mBAGxC,CAAA;AAED,eAAO,MAAM,qBAAqB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAqB1E,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,kBAGjC,CAAA"}
@@ -1,23 +1,24 @@
1
1
  import { AlignFeature } from '../../../features/align/feature.server.js';
2
- import { BlockQuoteFeature } from '../../../features/blockquote/feature.server.js';
2
+ import { BlockquoteFeature } from '../../../features/blockquote/feature.server.js';
3
3
  import { BoldFeature } from '../../../features/format/bold/feature.server.js';
4
- import { InlineCodeFeature } from '../../../features/format/inlinecode/feature.server.js';
4
+ import { InlineCodeFeature } from '../../../features/format/inlineCode/feature.server.js';
5
5
  import { ItalicFeature } from '../../../features/format/italic/feature.server.js';
6
6
  import { StrikethroughFeature } from '../../../features/format/strikethrough/feature.server.js';
7
7
  import { SubscriptFeature } from '../../../features/format/subscript/feature.server.js';
8
8
  import { SuperscriptFeature } from '../../../features/format/superscript/feature.server.js';
9
9
  import { UnderlineFeature } from '../../../features/format/underline/feature.server.js';
10
10
  import { HeadingFeature } from '../../../features/heading/feature.server.js';
11
+ import { HorizontalRuleFeature } from '../../../features/horizontalRule/feature.server.js';
11
12
  import { IndentFeature } from '../../../features/indent/feature.server.js';
12
13
  import { LinkFeature } from '../../../features/link/feature.server.js';
13
- import { CheckListFeature } from '../../../features/lists/checklist/feature.server.js';
14
- import { OrderedListFeature } from '../../../features/lists/orderedlist/feature.server.js';
15
- import { UnorderedListFeature } from '../../../features/lists/unorderedlist/feature.server.js';
14
+ import { ChecklistFeature } from '../../../features/lists/checklist/feature.server.js';
15
+ import { OrderedListFeature } from '../../../features/lists/orderedList/feature.server.js';
16
+ import { UnorderedListFeature } from '../../../features/lists/unorderedList/feature.server.js';
16
17
  import { ParagraphFeature } from '../../../features/paragraph/feature.server.js';
17
18
  import { RelationshipFeature } from '../../../features/relationship/feature.server.js';
19
+ import { InlineToolbarFeature } from '../../../features/toolbars/inline/feature.server.js';
18
20
  import { UploadFeature } from '../../../features/upload/feature.server.js';
19
21
  import { LexicalEditorTheme } from '../../theme/EditorTheme.js';
20
- import { sanitizeServerEditorConfig } from './sanitize.js';
21
22
  export const defaultEditorLexicalConfig = {
22
23
  namespace: 'lexical',
23
24
  theme: LexicalEditorTheme
@@ -36,16 +37,17 @@ export const defaultEditorFeatures = [
36
37
  IndentFeature(),
37
38
  UnorderedListFeature(),
38
39
  OrderedListFeature(),
39
- CheckListFeature(),
40
+ ChecklistFeature(),
40
41
  LinkFeature(),
41
42
  RelationshipFeature(),
42
- BlockQuoteFeature(),
43
- UploadFeature()
43
+ BlockquoteFeature(),
44
+ UploadFeature(),
45
+ HorizontalRuleFeature(),
46
+ InlineToolbarFeature()
44
47
  ];
45
48
  export const defaultEditorConfig = {
46
49
  features: defaultEditorFeatures,
47
50
  lexical: defaultEditorLexicalConfig
48
51
  };
49
- export const defaultSanitizedServerEditorConfig = sanitizeServerEditorConfig(defaultEditorConfig);
50
52
 
51
53
  //# sourceMappingURL=default.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/lexical/config/server/default.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical/LexicalEditor.js'\n\nimport type { FeatureProviderServer } from '../../../features/types.js'\nimport type { SanitizedServerEditorConfig, ServerEditorConfig } from '../types.js'\n\nimport { AlignFeature } from '../../../features/align/feature.server.js'\nimport { BlockQuoteFeature } from '../../../features/blockquote/feature.server.js'\nimport { BoldFeature } from '../../../features/format/bold/feature.server.js'\nimport { InlineCodeFeature } from '../../../features/format/inlinecode/feature.server.js'\nimport { ItalicFeature } from '../../../features/format/italic/feature.server.js'\nimport { StrikethroughFeature } from '../../../features/format/strikethrough/feature.server.js'\nimport { SubscriptFeature } from '../../../features/format/subscript/feature.server.js'\nimport { SuperscriptFeature } from '../../../features/format/superscript/feature.server.js'\nimport { UnderlineFeature } from '../../../features/format/underline/feature.server.js'\nimport { HeadingFeature } from '../../../features/heading/feature.server.js'\nimport { IndentFeature } from '../../../features/indent/feature.server.js'\nimport { LinkFeature } from '../../../features/link/feature.server.js'\nimport { CheckListFeature } from '../../../features/lists/checklist/feature.server.js'\nimport { OrderedListFeature } from '../../../features/lists/orderedlist/feature.server.js'\nimport { UnorderedListFeature } from '../../../features/lists/unorderedlist/feature.server.js'\nimport { ParagraphFeature } from '../../../features/paragraph/feature.server.js'\nimport { RelationshipFeature } from '../../../features/relationship/feature.server.js'\nimport { UploadFeature } from '../../../features/upload/feature.server.js'\nimport { LexicalEditorTheme } from '../../theme/EditorTheme.js'\nimport { sanitizeServerEditorConfig } from './sanitize.js'\n\nexport const defaultEditorLexicalConfig: LexicalEditorConfig = {\n namespace: 'lexical',\n theme: LexicalEditorTheme,\n}\n\nexport const defaultEditorFeatures: FeatureProviderServer<unknown, unknown>[] = [\n BoldFeature(),\n ItalicFeature(),\n UnderlineFeature(),\n StrikethroughFeature(),\n SubscriptFeature(),\n SuperscriptFeature(),\n InlineCodeFeature(),\n ParagraphFeature(),\n HeadingFeature(),\n AlignFeature(),\n IndentFeature(),\n UnorderedListFeature(),\n OrderedListFeature(),\n CheckListFeature(),\n LinkFeature(),\n RelationshipFeature(),\n BlockQuoteFeature(),\n UploadFeature(),\n]\n\nexport const defaultEditorConfig: ServerEditorConfig = {\n features: defaultEditorFeatures,\n lexical: defaultEditorLexicalConfig,\n}\n\nexport const defaultSanitizedServerEditorConfig: SanitizedServerEditorConfig =\n sanitizeServerEditorConfig(defaultEditorConfig)\n"],"names":["AlignFeature","BlockQuoteFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","IndentFeature","LinkFeature","CheckListFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","UploadFeature","LexicalEditorTheme","sanitizeServerEditorConfig","defaultEditorLexicalConfig","namespace","theme","defaultEditorFeatures","defaultEditorConfig","features","lexical","defaultSanitizedServerEditorConfig"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,YAAY,QAAQ,4CAA2C;AACxE,SAASC,iBAAiB,QAAQ,iDAAgD;AAClF,SAASC,WAAW,QAAQ,kDAAiD;AAC7E,SAASC,iBAAiB,QAAQ,wDAAuD;AACzF,SAASC,aAAa,QAAQ,oDAAmD;AACjF,SAASC,oBAAoB,QAAQ,2DAA0D;AAC/F,SAASC,gBAAgB,QAAQ,uDAAsD;AACvF,SAASC,kBAAkB,QAAQ,yDAAwD;AAC3F,SAASC,gBAAgB,QAAQ,uDAAsD;AACvF,SAASC,cAAc,QAAQ,8CAA6C;AAC5E,SAASC,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,WAAW,QAAQ,2CAA0C;AACtE,SAASC,gBAAgB,QAAQ,sDAAqD;AACtF,SAASC,kBAAkB,QAAQ,wDAAuD;AAC1F,SAASC,oBAAoB,QAAQ,0DAAyD;AAC9F,SAASC,gBAAgB,QAAQ,gDAA+C;AAChF,SAASC,mBAAmB,QAAQ,mDAAkD;AACtF,SAASC,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,kBAAkB,QAAQ,6BAA4B;AAC/D,SAASC,0BAA0B,QAAQ,gBAAe;AAE1D,OAAO,MAAMC,6BAAkD;IAC7DC,WAAW;IACXC,OAAOJ;AACT,EAAC;AAED,OAAO,MAAMK,wBAAmE;IAC9ErB;IACAE;IACAI;IACAH;IACAC;IACAC;IACAJ;IACAY;IACAN;IACAT;IACAU;IACAI;IACAD;IACAD;IACAD;IACAK;IACAf;IACAgB;CACD,CAAA;AAED,OAAO,MAAMO,sBAA0C;IACrDC,UAAUF;IACVG,SAASN;AACX,EAAC;AAED,OAAO,MAAMO,qCACXR,2BAA2BK,qBAAoB"}
1
+ {"version":3,"sources":["../../../../../src/field/lexical/config/server/default.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type { FeatureProviderServer } from '../../../features/types.js'\nimport type { ServerEditorConfig } from '../types.js'\n\nimport { AlignFeature } from '../../../features/align/feature.server.js'\nimport { BlockquoteFeature } from '../../../features/blockquote/feature.server.js'\nimport { BoldFeature } from '../../../features/format/bold/feature.server.js'\nimport { InlineCodeFeature } from '../../../features/format/inlineCode/feature.server.js'\nimport { ItalicFeature } from '../../../features/format/italic/feature.server.js'\nimport { StrikethroughFeature } from '../../../features/format/strikethrough/feature.server.js'\nimport { SubscriptFeature } from '../../../features/format/subscript/feature.server.js'\nimport { SuperscriptFeature } from '../../../features/format/superscript/feature.server.js'\nimport { UnderlineFeature } from '../../../features/format/underline/feature.server.js'\nimport { HeadingFeature } from '../../../features/heading/feature.server.js'\nimport { HorizontalRuleFeature } from '../../../features/horizontalRule/feature.server.js'\nimport { IndentFeature } from '../../../features/indent/feature.server.js'\nimport { LinkFeature } from '../../../features/link/feature.server.js'\nimport { ChecklistFeature } from '../../../features/lists/checklist/feature.server.js'\nimport { OrderedListFeature } from '../../../features/lists/orderedList/feature.server.js'\nimport { UnorderedListFeature } from '../../../features/lists/unorderedList/feature.server.js'\nimport { ParagraphFeature } from '../../../features/paragraph/feature.server.js'\nimport { RelationshipFeature } from '../../../features/relationship/feature.server.js'\nimport { InlineToolbarFeature } from '../../../features/toolbars/inline/feature.server.js'\nimport { UploadFeature } from '../../../features/upload/feature.server.js'\nimport { LexicalEditorTheme } from '../../theme/EditorTheme.js'\n\nexport const defaultEditorLexicalConfig: LexicalEditorConfig = {\n namespace: 'lexical',\n theme: LexicalEditorTheme,\n}\n\nexport const defaultEditorFeatures: FeatureProviderServer<unknown, unknown>[] = [\n BoldFeature(),\n ItalicFeature(),\n UnderlineFeature(),\n StrikethroughFeature(),\n SubscriptFeature(),\n SuperscriptFeature(),\n InlineCodeFeature(),\n ParagraphFeature(),\n HeadingFeature(),\n AlignFeature(),\n IndentFeature(),\n UnorderedListFeature(),\n OrderedListFeature(),\n ChecklistFeature(),\n LinkFeature(),\n RelationshipFeature(),\n BlockquoteFeature(),\n UploadFeature(),\n HorizontalRuleFeature(),\n InlineToolbarFeature(),\n]\n\nexport const defaultEditorConfig: ServerEditorConfig = {\n features: defaultEditorFeatures,\n lexical: defaultEditorLexicalConfig,\n}\n"],"names":["AlignFeature","BlockquoteFeature","BoldFeature","InlineCodeFeature","ItalicFeature","StrikethroughFeature","SubscriptFeature","SuperscriptFeature","UnderlineFeature","HeadingFeature","HorizontalRuleFeature","IndentFeature","LinkFeature","ChecklistFeature","OrderedListFeature","UnorderedListFeature","ParagraphFeature","RelationshipFeature","InlineToolbarFeature","UploadFeature","LexicalEditorTheme","defaultEditorLexicalConfig","namespace","theme","defaultEditorFeatures","defaultEditorConfig","features","lexical"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAKA,SAASA,YAAY,QAAQ,4CAA2C;AACxE,SAASC,iBAAiB,QAAQ,iDAAgD;AAClF,SAASC,WAAW,QAAQ,kDAAiD;AAC7E,SAASC,iBAAiB,QAAQ,wDAAuD;AACzF,SAASC,aAAa,QAAQ,oDAAmD;AACjF,SAASC,oBAAoB,QAAQ,2DAA0D;AAC/F,SAASC,gBAAgB,QAAQ,uDAAsD;AACvF,SAASC,kBAAkB,QAAQ,yDAAwD;AAC3F,SAASC,gBAAgB,QAAQ,uDAAsD;AACvF,SAASC,cAAc,QAAQ,8CAA6C;AAC5E,SAASC,qBAAqB,QAAQ,qDAAoD;AAC1F,SAASC,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,WAAW,QAAQ,2CAA0C;AACtE,SAASC,gBAAgB,QAAQ,sDAAqD;AACtF,SAASC,kBAAkB,QAAQ,wDAAuD;AAC1F,SAASC,oBAAoB,QAAQ,0DAAyD;AAC9F,SAASC,gBAAgB,QAAQ,gDAA+C;AAChF,SAASC,mBAAmB,QAAQ,mDAAkD;AACtF,SAASC,oBAAoB,QAAQ,sDAAqD;AAC1F,SAASC,aAAa,QAAQ,6CAA4C;AAC1E,SAASC,kBAAkB,QAAQ,6BAA4B;AAE/D,OAAO,MAAMC,6BAAkD;IAC7DC,WAAW;IACXC,OAAOH;AACT,EAAC;AAED,OAAO,MAAMI,wBAAmE;IAC9EtB;IACAE;IACAI;IACAH;IACAC;IACAC;IACAJ;IACAa;IACAP;IACAT;IACAW;IACAI;IACAD;IACAD;IACAD;IACAK;IACAhB;IACAkB;IACAT;IACAQ;CACD,CAAA;AAED,OAAO,MAAMO,sBAA0C;IACrDC,UAAUF;IACVG,SAASN;AACX,EAAC"}
@@ -1,7 +1,10 @@
1
+ import type { SanitizedConfig } from 'payload/config';
1
2
  import type { FeatureProviderServer, ResolvedServerFeatureMap } from '../../../features/types.js';
2
3
  import type { ServerEditorConfig } from '../types.js';
3
4
  export declare function sortFeaturesForOptimalLoading(featureProviders: FeatureProviderServer<unknown, unknown>[]): FeatureProviderServer<unknown, unknown>[];
4
- export declare function loadFeatures({ unSanitizedEditorConfig, }: {
5
+ export declare function loadFeatures({ config, isRoot, unSanitizedEditorConfig, }: {
6
+ config: SanitizedConfig;
7
+ isRoot?: boolean;
5
8
  unSanitizedEditorConfig: ServerEditorConfig;
6
- }): ResolvedServerFeatureMap;
9
+ }): Promise<ResolvedServerFeatureMap>;
7
10
  //# sourceMappingURL=loader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EAEzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AA8FrD,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAC1D,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAE3C;AAED,wBAAgB,YAAY,CAAC,EAC3B,uBAAuB,GACxB,EAAE;IACD,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,wBAAwB,CA8E3B"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,KAAK,EACV,qBAAqB,EACrB,wBAAwB,EAEzB,MAAM,4BAA4B,CAAA;AACnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AA8FrD,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,GAC1D,qBAAqB,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE,CAE3C;AAED,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,MAAM,EACN,uBAAuB,GACxB,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAgFpC"}
@@ -57,7 +57,7 @@ function visit(graph, key, visited, stack, currentPath = []) {
57
57
  export function sortFeaturesForOptimalLoading(featureProviders) {
58
58
  return topologicallySortFeatures(featureProviders);
59
59
  }
60
- export function loadFeatures({ unSanitizedEditorConfig }) {
60
+ export async function loadFeatures({ config, isRoot, unSanitizedEditorConfig }) {
61
61
  // First remove all duplicate features. The LAST feature with a given key wins.
62
62
  unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.reverse().filter((f, i, arr)=>{
63
63
  const firstIndex = arr.findIndex((f2)=>f2.key === f.key);
@@ -97,8 +97,10 @@ export function loadFeatures({ unSanitizedEditorConfig }) {
97
97
  }
98
98
  }
99
99
  }
100
- const feature = featureProvider.feature({
100
+ const feature = await featureProvider.feature({
101
+ config,
101
102
  featureProviderMap,
103
+ isRoot,
102
104
  resolvedFeatures,
103
105
  unSanitizedEditorConfig
104
106
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/lexical/config/server/loader.ts"],"sourcesContent":["import type {\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n ServerFeatureProviderMap,\n} from '../../../features/types.js'\nimport type { ServerEditorConfig } from '../types.js'\n\ntype DependencyGraph = {\n [key: string]: {\n dependencies: string[]\n dependenciesPriority: string[]\n dependenciesSoft: string[]\n featureProvider: FeatureProviderServer<unknown, unknown>\n }\n}\n\nfunction createDependencyGraph(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): DependencyGraph {\n const graph: DependencyGraph = {}\n for (const fp of featureProviders) {\n graph[fp.key] = {\n dependencies: fp.dependencies || [],\n dependenciesPriority: fp.dependenciesPriority || [],\n dependenciesSoft: fp.dependenciesSoft || [],\n featureProvider: fp,\n }\n }\n return graph\n}\n\nfunction topologicallySortFeatures(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): FeatureProviderServer<unknown, unknown>[] {\n const graph = createDependencyGraph(featureProviders)\n const visited: { [key: string]: boolean } = {}\n const stack: FeatureProviderServer<unknown, unknown>[] = []\n\n for (const key in graph) {\n if (!visited[key]) {\n visit(graph, key, visited, stack)\n }\n }\n\n return stack.reverse()\n}\n\nfunction visit(\n graph: DependencyGraph,\n key: string,\n visited: { [key: string]: boolean },\n stack: FeatureProviderServer<unknown, unknown>[],\n currentPath: string[] = [],\n) {\n if (!graph[key]) {\n throw new Error(`Feature key ${key} is not present in the dependency graph.`)\n }\n\n if (currentPath.includes(key)) {\n throw new Error(`Circular dependency detected: ${currentPath.join(' -> ')} -> ${key}`)\n }\n\n if (visited[key]) {\n return\n }\n\n visited[key] = true\n currentPath.push(key)\n\n // First process the hard priority dependencies\n for (const dep of graph[key].dependenciesPriority) {\n if (!visited[dep]) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n // Then process the normal dependencies, but make sure to not violate hard dependencies\n for (const dep of graph[key].dependencies) {\n if (!visited[dep] && !graph[key].dependenciesPriority.includes(dep)) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n // Then process the soft dependencies. Make sure to not violate hard and normal dependencies.\n for (const dep of graph[key].dependenciesSoft) {\n if (\n graph[dep] &&\n !visited[dep] &&\n !graph[key].dependenciesPriority.includes(dep) &&\n !graph[key].dependencies.includes(dep)\n ) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n stack.push(graph[key].featureProvider)\n currentPath.pop()\n}\n\nexport function sortFeaturesForOptimalLoading(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): FeatureProviderServer<unknown, unknown>[] {\n return topologicallySortFeatures(featureProviders)\n}\n\nexport function loadFeatures({\n unSanitizedEditorConfig,\n}: {\n unSanitizedEditorConfig: ServerEditorConfig\n}): ResolvedServerFeatureMap {\n // First remove all duplicate features. The LAST feature with a given key wins.\n unSanitizedEditorConfig.features = unSanitizedEditorConfig.features\n .reverse()\n .filter((f, i, arr) => {\n const firstIndex = arr.findIndex((f2) => f2.key === f.key)\n return firstIndex === i\n })\n .reverse()\n\n unSanitizedEditorConfig.features = sortFeaturesForOptimalLoading(unSanitizedEditorConfig.features)\n\n const featureProviderMap: ServerFeatureProviderMap = new Map(\n unSanitizedEditorConfig.features.map(\n (f) => [f.key, f] as [string, FeatureProviderServer<unknown, unknown>],\n ),\n )\n\n const resolvedFeatures: ResolvedServerFeatureMap = new Map()\n\n // Make sure all dependencies declared in the respective features exist\n let loaded = 0\n for (const featureProvider of unSanitizedEditorConfig.features) {\n if (!featureProvider.key) {\n throw new Error(\n `A Feature you've added does not have a key. Please add a key to the feature. This is used to uniquely identify the feature.`,\n )\n }\n if (featureProvider.dependencies?.length) {\n for (const dependencyKey of featureProvider.dependencies) {\n const found = unSanitizedEditorConfig.features.find((f) => f.key === dependencyKey)\n if (!found) {\n throw new Error(\n `Feature ${featureProvider.key} has a dependency ${dependencyKey} which does not exist.`,\n )\n }\n }\n }\n\n if (featureProvider.dependenciesPriority?.length) {\n for (const priorityDependencyKey of featureProvider.dependenciesPriority) {\n // look in the resolved features instead of the editorConfig.features, as a dependency requires the feature to be loaded before it, contrary to a soft-dependency\n const found = resolvedFeatures.get(priorityDependencyKey)\n if (!found) {\n const existsInEditorConfig = unSanitizedEditorConfig.features.find(\n (f) => f.key === priorityDependencyKey,\n )\n if (!existsInEditorConfig) {\n throw new Error(\n `Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which does not exist.`,\n )\n } else {\n throw new Error(\n `Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which is not loaded before it.`,\n )\n }\n }\n }\n }\n\n const feature = featureProvider.feature({\n featureProviderMap,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n resolvedFeatures.set(featureProvider.key, {\n ...feature,\n dependencies: featureProvider.dependencies,\n dependenciesPriority: featureProvider.dependenciesPriority,\n dependenciesSoft: featureProvider.dependenciesSoft,\n key: featureProvider.key,\n order: loaded,\n })\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"names":["createDependencyGraph","featureProviders","graph","fp","key","dependencies","dependenciesPriority","dependenciesSoft","featureProvider","topologicallySortFeatures","visited","stack","visit","reverse","currentPath","Error","includes","join","push","dep","pop","sortFeaturesForOptimalLoading","loadFeatures","unSanitizedEditorConfig","features","filter","f","i","arr","firstIndex","findIndex","f2","featureProviderMap","Map","map","resolvedFeatures","loaded","length","dependencyKey","found","find","priorityDependencyKey","get","existsInEditorConfig","feature","set","order"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAgBA,SAASA,sBACPC,gBAA2D;IAE3D,MAAMC,QAAyB,CAAC;IAChC,KAAK,MAAMC,MAAMF,iBAAkB;QACjCC,KAAK,CAACC,GAAGC,GAAG,CAAC,GAAG;YACdC,cAAcF,GAAGE,YAAY,IAAI,EAAE;YACnCC,sBAAsBH,GAAGG,oBAAoB,IAAI,EAAE;YACnDC,kBAAkBJ,GAAGI,gBAAgB,IAAI,EAAE;YAC3CC,iBAAiBL;QACnB;IACF;IACA,OAAOD;AACT;AAEA,SAASO,0BACPR,gBAA2D;IAE3D,MAAMC,QAAQF,sBAAsBC;IACpC,MAAMS,UAAsC,CAAC;IAC7C,MAAMC,QAAmD,EAAE;IAE3D,IAAK,MAAMP,OAAOF,MAAO;QACvB,IAAI,CAACQ,OAAO,CAACN,IAAI,EAAE;YACjBQ,MAAMV,OAAOE,KAAKM,SAASC;QAC7B;IACF;IAEA,OAAOA,MAAME,OAAO;AACtB;AAEA,SAASD,MACPV,KAAsB,EACtBE,GAAW,EACXM,OAAmC,EACnCC,KAAgD,EAChDG,cAAwB,EAAE;IAE1B,IAAI,CAACZ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MAAMI,uBAAuBpB,wBAAwBC,QAAQ,CAACgB,IAAI,CAChE,CAACd,IAAMA,EAAEtB,GAAG,KAAKqC;oBAEnB,IAAI,CAACE,sBAAsB;wBACzB,MAAM,IAAI5B,MACR,CAAC,QAAQ,EAAEP,gBAAgBJ,GAAG,CAAC,2BAA2B,EAAEqC,sBAAsB,sBAAsB,CAAC;oBAE7G,OAAO;wBACL,MAAM,IAAI1B,MACR,CAAC,QAAQ,EAAEP,gBAAgBJ,GAAG,CAAC,2BAA2B,EAAEqC,sBAAsB,+BAA+B,CAAC;oBAEtH;gBACF;YACF;QACF;QAEA,MAAMG,UAAUpC,gBAAgBoC,OAAO,CAAC;YACtCZ;YACAG;YACAZ;QACF;QACAY,iBAAiBU,GAAG,CAACrC,gBAAgBJ,GAAG,EAAE;YACxC,GAAGwC,OAAO;YACVvC,cAAcG,gBAAgBH,YAAY;YAC1CC,sBAAsBE,gBAAgBF,oBAAoB;YAC1DC,kBAAkBC,gBAAgBD,gBAAgB;YAClDH,KAAKI,gBAAgBJ,GAAG;YACxB0C,OAAOV;QACT;QAEAA;IACF;IAEA,OAAOD;AACT"}
1
+ {"version":3,"sources":["../../../../../src/field/lexical/config/server/loader.ts"],"sourcesContent":["import type { Config, SanitizedConfig } from 'payload/config'\n\nimport type {\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n ServerFeatureProviderMap,\n} from '../../../features/types.js'\nimport type { ServerEditorConfig } from '../types.js'\n\ntype DependencyGraph = {\n [key: string]: {\n dependencies: string[]\n dependenciesPriority: string[]\n dependenciesSoft: string[]\n featureProvider: FeatureProviderServer<unknown, unknown>\n }\n}\n\nfunction createDependencyGraph(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): DependencyGraph {\n const graph: DependencyGraph = {}\n for (const fp of featureProviders) {\n graph[fp.key] = {\n dependencies: fp.dependencies || [],\n dependenciesPriority: fp.dependenciesPriority || [],\n dependenciesSoft: fp.dependenciesSoft || [],\n featureProvider: fp,\n }\n }\n return graph\n}\n\nfunction topologicallySortFeatures(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): FeatureProviderServer<unknown, unknown>[] {\n const graph = createDependencyGraph(featureProviders)\n const visited: { [key: string]: boolean } = {}\n const stack: FeatureProviderServer<unknown, unknown>[] = []\n\n for (const key in graph) {\n if (!visited[key]) {\n visit(graph, key, visited, stack)\n }\n }\n\n return stack.reverse()\n}\n\nfunction visit(\n graph: DependencyGraph,\n key: string,\n visited: { [key: string]: boolean },\n stack: FeatureProviderServer<unknown, unknown>[],\n currentPath: string[] = [],\n) {\n if (!graph[key]) {\n throw new Error(`Feature key ${key} is not present in the dependency graph.`)\n }\n\n if (currentPath.includes(key)) {\n throw new Error(`Circular dependency detected: ${currentPath.join(' -> ')} -> ${key}`)\n }\n\n if (visited[key]) {\n return\n }\n\n visited[key] = true\n currentPath.push(key)\n\n // First process the hard priority dependencies\n for (const dep of graph[key].dependenciesPriority) {\n if (!visited[dep]) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n // Then process the normal dependencies, but make sure to not violate hard dependencies\n for (const dep of graph[key].dependencies) {\n if (!visited[dep] && !graph[key].dependenciesPriority.includes(dep)) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n // Then process the soft dependencies. Make sure to not violate hard and normal dependencies.\n for (const dep of graph[key].dependenciesSoft) {\n if (\n graph[dep] &&\n !visited[dep] &&\n !graph[key].dependenciesPriority.includes(dep) &&\n !graph[key].dependencies.includes(dep)\n ) {\n visit(graph, dep, visited, stack, currentPath)\n }\n }\n\n stack.push(graph[key].featureProvider)\n currentPath.pop()\n}\n\nexport function sortFeaturesForOptimalLoading(\n featureProviders: FeatureProviderServer<unknown, unknown>[],\n): FeatureProviderServer<unknown, unknown>[] {\n return topologicallySortFeatures(featureProviders)\n}\n\nexport async function loadFeatures({\n config,\n isRoot,\n unSanitizedEditorConfig,\n}: {\n config: SanitizedConfig\n isRoot?: boolean\n unSanitizedEditorConfig: ServerEditorConfig\n}): Promise<ResolvedServerFeatureMap> {\n // First remove all duplicate features. The LAST feature with a given key wins.\n unSanitizedEditorConfig.features = unSanitizedEditorConfig.features\n .reverse()\n .filter((f, i, arr) => {\n const firstIndex = arr.findIndex((f2) => f2.key === f.key)\n return firstIndex === i\n })\n .reverse()\n\n unSanitizedEditorConfig.features = sortFeaturesForOptimalLoading(unSanitizedEditorConfig.features)\n\n const featureProviderMap: ServerFeatureProviderMap = new Map(\n unSanitizedEditorConfig.features.map(\n (f) => [f.key, f] as [string, FeatureProviderServer<unknown, unknown>],\n ),\n )\n\n const resolvedFeatures: ResolvedServerFeatureMap = new Map()\n\n // Make sure all dependencies declared in the respective features exist\n let loaded = 0\n for (const featureProvider of unSanitizedEditorConfig.features) {\n if (!featureProvider.key) {\n throw new Error(\n `A Feature you've added does not have a key. Please add a key to the feature. This is used to uniquely identify the feature.`,\n )\n }\n if (featureProvider.dependencies?.length) {\n for (const dependencyKey of featureProvider.dependencies) {\n const found = unSanitizedEditorConfig.features.find((f) => f.key === dependencyKey)\n if (!found) {\n throw new Error(\n `Feature ${featureProvider.key} has a dependency ${dependencyKey} which does not exist.`,\n )\n }\n }\n }\n\n if (featureProvider.dependenciesPriority?.length) {\n for (const priorityDependencyKey of featureProvider.dependenciesPriority) {\n // look in the resolved features instead of the editorConfig.features, as a dependency requires the feature to be loaded before it, contrary to a soft-dependency\n const found = resolvedFeatures.get(priorityDependencyKey)\n if (!found) {\n const existsInEditorConfig = unSanitizedEditorConfig.features.find(\n (f) => f.key === priorityDependencyKey,\n )\n if (!existsInEditorConfig) {\n throw new Error(\n `Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which does not exist.`,\n )\n } else {\n throw new Error(\n `Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which is not loaded before it.`,\n )\n }\n }\n }\n }\n\n const feature = await featureProvider.feature({\n config,\n featureProviderMap,\n isRoot,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n resolvedFeatures.set(featureProvider.key, {\n ...feature,\n dependencies: featureProvider.dependencies,\n dependenciesPriority: featureProvider.dependenciesPriority,\n dependenciesSoft: featureProvider.dependenciesSoft,\n key: featureProvider.key,\n order: loaded,\n })\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"names":["createDependencyGraph","featureProviders","graph","fp","key","dependencies","dependenciesPriority","dependenciesSoft","featureProvider","topologicallySortFeatures","visited","stack","visit","reverse","currentPath","Error","includes","join","push","dep","pop","sortFeaturesForOptimalLoading","loadFeatures","config","isRoot","unSanitizedEditorConfig","features","filter","f","i","arr","firstIndex","findIndex","f2","featureProviderMap","Map","map","resolvedFeatures","loaded","length","dependencyKey","found","find","priorityDependencyKey","get","existsInEditorConfig","feature","set","order"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAkBA,SAASA,sBACPC,gBAA2D;IAE3D,MAAMC,QAAyB,CAAC;IAChC,KAAK,MAAMC,MAAMF,iBAAkB;QACjCC,KAAK,CAACC,GAAGC,GAAG,CAAC,GAAG;YACdC,cAAcF,GAAGE,YAAY,IAAI,EAAE;YACnCC,sBAAsBH,GAAGG,oBAAoB,IAAI,EAAE;YACnDC,kBAAkBJ,GAAGI,gBAAgB,IAAI,EAAE;YAC3CC,iBAAiBL;QACnB;IACF;IACA,OAAOD;AACT;AAEA,SAASO,0BACPR,gBAA2D;IAE3D,MAAMC,QAAQF,sBAAsBC;IACpC,MAAMS,UAAsC,CAAC;IAC7C,MAAMC,QAAmD,EAAE;IAE3D,IAAK,MAAMP,OAAOF,MAAO;QACvB,IAAI,CAACQ,OAAO,CAACN,IAAI,EAAE;YACjBQ,MAAMV,OAAOE,KAAKM,SAASC;QAC7B;IACF;IAEA,OAAOA,MAAME,OAAO;AACtB;AAEA,SAASD,MACPV,KAAsB,EACtBE,GAAW,EACXM,OAAmC,EAC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K,MAAMmC,QAAQJ,iBAAiBO,GAAG,CAACD;gBACnC,IAAI,CAACF,OAAO;oBACV,MAAMI,uBAAuBpB,wBAAwBC,QAAQ,CAACgB,IAAI,CAChE,CAACd,IAAMA,EAAExB,GAAG,KAAKuC;oBAEnB,IAAI,CAACE,sBAAsB;wBACzB,MAAM,IAAI9B,MACR,CAAC,QAAQ,EAAEP,gBAAgBJ,GAAG,CAAC,2BAA2B,EAAEuC,sBAAsB,sBAAsB,CAAC;oBAE7G,OAAO;wBACL,MAAM,IAAI5B,MACR,CAAC,QAAQ,EAAEP,gBAAgBJ,GAAG,CAAC,2BAA2B,EAAEuC,sBAAsB,+BAA+B,CAAC;oBAEtH;gBACF;YACF;QACF;QAEA,MAAMG,UAAU,MAAMtC,gBAAgBsC,OAAO,CAAC;YAC5CvB;YACAW;YACAV;YACAa;YACAZ;QACF;QACAY,iBAAiBU,GAAG,CAACvC,gBAAgBJ,GAAG,EAAE;YACxC,GAAG0C,OAAO;YACVzC,cAAcG,gBAAgBH,YAAY;YAC1CC,sBAAsBE,gBAAgBF,oBAAoB;YAC1DC,kBAAkBC,gBAAgBD,gBAAgB;YAClDH,KAAKI,gBAAgBJ,GAAG;YACxB4C,OAAOV;QACT;QAEAA;IACF;IAEA,OAAOD;AACT"}
@@ -1,5 +1,6 @@
1
+ import type { SanitizedConfig } from 'payload/config';
1
2
  import type { ResolvedServerFeatureMap, SanitizedServerFeatures } from '../../../features/types.js';
2
3
  import type { SanitizedServerEditorConfig, ServerEditorConfig } from '../types.js';
3
4
  export declare const sanitizeServerFeatures: (features: ResolvedServerFeatureMap) => SanitizedServerFeatures;
4
- export declare function sanitizeServerEditorConfig(editorConfig: ServerEditorConfig): SanitizedServerEditorConfig;
5
+ export declare function sanitizeServerEditorConfig(editorConfig: ServerEditorConfig, config: SanitizedConfig): Promise<SanitizedServerEditorConfig>;
5
6
  //# sourceMappingURL=sanitize.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIlF,eAAO,MAAM,sBAAsB,0CAEhC,uBA8DF,CAAA;AAED,wBAAgB,0BAA0B,CACxC,YAAY,EAAE,kBAAkB,GAC/B,2BAA2B,CAU7B"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../../src/field/lexical/config/server/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAE7D,OAAO,KAAK,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,MAAM,4BAA4B,CAAA;AACnG,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIlF,eAAO,MAAM,sBAAsB,0CAEhC,uBAsFF,CAAA;AAED,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,2BAA2B,CAAC,CAWtC"}