@payloadcms/richtext-lexical 3.86.0-internal.ac46214 → 4.0.0-internal.183b315

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 (1073) hide show
  1. package/dist/@types/assets.d.js +2 -0
  2. package/dist/@types/assets.d.js.map +1 -0
  3. package/dist/cell/rscEntry.d.ts +1 -1
  4. package/dist/cell/rscEntry.d.ts.map +1 -1
  5. package/dist/cell/rscEntry.js +5 -5
  6. package/dist/cell/rscEntry.js.map +1 -1
  7. package/dist/exports/client/Field-VYBSMSRY.js +2 -0
  8. package/dist/exports/client/Field-VYBSMSRY.js.map +7 -0
  9. package/dist/exports/client/RelationshipComponent-YCPAKOL7.js +2 -0
  10. package/dist/exports/client/RelationshipComponent-YCPAKOL7.js.map +7 -0
  11. package/dist/exports/client/bundled.css +1 -1
  12. package/dist/exports/client/chunk-5VIL27GI.js +2 -0
  13. package/dist/exports/client/chunk-5VIL27GI.js.map +7 -0
  14. package/dist/exports/client/{chunk-FTT5KJ6W.js → chunk-LH634DPU.js} +1 -1
  15. package/dist/exports/client/chunk-LH634DPU.js.map +7 -0
  16. package/dist/exports/client/{chunk-BZZVLW4U.js → chunk-RJ5MAOKZ.js} +1 -1
  17. package/dist/exports/client/chunk-RJ5MAOKZ.js.map +7 -0
  18. package/dist/exports/client/chunk-UD4DQ4AK.js +2 -0
  19. package/dist/exports/client/chunk-UD4DQ4AK.js.map +7 -0
  20. package/dist/exports/client/chunk-WSAPGI3Z.js +2 -0
  21. package/dist/exports/client/chunk-WSAPGI3Z.js.map +7 -0
  22. package/dist/exports/client/chunk-ZYXHC5CY.js +2 -0
  23. package/dist/exports/client/chunk-ZYXHC5CY.js.map +7 -0
  24. package/dist/exports/client/component-PHZQBOJE.js +2 -0
  25. package/dist/exports/client/component-PHZQBOJE.js.map +7 -0
  26. package/dist/exports/client/componentInline-R3EPNYWF.js +2 -0
  27. package/dist/exports/client/index.d.ts +1 -2
  28. package/dist/exports/client/index.d.ts.map +1 -1
  29. package/dist/exports/client/index.js +33 -33
  30. package/dist/exports/client/index.js.map +4 -4
  31. package/dist/exports/react/index.d.ts +1 -1
  32. package/dist/exports/react/index.d.ts.map +1 -1
  33. package/dist/exports/react/index.js.map +1 -1
  34. package/dist/exports/server/rsc.browser.d.ts +11 -0
  35. package/dist/exports/server/rsc.browser.d.ts.map +1 -0
  36. package/dist/exports/server/rsc.browser.js +10 -0
  37. package/dist/exports/server/rsc.browser.js.map +1 -0
  38. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  39. package/dist/features/align/client/toolbarAlignGroup.js +1 -0
  40. package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
  41. package/dist/features/blockquote/server/index.d.ts +1 -4
  42. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  43. package/dist/features/blockquote/server/index.js +2 -39
  44. package/dist/features/blockquote/server/index.js.map +1 -1
  45. package/dist/features/blockquote/server/schema.d.ts +8 -0
  46. package/dist/features/blockquote/server/schema.d.ts.map +1 -0
  47. package/dist/features/blockquote/server/schema.js +15 -0
  48. package/dist/features/blockquote/server/schema.js.map +1 -0
  49. package/dist/features/blocks/client/component/BlockContent.d.ts +10 -0
  50. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  51. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  52. package/dist/features/blocks/client/component/index.css +178 -0
  53. package/dist/features/blocks/client/component/index.d.ts +4 -3
  54. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  55. package/dist/features/blocks/client/component/index.js +89 -25
  56. package/dist/features/blocks/client/component/index.js.map +1 -1
  57. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  58. package/dist/features/blocks/client/componentInline/index.css +85 -0
  59. package/dist/features/blocks/client/componentInline/index.d.ts +4 -3
  60. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  61. package/dist/features/blocks/client/componentInline/index.js +34 -14
  62. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  63. package/dist/features/blocks/client/index.d.ts.map +1 -1
  64. package/dist/features/blocks/client/index.js +0 -2
  65. package/dist/features/blocks/client/index.js.map +1 -1
  66. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  67. package/dist/features/blocks/client/markdown/markdownTransformer.js +4 -4
  68. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  69. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
  70. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  71. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  72. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +2 -2
  73. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  74. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  75. package/dist/features/blocks/client/plugin/index.d.ts +1 -1
  76. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  77. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  78. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts +1 -1
  79. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
  80. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +4 -0
  81. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  82. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +26 -0
  83. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts +1 -1
  84. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts.map +1 -1
  85. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +4 -1
  86. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
  87. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +40 -0
  88. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts +1 -1
  89. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts.map +1 -1
  90. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +7 -8
  91. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
  92. package/dist/features/blocks/premade/CodeBlock/Component/index.css +171 -0
  93. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts +1 -2
  94. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  95. package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
  96. package/dist/features/blocks/server/index.d.ts +1 -0
  97. package/dist/features/blocks/server/index.d.ts.map +1 -1
  98. package/dist/features/blocks/server/index.js +20 -66
  99. package/dist/features/blocks/server/index.js.map +1 -1
  100. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  101. package/dist/features/blocks/server/markdown/markdownTransformer.js +4 -4
  102. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  103. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -18
  104. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  105. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  106. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +2 -10
  107. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  108. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  109. package/dist/features/blocks/server/schema.d.ts +45 -0
  110. package/dist/features/blocks/server/schema.d.ts.map +1 -0
  111. package/dist/features/blocks/server/schema.js +139 -0
  112. package/dist/features/blocks/server/schema.js.map +1 -0
  113. package/dist/features/blocks/server/validate.d.ts +1 -2
  114. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  115. package/dist/features/blocks/server/validate.js.map +1 -1
  116. package/dist/features/converters/htmlToLexical/index.d.ts +1 -1
  117. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  118. package/dist/features/converters/htmlToLexical/index.js.map +1 -1
  119. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts +1 -1
  120. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts.map +1 -1
  121. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.js.map +1 -1
  122. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts +1 -1
  123. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
  124. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  125. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts +1 -1
  126. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts.map +1 -1
  127. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.js.map +1 -1
  128. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts +1 -1
  129. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts.map +1 -1
  130. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.js.map +1 -1
  131. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts +1 -1
  132. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
  133. package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
  134. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts +1 -1
  135. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  136. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  137. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts +1 -1
  138. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts.map +1 -1
  139. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.js.map +1 -1
  140. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts +1 -1
  141. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts.map +1 -1
  142. package/dist/features/converters/lexicalToHtml/async/converters/tab.js.map +1 -1
  143. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts +1 -1
  144. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
  145. package/dist/features/converters/lexicalToHtml/async/converters/table.js +1 -1
  146. package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
  147. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts +1 -1
  148. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
  149. package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
  150. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts +1 -1
  151. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
  152. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  153. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts +1 -1
  154. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts.map +1 -1
  155. package/dist/features/converters/lexicalToHtml/async/defaultConverters.js.map +1 -1
  156. package/dist/features/converters/lexicalToHtml/async/types.d.ts +15 -16
  157. package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
  158. package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
  159. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  160. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  161. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts +1 -1
  162. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts.map +1 -1
  163. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.js.map +1 -1
  164. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts +1 -1
  165. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
  166. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  167. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts +1 -1
  168. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts.map +1 -1
  169. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.js.map +1 -1
  170. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts +1 -1
  171. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts.map +1 -1
  172. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.js.map +1 -1
  173. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts +1 -1
  174. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
  175. package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
  176. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts +1 -1
  177. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  178. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  179. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts +1 -1
  180. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts.map +1 -1
  181. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.js.map +1 -1
  182. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts +1 -1
  183. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts.map +1 -1
  184. package/dist/features/converters/lexicalToHtml/sync/converters/tab.js.map +1 -1
  185. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts +1 -1
  186. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
  187. package/dist/features/converters/lexicalToHtml/sync/converters/table.js +1 -1
  188. package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
  189. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts +1 -1
  190. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
  191. package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
  192. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts +1 -1
  193. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
  194. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  195. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts +1 -1
  196. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts.map +1 -1
  197. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.js.map +1 -1
  198. package/dist/features/converters/lexicalToHtml/sync/types.d.ts +15 -16
  199. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  200. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  201. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +6 -4
  202. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  203. package/dist/features/converters/lexicalToJSX/Component/index.js +5 -4
  204. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  205. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts +1 -1
  206. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts.map +1 -1
  207. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
  208. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts +1 -1
  209. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  210. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  211. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts +1 -1
  212. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts.map +1 -1
  213. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
  214. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts +1 -1
  215. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts.map +1 -1
  216. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
  217. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts +1 -1
  218. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts.map +1 -1
  219. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
  220. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts +1 -1
  221. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  222. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  223. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts +1 -1
  224. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts.map +1 -1
  225. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
  226. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts +1 -1
  227. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts.map +1 -1
  228. package/dist/features/converters/lexicalToJSX/converter/converters/tab.js.map +1 -1
  229. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts +1 -1
  230. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts.map +1 -1
  231. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
  232. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts +1 -1
  233. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts.map +1 -1
  234. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
  235. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts +1 -1
  236. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  237. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  238. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts +1 -1
  239. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts.map +1 -1
  240. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.js.map +1 -1
  241. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +1 -1
  242. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  243. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  244. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +13 -15
  245. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  246. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  247. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  248. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +1 -1
  249. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js.map +1 -1
  250. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +13 -15
  251. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
  252. package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
  253. package/dist/features/converters/markdownToLexical/index.d.ts +1 -1
  254. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  255. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  256. package/dist/features/debug/jsxConverter/client/plugin/index.d.ts +1 -1
  257. package/dist/features/debug/jsxConverter/client/plugin/index.d.ts.map +1 -1
  258. package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -0
  259. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  260. package/dist/features/debug/jsxConverter/client/plugin/style.css +9 -0
  261. package/dist/features/debug/testRecorder/client/plugin/index.css +51 -0
  262. package/dist/features/debug/testRecorder/client/plugin/index.d.ts +1 -1
  263. package/dist/features/debug/testRecorder/client/plugin/index.d.ts.map +1 -1
  264. package/dist/features/debug/testRecorder/client/plugin/index.js +1 -0
  265. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  266. package/dist/features/debug/treeView/client/plugin/index.css +81 -0
  267. package/dist/features/debug/treeView/client/plugin/index.d.ts +1 -1
  268. package/dist/features/debug/treeView/client/plugin/index.d.ts.map +1 -1
  269. package/dist/features/debug/treeView/client/plugin/index.js +1 -0
  270. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  271. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +91 -0
  272. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts +1 -1
  273. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  274. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +3 -2
  275. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  276. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.css +11 -0
  277. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts +1 -1
  278. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  279. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +1 -0
  280. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  281. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +1 -1
  282. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  283. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +166 -0
  284. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts +17 -0
  285. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  286. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js +219 -0
  287. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  288. package/dist/features/experimental_table/client/plugins/TablePlugin/index.css +235 -0
  289. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
  290. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  291. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +95 -104
  292. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  293. package/dist/features/experimental_table/server/index.d.ts +1 -6
  294. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  295. package/dist/features/experimental_table/server/index.js +4 -102
  296. package/dist/features/experimental_table/server/index.js.map +1 -1
  297. package/dist/features/experimental_table/server/schema.d.ts +27 -0
  298. package/dist/features/experimental_table/server/schema.d.ts.map +1 -0
  299. package/dist/features/experimental_table/server/schema.js +107 -0
  300. package/dist/features/experimental_table/server/schema.js.map +1 -0
  301. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  302. package/dist/features/heading/server/index.d.ts +2 -4
  303. package/dist/features/heading/server/index.d.ts.map +1 -1
  304. package/dist/features/heading/server/index.js +2 -39
  305. package/dist/features/heading/server/index.js.map +1 -1
  306. package/dist/features/heading/server/schema.d.ts +10 -0
  307. package/dist/features/heading/server/schema.d.ts.map +1 -0
  308. package/dist/features/heading/server/schema.js +37 -0
  309. package/dist/features/heading/server/schema.js.map +1 -0
  310. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
  311. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  312. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  313. package/dist/features/horizontalRule/client/plugin/index.css +25 -0
  314. package/dist/features/horizontalRule/client/plugin/index.d.ts +1 -1
  315. package/dist/features/horizontalRule/client/plugin/index.d.ts.map +1 -1
  316. package/dist/features/horizontalRule/client/plugin/index.js +73 -4
  317. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  318. package/dist/features/horizontalRule/server/index.d.ts +1 -0
  319. package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
  320. package/dist/features/horizontalRule/server/index.js +2 -8
  321. package/dist/features/horizontalRule/server/index.js.map +1 -1
  322. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -5
  323. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  324. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  325. package/dist/features/horizontalRule/server/schema.d.ts +7 -0
  326. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -0
  327. package/dist/features/horizontalRule/server/schema.js +25 -0
  328. package/dist/features/horizontalRule/server/schema.js.map +1 -0
  329. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  330. package/dist/features/link/client/index.d.ts.map +1 -1
  331. package/dist/features/link/client/index.js.map +1 -1
  332. package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
  333. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  334. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  335. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  336. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +28 -8
  337. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  338. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +112 -0
  339. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts +1 -1
  340. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  341. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -0
  342. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  343. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts +1 -1
  344. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts.map +1 -1
  345. package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
  346. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  347. package/dist/features/link/markdownTransformer.d.ts +1 -1
  348. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  349. package/dist/features/link/markdownTransformer.js.map +1 -1
  350. package/dist/features/link/markdownTransformer.spec.js.map +1 -1
  351. package/dist/features/link/nodes/AutoLinkNode.d.ts +3 -3
  352. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  353. package/dist/features/link/nodes/AutoLinkNode.js +2 -1
  354. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  355. package/dist/features/link/nodes/LinkNode.d.ts +3 -3
  356. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  357. package/dist/features/link/nodes/LinkNode.js +2 -1
  358. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  359. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  360. package/dist/features/link/server/baseFields.js.map +1 -1
  361. package/dist/features/link/server/graphQLPopulationPromise.d.ts +1 -1
  362. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  363. package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
  364. package/dist/features/link/server/index.d.ts +2 -1
  365. package/dist/features/link/server/index.d.ts.map +1 -1
  366. package/dist/features/link/server/index.js +3 -71
  367. package/dist/features/link/server/index.js.map +1 -1
  368. package/dist/features/link/server/schema.d.ts +32 -0
  369. package/dist/features/link/server/schema.d.ts.map +1 -0
  370. package/dist/features/link/server/schema.js +169 -0
  371. package/dist/features/link/server/schema.js.map +1 -0
  372. package/dist/features/link/server/validate.d.ts +1 -1
  373. package/dist/features/link/server/validate.d.ts.map +1 -1
  374. package/dist/features/link/server/validate.js.map +1 -1
  375. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  376. package/dist/features/lists/checklist/server/index.js +3 -7
  377. package/dist/features/lists/checklist/server/index.js.map +1 -1
  378. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  379. package/dist/features/lists/orderedList/server/index.js +3 -7
  380. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  381. package/dist/features/lists/plugin/index.d.ts +0 -9
  382. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  383. package/dist/features/lists/plugin/index.js.map +1 -1
  384. package/dist/features/lists/shared/markdown.d.ts.map +1 -1
  385. package/dist/features/lists/shared/schema.d.ts +18 -0
  386. package/dist/features/lists/shared/schema.d.ts.map +1 -0
  387. package/dist/features/lists/shared/schema.js +62 -0
  388. package/dist/features/lists/shared/schema.js.map +1 -0
  389. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  390. package/dist/features/lists/unorderedList/server/index.js +3 -7
  391. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  392. package/dist/features/relationship/client/components/RelationshipComponent.d.ts +2 -2
  393. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  394. package/dist/features/relationship/client/components/RelationshipComponent.js +29 -4
  395. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  396. package/dist/features/relationship/client/components/index.css +112 -0
  397. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  398. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
  399. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  400. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  401. package/dist/features/relationship/client/plugins/index.d.ts +1 -1
  402. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  403. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  404. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  405. package/dist/features/relationship/client/utils/useEnabledRelationships.js +9 -40
  406. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  407. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +1 -1
  408. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  409. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  410. package/dist/features/relationship/server/index.d.ts +1 -0
  411. package/dist/features/relationship/server/index.d.ts.map +1 -1
  412. package/dist/features/relationship/server/index.js +2 -0
  413. package/dist/features/relationship/server/index.js.map +1 -1
  414. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -10
  415. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  416. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  417. package/dist/features/relationship/server/schema.d.ts +28 -0
  418. package/dist/features/relationship/server/schema.d.ts.map +1 -0
  419. package/dist/features/relationship/server/schema.js +80 -0
  420. package/dist/features/relationship/server/schema.js.map +1 -0
  421. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +23 -0
  422. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -0
  423. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +34 -0
  424. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -0
  425. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  426. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  427. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  428. package/dist/features/toolbars/fixed/client/Toolbar/index.css +87 -0
  429. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts +1 -1
  430. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  431. package/dist/features/toolbars/fixed/client/Toolbar/index.js +1 -0
  432. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  433. package/dist/features/toolbars/inline/client/Toolbar/index.css +43 -0
  434. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts +1 -1
  435. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  436. package/dist/features/toolbars/inline/client/Toolbar/index.js +1 -0
  437. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  438. package/dist/features/toolbars/shared/ToolbarButton/index.css +57 -0
  439. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  440. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  441. package/dist/features/toolbars/shared/ToolbarButton/index.js +80 -74
  442. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  443. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  444. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +5 -2
  445. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  446. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +214 -0
  447. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  448. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  449. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +11 -7
  450. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  451. package/dist/features/toolbars/types.d.ts +5 -1
  452. package/dist/features/toolbars/types.d.ts.map +1 -1
  453. package/dist/features/toolbars/types.js.map +1 -1
  454. package/dist/features/typesClient.d.ts +1 -1
  455. package/dist/features/typesClient.d.ts.map +1 -1
  456. package/dist/features/typesClient.js.map +1 -1
  457. package/dist/features/typesServer.d.ts +18 -58
  458. package/dist/features/typesServer.d.ts.map +1 -1
  459. package/dist/features/typesServer.js.map +1 -1
  460. package/dist/features/upload/client/component/index.css +214 -0
  461. package/dist/features/upload/client/component/index.d.ts +2 -2
  462. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  463. package/dist/features/upload/client/component/index.js +86 -63
  464. package/dist/features/upload/client/component/index.js.map +1 -1
  465. package/dist/features/upload/client/component/pending/index.d.ts +0 -1
  466. package/dist/features/upload/client/component/pending/index.d.ts.map +1 -1
  467. package/dist/features/upload/client/component/pending/index.js.map +1 -1
  468. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  469. package/dist/features/upload/client/nodes/UploadNode.d.ts +1 -1
  470. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  471. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  472. package/dist/features/upload/client/plugin/index.d.ts +1 -1
  473. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  474. package/dist/features/upload/client/plugin/index.js.map +1 -1
  475. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +1 -1
  476. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  477. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  478. package/dist/features/upload/server/index.d.ts +1 -0
  479. package/dist/features/upload/server/index.d.ts.map +1 -1
  480. package/dist/features/upload/server/index.js +3 -80
  481. package/dist/features/upload/server/index.js.map +1 -1
  482. package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -55
  483. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  484. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  485. package/dist/features/upload/server/nodes/conversions.d.ts.map +1 -1
  486. package/dist/features/upload/server/nodes/conversions.js.map +1 -1
  487. package/dist/features/upload/server/schema.d.ts +52 -0
  488. package/dist/features/upload/server/schema.d.ts.map +1 -0
  489. package/dist/features/upload/server/schema.js +129 -0
  490. package/dist/features/upload/server/schema.js.map +1 -0
  491. package/dist/features/upload/server/validate.d.ts +1 -1
  492. package/dist/features/upload/server/validate.d.ts.map +1 -1
  493. package/dist/features/upload/server/validate.js.map +1 -1
  494. package/dist/field/Diff/converters/link.d.ts +1 -1
  495. package/dist/field/Diff/converters/link.d.ts.map +1 -1
  496. package/dist/field/Diff/converters/link.js.map +1 -1
  497. package/dist/field/Diff/converters/listitem/index.css +80 -0
  498. package/dist/field/Diff/converters/listitem/index.d.ts +2 -2
  499. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  500. package/dist/field/Diff/converters/listitem/index.js +1 -0
  501. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  502. package/dist/field/Diff/converters/relationship/index.css +108 -0
  503. package/dist/field/Diff/converters/relationship/index.d.ts +2 -2
  504. package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
  505. package/dist/field/Diff/converters/relationship/index.js +11 -28
  506. package/dist/field/Diff/converters/relationship/index.js.map +1 -1
  507. package/dist/field/Diff/converters/unknown/index.css +37 -0
  508. package/dist/field/Diff/converters/unknown/index.d.ts +1 -1
  509. package/dist/field/Diff/converters/unknown/index.d.ts.map +1 -1
  510. package/dist/field/Diff/converters/unknown/index.js +1 -0
  511. package/dist/field/Diff/converters/unknown/index.js.map +1 -1
  512. package/dist/field/Diff/converters/upload/index.css +175 -0
  513. package/dist/field/Diff/converters/upload/index.d.ts +2 -2
  514. package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
  515. package/dist/field/Diff/converters/upload/index.js +7 -2
  516. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  517. package/dist/field/Diff/index.css +156 -0
  518. package/dist/field/Diff/index.d.ts +1 -1
  519. package/dist/field/Diff/index.d.ts.map +1 -1
  520. package/dist/field/Diff/index.js +1 -0
  521. package/dist/field/Diff/index.js.map +1 -1
  522. package/dist/field/Field.d.ts +3 -3
  523. package/dist/field/Field.d.ts.map +1 -1
  524. package/dist/field/Field.js +12 -11
  525. package/dist/field/Field.js.map +1 -1
  526. package/dist/field/RenderLexical/index.d.ts +2 -2
  527. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  528. package/dist/field/RenderLexical/index.js.map +1 -1
  529. package/dist/field/RichTextViewProvider.d.ts +1 -1
  530. package/dist/field/RichTextViewProvider.d.ts.map +1 -1
  531. package/dist/field/RichTextViewProvider.js.map +1 -1
  532. package/dist/field/ViewSelector.css +32 -0
  533. package/dist/field/ViewSelector.d.ts +1 -1
  534. package/dist/field/ViewSelector.d.ts.map +1 -1
  535. package/dist/field/ViewSelector.js +1 -0
  536. package/dist/field/ViewSelector.js.map +1 -1
  537. package/dist/field/bundled.css +1 -1
  538. package/dist/field/clientEntry.d.ts +29 -0
  539. package/dist/field/clientEntry.d.ts.map +1 -0
  540. package/dist/field/clientEntry.js +86 -0
  541. package/dist/field/clientEntry.js.map +1 -0
  542. package/dist/field/index.css +57 -0
  543. package/dist/field/index.d.ts +1 -1
  544. package/dist/field/index.d.ts.map +1 -1
  545. package/dist/field/index.js +1 -1
  546. package/dist/field/index.js.map +1 -1
  547. package/dist/field/rscEntry.d.ts +1 -1
  548. package/dist/field/rscEntry.d.ts.map +1 -1
  549. package/dist/field/rscEntry.js +2 -0
  550. package/dist/field/rscEntry.js.map +1 -1
  551. package/dist/hooks.d.ts +6 -0
  552. package/dist/hooks.d.ts.map +1 -0
  553. package/dist/hooks.js +548 -0
  554. package/dist/hooks.js.map +1 -0
  555. package/dist/index.d.ts +11 -18
  556. package/dist/index.d.ts.map +1 -1
  557. package/dist/index.js +67 -632
  558. package/dist/index.js.map +1 -1
  559. package/dist/lexical/LexicalEditor.css +50 -0
  560. package/dist/lexical/LexicalEditor.d.ts +1 -1
  561. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  562. package/dist/lexical/LexicalEditor.js +37 -2
  563. package/dist/lexical/LexicalEditor.js.map +1 -1
  564. package/dist/lexical/LexicalProvider.d.ts +1 -1
  565. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  566. package/dist/lexical/LexicalProvider.js +22 -7
  567. package/dist/lexical/LexicalProvider.js.map +1 -1
  568. package/dist/lexical/config/client/EditorConfigProvider.d.ts +1 -1
  569. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  570. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  571. package/dist/lexical/config/client/loader.d.ts +1 -1
  572. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  573. package/dist/lexical/config/client/loader.js +5 -1
  574. package/dist/lexical/config/client/loader.js.map +1 -1
  575. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  576. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  577. package/dist/lexical/config/client/sanitize.js.map +1 -1
  578. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  579. package/dist/lexical/config/server/loader.js +12 -9
  580. package/dist/lexical/config/server/loader.js.map +1 -1
  581. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  582. package/dist/lexical/config/server/sanitize.js +9 -17
  583. package/dist/lexical/config/server/sanitize.js.map +1 -1
  584. package/dist/lexical/config/types.d.ts +1 -1
  585. package/dist/lexical/config/types.d.ts.map +1 -1
  586. package/dist/lexical/config/types.js.map +1 -1
  587. package/dist/lexical/nodes/index.d.ts +1 -1
  588. package/dist/lexical/nodes/index.d.ts.map +1 -1
  589. package/dist/lexical/nodes/index.js.map +1 -1
  590. package/dist/lexical/plugins/DecoratorPlugin/index.css +11 -0
  591. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts +1 -1
  592. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  593. package/dist/lexical/plugins/DecoratorPlugin/index.js +1 -0
  594. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  595. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +52 -0
  596. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts +1 -1
  597. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  598. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +1 -0
  599. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  600. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +1 -1
  601. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  602. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  603. package/dist/lexical/plugins/SlashMenu/index.css +65 -0
  604. package/dist/lexical/plugins/SlashMenu/index.d.ts +1 -1
  605. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  606. package/dist/lexical/plugins/SlashMenu/index.js +2 -0
  607. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  608. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +40 -0
  609. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +1 -1
  610. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  611. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +1 -0
  612. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  613. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  614. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +84 -0
  615. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +1 -1
  616. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  617. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +15 -8
  618. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  619. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +1 -1
  620. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  621. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  622. package/dist/lexical/theme/EditorTheme.css +359 -0
  623. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  624. package/dist/lexical/theme/EditorTheme.js +1 -0
  625. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  626. package/dist/lexical/ui/ContentEditable.css +95 -0
  627. package/dist/lexical/ui/ContentEditable.d.ts +1 -1
  628. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  629. package/dist/lexical/ui/ContentEditable.js +1 -0
  630. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  631. package/dist/lexical/ui/icons/Add/index.d.ts +4 -1
  632. package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
  633. package/dist/lexical/ui/icons/Add/index.js +19 -12
  634. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  635. package/dist/lexical/ui/icons/Add/index.svg +2 -3
  636. package/dist/lexical/ui/icons/Add/light.svg +2 -3
  637. package/dist/lexical/ui/icons/AlignCenter/index.d.ts +3 -1
  638. package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
  639. package/dist/lexical/ui/icons/AlignCenter/index.js +15 -19
  640. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  641. package/dist/lexical/ui/icons/AlignJustify/index.d.ts +3 -1
  642. package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
  643. package/dist/lexical/ui/icons/AlignJustify/index.js +15 -19
  644. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  645. package/dist/lexical/ui/icons/AlignLeft/index.d.ts +3 -1
  646. package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
  647. package/dist/lexical/ui/icons/AlignLeft/index.js +15 -19
  648. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  649. package/dist/lexical/ui/icons/AlignRight/index.d.ts +3 -1
  650. package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
  651. package/dist/lexical/ui/icons/AlignRight/index.js +15 -19
  652. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  653. package/dist/lexical/ui/icons/Block/index.d.ts +3 -1
  654. package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
  655. package/dist/lexical/ui/icons/Block/index.js +13 -28
  656. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  657. package/dist/lexical/ui/icons/Blockquote/index.d.ts +3 -1
  658. package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
  659. package/dist/lexical/ui/icons/Blockquote/index.js +9 -6
  660. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  661. package/dist/lexical/ui/icons/Bold/index.d.ts +3 -1
  662. package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
  663. package/dist/lexical/ui/icons/Bold/index.js +13 -8
  664. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  665. package/dist/lexical/ui/icons/Checklist/index.d.ts +4 -1
  666. package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
  667. package/dist/lexical/ui/icons/Checklist/index.js +17 -18
  668. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  669. package/dist/lexical/ui/icons/Code/index.d.ts +3 -1
  670. package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
  671. package/dist/lexical/ui/icons/Code/index.js +15 -13
  672. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  673. package/dist/lexical/ui/icons/CodeBlock/index.d.ts +4 -1
  674. package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
  675. package/dist/lexical/ui/icons/CodeBlock/index.js +18 -7
  676. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  677. package/dist/lexical/ui/icons/Collapse/index.d.ts +3 -1
  678. package/dist/lexical/ui/icons/Collapse/index.d.ts.map +1 -1
  679. package/dist/lexical/ui/icons/Collapse/index.js +10 -8
  680. package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
  681. package/dist/lexical/ui/icons/DraggableBlock/index.svg +7 -7
  682. package/dist/lexical/ui/icons/DraggableBlock/light.svg +7 -7
  683. package/dist/lexical/ui/icons/Expand/index.d.ts +5 -0
  684. package/dist/lexical/ui/icons/Expand/index.d.ts.map +1 -0
  685. package/dist/lexical/ui/icons/Expand/index.js +22 -0
  686. package/dist/lexical/ui/icons/Expand/index.js.map +1 -0
  687. package/dist/lexical/ui/icons/H1/index.d.ts +3 -1
  688. package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
  689. package/dist/lexical/ui/icons/H1/index.js +9 -6
  690. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  691. package/dist/lexical/ui/icons/H2/index.d.ts +3 -1
  692. package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
  693. package/dist/lexical/ui/icons/H2/index.js +9 -6
  694. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  695. package/dist/lexical/ui/icons/H3/index.d.ts +3 -1
  696. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  697. package/dist/lexical/ui/icons/H3/index.js +9 -6
  698. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  699. package/dist/lexical/ui/icons/H4/index.d.ts +3 -1
  700. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  701. package/dist/lexical/ui/icons/H4/index.js +9 -6
  702. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  703. package/dist/lexical/ui/icons/H5/index.d.ts +3 -1
  704. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  705. package/dist/lexical/ui/icons/H5/index.js +9 -6
  706. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  707. package/dist/lexical/ui/icons/H6/index.d.ts +3 -1
  708. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  709. package/dist/lexical/ui/icons/H6/index.js +9 -6
  710. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  711. package/dist/lexical/ui/icons/HorizontalRule/index.d.ts +3 -1
  712. package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
  713. package/dist/lexical/ui/icons/HorizontalRule/index.js +11 -11
  714. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  715. package/dist/lexical/ui/icons/IndentDecrease/index.d.ts +3 -1
  716. package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
  717. package/dist/lexical/ui/icons/IndentDecrease/index.js +18 -22
  718. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  719. package/dist/lexical/ui/icons/IndentIncrease/index.d.ts +3 -1
  720. package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
  721. package/dist/lexical/ui/icons/IndentIncrease/index.js +15 -22
  722. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  723. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts +3 -1
  724. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
  725. package/dist/lexical/ui/icons/InlineBlocks/index.js +9 -6
  726. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
  727. package/dist/lexical/ui/icons/Italic/index.d.ts +3 -1
  728. package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
  729. package/dist/lexical/ui/icons/Italic/index.js +13 -8
  730. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  731. package/dist/lexical/ui/icons/Link/index.d.ts +4 -1
  732. package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
  733. package/dist/lexical/ui/icons/Link/index.js +14 -9
  734. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  735. package/dist/lexical/ui/icons/Meatballs/index.d.ts +4 -1
  736. package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
  737. package/dist/lexical/ui/icons/Meatballs/index.js +19 -15
  738. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
  739. package/dist/lexical/ui/icons/OrderedList/index.d.ts +4 -1
  740. package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
  741. package/dist/lexical/ui/icons/OrderedList/index.js +19 -25
  742. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  743. package/dist/lexical/ui/icons/Page/index.d.ts +5 -0
  744. package/dist/lexical/ui/icons/Page/index.d.ts.map +1 -0
  745. package/dist/lexical/ui/icons/Page/index.js +21 -0
  746. package/dist/lexical/ui/icons/Page/index.js.map +1 -0
  747. package/dist/lexical/ui/icons/Relationship/index.d.ts +3 -1
  748. package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
  749. package/dist/lexical/ui/icons/Relationship/index.js +13 -25
  750. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  751. package/dist/lexical/ui/icons/Strikethrough/index.d.ts +3 -1
  752. package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
  753. package/dist/lexical/ui/icons/Strikethrough/index.js +13 -13
  754. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  755. package/dist/lexical/ui/icons/Subscript/index.d.ts +3 -1
  756. package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
  757. package/dist/lexical/ui/icons/Subscript/index.js +10 -7
  758. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  759. package/dist/lexical/ui/icons/Superscript/index.d.ts +3 -1
  760. package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
  761. package/dist/lexical/ui/icons/Superscript/index.js +10 -7
  762. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  763. package/dist/lexical/ui/icons/Table/index.d.ts +4 -1
  764. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
  765. package/dist/lexical/ui/icons/Table/index.js +20 -15
  766. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  767. package/dist/lexical/ui/icons/Text/index.d.ts +4 -1
  768. package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
  769. package/dist/lexical/ui/icons/Text/index.js +17 -8
  770. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  771. package/dist/lexical/ui/icons/Trash/index.d.ts +10 -0
  772. package/dist/lexical/ui/icons/Trash/index.d.ts.map +1 -0
  773. package/dist/lexical/ui/icons/Trash/index.js +29 -0
  774. package/dist/lexical/ui/icons/Trash/index.js.map +1 -0
  775. package/dist/lexical/ui/icons/Underline/index.d.ts +3 -1
  776. package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
  777. package/dist/lexical/ui/icons/Underline/index.js +16 -14
  778. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  779. package/dist/lexical/ui/icons/UnorderedList/index.d.ts +3 -1
  780. package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
  781. package/dist/lexical/ui/icons/UnorderedList/index.js +13 -40
  782. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  783. package/dist/lexical/ui/icons/Upload/index.d.ts +3 -1
  784. package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
  785. package/dist/lexical/ui/icons/Upload/index.js +15 -22
  786. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  787. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  788. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
  789. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  790. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  791. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  792. package/dist/types/builtInNodes.d.ts +14 -0
  793. package/dist/types/builtInNodes.d.ts.map +1 -0
  794. package/dist/types/builtInNodes.js +203 -0
  795. package/dist/types/builtInNodes.js.map +1 -0
  796. package/dist/{types.d.ts → types/index.d.ts} +25 -26
  797. package/dist/types/index.d.ts.map +1 -0
  798. package/dist/types/index.js +2 -0
  799. package/dist/types/index.js.map +1 -0
  800. package/dist/types/jsonSchemaHelpers.d.ts +30 -0
  801. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -0
  802. package/dist/types/jsonSchemaHelpers.js +58 -0
  803. package/dist/types/jsonSchemaHelpers.js.map +1 -0
  804. package/dist/types/nodeTypes.d.ts +128 -0
  805. package/dist/types/nodeTypes.d.ts.map +1 -0
  806. package/dist/types/nodeTypes.js +6 -0
  807. package/dist/types/nodeTypes.js.map +1 -0
  808. package/dist/types/schema.d.ts +6 -0
  809. package/dist/types/schema.d.ts.map +1 -0
  810. package/dist/types/schema.js +83 -0
  811. package/dist/types/schema.js.map +1 -0
  812. package/dist/utilities/buildEditorState.d.ts +18 -4
  813. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  814. package/dist/utilities/buildEditorState.js +21 -0
  815. package/dist/utilities/buildEditorState.js.map +1 -1
  816. package/dist/utilities/buildInitialState.d.ts +2 -1
  817. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  818. package/dist/utilities/buildInitialState.js.map +1 -1
  819. package/dist/utilities/createClientFeature.d.ts +1 -1
  820. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  821. package/dist/utilities/createClientFeature.js.map +1 -1
  822. package/dist/utilities/editorConfigFactory.d.ts +1 -1
  823. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  824. package/dist/utilities/editorConfigFactory.js.map +1 -1
  825. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
  826. package/dist/utilities/fieldsDrawer/Drawer.js +19 -10
  827. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  828. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -1
  829. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  830. package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -7
  831. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  832. package/dist/utilities/fieldsDrawer/index.css +12 -0
  833. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +29 -0
  834. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -0
  835. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js +97 -0
  836. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -0
  837. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +1 -0
  838. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  839. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +34 -18
  840. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  841. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  842. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  843. package/dist/utilities/generateImportMap.d.ts +1 -1
  844. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  845. package/dist/utilities/generateImportMap.js +7 -3
  846. package/dist/utilities/generateImportMap.js.map +1 -1
  847. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  848. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  849. package/dist/utilities/initLexicalFeatures.d.ts +1 -1
  850. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  851. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  852. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  853. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  854. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  855. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  856. package/dist/validate/index.d.ts.map +1 -1
  857. package/package.json +18 -22
  858. package/dist/exports/client/Component-DOSSWC76.js +0 -2
  859. package/dist/exports/client/Component-DOSSWC76.js.map +0 -7
  860. package/dist/exports/client/Component-MBLHTKDK.js +0 -2
  861. package/dist/exports/client/Component-MBLHTKDK.js.map +0 -7
  862. package/dist/exports/client/Field-OVF2FPGD.js +0 -2
  863. package/dist/exports/client/Field-OVF2FPGD.js.map +0 -7
  864. package/dist/exports/client/RelationshipComponent-BG3DPV3T.js +0 -2
  865. package/dist/exports/client/RelationshipComponent-BG3DPV3T.js.map +0 -7
  866. package/dist/exports/client/chunk-BZZVLW4U.js.map +0 -7
  867. package/dist/exports/client/chunk-F26IQ5RE.js +0 -2
  868. package/dist/exports/client/chunk-F26IQ5RE.js.map +0 -7
  869. package/dist/exports/client/chunk-FTT5KJ6W.js.map +0 -7
  870. package/dist/exports/client/chunk-INBEEENE.js +0 -2
  871. package/dist/exports/client/chunk-INBEEENE.js.map +0 -7
  872. package/dist/exports/client/chunk-QJ5EETIB.js +0 -2
  873. package/dist/exports/client/chunk-QJ5EETIB.js.map +0 -7
  874. package/dist/exports/client/chunk-XFA5M7FY.js +0 -2
  875. package/dist/exports/client/chunk-XFA5M7FY.js.map +0 -7
  876. package/dist/exports/client/component-XIHC3W6W.js +0 -2
  877. package/dist/exports/client/component-XIHC3W6W.js.map +0 -7
  878. package/dist/exports/client/componentInline-A4H3EY3L.js +0 -2
  879. package/dist/exports/server/migrate.d.ts +0 -16
  880. package/dist/exports/server/migrate.d.ts.map +0 -1
  881. package/dist/exports/server/migrate.js +0 -16
  882. package/dist/exports/server/migrate.js.map +0 -1
  883. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts +0 -4
  884. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts.map +0 -1
  885. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js +0 -7
  886. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js.map +0 -1
  887. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts +0 -4
  888. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts.map +0 -1
  889. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js +0 -38
  890. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js.map +0 -1
  891. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts +0 -4
  892. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts.map +0 -1
  893. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js +0 -9
  894. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js.map +0 -1
  895. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts +0 -4
  896. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts.map +0 -1
  897. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js +0 -33
  898. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js.map +0 -1
  899. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts +0 -6
  900. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts.map +0 -1
  901. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js +0 -9
  902. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js.map +0 -1
  903. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts +0 -70
  904. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts.map +0 -1
  905. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js +0 -104
  906. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js.map +0 -1
  907. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts +0 -27
  908. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts.map +0 -1
  909. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js +0 -2
  910. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js.map +0 -1
  911. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts +0 -39
  912. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts.map +0 -1
  913. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js +0 -122
  914. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js.map +0 -1
  915. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts +0 -12
  916. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts.map +0 -1
  917. package/dist/features/converters/lexicalToHtml_deprecated/index.js +0 -11
  918. package/dist/features/converters/lexicalToHtml_deprecated/index.js.map +0 -1
  919. package/dist/features/link/nodes/types.d.ts +0 -27
  920. package/dist/features/link/nodes/types.d.ts.map +0 -1
  921. package/dist/features/link/nodes/types.js +0 -2
  922. package/dist/features/link/nodes/types.js.map +0 -1
  923. package/dist/features/lists/htmlConverter.d.ts +0 -5
  924. package/dist/features/lists/htmlConverter.d.ts.map +0 -1
  925. package/dist/features/lists/htmlConverter.js +0 -81
  926. package/dist/features/lists/htmlConverter.js.map +0 -1
  927. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts +0 -3
  928. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts.map +0 -1
  929. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +0 -22
  930. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +0 -1
  931. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts +0 -3
  932. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts.map +0 -1
  933. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +0 -33
  934. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +0 -1
  935. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts +0 -3
  936. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts.map +0 -1
  937. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +0 -24
  938. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +0 -1
  939. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts +0 -3
  940. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
  941. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +0 -25
  942. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +0 -1
  943. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts +0 -3
  944. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts.map +0 -1
  945. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +0 -22
  946. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +0 -1
  947. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts +0 -3
  948. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
  949. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +0 -28
  950. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +0 -1
  951. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts +0 -3
  952. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +0 -1
  953. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +0 -22
  954. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +0 -1
  955. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts +0 -3
  956. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts.map +0 -1
  957. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +0 -9
  958. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +0 -1
  959. package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts +0 -19
  960. package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +0 -1
  961. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +0 -78
  962. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +0 -1
  963. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts +0 -23
  964. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts.map +0 -1
  965. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +0 -2
  966. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +0 -1
  967. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +0 -2
  968. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +0 -1
  969. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +0 -10
  970. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +0 -1
  971. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts +0 -10
  972. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +0 -1
  973. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +0 -49
  974. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +0 -1
  975. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
  976. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
  977. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +0 -15
  978. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
  979. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
  980. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
  981. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +0 -74
  982. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
  983. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts +0 -3
  984. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts.map +0 -1
  985. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +0 -23
  986. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +0 -1
  987. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts +0 -3
  988. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts.map +0 -1
  989. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +0 -24
  990. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +0 -1
  991. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts +0 -3
  992. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts.map +0 -1
  993. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +0 -33
  994. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +0 -1
  995. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts +0 -3
  996. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts.map +0 -1
  997. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +0 -30
  998. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +0 -1
  999. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts +0 -3
  1000. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
  1001. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +0 -26
  1002. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +0 -1
  1003. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts +0 -3
  1004. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts.map +0 -1
  1005. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +0 -26
  1006. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +0 -1
  1007. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts +0 -3
  1008. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +0 -1
  1009. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +0 -15
  1010. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +0 -1
  1011. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts +0 -3
  1012. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
  1013. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +0 -27
  1014. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +0 -1
  1015. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts +0 -3
  1016. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts.map +0 -1
  1017. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +0 -26
  1018. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +0 -1
  1019. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts +0 -3
  1020. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +0 -1
  1021. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +0 -18
  1022. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +0 -1
  1023. package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts +0 -3
  1024. package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts.map +0 -1
  1025. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +0 -12
  1026. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +0 -1
  1027. package/dist/features/migrations/slateToLexical/converter/index.d.ts +0 -19
  1028. package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +0 -1
  1029. package/dist/features/migrations/slateToLexical/converter/index.js +0 -130
  1030. package/dist/features/migrations/slateToLexical/converter/index.js.map +0 -1
  1031. package/dist/features/migrations/slateToLexical/converter/types.d.ts +0 -16
  1032. package/dist/features/migrations/slateToLexical/converter/types.d.ts.map +0 -1
  1033. package/dist/features/migrations/slateToLexical/converter/types.js +0 -2
  1034. package/dist/features/migrations/slateToLexical/converter/types.js.map +0 -1
  1035. package/dist/features/migrations/slateToLexical/feature.client.d.ts +0 -2
  1036. package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +0 -1
  1037. package/dist/features/migrations/slateToLexical/feature.client.js +0 -10
  1038. package/dist/features/migrations/slateToLexical/feature.client.js.map +0 -1
  1039. package/dist/features/migrations/slateToLexical/feature.server.d.ts +0 -40
  1040. package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +0 -1
  1041. package/dist/features/migrations/slateToLexical/feature.server.js +0 -68
  1042. package/dist/features/migrations/slateToLexical/feature.server.js.map +0 -1
  1043. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
  1044. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
  1045. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +0 -15
  1046. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
  1047. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
  1048. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
  1049. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +0 -74
  1050. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
  1051. package/dist/lexical/ui/icons/AI/index.d.ts +0 -3
  1052. package/dist/lexical/ui/icons/AI/index.d.ts.map +0 -1
  1053. package/dist/lexical/ui/icons/AI/index.js +0 -34
  1054. package/dist/lexical/ui/icons/AI/index.js.map +0 -1
  1055. package/dist/lexical/ui/icons/Caret/index.svg +0 -3
  1056. package/dist/lexical/ui/icons/Edit/index.svg +0 -10
  1057. package/dist/lexical/ui/icons/Remove/index.svg +0 -4
  1058. package/dist/nodeTypes.d.ts +0 -74
  1059. package/dist/nodeTypes.d.ts.map +0 -1
  1060. package/dist/nodeTypes.js +0 -5
  1061. package/dist/nodeTypes.js.map +0 -1
  1062. package/dist/types.d.ts.map +0 -1
  1063. package/dist/types.js +0 -2
  1064. package/dist/types.js.map +0 -1
  1065. package/dist/utilities/migrateSlateToLexical/index.d.ts +0 -15
  1066. package/dist/utilities/migrateSlateToLexical/index.d.ts.map +0 -1
  1067. package/dist/utilities/migrateSlateToLexical/index.js +0 -152
  1068. package/dist/utilities/migrateSlateToLexical/index.js.map +0 -1
  1069. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +0 -10
  1070. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +0 -1
  1071. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +0 -85
  1072. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +0 -1
  1073. /package/dist/exports/client/{componentInline-A4H3EY3L.js.map → componentInline-R3EPNYWF.js.map} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"EditorConfigProvider.js","names":["useLexicalComposerContext","useEditDepth","React","createContext","use","useMemo","useRef","useState","generateQuickGuid","Math","random","toString","substring","Context","editorConfig","fieldProps","uuid","EditorConfigProvider","children","editorContainerRef","parentContext","editor","childrenEditors","Map","focusedEditor","setFocusedEditor","focusHistory","Set","createdInlineBlock","setCreatedInlineBlock","editDepth","editorContext","blurEditor","current","clear","focusEditor","editorUUID","has","add","forEach","childEditor","parentEditor","registerChild","childUUID","childEditorContext","newMap","set","unregisterChild","delete","_jsx","value","useEditorConfigContext","context","undefined","Error"],"sources":["../../../../src/lexical/config/client/EditorConfigProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { LexicalEditor } from 'lexical'\nimport type { MarkRequired } from 'ts-essentials'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useEditDepth } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { createContext, use, useMemo, useRef, useState } from 'react'\n\nimport type { InlineBlockNode } from '../../../features/blocks/client/nodes/InlineBlocksNode.js'\nimport type { LexicalRichTextFieldProps } from '../../../types.js'\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 createdInlineBlock?: InlineBlockNode\n editDepth: number\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n fieldProps: MarkRequired<LexicalRichTextFieldProps, 'path' | 'schemaPath'>\n focusedEditor: EditorConfigContextType | null\n // Editor focus handling\n focusEditor: (editorContext: EditorConfigContextType) => void\n parentEditor: EditorConfigContextType\n registerChild: (uuid: string, editorContext: EditorConfigContextType) => void\n setCreatedInlineBlock?: React.Dispatch<React.SetStateAction<InlineBlockNode | undefined>>\n unregisterChild?: (uuid: string) => void\n uuid: string\n}\n\n// @ts-expect-error: TODO: Fix this\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n fieldProps: 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 | null>\n\n fieldProps: LexicalRichTextFieldProps\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 const [createdInlineBlock, setCreatedInlineBlock] = useState<InlineBlockNode>()\n\n const editDepth = useEditDepth()\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 createdInlineBlock,\n editDepth,\n editor,\n editorConfig,\n editorContainerRef,\n fieldProps,\n focusedEditor,\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) => {\n childEditor.focusEditor(editorContext)\n })\n\n focusHistory.current.clear()\n },\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 setCreatedInlineBlock,\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 createdInlineBlock,\n setCreatedInlineBlock,\n editor,\n childrenEditors,\n editorConfig,\n editorContainerRef,\n editDepth,\n fieldProps,\n focusedEditor,\n parentContext,\n uuid,\n ],\n )\n\n return <Context value={editorContext}>{children}</Context>\n}\n\nexport const useEditorConfigContext = (): EditorConfigContextType => {\n const context = use(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProvider')\n }\n return context\n}\n"],"mappings":"AAAA;;;AAKA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,YAAY,QAAQ;AAC7B,YAAYC,KAAA,MAAW;AACvB,SAASC,aAAa,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAM9D;AACA,SAASC,kBAAA;EACP,OAAOC,IAAA,CAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG,MAAMH,IAAA,CAAKC,MAAM,GAAGC,QAAQ,CAAC,IAAIC,SAAS,CAAC,GAAG;AAC/F;AAsBA;AACA,MAAMC,OAAA,gBAAkDV,aAAA,CAAc;EACpEW,YAAA,EAAc;EACdC,UAAA,EAAY;EACZC,IAAA,EAAM;AACR;AAEA,OAAO,MAAMC,oBAAA,GAAuBA,CAAC;EACnCC,QAAQ;EACRJ,YAAY;EACZK,kBAAkB;EAClBJ,UAAU;EACVK;AAAa,CAQd;EACC,MAAM,CAACC,MAAA,CAAO,GAAGrB,yBAAA;EACjB;EACA,MAAM,CAACgB,IAAA,CAAK,GAAGT,QAAA,CAAS,MAAMC,iBAAA;EAE9B,MAAMc,eAAA,GAAkBhB,MAAA,CAA6C,IAAIiB,GAAA;EACzE,MAAM,CAACC,aAAA,EAAeC,gBAAA,CAAiB,GAAGlB,QAAA,CAAyC;EACnF,MAAMmB,YAAA,GAAepB,MAAA,CAAoB,IAAIqB,GAAA;EAC7C,MAAM,CAACC,kBAAA,EAAoBC,qBAAA,CAAsB,GAAGtB,QAAA;EAEpD,MAAMuB,SA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AAM,CAACL,WAAA;QACdrB,eAAA,CAAgBW,OAAO,GAAGY,QAAA;MAC5B;IACF;IAEA7B;EACF,IACF,CACEY,kBAAA,EACAC,qBAAA,EACAR,MAAA,EACAC,eAAA,EACAR,YAAA,EACAK,kBAAA,EACAW,SAAA,EACAf,UAAA,EACAS,aAAA,EACAJ,aAAA,EACAJ,IAAA,CACD;EAGH,oBAAOiC,IAAA,CAACpC,OAAA;IAAQqC,KAAA,EAAOnB,eAAA;cAAgBb;;AACzC;AAEA,OAAO,MAAMiC,sBAAA,GAAyBA,CAAA;EACpC,MAAMC,OAAA,GAAUhD,GAAA,CAAIS,OAAA;EACpB,IAAIuC,OAAA,KAAYC,SAAA,EAAW;IACzB,MAAM,IAAIC,KAAA,CAAM;EAClB;EACA,OAAOF,OAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"EditorConfigProvider.js","names":["useLexicalComposerContext","useEditDepth","React","createContext","use","useMemo","useRef","useState","generateQuickGuid","Math","random","toString","substring","Context","editorConfig","fieldProps","uuid","EditorConfigProvider","children","editorContainerRef","parentContext","editor","childrenEditors","Map","focusedEditor","setFocusedEditor","focusHistory","Set","createdInlineBlock","setCreatedInlineBlock","editDepth","editorContext","blurEditor","current","clear","focusEditor","editorUUID","has","add","forEach","childEditor","parentEditor","registerChild","childUUID","childEditorContext","newMap","set","unregisterChild","delete","_jsx","value","useEditorConfigContext","context","undefined","Error"],"sources":["../../../../src/lexical/config/client/EditorConfigProvider.tsx"],"sourcesContent":["'use client'\n\nimport type { LexicalEditor } from 'lexical'\nimport type { MarkRequired } from 'ts-essentials'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useEditDepth } from '@payloadcms/ui'\nimport * as React from 'react'\nimport { createContext, use, useMemo, useRef, useState } from 'react'\n\nimport type { InlineBlockNode } from '../../../features/blocks/client/nodes/InlineBlocksNode.js'\nimport type { LexicalRichTextFieldProps } from '../../../types/index.js'\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 createdInlineBlock?: InlineBlockNode\n editDepth: number\n editor: LexicalEditor\n editorConfig: SanitizedClientEditorConfig\n editorContainerRef: React.RefObject<HTMLDivElement>\n fieldProps: MarkRequired<LexicalRichTextFieldProps, 'path' | 'schemaPath'>\n focusedEditor: EditorConfigContextType | null\n // Editor focus handling\n focusEditor: (editorContext: EditorConfigContextType) => void\n parentEditor: EditorConfigContextType\n registerChild: (uuid: string, editorContext: EditorConfigContextType) => void\n setCreatedInlineBlock?: React.Dispatch<React.SetStateAction<InlineBlockNode | undefined>>\n unregisterChild?: (uuid: string) => void\n uuid: string\n}\n\n// @ts-expect-error: TODO: Fix this\nconst Context: React.Context<EditorConfigContextType> = createContext({\n editorConfig: null,\n fieldProps: 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 | null>\n\n fieldProps: LexicalRichTextFieldProps\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 const [createdInlineBlock, setCreatedInlineBlock] = useState<InlineBlockNode>()\n\n const editDepth = useEditDepth()\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 createdInlineBlock,\n editDepth,\n editor,\n editorConfig,\n editorContainerRef,\n fieldProps,\n focusedEditor,\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) => {\n childEditor.focusEditor(editorContext)\n })\n\n focusHistory.current.clear()\n },\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 setCreatedInlineBlock,\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 createdInlineBlock,\n setCreatedInlineBlock,\n editor,\n childrenEditors,\n editorConfig,\n editorContainerRef,\n editDepth,\n fieldProps,\n focusedEditor,\n parentContext,\n uuid,\n ],\n )\n\n return <Context value={editorContext}>{children}</Context>\n}\n\nexport const useEditorConfigContext = (): EditorConfigContextType => {\n const context = use(Context)\n if (context === undefined) {\n throw new Error('useEditorConfigContext must be used within an EditorConfigProvider')\n }\n return context\n}\n"],"mappings":"AAAA;;;AAKA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,YAAY,QAAQ;AAC7B,YAAYC,KAAA,MAAW;AACvB,SAASC,aAAa,EAAEC,GAAG,EAAEC,OAAO,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAM9D;AACA,SAASC,kBAAA;EACP,OAAOC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,OAAA;AACT","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { ClientConfig, RichTextFieldClient } from 'payload';
2
2
  import type { ResolvedClientFeatureMap } from '../../../features/typesClient.js';
3
- import type { FeatureClientSchemaMap } from '../../../types.js';
3
+ import type { FeatureClientSchemaMap } from '../../../types/index.js';
4
4
  import type { ClientEditorConfig } from '../types.js';
5
5
  /**
6
6
  * This function expects client functions to ALREADY be ordered & dependencies checked on the server
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEhE,OAAO,KAAK,EAGV,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,mBAAmB,CAAA;AAC/D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,EACL,UAAU,EACV,uBAAuB,GACxB,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3C,sBAAsB,EAAE,sBAAsB,CAAA;IAC9C,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,wBAAwB,CAoD3B"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/loader.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAEhE,OAAO,KAAK,EAGV,wBAAwB,EACzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AACrE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAErD;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,EACjC,MAAM,EACN,sBAAsB,EACtB,sBAAsB,EACtB,KAAK,EACL,UAAU,EACV,uBAAuB,GACxB,EAAE;IACD,MAAM,EAAE,YAAY,CAAA;IACpB,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAA;IAC3C,sBAAsB,EAAE,sBAAsB,CAAA;IAC9C,KAAK,CAAC,EAAE,mBAAmB,CAAA;IAC3B,UAAU,EAAE,MAAM,CAAA;IAClB,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,wBAAwB,CA0D3B"}
@@ -13,12 +13,16 @@ export function loadClientFeatures({
13
13
  unSanitizedEditorConfig
14
14
  }) {
15
15
  const featureProviderMap = new Map();
16
+ const validFeatures = [];
16
17
  for (const featureProvider of unSanitizedEditorConfig.features) {
17
18
  if (!featureProvider?.clientFeatureProps?.featureKey || featureProvider?.clientFeatureProps?.order === undefined || featureProvider?.clientFeatureProps?.order === null) {
18
- throw new Error('A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.');
19
+ console.warn('A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected. Skipping feature.');
20
+ continue;
19
21
  }
20
22
  featureProviderMap.set(featureProvider.clientFeatureProps.featureKey, featureProvider);
23
+ validFeatures.push(featureProvider);
21
24
  }
25
+ unSanitizedEditorConfig.features = validFeatures;
22
26
  // sort unSanitizedEditorConfig.features by order
23
27
  unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.sort((a, b) => a.clientFeatureProps.order - b.clientFeatureProps.order);
24
28
  const resolvedFeatures = new Map();
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","names":["loadClientFeatures","config","featureClientImportMap","featureClientSchemaMap","field","schemaPath","unSanitizedEditorConfig","featureProviderMap","Map","featureProvider","features","clientFeatureProps","featureKey","order","undefined","Error","set","sort","a","b","resolvedFeatures","loaded","feature","key"],"sources":["../../../../src/lexical/config/client/loader.ts"],"sourcesContent":["'use client'\n\nimport type { ClientConfig, RichTextFieldClient } from 'payload'\n\nimport type {\n ClientFeatureProviderMap,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n} from '../../../features/typesClient.js'\nimport type { FeatureClientSchemaMap } from '../../../types.js'\nimport type { ClientEditorConfig } from '../types.js'\n\n/**\n * This function expects client functions to ALREADY be ordered & dependencies checked on the server\n * @param unSanitizedEditorConfig\n */\nexport function loadClientFeatures({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n field,\n schemaPath,\n unSanitizedEditorConfig,\n}: {\n config: ClientConfig\n featureClientImportMap: Record<string, any>\n featureClientSchemaMap: FeatureClientSchemaMap\n field?: RichTextFieldClient\n schemaPath: string\n unSanitizedEditorConfig: ClientEditorConfig\n}): ResolvedClientFeatureMap {\n const featureProviderMap: ClientFeatureProviderMap = new Map()\n\n for (const featureProvider of unSanitizedEditorConfig.features) {\n if (\n !featureProvider?.clientFeatureProps?.featureKey ||\n featureProvider?.clientFeatureProps?.order === undefined ||\n featureProvider?.clientFeatureProps?.order === null\n ) {\n throw new Error(\n 'A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected.',\n )\n }\n featureProviderMap.set(featureProvider.clientFeatureProps.featureKey, featureProvider)\n }\n\n // sort unSanitizedEditorConfig.features by order\n unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.sort(\n (a, b) => a.clientFeatureProps.order - b.clientFeatureProps.order,\n )\n\n const resolvedFeatures: ResolvedClientFeatureMap = 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 const feature: Partial<ResolvedClientFeature<any>> =\n typeof featureProvider.feature === 'function'\n ? featureProvider.feature({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n featureProviderMap,\n field,\n resolvedFeatures,\n schemaPath,\n unSanitizedEditorConfig,\n })\n : featureProvider.feature\n\n feature.key = featureProvider.clientFeatureProps.featureKey\n feature.order = loaded\n\n resolvedFeatures.set(\n featureProvider.clientFeatureProps.featureKey,\n feature as ResolvedClientFeature<any>,\n )\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"mappings":"AAAA;;AAYA;;;;AAIA,OAAO,SAASA,mBAAmB;EACjCC,MAAM;EACNC,sBAAsB;EACtBC,sBAAsB;EACtBC,KAAK;EACLC,UAAU;EACVC;AAAuB,CAQxB;EACC,MAAMC,kBAAA,GAA+C,IAAIC,GAAA;EAEzD,KAAK,MAAMC,eAAA,IAAmBH,uBAAA,CAAwBI,QAAQ,EAAE;IAC9D,IACE,CAACD,eAAA,EAAiBE,kBAAA,EAAoBC,UAAA,IACtCH,eAAA,EAAiBE,kBAAA,EAAoBE,KAAA,KAAUC,SAAA,IAC/CL,eAAA,EAAiBE,kBAAA,EAAoBE,KAAA,KAAU,MAC/C;MACA,MAAM,IAAIE,KAAA,CACR;IAEJ;IACAR,kBAAA,CAAmBS,GAAG,CAACP,eAAA,CAAgBE,kBAAkB,CAACC,UAAU,EAAEH,eAAA;EACxE;EAEA;EACAH,uBAAA,CAAwBI,QAAQ,GAAGJ,uBAAA,CAAwBI,QAAQ,CAACO,IAAI,CACtE,CAACC,CAAA,EAAGC,CAAA,KAAMD,CAAA,CAAEP,kBAAkB,CAACE,KAAK,GAAGM,CAAA,CAAER,kBAAkB,CAACE,KAAK;EAGnE,MAAMO,gBAAA,GAA6C,IAAIZ,GAAA;EAEvD;EACA,IAAIa,MAAA,GAAS;EACb,KAAK,MAAMZ,eAAA,IAAmBH,uBAAA,CAAwBI,QAAQ,EAAE;IAC9D,MAAMY,OAAA,GACJ,OAAOb,eAAA,CAAgBa,OAAO,KAAK,aAC/Bb,eAAA,CAAgBa,OAAO,CAAC;MACtBrB,MAAA;MACAC,sBAAA;MACAC,sBAAA;MACAI,kBAAA;MACAH,KAAA;MACAgB,gBAAA;MACAf,UAAA;MACAC;IACF,KACAG,eAAA,CAAgBa,OAAO;IAE7BA,OAAA,CAAQC,GAAG,GAAGd,eAAA,CAAgBE,kBAAkB,CAACC,UAAU;IAC3DU,OAAA,CAAQT,KAAK,GAAGQ,MAAA;IAEhBD,gBAAA,CAAiBJ,GAAG,CAClBP,eAAA,CAAgBE,kBAAkB,CAACC,UAAU,EAC7CU,OAAA;IAGFD,MAAA;EACF;EAEA,OAAOD,gBAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"loader.js","names":["loadClientFeatures","config","featureClientImportMap","featureClientSchemaMap","field","schemaPath","unSanitizedEditorConfig","featureProviderMap","Map","validFeatures","featureProvider","features","clientFeatureProps","featureKey","order","undefined","console","warn","set","push","sort","a","b","resolvedFeatures","loaded","feature","key"],"sources":["../../../../src/lexical/config/client/loader.ts"],"sourcesContent":["'use client'\n\nimport type { ClientConfig, RichTextFieldClient } from 'payload'\n\nimport type {\n ClientFeatureProviderMap,\n ResolvedClientFeature,\n ResolvedClientFeatureMap,\n} from '../../../features/typesClient.js'\nimport type { FeatureClientSchemaMap } from '../../../types/index.js'\nimport type { ClientEditorConfig } from '../types.js'\n\n/**\n * This function expects client functions to ALREADY be ordered & dependencies checked on the server\n * @param unSanitizedEditorConfig\n */\nexport function loadClientFeatures({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n field,\n schemaPath,\n unSanitizedEditorConfig,\n}: {\n config: ClientConfig\n featureClientImportMap: Record<string, any>\n featureClientSchemaMap: FeatureClientSchemaMap\n field?: RichTextFieldClient\n schemaPath: string\n unSanitizedEditorConfig: ClientEditorConfig\n}): ResolvedClientFeatureMap {\n const featureProviderMap: ClientFeatureProviderMap = new Map()\n\n const validFeatures: typeof unSanitizedEditorConfig.features = []\n\n for (const featureProvider of unSanitizedEditorConfig.features) {\n if (\n !featureProvider?.clientFeatureProps?.featureKey ||\n featureProvider?.clientFeatureProps?.order === undefined ||\n featureProvider?.clientFeatureProps?.order === null\n ) {\n console.warn(\n 'A Feature you have installed does not return the client props as clientFeatureProps. Please make sure to always return those props, even if they are null, as other important props like order and featureKey are later on injected. Skipping feature.',\n )\n continue\n }\n featureProviderMap.set(featureProvider.clientFeatureProps.featureKey, featureProvider)\n validFeatures.push(featureProvider)\n }\n\n unSanitizedEditorConfig.features = validFeatures\n\n // sort unSanitizedEditorConfig.features by order\n unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.sort(\n (a, b) => a.clientFeatureProps.order - b.clientFeatureProps.order,\n )\n\n const resolvedFeatures: ResolvedClientFeatureMap = 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 const feature: Partial<ResolvedClientFeature<any>> =\n typeof featureProvider.feature === 'function'\n ? featureProvider.feature({\n config,\n featureClientImportMap,\n featureClientSchemaMap,\n featureProviderMap,\n field,\n resolvedFeatures,\n schemaPath,\n unSanitizedEditorConfig,\n })\n : featureProvider.feature\n\n feature.key = featureProvider.clientFeatureProps.featureKey\n feature.order = loaded\n\n resolvedFeatures.set(\n featureProvider.clientFeatureProps.featureKey,\n feature as ResolvedClientFeature<any>,\n )\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"mappings":"AAAA;;AAYA;;;;AAIA,OAAO,SAASA,mBAAmB;EACjCC,MAAM;EACNC,sBAAsB;EACtBC,sBAAsB;EACtBC,KAAK;EACLC,UAAU;EACVC;AAAuB,CAQxB;EACC,MAAMC,kBAAA,GAA+C,IAAIC,GAAA;EAEzD,MAAMC,aAAA,GAAyD,EAAE;EAEjE,KAAK,MAAMC,eAAA,IAAmBJ,uBAAA,CAAwBK,QAAQ,EAAE;IAC9D,IACE,CAACD,eAAA,EAAiBE,kBAAA,EAAoBC,UAAA,IACtCH,eAAA,EAAiBE,kBAAA,EAAoBE,KAAA,KAAUC,SAAA,IAC/CL,eAAA,EAAiBE,kBAAA,EAAoBE,KAAA,KAAU,MAC/C;MACAE,OAAA,CAAQC,IAAI,CACV;MAEF;IACF;IACAV,kBAAA,CAAmBW,GAAG,CAACR,eAAA,CAAgBE,kBAAkB,CAACC,UAAU,EAAEH,eAAA;IACtED,aAAA,CAAcU,IAAI,CAACT,eAAA;EACrB;EAEAJ,uBAAA,CAAwBK,QAAQ,GAAGF,aAAA;EAEnC;EACAH,uBAAA,CAAwBK,QAAQ,GAAGL,uBAAA,CAAwBK,QAAQ,CAACS,IAAI,CACtE,CAACC,CAAA,EAAGC,CAAA,KAAMD,CAAA,CAAET,kBAAkB,CAACE,KAAK,GAAGQ,CAAA,CAAEV,kBAAkB,CAACE,KAAK;EAGnE,MAAMS,gBAAA,GAA6C,IAAIf,GAAA;EAEvD;EACA,IAAIgB,MAAA,GAAS;EACb,KAAK,MAAMd,eAAA,IAAmBJ,uBAAA,CAAwBK,QAAQ,EAAE;IAC9D,MAAMc,OAAA,GACJ,OAAOf,eAAA,CAAgBe,OAAO,KAAK,aAC/Bf,eAAA,CAAgBe,OAAO,CAAC;MACtBxB,MAAA;MACAC,sBAAA;MACAC,sBAAA;MACAI,kBAAA;MACAH,KAAA;MACAmB,gBAAA;MACAlB,UAAA;MACAC;IACF,KACAI,eAAA,CAAgBe,OAAO;IAE7BA,OAAA,CAAQC,GAAG,GAAGhB,eAAA,CAAgBE,kBAAkB,CAACC,UAAU;IAC3DY,OAAA,CAAQX,KAAK,GAAGU,MAAA;IAEhBD,gBAAA,CAAiBL,GAAG,CAClBR,eAAA,CAAgBE,kBAAkB,CAACC,UAAU,EAC7CY,OAAA;IAGFD,MAAA;EACF;EAEA,OAAOD,gBAAA;AACT","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { EditorConfig as LexicalEditorConfig } from 'lexical';
2
2
  import type { ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../../features/typesClient.js';
3
- import type { LexicalFieldAdminClientProps } from '../../../types.js';
3
+ import type { LexicalFieldAdminClientProps } from '../../../types/index.js';
4
4
  import type { SanitizedClientEditorConfig } from '../types.js';
5
5
  export declare const sanitizeClientFeatures: (features: ResolvedClientFeatureMap) => SanitizedClientFeatures;
6
6
  export declare function sanitizeClientEditorConfig(resolvedClientFeatureMap: ResolvedClientFeatureMap, lexical?: LexicalEditorConfig, admin?: LexicalFieldAdminClientProps, view?: string): SanitizedClientEditorConfig;
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,mBAAmB,CAAA;AACrE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,aACvB,wBAAwB,KACjC,uBAiOF,CAAA;AAED,wBAAgB,0BAA0B,CACxC,wBAAwB,EAAE,wBAAwB,EAClD,OAAO,CAAC,EAAE,mBAAmB,EAC7B,KAAK,CAAC,EAAE,4BAA4B,EACpC,IAAI,CAAC,EAAE,MAAM,GACZ,2BAA2B,CAQ7B"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/client/sanitize.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAA;AAC3E,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,aAAa,CAAA;AAE9D,eAAO,MAAM,sBAAsB,GACjC,UAAU,wBAAwB,KACjC,uBAiOF,CAAA;AAED,wBAAgB,0BAA0B,CACxC,wBAAwB,EAAE,wBAAwB,EAClD,OAAO,CAAC,EAAE,mBAAmB,EAC7B,KAAK,CAAC,EAAE,4BAA4B,EACpC,IAAI,CAAC,EAAE,MAAM,GACZ,2BAA2B,CAQ7B"}
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.js","names":["deepMerge","sanitizeClientFeatures","features","sanitized","enabledFeatures","enabledFormats","markdownTransformers","nodes","plugins","providers","slashMenu","dynamicGroups","groups","toolbarFixed","toolbarInline","customGroups","forEach","feature","key","sanitizedClientFeatureProps","size","length","concat","enableFormats","push","node","plugin","i","clientProps","Component","position","group","foundGroup","find","sanitizedGroup","items","filter","optionGroup","transformer","allNodes","allTransformers","Object","keys","map","customConfig","sort","a","b","order","sanitizeClientEditorConfig","resolvedClientFeatureMap","lexical","admin","view","resolvedFeatureMap"],"sources":["../../../../src/lexical/config/client/sanitize.ts"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { deepMerge } from 'payload/shared'\n\nimport type { ToolbarGroup } from '../../../features/toolbars/types.js'\nimport type {\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n} from '../../../features/typesClient.js'\nimport type { LexicalFieldAdminClientProps } from '../../../types.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\nexport const sanitizeClientFeatures = (\n features: ResolvedClientFeatureMap,\n): SanitizedClientFeatures => {\n const sanitized: SanitizedClientFeatures = {\n enabledFeatures: [],\n enabledFormats: [],\n markdownTransformers: [],\n nodes: [],\n plugins: [],\n providers: [],\n slashMenu: {\n dynamicGroups: [],\n groups: [],\n },\n toolbarFixed: {\n groups: [],\n },\n toolbarInline: {\n groups: [],\n },\n }\n\n // Allow customization of groups for toolbarFixed\n let customGroups: Record<string, Partial<ToolbarGroup>> = {}\n features.forEach((feature) => {\n if (feature.key === 'toolbarFixed' && feature.sanitizedClientFeatureProps?.customGroups) {\n customGroups = {\n ...customGroups,\n ...feature.sanitizedClientFeatureProps.customGroups,\n }\n }\n })\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature.providers?.length) {\n sanitized.providers = sanitized.providers.concat(feature.providers)\n }\n\n if (feature.enableFormats?.length) {\n sanitized.enabledFormats.push(...feature.enableFormats)\n }\n\n if (feature.nodes?.length) {\n // Important: do not use concat\n for (const node of feature.nodes) {\n sanitized.nodes.push(node)\n }\n }\n if (feature.plugins?.length) {\n feature.plugins.forEach((plugin, i) => {\n sanitized.plugins?.push({\n clientProps: feature.sanitizedClientFeatureProps,\n Component: plugin.Component as any, // Appeases strict: true\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 // Important: do not use concat\n for (const transformer of feature.markdownTransformers) {\n if (typeof transformer === 'function') {\n sanitized.markdownTransformers.push(\n transformer({\n allNodes: sanitized.nodes,\n allTransformers: sanitized.markdownTransformers,\n }),\n )\n } else {\n sanitized.markdownTransformers.push(transformer)\n }\n }\n }\n sanitized.enabledFeatures.push(feature.key)\n })\n\n // Apply custom group configurations to toolbarFixed groups\n if (Object.keys(customGroups).length > 0) {\n sanitized.toolbarFixed.groups = sanitized.toolbarFixed.groups.map((group) => {\n const customConfig = customGroups[group.key]\n if (customConfig) {\n return deepMerge(group, customConfig)\n }\n return group\n })\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 resolvedClientFeatureMap: ResolvedClientFeatureMap,\n lexical?: LexicalEditorConfig,\n admin?: LexicalFieldAdminClientProps,\n view?: string,\n): SanitizedClientEditorConfig {\n return {\n admin,\n features: sanitizeClientFeatures(resolvedClientFeatureMap),\n lexical: lexical!,\n resolvedFeatureMap: resolvedClientFeatureMap,\n view,\n }\n}\n"],"mappings":"AAAA;;AAIA,SAASA,SAAS,QAAQ;AAU1B,OAAO,MAAMC,sBAAA,GACXC,QAAA;EAEA,MAAMC,SAAA,GAAqC;IACzCC,eAAA,EAAiB,EAAE;IACnBC,cAAA,EAAgB,EAAE;IAClBC,oBAAA,EAAsB,EAAE;IACxBC,KAAA,EAAO,EAAE;IACTC,OAAA,EAAS,EAAE;IACXC,SAAA,EAAW,EAAE;IACbC,SAAA,EAAW;MACTC,aAAA,EAAe,EAAE;MACjBC,MAAA,EAAQ;IACV;IACAC,YAAA,EAAc;MACZD,MAAA,EAAQ;IACV;IACAE,aAAA,EAAe;MACbF,MAAA,EAAQ;IACV;EACF;EAEA;EACA,IAAIG,YAAA,GAAsD,CAAC;EAC3Db,QAAA,CAASc,OAAO,CAAEC,OAAA;IAChB,IAAIA,OAAA,CAAQC,GAAG,KAAK,kBAAkBD,OAAA,CAAQE,2BAA2B,EAAEJ,YAAA,EAAc;MACvFA,YAAA,GAAe;QACb,GAAGA,YAAY;QACf,GAA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"file":"sanitize.js","names":["deepMerge","sanitizeClientFeatures","features","sanitized","enabledFeatures","enabledFormats","markdownTransformers","nodes","plugins","providers","slashMenu","dynamicGroups","groups","toolbarFixed","toolbarInline","customGroups","forEach","feature","key","sanitizedClientFeatureProps","size","length","concat","enableFormats","push","node","plugin","i","clientProps","Component","position","group","foundGroup","find","sanitizedGroup","items","filter","optionGroup","transformer","allNodes","allTransformers","Object","keys","map","customConfig","sort","a","b","order","sanitizeClientEditorConfig","resolvedClientFeatureMap","lexical","admin","view","resolvedFeatureMap"],"sources":["../../../../src/lexical/config/client/sanitize.ts"],"sourcesContent":["'use client'\n\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { deepMerge } from 'payload/shared'\n\nimport type { ToolbarGroup } from '../../../features/toolbars/types.js'\nimport type {\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n} from '../../../features/typesClient.js'\nimport type { LexicalFieldAdminClientProps } from '../../../types/index.js'\nimport type { SanitizedClientEditorConfig } from '../types.js'\n\nexport const sanitizeClientFeatures = (\n features: ResolvedClientFeatureMap,\n): SanitizedClientFeatures => {\n const sanitized: SanitizedClientFeatures = {\n enabledFeatures: [],\n enabledFormats: [],\n markdownTransformers: [],\n nodes: [],\n plugins: [],\n providers: [],\n slashMenu: {\n dynamicGroups: [],\n groups: [],\n },\n toolbarFixed: {\n groups: [],\n },\n toolbarInline: {\n groups: [],\n },\n }\n\n // Allow customization of groups for toolbarFixed\n let customGroups: Record<string, Partial<ToolbarGroup>> = {}\n features.forEach((feature) => {\n if (feature.key === 'toolbarFixed' && feature.sanitizedClientFeatureProps?.customGroups) {\n customGroups = {\n ...customGroups,\n ...feature.sanitizedClientFeatureProps.customGroups,\n }\n }\n })\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature.providers?.length) {\n sanitized.providers = sanitized.providers.concat(feature.providers)\n }\n\n if (feature.enableFormats?.length) {\n sanitized.enabledFormats.push(...feature.enableFormats)\n }\n\n if (feature.nodes?.length) {\n // Important: do not use concat\n for (const node of feature.nodes) {\n sanitized.nodes.push(node)\n }\n }\n if (feature.plugins?.length) {\n feature.plugins.forEach((plugin, i) => {\n sanitized.plugins?.push({\n clientProps: feature.sanitizedClientFeatureProps,\n Component: plugin.Component as any, // Appeases strict: true\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 // Important: do not use concat\n for (const transformer of feature.markdownTransformers) {\n if (typeof transformer === 'function') {\n sanitized.markdownTransformers.push(\n transformer({\n allNodes: sanitized.nodes,\n allTransformers: sanitized.markdownTransformers,\n }),\n )\n } else {\n sanitized.markdownTransformers.push(transformer)\n }\n }\n }\n sanitized.enabledFeatures.push(feature.key)\n })\n\n // Apply custom group configurations to toolbarFixed groups\n if (Object.keys(customGroups).length > 0) {\n sanitized.toolbarFixed.groups = sanitized.toolbarFixed.groups.map((group) => {\n const customConfig = customGroups[group.key]\n if (customConfig) {\n return deepMerge(group, customConfig)\n }\n return group\n })\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 resolvedClientFeatureMap: ResolvedClientFeatureMap,\n lexical?: LexicalEditorConfig,\n admin?: LexicalFieldAdminClientProps,\n view?: string,\n): SanitizedClientEditorConfig {\n return {\n admin,\n features: sanitizeClientFeatures(resolvedClientFeatureMap),\n lexical: lexical!,\n resolvedFeatureMap: resolvedClientFeatureMap,\n view,\n }\n}\n"],"mappings":"AAAA;;AAIA,SAASA,SAAS,QAAQ;AAU1B,OAAO,MAAMC,sBAAA,GACXC,QAAA;EAEA,MAAMC,SAAA,GAAqC;IACzCC,eAAA,EAAiB,EAAE;IACnBC,cAAA,EAAgB,EAAE;IAClBC,oBAAA,EAAsB,EAAE;IACxBC,KAAA,EAAO,EAAE;IACTC,OAAA,EAAS,EAAE;IACXC,SAAA,EAAW,EAAE;IACbC,SAAA,EAAW;MACTC,aAAA,EAAe,EAAE;MACjBC,MAAA,EAAQ;IACV;IACAC,YAAA,EAAc;MACZD,MAAA,EAAQ;IACV;IACAE,aAAA,EAAe;MACbF,MAAA,EAAQ;IACV;EACF;EAEA;EACA,IAAIG,YAAA,GAAsD,CAAC;EAC3Db,QAAA,CAASc,OAAO,CAAEC,OAAA;IAChB,IAAIA,OAAA,CAAQC,GAAG,KAAK,kBAAkBD,OAAA,CAAQE,2BAA2B,EAAEJ,YAAA,EAAc;MACvFA,YAAA,GAAe;QACb,GAAGA,YAAY;QACf,GAAGE,OAAA,CAAQE,2BAA2B,CAACJ;MACzC;IACF;EACF;EAEA,IAAI,CAACb,QAAA,EAAUkB,IAAA,EAAM;IACnB,OAAOjB,SAAA;EACT;EAEAD,QAAA,CAASc,OAAO,CAAEC,OAAA;IAChB,IAAIA,OAAA,CAAQR,SAAS,EAAEY,MAAA,EAAQ;MAC7BlB,SAAA,CAAUM,SAAS,GAAG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,CAAA,EAAGC,CAAA;MACnB,IAAID,CAAA,CAAEE,KAAK,IAAID,CAAA,CAAEC,KAAK,EAAE;QACtB,OAAOF,CAAA,CAAEE,KAAK,GAAGD,CAAA,CAAEC,KAAK;MAC1B,OAAO,IAAIF,CAAA,CAAEE,KAAK,EAAE;QAClB,OAAO,CAAC;MACV,OAAO,IAAID,CAAA,CAAEC,KAAK,EAAE;QAClB,OAAO;MACT,OAAO;QACL,OAAO;MACT;IACF;EACF;EAEA;EACA,KAAK,MAAMjB,KAAA,IAAS5B,SAAA,CAAUU,YAAY,CAACD,MAAM,EAAE;IACjDmB,KAAA,CAAMI,KAAK,CAACU,IAAI,CAAC,CAACC,CAAA,EAAGC,CAAA;MACnB,IAAID,CAAA,CAAEE,KAAK,IAAID,CAAA,CAAEC,KAAK,EAAE;QACtB,OAAOF,CAAA,CAAEE,KAAK,GAAGD,CAAA,CAAEC,KAAK;MAC1B,OAAO,IAAIF,CAAA,CAAEE,KAAK,EAAE;QAClB,OAAO,CAAC;MACV,OAAO,IAAID,CAAA,CAAEC,KAAK,EAAE;QAClB,OAAO;MACT,OAAO;QACL,OAAO;MACT;IACF;EACF;EAEA,OAAO7C,SAAA;AACT;AAEA,OAAO,SAAS8C,2BACdC,wBAAkD,EAClDC,OAA6B,EAC7BC,KAAoC,EACpCC,IAAa;EAEb,OAAO;IACLD,KAAA;IACAlD,QAAA,EAAUD,sBAAA,CAAuBiD,wBAAA;IACjCC,OAAA,EAASA,OAAA;IACTG,kBAAA,EAAoBJ,wBAAA;IACpBG;EACF;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/server/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EACV,qBAAqB,EAErB,wBAAwB,EAEzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AA8FrD,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GACnE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAEpD;AAED,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,uBAAuB,GACxB,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,OAAO,CAAC,wBAAwB,CAAC,CA2FpC"}
1
+ {"version":3,"file":"loader.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/server/loader.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EACV,qBAAqB,EAErB,wBAAwB,EAEzB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AA8FrD,wBAAgB,6BAA6B,CAC3C,gBAAgB,EAAE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,GACnE,qBAAqB,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,CAEpD;AAED,wBAAsB,YAAY,CAAC,EACjC,MAAM,EACN,MAAM,EACN,iBAAiB,EACjB,uBAAuB,GACxB,EAAE;IACD,MAAM,EAAE,eAAe,CAAA;IACvB,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,iBAAiB,EAAE,OAAO,CAAA;IAC1B,uBAAuB,EAAE,kBAAkB,CAAA;CAC5C,GAAG,OAAO,CAAC,wBAAwB,CAAC,CAyFpC"}
@@ -63,11 +63,16 @@ export async function loadFeatures({
63
63
  parentIsLocalized,
64
64
  unSanitizedEditorConfig
65
65
  }) {
66
- // First remove all duplicate features. The LAST feature with a given key wins.
67
- unSanitizedEditorConfig.features = unSanitizedEditorConfig.features.reverse().filter((f, i, arr) => {
68
- const firstIndex = arr.findIndex(f2 => f2.key === f.key);
69
- return firstIndex === i;
70
- }).reverse();
66
+ // First remove all duplicate features. The LAST feature with a given key wins,
67
+ // and keeps the position of its last occurrence (matching the prior reverse/filter/reverse semantics).
68
+ const dedupedByKey = new Map();
69
+ for (const f of unSanitizedEditorConfig.features) {
70
+ if (dedupedByKey.has(f.key)) {
71
+ dedupedByKey.delete(f.key);
72
+ }
73
+ dedupedByKey.set(f.key, f);
74
+ }
75
+ unSanitizedEditorConfig.features = Array.from(dedupedByKey.values());
71
76
  unSanitizedEditorConfig.features = sortFeaturesForOptimalLoading(unSanitizedEditorConfig.features);
72
77
  const featureProviderMap = new Map(unSanitizedEditorConfig.features.map(f => [f.key, f]));
73
78
  const resolvedFeatures = new Map();
@@ -79,8 +84,7 @@ export async function loadFeatures({
79
84
  }
80
85
  if (featureProvider.dependencies?.length) {
81
86
  for (const dependencyKey of featureProvider.dependencies) {
82
- const found = unSanitizedEditorConfig.features.find(f => f.key === dependencyKey);
83
- if (!found) {
87
+ if (!featureProviderMap.has(dependencyKey)) {
84
88
  throw new Error(`Feature ${featureProvider.key} has a dependency ${dependencyKey} which does not exist.`);
85
89
  }
86
90
  }
@@ -90,8 +94,7 @@ export async function loadFeatures({
90
94
  // 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
91
95
  const found = resolvedFeatures.get(priorityDependencyKey);
92
96
  if (!found) {
93
- const existsInEditorConfig = unSanitizedEditorConfig.features.find(f => f.key === priorityDependencyKey);
94
- if (!existsInEditorConfig) {
97
+ if (!featureProviderMap.has(priorityDependencyKey)) {
95
98
  throw new Error(`Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which does not exist.`);
96
99
  } else {
97
100
  throw new Error(`Feature ${featureProvider.key} has a priority dependency ${priorityDependencyKey} which is not loaded before it.`);
@@ -1 +1 @@
1
- {"version":3,"file":"loader.js","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","parentIsLocalized","unSanitizedEditorConfig","features","filter","f","i","arr","firstIndex","findIndex","f2","featureProviderMap","Map","map","resolvedFeatures","loaded","length","dependencyKey","found","find","priorityDependencyKey","get","existsInEditorConfig","feature","resolvedFeature","order","set"],"sources":["../../../../src/lexical/config/server/loader.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n FeatureProviderServer,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n ServerFeatureProviderMap,\n} from '../../../features/typesServer.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, unknown>\n }\n}\n\nfunction createDependencyGraph(\n featureProviders: FeatureProviderServer<unknown, 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, unknown>[],\n): FeatureProviderServer<unknown, unknown, unknown>[] {\n const graph = createDependencyGraph(featureProviders)\n const visited: { [key: string]: boolean } = {}\n const stack: FeatureProviderServer<unknown, 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, 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, unknown>[],\n): FeatureProviderServer<unknown, unknown, unknown>[] {\n return topologicallySortFeatures(featureProviders)\n}\n\nexport async function loadFeatures({\n config,\n isRoot,\n parentIsLocalized,\n unSanitizedEditorConfig,\n}: {\n config: SanitizedConfig\n isRoot?: boolean\n parentIsLocalized: 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, 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 =\n typeof featureProvider.feature === 'function'\n ? await featureProvider.feature({\n config,\n featureProviderMap,\n isRoot,\n parentIsLocalized,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n : featureProvider.feature\n\n const resolvedFeature: ResolvedServerFeature<any, any> = feature as ResolvedServerFeature<\n any,\n any\n >\n\n // All these new properties would be added to the feature, as it's mutated. However, this does not cause any damage and allows\n // us to prevent an unnecessary spread operation.\n resolvedFeature.key = featureProvider.key\n resolvedFeature.order = loaded\n resolvedFeature.dependencies = featureProvider.dependencies!\n resolvedFeature.dependenciesPriority = featureProvider.dependenciesPriority!\n resolvedFeature.dependenciesSoft = featureProvider.dependenciesSoft!\n\n resolvedFeatures.set(featureProvider.key, resolvedFeature)\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"mappings":"AAmBA,SAASA,sBACPC,gBAAoE;EAEpE,MAAMC,KAAA,GAAyB,CAAC;EAChC,KAAK,MAAMC,EAAA,IAAMF,gBAAA,EAAkB;IACjCC,KAAK,CAACC,EAAA,CAAGC,GAAG,CAAC,GAAG;MACdC,YAAA,EAAcF,EAAA,CAAGE,YAAY,IAAI,EAAE;MACnCC,oBAAA,EAAsBH,EAAA,CAAGG,oBAAoB,IAAI,EAAE;MACnDC,gBAAA,EAAkBJ,EAAA,CAAGI,gBAAgB,IAAI,EAAE;MAC3CC,eAAA,EAAiBL;IACnB;EACF;EACA,OAAOD,KAAA;AACT;AAEA,SAASO,0BACPR,gBAAoE;EAEpE,MAAMC,KAAA,GAAQF,qBAAA,CAAsBC,gBAAA;EACpC,MAAMS,OAAA,GAAsC,CAAC;EAC7C,MAAMC,KAAA,GAA4D,EAAE;EAEpE,KAAK,MAAMP,GAAA,IAAOF,KAAA,EAAO;IACvB,IAAI,CAACQ,OAAO,CAACN,GAAA,CAAI,EAAE;MACjBQ,KAAA,CAAMV,KAAA,EAAOE,GAAA,EAAKM,OAAA,EAASC,KAAA;IAC7B;EACF;EAEA,OAAOA,KAAA,CAAME,OAAO;AACtB;AAEA,SAASD,MACPV,KAAsB,EACtBE,GAAW,EACXM,OAAmC,EACnCC,KAAyD,EACzDG,WAAA,GAAwB,EAAE;EAE1B,IAAI,CAACZ,KAAK,CAACE,GAAA,CAAI,EAAE;IACf,MAAM,IAAIW,KAAA,CAAM,eAAeX,GAAA,0CAA6C;EAC9E;EAEA,IAAIU,WAAA,CAAYE,QAAQ,CAACZ,GAAA,GAAM;IAC7B,MAAM,IAAIW,KAAA,CAAM,iCAAiCD,WAAA,CAAYG,IAAI,CAAC,cAAcb,GAAA,EAAK;EACvF;EAEA,I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[]}
1
+ {"version":3,"file":"loader.js","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","parentIsLocalized","unSanitizedEditorConfig","dedupedByKey","Map","f","features","has","delete","set","Array","from","values","featureProviderMap","map","resolvedFeatures","loaded","length","dependencyKey","priorityDependencyKey","found","get","feature","resolvedFeature","order"],"sources":["../../../../src/lexical/config/server/loader.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n FeatureProviderServer,\n ResolvedServerFeature,\n ResolvedServerFeatureMap,\n ServerFeatureProviderMap,\n} from '../../../features/typesServer.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, unknown>\n }\n}\n\nfunction createDependencyGraph(\n featureProviders: FeatureProviderServer<unknown, 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, unknown>[],\n): FeatureProviderServer<unknown, unknown, unknown>[] {\n const graph = createDependencyGraph(featureProviders)\n const visited: { [key: string]: boolean } = {}\n const stack: FeatureProviderServer<unknown, 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, 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, unknown>[],\n): FeatureProviderServer<unknown, unknown, unknown>[] {\n return topologicallySortFeatures(featureProviders)\n}\n\nexport async function loadFeatures({\n config,\n isRoot,\n parentIsLocalized,\n unSanitizedEditorConfig,\n}: {\n config: SanitizedConfig\n isRoot?: boolean\n parentIsLocalized: boolean\n unSanitizedEditorConfig: ServerEditorConfig\n}): Promise<ResolvedServerFeatureMap> {\n // First remove all duplicate features. The LAST feature with a given key wins,\n // and keeps the position of its last occurrence (matching the prior reverse/filter/reverse semantics).\n const dedupedByKey = new Map<string, FeatureProviderServer<unknown, unknown, unknown>>()\n for (const f of unSanitizedEditorConfig.features) {\n if (dedupedByKey.has(f.key)) {\n dedupedByKey.delete(f.key)\n }\n dedupedByKey.set(f.key, f)\n }\n unSanitizedEditorConfig.features = Array.from(dedupedByKey.values())\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, 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 if (!featureProviderMap.has(dependencyKey)) {\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 if (!featureProviderMap.has(priorityDependencyKey)) {\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 =\n typeof featureProvider.feature === 'function'\n ? await featureProvider.feature({\n config,\n featureProviderMap,\n isRoot,\n parentIsLocalized,\n resolvedFeatures,\n unSanitizedEditorConfig,\n })\n : featureProvider.feature\n\n const resolvedFeature: ResolvedServerFeature<any, any> = feature as ResolvedServerFeature<\n any,\n any\n >\n\n // All these new properties would be added to the feature, as it's mutated. However, this does not cause any damage and allows\n // us to prevent an unnecessary spread operation.\n resolvedFeature.key = featureProvider.key\n resolvedFeature.order = loaded\n resolvedFeature.dependencies = featureProvider.dependencies!\n resolvedFeature.dependenciesPriority = featureProvider.dependenciesPriority!\n resolvedFeature.dependenciesSoft = featureProvider.dependenciesSoft!\n\n resolvedFeatures.set(featureProvider.key, resolvedFeature)\n\n loaded++\n }\n\n return resolvedFeatures\n}\n"],"mappings":"AAmBA,SAASA,sBACPC,gBAAoE;EAEpE,MAAMC,KAAA,GAAyB,CAAC;EAChC,KAAK,MAAMC,EAAA,IAAMF,gBAAA,EAAkB;IACjCC,KAAK,CAACC,EAAA,CAAGC,GAAG,CAAC,GAAG;MACdC,YAAA,EAAcF,EAAA,CAAGE,YAAY,IAAI,EAAE;MACnCC,oBAAA,EAAsBH,EAAA,CAAGG,oBAAoB,IAAI,EAAE;MACnDC,gBAAA,EAAkBJ,EAAA,CAAGI,gBAAgB,IAAI,EAAE;MAC3CC,eAAA,EAAiBL;IACnB;EACF;EACA,OAAOD,KAAA;AACT;AAEA,SAASO,0BACPR,gBAAoE;EAEpE,MAAMC,KAAA,GAAQF,qBAAA,CAAsBC,gBAAA;EACpC,MAAMS,OAAA,GAAsC,CAAC;EAC7C,MAAMC,KAAA,GAA4D,EAAE;EAEpE,KAAK,MAAMP,GAAA,IAAOF,KAAA,EAAO;IACvB,IAAI,CAACQ,OAAO,CAACN,GAAA,CAAI,EAAE;MACjBQ,KAAA,CAAMV,KAAA,EAAOE,GAAA,EAAKM,OAAA,EAASC,KAAA;IAC7B;EACF;EAEA,OAAOA,KAAA,CAAME,OAAO;AACtB;AAEA,SAASD,MACPV,KAAsB,EACtBE,GAAW,EACXM,OAAmC,EACnCC,KAAyD,EACzDG,WAAA,GAAwB,EAAE;EAE1B,IAAI,CAACZ,KAAK,CAACE,GAAA,CAAI,EAAE;IACf,MAAM,IAAIW,KAAA,CAAM,eAAeX,GAAA,0CAA6C;EAC9E;EAEA,IAAIU,WAAA,CAAYE,QAAQ,CAACZ,GAAA,GAAM;IAC7B,MAAM,IAAIW,KAAA,CAAM,iCAAiCD,WAAA,CAAYG,IAAI,CAAC,cAAcb,GAAA,EAAK;EACvF;EAEA,IAAIM,OAAO,CAACN,GAAA,CAAI,EAA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AQ;MAChD,KAAK,MAAME,qBAAA,IAAyBnC,eAAA,CAAgBF,oBAAoB,EAAE;QACxE;QACA,MAAMsC,KAAA,GAAQL,gBAAA,CAAiBM,GAAG,CAACF,qBAAA;QACnC,IAAI,CAACC,KAAA,EAAO;UACV,IAAI,CAACP,kBAAA,CAAmBN,GAAG,CAACY,qBAAA,GAAwB;YAClD,MAAM,IAAI5B,KAAA,CACR,WAAWP,eAAA,CAAgBJ,GAAG,8BAA8BuC,qBAAA,wBAA6C;UAE7G,OAAO;YACL,MAAM,IAAI5B,KAAA,CACR,WAAWP,eAAA,CAAgBJ,GAAG,8BAA8BuC,qBAAA,iCAAsD;UAEtH;QACF;MACF;IACF;IAEA,MAAMG,OAAA,GACJ,OAAOtC,eAAA,CAAgBsC,OAAO,KAAK,aAC/B,MAAMtC,eAAA,CAAgBsC,OAAO,CAAC;MAC5BvB,MAAA;MACAc,kBAAA;MACAb,MAAA;MACAC,iBAAA;MACAc,gBAAA;MACAb;IACF,KACAlB,eAAA,CAAgBsC,OAAO;IAE7B,MAAMC,eAAA,GAAmDD,OAAA;IAKzD;IACA;IACAC,eAAA,CAAgB3C,GAAG,GAAGI,eAAA,CAAgBJ,GAAG;IACzC2C,eAAA,CAAgBC,KAAK,GAAGR,MAAA;IACxBO,eAAA,CAAgB1C,YAAY,GAAGG,eAAA,CAAgBH,YAAY;IAC3D0C,eAAA,CAAgBzC,oBAAoB,GAAGE,eAAA,CAAgBF,oBAAoB;IAC3EyC,eAAA,CAAgBxC,gBAAgB,GAAGC,eAAA,CAAgBD,gBAAgB;IAEnEgC,gBAAA,CAAiBN,GAAG,CAACzB,eAAA,CAAgBJ,GAAG,EAAE2C,eAAA;IAE1CP,MAAA;EACF;EAEA,OAAOD,gBAAA;AACT","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/server/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIlF,eAAO,MAAM,sBAAsB,aACvB,wBAAwB,KACjC,uBA+HF,CAAA;AAED,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,eAAe,EACvB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,2BAA2B,CAAC,CAYtC"}
1
+ {"version":3,"file":"sanitize.d.ts","sourceRoot":"","sources":["../../../../src/lexical/config/server/sanitize.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,kCAAkC,CAAA;AACzC,OAAO,KAAK,EAAE,2BAA2B,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIlF,eAAO,MAAM,sBAAsB,GACjC,UAAU,wBAAwB,KACjC,uBA0HF,CAAA;AAED,wBAAsB,0BAA0B,CAC9C,YAAY,EAAE,kBAAkB,EAChC,MAAM,EAAE,eAAe,EACvB,iBAAiB,CAAC,EAAE,OAAO,GAC1B,OAAO,CAAC,2BAA2B,CAAC,CAYtC"}
@@ -1,13 +1,7 @@
1
1
  import { loadFeatures } from './loader.js';
2
2
  export const sanitizeServerFeatures = features => {
3
3
  const sanitized = {
4
- converters: {
5
- html: []
6
- },
7
4
  enabledFeatures: [],
8
- generatedTypes: {
9
- modifyOutputSchemas: []
10
- },
11
5
  getSubFields: new Map(),
12
6
  getSubFieldsData: new Map(),
13
7
  graphQLPopulationPromises: new Map(),
@@ -32,9 +26,6 @@ export const sanitizeServerFeatures = features => {
32
26
  return sanitized;
33
27
  }
34
28
  features.forEach(feature => {
35
- if (feature?.generatedTypes?.modifyOutputSchema) {
36
- sanitized.generatedTypes.modifyOutputSchemas.push(feature.generatedTypes.modifyOutputSchema);
37
- }
38
29
  if (feature?.hooks?.beforeValidate?.length) {
39
30
  sanitized.hooks.beforeValidate = sanitized.hooks.beforeValidate?.concat(feature.hooks.beforeValidate);
40
31
  }
@@ -61,20 +52,21 @@ export const sanitizeServerFeatures = features => {
61
52
  if (feature.nodes?.length) {
62
53
  // Do not concat here. We need to keep the object reference of sanitized.nodes so that function markdown transformers of features automatically get the updated nodes
63
54
  for (const node of feature.nodes) {
55
+ const nodeType = 'with' in node.node ? node.node.replace.getType() : node.node.getType();
56
+ const alreadyRegistered = sanitized.nodes.some(existing => {
57
+ const existingType = 'with' in existing.node ? existing.node.replace.getType() : existing.node.getType();
58
+ return existingType === nodeType;
59
+ });
60
+ if (alreadyRegistered) {
61
+ throw new Error(`Lexical editor config: node type "${nodeType}" was registered more than once (feature "${feature.key}"). Each lexical node type may only be registered by a single feature.`);
62
+ }
64
63
  sanitized.nodes.push(node);
65
- }
66
- feature.nodes.forEach(node => {
67
- const nodeType = 'with' in node.node ? node.node.replace.getType() : node.node.getType() // TODO: Idk if this works for node replacements
68
- ;
69
64
  if (node?.graphQLPopulationPromises?.length) {
70
65
  sanitized.graphQLPopulationPromises.set(nodeType, node.graphQLPopulationPromises);
71
66
  }
72
67
  if (node?.validations?.length) {
73
68
  sanitized.validations.set(nodeType, node.validations);
74
69
  }
75
- if (node?.converters?.html) {
76
- sanitized.converters.html.push(node.converters.html);
77
- }
78
70
  if (node?.hooks?.afterChange) {
79
71
  sanitized.nodeHooks?.afterChange?.set(nodeType, node.hooks.afterChange);
80
72
  }
@@ -93,7 +85,7 @@ export const sanitizeServerFeatures = features => {
93
85
  if (node?.getSubFieldsData) {
94
86
  sanitized.getSubFieldsData?.set(nodeType, node.getSubFieldsData);
95
87
  }
96
- });
88
+ }
97
89
  }
98
90
  if (feature.markdownTransformers?.length) {
99
91
  // Do not concat here. We need to keep the object reference of feature.markdownTransformers
@@ -1 +1 @@
1
- {"version":3,"file":"sanitize.js","names":["loadFeatures","sanitizeServerFeatures","features","sanitized","converters","html","enabledFeatures","generatedTypes","modifyOutputSchemas","getSubFields","Map","getSubFieldsData","graphQLPopulationPromises","hooks","afterChange","afterRead","beforeChange","beforeValidate","i18n","markdownTransformers","nodeHooks","nodes","validations","size","forEach","feature","modifyOutputSchema","push","length","concat","lang","lexical","key","node","nodeType","replace","getType","set","transformer","allNodes","allTransformers","sanitizeServerEditorConfig","editorConfig","config","parentIsLocalized","resolvedFeatureMap","unSanitizedEditorConfig"],"sources":["../../../../src/lexical/config/server/sanitize.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n} from '../../../features/typesServer.js'\nimport type { SanitizedServerEditorConfig, ServerEditorConfig } from '../types.js'\n\nimport { loadFeatures } from './loader.js'\n\nexport const sanitizeServerFeatures = (\n features: ResolvedServerFeatureMap,\n): SanitizedServerFeatures => {\n const sanitized: SanitizedServerFeatures = {\n converters: {\n html: [],\n },\n enabledFeatures: [],\n generatedTypes: {\n modifyOutputSchemas: [],\n },\n getSubFields: new Map(),\n getSubFieldsData: new Map(),\n graphQLPopulationPromises: new Map(),\n hooks: {\n afterChange: [],\n afterRead: [],\n beforeChange: [],\n beforeValidate: [],\n },\n i18n: {},\n markdownTransformers: [],\n nodeHooks: {\n afterChange: new Map(),\n afterRead: new Map(),\n beforeChange: new Map(),\n beforeValidate: new Map(),\n },\n nodes: [],\n\n validations: new Map(),\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature?.generatedTypes?.modifyOutputSchema) {\n sanitized.generatedTypes.modifyOutputSchemas.push(feature.generatedTypes.modifyOutputSchema)\n }\n\n if (feature?.hooks?.beforeValidate?.length) {\n sanitized.hooks.beforeValidate = sanitized.hooks.beforeValidate?.concat(\n feature.hooks.beforeValidate,\n )\n }\n if (feature?.hooks?.beforeChange?.length) {\n sanitized.hooks.beforeChange = sanitized.hooks.beforeChange?.concat(\n feature.hooks.beforeChange,\n )\n }\n if (feature?.hooks?.afterRead?.length) {\n sanitized.hooks.afterRead = sanitized.hooks.afterRead?.concat(feature.hooks.afterRead)\n }\n if (feature?.hooks?.afterChange?.length) {\n sanitized.hooks.afterChange = sanitized.hooks.afterChange?.concat(feature.hooks.afterChange)\n }\n\n if (feature?.i18n) {\n for (const lang in feature.i18n) {\n if (!sanitized.i18n[lang as keyof typeof sanitized.i18n]) {\n sanitized.i18n[lang as keyof typeof sanitized.i18n] = {\n lexical: {},\n }\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n sanitized.i18n[lang].lexical[feature.key] = feature.i18n[lang]\n }\n }\n\n if (feature.nodes?.length) {\n // Do not concat here. We need to keep the object reference of sanitized.nodes so that function markdown transformers of features automatically get the updated nodes\n for (const node of feature.nodes) {\n sanitized.nodes.push(node)\n }\n feature.nodes.forEach((node) => {\n const nodeType = 'with' in node.node ? node.node.replace.getType() : node.node.getType() // TODO: Idk if this works for node replacements\n if (node?.graphQLPopulationPromises?.length) {\n sanitized.graphQLPopulationPromises.set(nodeType, node.graphQLPopulationPromises)\n }\n if (node?.validations?.length) {\n sanitized.validations.set(nodeType, node.validations)\n }\n if (node?.converters?.html) {\n sanitized.converters.html.push(node.converters.html)\n }\n if (node?.hooks?.afterChange) {\n sanitized.nodeHooks?.afterChange?.set(nodeType, node.hooks.afterChange)\n }\n if (node?.hooks?.afterRead) {\n sanitized.nodeHooks?.afterRead?.set(nodeType, node.hooks.afterRead)\n }\n if (node?.hooks?.beforeChange) {\n sanitized.nodeHooks?.beforeChange?.set(nodeType, node.hooks.beforeChange)\n }\n if (node?.hooks?.beforeValidate) {\n sanitized.nodeHooks?.beforeValidate?.set(nodeType, node.hooks.beforeValidate)\n }\n if (node?.getSubFields) {\n sanitized.getSubFields?.set(nodeType, node.getSubFields)\n }\n if (node?.getSubFieldsData) {\n sanitized.getSubFieldsData?.set(nodeType, node.getSubFieldsData)\n }\n })\n }\n\n if (feature.markdownTransformers?.length) {\n // Do not concat here. We need to keep the object reference of feature.markdownTransformers\n\n for (const transformer of feature.markdownTransformers) {\n if (typeof transformer === 'function') {\n sanitized.markdownTransformers.push(\n transformer({\n allNodes: sanitized.nodes,\n allTransformers: sanitized.markdownTransformers,\n }),\n )\n } else {\n sanitized.markdownTransformers.push(transformer)\n }\n }\n }\n\n sanitized.enabledFeatures.push(feature.key)\n })\n\n return sanitized\n}\n\nexport async function sanitizeServerEditorConfig(\n editorConfig: ServerEditorConfig,\n config: SanitizedConfig,\n parentIsLocalized?: boolean,\n): Promise<SanitizedServerEditorConfig> {\n const resolvedFeatureMap = await loadFeatures({\n config,\n parentIsLocalized: parentIsLocalized!,\n unSanitizedEditorConfig: editorConfig,\n })\n\n return {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical: editorConfig.lexical!,\n resolvedFeatureMap,\n }\n}\n"],"mappings":"AAQA,SAASA,YAAY,QAAQ;AAE7B,OAAO,MAAMC,sBAAA,GACXC,QAAA;EAEA,MAAMC,SAAA,GAAqC;IACzCC,UAAA,EAAY;MACVC,IAAA,EAAM;IACR;IACAC,eAAA,EAAiB,EAAE;IACnBC,cAAA,EAAgB;MACdC,mBAAA,EAAqB;IACvB;IACAC,YAAA,EAAc,IAAIC,GAAA;IAClBC,gBAAA,EAAkB,IAAID,GAAA;IACtBE,yBAAA,EAA2B,IAAIF,GAAA;IAC/BG,KAAA,EAAO;MACLC,WAAA,EAAa,EAAE;MACfC,SAAA,EAAW,EAAE;MACbC,YAAA,EAAc,EAAE;MAChBC,cAAA,EAAgB;IAClB;IACAC,IAAA,EAAM,CAAC;IACPC,oBAAA,EAAsB,EAAE;IACxBC,SAAA,EAAW;MACTN,WAAA,EAAa,IAAIJ,GAAA;MACjBK,SAAA,EAAW,IAAIL,GAAA;MACfM,YAAA,EAAc,IAAIN,GAAA;MAClBO,cAAA,EAAgB,IAAIP,GAAA;IACtB;I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W,WAAA;QACtC;MACF;IACF;IAEAnC,SAAA,CAAUG,eAAe,CAACqB,IAAI,CAACF,OAAA,CAAQO,GAAG;EAC5C;EAEA,OAAO7B,SAAA;AACT;AAEA,OAAO,eAAesC,2BACpBC,YAAgC,EAChCC,MAAuB,EACvBC,iBAA2B;EAE3B,MAAMC,kBAAA,GAAqB,MAAM7C,YAAA,CAAa;IAC5C2C,MAAA;IACAC,iBAAA,EAAmBA,iBAAA;IACnBE,uBAAA,EAAyBJ;EAC3B;EAEA,OAAO;IACLxC,QAAA,EAAUD,sBAAA,CAAuB4C,kBAAA;IACjCd,OAAA,EAASW,YAAA,CAAaX,OAAO;IAC7Bc;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"sanitize.js","names":["loadFeatures","sanitizeServerFeatures","features","sanitized","enabledFeatures","getSubFields","Map","getSubFieldsData","graphQLPopulationPromises","hooks","afterChange","afterRead","beforeChange","beforeValidate","i18n","markdownTransformers","nodeHooks","nodes","validations","size","forEach","feature","length","concat","lang","lexical","key","node","nodeType","replace","getType","alreadyRegistered","some","existing","existingType","Error","push","set","transformer","allNodes","allTransformers","sanitizeServerEditorConfig","editorConfig","config","parentIsLocalized","resolvedFeatureMap","unSanitizedEditorConfig"],"sources":["../../../../src/lexical/config/server/sanitize.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport type {\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n} from '../../../features/typesServer.js'\nimport type { SanitizedServerEditorConfig, ServerEditorConfig } from '../types.js'\n\nimport { loadFeatures } from './loader.js'\n\nexport const sanitizeServerFeatures = (\n features: ResolvedServerFeatureMap,\n): SanitizedServerFeatures => {\n const sanitized: SanitizedServerFeatures = {\n enabledFeatures: [],\n getSubFields: new Map(),\n getSubFieldsData: new Map(),\n graphQLPopulationPromises: new Map(),\n hooks: {\n afterChange: [],\n afterRead: [],\n beforeChange: [],\n beforeValidate: [],\n },\n i18n: {},\n markdownTransformers: [],\n nodeHooks: {\n afterChange: new Map(),\n afterRead: new Map(),\n beforeChange: new Map(),\n beforeValidate: new Map(),\n },\n nodes: [],\n\n validations: new Map(),\n }\n\n if (!features?.size) {\n return sanitized\n }\n\n features.forEach((feature) => {\n if (feature?.hooks?.beforeValidate?.length) {\n sanitized.hooks.beforeValidate = sanitized.hooks.beforeValidate?.concat(\n feature.hooks.beforeValidate,\n )\n }\n if (feature?.hooks?.beforeChange?.length) {\n sanitized.hooks.beforeChange = sanitized.hooks.beforeChange?.concat(\n feature.hooks.beforeChange,\n )\n }\n if (feature?.hooks?.afterRead?.length) {\n sanitized.hooks.afterRead = sanitized.hooks.afterRead?.concat(feature.hooks.afterRead)\n }\n if (feature?.hooks?.afterChange?.length) {\n sanitized.hooks.afterChange = sanitized.hooks.afterChange?.concat(feature.hooks.afterChange)\n }\n\n if (feature?.i18n) {\n for (const lang in feature.i18n) {\n if (!sanitized.i18n[lang as keyof typeof sanitized.i18n]) {\n sanitized.i18n[lang as keyof typeof sanitized.i18n] = {\n lexical: {},\n }\n }\n // @ts-expect-error - vestiges of when tsconfig was not strict. Feel free to improve\n sanitized.i18n[lang].lexical[feature.key] = feature.i18n[lang]\n }\n }\n\n if (feature.nodes?.length) {\n // Do not concat here. We need to keep the object reference of sanitized.nodes so that function markdown transformers of features automatically get the updated nodes\n for (const node of feature.nodes) {\n const nodeType = 'with' in node.node ? node.node.replace.getType() : node.node.getType()\n const alreadyRegistered = sanitized.nodes.some((existing) => {\n const existingType =\n 'with' in existing.node ? existing.node.replace.getType() : existing.node.getType()\n return existingType === nodeType\n })\n if (alreadyRegistered) {\n throw new Error(\n `Lexical editor config: node type \"${nodeType}\" was registered more than once (feature \"${feature.key}\"). Each lexical node type may only be registered by a single feature.`,\n )\n }\n sanitized.nodes.push(node)\n if (node?.graphQLPopulationPromises?.length) {\n sanitized.graphQLPopulationPromises.set(nodeType, node.graphQLPopulationPromises)\n }\n if (node?.validations?.length) {\n sanitized.validations.set(nodeType, node.validations)\n }\n if (node?.hooks?.afterChange) {\n sanitized.nodeHooks?.afterChange?.set(nodeType, node.hooks.afterChange)\n }\n if (node?.hooks?.afterRead) {\n sanitized.nodeHooks?.afterRead?.set(nodeType, node.hooks.afterRead)\n }\n if (node?.hooks?.beforeChange) {\n sanitized.nodeHooks?.beforeChange?.set(nodeType, node.hooks.beforeChange)\n }\n if (node?.hooks?.beforeValidate) {\n sanitized.nodeHooks?.beforeValidate?.set(nodeType, node.hooks.beforeValidate)\n }\n if (node?.getSubFields) {\n sanitized.getSubFields?.set(nodeType, node.getSubFields)\n }\n if (node?.getSubFieldsData) {\n sanitized.getSubFieldsData?.set(nodeType, node.getSubFieldsData)\n }\n }\n }\n\n if (feature.markdownTransformers?.length) {\n // Do not concat here. We need to keep the object reference of feature.markdownTransformers\n\n for (const transformer of feature.markdownTransformers) {\n if (typeof transformer === 'function') {\n sanitized.markdownTransformers.push(\n transformer({\n allNodes: sanitized.nodes,\n allTransformers: sanitized.markdownTransformers,\n }),\n )\n } else {\n sanitized.markdownTransformers.push(transformer)\n }\n }\n }\n\n sanitized.enabledFeatures.push(feature.key)\n })\n\n return sanitized\n}\n\nexport async function sanitizeServerEditorConfig(\n editorConfig: ServerEditorConfig,\n config: SanitizedConfig,\n parentIsLocalized?: boolean,\n): Promise<SanitizedServerEditorConfig> {\n const resolvedFeatureMap = await loadFeatures({\n config,\n parentIsLocalized: parentIsLocalized!,\n unSanitizedEditorConfig: editorConfig,\n })\n\n return {\n features: sanitizeServerFeatures(resolvedFeatureMap),\n lexical: editorConfig.lexical!,\n resolvedFeatureMap,\n }\n}\n"],"mappings":"AAQA,SAASA,YAAY,QAAQ;AAE7B,OAAO,MAAMC,sBAAA,GACXC,QAAA;EAEA,MAAMC,SAAA,GAAqC;IACzCC,eAAA,EAAiB,EAAE;IACnBC,YAAA,EAAc,IAAIC,GAAA;IAClBC,gBAAA,EAAkB,IAAID,GAAA;IACtBE,yBAAA,EAA2B,IAAIF,GAAA;IAC/BG,KAAA,EAAO;MACLC,WAAA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AA,CAAQN,oBAAoB,EAAE;QACtD,IAAI,OAAOuB,WAAA,KAAgB,YAAY;UACrCnC,SAAA,CAAUY,oBAAoB,CAACqB,IAAI,CACjCE,WAAA,CAAY;YACVC,QAAA,EAAUpC,SAAA,CAAUc,KAAK;YACzBuB,eAAA,EAAiBrC,SAAA,CAAUY;UAC7B;QAEJ,OAAO;UACLZ,SAAA,CAAUY,oBAAoB,CAACqB,IAAI,CAACE,WAAA;QACtC;MACF;IACF;IAEAnC,SAAA,CAAUC,eAAe,CAACgC,IAAI,CAACf,OAAA,CAAQK,GAAG;EAC5C;EAEA,OAAOvB,SAAA;AACT;AAEA,OAAO,eAAesC,2BACpBC,YAAgC,EAChCC,MAAuB,EACvBC,iBAA2B;EAE3B,MAAMC,kBAAA,GAAqB,MAAM7C,YAAA,CAAa;IAC5C2C,MAAA;IACAC,iBAAA,EAAmBA,iBAAA;IACnBE,uBAAA,EAAyBJ;EAC3B;EAEA,OAAO;IACLxC,QAAA,EAAUD,sBAAA,CAAuB4C,kBAAA;IACjCpB,OAAA,EAASiB,YAAA,CAAajB,OAAO;IAC7BoB;EACF;AACF","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import type { EditorConfig as LexicalEditorConfig } from 'lexical';
2
2
  import type { FeatureProviderClient, ResolvedClientFeatureMap, SanitizedClientFeatures } from '../../features/typesClient.js';
3
3
  import type { FeatureProviderServer, ResolvedServerFeatureMap, SanitizedServerFeatures } from '../../features/typesServer.js';
4
- import type { LexicalFieldAdminClientProps } from '../../types.js';
4
+ import type { LexicalFieldAdminClientProps } from '../../types/index.js';
5
5
  export type ServerEditorConfig = {
6
6
  features: FeatureProviderServer<any, any, any>[];
7
7
  lexical?: LexicalEditorConfig | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/lexical/config/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AA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EACxB,uBAAuB,EACxB,MAAM,+BAA+B,CAAA;AACtC,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAA;AAExE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;IAChD,OAAO,CAAC,EAAE,mBAAmB,GAAG,SAAS,CAAA;CAC1C,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,QAAQ,EAAE,uBAAuB,CAAA;IACjC,OAAO,EAAE,mBAAmB,GAAG,SAAS,CAAA;IACxC,kBAAkB,EAAE,wBAAwB,CAAA;CAC7C,CAAA;AAED,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,EAAE,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,CAAA;IAC3C,OAAO,CAAC,EAAE,mBAAmB,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,2BAA2B,GAAG;IACxC,KAAK,CAAC,EAAE,4BAA4B,CAAA;IACpC,QAAQ,EAAE,uBAAuB,CAAA;IACjC,OAAO,EAAE,mBAAmB,CAAA;IAC5B,kBAAkB,EAAE,wBAAwB,CAAA;IAC5C;;OAEG;IACH,IAAI,CAAC,EAAE,MAAM,CAAA;CACd,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"types.js","names":[],"sources":["../../../src/lexical/config/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type {\n FeatureProviderClient,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n} from '../../features/typesClient.js'\nimport type {\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n} from '../../features/typesServer.js'\nimport type { LexicalFieldAdminClientProps } from '../../types.js'\n\nexport type ServerEditorConfig = {\n features: FeatureProviderServer<any, any, any>[]\n lexical?: LexicalEditorConfig | undefined // If undefined, the default lexical editor config will be used. This can be undefined so that we do not send the default lexical editor config to the client.\n}\n\nexport type SanitizedServerEditorConfig = {\n features: SanitizedServerFeatures\n lexical: LexicalEditorConfig | undefined // If undefined, the default lexical editor config will be used. This can be undefined so that we do not send the default lexical editor config to the client.\n resolvedFeatureMap: ResolvedServerFeatureMap\n}\n\nexport type ClientEditorConfig = {\n features: FeatureProviderClient<any, any>[]\n lexical?: LexicalEditorConfig\n}\n\nexport type SanitizedClientEditorConfig = {\n admin?: LexicalFieldAdminClientProps\n features: SanitizedClientFeatures\n lexical: LexicalEditorConfig\n resolvedFeatureMap: ResolvedClientFeatureMap\n /**\n * To identify what view this editor config was created for.\n */\n view?: string\n}\n"],"mappings":"AA8BA","ignoreList":[]}
1
+ {"version":3,"file":"types.js","names":[],"sources":["../../../src/lexical/config/types.ts"],"sourcesContent":["import type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport type {\n FeatureProviderClient,\n ResolvedClientFeatureMap,\n SanitizedClientFeatures,\n} from '../../features/typesClient.js'\nimport type {\n FeatureProviderServer,\n ResolvedServerFeatureMap,\n SanitizedServerFeatures,\n} from '../../features/typesServer.js'\nimport type { LexicalFieldAdminClientProps } from '../../types/index.js'\n\nexport type ServerEditorConfig = {\n features: FeatureProviderServer<any, any, any>[]\n lexical?: LexicalEditorConfig | undefined // If undefined, the default lexical editor config will be used. This can be undefined so that we do not send the default lexical editor config to the client.\n}\n\nexport type SanitizedServerEditorConfig = {\n features: SanitizedServerFeatures\n lexical: LexicalEditorConfig | undefined // If undefined, the default lexical editor config will be used. This can be undefined so that we do not send the default lexical editor config to the client.\n resolvedFeatureMap: ResolvedServerFeatureMap\n}\n\nexport type ClientEditorConfig = {\n features: FeatureProviderClient<any, any>[]\n lexical?: LexicalEditorConfig\n}\n\nexport type SanitizedClientEditorConfig = {\n admin?: LexicalFieldAdminClientProps\n features: SanitizedClientFeatures\n lexical: LexicalEditorConfig\n resolvedFeatureMap: ResolvedClientFeatureMap\n /**\n * To identify what view this editor config was created for.\n */\n view?: string\n}\n"],"mappings":"AA8BA","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { Klass, LexicalEditor, LexicalNode, LexicalNodeReplacement } from 'lexical';
2
2
  import type { NodeWithHooks } from '../../features/typesServer.js';
3
- import type { LexicalEditorNodeMap } from '../../types.js';
3
+ import type { LexicalEditorNodeMap } from '../../types/index.js';
4
4
  import type { SanitizedClientEditorConfig, SanitizedServerEditorConfig } from '../config/types.js';
5
5
  /**
6
6
  * Register view definitions for an editor
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lexical/nodes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,KAAK,EACL,aAAa,EACb,WAAW,EACX,sBAAsB,EACvB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,KAAK,EACV,oBAAoB,EAIrB,MAAM,gBAAgB,CAAA;AACvB,OAAO,KAAK,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAMlG;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,oBAAoB,GAC9B,IAAI,CAsCN;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAEhE;AAwKD,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,SAAS,GACV,EAAE;IACD,YAAY,EAAE,2BAA2B,GAAG,2BAA2B,CAAA;IACvE,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAyCrD;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,KAAK,GACN,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAA;CACjF,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAOrD"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/lexical/nodes/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,KAAK,EACL,aAAa,EACb,WAAW,EACX,sBAAsB,EACvB,MAAM,SAAS,CAAA;AAMhB,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAA;AAClE,OAAO,KAAK,EACV,oBAAoB,EAIrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EAAE,2BAA2B,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAA;AAMlG;;GAEG;AACH,wBAAgB,uBAAuB,CACrC,MAAM,EAAE,aAAa,EACrB,SAAS,EAAE,oBAAoB,GAC9B,IAAI,CAsCN;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,aAAa,GAAG,IAAI,CAEhE;AAwKD,wBAAgB,eAAe,CAAC,EAC9B,YAAY,EACZ,SAAS,GACV,EAAE;IACD,YAAY,EAAE,2BAA2B,GAAG,2BAA2B,CAAA;IACvE,SAAS,CAAC,EAAE,oBAAoB,CAAA;CACjC,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAyCrD;AAED,wBAAgB,8BAA8B,CAAC,EAC7C,KAAK,GACN,EAAE;IACD,KAAK,EAAE,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,GAAG,KAAK,CAAC,aAAa,CAAC,CAAA;CACjF,GAAG,KAAK,CAAC,KAAK,CAAC,WAAW,CAAC,GAAG,sBAAsB,CAAC,CAOrD"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["React","editorNodeViews","WeakMap","registerEditorNodeViews","editor","nodeViews","has","set","Map","editorViews","get","nodeType","value","Object","entries","blockType","viewDef","clearEditorNodeViews","delete","getEditorNodeView","node","applyNodeOverride","getType","NodeClass","prototype","_originalDecorate","decorate","_originalCreateDOM","createDOM","_decorateOverridden","hasCreateDOM","config","Component","isEditor","isJSXConverter","html","htmlContent","createElement","dangerouslySetInnerHTML","__html","Fragment","blockViewDef","Block","Label","originalDecorate","call","_createDOMOverridden","tempDiv","document","innerHTML","firstElementChild","getEnabledNodes","editorConfig","nodes","getEnabledNodesFromServerNodes","features","nodeTypesToOverride","Set","key","keys","length","add","map"],"sources":["../../../src/lexical/nodes/index.ts"],"sourcesContent":["import type {\n EditorConfig,\n Klass,\n LexicalEditor,\n LexicalNode,\n LexicalNodeReplacement,\n} from 'lexical'\n\nimport React from 'react'\n\nimport type { BlockDecorateFunction } from '../../features/blocks/client/nodes/BlocksNode.js'\nimport type { InlineBlockDecorateFunction } from '../../features/blocks/client/nodes/InlineBlocksNode.js'\nimport type { NodeWithHooks } from '../../features/typesServer.js'\nimport type {\n LexicalEditorNodeMap,\n NodeMapBlockValue,\n NodeMapInlineBlockValue,\n NodeMapValue,\n} from '../../types.js'\nimport type { SanitizedClientEditorConfig, SanitizedServerEditorConfig } from '../config/types.js'\n\n// Store view definitions for each editor and node type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst editorNodeViews = new WeakMap<LexicalEditor, Map<string, NodeMapValue<any>>>()\n\n/**\n * Register view definitions for an editor\n */\nexport function registerEditorNodeViews(\n editor: LexicalEditor,\n nodeViews: LexicalEditorNodeMap,\n): void {\n if (!editorNodeViews.has(editor)) {\n editorNodeViews.set(editor, new Map())\n }\n const editorViews = editorNodeViews.get(editor)!\n\n // Register each node type's view\n for (const [nodeType, value] of Object.entries(nodeViews)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // Handle blocks specially - store each block type with key 'block:blockType'\n if (nodeType === 'blocks') {\n for (const [blockType, viewDef] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as Record<string, NodeMapValue<any>>,\n )) {\n editorViews.set(`block:${blockType}`, viewDef)\n }\n continue\n }\n\n // Handle inlineBlocks specially - store each block type with key 'inlineBlock:blockType'\n if (nodeType === 'inlineBlocks') {\n for (const [blockType, viewDef] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as Record<string, NodeMapValue<any>>,\n )) {\n editorViews.set(`inlineBlock:${blockType}`, viewDef)\n }\n continue\n }\n\n // Regular node types\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n editorViews.set(nodeType, value as NodeMapValue<any>)\n }\n}\n\n/**\n * Clear all view overrides for an editor (restores default rendering)\n */\nexport function clearEditorNodeViews(editor: LexicalEditor): void {\n editorNodeViews.delete(editor)\n}\n\n/**\n * Get the view definition for a specific editor and node\n */\nfunction getEditorNodeView(\n editor: LexicalEditor,\n nodeType: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node?: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): NodeMapValue<any> | undefined {\n const editorViews = editorNodeViews.get(editor)\n\n // For block nodes, look up by blockType\n if (nodeType === 'block' && node?.['__fields']?.blockType) {\n const blockType = node['__fields'].blockType\n return editorViews?.get(`block:${blockType}`)\n }\n\n // For inlineBlock nodes, look up by blockType\n if (nodeType === 'inlineBlock' && node?.['__fields']?.blockType) {\n const blockType = node['__fields'].blockType\n return editorViews?.get(`inlineBlock:${blockType}`)\n }\n\n // Regular node types\n return editorViews?.get(nodeType)\n}\n\n/**\n * Apply view overrides to a specific node type by modifying its prototype\n * Uses WeakMap to check per-editor at runtime\n */\nfunction applyNodeOverride({\n node,\n nodeType,\n}: {\n node: Klass<LexicalNode>\n nodeType: string\n}): void {\n if (!('getType' in node) || node.getType() !== nodeType) {\n return\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const NodeClass = node as any\n\n // Store original methods if not already stored\n if (!NodeClass.prototype._originalDecorate) {\n NodeClass.prototype._originalDecorate = NodeClass.prototype.decorate\n }\n if (!NodeClass.prototype._originalCreateDOM) {\n NodeClass.prototype._originalCreateDOM = NodeClass.prototype.createDOM\n }\n\n // Override decorate method (for DecoratorNodes)\n if (NodeClass.prototype.decorate && !NodeClass.prototype._decorateOverridden) {\n NodeClass.prototype._decorateOverridden = true\n const hasCreateDOM = !!NodeClass.prototype.createDOM\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n NodeClass.prototype.decorate = function (editor: LexicalEditor, config: EditorConfig): any {\n const viewDef = getEditorNodeView(editor, nodeType, this)\n\n if (viewDef) {\n // Priority 1: If Component is provided, use it\n if (viewDef.Component) {\n return viewDef.Component({\n config,\n editor,\n isEditor: true,\n isJSXConverter: false,\n node: this,\n })\n }\n\n // Priority 2: If custom createDOM is provided, use html in decorate\n if (viewDef.createDOM && viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function'\n ? viewDef.html({ config, editor, isEditor: true, isJSXConverter: false, node: this })\n : viewDef.html\n return React.createElement('span', {\n dangerouslySetInnerHTML: { __html: htmlContent },\n })\n }\n\n // Priority 3: If only html is provided (no custom createDOM),\n // createDOM will handle it, so decorate returns empty fragment\n if (viewDef.html && hasCreateDOM && !viewDef.createDOM) {\n return React.createElement(React.Fragment)\n }\n\n if (nodeType === 'block') {\n const blockViewDef: NodeMapBlockValue = viewDef as NodeMapBlockValue\n if (blockViewDef.Block || blockViewDef.Label) {\n const originalDecorate: BlockDecorateFunction = NodeClass.prototype._originalDecorate\n\n // Pass Block FC to BlockContent for rendering\n // BlockContent will render with useBlockComponentContext hook (client-only)\n return originalDecorate.call(\n this,\n editor,\n config,\n blockViewDef.Block,\n blockViewDef.Label,\n )\n }\n } else if (nodeType === 'inlineBlock') {\n const blockViewDef: NodeMapInlineBlockValue = viewDef as NodeMapInlineBlockValue\n if (blockViewDef.Block || blockViewDef.Label) {\n const originalDecorate: InlineBlockDecorateFunction =\n NodeClass.prototype._originalDecorate\n\n // Pass Block FC to BlockContent for rendering\n // BlockContent will render with useBlockComponentContext hook (client-only)\n return originalDecorate.call(\n this,\n editor,\n config,\n blockViewDef.Block,\n blockViewDef.Label,\n )\n }\n }\n }\n\n const originalDecorate: BlockDecorateFunction | InlineBlockDecorateFunction =\n NodeClass.prototype._originalDecorate\n\n // Otherwise use original\n return originalDecorate.call(this, editor, config)\n }\n }\n\n // Override createDOM method (for ElementNodes)\n if (NodeClass.prototype.createDOM && !NodeClass.prototype._createDOMOverridden) {\n NodeClass.prototype._createDOMOverridden = true\n NodeClass.prototype.createDOM = function (\n config: EditorConfig,\n editor: LexicalEditor,\n ): HTMLElement {\n const viewDef = getEditorNodeView(editor, nodeType, this)\n\n if (viewDef) {\n // If createDOM is provided, use it\n if (viewDef.createDOM) {\n return viewDef.createDOM({ config, editor, node: this })\n }\n\n // If html is provided (as a function or string), create element from it\n if (viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function'\n ? viewDef.html({ config, editor, isEditor: true, isJSXConverter: false, node: this })\n : viewDef.html\n const tempDiv = document.createElement('div')\n tempDiv.innerHTML = htmlContent\n return (tempDiv.firstElementChild as HTMLElement) || tempDiv\n }\n }\n\n // Otherwise use original\n return NodeClass.prototype._originalCreateDOM.call(this, config, editor)\n }\n }\n}\n\nexport function getEnabledNodes({\n editorConfig,\n nodeViews,\n}: {\n editorConfig: SanitizedClientEditorConfig | SanitizedServerEditorConfig\n nodeViews?: LexicalEditorNodeMap\n}): Array<Klass<LexicalNode> | LexicalNodeReplacement> {\n const nodes = getEnabledNodesFromServerNodes({\n nodes: editorConfig.features.nodes,\n })\n\n if (nodeViews) {\n // Apply node overrides by modifying prototypes (once globally)\n // The overrides check per-editor at runtime using WeakMap\n const nodeTypesToOverride = new Set<string>()\n\n for (const [key, value] of Object.entries(nodeViews)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // If 'blocks' key exists with content, we need to override 'block' nodes\n if (key === 'blocks' && Object.keys(value).length > 0) {\n nodeTypesToOverride.add('block')\n }\n // If 'inlineBlocks' key exists with content, we need to override 'inlineBlock' nodes\n else if (key === 'inlineBlocks' && Object.keys(value).length > 0) {\n nodeTypesToOverride.add('inlineBlock')\n }\n // Regular node types\n else {\n nodeTypesToOverride.add(key)\n }\n }\n\n for (const node of nodes) {\n if ('getType' in node) {\n const nodeType = node.getType()\n\n if (nodeTypesToOverride.has(nodeType)) {\n applyNodeOverride({ node, nodeType })\n }\n }\n }\n }\n\n return nodes\n}\n\nexport function getEnabledNodesFromServerNodes({\n nodes,\n}: {\n nodes: Array<Klass<LexicalNode> | LexicalNodeReplacement> | Array<NodeWithHooks>\n}): Array<Klass<LexicalNode> | LexicalNodeReplacement> {\n return nodes.map((node) => {\n if ('node' in node) {\n return node.node\n }\n return node\n })\n}\n"],"mappings":"AAQA,OAAOA,KAAA,MAAW;AAalB;AACA;AACA,MAAMC,eAAA,GAAkB,IAAIC,OAAA;AAE5B;;;AAGA,OAAO,SAASC,wBACdC,MAAqB,EACrBC,SAA+B;EAE/B,IAAI,CAACJ,eAAA,CAAgBK,GAAG,CAACF,MAAA,GAAS;IAChCH,eAAA,CAAgBM,GAAG,CAACH,MAAA,EAAQ,IAAII,GAAA;EAClC;EACA,MAAMC,WAAA,GAAcR,eAAA,CAAgBS,GAAG,CAACN,MAAA;EAExC;EACA,KAAK,MAAM,CAACO,QAAA,EAAUC,KAAA,CAAM,IAAIC,MAAA,CAAOC,OAAO,CAACT,SAAA,GAAY;IACzD,IAAI,CAACO,KAAA,IAAS,OAAOA,KAAA,KAAU,UAAU;MACvC;IACF;IAEA;IACA,IAAID,QAAA,KAAa,UAAU;MACzB,KAAK,MAAM,CAACI,SAAA,EAAWC,OAAA,CAAQ,IAAIH,MAAA,CAAOC,OAAO;MAC/C;MACAF,KAAA,GACC;QACDH,WAAA,CAAYF,GAAG,CAAC,SAASQ,SAAA,EAAW,EAAEC,OAAA;MACxC;MACA;IACF;IAEA;IACA,IAAIL,QAAA,KAAa,gBAAgB;MAC/B,KAAK,MAAM,CAACI,SAAA,EAAWC,OAAA,CAAQ,IAAIH,MAAA,CAAOC,OAAO;MAC/C;MACAF,KAAA,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AI,CAAC/C,KAAA,EAAOgD,MAAM,GAAG,GAAG;QAChEJ,mBAAA,CAAoBK,GAAG,CAAC;MAC1B,OAEK;QACHL,mBAAA,CAAoBK,GAAG,CAACH,GAAA;MAC1B;IACF;IAEA,KAAK,MAAMtC,IAAA,IAAQiC,KAAA,EAAO;MACxB,IAAI,aAAajC,IAAA,EAAM;QACrB,MAAMT,QAAA,GAAWS,IAAA,CAAKE,OAAO;QAE7B,IAAIkC,mBAAA,CAAoBlD,GAAG,CAACK,QAAA,GAAW;UACrCU,iBAAA,CAAkB;YAAED,IAAA;YAAMT;UAAS;QACrC;MACF;IACF;EACF;EAEA,OAAO0C,KAAA;AACT;AAEA,OAAO,SAASC,+BAA+B;EAC7CD;AAAK,CAGN;EACC,OAAOA,KAAA,CAAMS,GAAG,CAAE1C,IAAA;IAChB,IAAI,UAAUA,IAAA,EAAM;MAClB,OAAOA,IAAA,CAAKA,IAAI;IAClB;IACA,OAAOA,IAAA;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["React","editorNodeViews","WeakMap","registerEditorNodeViews","editor","nodeViews","has","set","Map","editorViews","get","nodeType","value","Object","entries","blockType","viewDef","clearEditorNodeViews","delete","getEditorNodeView","node","applyNodeOverride","getType","NodeClass","prototype","_originalDecorate","decorate","_originalCreateDOM","createDOM","_decorateOverridden","hasCreateDOM","config","Component","isEditor","isJSXConverter","html","htmlContent","createElement","dangerouslySetInnerHTML","__html","Fragment","blockViewDef","Block","Label","originalDecorate","call","_createDOMOverridden","tempDiv","document","innerHTML","firstElementChild","getEnabledNodes","editorConfig","nodes","getEnabledNodesFromServerNodes","features","nodeTypesToOverride","Set","key","keys","length","add","map"],"sources":["../../../src/lexical/nodes/index.ts"],"sourcesContent":["import type {\n EditorConfig,\n Klass,\n LexicalEditor,\n LexicalNode,\n LexicalNodeReplacement,\n} from 'lexical'\n\nimport React from 'react'\n\nimport type { BlockDecorateFunction } from '../../features/blocks/client/nodes/BlocksNode.js'\nimport type { InlineBlockDecorateFunction } from '../../features/blocks/client/nodes/InlineBlocksNode.js'\nimport type { NodeWithHooks } from '../../features/typesServer.js'\nimport type {\n LexicalEditorNodeMap,\n NodeMapBlockValue,\n NodeMapInlineBlockValue,\n NodeMapValue,\n} from '../../types/index.js'\nimport type { SanitizedClientEditorConfig, SanitizedServerEditorConfig } from '../config/types.js'\n\n// Store view definitions for each editor and node type\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nconst editorNodeViews = new WeakMap<LexicalEditor, Map<string, NodeMapValue<any>>>()\n\n/**\n * Register view definitions for an editor\n */\nexport function registerEditorNodeViews(\n editor: LexicalEditor,\n nodeViews: LexicalEditorNodeMap,\n): void {\n if (!editorNodeViews.has(editor)) {\n editorNodeViews.set(editor, new Map())\n }\n const editorViews = editorNodeViews.get(editor)!\n\n // Register each node type's view\n for (const [nodeType, value] of Object.entries(nodeViews)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // Handle blocks specially - store each block type with key 'block:blockType'\n if (nodeType === 'blocks') {\n for (const [blockType, viewDef] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as Record<string, NodeMapValue<any>>,\n )) {\n editorViews.set(`block:${blockType}`, viewDef)\n }\n continue\n }\n\n // Handle inlineBlocks specially - store each block type with key 'inlineBlock:blockType'\n if (nodeType === 'inlineBlocks') {\n for (const [blockType, viewDef] of Object.entries(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n value as Record<string, NodeMapValue<any>>,\n )) {\n editorViews.set(`inlineBlock:${blockType}`, viewDef)\n }\n continue\n }\n\n // Regular node types\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n editorViews.set(nodeType, value as NodeMapValue<any>)\n }\n}\n\n/**\n * Clear all view overrides for an editor (restores default rendering)\n */\nexport function clearEditorNodeViews(editor: LexicalEditor): void {\n editorNodeViews.delete(editor)\n}\n\n/**\n * Get the view definition for a specific editor and node\n */\nfunction getEditorNodeView(\n editor: LexicalEditor,\n nodeType: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n node?: any,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n): NodeMapValue<any> | undefined {\n const editorViews = editorNodeViews.get(editor)\n\n // For block nodes, look up by blockType\n if (nodeType === 'block' && node?.['__fields']?.blockType) {\n const blockType = node['__fields'].blockType\n return editorViews?.get(`block:${blockType}`)\n }\n\n // For inlineBlock nodes, look up by blockType\n if (nodeType === 'inlineBlock' && node?.['__fields']?.blockType) {\n const blockType = node['__fields'].blockType\n return editorViews?.get(`inlineBlock:${blockType}`)\n }\n\n // Regular node types\n return editorViews?.get(nodeType)\n}\n\n/**\n * Apply view overrides to a specific node type by modifying its prototype\n * Uses WeakMap to check per-editor at runtime\n */\nfunction applyNodeOverride({\n node,\n nodeType,\n}: {\n node: Klass<LexicalNode>\n nodeType: string\n}): void {\n if (!('getType' in node) || node.getType() !== nodeType) {\n return\n }\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const NodeClass = node as any\n\n // Store original methods if not already stored\n if (!NodeClass.prototype._originalDecorate) {\n NodeClass.prototype._originalDecorate = NodeClass.prototype.decorate\n }\n if (!NodeClass.prototype._originalCreateDOM) {\n NodeClass.prototype._originalCreateDOM = NodeClass.prototype.createDOM\n }\n\n // Override decorate method (for DecoratorNodes)\n if (NodeClass.prototype.decorate && !NodeClass.prototype._decorateOverridden) {\n NodeClass.prototype._decorateOverridden = true\n const hasCreateDOM = !!NodeClass.prototype.createDOM\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n NodeClass.prototype.decorate = function (editor: LexicalEditor, config: EditorConfig): any {\n const viewDef = getEditorNodeView(editor, nodeType, this)\n\n if (viewDef) {\n // Priority 1: If Component is provided, use it\n if (viewDef.Component) {\n return viewDef.Component({\n config,\n editor,\n isEditor: true,\n isJSXConverter: false,\n node: this,\n })\n }\n\n // Priority 2: If custom createDOM is provided, use html in decorate\n if (viewDef.createDOM && viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function'\n ? viewDef.html({ config, editor, isEditor: true, isJSXConverter: false, node: this })\n : viewDef.html\n return React.createElement('span', {\n dangerouslySetInnerHTML: { __html: htmlContent },\n })\n }\n\n // Priority 3: If only html is provided (no custom createDOM),\n // createDOM will handle it, so decorate returns empty fragment\n if (viewDef.html && hasCreateDOM && !viewDef.createDOM) {\n return React.createElement(React.Fragment)\n }\n\n if (nodeType === 'block') {\n const blockViewDef: NodeMapBlockValue = viewDef as NodeMapBlockValue\n if (blockViewDef.Block || blockViewDef.Label) {\n const originalDecorate: BlockDecorateFunction = NodeClass.prototype._originalDecorate\n\n // Pass Block FC to BlockContent for rendering\n // BlockContent will render with useBlockComponentContext hook (client-only)\n return originalDecorate.call(\n this,\n editor,\n config,\n blockViewDef.Block,\n blockViewDef.Label,\n )\n }\n } else if (nodeType === 'inlineBlock') {\n const blockViewDef: NodeMapInlineBlockValue = viewDef as NodeMapInlineBlockValue\n if (blockViewDef.Block || blockViewDef.Label) {\n const originalDecorate: InlineBlockDecorateFunction =\n NodeClass.prototype._originalDecorate\n\n // Pass Block FC to BlockContent for rendering\n // BlockContent will render with useBlockComponentContext hook (client-only)\n return originalDecorate.call(\n this,\n editor,\n config,\n blockViewDef.Block,\n blockViewDef.Label,\n )\n }\n }\n }\n\n const originalDecorate: BlockDecorateFunction | InlineBlockDecorateFunction =\n NodeClass.prototype._originalDecorate\n\n // Otherwise use original\n return originalDecorate.call(this, editor, config)\n }\n }\n\n // Override createDOM method (for ElementNodes)\n if (NodeClass.prototype.createDOM && !NodeClass.prototype._createDOMOverridden) {\n NodeClass.prototype._createDOMOverridden = true\n NodeClass.prototype.createDOM = function (\n config: EditorConfig,\n editor: LexicalEditor,\n ): HTMLElement {\n const viewDef = getEditorNodeView(editor, nodeType, this)\n\n if (viewDef) {\n // If createDOM is provided, use it\n if (viewDef.createDOM) {\n return viewDef.createDOM({ config, editor, node: this })\n }\n\n // If html is provided (as a function or string), create element from it\n if (viewDef.html) {\n const htmlContent =\n typeof viewDef.html === 'function'\n ? viewDef.html({ config, editor, isEditor: true, isJSXConverter: false, node: this })\n : viewDef.html\n const tempDiv = document.createElement('div')\n tempDiv.innerHTML = htmlContent\n return (tempDiv.firstElementChild as HTMLElement) || tempDiv\n }\n }\n\n // Otherwise use original\n return NodeClass.prototype._originalCreateDOM.call(this, config, editor)\n }\n }\n}\n\nexport function getEnabledNodes({\n editorConfig,\n nodeViews,\n}: {\n editorConfig: SanitizedClientEditorConfig | SanitizedServerEditorConfig\n nodeViews?: LexicalEditorNodeMap\n}): Array<Klass<LexicalNode> | LexicalNodeReplacement> {\n const nodes = getEnabledNodesFromServerNodes({\n nodes: editorConfig.features.nodes,\n })\n\n if (nodeViews) {\n // Apply node overrides by modifying prototypes (once globally)\n // The overrides check per-editor at runtime using WeakMap\n const nodeTypesToOverride = new Set<string>()\n\n for (const [key, value] of Object.entries(nodeViews)) {\n if (!value || typeof value !== 'object') {\n continue\n }\n\n // If 'blocks' key exists with content, we need to override 'block' nodes\n if (key === 'blocks' && Object.keys(value).length > 0) {\n nodeTypesToOverride.add('block')\n }\n // If 'inlineBlocks' key exists with content, we need to override 'inlineBlock' nodes\n else if (key === 'inlineBlocks' && Object.keys(value).length > 0) {\n nodeTypesToOverride.add('inlineBlock')\n }\n // Regular node types\n else {\n nodeTypesToOverride.add(key)\n }\n }\n\n for (const node of nodes) {\n if ('getType' in node) {\n const nodeType = node.getType()\n\n if (nodeTypesToOverride.has(nodeType)) {\n applyNodeOverride({ node, nodeType })\n }\n }\n }\n }\n\n return nodes\n}\n\nexport function getEnabledNodesFromServerNodes({\n nodes,\n}: {\n nodes: Array<Klass<LexicalNode> | LexicalNodeReplacement> | Array<NodeWithHooks>\n}): Array<Klass<LexicalNode> | LexicalNodeReplacement> {\n return nodes.map((node) => {\n if ('node' in node) {\n return node.node\n }\n return node\n })\n}\n"],"mappings":"AAQA,OAAOA,KAAA,MAAW;AAalB;AACA;AACA,MAAMC,eAAA,GAAkB,IAAIC,OAAA;AAE5B;;;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MS,GAAG,CAAE1C,IAAA;IAChB,IAAI,UAAUA,IAAA,EAAM;MAClB,OAAOA,IAAA,CAAKA,IAAI;IAClB;IACA,OAAOA,IAAA;EACT;AACF","ignoreList":[]}
@@ -0,0 +1,11 @@
1
+ @layer payload-default {
2
+ [data-lexical-decorator='true'] {
3
+ width: fit-content;
4
+ border-radius: var(--radius-medium);
5
+ }
6
+
7
+ .decorator-selected {
8
+ box-shadow: 0 0 0 2px var(--color-border-selected) !important;
9
+ outline: none !important;
10
+ }
11
+ }
@@ -1,5 +1,5 @@
1
1
  import type { DecoratorNode, ElementNode, LexicalNode } from 'lexical';
2
- import './index.scss';
2
+ import './index.css';
3
3
  export declare function DecoratorPlugin(): null;
4
4
  /**
5
5
  * Copied from https://github.com/facebook/lexical/blob/main/packages/lexical/src/LexicalUtils.ts