@payloadcms/richtext-lexical 4.0.0-internal.4804abd → 4.0.0-internal.4c2ee12

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 (602) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/exports/client/Field-MT4FK3IP.js +2 -0
  3. package/dist/exports/client/Field-MT4FK3IP.js.map +7 -0
  4. package/dist/exports/client/chunk-3LRZDIIG.js +2 -0
  5. package/dist/exports/client/{chunk-X3D4LZS7.js.map → chunk-3LRZDIIG.js.map} +4 -4
  6. package/dist/exports/client/chunk-E6LSRRP2.js +2 -0
  7. package/dist/exports/client/chunk-E6LSRRP2.js.map +7 -0
  8. package/dist/exports/client/chunk-ZQX5HXUL.js +2 -0
  9. package/dist/exports/client/chunk-ZQX5HXUL.js.map +7 -0
  10. package/dist/exports/client/component-6DQLENIE.js +2 -0
  11. package/dist/exports/client/component-6DQLENIE.js.map +7 -0
  12. package/dist/exports/client/componentInline-HNE5G4TE.js +2 -0
  13. package/dist/exports/client/index.d.ts +1 -2
  14. package/dist/exports/client/index.d.ts.map +1 -1
  15. package/dist/exports/client/index.js +28 -28
  16. package/dist/exports/client/index.js.map +4 -4
  17. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  18. package/dist/features/blocks/client/component/BlockReordering/index.d.ts +11 -0
  19. package/dist/features/blocks/client/component/BlockReordering/index.d.ts.map +1 -0
  20. package/dist/features/blocks/client/component/BlockReordering/index.js +18 -0
  21. package/dist/features/blocks/client/component/BlockReordering/index.js.map +1 -0
  22. package/dist/features/blocks/client/component/index.d.ts +0 -6
  23. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  24. package/dist/features/blocks/client/component/index.js +169 -101
  25. package/dist/features/blocks/client/component/index.js.map +1 -1
  26. package/dist/features/blocks/client/component/useBlockReordering.d.ts +16 -0
  27. package/dist/features/blocks/client/component/useBlockReordering.d.ts.map +1 -0
  28. package/dist/features/blocks/client/component/useBlockReordering.js +178 -0
  29. package/dist/features/blocks/client/component/useBlockReordering.js.map +1 -0
  30. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  31. package/dist/features/blocks/client/componentInline/index.css +0 -1
  32. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  33. package/dist/features/blocks/client/componentInline/index.js +30 -22
  34. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  35. package/dist/features/blocks/client/getBlockImageComponent.d.ts +1 -1
  36. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts +9 -0
  37. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.d.ts.map +1 -0
  38. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js +95 -0
  39. package/dist/features/blocks/client/getCachedFormStateIfDataMatches.js.map +1 -0
  40. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  41. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  42. package/dist/features/blocks/client/nodes/BlocksNode.js +0 -10
  43. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  44. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  45. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  46. package/dist/features/blocks/server/index.js +2 -2
  47. package/dist/features/blocks/server/index.js.map +1 -1
  48. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  49. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  50. package/dist/features/blocks/server/nodes/BlocksNode.js +1 -12
  51. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  52. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  53. package/dist/features/blocks/server/nodes/InlineBlocksNode.js +2 -2
  54. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  55. package/dist/features/blocks/server/schema.d.ts +2 -0
  56. package/dist/features/blocks/server/schema.d.ts.map +1 -1
  57. package/dist/features/blocks/server/schema.js +7 -9
  58. package/dist/features/blocks/server/schema.js.map +1 -1
  59. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  60. package/dist/features/blocks/server/validate.js +1 -1
  61. package/dist/features/blocks/server/validate.js.map +1 -1
  62. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  63. package/dist/features/converters/lexicalToHtml/async/converters/heading.js +1 -1
  64. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  65. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  66. package/dist/features/converters/lexicalToHtml/async/converters/list.js +4 -3
  67. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  68. package/dist/features/converters/lexicalToHtml/async/converters/upload.js +3 -3
  69. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  70. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  71. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.d.ts.map +1 -1
  72. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js +3 -2
  73. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  74. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js +1 -1
  75. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  76. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  77. package/dist/features/converters/lexicalToHtml/sync/converters/list.js +4 -3
  78. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  79. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js +3 -3
  80. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  81. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  82. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js +2 -1
  83. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  84. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  85. package/dist/features/converters/lexicalToJSX/converter/converters/list.js +2 -1
  86. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  87. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  88. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js +4 -5
  89. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  90. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  91. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  92. package/dist/features/converters/utilities/payloadPopulateFn.d.ts.map +1 -1
  93. package/dist/features/converters/utilities/payloadPopulateFn.js +4 -2
  94. package/dist/features/converters/utilities/payloadPopulateFn.js.map +1 -1
  95. package/dist/features/debug/testRecorder/client/plugin/index.css +0 -1
  96. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  97. package/dist/features/heading/constants.d.ts +2 -0
  98. package/dist/features/heading/constants.d.ts.map +1 -0
  99. package/dist/features/heading/constants.js +2 -0
  100. package/dist/features/heading/constants.js.map +1 -0
  101. package/dist/features/heading/server/index.d.ts.map +1 -1
  102. package/dist/features/heading/server/index.js +5 -1
  103. package/dist/features/heading/server/index.js.map +1 -1
  104. package/dist/features/heading/server/schema.d.ts.map +1 -1
  105. package/dist/features/heading/server/validate.d.ts +6 -0
  106. package/dist/features/heading/server/validate.d.ts.map +1 -0
  107. package/dist/features/heading/server/validate.js +15 -0
  108. package/dist/features/heading/server/validate.js.map +1 -0
  109. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +12 -2
  110. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  111. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js +18 -1
  112. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  113. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  114. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  115. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +3 -3
  116. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  117. package/dist/features/horizontalRule/server/schema.d.ts +1 -0
  118. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -1
  119. package/dist/features/horizontalRule/server/schema.js +6 -5
  120. package/dist/features/horizontalRule/server/schema.js.map +1 -1
  121. package/dist/features/indent/client/IndentPlugin.d.ts.map +1 -1
  122. package/dist/features/indent/client/IndentPlugin.js +122 -1
  123. package/dist/features/indent/client/IndentPlugin.js.map +1 -1
  124. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  125. package/dist/features/indent/server/i18n.d.ts.map +1 -1
  126. package/dist/features/indent/server/i18n.js +74 -37
  127. package/dist/features/indent/server/i18n.js.map +1 -1
  128. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  129. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  130. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +8 -5
  131. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  132. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +0 -2
  133. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  134. package/dist/features/link/nodes/AutoLinkNode.d.ts +1 -1
  135. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  136. package/dist/features/link/nodes/AutoLinkNode.js +2 -10
  137. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  138. package/dist/features/link/nodes/LinkNode.d.ts +1 -1
  139. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  140. package/dist/features/link/nodes/LinkNode.js +2 -15
  141. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  142. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  143. package/dist/features/link/server/baseFields.js.map +1 -1
  144. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  145. package/dist/features/link/server/index.js +2 -2
  146. package/dist/features/link/server/index.js.map +1 -1
  147. package/dist/features/link/server/schema.d.ts.map +1 -1
  148. package/dist/features/link/server/validate.d.ts.map +1 -1
  149. package/dist/features/link/server/validate.js +1 -1
  150. package/dist/features/link/server/validate.js.map +1 -1
  151. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  152. package/dist/features/lists/checklist/server/index.js +5 -2
  153. package/dist/features/lists/checklist/server/index.js.map +1 -1
  154. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  155. package/dist/features/lists/orderedList/server/index.js +5 -2
  156. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  157. package/dist/features/lists/shared/constants.d.ts +2 -0
  158. package/dist/features/lists/shared/constants.d.ts.map +1 -0
  159. package/dist/features/lists/shared/constants.js +2 -0
  160. package/dist/features/lists/shared/constants.js.map +1 -0
  161. package/dist/features/lists/shared/validate.d.ts +5 -0
  162. package/dist/features/lists/shared/validate.d.ts.map +1 -0
  163. package/dist/features/lists/shared/validate.js +15 -0
  164. package/dist/features/lists/shared/validate.js.map +1 -0
  165. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  166. package/dist/features/lists/unorderedList/server/index.js +5 -2
  167. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  168. package/dist/features/relationship/client/components/index.css +3 -6
  169. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  170. package/dist/features/relationship/client/index.d.ts +2 -2
  171. package/dist/features/relationship/client/index.d.ts.map +1 -1
  172. package/dist/features/relationship/client/index.js.map +1 -1
  173. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  174. package/dist/features/relationship/client/nodes/RelationshipNode.js +0 -3
  175. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  176. package/dist/features/relationship/client/plugins/index.d.ts +2 -2
  177. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  178. package/dist/features/relationship/client/plugins/index.js +27 -31
  179. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  180. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts +2 -4
  181. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  182. package/dist/features/relationship/client/utils/useEnabledRelationships.js +53 -20
  183. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  184. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +2 -2
  185. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  186. package/dist/features/relationship/server/graphQLPopulationPromise.js +2 -2
  187. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  188. package/dist/features/relationship/server/index.d.ts +8 -1
  189. package/dist/features/relationship/server/index.d.ts.map +1 -1
  190. package/dist/features/relationship/server/index.js +28 -11
  191. package/dist/features/relationship/server/index.js.map +1 -1
  192. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  193. package/dist/features/relationship/server/nodes/RelationshipNode.js +1 -5
  194. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  195. package/dist/features/relationship/server/schema.d.ts +3 -2
  196. package/dist/features/relationship/server/schema.d.ts.map +1 -1
  197. package/dist/features/relationship/server/schema.js +9 -12
  198. package/dist/features/relationship/server/schema.js.map +1 -1
  199. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +1 -6
  200. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -1
  201. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +1 -5
  202. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -1
  203. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  204. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  205. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  206. package/dist/features/table/client/index.d.ts.map +1 -0
  207. package/dist/features/table/client/index.js.map +1 -0
  208. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts +8 -0
  209. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.d.ts.map +1 -0
  210. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js +19 -0
  211. package/dist/features/table/client/plugins/TableActionMenuPlugin/computeSelectionCount.js.map +1 -0
  212. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.css +0 -1
  213. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -0
  214. package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.js +17 -44
  215. package/dist/features/table/client/plugins/TableActionMenuPlugin/index.js.map +1 -0
  216. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -0
  217. package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.js +41 -18
  218. package/dist/features/table/client/plugins/TableCellResizerPlugin/index.js.map +1 -0
  219. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -0
  220. package/dist/features/table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -0
  221. package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.css +0 -3
  222. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  223. package/dist/features/table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  224. package/dist/features/table/client/plugins/TablePlugin/index.d.ts.map +1 -0
  225. package/dist/features/table/client/plugins/TablePlugin/index.js.map +1 -0
  226. package/dist/features/table/client/utils/debounce.d.ts.map +1 -0
  227. package/dist/features/table/client/utils/debounce.js.map +1 -0
  228. package/dist/features/table/client/utils/useDebounce.d.ts.map +1 -0
  229. package/dist/features/table/client/utils/useDebounce.js.map +1 -0
  230. package/dist/features/table/markdownTransformer.d.ts.map +1 -0
  231. package/dist/features/table/markdownTransformer.js.map +1 -0
  232. package/dist/features/table/server/index.d.ts +3 -0
  233. package/dist/features/table/server/index.d.ts.map +1 -0
  234. package/dist/features/{experimental_table → table}/server/index.js +4 -4
  235. package/dist/features/table/server/index.js.map +1 -0
  236. package/dist/features/table/server/schema.d.ts.map +1 -0
  237. package/dist/features/table/server/schema.js.map +1 -0
  238. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts +8 -0
  239. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.d.ts.map +1 -0
  240. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js +80 -0
  241. package/dist/features/toolbars/fixed/client/Toolbar/horizontalWheelScroll.js.map +1 -0
  242. package/dist/features/toolbars/fixed/client/Toolbar/index.css +78 -6
  243. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  244. package/dist/features/toolbars/fixed/client/Toolbar/index.js +19 -1
  245. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  246. package/dist/features/toolbars/inline/client/Toolbar/index.css +0 -1
  247. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  248. package/dist/features/toolbars/inline/client/Toolbar/index.js +17 -2
  249. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  250. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  251. package/dist/features/toolbars/shared/ToolbarButton/index.js +1 -0
  252. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  253. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  254. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +85 -32
  255. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  256. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +16 -14
  257. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  258. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts +5 -0
  259. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.d.ts.map +1 -0
  260. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js +79 -0
  261. package/dist/features/toolbars/shared/useToolbarKeyboardNavigation.js.map +1 -0
  262. package/dist/features/typesServer.d.ts +17 -12
  263. package/dist/features/typesServer.d.ts.map +1 -1
  264. package/dist/features/typesServer.js.map +1 -1
  265. package/dist/features/upload/client/component/index.css +0 -2
  266. package/dist/features/upload/client/component/index.js +2 -1
  267. package/dist/features/upload/client/component/index.js.map +1 -1
  268. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  269. package/dist/features/upload/client/index.d.ts +3 -2
  270. package/dist/features/upload/client/index.d.ts.map +1 -1
  271. package/dist/features/upload/client/index.js.map +1 -1
  272. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  273. package/dist/features/upload/client/nodes/UploadNode.js +0 -7
  274. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  275. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  276. package/dist/features/upload/client/plugin/index.js +50 -53
  277. package/dist/features/upload/client/plugin/index.js.map +1 -1
  278. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +2 -2
  279. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  280. package/dist/features/upload/server/graphQLPopulationPromise.js +1 -1
  281. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  282. package/dist/features/upload/server/index.d.ts +7 -3
  283. package/dist/features/upload/server/index.d.ts.map +1 -1
  284. package/dist/features/upload/server/index.js +20 -16
  285. package/dist/features/upload/server/index.js.map +1 -1
  286. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  287. package/dist/features/upload/server/nodes/UploadNode.js +1 -9
  288. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  289. package/dist/features/upload/server/schema.d.ts +4 -16
  290. package/dist/features/upload/server/schema.d.ts.map +1 -1
  291. package/dist/features/upload/server/schema.js +8 -10
  292. package/dist/features/upload/server/schema.js.map +1 -1
  293. package/dist/features/upload/server/validate.d.ts +2 -2
  294. package/dist/features/upload/server/validate.d.ts.map +1 -1
  295. package/dist/features/upload/server/validate.js +4 -1
  296. package/dist/features/upload/server/validate.js.map +1 -1
  297. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  298. package/dist/field/Diff/converters/listitem/index.js +2 -1
  299. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  300. package/dist/field/Diff/converters/relationship/index.css +0 -1
  301. package/dist/field/Diff/converters/unknown/index.css +0 -1
  302. package/dist/field/Diff/converters/upload/index.css +0 -1
  303. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  304. package/dist/field/Diff/index.css +0 -2
  305. package/dist/field/Diff/index.d.ts +3 -2
  306. package/dist/field/Diff/index.d.ts.map +1 -1
  307. package/dist/field/Diff/index.js +3 -2
  308. package/dist/field/Diff/index.js.map +1 -1
  309. package/dist/field/Field.d.ts.map +1 -1
  310. package/dist/field/Field.js +26 -16
  311. package/dist/field/Field.js.map +1 -1
  312. package/dist/field/RenderLexical/index.d.ts +3 -1
  313. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  314. package/dist/field/RenderLexical/index.js +23 -23
  315. package/dist/field/RenderLexical/index.js.map +1 -1
  316. package/dist/field/ViewSelector.d.ts.map +1 -1
  317. package/dist/field/ViewSelector.js +1 -0
  318. package/dist/field/ViewSelector.js.map +1 -1
  319. package/dist/field/bundled.css +1 -1
  320. package/dist/field/index.css +2 -3
  321. package/dist/field/rscEntry.d.ts +2 -2
  322. package/dist/field/rscEntry.d.ts.map +1 -1
  323. package/dist/field/rscEntry.js.map +1 -1
  324. package/dist/i18n.d.ts.map +1 -1
  325. package/dist/i18n.js +68 -0
  326. package/dist/i18n.js.map +1 -1
  327. package/dist/index.d.ts +5 -5
  328. package/dist/index.d.ts.map +1 -1
  329. package/dist/index.js +31 -52
  330. package/dist/index.js.map +1 -1
  331. package/dist/lexical/LexicalEditor.css +30 -19
  332. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  333. package/dist/lexical/LexicalEditor.js +62 -99
  334. package/dist/lexical/LexicalEditor.js.map +1 -1
  335. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  336. package/dist/lexical/LexicalProvider.js +7 -22
  337. package/dist/lexical/LexicalProvider.js.map +1 -1
  338. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  339. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  340. package/dist/lexical/config/server/loader.d.ts +1 -1
  341. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  342. package/dist/lexical/config/server/loader.js +2 -2
  343. package/dist/lexical/config/server/loader.js.map +1 -1
  344. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  345. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  346. package/dist/lexical/config/server/sanitize.js +2 -2
  347. package/dist/lexical/config/server/sanitize.js.map +1 -1
  348. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  349. package/dist/lexical/plugins/DecoratorPlugin/index.js +24 -21
  350. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  351. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +18 -25
  352. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  353. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +27 -14
  354. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  355. package/dist/lexical/plugins/NodeViewOverridePlugin/index.d.ts.map +1 -1
  356. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js +21 -0
  357. package/dist/lexical/plugins/NodeViewOverridePlugin/index.js.map +1 -1
  358. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +0 -1
  359. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  360. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +2 -21
  361. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  362. package/dist/lexical/plugins/SlashMenu/index.css +0 -2
  363. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -0
  364. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +2 -2
  365. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  366. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  367. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +2 -0
  368. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  369. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +16 -2
  370. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  371. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts +7 -0
  372. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.d.ts.map +1 -0
  373. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js +65 -0
  374. package/dist/lexical/plugins/handles/DraggableBlockPlugin/useKeyboardReordering.js.map +1 -0
  375. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  376. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  377. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +2 -0
  378. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  379. package/dist/lexical/theme/EditorTheme.css +0 -2
  380. package/dist/lexical/ui/ContentEditable.css +19 -14
  381. package/dist/lexical/ui/ContentEditable.d.ts +2 -1
  382. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  383. package/dist/lexical/ui/ContentEditable.js +21 -7
  384. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  385. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  386. package/dist/lexical/ui/icons/H3/index.js +13 -6
  387. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  388. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  389. package/dist/lexical/ui/icons/H4/index.js +13 -6
  390. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  391. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  392. package/dist/lexical/ui/icons/H5/index.js +13 -6
  393. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  394. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  395. package/dist/lexical/ui/icons/H6/index.js +13 -6
  396. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  397. package/dist/lexical/utils/markdown/createBlockNode.d.ts +1 -1
  398. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  399. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  400. package/dist/lexical/utils/point.d.ts.map +1 -1
  401. package/dist/lexical/utils/rect.d.ts.map +1 -1
  402. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts +2 -0
  403. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.d.ts.map +1 -0
  404. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js +2 -0
  405. package/dist/lexical-proxy/@lexical-react/ExtensionComponent.js.map +1 -0
  406. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts +2 -0
  407. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.d.ts.map +1 -0
  408. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js +2 -0
  409. package/dist/lexical-proxy/@lexical-react/LexicalExtensionComposer.js.map +1 -0
  410. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts +2 -0
  411. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.d.ts.map +1 -0
  412. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js +2 -0
  413. package/dist/lexical-proxy/@lexical-react/LexicalExtensionEditorComposer.js.map +1 -0
  414. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts +2 -0
  415. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.d.ts.map +1 -0
  416. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js +2 -0
  417. package/dist/lexical-proxy/@lexical-react/LexicalSelectionAlwaysOnDisplay.js.map +1 -0
  418. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts +2 -0
  419. package/dist/lexical-proxy/@lexical-react/ReactExtension.d.ts.map +1 -0
  420. package/dist/lexical-proxy/@lexical-react/ReactExtension.js +2 -0
  421. package/dist/lexical-proxy/@lexical-react/ReactExtension.js.map +1 -0
  422. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts +2 -0
  423. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.d.ts.map +1 -0
  424. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js +2 -0
  425. package/dist/lexical-proxy/@lexical-react/ReactPluginHostExtension.js.map +1 -0
  426. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts +2 -0
  427. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.d.ts.map +1 -0
  428. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js +2 -0
  429. package/dist/lexical-proxy/@lexical-react/ReactProviderExtension.js.map +1 -0
  430. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts +2 -0
  431. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.d.ts.map +1 -0
  432. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js +2 -0
  433. package/dist/lexical-proxy/@lexical-react/TreeViewExtension.js.map +1 -0
  434. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts +2 -0
  435. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.d.ts.map +1 -0
  436. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js +2 -0
  437. package/dist/lexical-proxy/@lexical-react/useExtensionComponent.js.map +1 -0
  438. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts +2 -0
  439. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.d.ts.map +1 -0
  440. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js +2 -0
  441. package/dist/lexical-proxy/@lexical-react/useExtensionSignalValue.js.map +1 -0
  442. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts +2 -0
  443. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.d.ts.map +1 -0
  444. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js +2 -0
  445. package/dist/lexical-proxy/@lexical-react/useLexicalAriaLiveRegion.js.map +1 -0
  446. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts +2 -0
  447. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.d.ts.map +1 -0
  448. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js +2 -0
  449. package/dist/lexical-proxy/@lexical-react/useLexicalFocusManagerRef.js.map +1 -0
  450. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts +2 -0
  451. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.d.ts.map +1 -0
  452. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js +2 -0
  453. package/dist/lexical-proxy/@lexical-react/useLexicalFocusTrapRef.js.map +1 -0
  454. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts +2 -0
  455. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.d.ts.map +1 -0
  456. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js +2 -0
  457. package/dist/lexical-proxy/@lexical-react/useLexicalRovingTabIndexRef.js.map +1 -0
  458. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts +2 -0
  459. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.d.ts.map +1 -0
  460. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js +2 -0
  461. package/dist/lexical-proxy/@lexical-react/useLexicalSlotRef.js.map +1 -0
  462. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  463. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  464. package/dist/presets/llmInstructions.d.ts +2 -0
  465. package/dist/presets/llmInstructions.d.ts.map +1 -0
  466. package/dist/presets/llmInstructions.js +13 -0
  467. package/dist/presets/llmInstructions.js.map +1 -0
  468. package/dist/types/builtInNodes.d.ts +1 -1
  469. package/dist/types/builtInNodes.d.ts.map +1 -1
  470. package/dist/types/builtInNodes.js +8 -3
  471. package/dist/types/builtInNodes.js.map +1 -1
  472. package/dist/types/index.d.ts +4 -7
  473. package/dist/types/index.d.ts.map +1 -1
  474. package/dist/types/index.js.map +1 -1
  475. package/dist/types/jsonSchemaHelpers.d.ts +5 -1
  476. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -1
  477. package/dist/types/jsonSchemaHelpers.js +7 -2
  478. package/dist/types/jsonSchemaHelpers.js.map +1 -1
  479. package/dist/types/nodeTypes.d.ts +6 -1
  480. package/dist/types/nodeTypes.d.ts.map +1 -1
  481. package/dist/types/nodeTypes.js.map +1 -1
  482. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  483. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  484. package/dist/utilities/buildInitialState.d.ts +3 -2
  485. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  486. package/dist/utilities/buildInitialState.js +1 -0
  487. package/dist/utilities/buildInitialState.js.map +1 -1
  488. package/dist/utilities/createServerFeature.d.ts +1 -1
  489. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  490. package/dist/utilities/createServerFeature.js +2 -2
  491. package/dist/utilities/createServerFeature.js.map +1 -1
  492. package/dist/utilities/editorConfigFactory.d.ts +6 -6
  493. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  494. package/dist/utilities/editorConfigFactory.js +9 -9
  495. package/dist/utilities/editorConfigFactory.js.map +1 -1
  496. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +1 -1
  497. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -1
  498. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  499. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  500. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  501. package/dist/utilities/generateImportMap.d.ts +3 -3
  502. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  503. package/dist/utilities/generateImportMap.js +3 -7
  504. package/dist/utilities/generateImportMap.js.map +1 -1
  505. package/dist/utilities/generateSchemaMap.d.ts +1 -1
  506. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  507. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts +2 -2
  508. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  509. package/dist/utilities/getDefaultSanitizedEditorConfig.js +6 -17
  510. package/dist/utilities/getDefaultSanitizedEditorConfig.js.map +1 -1
  511. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  512. package/dist/utilities/upgradeLexicalData/index.js +6 -3
  513. package/dist/utilities/upgradeLexicalData/index.js.map +1 -1
  514. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  515. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  516. package/dist/validate/hasText.d.ts +2 -2
  517. package/dist/validate/hasText.d.ts.map +1 -1
  518. package/dist/validate/hasText.js.map +1 -1
  519. package/dist/validate/index.d.ts +1 -1
  520. package/dist/validate/index.d.ts.map +1 -1
  521. package/package.json +99 -27
  522. package/dist/@types/assets.d.js +0 -2
  523. package/dist/@types/assets.d.js.map +0 -1
  524. package/dist/dependencyChecker.spec.js +0 -16
  525. package/dist/dependencyChecker.spec.js.map +0 -1
  526. package/dist/exports/client/Field-DXKR3OGV.js +0 -2
  527. package/dist/exports/client/Field-DXKR3OGV.js.map +0 -7
  528. package/dist/exports/client/bundled.css +0 -1
  529. package/dist/exports/client/chunk-ESITTE3C.js +0 -2
  530. package/dist/exports/client/chunk-ESITTE3C.js.map +0 -7
  531. package/dist/exports/client/chunk-UD4DQ4AK.js +0 -2
  532. package/dist/exports/client/chunk-UD4DQ4AK.js.map +0 -7
  533. package/dist/exports/client/chunk-X3D4LZS7.js +0 -2
  534. package/dist/exports/client/component-PHZQBOJE.js +0 -2
  535. package/dist/exports/client/component-PHZQBOJE.js.map +0 -7
  536. package/dist/exports/client/componentInline-H24N7GUG.js +0 -2
  537. package/dist/exports/server/rsc.browser.d.ts +0 -11
  538. package/dist/exports/server/rsc.browser.d.ts.map +0 -1
  539. package/dist/exports/server/rsc.browser.js +0 -10
  540. package/dist/exports/server/rsc.browser.js.map +0 -1
  541. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts +0 -11
  542. package/dist/features/blocks/client/component/removeEmptyArrayValues.d.ts.map +0 -1
  543. package/dist/features/blocks/client/component/removeEmptyArrayValues.js +0 -20
  544. package/dist/features/blocks/client/component/removeEmptyArrayValues.js.map +0 -1
  545. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js +0 -180
  546. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +0 -1
  547. package/dist/features/experimental_table/client/index.d.ts.map +0 -1
  548. package/dist/features/experimental_table/client/index.js.map +0 -1
  549. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +0 -1
  550. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +0 -1
  551. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +0 -1
  552. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +0 -1
  553. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +0 -1
  554. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +0 -1
  555. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +0 -1
  556. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +0 -1
  557. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +0 -1
  558. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +0 -1
  559. package/dist/features/experimental_table/client/utils/debounce.d.ts.map +0 -1
  560. package/dist/features/experimental_table/client/utils/debounce.js.map +0 -1
  561. package/dist/features/experimental_table/client/utils/useDebounce.d.ts.map +0 -1
  562. package/dist/features/experimental_table/client/utils/useDebounce.js.map +0 -1
  563. package/dist/features/experimental_table/markdownTransformer.d.ts.map +0 -1
  564. package/dist/features/experimental_table/markdownTransformer.js.map +0 -1
  565. package/dist/features/experimental_table/server/index.d.ts +0 -3
  566. package/dist/features/experimental_table/server/index.d.ts.map +0 -1
  567. package/dist/features/experimental_table/server/index.js.map +0 -1
  568. package/dist/features/experimental_table/server/schema.d.ts.map +0 -1
  569. package/dist/features/experimental_table/server/schema.js.map +0 -1
  570. package/dist/features/link/markdownTransformer.spec.js +0 -195
  571. package/dist/features/link/markdownTransformer.spec.js.map +0 -1
  572. package/dist/field/clientEntry.d.ts +0 -29
  573. package/dist/field/clientEntry.d.ts.map +0 -1
  574. package/dist/field/clientEntry.js +0 -86
  575. package/dist/field/clientEntry.js.map +0 -1
  576. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +0 -88
  577. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +0 -1
  578. package/dist/lexical/utils/url.spec.js +0 -114
  579. package/dist/lexical/utils/url.spec.js.map +0 -1
  580. package/dist/utilities/jsx/jsx.spec.js +0 -178
  581. package/dist/utilities/jsx/jsx.spec.js.map +0 -1
  582. /package/dist/exports/client/{componentInline-H24N7GUG.js.map → componentInline-HNE5G4TE.js.map} +0 -0
  583. /package/dist/features/{experimental_table → table}/client/index.d.ts +0 -0
  584. /package/dist/features/{experimental_table → table}/client/index.js +0 -0
  585. /package/dist/features/{experimental_table → table}/client/plugins/TableActionMenuPlugin/index.d.ts +0 -0
  586. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.css +0 -0
  587. /package/dist/features/{experimental_table → table}/client/plugins/TableCellResizerPlugin/index.d.ts +0 -0
  588. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.d.ts +0 -0
  589. /package/dist/features/{experimental_table → table}/client/plugins/TableHoverActionsPlugin/index.js +0 -0
  590. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.d.ts +0 -0
  591. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/TableGridPopup/index.js +0 -0
  592. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.css +0 -0
  593. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.d.ts +0 -0
  594. /package/dist/features/{experimental_table → table}/client/plugins/TablePlugin/index.js +0 -0
  595. /package/dist/features/{experimental_table → table}/client/utils/debounce.d.ts +0 -0
  596. /package/dist/features/{experimental_table → table}/client/utils/debounce.js +0 -0
  597. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.d.ts +0 -0
  598. /package/dist/features/{experimental_table → table}/client/utils/useDebounce.js +0 -0
  599. /package/dist/features/{experimental_table → table}/markdownTransformer.d.ts +0 -0
  600. /package/dist/features/{experimental_table → table}/markdownTransformer.js +0 -0
  601. /package/dist/features/{experimental_table → table}/server/schema.d.ts +0 -0
  602. /package/dist/features/{experimental_table → table}/server/schema.js +0 -0
@@ -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;QACzC,MAAM,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ACzC,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 schema\n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A,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: collection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yB,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,GAC3B,OAAO,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;IAC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aZ,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;M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IAEA,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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AuBZ;;;;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;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BAAwBnB,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;Q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C,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,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);
@@ -1,5 +1,6 @@
1
- import type { RichTextFieldDiffServerComponent } from 'payload';
1
+ import type { RichTextFieldDiffServerProps } from 'payload';
2
2
  import './index.css';
3
3
  import '../bundled.css';
4
- export declare const LexicalDiffComponent: RichTextFieldDiffServerComponent;
4
+ import React from 'react';
5
+ export declare const LexicalDiffComponent: React.FC<RichTextFieldDiffServerProps>;
5
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/field/Diff/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gCAAgC,EAAE,MAAM,SAAS,CAAA;AAI/D,OAAO,aAAa,CAAA;AACpB,OAAO,gBAAgB,CAAA;AAqBvB,eAAO,MAAM,oBAAoB,EAAE,gCAiGlC,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/field/Diff/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,SAAS,CAAA;AAI3D,OAAO,aAAa,CAAA;AACpB,OAAO,gBAAgB,CAAA;AAGvB,OAAO,KAAK,MAAM,OAAO,CAAA;AAkBzB,eAAO,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CA0FvE,CAAA"}
@@ -14,13 +14,13 @@ import { UploadDiffHTMLConverterAsync } from './converters/upload/index.js';
14
14
  const baseClass = 'lexical-diff';
15
15
  export const LexicalDiffComponent = async args => {
16
16
  const {
17
- comparisonValue: valueFrom,
18
17
  field,
19
18
  i18n,
20
19
  locale,
21
20
  nestingLevel,
22
21
  req,
23
- versionValue: valueTo
22
+ valueFrom,
23
+ valueTo
24
24
  } = args;
25
25
  const internalDocToHref = async ({
26
26
  linkNode,
@@ -78,6 +78,7 @@ export const LexicalDiffComponent = async args => {
78
78
  const payloadPopulateFn = await getPayloadPopulateFn({
79
79
  currentDepth: 0,
80
80
  depth: 1,
81
+ overrideAccess: false,
81
82
  req
82
83
  });
83
84
  const fromHTML = await convertLexicalToHTMLAsync({
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["FieldDiffContainer","getHTMLDiffComponents","formatAdminURL","React","convertLexicalToHTMLAsync","getPayloadPopulateFn","LinkDiffHTMLConverterAsync","ListItemDiffHTMLConverterAsync","RelationshipDiffHTMLConverterAsync","UnknownDiffHTMLConverterAsync","UploadDiffHTMLConverterAsync","baseClass","LexicalDiffComponent","args","comparisonValue","valueFrom","field","i18n","locale","nestingLevel","req","versionValue","valueTo","internalDocToHref","linkNode","populate","fields","doc","relationTo","value","docId","id","collectionSlug","adminRoute","payload","config","routes","admin","path","serverURL","converters","defaultConverters","payloadPopulateFn","currentDepth","depth","fromHTML","data","disableContainer","toHTML","From","To","length","_jsx","className","label"],"sources":["../../../src/field/Diff/index.tsx"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextFieldDiffServerComponent } from 'payload'\n\nimport { FieldDiffContainer, getHTMLDiffComponents } from '@payloadcms/ui/rsc'\n\nimport './index.css'\nimport '../bundled.css'\n\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nimport type {\n HTMLConvertersFunctionAsync,\n HTMLPopulateFn,\n} from '../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedLinkNode } from '../../types/nodeTypes.js'\n\nimport { convertLexicalToHTMLAsync } from '../../features/converters/lexicalToHtml/async/index.js'\nimport { getPayloadPopulateFn } from '../../features/converters/utilities/payloadPopulateFn.js'\nimport { LinkDiffHTMLConverterAsync } from './converters/link.js'\nimport { ListItemDiffHTMLConverterAsync } from './converters/listitem/index.js'\nimport { RelationshipDiffHTMLConverterAsync } from './converters/relationship/index.js'\nimport { UnknownDiffHTMLConverterAsync } from './converters/unknown/index.js'\nimport { UploadDiffHTMLConverterAsync } from './converters/upload/index.js'\n\nconst baseClass = 'lexical-diff'\n\nexport const LexicalDiffComponent: RichTextFieldDiffServerComponent = async (args) => {\n const {\n comparisonValue: valueFrom,\n field,\n i18n,\n locale,\n nestingLevel,\n req,\n versionValue: valueTo,\n } = args\n\n const internalDocToHref = async ({\n linkNode,\n populate,\n }: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => {\n if (!linkNode.fields.doc) {\n return '#'\n }\n\n const { relationTo, value } = linkNode.fields.doc\n\n let docId: number | string\n\n if (typeof value === 'object' && value !== null) {\n docId = value.id\n } else if (populate && typeof value !== 'object') {\n const doc = await populate({\n id: value,\n collectionSlug: relationTo,\n })\n\n if (!doc || !doc.id) {\n return '#'\n }\n\n docId = doc.id\n } else {\n docId = value\n }\n\n return formatAdminURL({\n adminRoute: req.payload.config.routes.admin,\n path: `/collections/${relationTo}/${docId}`,\n serverURL: req.payload.config.serverURL,\n })\n }\n\n const converters: HTMLConvertersFunctionAsync = ({ defaultConverters }) => ({\n ...defaultConverters,\n ...LinkDiffHTMLConverterAsync({ internalDocToHref }),\n ...ListItemDiffHTMLConverterAsync,\n ...UploadDiffHTMLConverterAsync({ i18n, req }),\n ...RelationshipDiffHTMLConverterAsync({ i18n, req }),\n ...UnknownDiffHTMLConverterAsync({ i18n, req }),\n })\n\n const payloadPopulateFn = await getPayloadPopulateFn({\n currentDepth: 0,\n depth: 1,\n req,\n })\n const fromHTML = await convertLexicalToHTMLAsync({\n converters,\n data: valueFrom as SerializedEditorState,\n disableContainer: true,\n populate: payloadPopulateFn,\n })\n\n const toHTML = await convertLexicalToHTMLAsync({\n converters,\n data: valueTo as SerializedEditorState,\n disableContainer: true,\n populate: payloadPopulateFn,\n })\n\n const { From, To } = getHTMLDiffComponents({\n // Ensure empty paragraph is displayed for empty rich text fields - otherwise, toHTML may be displayed in the wrong column\n fromHTML: fromHTML?.length ? fromHTML : '<p></p>',\n toHTML: toHTML?.length ? toHTML : '<p></p>',\n })\n\n return (\n <FieldDiffContainer\n className={baseClass}\n From={From}\n i18n={i18n}\n label={{\n label: field.label,\n locale,\n }}\n nestingLevel={nestingLevel}\n To={To}\n />\n )\n}\n"],"mappings":";AAGA,SAASA,kBAAkB,EAAEC,qBAAqB,QAAQ;AAE1D,OAAO;AACP,OAAO;AAEP,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAQlB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,QAAQ;AACrC,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,8BAA8B,QAAQ;AAC/C,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iB,CAAE,MAAM;IAC1E,GAAGA,iBAAiB;IACpB,GAAGnC,0BAAA,CAA2B;MAAEiB;IAAkB,EAAE;IACpD,GAAGhB,8BAA8B;IACjC,GAAGG,4BAAA,CAA6B;MAAEO,IAAA;MAAMG;IAAI,EAAE;IAC9C,GAAGZ,kCAAA,CAAmC;MAAES,IAAA;MAAMG;IAAI,EAAE;IACpD,GAAGX,6BAAA,CAA8B;MAAEQ,IAAA;MAAMG;IAAI;EAC/C;EAEA,MAAMsB,iBAAA,GAAoB,MAAMrC,oBAAA,CAAqB;IACnDsC,YAAA,EAAc;IACdC,KAAA,EAAO;IACPxB;EACF;EACA,MAAMyB,QAAA,GAAW,MAAMzC,yBAAA,CAA0B;IAC/CoC,UAAA;IACAM,IAAA,EAAM/B,SAAA;IACNgC,gBAAA,EAAkB;IAClBtB,QAAA,EAAUiB;EACZ;EAEA,MAAMM,MAAA,GAAS,MAAM5C,yBAAA,CAA0B;IAC7CoC,UAAA;IACAM,IAAA,EAAMxB,OAAA;IACNyB,gBAAA,EAAkB;IAClBtB,QAAA,EAAUiB;EACZ;EAEA,MAAM;IAAEO,IAAI;IAAEC;EAAE,CAAE,GAAGjD,qBAAA,CAAsB;IACzC;IACA4C,QAAA,EAAUA,QAAA,EAAUM,MAAA,GAASN,QAAA,GAAW;IACxCG,MAAA,EAAQA,MAAA,EAAQG,MAAA,GAASH,MAAA,GAAS;EACpC;EAEA,oBACEI,IAAA,CAACpD,kBAAA;IACCqD,SAAA,EAAW1C,SAAA;IACXsC,IAAA,EAAMA,IAAA;IACNhC,IAAA,EAAMA,IAAA;IACNqC,KAAA,EAAO;MACLA,KAAA,EAAOtC,KAAA,CAAMsC,KAAK;MAClBpC;IACF;IACAC,YAAA,EAAcA,YAAA;IACd+B,EAAA,EAAIA;;AAGV","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["FieldDiffContainer","getHTMLDiffComponents","formatAdminURL","React","convertLexicalToHTMLAsync","getPayloadPopulateFn","LinkDiffHTMLConverterAsync","ListItemDiffHTMLConverterAsync","RelationshipDiffHTMLConverterAsync","UnknownDiffHTMLConverterAsync","UploadDiffHTMLConverterAsync","baseClass","LexicalDiffComponent","args","field","i18n","locale","nestingLevel","req","valueFrom","valueTo","internalDocToHref","linkNode","populate","fields","doc","relationTo","value","docId","id","collectionSlug","adminRoute","payload","config","routes","admin","path","serverURL","converters","defaultConverters","payloadPopulateFn","currentDepth","depth","overrideAccess","fromHTML","data","disableContainer","toHTML","From","To","length","_jsx","className","label"],"sources":["../../../src/field/Diff/index.tsx"],"sourcesContent":["import type { SerializedEditorState } from 'lexical'\nimport type { RichTextFieldDiffServerProps } from 'payload'\n\nimport { FieldDiffContainer, getHTMLDiffComponents } from '@payloadcms/ui/rsc'\n\nimport './index.css'\nimport '../bundled.css'\n\nimport { formatAdminURL } from 'payload/shared'\nimport React from 'react'\n\nimport type {\n HTMLConvertersFunctionAsync,\n HTMLPopulateFn,\n} from '../../features/converters/lexicalToHtml/async/types.js'\nimport type { SerializedLinkNode } from '../../types/nodeTypes.js'\n\nimport { convertLexicalToHTMLAsync } from '../../features/converters/lexicalToHtml/async/index.js'\nimport { getPayloadPopulateFn } from '../../features/converters/utilities/payloadPopulateFn.js'\nimport { LinkDiffHTMLConverterAsync } from './converters/link.js'\nimport { ListItemDiffHTMLConverterAsync } from './converters/listitem/index.js'\nimport { RelationshipDiffHTMLConverterAsync } from './converters/relationship/index.js'\nimport { UnknownDiffHTMLConverterAsync } from './converters/unknown/index.js'\nimport { UploadDiffHTMLConverterAsync } from './converters/upload/index.js'\n\nconst baseClass = 'lexical-diff'\n\nexport const LexicalDiffComponent: React.FC<RichTextFieldDiffServerProps> = async (args) => {\n const { field, i18n, locale, nestingLevel, req, valueFrom, valueTo } = args\n\n const internalDocToHref = async ({\n linkNode,\n populate,\n }: {\n linkNode: SerializedLinkNode\n populate?: HTMLPopulateFn\n }) => {\n if (!linkNode.fields.doc) {\n return '#'\n }\n\n const { relationTo, value } = linkNode.fields.doc\n\n let docId: number | string\n\n if (typeof value === 'object' && value !== null) {\n docId = value.id\n } else if (populate && typeof value !== 'object') {\n const doc = await populate({\n id: value,\n collectionSlug: relationTo,\n })\n\n if (!doc || !doc.id) {\n return '#'\n }\n\n docId = doc.id\n } else {\n docId = value\n }\n\n return formatAdminURL({\n adminRoute: req.payload.config.routes.admin,\n path: `/collections/${relationTo}/${docId}`,\n serverURL: req.payload.config.serverURL,\n })\n }\n\n const converters: HTMLConvertersFunctionAsync = ({ defaultConverters }) => ({\n ...defaultConverters,\n ...LinkDiffHTMLConverterAsync({ internalDocToHref }),\n ...ListItemDiffHTMLConverterAsync,\n ...UploadDiffHTMLConverterAsync({ i18n, req }),\n ...RelationshipDiffHTMLConverterAsync({ i18n, req }),\n ...UnknownDiffHTMLConverterAsync({ i18n, req }),\n })\n\n const payloadPopulateFn = await getPayloadPopulateFn({\n currentDepth: 0,\n depth: 1,\n overrideAccess: false,\n req,\n })\n const fromHTML = await convertLexicalToHTMLAsync({\n converters,\n data: valueFrom as SerializedEditorState,\n disableContainer: true,\n populate: payloadPopulateFn,\n })\n\n const toHTML = await convertLexicalToHTMLAsync({\n converters,\n data: valueTo as SerializedEditorState,\n disableContainer: true,\n populate: payloadPopulateFn,\n })\n\n const { From, To } = getHTMLDiffComponents({\n // Ensure empty paragraph is displayed for empty rich text fields - otherwise, toHTML may be displayed in the wrong column\n fromHTML: fromHTML?.length ? fromHTML : '<p></p>',\n toHTML: toHTML?.length ? toHTML : '<p></p>',\n })\n\n return (\n <FieldDiffContainer\n className={baseClass}\n From={From}\n i18n={i18n}\n label={{\n label: field.label,\n locale,\n }}\n nestingLevel={nestingLevel}\n To={To}\n />\n )\n}\n"],"mappings":";AAGA,SAASA,kBAAkB,EAAEC,qBAAqB,QAAQ;AAE1D,OAAO;AACP,OAAO;AAEP,SAASC,cAAc,QAAQ;AAC/B,OAAOC,KAAA,MAAW;AAQlB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,oBAAoB,QAAQ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Root":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAGxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,kCAAkC,CAAA;AACzC,OAAO,eAAe,CAAA;AACtB,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AASlE,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAA;CACnD,GAAG,yBAAyB,CAuM9B,CAAA;AAWD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
1
+ {"version":3,"file":"Field.d.ts","sourceRoot":"","sources":["../../src/field/Field.tsx"],"names":[],"mappings":"AAsBA,OAAO,KAAoD,MAAM,OAAO,CAAA;AAGxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,4BAA4B,CAAA;AAE7E,OAAO,kCAAkC,CAAA;AACzC,OAAO,eAAe,CAAA;AACtB,OAAO,aAAa,CAAA;AAEpB,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AASlE,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAC/B;IACE,QAAQ,CAAC,YAAY,EAAE,2BAA2B,CAAA;CACnD,GAAG,yBAAyB,CAmN9B,CAAA;AAWD,eAAO,MAAM,QAAQ,EAAE,OAAO,iBAAqC,CAAA"}
@@ -1,7 +1,8 @@
1
1
  'use client';
2
2
 
3
3
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
- import { BulkUploadProvider, FieldDescription, FieldError, FieldLabel, isFieldRTL, RenderCustomComponent, useConfig, useEditDepth, useEffectEvent, useField, useLocale } from '@payloadcms/ui';
4
+ import { getTranslation } from '@payloadcms/translations';
5
+ import { BulkUploadProvider, FieldDescription, FieldError, FieldLabel, isFieldRTL, RenderCustomComponent, useConfig, useEditDepth, useEffectEvent, useField, useLocale, useTranslation } from '@payloadcms/ui';
5
6
  import { mergeFieldStyles } from '@payloadcms/ui/shared';
6
7
  import { dequal } from 'dequal/lite';
7
8
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
@@ -33,6 +34,9 @@ const RichTextComponent = props => {
33
34
  schemaPath,
34
35
  validate
35
36
  } = props;
37
+ const {
38
+ i18n
39
+ } = useTranslation();
36
40
  const readOnlyFromProps = readOnlyFromTopLevelProps || readOnlyFromAdmin;
37
41
  const locale = useLocale();
38
42
  const {
@@ -137,14 +141,17 @@ const RichTextComponent = props => {
137
141
  }
138
142
  }, [initialValue]);
139
143
  return /*#__PURE__*/_jsxs("div", {
144
+ "aria-label": getTranslation(label || '', i18n),
140
145
  className: classes,
141
146
  "data-field-path": path,
142
147
  "data-field-schemapath": schemaPath,
143
148
  "data-lexical-view": editorConfig?.view,
149
+ role: "group",
144
150
  style: styles,
145
151
  children: [/*#__PURE__*/_jsxs("div", {
146
152
  className: `${baseClass}__label-row`,
147
153
  children: [Label || /*#__PURE__*/_jsx(FieldLabel, {
154
+ hasRequiredAccessibleState: true,
148
155
  label: label,
149
156
  localized: localized,
150
157
  path: path,
@@ -161,21 +168,24 @@ const RichTextComponent = props => {
161
168
  }), /*#__PURE__*/_jsxs(ErrorBoundary, {
162
169
  fallbackRender: fallbackRender,
163
170
  onReset: () => {},
164
- children: [BeforeInput, /*#__PURE__*/_jsx(BulkUploadProvider, {
165
- modalSlugPrefix: `lexical-${path}`,
166
- children: /*#__PURE__*/_jsx(LexicalProvider, {
167
- composerKey: pathWithEditDepth,
168
- editorConfig: editorConfig,
169
- fieldProps: props,
170
- isSmallWidthViewport: isSmallWidthViewport,
171
- onChange: handleChange,
172
- readOnly: disabled,
173
- rtl: rtl,
174
- value: value_0
175
- }, JSON.stringify({
176
- path,
177
- rerenderProviderKey
178
- }))
171
+ children: [BeforeInput, /*#__PURE__*/_jsx("div", {
172
+ className: `${baseClass}__editor-content`,
173
+ children: /*#__PURE__*/_jsx(BulkUploadProvider, {
174
+ modalSlugPrefix: `lexical-${path}`,
175
+ children: /*#__PURE__*/_jsx(LexicalProvider, {
176
+ composerKey: pathWithEditDepth,
177
+ editorConfig: editorConfig,
178
+ fieldProps: props,
179
+ isSmallWidthViewport: isSmallWidthViewport,
180
+ onChange: handleChange,
181
+ readOnly: disabled,
182
+ rtl: rtl,
183
+ value: value_0
184
+ }, JSON.stringify({
185
+ path,
186
+ rerenderProviderKey
187
+ }))
188
+ })
179
189
  }), AfterInput]
180
190
  }), /*#__PURE__*/_jsx(RenderCustomComponent, {
181
191
  CustomComponent: Description,