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

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 (916) hide show
  1. package/dist/cell/rscEntry.d.ts +1 -1
  2. package/dist/cell/rscEntry.d.ts.map +1 -1
  3. package/dist/cell/rscEntry.js.map +1 -1
  4. package/dist/exports/client/Field-G5Z2HM5Y.js +2 -0
  5. package/dist/exports/client/Field-G5Z2HM5Y.js.map +7 -0
  6. package/dist/exports/client/RelationshipComponent-RZL743CS.js +2 -0
  7. package/dist/exports/client/RelationshipComponent-RZL743CS.js.map +7 -0
  8. package/dist/exports/client/bundled.css +1 -1
  9. package/dist/exports/client/{chunk-QJ5EETIB.js → chunk-6QWQ7JV4.js} +2 -2
  10. package/dist/exports/client/chunk-FEJXFRL7.js +2 -0
  11. package/dist/exports/client/chunk-FEJXFRL7.js.map +7 -0
  12. package/dist/exports/client/{chunk-FTT5KJ6W.js → chunk-LH634DPU.js} +1 -1
  13. package/dist/exports/client/chunk-LH634DPU.js.map +7 -0
  14. package/dist/exports/client/{chunk-BZZVLW4U.js → chunk-RJ5MAOKZ.js} +1 -1
  15. package/dist/exports/client/chunk-RJ5MAOKZ.js.map +7 -0
  16. package/dist/exports/client/chunk-WSAPGI3Z.js +2 -0
  17. package/dist/exports/client/chunk-WSAPGI3Z.js.map +7 -0
  18. package/dist/exports/client/component-CVM4OESA.js +2 -0
  19. package/dist/exports/client/component-CVM4OESA.js.map +7 -0
  20. package/dist/exports/client/componentInline-JJZ2NKW2.js +2 -0
  21. package/dist/exports/client/index.d.ts +0 -2
  22. package/dist/exports/client/index.d.ts.map +1 -1
  23. package/dist/exports/client/index.js +30 -30
  24. package/dist/exports/client/index.js.map +4 -4
  25. package/dist/exports/react/index.d.ts +1 -1
  26. package/dist/exports/react/index.d.ts.map +1 -1
  27. package/dist/exports/react/index.js.map +1 -1
  28. package/dist/features/align/client/toolbarAlignGroup.d.ts.map +1 -1
  29. package/dist/features/align/client/toolbarAlignGroup.js +1 -0
  30. package/dist/features/align/client/toolbarAlignGroup.js.map +1 -1
  31. package/dist/features/blockquote/server/index.d.ts +1 -1
  32. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  33. package/dist/features/blockquote/server/index.js +0 -39
  34. package/dist/features/blockquote/server/index.js.map +1 -1
  35. package/dist/features/blocks/client/component/BlockContent.d.ts +10 -0
  36. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  37. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  38. package/dist/features/blocks/client/component/index.css +178 -0
  39. package/dist/features/blocks/client/component/index.d.ts +2 -2
  40. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  41. package/dist/features/blocks/client/component/index.js +75 -18
  42. package/dist/features/blocks/client/component/index.js.map +1 -1
  43. package/dist/features/blocks/client/componentInline/components/InlineBlockContainer.d.ts.map +1 -1
  44. package/dist/features/blocks/client/componentInline/index.css +85 -0
  45. package/dist/features/blocks/client/componentInline/index.d.ts +2 -2
  46. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  47. package/dist/features/blocks/client/componentInline/index.js +20 -7
  48. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  49. package/dist/features/blocks/client/index.d.ts.map +1 -1
  50. package/dist/features/blocks/client/index.js +0 -2
  51. package/dist/features/blocks/client/index.js.map +1 -1
  52. package/dist/features/blocks/client/markdown/markdownTransformer.d.ts.map +1 -1
  53. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +1 -1
  54. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  55. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  56. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts +1 -1
  57. package/dist/features/blocks/client/nodes/InlineBlocksNode.d.ts.map +1 -1
  58. package/dist/features/blocks/client/nodes/InlineBlocksNode.js.map +1 -1
  59. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts +1 -1
  60. package/dist/features/blocks/premade/CodeBlock/Component/Block.d.ts.map +1 -1
  61. package/dist/features/blocks/premade/CodeBlock/Component/Block.js +3 -0
  62. package/dist/features/blocks/premade/CodeBlock/Component/Block.js.map +1 -1
  63. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.css +26 -0
  64. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts +1 -1
  65. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.d.ts.map +1 -1
  66. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js +4 -1
  67. package/dist/features/blocks/premade/CodeBlock/Component/Collapse/index.js.map +1 -1
  68. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.css +40 -0
  69. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts +1 -1
  70. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.d.ts.map +1 -1
  71. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js +7 -8
  72. package/dist/features/blocks/premade/CodeBlock/Component/FloatingCollapse/index.js.map +1 -1
  73. package/dist/features/blocks/premade/CodeBlock/Component/index.css +171 -0
  74. package/dist/features/blocks/server/graphQLPopulationPromise.d.ts.map +1 -1
  75. package/dist/features/blocks/server/index.js +1 -1
  76. package/dist/features/blocks/server/index.js.map +1 -1
  77. package/dist/features/blocks/server/markdown/markdownTransformer.d.ts.map +1 -1
  78. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +1 -1
  79. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  80. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  81. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +1 -1
  82. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  83. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  84. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  85. package/dist/features/converters/htmlToLexical/index.d.ts +1 -1
  86. package/dist/features/converters/htmlToLexical/index.d.ts.map +1 -1
  87. package/dist/features/converters/htmlToLexical/index.js.map +1 -1
  88. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts +1 -1
  89. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.d.ts.map +1 -1
  90. package/dist/features/converters/lexicalToHtml/async/converters/blockquote.js.map +1 -1
  91. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts +1 -1
  92. package/dist/features/converters/lexicalToHtml/async/converters/heading.d.ts.map +1 -1
  93. package/dist/features/converters/lexicalToHtml/async/converters/heading.js.map +1 -1
  94. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts +1 -1
  95. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.d.ts.map +1 -1
  96. package/dist/features/converters/lexicalToHtml/async/converters/horizontalRule.js.map +1 -1
  97. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts +1 -1
  98. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.d.ts.map +1 -1
  99. package/dist/features/converters/lexicalToHtml/async/converters/linebreak.js.map +1 -1
  100. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts +1 -1
  101. package/dist/features/converters/lexicalToHtml/async/converters/link.d.ts.map +1 -1
  102. package/dist/features/converters/lexicalToHtml/async/converters/link.js.map +1 -1
  103. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts +1 -1
  104. package/dist/features/converters/lexicalToHtml/async/converters/list.d.ts.map +1 -1
  105. package/dist/features/converters/lexicalToHtml/async/converters/list.js.map +1 -1
  106. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts +1 -1
  107. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.d.ts.map +1 -1
  108. package/dist/features/converters/lexicalToHtml/async/converters/paragraph.js.map +1 -1
  109. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts +1 -1
  110. package/dist/features/converters/lexicalToHtml/async/converters/tab.d.ts.map +1 -1
  111. package/dist/features/converters/lexicalToHtml/async/converters/tab.js.map +1 -1
  112. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts +1 -1
  113. package/dist/features/converters/lexicalToHtml/async/converters/table.d.ts.map +1 -1
  114. package/dist/features/converters/lexicalToHtml/async/converters/table.js +1 -1
  115. package/dist/features/converters/lexicalToHtml/async/converters/table.js.map +1 -1
  116. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts +1 -1
  117. package/dist/features/converters/lexicalToHtml/async/converters/text.d.ts.map +1 -1
  118. package/dist/features/converters/lexicalToHtml/async/converters/text.js.map +1 -1
  119. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts +1 -1
  120. package/dist/features/converters/lexicalToHtml/async/converters/upload.d.ts.map +1 -1
  121. package/dist/features/converters/lexicalToHtml/async/converters/upload.js.map +1 -1
  122. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts +1 -1
  123. package/dist/features/converters/lexicalToHtml/async/defaultConverters.d.ts.map +1 -1
  124. package/dist/features/converters/lexicalToHtml/async/defaultConverters.js.map +1 -1
  125. package/dist/features/converters/lexicalToHtml/async/types.d.ts +1 -1
  126. package/dist/features/converters/lexicalToHtml/async/types.d.ts.map +1 -1
  127. package/dist/features/converters/lexicalToHtml/async/types.js.map +1 -1
  128. package/dist/features/converters/lexicalToHtml/shared/cssColors.d.ts.map +1 -1
  129. package/dist/features/converters/lexicalToHtml/shared/findConverterForNode.js.map +1 -1
  130. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts +1 -1
  131. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.d.ts.map +1 -1
  132. package/dist/features/converters/lexicalToHtml/sync/converters/blockquote.js.map +1 -1
  133. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts +1 -1
  134. package/dist/features/converters/lexicalToHtml/sync/converters/heading.d.ts.map +1 -1
  135. package/dist/features/converters/lexicalToHtml/sync/converters/heading.js.map +1 -1
  136. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts +1 -1
  137. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.d.ts.map +1 -1
  138. package/dist/features/converters/lexicalToHtml/sync/converters/horizontalRule.js.map +1 -1
  139. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts +1 -1
  140. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.d.ts.map +1 -1
  141. package/dist/features/converters/lexicalToHtml/sync/converters/linebreak.js.map +1 -1
  142. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts +1 -1
  143. package/dist/features/converters/lexicalToHtml/sync/converters/link.d.ts.map +1 -1
  144. package/dist/features/converters/lexicalToHtml/sync/converters/link.js.map +1 -1
  145. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts +1 -1
  146. package/dist/features/converters/lexicalToHtml/sync/converters/list.d.ts.map +1 -1
  147. package/dist/features/converters/lexicalToHtml/sync/converters/list.js.map +1 -1
  148. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts +1 -1
  149. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.d.ts.map +1 -1
  150. package/dist/features/converters/lexicalToHtml/sync/converters/paragraph.js.map +1 -1
  151. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts +1 -1
  152. package/dist/features/converters/lexicalToHtml/sync/converters/tab.d.ts.map +1 -1
  153. package/dist/features/converters/lexicalToHtml/sync/converters/tab.js.map +1 -1
  154. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts +1 -1
  155. package/dist/features/converters/lexicalToHtml/sync/converters/table.d.ts.map +1 -1
  156. package/dist/features/converters/lexicalToHtml/sync/converters/table.js +1 -1
  157. package/dist/features/converters/lexicalToHtml/sync/converters/table.js.map +1 -1
  158. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts +1 -1
  159. package/dist/features/converters/lexicalToHtml/sync/converters/text.d.ts.map +1 -1
  160. package/dist/features/converters/lexicalToHtml/sync/converters/text.js.map +1 -1
  161. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts +1 -1
  162. package/dist/features/converters/lexicalToHtml/sync/converters/upload.d.ts.map +1 -1
  163. package/dist/features/converters/lexicalToHtml/sync/converters/upload.js.map +1 -1
  164. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts +1 -1
  165. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.d.ts.map +1 -1
  166. package/dist/features/converters/lexicalToHtml/sync/defaultConverters.js.map +1 -1
  167. package/dist/features/converters/lexicalToHtml/sync/types.d.ts +1 -1
  168. package/dist/features/converters/lexicalToHtml/sync/types.d.ts.map +1 -1
  169. package/dist/features/converters/lexicalToHtml/sync/types.js.map +1 -1
  170. package/dist/features/converters/lexicalToJSX/Component/index.d.ts +2 -2
  171. package/dist/features/converters/lexicalToJSX/Component/index.d.ts.map +1 -1
  172. package/dist/features/converters/lexicalToJSX/Component/index.js.map +1 -1
  173. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts +1 -1
  174. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.d.ts.map +1 -1
  175. package/dist/features/converters/lexicalToJSX/converter/converters/blockquote.js.map +1 -1
  176. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts +1 -1
  177. package/dist/features/converters/lexicalToJSX/converter/converters/heading.d.ts.map +1 -1
  178. package/dist/features/converters/lexicalToJSX/converter/converters/heading.js.map +1 -1
  179. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts +1 -1
  180. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.d.ts.map +1 -1
  181. package/dist/features/converters/lexicalToJSX/converter/converters/horizontalRule.js.map +1 -1
  182. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts +1 -1
  183. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.d.ts.map +1 -1
  184. package/dist/features/converters/lexicalToJSX/converter/converters/linebreak.js.map +1 -1
  185. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts +1 -1
  186. package/dist/features/converters/lexicalToJSX/converter/converters/link.d.ts.map +1 -1
  187. package/dist/features/converters/lexicalToJSX/converter/converters/link.js.map +1 -1
  188. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts +1 -1
  189. package/dist/features/converters/lexicalToJSX/converter/converters/list.d.ts.map +1 -1
  190. package/dist/features/converters/lexicalToJSX/converter/converters/list.js.map +1 -1
  191. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts +1 -1
  192. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.d.ts.map +1 -1
  193. package/dist/features/converters/lexicalToJSX/converter/converters/paragraph.js.map +1 -1
  194. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts +1 -1
  195. package/dist/features/converters/lexicalToJSX/converter/converters/tab.d.ts.map +1 -1
  196. package/dist/features/converters/lexicalToJSX/converter/converters/tab.js.map +1 -1
  197. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts +1 -1
  198. package/dist/features/converters/lexicalToJSX/converter/converters/table.d.ts.map +1 -1
  199. package/dist/features/converters/lexicalToJSX/converter/converters/table.js.map +1 -1
  200. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts +1 -1
  201. package/dist/features/converters/lexicalToJSX/converter/converters/text.d.ts.map +1 -1
  202. package/dist/features/converters/lexicalToJSX/converter/converters/text.js.map +1 -1
  203. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts +1 -1
  204. package/dist/features/converters/lexicalToJSX/converter/converters/upload.d.ts.map +1 -1
  205. package/dist/features/converters/lexicalToJSX/converter/converters/upload.js.map +1 -1
  206. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts +1 -1
  207. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.d.ts.map +1 -1
  208. package/dist/features/converters/lexicalToJSX/converter/defaultConverters.js.map +1 -1
  209. package/dist/features/converters/lexicalToJSX/converter/index.d.ts +1 -1
  210. package/dist/features/converters/lexicalToJSX/converter/index.d.ts.map +1 -1
  211. package/dist/features/converters/lexicalToJSX/converter/index.js.map +1 -1
  212. package/dist/features/converters/lexicalToJSX/converter/types.d.ts +1 -1
  213. package/dist/features/converters/lexicalToJSX/converter/types.d.ts.map +1 -1
  214. package/dist/features/converters/lexicalToJSX/converter/types.js.map +1 -1
  215. package/dist/features/converters/lexicalToMarkdown/index.d.ts.map +1 -1
  216. package/dist/features/converters/lexicalToPlaintext/convertLexicalToPlaintext.spec.js.map +1 -1
  217. package/dist/features/converters/lexicalToPlaintext/shared/findConverterForNode.js.map +1 -1
  218. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts +1 -1
  219. package/dist/features/converters/lexicalToPlaintext/sync/types.d.ts.map +1 -1
  220. package/dist/features/converters/lexicalToPlaintext/sync/types.js.map +1 -1
  221. package/dist/features/converters/markdownToLexical/index.d.ts +1 -1
  222. package/dist/features/converters/markdownToLexical/index.d.ts.map +1 -1
  223. package/dist/features/converters/markdownToLexical/index.js.map +1 -1
  224. package/dist/features/debug/jsxConverter/client/plugin/index.d.ts +1 -1
  225. package/dist/features/debug/jsxConverter/client/plugin/index.d.ts.map +1 -1
  226. package/dist/features/debug/jsxConverter/client/plugin/index.js +1 -0
  227. package/dist/features/debug/jsxConverter/client/plugin/index.js.map +1 -1
  228. package/dist/features/debug/jsxConverter/client/plugin/style.css +9 -0
  229. package/dist/features/debug/testRecorder/client/plugin/index.css +51 -0
  230. package/dist/features/debug/testRecorder/client/plugin/index.d.ts +1 -1
  231. package/dist/features/debug/testRecorder/client/plugin/index.d.ts.map +1 -1
  232. package/dist/features/debug/testRecorder/client/plugin/index.js +1 -0
  233. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  234. package/dist/features/debug/treeView/client/plugin/index.css +81 -0
  235. package/dist/features/debug/treeView/client/plugin/index.d.ts +1 -1
  236. package/dist/features/debug/treeView/client/plugin/index.d.ts.map +1 -1
  237. package/dist/features/debug/treeView/client/plugin/index.js +1 -0
  238. package/dist/features/debug/treeView/client/plugin/index.js.map +1 -1
  239. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.css +91 -0
  240. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts +1 -1
  241. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  242. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +3 -2
  243. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  244. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.css +11 -0
  245. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts +1 -1
  246. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  247. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +1 -0
  248. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  249. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +1 -1
  250. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  251. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.css +166 -0
  252. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts +17 -0
  253. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.d.ts.map +1 -0
  254. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js +219 -0
  255. package/dist/features/experimental_table/client/plugins/TablePlugin/TableGridPopup/index.js.map +1 -0
  256. package/dist/features/experimental_table/client/plugins/TablePlugin/index.css +235 -0
  257. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts +1 -1
  258. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  259. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +95 -104
  260. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  261. package/dist/features/experimental_table/server/index.d.ts +1 -1
  262. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  263. package/dist/features/experimental_table/server/index.js +0 -102
  264. package/dist/features/experimental_table/server/index.js.map +1 -1
  265. package/dist/features/format/shared/toolbarFormatGroup.d.ts.map +1 -1
  266. package/dist/features/heading/server/index.d.ts +1 -1
  267. package/dist/features/heading/server/index.d.ts.map +1 -1
  268. package/dist/features/heading/server/index.js +0 -39
  269. package/dist/features/heading/server/index.js.map +1 -1
  270. package/dist/features/horizontalRule/client/plugin/index.css +25 -0
  271. package/dist/features/horizontalRule/client/plugin/index.d.ts +1 -1
  272. package/dist/features/horizontalRule/client/plugin/index.d.ts.map +1 -1
  273. package/dist/features/horizontalRule/client/plugin/index.js +73 -4
  274. package/dist/features/horizontalRule/client/plugin/index.js.map +1 -1
  275. package/dist/features/horizontalRule/server/index.d.ts.map +1 -1
  276. package/dist/features/horizontalRule/server/index.js +0 -8
  277. package/dist/features/horizontalRule/server/index.js.map +1 -1
  278. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +1 -1
  279. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  280. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  281. package/dist/features/indent/client/toolbarIndentGroup.d.ts.map +1 -1
  282. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  283. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  284. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +28 -8
  285. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  286. package/dist/features/link/client/plugins/floatingLinkEditor/index.css +112 -0
  287. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts +1 -1
  288. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  289. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -0
  290. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  291. package/dist/features/link/markdownTransformer.d.ts.map +1 -1
  292. package/dist/features/link/nodes/types.d.ts +1 -1
  293. package/dist/features/link/nodes/types.d.ts.map +1 -1
  294. package/dist/features/link/nodes/types.js.map +1 -1
  295. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  296. package/dist/features/link/server/graphQLPopulationPromise.d.ts.map +1 -1
  297. package/dist/features/link/server/index.d.ts.map +1 -1
  298. package/dist/features/link/server/index.js +0 -71
  299. package/dist/features/link/server/index.js.map +1 -1
  300. package/dist/features/link/server/validate.d.ts.map +1 -1
  301. package/dist/features/lists/checklist/server/index.d.ts.map +1 -1
  302. package/dist/features/lists/checklist/server/index.js +0 -7
  303. package/dist/features/lists/checklist/server/index.js.map +1 -1
  304. package/dist/features/lists/orderedList/server/index.d.ts.map +1 -1
  305. package/dist/features/lists/orderedList/server/index.js +0 -7
  306. package/dist/features/lists/orderedList/server/index.js.map +1 -1
  307. package/dist/features/lists/plugin/index.d.ts +1 -1
  308. package/dist/features/lists/plugin/index.d.ts.map +1 -1
  309. package/dist/features/lists/plugin/index.js.map +1 -1
  310. package/dist/features/lists/shared/markdown.d.ts.map +1 -1
  311. package/dist/features/lists/unorderedList/server/index.d.ts.map +1 -1
  312. package/dist/features/lists/unorderedList/server/index.js +0 -7
  313. package/dist/features/lists/unorderedList/server/index.js.map +1 -1
  314. package/dist/features/relationship/client/components/RelationshipComponent.d.ts +1 -1
  315. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  316. package/dist/features/relationship/client/components/RelationshipComponent.js +29 -4
  317. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  318. package/dist/features/relationship/client/components/index.css +112 -0
  319. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  320. package/dist/features/relationship/client/utils/useEnabledRelationships.d.ts.map +1 -1
  321. package/dist/features/relationship/server/graphQLPopulationPromise.d.ts.map +1 -1
  322. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +1 -1
  323. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  324. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  325. package/dist/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -1
  326. package/dist/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -1
  327. package/dist/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -1
  328. package/dist/features/toolbars/fixed/client/Toolbar/index.css +87 -0
  329. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts +1 -1
  330. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  331. package/dist/features/toolbars/fixed/client/Toolbar/index.js +1 -0
  332. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  333. package/dist/features/toolbars/inline/client/Toolbar/index.css +43 -0
  334. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts +1 -1
  335. package/dist/features/toolbars/inline/client/Toolbar/index.d.ts.map +1 -1
  336. package/dist/features/toolbars/inline/client/Toolbar/index.js +1 -0
  337. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  338. package/dist/features/toolbars/shared/ToolbarButton/index.css +57 -0
  339. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  340. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  341. package/dist/features/toolbars/shared/ToolbarButton/index.js +80 -74
  342. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  343. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  344. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +5 -2
  345. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  346. package/dist/features/toolbars/shared/ToolbarDropdown/index.css +214 -0
  347. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  348. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  349. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +11 -7
  350. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  351. package/dist/features/toolbars/types.d.ts +5 -1
  352. package/dist/features/toolbars/types.d.ts.map +1 -1
  353. package/dist/features/toolbars/types.js.map +1 -1
  354. package/dist/features/typesClient.d.ts +1 -1
  355. package/dist/features/typesClient.d.ts.map +1 -1
  356. package/dist/features/typesClient.js.map +1 -1
  357. package/dist/features/typesServer.d.ts +3 -20
  358. package/dist/features/typesServer.d.ts.map +1 -1
  359. package/dist/features/typesServer.js.map +1 -1
  360. package/dist/features/upload/client/component/index.css +214 -0
  361. package/dist/features/upload/client/component/index.d.ts +1 -1
  362. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  363. package/dist/features/upload/client/component/index.js +86 -63
  364. package/dist/features/upload/client/component/index.js.map +1 -1
  365. package/dist/features/upload/client/component/pending/index.d.ts +0 -1
  366. package/dist/features/upload/client/component/pending/index.d.ts.map +1 -1
  367. package/dist/features/upload/client/component/pending/index.js.map +1 -1
  368. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  369. package/dist/features/upload/server/graphQLPopulationPromise.d.ts.map +1 -1
  370. package/dist/features/upload/server/index.d.ts.map +1 -1
  371. package/dist/features/upload/server/index.js +0 -78
  372. package/dist/features/upload/server/index.js.map +1 -1
  373. package/dist/features/upload/server/nodes/UploadNode.d.ts +1 -1
  374. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  375. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  376. package/dist/features/upload/server/validate.d.ts.map +1 -1
  377. package/dist/field/Diff/converters/link.d.ts +1 -1
  378. package/dist/field/Diff/converters/link.d.ts.map +1 -1
  379. package/dist/field/Diff/converters/link.js.map +1 -1
  380. package/dist/field/Diff/converters/listitem/index.css +80 -0
  381. package/dist/field/Diff/converters/listitem/index.d.ts +2 -2
  382. package/dist/field/Diff/converters/listitem/index.d.ts.map +1 -1
  383. package/dist/field/Diff/converters/listitem/index.js +1 -0
  384. package/dist/field/Diff/converters/listitem/index.js.map +1 -1
  385. package/dist/field/Diff/converters/relationship/index.css +108 -0
  386. package/dist/field/Diff/converters/relationship/index.d.ts +2 -2
  387. package/dist/field/Diff/converters/relationship/index.d.ts.map +1 -1
  388. package/dist/field/Diff/converters/relationship/index.js +11 -28
  389. package/dist/field/Diff/converters/relationship/index.js.map +1 -1
  390. package/dist/field/Diff/converters/unknown/index.css +37 -0
  391. package/dist/field/Diff/converters/unknown/index.d.ts +1 -1
  392. package/dist/field/Diff/converters/unknown/index.d.ts.map +1 -1
  393. package/dist/field/Diff/converters/unknown/index.js +1 -0
  394. package/dist/field/Diff/converters/unknown/index.js.map +1 -1
  395. package/dist/field/Diff/converters/upload/index.css +175 -0
  396. package/dist/field/Diff/converters/upload/index.d.ts +2 -2
  397. package/dist/field/Diff/converters/upload/index.d.ts.map +1 -1
  398. package/dist/field/Diff/converters/upload/index.js +7 -2
  399. package/dist/field/Diff/converters/upload/index.js.map +1 -1
  400. package/dist/field/Diff/index.css +156 -0
  401. package/dist/field/Diff/index.d.ts +1 -1
  402. package/dist/field/Diff/index.d.ts.map +1 -1
  403. package/dist/field/Diff/index.js +1 -0
  404. package/dist/field/Diff/index.js.map +1 -1
  405. package/dist/field/Field.d.ts +3 -3
  406. package/dist/field/Field.d.ts.map +1 -1
  407. package/dist/field/Field.js +12 -11
  408. package/dist/field/Field.js.map +1 -1
  409. package/dist/field/RenderLexical/index.d.ts +2 -2
  410. package/dist/field/RenderLexical/index.d.ts.map +1 -1
  411. package/dist/field/RenderLexical/index.js.map +1 -1
  412. package/dist/field/RichTextViewProvider.d.ts +1 -1
  413. package/dist/field/RichTextViewProvider.d.ts.map +1 -1
  414. package/dist/field/RichTextViewProvider.js.map +1 -1
  415. package/dist/field/ViewSelector.css +32 -0
  416. package/dist/field/ViewSelector.d.ts +1 -1
  417. package/dist/field/ViewSelector.d.ts.map +1 -1
  418. package/dist/field/ViewSelector.js +1 -0
  419. package/dist/field/ViewSelector.js.map +1 -1
  420. package/dist/field/bundled.css +1 -1
  421. package/dist/field/index.css +60 -0
  422. package/dist/field/index.d.ts +1 -1
  423. package/dist/field/index.d.ts.map +1 -1
  424. package/dist/field/index.js.map +1 -1
  425. package/dist/field/rscEntry.d.ts +1 -1
  426. package/dist/field/rscEntry.d.ts.map +1 -1
  427. package/dist/field/rscEntry.js.map +1 -1
  428. package/dist/hooks.d.ts +6 -0
  429. package/dist/hooks.d.ts.map +1 -0
  430. package/dist/hooks.js +548 -0
  431. package/dist/hooks.js.map +1 -0
  432. package/dist/index.d.ts +3 -13
  433. package/dist/index.d.ts.map +1 -1
  434. package/dist/index.js +20 -628
  435. package/dist/index.js.map +1 -1
  436. package/dist/lexical/LexicalEditor.css +50 -0
  437. package/dist/lexical/LexicalEditor.d.ts +1 -1
  438. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  439. package/dist/lexical/LexicalEditor.js +1 -0
  440. package/dist/lexical/LexicalEditor.js.map +1 -1
  441. package/dist/lexical/LexicalProvider.d.ts +1 -1
  442. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  443. package/dist/lexical/LexicalProvider.js.map +1 -1
  444. package/dist/lexical/config/client/EditorConfigProvider.d.ts +1 -1
  445. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  446. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  447. package/dist/lexical/config/client/loader.d.ts +1 -1
  448. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  449. package/dist/lexical/config/client/loader.js.map +1 -1
  450. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  451. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  452. package/dist/lexical/config/client/sanitize.js.map +1 -1
  453. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  454. package/dist/lexical/config/server/loader.js +12 -9
  455. package/dist/lexical/config/server/loader.js.map +1 -1
  456. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  457. package/dist/lexical/config/server/sanitize.js +3 -9
  458. package/dist/lexical/config/server/sanitize.js.map +1 -1
  459. package/dist/lexical/config/types.d.ts +1 -1
  460. package/dist/lexical/config/types.d.ts.map +1 -1
  461. package/dist/lexical/config/types.js.map +1 -1
  462. package/dist/lexical/nodes/index.d.ts +1 -1
  463. package/dist/lexical/nodes/index.d.ts.map +1 -1
  464. package/dist/lexical/nodes/index.js.map +1 -1
  465. package/dist/lexical/plugins/DecoratorPlugin/index.css +11 -0
  466. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts +1 -1
  467. package/dist/lexical/plugins/DecoratorPlugin/index.d.ts.map +1 -1
  468. package/dist/lexical/plugins/DecoratorPlugin/index.js +1 -0
  469. package/dist/lexical/plugins/DecoratorPlugin/index.js.map +1 -1
  470. package/dist/lexical/plugins/InsertParagraphAtEnd/index.css +52 -0
  471. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts +1 -1
  472. package/dist/lexical/plugins/InsertParagraphAtEnd/index.d.ts.map +1 -1
  473. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js +1 -0
  474. package/dist/lexical/plugins/InsertParagraphAtEnd/index.js.map +1 -1
  475. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +1 -1
  476. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  477. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  478. package/dist/lexical/plugins/SlashMenu/index.css +65 -0
  479. package/dist/lexical/plugins/SlashMenu/index.d.ts +1 -1
  480. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  481. package/dist/lexical/plugins/SlashMenu/index.js +2 -0
  482. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  483. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.css +40 -0
  484. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +1 -1
  485. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  486. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +1 -0
  487. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  488. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  489. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.css +84 -0
  490. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +1 -1
  491. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  492. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +15 -8
  493. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  494. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +1 -1
  495. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  496. package/dist/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -1
  497. package/dist/lexical/theme/EditorTheme.css +359 -0
  498. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  499. package/dist/lexical/theme/EditorTheme.js +1 -0
  500. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  501. package/dist/lexical/ui/ContentEditable.css +95 -0
  502. package/dist/lexical/ui/ContentEditable.d.ts +1 -1
  503. package/dist/lexical/ui/ContentEditable.d.ts.map +1 -1
  504. package/dist/lexical/ui/ContentEditable.js +1 -0
  505. package/dist/lexical/ui/ContentEditable.js.map +1 -1
  506. package/dist/lexical/ui/icons/Add/index.d.ts +4 -1
  507. package/dist/lexical/ui/icons/Add/index.d.ts.map +1 -1
  508. package/dist/lexical/ui/icons/Add/index.js +19 -12
  509. package/dist/lexical/ui/icons/Add/index.js.map +1 -1
  510. package/dist/lexical/ui/icons/Add/index.svg +2 -3
  511. package/dist/lexical/ui/icons/Add/light.svg +2 -3
  512. package/dist/lexical/ui/icons/AlignCenter/index.d.ts +3 -1
  513. package/dist/lexical/ui/icons/AlignCenter/index.d.ts.map +1 -1
  514. package/dist/lexical/ui/icons/AlignCenter/index.js +15 -19
  515. package/dist/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  516. package/dist/lexical/ui/icons/AlignJustify/index.d.ts +3 -1
  517. package/dist/lexical/ui/icons/AlignJustify/index.d.ts.map +1 -1
  518. package/dist/lexical/ui/icons/AlignJustify/index.js +15 -19
  519. package/dist/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  520. package/dist/lexical/ui/icons/AlignLeft/index.d.ts +3 -1
  521. package/dist/lexical/ui/icons/AlignLeft/index.d.ts.map +1 -1
  522. package/dist/lexical/ui/icons/AlignLeft/index.js +15 -19
  523. package/dist/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  524. package/dist/lexical/ui/icons/AlignRight/index.d.ts +3 -1
  525. package/dist/lexical/ui/icons/AlignRight/index.d.ts.map +1 -1
  526. package/dist/lexical/ui/icons/AlignRight/index.js +15 -19
  527. package/dist/lexical/ui/icons/AlignRight/index.js.map +1 -1
  528. package/dist/lexical/ui/icons/Block/index.d.ts +3 -1
  529. package/dist/lexical/ui/icons/Block/index.d.ts.map +1 -1
  530. package/dist/lexical/ui/icons/Block/index.js +13 -28
  531. package/dist/lexical/ui/icons/Block/index.js.map +1 -1
  532. package/dist/lexical/ui/icons/Blockquote/index.d.ts +3 -1
  533. package/dist/lexical/ui/icons/Blockquote/index.d.ts.map +1 -1
  534. package/dist/lexical/ui/icons/Blockquote/index.js +9 -6
  535. package/dist/lexical/ui/icons/Blockquote/index.js.map +1 -1
  536. package/dist/lexical/ui/icons/Bold/index.d.ts +3 -1
  537. package/dist/lexical/ui/icons/Bold/index.d.ts.map +1 -1
  538. package/dist/lexical/ui/icons/Bold/index.js +13 -8
  539. package/dist/lexical/ui/icons/Bold/index.js.map +1 -1
  540. package/dist/lexical/ui/icons/Checklist/index.d.ts +4 -1
  541. package/dist/lexical/ui/icons/Checklist/index.d.ts.map +1 -1
  542. package/dist/lexical/ui/icons/Checklist/index.js +17 -18
  543. package/dist/lexical/ui/icons/Checklist/index.js.map +1 -1
  544. package/dist/lexical/ui/icons/Code/index.d.ts +3 -1
  545. package/dist/lexical/ui/icons/Code/index.d.ts.map +1 -1
  546. package/dist/lexical/ui/icons/Code/index.js +15 -13
  547. package/dist/lexical/ui/icons/Code/index.js.map +1 -1
  548. package/dist/lexical/ui/icons/CodeBlock/index.d.ts +4 -1
  549. package/dist/lexical/ui/icons/CodeBlock/index.d.ts.map +1 -1
  550. package/dist/lexical/ui/icons/CodeBlock/index.js +18 -7
  551. package/dist/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  552. package/dist/lexical/ui/icons/Collapse/index.d.ts +3 -1
  553. package/dist/lexical/ui/icons/Collapse/index.d.ts.map +1 -1
  554. package/dist/lexical/ui/icons/Collapse/index.js +10 -8
  555. package/dist/lexical/ui/icons/Collapse/index.js.map +1 -1
  556. package/dist/lexical/ui/icons/DraggableBlock/index.svg +7 -7
  557. package/dist/lexical/ui/icons/DraggableBlock/light.svg +7 -7
  558. package/dist/lexical/ui/icons/Expand/index.d.ts +5 -0
  559. package/dist/lexical/ui/icons/Expand/index.d.ts.map +1 -0
  560. package/dist/lexical/ui/icons/Expand/index.js +22 -0
  561. package/dist/lexical/ui/icons/Expand/index.js.map +1 -0
  562. package/dist/lexical/ui/icons/H1/index.d.ts +3 -1
  563. package/dist/lexical/ui/icons/H1/index.d.ts.map +1 -1
  564. package/dist/lexical/ui/icons/H1/index.js +9 -6
  565. package/dist/lexical/ui/icons/H1/index.js.map +1 -1
  566. package/dist/lexical/ui/icons/H2/index.d.ts +3 -1
  567. package/dist/lexical/ui/icons/H2/index.d.ts.map +1 -1
  568. package/dist/lexical/ui/icons/H2/index.js +9 -6
  569. package/dist/lexical/ui/icons/H2/index.js.map +1 -1
  570. package/dist/lexical/ui/icons/H3/index.d.ts +3 -1
  571. package/dist/lexical/ui/icons/H3/index.d.ts.map +1 -1
  572. package/dist/lexical/ui/icons/H3/index.js +9 -6
  573. package/dist/lexical/ui/icons/H3/index.js.map +1 -1
  574. package/dist/lexical/ui/icons/H4/index.d.ts +3 -1
  575. package/dist/lexical/ui/icons/H4/index.d.ts.map +1 -1
  576. package/dist/lexical/ui/icons/H4/index.js +9 -6
  577. package/dist/lexical/ui/icons/H4/index.js.map +1 -1
  578. package/dist/lexical/ui/icons/H5/index.d.ts +3 -1
  579. package/dist/lexical/ui/icons/H5/index.d.ts.map +1 -1
  580. package/dist/lexical/ui/icons/H5/index.js +9 -6
  581. package/dist/lexical/ui/icons/H5/index.js.map +1 -1
  582. package/dist/lexical/ui/icons/H6/index.d.ts +3 -1
  583. package/dist/lexical/ui/icons/H6/index.d.ts.map +1 -1
  584. package/dist/lexical/ui/icons/H6/index.js +9 -6
  585. package/dist/lexical/ui/icons/H6/index.js.map +1 -1
  586. package/dist/lexical/ui/icons/HorizontalRule/index.d.ts +3 -1
  587. package/dist/lexical/ui/icons/HorizontalRule/index.d.ts.map +1 -1
  588. package/dist/lexical/ui/icons/HorizontalRule/index.js +11 -11
  589. package/dist/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  590. package/dist/lexical/ui/icons/IndentDecrease/index.d.ts +3 -1
  591. package/dist/lexical/ui/icons/IndentDecrease/index.d.ts.map +1 -1
  592. package/dist/lexical/ui/icons/IndentDecrease/index.js +18 -22
  593. package/dist/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  594. package/dist/lexical/ui/icons/IndentIncrease/index.d.ts +3 -1
  595. package/dist/lexical/ui/icons/IndentIncrease/index.d.ts.map +1 -1
  596. package/dist/lexical/ui/icons/IndentIncrease/index.js +15 -22
  597. package/dist/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  598. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts +3 -1
  599. package/dist/lexical/ui/icons/InlineBlocks/index.d.ts.map +1 -1
  600. package/dist/lexical/ui/icons/InlineBlocks/index.js +9 -6
  601. package/dist/lexical/ui/icons/InlineBlocks/index.js.map +1 -1
  602. package/dist/lexical/ui/icons/Italic/index.d.ts +3 -1
  603. package/dist/lexical/ui/icons/Italic/index.d.ts.map +1 -1
  604. package/dist/lexical/ui/icons/Italic/index.js +13 -8
  605. package/dist/lexical/ui/icons/Italic/index.js.map +1 -1
  606. package/dist/lexical/ui/icons/Link/index.d.ts +4 -1
  607. package/dist/lexical/ui/icons/Link/index.d.ts.map +1 -1
  608. package/dist/lexical/ui/icons/Link/index.js +14 -9
  609. package/dist/lexical/ui/icons/Link/index.js.map +1 -1
  610. package/dist/lexical/ui/icons/Meatballs/index.d.ts +4 -1
  611. package/dist/lexical/ui/icons/Meatballs/index.d.ts.map +1 -1
  612. package/dist/lexical/ui/icons/Meatballs/index.js +19 -15
  613. package/dist/lexical/ui/icons/Meatballs/index.js.map +1 -1
  614. package/dist/lexical/ui/icons/OrderedList/index.d.ts +4 -1
  615. package/dist/lexical/ui/icons/OrderedList/index.d.ts.map +1 -1
  616. package/dist/lexical/ui/icons/OrderedList/index.js +19 -25
  617. package/dist/lexical/ui/icons/OrderedList/index.js.map +1 -1
  618. package/dist/lexical/ui/icons/Page/index.d.ts +5 -0
  619. package/dist/lexical/ui/icons/Page/index.d.ts.map +1 -0
  620. package/dist/lexical/ui/icons/Page/index.js +21 -0
  621. package/dist/lexical/ui/icons/Page/index.js.map +1 -0
  622. package/dist/lexical/ui/icons/Relationship/index.d.ts +3 -1
  623. package/dist/lexical/ui/icons/Relationship/index.d.ts.map +1 -1
  624. package/dist/lexical/ui/icons/Relationship/index.js +13 -25
  625. package/dist/lexical/ui/icons/Relationship/index.js.map +1 -1
  626. package/dist/lexical/ui/icons/Strikethrough/index.d.ts +3 -1
  627. package/dist/lexical/ui/icons/Strikethrough/index.d.ts.map +1 -1
  628. package/dist/lexical/ui/icons/Strikethrough/index.js +13 -13
  629. package/dist/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  630. package/dist/lexical/ui/icons/Subscript/index.d.ts +3 -1
  631. package/dist/lexical/ui/icons/Subscript/index.d.ts.map +1 -1
  632. package/dist/lexical/ui/icons/Subscript/index.js +10 -7
  633. package/dist/lexical/ui/icons/Subscript/index.js.map +1 -1
  634. package/dist/lexical/ui/icons/Superscript/index.d.ts +3 -1
  635. package/dist/lexical/ui/icons/Superscript/index.d.ts.map +1 -1
  636. package/dist/lexical/ui/icons/Superscript/index.js +10 -7
  637. package/dist/lexical/ui/icons/Superscript/index.js.map +1 -1
  638. package/dist/lexical/ui/icons/Table/index.d.ts +4 -1
  639. package/dist/lexical/ui/icons/Table/index.d.ts.map +1 -1
  640. package/dist/lexical/ui/icons/Table/index.js +20 -15
  641. package/dist/lexical/ui/icons/Table/index.js.map +1 -1
  642. package/dist/lexical/ui/icons/Text/index.d.ts +4 -1
  643. package/dist/lexical/ui/icons/Text/index.d.ts.map +1 -1
  644. package/dist/lexical/ui/icons/Text/index.js +17 -8
  645. package/dist/lexical/ui/icons/Text/index.js.map +1 -1
  646. package/dist/lexical/ui/icons/Trash/index.d.ts +10 -0
  647. package/dist/lexical/ui/icons/Trash/index.d.ts.map +1 -0
  648. package/dist/lexical/ui/icons/Trash/index.js +29 -0
  649. package/dist/lexical/ui/icons/Trash/index.js.map +1 -0
  650. package/dist/lexical/ui/icons/Underline/index.d.ts +3 -1
  651. package/dist/lexical/ui/icons/Underline/index.d.ts.map +1 -1
  652. package/dist/lexical/ui/icons/Underline/index.js +16 -14
  653. package/dist/lexical/ui/icons/Underline/index.js.map +1 -1
  654. package/dist/lexical/ui/icons/UnorderedList/index.d.ts +3 -1
  655. package/dist/lexical/ui/icons/UnorderedList/index.d.ts.map +1 -1
  656. package/dist/lexical/ui/icons/UnorderedList/index.js +13 -40
  657. package/dist/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  658. package/dist/lexical/ui/icons/Upload/index.d.ts +3 -1
  659. package/dist/lexical/ui/icons/Upload/index.d.ts.map +1 -1
  660. package/dist/lexical/ui/icons/Upload/index.js +15 -22
  661. package/dist/lexical/ui/icons/Upload/index.js.map +1 -1
  662. package/dist/lexical/utils/markdown/createBlockNode.d.ts.map +1 -1
  663. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
  664. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  665. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  666. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.d.ts.map +1 -1
  667. package/dist/{types.d.ts → types/index.d.ts} +9 -9
  668. package/dist/types/index.d.ts.map +1 -0
  669. package/dist/types/index.js +2 -0
  670. package/dist/types/index.js.map +1 -0
  671. package/dist/{nodeTypes.d.ts → types/nodeTypes.d.ts} +10 -10
  672. package/dist/types/nodeTypes.d.ts.map +1 -0
  673. package/dist/types/nodeTypes.js.map +1 -0
  674. package/dist/types/schema.d.ts +6 -0
  675. package/dist/types/schema.d.ts.map +1 -0
  676. package/dist/types/schema.js +81 -0
  677. package/dist/types/schema.js.map +1 -0
  678. package/dist/utilities/buildEditorState.d.ts +1 -1
  679. package/dist/utilities/buildEditorState.d.ts.map +1 -1
  680. package/dist/utilities/buildEditorState.js +13 -0
  681. package/dist/utilities/buildEditorState.js.map +1 -1
  682. package/dist/utilities/buildInitialState.js.map +1 -1
  683. package/dist/utilities/createClientFeature.d.ts +1 -1
  684. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  685. package/dist/utilities/createClientFeature.js.map +1 -1
  686. package/dist/utilities/editorConfigFactory.d.ts +1 -1
  687. package/dist/utilities/editorConfigFactory.d.ts.map +1 -1
  688. package/dist/utilities/editorConfigFactory.js.map +1 -1
  689. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +1 -0
  690. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -1
  691. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +34 -18
  692. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -1
  693. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -1
  694. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -1
  695. package/dist/utilities/generateImportMap.d.ts +1 -1
  696. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  697. package/dist/utilities/generateImportMap.js.map +1 -1
  698. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  699. package/dist/utilities/getDefaultSanitizedEditorConfig.d.ts.map +1 -1
  700. package/dist/utilities/initLexicalFeatures.d.ts +1 -1
  701. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -1
  702. package/dist/utilities/initLexicalFeatures.js.map +1 -1
  703. package/dist/utilities/recurseNodeTree.d.ts.map +1 -1
  704. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  705. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  706. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  707. package/dist/validate/index.d.ts.map +1 -1
  708. package/package.json +16 -21
  709. package/dist/exports/client/Component-DOSSWC76.js +0 -2
  710. package/dist/exports/client/Component-DOSSWC76.js.map +0 -7
  711. package/dist/exports/client/Component-MBLHTKDK.js +0 -2
  712. package/dist/exports/client/Component-MBLHTKDK.js.map +0 -7
  713. package/dist/exports/client/Field-OVF2FPGD.js +0 -2
  714. package/dist/exports/client/Field-OVF2FPGD.js.map +0 -7
  715. package/dist/exports/client/RelationshipComponent-BG3DPV3T.js +0 -2
  716. package/dist/exports/client/RelationshipComponent-BG3DPV3T.js.map +0 -7
  717. package/dist/exports/client/chunk-BZZVLW4U.js.map +0 -7
  718. package/dist/exports/client/chunk-F26IQ5RE.js +0 -2
  719. package/dist/exports/client/chunk-F26IQ5RE.js.map +0 -7
  720. package/dist/exports/client/chunk-FTT5KJ6W.js.map +0 -7
  721. package/dist/exports/client/chunk-XFA5M7FY.js +0 -2
  722. package/dist/exports/client/chunk-XFA5M7FY.js.map +0 -7
  723. package/dist/exports/client/component-XIHC3W6W.js +0 -2
  724. package/dist/exports/client/component-XIHC3W6W.js.map +0 -7
  725. package/dist/exports/client/componentInline-A4H3EY3L.js +0 -2
  726. package/dist/exports/server/migrate.d.ts +0 -16
  727. package/dist/exports/server/migrate.d.ts.map +0 -1
  728. package/dist/exports/server/migrate.js +0 -16
  729. package/dist/exports/server/migrate.js.map +0 -1
  730. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts +0 -4
  731. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.d.ts.map +0 -1
  732. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js +0 -7
  733. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/linebreak.js.map +0 -1
  734. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts +0 -4
  735. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.d.ts.map +0 -1
  736. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js +0 -38
  737. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/paragraph.js.map +0 -1
  738. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts +0 -4
  739. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.d.ts.map +0 -1
  740. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js +0 -9
  741. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/tab.js.map +0 -1
  742. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts +0 -4
  743. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.d.ts.map +0 -1
  744. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js +0 -33
  745. package/dist/features/converters/lexicalToHtml_deprecated/converter/converters/text.js.map +0 -1
  746. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts +0 -6
  747. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.d.ts.map +0 -1
  748. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js +0 -9
  749. package/dist/features/converters/lexicalToHtml_deprecated/converter/defaultConverters.js.map +0 -1
  750. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts +0 -70
  751. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.d.ts.map +0 -1
  752. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js +0 -104
  753. package/dist/features/converters/lexicalToHtml_deprecated/converter/index.js.map +0 -1
  754. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts +0 -27
  755. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.d.ts.map +0 -1
  756. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js +0 -2
  757. package/dist/features/converters/lexicalToHtml_deprecated/converter/types.js.map +0 -1
  758. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts +0 -39
  759. package/dist/features/converters/lexicalToHtml_deprecated/field/index.d.ts.map +0 -1
  760. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js +0 -122
  761. package/dist/features/converters/lexicalToHtml_deprecated/field/index.js.map +0 -1
  762. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts +0 -12
  763. package/dist/features/converters/lexicalToHtml_deprecated/index.d.ts.map +0 -1
  764. package/dist/features/converters/lexicalToHtml_deprecated/index.js +0 -11
  765. package/dist/features/converters/lexicalToHtml_deprecated/index.js.map +0 -1
  766. package/dist/features/lists/htmlConverter.d.ts +0 -5
  767. package/dist/features/lists/htmlConverter.d.ts.map +0 -1
  768. package/dist/features/lists/htmlConverter.js +0 -81
  769. package/dist/features/lists/htmlConverter.js.map +0 -1
  770. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts +0 -3
  771. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.d.ts.map +0 -1
  772. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js +0 -22
  773. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/heading/converter.js.map +0 -1
  774. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts +0 -3
  775. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.d.ts.map +0 -1
  776. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js +0 -33
  777. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/link/converter.js.map +0 -1
  778. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts +0 -3
  779. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.d.ts.map +0 -1
  780. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js +0 -24
  781. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/list/converter.js.map +0 -1
  782. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts +0 -3
  783. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
  784. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js +0 -25
  785. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/listItem/converter.js.map +0 -1
  786. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts +0 -3
  787. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.d.ts.map +0 -1
  788. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js +0 -22
  789. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/quote/converter.js.map +0 -1
  790. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts +0 -3
  791. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
  792. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js +0 -28
  793. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/unknown/converter.js.map +0 -1
  794. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts +0 -3
  795. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.d.ts.map +0 -1
  796. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js +0 -22
  797. package/dist/features/migrations/lexicalPluginToLexical/converter/converters/upload/converter.js.map +0 -1
  798. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts +0 -3
  799. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.d.ts.map +0 -1
  800. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js +0 -9
  801. package/dist/features/migrations/lexicalPluginToLexical/converter/defaultConverters.js.map +0 -1
  802. package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts +0 -19
  803. package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +0 -1
  804. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +0 -78
  805. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +0 -1
  806. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts +0 -23
  807. package/dist/features/migrations/lexicalPluginToLexical/converter/types.d.ts.map +0 -1
  808. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js +0 -2
  809. package/dist/features/migrations/lexicalPluginToLexical/converter/types.js.map +0 -1
  810. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +0 -2
  811. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +0 -1
  812. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js +0 -10
  813. package/dist/features/migrations/lexicalPluginToLexical/feature.client.js.map +0 -1
  814. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts +0 -10
  815. package/dist/features/migrations/lexicalPluginToLexical/feature.server.d.ts.map +0 -1
  816. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js +0 -49
  817. package/dist/features/migrations/lexicalPluginToLexical/feature.server.js.map +0 -1
  818. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
  819. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
  820. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +0 -15
  821. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
  822. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
  823. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
  824. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +0 -74
  825. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
  826. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts +0 -3
  827. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.d.ts.map +0 -1
  828. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js +0 -23
  829. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +0 -1
  830. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts +0 -3
  831. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.d.ts.map +0 -1
  832. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js +0 -24
  833. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +0 -1
  834. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts +0 -3
  835. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.d.ts.map +0 -1
  836. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js +0 -33
  837. package/dist/features/migrations/slateToLexical/converter/converters/indent/converter.js.map +0 -1
  838. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts +0 -3
  839. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.d.ts.map +0 -1
  840. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js +0 -30
  841. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +0 -1
  842. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts +0 -3
  843. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.d.ts.map +0 -1
  844. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js +0 -26
  845. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +0 -1
  846. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts +0 -3
  847. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.d.ts.map +0 -1
  848. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js +0 -26
  849. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +0 -1
  850. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts +0 -3
  851. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.d.ts.map +0 -1
  852. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js +0 -15
  853. package/dist/features/migrations/slateToLexical/converter/converters/relationship/converter.js.map +0 -1
  854. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts +0 -3
  855. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.d.ts.map +0 -1
  856. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js +0 -27
  857. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +0 -1
  858. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts +0 -3
  859. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.d.ts.map +0 -1
  860. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js +0 -26
  861. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +0 -1
  862. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts +0 -3
  863. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.d.ts.map +0 -1
  864. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js +0 -18
  865. package/dist/features/migrations/slateToLexical/converter/converters/upload/converter.js.map +0 -1
  866. package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts +0 -3
  867. package/dist/features/migrations/slateToLexical/converter/defaultConverters.d.ts.map +0 -1
  868. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js +0 -12
  869. package/dist/features/migrations/slateToLexical/converter/defaultConverters.js.map +0 -1
  870. package/dist/features/migrations/slateToLexical/converter/index.d.ts +0 -19
  871. package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +0 -1
  872. package/dist/features/migrations/slateToLexical/converter/index.js +0 -130
  873. package/dist/features/migrations/slateToLexical/converter/index.js.map +0 -1
  874. package/dist/features/migrations/slateToLexical/converter/types.d.ts +0 -16
  875. package/dist/features/migrations/slateToLexical/converter/types.d.ts.map +0 -1
  876. package/dist/features/migrations/slateToLexical/converter/types.js +0 -2
  877. package/dist/features/migrations/slateToLexical/converter/types.js.map +0 -1
  878. package/dist/features/migrations/slateToLexical/feature.client.d.ts +0 -2
  879. package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +0 -1
  880. package/dist/features/migrations/slateToLexical/feature.client.js +0 -10
  881. package/dist/features/migrations/slateToLexical/feature.client.js.map +0 -1
  882. package/dist/features/migrations/slateToLexical/feature.server.d.ts +0 -40
  883. package/dist/features/migrations/slateToLexical/feature.server.d.ts.map +0 -1
  884. package/dist/features/migrations/slateToLexical/feature.server.js +0 -68
  885. package/dist/features/migrations/slateToLexical/feature.server.js.map +0 -1
  886. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts +0 -9
  887. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.d.ts.map +0 -1
  888. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +0 -15
  889. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +0 -1
  890. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +0 -33
  891. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +0 -1
  892. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +0 -74
  893. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +0 -1
  894. package/dist/lexical/ui/icons/AI/index.d.ts +0 -3
  895. package/dist/lexical/ui/icons/AI/index.d.ts.map +0 -1
  896. package/dist/lexical/ui/icons/AI/index.js +0 -34
  897. package/dist/lexical/ui/icons/AI/index.js.map +0 -1
  898. package/dist/lexical/ui/icons/Caret/index.svg +0 -3
  899. package/dist/lexical/ui/icons/Edit/index.svg +0 -10
  900. package/dist/lexical/ui/icons/Remove/index.svg +0 -4
  901. package/dist/nodeTypes.d.ts.map +0 -1
  902. package/dist/nodeTypes.js.map +0 -1
  903. package/dist/types.d.ts.map +0 -1
  904. package/dist/types.js +0 -2
  905. package/dist/types.js.map +0 -1
  906. package/dist/utilities/migrateSlateToLexical/index.d.ts +0 -15
  907. package/dist/utilities/migrateSlateToLexical/index.d.ts.map +0 -1
  908. package/dist/utilities/migrateSlateToLexical/index.js +0 -152
  909. package/dist/utilities/migrateSlateToLexical/index.js.map +0 -1
  910. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +0 -10
  911. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +0 -1
  912. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +0 -85
  913. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +0 -1
  914. /package/dist/exports/client/{chunk-QJ5EETIB.js.map → chunk-6QWQ7JV4.js.map} +0 -0
  915. /package/dist/exports/client/{componentInline-A4H3EY3L.js.map → componentInline-JJZ2NKW2.js.map} +0 -0
  916. /package/dist/{nodeTypes.js → types/nodeTypes.js} +0 -0
@@ -4,15 +4,16 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
4
4
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
5
5
  import { useLexicalEditable } from '@lexical/react/useLexicalEditable';
6
6
  import { getTranslation } from '@payloadcms/translations';
7
- import { Button, formatDrawerSlug, Thumbnail, useConfig, useEditDepth, usePayloadAPI, useTranslation } from '@payloadcms/ui';
8
- import { $getNodeByKey } from 'lexical';
7
+ import { Button, formatDrawerSlug, Pill, Thumbnail, useConfig, useEditDepth, usePayloadAPI, useTranslation } from '@payloadcms/ui';
8
+ import { $getNodeByKey, $getSelection, $isNodeSelection, $isRangeSelection } from 'lexical';
9
9
  import { formatAdminURL, isImage } from 'payload/shared';
10
- import React, { useCallback, useId, useReducer, useRef, useState } from 'react';
10
+ import React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react';
11
11
  import { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js';
12
12
  import { FieldsDrawer } from '../../../../utilities/fieldsDrawer/Drawer.js';
13
13
  import { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js';
14
14
  import { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js';
15
15
  import { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js';
16
+ import './index.css';
16
17
  const initialParams = {
17
18
  depth: 0
18
19
  };
@@ -56,6 +57,7 @@ export const UploadComponent = props => {
56
57
  i18n,
57
58
  t
58
59
  } = useTranslation();
60
+ const [isSelected, setIsSelected] = useState(false);
59
61
  const [cacheBust, dispatchCacheBust] = useReducer(state => state + 1, 0);
60
62
  const [relatedCollection] = useState(() => getEntityConfig({
61
63
  collectionSlug: relationTo
@@ -90,6 +92,29 @@ export const UploadComponent = props => {
90
92
  initialParams
91
93
  });
92
94
  const thumbnailSRC = data?.thumbnailURL || data?.url;
95
+ useEffect(() => {
96
+ return editor.registerUpdateListener(({
97
+ editorState
98
+ }) => {
99
+ editorState.read(() => {
100
+ const selection = $getSelection();
101
+ if ($isNodeSelection(selection)) {
102
+ setIsSelected(selection.has(nodeKey));
103
+ } else if ($isRangeSelection(selection)) {
104
+ const nodes = selection.getNodes();
105
+ setIsSelected(nodes.some(node => node.getKey() === nodeKey));
106
+ } else {
107
+ setIsSelected(false);
108
+ }
109
+ });
110
+ });
111
+ }, [editor, nodeKey]);
112
+ useEffect(() => {
113
+ const outerEl = uploadRef.current?.closest(`.${baseClass}`);
114
+ if (outerEl) {
115
+ outerEl.classList.toggle(`${baseClass}--selected`, isSelected);
116
+ }
117
+ }, [isSelected, baseClass]);
93
118
  const removeUpload = useCallback(() => {
94
119
  editor.update(() => {
95
120
  $getNodeByKey(nodeKey)?.remove();
@@ -123,9 +148,9 @@ export const UploadComponent = props => {
123
148
  "data-align": format || undefined,
124
149
  "data-filename": data?.filename,
125
150
  ref: uploadRef,
126
- children: [/*#__PURE__*/_jsxs("div", {
151
+ children: [/*#__PURE__*/_jsx("div", {
127
152
  className: `${baseClass}__card`,
128
- children: [/*#__PURE__*/_jsxs("div", {
153
+ children: /*#__PURE__*/_jsxs("div", {
129
154
  className: `${baseClass}__media`,
130
155
  children: [/*#__PURE__*/_jsx(Thumbnail, {
131
156
  collectionSlug: relationTo,
@@ -133,65 +158,63 @@ export const UploadComponent = props => {
133
158
  height: data?.height,
134
159
  size: "none",
135
160
  width: data?.width
136
- }), isEditable && /*#__PURE__*/_jsx("div", {
137
- className: `${baseClass}__overlay ${baseClass}__floater`,
138
- children: /*#__PURE__*/_jsxs("div", {
139
- className: `${baseClass}__actions`,
140
- role: "toolbar",
141
- children: [hasExtraFields ? /*#__PURE__*/_jsx(Button, {
142
- buttonStyle: "icon-label",
143
- className: `${baseClass}__upload-drawer-toggler`,
144
- disabled: !isEditable,
145
- el: "button",
146
- icon: "edit",
147
- onClick: toggleDrawer,
148
- round: true,
149
- size: "medium",
150
- tooltip: t('fields:editRelationship')
151
- }) : null, /*#__PURE__*/_jsx(Button, {
152
- buttonStyle: "icon-label",
153
- className: `${baseClass}__swap-drawer-toggler`,
154
- disabled: !isEditable,
155
- el: "button",
156
- icon: "swap",
157
- onClick: () => {
158
- editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {
159
- replace: {
160
- nodeKey
161
- }
162
- });
163
- },
164
- round: true,
165
- size: "medium",
166
- tooltip: t('fields:swapUpload')
167
- }), /*#__PURE__*/_jsx(Button, {
168
- buttonStyle: "icon-label",
169
- className: `${baseClass}__removeButton`,
170
- disabled: !isEditable,
171
- icon: "x",
172
- onClick: e => {
173
- e.preventDefault();
174
- removeUpload();
175
- },
176
- round: true,
177
- size: "medium",
178
- tooltip: t('fields:removeUpload')
179
- })]
180
- })
181
- })]
182
- }), /*#__PURE__*/_jsxs("div", {
183
- className: `${baseClass}__metaOverlay ${baseClass}__floater`,
184
- children: [/*#__PURE__*/_jsx(DocumentDrawerToggler, {
185
- className: `${baseClass}__doc-drawer-toggler`,
186
- children: /*#__PURE__*/_jsx("strong", {
187
- className: `${baseClass}__filename`,
188
- children: data?.filename || t('general:untitled')
189
- })
190
- }), /*#__PURE__*/_jsx("div", {
191
- className: `${baseClass}__collectionLabel`,
192
- children: getTranslation(relatedCollection.labels.singular, i18n)
161
+ }), isEditable && /*#__PURE__*/_jsxs("div", {
162
+ className: `${baseClass}__floater`,
163
+ "data-theme": "dark",
164
+ children: [/*#__PURE__*/_jsx(Pill, {
165
+ className: `${baseClass}__collectionLabel`,
166
+ pillStyle: "dark",
167
+ size: "small",
168
+ children: getTranslation(relatedCollection.labels.singular, i18n)
169
+ }), /*#__PURE__*/_jsx(DocumentDrawerToggler, {
170
+ className: `${baseClass}__doc-drawer-toggler`,
171
+ children: /*#__PURE__*/_jsx("span", {
172
+ className: `${baseClass}__filename`,
173
+ children: data?.filename || t('general:untitled')
174
+ })
175
+ }), hasExtraFields ? /*#__PURE__*/_jsx(Button, {
176
+ buttonStyle: "ghost",
177
+ className: `${baseClass}__upload-drawer-toggler`,
178
+ disabled: !isEditable,
179
+ el: "button",
180
+ icon: "write",
181
+ onClick: toggleDrawer,
182
+ round: true,
183
+ size: "medium",
184
+ tooltip: t('fields:editRelationship')
185
+ }) : null, /*#__PURE__*/_jsx("div", {
186
+ className: `${baseClass}__divider`
187
+ }), /*#__PURE__*/_jsx(Button, {
188
+ buttonStyle: "ghost",
189
+ className: `${baseClass}__swap-drawer-toggler`,
190
+ disabled: !isEditable,
191
+ el: "button",
192
+ icon: "swap",
193
+ onClick: () => {
194
+ editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {
195
+ replace: {
196
+ nodeKey
197
+ }
198
+ });
199
+ },
200
+ round: true,
201
+ size: "medium",
202
+ tooltip: t('fields:swapUpload')
203
+ }), /*#__PURE__*/_jsx(Button, {
204
+ buttonStyle: "ghost",
205
+ className: `${baseClass}__removeButton`,
206
+ disabled: !isEditable,
207
+ icon: "x",
208
+ onClick: e => {
209
+ e.preventDefault();
210
+ removeUpload();
211
+ },
212
+ round: true,
213
+ size: "medium",
214
+ tooltip: t('fields:removeUpload')
215
+ })]
193
216
  })]
194
- })]
217
+ })
195
218
  }), value ? /*#__PURE__*/_jsx(DocumentDrawer, {
196
219
  onSave: updateUpload
197
220
  }) : null, hasExtraFields ? /*#__PURE__*/_jsx(FieldsDrawer, {
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalEditable","getTranslation","Button","formatDrawerSlug","Thumbnail","useConfig","useEditDepth","usePayloadAPI","useTranslation","$getNodeByKey","formatAdminURL","isImage","React","useCallback","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","cacheBust","dispatchCacheBust","state","relatedCollection","collectionSlug","componentID","extraFieldsDrawerSlug","slug","toggleDrawer","closeDocumentDrawer","DocumentDrawer","DocumentDrawerToggler","id","setParams","apiRoute","path","thumbnailSRC","thumbnailURL","url","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","role","buttonStyle","disabled","el","icon","onClick","round","tooltip","dispatchCommand","replace","e","preventDefault","labels","singular","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 Thumbnail,\n useConfig,\n useEditDepth,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport { $getNodeByKey, type ElementFormatType } from 'lexical'\nimport { formatAdminURL, isImage } from 'payload/shared'\nimport React, { useCallback, 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.scss'\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 [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 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}__overlay ${baseClass}__floater`}>\n <div className={`${baseClass}__actions`} role=\"toolbar\">\n {hasExtraFields ? (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={!isEditable}\n el=\"button\"\n icon=\"edit\"\n onClick={toggleDrawer}\n round\n size=\"medium\"\n tooltip={t('fields:editRelationship')}\n />\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\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=\"icon-label\"\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 </div>\n )}\n </div>\n\n <div className={`${baseClass}__metaOverlay ${baseClass}__floater`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong className={`${baseClass}__filename`}>\n {data?.filename || t('general:untitled')}\n </strong>\n </DocumentDrawerToggler>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\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,SAAS,EACTC,SAAS,EACTC,YAAY,EACZC,aAAa,EACbC,cAAc,QACT;AACP,SAASC,aAAa,QAAgC;AACtD,SAASC,cAAc,EAAEC,OAAO,QAAQ;AACxC,OAAOC,KAAA,IAASC,WAAW,EAAEC,KAAK,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAOxE,SAASC,sBAAsB,QAAQ;AACvC,SAASC,YAAY,QAAQ;AAC7B,SAASC,wBAAwB,QAAQ;AACzC,SAASC,gBAAgB,QAAQ;AACjC,SAASC,iCAAiC,QAAQ;A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AC1E,YAAA;MACCU,IAAA,EAAMC,MAAA;MACNkF,UAAA,EAAYvD,qBAAA;MACZwD,WAAA,EAAa/D,CAAA,CAAE,qBAAqB;QAClCgE,KAAA,EAAOjH,cAAA,CAAeqD,iBAAA,CAAkBuD,MAAM,CAACC,QAAQ,EAAE7D,IAAA;MAC3D;MACAkE,UAAA,EAAW;MACXC,kBAAA,EAAoBpC,yBAAA;MACpBjC,UAAA,EAAYA,UAAA;MACZsE,gBAAA,EAAkB/D,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/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,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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AAA,EAAYA,UAAA;MACZuF,gBAAA,EAAkB9E,iBAAA,CAAkBI;SAEpC;;AAGV","ignoreList":[]}
@@ -1,3 +1,2 @@
1
- import '../index.scss';
2
1
  export declare const PendingUploadComponent: () => React.ReactNode;
3
2
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/upload/client/component/pending/index.tsx"],"names":[],"mappings":"AAIA,OAAO,eAAe,CAAA;AAEtB,eAAO,MAAM,sBAAsB,QAAO,KAAK,CAAC,SAM/C,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/features/upload/client/component/pending/index.tsx"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB,QAAO,KAAK,CAAC,SAM/C,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["ShimmerEffect","PendingUploadComponent","_jsx","className","height","width"],"sources":["../../../../../../src/features/upload/client/component/pending/index.tsx"],"sourcesContent":["'use client'\n\nimport { ShimmerEffect } from '@payloadcms/ui'\n\nimport '../index.scss'\n\nexport const PendingUploadComponent = (): React.ReactNode => {\n return (\n <div className={'lexical-upload'}>\n <ShimmerEffect height={'95px'} width={'203px'} />\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAEA,SAASA,aAAa,QAAQ;AAI9B,OAAO,MAAMC,sBAAA,GAAyBA,CAAA;EACpC,oBACEC,IAAA,CAAC;IAAIC,SAAA,EAAW;cACd,aAAAD,IAAA,CAACF,aAAA;MAAcI,MAAA,EAAQ;MAAQC,KAAA,EAAO;;;AAG5C","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["ShimmerEffect","PendingUploadComponent","_jsx","className","height","width"],"sources":["../../../../../../src/features/upload/client/component/pending/index.tsx"],"sourcesContent":["'use client'\n\nimport { ShimmerEffect } from '@payloadcms/ui'\n\nexport const PendingUploadComponent = (): React.ReactNode => {\n return (\n <div className={'lexical-upload'}>\n <ShimmerEffect height={'95px'} width={'203px'} />\n </div>\n )\n}\n"],"mappings":"AAAA;;;AAEA,SAASA,aAAa,QAAQ;AAE9B,OAAO,MAAMC,sBAAA,GAAyBA,CAAA;EACpC,oBACEC,IAAA,CAAC;IAAIC,SAAA,EAAW;cACd,aAAAD,IAAA,CAACF,aAAA;MAAcI,MAAA,EAAQ;MAAQC,KAAA,EAAO;;;AAG5C","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/drawer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAKnD,OAAO,KAA2C,MAAM,OAAO,CAAA;AA4C/D,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,oBAAoB,EAAE,CAAA;CAC/C,CAAA;AA6DD,eAAO,MAAM,YAAY,+BAAgC,KAAK,KAAG,KAAK,CAAC,SAMtE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/drawer/index.tsx"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAKnD,OAAO,KAA2C,MAAM,OAAO,CAAA;AA4C/D,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,oBAAoB,EAAE,CAAA;CAC/C,CAAA;AA6DD,eAAO,MAAM,YAAY,GAAI,4BAA4B,KAAK,KAAG,KAAK,CAAC,SAMtE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"graphQLPopulationPromise.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/graphQLPopulationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAKjE,eAAO,MAAM,0BAA0B,WAC7B,kBAAkB,KACzB,iBAAiB,CAAC,oBAAoB,CAwExC,CAAA"}
1
+ {"version":3,"file":"graphQLPopulationPromise.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/graphQLPopulationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAC7D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAKjE,eAAO,MAAM,0BAA0B,GACrC,QAAQ,kBAAkB,KACzB,iBAAiB,CAAC,oBAAoB,CAwExC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAEV,KAAK,EAML,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAIhB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAWlE,MAAM,MAAM,2BAA2B,GACnC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,oBAAoB,EAAE,CAAA;IAG5C,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAC5C,CAAA;AAEL,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,CAAC,EAAE;QACZ,CAAC,UAAU,EAAE,oBAAoB,GAAG;YAClC,MAAM,EAAE,KAAK,EAAE,CAAA;SAChB,CAAA;KACF,CAAA;IACD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,2BAA2B,CAAA;AAS/B,eAAO,MAAM,aAAa,gIA8PxB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAU,KAAK,EAAkB,oBAAoB,EAAE,MAAM,SAAS,CAAA;AAIlF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAA;AAWlE,MAAM,MAAM,2BAA2B,GACnC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,oBAAoB,EAAE,CAAA;IAG5C,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,oBAAoB,EAAE,CAAA;CAC5C,CAAA;AAEL,MAAM,MAAM,kBAAkB,GAAG;IAC/B,WAAW,CAAC,EAAE;QACZ,CAAC,UAAU,EAAE,oBAAoB,GAAG;YAClC,MAAM,EAAE,KAAK,EAAE,CAAA;SAChB,CAAA;KACF,CAAA;IACD;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,GAAG,2BAA2B,CAAA;AAE/B,eAAO,MAAM,aAAa,gIAuJxB,CAAA"}
@@ -7,12 +7,6 @@ import { i18n } from './i18n.js';
7
7
  import { UploadMarkdownTransformer } from './markdownTransformer.js';
8
8
  import { UploadServerNode } from './nodes/UploadNode.js';
9
9
  import { uploadValidation } from './validate.js';
10
- /**
11
- * Get the absolute URL for an upload URL by potentially prepending the serverURL
12
- */
13
- function getAbsoluteURL(url, payload) {
14
- return url?.startsWith('http') ? url : (payload?.config?.serverURL || '') + url;
15
- }
16
10
  export const UploadFeature = createServerFeature({
17
11
  feature: async ({
18
12
  config: _config,
@@ -77,78 +71,6 @@ export const UploadFeature = createServerFeature({
77
71
  i18n,
78
72
  markdownTransformers: [UploadMarkdownTransformer],
79
73
  nodes: [createNode({
80
- converters: {
81
- html: {
82
- converter: async ({
83
- currentDepth,
84
- depth,
85
- draft,
86
- node,
87
- overrideAccess,
88
- req,
89
- showHiddenFields
90
- }) => {
91
- // @ts-expect-error - for backwards-compatibility
92
- const id = node?.value?.id || node?.value;
93
- if (req?.payload) {
94
- const uploadDocument = {};
95
- try {
96
- await populate({
97
- id,
98
- collectionSlug: node.relationTo,
99
- currentDepth,
100
- data: uploadDocument,
101
- depth,
102
- draft,
103
- key: 'value',
104
- overrideAccess,
105
- req,
106
- showHiddenFields
107
- });
108
- } catch (ignored) {
109
- // eslint-disable-next-line no-console
110
- console.error('Lexical upload node HTML converter: error fetching upload file', ignored, 'Node:', node);
111
- return `<img />`;
112
- }
113
- const url = getAbsoluteURL(uploadDocument?.value?.url ?? '', req?.payload);
114
- const alt = node.fields?.alt || uploadDocument?.value?.alt || '';
115
- /**
116
- * If the upload is not an image, return a link to the upload
117
- */
118
- if (!uploadDocument?.value?.mimeType?.startsWith('image')) {
119
- return `<a href="${url}" rel="noopener noreferrer">${uploadDocument.value?.filename}</a>`;
120
- }
121
- /**
122
- * If the upload is a simple image with no different sizes, return a simple img tag
123
- */
124
- if (!uploadDocument?.value?.sizes || !Object.keys(uploadDocument?.value?.sizes).length) {
125
- return `<img src="${url}" alt="${alt}" width="${uploadDocument?.value?.width}" height="${uploadDocument?.value?.height}"/>`;
126
- }
127
- /**
128
- * If the upload is an image with different sizes, return a picture element
129
- */
130
- let pictureHTML = '<picture>';
131
- // Iterate through each size in the data.sizes object
132
- for (const size in uploadDocument.value?.sizes) {
133
- const imageSize = uploadDocument.value.sizes[size];
134
- // Skip if any property of the size object is null
135
- if (!imageSize.width || !imageSize.height || !imageSize.mimeType || !imageSize.filesize || !imageSize.filename || !imageSize.url) {
136
- continue;
137
- }
138
- const imageSizeURL = getAbsoluteURL(imageSize?.url, req?.payload);
139
- pictureHTML += `<source srcset="${imageSizeURL}" media="(max-width: ${imageSize.width}px)" type="${imageSize.mimeType}">`;
140
- }
141
- // Add the default img tag
142
- pictureHTML += `<img src="${url}" alt="${alt}" width="${uploadDocument.value?.width}" height="${uploadDocument.value?.height}">`;
143
- pictureHTML += '</picture>';
144
- return pictureHTML;
145
- } else {
146
- return `<img src="${id}" />`;
147
- }
148
- },
149
- nodeTypes: [UploadServerNode.getType()]
150
- }
151
- },
152
74
  getSubFields: ({
153
75
  node,
154
76
  req
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["sanitizeFields","populate","createServerFeature","createNode","uploadPopulationPromiseHOC","i18n","UploadMarkdownTransformer","UploadServerNode","uploadValidation","getAbsoluteURL","url","payload","startsWith","config","serverURL","UploadFeature","feature","_config","isRoot","parentIsLocalized","props","collections","clientProps","disabledCollections","enabledCollections","collection","hasExtraFields","fields","length","validRelationships","map","c","slug","collectionKey","requireFieldLevelRichTextEditor","ClientFeature","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","markdownTransformers","nodes","converters","html","converter","currentDepth","depth","draft","node","overrideAccess","req","showHiddenFields","id","value","uploadDocument","collectionSlug","relationTo","data","key","ignored","console","error","alt","mimeType","filename","sizes","Object","keys","width","height","pictureHTML","size","imageSize","filesize","imageSizeURL","nodeTypes","getType","getSubFields","allSubFields","collectionFields","concat","collectionFieldSchema","Array","isArray","getSubFieldsData","graphQLPopulationPromises","hooks","afterRead","populateArg","populationPromises","populateDepth","maxDepth","undefined","push","select","defaultPopulate","validations","sanitizedServerFeatureProps"],"sources":["../../../../src/features/upload/server/index.ts"],"sourcesContent":["import type {\n Config,\n Field,\n FieldSchemaMap,\n FileData,\n FileSizeImproved,\n Payload,\n TypeWithID,\n UploadCollectionSlug,\n} from 'payload'\n\nimport { sanitizeFields } from 'payload'\n\nimport type { UploadFeaturePropsClient } from '../client/index.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { uploadPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { UploadMarkdownTransformer } from './markdownTransformer.js'\nimport { UploadServerNode } from './nodes/UploadNode.js'\nimport { uploadValidation } from './validate.js'\n\nexport type ExclusiveUploadFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: UploadCollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: UploadCollectionSlug[]\n }\n\nexport type UploadFeatureProps = {\n collections?: {\n [collection: UploadCollectionSlug]: {\n fields: Field[]\n }\n }\n /**\n * Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveUploadFeatureProps\n\n/**\n * Get the absolute URL for an upload URL by potentially prepending the serverURL\n */\nfunction getAbsoluteURL(url: string, payload: Payload): string {\n return url?.startsWith('http') ? url : (payload?.config?.serverURL || '') + url\n}\n\nexport const UploadFeature = createServerFeature<\n UploadFeatureProps,\n UploadFeatureProps,\n UploadFeaturePropsClient\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = {\n collections: {},\n }\n if (props.disabledCollections) {\n clientProps.disabledCollections = props.disabledCollections\n }\n if (props.enabledCollections) {\n clientProps.enabledCollections = props.enabledCollections\n }\n\n if (props.collections) {\n for (const collection in props.collections) {\n clientProps.collections[collection] = {\n hasExtraFields: props.collections[collection]!.fields.length >= 1,\n }\n }\n }\n\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const collectionKey in props.collections) {\n const collection = props.collections[collectionKey]!\n if (collection.fields?.length) {\n collection.fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: collection.fields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#UploadFeatureClient',\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ props }) => {\n if (!props?.collections) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n\n for (const collectionKey in props.collections) {\n const collection = props.collections[collectionKey]!\n if (collection.fields?.length) {\n schemaMap.set(collectionKey, {\n fields: collection.fields,\n })\n }\n }\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [UploadMarkdownTransformer],\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n req,\n showHiddenFields,\n }) => {\n // @ts-expect-error - for backwards-compatibility\n const id = node?.value?.id || node?.value\n\n if (req?.payload) {\n const uploadDocument: {\n value?: FileData & TypeWithID\n } = {}\n\n try {\n await populate({\n id,\n collectionSlug: node.relationTo,\n currentDepth,\n data: uploadDocument,\n depth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n showHiddenFields,\n })\n } catch (ignored) {\n // eslint-disable-next-line no-console\n console.error(\n 'Lexical upload node HTML converter: error fetching upload file',\n ignored,\n 'Node:',\n node,\n )\n return `<img />`\n }\n\n const url = getAbsoluteURL(uploadDocument?.value?.url ?? '', req?.payload)\n\n const alt =\n (node.fields?.alt as string) ||\n (uploadDocument?.value as { alt?: string })?.alt ||\n ''\n\n /**\n * If the upload is not an image, return a link to the upload\n */\n if (!uploadDocument?.value?.mimeType?.startsWith('image')) {\n return `<a href=\"${url}\" rel=\"noopener noreferrer\">${uploadDocument.value?.filename}</a>`\n }\n\n /**\n * If the upload is a simple image with no different sizes, return a simple img tag\n */\n if (\n !uploadDocument?.value?.sizes ||\n !Object.keys(uploadDocument?.value?.sizes).length\n ) {\n return `<img src=\"${url}\" alt=\"${alt}\" width=\"${uploadDocument?.value?.width}\" height=\"${uploadDocument?.value?.height}\"/>`\n }\n\n /**\n * If the upload is an image with different sizes, return a picture element\n */\n let pictureHTML = '<picture>'\n\n // Iterate through each size in the data.sizes object\n for (const size in uploadDocument.value?.sizes) {\n const imageSize = uploadDocument.value.sizes[size] as FileSizeImproved\n\n // Skip if any property of the size object is null\n if (\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n const imageSizeURL = getAbsoluteURL(imageSize?.url, req?.payload)\n\n pictureHTML += `<source srcset=\"${imageSizeURL}\" media=\"(max-width: ${imageSize.width}px)\" type=\"${imageSize.mimeType}\">`\n }\n\n // Add the default img tag\n pictureHTML += `<img src=\"${url}\" alt=\"${alt}\" width=\"${uploadDocument.value?.width}\" height=\"${uploadDocument.value?.height}\">`\n pictureHTML += '</picture>'\n return pictureHTML\n } else {\n return `<img src=\"${id}\" />`\n }\n },\n nodeTypes: [UploadServerNode.getType()],\n },\n },\n getSubFields: ({ node, req }) => {\n if (!node) {\n let allSubFields: Field[] = []\n for (const collection in props?.collections) {\n const collectionFields = props.collections[collection]!.fields\n allSubFields = allSubFields.concat(collectionFields)\n }\n return allSubFields\n }\n const collection = req ? req.payload.collections[node?.relationTo] : null\n\n if (collection) {\n const collectionFieldSchema = props?.collections?.[node?.relationTo]?.fields\n\n if (Array.isArray(collectionFieldSchema)) {\n if (!collectionFieldSchema?.length) {\n return null\n }\n return collectionFieldSchema\n }\n }\n return null\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [uploadPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populateArg,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n // @ts-expect-error - Fix in Payload v4\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n select:\n populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n node: UploadServerNode,\n validations: [uploadValidation(props)],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'upload',\n})\n"],"mappings":"AAWA,SAASA,cAAc,QAAQ;AAI/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,IAAI,QAAQ;AACrB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AAuCjC;;;AAGA,SAASC,eAAeC,GAAW,EAAEC,OAAgB;EACnD,OAAOD,GAAA,EAAKE,UAAA,CAAW,UAAUF,GAAA,GAAM,CAACC,OAAA,EAASE,MAAA,EAAQC,SAAA,IAAa,EAAC,IAAKJ,GAAA;AAC9E;AAEA,OAAO,MAAMK,aAAA,GAAgBb,mBAAA,CAI3B;EACAc,OAAA,EAAS,MAAAA,CAAO;IAAEH,MAAA,EAAQI,OAAO;IAAEC,MAAM;IAAEC,iBAAiB;IAAEC;EAAK,CAAE;IACnE,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ;QAAEC,WAAA,EAAa,CAAC;MAAE;IAC5B;IAEA,MAAMC,WAAA,GAAwC;MAC5CD,WAAA,EAAa,CAAC;IAChB;IACA,IAAID,KAAA,CAAMG,mBAAmB,EAAE;MAC7BD,WAAA,CAAYC,mBAAmB,GAAGH,KAAA,CAAMG,mBAAmB;IAC7D;IACA,IAAIH,KAAA,CAAMI,kBAAkB,EA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,IAAI,CAAChC,UAAA,EAAY;cACf,OAAOwB,IAAA;YACT;YACA;YACA,MAAMI,EAAA,GAAKJ,IAAA,EAAMK,KAAA,EAAOD,EAAA,IAAMJ,IAAA,EAAMK,KAAA,CAAM;AAAA;YAE1C,MAAMqC,aAAA,GACJvE,KAAA,EAAOwE,QAAA,KAAaC,SAAA,IAAazE,KAAA,EAAOwE,QAAA,GAAW7C,KAAA,GAAQ3B,KAAA,EAAOwE,QAAA,GAAW7C,KAAA;YAE/E2C,kBAAA,CAAmBI,IAAI,CACrB7F,QAAA,CAAS;cACPoD,EAAA;cACAG,cAAA,EAAgB/B,UAAA,CAAWZ,MAAM,CAACmB,IAAI;cACtCc,YAAA;cACAY,IAAA,EAAMT,IAAA;cACNF,KAAA,EAAO4C,aAAA;cACP3C,KAAA;cACAW,GAAA,EAAK;cACLT,cAAA;cACAC,GAAA;cACA4C,MAAA,EACEN,WAAA,GAAchE,UAAA,CAAWZ,MAAM,CAACmB,IAAI,CAAC,IAAIP,UAAA,CAAWZ,MAAM,CAACmF,eAAe;cAC5E5C;YACF;YAGF,OAAOH,IAAA;UACT;QAEJ;QACAA,IAAA,EAAM1C,gBAAA;QACN0F,WAAA,EAAa,CAACzF,gBAAA,CAAiBY,KAAA;MACjC,GACD;MACD8E,2BAAA,EAA6B9E;IAC/B;EACF;EACAuC,GAAA,EAAK;AACP","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["sanitizeFields","populate","createServerFeature","createNode","uploadPopulationPromiseHOC","i18n","UploadMarkdownTransformer","UploadServerNode","uploadValidation","UploadFeature","feature","config","_config","isRoot","parentIsLocalized","props","collections","clientProps","disabledCollections","enabledCollections","collection","hasExtraFields","fields","length","validRelationships","map","c","slug","collectionKey","requireFieldLevelRichTextEditor","ClientFeature","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","markdownTransformers","nodes","getSubFields","node","req","allSubFields","collectionFields","concat","payload","relationTo","collectionFieldSchema","Array","isArray","getSubFieldsData","graphQLPopulationPromises","hooks","afterRead","currentDepth","depth","draft","overrideAccess","populateArg","populationPromises","showHiddenFields","value","id","populateDepth","maxDepth","undefined","push","collectionSlug","data","key","select","defaultPopulate","validations","sanitizedServerFeatureProps"],"sources":["../../../../src/features/upload/server/index.ts"],"sourcesContent":["import type { Config, Field, FieldSchemaMap, UploadCollectionSlug } from 'payload'\n\nimport { sanitizeFields } from 'payload'\n\nimport type { UploadFeaturePropsClient } from '../client/index.js'\n\nimport { populate } from '../../../populateGraphQL/populate.js'\nimport { createServerFeature } from '../../../utilities/createServerFeature.js'\nimport { createNode } from '../../typeUtilities.js'\nimport { uploadPopulationPromiseHOC } from './graphQLPopulationPromise.js'\nimport { i18n } from './i18n.js'\nimport { UploadMarkdownTransformer } from './markdownTransformer.js'\nimport { UploadServerNode } from './nodes/UploadNode.js'\nimport { uploadValidation } from './validate.js'\n\nexport type ExclusiveUploadFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: UploadCollectionSlug[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: UploadCollectionSlug[]\n }\n\nexport type UploadFeatureProps = {\n collections?: {\n [collection: UploadCollectionSlug]: {\n fields: Field[]\n }\n }\n /**\n * Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n} & ExclusiveUploadFeatureProps\n\nexport const UploadFeature = createServerFeature<\n UploadFeatureProps,\n UploadFeatureProps,\n UploadFeaturePropsClient\n>({\n feature: async ({ config: _config, isRoot, parentIsLocalized, props }) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = {\n collections: {},\n }\n if (props.disabledCollections) {\n clientProps.disabledCollections = props.disabledCollections\n }\n if (props.enabledCollections) {\n clientProps.enabledCollections = props.enabledCollections\n }\n\n if (props.collections) {\n for (const collection in props.collections) {\n clientProps.collections[collection] = {\n hasExtraFields: props.collections[collection]!.fields.length >= 1,\n }\n }\n }\n\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const collectionKey in props.collections) {\n const collection = props.collections[collectionKey]!\n if (collection.fields?.length) {\n collection.fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: collection.fields,\n parentIsLocalized,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n return {\n ClientFeature: '@payloadcms/richtext-lexical/client#UploadFeatureClient',\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ props }) => {\n if (!props?.collections) {\n return null\n }\n\n const schemaMap: FieldSchemaMap = new Map()\n\n for (const collectionKey in props.collections) {\n const collection = props.collections[collectionKey]!\n if (collection.fields?.length) {\n schemaMap.set(collectionKey, {\n fields: collection.fields,\n })\n }\n }\n\n return schemaMap\n },\n i18n,\n markdownTransformers: [UploadMarkdownTransformer],\n nodes: [\n createNode({\n getSubFields: ({ node, req }) => {\n if (!node) {\n let allSubFields: Field[] = []\n for (const collection in props?.collections) {\n const collectionFields = props.collections[collection]!.fields\n allSubFields = allSubFields.concat(collectionFields)\n }\n return allSubFields\n }\n const collection = req ? req.payload.collections[node?.relationTo] : null\n\n if (collection) {\n const collectionFieldSchema = props?.collections?.[node?.relationTo]?.fields\n\n if (Array.isArray(collectionFieldSchema)) {\n if (!collectionFieldSchema?.length) {\n return null\n }\n return collectionFieldSchema\n }\n }\n return null\n },\n getSubFieldsData: ({ node }) => {\n return node?.fields\n },\n graphQLPopulationPromises: [uploadPopulationPromiseHOC(props)],\n hooks: {\n afterRead: [\n ({\n currentDepth,\n depth,\n draft,\n node,\n overrideAccess,\n populateArg,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (!node?.value) {\n return node\n }\n const collection = req.payload.collections[node?.relationTo]\n\n if (!collection) {\n return node\n }\n // @ts-expect-error - Fix in Payload v4\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collectionSlug: collection.config.slug,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n key: 'value',\n overrideAccess,\n req,\n select:\n populateArg?.[collection.config.slug] ?? collection.config.defaultPopulate,\n showHiddenFields,\n }),\n )\n\n return node\n },\n ],\n },\n node: UploadServerNode,\n validations: [uploadValidation(props)],\n }),\n ],\n sanitizedServerFeatureProps: props,\n }\n },\n key: 'upload',\n})\n"],"mappings":"AAEA,SAASA,cAAc,QAAQ;AAI/B,SAASC,QAAQ,QAAQ;AACzB,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAC3B,SAASC,0BAA0B,QAAQ;AAC3C,SAASC,IAAI,QAAQ;AACrB,SAASC,yBAAyB,QAAQ;AAC1C,SAASC,gBAAgB,QAAQ;AACjC,SAASC,gBAAgB,QAAQ;AAuCjC,OAAO,MAAMC,aAAA,GAAgBP,mBAAA,CAI3B;EACAQ,OAAA,EAAS,MAAAA,CAAO;IAAEC,MAAA,EAAQC,OAAO;IAAEC,MAAM;IAAEC,iBAAiB;IAAEC;EAAK,CAAE;IACnE,IAAI,CAACA,KAAA,EAAO;MACVA,KAAA,GAAQ;QAAEC,WAAA,EAAa,CAAC;MAAE;IAC5B;IAEA,MAAMC,WAAA,GAAwC;MAC5CD,WAAA,EAAa,CAAC;IAChB;IACA,IAAID,KAAA,CAAMG,mBAAmB,EAAE;MAC7BD,WAAA,CAAYC,mBAAmB,GAAGH,KAAA,CAAMG,mBAAmB;IAC7D;IACA,IAAIH,KAAA,CAAMI,kBAAkB,EA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AgB,CACjB;YACC,IAAI,CAACpB,IAAA,EAAMqB,KAAA,EAAO;cAChB,OAAOrB,IAAA;YACT;YACA,MAAMnB,UAAA,GAAaoB,GAAA,CAAII,OAAO,CAAC5B,WAAW,CAACuB,IAAA,EAAMM,UAAA,CAAW;YAE5D,IAAI,CAACzB,UAAA,EAAY;cACf,OAAOmB,IAAA;YACT;YACA;YACA,MAAMsB,EAAA,GAAKtB,IAAA,EAAMqB,KAAA,EAAOC,EAAA,IAAMtB,IAAA,EAAMqB,KAAA,CAAM;AAAA;YAE1C,MAAME,aAAA,GACJ/C,KAAA,EAAOgD,QAAA,KAAaC,SAAA,IAAajD,KAAA,EAAOgD,QAAA,GAAWT,KAAA,GAAQvC,KAAA,EAAOgD,QAAA,GAAWT,KAAA;YAE/EI,kBAAA,CAAmBO,IAAI,CACrBhE,QAAA,CAAS;cACP4D,EAAA;cACAK,cAAA,EAAgB9C,UAAA,CAAWT,MAAM,CAACgB,IAAI;cACtC0B,YAAA;cACAc,IAAA,EAAM5B,IAAA;cACNe,KAAA,EAAOQ,aAAA;cACPP,KAAA;cACAa,GAAA,EAAK;cACLZ,cAAA;cACAhB,GAAA;cACA6B,MAAA,EACEZ,WAAA,GAAcrC,UAAA,CAAWT,MAAM,CAACgB,IAAI,CAAC,IAAIP,UAAA,CAAWT,MAAM,CAAC2D,eAAe;cAC5EX;YACF;YAGF,OAAOpB,IAAA;UACT;QAEJ;QACAA,IAAA,EAAMhC,gBAAA;QACNgE,WAAA,EAAa,CAAC/D,gBAAA,CAAiBO,KAAA;MACjC,GACD;MACDyD,2BAAA,EAA6BzD;IAC/B;EACF;EACAqD,GAAA,EAAK;AACP","ignoreList":[]}
@@ -3,7 +3,7 @@ import type { DOMConversionMap, DOMExportOutput, EditorConfig, ElementFormatType
3
3
  import type { CollectionSlug, DataFromCollectionSlug, JsonObject, TypedUploadCollection, UploadCollectionSlug } from 'payload';
4
4
  import type { JSX } from 'react';
5
5
  import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
6
- import type { StronglyTypedLeafNode } from '../../../../nodeTypes.js';
6
+ import type { StronglyTypedLeafNode } from '../../../../types/nodeTypes.js';
7
7
  export type UploadData<TUploadExtraFieldsData extends JsonObject = JsonObject> = {
8
8
  [TCollectionSlug in CollectionSlug]: {
9
9
  fields: TUploadExtraFieldsData;
@@ -1 +1 @@
1
- {"version":3,"file":"UploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/server/nodes/UploadNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,OAAO,EACR,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAKhF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,0BAA0B,CAAA;AAIrE,MAAM,MAAM,UAAU,CAAC,sBAAsB,SAAS,UAAU,GAAG,UAAU,IAAI;KAC9E,eAAe,IAAI,cAAc,GAAG;QACnC,MAAM,EAAE,sBAAsB,CAAA;QAC9B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAA;QACV,UAAU,EAAE,eAAe,CAAA;QAC3B;;WAEG;QACH,KAAK,EAAE,sBAAsB,CAAC,eAAe,CAAC,GAAG,MAAM,GAAG,MAAM,CAAA;KACjE;CACF,CAAC,cAAc,CAAC,CAAA;AAEjB;;;GAGG;AACH,MAAM,MAAM,mBAAmB,CAAC,sBAAsB,SAAS,UAAU,GAAG,UAAU,IAAI;IACxF,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,MA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AAI;IAKtB,SAAS,IAAI,KAAK;CAG5B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAA;CAC/D,GAAG,gBAAgB,CAKnB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,gBAAgB,CAE1B"}
1
+ {"version":3,"file":"UploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/server/nodes/UploadNode.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EACV,gBAAgB,EAChB,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,WAAW,EACX,OAAO,EACR,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EACV,cAAc,EACd,sBAAsB,EACtB,UAAU,EACV,qBAAqB,EACrB,oBAAoB,EACrB,MAAM,SAAS,CAAA;AAChB,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,OAAO,CAAA;AAEhC,OAAO,EAAE,kBAAkB,EAAE,MAAM,6CAA6C,CAAA;AAKhF,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,gCAAgC,CAAA;AAI3E,MAAM,MAAM,UAAU,CAAC,sBAAsB,SAAS,UAAU,GAAG,UAAU,IAAI;KAC9E,eAAe,IAAI,cAAc,GAAG;QACnC,MAAM,EAAE,sBAAsB,CAAA;QAC9B;;WAEG;QACH,EAAE,EAAE,MAAM,CAAA;QACV,UAAU,EAAE,eAAe,CAAA;QAC3B;;WAEG;QACH,KAAK,EAAE,sBAAsB,CAAC,eAAe,CAAC,GAAG,MAAM,GAAG,MAAM,CAAA;KACjE;CACF,CAAC,cAAc,CAAC,CAAA;AAEjB;;;GAGG;AACH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IAAI,eAAe;IAc5B,UAAU,IAAI,oBAAoB;IAS3C,OAAO,IAAI,UAAU;IAIrB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAKtB,SAAS,IAAI,KAAK;CAG5B;AAED,wBAAgB,uBAAuB,CAAC,EACtC,IAAI,GACL,EAAE;IACD,IAAI,EAAE,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC,CAAA;CAC/D,GAAG,gBAAgB,CAKnB;AAED,wBAAgB,mBAAmB,CACjC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GACnC,IAAI,IAAI,gBAAgB,CAE1B"}
@@ -1 +1 @@
1
- {"version":3,"file":"UploadNode.js","names":["DecoratorBlockNode","addClassNamesToElement","ObjectID","$applyNodeReplacement","$convertUploadElement","UploadServerNode","__data","constructor","data","format","key","clone","node","__format","__key","getType","importDOM","img","conversion","domNode","$createUploadServerNode","priority","importJSON","serializedNode","version","value","id","default","toHexString","importedData","fields","pending","relationTo","setFormat","isInline","createDOM","config","element","document","createElement","theme","upload","decorate","exportDOM","setAttribute","String","formID","src","exportJSON","getData","type","getLatest","setData","writable","getWritable","updateDOM","$isUploadServerNode"],"sources":["../../../../../src/features/upload/server/nodes/UploadNode.tsx"],"sourcesContent":["import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n} from 'lexical'\nimport type {\n CollectionSlug,\n DataFromCollectionSlug,\n JsonObject,\n TypedUploadCollection,\n UploadCollectionSlug,\n} from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { addClassNamesToElement } from '@lexical/utils'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\n\nimport type { StronglyTypedLeafNode } from '../../../../nodeTypes.js'\n\nimport { $convertUploadElement } from './conversions.js'\n\nexport type UploadData<TUploadExtraFieldsData extends JsonObject = JsonObject> = {\n [TCollectionSlug in CollectionSlug]: {\n fields: TUploadExtraFieldsData\n /**\n * Every lexical node that has sub-fields needs to have a unique ID. This is the ID of this upload node, not the ID of the linked upload document\n */\n id: string\n relationTo: TCollectionSlug\n /**\n * Value can be just the document ID, or the full, populated document\n */\n value: DataFromCollectionSlug<TCollectionSlug> | number | string\n }\n}[CollectionSlug]\n\n/**\n * Internal use only - UploadData type that can contain a pending state\n * @internal\n */\nexport type Internal_UploadData<TUploadExtraFieldsData extends JsonObject = JsonObject> = {\n pending?: {\n /**\n * ID that corresponds to the bulk upload form ID\n */\n formID: string\n /**\n * src value of the image dom element\n */\n src: string\n }\n} & UploadData<TUploadExtraFieldsData>\n\n/**\n * UploadDataImproved is a more precise type, and will replace UploadData in Payload v4.\n * This type is for internal use only as it will be deprecated in the future.\n * @internal\n *\n * @todo Replace UploadData with UploadDataImproved in 4.0\n */\nexport type UploadDataImproved<TUploadExtraFieldsData extends JsonObject = JsonObject> = {\n [TCollectionSlug in UploadCollectionSlug]: {\n fields: TUploadExtraFieldsData\n /**\n * Every lexical node that has sub-fields needs to have a unique ID. This is the ID of this upload node, not the ID of the linked upload document\n */\n id: string\n relationTo: TCollectionSlug\n /**\n * Value can be just the document ID, or the full, populated document\n */\n value: number | string | TypedUploadCollection[TCollectionSlug]\n }\n}[UploadCollectionSlug]\n\nexport type SerializedUploadNode = StronglyTypedLeafNode<SerializedDecoratorBlockNode, 'upload'> &\n UploadData\n\nexport class UploadServerNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static override clone(node: UploadServerNode): UploadServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'upload'\n }\n\n static override importDOM(): DOMConversionMap<HTMLImageElement> {\n return {\n img: (node) => ({\n conversion: (domNode) => $convertUploadElement(domNode, $createUploadServerNode),\n priority: 0,\n }),\n }\n }\n\n static override importJSON(serializedNode: SerializedUploadNode): UploadServerNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: Internal_UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n pending: (serializedNode as Internal_UploadData).pending,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadServerNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('div')\n addClassNamesToElement(element, config?.theme?.upload)\n return element\n }\n\n override decorate(): JSX.Element {\n return null as unknown as JSX.Element\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n const data = this.__data as Internal_UploadData\n if (data.pending) {\n element.setAttribute('data-lexical-pending-upload-form-id', String(data?.pending?.formID))\n element.setAttribute('src', data?.pending?.src || '')\n } else {\n element.setAttribute('data-lexical-upload-id', String(data?.value))\n element.setAttribute('data-lexical-upload-relation-to', data?.relationTo)\n }\n\n return { element }\n }\n\n override exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'upload',\n version: 3,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n override updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadServerNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadServerNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadServerNode({ data: data as UploadData }))\n}\n\nexport function $isUploadServerNode(\n node: LexicalNode | null | undefined,\n): node is UploadServerNode {\n return node instanceof UploadServerNode\n}\n"],"mappings":"AAkBA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,sBAAsB,QAAQ;AACvC,OAAOC,QAAA,MAAc;AACrB,SAASC,qBAAqB,QAAQ;AAItC,SAASC,qBAAqB,QAAQ;AA2DtC,OAAO,MAAMC,gBAAA,SAAyBL,kBAAA;EACpCM,MAAA;EAEAC,YAAY;IACVC,IAAI;IACJC,MAAM;IACNC;EAAG,CAKJ,EAAE;IACD,KAAK,CAACD,MAAA,EAAQC,GAAA;IACd,IAAI,CAACJ,MAAM,GAAGE,IAAA;EAChB;EAEA,OAAgBG,MAAMC,IAAsB,EAAoB;IAC9D,OAAO,IAAI,IAAI,CAAC;MACdJ,IAAA,EAAMI,IAAA,CAAKN,MAAM;MACjBG,MAAA,EAAQG,IAAA,CAAKC,QAAQ;MACrBH,GAAA,EAAKE,IAAA,CAAKE;IACZ;EACF;EAEA,OAAgBC,QAAA,EAAkB;IAChC,OAAO;EACT;EAEA,OAAgBC,UAAA,EAAgD;IAC9D,OAAO;MACLC,GAAA,EAAML,IAAA,KAAU;QACdM,UAAA,EAAaC,OAAA,IAAYf,qBAAA,CAAsBe,OAAA,EAASC,uBAAA;QACxDC,QAAA,EAAU;MACZ;IACF;EACF;EAEA,OAAgBC,WAAWC,cAAoC,EAAoB;IACjF,IAAIA,cAAA,CAAeC,OAAO,KAAK,KAAMD,cAAA,EAAgBE,KAAA,EAAqCC,EAAA,EAAI;MAC5FH,cAAA,CAAeE,KAAK,GAAGF,cAAC,CAAeE,KAAK,CAA+BC,EAAE;IAC/E;IACA,IAAIH,cAAA,CAAeC,OAAO,KAAK,KAAK,CAACD,cAAA,EAAgBG,EAAA,EAAI;MACvDH,cAAA,CAAeG,EAAE,GAAG,IAAIxB,QAAA,CAASyB,OAA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AO;MACL,GAAG,KAAK,CAACA,UAAA,EAAY;MACrB,GAAG,IAAI,CAACC,OAAO,EAAE;MACjBC,IAAA,EAAM;MACN1B,OAAA,EAAS;IACX;EACF;EAEAyB,QAAA,EAAsB;IACpB,OAAO,IAAI,CAACE,SAAS,GAAG7C,MAAM;EAChC;EAEA8C,QAAQ5C,IAAgB,EAAQ;IAC9B,MAAM6C,QAAA,GAAW,IAAI,CAACC,WAAW;IACjCD,QAAA,CAAS/C,MAAM,GAAGE,IAAA;EACpB;EAES+C,UAAA,EAAmB;IAC1B,OAAO;EACT;AACF;AAEA,OAAO,SAASnC,wBAAwB;EACtCZ;AAAI,CAGL;EACC,IAAI,CAACA,IAAA,EAAMkB,EAAA,EAAI;IACblB,IAAA,CAAKkB,EAAE,GAAG,IAAIxB,QAAA,CAASyB,OAAO,GAAGC,WAAW;EAC9C;EACA,OAAOzB,qBAAA,CAAsB,IAAIE,gBAAA,CAAiB;IAAEG,IAAA,EAAMA;EAAmB;AAC/E;AAEA,OAAO,SAASgD,oBACd5C,IAAoC;EAEpC,OAAOA,IAAA,YAAgBP,gBAAA;AACzB","ignoreList":[]}
1
+ {"version":3,"file":"UploadNode.js","names":["DecoratorBlockNode","addClassNamesToElement","ObjectID","$applyNodeReplacement","$convertUploadElement","UploadServerNode","__data","constructor","data","format","key","clone","node","__format","__key","getType","importDOM","img","conversion","domNode","$createUploadServerNode","priority","importJSON","serializedNode","version","value","id","default","toHexString","importedData","fields","pending","relationTo","setFormat","isInline","createDOM","config","element","document","createElement","theme","upload","decorate","exportDOM","setAttribute","String","formID","src","exportJSON","getData","type","getLatest","setData","writable","getWritable","updateDOM","$isUploadServerNode"],"sources":["../../../../../src/features/upload/server/nodes/UploadNode.tsx"],"sourcesContent":["import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type {\n DOMConversionMap,\n DOMExportOutput,\n EditorConfig,\n ElementFormatType,\n LexicalNode,\n NodeKey,\n} from 'lexical'\nimport type {\n CollectionSlug,\n DataFromCollectionSlug,\n JsonObject,\n TypedUploadCollection,\n UploadCollectionSlug,\n} from 'payload'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { addClassNamesToElement } from '@lexical/utils'\nimport ObjectID from 'bson-objectid'\nimport { $applyNodeReplacement } from 'lexical'\n\nimport type { StronglyTypedLeafNode } from '../../../../types/nodeTypes.js'\n\nimport { $convertUploadElement } from './conversions.js'\n\nexport type UploadData<TUploadExtraFieldsData extends JsonObject = JsonObject> = {\n [TCollectionSlug in CollectionSlug]: {\n fields: TUploadExtraFieldsData\n /**\n * Every lexical node that has sub-fields needs to have a unique ID. This is the ID of this upload node, not the ID of the linked upload document\n */\n id: string\n relationTo: TCollectionSlug\n /**\n * Value can be just the document ID, or the full, populated document\n */\n value: DataFromCollectionSlug<TCollectionSlug> | number | string\n }\n}[CollectionSlug]\n\n/**\n * Internal use only - UploadData type that can contain a pending state\n * @internal\n */\nexport type Internal_UploadData<TUploadExtraFieldsData extends JsonObject = JsonObject> = {\n pending?: {\n /**\n * ID that corresponds to the bulk upload form ID\n */\n formID: string\n /**\n * src value of the image dom element\n */\n src: string\n }\n} & UploadData<TUploadExtraFieldsData>\n\n/**\n * UploadDataImproved is a more precise type, and will replace UploadData in Payload v4.\n * This type is for internal use only as it will be deprecated in the future.\n * @internal\n *\n * @todo Replace UploadData with UploadDataImproved in 4.0\n */\nexport type UploadDataImproved<TUploadExtraFieldsData extends JsonObject = JsonObject> = {\n [TCollectionSlug in UploadCollectionSlug]: {\n fields: TUploadExtraFieldsData\n /**\n * Every lexical node that has sub-fields needs to have a unique ID. This is the ID of this upload node, not the ID of the linked upload document\n */\n id: string\n relationTo: TCollectionSlug\n /**\n * Value can be just the document ID, or the full, populated document\n */\n value: number | string | TypedUploadCollection[TCollectionSlug]\n }\n}[UploadCollectionSlug]\n\nexport type SerializedUploadNode = StronglyTypedLeafNode<SerializedDecoratorBlockNode, 'upload'> &\n UploadData\n\nexport class UploadServerNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static override clone(node: UploadServerNode): UploadServerNode {\n return new this({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static override getType(): string {\n return 'upload'\n }\n\n static override importDOM(): DOMConversionMap<HTMLImageElement> {\n return {\n img: (node) => ({\n conversion: (domNode) => $convertUploadElement(domNode, $createUploadServerNode),\n priority: 0,\n }),\n }\n }\n\n static override importJSON(serializedNode: SerializedUploadNode): UploadServerNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n if (serializedNode.version === 2 && !serializedNode?.id) {\n serializedNode.id = new ObjectID.default().toHexString()\n serializedNode.version = 3\n }\n\n const importedData: Internal_UploadData = {\n id: serializedNode.id,\n fields: serializedNode.fields,\n pending: (serializedNode as Internal_UploadData).pending,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadServerNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n override createDOM(config?: EditorConfig): HTMLElement {\n const element = document.createElement('div')\n addClassNamesToElement(element, config?.theme?.upload)\n return element\n }\n\n override decorate(): JSX.Element {\n return null as unknown as JSX.Element\n }\n\n override exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n const data = this.__data as Internal_UploadData\n if (data.pending) {\n element.setAttribute('data-lexical-pending-upload-form-id', String(data?.pending?.formID))\n element.setAttribute('src', data?.pending?.src || '')\n } else {\n element.setAttribute('data-lexical-upload-id', String(data?.value))\n element.setAttribute('data-lexical-upload-relation-to', data?.relationTo)\n }\n\n return { element }\n }\n\n override exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: 'upload',\n version: 3,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n override updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadServerNode({\n data,\n}: {\n data: Omit<UploadData, 'id'> & Partial<Pick<UploadData, 'id'>>\n}): UploadServerNode {\n if (!data?.id) {\n data.id = new ObjectID.default().toHexString()\n }\n return $applyNodeReplacement(new UploadServerNode({ data: data as UploadData }))\n}\n\nexport function $isUploadServerNode(\n node: LexicalNode | null | undefined,\n): node is UploadServerNode {\n return node instanceof UploadServerNode\n}\n"],"mappings":"AAkBA,SAASA,kBAAkB,QAAQ;AACnC,SAASC,sBAAsB,QAAQ;AACvC,OAAOC,QAAA,MAAc;AACrB,SAASC,qBAAqB,QAAQ;AAItC,SAASC,qBAAqB,QAAQ;AA2DtC,OAAO,MAAMC,gBAAA,SAAyBL,kBAAA;EACpCM,MAAA;EAEAC,YAAY;IACVC,IAAI;IACJC,MAAM;IACNC;EAAG,CAKJ,EAAE;IACD,KAAK,CAACD,MAAA,EAAQC,GAAA;IACd,IAAI,CAACJ,MAAM,GAAGE,IAAA;EAChB;EAEA,OAAgBG,MAAMC,IAAsB,EAAoB;IAC9D,OAAO,IAAI,IAAI,CAAC;MACdJ,IAAA,EAAMI,IAAA,CAAKN,MAAM;MACjBG,MAAA,EAAQG,IAAA,CAAKC,QAAQ;MACrBH,GAAA,EAAKE,IAAA,CAAKE;IACZ;EACF;EAEA,OAAgBC,QAAA,EAAkB;IAChC,OAAO;EACT;EAEA,OAAgBC,UAAA,EAAgD;IAC9D,OAAO;MACLC,GAAA,EAAML,IAAA,KAAU;QACdM,UAAA,EAAaC,OAAA,IAAYf,qBAAA,CAAsBe,OAAA,EAASC,uBAAA;QACxDC,QAAA,EAAU;MACZ;IACF;EACF;EAEA,OAAgBC,WAAWC,cAAoC,EAAoB;IACjF,IAAIA,cAAA,CAAeC,OAAO,KAAK,KAAMD,cAA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,OAAA,EAASgB,GAAA,IAAO;IACpD,OAAO;MACLV,OAAA,CAAQO,YAAY,CAAC,0BAA0BC,MAAA,CAAOrC,IAAA,EAAMiB,KAAA;MAC5DY,OAAA,CAAQO,YAAY,CAAC,mCAAmCpC,IAAA,EAAMwB,UAAA;IAChE;IAEA,OAAO;MAAEK;IAAQ;EACnB;EAESW,WAAA,EAAmC;IAC1C,OAAO;MACL,GAAG,KAAK,CAACA,UAAA,EAAY;MACrB,GAAG,IAAI,CAACC,OAAO,EAAE;MACjBC,IAAA,EAAM;MACN1B,OAAA,EAAS;IACX;EACF;EAEAyB,QAAA,EAAsB;IACpB,OAAO,IAAI,CAACE,SAAS,GAAG7C,MAAM;EAChC;EAEA8C,QAAQ5C,IAAgB,EAAQ;IAC9B,MAAM6C,QAAA,GAAW,IAAI,CAACC,WAAW;IACjCD,QAAA,CAAS/C,MAAM,GAAGE,IAAA;EACpB;EAES+C,UAAA,EAAmB;IAC1B,OAAO;EACT;AACF;AAEA,OAAO,SAASnC,wBAAwB;EACtCZ;AAAI,CAGL;EACC,IAAI,CAACA,IAAA,EAAMkB,EAAA,EAAI;IACblB,IAAA,CAAKkB,EAAE,GAAG,IAAIxB,QAAA,CAASyB,OAAO,GAAGC,WAAW;EAC9C;EACA,OAAOzB,qBAAA,CAAsB,IAAIE,gBAAA,CAAiB;IAAEG,IAAA,EAAMA;EAAmB;AAC/E;AAEA,OAAO,SAASgD,oBACd5C,IAAoC;EAEpC,OAAOA,IAAA,YAAgBP,gBAAA;AACzB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjE,eAAO,MAAM,gBAAgB,UACpB,kBAAkB,KACxB,cAAc,CAAC,oBAAoB,CAqErC,CAAA"}
1
+ {"version":3,"file":"validate.d.ts","sourceRoot":"","sources":["../../../../src/features/upload/server/validate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAA;AAC1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAEjE,eAAO,MAAM,gBAAgB,GAC3B,OAAO,kBAAkB,KACxB,cAAc,CAAC,oBAAoB,CAqErC,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import type { HTMLConvertersAsync, HTMLPopulateFn } from '../../../features/converters/lexicalToHtml/async/types.js';
2
- import type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../nodeTypes.js';
2
+ import type { SerializedAutoLinkNode, SerializedLinkNode } from '../../../types/nodeTypes.js';
3
3
  export declare const LinkDiffHTMLConverterAsync: (args: {
4
4
  internalDocToHref?: (args: {
5
5
  linkNode: SerializedLinkNode;
@@ -1 +1 @@
1
- {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/field/Diff/converters/link.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2DAA2D,CAAA;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAEvF,eAAO,MAAM,0BAA0B,EAAE,CAAC,IAAI,EAAE;IAC9C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,kBAAkB,CAAA;QAC5B,QAAQ,CAAC,EAAE,cAAc,CAAA;KAC1B,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;CAC/B,KAAK,mBAAmB,CAAC,sBAAsB,GAAG,kBAAkB,CAkDnE,CAAA"}
1
+ {"version":3,"file":"link.d.ts","sourceRoot":"","sources":["../../../../src/field/Diff/converters/link.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,mBAAmB,EACnB,cAAc,EACf,MAAM,2DAA2D,CAAA;AAClE,OAAO,KAAK,EAAE,sBAAsB,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAA;AAE7F,eAAO,MAAM,0BAA0B,EAAE,CAAC,IAAI,EAAE;IAC9C,iBAAiB,CAAC,EAAE,CAAC,IAAI,EAAE;QACzB,QAAQ,EAAE,kBAAkB,CAAA;QAC5B,QAAQ,CAAC,EAAE,cAAc,CAAA;KAC1B,KAAK,OAAO,CAAC,MAAM,CAAC,GAAG,MAAM,CAAA;CAC/B,KAAK,mBAAmB,CAAC,sBAAsB,GAAG,kBAAkB,CAkDnE,CAAA"}