@payloadcms/richtext-lexical 3.0.0-alpha.65 → 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 (336) 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 +1 -2
  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/drawer/index.d.ts.map +1 -1
  21. package/dist/field/features/blocks/drawer/index.js +2 -4
  22. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  23. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  24. package/dist/field/features/blocks/feature.server.js +28 -68
  25. package/dist/field/features/blocks/feature.server.js.map +1 -1
  26. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -3
  27. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  28. package/dist/field/features/blocks/nodes/BlocksNode.js +1 -2
  29. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  30. package/dist/field/features/blocks/plugin/commands.d.ts.map +1 -1
  31. package/dist/field/features/blocks/plugin/commands.js +1 -2
  32. package/dist/field/features/blocks/plugin/commands.js.map +1 -1
  33. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  34. package/dist/field/features/blocks/plugin/index.js +3 -6
  35. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  36. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  37. package/dist/field/features/blocks/populationPromise.js +0 -13
  38. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  39. package/dist/field/features/blocks/validate.d.ts.map +1 -1
  40. package/dist/field/features/blocks/validate.js +2 -14
  41. package/dist/field/features/blocks/validate.js.map +1 -1
  42. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +1 -1
  43. package/dist/field/features/debug/testrecorder/plugin/index.js +2 -4
  44. package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
  45. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +1 -1
  46. package/dist/field/features/debug/treeview/plugin/index.js +2 -4
  47. package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
  48. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  49. package/dist/field/features/format/bold/feature.client.js +1 -2
  50. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  51. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +1 -1
  52. package/dist/field/features/format/inlinecode/feature.client.js +1 -2
  53. package/dist/field/features/format/inlinecode/feature.client.js.map +1 -1
  54. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  55. package/dist/field/features/format/italic/feature.client.js +1 -2
  56. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  57. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  58. package/dist/field/features/format/strikethrough/feature.client.js +1 -2
  59. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  60. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  61. package/dist/field/features/format/subscript/feature.client.js +1 -2
  62. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  63. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  64. package/dist/field/features/format/superscript/feature.client.js +1 -2
  65. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  66. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  67. package/dist/field/features/format/underline/feature.client.js +1 -2
  68. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  69. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  70. package/dist/field/features/heading/feature.client.js +3 -6
  71. package/dist/field/features/heading/feature.client.js.map +1 -1
  72. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  73. package/dist/field/features/heading/feature.server.js +1 -2
  74. package/dist/field/features/heading/feature.server.js.map +1 -1
  75. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  76. package/dist/field/features/heading/markdownTransformer.js +1 -2
  77. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  78. package/dist/field/features/horizontalrule/component/index.d.ts.map +1 -1
  79. package/dist/field/features/horizontalrule/component/index.js +2 -4
  80. package/dist/field/features/horizontalrule/component/index.js.map +1 -1
  81. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts +1 -3
  82. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +1 -1
  83. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js +1 -2
  84. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +1 -1
  85. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +1 -1
  86. package/dist/field/features/horizontalrule/plugin/index.js +3 -6
  87. package/dist/field/features/horizontalrule/plugin/index.js.map +1 -1
  88. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  89. package/dist/field/features/indent/feature.client.js +1 -2
  90. package/dist/field/features/indent/feature.client.js.map +1 -1
  91. package/dist/field/features/link/drawer/baseFields.d.ts +3 -3
  92. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  93. package/dist/field/features/link/drawer/baseFields.js +28 -42
  94. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  95. package/dist/field/features/link/drawer/types.d.ts +4 -2
  96. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  97. package/dist/field/features/link/drawer/types.js.map +1 -1
  98. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  99. package/dist/field/features/link/feature.client.js +2 -4
  100. package/dist/field/features/link/feature.client.js.map +1 -1
  101. package/dist/field/features/link/feature.server.d.ts +0 -2
  102. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  103. package/dist/field/features/link/feature.server.js +22 -6
  104. package/dist/field/features/link/feature.server.js.map +1 -1
  105. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  106. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  107. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  108. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  109. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  110. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  111. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  112. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  113. package/dist/field/features/link/plugins/autoLink/index.js +3 -6
  114. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  115. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  116. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  117. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  118. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  119. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +56 -39
  120. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  121. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +9 -1
  122. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -5
  123. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  124. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +11 -29
  125. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  126. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  127. package/dist/field/features/link/plugins/link/index.js +3 -12
  128. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  129. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  130. package/dist/field/features/link/populationPromise.js +5 -23
  131. package/dist/field/features/link/populationPromise.js.map +1 -1
  132. package/dist/field/features/link/validate.d.ts +5 -0
  133. package/dist/field/features/link/validate.d.ts.map +1 -0
  134. package/dist/field/features/link/validate.js +32 -0
  135. package/dist/field/features/link/validate.js.map +1 -0
  136. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  137. package/dist/field/features/lists/checklist/feature.client.js +1 -2
  138. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  139. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  140. package/dist/field/features/lists/checklist/feature.server.js +1 -2
  141. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  142. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  143. package/dist/field/features/lists/checklist/markdownTransformers.js +1 -2
  144. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  145. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  146. package/dist/field/features/lists/checklist/plugin/index.js +1 -2
  147. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  148. package/dist/field/features/lists/common/markdown.d.ts.map +1 -1
  149. package/dist/field/features/lists/common/markdown.js +1 -2
  150. package/dist/field/features/lists/common/markdown.js.map +1 -1
  151. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  152. package/dist/field/features/lists/htmlConverter.js +1 -2
  153. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  154. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +1 -1
  155. package/dist/field/features/lists/orderedlist/feature.client.js +1 -2
  156. package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
  157. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +1 -1
  158. package/dist/field/features/lists/orderedlist/feature.server.js +1 -2
  159. package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
  160. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +1 -1
  161. package/dist/field/features/lists/orderedlist/markdownTransformer.js +1 -2
  162. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
  163. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  164. package/dist/field/features/lists/plugin/index.js +1 -2
  165. package/dist/field/features/lists/plugin/index.js.map +1 -1
  166. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +1 -1
  167. package/dist/field/features/lists/unorderedlist/feature.client.js +1 -2
  168. package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
  169. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +1 -1
  170. package/dist/field/features/lists/unorderedlist/feature.server.js +1 -2
  171. package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
  172. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +1 -1
  173. package/dist/field/features/lists/unorderedlist/markdownTransformer.js +1 -2
  174. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
  175. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  176. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  177. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  178. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  179. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  180. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  181. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  182. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  183. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  184. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  185. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  186. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  187. package/dist/field/features/paragraph/feature.client.js +2 -4
  188. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  189. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  190. package/dist/field/features/relationship/drawer/commands.js +1 -2
  191. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  192. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  193. package/dist/field/features/relationship/drawer/index.js +2 -4
  194. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  195. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +2 -4
  196. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  197. package/dist/field/features/relationship/nodes/RelationshipNode.js +1 -2
  198. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  199. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  200. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +53 -6
  201. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  202. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  203. package/dist/field/features/relationship/plugins/index.js +3 -6
  204. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  205. package/dist/field/features/types.d.ts +5 -1
  206. package/dist/field/features/types.d.ts.map +1 -1
  207. package/dist/field/features/types.js.map +1 -1
  208. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  209. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +2 -4
  210. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  211. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  212. package/dist/field/features/upload/component/index.js +52 -6
  213. package/dist/field/features/upload/component/index.js.map +1 -1
  214. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  215. package/dist/field/features/upload/drawer/commands.js +1 -2
  216. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  217. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  218. package/dist/field/features/upload/drawer/index.js +2 -4
  219. package/dist/field/features/upload/drawer/index.js.map +1 -1
  220. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  221. package/dist/field/features/upload/feature.server.js +14 -2
  222. package/dist/field/features/upload/feature.server.js.map +1 -1
  223. package/dist/field/features/upload/nodes/UploadNode.d.ts +1 -3
  224. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  225. package/dist/field/features/upload/nodes/UploadNode.js +2 -8
  226. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  227. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  228. package/dist/field/features/upload/plugin/index.js +3 -6
  229. package/dist/field/features/upload/plugin/index.js.map +1 -1
  230. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  231. package/dist/field/features/upload/populationPromise.js +2 -12
  232. package/dist/field/features/upload/populationPromise.js.map +1 -1
  233. package/dist/field/features/upload/validate.d.ts +2 -1
  234. package/dist/field/features/upload/validate.d.ts.map +1 -1
  235. package/dist/field/features/upload/validate.js +33 -11
  236. package/dist/field/features/upload/validate.js.map +1 -1
  237. package/dist/field/index.d.ts +1 -1
  238. package/dist/field/index.d.ts.map +1 -1
  239. package/dist/field/index.js.map +1 -1
  240. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  241. package/dist/field/lexical/LexicalEditor.js +6 -11
  242. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  243. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  244. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  245. package/dist/field/lexical/LexicalProvider.js +1 -2
  246. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  247. package/dist/field/lexical/config/client/default.d.ts +1 -1
  248. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  249. package/dist/field/lexical/config/client/default.js.map +1 -1
  250. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  251. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  252. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  253. package/dist/field/lexical/config/server/default.d.ts +2 -3
  254. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  255. package/dist/field/lexical/config/server/default.js +0 -2
  256. package/dist/field/lexical/config/server/default.js.map +1 -1
  257. package/dist/field/lexical/config/server/loader.d.ts +4 -2
  258. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  259. package/dist/field/lexical/config/server/loader.js +3 -2
  260. package/dist/field/lexical/config/server/loader.js.map +1 -1
  261. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  262. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  263. package/dist/field/lexical/config/server/sanitize.js +3 -2
  264. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  265. package/dist/field/lexical/config/types.d.ts +1 -1
  266. package/dist/field/lexical/config/types.d.ts.map +1 -1
  267. package/dist/field/lexical/config/types.js.map +1 -1
  268. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +1 -1
  269. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js +3 -6
  270. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
  271. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +1 -1
  272. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js +3 -6
  273. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
  274. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +1 -1
  275. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +27 -29
  276. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +1 -1
  277. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  278. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  279. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  280. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  281. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +3 -6
  282. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  283. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  284. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -6
  285. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  286. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  287. package/dist/field/lexical/plugins/SlashMenu/index.js +1 -2
  288. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  289. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  290. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -4
  291. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  292. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  293. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +1 -2
  294. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  295. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  296. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +2 -4
  297. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  298. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  299. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  300. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  301. package/dist/field/lexical/theme/EditorTheme.scss +7 -8
  302. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  303. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  304. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  305. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  306. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  307. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  308. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  309. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  310. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  311. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +1 -1
  312. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  313. package/dist/field/lexical/utils/setFloatingElemPosition.js +15 -13
  314. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  315. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  316. package/dist/field/lexical/utils/url.js +2 -0
  317. package/dist/field/lexical/utils/url.js.map +1 -1
  318. package/dist/generateComponentMap.d.ts.map +1 -1
  319. package/dist/generateComponentMap.js +1 -10
  320. package/dist/generateComponentMap.js.map +1 -1
  321. package/dist/generateSchemaMap.d.ts.map +1 -1
  322. package/dist/generateSchemaMap.js +1 -10
  323. package/dist/generateSchemaMap.js.map +1 -1
  324. package/dist/index.d.ts +3 -3
  325. package/dist/index.d.ts.map +1 -1
  326. package/dist/index.js +241 -234
  327. package/dist/index.js.map +1 -1
  328. package/dist/populate/defaultValue.d.ts.map +1 -1
  329. package/dist/populate/defaultValue.js +1 -0
  330. package/dist/populate/defaultValue.js.map +1 -1
  331. package/dist/types.d.ts +11 -5
  332. package/dist/types.d.ts.map +1 -1
  333. package/dist/types.js.map +1 -1
  334. package/dist/validate/index.d.ts +1 -1
  335. package/dist/validate/index.d.ts.map +1 -1
  336. package/package.json +46 -45
package/dist/index.js CHANGED
@@ -2,147 +2,153 @@ 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
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
- editorConfig: finalSanitizedEditorConfig,
54
- generateComponentMap: getGenerateComponentMap({
55
- resolvedFeatureMap
56
- }),
57
- generateSchemaMap: getGenerateSchemaMap({
58
- resolvedFeatureMap
59
- }),
60
- /* hooks: {
61
- afterChange: finalSanitizedEditorConfig.features.hooks.afterChange,
62
- afterRead: finalSanitizedEditorConfig.features.hooks.afterRead,
63
- beforeChange: finalSanitizedEditorConfig.features.hooks.beforeChange,
64
- beforeDuplicate: finalSanitizedEditorConfig.features.hooks.beforeDuplicate,
65
- beforeValidate: finalSanitizedEditorConfig.features.hooks.beforeValidate,
66
- },*/ /* // TODO: Figure out docWithLocales / originalSiblingDoc => node matching. Can't use indexes, as the order of nodes could technically change between hooks.
67
- hooks: {
68
- afterChange: [
69
- async ({ context, findMany, operation, overrideAccess, req, value }) => {
70
- await recurseNodesAsync({
71
- callback: async (node) => {
72
- const afterChangeHooks = finalSanitizedEditorConfig.features.hooks.afterChange
73
- if (afterChangeHooks?.has(node.type)) {
74
- for (const hook of afterChangeHooks.get(node.type)) {
75
- node = await hook({ context, findMany, node, operation, overrideAccess, req })
32
+ const lexical = props.lexical;
33
+ resolvedFeatureMap = await loadFeatures({
34
+ config,
35
+ unSanitizedEditorConfig: {
36
+ features,
37
+ lexical: lexical ? lexical : defaultEditorConfig.lexical
76
38
  }
77
- }
78
- },
79
- nodes: (value as SerializedEditorState)?.root?.children ?? [],
80
- })
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
+ })
81
87
 
82
- return value
83
- },
84
- ],
85
- afterRead: [
86
- async ({ context, findMany, operation, overrideAccess, req, value }) => {
87
- await recurseNodesAsync({
88
- callback: async (node) => {
89
- const afterReadHooks = finalSanitizedEditorConfig.features.hooks.afterRead
90
- if (afterReadHooks?.has(node.type)) {
91
- for (const hook of afterReadHooks.get(node.type)) {
92
- node = await hook({ context, findMany, node, operation, overrideAccess, req })
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
+ }
93
100
  }
94
- }
95
- },
96
- nodes: (value as SerializedEditorState)?.root?.children ?? [],
97
- })
101
+ },
102
+ nodes: (value as SerializedEditorState)?.root?.children ?? [],
103
+ })
98
104
 
99
- return value
100
- },
101
- ],
102
- beforeChange: [
103
- async ({ context, findMany, operation, overrideAccess, req, value }) => {
104
- await recurseNodesAsync({
105
- callback: async (node) => {
106
- const beforeChangeHooks = finalSanitizedEditorConfig.features.hooks.beforeChange
107
- if (beforeChangeHooks?.has(node.type)) {
108
- for (const hook of beforeChangeHooks.get(node.type)) {
109
- node = await hook({ context, findMany, node, operation, overrideAccess, req })
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
+ }
110
117
  }
111
- }
112
- },
113
- nodes: (value as SerializedEditorState)?.root?.children ?? [],
114
- })
118
+ },
119
+ nodes: (value as SerializedEditorState)?.root?.children ?? [],
120
+ })
115
121
 
116
- return value
117
- },
118
- ],
119
- beforeDuplicate: [
120
- async ({ context, findMany, operation, overrideAccess, req, value }) => {
121
- await recurseNodesAsync({
122
- callback: async (node) => {
123
- const beforeDuplicateHooks = finalSanitizedEditorConfig.features.hooks.beforeDuplicate
124
- if (beforeDuplicateHooks?.has(node.type)) {
125
- for (const hook of beforeDuplicateHooks.get(node.type)) {
126
- node = await hook({ context, findMany, node, operation, overrideAccess, req })
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
+ }
127
134
  }
128
- }
129
- },
130
- nodes: (value as SerializedEditorState)?.root?.children ?? [],
131
- })
135
+ },
136
+ nodes: (value as SerializedEditorState)?.root?.children ?? [],
137
+ })
132
138
 
133
- return value
134
- },
135
- ],
136
- beforeValidate: [
137
- async ({ context, findMany, operation, overrideAccess, req, value }) => {
138
- await recurseNodesAsync({
139
- callback: async (node) => {
140
- const beforeValidateHooks = finalSanitizedEditorConfig.features.hooks.beforeValidate
141
- if (beforeValidateHooks?.has(node.type)) {
142
- for (const hook of beforeValidateHooks.get(node.type)) {
143
- /**
144
- * 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
145
- */ /*
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
+ */ /*
146
152
  node = await hook({ context, findMany, node, operation, overrideAccess, req })
147
153
  }
148
154
  }
@@ -154,120 +160,121 @@ export function lexicalEditor(props) {
154
160
  },
155
161
  ],
156
162
  },*/ outputSchema: ({ collectionIDFieldTypes, config, field, interfaceNameDefinitions, isRequired })=>{
157
- let outputSchema = {
158
- // This schema matches the SerializedEditorState type so far, that it's possible to cast SerializedEditorState to this schema without any errors.
159
- // In the future, we should
160
- // 1) allow recursive children
161
- // 2) Pass in all the different types for every node added to the editorconfig. This can be done with refs in the schema.
162
- type: withNullableJSONSchemaType('object', isRequired),
163
- properties: {
164
- root: {
165
- type: 'object',
166
- additionalProperties: false,
167
- properties: {
168
- type: {
169
- type: 'string'
170
- },
171
- children: {
172
- type: 'array',
173
- items: {
174
- type: 'object',
175
- additionalProperties: true,
176
- properties: {
177
- type: {
178
- type: 'string'
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
+ }
179
189
  },
180
- version: {
181
- 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'
182
206
  }
183
- },
184
- required: [
185
- 'type',
186
- 'version'
187
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'
188
226
  }
189
227
  },
190
- direction: {
191
- oneOf: [
192
- {
193
- enum: [
194
- 'ltr',
195
- 'rtl'
196
- ]
197
- },
198
- {
199
- type: 'null'
200
- }
201
- ]
202
- },
203
- format: {
204
- type: 'string',
205
- enum: [
206
- 'left',
207
- 'start',
208
- 'center',
209
- 'right',
210
- 'end',
211
- 'justify',
212
- ''
213
- ]
214
- },
215
- indent: {
216
- type: 'integer'
217
- },
218
- version: {
219
- type: 'integer'
220
- }
221
- },
222
- required: [
223
- 'children',
224
- 'direction',
225
- 'format',
226
- 'indent',
227
- 'type',
228
- 'version'
229
- ]
230
- }
231
- },
232
- required: [
233
- 'root'
234
- ]
235
- };
236
- for (const modifyOutputSchema of finalSanitizedEditorConfig.features.generatedTypes.modifyOutputSchemas){
237
- outputSchema = modifyOutputSchema({
238
- collectionIDFieldTypes,
239
- config,
240
- currentSchema: outputSchema,
241
- field,
242
- interfaceNameDefinitions,
243
- isRequired
244
- });
245
- }
246
- return outputSchema;
247
- },
248
- populationPromises ({ context, currentDepth, depth, field, fieldPromises, findMany, flattenLocales, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc }) {
249
- // check if there are any features with nodes which have populationPromises for this field
250
- if (finalSanitizedEditorConfig?.features?.populationPromises?.size) {
251
- populateLexicalPopulationPromises({
252
- context,
253
- currentDepth,
254
- depth,
255
- editorPopulationPromises: finalSanitizedEditorConfig.features.populationPromises,
256
- field,
257
- fieldPromises,
258
- findMany,
259
- flattenLocales,
260
- overrideAccess,
261
- populationPromises,
262
- req,
263
- showHiddenFields,
264
- siblingDoc
265
- });
266
- }
267
- },
268
- validate: richTextValidateHOC({
269
- editorConfig: finalSanitizedEditorConfig
270
- })
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
+ };
271
278
  };
272
279
  }
273
280
  export { AlignFeature } from './field/features/align/feature.server.js';
@@ -324,7 +331,7 @@ export { UploadFeature } from './field/features/upload/feature.server.js';
324
331
  export { $createUploadNode, $isUploadNode, UploadNode } from './field/features/upload/nodes/UploadNode.js';
325
332
  export { EditorConfigProvider, useEditorConfigContext } from './field/lexical/config/client/EditorConfigProvider.js';
326
333
  export { sanitizeClientEditorConfig, sanitizeClientFeatures } from './field/lexical/config/client/sanitize.js';
327
- export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig, defaultSanitizedServerEditorConfig } from './field/lexical/config/server/default.js';
334
+ export { defaultEditorConfig, defaultEditorFeatures, defaultEditorLexicalConfig } from './field/lexical/config/server/default.js';
328
335
  export { loadFeatures, sortFeaturesForOptimalLoading } from './field/lexical/config/server/loader.js';
329
336
  export { sanitizeServerEditorConfig, sanitizeServerFeatures } from './field/lexical/config/server/sanitize.js';
330
337
  export { getEnabledNodes } from './field/lexical/nodes/index.js';