@payloadcms/richtext-lexical 4.0.0-internal.1f9ae9a → 4.0.0-internal.203916b

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 (531) hide show
  1. package/LICENSE.md +1 -1
  2. package/dist/cell/rscEntry.d.ts.map +1 -1
  3. package/dist/cell/rscEntry.js +5 -5
  4. package/dist/cell/rscEntry.js.map +1 -1
  5. package/dist/exports/client/Field-XH5C4HFU.js +2 -0
  6. package/dist/exports/client/Field-XH5C4HFU.js.map +7 -0
  7. package/dist/exports/client/{RelationshipComponent-RZL743CS.js → RelationshipComponent-YCPAKOL7.js} +1 -1
  8. package/dist/exports/client/RelationshipComponent-YCPAKOL7.js.map +7 -0
  9. package/dist/exports/client/bundled.css +1 -1
  10. package/dist/exports/client/chunk-5VIL27GI.js +2 -0
  11. package/dist/exports/client/chunk-5VIL27GI.js.map +7 -0
  12. package/dist/exports/client/chunk-ESITTE3C.js +2 -0
  13. package/dist/exports/client/chunk-ESITTE3C.js.map +7 -0
  14. package/dist/exports/client/chunk-UD4DQ4AK.js +2 -0
  15. package/dist/exports/client/chunk-UD4DQ4AK.js.map +7 -0
  16. package/dist/exports/client/chunk-X3D4LZS7.js +2 -0
  17. package/dist/exports/client/chunk-X3D4LZS7.js.map +7 -0
  18. package/dist/exports/client/{component-CVM4OESA.js → component-PHZQBOJE.js} +2 -2
  19. package/dist/exports/client/component-PHZQBOJE.js.map +7 -0
  20. package/dist/exports/client/componentInline-H24N7GUG.js +2 -0
  21. package/dist/exports/client/index.d.ts +0 -1
  22. package/dist/exports/client/index.d.ts.map +1 -1
  23. package/dist/exports/client/index.js +20 -21
  24. package/dist/exports/client/index.js.map +4 -4
  25. package/dist/features/blockquote/client/index.js +2 -2
  26. package/dist/features/blockquote/client/index.js.map +1 -1
  27. package/dist/features/blockquote/server/index.d.ts +1 -4
  28. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  29. package/dist/features/blockquote/server/index.js +4 -2
  30. package/dist/features/blockquote/server/index.js.map +1 -1
  31. package/dist/features/blockquote/server/schema.d.ts +8 -0
  32. package/dist/features/blockquote/server/schema.d.ts.map +1 -0
  33. package/dist/features/blockquote/server/schema.js +15 -0
  34. package/dist/features/blockquote/server/schema.js.map +1 -0
  35. package/dist/features/blocks/client/component/index.css +2 -2
  36. package/dist/features/blocks/client/component/index.d.ts +2 -1
  37. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  38. package/dist/features/blocks/client/component/index.js +16 -8
  39. package/dist/features/blocks/client/component/index.js.map +1 -1
  40. package/dist/features/blocks/client/componentInline/index.css +8 -8
  41. package/dist/features/blocks/client/componentInline/index.d.ts +2 -1
  42. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  43. package/dist/features/blocks/client/componentInline/index.js +15 -7
  44. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  45. package/dist/features/blocks/client/index.d.ts.map +1 -1
  46. package/dist/features/blocks/client/index.js +4 -2
  47. package/dist/features/blocks/client/index.js.map +1 -1
  48. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts +1 -1
  49. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.d.ts.map +1 -1
  50. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js +1 -1
  51. package/dist/features/blocks/client/markdown/getLexicalToMarkdown.js.map +1 -1
  52. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts +1 -1
  53. package/dist/features/blocks/client/markdown/getMarkdownToLexical.d.ts.map +1 -1
  54. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js +5 -2
  55. package/dist/features/blocks/client/markdown/getMarkdownToLexical.js.map +1 -1
  56. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts +1 -2
  57. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  58. package/dist/features/blocks/client/markdown/markdownTransformer.js +4 -4
  59. package/dist/features/blocks/client/markdown/markdownTransformer.js.map +1 -1
  60. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +1 -1
  61. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  62. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  63. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +1 -1
  64. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  65. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  66. package/dist/features/blocks/client/plugin/index.d.ts +1 -1
  67. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  68. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  69. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
  70. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +1 -0
  71. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  72. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +1 -1
  73. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +2 -4
  74. package/dist/features/blocks/premade/CodeBlock/Component/index.css +5 -5
  75. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts +1 -2
  76. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  77. package/dist/features/blocks/server/graphQLPopulationPromise.js.map +1 -1
  78. package/dist/features/blocks/server/index.d.ts +1 -0
  79. package/dist/features/blocks/server/index.d.ts.map +1 -1
  80. package/dist/features/blocks/server/index.js +24 -72
  81. package/dist/features/blocks/server/index.js.map +1 -1
  82. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts +1 -1
  83. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  84. package/dist/features/blocks/server/markdown/markdownTransformer.js +4 -4
  85. package/dist/features/blocks/server/markdown/markdownTransformer.js.map +1 -1
  86. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -18
  87. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  88. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  89. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +2 -10
  90. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  91. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  92. package/dist/features/blocks/server/schema.d.ts +45 -0
  93. package/dist/features/blocks/server/schema.d.ts.map +1 -0
  94. package/dist/features/blocks/server/schema.js +140 -0
  95. package/dist/features/blocks/server/schema.js.map +1 -0
  96. package/dist/features/blocks/server/validate.d.ts +1 -2
  97. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  98. package/dist/features/blocks/server/validate.js.map +1 -1
  99. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  100. package/dist/features/converters/lexicalToHtml/async/types.d.ts +14 -15
  101. package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
  102. package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
  103. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  104. package/dist/features/converters/lexicalToHtml/sync/types.d.ts +14 -15
  105. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  106. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  107. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +4 -2
  108. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  109. package/dist/features/converters/lexicalToJSX/Component/index.js +5 -4
  110. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  111. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  112. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +12 -14
  113. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  114. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  115. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  116. package/dist/features/converters/lexicalToMarkdown/index.js +1 -1
  117. package/dist/features/converters/lexicalToMarkdown/index.js.map +1 -1
  118. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +12 -14
  119. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
  120. package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
  121. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  122. package/dist/features/converters/markdownToLexical/index.js +5 -2
  123. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  124. package/dist/features/debug/jsxConverter/client/plugin/style.css +2 -2
  125. package/dist/features/experimental_table/client/index.js +2 -2
  126. package/dist/features/experimental_table/client/index.js.map +1 -1
  127. package/dist/features/experimental_table/markdownTransformer.d.ts +2 -2
  128. package/dist/features/experimental_table/markdownTransformer.d.ts.map +1 -1
  129. package/dist/features/experimental_table/markdownTransformer.js +6 -3
  130. package/dist/features/experimental_table/markdownTransformer.js.map +1 -1
  131. package/dist/features/experimental_table/server/index.d.ts +1 -6
  132. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  133. package/dist/features/experimental_table/server/index.js +6 -2
  134. package/dist/features/experimental_table/server/index.js.map +1 -1
  135. package/dist/features/experimental_table/server/schema.d.ts +27 -0
  136. package/dist/features/experimental_table/server/schema.d.ts.map +1 -0
  137. package/dist/features/experimental_table/server/schema.js +107 -0
  138. package/dist/features/experimental_table/server/schema.js.map +1 -0
  139. package/dist/features/format/bold/feature.client.js +1 -1
  140. package/dist/features/format/bold/feature.client.js.map +1 -1
  141. package/dist/features/format/bold/feature.server.d.ts.map +1 -1
  142. package/dist/features/format/bold/feature.server.js +1 -1
  143. package/dist/features/format/bold/feature.server.js.map +1 -1
  144. package/dist/features/format/inlineCode/feature.client.js +1 -1
  145. package/dist/features/format/inlineCode/feature.client.js.map +1 -1
  146. package/dist/features/format/inlineCode/feature.server.d.ts.map +1 -1
  147. package/dist/features/format/inlineCode/feature.server.js +1 -1
  148. package/dist/features/format/inlineCode/feature.server.js.map +1 -1
  149. package/dist/features/format/italic/feature.client.js +1 -1
  150. package/dist/features/format/italic/feature.client.js.map +1 -1
  151. package/dist/features/format/italic/feature.server.d.ts.map +1 -1
  152. package/dist/features/format/italic/feature.server.js +1 -1
  153. package/dist/features/format/italic/feature.server.js.map +1 -1
  154. package/dist/features/format/strikethrough/feature.client.js +1 -1
  155. package/dist/features/format/strikethrough/feature.client.js.map +1 -1
  156. package/dist/features/format/strikethrough/feature.server.d.ts.map +1 -1
  157. package/dist/features/format/strikethrough/feature.server.js +1 -1
  158. package/dist/features/format/strikethrough/feature.server.js.map +1 -1
  159. package/dist/features/heading/client/index.js +2 -2
  160. package/dist/features/heading/client/index.js.map +1 -1
  161. package/dist/features/heading/markdownTransformer.d.ts +2 -2
  162. package/dist/features/heading/markdownTransformer.d.ts.map +1 -1
  163. package/dist/features/heading/markdownTransformer.js +6 -19
  164. package/dist/features/heading/markdownTransformer.js.map +1 -1
  165. package/dist/features/heading/server/index.d.ts +2 -4
  166. package/dist/features/heading/server/index.d.ts.map +1 -1
  167. package/dist/features/heading/server/index.js +4 -2
  168. package/dist/features/heading/server/index.js.map +1 -1
  169. package/dist/features/heading/server/schema.d.ts +10 -0
  170. package/dist/features/heading/server/schema.d.ts.map +1 -0
  171. package/dist/features/heading/server/schema.js +37 -0
  172. package/dist/features/heading/server/schema.js.map +1 -0
  173. package/dist/features/horizontalRule/client/index.js +2 -2
  174. package/dist/features/horizontalRule/client/index.js.map +1 -1
  175. package/dist/features/horizontalRule/client/markdownTransformer.d.ts +2 -2
  176. package/dist/features/horizontalRule/client/markdownTransformer.d.ts.map +1 -1
  177. package/dist/features/horizontalRule/client/markdownTransformer.js +1 -1
  178. package/dist/features/horizontalRule/client/markdownTransformer.js.map +1 -1
  179. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts +1 -1
  180. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.d.ts.map +1 -1
  181. package/dist/features/horizontalRule/client/nodes/HorizontalRuleNode.js.map +1 -1
  182. package/dist/features/horizontalRule/client/plugin/index.css +2 -2
  183. package/dist/features/horizontalRule/server/index.d.ts +1 -0
  184. package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
  185. package/dist/features/horizontalRule/server/index.js +4 -2
  186. package/dist/features/horizontalRule/server/index.js.map +1 -1
  187. package/dist/features/horizontalRule/server/markdownTransformer.d.ts +2 -2
  188. package/dist/features/horizontalRule/server/markdownTransformer.d.ts.map +1 -1
  189. package/dist/features/horizontalRule/server/markdownTransformer.js +1 -1
  190. package/dist/features/horizontalRule/server/markdownTransformer.js.map +1 -1
  191. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -5
  192. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  193. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  194. package/dist/features/horizontalRule/server/schema.d.ts +7 -0
  195. package/dist/features/horizontalRule/server/schema.d.ts.map +1 -0
  196. package/dist/features/horizontalRule/server/schema.js +25 -0
  197. package/dist/features/horizontalRule/server/schema.js.map +1 -0
  198. package/dist/features/link/client/index.d.ts.map +1 -1
  199. package/dist/features/link/client/index.js +2 -2
  200. package/dist/features/link/client/index.js.map +1 -1
  201. package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
  202. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  203. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  204. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +3 -3
  205. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  206. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +7 -11
  207. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts +1 -1
  208. package/dist/features/link/client/plugins/floatingLinkEditor/types.d.ts.map +1 -1
  209. package/dist/features/link/client/plugins/floatingLinkEditor/types.js.map +1 -1
  210. package/dist/features/link/client/plugins/link/index.js.map +1 -1
  211. package/dist/features/link/markdownTransformer.d.ts +5 -5
  212. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  213. package/dist/features/link/markdownTransformer.js +2 -2
  214. package/dist/features/link/markdownTransformer.js.map +1 -1
  215. package/dist/features/link/markdownTransformer.spec.js +10 -10
  216. package/dist/features/link/markdownTransformer.spec.js.map +1 -1
  217. package/dist/features/link/nodes/AutoLinkNode.d.ts +3 -3
  218. package/dist/features/link/nodes/AutoLinkNode.d.ts.map +1 -1
  219. package/dist/features/link/nodes/AutoLinkNode.js +2 -1
  220. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  221. package/dist/features/link/nodes/LinkNode.d.ts +3 -3
  222. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  223. package/dist/features/link/nodes/LinkNode.js +2 -1
  224. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  225. package/dist/features/link/server/baseFields.js.map +1 -1
  226. package/dist/features/link/server/graphQLPopulationPromise.d.ts +1 -1
  227. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  228. package/dist/features/link/server/graphQLPopulationPromise.js.map +1 -1
  229. package/dist/features/link/server/index.d.ts +2 -1
  230. package/dist/features/link/server/index.d.ts.map +1 -1
  231. package/dist/features/link/server/index.js +5 -2
  232. package/dist/features/link/server/index.js.map +1 -1
  233. package/dist/features/link/server/schema.d.ts +32 -0
  234. package/dist/features/link/server/schema.d.ts.map +1 -0
  235. package/dist/features/link/server/schema.js +171 -0
  236. package/dist/features/link/server/schema.js.map +1 -0
  237. package/dist/features/link/server/validate.d.ts +1 -1
  238. package/dist/features/link/server/validate.d.ts.map +1 -1
  239. package/dist/features/link/server/validate.js.map +1 -1
  240. package/dist/features/lists/checklist/client/index.js +1 -1
  241. package/dist/features/lists/checklist/client/index.js.map +1 -1
  242. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  243. package/dist/features/lists/checklist/server/index.js +4 -1
  244. package/dist/features/lists/checklist/server/index.js.map +1 -1
  245. package/dist/features/lists/orderedList/client/index.js +1 -1
  246. package/dist/features/lists/orderedList/client/index.js.map +1 -1
  247. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  248. package/dist/features/lists/orderedList/server/index.js +4 -1
  249. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  250. package/dist/features/lists/plugin/index.d.ts +0 -9
  251. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  252. package/dist/features/lists/plugin/index.js.map +1 -1
  253. package/dist/features/lists/shared/schema.d.ts +18 -0
  254. package/dist/features/lists/shared/schema.d.ts.map +1 -0
  255. package/dist/features/lists/shared/schema.js +62 -0
  256. package/dist/features/lists/shared/schema.js.map +1 -0
  257. package/dist/features/lists/unorderedList/client/index.js +1 -1
  258. package/dist/features/lists/unorderedList/client/index.js.map +1 -1
  259. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  260. package/dist/features/lists/unorderedList/server/index.js +4 -1
  261. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  262. package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
  263. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  264. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  265. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
  266. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  267. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  268. package/dist/features/relationship/client/plugins/index.d.ts +1 -1
  269. package/dist/features/relationship/client/plugins/index.d.ts.map +1 -1
  270. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  271. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  272. package/dist/features/relationship/client/utils/useEnabledRelationships.js +9 -40
  273. package/dist/features/relationship/client/utils/useEnabledRelationships.js.map +1 -1
  274. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts +1 -1
  275. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  276. package/dist/features/relationship/server/graphQLPopulationPromise.js.map +1 -1
  277. package/dist/features/relationship/server/index.d.ts +1 -0
  278. package/dist/features/relationship/server/index.d.ts.map +1 -1
  279. package/dist/features/relationship/server/index.js +2 -0
  280. package/dist/features/relationship/server/index.js.map +1 -1
  281. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -10
  282. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  283. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  284. package/dist/features/relationship/server/schema.d.ts +28 -0
  285. package/dist/features/relationship/server/schema.d.ts.map +1 -0
  286. package/dist/features/relationship/server/schema.js +97 -0
  287. package/dist/features/relationship/server/schema.js.map +1 -0
  288. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts +23 -0
  289. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.d.ts.map +1 -0
  290. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js +34 -0
  291. package/dist/features/relationship/shared/filterEnabledRelationshipCollections.js.map +1 -0
  292. package/dist/features/textState/feature.client.js +1 -1
  293. package/dist/features/textState/feature.client.js.map +1 -1
  294. package/dist/features/toolbars/fixed/client/Toolbar/index.css +2 -2
  295. package/dist/features/toolbars/inline/client/Toolbar/index.css +2 -13
  296. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +8 -12
  297. package/dist/features/toolbars/shared/useToolbarStates.d.ts.map +1 -1
  298. package/dist/features/toolbars/shared/useToolbarStates.js +3 -1
  299. package/dist/features/toolbars/shared/useToolbarStates.js.map +1 -1
  300. package/dist/features/typesClient.d.ts +1 -1
  301. package/dist/features/typesClient.d.ts.map +1 -1
  302. package/dist/features/typesClient.js.map +1 -1
  303. package/dist/features/typesServer.d.ts +18 -41
  304. package/dist/features/typesServer.d.ts.map +1 -1
  305. package/dist/features/typesServer.js.map +1 -1
  306. package/dist/features/upload/client/component/index.css +11 -11
  307. package/dist/features/upload/client/component/index.d.ts +1 -1
  308. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  309. package/dist/features/upload/client/component/index.js.map +1 -1
  310. package/dist/features/upload/client/nodes/UploadNode.d.ts +1 -1
  311. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  312. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  313. package/dist/features/upload/client/plugin/index.d.ts +1 -1
  314. package/dist/features/upload/client/plugin/index.d.ts.map +1 -1
  315. package/dist/features/upload/client/plugin/index.js +5 -5
  316. package/dist/features/upload/client/plugin/index.js.map +1 -1
  317. package/dist/features/upload/server/graphQLPopulationPromise.d.ts +1 -1
  318. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  319. package/dist/features/upload/server/graphQLPopulationPromise.js.map +1 -1
  320. package/dist/features/upload/server/index.d.ts +1 -0
  321. package/dist/features/upload/server/index.d.ts.map +1 -1
  322. package/dist/features/upload/server/index.js +5 -4
  323. package/dist/features/upload/server/index.js.map +1 -1
  324. package/dist/features/upload/server/markdownTransformer.d.ts +2 -2
  325. package/dist/features/upload/server/markdownTransformer.d.ts.map +1 -1
  326. package/dist/features/upload/server/markdownTransformer.js +1 -1
  327. package/dist/features/upload/server/markdownTransformer.js.map +1 -1
  328. package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -55
  329. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  330. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  331. package/dist/features/upload/server/nodes/conversions.d.ts.map +1 -1
  332. package/dist/features/upload/server/nodes/conversions.js.map +1 -1
  333. package/dist/features/upload/server/schema.d.ts +52 -0
  334. package/dist/features/upload/server/schema.d.ts.map +1 -0
  335. package/dist/features/upload/server/schema.js +149 -0
  336. package/dist/features/upload/server/schema.js.map +1 -0
  337. package/dist/features/upload/server/validate.d.ts +1 -1
  338. package/dist/features/upload/server/validate.d.ts.map +1 -1
  339. package/dist/features/upload/server/validate.js.map +1 -1
  340. package/dist/field/Diff/converters/unknown/index.css +1 -1
  341. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  342. package/dist/field/Field.js +1 -1
  343. package/dist/field/Field.js.map +1 -1
  344. package/dist/field/ViewSelector.css +1 -1
  345. package/dist/field/bundled.css +1 -1
  346. package/dist/field/index.css +5 -5
  347. package/dist/field/index.js +1 -1
  348. package/dist/field/index.js.map +1 -1
  349. package/dist/field/rscEntry.d.ts.map +1 -1
  350. package/dist/field/rscEntry.js +2 -0
  351. package/dist/field/rscEntry.js.map +1 -1
  352. package/dist/index.d.ts +10 -7
  353. package/dist/index.d.ts.map +1 -1
  354. package/dist/index.js +3 -3
  355. package/dist/index.js.map +1 -1
  356. package/dist/lexical/LexicalEditor.css +2 -2
  357. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  358. package/dist/lexical/config/client/loader.js +5 -1
  359. package/dist/lexical/config/client/loader.js.map +1 -1
  360. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  361. package/dist/lexical/config/server/sanitize.js +9 -11
  362. package/dist/lexical/config/server/sanitize.js.map +1 -1
  363. package/dist/lexical/plugins/DecoratorPlugin/index.css +1 -1
  364. package/dist/lexical/plugins/MarkdownShortcut/index.d.ts.map +1 -1
  365. package/dist/lexical/plugins/MarkdownShortcut/index.js +1 -1
  366. package/dist/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  367. package/dist/lexical/plugins/SlashMenu/index.css +1 -5
  368. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +1 -1
  369. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +3 -3
  370. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +1 -1
  371. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  372. package/dist/lexical/theme/EditorTheme.css +18 -19
  373. package/dist/lexical/ui/ContentEditable.css +5 -5
  374. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts +17 -0
  375. package/dist/lexical/utils/markdown/convertFromMarkdownString.d.ts.map +1 -0
  376. package/dist/lexical/utils/markdown/convertFromMarkdownString.js +27 -0
  377. package/dist/lexical/utils/markdown/convertFromMarkdownString.js.map +1 -0
  378. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js +88 -0
  379. package/dist/lexical/utils/markdown/convertFromMarkdownString.spec.js.map +1 -0
  380. package/dist/lexical/utils/markdown/createBlockNode.d.ts +1 -1
  381. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  382. package/dist/lexical/utils/markdown/createBlockNode.js.map +1 -1
  383. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts +25 -0
  384. package/dist/lexical/utils/markdown/normalizeMarkdown.d.ts.map +1 -0
  385. package/dist/lexical/utils/markdown/normalizeMarkdown.js +91 -0
  386. package/dist/lexical/utils/markdown/normalizeMarkdown.js.map +1 -0
  387. package/dist/lexical-proxy/@lexical-markdown.d.ts +1 -1
  388. package/dist/lexical-proxy/@lexical-markdown.d.ts.map +1 -1
  389. package/dist/lexical-proxy/@lexical-markdown.js +1 -1
  390. package/dist/lexical-proxy/@lexical-markdown.js.map +1 -1
  391. package/dist/types/builtInNodes.d.ts +14 -0
  392. package/dist/types/builtInNodes.d.ts.map +1 -0
  393. package/dist/types/builtInNodes.js +203 -0
  394. package/dist/types/builtInNodes.js.map +1 -0
  395. package/dist/types/index.d.ts +16 -17
  396. package/dist/types/index.d.ts.map +1 -1
  397. package/dist/types/index.js.map +1 -1
  398. package/dist/types/jsonSchemaHelpers.d.ts +30 -0
  399. package/dist/types/jsonSchemaHelpers.d.ts.map +1 -0
  400. package/dist/types/jsonSchemaHelpers.js +58 -0
  401. package/dist/types/jsonSchemaHelpers.js.map +1 -0
  402. package/dist/types/nodeTypes.d.ts +115 -61
  403. package/dist/types/nodeTypes.d.ts.map +1 -1
  404. package/dist/types/nodeTypes.js +3 -2
  405. package/dist/types/nodeTypes.js.map +1 -1
  406. package/dist/types/schema.d.ts.map +1 -1
  407. package/dist/types/schema.js +74 -65
  408. package/dist/types/schema.js.map +1 -1
  409. package/dist/utilities/applyBaseFilterToFields.d.ts.map +1 -1
  410. package/dist/utilities/applyBaseFilterToFields.js +1 -2
  411. package/dist/utilities/applyBaseFilterToFields.js.map +1 -1
  412. package/dist/utilities/buildEditorState.d.ts +17 -3
  413. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  414. package/dist/utilities/buildEditorState.js +8 -0
  415. package/dist/utilities/buildEditorState.js.map +1 -1
  416. package/dist/utilities/buildInitialState.d.ts +2 -1
  417. package/dist/utilities/buildInitialState.d.ts.map +1 -1
  418. package/dist/utilities/buildInitialState.js.map +1 -1
  419. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
  420. package/dist/utilities/fieldsDrawer/Drawer.js +19 -10
  421. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  422. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts +4 -1
  423. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  424. package/dist/utilities/fieldsDrawer/DrawerContent.js +8 -7
  425. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  426. package/dist/utilities/fieldsDrawer/index.css +12 -0
  427. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts +29 -0
  428. package/dist/utilities/fieldsDrawer/useDrawerSubmit.d.ts.map +1 -0
  429. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js +97 -0
  430. package/dist/utilities/fieldsDrawer/useDrawerSubmit.js.map +1 -0
  431. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +1 -1
  432. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  433. package/package.json +22 -26
  434. package/dist/exports/client/Field-G5Z2HM5Y.js +0 -2
  435. package/dist/exports/client/Field-G5Z2HM5Y.js.map +0 -7
  436. package/dist/exports/client/RelationshipComponent-RZL743CS.js.map +0 -7
  437. package/dist/exports/client/chunk-6QWQ7JV4.js +0 -2
  438. package/dist/exports/client/chunk-6QWQ7JV4.js.map +0 -7
  439. package/dist/exports/client/chunk-FEJXFRL7.js +0 -2
  440. package/dist/exports/client/chunk-FEJXFRL7.js.map +0 -7
  441. package/dist/exports/client/chunk-INBEEENE.js +0 -2
  442. package/dist/exports/client/chunk-INBEEENE.js.map +0 -7
  443. package/dist/exports/client/chunk-LH634DPU.js +0 -12
  444. package/dist/exports/client/chunk-LH634DPU.js.map +0 -7
  445. package/dist/exports/client/component-CVM4OESA.js.map +0 -7
  446. package/dist/exports/client/componentInline-JJZ2NKW2.js +0 -2
  447. package/dist/features/blockquote/markdownTransformer.d.ts +0 -3
  448. package/dist/features/blockquote/markdownTransformer.d.ts.map +0 -1
  449. package/dist/features/blockquote/markdownTransformer.js +0 -33
  450. package/dist/features/blockquote/markdownTransformer.js.map +0 -1
  451. package/dist/features/format/bold/markdownTransformers.d.ts +0 -6
  452. package/dist/features/format/bold/markdownTransformers.d.ts.map +0 -1
  453. package/dist/features/format/bold/markdownTransformers.js +0 -23
  454. package/dist/features/format/bold/markdownTransformers.js.map +0 -1
  455. package/dist/features/format/inlineCode/markdownTransformers.d.ts +0 -3
  456. package/dist/features/format/inlineCode/markdownTransformers.d.ts.map +0 -1
  457. package/dist/features/format/inlineCode/markdownTransformers.js +0 -6
  458. package/dist/features/format/inlineCode/markdownTransformers.js.map +0 -1
  459. package/dist/features/format/italic/markdownTransformers.d.ts +0 -4
  460. package/dist/features/format/italic/markdownTransformers.d.ts.map +0 -1
  461. package/dist/features/format/italic/markdownTransformers.js +0 -12
  462. package/dist/features/format/italic/markdownTransformers.js.map +0 -1
  463. package/dist/features/format/strikethrough/markdownTransformers.d.ts +0 -3
  464. package/dist/features/format/strikethrough/markdownTransformers.d.ts.map +0 -1
  465. package/dist/features/format/strikethrough/markdownTransformers.js +0 -6
  466. package/dist/features/format/strikethrough/markdownTransformers.js.map +0 -1
  467. package/dist/features/link/nodes/types.d.ts +0 -27
  468. package/dist/features/link/nodes/types.d.ts.map +0 -1
  469. package/dist/features/link/nodes/types.js +0 -2
  470. package/dist/features/link/nodes/types.js.map +0 -1
  471. package/dist/features/lists/checklist/markdownTransformers.d.ts +0 -3
  472. package/dist/features/lists/checklist/markdownTransformers.d.ts.map +0 -1
  473. package/dist/features/lists/checklist/markdownTransformers.js +0 -12
  474. package/dist/features/lists/checklist/markdownTransformers.js.map +0 -1
  475. package/dist/features/lists/orderedList/markdownTransformer.d.ts +0 -3
  476. package/dist/features/lists/orderedList/markdownTransformer.d.ts.map +0 -1
  477. package/dist/features/lists/orderedList/markdownTransformer.js +0 -12
  478. package/dist/features/lists/orderedList/markdownTransformer.js.map +0 -1
  479. package/dist/features/lists/shared/markdown.d.ts +0 -6
  480. package/dist/features/lists/shared/markdown.d.ts.map +0 -1
  481. package/dist/features/lists/shared/markdown.js +0 -57
  482. package/dist/features/lists/shared/markdown.js.map +0 -1
  483. package/dist/features/lists/unorderedList/markdownTransformer.d.ts +0 -3
  484. package/dist/features/lists/unorderedList/markdownTransformer.d.ts.map +0 -1
  485. package/dist/features/lists/unorderedList/markdownTransformer.js +0 -12
  486. package/dist/features/lists/unorderedList/markdownTransformer.js.map +0 -1
  487. package/dist/lexical/utils/guard.d.ts +0 -5
  488. package/dist/lexical/utils/guard.d.ts.map +0 -1
  489. package/dist/lexical/utils/guard.js +0 -9
  490. package/dist/lexical/utils/guard.js.map +0 -1
  491. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts +0 -2
  492. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.d.ts.map +0 -1
  493. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js +0 -2
  494. package/dist/lexical-proxy/@lexical-react/LexicalContextMenuPlugin.js.map +0 -1
  495. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts +0 -14
  496. package/dist/packages/@lexical/markdown/MarkdownExport.d.ts.map +0 -1
  497. package/dist/packages/@lexical/markdown/MarkdownExport.js +0 -213
  498. package/dist/packages/@lexical/markdown/MarkdownExport.js.map +0 -1
  499. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts +0 -19
  500. package/dist/packages/@lexical/markdown/MarkdownImport.d.ts.map +0 -1
  501. package/dist/packages/@lexical/markdown/MarkdownImport.js +0 -198
  502. package/dist/packages/@lexical/markdown/MarkdownImport.js.map +0 -1
  503. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts +0 -11
  504. package/dist/packages/@lexical/markdown/MarkdownShortcuts.d.ts.map +0 -1
  505. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js +0 -304
  506. package/dist/packages/@lexical/markdown/MarkdownShortcuts.js.map +0 -1
  507. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts +0 -147
  508. package/dist/packages/@lexical/markdown/MarkdownTransformers.d.ts.map +0 -1
  509. package/dist/packages/@lexical/markdown/MarkdownTransformers.js +0 -268
  510. package/dist/packages/@lexical/markdown/MarkdownTransformers.js.map +0 -1
  511. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts +0 -22
  512. package/dist/packages/@lexical/markdown/importTextFormatTransformer.d.ts.map +0 -1
  513. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js +0 -91
  514. package/dist/packages/@lexical/markdown/importTextFormatTransformer.js.map +0 -1
  515. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts +0 -21
  516. package/dist/packages/@lexical/markdown/importTextMatchTransformer.d.ts.map +0 -1
  517. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js +0 -54
  518. package/dist/packages/@lexical/markdown/importTextMatchTransformer.js.map +0 -1
  519. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts +0 -18
  520. package/dist/packages/@lexical/markdown/importTextTransformers.d.ts.map +0 -1
  521. package/dist/packages/@lexical/markdown/importTextTransformers.js +0 -54
  522. package/dist/packages/@lexical/markdown/importTextTransformers.js.map +0 -1
  523. package/dist/packages/@lexical/markdown/index.d.ts +0 -29
  524. package/dist/packages/@lexical/markdown/index.d.ts.map +0 -1
  525. package/dist/packages/@lexical/markdown/index.js +0 -39
  526. package/dist/packages/@lexical/markdown/index.js.map +0 -1
  527. package/dist/packages/@lexical/markdown/utils.d.ts +0 -34
  528. package/dist/packages/@lexical/markdown/utils.d.ts.map +0 -1
  529. package/dist/packages/@lexical/markdown/utils.js +0 -267
  530. package/dist/packages/@lexical/markdown/utils.js.map +0 -1
  531. /package/dist/exports/client/{componentInline-JJZ2NKW2.js.map → componentInline-H24N7GUG.js.map} +0 -0
@@ -1,10 +1,11 @@
1
- import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations';
1
+ import type { Transformer } from '@lexical/markdown';
2
+ import type { GenericLanguages, I18nClient } from '@payloadcms/translations';
2
3
  import type { JSONSchema4 } from 'json-schema';
3
4
  import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState, SerializedLexicalNode } from 'lexical';
4
- import type { Field, FieldSchemaMap, ImportMapGenerators, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, TypedFallbackLocale, ValidateOptions, ValidationFieldError } from 'payload';
5
+ import type { Field, FieldSchemaMap, FieldsToJSONSchemaArgs, ImportMapGenerators, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, TypedFallbackLocale, ValidateOptions, ValidationFieldError } from 'payload';
5
6
  import type { ServerEditorConfig } from '../lexical/config/types.js';
6
- import type { Transformer } from '../packages/@lexical/markdown/index.js';
7
7
  import type { LexicalRichTextField } from '../types/index.js';
8
+ import type { ElementNodeSchemaFn } from '../types/jsonSchemaHelpers.js';
8
9
  import type { BaseClientFeatureProps } from './typesClient.js';
9
10
  export type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {
10
11
  context: RequestContext;
@@ -150,6 +151,14 @@ export type AfterReadNodeHook<T extends SerializedLexicalNode> = (args: AfterRea
150
151
  export type AfterChangeNodeHook<T extends SerializedLexicalNode> = (args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>) => Promise<T> | T;
151
152
  export type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>) => Promise<T> | T;
152
153
  export type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>) => Promise<T> | T;
154
+ /** Arguments passed to each node's `jsonSchema` function. */
155
+ export type JSONSchemaArgs = {
156
+ elementNodeSchema: ElementNodeSchemaFn;
157
+ field: LexicalRichTextField;
158
+ /** TS name of the node union - use in `tsType` annotations. */
159
+ nodeUnionName: string;
160
+ } & Pick<FieldsToJSONSchemaArgs, 'collectionIDFieldTypes' | 'config' | 'i18n' | 'interfaceNameDefinitions' | 'typeStringDefinitions' | 'variant'>;
161
+ export type JSONSchemaFn = (args: JSONSchemaArgs) => JSONSchema4;
153
162
  export type NodeWithHooks<T extends LexicalNode = any> = {
154
163
  /**
155
164
  * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload
@@ -185,6 +194,12 @@ export type NodeWithHooks<T extends LexicalNode = any> = {
185
194
  beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
186
195
  beforeValidate?: Array<BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
187
196
  };
197
+ /**
198
+ * Returns the JSON Schema for this node, plus optional standalone TS
199
+ * source for helper types its `tsType` annotations reference. Nodes
200
+ * without this function are omitted from the strictly-typed union.
201
+ */
202
+ jsonSchema?: JSONSchemaFn;
188
203
  /**
189
204
  * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).
190
205
  */
@@ -209,25 +224,6 @@ export type ServerFeature<ServerProps, ClientFeatureProps> = {
209
224
  componentImports?: {
210
225
  [key: string]: PayloadComponent;
211
226
  } | ImportMapGenerators[0] | PayloadComponent[];
212
- generatedTypes?: {
213
- modifyJSONSchema: (args: {
214
- collectionIDFieldTypes: {
215
- [key: string]: 'number' | 'string';
216
- };
217
- config?: SanitizedConfig;
218
- /**
219
- * Current schema which will be modified by this function.
220
- */
221
- currentSchema: JSONSchema4;
222
- field: LexicalRichTextField;
223
- i18n?: I18n;
224
- /**
225
- * Allows you to define new top-level interfaces that can be re-used in the output schema.
226
- */
227
- interfaceNameDefinitions: Map<string, JSONSchema4>;
228
- isRequired: boolean;
229
- }) => JSONSchema4;
230
- };
231
227
  generateSchemaMap?: (args: {
232
228
  config: SanitizedConfig;
233
229
  field: RichTextField;
@@ -272,25 +268,6 @@ export type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, an
272
268
  export type SanitizedServerFeatures = {
273
269
  /** The keys of all enabled features */
274
270
  enabledFeatures: string[];
275
- generatedTypes: {
276
- modifyJSONSchemas: Array<(args: {
277
- collectionIDFieldTypes: {
278
- [key: string]: 'number' | 'string';
279
- };
280
- config?: SanitizedConfig;
281
- /**
282
- * Current schema which will be modified by this function.
283
- */
284
- currentSchema: JSONSchema4;
285
- field: LexicalRichTextField;
286
- i18n?: I18n;
287
- /**
288
- * Allows you to define new top-level interfaces that can be re-used in the output schema.
289
- */
290
- interfaceNameDefinitions: Map<string, JSONSchema4>;
291
- isRequired: boolean;
292
- }) => JSONSchema4>;
293
- };
294
271
  /** The node types mapped to their hooks */
295
272
  getSubFields?: Map<string, (args: {
296
273
  node: SerializedLexicalNode;
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.d.ts","sourceRoot":"","sources":["../../src/features/typesServer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,0BAA0B,CAAA;AAClF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AAC9C,OAAO,KAAK,EACV,KAAK,EACL,WAAW,EACX,sBAAsB,EACtB,qBAAqB,EACrB,qBAAqB,EACtB,MAAM,SAAS,CAAA;AAChB,OA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GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { GenericLanguages, I18n, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Field,\n FieldSchemaMap,\n ImportMapGenerators,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n TypedFallbackLocale,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { Transformer } from '../packages/@lexical/markdown/index.js'\nimport type { LexicalRichTextField } from '../types/index.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: LexicalRichTextField\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n | ImportMapGenerators[0]\n | PayloadComponent[]\n generatedTypes?: {\n modifyJSONSchema: (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: LexicalRichTextField\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyJSONSchemas: Array<\n (args: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: LexicalRichTextField\n i18n?: I18n\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AAmWA","ignoreList":[]}
1
+ {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { GenericLanguages, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Field,\n FieldSchemaMap,\n FieldsToJSONSchemaArgs,\n ImportMapGenerators,\n JsonObject,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n TypedFallbackLocale,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { LexicalRichTextField } from '../types/index.js'\nimport type { ElementNodeSchemaFn } from '../types/jsonSchemaHelpers.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = (args: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: LexicalRichTextField\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n parentIsLocalized: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: TypedFallbackLocale\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n previousNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void> | void)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n previousNode: T\n\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n/** Arguments passed to each node's `jsonSchema` function. */\nexport type JSONSchemaArgs = {\n elementNodeSchema: ElementNodeSchemaFn\n field: LexicalRichTextField\n /** TS name of the node union - use in `tsType` annotations. */\n nodeUnionName: string\n} & Pick<\n FieldsToJSONSchemaArgs,\n | 'collectionIDFieldTypes'\n | 'config'\n | 'i18n'\n | 'interfaceNameDefinitions'\n | 'typeStringDefinitions'\n | 'variant'\n>\n\nexport type JSONSchemaFn = (args: JSONSchemaArgs) => JSONSchema4\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * Returns the JSON Schema for this node, plus optional standalone TS\n * source for helper types its `tsType` annotations reference. Nodes\n * without this function are omitted from the strictly-typed union.\n */\n jsonSchema?: JSONSchemaFn\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n /**\n * Adds payload components to the importMap.\n *\n * If an object is provided, the imported components will automatically be made available to the client feature, keyed by the object's keys.\n */\n componentImports?:\n | {\n [key: string]: PayloadComponent\n }\n | ImportMapGenerators[0]\n | PayloadComponent[]\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: (\n | ((props: { allNodes: Array<NodeWithHooks>; allTransformers: Transformer[] }) => Transformer)\n | Transformer\n )[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n markdownTransformers: Transformer[]\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'nodes'>>\n"],"mappings":"AA4WA","ignoreList":[]}
@@ -11,22 +11,22 @@
11
11
 
12
12
  &:has([data-align='center']) {
13
13
  width: fit-content;
14
- margin-left: auto;
15
- margin-right: auto;
14
+ margin-inline-start: auto;
15
+ margin-inline-end: auto;
16
16
  }
17
17
 
18
18
  &:has([data-align='right']),
19
19
  &:has([data-align='end']) {
20
20
  width: fit-content;
21
- margin-left: auto;
22
- margin-right: 0;
21
+ margin-inline-start: auto;
22
+ margin-inline-end: 0;
23
23
  }
24
24
 
25
25
  &:has([data-align='left']),
26
26
  &:has([data-align='start']) {
27
27
  width: fit-content;
28
- margin-left: 0;
29
- margin-right: auto;
28
+ margin-inline-start: 0;
29
+ margin-inline-end: auto;
30
30
  }
31
31
 
32
32
  &:hover {
@@ -78,7 +78,7 @@
78
78
 
79
79
  .LexicalEditorTheme__upload__floater {
80
80
  position: absolute;
81
- left: 50%;
81
+ inset-inline-start: 50%;
82
82
  bottom: calc(100% + var(--spacer-2));
83
83
  transform: translateX(-50%);
84
84
  display: flex;
@@ -89,7 +89,7 @@
89
89
  background: var(--color-bg-menu);
90
90
  border-radius: var(--radius-large);
91
91
  color: var(--color-text);
92
- /* opacity: 0; */
92
+ opacity: 0;
93
93
  pointer-events: none;
94
94
  white-space: nowrap;
95
95
  z-index: 1;
@@ -97,8 +97,8 @@
97
97
  &::before {
98
98
  content: '';
99
99
  position: absolute;
100
- left: 0;
101
- right: 0;
100
+ inset-inline-start: 0;
101
+ inset-inline-end: 0;
102
102
  top: 100%;
103
103
  height: var(--spacer-2);
104
104
  }
@@ -151,7 +151,7 @@
151
151
  .LexicalEditorTheme__upload__divider {
152
152
  width: var(--stroke-width-small);
153
153
  height: var(--spacer-6);
154
- background: var(--ramp-grey-700);
154
+ background: var(--color-border);
155
155
  flex-shrink: 0;
156
156
  }
157
157
 
@@ -1,6 +1,6 @@
1
1
  import { type ElementFormatType } from 'lexical';
2
2
  import React from 'react';
3
- import type { UploadData } from '../../server/nodes/UploadNode.js';
3
+ import type { UploadData } from '../../server/schema.js';
4
4
  import './index.css';
5
5
  export type ElementProps = {
6
6
  className: string;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/component/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAsE,MAAM,OAAO,CAAA;AAG1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AASlE,OAAO,aAAa,CAAA;AAMpB,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAqOlD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/component/index.tsx"],"names":[],"mappings":"AAgBA,OAAO,EAKL,KAAK,iBAAiB,EACvB,MAAM,SAAS,CAAA;AAEhB,OAAO,KAAsE,MAAM,OAAO,CAAA;AAG1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AASxD,OAAO,aAAa,CAAA;AAMpB,MAAM,MAAM,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,UAAU,CAAA;IAChB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,YAAY,CAqOlD,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","formatDrawerSlug","Pill","Thumbnail","useConfig","useEditDepth","usePayloadAPI","useTranslation","$getNodeByKey","$getSelection","$isNodeSelection","$isRangeSelection","formatAdminURL","isImage","React","useCallback","useEffect","useId","useReducer","useRef","useState","useEditorConfigContext","FieldsDrawer","useLexicalDocumentDrawer","useLexicalDrawer","INSERT_UPLOAD_WITH_DRAWER_COMMAND","initialParams","depth","UploadComponent","props","className","baseClass","data","fields","relationTo","value","format","nodeKey","Error","config","routes","api","serverURL","getEntityConfig","uploadRef","uuid","editDepth","editor","editorConfig","fieldProps","schemaPath","isEditable","i18n","t","isSelected","setIsSelected","cacheBust","dispatchCacheBust","state","relatedCollection","collectionSlug","componentID","extraFieldsDrawerSlug","slug","toggleDrawer","closeDocumentDrawer","DocumentDrawer","DocumentDrawerToggler","id","setParams","apiRoute","path","thumbnailSRC","thumbnailURL","url","registerUpdateListener","editorState","read","selection","has","nodes","getNodes","some","node","getKey","outerEl","current","closest","classList","toggle","removeUpload","update","remove","updateUpload","_data","hasExtraFields","resolvedFeatureMap","get","sanitizedClientFeatureProps","collections","onExtraFieldsDrawerSubmit","_","uploadNode","newData","getData","setData","aspectRatio","width","height","_jsxs","undefined","filename","ref","_jsx","fileSrc","mimeType","size","pillStyle","labels","singular","buttonStyle","disabled","el","icon","onClick","round","tooltip","dispatchCommand","replace","e","preventDefault","onSave","drawerSlug","drawerTitle","label","featureKey","handleDrawerSubmit","schemaPathSuffix"],"sources":["../../../../../src/features/upload/client/component/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, Data, FormState, JsonObject } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n formatDrawerSlug,\n Pill,\n Thumbnail,\n useConfig,\n useEditDepth,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n $isRangeSelection,\n type ElementFormatType,\n} from 'lexical'\nimport { formatAdminURL, isImage } from 'payload/shared'\nimport React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'\n\nimport type { BaseClientFeatureProps } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\nimport type { UploadFeaturePropsClient } from '../index.js'\nimport type { UploadNode } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js'\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport './index.css'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n className: string\n data: UploadData\n format?: ElementFormatType\n nodeKey: string\n}\n\nexport const UploadComponent: React.FC<ElementProps> = (props) => {\n const {\n className: baseClass,\n data: { fields, relationTo, value },\n format,\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.',\n )\n }\n\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n\n const {\n editorConfig,\n fieldProps: { schemaPath },\n } = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation()\n const [isSelected, setIsSelected] = useState(false)\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(() =>\n getEntityConfig({ collectionSlug: relationTo }),\n )\n\n const componentID = useId()\n\n const extraFieldsDrawerSlug = formatDrawerSlug({\n slug: `lexical-upload-drawer-` + uuid + componentID, // There can be multiple upload components, each with their own drawer, in one single editor => separate them by componentID\n depth: editDepth,\n })\n\n // Need to use hook to initialize useEffect that restores cursor position\n const { toggleDrawer } = useLexicalDrawer(extraFieldsDrawerSlug, true)\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n formatAdminURL({ apiRoute: api, path: `/${relatedCollection.slug}/${value}`, serverURL }),\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n useEffect(() => {\n return editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n const selection = $getSelection()\n\n if ($isNodeSelection(selection)) {\n setIsSelected(selection.has(nodeKey))\n } else if ($isRangeSelection(selection)) {\n const nodes = selection.getNodes()\n setIsSelected(nodes.some((node) => node.getKey() === nodeKey))\n } else {\n setIsSelected(false)\n }\n })\n })\n }, [editor, nodeKey])\n\n useEffect(() => {\n const outerEl = uploadRef.current?.closest(`.${baseClass}`)\n\n if (outerEl) {\n outerEl.classList.toggle(`${baseClass}--selected`, isSelected)\n }\n }, [isSelected, baseClass])\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (_data: Data) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDocumentDrawer()\n },\n [setParams, cacheBust, closeDocumentDrawer],\n )\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.sanitizedClientFeatureProps as BaseClientFeatureProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n const onExtraFieldsDrawerSubmit = useCallback(\n (_: FormState, data: JsonObject) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: null | UploadNode = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n },\n [editor, nodeKey],\n )\n\n const aspectRatio =\n thumbnailSRC && data?.width && data?.height\n ? data.width > data.height\n ? 'landscape'\n : 'portrait'\n : 'landscape'\n\n return (\n <div\n className={`${baseClass}__contents ${baseClass}__contents--${aspectRatio}`}\n data-align={format || undefined}\n data-filename={data?.filename}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__media`}>\n <Thumbnail\n collectionSlug={relationTo}\n fileSrc={isImage(data?.mimeType) ? thumbnailSRC : null}\n height={data?.height}\n size=\"none\"\n width={data?.width}\n />\n\n {isEditable && (\n <div className={`${baseClass}__floater`} data-theme=\"dark\">\n <Pill className={`${baseClass}__collectionLabel`} pillStyle=\"dark\" size=\"small\">\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </Pill>\n\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <span className={`${baseClass}__filename`}>\n {data?.filename || t('general:untitled')}\n </span>\n </DocumentDrawerToggler>\n\n {hasExtraFields ? (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"write\"\n onClick={toggleDrawer}\n round\n size=\"medium\"\n tooltip={t('fields:editRelationship')}\n />\n ) : null}\n\n <div className={`${baseClass}__divider`} />\n\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__swap-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n size=\"medium\"\n tooltip={t('fields:swapUpload')}\n />\n\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n size=\"medium\"\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n\n {value ? <DocumentDrawer onSave={updateUpload} /> : null}\n {hasExtraFields ? (\n <FieldsDrawer\n data={fields}\n drawerSlug={extraFieldsDrawerSlug}\n drawerTitle={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n featureKey=\"upload\"\n handleDrawerSubmit={onExtraFieldsDrawerSubmit}\n schemaPath={schemaPath}\n schemaPathSuffix={relatedCollection.slug}\n />\n ) : null}\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,gBAAgB,EAChBC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,YAAY,EACZC,aAAa,EACbC,cAAc,QACT;AACP,SACEC,aAAa,EACbC,a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qBAAqB;QAClCiF,KAAA,EAAOvI,cAAA,CAAe4D,iBAAA,CAAkB2D,MAAM,CAACC,QAAQ,EAAEnE,IAAA;MAC3D;MACAmF,UAAA,EAAW;MACXC,kBAAA,EAAoBpC,yBAAA;MACpBlD,UAAA,EAAYA,UAAA;MACZuF,gBAAA,EAAkB9E,iBAAA,CAAkBI;SAEpC;;AAGV","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","formatDrawerSlug","Pill","Thumbnail","useConfig","useEditDepth","usePayloadAPI","useTranslation","$getNodeByKey","$getSelection","$isNodeSelection","$isRangeSelection","formatAdminURL","isImage","React","useCallback","useEffect","useId","useReducer","useRef","useState","useEditorConfigContext","FieldsDrawer","useLexicalDocumentDrawer","useLexicalDrawer","INSERT_UPLOAD_WITH_DRAWER_COMMAND","initialParams","depth","UploadComponent","props","className","baseClass","data","fields","relationTo","value","format","nodeKey","Error","config","routes","api","serverURL","getEntityConfig","uploadRef","uuid","editDepth","editor","editorConfig","fieldProps","schemaPath","isEditable","i18n","t","isSelected","setIsSelected","cacheBust","dispatchCacheBust","state","relatedCollection","collectionSlug","componentID","extraFieldsDrawerSlug","slug","toggleDrawer","closeDocumentDrawer","DocumentDrawer","DocumentDrawerToggler","id","setParams","apiRoute","path","thumbnailSRC","thumbnailURL","url","registerUpdateListener","editorState","read","selection","has","nodes","getNodes","some","node","getKey","outerEl","current","closest","classList","toggle","removeUpload","update","remove","updateUpload","_data","hasExtraFields","resolvedFeatureMap","get","sanitizedClientFeatureProps","collections","onExtraFieldsDrawerSubmit","_","uploadNode","newData","getData","setData","aspectRatio","width","height","_jsxs","undefined","filename","ref","_jsx","fileSrc","mimeType","size","pillStyle","labels","singular","buttonStyle","disabled","el","icon","onClick","round","tooltip","dispatchCommand","replace","e","preventDefault","onSave","drawerSlug","drawerTitle","label","featureKey","handleDrawerSubmit","schemaPathSuffix"],"sources":["../../../../../src/features/upload/client/component/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, Data, FormState, JsonObject } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalEditable } from '@lexical/react/useLexicalEditable'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n formatDrawerSlug,\n Pill,\n Thumbnail,\n useConfig,\n useEditDepth,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n $isRangeSelection,\n type ElementFormatType,\n} from 'lexical'\nimport { formatAdminURL, isImage } from 'payload/shared'\nimport React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'\n\nimport type { BaseClientFeatureProps } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/schema.js'\nimport type { UploadFeaturePropsClient } from '../index.js'\nimport type { UploadNode } from '../nodes/UploadNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js'\nimport { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js'\nimport { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport './index.css'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n className: string\n data: UploadData\n format?: ElementFormatType\n nodeKey: string\n}\n\nexport const UploadComponent: React.FC<ElementProps> = (props) => {\n const {\n className: baseClass,\n data: { fields, relationTo, value },\n format,\n nodeKey,\n } = props\n\n if (typeof value === 'object') {\n throw new Error(\n 'Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.',\n )\n }\n\n const {\n config: {\n routes: { api },\n serverURL,\n },\n getEntityConfig,\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n\n const {\n editorConfig,\n fieldProps: { schemaPath },\n } = useEditorConfigContext()\n const isEditable = useLexicalEditable()\n const { i18n, t } = useTranslation()\n const [isSelected, setIsSelected] = useState(false)\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(() =>\n getEntityConfig({ collectionSlug: relationTo }),\n )\n\n const componentID = useId()\n\n const extraFieldsDrawerSlug = formatDrawerSlug({\n slug: `lexical-upload-drawer-` + uuid + componentID, // There can be multiple upload components, each with their own drawer, in one single editor => separate them by componentID\n depth: editDepth,\n })\n\n // Need to use hook to initialize useEffect that restores cursor position\n const { toggleDrawer } = useLexicalDrawer(extraFieldsDrawerSlug, true)\n\n const { closeDocumentDrawer, DocumentDrawer, DocumentDrawerToggler } = useLexicalDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n formatAdminURL({ apiRoute: api, path: `/${relatedCollection.slug}/${value}`, serverURL }),\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n useEffect(() => {\n return editor.registerUpdateListener(({ editorState }) => {\n editorState.read(() => {\n const selection = $getSelection()\n\n if ($isNodeSelection(selection)) {\n setIsSelected(selection.has(nodeKey))\n } else if ($isRangeSelection(selection)) {\n const nodes = selection.getNodes()\n setIsSelected(nodes.some((node) => node.getKey() === nodeKey))\n } else {\n setIsSelected(false)\n }\n })\n })\n }, [editor, nodeKey])\n\n useEffect(() => {\n const outerEl = uploadRef.current?.closest(`.${baseClass}`)\n\n if (outerEl) {\n outerEl.classList.toggle(`${baseClass}--selected`, isSelected)\n }\n }, [isSelected, baseClass])\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (_data: Data) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n dispatchCacheBust()\n closeDocumentDrawer()\n },\n [setParams, cacheBust, closeDocumentDrawer],\n )\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.sanitizedClientFeatureProps as BaseClientFeatureProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n const onExtraFieldsDrawerSubmit = useCallback(\n (_: FormState, data: JsonObject) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: null | UploadNode = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n },\n [editor, nodeKey],\n )\n\n const aspectRatio =\n thumbnailSRC && data?.width && data?.height\n ? data.width > data.height\n ? 'landscape'\n : 'portrait'\n : 'landscape'\n\n return (\n <div\n className={`${baseClass}__contents ${baseClass}__contents--${aspectRatio}`}\n data-align={format || undefined}\n data-filename={data?.filename}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__media`}>\n <Thumbnail\n collectionSlug={relationTo}\n fileSrc={isImage(data?.mimeType) ? thumbnailSRC : null}\n height={data?.height}\n size=\"none\"\n width={data?.width}\n />\n\n {isEditable && (\n <div className={`${baseClass}__floater`} data-theme=\"dark\">\n <Pill className={`${baseClass}__collectionLabel`} pillStyle=\"dark\" size=\"small\">\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </Pill>\n\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <span className={`${baseClass}__filename`}>\n {data?.filename || t('general:untitled')}\n </span>\n </DocumentDrawerToggler>\n\n {hasExtraFields ? (\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"write\"\n onClick={toggleDrawer}\n round\n size=\"medium\"\n tooltip={t('fields:editRelationship')}\n />\n ) : null}\n\n <div className={`${baseClass}__divider`} />\n\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__swap-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n size=\"medium\"\n tooltip={t('fields:swapUpload')}\n />\n\n <Button\n buttonStyle=\"ghost\"\n className={`${baseClass}__removeButton`}\n disabled={!isEditable}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n size=\"medium\"\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n\n {value ? <DocumentDrawer onSave={updateUpload} /> : null}\n {hasExtraFields ? (\n <FieldsDrawer\n data={fields}\n drawerSlug={extraFieldsDrawerSlug}\n drawerTitle={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n featureKey=\"upload\"\n handleDrawerSubmit={onExtraFieldsDrawerSubmit}\n schemaPath={schemaPath}\n schemaPathSuffix={relatedCollection.slug}\n />\n ) : null}\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,kBAAkB,QAAQ;AACnC,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,gBAAgB,EAChBC,IAAI,EACJC,SAAS,EACTC,SAAS,EACTC,YAAY,EACZC,aAAa,EACbC,cAAc,QACT;AACP,SACEC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,QAEZ;AACP,SAASC,cAAc,EAAEC,OAAO,QAAQ;AACxC,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAOnF,SAASC,sBAAsB,QAAQ;AACvC,SAASC,YAAY,QAAQ;AAC7B,SAASC,wBAAwB,QAAQ;AAC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  import type { DOMConversionMap, EditorConfig, LexicalEditor, LexicalNode } from 'lexical';
2
2
  import type { JSX } from 'react';
3
- import type { SerializedUploadNode, UploadData } from '../../server/nodes/UploadNode.js';
3
+ import type { SerializedUploadNode, UploadData } from '../../server/schema.js';
4
4
  import { UploadServerNode } from '../../server/nodes/UploadNode.js';
5
5
  export declare class UploadNode extends UploadServerNode {
6
6
  static clone(node: UploadServerNode): UploadServerNode;
@@ -1 +1 @@
1
- {"version":3,"file":"UploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/nodes/UploadNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,KAAK,EAEV,oBAAoB,EACpB,UAAU,EACX,MAAM,kCAAkC,CAAA;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAOnE,qBAAa,UAAW,SAAQ,gBAAgB;WAC9B,KAAK,CAAC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB;WAI/C,OAAO,IAAI,MAAM;WAIjB,SAAS,IAAI,gBAAgB,CAAC,gBAAgB,CAAC;WAS/C,UAAU,CAAC,cAAc,EAAE,oBAAoB,GAAG,UAAU;IAuBnE,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO;IAcpE,UAAU,IAAI,oBAAoB;CAG5C;AAED,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAA;CAC/D,GAAG,UAAU,CAMb;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,UAAU,CAEtF"}
1
+ {"version":3,"file":"UploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/nodes/UploadNode.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,gBAAgB,EAAE,YAAY,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AACzF,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAMhC,OAAO,KAAK,EAAuB,oBAAoB,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAGnG,OAAO,EAAE,gBAAgB,EAAE,MAAM,kCAAkC,CAAA;AAOnE,qBAAa,UAAW,SAAQ,gBAAgB;WAC9B,KAAK,CAAC,IAAI,EAAE,gBAAgB,GAAG,gBAAgB;WAI/C,OAAO,IAAI,MAAM;WAIjB,SAAS,IAAI,gBAAgB,CAAC,gBAAgB,CAAC;WAS/C,UAAU,CAAC,cAAc,EAAE,oBAAoB,GAAG,UAAU;IAuBnE,QAAQ,CAAC,MAAM,CAAC,EAAE,aAAa,EAAE,MAAM,CAAC,EAAE,YAAY,GAAG,GAAG,CAAC,OAAO;IAcpE,UAAU,IAAI,oBAAoB;CAG5C;AAED,wBAAgB,iBAAiB,CAAC,EAChC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAA;CAC/D,GAAG,UAAU,CAMb;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,UAAU,CAEtF"}
@@ -1 +1 @@
1
- {"version":3,"file":"UploadNode.js","names":["ObjectID","$applyNodeReplacement","React","$convertUploadElement","UploadServerNode","PendingUploadComponent","RawUploadComponent","lazy","then","module","default","UploadComponent","UploadNode","clone","node","getType","importDOM","img","conversion","domNode","$createUploadNode","priority","importJSON","serializedNode","version","value","id","toHexString","importedData","fields","pending","relationTo","data","setFormat","format","decorate","editor","config","__data","_jsx","className","theme","upload","__format","nodeKey","getKey","exportJSON","$isUploadNode"],"sources":["../../../../../src/features/upload/client/nodes/UploadNode.tsx"],"sourcesContent":["'use client'\nimport type { DOMConversionMap, EditorConfig, LexicalEditor, LexicalNode } from 'lexical'\nimport type { JSX } from 'react'\n\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nimport type {\n Internal_UploadData,\n SerializedUploadNode,\n UploadData,\n} from '../../server/nodes/UploadNode.js'\n\nimport { $convertUploadElement } from '../../server/nodes/conversions.js'\nimport { UploadServerNode } from '../../server/nodes/UploadNode.js'\nimport { PendingUploadComponent } from '../component/pending/index.js'\n\nconst RawUploadComponent = React.lazy(() =>\n import('../../client/component/index.js').then((module) => ({ default: module.UploadComponent })),\n)\n\nexport class UploadNode extends UploadServerNode {\n static override clone(node: UploadServerNode): UploadServerNode {\n return super.clone(node)\n }\n\n static override getType(): string {\n return super.getType()\n }\n\n static override importDOM(): DOMConversionMap<HTMLImageElement> {\n return {\n img: (node) => ({\n conversion: (domNode) => $convertUploadElement(domNode, $createUploadNode),\n priority: 0,\n }),\n }\n }\n\n static override importJSON(serializedNode: SerializedUploadNode): UploadNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: Internal_UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n pending: (serializedNode as Internal_UploadData).pending,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n override decorate(editor?: LexicalEditor, config?: EditorConfig): JSX.Element {\n if ((this.__data as Internal_UploadData).pending) {\n return <PendingUploadComponent />\n }\n return (\n <RawUploadComponent\n className={config?.theme?.upload ?? 'LexicalEditorTheme__upload'}\n data={this.__data}\n format={this.__format}\n nodeKey={this.getKey()}\n />\n )\n }\n\n override exportJSON(): SerializedUploadNode {\n return super.exportJSON()\n }\n}\n\nexport function $createUploadNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n\n return $applyNodeReplacement(new UploadNode({ data: data as UploadData }))\n}\n\nexport function $isUploadNode(node: LexicalNode | null | undefined): node is UploadNode {\n return node instanceof UploadNode\n}\n"],"mappings":"AAAA;;;AAIA,OAAOA,QAAA,MAAc;AACrB,SAASC,qBAAqB,QAAQ;AACtC,YAAYC,KAAA,MAAW;AAQvB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,sBAAsB,QAAQ;AAEvC,MAAMC,kBAAA,gBAAqBJ,KAAA,CAAMK,IAAI,CAAC,MACpC,MAAM,CAAC,mCAAmCC,IAAI,CAAEC,MAAA,KAAY;EAAEC,OAAA,EAASD,MAAA,CAAOE;AAAgB;AAGhG,OAAO,MAAMC,UAAA,SAAmBR,gBAAA;EAC9B,OAAgBS,MAAMC,IAAsB,EAAoB;IAC9D,OAAO,KAAK,CAACD,KAAA,CAAMC,IAAA;EACrB;EAEA,OAAgBC,QAAA,EAAkB;IAChC,OAAO,KAAK,CAACA,OAAA;EACf;EAEA,OAAgBC,UAAA,EAAgD;IAC9D,OAAO;MACLC,GAAA,EAAMH,IAAA,KAAU;QACdI,UAAA,EAAaC,OAAA,IAAYhB,qBAAA,CAAsBgB,OAAA,EAASC,iBAAA;QACxDC,QAAA,EAAU;MACZ;IACF;EACF;EAEA,OAAgBC,WAAWC,cAAoC,EAAc;IAC3E,IAAIA,cAAA,CAAeC,OAAO,KAAK,KAAMD,cAAA,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,GAAGiB,WAAW;EAC9C;EAEA,OAAO1B,qBAAA,CAAsB,IAAIW,UAAA,CAAW;IAAEoB,IAAA,EAAMA;EAAmB;AACzE;AAEA,OAAO,SAASe,cAAcjC,IAAoC;EAChE,OAAOA,IAAA,YAAgBF,UAAA;AACzB","ignoreList":[]}
1
+ {"version":3,"file":"UploadNode.js","names":["ObjectID","$applyNodeReplacement","React","$convertUploadElement","UploadServerNode","PendingUploadComponent","RawUploadComponent","lazy","then","module","default","UploadComponent","UploadNode","clone","node","getType","importDOM","img","conversion","domNode","$createUploadNode","priority","importJSON","serializedNode","version","value","id","toHexString","importedData","fields","pending","relationTo","data","setFormat","format","decorate","editor","config","__data","_jsx","className","theme","upload","__format","nodeKey","getKey","exportJSON","$isUploadNode"],"sources":["../../../../../src/features/upload/client/nodes/UploadNode.tsx"],"sourcesContent":["'use client'\nimport type { DOMConversionMap, EditorConfig, LexicalEditor, LexicalNode } from 'lexical'\nimport type { JSX } from 'react'\n\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nimport type { Internal_UploadData, SerializedUploadNode, UploadData } from '../../server/schema.js'\n\nimport { $convertUploadElement } from '../../server/nodes/conversions.js'\nimport { UploadServerNode } from '../../server/nodes/UploadNode.js'\nimport { PendingUploadComponent } from '../component/pending/index.js'\n\nconst RawUploadComponent = React.lazy(() =>\n import('../../client/component/index.js').then((module) => ({ default: module.UploadComponent })),\n)\n\nexport class UploadNode extends UploadServerNode {\n static override clone(node: UploadServerNode): UploadServerNode {\n return super.clone(node)\n }\n\n static override getType(): string {\n return super.getType()\n }\n\n static override importDOM(): DOMConversionMap<HTMLImageElement> {\n return {\n img: (node) => ({\n conversion: (domNode) => $convertUploadElement(domNode, $createUploadNode),\n priority: 0,\n }),\n }\n }\n\n static override importJSON(serializedNode: SerializedUploadNode): UploadNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: Internal_UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n pending: (serializedNode as Internal_UploadData).pending,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n override decorate(editor?: LexicalEditor, config?: EditorConfig): JSX.Element {\n if ((this.__data as Internal_UploadData).pending) {\n return <PendingUploadComponent />\n }\n return (\n <RawUploadComponent\n className={config?.theme?.upload ?? 'LexicalEditorTheme__upload'}\n data={this.__data}\n format={this.__format}\n nodeKey={this.getKey()}\n />\n )\n }\n\n override exportJSON(): SerializedUploadNode {\n return super.exportJSON()\n }\n}\n\nexport function $createUploadNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n\n return $applyNodeReplacement(new UploadNode({ data: data as UploadData }))\n}\n\nexport function $isUploadNode(node: LexicalNode | null | undefined): node is UploadNode {\n return node instanceof UploadNode\n}\n"],"mappings":"AAAA;;;AAIA,OAAOA,QAAA,MAAc;AACrB,SAASC,qBAAqB,QAAQ;AACtC,YAAYC,KAAA,MAAW;AAIvB,SAASC,qBAAqB,QAAQ;AACtC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,sBAAsB,QAAQ;AAEvC,MAAMC,kBAAA,gBAAqBJ,KAAA,CAAMK,IAAI,CAAC,MACpC,MAAM,CAAC,mCAAmCC,IAAI,CAAEC,MAAA,KAAY;EAAEC,OAAA,EAASD,MAAA,CAAOE;AAAgB;AAGhG,OAAO,MAAMC,UAAA,SAAmBR,gBAAA;EAC9B,OAAgBS,MAAMC,IAAsB,EAAoB;IAC9D,OAAO,KAAK,CAACD,KAAA,CAAMC,IAAA;EACrB;EAEA,OA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,EAAM,IAAI,CAACM,MAAM;MACjBJ,MAAA,EAAQ,IAAI,CAACS,QAAQ;MACrBC,OAAA,EAAS,IAAI,CAACC,MAAM;;EAG1B;EAESC,WAAA,EAAmC;IAC1C,OAAO,KAAK,CAACA,UAAA;EACf;AACF;AAEA,OAAO,SAAS1B,kBAAkB;EAChCY;AAAI,CAGL;EACC,IAAI,CAACA,IAAA,EAAMN,EAAA,EAAI;IACbM,IAAA,CAAKN,EAAE,GAAG,IAAI1B,QAAA,CAASU,OAAO,GAAGiB,WAAW;EAC9C;EAEA,OAAO1B,qBAAA,CAAsB,IAAIW,UAAA,CAAW;IAAEoB,IAAA,EAAMA;EAAmB;AACzE;AAEA,OAAO,SAASe,cAAcjC,IAAoC;EAChE,OAAOA,IAAA,YAAgBF,UAAA;AACzB","ignoreList":[]}
@@ -1,6 +1,6 @@
1
1
  import type { LexicalCommand } from 'lexical';
2
2
  import type { PluginComponent } from '../../../typesClient.js';
3
- import type { UploadData } from '../../server/nodes/UploadNode.js';
3
+ import type { UploadData } from '../../server/schema.js';
4
4
  import type { UploadFeaturePropsClient } from '../index.js';
5
5
  export type InsertUploadPayload = Readonly<Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>>;
6
6
  declare global {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/plugin/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAuB7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,kCAAkC,CAAA;AACvF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAM3D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;AAEpG,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,SAAS;QACjB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,WAAW,CAAC,EAAE,IAAI,CAAA;KACnB;CACF;AA4BD,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,mBAAmB,CAC9B,CAAA;AAYxC,eAAO,MAAM,YAAY,EAAE,eAAe,CAAC,wBAAwB,CAiUlE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/plugin/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAuB7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAA;AAC9D,OAAO,KAAK,EAAuB,UAAU,EAAE,MAAM,wBAAwB,CAAA;AAC7E,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,aAAa,CAAA;AAM3D,MAAM,MAAM,mBAAmB,GAAG,QAAQ,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAC,CAAA;AAEpG,OAAO,CAAC,MAAM,CAAC;IACb,UAAU,SAAS;QACjB,WAAW,CAAC,EAAE,MAAM,CAAA;QACpB,WAAW,CAAC,EAAE,IAAI,CAAA;KACnB;CACF;AA4BD,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAAC,mBAAmB,CAC9B,CAAA;AAYxC,eAAO,MAAM,YAAY,EAAE,eAAe,CAAC,wBAAwB,CAiUlE,CAAA"}
@@ -55,7 +55,7 @@ export const UploadPlugin = t0 => {
55
55
  enabledCollectionSlugs
56
56
  } = useEnabledRelationships(t3);
57
57
  const {
58
- drawerSlug: bulkUploadDrawerSlug,
58
+ modalSlug: bulkUploadModalSlug,
59
59
  setCollectionSlug,
60
60
  setInitialForms,
61
61
  setOnCancel,
@@ -67,7 +67,7 @@ export const UploadPlugin = t0 => {
67
67
  openModal
68
68
  } = useModal();
69
69
  let t4;
70
- if ($[3] !== bulkUploadDrawerSlug || $[4] !== editor || $[5] !== enabledCollectionSlugs || $[6] !== isModalOpen || $[7] !== openModal || $[8] !== setCollectionSlug || $[9] !== setInitialForms || $[10] !== setOnCancel || $[11] !== setOnSuccess || $[12] !== setSelectableCollections) {
70
+ if ($[3] !== bulkUploadModalSlug || $[4] !== editor || $[5] !== enabledCollectionSlugs || $[6] !== isModalOpen || $[7] !== openModal || $[8] !== setCollectionSlug || $[9] !== setInitialForms || $[10] !== setOnCancel || $[11] !== setOnSuccess || $[12] !== setSelectableCollections) {
71
71
  t4 = t5 => {
72
72
  const {
73
73
  files
@@ -76,7 +76,7 @@ export const UploadPlugin = t0 => {
76
76
  return;
77
77
  }
78
78
  setInitialForms(initialForms => [...(initialForms ?? []), ...files.map(_temp)]);
79
- if (!isModalOpen(bulkUploadDrawerSlug)) {
79
+ if (!isModalOpen(bulkUploadModalSlug)) {
80
80
  if (!enabledCollectionSlugs.length || !enabledCollectionSlugs[0]) {
81
81
  return;
82
82
  }
@@ -109,10 +109,10 @@ export const UploadPlugin = t0 => {
109
109
  }
110
110
  });
111
111
  });
112
- openModal(bulkUploadDrawerSlug);
112
+ openModal(bulkUploadModalSlug);
113
113
  }
114
114
  };
115
- $[3] = bulkUploadDrawerSlug;
115
+ $[3] = bulkUploadModalSlug;
116
116
  $[4] = editor;
117
117
  $[5] = enabledCollectionSlugs;
118
118
  $[6] = isModalOpen;