@payloadcms/richtext-lexical 3.0.0-canary.b8dd0db → 3.0.0-canary.bb00d64

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 (512) hide show
  1. package/dist/cell/rscEntry.d.ts +12 -0
  2. package/dist/cell/rscEntry.d.ts.map +1 -0
  3. package/dist/cell/rscEntry.js +82 -0
  4. package/dist/cell/rscEntry.js.map +1 -0
  5. package/dist/exports/client/Field-LKCJPU2R.js +2 -0
  6. package/dist/exports/client/Field-LKCJPU2R.js.map +7 -0
  7. package/dist/exports/client/RelationshipComponent-IMM4CFBE.js +2 -0
  8. package/dist/exports/client/RelationshipComponent-IMM4CFBE.js.map +7 -0
  9. package/dist/exports/client/bundled.css +1 -1
  10. package/dist/exports/client/chunk-5PBXL4HT.js +2 -0
  11. package/dist/exports/client/chunk-5PBXL4HT.js.map +7 -0
  12. package/dist/exports/client/chunk-NNE6RSU5.js +2 -0
  13. package/dist/exports/client/chunk-NNE6RSU5.js.map +7 -0
  14. package/dist/exports/client/{chunk-LGUXX2QH.js → chunk-O4IOO4EU.js} +2 -2
  15. package/dist/exports/client/{chunk-LGUXX2QH.js.map → chunk-O4IOO4EU.js.map} +2 -2
  16. package/dist/exports/client/chunk-PDAZFJVO.js +2 -0
  17. package/dist/exports/client/chunk-PDAZFJVO.js.map +7 -0
  18. package/dist/exports/client/chunk-PSABE6CO.js +2 -0
  19. package/dist/exports/client/chunk-PSABE6CO.js.map +7 -0
  20. package/dist/exports/client/{chunk-V2LKLT2F.js → chunk-XCEM47RI.js} +3 -3
  21. package/dist/exports/client/{chunk-V2LKLT2F.js.map → chunk-XCEM47RI.js.map} +3 -3
  22. package/dist/exports/client/chunk-ZFVIUTHB.js +2 -0
  23. package/dist/exports/client/chunk-ZFVIUTHB.js.map +7 -0
  24. package/dist/exports/client/{chunk-OKMIHD2R.js → chunk-ZOYGBIAN.js} +2 -2
  25. package/dist/exports/client/{chunk-OKMIHD2R.js.map → chunk-ZOYGBIAN.js.map} +2 -2
  26. package/dist/exports/client/component-4OBXHYCD.js +2 -0
  27. package/dist/exports/client/component-4OBXHYCD.js.map +7 -0
  28. package/dist/exports/client/component-ANB7VZLA.js +2 -0
  29. package/dist/exports/client/component-ANB7VZLA.js.map +7 -0
  30. package/dist/exports/client/component-P25AKAUU.js +2 -0
  31. package/dist/exports/client/component-P25AKAUU.js.map +7 -0
  32. package/dist/exports/client/componentInline-N5LJ2LY2.js +2 -0
  33. package/dist/exports/client/componentInline-N5LJ2LY2.js.map +7 -0
  34. package/dist/exports/client/index.d.ts +3 -4
  35. package/dist/exports/client/index.d.ts.map +1 -1
  36. package/dist/exports/client/index.js +7 -7
  37. package/dist/exports/client/index.js.map +4 -4
  38. package/dist/exports/server/rsc.d.ts +3 -0
  39. package/dist/exports/server/rsc.d.ts.map +1 -0
  40. package/dist/exports/server/rsc.js +3 -0
  41. package/dist/exports/server/rsc.js.map +1 -0
  42. package/dist/features/align/client/index.d.ts +1 -4
  43. package/dist/features/align/client/index.d.ts.map +1 -1
  44. package/dist/features/blockquote/client/index.d.ts +1 -4
  45. package/dist/features/blockquote/client/index.d.ts.map +1 -1
  46. package/dist/features/blockquote/markdownTransformer.js.map +1 -1
  47. package/dist/features/blockquote/server/index.d.ts +1 -1
  48. package/dist/features/blockquote/server/index.d.ts.map +1 -1
  49. package/dist/features/blockquote/server/index.js +5 -1
  50. package/dist/features/blockquote/server/index.js.map +1 -1
  51. package/dist/features/blocks/client/component/BlockContent.d.ts +1 -0
  52. package/dist/features/blocks/client/component/BlockContent.d.ts.map +1 -1
  53. package/dist/features/blocks/client/component/BlockContent.js +28 -28
  54. package/dist/features/blocks/client/component/BlockContent.js.map +1 -1
  55. package/dist/features/blocks/client/component/index.d.ts +1 -1
  56. package/dist/features/blocks/client/component/index.d.ts.map +1 -1
  57. package/dist/features/blocks/client/component/index.js +94 -55
  58. package/dist/features/blocks/client/component/index.js.map +1 -1
  59. package/dist/features/blocks/client/componentInline/index.d.ts +1 -1
  60. package/dist/features/blocks/client/componentInline/index.d.ts.map +1 -1
  61. package/dist/features/blocks/client/componentInline/index.js +27 -29
  62. package/dist/features/blocks/client/componentInline/index.js.map +1 -1
  63. package/dist/features/blocks/client/index.d.ts +1 -4
  64. package/dist/features/blocks/client/index.d.ts.map +1 -1
  65. package/dist/features/blocks/client/index.js +35 -23
  66. package/dist/features/blocks/client/index.js.map +1 -1
  67. package/dist/features/blocks/client/nodes/BlocksNode.d.ts +2 -2
  68. package/dist/features/blocks/client/nodes/BlocksNode.d.ts.map +1 -1
  69. package/dist/features/blocks/client/nodes/BlocksNode.js.map +1 -1
  70. package/dist/features/blocks/client/plugin/index.d.ts +2 -2
  71. package/dist/features/blocks/client/plugin/index.d.ts.map +1 -1
  72. package/dist/features/blocks/client/plugin/index.js +96 -93
  73. package/dist/features/blocks/client/plugin/index.js.map +1 -1
  74. package/dist/features/blocks/server/index.d.ts.map +1 -1
  75. package/dist/features/blocks/server/index.js +41 -27
  76. package/dist/features/blocks/server/index.js.map +1 -1
  77. package/dist/features/blocks/server/nodes/BlocksNode.d.ts +11 -5
  78. package/dist/features/blocks/server/nodes/BlocksNode.d.ts.map +1 -1
  79. package/dist/features/blocks/server/nodes/BlocksNode.js.map +1 -1
  80. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts +3 -3
  81. package/dist/features/blocks/server/nodes/InlineBlocksNode.d.ts.map +1 -1
  82. package/dist/features/blocks/server/nodes/InlineBlocksNode.js.map +1 -1
  83. package/dist/features/blocks/server/validate.d.ts.map +1 -1
  84. package/dist/features/blocks/server/validate.js +8 -5
  85. package/dist/features/blocks/server/validate.js.map +1 -1
  86. package/dist/features/converters/html/converter/converters/paragraph.d.ts.map +1 -1
  87. package/dist/features/converters/html/converter/converters/paragraph.js +4 -0
  88. package/dist/features/converters/html/converter/converters/paragraph.js.map +1 -1
  89. package/dist/features/converters/html/converter/converters/text.d.ts.map +1 -1
  90. package/dist/features/converters/html/converter/converters/text.js +2 -1
  91. package/dist/features/converters/html/converter/converters/text.js.map +1 -1
  92. package/dist/features/converters/html/converter/index.d.ts +11 -7
  93. package/dist/features/converters/html/converter/index.d.ts.map +1 -1
  94. package/dist/features/converters/html/converter/index.js +17 -1
  95. package/dist/features/converters/html/converter/index.js.map +1 -1
  96. package/dist/features/converters/html/converter/types.d.ts +3 -1
  97. package/dist/features/converters/html/converter/types.d.ts.map +1 -1
  98. package/dist/features/converters/html/converter/types.js.map +1 -1
  99. package/dist/features/converters/html/field/index.d.ts.map +1 -1
  100. package/dist/features/converters/html/field/index.js +7 -1
  101. package/dist/features/converters/html/field/index.js.map +1 -1
  102. package/dist/features/debug/testRecorder/client/index.d.ts +1 -4
  103. package/dist/features/debug/testRecorder/client/index.d.ts.map +1 -1
  104. package/dist/features/debug/testRecorder/client/plugin/index.js +180 -345
  105. package/dist/features/debug/testRecorder/client/plugin/index.js.map +1 -1
  106. package/dist/features/debug/treeView/client/index.d.ts +1 -4
  107. package/dist/features/debug/treeView/client/index.d.ts.map +1 -1
  108. package/dist/features/experimental_table/client/index.d.ts +1 -1
  109. package/dist/features/experimental_table/client/index.d.ts.map +1 -1
  110. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.d.ts.map +1 -1
  111. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js +250 -488
  112. package/dist/features/experimental_table/client/plugins/TableActionMenuPlugin/index.js.map +1 -1
  113. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.d.ts.map +1 -1
  114. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js +39 -39
  115. package/dist/features/experimental_table/client/plugins/TableCellResizerPlugin/index.js.map +1 -1
  116. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts +1 -1
  117. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.d.ts.map +1 -1
  118. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js +60 -124
  119. package/dist/features/experimental_table/client/plugins/TableHoverActionsPlugin/index.js.map +1 -1
  120. package/dist/features/experimental_table/client/plugins/TablePlugin/index.d.ts.map +1 -1
  121. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js +52 -50
  122. package/dist/features/experimental_table/client/plugins/TablePlugin/index.js.map +1 -1
  123. package/dist/features/experimental_table/client/utils/debounce.js +4 -4
  124. package/dist/features/experimental_table/client/utils/debounce.js.map +1 -1
  125. package/dist/features/experimental_table/client/utils/useDebounce.js.map +1 -1
  126. package/dist/features/experimental_table/server/index.d.ts.map +1 -1
  127. package/dist/features/experimental_table/server/index.js +20 -4
  128. package/dist/features/experimental_table/server/index.js.map +1 -1
  129. package/dist/features/format/bold/feature.client.d.ts +1 -4
  130. package/dist/features/format/bold/feature.client.d.ts.map +1 -1
  131. package/dist/features/format/inlineCode/feature.client.d.ts +1 -4
  132. package/dist/features/format/inlineCode/feature.client.d.ts.map +1 -1
  133. package/dist/features/format/italic/feature.client.d.ts +1 -4
  134. package/dist/features/format/italic/feature.client.d.ts.map +1 -1
  135. package/dist/features/format/strikethrough/feature.client.d.ts +1 -4
  136. package/dist/features/format/strikethrough/feature.client.d.ts.map +1 -1
  137. package/dist/features/format/subscript/feature.client.d.ts +1 -4
  138. package/dist/features/format/subscript/feature.client.d.ts.map +1 -1
  139. package/dist/features/format/superscript/feature.client.d.ts +1 -4
  140. package/dist/features/format/superscript/feature.client.d.ts.map +1 -1
  141. package/dist/features/format/underline/feature.client.d.ts +1 -4
  142. package/dist/features/format/underline/feature.client.d.ts.map +1 -1
  143. package/dist/features/heading/client/index.d.ts +1 -4
  144. package/dist/features/heading/client/index.d.ts.map +1 -1
  145. package/dist/features/heading/server/index.d.ts.map +1 -1
  146. package/dist/features/heading/server/index.js +4 -0
  147. package/dist/features/heading/server/index.js.map +1 -1
  148. package/dist/features/horizontalRule/client/component/index.d.ts +1 -1
  149. package/dist/features/horizontalRule/client/component/index.d.ts.map +1 -1
  150. package/dist/features/horizontalRule/client/component/index.js +12 -9
  151. package/dist/features/horizontalRule/client/component/index.js.map +1 -1
  152. package/dist/features/horizontalRule/client/index.d.ts +1 -4
  153. package/dist/features/horizontalRule/client/index.d.ts.map +1 -1
  154. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts +2 -2
  155. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.d.ts.map +1 -1
  156. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js +1 -1
  157. package/dist/features/horizontalRule/server/nodes/HorizontalRuleNode.js.map +1 -1
  158. package/dist/features/indent/client/index.d.ts +1 -4
  159. package/dist/features/indent/client/index.d.ts.map +1 -1
  160. package/dist/features/indent/client/index.js +2 -1
  161. package/dist/features/indent/client/index.js.map +1 -1
  162. package/dist/features/link/client/index.d.ts +1 -13
  163. package/dist/features/link/client/index.d.ts.map +1 -1
  164. package/dist/features/link/client/index.js +2 -2
  165. package/dist/features/link/client/index.js.map +1 -1
  166. package/dist/features/link/client/plugins/autoLink/index.d.ts +1 -1
  167. package/dist/features/link/client/plugins/autoLink/index.d.ts.map +1 -1
  168. package/dist/features/link/client/plugins/autoLink/index.js +3 -1
  169. package/dist/features/link/client/plugins/autoLink/index.js.map +1 -1
  170. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  171. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js +21 -20
  172. package/dist/features/link/client/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  173. package/dist/features/link/client/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  174. package/dist/features/link/client/plugins/floatingLinkEditor/index.js +1 -1
  175. package/dist/features/link/client/plugins/floatingLinkEditor/index.js.map +1 -1
  176. package/dist/features/link/nodes/AutoLinkNode.js +2 -2
  177. package/dist/features/link/nodes/AutoLinkNode.js.map +1 -1
  178. package/dist/features/link/nodes/LinkNode.d.ts.map +1 -1
  179. package/dist/features/link/nodes/LinkNode.js +12 -7
  180. package/dist/features/link/nodes/LinkNode.js.map +1 -1
  181. package/dist/features/link/nodes/types.d.ts +3 -3
  182. package/dist/features/link/nodes/types.d.ts.map +1 -1
  183. package/dist/features/link/nodes/types.js.map +1 -1
  184. package/dist/features/link/server/baseFields.d.ts +1 -1
  185. package/dist/features/link/server/baseFields.d.ts.map +1 -1
  186. package/dist/features/link/server/baseFields.js +15 -3
  187. package/dist/features/link/server/baseFields.js.map +1 -1
  188. package/dist/features/link/server/index.d.ts.map +1 -1
  189. package/dist/features/link/server/index.js +17 -4
  190. package/dist/features/link/server/index.js.map +1 -1
  191. package/dist/features/link/server/transformExtraFields.d.ts +1 -1
  192. package/dist/features/link/server/transformExtraFields.d.ts.map +1 -1
  193. package/dist/features/link/server/transformExtraFields.js.map +1 -1
  194. package/dist/features/link/server/validate.d.ts.map +1 -1
  195. package/dist/features/link/server/validate.js +8 -5
  196. package/dist/features/link/server/validate.js.map +1 -1
  197. package/dist/features/lists/checklist/client/index.d.ts +1 -4
  198. package/dist/features/lists/checklist/client/index.d.ts.map +1 -1
  199. package/dist/features/lists/htmlConverter.d.ts.map +1 -1
  200. package/dist/features/lists/htmlConverter.js +8 -0
  201. package/dist/features/lists/htmlConverter.js.map +1 -1
  202. package/dist/features/lists/orderedList/client/index.d.ts +1 -4
  203. package/dist/features/lists/orderedList/client/index.d.ts.map +1 -1
  204. package/dist/features/lists/shared/markdown.js.map +1 -1
  205. package/dist/features/lists/unorderedList/client/index.d.ts +1 -4
  206. package/dist/features/lists/unorderedList/client/index.d.ts.map +1 -1
  207. package/dist/features/migrations/lexicalPluginToLexical/converter/index.d.ts.map +1 -1
  208. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js +1 -0
  209. package/dist/features/migrations/lexicalPluginToLexical/converter/index.js.map +1 -1
  210. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts +1 -4
  211. package/dist/features/migrations/lexicalPluginToLexical/feature.client.d.ts.map +1 -1
  212. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  213. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  214. package/dist/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  215. package/dist/features/migrations/slateToLexical/converter/converters/blockquote/converter.js.map +1 -1
  216. package/dist/features/migrations/slateToLexical/converter/converters/heading/converter.js.map +1 -1
  217. package/dist/features/migrations/slateToLexical/converter/converters/link/converter.js.map +1 -1
  218. package/dist/features/migrations/slateToLexical/converter/converters/listItem/converter.js.map +1 -1
  219. package/dist/features/migrations/slateToLexical/converter/converters/orderedList/converter.js.map +1 -1
  220. package/dist/features/migrations/slateToLexical/converter/converters/unknown/converter.js.map +1 -1
  221. package/dist/features/migrations/slateToLexical/converter/converters/unorderedList/converter.js.map +1 -1
  222. package/dist/features/migrations/slateToLexical/converter/index.d.ts.map +1 -1
  223. package/dist/features/migrations/slateToLexical/converter/index.js +1 -0
  224. package/dist/features/migrations/slateToLexical/converter/index.js.map +1 -1
  225. package/dist/features/migrations/slateToLexical/feature.client.d.ts +1 -4
  226. package/dist/features/migrations/slateToLexical/feature.client.d.ts.map +1 -1
  227. package/dist/features/migrations/slateToLexical/feature.client.js +1 -3
  228. package/dist/features/migrations/slateToLexical/feature.client.js.map +1 -1
  229. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  230. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  231. package/dist/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  232. package/dist/features/paragraph/client/index.d.ts +1 -4
  233. package/dist/features/paragraph/client/index.d.ts.map +1 -1
  234. package/dist/features/paragraph/server/index.d.ts +1 -1
  235. package/dist/features/paragraph/server/index.d.ts.map +1 -1
  236. package/dist/features/relationship/client/components/RelationshipComponent.d.ts.map +1 -1
  237. package/dist/features/relationship/client/components/RelationshipComponent.js +42 -29
  238. package/dist/features/relationship/client/components/RelationshipComponent.js.map +1 -1
  239. package/dist/features/relationship/client/drawer/index.d.ts.map +1 -1
  240. package/dist/features/relationship/client/drawer/index.js +27 -26
  241. package/dist/features/relationship/client/drawer/index.js.map +1 -1
  242. package/dist/features/relationship/client/index.d.ts +2 -17
  243. package/dist/features/relationship/client/index.d.ts.map +1 -1
  244. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts +1 -1
  245. package/dist/features/relationship/client/nodes/RelationshipNode.d.ts.map +1 -1
  246. package/dist/features/relationship/client/nodes/RelationshipNode.js.map +1 -1
  247. package/dist/features/relationship/client/plugins/index.js +1 -1
  248. package/dist/features/relationship/client/plugins/index.js.map +1 -1
  249. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js +1 -1
  250. package/dist/features/relationship/client/utils/EnabledRelationshipsCondition.js.map +1 -1
  251. package/dist/features/relationship/server/index.d.ts +1 -1
  252. package/dist/features/relationship/server/index.d.ts.map +1 -1
  253. package/dist/features/relationship/server/index.js +50 -40
  254. package/dist/features/relationship/server/index.js.map +1 -1
  255. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts +8 -6
  256. package/dist/features/relationship/server/nodes/RelationshipNode.d.ts.map +1 -1
  257. package/dist/features/relationship/server/nodes/RelationshipNode.js.map +1 -1
  258. package/dist/features/toolbars/fixed/client/Toolbar/index.d.ts.map +1 -1
  259. package/dist/features/toolbars/fixed/client/Toolbar/index.js +93 -66
  260. package/dist/features/toolbars/fixed/client/Toolbar/index.js.map +1 -1
  261. package/dist/features/toolbars/fixed/client/index.d.ts +1 -4
  262. package/dist/features/toolbars/fixed/client/index.d.ts.map +1 -1
  263. package/dist/features/toolbars/inline/client/Toolbar/index.js +43 -46
  264. package/dist/features/toolbars/inline/client/Toolbar/index.js.map +1 -1
  265. package/dist/features/toolbars/inline/client/index.d.ts +1 -4
  266. package/dist/features/toolbars/inline/client/index.d.ts.map +1 -1
  267. package/dist/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  268. package/dist/features/toolbars/shared/ToolbarButton/index.js +4 -1
  269. package/dist/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  270. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +2 -2
  271. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  272. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js +12 -6
  273. package/dist/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  274. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts +4 -5
  275. package/dist/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  276. package/dist/features/toolbars/shared/ToolbarDropdown/index.js +119 -116
  277. package/dist/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  278. package/dist/features/toolbars/types.d.ts +23 -11
  279. package/dist/features/toolbars/types.d.ts.map +1 -1
  280. package/dist/features/toolbars/types.js.map +1 -1
  281. package/dist/features/typesClient.d.ts +10 -11
  282. package/dist/features/typesClient.d.ts.map +1 -1
  283. package/dist/features/typesClient.js.map +1 -1
  284. package/dist/features/typesServer.d.ts +17 -26
  285. package/dist/features/typesServer.d.ts.map +1 -1
  286. package/dist/features/typesServer.js.map +1 -1
  287. package/dist/features/upload/client/component/index.d.ts.map +1 -1
  288. package/dist/features/upload/client/component/index.js +69 -58
  289. package/dist/features/upload/client/component/index.js.map +1 -1
  290. package/dist/features/upload/client/drawer/index.d.ts.map +1 -1
  291. package/dist/features/upload/client/drawer/index.js +34 -32
  292. package/dist/features/upload/client/drawer/index.js.map +1 -1
  293. package/dist/features/upload/client/feature.client.d.ts +1 -4
  294. package/dist/features/upload/client/feature.client.d.ts.map +1 -1
  295. package/dist/features/upload/client/nodes/UploadNode.d.ts.map +1 -1
  296. package/dist/features/upload/client/nodes/UploadNode.js +1 -1
  297. package/dist/features/upload/client/nodes/UploadNode.js.map +1 -1
  298. package/dist/features/upload/client/plugin/index.js +1 -1
  299. package/dist/features/upload/client/plugin/index.js.map +1 -1
  300. package/dist/features/upload/server/feature.server.d.ts.map +1 -1
  301. package/dist/features/upload/server/feature.server.js +17 -8
  302. package/dist/features/upload/server/feature.server.js.map +1 -1
  303. package/dist/features/upload/server/nodes/UploadNode.d.ts +9 -7
  304. package/dist/features/upload/server/nodes/UploadNode.d.ts.map +1 -1
  305. package/dist/features/upload/server/nodes/UploadNode.js.map +1 -1
  306. package/dist/features/upload/server/validate.d.ts.map +1 -1
  307. package/dist/features/upload/server/validate.js +7 -4
  308. package/dist/features/upload/server/validate.js.map +1 -1
  309. package/dist/field/Field.d.ts.map +1 -1
  310. package/dist/field/Field.js +29 -44
  311. package/dist/field/Field.js.map +1 -1
  312. package/dist/field/bundled.css +1 -1
  313. package/dist/field/index.d.ts.map +1 -1
  314. package/dist/field/index.js +63 -73
  315. package/dist/field/index.js.map +1 -1
  316. package/dist/field/rscEntry.d.ts +9 -0
  317. package/dist/field/rscEntry.d.ts.map +1 -0
  318. package/dist/field/rscEntry.js +37 -0
  319. package/dist/field/rscEntry.js.map +1 -0
  320. package/dist/index.d.ts +4 -3
  321. package/dist/index.d.ts.map +1 -1
  322. package/dist/index.js +94 -103
  323. package/dist/index.js.map +1 -1
  324. package/dist/lexical/EditorPlugin.d.ts.map +1 -1
  325. package/dist/lexical/EditorPlugin.js +2 -1
  326. package/dist/lexical/EditorPlugin.js.map +1 -1
  327. package/dist/lexical/LexicalEditor.d.ts +1 -1
  328. package/dist/lexical/LexicalEditor.d.ts.map +1 -1
  329. package/dist/lexical/LexicalEditor.js +10 -10
  330. package/dist/lexical/LexicalEditor.js.map +1 -1
  331. package/dist/lexical/LexicalProvider.d.ts +2 -2
  332. package/dist/lexical/LexicalProvider.d.ts.map +1 -1
  333. package/dist/lexical/LexicalProvider.js +9 -7
  334. package/dist/lexical/LexicalProvider.js.map +1 -1
  335. package/dist/lexical/config/client/EditorConfigProvider.d.ts +6 -5
  336. package/dist/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  337. package/dist/lexical/config/client/EditorConfigProvider.js +13 -12
  338. package/dist/lexical/config/client/EditorConfigProvider.js.map +1 -1
  339. package/dist/lexical/config/client/loader.d.ts +1 -3
  340. package/dist/lexical/config/client/loader.d.ts.map +1 -1
  341. package/dist/lexical/config/client/loader.js +7 -19
  342. package/dist/lexical/config/client/loader.js.map +1 -1
  343. package/dist/lexical/config/client/sanitize.d.ts +1 -1
  344. package/dist/lexical/config/client/sanitize.d.ts.map +1 -1
  345. package/dist/lexical/config/client/sanitize.js +4 -4
  346. package/dist/lexical/config/client/sanitize.js.map +1 -1
  347. package/dist/lexical/config/server/loader.d.ts +2 -1
  348. package/dist/lexical/config/server/loader.d.ts.map +1 -1
  349. package/dist/lexical/config/server/loader.js +2 -0
  350. package/dist/lexical/config/server/loader.js.map +1 -1
  351. package/dist/lexical/config/server/sanitize.d.ts +1 -1
  352. package/dist/lexical/config/server/sanitize.d.ts.map +1 -1
  353. package/dist/lexical/config/server/sanitize.js +12 -11
  354. package/dist/lexical/config/server/sanitize.js.map +1 -1
  355. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +4 -4
  356. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  357. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js +82 -113
  358. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  359. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +2 -2
  360. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  361. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +2 -2
  362. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  363. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +3 -2
  364. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  365. package/dist/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  366. package/dist/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  367. package/dist/lexical/plugins/SlashMenu/index.js +24 -30
  368. package/dist/lexical/plugins/SlashMenu/index.js.map +1 -1
  369. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  370. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js +93 -130
  371. package/dist/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  372. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts +1 -1
  373. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.d.ts.map +1 -1
  374. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js +1 -1
  375. package/dist/lexical/plugins/handles/DraggableBlockPlugin/debounce.js.map +1 -1
  376. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js +1 -1
  377. package/dist/lexical/plugins/handles/DraggableBlockPlugin/getBoundingRectWithoutTransform.js.map +1 -1
  378. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  379. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js +119 -137
  380. package/dist/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  381. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  382. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +16 -32
  383. package/dist/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  384. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.d.ts.map +1 -1
  385. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js +3 -1
  386. package/dist/lexical/plugins/handles/utils/doesLineHeightAffectElement.js.map +1 -1
  387. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -1
  388. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js +3 -4
  389. package/dist/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -1
  390. package/dist/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  391. package/dist/lexical/plugins/handles/utils/setHandlePosition.js +4 -6
  392. package/dist/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  393. package/dist/lexical/theme/EditorTheme.d.ts.map +1 -1
  394. package/dist/lexical/theme/EditorTheme.js +1 -2
  395. package/dist/lexical/theme/EditorTheme.js.map +1 -1
  396. package/dist/lexical/ui/icons/Caret/index.svg +2 -2
  397. package/dist/lexical/utils/nodeFormat.d.ts +2 -2
  398. package/dist/lexical/utils/nodeFormat.d.ts.map +1 -1
  399. package/dist/lexical/utils/nodeFormat.js.map +1 -1
  400. package/dist/lexical/utils/rect.d.ts +4 -4
  401. package/dist/lexical/utils/rect.d.ts.map +1 -1
  402. package/dist/lexical/utils/rect.js.map +1 -1
  403. package/dist/lexical/utils/setFloatingElemPosition.d.ts +1 -1
  404. package/dist/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  405. package/dist/lexical/utils/setFloatingElemPosition.js +1 -1
  406. package/dist/lexical/utils/setFloatingElemPosition.js.map +1 -1
  407. package/dist/lexical/utils/url.d.ts +5 -0
  408. package/dist/lexical/utils/url.d.ts.map +1 -1
  409. package/dist/lexical/utils/url.js +25 -5
  410. package/dist/lexical/utils/url.js.map +1 -1
  411. package/dist/populateGraphQL/populate.d.ts +3 -2
  412. package/dist/populateGraphQL/populate.d.ts.map +1 -1
  413. package/dist/populateGraphQL/populate.js +3 -1
  414. package/dist/populateGraphQL/populate.js.map +1 -1
  415. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts +1 -1
  416. package/dist/populateGraphQL/populateLexicalPopulationPromises.d.ts.map +1 -1
  417. package/dist/populateGraphQL/populateLexicalPopulationPromises.js +5 -4
  418. package/dist/populateGraphQL/populateLexicalPopulationPromises.js.map +1 -1
  419. package/dist/populateGraphQL/recursivelyPopulateFieldsForGraphQL.js.map +1 -1
  420. package/dist/types.d.ts +20 -7
  421. package/dist/types.d.ts.map +1 -1
  422. package/dist/types.js.map +1 -1
  423. package/dist/utilities/createClientFeature.d.ts +3 -5
  424. package/dist/utilities/createClientFeature.d.ts.map +1 -1
  425. package/dist/utilities/createClientFeature.js +1 -4
  426. package/dist/utilities/createClientFeature.js.map +1 -1
  427. package/dist/utilities/createServerFeature.d.ts +1 -0
  428. package/dist/utilities/createServerFeature.d.ts.map +1 -1
  429. package/dist/utilities/createServerFeature.js +2 -0
  430. package/dist/utilities/createServerFeature.js.map +1 -1
  431. package/dist/utilities/fieldsDrawer/Drawer.d.ts +1 -0
  432. package/dist/utilities/fieldsDrawer/Drawer.d.ts.map +1 -1
  433. package/dist/utilities/fieldsDrawer/Drawer.js +68 -27
  434. package/dist/utilities/fieldsDrawer/Drawer.js.map +1 -1
  435. package/dist/utilities/fieldsDrawer/DrawerContent.d.ts.map +1 -1
  436. package/dist/utilities/fieldsDrawer/DrawerContent.js +115 -139
  437. package/dist/utilities/fieldsDrawer/DrawerContent.js.map +1 -1
  438. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts +13 -0
  439. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.d.ts.map +1 -0
  440. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js +129 -0
  441. package/dist/utilities/fieldsDrawer/useLexicalDocumentDrawer.js.map +1 -0
  442. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts +10 -0
  443. package/dist/utilities/fieldsDrawer/useLexicalDrawer.d.ts.map +1 -0
  444. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js +136 -0
  445. package/dist/utilities/fieldsDrawer/useLexicalDrawer.js.map +1 -0
  446. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts +16 -0
  447. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.d.ts.map +1 -0
  448. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js +144 -0
  449. package/dist/utilities/fieldsDrawer/useLexicalListDrawer.js.map +1 -0
  450. package/dist/utilities/generateImportMap.d.ts.map +1 -1
  451. package/dist/utilities/generateImportMap.js +2 -3
  452. package/dist/utilities/generateImportMap.js.map +1 -1
  453. package/dist/utilities/generateSchemaMap.d.ts.map +1 -1
  454. package/dist/utilities/generateSchemaMap.js +13 -10
  455. package/dist/utilities/generateSchemaMap.js.map +1 -1
  456. package/dist/utilities/initLexicalFeatures.d.ts +18 -0
  457. package/dist/utilities/initLexicalFeatures.d.ts.map +1 -0
  458. package/dist/utilities/initLexicalFeatures.js +95 -0
  459. package/dist/utilities/initLexicalFeatures.js.map +1 -0
  460. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts +1 -1
  461. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.d.ts.map +1 -1
  462. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js +1 -1
  463. package/dist/utilities/migrateSlateToLexical/migrateDocumentFieldsRecursively.js.map +1 -1
  464. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts +1 -1
  465. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.d.ts.map +1 -1
  466. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js +5 -1
  467. package/dist/utilities/upgradeLexicalData/upgradeDocumentFieldsRecursively.js.map +1 -1
  468. package/dist/utilities/useLexicalFeature.d.ts.map +1 -1
  469. package/dist/utilities/useLexicalFeature.js +12 -4
  470. package/dist/utilities/useLexicalFeature.js.map +1 -1
  471. package/dist/validate/index.d.ts.map +1 -1
  472. package/dist/validate/index.js +2 -2
  473. package/dist/validate/index.js.map +1 -1
  474. package/dist/validate/validateNodes.d.ts +2 -2
  475. package/dist/validate/validateNodes.d.ts.map +1 -1
  476. package/dist/validate/validateNodes.js +4 -4
  477. package/dist/validate/validateNodes.js.map +1 -1
  478. package/package.json +51 -49
  479. package/dist/cell/index.d.ts +0 -9
  480. package/dist/cell/index.d.ts.map +0 -1
  481. package/dist/cell/index.js +0 -135
  482. package/dist/cell/index.js.map +0 -1
  483. package/dist/exports/client/Field-63NGLPJB.js +0 -2
  484. package/dist/exports/client/Field-63NGLPJB.js.map +0 -7
  485. package/dist/exports/client/RelationshipComponent-3QWBV4GT.js +0 -2
  486. package/dist/exports/client/RelationshipComponent-3QWBV4GT.js.map +0 -7
  487. package/dist/exports/client/chunk-G5DTIOPI.js +0 -2
  488. package/dist/exports/client/chunk-G5DTIOPI.js.map +0 -7
  489. package/dist/exports/client/chunk-NI6Z4GBD.js +0 -2
  490. package/dist/exports/client/chunk-NI6Z4GBD.js.map +0 -7
  491. package/dist/exports/client/chunk-TO2W7Q2G.js +0 -2
  492. package/dist/exports/client/chunk-TO2W7Q2G.js.map +0 -7
  493. package/dist/exports/client/component-3OFD6Q4Z.js +0 -2
  494. package/dist/exports/client/component-3OFD6Q4Z.js.map +0 -7
  495. package/dist/exports/client/component-LCAAX56T.js +0 -2
  496. package/dist/exports/client/component-LCAAX56T.js.map +0 -7
  497. package/dist/exports/client/component-LLWMZU6K.js +0 -2
  498. package/dist/exports/client/component-LLWMZU6K.js.map +0 -7
  499. package/dist/exports/client/componentInline-72VZAAHP.js +0 -2
  500. package/dist/exports/client/componentInline-72VZAAHP.js.map +0 -7
  501. package/dist/features/createClientComponent.d.ts +0 -7
  502. package/dist/features/createClientComponent.d.ts.map +0 -1
  503. package/dist/features/createClientComponent.js +0 -13
  504. package/dist/features/createClientComponent.js.map +0 -1
  505. package/dist/features/createFeaturePropComponent.d.ts +0 -6
  506. package/dist/features/createFeaturePropComponent.d.ts.map +0 -1
  507. package/dist/features/createFeaturePropComponent.js +0 -19
  508. package/dist/features/createFeaturePropComponent.js.map +0 -1
  509. package/dist/utilities/generateComponentMap.d.ts +0 -6
  510. package/dist/utilities/generateComponentMap.d.ts.map +0 -1
  511. package/dist/utilities/generateComponentMap.js +0 -99
  512. package/dist/utilities/generateComponentMap.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"typesClient.js","names":[],"sources":["../../src/features/typesClient.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type {\n Klass,\n LexicalEditor,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n} from 'lexical'\nimport type React from 'react'\n\nimport type { ClientEditorConfig } from '../lexical/config/types.js'\nimport type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport type { ToolbarGroup } from './toolbars/types.js'\n\nexport type FeatureProviderProviderClient<\n UnSanitizedClientFeatureProps = undefined,\n ClientFeatureProps = UnSanitizedClientFeatureProps,\n> = (props: ClientComponentProps<ClientFeatureProps>) => FeatureProviderClient<ClientFeatureProps>\n\n/**\n * No dependencies => Features need to be sorted on the server first, then sent to client in right order\n */\nexport type FeatureProviderClient<\n UnSanitizedClientFeatureProps = undefined,\n ClientFeatureProps = UnSanitizedClientFeatureProps,\n> = {\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n clientFeatureProps: ClientComponentProps<UnSanitizedClientFeatureProps>\n feature:\n | ((props: {\n clientFunctions: Record<string, any>\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ClientFeatureProviderMap\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedClientFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ClientEditorConfig\n }) => ClientFeature<ClientFeatureProps>)\n | ClientFeature<ClientFeatureProps>\n}\n\nexport type PluginComponent<ClientFeatureProps = any> = React.FC<{\n clientProps: ClientFeatureProps\n}>\nexport type PluginComponentWithAnchor<ClientFeatureProps = any> = React.FC<{\n anchorElem: HTMLElement\n clientProps: ClientFeatureProps\n}>\n\nexport type ClientFeature<ClientFeatureProps> = {\n hooks?: {\n load?: ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n save?: ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n }\n markdownTransformers?: Transformer[]\n nodes?: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n /**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\n plugins?: Array<\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'aboveContainer' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponentWithAnchor<ClientFeatureProps>\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n | {\n Component: PluginComponent<ClientFeatureProps>\n position: 'belowContainer' // Determines at which position the Component will be added.\n }\n >\n /**\n * Client Features can register their own providers, which will be nested below the EditorConfigProvider\n */\n providers?: Array<React.FC>\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n sanitizedClientFeatureProps?: ClientComponentProps<ClientFeatureProps>\n slashMenu?: {\n /**\n * Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).\n * Thus, to re-calculate the available groups, this function will be called every time you type after the /.\n *\n * The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.\n */\n dynamicGroups?: ({\n editor,\n queryString,\n }: {\n editor: LexicalEditor\n queryString: string\n }) => SlashMenuGroup[]\n /**\n * Static array of groups together with the items in them. These will always be present.\n * While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.\n */\n groups?: SlashMenuGroup[]\n }\n /**\n * An opt-in, classic fixed toolbar which stays at the top of the editor\n */\n toolbarFixed?: {\n groups: ToolbarGroup[]\n }\n /**\n * The default, floating toolbar which appears when you select text.\n */\n toolbarInline?: {\n /**\n * Array of toolbar groups / sections. Each section can contain multiple toolbar items.\n */\n groups: ToolbarGroup[]\n }\n}\n\nexport type ClientComponentProps<ClientFeatureProps> = ClientFeatureProps extends undefined\n ? {\n featureKey: string\n order: number\n }\n : {\n featureKey: string\n order: number\n } & ClientFeatureProps\n\nexport type ResolvedClientFeature<ClientFeatureProps> = {\n key: string\n order: number\n} & ClientFeature<ClientFeatureProps>\n\nexport type ResolvedClientFeatureMap = Map<string, ResolvedClientFeature<any>>\n\nexport type ClientFeatureProviderMap = Map<string, FeatureProviderClient<any, any>>\n\n/**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\nexport type SanitizedPlugin =\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n clientProps: any\n key: string\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n clientProps: any\n key: string\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n clientProps: any\n key: string\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponentWithAnchor\n clientProps: any\n desktopOnly?: boolean\n key: string\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n | {\n Component: PluginComponent\n clientProps: any\n key: string\n position: 'aboveContainer'\n }\n | {\n Component: PluginComponent\n clientProps: any\n key: string\n position: 'belowContainer'\n }\n\nexport type SanitizedClientFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n hooks: {\n load: Array<\n ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n >\n save: Array<\n ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n >\n }\n /**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\n plugins?: Array<SanitizedPlugin>\n slashMenu: {\n /**\n * Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).\n * Thus, to re-calculate the available groups, this function will be called every time you type after the /.\n *\n * The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.\n */\n dynamicGroups: Array<\n ({ editor, queryString }: { editor: LexicalEditor; queryString: string }) => SlashMenuGroup[]\n >\n /**\n * Static array of groups together with the items in them. These will always be present.\n * While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.\n */\n groups: SlashMenuGroup[]\n }\n} & Required<\n Pick<\n ResolvedClientFeature<unknown>,\n 'markdownTransformers' | 'nodes' | 'providers' | 'toolbarFixed' | 'toolbarInline'\n >\n>\n"],"mappings":"AAkNA","ignoreList":[]}
1
+ {"version":3,"file":"typesClient.js","names":[],"sources":["../../src/features/typesClient.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type {\n Klass,\n LexicalEditor,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n} from 'lexical'\nimport type React from 'react'\n\nimport type { ClientEditorConfig } from '../lexical/config/types.js'\nimport type { SlashMenuGroup } from '../lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js'\nimport type { ToolbarGroup } from './toolbars/types.js'\n\nexport type FeatureProviderProviderClient<\n UnSanitizedClientFeatureProps = undefined,\n ClientFeatureProps = UnSanitizedClientFeatureProps,\n> = (props: BaseClientFeatureProps<ClientFeatureProps>) => FeatureProviderClient<ClientFeatureProps>\n\n/**\n * No dependencies => Features need to be sorted on the server first, then sent to client in right order\n */\nexport type FeatureProviderClient<\n UnSanitizedClientFeatureProps = undefined,\n ClientFeatureProps = UnSanitizedClientFeatureProps,\n> = {\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n clientFeatureProps: BaseClientFeatureProps<UnSanitizedClientFeatureProps>\n feature:\n | ((props: {\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ClientFeatureProviderMap\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedClientFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ClientEditorConfig\n }) => ClientFeature<ClientFeatureProps>)\n | ClientFeature<ClientFeatureProps>\n}\n\nexport type PluginComponent<ClientFeatureProps = any> = React.FC<{\n clientProps: ClientFeatureProps\n}>\nexport type PluginComponentWithAnchor<ClientFeatureProps = any> = React.FC<{\n anchorElem: HTMLElement\n clientProps: ClientFeatureProps\n}>\n\nexport type ClientFeature<ClientFeatureProps> = {\n hooks?: {\n load?: ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n save?: ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n }\n markdownTransformers?: Transformer[]\n nodes?: Array<Klass<LexicalNode> | LexicalNodeReplacement>\n /**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\n plugins?: Array<\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'aboveContainer' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent<ClientFeatureProps>\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponentWithAnchor<ClientFeatureProps>\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n | {\n Component: PluginComponent<ClientFeatureProps>\n position: 'belowContainer' // Determines at which position the Component will be added.\n }\n >\n /**\n * Client Features can register their own providers, which will be nested below the EditorConfigProvider\n */\n providers?: Array<React.FC>\n /**\n * Return props, to make it easy to retrieve passed in props to this Feature for the client if anyone wants to\n */\n sanitizedClientFeatureProps?: BaseClientFeatureProps<ClientFeatureProps>\n slashMenu?: {\n /**\n * Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).\n * Thus, to re-calculate the available groups, this function will be called every time you type after the /.\n *\n * The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.\n */\n dynamicGroups?: ({\n editor,\n queryString,\n }: {\n editor: LexicalEditor\n queryString: string\n }) => SlashMenuGroup[]\n /**\n * Static array of groups together with the items in them. These will always be present.\n * While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.\n */\n groups?: SlashMenuGroup[]\n }\n /**\n * An opt-in, classic fixed toolbar which stays at the top of the editor\n */\n toolbarFixed?: {\n groups: ToolbarGroup[]\n }\n /**\n * The default, floating toolbar which appears when you select text.\n */\n toolbarInline?: {\n /**\n * Array of toolbar groups / sections. Each section can contain multiple toolbar items.\n */\n groups: ToolbarGroup[]\n }\n}\n\nexport type BaseClientFeatureProps<ClientFeatureProps> = ClientFeatureProps extends undefined\n ? {\n featureKey: string\n order: number\n }\n : {\n featureKey: string\n order: number\n } & ClientFeatureProps\n\nexport type ResolvedClientFeature<ClientFeatureProps> = {\n key: string\n order: number\n} & ClientFeature<ClientFeatureProps>\n\nexport type ResolvedClientFeatureMap = Map<string, ResolvedClientFeature<any>>\n\nexport type ClientFeatureProviderMap = Map<string, FeatureProviderClient<any, any>>\n\n/**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\nexport type SanitizedPlugin =\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'bottom' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'normal' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponent\n key: string\n position: 'top' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n // plugins are anything which is not directly part of the editor. Like, creating a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n Component: PluginComponentWithAnchor\n desktopOnly?: boolean\n key: string\n position: 'floatingAnchorElem' // Determines at which position the Component will be added.\n }\n | {\n clientProps: any\n Component: PluginComponent\n key: string\n position: 'aboveContainer'\n }\n | {\n clientProps: any\n Component: PluginComponent\n key: string\n position: 'belowContainer'\n }\n\nexport type SanitizedClientFeatures = {\n /** The keys of all enabled features */\n enabledFeatures: string[]\n hooks: {\n load: Array<\n ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n >\n save: Array<\n ({\n incomingEditorState,\n }: {\n incomingEditorState: SerializedEditorState\n }) => SerializedEditorState\n >\n }\n /**\n * Plugins are react components which get added to the editor. You can use them to interact with lexical, e.g. to create a command which creates a node, or opens a modal, or some other more \"outside\" functionality\n */\n plugins?: Array<SanitizedPlugin>\n slashMenu: {\n /**\n * Dynamic groups allow you to add different groups depending on the query string (so, the text after the slash).\n * Thus, to re-calculate the available groups, this function will be called every time you type after the /.\n *\n * The groups provided by dynamicGroups will be merged with the static groups provided by the groups property.\n */\n dynamicGroups: Array<\n ({ editor, queryString }: { editor: LexicalEditor; queryString: string }) => SlashMenuGroup[]\n >\n /**\n * Static array of groups together with the items in them. These will always be present.\n * While typing after the /, they will be filtered by the query string and the keywords, key and display name of the items.\n */\n groups: SlashMenuGroup[]\n }\n} & Required<\n Pick<\n ResolvedClientFeature<unknown>,\n 'markdownTransformers' | 'nodes' | 'providers' | 'toolbarFixed' | 'toolbarInline'\n >\n>\n"],"mappings":"AAiNA","ignoreList":[]}
@@ -2,11 +2,11 @@ import type { Transformer } from '@lexical/markdown';
2
2
  import type { GenericLanguages, I18nClient } from '@payloadcms/translations';
3
3
  import type { JSONSchema4 } from 'json-schema';
4
4
  import type { Klass, LexicalNode, LexicalNodeReplacement, SerializedEditorState, SerializedLexicalNode } from 'lexical';
5
- import type { Config, Field, JsonObject, Payload, PayloadComponent, PayloadRequest, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, ValidateOptions } from 'payload';
5
+ import type { Config, Field, FieldSchemaMap, JsonObject, PayloadComponent, PayloadRequest, PopulateType, ReplaceAny, RequestContext, RichTextField, RichTextHooks, SanitizedConfig, ValidateOptions, ValidationFieldError } from 'payload';
6
6
  import type { ServerEditorConfig } from '../lexical/config/types.js';
7
7
  import type { AdapterProps } from '../types.js';
8
8
  import type { HTMLConverter } from './converters/html/converter/types.js';
9
- import type { ClientComponentProps } from './typesClient.js';
9
+ import type { BaseClientFeatureProps } from './typesClient.js';
10
10
  export type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({ context, currentDepth, depth, draft, editorPopulationPromises, field, fieldPromises, findMany, flattenLocales, node, overrideAccess, populationPromises, req, showHiddenFields, siblingDoc, }: {
11
11
  context: RequestContext;
12
12
  currentDepth: number;
@@ -54,6 +54,7 @@ export type FeatureProviderServer<UnSanitizedServerFeatureProps = undefined, Ser
54
54
  /** unSanitizedEditorConfig.features, but mapped */
55
55
  featureProviderMap: ServerFeatureProviderMap;
56
56
  isRoot?: boolean;
57
+ parentIsLocalized: boolean;
57
58
  resolvedFeatures: ResolvedServerFeatureMap;
58
59
  unSanitizedEditorConfig: ServerEditorConfig;
59
60
  }) => Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>> | ServerFeature<ServerFeatureProps, ClientFeatureProps>) | ServerFeature<ServerFeatureProps, ClientFeatureProps>;
@@ -84,6 +85,10 @@ export type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {
84
85
  */
85
86
  locale: string;
86
87
  overrideAccess: boolean;
88
+ /**
89
+ * Only available in `afterRead` hooks.
90
+ */
91
+ populateArg?: PopulateType;
87
92
  /**
88
93
  * Only available in `afterRead` field hooks.
89
94
  */
@@ -115,14 +120,10 @@ export type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {
115
120
  overrideAccess: boolean;
116
121
  };
117
122
  export type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {
118
- duplicate: boolean;
119
123
  /**
120
124
  * Only available in `beforeChange` hooks.
121
125
  */
122
- errors: {
123
- field: string;
124
- message: string;
125
- }[];
126
+ errors: ValidationFieldError[];
126
127
  mergeLocaleActions: (() => Promise<void>)[];
127
128
  /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */
128
129
  operation: 'create' | 'delete' | 'read' | 'update';
@@ -200,30 +201,12 @@ export type NodeWithHooks<T extends LexicalNode = any> = {
200
201
  validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>;
201
202
  };
202
203
  export type ServerFeature<ServerProps, ClientFeatureProps> = {
203
- ClientFeature?: PayloadComponent<never, ClientComponentProps<ClientFeatureProps>>;
204
+ ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>;
204
205
  /**
205
206
  * This determines what props will be available on the Client.
206
207
  */
207
208
  clientFeatureProps?: ClientFeatureProps;
208
209
  componentImports?: Config['admin']['importMap']['generators'][0] | PayloadComponent[];
209
- componentMap?: ((args: {
210
- i18n: I18nClient;
211
- payload: Payload;
212
- props: ServerProps;
213
- schemaPath: string;
214
- }) => {
215
- [key: string]: PayloadComponent;
216
- }) | {
217
- [key: string]: PayloadComponent;
218
- };
219
- generateSchemaMap?: (args: {
220
- config: SanitizedConfig;
221
- field: RichTextField;
222
- i18n: I18nClient;
223
- props: ServerProps;
224
- schemaMap: Map<string, Field[]>;
225
- schemaPath: string;
226
- }) => Map<string, Field[]> | null;
227
210
  generatedTypes?: {
228
211
  modifyOutputSchema: ({ collectionIDFieldTypes, config, currentSchema, field, interfaceNameDefinitions, isRequired, }: {
229
212
  collectionIDFieldTypes: {
@@ -242,6 +225,14 @@ export type ServerFeature<ServerProps, ClientFeatureProps> = {
242
225
  isRequired: boolean;
243
226
  }) => JSONSchema4;
244
227
  };
228
+ generateSchemaMap?: (args: {
229
+ config: SanitizedConfig;
230
+ field: RichTextField;
231
+ i18n: I18nClient;
232
+ props: ServerProps;
233
+ schemaMap: FieldSchemaMap;
234
+ schemaPath: string;
235
+ }) => FieldSchemaMap | null;
245
236
  hooks?: RichTextHooks;
246
237
  /**
247
238
  * Here you can provide i18n translations for your feature. These will only be available on the server and client.
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.d.ts","sourceRoot":"","sources":["../../src/features/typesServer.ts"],"names":[],"mappings":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AE,KAAK,CAAC,iBAAiB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QACxE,YAAY,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;QAC9E,cAAc,CAAC,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,sBAAsB,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAA;KACnF,CAAA,CAAC,yDAAyD;IAC3D,kDAAkD;IAClD,WAAW,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,cAAc,CAAC,CAAC,CAAA;CAChD,GAAG,QAAQ,CAAC,IAAI,CAAC,qBAAqB,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,MAAM,GAAG,sBAAsB,GAAG,OAAO,CAAC,CAAC,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { GenericLanguages, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Config,\n Field,\n JsonObject,\n Payload,\n PayloadComponent,\n PayloadRequest,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n ValidateOptions,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { AdapterProps } from '../types.js'\nimport type { HTMLConverter } from './converters/html/converter/types.js'\nimport type { ClientComponentProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: string\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n duplicate: boolean\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: { field: string; message: string }[]\n mergeLocaleActions: (() => Promise<void>)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * Allows you to define how a node can be serialized into different formats. Currently, only supports html.\n * Markdown converters are defined in `markdownTransformers` and not here.\n */\n converters?: {\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, ClientComponentProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n componentImports?: Config['admin']['importMap']['generators'][0] | PayloadComponent[]\n componentMap?:\n | ((args: { i18n: I18nClient; payload: Payload; props: ServerProps; schemaPath: string }) => {\n [key: string]: PayloadComponent\n })\n | {\n [key: string]: PayloadComponent\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: Map<string, Field[]>\n schemaPath: string\n }) => Map<string, Field[]> | null\n generatedTypes?: {\n modifyOutputSchema: ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: Transformer[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'markdownTransformers' | 'nodes'>>\n"],"mappings":"AAgXA","ignoreList":[]}
1
+ {"version":3,"file":"typesServer.js","names":[],"sources":["../../src/features/typesServer.ts"],"sourcesContent":["import type { Transformer } from '@lexical/markdown'\nimport type { GenericLanguages, I18nClient } from '@payloadcms/translations'\nimport type { JSONSchema4 } from 'json-schema'\nimport type {\n Klass,\n LexicalNode,\n LexicalNodeReplacement,\n SerializedEditorState,\n SerializedLexicalNode,\n} from 'lexical'\nimport type {\n Config,\n Field,\n FieldSchemaMap,\n JsonObject,\n Payload,\n PayloadComponent,\n PayloadRequest,\n PopulateType,\n ReplaceAny,\n RequestContext,\n RichTextField,\n RichTextHooks,\n SanitizedConfig,\n ValidateOptions,\n ValidationFieldError,\n} from 'payload'\n\nimport type { ServerEditorConfig } from '../lexical/config/types.js'\nimport type { AdapterProps } from '../types.js'\nimport type { HTMLConverter } from './converters/html/converter/types.js'\nimport type { BaseClientFeatureProps } from './typesClient.js'\n\nexport type PopulationPromise<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n context,\n currentDepth,\n depth,\n draft,\n editorPopulationPromises,\n field,\n fieldPromises,\n findMany,\n flattenLocales,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc,\n}: {\n context: RequestContext\n currentDepth: number\n depth: number\n draft: boolean\n /**\n * This maps all population promises to the node type\n */\n editorPopulationPromises: Map<string, Array<PopulationPromise>>\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * fieldPromises are used for things like field hooks. They will be awaited before awaiting populationPromises\n */\n fieldPromises: Promise<void>[]\n findMany: boolean\n flattenLocales: boolean\n node: T\n overrideAccess: boolean\n populationPromises: Promise<void>[]\n req: PayloadRequest\n showHiddenFields: boolean\n siblingDoc: JsonObject\n}) => void\n\nexport type NodeValidation<T extends SerializedLexicalNode = SerializedLexicalNode> = ({\n node,\n nodeValidations,\n validation,\n}: {\n node: T\n nodeValidations: Map<string, Array<NodeValidation>>\n validation: {\n options: ValidateOptions<unknown, unknown, RichTextField, SerializedEditorState>\n value: SerializedEditorState\n }\n}) => Promise<string | true> | string | true\n\nexport type FeatureProviderProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = (\n props?: UnSanitizedServerFeatureProps,\n) => FeatureProviderServer<UnSanitizedServerFeatureProps, ServerFeatureProps, ClientFeatureProps>\n\nexport type FeatureProviderServer<\n UnSanitizedServerFeatureProps = undefined,\n ServerFeatureProps = UnSanitizedServerFeatureProps,\n ClientFeatureProps = undefined,\n> = {\n /** Keys of dependencies needed for this feature. These dependencies do not have to be loaded first, but they have to exist, otherwise an error will be thrown. */\n dependencies?: string[]\n /** Keys of priority dependencies needed for this feature. These dependencies have to be loaded first AND have to exist, otherwise an error will be thrown. They will be available in the `feature` property. */\n dependenciesPriority?: string[]\n /** Keys of soft-dependencies needed for this feature. These are optional. Payload will attempt to load them before this feature, but doesn't throw an error if that's not possible. */\n dependenciesSoft?: string[]\n\n /**\n * This is being called during the payload sanitization process\n */\n feature:\n | ((props: {\n config: SanitizedConfig\n /** unSanitizedEditorConfig.features, but mapped */\n featureProviderMap: ServerFeatureProviderMap\n isRoot?: boolean\n parentIsLocalized: boolean\n // other resolved features, which have been loaded before this one. All features declared in 'dependencies' should be available here\n resolvedFeatures: ResolvedServerFeatureMap\n // unSanitized EditorConfig,\n unSanitizedEditorConfig: ServerEditorConfig\n }) =>\n | Promise<ServerFeature<ServerFeatureProps, ClientFeatureProps>>\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>)\n | ServerFeature<ServerFeatureProps, ClientFeatureProps>\n key: string\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n serverFeatureProps: UnSanitizedServerFeatureProps\n}\n\nexport type AfterReadNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `afterRead` hooks.\n */\n currentDepth: number\n /**\n * Only available in `afterRead` hooks.\n */\n depth: number\n draft: boolean\n fallbackLocale: string\n /**\n * Only available in `afterRead` field hooks.\n */\n fieldPromises: Promise<void>[]\n /** Boolean to denote if this hook is running against finding one, or finding many within the afterRead hook. */\n findMany: boolean\n flattenLocales: boolean\n /**\n * The requested locale.\n */\n locale: string\n overrideAccess: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n populateArg?: PopulateType\n /**\n * Only available in `afterRead` field hooks.\n */\n populationPromises: Promise<void>[]\n /**\n * Only available in `afterRead` hooks.\n */\n showHiddenFields: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerAccessControl: boolean\n /**\n * Only available in `afterRead` hooks.\n */\n triggerHooks: boolean\n}\n\nexport type AfterChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n}\nexport type BeforeValidateNodeHookArgs<T extends SerializedLexicalNode> = {\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n overrideAccess: boolean\n}\n\nexport type BeforeChangeNodeHookArgs<T extends SerializedLexicalNode> = {\n /**\n * Only available in `beforeChange` hooks.\n */\n errors: ValidationFieldError[]\n mergeLocaleActions: (() => Promise<void>)[]\n /** A string relating to which operation the field type is currently executing within. Useful within beforeValidate, beforeChange, and afterChange hooks to differentiate between create and update operations. */\n operation: 'create' | 'delete' | 'read' | 'update'\n /** The value of the node before any changes. Not available in afterRead hooks */\n originalNode: T\n /**\n * The original node with locales (not modified by any hooks).\n */\n originalNodeWithLocales?: T\n skipValidation: boolean\n}\n\nexport type BaseNodeHookArgs<T extends SerializedLexicalNode> = {\n context: RequestContext\n /** The value of the node. */\n node: T\n parentRichTextFieldPath: (number | string)[]\n parentRichTextFieldSchemaPath: string[]\n /** The payload request object. It is mocked for Local API operations. */\n req: PayloadRequest\n}\n\nexport type AfterReadNodeHook<T extends SerializedLexicalNode> = (\n args: AfterReadNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type AfterChangeNodeHook<T extends SerializedLexicalNode> = (\n args: AfterChangeNodeHookArgs<T> & BaseNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeChangeNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeChangeNodeHookArgs<T>,\n) => Promise<T> | T\n\nexport type BeforeValidateNodeHook<T extends SerializedLexicalNode> = (\n args: BaseNodeHookArgs<T> & BeforeValidateNodeHookArgs<T>,\n) => Promise<T> | T\n\n// Define the node with hooks that use the node's exportJSON return type\nexport type NodeWithHooks<T extends LexicalNode = any> = {\n /**\n * Allows you to define how a node can be serialized into different formats. Currently, only supports html.\n * Markdown converters are defined in `markdownTransformers` and not here.\n */\n converters?: {\n html?: HTMLConverter<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n }\n /**\n * If a node includes sub-fields (e.g. block and link nodes), passing those subFields here will make payload\n * automatically populate, run hooks, and generate component import maps for them\n */\n getSubFields?: (args: {\n /**\n * Optional. If not provided, all possible sub-fields should be returned.\n */\n node?: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req?: PayloadRequest\n }) => Field[] | null\n /**\n * If a node includes sub-fields, the sub-fields data needs to be returned here, alongside `getSubFields` which returns their schema.\n */\n getSubFieldsData?: (args: {\n node: ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>\n req: PayloadRequest\n }) => JsonObject\n /**\n * Allows you to run population logic when a node's data was requested from graphQL.\n * While `getSubFields` and `getSubFieldsData` automatically handle populating sub-fields (since they run hooks on them), those are only populated in the Rest API.\n * This is because the Rest API hooks do not have access to the 'depth' property provided by graphQL.\n * In order for them to be populated correctly in graphQL, the population logic needs to be provided here.\n */\n graphQLPopulationPromises?: Array<\n PopulationPromise<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n /**\n * Just like payload fields, you can provide hooks which are run for this specific node. These are called Node Hooks.\n */\n hooks?: {\n afterChange?: Array<AfterChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n afterRead?: Array<AfterReadNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeChange?: Array<BeforeChangeNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n beforeValidate?: Array<\n BeforeValidateNodeHook<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>\n >\n }\n /**\n * The actual lexical node needs to be provided here. This also supports [lexical node replacements](https://lexical.dev/docs/concepts/node-replacement).\n */\n node: Klass<T> | LexicalNodeReplacement\n /**\n * This allows you to provide node validations, which are run when your document is being validated, alongside other payload fields.\n * You can use it to throw a validation error for a specific node in case its data is incorrect.\n */\n validations?: Array<NodeValidation<ReturnType<ReplaceAny<T, LexicalNode>['exportJSON']>>>\n}\n\nexport type ServerFeature<ServerProps, ClientFeatureProps> = {\n ClientFeature?: PayloadComponent<never, BaseClientFeatureProps<ClientFeatureProps>>\n /**\n * This determines what props will be available on the Client.\n */\n clientFeatureProps?: ClientFeatureProps\n // @ts-expect-error - TODO: fix this\n componentImports?: Config['admin']['importMap']['generators'][0] | PayloadComponent[]\n generatedTypes?: {\n modifyOutputSchema: ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n }\n generateSchemaMap?: (args: {\n config: SanitizedConfig\n field: RichTextField\n i18n: I18nClient\n props: ServerProps\n schemaMap: FieldSchemaMap\n schemaPath: string\n }) => FieldSchemaMap | null\n hooks?: RichTextHooks\n /**\n * Here you can provide i18n translations for your feature. These will only be available on the server and client.\n *\n * Translations here are automatically scoped to `lexical.featureKey.yourKey`\n *\n * @Example\n * ```ts\n * i18n: {\n * en: {\n * label: 'Horizontal Rule',\n * },\n * de: {\n * label: 'Trennlinie',\n * },\n * }\n * ```\n * In order to access these translations, you would use `i18n.t('lexical:horizontalRule:label')`.\n */\n i18n?: Partial<GenericLanguages>\n markdownTransformers?: Transformer[]\n nodes?: Array<NodeWithHooks>\n\n /** Props which were passed into your feature will have to be passed here. This will allow them to be used / read in other places of the code, e.g. wherever you can use useEditorConfigContext */\n sanitizedServerFeatureProps?: ServerProps\n}\n\nexport type ResolvedServerFeature<ServerProps, ClientFeatureProps> = {\n order: number\n} & Required<\n Pick<\n FeatureProviderServer<ServerProps, ClientFeatureProps>,\n 'dependencies' | 'dependenciesPriority' | 'dependenciesSoft' | 'key'\n >\n> &\n ServerFeature<ServerProps, ClientFeatureProps>\n\nexport type ResolvedServerFeatureMap = Map<string, ResolvedServerFeature<any, any>>\n\nexport type ServerFeatureProviderMap = Map<string, FeatureProviderServer<any, any, any>>\n\nexport type SanitizedServerFeatures = {\n /** The node types mapped to their converters */\n converters: {\n html: HTMLConverter[]\n }\n /** The keys of all enabled features */\n enabledFeatures: string[]\n generatedTypes: {\n modifyOutputSchemas: Array<\n ({\n collectionIDFieldTypes,\n config,\n currentSchema,\n field,\n interfaceNameDefinitions,\n isRequired,\n }: {\n collectionIDFieldTypes: { [key: string]: 'number' | 'string' }\n config?: SanitizedConfig\n /**\n * Current schema which will be modified by this function.\n */\n currentSchema: JSONSchema4\n field: RichTextField<SerializedEditorState, AdapterProps>\n /**\n * Allows you to define new top-level interfaces that can be re-used in the output schema.\n */\n interfaceNameDefinitions: Map<string, JSONSchema4>\n isRequired: boolean\n }) => JSONSchema4\n >\n }\n /** The node types mapped to their hooks */\n\n getSubFields?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => Field[] | null\n >\n getSubFieldsData?: Map<\n string,\n (args: { node: SerializedLexicalNode; req: PayloadRequest }) => JsonObject\n >\n graphQLPopulationPromises: Map<string, Array<PopulationPromise>>\n hooks: RichTextHooks\n nodeHooks?: {\n afterChange?: Map<string, Array<AfterChangeNodeHook<SerializedLexicalNode>>>\n afterRead?: Map<string, Array<AfterReadNodeHook<SerializedLexicalNode>>>\n beforeChange?: Map<string, Array<BeforeChangeNodeHook<SerializedLexicalNode>>>\n beforeValidate?: Map<string, Array<BeforeValidateNodeHook<SerializedLexicalNode>>>\n } /** The node types mapped to their populationPromises */\n /** The node types mapped to their validations */\n validations: Map<string, Array<NodeValidation>>\n} & Required<Pick<ResolvedServerFeature<any, any>, 'i18n' | 'markdownTransformers' | 'nodes'>>\n"],"mappings":"AAiXA","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/component/index.tsx"],"names":[],"mappings":"AA4BA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAG1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AASlE,OAAO,cAAc,CAAA;AAQrB,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AA0OD,eAAO,MAAM,eAAe,UAAW,YAAY,KAAG,KAAK,CAAC,SAM3D,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/component/index.tsx"],"names":[],"mappings":"AAyBA,OAAO,KAAsE,MAAM,OAAO,CAAA;AAG1F,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAA;AAWlE,OAAO,cAAc,CAAA;AAQrB,MAAM,MAAM,YAAY,GAAG;IACzB,IAAI,EAAE,UAAU,CAAA;IAChB,OAAO,EAAE,MAAM,CAAA;CAChB,CAAA;AAuPD,eAAO,MAAM,eAAe,UAAW,YAAY,KAAG,KAAK,CAAC,SAM3D,CAAA"}
@@ -5,11 +5,13 @@ import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext
5
5
  import { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js';
6
6
  import { mergeRegister } from '@lexical/utils';
7
7
  import { getTranslation } from '@payloadcms/translations';
8
- import { Button, DrawerToggler, File, formatDrawerSlug, useConfig, useDocumentDrawer, useEditDepth, useModal, usePayloadAPI, useTranslation } from '@payloadcms/ui';
8
+ import { Button, File, formatDrawerSlug, useConfig, useEditDepth, usePayloadAPI, useTranslation } from '@payloadcms/ui';
9
9
  import { $getNodeByKey, $getSelection, $isNodeSelection, CLICK_COMMAND, COMMAND_PRIORITY_LOW, KEY_BACKSPACE_COMMAND, KEY_DELETE_COMMAND } from 'lexical';
10
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
+ import { useLexicalDocumentDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDocumentDrawer.js';
14
+ import { useLexicalDrawer } from '../../../../utilities/fieldsDrawer/useLexicalDrawer.js';
13
15
  import { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js';
14
16
  import { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js';
15
17
  import { $isUploadNode } from '../nodes/UploadNode.js';
@@ -26,6 +28,9 @@ const Component = props => {
26
28
  },
27
29
  nodeKey
28
30
  } = props;
31
+ if (typeof value === 'object') {
32
+ throw new Error('Upload value should be a string or number. The Lexical Upload component should not receive the populated value object.');
33
+ }
29
34
  const {
30
35
  config: {
31
36
  collections,
@@ -36,9 +41,6 @@ const Component = props => {
36
41
  }
37
42
  } = useConfig();
38
43
  const uploadRef = useRef(null);
39
- const {
40
- closeModal
41
- } = useModal();
42
44
  const {
43
45
  uuid
44
46
  } = useEditorConfigContext();
@@ -47,7 +49,10 @@ const Component = props => {
47
49
  const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey);
48
50
  const {
49
51
  editorConfig,
50
- field
52
+ fieldProps: {
53
+ readOnly,
54
+ schemaPath
55
+ }
51
56
  } = useEditorConfigContext();
52
57
  const {
53
58
  i18n,
@@ -56,13 +61,19 @@ const Component = props => {
56
61
  const [cacheBust, dispatchCacheBust] = useReducer(state => state + 1, 0);
57
62
  const [relatedCollection] = useState(() => collections.find(coll => coll.slug === relationTo));
58
63
  const componentID = useId();
59
- const drawerSlug = formatDrawerSlug({
64
+ const extraFieldsDrawerSlug = formatDrawerSlug({
60
65
  slug: `lexical-upload-drawer-` + uuid + componentID,
61
66
  depth: editDepth
62
67
  });
63
- const [DocumentDrawer, DocumentDrawerToggler, {
64
- closeDrawer
65
- }] = useDocumentDrawer({
68
+ // Need to use hook to initialize useEffect that restores cursor position
69
+ const {
70
+ toggleDrawer
71
+ } = useLexicalDrawer(extraFieldsDrawerSlug, true);
72
+ const {
73
+ closeDocumentDrawer,
74
+ DocumentDrawer,
75
+ DocumentDrawerToggler
76
+ } = useLexicalDocumentDrawer({
66
77
  id: value,
67
78
  collectionSlug: relatedCollection.slug
68
79
  });
@@ -77,7 +88,7 @@ const Component = props => {
77
88
  const thumbnailSRC = data?.thumbnailURL || data?.url;
78
89
  const removeUpload = useCallback(() => {
79
90
  editor.update(() => {
80
- $getNodeByKey(nodeKey).remove();
91
+ $getNodeByKey(nodeKey)?.remove();
81
92
  });
82
93
  }, [editor, nodeKey]);
83
94
  const updateUpload = useCallback(data_0 => {
@@ -86,37 +97,39 @@ const Component = props => {
86
97
  cacheBust
87
98
  });
88
99
  dispatchCacheBust();
89
- closeDrawer();
90
- }, [setParams, cacheBust, closeDrawer]);
100
+ closeDocumentDrawer();
101
+ }, [setParams, cacheBust, closeDocumentDrawer]);
91
102
  const $onDelete = useCallback(event => {
92
- if (isSelected && $isNodeSelection($getSelection())) {
103
+ const deleteSelection = $getSelection();
104
+ if (isSelected && $isNodeSelection(deleteSelection)) {
93
105
  event.preventDefault();
94
- const node = $getNodeByKey(nodeKey);
95
- if ($isUploadNode(node)) {
96
- node.remove();
97
- return true;
98
- }
106
+ editor.update(() => {
107
+ deleteSelection.getNodes().forEach(node => {
108
+ if ($isUploadNode(node)) {
109
+ node.remove();
110
+ }
111
+ });
112
+ });
99
113
  }
100
114
  return false;
101
- }, [isSelected, nodeKey]);
102
- const onClick = useCallback(event_0 => {
103
- // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked
104
- if (event_0.target === uploadRef.current || uploadRef.current?.contains(event_0.target)) {
105
- if (event_0.shiftKey) {
106
- setSelected(!isSelected);
107
- } else {
108
- if (!isSelected) {
109
- clearSelection();
110
- setSelected(true);
115
+ }, [editor, isSelected]);
116
+ useEffect(() => {
117
+ return mergeRegister(editor.registerCommand(CLICK_COMMAND, event_0 => {
118
+ // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked
119
+ if (event_0.target === uploadRef.current || uploadRef.current?.contains(event_0.target)) {
120
+ if (event_0.shiftKey) {
121
+ setSelected(!isSelected);
122
+ } else {
123
+ if (!isSelected) {
124
+ clearSelection();
125
+ setSelected(true);
126
+ }
111
127
  }
128
+ return true;
112
129
  }
113
- return true;
114
- }
115
- return false;
116
- }, [isSelected, setSelected, clearSelection]);
117
- useEffect(() => {
118
- return mergeRegister(editor.registerCommand(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW));
119
- }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick]);
130
+ return false;
131
+ }, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW), editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW));
132
+ }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected]);
120
133
  const hasExtraFields = editorConfig?.resolvedFeatureMap?.get('upload')?.sanitizedClientFeatureProps.collections?.[relatedCollection.slug]?.hasExtraFields;
121
134
  const onExtraFieldsDrawerSubmit = useCallback((_, data_1) => {
122
135
  // Update lexical node (with key nodeKey) with new data
@@ -130,8 +143,7 @@ const Component = props => {
130
143
  uploadNode.setData(newData);
131
144
  }
132
145
  });
133
- closeModal(drawerSlug);
134
- }, [closeModal, editor, drawerSlug, nodeKey]);
146
+ }, [editor, nodeKey]);
135
147
  return /*#__PURE__*/_jsxs("div", {
136
148
  className: [baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' '),
137
149
  contentEditable: false,
@@ -155,24 +167,22 @@ const Component = props => {
155
167
  children: getTranslation(relatedCollection.labels.singular, i18n)
156
168
  }), editor.isEditable() && /*#__PURE__*/_jsxs("div", {
157
169
  className: `${baseClass}__actions`,
158
- children: [hasExtraFields ? /*#__PURE__*/_jsx(DrawerToggler, {
170
+ children: [hasExtraFields ? /*#__PURE__*/_jsx(Button, {
171
+ buttonStyle: "icon-label",
159
172
  className: `${baseClass}__upload-drawer-toggler`,
160
- disabled: field?.admin?.readOnly,
161
- slug: drawerSlug,
162
- children: /*#__PURE__*/_jsx(Button, {
163
- buttonStyle: "icon-label",
164
- el: "div",
165
- icon: "edit",
166
- onClick: e => {
167
- e.preventDefault();
168
- },
169
- round: true,
170
- tooltip: t('fields:editRelationship')
171
- })
173
+ disabled: readOnly,
174
+ el: "button",
175
+ icon: "edit",
176
+ onClick: () => {
177
+ toggleDrawer();
178
+ },
179
+ round: true,
180
+ tooltip: t('fields:editRelationship')
172
181
  }) : null, /*#__PURE__*/_jsx(Button, {
173
182
  buttonStyle: "icon-label",
174
- disabled: field?.admin?.readOnly,
175
- el: "div",
183
+ className: `${baseClass}__swap-drawer-toggler`,
184
+ disabled: readOnly,
185
+ el: "button",
176
186
  icon: "swap",
177
187
  onClick: () => {
178
188
  editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {
@@ -186,10 +196,10 @@ const Component = props => {
186
196
  }), /*#__PURE__*/_jsx(Button, {
187
197
  buttonStyle: "icon-label",
188
198
  className: `${baseClass}__removeButton`,
189
- disabled: field?.admin?.readOnly,
199
+ disabled: readOnly,
190
200
  icon: "x",
191
- onClick: e_0 => {
192
- e_0.preventDefault();
201
+ onClick: e => {
202
+ e.preventDefault();
193
203
  removeUpload();
194
204
  },
195
205
  round: true,
@@ -206,16 +216,17 @@ const Component = props => {
206
216
  })
207
217
  })
208
218
  })]
209
- }), value && /*#__PURE__*/_jsx(DocumentDrawer, {
219
+ }), value ? /*#__PURE__*/_jsx(DocumentDrawer, {
210
220
  onSave: updateUpload
211
- }), hasExtraFields ? /*#__PURE__*/_jsx(FieldsDrawer, {
221
+ }) : null, hasExtraFields ? /*#__PURE__*/_jsx(FieldsDrawer, {
212
222
  data: fields,
213
- drawerSlug: drawerSlug,
223
+ drawerSlug: extraFieldsDrawerSlug,
214
224
  drawerTitle: t('general:editLabel', {
215
225
  label: getTranslation(relatedCollection.labels.singular, i18n)
216
226
  }),
217
227
  featureKey: "upload",
218
228
  handleDrawerSubmit: onExtraFieldsDrawerSubmit,
229
+ schemaPath: schemaPath,
219
230
  schemaPathSuffix: relatedCollection.slug
220
231
  }) : null]
221
232
  });
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","DrawerToggler","File","formatDrawerSlug","useConfig","useDocumentDrawer","useEditDepth","useModal","usePayloadAPI","useTranslation","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","React","useCallback","useEffect","useId","useReducer","useRef","useState","useEditorConfigContext","FieldsDrawer","EnabledRelationshipsCondition","INSERT_UPLOAD_WITH_DRAWER_COMMAND","$isUploadNode","baseClass","initialParams","depth","Component","props","data","fields","relationTo","value","nodeKey","config","collections","routes","api","serverURL","uploadRef","closeModal","uuid","editDepth","editor","isSelected","setSelected","clearSelection","editorConfig","field","i18n","t","cacheBust","dispatchCacheBust","state","relatedCollection","find","coll","slug","componentID","drawerSlug","DocumentDrawer","DocumentDrawerToggler","closeDrawer","id","collectionSlug","setParams","thumbnailSRC","thumbnailURL","url","removeUpload","update","remove","updateUpload","$onDelete","event","preventDefault","node","onClick","target","current","contains","shiftKey","registerCommand","hasExtraFields","resolvedFeatureMap","get","sanitizedClientFeatureProps","onExtraFieldsDrawerSubmit","_","uploadNode","newData","getData","setData","_jsxs","className","filter","Boolean","join","contentEditable","ref","_jsx","alt","filename","src","labels","singular","isEditable","disabled","admin","readOnly","buttonStyle","el","icon","e","round","tooltip","dispatchCommand","replace","onSave","drawerTitle","label","featureKey","handleDrawerSubmit","schemaPathSuffix","UploadComponent","uploads"],"sources":["../../../../../src/features/upload/client/component/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, Data } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n DrawerToggler,\n File,\n formatDrawerSlug,\n useConfig,\n useDocumentDrawer,\n useEditDepth,\n useModal,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, useId, useReducer, useRef, useState } from 'react'\n\nimport type { ClientComponentProps } from '../../../typesClient.js'\nimport type { UploadData } from '../../server/nodes/UploadNode.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.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 { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isUploadNode } from '../nodes/UploadNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n const {\n config: {\n collections,\n routes: { api },\n serverURL,\n },\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { closeModal } = useModal()\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const { editorConfig, field } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const componentID = useId()\n\n const drawerSlug = 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 const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id: value,\n collectionSlug: relatedCollection.slug,\n })\n\n // Get the referenced document\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (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 closeDrawer()\n },\n [setParams, cacheBust, closeDrawer],\n )\n\n const $onDelete = useCallback(\n (event: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isUploadNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (event: MouseEvent) => {\n // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked\n if (event.target === uploadRef.current || uploadRef.current?.contains(event.target as Node)) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected, onClick])\n\n const hasExtraFields = (\n editorConfig?.resolvedFeatureMap?.get('upload')\n ?.sanitizedClientFeatureProps as ClientComponentProps<UploadFeaturePropsClient>\n ).collections?.[relatedCollection.slug]?.hasExtraFields\n\n const onExtraFieldsDrawerSubmit = useCallback(\n (_, data) => {\n // Update lexical node (with key nodeKey) with new data\n editor.update(() => {\n const uploadNode: UploadNode | null = $getNodeByKey(nodeKey)\n if (uploadNode) {\n const newData: UploadData = {\n ...uploadNode.getData(),\n fields: data,\n }\n uploadNode.setData(newData)\n }\n })\n\n closeModal(drawerSlug)\n },\n [closeModal, editor, drawerSlug, nodeKey],\n )\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? (\n <img\n alt={data?.filename}\n data-lexical-upload-id={value}\n data-lexical-upload-relation-to={relationTo}\n src={thumbnailSRC}\n />\n ) : (\n <File />\n )}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <DrawerToggler\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={field?.admin?.readOnly}\n slug={drawerSlug}\n >\n <Button\n buttonStyle=\"icon-label\"\n el=\"div\"\n icon=\"edit\"\n onClick={(e) => {\n e.preventDefault()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n </DrawerToggler>\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n disabled={field?.admin?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.admin?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value && <DocumentDrawer onSave={updateUpload} />}\n {hasExtraFields ? (\n <FieldsDrawer\n data={fields}\n drawerSlug={drawerSlug}\n drawerTitle={t('general:editLabel', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n featureKey=\"upload\"\n handleDrawerSubmit={onExtraFieldsDrawerSubmit}\n schemaPathSuffix={relatedCollection.slug}\n />\n ) : null}\n </div>\n )\n}\n\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,uBAAuB,QAAQ;AACxC,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,aAAa,EACbC,IAAI,EACJC,gBAAgB,EAChBC,SAAS,EACTC,iBAAiB,EACjBC,YAAY,EACZC,QAAQ,EACRC,aAAa,EACbC,cAAc,QACT;AACP,SACEC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb;AACP,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAOnF,SAASC,sBAAsB,QAAQ;AACvC,SAASC,YAAY,QAAQ;AAC7B,SAASC,6BAA6B,QAAQ;AAC9C,SAASC,iCAAiC,QAAQ;AAClD,SAASC,aAAa,QAAQ;AAG9B,MAAMC,SAAA,GAAY;AAElB,MAAMC,aAAA,GAAgB;EACpBC,KAAA,EAAO;AACT;AAOA,MAAMC,SAAA,GAAqCC,KAAA;EACzC,MAAM;IACJC,IAAA,EAAM;MAAEC,MAAM;MAAEC,UAAU;MAAEC;IAAK,CAAE;IACnCC;EAAO,CACR,GAAGL,KAAA;EAEJ,MAAM;IACJM,MAAA,EAAQ;MACNC,WAAW;MACXC,MAAA,EAAQ;QAAEC;MAAG,CAAE;MACfC;IAAS;EACV,CACF,GAAGvC,SAAA;EACJ,MA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SAAA,EAAW,GAAGtE,SAAA,gBAAyB;cACvCmF,QAAA,EAAU3D,KAAA,EAAO4D,KAAA,EAAOC,QAAA;cACxBG,IAAA,EAAK;cACLnC,OAAA,EAAUoC,GAAA;gBACRA,GAAA,CAAEtC,cAAc;gBAChBN,YAAA;cACF;cACA6C,KAAK;cACLC,OAAA,EAASjE,CAAA,CAAE;;;;uBAMrBkD,IAAA,CAAC;QAAIN,SAAA,EAAW,GAAGtE,SAAA,aAAsB;kBACvC,aAAA4E,IAAA,CAACvC,qBAAA;UAAsBiC,SAAA,EAAW,GAAGtE,SAAA,sBAA+B;oBAClE,aAAA4E,IAAA,CAAC;sBAAQvE,IAAA,EAAMyE;;;;QAIpBtE,KAAA,iBAASoE,IAAA,CAACxC,cAAA;MAAe0D,MAAA,EAAQ9C;QACjCW,cAAA,gBACCiB,IAAA,CAAChF,YAAA;MACCS,IAAA,EAAMC,MAAA;MACN6B,UAAA,EAAYA,UAAA;MACZ4D,WAAA,EAAarE,CAAA,CAAE,qBAAqB;QAClCsE,KAAA,EAAO9H,cAAA,CAAe4D,iBAAA,CAAkBkD,MAAM,CAACC,QAAQ,EAAExD,IAAA;MAC3D;MACAwE,UAAA,EAAW;MACXC,kBAAA,EAAoBnC,yBAAA;MACpBoC,gBAAA,EAAkBrE,iBAAA,CAAkBG;SAEpC;;AAGV;AAEA,OAAO,MAAMmE,eAAA,GAAmBhG,KAAA;EAC9B,oBACEwE,IAAA,CAAC/E,6BAAA;IAA+B,GAAGO,KAAK;IAAEiG,OAAO;cAC/C,aAAAzB,IAAA,CAACzE,SAAA;MAAW,GAAGC;;;AAGrB","ignoreList":[]}
1
+ {"version":3,"file":"index.js","names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","File","formatDrawerSlug","useConfig","useEditDepth","usePayloadAPI","useTranslation","$getNodeByKey","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","React","useCallback","useEffect","useId","useReducer","useRef","useState","useEditorConfigContext","FieldsDrawer","useLexicalDocumentDrawer","useLexicalDrawer","EnabledRelationshipsCondition","INSERT_UPLOAD_WITH_DRAWER_COMMAND","$isUploadNode","baseClass","initialParams","depth","Component","props","data","fields","relationTo","value","nodeKey","Error","config","collections","routes","api","serverURL","uploadRef","uuid","editDepth","editor","isSelected","setSelected","clearSelection","editorConfig","fieldProps","readOnly","schemaPath","i18n","t","cacheBust","dispatchCacheBust","state","relatedCollection","find","coll","slug","componentID","extraFieldsDrawerSlug","toggleDrawer","closeDocumentDrawer","DocumentDrawer","DocumentDrawerToggler","id","collectionSlug","setParams","thumbnailSRC","thumbnailURL","url","removeUpload","update","remove","updateUpload","$onDelete","event","deleteSelection","preventDefault","getNodes","forEach","node","registerCommand","target","current","contains","shiftKey","hasExtraFields","resolvedFeatureMap","get","sanitizedClientFeatureProps","onExtraFieldsDrawerSubmit","_","uploadNode","newData","getData","setData","_jsxs","className","filter","Boolean","join","contentEditable","ref","_jsx","alt","filename","src","labels","singular","isEditable","buttonStyle","disabled","el","icon","onClick","round","tooltip","dispatchCommand","replace","e","onSave","drawerSlug","drawerTitle","label","featureKey","handleDrawerSubmit","schemaPathSuffix","UploadComponent","uploads"],"sources":["../../../../../src/features/upload/client/component/index.tsx"],"sourcesContent":["'use client'\nimport type { ClientCollectionConfig, Data } from 'payload'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport {\n Button,\n File,\n formatDrawerSlug,\n useConfig,\n useEditDepth,\n usePayloadAPI,\n useTranslation,\n} from '@payloadcms/ui'\nimport {\n $getNodeByKey,\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport React, { useCallback, useEffect, 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 '../feature.client.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 { EnabledRelationshipsCondition } from '../../../relationship/client/utils/EnabledRelationshipsCondition.js'\nimport { INSERT_UPLOAD_WITH_DRAWER_COMMAND } from '../drawer/commands.js'\nimport { $isUploadNode } from '../nodes/UploadNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-upload'\n\nconst initialParams = {\n depth: 0,\n}\n\nexport type ElementProps = {\n data: UploadData\n nodeKey: string\n}\n\nconst Component: React.FC<ElementProps> = (props) => {\n const {\n data: { fields, relationTo, value },\n nodeKey,\n } = props\n\n 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 collections,\n routes: { api },\n serverURL,\n },\n } = useConfig()\n const uploadRef = useRef<HTMLDivElement | null>(null)\n const { uuid } = useEditorConfigContext()\n const editDepth = useEditDepth()\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n\n const {\n editorConfig,\n fieldProps: { readOnly, schemaPath },\n } = useEditorConfigContext()\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [relatedCollection] = useState<ClientCollectionConfig>(\n () => collections.find((coll) => coll.slug === 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 `${serverURL}${api}/${relatedCollection.slug}/${value}`,\n { initialParams },\n )\n\n const thumbnailSRC = data?.thumbnailURL || data?.url\n\n const removeUpload = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey)?.remove()\n })\n }, [editor, nodeKey])\n\n const updateUpload = useCallback(\n (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 $onDelete = useCallback(\n (event: KeyboardEvent) => {\n const deleteSelection = $getSelection()\n if (isSelected && $isNodeSelection(deleteSelection)) {\n event.preventDefault()\n editor.update(() => {\n deleteSelection.getNodes().forEach((node) => {\n if ($isUploadNode(node)) {\n node.remove()\n }\n })\n })\n }\n return false\n },\n [editor, isSelected],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(\n CLICK_COMMAND,\n (event: MouseEvent) => {\n // Check if uploadRef.target or anything WITHIN uploadRef.target was clicked\n if (\n event.target === uploadRef.current ||\n uploadRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n COMMAND_PRIORITY_LOW,\n ),\n\n editor.registerCommand(KEY_DELETE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, $onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, $onDelete, setSelected])\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 (_, data) => {\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 return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={uploadRef}\n >\n <div className={`${baseClass}__card`}>\n <div className={`${baseClass}__topRow`}>\n {/* TODO: migrate to use @payloadcms/ui/elements/Thumbnail component */}\n <div className={`${baseClass}__thumbnail`}>\n {thumbnailSRC ? (\n <img\n alt={data?.filename}\n data-lexical-upload-id={value}\n data-lexical-upload-relation-to={relationTo}\n src={thumbnailSRC}\n />\n ) : (\n <File />\n )}\n </div>\n <div className={`${baseClass}__topRowRightPanel`}>\n <div className={`${baseClass}__collectionLabel`}>\n {getTranslation(relatedCollection.labels.singular, i18n)}\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n {hasExtraFields ? (\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__upload-drawer-toggler`}\n disabled={readOnly}\n el=\"button\"\n icon=\"edit\"\n onClick={() => {\n toggleDrawer()\n }}\n round\n tooltip={t('fields:editRelationship')}\n />\n ) : null}\n\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swap-drawer-toggler`}\n disabled={readOnly}\n el=\"button\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_UPLOAD_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapUpload')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeUpload()\n }}\n round\n tooltip={t('fields:removeUpload')}\n />\n </div>\n )}\n </div>\n </div>\n <div className={`${baseClass}__bottomRow`}>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <strong>{data?.filename}</strong>\n </DocumentDrawerToggler>\n </div>\n </div>\n {value ? <DocumentDrawer onSave={updateUpload} /> : 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\nexport const UploadComponent = (props: ElementProps): React.ReactNode => {\n return (\n <EnabledRelationshipsCondition {...props} uploads>\n <Component {...props} />\n </EnabledRelationshipsCondition>\n )\n}\n"],"mappings":"AAAA;;;AAGA,SAASA,yBAAyB,QAAQ;AAC1C,SAASC,uBAAuB,QAAQ;AACxC,SAASC,aAAa,QAAQ;AAC9B,SAASC,cAAc,QAAQ;AAC/B,SACEC,MAAM,EACNC,IAAI,EACJC,gBAAgB,EAChBC,SAAS,EACTC,YAAY,EACZC,aAAa,EACbC,cAAc,QACT;AACP,SACEC,aAAa,EACbC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb;AACP,OAAOC,KAAA,IAASC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ;AAOnF,SAASC,sBAAsB,QAAQ;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UAAA;MACZ8E,gBAAA,EAAkBxE,iBAAA,CAAkBG;SAEpC;;AAGV;AAEA,OAAO,MAAMsE,eAAA,GAAmBrG,KAAA;EAC9B,oBACE6E,IAAA,CAACpF,6BAAA;IAA+B,GAAGO,KAAK;IAAEsG,OAAO;cAC/C,aAAAzB,IAAA,CAAC9E,SAAA;MAAW,GAAGC;;;AAGrB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/drawer/index.tsx"],"names":[],"mappings":"AAMA,OAAO,KAA2C,MAAM,OAAO,CAAA;AA0C/D,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,MAAM,EAAE,CAAA;CACjC,CAAA;AA0CD,eAAO,MAAM,YAAY,UAAW,KAAK,KAAG,KAAK,CAAC,SAMjD,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/features/upload/client/drawer/index.tsx"],"names":[],"mappings":"AAKA,OAAO,KAA2C,MAAM,OAAO,CAAA;AA6C/D,KAAK,KAAK,GAAG;IACX,sBAAsB,EAAE,MAAM,EAAE,CAAA;CACjC,CAAA;AA0CD,eAAO,MAAM,YAAY,UAAW,KAAK,KAAG,KAAK,CAAC,SAMjD,CAAA"}