@payloadcms/richtext-lexical 3.0.0-alpha.64 → 3.0.0-alpha.66

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 (379) hide show
  1. package/dist/cell/index.d.ts +1 -1
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +2 -4
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  6. package/dist/field/features/align/feature.client.js +1 -2
  7. package/dist/field/features/align/feature.client.js.map +1 -1
  8. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  9. package/dist/field/features/blockquote/feature.client.js +3 -6
  10. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  11. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  12. package/dist/field/features/blockquote/feature.server.js +4 -4
  13. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  14. package/dist/field/features/blockquote/markdownTransformer.d.ts.map +1 -1
  15. package/dist/field/features/blockquote/markdownTransformer.js +2 -4
  16. package/dist/field/features/blockquote/markdownTransformer.js.map +1 -1
  17. package/dist/field/features/blocks/component/BlockContent.d.ts.map +1 -1
  18. package/dist/field/features/blocks/component/BlockContent.js +3 -5
  19. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  20. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  21. package/dist/field/features/blocks/component/index.js +31 -1
  22. package/dist/field/features/blocks/component/index.js.map +1 -1
  23. package/dist/field/features/blocks/drawer/index.d.ts.map +1 -1
  24. package/dist/field/features/blocks/drawer/index.js +2 -4
  25. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  26. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  27. package/dist/field/features/blocks/feature.server.js +94 -47
  28. package/dist/field/features/blocks/feature.server.js.map +1 -1
  29. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -3
  30. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  31. package/dist/field/features/blocks/nodes/BlocksNode.js +1 -2
  32. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  33. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  34. package/dist/field/features/blocks/plugin/commands.js +1 -2
  35. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  36. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  37. package/dist/field/features/blocks/plugin/index.js +3 -6
  38. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  39. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  40. package/dist/field/features/blocks/populationPromise.js +3 -18
  41. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  42. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  43. package/dist/field/features/blocks/validate.js +22 -36
  44. package/dist/field/features/blocks/validate.js.map +1 -1
  45. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +1 -1
  46. package/dist/field/features/debug/testrecorder/plugin/index.js +2 -4
  47. package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
  48. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +1 -1
  49. package/dist/field/features/debug/treeview/plugin/index.js +2 -4
  50. package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
  51. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  52. package/dist/field/features/format/bold/feature.client.js +1 -2
  53. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  54. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +1 -1
  55. package/dist/field/features/format/inlinecode/feature.client.js +1 -2
  56. package/dist/field/features/format/inlinecode/feature.client.js.map +1 -1
  57. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  58. package/dist/field/features/format/italic/feature.client.js +1 -2
  59. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  60. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  61. package/dist/field/features/format/strikethrough/feature.client.js +1 -2
  62. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  63. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  64. package/dist/field/features/format/subscript/feature.client.js +1 -2
  65. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  66. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  67. package/dist/field/features/format/superscript/feature.client.js +1 -2
  68. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  69. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  70. package/dist/field/features/format/underline/feature.client.js +1 -2
  71. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  72. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  73. package/dist/field/features/heading/feature.client.js +3 -6
  74. package/dist/field/features/heading/feature.client.js.map +1 -1
  75. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  76. package/dist/field/features/heading/feature.server.js +5 -5
  77. package/dist/field/features/heading/feature.server.js.map +1 -1
  78. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  79. package/dist/field/features/heading/markdownTransformer.js +1 -2
  80. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  81. package/dist/field/features/horizontalrule/component/index.d.ts.map +1 -1
  82. package/dist/field/features/horizontalrule/component/index.js +2 -4
  83. package/dist/field/features/horizontalrule/component/index.js.map +1 -1
  84. package/dist/field/features/horizontalrule/feature.server.d.ts.map +1 -1
  85. package/dist/field/features/horizontalrule/feature.server.js +3 -2
  86. package/dist/field/features/horizontalrule/feature.server.js.map +1 -1
  87. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts +1 -3
  88. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +1 -1
  89. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js +1 -2
  90. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +1 -1
  91. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +1 -1
  92. package/dist/field/features/horizontalrule/plugin/index.js +3 -6
  93. package/dist/field/features/horizontalrule/plugin/index.js.map +1 -1
  94. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  95. package/dist/field/features/indent/feature.client.js +1 -2
  96. package/dist/field/features/indent/feature.client.js.map +1 -1
  97. package/dist/field/features/link/drawer/baseFields.d.ts +3 -3
  98. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  99. package/dist/field/features/link/drawer/baseFields.js +28 -42
  100. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  101. package/dist/field/features/link/drawer/types.d.ts +4 -2
  102. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  103. package/dist/field/features/link/drawer/types.js.map +1 -1
  104. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  105. package/dist/field/features/link/feature.client.js +2 -4
  106. package/dist/field/features/link/feature.client.js.map +1 -1
  107. package/dist/field/features/link/feature.server.d.ts +0 -2
  108. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  109. package/dist/field/features/link/feature.server.js +35 -10
  110. package/dist/field/features/link/feature.server.js.map +1 -1
  111. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  112. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  113. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  114. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  115. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  116. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  117. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  118. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  119. package/dist/field/features/link/plugins/autoLink/index.js +3 -6
  120. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  121. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  122. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  123. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  124. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  125. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +56 -39
  126. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  127. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +9 -1
  128. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -5
  129. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  130. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +11 -29
  131. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  132. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  133. package/dist/field/features/link/plugins/link/index.js +3 -12
  134. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  135. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  136. package/dist/field/features/link/populationPromise.js +9 -25
  137. package/dist/field/features/link/populationPromise.js.map +1 -1
  138. package/dist/field/features/link/validate.d.ts +5 -0
  139. package/dist/field/features/link/validate.d.ts.map +1 -0
  140. package/dist/field/features/link/validate.js +32 -0
  141. package/dist/field/features/link/validate.js.map +1 -0
  142. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  143. package/dist/field/features/lists/checklist/feature.client.js +1 -2
  144. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  145. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  146. package/dist/field/features/lists/checklist/feature.server.js +6 -6
  147. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  148. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  149. package/dist/field/features/lists/checklist/markdownTransformers.js +1 -2
  150. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  151. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  152. package/dist/field/features/lists/checklist/plugin/index.js +1 -2
  153. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  154. package/dist/field/features/lists/common/markdown.d.ts.map +1 -1
  155. package/dist/field/features/lists/common/markdown.js +1 -2
  156. package/dist/field/features/lists/common/markdown.js.map +1 -1
  157. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  158. package/dist/field/features/lists/htmlConverter.js +1 -2
  159. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  160. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +1 -1
  161. package/dist/field/features/lists/orderedlist/feature.client.js +1 -2
  162. package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
  163. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +1 -1
  164. package/dist/field/features/lists/orderedlist/feature.server.js +6 -6
  165. package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
  166. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +1 -1
  167. package/dist/field/features/lists/orderedlist/markdownTransformer.js +1 -2
  168. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
  169. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  170. package/dist/field/features/lists/plugin/index.js +1 -2
  171. package/dist/field/features/lists/plugin/index.js.map +1 -1
  172. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +1 -1
  173. package/dist/field/features/lists/unorderedlist/feature.client.js +1 -2
  174. package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
  175. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +1 -1
  176. package/dist/field/features/lists/unorderedlist/feature.server.js +6 -6
  177. package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
  178. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +1 -1
  179. package/dist/field/features/lists/unorderedlist/markdownTransformer.js +1 -2
  180. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
  181. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  182. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  183. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  184. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  185. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  186. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  187. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  188. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  189. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  190. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  191. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  192. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  193. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  194. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  195. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  196. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  197. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  198. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  199. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  200. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  201. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  202. package/dist/field/features/paragraph/feature.client.js +2 -4
  203. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  204. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  205. package/dist/field/features/relationship/drawer/commands.js +1 -2
  206. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  207. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  208. package/dist/field/features/relationship/drawer/index.js +7 -13
  209. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  210. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  211. package/dist/field/features/relationship/feature.server.js +3 -2
  212. package/dist/field/features/relationship/feature.server.js.map +1 -1
  213. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
  214. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  215. package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
  216. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  217. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  218. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +54 -7
  219. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  220. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  221. package/dist/field/features/relationship/plugins/index.js +3 -6
  222. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  223. package/dist/field/features/relationship/populationPromise.js +7 -6
  224. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  225. package/dist/field/features/typeUtilities.d.ts +8 -0
  226. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  227. package/dist/field/features/typeUtilities.js +8 -0
  228. package/dist/field/features/typeUtilities.js.map +1 -0
  229. package/dist/field/features/types.d.ts +56 -28
  230. package/dist/field/features/types.d.ts.map +1 -1
  231. package/dist/field/features/types.js.map +1 -1
  232. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  233. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +2 -4
  234. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  235. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  236. package/dist/field/features/upload/component/index.js +55 -9
  237. package/dist/field/features/upload/component/index.js.map +1 -1
  238. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  239. package/dist/field/features/upload/drawer/commands.js +1 -2
  240. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  241. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  242. package/dist/field/features/upload/drawer/index.js +8 -12
  243. package/dist/field/features/upload/drawer/index.js.map +1 -1
  244. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  245. package/dist/field/features/upload/feature.server.js +22 -6
  246. package/dist/field/features/upload/feature.server.js.map +1 -1
  247. package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
  248. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  249. package/dist/field/features/upload/nodes/UploadNode.js +6 -9
  250. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  251. package/dist/field/features/upload/plugin/index.d.ts +2 -2
  252. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  253. package/dist/field/features/upload/plugin/index.js +4 -9
  254. package/dist/field/features/upload/plugin/index.js.map +1 -1
  255. package/dist/field/features/upload/populationPromise.js +11 -8
  256. package/dist/field/features/upload/populationPromise.js.map +1 -1
  257. package/dist/field/features/upload/validate.d.ts +2 -1
  258. package/dist/field/features/upload/validate.d.ts.map +1 -1
  259. package/dist/field/features/upload/validate.js +33 -9
  260. package/dist/field/features/upload/validate.js.map +1 -1
  261. package/dist/field/index.d.ts +1 -1
  262. package/dist/field/index.d.ts.map +1 -1
  263. package/dist/field/index.js.map +1 -1
  264. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  265. package/dist/field/lexical/LexicalEditor.js +6 -11
  266. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  267. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  268. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  269. package/dist/field/lexical/LexicalProvider.js +1 -2
  270. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  271. package/dist/field/lexical/config/client/default.d.ts +1 -1
  272. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  273. package/dist/field/lexical/config/client/default.js.map +1 -1
  274. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  275. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  276. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  277. package/dist/field/lexical/config/server/default.d.ts +2 -3
  278. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  279. package/dist/field/lexical/config/server/default.js +0 -2
  280. package/dist/field/lexical/config/server/default.js.map +1 -1
  281. package/dist/field/lexical/config/server/loader.d.ts +4 -2
  282. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  283. package/dist/field/lexical/config/server/loader.js +3 -2
  284. package/dist/field/lexical/config/server/loader.js.map +1 -1
  285. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  286. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  287. package/dist/field/lexical/config/server/sanitize.js +23 -8
  288. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  289. package/dist/field/lexical/config/types.d.ts +1 -1
  290. package/dist/field/lexical/config/types.d.ts.map +1 -1
  291. package/dist/field/lexical/config/types.js.map +1 -1
  292. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +1 -1
  293. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js +3 -6
  294. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
  295. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +1 -1
  296. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js +3 -6
  297. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
  298. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +1 -1
  299. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +27 -29
  300. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +1 -1
  301. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  302. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  303. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  304. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  305. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +3 -6
  306. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  307. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  308. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -6
  309. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  310. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  311. package/dist/field/lexical/plugins/SlashMenu/index.js +1 -2
  312. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  313. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  314. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -4
  315. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  316. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  317. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +1 -2
  318. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  319. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  320. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +2 -4
  321. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  322. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  323. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  324. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  325. package/dist/field/lexical/theme/EditorTheme.scss +7 -8
  326. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  327. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  328. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  329. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  330. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  331. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  332. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  333. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  334. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  335. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +1 -1
  336. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  337. package/dist/field/lexical/utils/setFloatingElemPosition.js +15 -13
  338. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  339. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  340. package/dist/field/lexical/utils/url.js +3 -0
  341. package/dist/field/lexical/utils/url.js.map +1 -1
  342. package/dist/forEachNodeRecursively.d.ts +10 -0
  343. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  344. package/dist/forEachNodeRecursively.js +24 -0
  345. package/dist/forEachNodeRecursively.js.map +1 -0
  346. package/dist/generateComponentMap.d.ts.map +1 -1
  347. package/dist/generateComponentMap.js +1 -10
  348. package/dist/generateComponentMap.js.map +1 -1
  349. package/dist/generateSchemaMap.d.ts.map +1 -1
  350. package/dist/generateSchemaMap.js +1 -10
  351. package/dist/generateSchemaMap.js.map +1 -1
  352. package/dist/index.d.ts +6 -5
  353. package/dist/index.d.ts.map +1 -1
  354. package/dist/index.js +260 -173
  355. package/dist/index.js.map +1 -1
  356. package/dist/populate/defaultValue.d.ts.map +1 -1
  357. package/dist/populate/defaultValue.js +1 -0
  358. package/dist/populate/defaultValue.js.map +1 -1
  359. package/dist/populate/populate.d.ts +3 -3
  360. package/dist/populate/populate.d.ts.map +1 -1
  361. package/dist/populate/populate.js.map +1 -1
  362. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  363. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  364. package/dist/populate/populateLexicalPopulationPromises.js +35 -0
  365. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  366. package/dist/populate/recurseNestedFields.d.ts +7 -4
  367. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  368. package/dist/populate/recurseNestedFields.js +3 -5
  369. package/dist/populate/recurseNestedFields.js.map +1 -1
  370. package/dist/types.d.ts +11 -5
  371. package/dist/types.d.ts.map +1 -1
  372. package/dist/types.js.map +1 -1
  373. package/dist/validate/index.d.ts +1 -1
  374. package/dist/validate/index.d.ts.map +1 -1
  375. package/package.json +46 -45
  376. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  377. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  378. package/dist/populate/richTextRelationshipPromise.js +0 -68
  379. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/generateSchemaMap.ts"],"sourcesContent":["import type { RichTextAdapter } from 'payload/types'\n\nimport { sanitizeFields } from 'payload/config'\n\nimport type { ResolvedServerFeatureMap } from './field/features/types.js'\n\nimport { cloneDeep } from './field/lexical/utils/cloneDeep.js'\n\nexport const getGenerateSchemaMap =\n (args: { resolvedFeatureMap: ResolvedServerFeatureMap }): RichTextAdapter['generateSchemaMap'] =>\n ({ config, i18n, schemaMap, schemaPath }) => {\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n for (const [featureKey, resolvedFeature] of args.resolvedFeatureMap.entries()) {\n if (\n !('generateSchemaMap' in resolvedFeature) ||\n typeof resolvedFeature.generateSchemaMap !== 'function'\n ) {\n continue\n }\n const schemas = resolvedFeature.generateSchemaMap({\n config,\n i18n,\n props: resolvedFeature.serverFeatureProps,\n schemaMap,\n schemaPath,\n })\n\n if (schemas) {\n for (const [schemaKey, fields] of schemas.entries()) {\n const sanitizedFields = sanitizeFields({\n config,\n fields: cloneDeep(fields),\n requireFieldLevelRichTextEditor: true,\n validRelationships,\n })\n\n schemaMap.set(`${schemaPath}.feature.${featureKey}.${schemaKey}`, sanitizedFields)\n }\n }\n }\n\n return schemaMap\n }\n"],"names":["sanitizeFields","cloneDeep","getGenerateSchemaMap","args","config","i18n","schemaMap","schemaPath","validRelationships","collections","map","c","slug","featureKey","resolvedFeature","resolvedFeatureMap","entries","generateSchemaMap","schemas","props","serverFeatureProps","schemaKey","fields","sanitizedFields","requireFieldLevelRichTextEditor","set"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,cAAc,QAAQ,iBAAgB;AAI/C,SAASC,SAAS,QAAQ,qCAAoC;AAE9D,OAAO,MAAMC,uBACX,CAACC,OACD,CAAC,EAAEC,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAEC,UAAU,EAAE;QACtC,MAAMC,qBAAqBJ,OAAOK,WAAW,CAACC,GAAG,CAAC,CAACC,IAAMA,EAAEC,IAAI,KAAK,EAAE;QAEtE,KAAK,MAAM,CAACC,YAAYC,gBAAgB,IAAIX,KAAKY,kBAAkB,CAACC,OAAO,GAAI;YAC7E,IACE,CAAE,CAAA,uBAAuBF,eAAc,KACvC,OAAOA,gBAAgBG,iBAAiB,KAAK,YAC7C;gBACA;YACF;YACA,MAAMC,UAAUJ,gBAAgBG,iBAAiB,CAAC;gBAChDb;gBACAC;gBACAc,OAAOL,gBAAgBM,kBAAkB;gBACzCd;gBACAC;YACF;YAEA,IAAIW,SAAS;gBACX,KAAK,MAAM,CAACG,WAAWC,OAAO,IAAIJ,QAAQF,OAAO,GAAI;oBACnD,MAAMO,kBAAkBvB,eAAe;wBACrCI;wBACAkB,QAAQrB,UAAUqB;wBAClBE,iCAAiC;wBACjChB;oBACF;oBAEAF,UAAUmB,GAAG,CAAC,CAAC,EAAElB,WAAW,SAAS,EAAEM,WAAW,CAAC,EAAEQ,UAAU,CAAC,EAAEE;gBACpE;YACF;QACF;QAEA,OAAOjB;IACT,EAAC"}
1
+ {"version":3,"sources":["../src/generateSchemaMap.ts"],"sourcesContent":["import type { RichTextAdapter } from 'payload/types'\n\nimport type { ResolvedServerFeatureMap } from './field/features/types.js'\n\nexport const getGenerateSchemaMap =\n (args: { resolvedFeatureMap: ResolvedServerFeatureMap }): RichTextAdapter['generateSchemaMap'] =>\n ({ config, i18n, schemaMap, schemaPath }) => {\n for (const [featureKey, resolvedFeature] of args.resolvedFeatureMap.entries()) {\n if (\n !('generateSchemaMap' in resolvedFeature) ||\n typeof resolvedFeature.generateSchemaMap !== 'function'\n ) {\n continue\n }\n const schemas = resolvedFeature.generateSchemaMap({\n config,\n i18n,\n props: resolvedFeature.serverFeatureProps,\n schemaMap,\n schemaPath,\n })\n\n if (schemas) {\n for (const [schemaKey, fields] of schemas.entries()) {\n schemaMap.set(`${schemaPath}.feature.${featureKey}.${schemaKey}`, fields)\n }\n }\n }\n\n return schemaMap\n }\n"],"names":["getGenerateSchemaMap","args","config","i18n","schemaMap","schemaPath","featureKey","resolvedFeature","resolvedFeatureMap","entries","generateSchemaMap","schemas","props","serverFeatureProps","schemaKey","fields","set"],"rangeMappings":";;;;;;;;;;;;;;;;;;;","mappings":"AAIA,OAAO,MAAMA,uBACX,CAACC,OACD,CAAC,EAAEC,MAAM,EAAEC,IAAI,EAAEC,SAAS,EAAEC,UAAU,EAAE;QACtC,KAAK,MAAM,CAACC,YAAYC,gBAAgB,IAAIN,KAAKO,kBAAkB,CAACC,OAAO,GAAI;YAC7E,IACE,CAAE,CAAA,uBAAuBF,eAAc,KACvC,OAAOA,gBAAgBG,iBAAiB,KAAK,YAC7C;gBACA;YACF;YACA,MAAMC,UAAUJ,gBAAgBG,iBAAiB,CAAC;gBAChDR;gBACAC;gBACAS,OAAOL,gBAAgBM,kBAAkB;gBACzCT;gBACAC;YACF;YAEA,IAAIM,SAAS;gBACX,KAAK,MAAM,CAACG,WAAWC,OAAO,IAAIJ,QAAQF,OAAO,GAAI;oBACnDL,UAAUY,GAAG,CAAC,CAAC,EAAEX,WAAW,SAAS,EAAEC,WAAW,CAAC,EAAEQ,UAAU,CAAC,EAAEC;gBACpE;YACF;QACF;QAEA,OAAOX;IACT,EAAC"}
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
- import type { AdapterProps, LexicalEditorProps, LexicalRichTextAdapter } from './types.js';
2
- export declare function lexicalEditor(props?: LexicalEditorProps): LexicalRichTextAdapter;
1
+ import type { AdapterProps, LexicalEditorProps, LexicalRichTextAdapterProvider } from './types.js';
2
+ export declare function lexicalEditor(props?: LexicalEditorProps): LexicalRichTextAdapterProvider;
3
3
  export { AlignFeature } from './field/features/align/feature.server.js';
4
4
  export { BlockQuoteFeature } from './field/features/blockquote/feature.server.js';
5
5
  export { BlocksFeature, type BlocksFeatureProps, type LexicalBlock, } from './field/features/blocks/feature.server.js';
@@ -25,6 +25,7 @@ export { SubscriptFeature } from './field/features/format/subscript/feature.serv
25
25
  export { SuperscriptFeature } from './field/features/format/superscript/feature.server.js';
26
26
  export { UnderlineFeature } from './field/features/format/underline/feature.server.js';
27
27
  export { HeadingFeature } from './field/features/heading/feature.server.js';
28
+ export { HorizontalRuleFeature } from './field/features/horizontalrule/feature.server.js';
28
29
  export { IndentFeature } from './field/features/indent/feature.server.js';
29
30
  export { LinkFeature, type LinkFeatureServerProps } from './field/features/link/feature.server.js';
30
31
  export { $createAutoLinkNode, $isAutoLinkNode, AutoLinkNode, } from './field/features/link/nodes/AutoLinkNode.js';
@@ -51,14 +52,14 @@ export { SlateToLexicalFeature } from './field/features/migrations/slateToLexica
51
52
  export { ParagraphFeature } from './field/features/paragraph/feature.server.js';
52
53
  export { RelationshipFeature } from './field/features/relationship/feature.server.js';
53
54
  export { $createRelationshipNode, $isRelationshipNode, type RelationshipData, RelationshipNode, type SerializedRelationshipNode, } from './field/features/relationship/nodes/RelationshipNode.js';
54
- export type { ClientFeature, ClientFeatureProviderMap, FeatureProviderClient, FeatureProviderProviderClient, FeatureProviderProviderServer, FeatureProviderServer, NodeValidation, PopulationPromise, ResolvedClientFeature, ResolvedClientFeatureMap, ResolvedServerFeature, ResolvedServerFeatureMap, SanitizedClientFeatures, SanitizedPlugin, SanitizedServerFeatures, ServerFeature, ServerFeatureProviderMap, } from './field/features/types.js';
55
+ export { createNode } from './field/features/typeUtilities.js';
56
+ export type { ClientComponentProps, ClientFeature, ClientFeatureProviderMap, FeatureProviderClient, FeatureProviderProviderClient, FeatureProviderProviderServer, FeatureProviderServer, FieldNodeHook, FieldNodeHookArgs, NodeValidation, NodeWithHooks, PopulationPromise, ResolvedClientFeature, ResolvedClientFeatureMap, ResolvedServerFeature, ResolvedServerFeatureMap, SanitizedClientFeatures, SanitizedPlugin, SanitizedServerFeatures, ServerFeature, ServerFeatureProviderMap, } from './field/features/types.js';
55
57
  export { UploadFeature } from './field/features/upload/feature.server.js';
56
58
  export type { UploadFeatureProps } from './field/features/upload/feature.server.js';
57
- export type { RawUploadPayload } from './field/features/upload/nodes/UploadNode.js';
58
59
  export { $createUploadNode, $isUploadNode, type SerializedUploadNode, type UploadData, UploadNode, } from './field/features/upload/nodes/UploadNode.js';
59
60
  export { EditorConfigProvider, useEditorConfigContext, } from './field/lexical/config/client/EditorConfigProvider.js';
60
61
  export { sanitizeClientEditorConfig, sanitizeClientFeatures, } from './field/lexical/config/client/sanitize.js';
61
- export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig, defaultSanitizedServerEditorConfig, } from './field/lexical/config/server/default.js';
62
+ export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig, } from './field/lexical/config/server/default.js';
62
63
  export { loadFeatures, sortFeaturesForOptimalLoading, } from './field/lexical/config/server/loader.js';
63
64
  export { sanitizeServerEditorConfig, sanitizeServerFeatures, } from './field/lexical/config/server/sanitize.js';
64
65
  export type { ClientEditorConfig, SanitizedClientEditorConfig, SanitizedServerEditorConfig, ServerEditorConfig, } from './field/lexical/config/types.js';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA;AAiB1F,wBAAgB,aAAa,CAAC,KAAK,CAAC,EAAE,kBAAkB,GAAG,sBAAsB,CAyLhF;AAED,OAAO,EAAE,YAAY,EAAE,MAAM,0CAA0C,CAAA;AACvE,OAAO,EAAE,iBAAiB,EAAE,MAAM,+CAA+C,CAAA;AACjF,OAAO,EACL,aAAa,EACb,KAAK,kBAAkB,EACvB,KAAK,YAAY,GAClB,MAAM,2CAA2C,CAAA;AAClD,OAAO,EACL,gBAAgB,EAChB,YAAY,EACZ,KAAK,WAAW,EAChB,SAAS,EACT,KAAK,mBAAmB,GACzB,MAAM,6CAA6C,CAAA;AAEpD,OAAO,EAAE,8BAA8B,EAAE,MAAM,2EAA2E,CAAA;AAC1H,OAAO,EAAE,sBAAsB,EAAE,MAAM,oEAAoE,CAAA;AAC3G,OAAO,EAAE,sBAAsB,EAAE,MAAM,oEAAoE,CAAA;AAE3G,OAAO,EAAE,iBAAiB,EAAE,MAAM,+DAA+D,CAAA;AACjG,OAAO,EAAE,qBAAqB,EAAE,MAAM,iEAAiE,CAAA;AACvG,OAAO,EACL,yBAAyB,EACzB,oBAAoB,GACrB,MAAM,qDAAqD,CAAA;AAC5D,YAAY,EAAE,aAAa,EAAE,MAAM,qDAAqD,CAAA;AACxF,OAAO,EACL,oBAAoB,EACpB,KAAK,yBA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jB,SAAS,EACT,kBAAkB,EAClB,UAAU,EACV,SAAS,EACT,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,GAClB,MAAM,qCAAqC,CAAA;AAC5C,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,gCAAgC,CAAA;AAC/D,OAAO,EAAE,IAAI,EAAE,MAAM,+BAA+B,CAAA;AACpD,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAA;AAC1F,OAAO,EAAE,oCAAoC,EAAE,MAAM,+DAA+D,CAAA;AACpH,OAAO,EACL,oBAAoB,EACpB,oBAAoB,EACpB,qBAAqB,EACrB,kBAAkB,GACnB,MAAM,gCAAgC,CAAA;AACvC,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAA;AACvE,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AAEjE,YAAY,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,YAAY,CAAA"}
package/dist/index.js CHANGED
@@ -2,194 +2,279 @@ import { withMergedProps } from '@payloadcms/ui/elements/withMergedProps';
2
2
  import { withNullableJSONSchemaType } from 'payload/utilities';
3
3
  import { RichTextCell } from './cell/index.js';
4
4
  import { RichTextField } from './field/index.js';
5
- import { defaultEditorConfig, defaultEditorFeatures, defaultSanitizedServerEditorConfig } from './field/lexical/config/server/default.js';
5
+ import { defaultEditorConfig, defaultEditorFeatures } from './field/lexical/config/server/default.js';
6
6
  import { loadFeatures } from './field/lexical/config/server/loader.js';
7
- import { sanitizeServerFeatures } from './field/lexical/config/server/sanitize.js';
7
+ import { sanitizeServerEditorConfig, sanitizeServerFeatures } from './field/lexical/config/server/sanitize.js';
8
8
  import { cloneDeep } from './field/lexical/utils/cloneDeep.js';
9
9
  import { getGenerateComponentMap } from './generateComponentMap.js';
10
10
  import { getGenerateSchemaMap } from './generateSchemaMap.js';
11
- import { richTextRelationshipPromise } from './populate/richTextRelationshipPromise.js';
11
+ import { populateLexicalPopulationPromises } from './populate/populateLexicalPopulationPromises.js';
12
12
  import { richTextValidateHOC } from './validate/index.js';
13
+ let defaultSanitizedServerEditorConfig = null;
13
14
  export function lexicalEditor(props) {
14
- let resolvedFeatureMap = null;
15
- let finalSanitizedEditorConfig// For server only
16
- ;
17
- if (!props || !props.features && !props.lexical) {
18
- finalSanitizedEditorConfig = cloneDeep(defaultSanitizedServerEditorConfig);
19
- resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap;
20
- } else {
21
- let features = props.features && typeof props.features === 'function' ? props.features({
22
- defaultFeatures: cloneDeep(defaultEditorFeatures)
23
- }) : props.features;
24
- if (!features) {
25
- features = cloneDeep(defaultEditorFeatures);
26
- }
27
- const lexical = props.lexical;
28
- resolvedFeatureMap = loadFeatures({
29
- unSanitizedEditorConfig: {
30
- features,
31
- lexical: lexical ? lexical : defaultEditorConfig.lexical
32
- }
33
- });
34
- finalSanitizedEditorConfig = {
35
- features: sanitizeServerFeatures(resolvedFeatureMap),
36
- lexical: lexical ? lexical : defaultEditorConfig.lexical,
37
- resolvedFeatureMap
38
- };
39
- }
40
- return {
41
- CellComponent: withMergedProps({
42
- Component: RichTextCell,
43
- toMergeIntoProps: {
44
- lexicalEditorConfig: finalSanitizedEditorConfig.lexical
15
+ return async ({ config })=>{
16
+ let resolvedFeatureMap = null;
17
+ let finalSanitizedEditorConfig// For server only
18
+ ;
19
+ if (!props || !props.features && !props.lexical) {
20
+ if (!defaultSanitizedServerEditorConfig) {
21
+ defaultSanitizedServerEditorConfig = await sanitizeServerEditorConfig(defaultEditorConfig, config);
45
22
  }
46
- }),
47
- FieldComponent: withMergedProps({
48
- Component: RichTextField,
49
- toMergeIntoProps: {
50
- lexicalEditorConfig: finalSanitizedEditorConfig.lexical
23
+ finalSanitizedEditorConfig = cloneDeep(defaultSanitizedServerEditorConfig);
24
+ resolvedFeatureMap = finalSanitizedEditorConfig.resolvedFeatureMap;
25
+ } else {
26
+ let features = props.features && typeof props.features === 'function' ? props.features({
27
+ defaultFeatures: cloneDeep(defaultEditorFeatures)
28
+ }) : props.features;
29
+ if (!features) {
30
+ features = cloneDeep(defaultEditorFeatures);
51
31
  }
52
- }),
53
- afterReadPromise: ({ field, incomingEditorState, siblingDoc })=>{
54
- return new Promise((resolve, reject)=>{
55
- const promises = [];
56
- if (finalSanitizedEditorConfig?.features?.hooks?.afterReadPromises?.length) {
57
- for (const afterReadPromise of finalSanitizedEditorConfig.features.hooks.afterReadPromises){
58
- const promise = afterReadPromise({
59
- field,
60
- incomingEditorState,
61
- siblingDoc
62
- });
63
- if (promise) {
64
- promises.push(promise);
65
- }
66
- }
32
+ const lexical = props.lexical;
33
+ resolvedFeatureMap = await loadFeatures({
34
+ config,
35
+ unSanitizedEditorConfig: {
36
+ features,
37
+ lexical: lexical ? lexical : defaultEditorConfig.lexical
67
38
  }
68
- Promise.all(promises).then(()=>resolve()).catch((error)=>reject(error));
69
39
  });
40
+ finalSanitizedEditorConfig = {
41
+ features: sanitizeServerFeatures(resolvedFeatureMap),
42
+ lexical: lexical ? lexical : defaultEditorConfig.lexical,
43
+ resolvedFeatureMap
44
+ };
45
+ }
46
+ return {
47
+ CellComponent: withMergedProps({
48
+ Component: RichTextCell,
49
+ toMergeIntoProps: {
50
+ lexicalEditorConfig: finalSanitizedEditorConfig.lexical
51
+ }
52
+ }),
53
+ FieldComponent: withMergedProps({
54
+ Component: RichTextField,
55
+ toMergeIntoProps: {
56
+ lexicalEditorConfig: finalSanitizedEditorConfig.lexical
57
+ }
58
+ }),
59
+ editorConfig: finalSanitizedEditorConfig,
60
+ generateComponentMap: getGenerateComponentMap({
61
+ resolvedFeatureMap
62
+ }),
63
+ generateSchemaMap: getGenerateSchemaMap({
64
+ resolvedFeatureMap
65
+ }),
66
+ /* hooks: {
67
+ afterChange: finalSanitizedEditorConfig.features.hooks.afterChange,
68
+ afterRead: finalSanitizedEditorConfig.features.hooks.afterRead,
69
+ beforeChange: finalSanitizedEditorConfig.features.hooks.beforeChange,
70
+ beforeDuplicate: finalSanitizedEditorConfig.features.hooks.beforeDuplicate,
71
+ beforeValidate: finalSanitizedEditorConfig.features.hooks.beforeValidate,
72
+ },*/ /* // TODO: Figure out docWithLocales / originalSiblingDoc => node matching. Can't use indexes, as the order of nodes could technically change between hooks.
73
+ hooks: {
74
+ afterChange: [
75
+ async ({ context, findMany, operation, overrideAccess, req, value }) => {
76
+ await recurseNodesAsync({
77
+ callback: async (node) => {
78
+ const afterChangeHooks = finalSanitizedEditorConfig.features.hooks.afterChange
79
+ if (afterChangeHooks?.has(node.type)) {
80
+ for (const hook of afterChangeHooks.get(node.type)) {
81
+ node = await hook({ context, findMany, node, operation, overrideAccess, req })
82
+ }
83
+ }
84
+ },
85
+ nodes: (value as SerializedEditorState)?.root?.children ?? [],
86
+ })
87
+
88
+ return value
89
+ },
90
+ ],
91
+ afterRead: [
92
+ async ({ context, findMany, operation, overrideAccess, req, value }) => {
93
+ await recurseNodesAsync({
94
+ callback: async (node) => {
95
+ const afterReadHooks = finalSanitizedEditorConfig.features.hooks.afterRead
96
+ if (afterReadHooks?.has(node.type)) {
97
+ for (const hook of afterReadHooks.get(node.type)) {
98
+ node = await hook({ context, findMany, node, operation, overrideAccess, req })
99
+ }
100
+ }
101
+ },
102
+ nodes: (value as SerializedEditorState)?.root?.children ?? [],
103
+ })
104
+
105
+ return value
106
+ },
107
+ ],
108
+ beforeChange: [
109
+ async ({ context, findMany, operation, overrideAccess, req, value }) => {
110
+ await recurseNodesAsync({
111
+ callback: async (node) => {
112
+ const beforeChangeHooks = finalSanitizedEditorConfig.features.hooks.beforeChange
113
+ if (beforeChangeHooks?.has(node.type)) {
114
+ for (const hook of beforeChangeHooks.get(node.type)) {
115
+ node = await hook({ context, findMany, node, operation, overrideAccess, req })
116
+ }
117
+ }
118
+ },
119
+ nodes: (value as SerializedEditorState)?.root?.children ?? [],
120
+ })
121
+
122
+ return value
123
+ },
124
+ ],
125
+ beforeDuplicate: [
126
+ async ({ context, findMany, operation, overrideAccess, req, value }) => {
127
+ await recurseNodesAsync({
128
+ callback: async (node) => {
129
+ const beforeDuplicateHooks = finalSanitizedEditorConfig.features.hooks.beforeDuplicate
130
+ if (beforeDuplicateHooks?.has(node.type)) {
131
+ for (const hook of beforeDuplicateHooks.get(node.type)) {
132
+ node = await hook({ context, findMany, node, operation, overrideAccess, req })
133
+ }
134
+ }
135
+ },
136
+ nodes: (value as SerializedEditorState)?.root?.children ?? [],
137
+ })
138
+
139
+ return value
140
+ },
141
+ ],
142
+ beforeValidate: [
143
+ async ({ context, findMany, operation, overrideAccess, req, value }) => {
144
+ await recurseNodesAsync({
145
+ callback: async (node) => {
146
+ const beforeValidateHooks = finalSanitizedEditorConfig.features.hooks.beforeValidate
147
+ if (beforeValidateHooks?.has(node.type)) {
148
+ for (const hook of beforeValidateHooks.get(node.type)) {
149
+ /**
150
+ * We cannot pass the originalNode here, as there is no way to map one node to a previous one, as a previous originalNode might be in a different position
151
+ */ /*
152
+ node = await hook({ context, findMany, node, operation, overrideAccess, req })
153
+ }
154
+ }
155
+ },
156
+ nodes: (value as SerializedEditorState)?.root?.children ?? [],
157
+ })
158
+
159
+ return value
70
160
  },
71
- editorConfig: finalSanitizedEditorConfig,
72
- generateComponentMap: getGenerateComponentMap({
73
- resolvedFeatureMap
74
- }),
75
- generateSchemaMap: getGenerateSchemaMap({
76
- resolvedFeatureMap
77
- }),
78
- outputSchema: ({ collectionIDFieldTypes, config, field, interfaceNameDefinitions, isRequired })=>{
79
- let outputSchema = {
80
- // This schema matches the SerializedEditorState type so far, that it's possible to cast SerializedEditorState to this schema without any errors.
81
- // In the future, we should
82
- // 1) allow recursive children
83
- // 2) Pass in all the different types for every node added to the editorconfig. This can be done with refs in the schema.
84
- type: withNullableJSONSchemaType('object', isRequired),
85
- properties: {
86
- root: {
87
- type: 'object',
88
- additionalProperties: false,
89
- properties: {
90
- type: {
91
- type: 'string'
92
- },
93
- children: {
94
- type: 'array',
95
- items: {
96
- type: 'object',
97
- additionalProperties: true,
98
- properties: {
99
- type: {
100
- type: 'string'
161
+ ],
162
+ },*/ outputSchema: ({ collectionIDFieldTypes, config, field, interfaceNameDefinitions, isRequired })=>{
163
+ let outputSchema = {
164
+ // This schema matches the SerializedEditorState type so far, that it's possible to cast SerializedEditorState to this schema without any errors.
165
+ // In the future, we should
166
+ // 1) allow recursive children
167
+ // 2) Pass in all the different types for every node added to the editorconfig. This can be done with refs in the schema.
168
+ type: withNullableJSONSchemaType('object', isRequired),
169
+ properties: {
170
+ root: {
171
+ type: 'object',
172
+ additionalProperties: false,
173
+ properties: {
174
+ type: {
175
+ type: 'string'
176
+ },
177
+ children: {
178
+ type: 'array',
179
+ items: {
180
+ type: 'object',
181
+ additionalProperties: true,
182
+ properties: {
183
+ type: {
184
+ type: 'string'
185
+ },
186
+ version: {
187
+ type: 'integer'
188
+ }
101
189
  },
102
- version: {
103
- type: 'integer'
190
+ required: [
191
+ 'type',
192
+ 'version'
193
+ ]
194
+ }
195
+ },
196
+ direction: {
197
+ oneOf: [
198
+ {
199
+ enum: [
200
+ 'ltr',
201
+ 'rtl'
202
+ ]
203
+ },
204
+ {
205
+ type: 'null'
104
206
  }
105
- },
106
- required: [
107
- 'type',
108
- 'version'
109
207
  ]
208
+ },
209
+ format: {
210
+ type: 'string',
211
+ enum: [
212
+ 'left',
213
+ 'start',
214
+ 'center',
215
+ 'right',
216
+ 'end',
217
+ 'justify',
218
+ ''
219
+ ]
220
+ },
221
+ indent: {
222
+ type: 'integer'
223
+ },
224
+ version: {
225
+ type: 'integer'
110
226
  }
111
227
  },
112
- direction: {
113
- oneOf: [
114
- {
115
- enum: [
116
- 'ltr',
117
- 'rtl'
118
- ]
119
- },
120
- {
121
- type: 'null'
122
- }
123
- ]
124
- },
125
- format: {
126
- type: 'string',
127
- enum: [
128
- 'left',
129
- 'start',
130
- 'center',
131
- 'right',
132
- 'end',
133
- 'justify',
134
- ''
135
- ]
136
- },
137
- indent: {
138
- type: 'integer'
139
- },
140
- version: {
141
- type: 'integer'
142
- }
143
- },
144
- required: [
145
- 'children',
146
- 'direction',
147
- 'format',
148
- 'indent',
149
- 'type',
150
- 'version'
151
- ]
152
- }
153
- },
154
- required: [
155
- 'root'
156
- ]
157
- };
158
- for (const modifyOutputSchema of finalSanitizedEditorConfig.features.generatedTypes.modifyOutputSchemas){
159
- outputSchema = modifyOutputSchema({
160
- collectionIDFieldTypes,
161
- config,
162
- currentSchema: outputSchema,
163
- field,
164
- interfaceNameDefinitions,
165
- isRequired
166
- });
167
- }
168
- return outputSchema;
169
- },
170
- populationPromise ({ context, currentDepth, depth, field, findMany, flattenLocales, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc }) {
171
- // check if there are any features with nodes which have populationPromises for this field
172
- if (finalSanitizedEditorConfig?.features?.populationPromises?.size) {
173
- return richTextRelationshipPromise({
174
- context,
175
- currentDepth,
176
- depth,
177
- editorPopulationPromises: finalSanitizedEditorConfig.features.populationPromises,
178
- field,
179
- findMany,
180
- flattenLocales,
181
- overrideAccess,
182
- populationPromises,
183
- req,
184
- showHiddenFields,
185
- siblingDoc
186
- });
187
- }
188
- return null;
189
- },
190
- validate: richTextValidateHOC({
191
- editorConfig: finalSanitizedEditorConfig
192
- })
228
+ required: [
229
+ 'children',
230
+ 'direction',
231
+ 'format',
232
+ 'indent',
233
+ 'type',
234
+ 'version'
235
+ ]
236
+ }
237
+ },
238
+ required: [
239
+ 'root'
240
+ ]
241
+ };
242
+ for (const modifyOutputSchema of finalSanitizedEditorConfig.features.generatedTypes.modifyOutputSchemas){
243
+ outputSchema = modifyOutputSchema({
244
+ collectionIDFieldTypes,
245
+ config,
246
+ currentSchema: outputSchema,
247
+ field,
248
+ interfaceNameDefinitions,
249
+ isRequired
250
+ });
251
+ }
252
+ return outputSchema;
253
+ },
254
+ populationPromises ({ context, currentDepth, depth, field, fieldPromises, findMany, flattenLocales, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc }) {
255
+ // check if there are any features with nodes which have populationPromises for this field
256
+ if (finalSanitizedEditorConfig?.features?.populationPromises?.size) {
257
+ populateLexicalPopulationPromises({
258
+ context,
259
+ currentDepth,
260
+ depth,
261
+ editorPopulationPromises: finalSanitizedEditorConfig.features.populationPromises,
262
+ field,
263
+ fieldPromises,
264
+ findMany,
265
+ flattenLocales,
266
+ overrideAccess,
267
+ populationPromises,
268
+ req,
269
+ showHiddenFields,
270
+ siblingDoc
271
+ });
272
+ }
273
+ },
274
+ validate: richTextValidateHOC({
275
+ editorConfig: finalSanitizedEditorConfig
276
+ })
277
+ };
193
278
  };
194
279
  }
195
280
  export { AlignFeature } from './field/features/align/feature.server.js';
@@ -216,6 +301,7 @@ export { SubscriptFeature } from './field/features/format/subscript/feature.serv
216
301
  export { SuperscriptFeature } from './field/features/format/superscript/feature.server.js';
217
302
  export { UnderlineFeature } from './field/features/format/underline/feature.server.js';
218
303
  export { HeadingFeature } from './field/features/heading/feature.server.js';
304
+ export { HorizontalRuleFeature } from './field/features/horizontalrule/feature.server.js';
219
305
  export { IndentFeature } from './field/features/indent/feature.server.js';
220
306
  export { LinkFeature } from './field/features/link/feature.server.js';
221
307
  export { $createAutoLinkNode, $isAutoLinkNode, AutoLinkNode } from './field/features/link/nodes/AutoLinkNode.js';
@@ -240,11 +326,12 @@ export { SlateToLexicalFeature } from './field/features/migrations/slateToLexica
240
326
  export { ParagraphFeature } from './field/features/paragraph/feature.server.js';
241
327
  export { RelationshipFeature } from './field/features/relationship/feature.server.js';
242
328
  export { $createRelationshipNode, $isRelationshipNode, RelationshipNode } from './field/features/relationship/nodes/RelationshipNode.js';
329
+ export { createNode } from './field/features/typeUtilities.js';
243
330
  export { UploadFeature } from './field/features/upload/feature.server.js';
244
331
  export { $createUploadNode, $isUploadNode, UploadNode } from './field/features/upload/nodes/UploadNode.js';
245
332
  export { EditorConfigProvider, useEditorConfigContext } from './field/lexical/config/client/EditorConfigProvider.js';
246
333
  export { sanitizeClientEditorConfig, sanitizeClientFeatures } from './field/lexical/config/client/sanitize.js';
247
- export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig, defaultSanitizedServerEditorConfig } from './field/lexical/config/server/default.js';
334
+ export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig } from './field/lexical/config/server/default.js';
248
335
  export { loadFeatures, sortFeaturesForOptimalLoading } from './field/lexical/config/server/loader.js';
249
336
  export { sanitizeServerEditorConfig, sanitizeServerFeatures } from './field/lexical/config/server/sanitize.js';
250
337
  export { getEnabledNodes } from './field/lexical/nodes/index.js';