@payloadcms/richtext-lexical 4.0.0-internal.e55ccef → 4.0.0-internal.ea6e8f8

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 (525) hide show
  1. package/dist/exports/client/Field-MT4FK3IP.js +2 -0
  2. package/dist/exports/client/Field-MT4FK3IP.js.map +7 -0
  3. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  4. package/dist/exports/client/{chunk-X3D4LZS7.js.map → chunk-3LRZDIIG.js.map} +4 -4
  5. package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
  6. package/dist/exports/client/chunk-E6LSRRP2.js.map +7 -0
  7. package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
  8. package/dist/exports/client/chunk-ZQX5HXUL.js.map +7 -0
  9. package/dist/exports/client/component-6DQLENIE.js +2 -0
  10. package/dist/exports/client/component-6DQLENIE.js.map +7 -0
  11. package/dist/exports/client/componentInline-HNE5G4TE.js +2 -0
  12. package/dist/exports/client/index.d.ts +1 -1
  13. package/dist/exports/client/index.d.ts.map +1 -1
  14. package/dist/exports/client/index.js +23 -23
  15. package/dist/exports/client/index.js.map +4 -4
  16. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  17. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  18. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  19. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  20. package/dist/features/blocks/client/component/index.d.ts +0 -6
  21. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  22. package/dist/features/blocks/client/component/index.js +169 -101
  23. package/dist/features/blocks/client/component/index.js.map +1 -1
  24. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  25. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  26. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  27. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  28. package/dist/features/blocks/client/componentInline/index.css +0 -1
  29. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  30. package/dist/features/blocks/client/componentInline/index.js +30 -22
  31. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  32. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  33. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  34. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  35. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  36. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  37. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  38. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  39. package/dist/features/blocks/server/index.js +2 -2
  40. package/dist/features/blocks/server/index.js.map +1 -1
  41. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  42. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  43. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  44. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  45. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  46. package/dist/features/blocks/server/schema.d.ts +2 -0
  47. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  48. package/dist/features/blocks/server/schema.js +7 -9
  49. package/dist/features/blocks/server/schema.js.map +1 -1
  50. package/dist/features/blocks/server/validate.js +1 -1
  51. package/dist/features/blocks/server/validate.js.map +1 -1
  52. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  53. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  54. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  55. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  56. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  57. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  58. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  59. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  60. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  61. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  62. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  63. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  64. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  65. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  66. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  67. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  68. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  69. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  70. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  71. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  72. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  73. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  74. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  75. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  76. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  77. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  78. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  79. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  80. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  81. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  82. package/dist/features/heading/constants.d.ts +2 -0
  83. package/dist/features/heading/constants.d.ts.map +1 -0
  84. package/dist/features/heading/constants.js +2 -0
  85. package/dist/features/heading/constants.js.map +1 -0
  86. package/dist/features/heading/server/index.d.ts.map +1 -1
  87. package/dist/features/heading/server/index.js +5 -1
  88. package/dist/features/heading/server/index.js.map +1 -1
  89. package/dist/features/heading/server/validate.d.ts +6 -0
  90. package/dist/features/heading/server/validate.d.ts.map +1 -0
  91. package/dist/features/heading/server/validate.js +15 -0
  92. package/dist/features/heading/server/validate.js.map +1 -0
  93. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  94. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  95. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  96. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  97. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  98. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  99. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  100. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  101. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  102. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  103. package/dist/features/horizontalRule/server/schema.js +6 -5
  104. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  105. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  106. package/dist/features/indent/client/IndentPlugin.js +122 -1
  107. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  108. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  109. package/dist/features/indent/server/i18n.js +74 -37
  110. package/dist/features/indent/server/i18n.js.map +1 -1
  111. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  112. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  113. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  114. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -2
  115. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  116. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  117. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  118. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  119. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  120. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  121. package/dist/features/link/nodes/LinkNode.js +2 -15
  122. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  123. package/dist/features/link/server/index.js +2 -2
  124. package/dist/features/link/server/index.js.map +1 -1
  125. package/dist/features/link/server/validate.js +1 -1
  126. package/dist/features/link/server/validate.js.map +1 -1
  127. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  128. package/dist/features/lists/checklist/server/index.js +5 -2
  129. package/dist/features/lists/checklist/server/index.js.map +1 -1
  130. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  131. package/dist/features/lists/orderedList/server/index.js +5 -2
  132. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  133. package/dist/features/lists/shared/constants.d.ts +2 -0
  134. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  135. package/dist/features/lists/shared/constants.js +2 -0
  136. package/dist/features/lists/shared/constants.js.map +1 -0
  137. package/dist/features/lists/shared/validate.d.ts +5 -0
  138. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  139. package/dist/features/lists/shared/validate.js +15 -0
  140. package/dist/features/lists/shared/validate.js.map +1 -0
  141. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  142. package/dist/features/lists/unorderedList/server/index.js +5 -2
  143. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  144. package/dist/features/relationship/client/components/index.css +3 -6
  145. package/dist/features/relationship/client/index.d.ts +2 -2
  146. package/dist/features/relationship/client/index.d.ts.map +1 -1
  147. package/dist/features/relationship/client/index.js.map +1 -1
  148. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  149. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  150. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  151. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  152. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  153. package/dist/features/relationship/client/plugins/index.js +27 -31
  154. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  155. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  156. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  157. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  158. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  159. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  160. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  161. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  162. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  163. package/dist/features/relationship/server/index.d.ts +8 -1
  164. package/dist/features/relationship/server/index.d.ts.map +1 -1
  165. package/dist/features/relationship/server/index.js +28 -11
  166. package/dist/features/relationship/server/index.js.map +1 -1
  167. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  168. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  169. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  170. package/dist/features/relationship/server/schema.d.ts +3 -2
  171. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  172. package/dist/features/relationship/server/schema.js +9 -12
  173. package/dist/features/relationship/server/schema.js.map +1 -1
  174. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  175. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  176. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  177. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  178. package/dist/features/table/client/index.d.ts.map +1 -0
  179. package/dist/features/table/client/index.js.map +1 -0
  180. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  181. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  182. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  183. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  184. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -1
  185. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  186. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  187. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  188. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  189. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  190. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  191. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  192. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  193. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  194. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  195. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  196. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  197. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  198. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  199. package/dist/features/table/client/utils/debounce.js.map +1 -0
  200. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  201. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  202. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  203. package/dist/features/table/markdownTransformer.js.map +1 -0
  204. package/dist/features/table/server/index.d.ts +3 -0
  205. package/dist/features/table/server/index.d.ts.map +1 -0
  206. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  207. package/dist/features/table/server/index.js.map +1 -0
  208. package/dist/features/table/server/schema.d.ts.map +1 -0
  209. package/dist/features/table/server/schema.js.map +1 -0
  210. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  211. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  212. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  213. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  214. package/dist/features/toolbars/fixed/client/Toolbar/index.css +78 -6
  215. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  216. package/dist/features/toolbars/fixed/client/Toolbar/index.js +4 -1
  217. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  218. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  219. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  220. package/dist/features/toolbars/inline/client/Toolbar/index.js +2 -2
  221. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  222. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  223. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  224. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  225. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  226. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  227. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  228. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -14
  229. package/dist/features/typesServer.d.ts +17 -12
  230. package/dist/features/typesServer.d.ts.map +1 -1
  231. package/dist/features/typesServer.js.map +1 -1
  232. package/dist/features/upload/client/component/index.css +0 -2
  233. package/dist/features/upload/client/component/index.js +2 -1
  234. package/dist/features/upload/client/component/index.js.map +1 -1
  235. package/dist/features/upload/client/index.d.ts +3 -2
  236. package/dist/features/upload/client/index.d.ts.map +1 -1
  237. package/dist/features/upload/client/index.js.map +1 -1
  238. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  239. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  240. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  241. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  242. package/dist/features/upload/client/plugin/index.js +50 -53
  243. package/dist/features/upload/client/plugin/index.js.map +1 -1
  244. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  245. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  246. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  247. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  248. package/dist/features/upload/server/index.d.ts +7 -3
  249. package/dist/features/upload/server/index.d.ts.map +1 -1
  250. package/dist/features/upload/server/index.js +20 -16
  251. package/dist/features/upload/server/index.js.map +1 -1
  252. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  253. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  254. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  255. package/dist/features/upload/server/schema.d.ts +4 -16
  256. package/dist/features/upload/server/schema.d.ts.map +1 -1
  257. package/dist/features/upload/server/schema.js +8 -10
  258. package/dist/features/upload/server/schema.js.map +1 -1
  259. package/dist/features/upload/server/validate.d.ts +2 -2
  260. package/dist/features/upload/server/validate.d.ts.map +1 -1
  261. package/dist/features/upload/server/validate.js +4 -1
  262. package/dist/features/upload/server/validate.js.map +1 -1
  263. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  264. package/dist/field/Diff/converters/listitem/index.js +2 -1
  265. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  266. package/dist/field/Diff/converters/relationship/index.css +0 -1
  267. package/dist/field/Diff/converters/unknown/index.css +0 -1
  268. package/dist/field/Diff/converters/upload/index.css +0 -1
  269. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  270. package/dist/field/Diff/index.css +0 -2
  271. package/dist/field/Diff/index.d.ts +3 -2
  272. package/dist/field/Diff/index.d.ts.map +1 -1
  273. package/dist/field/Diff/index.js +3 -2
  274. package/dist/field/Diff/index.js.map +1 -1
  275. package/dist/field/Field.d.ts.map +1 -1
  276. package/dist/field/Field.js +8 -1
  277. package/dist/field/Field.js.map +1 -1
  278. package/dist/field/RenderLexical/index.d.ts +3 -1
  279. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  280. package/dist/field/RenderLexical/index.js +23 -23
  281. package/dist/field/RenderLexical/index.js.map +1 -1
  282. package/dist/field/ViewSelector.d.ts.map +1 -1
  283. package/dist/field/ViewSelector.js +1 -0
  284. package/dist/field/ViewSelector.js.map +1 -1
  285. package/dist/field/bundled.css +1 -1
  286. package/dist/field/index.css +10 -11
  287. package/dist/i18n.d.ts.map +1 -1
  288. package/dist/i18n.js +68 -0
  289. package/dist/i18n.js.map +1 -1
  290. package/dist/index.d.ts +2 -2
  291. package/dist/index.d.ts.map +1 -1
  292. package/dist/index.js +27 -5
  293. package/dist/index.js.map +1 -1
  294. package/dist/lexical/LexicalEditor.css +30 -21
  295. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  296. package/dist/lexical/LexicalEditor.js +61 -64
  297. package/dist/lexical/LexicalEditor.js.map +1 -1
  298. package/dist/lexical/config/server/loader.d.ts +1 -1
  299. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  300. package/dist/lexical/config/server/loader.js +2 -2
  301. package/dist/lexical/config/server/loader.js.map +1 -1
  302. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  303. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  304. package/dist/lexical/config/server/sanitize.js +2 -2
  305. package/dist/lexical/config/server/sanitize.js.map +1 -1
  306. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  307. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  308. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  309. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  310. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  311. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  312. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  313. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  314. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  315. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  316. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  317. package/dist/lexical/plugins/SlashMenu/index.css +0 -2
  318. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  319. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  320. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  321. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +1 -0
  322. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  323. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  324. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  325. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  326. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  327. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  328. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  329. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  330. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  331. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  332. package/dist/lexical/theme/EditorTheme.css +0 -2
  333. package/dist/lexical/ui/ContentEditable.css +16 -15
  334. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  335. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  336. package/dist/lexical/ui/ContentEditable.js +21 -7
  337. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  338. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  339. package/dist/lexical/ui/icons/H3/index.js +13 -6
  340. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  341. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  342. package/dist/lexical/ui/icons/H4/index.js +13 -6
  343. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  344. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  345. package/dist/lexical/ui/icons/H5/index.js +13 -6
  346. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  347. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  348. package/dist/lexical/ui/icons/H6/index.js +13 -6
  349. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  350. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  351. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  352. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  353. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  354. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  355. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  356. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  357. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  358. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  359. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  360. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  361. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  362. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  363. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  364. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  365. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  366. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  367. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  368. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  369. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  370. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  371. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  372. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  373. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  374. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  375. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  376. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  377. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  378. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  379. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  380. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  381. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  382. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  383. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  384. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  385. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  386. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  387. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  388. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  389. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  390. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  391. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  392. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  393. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  394. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  395. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  396. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  397. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  398. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  399. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  400. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  401. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  402. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  403. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  404. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  405. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  406. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  407. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  408. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  409. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  410. package/dist/populateGraphQL/populate.d.ts.map +1 -1
  411. package/dist/populateGraphQL/populate.js +2 -1
  412. package/dist/populateGraphQL/populate.js.map +1 -1
  413. package/dist/presets/llmInstructions.d.ts +2 -0
  414. package/dist/presets/llmInstructions.d.ts.map +1 -0
  415. package/dist/presets/llmInstructions.js +13 -0
  416. package/dist/presets/llmInstructions.js.map +1 -0
  417. package/dist/types/builtInNodes.d.ts +1 -1
  418. package/dist/types/builtInNodes.d.ts.map +1 -1
  419. package/dist/types/builtInNodes.js +8 -3
  420. package/dist/types/builtInNodes.js.map +1 -1
  421. package/dist/types/index.d.ts +3 -3
  422. package/dist/types/index.d.ts.map +1 -1
  423. package/dist/types/index.js.map +1 -1
  424. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  425. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  426. package/dist/types/jsonSchemaHelpers.js +7 -2
  427. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  428. package/dist/types/nodeTypes.d.ts +6 -1
  429. package/dist/types/nodeTypes.d.ts.map +1 -1
  430. package/dist/types/nodeTypes.js.map +1 -1
  431. package/dist/utilities/buildInitialState.d.ts +3 -2
  432. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  433. package/dist/utilities/buildInitialState.js +1 -0
  434. package/dist/utilities/buildInitialState.js.map +1 -1
  435. package/dist/utilities/createServerFeature.d.ts +1 -1
  436. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  437. package/dist/utilities/createServerFeature.js +2 -2
  438. package/dist/utilities/createServerFeature.js.map +1 -1
  439. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  440. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  441. package/dist/utilities/editorConfigFactory.js +9 -9
  442. package/dist/utilities/editorConfigFactory.js.map +1 -1
  443. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  444. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  445. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  446. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  447. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  448. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  449. package/dist/validate/hasText.d.ts +2 -2
  450. package/dist/validate/hasText.d.ts.map +1 -1
  451. package/dist/validate/hasText.js.map +1 -1
  452. package/dist/validate/index.d.ts +1 -1
  453. package/dist/validate/index.d.ts.map +1 -1
  454. package/package.json +99 -25
  455. package/dist/dependencyChecker.spec.js +0 -16
  456. package/dist/dependencyChecker.spec.js.map +0 -1
  457. package/dist/exports/client/Field-QGSHF22S.js +0 -2
  458. package/dist/exports/client/Field-QGSHF22S.js.map +0 -7
  459. package/dist/exports/client/bundled.css +0 -1
  460. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  461. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  462. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  463. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  464. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  465. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  466. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  467. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  468. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  469. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  470. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  471. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  472. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  473. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  474. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  475. package/dist/features/experimental_table/client/index.js.map +0 -1
  476. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  477. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  478. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  479. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  480. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  481. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  482. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  483. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  484. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  485. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  486. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  487. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  488. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  489. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  490. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  491. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  492. package/dist/features/experimental_table/server/index.d.ts +0 -3
  493. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  494. package/dist/features/experimental_table/server/index.js.map +0 -1
  495. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  496. package/dist/features/experimental_table/server/schema.js.map +0 -1
  497. package/dist/features/link/markdownTransformer.spec.js +0 -195
  498. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  499. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  500. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  501. package/dist/lexical/utils/url.spec.js +0 -114
  502. package/dist/lexical/utils/url.spec.js.map +0 -1
  503. package/dist/utilities/jsx/jsx.spec.js +0 -178
  504. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  505. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
  506. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  507. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  508. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  509. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  510. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  511. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  512. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  513. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  514. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  515. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  516. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  517. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  518. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  519. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  520. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  521. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  522. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  523. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  524. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  525. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -1,6 +1,7 @@
1
1
  import { sanitizeFields } from 'payload';
2
2
  import { populate } from '../../../populateGraphQL/populate.js';
3
3
  import { createServerFeature } from '../../../utilities/createServerFeature.js';
4
+ import { filterEnabledRelationshipCollections } from '../../relationship/shared/filterEnabledRelationshipCollections.js';
4
5
  import { createNode } from '../../typeUtilities.js';
5
6
  import { uploadPopulationPromiseHOC } from './graphQLPopulationPromise.js';
6
7
  import { i18n } from './i18n.js';
@@ -9,26 +10,26 @@ import { UploadServerNode } from './nodes/UploadNode.js';
9
10
  import { createUploadNodeJSONSchema } from './schema.js';
10
11
  import { uploadValidation } from './validate.js';
11
12
  export const UploadFeature = createServerFeature({
12
- feature: async ({
13
+ feature: ({
13
14
  config: _config,
14
15
  isRoot,
15
16
  parentIsLocalized,
16
- props
17
+ props: unsanitizedProps
17
18
  }) => {
18
- if (!props) {
19
- props = {
20
- collections: {}
21
- };
22
- }
19
+ const props = {
20
+ ...unsanitizedProps,
21
+ collections: unsanitizedProps?.collections ?? {},
22
+ enabledCollectionSlugs: filterEnabledRelationshipCollections(_config.collections, {
23
+ ...unsanitizedProps,
24
+ uploads: true
25
+ }).map(({
26
+ slug
27
+ }) => slug)
28
+ };
23
29
  const clientProps = {
24
- collections: {}
30
+ collections: {},
31
+ enabledCollectionSlugs: props.enabledCollectionSlugs
25
32
  };
26
- if (props.disabledCollections) {
27
- clientProps.disabledCollections = props.disabledCollections;
28
- }
29
- if (props.enabledCollections) {
30
- clientProps.enabledCollections = props.enabledCollections;
31
- }
32
33
  if (props.collections) {
33
34
  for (const collection in props.collections) {
34
35
  clientProps.collections[collection] = {
@@ -40,7 +41,7 @@ export const UploadFeature = createServerFeature({
40
41
  for (const collectionKey in props.collections) {
41
42
  const collection = props.collections[collectionKey];
42
43
  if (collection.fields?.length) {
43
- collection.fields = await sanitizeFields({
44
+ collection.fields = sanitizeFields({
44
45
  config: _config,
45
46
  fields: collection.fields,
46
47
  parentIsLocalized,
@@ -84,6 +85,9 @@ export const UploadFeature = createServerFeature({
84
85
  }
85
86
  return allSubFields;
86
87
  }
88
+ if (!props.enabledCollectionSlugs.includes(node.relationTo)) {
89
+ return null;
90
+ }
87
91
  const collection = req ? req.payload.collections[node?.relationTo] : null;
88
92
  if (collection) {
89
93
  const collectionFieldSchema = props?.collections?.[node?.relationTo]?.fields;
@@ -114,7 +118,7 @@ export const UploadFeature = createServerFeature({
114
118
  req,
115
119
  showHiddenFields
116
120
  }) => {
117
- if (!node?.value) {
121
+ if (!node?.value || !props.enabledCollectionSlugs.includes(node.relationTo)) {
118
122
  return node;
119
123
  }
120
124
  const collection = req.payload.collections[node?.relationTo];
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["sanitizeFields","populate","createServerFeature","createNode","uploadPopulationPromiseHOC","i18n","PAYLOAD_UPLOAD","UploadServerNode","createUploadNodeJSONSchema","uploadValidation","UploadFeature","feature","config","_config","isRoot","parentIsLocalized","props","collections","clientProps","disabledCollections","enabledCollections","collection","hasExtraFields","fields","length","validRelationships","map","c","slug","collectionKey","requireFieldLevelRichTextEditor","ClientFeature","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","markdownTransformers","nodes","getSubFields","node","req","allSubFields","collectionFields","concat","payload","relationTo","collectionFieldSchema","Array","isArray","getSubFieldsData","graphQLPopulationPromises","hooks","afterRead","currentDepth","depth","draft","overrideAccess","populateArg","populationPromises","showHiddenFields","value","id","populateDepth","maxDepth","undefined","push","collectionSlug","data","key","select","defaultPopulate","jsonSchema","validations","sanitizedServerFeatureProps"],"sources":["../../../../src/features/upload/server/index.ts"],"sourcesContent":["import type { Config, Field, FieldSchemaMap, UploadCollectionSlug } from 'payload'\n\nimport { sanitizeFields } from 'payload'\n\nimport type { UploadFeaturePropsClient } from '../client/index.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { uploadPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { PAYLOAD_UPLOAD } from './markdownTransformer.js'\nimport { UploadServerNode } from './nodes/UploadNode.js'\nimport { createUploadNodeJSONSchema } from './schema.js'\nimport { uploadValidation } from './validate.js'\n\nexport type {\n Internal_UploadData,\n SerializedUploadNode,\n UploadData,\n UploadDataImproved,\n} from './schema.js'\n\nexport type ExclusiveUploadFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: UploadCollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: UploadCollectionSlug[]\n }\n\nexport type UploadFeatureProps = {\n collections?: {\n [collection: UploadCollectionSlug]: {\n fields: Field[]\n }\n }\n /**\n * Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveUploadFeatureProps\n\nexport const UploadFeature = createServerFeature<\n UploadFeatureProps,\n UploadFeatureProps,\n UploadFeaturePropsClient\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = {\n collections: {},\n }\n if (props.disabledCollections) {\n clientProps.disabledCollections = props.disabledCollections\n }\n if (props.enabledCollections) {\n clientProps.enabledCollections = props.enabledCollections\n }\n\n if (props.collections) {\n for (const collection in props.collections) {\n clientProps.collections[collection] = {\n hasExtraFields: props.collections[collection]!.fields.length >= 1,\n }\n }\n }\n\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const collectionKey in props.collections) {\n const collection = props.collections[collectionKey]!\n if (collection.fields?.length) {\n collection.fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: collection.fields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#UploadFeatureClient',\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ props }) => {\n if (!props?.collections) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n\n for (const collectionKey in props.collections) {\n const collection = props.collections[collectionKey]!\n if (collection.fields?.length) {\n schemaMap.set(collectionKey, {\n fields: collection.fields,\n })\n }\n }\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [PAYLOAD_UPLOAD],\n nodes: [\n createNode({\n getSubFields: ({ node, req }) => {\n if (!node) {\n let allSubFields: Field[] = []\n for (const collection in props?.collections) {\n const collectionFields = props.collections[collection]!.fields\n allSubFields = allSubFields.concat(collectionFields)\n }\n return allSubFields\n }\n const collection = req ? req.payload.collections[node?.relationTo] : null\n\n if (collection) {\n const collectionFieldSchema = props?.collections?.[node?.relationTo]?.fields\n\n if (Array.isArray(collectionFieldSchema)) {\n if (!collectionFieldSchema?.length) {\n return null\n }\n return collectionFieldSchema\n }\n }\n return null\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [uploadPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populateArg,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n const id =\n typeof node?.value === 'object' && node.value !== null && 'id' in node.value\n ? node.value.id\n : node?.value // for backwards-compatibility\n\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n select:\n populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n jsonSchema: createUploadNodeJSONSchema(props),\n node: UploadServerNode,\n validations: [uploadValidation(props)],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'upload',\n})\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ;AAI/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,IAAI,QAAQ;AACrB,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,gBAAgB,QAAQ;AA8CjC,OAAO,MAAMC,aAAA,GAAgBR,mBAAA,CAI3B;EACAS,OAAA,EAAS,MAAAA,CAAO;IAAEC,MAAA,EAAQC,OAAO;IAAEC,MAAM;IAAEC,iBAAiB;IAAEC;EAAK,CAAE;IACnE,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ;QAAEC,WAAA,EAAa,CAAC;MAAE;IAC5B;IAEA,MAAMC,WAAA,GAAwC;MAC5CD,WAAA,EAAa,CAAC;IAChB;IACA,IAAID,KAAA,CAAMG,mBAAmB,EAAE;MAC7BD,WAAA,CAAYC,mBAAmB,GAAGH,K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K;AACP","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["sanitizeFields","populate","createServerFeature","filterEnabledRelationshipCollections","createNode","uploadPopulationPromiseHOC","i18n","PAYLOAD_UPLOAD","UploadServerNode","createUploadNodeJSONSchema","uploadValidation","UploadFeature","feature","config","_config","isRoot","parentIsLocalized","props","unsanitizedProps","collections","enabledCollectionSlugs","uploads","map","slug","clientProps","collection","hasExtraFields","fields","length","validRelationships","c","collectionKey","requireFieldLevelRichTextEditor","ClientFeature","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","markdownTransformers","nodes","getSubFields","node","req","allSubFields","collectionFields","concat","includes","relationTo","payload","collectionFieldSchema","Array","isArray","getSubFieldsData","graphQLPopulationPromises","hooks","afterRead","currentDepth","depth","draft","overrideAccess","populateArg","populationPromises","showHiddenFields","value","id","populateDepth","maxDepth","undefined","push","collectionSlug","data","key","select","defaultPopulate","jsonSchema","validations","sanitizedServerFeatureProps"],"sources":["../../../../src/features/upload/server/index.ts"],"sourcesContent":["import type { CollectionSlug, Config, Field, FieldSchemaMap, UploadCollectionSlug } from 'payload'\n\nimport { sanitizeFields } from 'payload'\n\nimport type { UploadFeaturePropsClient } from '../client/index.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { filterEnabledRelationshipCollections } from '../../relationship/shared/filterEnabledRelationshipCollections.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { uploadPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { PAYLOAD_UPLOAD } from './markdownTransformer.js'\nimport { UploadServerNode } from './nodes/UploadNode.js'\nimport { createUploadNodeJSONSchema } from './schema.js'\nimport { uploadValidation } from './validate.js'\n\nexport type { Internal_UploadData, SerializedUploadNode, UploadData } from './schema.js'\n\nexport type ExclusiveUploadFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: UploadCollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: UploadCollectionSlug[]\n }\n\nexport type UploadFeatureProps = {\n collections?: {\n [collection: UploadCollectionSlug]: {\n fields: Field[]\n }\n }\n /**\n * Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveUploadFeatureProps\n\nexport type UploadFeatureServerProps = {\n /** Collection policy resolved during feature initialization. */\n enabledCollectionSlugs: CollectionSlug[]\n} & UploadFeatureProps\n\nexport const UploadFeature = createServerFeature<\n UploadFeatureProps,\n UploadFeatureServerProps,\n UploadFeaturePropsClient\n>({\n feature: ({ config: _config, isRoot, parentIsLocalized, props: unsanitizedProps }) => {\n const props: UploadFeatureServerProps = {\n ...unsanitizedProps,\n collections: unsanitizedProps?.collections ?? {},\n enabledCollectionSlugs: filterEnabledRelationshipCollections(_config.collections, {\n ...unsanitizedProps,\n uploads: true,\n }).map(({ slug }) => slug),\n }\n\n const clientProps: UploadFeaturePropsClient = {\n collections: {},\n enabledCollectionSlugs: props.enabledCollectionSlugs,\n }\n\n if (props.collections) {\n for (const collection in props.collections) {\n clientProps.collections[collection] = {\n hasExtraFields: props.collections[collection]!.fields.length >= 1,\n }\n }\n }\n\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const collectionKey in props.collections) {\n const collection = props.collections[collectionKey]!\n if (collection.fields?.length) {\n collection.fields = sanitizeFields({\n config: _config as unknown as Config,\n fields: collection.fields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#UploadFeatureClient',\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ props }) => {\n if (!props?.collections) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n\n for (const collectionKey in props.collections) {\n const collection = props.collections[collectionKey]!\n if (collection.fields?.length) {\n schemaMap.set(collectionKey, {\n fields: collection.fields,\n })\n }\n }\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [PAYLOAD_UPLOAD],\n nodes: [\n createNode({\n getSubFields: ({ node, req }) => {\n if (!node) {\n let allSubFields: Field[] = []\n for (const collection in props?.collections) {\n const collectionFields = props.collections[collection]!.fields\n allSubFields = allSubFields.concat(collectionFields)\n }\n return allSubFields\n }\n if (!props.enabledCollectionSlugs.includes(node.relationTo)) {\n return null\n }\n const collection = req ? req.payload.collections[node?.relationTo] : null\n\n if (collection) {\n const collectionFieldSchema = props?.collections?.[node?.relationTo]?.fields\n\n if (Array.isArray(collectionFieldSchema)) {\n if (!collectionFieldSchema?.length) {\n return null\n }\n return collectionFieldSchema\n }\n }\n return null\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [uploadPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populateArg,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value || !props.enabledCollectionSlugs.includes(node.relationTo)) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n const id =\n typeof node?.value === 'object' && node.value !== null && 'id' in node.value\n ? node.value.id\n : node?.value // for backwards-compatibility\n\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n select:\n populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n jsonSchema: createUploadNodeJSONSchema(props),\n node: UploadServerNode,\n validations: [uploadValidation(props)],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'upload',\n})\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ;AAI/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,oCAAoC,QAAQ;AACrD,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,IAAI,QAAQ;AACrB,SAASC,cAAc,QAAQ;AAC/B,SAASC,gBAAgB,QAAQ;AACjC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,gBAAgB,QAAQ;AA8CjC,OAAO,MAAMC,aAAA,GAAgBT,mBAAA,CAI3B;EACAU,OAAA,EAASA,CAAC;IAAEC,MAAA,EAAQC,OAAO;IAAEC,MAAM;IAAEC,iBAAiB;IAAEC,KAAA,EAAOC;EAAgB,CAAE;IAC/E,MAAMD,KAAA,GAAkC;MACtC,GAAGC,gBAAgB;MACnBC,WAAA,EAAaD,gBAAA,EAAkBC,WAAA,IAAe,CAAC;MAC/CC,sBAAA,EAAwBjB,oCAAA,CAAqCW,OAAA,CAAQK,WAAW,EAAE;QAChF,GAAGD,gBAAgB;QACnBG,OAAA,EAAS;MACX,GAAGC,GAAG,CAAC,CAAC;QAAEC;MAAI,CAAE,KAAKA,IAAA;IACvB;IAEA,MAAMC,WAAA,GAAwC;MAC5CL,WAAA,EAAa,CAAC;MACdC,sBAAA,EAAwBH,KAAA,CAAMG;IAChC;IAEA,IAAIH,KAAA,CAAME,WAAW,EAAE;MACrB,KAAK,MAAMM,UAAA,IAAcR,KAAA,CAAME,WAAW,EAAE;QAC1CK,WAAA,CAAYL,WAAW,CAACM,UAAA,CAAW,GAAG;UACpCC,cAAA,EAAgBT,KAAA,CAAME,WAAW,CAACM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,GAAakB,GAAA,CAAIM,OAAO,CAAC9B,WAAW,CAACuB,IAAA,EAAMM,UAAA,CAAW;YAE5D,IAAI,CAACvB,UAAA,EAAY;cACf,OAAOiB,IAAA;YACT;YACA,MAAMuB,EAAA,GACJ,OAAOvB,IAAA,EAAMsB,KAAA,KAAU,YAAYtB,IAAA,CAAKsB,KAAK,KAAK,QAAQ,QAAQtB,IAAA,CAAKsB,KAAK,GACxEtB,IAAA,CAAKsB,KAAK,CAACC,EAAE,GACbvB,IAAA,EAAMsB,KAAA,CAAM;AAAA;YAElB,MAAME,aAAA,GACJjD,KAAA,EAAOkD,QAAA,KAAaC,SAAA,IAAanD,KAAA,EAAOkD,QAAA,GAAWT,KAAA,GAAQzC,KAAA,EAAOkD,QAAA,GAAWT,KAAA;YAE/EI,kBAAA,CAAmBO,IAAI,CACrBpE,QAAA,CAAS;cACPgE,EAAA;cACAK,cAAA,EAAgB7C,UAAA,CAAWZ,MAAM,CAACU,IAAI;cACtCkC,YAAA;cACAc,IAAA,EAAM7B,IAAA;cACNgB,KAAA,EAAOQ,aAAA;cACPP,KAAA;cACAa,GAAA,EAAK;cACLZ,cAAA;cACAjB,GAAA;cACA8B,MAAA,EACEZ,WAAA,GAAcpC,UAAA,CAAWZ,MAAM,CAACU,IAAI,CAAC,IAAIE,UAAA,CAAWZ,MAAM,CAAC6D,eAAe;cAC5EX;YACF;YAGF,OAAOrB,IAAA;UACT;QAEJ;QACAiC,UAAA,EAAYlE,0BAAA,CAA2BQ,KAAA;QACvCyB,IAAA,EAAMlC,gBAAA;QACNoE,WAAA,EAAa,CAAClE,gBAAA,CAAiBO,KAAA;MACjC,GACD;MACD4D,2BAAA,EAA6B5D;IAC/B;EACF;EACAuD,GAAA,EAAK;AACP","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"UploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/server/nodes/UploadNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,gBAAgB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AAO,IAAI,UAAU,CAEpB;IAED,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI,CAG9B;IAEQ,SAAS,IAAI,KAAK,CAE1B;CACF;AAED,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAA;CAC/D,GAAG,gBAAgB,CAKnB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,gBAAgB,CAE1B"}
@@ -32,13 +32,6 @@ export class UploadServerNode extends DecoratorBlockNode {
32
32
  };
33
33
  }
34
34
  static importJSON(serializedNode) {
35
- if (serializedNode.version === 1 && serializedNode?.value?.id) {
36
- serializedNode.value = serializedNode.value.id;
37
- }
38
- if (serializedNode.version === 2 && !serializedNode?.id) {
39
- serializedNode.id = new ObjectID.default().toHexString();
40
- serializedNode.version = 3;
41
- }
42
35
  const importedData = {
43
36
  id: serializedNode.id,
44
37
  fields: serializedNode.fields,
@@ -81,8 +74,7 @@ export class UploadServerNode extends DecoratorBlockNode {
81
74
  return {
82
75
  ...super.exportJSON(),
83
76
  ...this.getData(),
84
- type: 'upload',
85
- version: 3
77
+ type: 'upload'
86
78
  };
87
79
  }
88
80
  getData() {
@@ -1 +1 @@
1
- {"version":3,"file":"UploadNode.js","names":["DecoratorBlockNode","addClassNamesToElement","ObjectID","$applyNodeReplacement","$convertUploadElement","UploadServerNode","__data","constructor","data","format","key","clone","node","__format","__key","getType","importDOM","img","conversion","domNode","$createUploadServerNode","priority","importJSON","serializedNode","version","value","id","default","toHexString","importedData","fields","pending","relationTo","setFormat","isInline","createDOM","config","element","document","createElement","theme","upload","decorate","exportDOM","setAttribute","String","formID","src","exportJSON","getData","type","getLatest","setData","writable","getWritable","updateDOM","$isUploadServerNode"],"sources":["../../../../../src/features/upload/server/nodes/UploadNode.tsx"],"sourcesContent":["import type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n} from 'lexical'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { addClassNamesToElement } from '@lexical/utils'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\n\nimport type { Internal_UploadData, SerializedUploadNode, UploadData } from '../schema.js'\n\nimport { $convertUploadElement } from './conversions.js'\n\nexport class UploadServerNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static override clone(node: UploadServerNode): UploadServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'upload'\n }\n\n static override importDOM(): DOMConversionMap<HTMLImageElement> {\n return {\n img: (node) => ({\n conversion: (domNode) => $convertUploadElement(domNode, $createUploadServerNode),\n priority: 0,\n }),\n }\n }\n\n static override importJSON(serializedNode: SerializedUploadNode): UploadServerNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: Internal_UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n pending: (serializedNode as Internal_UploadData).pending,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadServerNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('div')\n addClassNamesToElement(element, config?.theme?.upload)\n return element\n }\n\n override decorate(): JSX.Element {\n return null as unknown as JSX.Element\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n const data = this.__data as Internal_UploadData\n if (data.pending) {\n element.setAttribute('data-lexical-pending-upload-form-id', String(data?.pending?.formID))\n element.setAttribute('src', data?.pending?.src || '')\n } else {\n element.setAttribute('data-lexical-upload-id', String(data?.value))\n element.setAttribute('data-lexical-upload-relation-to', data?.relationTo)\n }\n\n return { element }\n }\n\n override exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'upload',\n version: 3,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n override updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadServerNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadServerNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadServerNode({ data: data as UploadData }))\n}\n\nexport function $isUploadServerNode(\n node: LexicalNode | null | undefined,\n): node is UploadServerNode {\n return node instanceof UploadServerNode\n}\n"],"mappings":"AAUA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,sBAAsB,QAAQ;AACvC,OAAOC,QAAA,MAAc;AACrB,SAASC,qBAAqB,QAAQ;AAItC,SAASC,qBAAqB,QAAQ;AAEtC,OAAO,MAAMC,gBAAA,SAAyBL,kBAAA;EACpCM,MAAA;EAEAC,YAAY;IACVC,IAAI;IACJC,MAAM;IACNC;EAAG,CAKJ,EAAE;IACD,KAAK,CAACD,MAAA,EAAQC,GAAA;IACd,IAAI,CAACJ,MAAM,GAAGE,IAAA;EAChB;EAEA,OAAgBG,MAAMC,IAAsB,EAAoB;IAC9D,OAAO,IAAI,IAAI,CAAC;MACdJ,IAAA,EAAMI,IAAA,CAAKN,MAAM;MACjBG,MAAA,EAAQG,IAAA,CAAKC,QAAQ;MACrBH,GAAA,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oC;EAEpC,OAAOA,IAAA,YAAgBP,gBAAA;AACzB","ignoreList":[]}
1
+ {"version":3,"file":"UploadNode.js","names":["DecoratorBlockNode","addClassNamesToElement","ObjectID","$applyNodeReplacement","$convertUploadElement","UploadServerNode","__data","constructor","data","format","key","clone","node","__format","__key","getType","importDOM","img","conversion","domNode","$createUploadServerNode","priority","importJSON","serializedNode","importedData","id","fields","pending","relationTo","value","setFormat","isInline","createDOM","config","element","document","createElement","theme","upload","decorate","exportDOM","setAttribute","String","formID","src","exportJSON","getData","type","getLatest","setData","writable","getWritable","updateDOM","default","toHexString","$isUploadServerNode"],"sources":["../../../../../src/features/upload/server/nodes/UploadNode.tsx"],"sourcesContent":["import type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n} from 'lexical'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { addClassNamesToElement } from '@lexical/utils'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\n\nimport type { Internal_UploadData, SerializedUploadNode, UploadData } from '../schema.js'\n\nimport { $convertUploadElement } from './conversions.js'\n\nexport class UploadServerNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static override clone(node: UploadServerNode): UploadServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'upload'\n }\n\n static override importDOM(): DOMConversionMap<HTMLImageElement> {\n return {\n img: (node) => ({\n conversion: (domNode) => $convertUploadElement(domNode, $createUploadServerNode),\n priority: 0,\n }),\n }\n }\n\n static override importJSON(serializedNode: SerializedUploadNode): UploadServerNode {\n const importedData: Internal_UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n pending: (serializedNode as Internal_UploadData).pending,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadServerNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('div')\n addClassNamesToElement(element, config?.theme?.upload)\n return element\n }\n\n override decorate(): JSX.Element {\n return null as unknown as JSX.Element\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n const data = this.__data as Internal_UploadData\n if (data.pending) {\n element.setAttribute('data-lexical-pending-upload-form-id', String(data?.pending?.formID))\n element.setAttribute('src', data?.pending?.src || '')\n } else {\n element.setAttribute('data-lexical-upload-id', String(data?.value))\n element.setAttribute('data-lexical-upload-relation-to', data?.relationTo)\n }\n\n return { element }\n }\n\n override exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'upload',\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n override updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadServerNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadServerNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadServerNode({ data: data as UploadData }))\n}\n\nexport function $isUploadServerNode(\n node: LexicalNode | null | undefined,\n): node is UploadServerNode {\n return node instanceof UploadServerNode\n}\n"],"mappings":"AAUA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,sBAAsB,QAAQ;AACvC,OAAOC,QAAA,MAAc;AACrB,SAASC,qBAAqB,QAAQ;AAItC,SAASC,qBAAqB,QAAQ;AAEtC,OAAO,MAAMC,gBAAA,SAAyBL,kBAAA;EACpCM,MAAA;EAEAC,YAAY;IACVC,IAAI;IACJC,MAAM;IACNC;EAAG,CAKJ,EAAE;IACD,KAAK,CAACD,MAAA,EAA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I,CAACF,MAAM;IACxB,IAAIE,IAAA,CAAKmB,OAAO,EAAE;MAChBO,OAAA,CAAQO,YAAY,CAAC,uCAAuCC,MAAA,CAAOlC,IAAA,EAAMmB,OAAA,EAASgB,MAAA;MAClFT,OAAA,CAAQO,YAAY,CAAC,OAAOjC,IAAA,EAAMmB,OAAA,EAASiB,GAAA,IAAO;IACpD,OAAO;MACLV,OAAA,CAAQO,YAAY,CAAC,0BAA0BC,MAAA,CAAOlC,IAAA,EAAMqB,KAAA;MAC5DK,OAAA,CAAQO,YAAY,CAAC,mCAAmCjC,IAAA,EAAMoB,UAAA;IAChE;IAEA,OAAO;MAAEM;IAAQ;EACnB;EAESW,WAAA,EAAmC;IAC1C,OAAO;MACL,GAAG,KAAK,CAACA,UAAA,EAAY;MACrB,GAAG,IAAI,CAACC,OAAO,EAAE;MACjBC,IAAA,EAAM;IACR;EACF;EAEAD,QAAA,EAAsB;IACpB,OAAO,IAAI,CAACE,SAAS,GAAG1C,MAAM;EAChC;EAEA2C,QAAQzC,IAAgB,EAAQ;IAC9B,MAAM0C,QAAA,GAAW,IAAI,CAACC,WAAW;IACjCD,QAAA,CAAS5C,MAAM,GAAGE,IAAA;EACpB;EAES4C,UAAA,EAAmB;IAC1B,OAAO;EACT;AACF;AAEA,OAAO,SAAShC,wBAAwB;EACtCZ;AAAI,CAGL;EACC,IAAI,CAACA,IAAA,EAAMiB,EAAA,EAAI;IACbjB,IAAA,CAAKiB,EAAE,GAAG,IAAIvB,QAAA,CAASmD,OAAO,GAAGC,WAAW;EAC9C;EACA,OAAOnD,qBAAA,CAAsB,IAAIE,gBAAA,CAAiB;IAAEG,IAAA,EAAMA;EAAmB;AAC/E;AAEA,OAAO,SAAS+C,oBACd3C,IAAoC;EAEpC,OAAOA,IAAA,YAAgBP,gBAAA;AACzB","ignoreList":[]}
@@ -1,7 +1,7 @@
1
1
  import type { DataFromCollectionSlug, IDTypeForCollectionSlug, JsonObject, TypedUploadCollection, UploadCollectionSlug } from 'payload';
2
2
  import type { LexicalElementFormat } from '../../../types/nodeTypes.js';
3
3
  import type { JSONSchemaFn } from '../../typesServer.js';
4
- import type { UploadFeatureProps } from './index.js';
4
+ import type { UploadFeatureServerProps } from './index.js';
5
5
  export type UploadData<TFields extends JsonObject = JsonObject> = {
6
6
  [TCollectionSlug in UploadCollectionSlug]: {
7
7
  fields: TFields;
@@ -9,7 +9,7 @@ export type UploadData<TFields extends JsonObject = JsonObject> = {
9
9
  id: string;
10
10
  relationTo: TCollectionSlug;
11
11
  /** Either the document ID or the full populated document. */
12
- value: DataFromCollectionSlug<TCollectionSlug> | IDTypeForCollectionSlug<TCollectionSlug>;
12
+ value: IDTypeForCollectionSlug<TCollectionSlug> | TypedUploadCollection[TCollectionSlug];
13
13
  };
14
14
  }[UploadCollectionSlug];
15
15
  /** @internal Adds a pending state to `UploadData`. */
@@ -21,19 +21,6 @@ export type Internal_UploadData<TFields extends JsonObject = JsonObject> = {
21
21
  src: string;
22
22
  };
23
23
  } & UploadData<TFields>;
24
- /**
25
- * More precise variant of {@link UploadData}. Replaces `UploadData` in v4.
26
- * @internal
27
- * @todo Replace UploadData with UploadDataImproved in 4.0
28
- */
29
- export type UploadDataImproved<TFields extends JsonObject = JsonObject> = {
30
- [TCollectionSlug in UploadCollectionSlug]: {
31
- fields: TFields;
32
- id: string;
33
- relationTo: TCollectionSlug;
34
- value: IDTypeForCollectionSlug<TCollectionSlug> | TypedUploadCollection[TCollectionSlug];
35
- };
36
- }[UploadCollectionSlug];
37
24
  export type SerializedUploadNode<TSlugs extends UploadCollectionSlug = UploadCollectionSlug, TFields = {
38
25
  [k: string]: unknown;
39
26
  }> = {
@@ -46,7 +33,8 @@ export type SerializedUploadNode<TSlugs extends UploadCollectionSlug = UploadCol
46
33
  format: LexicalElementFormat;
47
34
  id: string;
48
35
  type: 'upload';
36
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
49
37
  version: number;
50
38
  };
51
- export declare const createUploadNodeJSONSchema: (props: undefined | UploadFeatureProps) => JSONSchemaFn;
39
+ export declare const createUploadNodeJSONSchema: (props: UploadFeatureServerProps) => JSONSchemaFn;
52
40
  //# sourceMappingURL=schema.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/schema.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACV,sBAAsB,EACtB,uBAAuB,EACvB,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAKhB,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,6BAA6B,CAAA;AACvE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAA;AACxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AAKpD,MAAM,MAAM,UAAU,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI;KAC/D,eAAe,IAAI,oBAAoB,GAAG;QACzC,MAAM,EAAE,OAAO,CAAA;QACf,6DAA6D;QAC7D,EAAE,EAAE,MAAM,CAAA;QACV,UAAU,EAAE,eAAe,CAAA;QAC3B,6DAA6D;QAC7D,KAAK,EAAE,sBAAsB,CAAC,eAAe,CAAC,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAA;KAC1F;CACF,CAAC,oBAAoB,CAAC,CAAA;AAEvB,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI;IACzE,OAAO,CAAC,EAAE;QACR,2BAA2B;QAC3B,MAAM,EAAE,MAAM,CAAA;QACd,sCAAsC;QACtC,GAAG,EAAE,MAAM,CAAA;KACZ,CAAA;CACF,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;AAEvB;;;;GAIG;AACH,MAAM,MAAM,kBAAkB,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI;KACvE,eAAe,IAAI,oBAAoB,GAAG;QACz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G;QACzC,MAAM,EAAE,OAAO,CAAA;QACf,6DAA6D;QAC7D,EAAE,EAAE,MAAM,CAAA;QACV,UAAU,EAAE,eAAe,CAAA;QAC3B,6DAA6D;QAC7D,KAAK,EAAE,uBAAuB,CAAC,eAAe,CAAC,GAAG,qBAAqB,CAAC,eAAe,CAAC,CAAA;KACzF;CACF,CAAC,oBAAoB,CAAC,CAAA;AAEvB,sDAAsD;AACtD,MAAM,MAAM,mBAAmB,CAAC,OAAO,SAAS,UAAU,GAAG,UAAU,IAAI;IACzE,OAAO,CAAC,EAAE;QACR,2BAA2B;QAC3B,MAAM,EAAE,MAAM,CAAA;QACd,sCAAsC;QACtC,GAAG,EAAE,MAAM,CAAA;KACZ,CAAA;CACF,GAAG,UAAU,CAAC,OAAO,CAAC,CAAA;AAEvB,MAAM,MAAM,oBAAoB,CAC9B,MAAM,SAAS,oBAAoB,GAAG,oBAAoB,EAC1D,OAAO,GAAG;IAAE,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAAA;CAAE,IAChC;KACD,KAAK,IAAI,MAAM,GAAG;QACjB,UAAU,EAAE,KAAK,CAAA;QACjB,KAAK,EAAE,sBAAsB,CAAC,KAAK,CAAC,GAAG,uBAAuB,CAAC,KAAK,CAAC,CAAA;KACtE;CACF,CAAC,MAAM,CAAC,GAAG;IACV,MAAM,EAAE,OAAO,CAAA;IACf,MAAM,EAAE,oBAAoB,CAAA;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,QAAQ,CAAA;IACd,wJAAwJ;IACxJ,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAmCD,eAAO,MAAM,0BAA0B,UAC7B,wBAAwB,KAAG,YAmGlC,CAAA"}
@@ -1,12 +1,12 @@
1
1
  import { createHash } from 'crypto';
2
2
  import { fieldsToJSONSchema, flattenAllFields } from 'payload';
3
3
  import { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js';
4
- import { filterEnabledRelationshipCollections } from '../../relationship/shared/filterEnabledRelationshipCollections.js';
5
4
  /** MUST stay byte-for-byte in sync with the runtime `SerializedUploadNode` declared above. */
6
5
  const SERIALIZED_UPLOAD_NODE_TS = `export type SerializedUploadNode<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {
7
6
  type: 'upload';
8
7
  format: LexicalElementFormat;
9
8
  id: string;
9
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
10
10
  version: number;
11
11
  fields: TFields;
12
12
  } & {
@@ -20,6 +20,7 @@ const SERIALIZED_UPLOAD_NODE_INPUT_TS = `export type SerializedUploadNodeInput<T
20
20
  type: 'upload';
21
21
  format: LexicalElementFormat;
22
22
  id: string;
23
+ /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */
23
24
  version: number;
24
25
  fields: TFields;
25
26
  } & {
@@ -39,11 +40,9 @@ export const createUploadNodeJSONSchema = props => ({
39
40
  }) => {
40
41
  const isInput = variant === 'input';
41
42
  typeStringDefinitions.add(isInput ? SERIALIZED_UPLOAD_NODE_INPUT_TS : SERIALIZED_UPLOAD_NODE_TS);
42
- const enabledCollections = config?.collections ? filterEnabledRelationshipCollections(config.collections, {
43
- disabledCollections: props?.disabledCollections,
44
- enabledCollections: props?.enabledCollections,
45
- uploads: true
46
- }) : [];
43
+ const {
44
+ enabledCollectionSlugs
45
+ } = props;
47
46
  // Configured extra fields are registered as their own interface and referenced here, so the
48
47
  // generated TypeScript keeps them - the node-level `tsType` would otherwise erase `fields` to
49
48
  // `{ [k: string]: unknown }`. Mirrors how LinkFeature handles custom link fields.
@@ -52,8 +51,7 @@ export const createUploadNodeJSONSchema = props => ({
52
51
  // generated union correctly pairs each `relationTo` with its own fields type. A single
53
52
  // `SerializedUploadNode<'a' | 'b', AFields | BFields>` would lose that pairing.
54
53
  const perCollectionTsTypes = [];
55
- const collectionVariants = enabledCollections.map(collection => {
56
- const slug = collection.slug;
54
+ const collectionVariants = enabledCollectionSlugs.map(slug => {
57
55
  const idType = collectionIDFieldTypes[slug] ?? 'string';
58
56
  const extraFields = props?.collections?.[slug]?.fields ?? [];
59
57
  const flattenedExtra = flattenAllFields({
@@ -117,7 +115,7 @@ export const createUploadNodeJSONSchema = props => ({
117
115
  },
118
116
  version: versionSchema
119
117
  },
120
- required: ['fields', 'format', 'id', 'relationTo', 'type', 'value', 'version']
118
+ required: ['fields', 'format', 'id', 'relationTo', 'type', 'value']
121
119
  };
122
120
  });
123
121
  let schema;
@@ -133,7 +131,7 @@ export const createUploadNodeJSONSchema = props => ({
133
131
  },
134
132
  version: versionSchema
135
133
  },
136
- required: ['type', 'version']
134
+ required: ['type']
137
135
  };
138
136
  } else {
139
137
  const baseSchema = collectionVariants.length === 1 ? collectionVariants[0] : {
@@ -1 +1 @@
1
- {"version":3,"file":"schema.js","names":["createHash","fieldsToJSONSchema","flattenAllFields","formatSchema","versionSchema","filterEnabledRelationshipCollections","SERIALIZED_UPLOAD_NODE_TS","SERIALIZED_UPLOAD_NODE_INPUT_TS","hashUploadFields","schema","update","JSON","stringify","digest","slice","toUpperCase","createUploadNodeJSONSchema","props","collectionIDFieldTypes","config","i18n","interfaceNameDefinitions","typeStringDefinitions","variant","isInput","add","enabledCollections","collections","disabledCollections","uploads","perCollectionTsTypes","collectionVariants","map","collection","slug","idType","extraFields","fields","flattenedExtra","extraFieldsSchema","length","properties","required","fieldsSchema","type","additionalProperties","fieldsTypeName","set","$ref","uploadTsName","push","id","const","format","relationTo","value","description","oneOf","version","baseSchema","tsType","join"],"sources":["../../../../src/features/upload/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type {\n DataFromCollectionSlug,\n IDTypeForCollectionSlug,\n JsonObject,\n TypedUploadCollection,\n UploadCollectionSlug,\n} from 'payload'\n\nimport { createHash } from 'crypto'\nimport { fieldsToJSONSchema, flattenAllFields } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\nimport type { UploadFeatureProps } from './index.js'\n\nimport { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js'\nimport { filterEnabledRelationshipCollections } from '../../relationship/shared/filterEnabledRelationshipCollections.js'\n\nexport type UploadData<TFields extends JsonObject = JsonObject> = {\n [TCollectionSlug in UploadCollectionSlug]: {\n fields: TFields\n /** ID of this upload node — NOT the linked document's ID. */\n id: string\n relationTo: TCollectionSlug\n /** Either the document ID or the full populated document. */\n value: DataFromCollectionSlug<TCollectionSlug> | IDTypeForCollectionSlug<TCollectionSlug>\n }\n}[UploadCollectionSlug]\n\n/** @internal Adds a pending state to `UploadData`. */\nexport type Internal_UploadData<TFields extends JsonObject = JsonObject> = {\n pending?: {\n /** Bulk upload form ID. */\n formID: string\n /** `src` of the image DOM element. */\n src: string\n }\n} & UploadData<TFields>\n\n/**\n * More precise variant of {@link UploadData}. Replaces `UploadData` in v4.\n * @internal\n * @todo Replace UploadData with UploadDataImproved in 4.0\n */\nexport type UploadDataImproved<TFields extends JsonObject = JsonObject> = {\n [TCollectionSlug in UploadCollectionSlug]: {\n fields: TFields\n id: string\n relationTo: TCollectionSlug\n value: IDTypeForCollectionSlug<TCollectionSlug> | TypedUploadCollection[TCollectionSlug]\n }\n}[UploadCollectionSlug]\n\nexport type SerializedUploadNode<\n TSlugs extends UploadCollectionSlug = UploadCollectionSlug,\n TFields = { [k: string]: unknown },\n> = {\n [TSlug in TSlugs]: {\n relationTo: TSlug\n value: DataFromCollectionSlug<TSlug> | IDTypeForCollectionSlug<TSlug>\n }\n}[TSlugs] & {\n fields: TFields\n format: LexicalElementFormat\n id: string\n type: 'upload'\n version: number\n}\n\n/** MUST stay byte-for-byte in sync with the runtime `SerializedUploadNode` declared above. */\nconst SERIALIZED_UPLOAD_NODE_TS = `export type SerializedUploadNode<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {\n type: 'upload';\n format: LexicalElementFormat;\n id: string;\n version: number;\n fields: TFields;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'] | Config['collections'][TSlug];\n };\n}[TSlugs];`\n\n/** Input variant of `SerializedUploadNode`: `value` is ID-only (you only ever write an ID). */\nconst SERIALIZED_UPLOAD_NODE_INPUT_TS = `export type SerializedUploadNodeInput<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {\n type: 'upload';\n format: LexicalElementFormat;\n id: string;\n version: number;\n fields: TFields;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'];\n };\n}[TSlugs];`\n\nconst hashUploadFields = (schema: JSONSchema4): string =>\n createHash('sha256').update(JSON.stringify(schema)).digest('hex').slice(0, 8).toUpperCase()\n\nexport const createUploadNodeJSONSchema =\n (props: undefined | UploadFeatureProps): JSONSchemaFn =>\n ({\n collectionIDFieldTypes,\n config,\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n variant,\n }) => {\n const isInput = variant === 'input'\n typeStringDefinitions.add(isInput ? SERIALIZED_UPLOAD_NODE_INPUT_TS : SERIALIZED_UPLOAD_NODE_TS)\n const enabledCollections = config?.collections\n ? filterEnabledRelationshipCollections(config.collections, {\n disabledCollections: props?.disabledCollections,\n enabledCollections: props?.enabledCollections,\n uploads: true,\n })\n : []\n\n // Configured extra fields are registered as their own interface and referenced here, so the\n // generated TypeScript keeps them - the node-level `tsType` would otherwise erase `fields` to\n // `{ [k: string]: unknown }`. Mirrors how LinkFeature handles custom link fields.\n //\n // Each collection gets its own `SerializedUploadNode<'slug', Fields>` instantiation so the\n // generated union correctly pairs each `relationTo` with its own fields type. A single\n // `SerializedUploadNode<'a' | 'b', AFields | BFields>` would lose that pairing.\n const perCollectionTsTypes: string[] = []\n const collectionVariants: JSONSchema4[] = enabledCollections.map((collection) => {\n const slug = collection.slug\n const idType: 'number' | 'string' = collectionIDFieldTypes[slug] ?? 'string'\n const extraFields = props?.collections?.[slug]?.fields ?? []\n const flattenedExtra = flattenAllFields({ fields: extraFields })\n const extraFieldsSchema =\n flattenedExtra.length > 0 && config\n ? fieldsToJSONSchema({\n collectionIDFieldTypes,\n config,\n fields: flattenedExtra,\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n variant,\n })\n : { properties: {}, required: [] }\n\n let fieldsSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: extraFieldsSchema.properties,\n required: extraFieldsSchema.required,\n }\n let fieldsTypeName: string | undefined\n if (flattenedExtra.length > 0) {\n fieldsTypeName = `LexicalUploadFields_${hashUploadFields(fieldsSchema)}`\n interfaceNameDefinitions.set(fieldsTypeName, fieldsSchema)\n fieldsSchema = { $ref: `#/$defs/${fieldsTypeName}` }\n }\n\n const uploadTsName = isInput ? 'SerializedUploadNodeInput' : 'SerializedUploadNode'\n perCollectionTsTypes.push(\n fieldsTypeName\n ? `${uploadTsName}<'${slug}', ${fieldsTypeName}>`\n : `${uploadTsName}<'${slug}'>`,\n )\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n id: { type: 'string' },\n type: { type: 'string', const: 'upload' },\n fields: fieldsSchema,\n format: formatSchema,\n relationTo: { type: 'string', const: slug },\n value: isInput\n ? { type: idType, description: 'The uploaded file ID.' }\n : {\n description:\n 'The uploaded file by ID (string or number). Populated to the full upload document when read at depth > 0.',\n oneOf: [{ type: idType }, { $ref: `#/$defs/${slug}` }],\n },\n version: versionSchema,\n },\n required: ['fields', 'format', 'id', 'relationTo', 'type', 'value', 'version'],\n }\n })\n\n let schema: JSONSchema4\n if (collectionVariants.length === 0) {\n // Fallback when no enabled upload collections.\n schema = {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: { type: 'string', const: 'upload' },\n version: versionSchema,\n },\n required: ['type', 'version'],\n }\n } else {\n const baseSchema: JSONSchema4 =\n collectionVariants.length === 1 ? collectionVariants[0]! : { oneOf: collectionVariants }\n schema = { ...baseSchema, tsType: perCollectionTsTypes.join(' | ') }\n }\n\n return sch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OAAA,GACH;UAAEoB,IAAA,EAAMT,MAAA;UAAQqB,WAAA,EAAa;QAAwB,IACrD;UACEA,WAAA,EACE;UACFC,KAAA,EAAO,CAAC;YAAEb,IAAA,EAAMT;UAAO,GAAG;YAAEa,IAAA,EAAM,WAAWd,IAAA;UAAO;QACtD;QACJwB,OAAA,EAAStD;MACX;MACAsC,QAAA,EAAU,CAAC,UAAU,UAAU,MAAM,cAAc,QAAQ,SAAS;IACtE;EACF;EAEA,IAAIjC,MAAA;EACJ,IAAIsB,kBAAA,CAAmBS,MAAM,KAAK,GAAG;IACnC;IACA/B,MAAA,GAAS;MACPmC,IAAA,EAAM;MACNC,oBAAA,EAAsB;MACtBJ,UAAA,EAAY;QACVG,IAAA,EAAM;UAAEA,IAAA,EAAM;UAAUQ,KAAA,EAAO;QAAS;QACxCM,OAAA,EAAStD;MACX;MACAsC,QAAA,EAAU,CAAC,QAAQ;IACrB;EACF,OAAO;IACL,MAAMiB,UAAA,GACJ5B,kBAAA,CAAmBS,MAAM,KAAK,IAAIT,kBAAkB,CAAC,EAAE,GAAI;MAAE0B,KAAA,EAAO1B;IAAmB;IACzFtB,MAAA,GAAS;MAAE,GAAGkD,UAAU;MAAEC,MAAA,EAAQ9B,oBAAA,CAAqB+B,IAAI,CAAC;IAAO;EACrE;EAEA,OAAOpD,MAAA;AACT","ignoreList":[]}
1
+ {"version":3,"file":"schema.js","names":["createHash","fieldsToJSONSchema","flattenAllFields","formatSchema","versionSchema","SERIALIZED_UPLOAD_NODE_TS","SERIALIZED_UPLOAD_NODE_INPUT_TS","hashUploadFields","schema","update","JSON","stringify","digest","slice","toUpperCase","createUploadNodeJSONSchema","props","collectionIDFieldTypes","config","i18n","interfaceNameDefinitions","typeStringDefinitions","variant","isInput","add","enabledCollectionSlugs","perCollectionTsTypes","collectionVariants","map","slug","idType","extraFields","collections","fields","flattenedExtra","extraFieldsSchema","length","properties","required","fieldsSchema","type","additionalProperties","fieldsTypeName","set","$ref","uploadTsName","push","id","const","format","relationTo","value","description","oneOf","version","baseSchema","tsType","join"],"sources":["../../../../src/features/upload/server/schema.ts"],"sourcesContent":["import type { JSONSchema4 } from 'json-schema'\nimport type {\n DataFromCollectionSlug,\n IDTypeForCollectionSlug,\n JsonObject,\n TypedUploadCollection,\n UploadCollectionSlug,\n} from 'payload'\n\nimport { createHash } from 'crypto'\nimport { fieldsToJSONSchema, flattenAllFields } from 'payload'\n\nimport type { LexicalElementFormat } from '../../../types/nodeTypes.js'\nimport type { JSONSchemaFn } from '../../typesServer.js'\nimport type { UploadFeatureServerProps } from './index.js'\n\nimport { formatSchema, versionSchema } from '../../../types/jsonSchemaHelpers.js'\n\nexport type UploadData<TFields extends JsonObject = JsonObject> = {\n [TCollectionSlug in UploadCollectionSlug]: {\n fields: TFields\n /** ID of this upload node — NOT the linked document's ID. */\n id: string\n relationTo: TCollectionSlug\n /** Either the document ID or the full populated document. */\n value: IDTypeForCollectionSlug<TCollectionSlug> | TypedUploadCollection[TCollectionSlug]\n }\n}[UploadCollectionSlug]\n\n/** @internal Adds a pending state to `UploadData`. */\nexport type Internal_UploadData<TFields extends JsonObject = JsonObject> = {\n pending?: {\n /** Bulk upload form ID. */\n formID: string\n /** `src` of the image DOM element. */\n src: string\n }\n} & UploadData<TFields>\n\nexport type SerializedUploadNode<\n TSlugs extends UploadCollectionSlug = UploadCollectionSlug,\n TFields = { [k: string]: unknown },\n> = {\n [TSlug in TSlugs]: {\n relationTo: TSlug\n value: DataFromCollectionSlug<TSlug> | IDTypeForCollectionSlug<TSlug>\n }\n}[TSlugs] & {\n fields: TFields\n format: LexicalElementFormat\n id: string\n type: 'upload'\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number\n}\n\n/** MUST stay byte-for-byte in sync with the runtime `SerializedUploadNode` declared above. */\nconst SERIALIZED_UPLOAD_NODE_TS = `export type SerializedUploadNode<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {\n type: 'upload';\n format: LexicalElementFormat;\n id: string;\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number;\n fields: TFields;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'] | Config['collections'][TSlug];\n };\n}[TSlugs];`\n\n/** Input variant of `SerializedUploadNode`: `value` is ID-only (you only ever write an ID). */\nconst SERIALIZED_UPLOAD_NODE_INPUT_TS = `export type SerializedUploadNodeInput<TSlugs extends keyof Config['collections'], TFields = { [k: string]: unknown }> = {\n type: 'upload';\n format: LexicalElementFormat;\n id: string;\n /** @deprecated Ignored when loading. Typed as required only to match Lexical's types: rich text sent through the API, CLI or MCP may not contain it. */\n version: number;\n fields: TFields;\n} & {\n [TSlug in TSlugs]: {\n relationTo: TSlug;\n value: Config['collections'][TSlug]['id'];\n };\n}[TSlugs];`\n\nconst hashUploadFields = (schema: JSONSchema4): string =>\n createHash('sha256').update(JSON.stringify(schema)).digest('hex').slice(0, 8).toUpperCase()\n\nexport const createUploadNodeJSONSchema =\n (props: UploadFeatureServerProps): JSONSchemaFn =>\n ({\n collectionIDFieldTypes,\n config,\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n variant,\n }) => {\n const isInput = variant === 'input'\n typeStringDefinitions.add(isInput ? SERIALIZED_UPLOAD_NODE_INPUT_TS : SERIALIZED_UPLOAD_NODE_TS)\n const { enabledCollectionSlugs } = props\n\n // Configured extra fields are registered as their own interface and referenced here, so the\n // generated TypeScript keeps them - the node-level `tsType` would otherwise erase `fields` to\n // `{ [k: string]: unknown }`. Mirrors how LinkFeature handles custom link fields.\n //\n // Each collection gets its own `SerializedUploadNode<'slug', Fields>` instantiation so the\n // generated union correctly pairs each `relationTo` with its own fields type. A single\n // `SerializedUploadNode<'a' | 'b', AFields | BFields>` would lose that pairing.\n const perCollectionTsTypes: string[] = []\n const collectionVariants: JSONSchema4[] = enabledCollectionSlugs.map((slug) => {\n const idType: 'number' | 'string' = collectionIDFieldTypes[slug] ?? 'string'\n const extraFields = props?.collections?.[slug]?.fields ?? []\n const flattenedExtra = flattenAllFields({ fields: extraFields })\n const extraFieldsSchema =\n flattenedExtra.length > 0 && config\n ? fieldsToJSONSchema({\n collectionIDFieldTypes,\n config,\n fields: flattenedExtra,\n i18n,\n interfaceNameDefinitions,\n typeStringDefinitions,\n variant,\n })\n : { properties: {}, required: [] }\n\n let fieldsSchema: JSONSchema4 = {\n type: 'object',\n additionalProperties: false,\n properties: extraFieldsSchema.properties,\n required: extraFieldsSchema.required,\n }\n let fieldsTypeName: string | undefined\n if (flattenedExtra.length > 0) {\n fieldsTypeName = `LexicalUploadFields_${hashUploadFields(fieldsSchema)}`\n interfaceNameDefinitions.set(fieldsTypeName, fieldsSchema)\n fieldsSchema = { $ref: `#/$defs/${fieldsTypeName}` }\n }\n\n const uploadTsName = isInput ? 'SerializedUploadNodeInput' : 'SerializedUploadNode'\n perCollectionTsTypes.push(\n fieldsTypeName\n ? `${uploadTsName}<'${slug}', ${fieldsTypeName}>`\n : `${uploadTsName}<'${slug}'>`,\n )\n\n return {\n type: 'object',\n additionalProperties: false,\n properties: {\n id: { type: 'string' },\n type: { type: 'string', const: 'upload' },\n fields: fieldsSchema,\n format: formatSchema,\n relationTo: { type: 'string', const: slug },\n value: isInput\n ? { type: idType, description: 'The uploaded file ID.' }\n : {\n description:\n 'The uploaded file by ID (string or number). Populated to the full upload document when read at depth > 0.',\n oneOf: [{ type: idType }, { $ref: `#/$defs/${slug}` }],\n },\n version: versionSchema,\n },\n required: ['fields', 'format', 'id', 'relationTo', 'type', 'value'],\n }\n })\n\n let schema: JSONSchema4\n if (collectionVariants.length === 0) {\n // Fallback when no enabled upload collections.\n schema = {\n type: 'object',\n additionalProperties: true,\n properties: {\n type: { type: 'string', const: 'upload' },\n version: versionSchema,\n },\n required: ['type'],\n }\n } else {\n const baseSchema: JSONSchema4 =\n collectionVariants.length === 1 ? collectionVariants[0]! : { oneOf: collectionVariants }\n schema = { ...baseSchema, tsType: perCollectionTsTypes.join(' | ') }\n }\n\n return schema\n }\n"],"mappings":"AASA,SAASA,UAAU,QAAQ;AAC3B,SAASC,kBAAkB,EAAEC,gBAAgB,QAAQ;AAMrD,SAASC,YAAY,EAAEC,aAAa,QAAQ;AAwC5C;AACA,MAAMC,yBAAA,GAA4B;;;;;;;;;;;;WAYvB;AAEX;AACA,MAAMC,+BAAA,GAAkC;;;;;;;;;;;;WAY7B;AAEX,MAAMC,gBAAA,GAAoBC,MAAA,IACxBR,UAAA,CAAW,UAAUS,MAAM,CAACC,IAAA,CAAKC,SAAS,CAACH,MAAA,GAASI,MAAM,CAAC,OAAOC,KAAK,CAAC,GAAG,GAAGC,WAAW;AAE3F,OAAO,MAAMC,0BAAA,GACVC,KAAA,IACD,CAAC;EACCC,sBAAsB;EACtBC,MAAM;EACNC,IAAI;EACJC,wBAAwB;EACxBC,qBAAqB;EACrBC;AAAO,CACR;EACC,MAAMC,OAAA,GAAUD,OAAA,KAAY;EAC5BD,qBAAA,CAAsBG,GAAG,CAACD,OAAA,GAAUjB,+BAAA,GAAkCD,yBAAA;EACtE,MAAM;IAAEoB;EAAsB,CAAE,GAAGT,KAAA;EAEnC;EACA;EACA;EACA;EACA;EACA;EACA;EACA,MAAMU,oBAAA,GAAiC,EAAE;EACzC,MAAMC,kBAAA,GAAoCF,sBAAA,CAAuBG,GAAG,CAAEC,IAAA;IACpE,MAAMC,MAAA,GAA8Bb,sBAAsB,CAACY,IAAA,CAAK,IAAI;IACpE,MAAME,WAAA,GAAcf,KAAA,EAAOgB,WAAA,GAAcH,IAAA,CAAK,EAAEI,MAAA,IAAU,EAAE;IAC5D,MAAMC,cAAA,GAAiBhC,gBAAA,CAAiB;MAAE+B,MAAA,EAAQF;IAAY;IAC9D,MAAMI,iBAAA,GACJD,cAAA,CAAeE,MAAM,GAAG,KAAKlB,MAAA,GACzBjB,kBAAA,CAAmB;MACjBgB,sBAAA;MACAC,MAAA;MACAe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QACJyB,OAAA,EAASlD;MACX;MACAkC,QAAA,EAAU,CAAC,UAAU,UAAU,MAAM,cAAc,QAAQ;IAC7D;EACF;EAEA,IAAI9B,MAAA;EACJ,IAAImB,kBAAA,CAAmBS,MAAM,KAAK,GAAG;IACnC;IACA5B,MAAA,GAAS;MACPgC,IAAA,EAAM;MACNC,oBAAA,EAAsB;MACtBJ,UAAA,EAAY;QACVG,IAAA,EAAM;UAAEA,IAAA,EAAM;UAAUQ,KAAA,EAAO;QAAS;QACxCM,OAAA,EAASlD;MACX;MACAkC,QAAA,EAAU,CAAC;IACb;EACF,OAAO;IACL,MAAMiB,UAAA,GACJ5B,kBAAA,CAAmBS,MAAM,KAAK,IAAIT,kBAAkB,CAAC,EAAE,GAAI;MAAE0B,KAAA,EAAO1B;IAAmB;IACzFnB,MAAA,GAAS;MAAE,GAAG+C,UAAU;MAAEC,MAAA,EAAQ9B,oBAAA,CAAqB+B,IAAI,CAAC;IAAO;EACrE;EAEA,OAAOjD,MAAA;AACT","ignoreList":[]}
@@ -1,5 +1,5 @@
1
1
  import type { NodeValidation } from '../../typesServer.js';
2
- import type { UploadFeatureProps } from './index.js';
2
+ import type { UploadFeatureServerProps } from './index.js';
3
3
  import type { SerializedUploadNode } from './schema.js';
4
- export declare const uploadValidation: (props: UploadFeatureProps) => NodeValidation<SerializedUploadNode>;
4
+ export declare const uploadValidation: (props: UploadFeatureServerProps) => NodeValidation<SerializedUploadNode>;
5
5
  //# sourceMappingURL=validate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,gBAAgB,UACpB,kBAAkB,KACxB,cAAc,CAAC,oBAAoB,CAqErC,CAAA"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,YAAY,CAAA;AAC1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAA;AAEvD,eAAO,MAAM,gBAAgB,UACpB,wBAAwB,KAC9B,cAAc,CAAC,oBAAoB,CAyErC,CAAA"}
@@ -17,6 +17,9 @@ export const uploadValidation = props => {
17
17
  }
18
18
  }
19
19
  }) => {
20
+ if (!props.enabledCollectionSlugs.includes(node.relationTo)) {
21
+ return t('validation:invalidSelection');
22
+ }
20
23
  const idType = payload.collections[node.relationTo]?.customIDType || payload.db.defaultIDType;
21
24
  // @ts-expect-error - Fix in Payload v4
22
25
  const nodeID = node?.value?.id || node?.value // for backwards-compatibility
@@ -42,7 +45,7 @@ export const uploadValidation = props => {
42
45
  fields: collection.fields,
43
46
  fieldSchemaMap: undefined,
44
47
  initialBlockData: node?.fields ?? {},
45
- operation: operation === 'create' || operation === 'update' ? operation : 'update',
48
+ operation,
46
49
  permissions: {},
47
50
  preferences,
48
51
  renderAllFields: false,
@@ -1 +1 @@
1
- {"version":3,"file":"validate.js","names":["fieldSchemasToFormState","isValidID","uploadValidation","props","node","validation","options","id","data","operation","preferences","req","payload","t","idType","collections","relationTo","customIDType","db","defaultIDType","nodeID","value","Object","keys","length","collection","fields","result","collectionSlug","documentData","fieldSchemaMap","undefined","initialBlockData","permissions","renderAllFields","schemaPath","errorPathsSet","Set","fieldKey","fieldState","errorPaths","errorPath","add","Array","from","join"],"sources":["../../../../src/features/upload/server/validate.ts"],"sourcesContent":["import { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToFormState'\nimport { isValidID } from 'payload'\n\nimport type { NodeValidation } from '../../typesServer.js'\nimport type { UploadFeatureProps } from './index.js'\nimport type { SerializedUploadNode } from './schema.js'\n\nexport const uploadValidation = (\n props: UploadFeatureProps,\n): NodeValidation<SerializedUploadNode> => {\n return async ({\n node,\n validation: {\n options: {\n id,\n data,\n operation,\n preferences,\n req,\n req: { payload, t },\n },\n },\n }) => {\n const idType = payload.collections[node.relationTo]?.customIDType || payload.db.defaultIDType\n // @ts-expect-error - Fix in Payload v4\n const nodeID = node?.value?.id || node?.value // for backwards-compatibility\n\n if (!isValidID(nodeID, idType)) {\n return t('validation:validUploadID')\n }\n\n if (!props?.collections) {\n return true\n }\n\n if (Object.keys(props?.collections).length === 0) {\n return true\n }\n\n const collection = props?.collections[node.relationTo]\n\n if (!collection?.fields?.length) {\n return true\n }\n\n const result = await fieldSchemasToFormState({\n id,\n collectionSlug: node.relationTo,\n data: node?.fields ?? {},\n documentData: data,\n fields: collection.fields,\n fieldSchemaMap: undefined,\n initialBlockData: node?.fields ?? {},\n operation: operation === 'create' || operation === 'update' ? operation : 'update',\n permissions: {},\n preferences,\n renderAllFields: false,\n req,\n schemaPath: '',\n })\n\n const errorPathsSet = new Set<string>()\n for (const fieldKey in result) {\n const fieldState = result[fieldKey]\n if (fieldState?.errorPaths?.length) {\n for (const errorPath of fieldState.errorPaths) {\n errorPathsSet.add(errorPath)\n }\n }\n }\n const errorPaths = Array.from(errorPathsSet)\n\n if (errorPaths.length) {\n return 'The following fields are invalid: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ;AACxC,SAASC,SAAS,QAAQ;AAM1B,OAAO,MAAMC,gBAAA,GACXC,KAAA;EAEA,OAAO,OAAO;IACZC,IAAI;IACJC,UAAA,EAAY;MACVC,OAAA,EAAS;QACPC,EAAE;QACFC,IAAI;QACJC,SAAS;QACTC,WAAW;QACXC,GAAG;QACHA,GAAA,EAAK;UAAEC,OAAO;UAAEC;QAAC;MAAE;IACpB;EACF,CACF;IACC,M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,MAAM,CAACW,QAAA,CAAS;MACnC,IAAIC,UAAA,EAAYC,UAAA,EAAYhB,MAAA,EAAQ;QAClC,KAAK,MAAMiB,SAAA,IAAaF,UAAA,CAAWC,UAAU,EAAE;UAC7CJ,aAAA,CAAcM,GAAG,CAACD,SAAA;QACpB;MACF;IACF;IACA,MAAMD,UAAA,GAAaG,KAAA,CAAMC,IAAI,CAACR,aAAA;IAE9B,IAAII,UAAA,CAAWhB,MAAM,EAAE;MACrB,OAAO,uCAAuCgB,UAAA,CAAWK,IAAI,CAAC;IAChE;IAEA,OAAO;EACT;AACF","ignoreList":[]}
1
+ {"version":3,"file":"validate.js","names":["fieldSchemasToFormState","isValidID","uploadValidation","props","node","validation","options","id","data","operation","preferences","req","payload","t","enabledCollectionSlugs","includes","relationTo","idType","collections","customIDType","db","defaultIDType","nodeID","value","Object","keys","length","collection","fields","result","collectionSlug","documentData","fieldSchemaMap","undefined","initialBlockData","permissions","renderAllFields","schemaPath","errorPathsSet","Set","fieldKey","fieldState","errorPaths","errorPath","add","Array","from","join"],"sources":["../../../../src/features/upload/server/validate.ts"],"sourcesContent":["import { fieldSchemasToFormState } from '@payloadcms/ui/forms/fieldSchemasToFormState'\nimport { isValidID } from 'payload'\n\nimport type { NodeValidation } from '../../typesServer.js'\nimport type { UploadFeatureServerProps } from './index.js'\nimport type { SerializedUploadNode } from './schema.js'\n\nexport const uploadValidation = (\n props: UploadFeatureServerProps,\n): NodeValidation<SerializedUploadNode> => {\n return async ({\n node,\n validation: {\n options: {\n id,\n data,\n operation,\n preferences,\n req,\n req: { payload, t },\n },\n },\n }) => {\n if (!props.enabledCollectionSlugs.includes(node.relationTo)) {\n return t('validation:invalidSelection')\n }\n\n const idType = payload.collections[node.relationTo]?.customIDType || payload.db.defaultIDType\n // @ts-expect-error - Fix in Payload v4\n const nodeID = node?.value?.id || node?.value // for backwards-compatibility\n\n if (!isValidID(nodeID, idType)) {\n return t('validation:validUploadID')\n }\n\n if (!props?.collections) {\n return true\n }\n\n if (Object.keys(props?.collections).length === 0) {\n return true\n }\n\n const collection = props?.collections[node.relationTo]\n\n if (!collection?.fields?.length) {\n return true\n }\n\n const result = await fieldSchemasToFormState({\n id,\n collectionSlug: node.relationTo,\n data: node?.fields ?? {},\n documentData: data,\n fields: collection.fields,\n fieldSchemaMap: undefined,\n initialBlockData: node?.fields ?? {},\n operation,\n permissions: {},\n preferences,\n renderAllFields: false,\n req,\n schemaPath: '',\n })\n\n const errorPathsSet = new Set<string>()\n for (const fieldKey in result) {\n const fieldState = result[fieldKey]\n if (fieldState?.errorPaths?.length) {\n for (const errorPath of fieldState.errorPaths) {\n errorPathsSet.add(errorPath)\n }\n }\n }\n const errorPaths = Array.from(errorPathsSet)\n\n if (errorPaths.length) {\n return 'The following fields are invalid: ' + errorPaths.join(', ')\n }\n\n return true\n }\n}\n"],"mappings":"AAAA,SAASA,uBAAuB,QAAQ;AACxC,SAASC,SAAS,QAAQ;AAM1B,OAAO,MAAMC,gBAAA,GACXC,KAAA;EAEA,OAAO,OAAO;IACZC,IAAI;IACJC,UAAA,EAAY;MACVC,OAAA,EAAS;QACPC,EAAE;QACFC,IAAI;QACJC,SAAS;QACTC,WAAW;QACXC,GAAG;QACHA,GAAA,EAAK;UAAEC,OAAO;UAAEC;QAAC;MAAE;IACpB;EACF,CACF;IACC,IAAI,CAACV,KAAA,CAAMW,sBAAsB,CAACC,QAAQ,CAACX,IAAA,CAAKY,UAAU,GAAG;MAC3D,OAAOH,CAAA,CAAE;IACX;IAEA,MAAMI,MAAA,GAASL,OAAA,CAAQM,WAAW,CAACd,IAAA,CAAKY,UAAU,CAAC,EAAEG,YAAA,IAAgBP,OAAA,CAAQQ,EAAE,CAACC,aAAa;IAC7F;IACA,MAAMC,MAAA,GAASlB,IAAA,EAAMmB,KAAA,EAAOhB,EAAA,IAAMH,IAAA,EAAMmB,KAAA,CAAM;AAAA;IAE9C,IAAI,CAACtB,SAAA,CAAUqB,MAAA,EAAQL,MAAA,GAAS;MAC9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A,OAAO;EACT;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/Diff/converters/listitem/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AACvG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAE5E,OAAO,aAAa,CAAA;AAEpB,eAAO,MAAM,8BAA8B,EAAE,mBAAmB,CAAC,sBAAsB,CA+DtF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/Diff/converters/listitem/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,8DAA8D,CAAA;AACvG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAA;AAE5E,OAAO,aAAa,CAAA;AAEpB,eAAO,MAAM,8BAA8B,EAAE,mBAAmB,CAAC,sBAAsB,CA+DtF,CAAA"}
@@ -1,5 +1,6 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
2
  import { CheckIcon } from '@payloadcms/ui/rsc';
3
+ import escapeHTML from 'escape-html';
3
4
  import './index.css';
4
5
  export const ListItemDiffHTMLConverterAsync = {
5
6
  listitem: async ({
@@ -57,7 +58,7 @@ export const ListItemDiffHTMLConverterAsync = {
57
58
  return `<li
58
59
  class="${hasSubLists ? 'nestedListItem' : ''}"
59
60
  style="${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}"
60
- value="${node.value}"
61
+ value="${escapeHTML(String(node.value))}"
61
62
  data-enable-match="true"
62
63
  >${children}</li>`;
63
64
  }
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["CheckIcon","ListItemDiffHTMLConverterAsync","listitem","node","nodesToHTML","parent","providedCSSString","hasSubLists","children","some","child","type","nodes","join","listType","ReactDOMServer","default","JSX","_jsx","checked","className","role","tabIndex","value","dangerouslySetInnerHTML","__html","_jsxs","html","renderToStaticMarkup","styleIndex","indexOf","classIndex","classEndIndex","substring","classNameWithStyle","htmlWithStyle","replace"],"sources":["../../../../../src/field/Diff/converters/listitem/index.tsx"],"sourcesContent":["import { CheckIcon } from '@payloadcms/ui/rsc'\n\nimport type { HTMLConvertersAsync } from '../../../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedListItemNode } from '../../../../types/nodeTypes.js'\n\nimport './index.css'\n\nexport const ListItemDiffHTMLConverterAsync: HTMLConvertersAsync<SerializedListItemNode> = {\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const ReactDOMServer = (await import('react-dom/server')).default\n\n const JSX = (\n <li\n aria-checked={node.checked ? true : false}\n className={`checkboxItem ${node.checked ? 'checkboxItem--checked' : 'checkboxItem--unchecked'}${\n hasSubLists ? ' checkboxItem--nested' : ''\n }`}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"checkbox\"\n tabIndex={-1}\n value={node.value}\n >\n {hasSubLists ? (\n // When sublists exist, just render them safely as HTML\n <div dangerouslySetInnerHTML={{ __html: children }} />\n ) : (\n // Otherwise, show our custom styled checkbox\n <div className=\"checkboxItem__wrapper\">\n <div\n className=\"checkboxItem__icon\"\n data-checked={node.checked}\n data-enable-match=\"true\"\n >\n {node.checked && <CheckIcon />}\n </div>\n <span className=\"checkboxItem__label\">{children}</span>\n </div>\n )}\n </li>\n )\n\n const html = ReactDOMServer.renderToStaticMarkup(JSX)\n\n // Add style=\"list-style-type: none;${providedCSSString}\" to html\n const styleIndex = html.indexOf('class=\"list-item-checkbox')\n const classIndex = html.indexOf('class=\"list-item-checkbox', styleIndex)\n const classEndIndex = html.indexOf('\"', classIndex + 6)\n const className = html.substring(classIndex, classEndIndex)\n const classNameWithStyle = `${className} style=\"list-style-type: none;${providedCSSString}\"`\n const htmlWithStyle = html.replace(className, classNameWithStyle)\n\n return htmlWithStyle\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\"${node.value}\"\n data-enable-match=\"true\"\n >${children}</li>`\n }\n },\n}\n"],"mappings":";AAAA,SAASA,SAAS,QAAQ;AAK1B,OAAO;AAEP,OAAO,MAAMC,8BAAA,GAA8E;EACzFC,QAAA,EAAU,MAAAA,CAAO;IAAEC,IAAI;IAAEC,WAAW;IAAEC,MAAM;IAAEC;EAAiB,CAAE;IAC/D,MAAMC,WAAA,GAAcJ,IAAA,CAAKK,QAAQ,CAACC,IAAI,CAAEC,KAAA,IAAUA,KAAA,CAAMC,IAAI,KAAK;IAEjE,MAAMH,QAAA,GAAW,CACf,MAAMJ,WAAA,CAAY;MAChBQ,KAAA,EAAOT,IAAA,CAAKK;IACd,EAAC,EACDK,IAAI,CAAC;IAEP,IAAI,cAAcR,MAAA,IAAUA,MAAA,EAAQS,QAAA,KAAa,SAAS;MACxD,MAAMC,cAAA,GAAiB,CAAC,MAAM,MAAM,CAAC,mBAAkB,EAAGC,OAAO;MAEjE,MAAMC,GAAA,gBACJC,IAAA,CAAC;QACC,gBAAcf,IAAA,CAAKgB,OAAO,GAAG,OAAO;QACpCC,SAAA,EAAW,gBAAgBjB,IAAA,CAAKgB,OAAO,GAAG,0BAA0B,4BAClEZ,WAAA,GAAc,0BAA0B,IACxC;QACF;QACAc,IAAA,EAAK;QACLC,QAAA,EAAU,CAAC;QACXC,KAAA,EAAOpB,IAAA,CAAKoB,KAAK;kBAEhBhB,WAAA;QACC;;QACAW,IAAA,CAAC;UAAIM,uBAAA,EAAyB;YAAEC,MAAA,EAAQjB;UAAS;;QAEjD;;QACAkB,KAAA,CAAC;UAAIN,SAAA,EAAU;kCACbF,IAAA,CAAC;YACCE,SAAA,EAAU;YACV,gBAAcjB,IAAA,CAAKgB,OAAO;YAC1B,qBAAkB;sBAEjBhB,IAAA,CAAKgB,OAAO,iBAAID,IAAA,CAAClB,SAAA;2BAEpBkB,IAAA,CAAC;YAAKE,SAAA,EAAU;sBAAuBZ;;;;MAM/C,MAAMmB,IAAA,GAAOZ,cAAA,CAAea,oBAAoB,CAACX,GAAA;MAEjD;MACA,MAAMY,UAAA,GAAaF,IAAA,CAAKG,OAAO,CAAC;MAChC,MAAMC,UAAA,GAAaJ,IAAA,CAAKG,OAAO,CAAC,6BAA6BD,UAAA;MAC7D,MAAMG,aAAA,GAAgBL,IAAA,CAAKG,OAAO,CAAC,KAAKC,UAAA,GAAa;MACrD,MAAMX,SAAA,GAAYO,IAAA,CAAKM,SAAS,CAACF,UAAA,EAAYC,aAAA;MAC7C,MAAME,kBAAA,GAAqB,GAAGd,SAAA,iCAA0Cd,iBAAA,GAAoB;MAC5F,MAAM6B,aAAA,GAAgBR,IAAA,CAAKS,OAAO,CAAChB,SAAA,EAAWc,kBAAA;MAE9C,OAAOC,aAAA;IACT,OAAO;MACL,OAAO;mBACM5B,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DH,IAAA,CAAKoB,KAAK;;WAElBf,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["CheckIcon","escapeHTML","ListItemDiffHTMLConverterAsync","listitem","node","nodesToHTML","parent","providedCSSString","hasSubLists","children","some","child","type","nodes","join","listType","ReactDOMServer","default","JSX","_jsx","checked","className","role","tabIndex","value","dangerouslySetInnerHTML","__html","_jsxs","html","renderToStaticMarkup","styleIndex","indexOf","classIndex","classEndIndex","substring","classNameWithStyle","htmlWithStyle","replace","String"],"sources":["../../../../../src/field/Diff/converters/listitem/index.tsx"],"sourcesContent":["import { CheckIcon } from '@payloadcms/ui/rsc'\nimport escapeHTML from 'escape-html'\n\nimport type { HTMLConvertersAsync } from '../../../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedListItemNode } from '../../../../types/nodeTypes.js'\n\nimport './index.css'\n\nexport const ListItemDiffHTMLConverterAsync: HTMLConvertersAsync<SerializedListItemNode> = {\n listitem: async ({ node, nodesToHTML, parent, providedCSSString }) => {\n const hasSubLists = node.children.some((child) => child.type === 'list')\n\n const children = (\n await nodesToHTML({\n nodes: node.children,\n })\n ).join('')\n\n if ('listType' in parent && parent?.listType === 'check') {\n const ReactDOMServer = (await import('react-dom/server')).default\n\n const JSX = (\n <li\n aria-checked={node.checked ? true : false}\n className={`checkboxItem ${node.checked ? 'checkboxItem--checked' : 'checkboxItem--unchecked'}${\n hasSubLists ? ' checkboxItem--nested' : ''\n }`}\n // eslint-disable-next-line jsx-a11y/no-noninteractive-element-to-interactive-role\n role=\"checkbox\"\n tabIndex={-1}\n value={node.value}\n >\n {hasSubLists ? (\n // When sublists exist, just render them safely as HTML\n <div dangerouslySetInnerHTML={{ __html: children }} />\n ) : (\n // Otherwise, show our custom styled checkbox\n <div className=\"checkboxItem__wrapper\">\n <div\n className=\"checkboxItem__icon\"\n data-checked={node.checked}\n data-enable-match=\"true\"\n >\n {node.checked && <CheckIcon />}\n </div>\n <span className=\"checkboxItem__label\">{children}</span>\n </div>\n )}\n </li>\n )\n\n const html = ReactDOMServer.renderToStaticMarkup(JSX)\n\n // Add style=\"list-style-type: none;${providedCSSString}\" to html\n const styleIndex = html.indexOf('class=\"list-item-checkbox')\n const classIndex = html.indexOf('class=\"list-item-checkbox', styleIndex)\n const classEndIndex = html.indexOf('\"', classIndex + 6)\n const className = html.substring(classIndex, classEndIndex)\n const classNameWithStyle = `${className} style=\"list-style-type: none;${providedCSSString}\"`\n const htmlWithStyle = html.replace(className, classNameWithStyle)\n\n return htmlWithStyle\n } else {\n return `<li\n class=\"${hasSubLists ? 'nestedListItem' : ''}\"\n style=\"${hasSubLists ? `list-style-type: none;${providedCSSString}` : providedCSSString}\"\n value=\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Z;;;;MAM/C,MAAMmB,IAAA,GAAOZ,cAAA,CAAea,oBAAoB,CAACX,GAAA;MAEjD;MACA,MAAMY,UAAA,GAAaF,IAAA,CAAKG,OAAO,CAAC;MAChC,MAAMC,UAAA,GAAaJ,IAAA,CAAKG,OAAO,CAAC,6BAA6BD,UAAA;MAC7D,MAAMG,aAAA,GAAgBL,IAAA,CAAKG,OAAO,CAAC,KAAKC,UAAA,GAAa;MACrD,MAAMX,SAAA,GAAYO,IAAA,CAAKM,SAAS,CAACF,UAAA,EAAYC,aAAA;MAC7C,MAAME,kBAAA,GAAqB,GAAGd,SAAA,iCAA0Cd,iBAAA,GAAoB;MAC5F,MAAM6B,aAAA,GAAgBR,IAAA,CAAKS,OAAO,CAAChB,SAAA,EAAWc,kBAAA;MAE9C,OAAOC,aAAA;IACT,OAAO;MACL,OAAO;mBACM5B,WAAA,GAAc,mBAAmB;mBACjCA,WAAA,GAAc,yBAAyBD,iBAAA,EAAmB,GAAGA,iBAAA;mBAC7DN,UAAA,CAAWqC,MAAA,CAAOlC,IAAA,CAAKoB,KAAK;;WAEpCf,QAAA,OAAe;IACtB;EACF;AACF","ignoreList":[]}
@@ -9,7 +9,6 @@
9
9
  border-radius: var(--radius-medium);
10
10
  position: relative;
11
11
  z-index: 2;
12
- font-family: var(--text-body-medium-font-family);
13
12
  font-size: var(--text-body-medium-font-size);
14
13
  font-weight: var(--text-body-medium-font-weight);
15
14
  line-height: var(--text-body-medium-line-height);
@@ -8,7 +8,6 @@
8
8
  border-radius: var(--radius-medium);
9
9
  border: var(--stroke-width-small) solid var(--color-border);
10
10
  position: relative;
11
- font-family: var(--font-body);
12
11
  margin-block: calc(var(--spacer-1) * 2.5);
13
12
  max-height: calc(var(--spacer-5) * 2.5);
14
13
  padding: calc(var(--spacer-1) * 1.25);
@@ -11,7 +11,6 @@
11
11
  outline-offset: calc(var(--stroke-width-small) * -1);
12
12
  position: relative;
13
13
  z-index: 2;
14
- font-family: var(--text-body-medium-font-family);
15
14
  padding: var(--spacer-2);
16
15
 
17
16
  &[data-match-type='create'] {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["File","createHash","formatFilesize","React","baseClass","UploadDiffHTMLConverterAsync","i18n","req","upload","node","populate","providedCSSString","uploadNode","uploadDoc","undefined","value","id","collectionSlug","relationTo","alt","fields","thumbnailSRC","thumbnailURL","url","ReactDOMServer","default","nodeFieldsHash","update","JSON","stringify","digest","filename","t","JSX","_jsx","className","_jsxs","length","src","filesize","width","height","Fragment","mimeType","html","renderToStaticMarkup"],"sources":["../../../../../src/field/Diff/converters/upload/index.tsx"],"sourcesContent":["import type { FileData, PayloadRequest, TypeWithID } from 'payload'\n\nimport { type I18nClient } from '@payloadcms/translations'\nimport { File } from '@payloadcms/ui/rsc'\nimport { createHash } from 'crypto'\n\nimport './index.css'\n\nimport { formatFilesize } from 'payload/shared'\nimport React from 'react'\n\nimport type { HTMLConvertersAsync } from '../../../../features/converters/lexicalToHtml/async/types.js'\nimport type { UploadDataImproved } from '../../../../features/upload/server/schema.js'\nimport type { SerializedUploadNode } from '../../../../types/nodeTypes.js'\n\nconst baseClass = 'lexical-upload-diff'\n\nexport const UploadDiffHTMLConverterAsync: (args: {\n i18n: I18nClient\n req: PayloadRequest\n}) => HTMLConvertersAsync<SerializedUploadNode> = ({ i18n, req }) => {\n return {\n upload: async ({ node, populate, providedCSSString }) => {\n const uploadNode = node as UploadDataImproved\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n if (!populate) {\n return ''\n }\n uploadDoc = await populate<FileData & TypeWithID>({\n id: uploadNode.value,\n collectionSlug: uploadNode.relationTo,\n })\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || ''\n\n const thumbnailSRC: string =\n ('thumbnailURL' in uploadDoc && (uploadDoc?.thumbnailURL as string)) || uploadDoc?.url || ''\n\n const ReactDOMServer = (await import('react-dom/server')).default\n\n // hash fields to ensure they are diffed if they change\n const nodeFieldsHash = createHash('sha256')\n .update(JSON.stringify(node.fields ?? {}))\n .digest('hex')\n\n const filename =\n uploadDoc?.filename ||\n `${i18n.t('general:untitled')} - ID: ${typeof uploadNode.value === 'object' ? uploadNode.value : uploadNode.value}`\n\n const JSX = (\n <div\n className={`${baseClass}${providedCSSString}`}\n data-enable-match=\"true\"\n data-fields-hash={`${nodeFieldsHash}`}\n data-filename={uploadDoc?.filename}\n data-lexical-upload-id={uploadNode.value}\n data-lexical-upload-relation-to={uploadNode.relationTo}\n data-src={thumbnailSRC}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC?.length ? <img alt={alt} src={thumbnailSRC} /> : <File />}\n </div>\n <div className={`${baseClass}__info`} data-enable-match=\"false\">\n <strong>{filename}</strong>\n <div className={`${baseClass}__meta`}>\n {formatFilesize(uploadDoc?.filesize)}\n {typeof uploadDoc?.width === 'number' && typeof uploadDoc?.height === 'number' && (\n <React.Fragment>\n &nbsp;-&nbsp;\n {uploadDoc?.width}x{uploadDoc?.height}\n </React.Fragment>\n )}\n {uploadDoc?.mimeType && (\n <React.Fragment>\n &nbsp;-&nbsp;\n {uploadDoc?.mimeType}\n </React.Fragment>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n\n // Render to HTML\n const html = ReactDOMServer.renderToStaticMarkup(JSX)\n\n return html\n },\n }\n}\n"],"mappings":";AAGA,SAASA,IAAI,QAAQ;AACrB,SAASC,UAAU,QAAQ;AAE3B,OAAO;AAEP,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAMlB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,4BAAA,GAGqCA,CAAC;EAAEC,IAAI;EAAEC;AAAG,CAAE;EAC9D,OAAO;IACLC,MAAA,EAAQ,MAAAA,CAAO;MAA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wBnB,UAAA,CAAWG,KAAK;QACxC,mCAAiCH,UAAA,CAAWM,UAAU;QACtD,YAAUG,YAAA;kBAEV,aAAAe,KAAA,CAAC;UAAID,SAAA,EAAW,GAAG/B,SAAA,QAAiB;kCAClC8B,IAAA,CAAC;YAAIC,SAAA,EAAW,GAAG/B,SAAA,aAAsB;sBACtCiB,YAAA,EAAcgB,MAAA,gBAASH,IAAA,CAAC;cAAIf,GAAA,EAAKA,GAAA;cAAKmB,GAAA,EAAKjB;8BAAmBa,IAAA,CAAClC,IAAA;2BAElEoC,KAAA,CAAC;YAAID,SAAA,EAAW,GAAG/B,SAAA,QAAiB;YAAE,qBAAkB;oCACtD8B,IAAA,CAAC;wBAAQH;6BACTK,KAAA,CAAC;cAAID,SAAA,EAAW,GAAG/B,SAAA,QAAiB;yBACjCF,cAAA,CAAeW,SAAA,EAAW0B,QAAA,GAC1B,OAAO1B,SAAA,EAAW2B,KAAA,KAAU,YAAY,OAAO3B,SAAA,EAAW4B,MAAA,KAAW,yBACpEL,KAAA,CAACjC,KAAA,CAAMuC,QAAQ;2BAAC,OAEb7B,SAAA,EAAW2B,KAAA,EAAM,KAAE3B,SAAA,EAAW4B,MAAA;kBAGlC5B,SAAA,EAAW8B,QAAA,iBACVP,KAAA,CAACjC,KAAA,CAAMuC,QAAQ;2BAAC,OAEb7B,SAAA,EAAW8B,QAAA;;;;;;MAS1B;MACA,MAAMC,IAAA,GAAOpB,cAAA,CAAeqB,oBAAoB,CAACZ,GAAA;MAEjD,OAAOW,IAAA;IACT;EACF;AACF","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["File","createHash","formatFilesize","React","baseClass","UploadDiffHTMLConverterAsync","i18n","req","upload","node","populate","providedCSSString","uploadNode","uploadDoc","undefined","value","id","collectionSlug","relationTo","alt","fields","thumbnailSRC","thumbnailURL","url","ReactDOMServer","default","nodeFieldsHash","update","JSON","stringify","digest","filename","t","JSX","_jsx","className","_jsxs","length","src","filesize","width","height","Fragment","mimeType","html","renderToStaticMarkup"],"sources":["../../../../../src/field/Diff/converters/upload/index.tsx"],"sourcesContent":["import type { FileData, PayloadRequest, TypeWithID } from 'payload'\n\nimport { type I18nClient } from '@payloadcms/translations'\nimport { File } from '@payloadcms/ui/rsc'\nimport { createHash } from 'crypto'\n\nimport './index.css'\n\nimport { formatFilesize } from 'payload/shared'\nimport React from 'react'\n\nimport type { HTMLConvertersAsync } from '../../../../features/converters/lexicalToHtml/async/types.js'\nimport type { UploadData } from '../../../../features/upload/server/schema.js'\nimport type { SerializedUploadNode } from '../../../../types/nodeTypes.js'\n\nconst baseClass = 'lexical-upload-diff'\n\nexport const UploadDiffHTMLConverterAsync: (args: {\n i18n: I18nClient\n req: PayloadRequest\n}) => HTMLConvertersAsync<SerializedUploadNode> = ({ i18n, req }) => {\n return {\n upload: async ({ node, populate, providedCSSString }) => {\n const uploadNode = node as UploadData\n\n let uploadDoc: (FileData & TypeWithID) | undefined = undefined\n\n // If there's no valid upload data, populate return an empty string\n if (typeof uploadNode.value !== 'object') {\n if (!populate) {\n return ''\n }\n uploadDoc = await populate<FileData & TypeWithID>({\n id: uploadNode.value,\n collectionSlug: uploadNode.relationTo,\n })\n } else {\n uploadDoc = uploadNode.value as unknown as FileData & TypeWithID\n }\n\n if (!uploadDoc) {\n return ''\n }\n\n const alt = (node.fields?.alt as string) || (uploadDoc as { alt?: string })?.alt || ''\n\n const thumbnailSRC: string =\n ('thumbnailURL' in uploadDoc && (uploadDoc?.thumbnailURL as string)) || uploadDoc?.url || ''\n\n const ReactDOMServer = (await import('react-dom/server')).default\n\n // hash fields to ensure they are diffed if they change\n const nodeFieldsHash = createHash('sha256')\n .update(JSON.stringify(node.fields ?? {}))\n .digest('hex')\n\n const filename =\n uploadDoc?.filename ||\n `${i18n.t('general:untitled')} - ID: ${typeof uploadNode.value === 'object' ? uploadNode.value : uploadNode.value}`\n\n const JSX = (\n <div\n className={`${baseClass}${providedCSSString}`}\n data-enable-match=\"true\"\n data-fields-hash={`${nodeFieldsHash}`}\n data-filename={uploadDoc?.filename}\n data-lexical-upload-id={uploadNode.value}\n data-lexical-upload-relation-to={uploadNode.relationTo}\n data-src={thumbnailSRC}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC?.length ? <img alt={alt} src={thumbnailSRC} /> : <File />}\n </div>\n <div className={`${baseClass}__info`} data-enable-match=\"false\">\n <strong>{filename}</strong>\n <div className={`${baseClass}__meta`}>\n {formatFilesize(uploadDoc?.filesize)}\n {typeof uploadDoc?.width === 'number' && typeof uploadDoc?.height === 'number' && (\n <React.Fragment>\n &nbsp;-&nbsp;\n {uploadDoc?.width}x{uploadDoc?.height}\n </React.Fragment>\n )}\n {uploadDoc?.mimeType && (\n <React.Fragment>\n &nbsp;-&nbsp;\n {uploadDoc?.mimeType}\n </React.Fragment>\n )}\n </div>\n </div>\n </div>\n </div>\n )\n\n // Render to HTML\n const html = ReactDOMServer.renderToStaticMarkup(JSX)\n\n return html\n },\n }\n}\n"],"mappings":";AAGA,SAASA,IAAI,QAAQ;AACrB,SAASC,UAAU,QAAQ;AAE3B,OAAO;AAEP,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAMlB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,4BAAA,GAGqCA,CAAC;EAAEC,IAAI;EAAEC;AAAG,CAAE;EAC9D,OAAO;IACLC,MAAA,EAAQ,MAAAA,CAAO;MAAEC,IAAI;MAAEC,QAAQ;MAAEC;IAAiB,CAAE;MAClD,MAAMC,UAAA,GAAaH,IAAA;MAEnB,IAAII,SAAA,GAAiDC,SAAA;MAErD;MACA,IAAI,OAAOF,UAAA,CAAWG,KAAK,KAAK,UAAU;QACxC,IAAI,CAACL,QAAA,EAAU;UACb,OAAO;QACT;QACAG,SAAA,GAAY,MAAMH,QAAA,CAAgC;UAChDM,EAAA,EAAIJ,UAAA,CAAWG,KAAK;UACpBE,cAAA,EAAgBL,UAAA,CAAWM;QAC7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AAA;2BAElEoC,KAAA,CAAC;YAAID,SAAA,EAAW,GAAG/B,SAAA,QAAiB;YAAE,qBAAkB;oCACtD8B,IAAA,CAAC;wBAAQH;6BACTK,KAAA,CAAC;cAAID,SAAA,EAAW,GAAG/B,SAAA,QAAiB;yBACjCF,cAAA,CAAeW,SAAA,EAAW0B,QAAA,GAC1B,OAAO1B,SAAA,EAAW2B,KAAA,KAAU,YAAY,OAAO3B,SAAA,EAAW4B,MAAA,KAAW,yBACpEL,KAAA,CAACjC,KAAA,CAAMuC,QAAQ;2BAAC,OAEb7B,SAAA,EAAW2B,KAAA,EAAM,KAAE3B,SAAA,EAAW4B,MAAA;kBAGlC5B,SAAA,EAAW8B,QAAA,iBACVP,KAAA,CAACjC,KAAA,CAAMuC,QAAQ;2BAAC,OAEb7B,SAAA,EAAW8B,QAAA;;;;;;MAS1B;MACA,MAAMC,IAAA,GAAOpB,cAAA,CAAeqB,oBAAoB,CAACZ,GAAA;MAEjD,OAAOW,IAAA;IACT;EACF;AACF","ignoreList":[]}
@@ -1,7 +1,6 @@
1
1
  @layer payload-default {
2
2
  .lexical-diff .field-diff-content {
3
3
  .html-diff {
4
- font-family: var(--text-body-large-font-family);
5
4
  font-size: var(--text-body-large-font-size);
6
5
  font-weight: var(--text-body-large-font-weight);
7
6
  line-height: var(--text-body-large-line-height);
@@ -119,7 +118,6 @@
119
118
  }
120
119
 
121
120
  li {
122
- font-family: var(--text-body-large-font-family);
123
121
  font-size: var(--text-body-large-font-size);
124
122
  margin-block: 0 var(--spacer-1);
125
123
  margin-inline-start: var(--spacer-4);