@payloadcms/richtext-lexical 3.0.0-beta.2 → 3.0.0-beta.21

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 (415) 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 +36 -3
  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 +109 -77
  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/converters/html/field/index.d.ts +8 -2
  46. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  47. package/dist/field/features/converters/html/field/index.js +6 -3
  48. package/dist/field/features/converters/html/field/index.js.map +1 -1
  49. package/dist/field/features/debug/testrecorder/plugin/index.d.ts.map +1 -1
  50. package/dist/field/features/debug/testrecorder/plugin/index.js +2 -4
  51. package/dist/field/features/debug/testrecorder/plugin/index.js.map +1 -1
  52. package/dist/field/features/debug/treeview/plugin/index.d.ts.map +1 -1
  53. package/dist/field/features/debug/treeview/plugin/index.js +2 -4
  54. package/dist/field/features/debug/treeview/plugin/index.js.map +1 -1
  55. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  56. package/dist/field/features/format/bold/feature.client.js +1 -2
  57. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  58. package/dist/field/features/format/inlinecode/feature.client.d.ts.map +1 -1
  59. package/dist/field/features/format/inlinecode/feature.client.js +1 -2
  60. package/dist/field/features/format/inlinecode/feature.client.js.map +1 -1
  61. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  62. package/dist/field/features/format/italic/feature.client.js +1 -2
  63. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  64. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  65. package/dist/field/features/format/strikethrough/feature.client.js +1 -2
  66. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  67. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  68. package/dist/field/features/format/subscript/feature.client.js +1 -2
  69. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  70. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  71. package/dist/field/features/format/superscript/feature.client.js +1 -2
  72. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  73. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  74. package/dist/field/features/format/underline/feature.client.js +1 -2
  75. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  76. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  77. package/dist/field/features/heading/feature.client.js +3 -6
  78. package/dist/field/features/heading/feature.client.js.map +1 -1
  79. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  80. package/dist/field/features/heading/feature.server.js +5 -5
  81. package/dist/field/features/heading/feature.server.js.map +1 -1
  82. package/dist/field/features/heading/markdownTransformer.d.ts.map +1 -1
  83. package/dist/field/features/heading/markdownTransformer.js +1 -2
  84. package/dist/field/features/heading/markdownTransformer.js.map +1 -1
  85. package/dist/field/features/horizontalrule/component/index.d.ts +10 -0
  86. package/dist/field/features/horizontalrule/component/index.d.ts.map +1 -0
  87. package/dist/field/features/horizontalrule/component/index.js +62 -0
  88. package/dist/field/features/horizontalrule/component/index.js.map +1 -0
  89. package/dist/field/features/horizontalrule/feature.client.d.ts +3 -0
  90. package/dist/field/features/horizontalrule/feature.client.d.ts.map +1 -0
  91. package/dist/field/features/horizontalrule/feature.client.js +53 -0
  92. package/dist/field/features/horizontalrule/feature.client.js.map +1 -0
  93. package/dist/field/features/horizontalrule/feature.server.d.ts +3 -0
  94. package/dist/field/features/horizontalrule/feature.server.d.ts.map +1 -0
  95. package/dist/field/features/horizontalrule/feature.server.js +37 -0
  96. package/dist/field/features/horizontalrule/feature.server.js.map +1 -0
  97. package/dist/field/features/horizontalrule/markdownTransformer.d.ts +3 -0
  98. package/dist/field/features/horizontalrule/markdownTransformer.d.ts.map +1 -0
  99. package/dist/field/features/horizontalrule/markdownTransformer.js +23 -0
  100. package/dist/field/features/horizontalrule/markdownTransformer.js.map +1 -0
  101. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts +53 -0
  102. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.d.ts.map +1 -0
  103. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js +88 -0
  104. package/dist/field/features/horizontalrule/nodes/HorizontalRuleNode.js.map +1 -0
  105. package/dist/field/features/horizontalrule/plugin/index.d.ts +6 -0
  106. package/dist/field/features/horizontalrule/plugin/index.d.ts.map +1 -0
  107. package/dist/field/features/horizontalrule/plugin/index.js +31 -0
  108. package/dist/field/features/horizontalrule/plugin/index.js.map +1 -0
  109. package/dist/field/features/horizontalrule/plugin/index.scss +20 -0
  110. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  111. package/dist/field/features/indent/feature.client.js +1 -2
  112. package/dist/field/features/indent/feature.client.js.map +1 -1
  113. package/dist/field/features/link/drawer/baseFields.d.ts +3 -3
  114. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  115. package/dist/field/features/link/drawer/baseFields.js +28 -42
  116. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  117. package/dist/field/features/link/drawer/index.js +3 -2
  118. package/dist/field/features/link/drawer/index.js.map +1 -1
  119. package/dist/field/features/link/drawer/types.d.ts +4 -2
  120. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  121. package/dist/field/features/link/drawer/types.js.map +1 -1
  122. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  123. package/dist/field/features/link/feature.client.js +2 -4
  124. package/dist/field/features/link/feature.client.js.map +1 -1
  125. package/dist/field/features/link/feature.server.d.ts +0 -2
  126. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  127. package/dist/field/features/link/feature.server.js +48 -9
  128. package/dist/field/features/link/feature.server.js.map +1 -1
  129. package/dist/field/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  130. package/dist/field/features/link/nodes/AutoLinkNode.js +1 -2
  131. package/dist/field/features/link/nodes/AutoLinkNode.js.map +1 -1
  132. package/dist/field/features/link/nodes/LinkNode.d.ts +1 -3
  133. package/dist/field/features/link/nodes/LinkNode.d.ts.map +1 -1
  134. package/dist/field/features/link/nodes/LinkNode.js +2 -4
  135. package/dist/field/features/link/nodes/LinkNode.js.map +1 -1
  136. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  137. package/dist/field/features/link/plugins/autoLink/index.js +3 -6
  138. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  139. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.d.ts.map +1 -1
  140. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js +1 -2
  141. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/commands.js.map +1 -1
  142. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  143. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +56 -39
  144. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  145. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +9 -1
  146. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -5
  147. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  148. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +11 -29
  149. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  150. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  151. package/dist/field/features/link/plugins/link/index.js +3 -12
  152. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  153. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  154. package/dist/field/features/link/populationPromise.js +9 -25
  155. package/dist/field/features/link/populationPromise.js.map +1 -1
  156. package/dist/field/features/link/validate.d.ts +5 -0
  157. package/dist/field/features/link/validate.d.ts.map +1 -0
  158. package/dist/field/features/link/validate.js +32 -0
  159. package/dist/field/features/link/validate.js.map +1 -0
  160. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  161. package/dist/field/features/lists/checklist/feature.client.js +1 -2
  162. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  163. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  164. package/dist/field/features/lists/checklist/feature.server.js +6 -6
  165. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  166. package/dist/field/features/lists/checklist/markdownTransformers.d.ts.map +1 -1
  167. package/dist/field/features/lists/checklist/markdownTransformers.js +1 -2
  168. package/dist/field/features/lists/checklist/markdownTransformers.js.map +1 -1
  169. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  170. package/dist/field/features/lists/checklist/plugin/index.js +1 -2
  171. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  172. package/dist/field/features/lists/common/markdown.d.ts.map +1 -1
  173. package/dist/field/features/lists/common/markdown.js +1 -2
  174. package/dist/field/features/lists/common/markdown.js.map +1 -1
  175. package/dist/field/features/lists/htmlConverter.d.ts.map +1 -1
  176. package/dist/field/features/lists/htmlConverter.js +13 -6
  177. package/dist/field/features/lists/htmlConverter.js.map +1 -1
  178. package/dist/field/features/lists/orderedlist/feature.client.d.ts.map +1 -1
  179. package/dist/field/features/lists/orderedlist/feature.client.js +1 -2
  180. package/dist/field/features/lists/orderedlist/feature.client.js.map +1 -1
  181. package/dist/field/features/lists/orderedlist/feature.server.d.ts.map +1 -1
  182. package/dist/field/features/lists/orderedlist/feature.server.js +6 -6
  183. package/dist/field/features/lists/orderedlist/feature.server.js.map +1 -1
  184. package/dist/field/features/lists/orderedlist/markdownTransformer.d.ts.map +1 -1
  185. package/dist/field/features/lists/orderedlist/markdownTransformer.js +1 -2
  186. package/dist/field/features/lists/orderedlist/markdownTransformer.js.map +1 -1
  187. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  188. package/dist/field/features/lists/plugin/index.js +1 -2
  189. package/dist/field/features/lists/plugin/index.js.map +1 -1
  190. package/dist/field/features/lists/unorderedlist/feature.client.d.ts.map +1 -1
  191. package/dist/field/features/lists/unorderedlist/feature.client.js +1 -2
  192. package/dist/field/features/lists/unorderedlist/feature.client.js.map +1 -1
  193. package/dist/field/features/lists/unorderedlist/feature.server.d.ts.map +1 -1
  194. package/dist/field/features/lists/unorderedlist/feature.server.js +6 -6
  195. package/dist/field/features/lists/unorderedlist/feature.server.js.map +1 -1
  196. package/dist/field/features/lists/unorderedlist/markdownTransformer.d.ts.map +1 -1
  197. package/dist/field/features/lists/unorderedlist/markdownTransformer.js +1 -2
  198. package/dist/field/features/lists/unorderedlist/markdownTransformer.js.map +1 -1
  199. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  200. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +2 -4
  201. package/dist/field/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +1 -1
  202. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  203. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  204. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -4
  205. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  206. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +1 -1
  207. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js +2 -4
  208. package/dist/field/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +1 -1
  209. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +1 -1
  210. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js +2 -4
  211. package/dist/field/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +1 -1
  212. package/dist/field/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  213. package/dist/field/features/migrations/slateToLexical/converter/index.js +2 -1
  214. package/dist/field/features/migrations/slateToLexical/converter/index.js.map +1 -1
  215. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -3
  216. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  217. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -4
  218. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  219. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  220. package/dist/field/features/paragraph/feature.client.js +2 -4
  221. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  222. package/dist/field/features/relationship/drawer/commands.d.ts.map +1 -1
  223. package/dist/field/features/relationship/drawer/commands.js +1 -2
  224. package/dist/field/features/relationship/drawer/commands.js.map +1 -1
  225. package/dist/field/features/relationship/drawer/index.d.ts.map +1 -1
  226. package/dist/field/features/relationship/drawer/index.js +7 -13
  227. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  228. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  229. package/dist/field/features/relationship/feature.server.js +3 -2
  230. package/dist/field/features/relationship/feature.server.js.map +1 -1
  231. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +3 -8
  232. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  233. package/dist/field/features/relationship/nodes/RelationshipNode.js +8 -8
  234. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  235. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  236. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +54 -7
  237. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  238. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  239. package/dist/field/features/relationship/plugins/index.js +3 -6
  240. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  241. package/dist/field/features/relationship/populationPromise.js +7 -6
  242. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  243. package/dist/field/features/typeUtilities.d.ts +8 -0
  244. package/dist/field/features/typeUtilities.d.ts.map +1 -0
  245. package/dist/field/features/typeUtilities.js +8 -0
  246. package/dist/field/features/typeUtilities.js.map +1 -0
  247. package/dist/field/features/types.d.ts +57 -33
  248. package/dist/field/features/types.d.ts.map +1 -1
  249. package/dist/field/features/types.js.map +1 -1
  250. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.d.ts.map +1 -1
  251. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +5 -6
  252. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  253. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  254. package/dist/field/features/upload/component/index.js +55 -9
  255. package/dist/field/features/upload/component/index.js.map +1 -1
  256. package/dist/field/features/upload/drawer/commands.d.ts.map +1 -1
  257. package/dist/field/features/upload/drawer/commands.js +1 -2
  258. package/dist/field/features/upload/drawer/commands.js.map +1 -1
  259. package/dist/field/features/upload/drawer/index.d.ts.map +1 -1
  260. package/dist/field/features/upload/drawer/index.js +8 -12
  261. package/dist/field/features/upload/drawer/index.js.map +1 -1
  262. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  263. package/dist/field/features/upload/feature.server.js +39 -11
  264. package/dist/field/features/upload/feature.server.js.map +1 -1
  265. package/dist/field/features/upload/nodes/UploadNode.d.ts +2 -14
  266. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  267. package/dist/field/features/upload/nodes/UploadNode.js +6 -9
  268. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  269. package/dist/field/features/upload/plugin/index.d.ts +2 -2
  270. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  271. package/dist/field/features/upload/plugin/index.js +4 -9
  272. package/dist/field/features/upload/plugin/index.js.map +1 -1
  273. package/dist/field/features/upload/populationPromise.js +11 -8
  274. package/dist/field/features/upload/populationPromise.js.map +1 -1
  275. package/dist/field/features/upload/validate.d.ts +2 -1
  276. package/dist/field/features/upload/validate.d.ts.map +1 -1
  277. package/dist/field/features/upload/validate.js +34 -12
  278. package/dist/field/features/upload/validate.js.map +1 -1
  279. package/dist/field/index.d.ts +1 -1
  280. package/dist/field/index.d.ts.map +1 -1
  281. package/dist/field/index.js.map +1 -1
  282. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  283. package/dist/field/lexical/LexicalEditor.js +6 -11
  284. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  285. package/dist/field/lexical/LexicalProvider.d.ts +1 -1
  286. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  287. package/dist/field/lexical/LexicalProvider.js +1 -2
  288. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  289. package/dist/field/lexical/config/client/default.d.ts +1 -1
  290. package/dist/field/lexical/config/client/default.d.ts.map +1 -1
  291. package/dist/field/lexical/config/client/default.js.map +1 -1
  292. package/dist/field/lexical/config/client/sanitize.d.ts +1 -1
  293. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  294. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  295. package/dist/field/lexical/config/server/default.d.ts +2 -3
  296. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  297. package/dist/field/lexical/config/server/default.js +3 -3
  298. package/dist/field/lexical/config/server/default.js.map +1 -1
  299. package/dist/field/lexical/config/server/loader.d.ts +4 -2
  300. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  301. package/dist/field/lexical/config/server/loader.js +3 -2
  302. package/dist/field/lexical/config/server/loader.js.map +1 -1
  303. package/dist/field/lexical/config/server/sanitize.d.ts +2 -1
  304. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  305. package/dist/field/lexical/config/server/sanitize.js +23 -8
  306. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  307. package/dist/field/lexical/config/types.d.ts +1 -1
  308. package/dist/field/lexical/config/types.d.ts.map +1 -1
  309. package/dist/field/lexical/config/types.js.map +1 -1
  310. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.d.ts.map +1 -1
  311. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js +3 -6
  312. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarButton/index.js.map +1 -1
  313. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.d.ts.map +1 -1
  314. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js +3 -6
  315. package/dist/field/lexical/plugins/FloatingSelectToolbar/ToolbarDropdown/DropDown.js.map +1 -1
  316. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.d.ts.map +1 -1
  317. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js +27 -29
  318. package/dist/field/lexical/plugins/FloatingSelectToolbar/index.js.map +1 -1
  319. package/dist/field/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  320. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +1 -2
  321. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  322. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  323. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +3 -6
  324. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  325. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  326. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +3 -6
  327. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  328. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  329. package/dist/field/lexical/plugins/SlashMenu/index.js +1 -2
  330. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  331. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  332. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +13 -10
  333. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  334. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  335. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +1 -2
  336. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  337. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  338. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +10 -7
  339. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  340. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts +9 -0
  341. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -0
  342. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +35 -0
  343. package/dist/field/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -0
  344. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.d.ts.map +1 -1
  345. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js +1 -2
  346. package/dist/field/lexical/plugins/handles/utils/getTopLevelNodeKeys.js.map +1 -1
  347. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts +1 -1
  348. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  349. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +17 -7
  350. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  351. package/dist/field/lexical/theme/EditorTheme.scss +11 -8
  352. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  353. package/dist/field/lexical/ui/ContentEditable.js +1 -2
  354. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  355. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts +3 -0
  356. package/dist/field/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -0
  357. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +19 -0
  358. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -0
  359. package/dist/field/lexical/utils/getSelectedNode.d.ts.map +1 -1
  360. package/dist/field/lexical/utils/getSelectedNode.js +1 -2
  361. package/dist/field/lexical/utils/getSelectedNode.js.map +1 -1
  362. package/dist/field/lexical/utils/nodeFormat.d.ts +2 -1
  363. package/dist/field/lexical/utils/nodeFormat.d.ts.map +1 -1
  364. package/dist/field/lexical/utils/nodeFormat.js.map +1 -1
  365. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +1 -1
  366. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  367. package/dist/field/lexical/utils/setFloatingElemPosition.js +15 -13
  368. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  369. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  370. package/dist/field/lexical/utils/url.js +3 -0
  371. package/dist/field/lexical/utils/url.js.map +1 -1
  372. package/dist/forEachNodeRecursively.d.ts +10 -0
  373. package/dist/forEachNodeRecursively.d.ts.map +1 -0
  374. package/dist/forEachNodeRecursively.js +24 -0
  375. package/dist/forEachNodeRecursively.js.map +1 -0
  376. package/dist/generateComponentMap.d.ts.map +1 -1
  377. package/dist/generateComponentMap.js +16 -22
  378. package/dist/generateComponentMap.js.map +1 -1
  379. package/dist/generateSchemaMap.d.ts.map +1 -1
  380. package/dist/generateSchemaMap.js +4 -12
  381. package/dist/generateSchemaMap.js.map +1 -1
  382. package/dist/index.d.ts +6 -5
  383. package/dist/index.d.ts.map +1 -1
  384. package/dist/index.js +260 -173
  385. package/dist/index.js.map +1 -1
  386. package/dist/populate/defaultValue.d.ts.map +1 -1
  387. package/dist/populate/defaultValue.js +1 -0
  388. package/dist/populate/defaultValue.js.map +1 -1
  389. package/dist/populate/populate.d.ts +3 -3
  390. package/dist/populate/populate.d.ts.map +1 -1
  391. package/dist/populate/populate.js.map +1 -1
  392. package/dist/populate/populateLexicalPopulationPromises.d.ts +12 -0
  393. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -0
  394. package/dist/populate/populateLexicalPopulationPromises.js +35 -0
  395. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -0
  396. package/dist/populate/recurseNestedFields.d.ts +7 -4
  397. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  398. package/dist/populate/recurseNestedFields.js +3 -5
  399. package/dist/populate/recurseNestedFields.js.map +1 -1
  400. package/dist/scss/app.scss +2 -3
  401. package/dist/scss/vars.scss +0 -7
  402. package/dist/types.d.ts +11 -5
  403. package/dist/types.d.ts.map +1 -1
  404. package/dist/types.js.map +1 -1
  405. package/dist/validate/index.d.ts +1 -1
  406. package/dist/validate/index.d.ts.map +1 -1
  407. package/package.json +47 -46
  408. package/components.d.ts +0 -6
  409. package/components.js +0 -7
  410. package/dist/populate/richTextRelationshipPromise.d.ts +0 -23
  411. package/dist/populate/richTextRelationshipPromise.d.ts.map +0 -1
  412. package/dist/populate/richTextRelationshipPromise.js +0 -68
  413. package/dist/populate/richTextRelationshipPromise.js.map +0 -1
  414. package/dist/scss/fonts.scss +0 -75
  415. package/src/index.ts +0 -423
@@ -6,14 +6,14 @@ import type { SerializedLexicalNode } from 'lexical';
6
6
  import type { LexicalNodeReplacement } from 'lexical';
7
7
  import type { RequestContext } from 'payload';
8
8
  import type { SanitizedConfig } from 'payload/config';
9
- import type { Field, PayloadRequest, RichTextField, ValidateOptions } from 'payload/types';
9
+ import type { Field, PayloadRequestWithData, ReplaceAny, RichTextField, ValidateOptions } from 'payload/types';
10
10
  import type React from 'react';
11
11
  import type { AdapterProps } from '../../types.js';
12
12
  import type { ClientEditorConfig, ServerEditorConfig } from '../lexical/config/types.js';
13
13
  import type { FloatingToolbarSection } from '../lexical/plugins/FloatingSelectToolbar/types.js';
14
14
  import type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js';
15
15
  import type { HTMLConverter } from './converters/html/converter/types.js';
16
- export type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({ context, currentDepth, depth, editorPopulationPromises, field, findMany, flattenLocales, node, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc, }: {
16
+ export type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({ context, currentDepth, depth, editorPopulationPromises, field, fieldPromises, findMany, flattenLocales, node, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc, }: {
17
17
  context: RequestContext;
18
18
  currentDepth: number;
19
19
  depth: number;
@@ -22,15 +22,19 @@ export type PopulationPromise<T extends SerializedLexicalNode = SerializedLexica
22
22
  */
23
23
  editorPopulationPromises: Map<string, Array<PopulationPromise>>;
24
24
  field: RichTextField<SerializedEditorState, AdapterProps>;
25
+ /**
26
+ * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises
27
+ */
28
+ fieldPromises: Promise<void>[];
25
29
  findMany: boolean;
26
30
  flattenLocales: boolean;
27
31
  node: T;
28
32
  overrideAccess: boolean;
29
33
  populationPromises: Promise<void>[];
30
- req: PayloadRequest;
34
+ req: PayloadRequestWithData;
31
35
  showHiddenFields: boolean;
32
36
  siblingDoc: Record<string, unknown>;
33
- }) => Promise<void>[];
37
+ }) => void;
34
38
  export type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({ node, nodeValidations, validation, }: {
35
39
  node: T;
36
40
  nodeValidations: Map<string, Array<NodeValidation>>;
@@ -47,12 +51,16 @@ export type FeatureProviderServer<ServerFeatureProps, ClientFeatureProps> = {
47
51
  dependenciesPriority?: string[];
48
52
  /** Keys of soft-dependencies needed for this feature. The FeatureProviders dependencies are optional, but are considered as last-priority in the loading process */
49
53
  dependenciesSoft?: string[];
54
+ /**
55
+ * This is being called during the payload sanitization process
56
+ */
50
57
  feature: (props: {
58
+ config: SanitizedConfig;
51
59
  /** unSanitizedEditorConfig.features, but mapped */
52
60
  featureProviderMap: ServerFeatureProviderMap;
53
61
  resolvedFeatures: ResolvedServerFeatureMap;
54
62
  unSanitizedEditorConfig: ServerEditorConfig;
55
- }) => ServerFeature<ServerFeatureProps, ClientFeatureProps>;
63
+ }) => Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>> | ServerFeature<ServerFeatureProps, ClientFeatureProps>;
56
64
  key: string;
57
65
  /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */
58
66
  serverFeatureProps: ServerFeatureProps;
@@ -119,6 +127,37 @@ export type ClientComponentProps<ClientFeatureProps> = ClientFeatureProps & {
119
127
  featureKey: string;
120
128
  order: number;
121
129
  };
130
+ export type FieldNodeHookArgs<T extends SerializedLexicalNode> = {
131
+ context: RequestContext;
132
+ /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */
133
+ findMany?: boolean;
134
+ /** The value of the field. */
135
+ node?: T;
136
+ /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */
137
+ operation?: 'create' | 'delete' | 'read' | 'update';
138
+ overrideAccess?: boolean;
139
+ /** The Express request object. It is mocked for Local API operations. */
140
+ req: PayloadRequestWithData;
141
+ };
142
+ export type FieldNodeHook<T extends SerializedLexicalNode> = (args: FieldNodeHookArgs<T>) => Promise<T> | T;
143
+ export type NodeWithHooks<T extends LexicalNode = any> = {
144
+ converters?: {
145
+ html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>;
146
+ };
147
+ hooks?: {
148
+ afterChange?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
149
+ afterRead?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
150
+ beforeChange?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
151
+ /**
152
+ * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.
153
+ */
154
+ beforeDuplicate?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
155
+ beforeValidate?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
156
+ };
157
+ node: Klass<T> | LexicalNodeReplacement;
158
+ populationPromises?: Array<PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
159
+ validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
160
+ };
122
161
  export type ServerFeature<ServerProps, ClientFeatureProps> = {
123
162
  ClientComponent?: React.FC<ClientComponentProps<ClientFeatureProps>>;
124
163
  /**
@@ -142,11 +181,7 @@ export type ServerFeature<ServerProps, ClientFeatureProps> = {
142
181
  props: ServerProps;
143
182
  schemaMap: Map<string, Field[]>;
144
183
  schemaPath: string;
145
- }) => {
146
- [key: string]: Field[];
147
- } | Promise<{
148
- [key: string]: Field[];
149
- }>;
184
+ }) => Map<string, Field[]> | null;
150
185
  generatedTypes?: {
151
186
  modifyOutputSchema: ({ collectionIDFieldTypes, config, currentSchema, field, interfaceNameDefinitions, isRequired, }: {
152
187
  collectionIDFieldTypes: {
@@ -165,22 +200,8 @@ export type ServerFeature<ServerProps, ClientFeatureProps> = {
165
200
  isRequired: boolean;
166
201
  }) => JSONSchema4;
167
202
  };
168
- hooks?: {
169
- afterReadPromise?: ({ field, incomingEditorState, siblingDoc, }: {
170
- field: RichTextField<SerializedEditorState, AdapterProps>;
171
- incomingEditorState: SerializedEditorState;
172
- siblingDoc: Record<string, unknown>;
173
- }) => Promise<void> | null;
174
- };
175
203
  markdownTransformers?: Transformer[];
176
- nodes?: Array<{
177
- converters?: {
178
- html?: HTMLConverter;
179
- };
180
- node: Klass<LexicalNode> | LexicalNodeReplacement;
181
- populationPromises?: Array<PopulationPromise>;
182
- validations?: Array<NodeValidation>;
183
- }>;
204
+ nodes?: Array<NodeWithHooks>;
184
205
  /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */
185
206
  serverFeatureProps: ServerProps;
186
207
  };
@@ -240,14 +261,17 @@ export type SanitizedServerFeatures = Required<Pick<ResolvedServerFeature<unknow
240
261
  isRequired: boolean;
241
262
  }) => JSONSchema4>;
242
263
  };
243
- hooks: {
244
- afterReadPromises: Array<({ field, incomingEditorState, siblingDoc, }: {
245
- field: RichTextField<SerializedEditorState, AdapterProps>;
246
- incomingEditorState: SerializedEditorState;
247
- siblingDoc: Record<string, unknown>;
248
- }) => Promise<void> | null>;
249
- };
250
- /** The node types mapped to their populationPromises */
264
+ /** The node types mapped to their hooks */
265
+ hooks?: {
266
+ afterChange?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
267
+ afterRead?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
268
+ beforeChange?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
269
+ /**
270
+ * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.
271
+ */
272
+ beforeDuplicate?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
273
+ beforeValidate?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>;
274
+ }; /** The node types mapped to their populationPromises */
251
275
  populationPromises: Map<string, Array<PopulationPromise>>;
252
276
  /** The node types mapped to their validations */
253
277
  validations: Map<string, Array<NodeValidation>>;
@@ -1 +1 @@
1
- {"version":3,"file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;IACF,uCAAuC;IACvC,eAAe,EAAE,MAAM,EAAE,CAAA;IACzB,qBAAqB,EAAE;QACrB,QAAQ,EAAE,sBAAsB,EAAE,CAAA;KACnC,CAAA;IACD,KAAK,EAAE;QACL,IAAI,EAAE,KAAK,CACT,CAAC,EACC,mBAAmB,GACpB,EAAE;YACD,mBAAmB,EAAE,qBAAqB,CAAA;SAC3C,KAAK,qBAAqB,CAC5B,CAAA;QACD,IAAI,EAAE,KAAK,CACT,CAAC,EACC,mBAAmB,GACpB,EAAE;YACD,mBAAmB,EAAE,qBAAqB,CAAA;SAC3C,KAAK,qBAAqB,CAC5B,CAAA;KACF,CAAA;IACD,OAAO,CAAC,EAAE,KAAK,CAAC,eAAe,CAAC,CAAA;IAChC,SAAS,EAAE;QACT,cAAc,EAAE,KAAK,CACnB,CAAC,EAAE,MAAM,EAAE,WAAW,EAAE,EAAE;YAAE,MAAM,EAAE,aAAa,CAAC;YAAC,WAAW,EAAE,MAAM,CAAA;SAAE,KAAK,cAAc,EAAE,CAC9F,CAAA;QACD,iBAAiB,EAAE,cAAc,EAAE,CAAA;KACpC,CAAA;CACF,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/field/features/types.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { Klass, LexicalEditor, LexicalNode, SerializedEditorState } from 'lexical'\nimport type { SerializedLexicalNode } from 'lexical'\nimport type { LexicalNodeReplacement } from 'lexical'\nimport type { RequestContext } from 'payload'\nimport type { SanitizedConfig } from 'payload/config'\nimport type { Field, PayloadRequest, RichTextField, ValidateOptions } from 'payload/types'\nimport type React from 'react'\n\nimport type { AdapterProps } from '../../types.js'\nimport type { ClientEditorConfig, ServerEditorConfig } from '../lexical/config/types.js'\nimport type { FloatingToolbarSection } from '../lexical/plugins/FloatingSelectToolbar/types.js'\nimport type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport type { HTMLConverter } from './converters/html/converter/types.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n context,\n currentDepth,\n depth,\n editorPopulationPromises,\n field,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: {\n context: RequestContext\n currentDepth: number\n depth: number\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: RichTextField<SerializedEditorState, AdapterProps>\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: Record<string, unknown>\n}) => Promise<void>[]\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<ServerFeatureProps, ClientFeatureProps> = (\n props?: ServerFeatureProps,\n) => FeatureProviderServer<ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<ServerFeatureProps, ClientFeatureProps> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first and are available in the `feature` property*/\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. The FeatureProviders dependencies are optional, but are considered as last-priority in the loading process */\n dependenciesSoft?: string[]\n\n feature: (props: {\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) => ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: ServerFeatureProps\n}\n\nexport type FeatureProviderProviderClient<ClientFeatureProps> = (\n props?: ClientComponentProps<ClientFeatureProps>,\n) => FeatureProviderClient<ClientFeatureProps>\n\n/**\n * No dependencies => Features need to be sorted on the server first, then sent to client in right order\n */\nexport type FeatureProviderClient<ClientFeatureProps> = {\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n clientFeatureProps: ClientComponentProps<ClientFeatureProps>\n feature: (props: {\n clientFunctions: Record<string, any>\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ClientFeatureProviderMap\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedClientFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ClientEditorConfig\n }) => ClientFeature<ClientFeatureProps>\n}\n\nexport type ClientFeature<ClientFeatureProps> = {\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n clientFeatureProps: ClientComponentProps<ClientFeatureProps>\n\n floatingSelectToolbar?: {\n sections: FloatingToolbarSection[]\n }\n hooks?: {\n load?: ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n save?: ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n }\n markdownTransformers?: Transformer[]\n nodes?: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n plugins?: Array<\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC<{ anchorElem: HTMLElement }>\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n >\n slashMenu?: {\n dynamicOptions?: ({\n editor,\n queryString,\n }: {\n editor: LexicalEditor\n queryString: string\n }) => SlashMenuGroup[]\n options?: SlashMenuGroup[]\n }\n}\n\nexport type ClientComponentProps<ClientFeatureProps> = ClientFeatureProps & {\n featureKey: string\n order: number\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientComponent?: React.FC<ClientComponentProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n generateComponentMap?: (args: {\n config: SanitizedConfig\n i18n: I18n\n props: ServerProps\n schemaPath: string\n }) => {\n [key: string]: React.FC<{ componentKey: string; featureKey: string }>\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n i18n: I18n\n props: ServerProps\n schemaMap: Map<string, Field[]>\n schemaPath: string\n }) =>\n | {\n [key: string]: Field[]\n }\n | Promise<{\n [key: string]: Field[]\n }>\n generatedTypes?: {\n modifyOutputSchema: ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n hooks?: {\n afterReadPromise?: ({\n field,\n incomingEditorState,\n siblingDoc,\n }: {\n field: RichTextField<SerializedEditorState, AdapterProps>\n incomingEditorState: SerializedEditorState\n siblingDoc: Record<string, unknown>\n }) => Promise<void> | null\n }\n markdownTransformers?: Transformer[]\n nodes?: Array<{\n converters?: {\n html?: HTMLConverter\n }\n node: Klass<LexicalNode> | LexicalNodeReplacement\n populationPromises?: Array<PopulationPromise>\n validations?: Array<NodeValidation>\n }>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = ServerFeature<\n ServerProps,\n ClientFeatureProps\n> &\n Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n > & {\n order: number\n }\n\nexport type ResolvedClientFeature<ClientFeatureProps> = ClientFeature<ClientFeatureProps> & {\n key: string\n order: number\n}\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<unknown, unknown>>\nexport type ResolvedClientFeatureMap = Map<string, ResolvedClientFeature<unknown>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<unknown, unknown>>\nexport type ClientFeatureProviderMap = Map<string, FeatureProviderClient<unknown>>\n\nexport type SanitizedPlugin =\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n key: string\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n key: string\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n key: string\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC<{ anchorElem: HTMLElement }>\n desktopOnly?: boolean\n key: string\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n\nexport type SanitizedServerFeatures = Required<\n Pick<ResolvedServerFeature<unknown, unknown>, 'markdownTransformers' | 'nodes'>\n> & {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n hooks: {\n afterReadPromises: Array<\n ({\n field,\n incomingEditorState,\n siblingDoc,\n }: {\n field: RichTextField<SerializedEditorState, AdapterProps>\n incomingEditorState: SerializedEditorState\n siblingDoc: Record<string, unknown>\n }) => Promise<void> | null\n >\n }\n /** The node types mapped to their populationPromises */\n populationPromises: Map<string, Array<PopulationPromise>>\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n}\n\nexport type SanitizedClientFeatures = Required<\n Pick<ResolvedClientFeature<unknown>, 'markdownTransformers' | 'nodes'>\n> & {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n floatingSelectToolbar: {\n sections: FloatingToolbarSection[]\n }\n hooks: {\n load: Array<\n ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n >\n save: Array<\n ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n >\n }\n plugins?: Array<SanitizedPlugin>\n slashMenu: {\n dynamicOptions: Array<\n ({ editor, queryString }: { editor: LexicalEditor; queryString: string }) => SlashMenuGroup[]\n >\n groupsWithOptions: SlashMenuGroup[]\n }\n}\n"],"names":[],"rangeMappings":"","mappings":"AAgWA,WA+BC"}
1
+ {"version":3,"sources":["../../../src/field/features/types.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { I18n } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type { Klass, LexicalEditor, LexicalNode, SerializedEditorState } from 'lexical'\nimport type { SerializedLexicalNode } from 'lexical'\nimport type { LexicalNodeReplacement } from 'lexical'\nimport type { RequestContext } from 'payload'\nimport type { SanitizedConfig } from 'payload/config'\nimport type {\n Field,\n PayloadRequestWithData,\n ReplaceAny,\n RichTextField,\n ValidateOptions,\n} from 'payload/types'\nimport type React from 'react'\n\nimport type { AdapterProps } from '../../types.js'\nimport type { ClientEditorConfig, ServerEditorConfig } from '../lexical/config/types.js'\nimport type { FloatingToolbarSection } from '../lexical/plugins/FloatingSelectToolbar/types.js'\nimport type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport type { HTMLConverter } from './converters/html/converter/types.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n context,\n currentDepth,\n depth,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: {\n context: RequestContext\n currentDepth: number\n depth: number\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequestWithData\n showHiddenFields: boolean\n siblingDoc: Record<string, unknown>\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<ServerFeatureProps, ClientFeatureProps> = (\n props?: ServerFeatureProps,\n) => FeatureProviderServer<ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<ServerFeatureProps, ClientFeatureProps> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first and are available in the `feature` property*/\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. The FeatureProviders dependencies are optional, but are considered as last-priority in the loading process */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature: (props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: ServerFeatureProps\n}\n\nexport type FeatureProviderProviderClient<ClientFeatureProps> = (\n props?: ClientComponentProps<ClientFeatureProps>,\n) => FeatureProviderClient<ClientFeatureProps>\n\n/**\n * No dependencies => Features need to be sorted on the server first, then sent to client in right order\n */\nexport type FeatureProviderClient<ClientFeatureProps> = {\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n clientFeatureProps: ClientComponentProps<ClientFeatureProps>\n feature: (props: {\n clientFunctions: Record<string, any>\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ClientFeatureProviderMap\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedClientFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ClientEditorConfig\n }) => ClientFeature<ClientFeatureProps>\n}\n\nexport type ClientFeature<ClientFeatureProps> = {\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n clientFeatureProps: ClientComponentProps<ClientFeatureProps>\n\n floatingSelectToolbar?: {\n sections: FloatingToolbarSection[]\n }\n hooks?: {\n load?: ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n save?: ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n }\n markdownTransformers?: Transformer[]\n nodes?: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n plugins?: Array<\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC<{ anchorElem: HTMLElement }>\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n >\n slashMenu?: {\n dynamicOptions?: ({\n editor,\n queryString,\n }: {\n editor: LexicalEditor\n queryString: string\n }) => SlashMenuGroup[]\n options?: SlashMenuGroup[]\n }\n}\n\nexport type ClientComponentProps<ClientFeatureProps> = ClientFeatureProps & {\n featureKey: string\n order: number\n}\n\nexport type FieldNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany?: boolean\n /** The value of the field. */\n node?: T\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation?: 'create' | 'delete' | 'read' | 'update'\n overrideAccess?: boolean\n /** The Express request object. It is mocked for Local API operations. */\n req: PayloadRequestWithData\n}\n\nexport type FieldNodeHook<T extends SerializedLexicalNode> = (\n args: FieldNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n converters?: {\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n hooks?: {\n afterChange?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n /**\n * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.\n */\n beforeDuplicate?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<FieldNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n }\n node: Klass<T> | LexicalNodeReplacement\n populationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientComponent?: React.FC<ClientComponentProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n generateComponentMap?: (args: {\n config: SanitizedConfig\n i18n: I18n\n props: ServerProps\n schemaPath: string\n }) => {\n [key: string]: React.FC<{ componentKey: string; featureKey: string }>\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n i18n: I18n\n props: ServerProps\n schemaMap: Map<string, Field[]>\n schemaPath: string\n }) => Map<string, Field[]> | null\n generatedTypes?: {\n modifyOutputSchema: ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n markdownTransformers?: Transformer[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = ServerFeature<\n ServerProps,\n ClientFeatureProps\n> &\n Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n > & {\n order: number\n }\n\nexport type ResolvedClientFeature<ClientFeatureProps> = ClientFeature<ClientFeatureProps> & {\n key: string\n order: number\n}\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<unknown, unknown>>\nexport type ResolvedClientFeatureMap = Map<string, ResolvedClientFeature<unknown>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<unknown, unknown>>\nexport type ClientFeatureProviderMap = Map<string, FeatureProviderClient<unknown>>\n\nexport type SanitizedPlugin =\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n key: string\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n key: string\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC\n key: string\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: React.FC<{ anchorElem: HTMLElement }>\n desktopOnly?: boolean\n key: string\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n\nexport type SanitizedServerFeatures = Required<\n Pick<ResolvedServerFeature<unknown, unknown>, 'markdownTransformers' | 'nodes'>\n> & {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n hooks?: {\n afterChange?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>\n /**\n * Runs before a document is duplicated to prevent errors in unique fields or return null to use defaultValue.\n */\n beforeDuplicate?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<FieldNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n populationPromises: Map<string, Array<PopulationPromise>>\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n}\n\nexport type SanitizedClientFeatures = Required<\n Pick<ResolvedClientFeature<unknown>, 'markdownTransformers' | 'nodes'>\n> & {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n floatingSelectToolbar: {\n sections: FloatingToolbarSection[]\n }\n hooks: {\n load: Array<\n ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n >\n save: Array<\n ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n >\n }\n plugins?: Array<SanitizedPlugin>\n slashMenu: {\n dynamicOptions: Array<\n ({ editor, queryString }: { editor: LexicalEditor; queryString: string }) => SlashMenuGroup[]\n >\n groupsWithOptions: SlashMenuGroup[]\n }\n}\n"],"names":[],"rangeMappings":"","mappings":"AA8XA,WA+BC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/upload/component/ExtraFieldsDrawer/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAa,MAAM,eAAe,CAAA;AAoBtE,OAAO,KAA2C,MAAM,OAAO,CAAA;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAC5C,YAAY,GAAG;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,sBAAsB,CAAA;CAC1C,CAkHF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/upload/component/ExtraFieldsDrawer/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,sBAAsB,EAAa,MAAM,eAAe,CAAA;AAgBtE,OAAO,KAA2C,MAAM,OAAO,CAAA;AAI/D,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAI/C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAC5C,YAAY,GAAG;IACb,UAAU,EAAE,MAAM,CAAA;IAClB,iBAAiB,EAAE,sBAAsB,CAAA;CAC1C,CAkHF,CAAA"}
@@ -1,10 +1,7 @@
1
1
  'use client';
2
2
  import * as facelessUIImport from '@faceless-ui/modal';
3
- import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js';
4
- const { useLexicalComposerContext } = lexicalComposerContextImport;
3
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
5
4
  import { getTranslation } from '@payloadcms/translations';
6
- import lexicalImport from 'lexical';
7
- const { $getNodeByKey } = lexicalImport;
8
5
  import { Drawer } from '@payloadcms/ui/elements/Drawer';
9
6
  import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
10
7
  import { Form } from '@payloadcms/ui/forms/Form';
@@ -14,6 +11,7 @@ import { useConfig } from '@payloadcms/ui/providers/Config';
14
11
  import { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo';
15
12
  import { useTranslation } from '@payloadcms/ui/providers/Translation';
16
13
  import { getFormState } from '@payloadcms/ui/utilities/getFormState';
14
+ import { $getNodeByKey } from 'lexical';
17
15
  import { deepCopyObject } from 'payload/utilities';
18
16
  import React, { useCallback, useEffect, useState } from 'react';
19
17
  import { v4 as uuid } from 'uuid';
@@ -116,9 +114,10 @@ import { useEditorConfigContext } from '../../../../lexical/config/client/Editor
116
114
  }, /*#__PURE__*/ React.createElement(RenderFields, {
117
115
  fieldMap: Array.isArray(fieldMap) ? fieldMap : [],
118
116
  forceRender: true,
119
- path: "",
117
+ path: "" // See Blocks feature path for details as for why this is empty
118
+ ,
120
119
  readOnly: false,
121
- schemaPath: ""
120
+ schemaPath: schemaFieldsPath
122
121
  }), /*#__PURE__*/ React.createElement(FormSubmit, null, t('fields:saveChanges'))));
123
122
  };
124
123
 
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/upload/component/ExtraFieldsDrawer/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, FormState } from 'payload/types'\n\nimport * as facelessUIImport from '@faceless-ui/modal'\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport { getTranslation } from '@payloadcms/translations'\nimport lexicalImport from 'lexical'\nconst { $getNodeByKey } = lexicalImport\nimport type { FormProps } from '@payloadcms/ui/forms/Form'\n\nimport { Drawer } from '@payloadcms/ui/elements/Drawer'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { Form } from '@payloadcms/ui/forms/Form'\nimport { RenderFields } from '@payloadcms/ui/forms/RenderFields'\nimport { FormSubmit } from '@payloadcms/ui/forms/Submit'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { getFormState } from '@payloadcms/ui/utilities/getFormState'\nimport { deepCopyObject } from 'payload/utilities'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { UploadData, UploadNode } from '../../nodes/UploadNode.js'\nimport type { ElementProps } from '../index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\n\n/**\n * This handles the extra fields, e.g. captions or alt text, which are\n * potentially added to the upload feature.\n */\nexport const ExtraFieldsUploadDrawer: React.FC<\n ElementProps & {\n drawerSlug: string\n relatedCollection: ClientCollectionConfig\n }\n> = (props) => {\n const { useModal } = facelessUIImport\n\n const {\n data: { fields, relationTo, value },\n drawerSlug,\n nodeKey,\n relatedCollection,\n } = props\n\n const [editor] = useLexicalComposerContext()\n\n const { closeModal } = useModal()\n\n const { i18n, t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.upload.fields.${relatedCollection.slug}`\n const schemaFieldsPath = `${schemaPath}.feature.upload.${relatedCollection.slug}`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: deepCopyObject(fields || {}),\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, fields])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n const handleUpdateEditData = useCallback(\n (_, data) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: UploadNode | null = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n\n closeModal(drawerSlug)\n },\n [closeModal, editor, drawerSlug, nodeKey],\n )\n\n return (\n <Drawer\n slug={drawerSlug}\n title={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n >\n {initialState !== false && (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n // @ts-expect-error TODO: Fix this\n fields={fieldMap}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleUpdateEditData}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\"\n readOnly={false}\n schemaPath=\"\"\n />\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )}\n </Drawer>\n )\n}\n"],"names":["facelessUIImport","lexicalComposerContextImport","useLexicalComposerContext","getTranslation","lexicalImport","$getNodeByKey","Drawer","useFieldProps","Form","RenderFields","FormSubmit","useConfig","useDocumentInfo","useTranslation","getFormState","deepCopyObject","React","useCallback","useEffect","useState","v4","uuid","useEditorConfigContext","ExtraFieldsUploadDrawer","props","useModal","data","fields","relationTo","value","drawerSlug","nodeKey","relatedCollection","editor","closeModal","i18n","t","id","schemaPath","config","initialState","setInitialState","field","richTextComponentMap","componentMapRenderedFieldsPath","slug","schemaFieldsPath","fieldMap","get","awaitInitialState","state","apiRoute","routes","api","body","operation","serverURL","onChange","formState","prevFormState","handleUpdateEditData","_","update","uploadNode","newData","getData","setData","title","label","labels","singular","beforeSubmit","disableValidationOnSubmit","onSubmit","Array","isArray","forceRender","path","readOnly"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,YAAYA,sBAAsB,qBAAoB;AACtD,OAAOC,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,SAASE,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAE,GAAGD;AAG1B,SAASE,MAAM,QAAQ,iCAAgC;AACvD,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,IAAI,QAAQ,4BAA2B;AAChD,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,UAAU,QAAQ,8BAA6B;AACxD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,eAAe,QAAQ,wCAAuC;A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AAK;QACLC,UAAU;QACVxC,YAAW;sBAEb,oBAAC5B,kBAAY0B,EAAE;AAKzB,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/upload/component/ExtraFieldsDrawer/index.tsx"],"sourcesContent":["'use client'\nimport type { FormProps } from '@payloadcms/ui/forms/Form'\nimport type { ClientCollectionConfig, FormState } from 'payload/types'\n\nimport * as facelessUIImport from '@faceless-ui/modal'\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Drawer } from '@payloadcms/ui/elements/Drawer'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { Form } from '@payloadcms/ui/forms/Form'\nimport { RenderFields } from '@payloadcms/ui/forms/RenderFields'\nimport { FormSubmit } from '@payloadcms/ui/forms/Submit'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useDocumentInfo } from '@payloadcms/ui/providers/DocumentInfo'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport { getFormState } from '@payloadcms/ui/utilities/getFormState'\nimport { $getNodeByKey } from 'lexical'\nimport { deepCopyObject } from 'payload/utilities'\nimport React, { useCallback, useEffect, useState } from 'react'\nimport { v4 as uuid } from 'uuid'\n\nimport type { UploadData, UploadNode } from '../../nodes/UploadNode.js'\nimport type { ElementProps } from '../index.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\n\n/**\n * This handles the extra fields, e.g. captions or alt text, which are\n * potentially added to the upload feature.\n */\nexport const ExtraFieldsUploadDrawer: React.FC<\n ElementProps & {\n drawerSlug: string\n relatedCollection: ClientCollectionConfig\n }\n> = (props) => {\n const { useModal } = facelessUIImport\n\n const {\n data: { fields, relationTo, value },\n drawerSlug,\n nodeKey,\n relatedCollection,\n } = props\n\n const [editor] = useLexicalComposerContext()\n\n const { closeModal } = useModal()\n\n const { i18n, t } = useTranslation()\n const { id } = useDocumentInfo()\n const { schemaPath } = useFieldProps()\n const config = useConfig()\n const [initialState, setInitialState] = useState<FormState | false>(false)\n const {\n field: { richTextComponentMap },\n } = useEditorConfigContext()\n\n const componentMapRenderedFieldsPath = `feature.upload.fields.${relatedCollection.slug}`\n const schemaFieldsPath = `${schemaPath}.feature.upload.${relatedCollection.slug}`\n\n const fieldMap = richTextComponentMap.get(componentMapRenderedFieldsPath) // Field Schema\n\n useEffect(() => {\n const awaitInitialState = async () => {\n const state = await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n data: deepCopyObject(fields || {}),\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n }) // Form State\n\n setInitialState(state)\n }\n\n void awaitInitialState()\n }, [config.routes.api, config.serverURL, schemaFieldsPath, id, fields])\n\n const onChange: FormProps['onChange'][0] = useCallback(\n async ({ formState: prevFormState }) => {\n return await getFormState({\n apiRoute: config.routes.api,\n body: {\n id,\n formState: prevFormState,\n operation: 'update',\n schemaPath: schemaFieldsPath,\n },\n serverURL: config.serverURL,\n })\n },\n\n [config.routes.api, config.serverURL, schemaFieldsPath, id],\n )\n\n const handleUpdateEditData = useCallback(\n (_, data) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: UploadNode | null = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n\n closeModal(drawerSlug)\n },\n [closeModal, editor, drawerSlug, nodeKey],\n )\n\n return (\n <Drawer\n slug={drawerSlug}\n title={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n >\n {initialState !== false && (\n <Form\n beforeSubmit={[onChange]}\n disableValidationOnSubmit\n // @ts-expect-error TODO: Fix this\n fields={fieldMap}\n initialState={initialState}\n onChange={[onChange]}\n onSubmit={handleUpdateEditData}\n uuid={uuid()}\n >\n <RenderFields\n fieldMap={Array.isArray(fieldMap) ? fieldMap : []}\n forceRender\n path=\"\" // See Blocks feature path for details as for why this is empty\n readOnly={false}\n schemaPath={schemaFieldsPath}\n />\n <FormSubmit>{t('fields:saveChanges')}</FormSubmit>\n </Form>\n )}\n </Drawer>\n )\n}\n"],"names":["facelessUIImport","useLexicalComposerContext","getTranslation","Drawer","useFieldProps","Form","RenderFields","FormSubmit","useConfig","useDocumentInfo","useTranslation","getFormState","$getNodeByKey","deepCopyObject","React","useCallback","useEffect","useState","v4","uuid","useEditorConfigContext","ExtraFieldsUploadDrawer","props","useModal","data","fields","relationTo","value","drawerSlug","nodeKey","relatedCollection","editor","closeModal","i18n","t","id","schemaPath","config","initialState","setInitialState","field","richTextComponentMap","componentMapRenderedFieldsPath","slug","schemaFieldsPath","fieldMap","get","awaitInitialState","state","apiRoute","routes","api","body","operation","serverURL","onChange","formState","prevFormState","handleUpdateEditData","_","update","uploadNode","newData","getData","setData","title","label","labels","singular","beforeSubmit","disableValidationOnSubmit","onSubmit","Array","isArray","forceRender","path","readOnly"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,YAAYA,sBAAsB,qBAAoB;AACtD,SAASC,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,cAAc,QAAQ,2BAA0B;AACzD,SAASC,MAAM,QAAQ,iCAAgC;AACvD,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,IAAI,QAAQ,4BAA2B;AAChD,SAASC,YAAY,QAAQ,oCAAmC;AAChE,SAASC,UAAU,QAAQ,8BAA6B;AACxD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,eAAe,QAAQ,wCAAuC;AACvE,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SAASC,YAAY,QAAQ,wCAAuC;AACpE,SAASC,aAAa,QAAQ,UAAS;AACvC,SAASC,cAAc,QAAQ,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}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/upload/component/index.tsx"],"names":[],"mappings":"AAkBA,OAAO,KAA4C,MAAM,OAAO,CAAA;AAIhE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAMxD,OAAO,cAAc,CAAA;AAQrB,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAEhB,CAAA;AAkJD,eAAO,MAAM,eAAe,UAAW,YAAY,KAAG,MAAM,SAM3D,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/upload/component/index.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAA+D,MAAM,OAAO,CAAA;AAInF,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAOxD,OAAO,cAAc,CAAA;AAQrB,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAgMD,eAAO,MAAM,eAAe,UAAW,YAAY,KAAG,MAAM,SAM3D,CAAA"}
@@ -1,10 +1,8 @@
1
1
  'use client';
2
- import lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js';
3
- const { useLexicalComposerContext } = lexicalComposerContextImport;
2
+ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
4
3
  import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js';
4
+ import { mergeRegister } from '@lexical/utils';
5
5
  import { getTranslation } from '@payloadcms/translations';
6
- import lexicalImport from 'lexical';
7
- const { $getNodeByKey } = lexicalImport;
8
6
  import { Button } from '@payloadcms/ui/elements/Button';
9
7
  import { useDocumentDrawer } from '@payloadcms/ui/elements/DocumentDrawer';
10
8
  import { DrawerToggler } from '@payloadcms/ui/elements/Drawer';
@@ -13,10 +11,12 @@ import { File } from '@payloadcms/ui/graphics/File';
13
11
  import usePayloadAPI from '@payloadcms/ui/hooks/usePayloadAPI';
14
12
  import { useConfig } from '@payloadcms/ui/providers/Config';
15
13
  import { useTranslation } from '@payloadcms/ui/providers/Translation';
16
- import React, { useCallback, useReducer, useState } from 'react';
14
+ import { $getNodeByKey, $getSelection, $isNodeSelection, CLICK_COMMAND, COMMAND_PRIORITY_LOW, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND } from 'lexical';
15
+ import React, { useCallback, useEffect, useReducer, useRef, useState } from 'react';
17
16
  import { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js';
18
17
  import { EnabledRelationshipsCondition } from '../../relationship/utils/EnabledRelationshipsCondition.js';
19
18
  import { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js';
19
+ import { $isUploadNode } from '../nodes/UploadNode.js';
20
20
  import { ExtraFieldsUploadDrawer } from './ExtraFieldsDrawer/index.js';
21
21
  import './index.scss';
22
22
  const baseClass = 'lexical-upload';
@@ -26,6 +26,7 @@ const initialParams = {
26
26
  const Component = (props)=>{
27
27
  const { data: { fields, relationTo, value }, nodeKey } = props;
28
28
  const { collections, routes: { api }, serverURL } = useConfig();
29
+ const uploadRef = useRef(null);
29
30
  const [editor] = useLexicalComposerContext();
30
31
  const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
31
32
  const { editorConfig, field } = useEditorConfigContext();
@@ -34,11 +35,11 @@ const Component = (props)=>{
34
35
  const [relatedCollection, setRelatedCollection] = useState(()=>collections.find((coll)=>coll.slug === relationTo));
35
36
  const drawerSlug = useDrawerSlug('upload-drawer');
36
37
  const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({
37
- id: value?.id,
38
+ id: value,
38
39
  collectionSlug: relatedCollection.slug
39
40
  });
40
41
  // Get the referenced document
41
- const [{ data }, { setParams }] = usePayloadAPI(`${serverURL}${api}/${relatedCollection.slug}/${value?.id}`, {
42
+ const [{ data }, { setParams }] = usePayloadAPI(`${serverURL}${api}/${relatedCollection.slug}/${value}`, {
42
43
  initialParams
43
44
  });
44
45
  const thumbnailSRC = data?.thumbnailURL || data?.url;
@@ -62,13 +63,58 @@ const Component = (props)=>{
62
63
  cacheBust,
63
64
  closeDrawer
64
65
  ]);
66
+ const onDelete = useCallback((payload)=>{
67
+ if (isSelected && $isNodeSelection($getSelection())) {
68
+ const event = payload;
69
+ event.preventDefault();
70
+ const node = $getNodeByKey(nodeKey);
71
+ if ($isUploadNode(node)) {
72
+ node.remove();
73
+ return true;
74
+ }
75
+ }
76
+ return false;
77
+ }, [
78
+ isSelected,
79
+ nodeKey
80
+ ]);
81
+ const onClick = useCallback((payload)=>{
82
+ const event = payload;
83
+ // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked
84
+ if (event.target === uploadRef.current || uploadRef.current?.contains(event.target)) {
85
+ if (event.shiftKey) {
86
+ setSelected(!isSelected);
87
+ } else {
88
+ clearSelection();
89
+ setSelected(true);
90
+ }
91
+ return true;
92
+ }
93
+ return false;
94
+ }, [
95
+ isSelected,
96
+ setSelected,
97
+ clearSelection
98
+ ]);
99
+ useEffect(()=>{
100
+ return mergeRegister(editor.registerCommand(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW));
101
+ }, [
102
+ clearSelection,
103
+ editor,
104
+ isSelected,
105
+ nodeKey,
106
+ onDelete,
107
+ setSelected,
108
+ onClick
109
+ ]);
65
110
  const hasExtraFields = editorConfig?.resolvedFeatureMap?.get('upload')?.clientFeatureProps.collections?.[relatedCollection.slug]?.hasExtraFields;
66
111
  return /*#__PURE__*/ React.createElement("div", {
67
112
  className: [
68
113
  baseClass,
69
114
  isSelected && `${baseClass}--selected`
70
115
  ].filter(Boolean).join(' '),
71
- contentEditable: false
116
+ contentEditable: false,
117
+ ref: uploadRef
72
118
  }, /*#__PURE__*/ React.createElement("div", {
73
119
  className: `${baseClass}__card`
74
120
  }, /*#__PURE__*/ React.createElement("div", {
@@ -126,7 +172,7 @@ const Component = (props)=>{
126
172
  className: `${baseClass}__bottomRow`
127
173
  }, /*#__PURE__*/ React.createElement(DocumentDrawerToggler, {
128
174
  className: `${baseClass}__doc-drawer-toggler`
129
- }, /*#__PURE__*/ React.createElement("strong", null, data?.filename)))), value?.id && /*#__PURE__*/ React.createElement(DocumentDrawer, {
175
+ }, /*#__PURE__*/ React.createElement("strong", null, data?.filename)))), value && /*#__PURE__*/ React.createElement(DocumentDrawer, {
130
176
  onSave: updateUpload
131
177
  }), hasExtraFields ? /*#__PURE__*/ React.createElement(ExtraFieldsUploadDrawer, {
132
178
  drawerSlug: drawerSlug,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/upload/component/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig } from 'payload/types'\n\nimport lexicalComposerContextImport from '@lexical/react/LexicalComposerContext.js'\nconst { useLexicalComposerContext } = lexicalComposerContextImport\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { getTranslation } from '@payloadcms/translations'\nimport lexicalImport from 'lexical'\nconst { $getNodeByKey } = lexicalImport\n\nimport { Button } from '@payloadcms/ui/elements/Button'\nimport { useDocumentDrawer } from '@payloadcms/ui/elements/DocumentDrawer'\nimport { DrawerToggler } from '@payloadcms/ui/elements/Drawer'\nimport { useDrawerSlug } from '@payloadcms/ui/elements/Drawer'\nimport { File } from '@payloadcms/ui/graphics/File'\nimport usePayloadAPI from '@payloadcms/ui/hooks/usePayloadAPI'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport React, { useCallback, useReducer, useState } from 'react'\n\nimport type { ClientComponentProps } from '../../types.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadData } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport { EnabledRelationshipsCondition } from '../../relationship/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { ExtraFieldsUploadDrawer } from './ExtraFieldsDrawer/index.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n //uploadProps: UploadFeatureProps\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n const {\n collections,\n routes: { api },\n serverURL,\n } = useConfig()\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n const { editorConfig, field } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection, setRelatedCollection] = useState<ClientCollectionConfig>(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const drawerSlug = useDrawerSlug('upload-drawer')\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id: value?.id,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value?.id}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (json) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDrawer()\n },\n [setParams, cacheBust, closeDrawer],\n )\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.clientFeatureProps as ClientComponentProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? <img alt={data?.filename} src={thumbnailSRC} /> : <File />}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <DrawerToggler\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={field?.readOnly}\n slug={drawerSlug}\n >\n <Button\n buttonStyle=\"icon-label\"\n el=\"div\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n </DrawerToggler>\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value?.id && <DocumentDrawer onSave={updateUpload} />}\n {hasExtraFields ? (\n <ExtraFieldsUploadDrawer\n drawerSlug={drawerSlug}\n relatedCollection={relatedCollection}\n {...props}\n />\n ) : null}\n </div>\n )\n}\n\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"names":["lexicalComposerContextImport","useLexicalComposerContext","useLexicalNodeSelection","getTranslation","lexicalImport","$getNodeByKey","Button","useDocumentDrawer","DrawerToggler","useDrawerSlug","File","usePayloadAPI","useConfig","useTranslation","React","useCallback","useReducer","useState","useEditorConfigContext","EnabledRelationshipsCondition","INSERT_UPLOAD_WITH_DRAWER_COMMAND","ExtraFieldsUploadDrawer","baseClass","initialParams","depth","Component","props","data","fields","relationTo","value","nodeKey","collections","routes","api","serverURL","editor","isSelected","setSelected","clearSelection","editorConfig","field","i18n","t","cacheBust","dispatchCacheBust","state","relatedCollection","setRelatedCollection","find","coll","slug","drawerSlug","DocumentDrawer","DocumentDrawerToggler","closeDrawer","id","collectionSlug","setParams","thumbnailSRC","thumbnailURL","url","removeUpload","update","remove","updateUpload","json","hasExtraFields","resolvedFeatureMap","get","clientFeatureProps","div","className","filter","Boolean","join","contentEditable","img","alt","filename","src","labels","singular","isEditable","disabled","readOnly","buttonStyle","el","icon","onClick","e","preventDefault","round","tooltip","dispatchCommand","replace","strong","onSave","UploadComponent","uploads"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,OAAOA,kCAAkC,2CAA0C;AACnF,MAAM,EAAEC,yBAAyB,EAAE,GAAGD;AACtC,SAASE,uBAAuB,QAAQ,4CAA2C;AACnF,SAASC,cAAc,QAAQ,2BAA0B;AACzD,OAAOC,mBAAmB,UAAS;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,oBAACP;QAA+B,GAAGO,KAAK;QAAEyE,SAAAA;qBACxC,oBAAC1E,WAAcC;AAGrB,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/upload/component/index.tsx"],"sourcesContent":["'use client'\nimport type { BaseSelection } from 'lexical'\nimport type { ClientCollectionConfig } from 'payload/types'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button } from '@payloadcms/ui/elements/Button'\nimport { useDocumentDrawer } from '@payloadcms/ui/elements/DocumentDrawer'\nimport { DrawerToggler } from '@payloadcms/ui/elements/Drawer'\nimport { useDrawerSlug } from '@payloadcms/ui/elements/Drawer'\nimport { File } from '@payloadcms/ui/graphics/File'\nimport usePayloadAPI from '@payloadcms/ui/hooks/usePayloadAPI'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'\n\nimport type { ClientComponentProps } from '../../types.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadData } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../lexical/config/client/EditorConfigProvider.js'\nimport { EnabledRelationshipsCondition } from '../../relationship/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isUploadNode } from '../nodes/UploadNode.js'\nimport { ExtraFieldsUploadDrawer } from './ExtraFieldsDrawer/index.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n const {\n collections,\n routes: { api },\n serverURL,\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const { editorConfig, field } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection, setRelatedCollection] = useState<ClientCollectionConfig>(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const drawerSlug = useDrawerSlug('upload-drawer')\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (json) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDrawer()\n },\n [setParams, cacheBust, closeDrawer],\n )\n\n const onDelete = useCallback(\n (payload: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n const event: KeyboardEvent = payload\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isUploadNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked\n if (event.target === uploadRef.current || uploadRef.current?.contains(event.target as Node)) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n clearSelection()\n setSelected(true)\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected, onClick])\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.clientFeatureProps as ClientComponentProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? <img alt={data?.filename} src={thumbnailSRC} /> : <File />}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <DrawerToggler\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={field?.readOnly}\n slug={drawerSlug}\n >\n <Button\n buttonStyle=\"icon-label\"\n el=\"div\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n </DrawerToggler>\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value && <DocumentDrawer onSave={updateUpload} />}\n {hasExtraFields ? (\n <ExtraFieldsUploadDrawer\n drawerSlug={drawerSlug}\n relatedCollection={relatedCollection}\n {...props}\n />\n ) : null}\n </div>\n )\n}\n\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","useDocumentDrawer","DrawerToggler","useDrawerSlug","File","usePayloadAPI","useConfig","useTranslation","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","React","useCallback","useEffect","useReducer","useRef","useState","useEditorConfigContext","EnabledRelationshipsCondition","INSERT_UPLOAD_WITH_DRAWER_COMMAND","$isUploadNode","ExtraFieldsUploadDrawer","baseClass","initialParams","depth","Component","props","data","fields","relationTo","value","nodeKey","collections","routes","api","serverURL","uploadRef","editor","isSelected","setSelected","clearSelection","editorConfig","field","i18n","t","cacheBust","dispatchCacheBust","state","relatedCollection","setRelatedCollection","find","coll","slug","drawerSlug","DocumentDrawer","DocumentDrawerToggler","closeDrawer","id","collectionSlug","setParams","thumbnailSRC","thumbnailURL","url","removeUpload","update","remove","updateUpload","json","onDelete","payload","event","preventDefault","node","onClick","target","current","contains","shiftKey","registerCommand","hasExtraFields","resolvedFeatureMap","get","clientFeatureProps","div","className","filter","Boolean","join","contentEditable","ref","img","alt","filename","src","labels","singular","isEditable","disabled","readOnly","buttonStyle","el","icon","e","round","tooltip","dispatchCommand","replace","strong","onSave","UploadComponent","uploads"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAIA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,uBAAuB,QAAQ,4CAA2C;AACnF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SAASC,cAAc,QAAQ,2BAA0B;AACzD,SAASC,MAAM,QAAQ,iCAAgC;AACvD,SAASC,iBAAiB,QAAQ,yCAAwC;AAC1E,SAASC,aAAa,QAAQ,iCAAgC;AAC9D,SAASC,aAAa,QAAQ,iCAAgC;AAC9D,SAASC,IAAI,QAAQ,+BAA8B;AACnD,OAAOC,mBAAmB,qCAAoC;AAC9D,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SACEC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,UAAS;AAChB,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAMnF,SAASC,sBAAsB,QAAQ,yDAAwD;AAC/F,SAASC,6BAA6B,QAAQ,4DAA2D;AACzG,SAASC,iCAAiC,QAAQ,wBAAuB;AACzE,SAASC,aAAa,QAAQ,yBAAwB;AACtD,SAASC,uBAAuB,QAAQ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ChBR;QACF;QACAwC,OAAAA;QACAC,SAAS5D,EAAE;yBAMrB,oBAACuC;QAAIC,WAAW,CAAC,EAAE9D,UAAU,WAAW,CAAC;qBACvC,oBAACiC;QAAsB6B,WAAW,CAAC,EAAE9D,UAAU,oBAAoB,CAAC;qBAClE,oBAACqF,gBAAQhF,MAAMiE,cAIpB9D,uBAAS,oBAACwB;QAAesD,QAAQ1C;QACjCa,+BACC,oBAAC1D;QACCgC,YAAYA;QACZL,mBAAmBA;QAClB,GAAGtB,KAAK;SAET;AAGV;AAEA,OAAO,MAAMmF,kBAAkB,CAACnF;IAC9B,qBACE,oBAACR;QAA+B,GAAGQ,KAAK;QAAEoF,SAAAA;qBACxC,oBAACrF,WAAcC;AAGrB,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/upload/drawer/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAK7C,eAAO,MAAM,iCAAiC,EAAE,cAAc,CAAC;IAC7D,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,CAAA;CACrC,CAAsD,CAAA"}
1
+ {"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/upload/drawer/commands.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAI7C,eAAO,MAAM,iCAAiC,EAAE,cAAc,CAAC;IAC7D,OAAO,EAAE;QAAE,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,KAAK,CAAA;CACrC,CAAsD,CAAA"}
@@ -1,6 +1,5 @@
1
1
  'use client';
2
- import lexicalImport from 'lexical';
3
- const { createCommand } = lexicalImport;
2
+ import { createCommand } from 'lexical';
4
3
  export const INSERT_UPLOAD_WITH_DRAWER_COMMAND = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND');
5
4
 
6
5
  //# sourceMappingURL=commands.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/upload/drawer/commands.ts"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport lexicalImport from 'lexical'\nconst { createCommand } = lexicalImport\n\nexport const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND')\n"],"names":["lexicalImport","createCommand","INSERT_UPLOAD_WITH_DRAWER_COMMAND"],"rangeMappings":";;;","mappings":"AAAA;AAGA,OAAOA,mBAAmB,UAAS;AACnC,MAAM,EAAEC,aAAa,EAAE,GAAGD;AAE1B,OAAO,MAAME,oCAERD,cAAc,qCAAoC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/upload/drawer/commands.ts"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { createCommand } from 'lexical'\n\nexport const INSERT_UPLOAD_WITH_DRAWER_COMMAND: LexicalCommand<{\n replace: { nodeKey: string } | false\n}> = createCommand('INSERT_UPLOAD_WITH_DRAWER_COMMAND')\n"],"names":["createCommand","INSERT_UPLOAD_WITH_DRAWER_COMMAND"],"rangeMappings":";;","mappings":"AAAA;AAGA,SAASA,aAAa,QAAQ,UAAS;AAEvC,OAAO,MAAMC,oCAERD,cAAc,qCAAoC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/upload/drawer/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAA2C,MAAM,OAAO,CAAA;AA8C/D,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,MAAM,EAAE,CAAA;CACjC,CAAA;AA0CD,eAAO,MAAM,YAAY,UAAW,KAAK,KAAG,MAAM,SAMjD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/upload/drawer/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA2C,MAAM,OAAO,CAAA;AA4C/D,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,MAAM,EAAE,CAAA;CACjC,CAAA;AA0CD,eAAO,MAAM,YAAY,UAAW,KAAK,KAAG,MAAM,SAMjD,CAAA"}