@payloadcms/richtext-lexical 3.0.0-beta.35 → 3.0.0-beta.37

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 (406) hide show
  1. package/dist/cell/index.d.ts +2 -0
  2. package/dist/cell/index.d.ts.map +1 -1
  3. package/dist/cell/index.js +24 -15
  4. package/dist/cell/index.js.map +1 -1
  5. package/dist/field/Field.d.ts.map +1 -1
  6. package/dist/field/Field.js +66 -47
  7. package/dist/field/Field.js.map +1 -1
  8. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  9. package/dist/field/features/align/feature.client.js +12 -4
  10. package/dist/field/features/align/feature.client.js.map +1 -1
  11. package/dist/field/features/align/feature.server.d.ts.map +1 -1
  12. package/dist/field/features/align/feature.server.js +2 -0
  13. package/dist/field/features/align/feature.server.js.map +1 -1
  14. package/dist/field/features/align/i18n.d.ts +3 -0
  15. package/dist/field/features/align/i18n.d.ts.map +1 -0
  16. package/dist/field/features/align/i18n.js +196 -0
  17. package/dist/field/features/align/i18n.js.map +1 -0
  18. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  19. package/dist/field/features/blockquote/feature.client.js +22 -21
  20. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  21. package/dist/field/features/blockquote/feature.server.d.ts.map +1 -1
  22. package/dist/field/features/blockquote/feature.server.js +2 -0
  23. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  24. package/dist/field/features/blockquote/i18n.d.ts +3 -0
  25. package/dist/field/features/blockquote/i18n.d.ts.map +1 -0
  26. package/dist/field/features/blockquote/i18n.js +100 -0
  27. package/dist/field/features/blockquote/i18n.js.map +1 -0
  28. package/dist/field/features/blocks/component/BlockContent.js +62 -45
  29. package/dist/field/features/blocks/component/BlockContent.js.map +1 -1
  30. package/dist/field/features/blocks/component/index.js +38 -28
  31. package/dist/field/features/blocks/component/index.js.map +1 -1
  32. package/dist/field/features/blocks/drawer/index.js +2 -1
  33. package/dist/field/features/blocks/drawer/index.js.map +1 -1
  34. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  35. package/dist/field/features/blocks/feature.client.js +3 -1
  36. package/dist/field/features/blocks/feature.client.js.map +1 -1
  37. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  38. package/dist/field/features/blocks/feature.server.js +2 -0
  39. package/dist/field/features/blocks/feature.server.js.map +1 -1
  40. package/dist/field/features/blocks/i18n.d.ts +3 -0
  41. package/dist/field/features/blocks/i18n.d.ts.map +1 -0
  42. package/dist/field/features/blocks/i18n.js +100 -0
  43. package/dist/field/features/blocks/i18n.js.map +1 -0
  44. package/dist/field/features/blocks/nodes/BlocksNode.d.ts +1 -1
  45. package/dist/field/features/blocks/nodes/BlocksNode.d.ts.map +1 -1
  46. package/dist/field/features/blocks/nodes/BlocksNode.js +2 -1
  47. package/dist/field/features/blocks/nodes/BlocksNode.js.map +1 -1
  48. package/dist/field/features/blocks/plugin/index.js +2 -1
  49. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  50. package/dist/field/features/blocks/populationPromise.js +1 -1
  51. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  52. package/dist/field/features/converters/html/field/index.d.ts.map +1 -1
  53. package/dist/field/features/converters/html/field/index.js +30 -2
  54. package/dist/field/features/converters/html/field/index.js.map +1 -1
  55. package/dist/field/features/debug/testRecorder/plugin/index.js +65 -39
  56. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
  57. package/dist/field/features/debug/treeView/plugin/index.js +2 -1
  58. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -1
  59. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  60. package/dist/field/features/heading/feature.client.js +26 -21
  61. package/dist/field/features/heading/feature.client.js.map +1 -1
  62. package/dist/field/features/heading/feature.server.d.ts.map +1 -1
  63. package/dist/field/features/heading/feature.server.js +2 -0
  64. package/dist/field/features/heading/feature.server.js.map +1 -1
  65. package/dist/field/features/heading/i18n.d.ts +3 -0
  66. package/dist/field/features/heading/i18n.d.ts.map +1 -0
  67. package/dist/field/features/heading/i18n.js +100 -0
  68. package/dist/field/features/heading/i18n.js.map +1 -0
  69. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -1
  70. package/dist/field/features/horizontalRule/feature.client.js +21 -20
  71. package/dist/field/features/horizontalRule/feature.client.js.map +1 -1
  72. package/dist/field/features/horizontalRule/feature.server.d.ts.map +1 -1
  73. package/dist/field/features/horizontalRule/feature.server.js +2 -0
  74. package/dist/field/features/horizontalRule/feature.server.js.map +1 -1
  75. package/dist/field/features/horizontalRule/i18n.d.ts +3 -0
  76. package/dist/field/features/horizontalRule/i18n.d.ts.map +1 -0
  77. package/dist/field/features/horizontalRule/i18n.js +100 -0
  78. package/dist/field/features/horizontalRule/i18n.js.map +1 -0
  79. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js +2 -1
  80. package/dist/field/features/horizontalRule/nodes/HorizontalRuleNode.js.map +1 -1
  81. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  82. package/dist/field/features/indent/feature.client.js +6 -2
  83. package/dist/field/features/indent/feature.client.js.map +1 -1
  84. package/dist/field/features/indent/feature.server.d.ts.map +1 -1
  85. package/dist/field/features/indent/feature.server.js +2 -0
  86. package/dist/field/features/indent/feature.server.js.map +1 -1
  87. package/dist/field/features/indent/i18n.d.ts +3 -0
  88. package/dist/field/features/indent/i18n.d.ts.map +1 -0
  89. package/dist/field/features/indent/i18n.js +132 -0
  90. package/dist/field/features/indent/i18n.js.map +1 -0
  91. package/dist/field/features/link/drawer/index.js +30 -22
  92. package/dist/field/features/link/drawer/index.js.map +1 -1
  93. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  94. package/dist/field/features/link/feature.client.js +7 -1
  95. package/dist/field/features/link/feature.client.js.map +1 -1
  96. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  97. package/dist/field/features/link/feature.server.js +10 -2
  98. package/dist/field/features/link/feature.server.js.map +1 -1
  99. package/dist/field/features/link/i18n.d.ts +3 -0
  100. package/dist/field/features/link/i18n.d.ts.map +1 -0
  101. package/dist/field/features/link/i18n.js +100 -0
  102. package/dist/field/features/link/i18n.js.map +1 -0
  103. package/dist/field/features/link/markdownTransformer.d.ts +6 -0
  104. package/dist/field/features/link/markdownTransformer.d.ts.map +1 -0
  105. package/dist/field/features/link/markdownTransformer.js +50 -0
  106. package/dist/field/features/link/markdownTransformer.js.map +1 -0
  107. package/dist/field/features/link/plugins/clickableLink/index.js +2 -1
  108. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  109. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  110. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +88 -70
  111. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  112. package/dist/field/features/link/plugins/floatingLinkEditor/index.js +2 -1
  113. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  114. package/dist/field/features/link/populationPromise.js +1 -1
  115. package/dist/field/features/link/populationPromise.js.map +1 -1
  116. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  117. package/dist/field/features/lists/checklist/feature.client.js +21 -20
  118. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  119. package/dist/field/features/lists/checklist/feature.server.d.ts.map +1 -1
  120. package/dist/field/features/lists/checklist/feature.server.js +2 -0
  121. package/dist/field/features/lists/checklist/feature.server.js.map +1 -1
  122. package/dist/field/features/lists/checklist/i18n.d.ts +3 -0
  123. package/dist/field/features/lists/checklist/i18n.d.ts.map +1 -0
  124. package/dist/field/features/lists/checklist/i18n.js +100 -0
  125. package/dist/field/features/lists/checklist/i18n.js.map +1 -0
  126. package/dist/field/features/lists/checklist/plugin/index.js +2 -1
  127. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  128. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -1
  129. package/dist/field/features/lists/orderedList/feature.client.js +19 -18
  130. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -1
  131. package/dist/field/features/lists/orderedList/feature.server.d.ts.map +1 -1
  132. package/dist/field/features/lists/orderedList/feature.server.js +3 -1
  133. package/dist/field/features/lists/orderedList/feature.server.js.map +1 -1
  134. package/dist/field/features/lists/orderedList/i18n.d.ts +3 -0
  135. package/dist/field/features/lists/orderedList/i18n.d.ts.map +1 -0
  136. package/dist/field/features/lists/orderedList/i18n.js +100 -0
  137. package/dist/field/features/lists/orderedList/i18n.js.map +1 -0
  138. package/dist/field/features/lists/plugin/index.js +2 -1
  139. package/dist/field/features/lists/plugin/index.js.map +1 -1
  140. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts +3 -0
  141. package/dist/field/features/lists/shared/slashMenuListGroup.d.ts.map +1 -0
  142. package/dist/field/features/lists/shared/slashMenuListGroup.js +11 -0
  143. package/dist/field/features/lists/shared/slashMenuListGroup.js.map +1 -0
  144. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -1
  145. package/dist/field/features/lists/unorderedList/feature.client.js +19 -18
  146. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -1
  147. package/dist/field/features/lists/unorderedList/feature.server.d.ts.map +1 -1
  148. package/dist/field/features/lists/unorderedList/feature.server.js +2 -0
  149. package/dist/field/features/lists/unorderedList/feature.server.js.map +1 -1
  150. package/dist/field/features/lists/unorderedList/i18n.d.ts +3 -0
  151. package/dist/field/features/lists/unorderedList/i18n.d.ts.map +1 -0
  152. package/dist/field/features/lists/unorderedList/i18n.js +100 -0
  153. package/dist/field/features/lists/unorderedList/i18n.js.map +1 -0
  154. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  155. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  156. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  157. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  158. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js +2 -1
  159. package/dist/field/features/migrations/lexicalPluginToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  160. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js +9 -1
  161. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/Component.js.map +1 -1
  162. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts +1 -1
  163. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.d.ts.map +1 -1
  164. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js +2 -1
  165. package/dist/field/features/migrations/slateToLexical/nodes/unknownConvertedNode/index.js.map +1 -1
  166. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  167. package/dist/field/features/paragraph/feature.client.js +24 -23
  168. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  169. package/dist/field/features/paragraph/feature.server.d.ts.map +1 -1
  170. package/dist/field/features/paragraph/feature.server.js +2 -0
  171. package/dist/field/features/paragraph/feature.server.js.map +1 -1
  172. package/dist/field/features/paragraph/i18n.d.ts +3 -0
  173. package/dist/field/features/paragraph/i18n.d.ts.map +1 -0
  174. package/dist/field/features/paragraph/i18n.js +132 -0
  175. package/dist/field/features/paragraph/i18n.js.map +1 -0
  176. package/dist/field/features/relationship/drawer/index.js +10 -2
  177. package/dist/field/features/relationship/drawer/index.js.map +1 -1
  178. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  179. package/dist/field/features/relationship/feature.client.js +23 -22
  180. package/dist/field/features/relationship/feature.client.js.map +1 -1
  181. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  182. package/dist/field/features/relationship/feature.server.js +2 -0
  183. package/dist/field/features/relationship/feature.server.js.map +1 -1
  184. package/dist/field/features/relationship/i18n.d.ts +3 -0
  185. package/dist/field/features/relationship/i18n.d.ts.map +1 -0
  186. package/dist/field/features/relationship/i18n.js +100 -0
  187. package/dist/field/features/relationship/i18n.js.map +1 -0
  188. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts +1 -1
  189. package/dist/field/features/relationship/nodes/RelationshipNode.d.ts.map +1 -1
  190. package/dist/field/features/relationship/nodes/RelationshipNode.js +2 -1
  191. package/dist/field/features/relationship/nodes/RelationshipNode.js.map +1 -1
  192. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +64 -44
  193. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  194. package/dist/field/features/relationship/plugins/index.js +2 -1
  195. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  196. package/dist/field/features/shared/slashMenu/basicGroup.d.ts +3 -0
  197. package/dist/field/features/shared/slashMenu/basicGroup.d.ts.map +1 -0
  198. package/dist/field/features/shared/slashMenu/basicGroup.js +11 -0
  199. package/dist/field/features/shared/slashMenu/basicGroup.js.map +1 -0
  200. package/dist/field/features/toolbars/fixed/Toolbar/index.js +60 -55
  201. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -1
  202. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +16 -2
  203. package/dist/field/features/toolbars/inline/Toolbar/index.js +57 -49
  204. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -1
  205. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +1 -1
  206. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -1
  207. package/dist/field/features/toolbars/shared/ToolbarButton/index.js +5 -3
  208. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -1
  209. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -1
  210. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js +54 -35
  211. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -1
  212. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +1 -1
  213. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -1
  214. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +25 -22
  215. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -1
  216. package/dist/field/features/toolbars/types.d.ts +1 -1
  217. package/dist/field/features/toolbars/types.d.ts.map +1 -1
  218. package/dist/field/features/toolbars/types.js.map +1 -1
  219. package/dist/field/features/types.d.ts +21 -2
  220. package/dist/field/features/types.d.ts.map +1 -1
  221. package/dist/field/features/types.js.map +1 -1
  222. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js +30 -22
  223. package/dist/field/features/upload/component/ExtraFieldsDrawer/index.js.map +1 -1
  224. package/dist/field/features/upload/component/index.js +104 -71
  225. package/dist/field/features/upload/component/index.js.map +1 -1
  226. package/dist/field/features/upload/drawer/index.js +8 -4
  227. package/dist/field/features/upload/drawer/index.js.map +1 -1
  228. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  229. package/dist/field/features/upload/feature.client.js +26 -25
  230. package/dist/field/features/upload/feature.client.js.map +1 -1
  231. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  232. package/dist/field/features/upload/feature.server.js +2 -0
  233. package/dist/field/features/upload/feature.server.js.map +1 -1
  234. package/dist/field/features/upload/i18n.d.ts +3 -0
  235. package/dist/field/features/upload/i18n.d.ts.map +1 -0
  236. package/dist/field/features/upload/i18n.js +100 -0
  237. package/dist/field/features/upload/i18n.js.map +1 -0
  238. package/dist/field/features/upload/nodes/UploadNode.d.ts +1 -1
  239. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  240. package/dist/field/features/upload/nodes/UploadNode.js +2 -1
  241. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  242. package/dist/field/features/upload/plugin/index.js +2 -1
  243. package/dist/field/features/upload/plugin/index.js.map +1 -1
  244. package/dist/field/features/upload/populationPromise.js +1 -1
  245. package/dist/field/features/upload/populationPromise.js.map +1 -1
  246. package/dist/field/index.d.ts +2 -0
  247. package/dist/field/index.d.ts.map +1 -1
  248. package/dist/field/index.js +29 -21
  249. package/dist/field/index.js.map +1 -1
  250. package/dist/field/index.scss +0 -19
  251. package/dist/field/lexical/EditorFocusProvider.d.ts +1 -2
  252. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -1
  253. package/dist/field/lexical/EditorFocusProvider.js +5 -3
  254. package/dist/field/lexical/EditorFocusProvider.js.map +1 -1
  255. package/dist/field/lexical/EditorPlugin.js +3 -2
  256. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  257. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  258. package/dist/field/lexical/LexicalEditor.js +115 -81
  259. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  260. package/dist/field/lexical/LexicalEditor.scss +10 -1
  261. package/dist/field/lexical/LexicalProvider.js +16 -10
  262. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  263. package/dist/field/lexical/config/client/EditorConfigProvider.js +5 -3
  264. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  265. package/dist/field/lexical/config/client/sanitize.d.ts +2 -1
  266. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  267. package/dist/field/lexical/config/client/sanitize.js +2 -1
  268. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  269. package/dist/field/lexical/config/server/sanitize.d.ts.map +1 -1
  270. package/dist/field/lexical/config/server/sanitize.js +11 -0
  271. package/dist/field/lexical/config/server/sanitize.js.map +1 -1
  272. package/dist/field/lexical/config/types.d.ts +2 -0
  273. package/dist/field/lexical/config/types.d.ts.map +1 -1
  274. package/dist/field/lexical/config/types.js.map +1 -1
  275. package/dist/field/lexical/plugins/MarkdownShortcut/index.js +2 -1
  276. package/dist/field/lexical/plugins/MarkdownShortcut/index.js.map +1 -1
  277. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts +1 -1
  278. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.d.ts.map +1 -1
  279. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/LexicalMenu.js.map +1 -1
  280. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts +1 -1
  281. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.d.ts.map +1 -1
  282. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js +2 -1
  283. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/index.js.map +1 -1
  284. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +2 -2
  285. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  286. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  287. package/dist/field/lexical/plugins/SlashMenu/index.js +51 -40
  288. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  289. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts +2 -2
  290. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.d.ts.map +1 -1
  291. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js +38 -119
  292. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.js.map +1 -1
  293. package/dist/field/lexical/plugins/handles/AddBlockHandlePlugin/index.scss +2 -2
  294. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts +1 -1
  295. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.d.ts.map +1 -1
  296. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/highlightElemOriginalPosition.js.map +1 -1
  297. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts +2 -2
  298. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  299. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +102 -58
  300. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  301. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +12 -3
  302. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts +8 -1
  303. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  304. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +73 -25
  305. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  306. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts +5 -0
  307. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.d.ts.map +1 -0
  308. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js +21 -0
  309. package/dist/field/lexical/plugins/handles/utils/calculateDistanceFromScrollerElem.js.map +1 -0
  310. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.d.ts +4 -0
  311. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.d.ts.map +1 -0
  312. package/dist/field/lexical/plugins/handles/{DraggableBlockPlugin → utils}/getNodeCloseToPoint.js +2 -14
  313. package/dist/field/lexical/plugins/handles/utils/getNodeCloseToPoint.js.map +1 -0
  314. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.d.ts.map +1 -1
  315. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js +4 -2
  316. package/dist/field/lexical/plugins/handles/utils/setHandlePosition.js.map +1 -1
  317. package/dist/field/lexical/theme/EditorTheme.scss +5 -0
  318. package/dist/field/lexical/ui/ContentEditable.d.ts +1 -1
  319. package/dist/field/lexical/ui/ContentEditable.d.ts.map +1 -1
  320. package/dist/field/lexical/ui/ContentEditable.js +2 -1
  321. package/dist/field/lexical/ui/ContentEditable.js.map +1 -1
  322. package/dist/field/lexical/ui/ContentEditable.scss +50 -2
  323. package/dist/field/lexical/ui/icons/AI/index.js +26 -17
  324. package/dist/field/lexical/ui/icons/AI/index.js.map +1 -1
  325. package/dist/field/lexical/ui/icons/Add/index.js +14 -9
  326. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -1
  327. package/dist/field/lexical/ui/icons/Add/light.svg +4 -0
  328. package/dist/field/lexical/ui/icons/AlignCenter/index.js +21 -15
  329. package/dist/field/lexical/ui/icons/AlignCenter/index.js.map +1 -1
  330. package/dist/field/lexical/ui/icons/AlignJustify/index.js +21 -15
  331. package/dist/field/lexical/ui/icons/AlignJustify/index.js.map +1 -1
  332. package/dist/field/lexical/ui/icons/AlignLeft/index.js +21 -15
  333. package/dist/field/lexical/ui/icons/AlignLeft/index.js.map +1 -1
  334. package/dist/field/lexical/ui/icons/AlignRight/index.js +21 -15
  335. package/dist/field/lexical/ui/icons/AlignRight/index.js.map +1 -1
  336. package/dist/field/lexical/ui/icons/Block/index.js +30 -24
  337. package/dist/field/lexical/ui/icons/Block/index.js.map +1 -1
  338. package/dist/field/lexical/ui/icons/Blockquote/index.js +8 -6
  339. package/dist/field/lexical/ui/icons/Blockquote/index.js.map +1 -1
  340. package/dist/field/lexical/ui/icons/Bold/index.js +8 -6
  341. package/dist/field/lexical/ui/icons/Bold/index.js.map +1 -1
  342. package/dist/field/lexical/ui/icons/Checklist/index.js +19 -14
  343. package/dist/field/lexical/ui/icons/Checklist/index.js.map +1 -1
  344. package/dist/field/lexical/ui/icons/Code/index.js +14 -9
  345. package/dist/field/lexical/ui/icons/Code/index.js.map +1 -1
  346. package/dist/field/lexical/ui/icons/CodeBlock/index.js +14 -9
  347. package/dist/field/lexical/ui/icons/CodeBlock/index.js.map +1 -1
  348. package/dist/field/lexical/ui/icons/DraggableBlock/light.svg +9 -0
  349. package/dist/field/lexical/ui/icons/H1/index.js +8 -6
  350. package/dist/field/lexical/ui/icons/H1/index.js.map +1 -1
  351. package/dist/field/lexical/ui/icons/H2/index.js +8 -6
  352. package/dist/field/lexical/ui/icons/H2/index.js.map +1 -1
  353. package/dist/field/lexical/ui/icons/H3/index.js +8 -6
  354. package/dist/field/lexical/ui/icons/H3/index.js.map +1 -1
  355. package/dist/field/lexical/ui/icons/H4/index.js +8 -6
  356. package/dist/field/lexical/ui/icons/H4/index.js.map +1 -1
  357. package/dist/field/lexical/ui/icons/H5/index.js +8 -6
  358. package/dist/field/lexical/ui/icons/H5/index.js.map +1 -1
  359. package/dist/field/lexical/ui/icons/H6/index.js +8 -6
  360. package/dist/field/lexical/ui/icons/H6/index.js.map +1 -1
  361. package/dist/field/lexical/ui/icons/HorizontalRule/index.js +11 -9
  362. package/dist/field/lexical/ui/icons/HorizontalRule/index.js.map +1 -1
  363. package/dist/field/lexical/ui/icons/IndentDecrease/index.js +25 -18
  364. package/dist/field/lexical/ui/icons/IndentDecrease/index.js.map +1 -1
  365. package/dist/field/lexical/ui/icons/IndentIncrease/index.js +25 -18
  366. package/dist/field/lexical/ui/icons/IndentIncrease/index.js.map +1 -1
  367. package/dist/field/lexical/ui/icons/Italic/index.js +8 -6
  368. package/dist/field/lexical/ui/icons/Italic/index.js.map +1 -1
  369. package/dist/field/lexical/ui/icons/Link/index.js +26 -17
  370. package/dist/field/lexical/ui/icons/Link/index.js.map +1 -1
  371. package/dist/field/lexical/ui/icons/OrderedList/index.js +29 -21
  372. package/dist/field/lexical/ui/icons/OrderedList/index.js.map +1 -1
  373. package/dist/field/lexical/ui/icons/Relationship/index.js +26 -17
  374. package/dist/field/lexical/ui/icons/Relationship/index.js.map +1 -1
  375. package/dist/field/lexical/ui/icons/Strikethrough/index.js +14 -9
  376. package/dist/field/lexical/ui/icons/Strikethrough/index.js.map +1 -1
  377. package/dist/field/lexical/ui/icons/Subscript/index.js +8 -6
  378. package/dist/field/lexical/ui/icons/Subscript/index.js.map +1 -1
  379. package/dist/field/lexical/ui/icons/Superscript/index.js +8 -6
  380. package/dist/field/lexical/ui/icons/Superscript/index.js.map +1 -1
  381. package/dist/field/lexical/ui/icons/Text/index.js +8 -6
  382. package/dist/field/lexical/ui/icons/Text/index.js.map +1 -1
  383. package/dist/field/lexical/ui/icons/Underline/index.js +14 -9
  384. package/dist/field/lexical/ui/icons/Underline/index.js.map +1 -1
  385. package/dist/field/lexical/ui/icons/UnorderedList/index.js +45 -36
  386. package/dist/field/lexical/ui/icons/UnorderedList/index.js.map +1 -1
  387. package/dist/field/lexical/ui/icons/Upload/index.js +24 -18
  388. package/dist/field/lexical/ui/icons/Upload/index.js.map +1 -1
  389. package/dist/field/lexical/utils/url.d.ts.map +1 -1
  390. package/dist/field/lexical/utils/url.js +10 -2
  391. package/dist/field/lexical/utils/url.js.map +1 -1
  392. package/dist/generateComponentMap.js +8 -8
  393. package/dist/generateComponentMap.js.map +1 -1
  394. package/dist/i18n.d.ts +3 -0
  395. package/dist/i18n.d.ts.map +1 -0
  396. package/dist/i18n.js +164 -0
  397. package/dist/i18n.js.map +1 -0
  398. package/dist/index.d.ts.map +1 -1
  399. package/dist/index.js +13 -0
  400. package/dist/index.js.map +1 -1
  401. package/dist/types.d.ts +7 -0
  402. package/dist/types.d.ts.map +1 -1
  403. package/dist/types.js.map +1 -1
  404. package/package.json +20 -15
  405. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +0 -1
  406. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/upload/feature.server.ts"],"sourcesContent":["import type { Config } from 'payload/config'\nimport type { Field, FileData, FileSize, Payload, TypeWithID } from 'payload/types'\n\nimport { traverseFields } from '@payloadcms/next/utilities'\nimport { sanitizeFields } from 'payload/config'\n\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { UploadFeaturePropsClient } from './feature.client.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { UploadFeatureClientComponent } from './feature.client.js'\nimport { UploadNode } from './nodes/UploadNode.js'\nimport { uploadPopulationPromiseHOC } from './populationPromise.js'\nimport { uploadValidation } from './validate.js'\n\nexport type UploadFeatureProps = {\n collections?: {\n [collection: string]: {\n fields: Field[]\n }\n }\n /**\n * Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n}\n\n/**\n * Get the absolute URL for an upload URL by potentially prepending the serverURL\n */\nfunction getAbsoluteURL(url: string, payload: Payload): string {\n return url?.startsWith('http') ? url : (payload?.config?.serverURL || '') + url\n}\n\nexport const UploadFeature: FeatureProviderProviderServer<\n UploadFeatureProps,\n UploadFeaturePropsClient\n> = (props) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = {\n collections: {},\n }\n if (props.collections) {\n for (const collection in props.collections) {\n clientProps.collections[collection] = {\n hasExtraFields: props.collections[collection].fields.length >= 1,\n }\n }\n }\n\n return {\n feature: async ({ config: _config, isRoot }) => {\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const collection in props.collections) {\n if (props.collections[collection].fields?.length) {\n props.collections[collection].fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: props.collections[collection].fields,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n return {\n ClientComponent: UploadFeatureClientComponent,\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ config, i18n, props }) => {\n if (!props?.collections) return null\n\n const schemaMap = new Map<string, Field[]>()\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n for (const collection in props.collections) {\n if (props.collections[collection].fields?.length) {\n schemaMap.set(collection, props.collections[collection].fields)\n traverseFields({\n config,\n fields: props.collections[collection].fields,\n i18n,\n schemaMap,\n schemaPath: collection,\n validRelationships,\n })\n }\n }\n\n return schemaMap\n },\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({ node, payload }) => {\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n if (payload) {\n let uploadDocument: TypeWithID & FileData\n\n try {\n uploadDocument = (await payload.findByID({\n id,\n collection: node.relationTo,\n })) as TypeWithID & FileData\n } catch (ignored) {\n // eslint-disable-next-line no-console\n console.error(\n 'Lexical upload node HTML converter: error fetching upload file',\n ignored,\n 'Node:',\n node,\n )\n return `<img />`\n }\n\n const url = getAbsoluteURL(uploadDocument?.url, payload)\n\n /**\n * If the upload is not an image, return a link to the upload\n */\n if (!uploadDocument?.mimeType?.startsWith('image')) {\n return `<a href=\"${url}\" rel=\"noopener noreferrer\">${uploadDocument.filename}</a>`\n }\n\n /**\n * If the upload is a simple image with no different sizes, return a simple img tag\n */\n if (!uploadDocument?.sizes || !Object.keys(uploadDocument?.sizes).length) {\n return `<img src=\"${url}\" alt=\"${uploadDocument?.filename}\" width=\"${uploadDocument?.width}\" height=\"${uploadDocument?.height}\"/>`\n }\n\n /**\n * If the upload is an image with different sizes, return a picture element\n */\n let pictureHTML = '<picture>'\n\n // Iterate through each size in the data.sizes object\n for (const size in uploadDocument.sizes) {\n const imageSize: FileSize & {\n url?: string\n } = uploadDocument.sizes[size]\n\n // Skip if any property of the size object is null\n if (\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n const imageSizeURL = getAbsoluteURL(imageSize?.url, payload)\n\n pictureHTML += `<source srcset=\"${imageSizeURL}\" media=\"(max-width: ${imageSize.width}px)\" type=\"${imageSize.mimeType}\">`\n }\n\n // Add the default img tag\n pictureHTML += `<img src=\"${url}\" alt=\"Image\" width=\"${uploadDocument.width}\" height=\"${uploadDocument.height}\">`\n pictureHTML += '</picture>'\n return pictureHTML\n } else {\n return `<img src=\"${id}\" />`\n }\n },\n nodeTypes: [UploadNode.getType()],\n },\n },\n node: UploadNode,\n populationPromises: [uploadPopulationPromiseHOC(props)],\n validations: [uploadValidation(props)],\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'upload',\n serverFeatureProps: props,\n }\n}\n"],"names":["traverseFields","sanitizeFields","createNode","UploadFeatureClientComponent","UploadNode","uploadPopulationPromiseHOC","uploadValidation","getAbsoluteURL","url","payload","startsWith","config","serverURL","UploadFeature","props","collections","clientProps","collection","hasExtraFields","fields","length","feature","_config","isRoot","validRelationships","map","c","slug","requireFieldLevelRichTextEditor","ClientComponent","clientFeatureProps","generateSchemaMap","i18n","schemaMap","Map","set","schemaPath","nodes","converters","html","converter","node","id","value","uploadDocument","findByID","relationTo","ignored","console","error","mimeType","filename","sizes","Object","keys","width","height","pictureHTML","size","imageSize","filesize","imageSizeURL","nodeTypes","getType","populationPromises","validations","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,cAAc,QAAQ,6BAA4B;AAC3D,SAASC,cAAc,QAAQ,iBAAgB;AAK/C,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,4BAA4B,QAAQ,sBAAqB;AAClE,SAASC,UAAU,QAAQ,wBAAuB;AAClD,SAASC,0BAA0B,QAAQ,yBAAwB;AACnE,SAASC,gBAAgB,QAAQ,gBAAe;AAiBhD;;CAEC,GACD,SAASC,eAAeC,GAAW,EAAEC,OAAgB;IACnD,OAAOD,KAAKE,WAAW,UAAUF,MAAM,AAACC,CAAAA,SAASE,QAAQC,aAAa,EAAC,IAAKJ;AAC9E;AAEA,OAAO,MAAMK,gBAGT,CAACC;IACH,IAAI,CAACA,OAAO;QACVA,QAAQ;YAAEC,aAAa,CAAC;QAAE;IAC5B;IAEA,MAAMC,cAAwC;QAC5CD,aAAa,CAAC;IAChB;IACA,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AAQ,IACnB,CAACD,UAAUR,QAAQ,IACnB,CAACQ,UAAUnD,GAAG,EACd;gDACA;4CACF;4CACA,MAAMqD,eAAetD,eAAeoD,WAAWnD,KAAKC;4CAEpDgD,eAAe,CAAC,gBAAgB,EAAEI,aAAa,qBAAqB,EAAEF,UAAUJ,KAAK,CAAC,WAAW,EAAEI,UAAUT,QAAQ,CAAC,EAAE,CAAC;wCAC3H;wCAEA,0BAA0B;wCAC1BO,eAAe,CAAC,UAAU,EAAEjD,IAAI,qBAAqB,EAAEoC,eAAeW,KAAK,CAAC,UAAU,EAAEX,eAAeY,MAAM,CAAC,EAAE,CAAC;wCACjHC,eAAe;wCACf,OAAOA;oCACT,OAAO;wCACL,OAAO,CAAC,UAAU,EAAEf,GAAG,IAAI,CAAC;oCAC9B;gCACF;gCACAoB,WAAW;oCAAC1D,WAAW2D,OAAO;iCAAG;4BACnC;wBACF;wBACAtB,MAAMrC;wBACN4D,oBAAoB;4BAAC3D,2BAA2BS;yBAAO;wBACvDmD,aAAa;4BAAC3D,iBAAiBQ;yBAAO;oBACxC;iBACD;gBACDoD,oBAAoBpD;YACtB;QACF;QACAqD,KAAK;QACLD,oBAAoBpD;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/upload/feature.server.ts"],"sourcesContent":["import type { Config } from 'payload/config'\nimport type { Field, FileData, FileSize, Payload, TypeWithID } from 'payload/types'\n\nimport { traverseFields } from '@payloadcms/next/utilities'\nimport { sanitizeFields } from 'payload/config'\n\nimport type { FeatureProviderProviderServer } from '../types.js'\nimport type { UploadFeaturePropsClient } from './feature.client.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { UploadFeatureClientComponent } from './feature.client.js'\nimport { i18n } from './i18n.js'\nimport { UploadNode } from './nodes/UploadNode.js'\nimport { uploadPopulationPromiseHOC } from './populationPromise.js'\nimport { uploadValidation } from './validate.js'\n\nexport type UploadFeatureProps = {\n collections?: {\n [collection: string]: {\n fields: Field[]\n }\n }\n /**\n * Sets a maximum population depth for this upload (not the fields for this upload), regardless of the remaining depth when the respective field is reached.\n * This behaves exactly like the maxDepth properties of relationship and upload fields.\n *\n * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}\n */\n maxDepth?: number\n}\n\n/**\n * Get the absolute URL for an upload URL by potentially prepending the serverURL\n */\nfunction getAbsoluteURL(url: string, payload: Payload): string {\n return url?.startsWith('http') ? url : (payload?.config?.serverURL || '') + url\n}\n\nexport const UploadFeature: FeatureProviderProviderServer<\n UploadFeatureProps,\n UploadFeaturePropsClient\n> = (props) => {\n if (!props) {\n props = { collections: {} }\n }\n\n const clientProps: UploadFeaturePropsClient = {\n collections: {},\n }\n if (props.collections) {\n for (const collection in props.collections) {\n clientProps.collections[collection] = {\n hasExtraFields: props.collections[collection].fields.length >= 1,\n }\n }\n }\n\n return {\n feature: async ({ config: _config, isRoot }) => {\n const validRelationships = _config.collections.map((c) => c.slug) || []\n\n for (const collection in props.collections) {\n if (props.collections[collection].fields?.length) {\n props.collections[collection].fields = await sanitizeFields({\n config: _config as unknown as Config,\n fields: props.collections[collection].fields,\n requireFieldLevelRichTextEditor: isRoot,\n validRelationships,\n })\n }\n }\n\n return {\n ClientComponent: UploadFeatureClientComponent,\n clientFeatureProps: clientProps,\n generateSchemaMap: ({ config, i18n, props }) => {\n if (!props?.collections) return null\n\n const schemaMap = new Map<string, Field[]>()\n const validRelationships = config.collections.map((c) => c.slug) || []\n\n for (const collection in props.collections) {\n if (props.collections[collection].fields?.length) {\n schemaMap.set(collection, props.collections[collection].fields)\n traverseFields({\n config,\n fields: props.collections[collection].fields,\n i18n,\n schemaMap,\n schemaPath: collection,\n validRelationships,\n })\n }\n }\n\n return schemaMap\n },\n i18n,\n nodes: [\n createNode({\n converters: {\n html: {\n converter: async ({ node, payload }) => {\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n if (payload) {\n let uploadDocument: TypeWithID & FileData\n\n try {\n uploadDocument = (await payload.findByID({\n id,\n collection: node.relationTo,\n })) as TypeWithID & FileData\n } catch (ignored) {\n // eslint-disable-next-line no-console\n console.error(\n 'Lexical upload node HTML converter: error fetching upload file',\n ignored,\n 'Node:',\n node,\n )\n return `<img />`\n }\n\n const url = getAbsoluteURL(uploadDocument?.url, payload)\n\n /**\n * If the upload is not an image, return a link to the upload\n */\n if (!uploadDocument?.mimeType?.startsWith('image')) {\n return `<a href=\"${url}\" rel=\"noopener noreferrer\">${uploadDocument.filename}</a>`\n }\n\n /**\n * If the upload is a simple image with no different sizes, return a simple img tag\n */\n if (!uploadDocument?.sizes || !Object.keys(uploadDocument?.sizes).length) {\n return `<img src=\"${url}\" alt=\"${uploadDocument?.filename}\" width=\"${uploadDocument?.width}\" height=\"${uploadDocument?.height}\"/>`\n }\n\n /**\n * If the upload is an image with different sizes, return a picture element\n */\n let pictureHTML = '<picture>'\n\n // Iterate through each size in the data.sizes object\n for (const size in uploadDocument.sizes) {\n const imageSize: FileSize & {\n url?: string\n } = uploadDocument.sizes[size]\n\n // Skip if any property of the size object is null\n if (\n !imageSize.width ||\n !imageSize.height ||\n !imageSize.mimeType ||\n !imageSize.filesize ||\n !imageSize.filename ||\n !imageSize.url\n ) {\n continue\n }\n const imageSizeURL = getAbsoluteURL(imageSize?.url, payload)\n\n pictureHTML += `<source srcset=\"${imageSizeURL}\" media=\"(max-width: ${imageSize.width}px)\" type=\"${imageSize.mimeType}\">`\n }\n\n // Add the default img tag\n pictureHTML += `<img src=\"${url}\" alt=\"Image\" width=\"${uploadDocument.width}\" height=\"${uploadDocument.height}\">`\n pictureHTML += '</picture>'\n return pictureHTML\n } else {\n return `<img src=\"${id}\" />`\n }\n },\n nodeTypes: [UploadNode.getType()],\n },\n },\n node: UploadNode,\n populationPromises: [uploadPopulationPromiseHOC(props)],\n validations: [uploadValidation(props)],\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'upload',\n serverFeatureProps: props,\n }\n}\n"],"names":["traverseFields","sanitizeFields","createNode","UploadFeatureClientComponent","i18n","UploadNode","uploadPopulationPromiseHOC","uploadValidation","getAbsoluteURL","url","payload","startsWith","config","serverURL","UploadFeature","props","collections","clientProps","collection","hasExtraFields","fields","length","feature","_config","isRoot","validRelationships","map","c","slug","requireFieldLevelRichTextEditor","ClientComponent","clientFeatureProps","generateSchemaMap","schemaMap","Map","set","schemaPath","nodes","converters","html","converter","node","id","value","uploadDocument","findByID","relationTo","ignored","console","error","mimeType","filename","sizes","Object","keys","width","height","pictureHTML","size","imageSize","filesize","imageSizeURL","nodeTypes","getType","populationPromises","validations","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,cAAc,QAAQ,6BAA4B;AAC3D,SAASC,cAAc,QAAQ,iBAAgB;AAK/C,SAASC,UAAU,QAAQ,sBAAqB;AAChD,SAASC,4BAA4B,QAAQ,sBAAqB;AAClE,SAASC,IAAI,QAAQ,YAAW;AAChC,SAASC,UAAU,QAAQ,wBAAuB;AAClD,SAASC,0BAA0B,QAAQ,yBAAwB;AACnE,SAASC,gBAAgB,QAAQ,gBAAe;AAiBhD;;CAEC,GACD,SAASC,eAAeC,GAAW,EAAEC,OAAgB;IACnD,OAAOD,KAAKE,WAAW,UAAUF,MAAM,AAACC,CAAAA,SAASE,QAAQC,aAAa,EAAC,IAAKJ;AAC9E;AAEA,OAAO,MAAMK,gBAGT,CAACC;IACH,IAAI,CAACA,OAAO;QACVA,QAAQ;YAAEC,aAAa,CAAC;QAAE;IAC5B;IAEA,MAAMC,cAAwC;QAC5CD,aAAa,CAAC;IAChB;IACA,IAAID,MAAMC,WAAW,EAAE;QACrB,IAAK,MAAME,cAAcH,MAAMC,WAAW,CAAE;YAC1CC,YAAYD,WAAW,CAACE,WAAW,GAAG;g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AAemD,WAAWlD,KAAKC;4CAEpD+C,eAAe,CAAC,gBAAgB,EAAEI,aAAa,qBAAqB,EAAEF,UAAUJ,KAAK,CAAC,WAAW,EAAEI,UAAUT,QAAQ,CAAC,EAAE,CAAC;wCAC3H;wCAEA,0BAA0B;wCAC1BO,eAAe,CAAC,UAAU,EAAEhD,IAAI,qBAAqB,EAAEmC,eAAeW,KAAK,CAAC,UAAU,EAAEX,eAAeY,MAAM,CAAC,EAAE,CAAC;wCACjHC,eAAe;wCACf,OAAOA;oCACT,OAAO;wCACL,OAAO,CAAC,UAAU,EAAEf,GAAG,IAAI,CAAC;oCAC9B;gCACF;gCACAoB,WAAW;oCAACzD,WAAW0D,OAAO;iCAAG;4BACnC;wBACF;wBACAtB,MAAMpC;wBACN2D,oBAAoB;4BAAC1D,2BAA2BS;yBAAO;wBACvDkD,aAAa;4BAAC1D,iBAAiBQ;yBAAO;oBACxC;iBACD;gBACDmD,oBAAoBnD;YACtB;QACF;QACAoD,KAAK;QACLD,oBAAoBnD;IACtB;AACF,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { GenericLanguages } from '@payloadcms/translations';
2
+ export declare const i18n: Partial<GenericLanguages>;
3
+ //# sourceMappingURL=i18n.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../../../src/field/features/upload/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA;AAEhE,eAAO,MAAM,IAAI,EAAE,OAAO,CAAC,gBAAgB,CAiG1C,CAAA"}
@@ -0,0 +1,100 @@
1
+ export const i18n = {
2
+ ar: {
3
+ label: 'تحميل'
4
+ },
5
+ az: {
6
+ label: 'Yükləyin'
7
+ },
8
+ bg: {
9
+ label: 'Качване'
10
+ },
11
+ cs: {
12
+ label: 'Nahrát'
13
+ },
14
+ de: {
15
+ label: 'Datei'
16
+ },
17
+ en: {
18
+ label: 'Upload'
19
+ },
20
+ es: {
21
+ label: 'Subir'
22
+ },
23
+ fa: {
24
+ label: 'بارگذاری'
25
+ },
26
+ fr: {
27
+ label: 'Télécharger'
28
+ },
29
+ he: {
30
+ label: 'העלה'
31
+ },
32
+ hr: {
33
+ label: 'Prenesi'
34
+ },
35
+ hu: {
36
+ label: 'Feltöltés'
37
+ },
38
+ it: {
39
+ label: 'Carica'
40
+ },
41
+ ja: {
42
+ label: 'アップロード'
43
+ },
44
+ ko: {
45
+ label: '업로드'
46
+ },
47
+ my: {
48
+ label: 'တင်ပြီး'
49
+ },
50
+ nb: {
51
+ label: 'Last opp'
52
+ },
53
+ nl: {
54
+ label: 'Uploaden'
55
+ },
56
+ pl: {
57
+ label: 'Prześlij'
58
+ },
59
+ pt: {
60
+ label: 'Carregar'
61
+ },
62
+ ro: {
63
+ label: 'Încarcă'
64
+ },
65
+ rs: {
66
+ label: 'Otpremi'
67
+ },
68
+ 'rs-latin': {
69
+ label: 'Otpremi'
70
+ },
71
+ ru: {
72
+ label: 'Загрузить'
73
+ },
74
+ sk: {
75
+ label: 'Nahrať'
76
+ },
77
+ sv: {
78
+ label: 'Ladda upp'
79
+ },
80
+ th: {
81
+ label: 'อัปโหลด'
82
+ },
83
+ tr: {
84
+ label: 'Yükle'
85
+ },
86
+ uk: {
87
+ label: 'Завантажити'
88
+ },
89
+ vi: {
90
+ label: 'Tải lên'
91
+ },
92
+ zh: {
93
+ label: '上传'
94
+ },
95
+ 'zh-TW': {
96
+ label: '上傳'
97
+ }
98
+ };
99
+
100
+ //# sourceMappingURL=i18n.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../src/field/features/upload/i18n.ts"],"sourcesContent":["import type { GenericLanguages } from '@payloadcms/translations'\n\nexport const i18n: Partial<GenericLanguages> = {\n ar: {\n label: 'تحميل',\n },\n az: {\n label: 'Yükləyin',\n },\n bg: {\n label: 'Качване',\n },\n cs: {\n label: 'Nahrát',\n },\n de: {\n label: 'Datei',\n },\n en: {\n label: 'Upload',\n },\n es: {\n label: 'Subir',\n },\n fa: {\n label: 'بارگذاری',\n },\n fr: {\n label: 'Télécharger',\n },\n he: {\n label: 'העלה',\n },\n hr: {\n label: 'Prenesi',\n },\n hu: {\n label: 'Feltöltés',\n },\n it: {\n label: 'Carica',\n },\n ja: {\n label: 'アップロード',\n },\n ko: {\n label: '업로드',\n },\n my: {\n label: 'တင်ပြီး',\n },\n nb: {\n label: 'Last opp',\n },\n nl: {\n label: 'Uploaden',\n },\n pl: {\n label: 'Prześlij',\n },\n pt: {\n label: 'Carregar',\n },\n ro: {\n label: 'Încarcă',\n },\n rs: {\n label: 'Otpremi',\n },\n 'rs-latin': {\n label: 'Otpremi',\n },\n ru: {\n label: 'Загрузить',\n },\n sk: {\n label: 'Nahrať',\n },\n sv: {\n label: 'Ladda upp',\n },\n th: {\n label: 'อัปโหลด',\n },\n tr: {\n label: 'Yükle',\n },\n uk: {\n label: 'Завантажити',\n },\n vi: {\n label: 'Tải lên',\n },\n zh: {\n label: '上传',\n },\n 'zh-TW': {\n label: '上傳',\n },\n}\n"],"names":["i18n","ar","label","az","bg","cs","de","en","es","fa","fr","he","hr","hu","it","ja","ko","my","nb","nl","pl","pt","ro","rs","ru","sk","sv","th","tr","uk","vi","zh"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,OAAO,MAAMA,OAAkC;IAC7CC,IAAI;QACFC,OAAO;IACT;IACAC,IAAI;QACFD,OAAO;IACT;IACAE,IAAI;QACFF,OAAO;IACT;IACAG,IAAI;QACFH,OAAO;IACT;IACAI,IAAI;QACFJ,OAAO;IACT;IACAK,IAAI;QACFL,OAAO;IACT;IACAM,IAAI;QACFN,OAAO;IACT;IACAO,IAAI;QACFP,OAAO;IACT;IACAQ,IAAI;QACFR,OAAO;IACT;IACAS,IAAI;QACFT,OAAO;IACT;IACAU,IAAI;QACFV,OAAO;IACT;IACAW,IAAI;QACFX,OAAO;IACT;IACAY,IAAI;QACFZ,OAAO;IACT;IACAa,IAAI;QACFb,OAAO;IACT;IACAc,IAAI;QACFd,OAAO;IACT;IACAe,IAAI;QACFf,OAAO;IACT;IACAgB,IAAI;QACFhB,OAAO;IACT;IACAiB,IAAI;QACFjB,OAAO;IACT;IACAkB,IAAI;QACFlB,OAAO;IACT;IACAmB,IAAI;QACFnB,OAAO;IACT;IACAoB,IAAI;QACFpB,OAAO;IACT;IACAqB,IAAI;QACFrB,OAAO;IACT;IACA,YAAY;QACVA,OAAO;IACT;IACAsB,IAAI;QACFtB,OAAO;IACT;IACAuB,IAAI;QACFvB,OAAO;IACT;IACAwB,IAAI;QACFxB,OAAO;IACT;IACAyB,IAAI;QACFzB,OAAO;IACT;IACA0B,IAAI;QACF1B,OAAO;IACT;IACA2B,IAAI;QACF3B,OAAO;IACT;IACA4B,IAAI;QACF5B,OAAO;IACT;IACA6B,IAAI;QACF7B,OAAO;IACT;IACA,SAAS;QACPA,OAAO;IACT;AACF,EAAC"}
@@ -1,7 +1,7 @@
1
- /// <reference types="react" resolution-mode="require"/>
2
1
  import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
3
2
  import type { ElementFormatType, NodeKey } from 'lexical';
4
3
  import type { DOMConversionMap, DOMExportOutput, LexicalNode, Spread } from 'lexical';
4
+ import type { JSX } from 'react';
5
5
  import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
6
6
  export type UploadData = {
7
7
  fields: {
@@ -1 +1 @@
1
- {"version":3,"file":"UploadNode.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/upload/nodes/UploadNode.tsx"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,4BAA4B,EAAE,MAAM,6CAA6C,CAAA;AAC/F,OAAO,KAAK,EAAE,iBAAiB,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AACzD,OAAO,KA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IxB,QAAQ,IAAI,GAAG,CAAC,OAAO;IAKvB,SAAS,IAAI,eAAe;IAQ5B,UAAU,IAAI,oBAAoB;IASlC,OAAO,IAAI,UAAU;IAIrB,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,IAAI;IAM/B,SAAS,IAAI,KAAK;CAGnB;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,EAAE;IAAE,IAAI,EAAE,UAAU,CAAA;CAAE,GAAG,UAAU,CAE5E;AAED,wBAAgB,aAAa,CAAC,IAAI,EAAE,WAAW,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI,IAAI,UAAU,CAEtF"}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js';
2
3
  import { $applyNodeReplacement } from 'lexical';
3
4
  import * as React from 'react';
@@ -69,7 +70,7 @@ export class UploadNode extends DecoratorBlockNode {
69
70
  }
70
71
  decorate() {
71
72
  // @ts-expect-error
72
- return /*#__PURE__*/ React.createElement(RawUploadComponent, {
73
+ return /*#__PURE__*/ _jsx(RawUploadComponent, {
73
74
  data: this.__data,
74
75
  format: this.__format,
75
76
  nodeKey: this.getKey()
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/upload/nodes/UploadNode.tsx"],"sourcesContent":["import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type { ElementFormatType, NodeKey } from 'lexical'\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n LexicalNode,\n Spread,\n} from 'lexical'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nconst RawUploadComponent = React.lazy(() =>\n import('../component/index.js').then((module) => ({ default: module.UploadComponent })),\n)\n\nexport type UploadData = {\n fields: {\n // unknown, custom fields:\n [key: string]: unknown\n }\n relationTo: string\n value: number | string\n}\n\nfunction $convertUploadElement(domNode: HTMLImageElement): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createUploadNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n // TODO: Auto-upload functionality here!\n //}\n return null\n}\n\nexport type SerializedUploadNode = Spread<UploadData, SerializedDecoratorBlockNode>\n\nexport class UploadNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: UploadNode): UploadNode {\n return new UploadNode({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'upload'\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n\n const importedData: UploadData = {\n fields: serializedNode.fields,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n decorate(): JSX.Element {\n // @ts-expect-error\n return <RawUploadComponent data={this.__data} format={this.__format} nodeKey={this.getKey()} />\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n element.setAttribute('data-lexical-upload-id', String(this.__data?.value))\n element.setAttribute('data-lexical-upload-relation-to', this.__data?.relationTo)\n\n return { element }\n }\n\n exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: this.getType(),\n version: 2,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n // eslint-disable-next-line class-methods-use-this\n updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadNode({ data }: { data: UploadData }): UploadNode {\n return $applyNodeReplacement(new UploadNode({ data }))\n}\n\nexport function $isUploadNode(node: LexicalNode | null | undefined): node is UploadNode {\n return node instanceof UploadNode\n}\n"],"names":["DecoratorBlockNode","$applyNodeReplacement","React","RawUploadComponent","lazy","then","module","default","UploadComponent","$convertUploadElement","domNode","hasAttribute","id","getAttribute","relationTo","node","$createUploadNode","data","fields","value","UploadNode","__data","constructor","format","key","clone","__format","__key","getType","importDOM","img","conversion","priority","importJSON","serializedNode","version","importedData","setFormat","isInline","decorate","nodeKey","getKey","exportDOM","element","document","createElement","setAttribute","String","exportJSON","getData","type","getLatest","setData","writable","getWritable","updateDOM","$isUploadNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAUA,SAASA,kBAAkB,QAAQ,8CAA6C;AAChF,SAASC,qBAAqB,QAAQ,UAAS;AAC/C,YAAYC,WAAW,QAAO;AAE9B,MAAMC,mCAAqBD,MAAME,IAAI,CAAC,IACpC,MAAM,CAAC,yBAAyBC,IAAI,CAAC,CAACC,SAAY,CAAA;YAAEC,SAASD,OAAOE,eAAe;QAAC,CAAA;AAYtF,SAASC,sBAAsBC,OAAyB;IACtD,IACEA,QAAQC,YAAY,CAAC,sCACrBD,QAAQC,YAAY,CAAC,2BACrB;QACA,MAAMC,KAAKF,QAAQG,YAAY,CAAC;QAChC,MAAMC,aAAaJ,QAAQG,YAAY,CAAC;QAExC,IAAID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AQ;YAAEc,SAAS,IAAI,CAACC,MAAM;;IAC3F;IAEAC,YAA6B;QAC3B,MAAMC,UAAUC,SAASC,aAAa,CAAC;QACvCF,QAAQG,YAAY,CAAC,0BAA0BC,OAAO,IAAI,CAAC1B,MAAM,EAAEF;QACnEwB,QAAQG,YAAY,CAAC,mCAAmC,IAAI,CAACzB,MAAM,EAAEP;QAErE,OAAO;YAAE6B;QAAQ;IACnB;IAEAK,aAAmC;QACjC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrB,GAAG,IAAI,CAACC,OAAO,EAAE;YACjBC,MAAM,IAAI,CAACtB,OAAO;YAClBO,SAAS;QACX;IACF;IAEAc,UAAsB;QACpB,OAAO,IAAI,CAACE,SAAS,GAAG9B,MAAM;IAChC;IAEA+B,QAAQnC,IAAgB,EAAQ;QAC9B,MAAMoC,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAShC,MAAM,GAAGJ;IACpB;IAEA,kDAAkD;IAClDsC,YAAmB;QACjB,OAAO;IACT;AACF;AAEA,OAAO,SAASvC,kBAAkB,EAAEC,IAAI,EAAwB;IAC9D,OAAOhB,sBAAsB,IAAImB,WAAW;QAAEH;IAAK;AACrD;AAEA,OAAO,SAASuC,cAAczC,IAAoC;IAChE,OAAOA,gBAAgBK;AACzB"}
1
+ {"version":3,"sources":["../../../../../src/field/features/upload/nodes/UploadNode.tsx"],"sourcesContent":["import type { SerializedDecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport type { ElementFormatType, NodeKey } from 'lexical'\nimport type {\n DOMConversionMap,\n DOMConversionOutput,\n DOMExportOutput,\n LexicalNode,\n Spread,\n} from 'lexical'\nimport type { JSX } from 'react'\n\nimport { DecoratorBlockNode } from '@lexical/react/LexicalDecoratorBlockNode.js'\nimport { $applyNodeReplacement } from 'lexical'\nimport * as React from 'react'\n\nconst RawUploadComponent = React.lazy(() =>\n import('../component/index.js').then((module) => ({ default: module.UploadComponent })),\n)\n\nexport type UploadData = {\n fields: {\n // unknown, custom fields:\n [key: string]: unknown\n }\n relationTo: string\n value: number | string\n}\n\nfunction $convertUploadElement(domNode: HTMLImageElement): DOMConversionOutput | null {\n if (\n domNode.hasAttribute('data-lexical-upload-relation-to') &&\n domNode.hasAttribute('data-lexical-upload-id')\n ) {\n const id = domNode.getAttribute('data-lexical-upload-id')\n const relationTo = domNode.getAttribute('data-lexical-upload-relation-to')\n\n if (id != null && relationTo != null) {\n const node = $createUploadNode({\n data: {\n fields: {},\n relationTo,\n value: id,\n },\n })\n return { node }\n }\n }\n // TODO: Auto-upload functionality here!\n //}\n return null\n}\n\nexport type SerializedUploadNode = Spread<UploadData, SerializedDecoratorBlockNode>\n\nexport class UploadNode extends DecoratorBlockNode {\n __data: UploadData\n\n constructor({\n data,\n format,\n key,\n }: {\n data: UploadData\n format?: ElementFormatType\n key?: NodeKey\n }) {\n super(format, key)\n this.__data = data\n }\n\n static clone(node: UploadNode): UploadNode {\n return new UploadNode({\n data: node.__data,\n format: node.__format,\n key: node.__key,\n })\n }\n\n static getType(): string {\n return 'upload'\n }\n\n static importDOM(): DOMConversionMap | null {\n return {\n img: (node: HTMLImageElement) => ({\n conversion: $convertUploadElement,\n priority: 0,\n }),\n }\n }\n\n static importJSON(serializedNode: SerializedUploadNode): UploadNode {\n if (serializedNode.version === 1 && (serializedNode?.value as unknown as { id: string })?.id) {\n serializedNode.value = (serializedNode.value as unknown as { id: string }).id\n }\n\n const importedData: UploadData = {\n fields: serializedNode.fields,\n relationTo: serializedNode.relationTo,\n value: serializedNode.value,\n }\n\n const node = $createUploadNode({ data: importedData })\n node.setFormat(serializedNode.format)\n\n return node\n }\n\n static isInline(): false {\n return false\n }\n\n decorate(): JSX.Element {\n // @ts-expect-error\n return <RawUploadComponent data={this.__data} format={this.__format} nodeKey={this.getKey()} />\n }\n\n exportDOM(): DOMExportOutput {\n const element = document.createElement('img')\n element.setAttribute('data-lexical-upload-id', String(this.__data?.value))\n element.setAttribute('data-lexical-upload-relation-to', this.__data?.relationTo)\n\n return { element }\n }\n\n exportJSON(): SerializedUploadNode {\n return {\n ...super.exportJSON(),\n ...this.getData(),\n type: this.getType(),\n version: 2,\n }\n }\n\n getData(): UploadData {\n return this.getLatest().__data\n }\n\n setData(data: UploadData): void {\n const writable = this.getWritable()\n writable.__data = data\n }\n\n // eslint-disable-next-line class-methods-use-this\n updateDOM(): false {\n return false\n }\n}\n\nexport function $createUploadNode({ data }: { data: UploadData }): UploadNode {\n return $applyNodeReplacement(new UploadNode({ data }))\n}\n\nexport function $isUploadNode(node: LexicalNode | null | undefined): node is UploadNode {\n return node instanceof UploadNode\n}\n"],"names":["DecoratorBlockNode","$applyNodeReplacement","React","RawUploadComponent","lazy","then","module","default","UploadComponent","$convertUploadElement","domNode","hasAttribute","id","getAttribute","relationTo","node","$createUploadNode","data","fields","value","UploadNode","__data","constructor","format","key","clone","__format","__key","getType","importDOM","img","conversion","priority","importJSON","serializedNode","version","importedData","setFormat","isInline","decorate","nodeKey","getKey","exportDOM","element","document","createElement","setAttribute","String","exportJSON","getData","type","getLatest","setData","writable","getWritable","updateDOM","$isUploadNode"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAWA,SAASA,kBAAkB,QAAQ,8CAA6C;AAChF,SAASC,qBAAqB,QAAQ,UAAS;AAC/C,YAAYC,WAAW,QAAO;AAE9B,MAAMC,mCAAqBD,MAAME,IAAI,CAAC,IACpC,MAAM,CAAC,yBAAyBC,IAAI,CAAC,CAACC,SAAY,CAAA;YAAEC,SAASD,OAAOE,eAAe;QAAC,CAAA;AAYtF,SAASC,sBAAsBC,OAAyB;IACtD,IACEA,QAAQC,YAAY,CAAC,sCACrBD,QAAQC,YAAY,CAAC,2BACrB;QACA,MAAMC,KAAKF,QAAQG,YAAY,CAAC;QAChC,MAAMC,aAA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AAM;YAAEE,QAAQ,IAAI,CAACG,QAAQ;YAAEc,SAAS,IAAI,CAACC,MAAM;;IAC3F;IAEAC,YAA6B;QAC3B,MAAMC,UAAUC,SAASC,aAAa,CAAC;QACvCF,QAAQG,YAAY,CAAC,0BAA0BC,OAAO,IAAI,CAAC1B,MAAM,EAAEF;QACnEwB,QAAQG,YAAY,CAAC,mCAAmC,IAAI,CAACzB,MAAM,EAAEP;QAErE,OAAO;YAAE6B;QAAQ;IACnB;IAEAK,aAAmC;QACjC,OAAO;YACL,GAAG,KAAK,CAACA,YAAY;YACrB,GAAG,IAAI,CAACC,OAAO,EAAE;YACjBC,MAAM,IAAI,CAACtB,OAAO;YAClBO,SAAS;QACX;IACF;IAEAc,UAAsB;QACpB,OAAO,IAAI,CAACE,SAAS,GAAG9B,MAAM;IAChC;IAEA+B,QAAQnC,IAAgB,EAAQ;QAC9B,MAAMoC,WAAW,IAAI,CAACC,WAAW;QACjCD,SAAShC,MAAM,GAAGJ;IACpB;IAEA,kDAAkD;IAClDsC,YAAmB;QACjB,OAAO;IACT;AACF;AAEA,OAAO,SAASvC,kBAAkB,EAAEC,IAAI,EAAwB;IAC9D,OAAOhB,sBAAsB,IAAImB,WAAW;QAAEH;IAAK;AACrD;AAEA,OAAO,SAASuC,cAAczC,IAAoC;IAChE,OAAOA,gBAAgBK;AACzB"}
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import { jsx as _jsx } from "react/jsx-runtime";
2
3
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
3
4
  import { $insertNodeToNearestRoot, mergeRegister } from '@lexical/utils';
4
5
  import { useConfig } from '@payloadcms/ui/providers/Config';
@@ -43,7 +44,7 @@ export const UploadPlugin = ({ clientProps })=>{
43
44
  }, [
44
45
  editor
45
46
  ]);
46
- return /*#__PURE__*/ React.createElement(UploadDrawer, {
47
+ return /*#__PURE__*/ _jsx(UploadDrawer, {
47
48
  enabledCollectionSlugs: collections.map(({ slug })=>slug)
48
49
  });
49
50
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/upload/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot, mergeRegister } from '@lexical/utils'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport React, { useEffect } from 'react'\n\nimport type { PluginComponentWithAnchor } from '../../types.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadData } from '../nodes/UploadNode.js'\n\nimport { UploadDrawer } from '../drawer/index.js'\nimport { $createUploadNode, UploadNode } from '../nodes/UploadNode.js'\n\nexport type InsertUploadPayload = Readonly<UploadData>\n\nexport const INSERT_UPLOAD_COMMAND: LexicalCommand<InsertUploadPayload> =\n createCommand('INSERT_UPLOAD_COMMAND')\n\nexport const UploadPlugin: PluginComponentWithAnchor<UploadFeaturePropsClient> = ({\n clientProps,\n}) => {\n const [editor] = useLexicalComposerContext()\n const { collections } = useConfig()\n\n useEffect(() => {\n if (!editor.hasNodes([UploadNode])) {\n throw new Error('UploadPlugin: UploadNode not registered on editor')\n }\n\n return mergeRegister(\n editor.registerCommand<InsertUploadPayload>(\n INSERT_UPLOAD_COMMAND,\n (payload: InsertUploadPayload) => {\n editor.update(() => {\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\n const uploadNode = $createUploadNode({\n data: {\n fields: payload.fields,\n relationTo: payload.relationTo,\n value: payload.value,\n },\n })\n // Insert upload node BEFORE potentially removing focusNode, as $insertNodeToNearestRoot errors if the focusNode doesn't exist\n $insertNodeToNearestRoot(uploadNode)\n\n const { focus } = selection\n const focusNode = focus.getNode()\n\n // First, delete currently selected node if it's an empty paragraph and if there are sufficient\n // paragraph nodes (more than 1) left in the parent node, so that we don't \"trap\" the user\n if (\n $isParagraphNode(focusNode) &&\n focusNode.getTextContentSize() === 0 &&\n focusNode\n .getParent()\n .getChildren()\n .filter((node) => $isParagraphNode(node)).length > 1\n ) {\n focusNode.remove()\n }\n }\n })\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n ),\n )\n }, [editor])\n\n return <UploadDrawer enabledCollectionSlugs={collections.map(({ slug }) => slug)} />\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","mergeRegister","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","React","useEffect","UploadDrawer","$createUploadNode","UploadNode","INSERT_UPLOAD_COMMAND","UploadPlugin","clientProps","editor","collections","hasNodes","Error","registerCommand","payload","update","selection","uploadNode","data","fields","relationTo","value","focus","focusNode","getNode","getTextContentSize","getParent","getChildren","filter","node","length","remove","enabledCollectionSlugs","map","slug"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,EAAEC,aAAa,QAAQ,iBAAgB;AACxE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR,UAAS;AAChB,OAAOC,SAASC,SAAS,QAAQ,QAAO;AAMxC,SAASC,YAAY,QAAQ,qBAAoB;AACjD,SAASC,iBAAiB,EAAEC,UAAU,QAAQ,yBAAwB;AAItE,OAAO,MAAMC,wBACXN,cAAc,yBAAwB;AAExC,OAAO,MAAMO,eAAoE,CAAC,EAChFC,WAAW,EACZ;IACC,MAAM,CAACC,OAAO,GAAGlB;IACjB,MAAM,EAAEmB,WAAW,EAAE,GAAGhB;IAExBQ,UAAU;QACR,IAAI,CAACO,OAAOE,QAAQ,CAAC;YAACN;SAAW,GAAG;YAClC,MAAM,IAAIO,MAAM;QAClB;QAEA,OAAOnB,cACLgB,OAAOI,eAAe,CACpBP,uBACA,CAACQ;YACCL,OAAOM,MAAM,CAAC;gBACZ,MAAMC,YAAYpB,mBAAmBD;gBAErC,IAAIG,kBAAkBkB,YAAY;oBAChC,MAAMC,aAAab,kBAAkB;wBACnCc,MAAM;4BACJC,QAAQL,QAAQK,MAAM;4BACtBC,YAAYN,QAAQM,UAAU;4BAC9BC,OAAOP,QAAQO,KAAK;wBACtB;oBACF;oBACA,8HAA8H;oBAC9H7B,yBAAyByB;oBAEzB,MAAM,EAAEK,KAAK,EAAE,GAAGN;oBAClB,MAAMO,YAAYD,MAAME,OAAO;oBAE/B,+FAA+F;oBAC/F,0FAA0F;oBAC1F,IACE3B,iBAAiB0B,cACjBA,UAAUE,kBAAkB,OAAO,KACnCF,UACGG,SAAS,GACTC,WAAW,GACXC,MAAM,CAAC,CAACC,OAAShC,iBAAiBgC,OAAOC,MAAM,GAAG,GACrD;wBACAP,UAAUQ,MAAM;oBAClB;gBACF;YACF;YAEA,OAAO;QACT,GACAhC;IAGN,GAAG;QAACU;KAAO;IAEX,qBAAO,oBAACN;QAAa6B,wBAAwBtB,YAAYuB,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA;;AAC7E,EAAC"}
1
+ {"version":3,"sources":["../../../../../src/field/features/upload/plugin/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot, mergeRegister } from '@lexical/utils'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport {\n $getPreviousSelection,\n $getSelection,\n $isParagraphNode,\n $isRangeSelection,\n COMMAND_PRIORITY_EDITOR,\n createCommand,\n} from 'lexical'\nimport React, { useEffect } from 'react'\n\nimport type { PluginComponentWithAnchor } from '../../types.js'\nimport type { UploadFeaturePropsClient } from '../feature.client.js'\nimport type { UploadData } from '../nodes/UploadNode.js'\n\nimport { UploadDrawer } from '../drawer/index.js'\nimport { $createUploadNode, UploadNode } from '../nodes/UploadNode.js'\n\nexport type InsertUploadPayload = Readonly<UploadData>\n\nexport const INSERT_UPLOAD_COMMAND: LexicalCommand<InsertUploadPayload> =\n createCommand('INSERT_UPLOAD_COMMAND')\n\nexport const UploadPlugin: PluginComponentWithAnchor<UploadFeaturePropsClient> = ({\n clientProps,\n}) => {\n const [editor] = useLexicalComposerContext()\n const { collections } = useConfig()\n\n useEffect(() => {\n if (!editor.hasNodes([UploadNode])) {\n throw new Error('UploadPlugin: UploadNode not registered on editor')\n }\n\n return mergeRegister(\n editor.registerCommand<InsertUploadPayload>(\n INSERT_UPLOAD_COMMAND,\n (payload: InsertUploadPayload) => {\n editor.update(() => {\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\n const uploadNode = $createUploadNode({\n data: {\n fields: payload.fields,\n relationTo: payload.relationTo,\n value: payload.value,\n },\n })\n // Insert upload node BEFORE potentially removing focusNode, as $insertNodeToNearestRoot errors if the focusNode doesn't exist\n $insertNodeToNearestRoot(uploadNode)\n\n const { focus } = selection\n const focusNode = focus.getNode()\n\n // First, delete currently selected node if it's an empty paragraph and if there are sufficient\n // paragraph nodes (more than 1) left in the parent node, so that we don't \"trap\" the user\n if (\n $isParagraphNode(focusNode) &&\n focusNode.getTextContentSize() === 0 &&\n focusNode\n .getParent()\n .getChildren()\n .filter((node) => $isParagraphNode(node)).length > 1\n ) {\n focusNode.remove()\n }\n }\n })\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n ),\n )\n }, [editor])\n\n return <UploadDrawer enabledCollectionSlugs={collections.map(({ slug }) => slug)} />\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","mergeRegister","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","React","useEffect","UploadDrawer","$createUploadNode","UploadNode","INSERT_UPLOAD_COMMAND","UploadPlugin","clientProps","editor","collections","hasNodes","Error","registerCommand","payload","update","selection","uploadNode","data","fields","relationTo","value","focus","focusNode","getNode","getTextContentSize","getParent","getChildren","filter","node","length","remove","enabledCollectionSlugs","map","slug"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,EAAEC,aAAa,QAAQ,iBAAgB;AACxE,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR,UAAS;AAChB,OAAOC,SAASC,SAAS,QAAQ,QAAO;AAMxC,SAASC,YAAY,QAAQ,qBAAoB;AACjD,SAASC,iBAAiB,EAAEC,UAAU,QAAQ,yBAAwB;AAItE,OAAO,MAAMC,wBACXN,cAAc,yBAAwB;AAExC,OAAO,MAAMO,eAAoE,CAAC,EAChFC,WAAW,EACZ;IACC,MAAM,CAACC,OAAO,GAAGlB;IACjB,MAAM,EAAEmB,WAAW,EAAE,GAAGhB;IAExBQ,UAAU;QACR,IAAI,CAACO,OAAOE,QAAQ,CAAC;YAACN;SAAW,GAAG;YAClC,MAAM,IAAIO,MAAM;QAClB;QAEA,OAAOnB,cACLgB,OAAOI,eAAe,CACpBP,uBACA,CAACQ;YACCL,OAAOM,MAAM,CAAC;gBACZ,MAAMC,YAAYpB,mBAAmBD;gBAErC,IAAIG,kBAAkBkB,YAAY;oBAChC,MAAMC,aAAab,kBAAkB;wBACnCc,MAAM;4BACJC,QAAQL,QAAQK,MAAM;4BACtBC,YAAYN,QAAQM,UAAU;4BAC9BC,OAAOP,QAAQO,KAAK;wBACtB;oBACF;oBACA,8HAA8H;oBAC9H7B,yBAAyByB;oBAEzB,MAAM,EAAEK,KAAK,EAAE,GAAGN;oBAClB,MAAMO,YAAYD,MAAME,OAAO;oBAE/B,+FAA+F;oBAC/F,0FAA0F;oBAC1F,IACE3B,iBAAiB0B,cACjBA,UAAUE,kBAAkB,OAAO,KACnCF,UACGG,SAAS,GACTC,WAAW,GACXC,MAAM,CAAC,CAACC,OAAShC,iBAAiBgC,OAAOC,MAAM,GAAG,GACrD;wBACAP,UAAUQ,MAAM;oBAClB;gBACF;YACF;YAEA,OAAO;QACT,GACAhC;IAGN,GAAG;QAACU;KAAO;IAEX,qBAAO,KAACN;QAAa6B,wBAAwBtB,YAAYuB,GAAG,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAKA;;AAC7E,EAAC"}
@@ -37,7 +37,7 @@ export const uploadPopulationPromiseHOC = (props)=>{
37
37
  fieldPromises,
38
38
  fields: props?.collections?.[node?.relationTo]?.fields,
39
39
  findMany,
40
- flattenLocales,
40
+ flattenLocales: false,
41
41
  overrideAccess,
42
42
  populationPromises,
43
43
  req,
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/upload/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { UploadFeatureProps } from './feature.server.js'\nimport type { SerializedUploadNode } from './nodes/UploadNode.js'\n\nimport { populate } from '../../../populate/populate.js'\nimport { recurseNestedFields } from '../../../populate/recurseNestedFields.js'\n\nexport const uploadPopulationPromiseHOC = (\n props?: UploadFeatureProps,\n): PopulationPromise<SerializedUploadNode> => {\n return ({\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 }) => {\n if (node?.value) {\n const collection = req.payload.collections[node?.relationTo]\n\n if (collection) {\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collection,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n field,\n key: 'value',\n overrideAccess,\n req,\n showHiddenFields,\n }),\n )\n }\n if (Array.isArray(props?.collections?.[node?.relationTo]?.fields)) {\n if (!props?.collections?.[node?.relationTo]?.fields?.length) {\n return\n }\n recurseNestedFields({\n context,\n currentDepth,\n data: node.fields || {},\n depth,\n draft,\n editorPopulationPromises,\n fieldPromises,\n fields: props?.collections?.[node?.relationTo]?.fields,\n findMany,\n flattenLocales,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc: node.fields || {},\n })\n }\n }\n }\n}\n"],"names":["populate","recurseNestedFields","uploadPopulationPromiseHOC","props","context","currentDepth","depth","draft","editorPopulationPromises","field","fieldPromises","findMany","flattenLocales","node","overrideAccess","populationPromises","req","showHiddenFields","value","collection","payload","collections","relationTo","id","populateDepth","maxDepth","undefined","push","data","key","Array","isArray","fields","length","siblingDoc"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,mBAAmB,QAAQ,2CAA0C;AAE9E,OAAO,MAAMC,6BAA6B,CACxCC;IAEA,OAAO,CAAC,EACNC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,KAAK,EACLC,wBAAwB,EACxBC,KAAK,EACLC,aAAa,EACbC,QAAQ,EACRC,cAAc,EACdC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EACjB;QACC,IAAIJ,MAAMK,OAAO;YACf,MAAMC,aAAaH,IAAII,OAAO,CAACC,WAAW,CAACR,MAAMS,WAAW;YAE5D,IAAIH,YAAY;gBACd,mBAAmB;gBACnB,MAAMI,KAAKV,MAAMK,OAAOK,MAAMV,MAAMK,MAAM,8BAA8B;;gBAExE,MAAMM,gBACJrB,OAAOsB,aAAaC,aAAavB,OAAOsB,WAAWnB,QAAQH,OAAOsB,WAAWnB;gBAE/ES,mBAAmBY,IAAI,CACrB3B,SAAS;oBACPuB;oBACAJ;oBACAd;oBACAuB,MAAMf;oBACNP,OAAOkB;oBACPjB;oBACAE;oBACAoB,KAAK;oBACLf;oBACAE;oBACAC;gBACF;YAEJ;YACA,IAAIa,MAAMC,OAAO,CAAC5B,OAAOkB,aAAa,CAACR,MAAMS,WAAW,EAAEU,SAAS;gBACjE,IAAI,CAAC7B,OAAOkB,aAAa,CAACR,MAAMS,WAAW,EAAEU,QAAQC,QAAQ;oBAC3D;gBACF;gBACAhC,oBAAoB;oBAClBG;oBACAC;oBACAuB,MAAMf,KAAKmB,MAAM,IAAI,CAAC;oBACtB1B;oBACAC;oBACAC;oBACAE;oBACAsB,QAAQ7B,OAAOkB,aAAa,CAACR,MAAMS,WAAW,EAAEU;oBAChDrB;oBACAC;oBACAE;oBACAC;oBACAC;oBACAC;oBACAiB,YAAYrB,KAAKmB,MAAM,IAAI,CAAC;gBAC9B;YACF;QACF;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/upload/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { UploadFeatureProps } from './feature.server.js'\nimport type { SerializedUploadNode } from './nodes/UploadNode.js'\n\nimport { populate } from '../../../populate/populate.js'\nimport { recurseNestedFields } from '../../../populate/recurseNestedFields.js'\n\nexport const uploadPopulationPromiseHOC = (\n props?: UploadFeatureProps,\n): PopulationPromise<SerializedUploadNode> => {\n return ({\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 }) => {\n if (node?.value) {\n const collection = req.payload.collections[node?.relationTo]\n\n if (collection) {\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const populateDepth =\n props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth\n\n populationPromises.push(\n populate({\n id,\n collection,\n currentDepth,\n data: node,\n depth: populateDepth,\n draft,\n field,\n key: 'value',\n overrideAccess,\n req,\n showHiddenFields,\n }),\n )\n }\n if (Array.isArray(props?.collections?.[node?.relationTo]?.fields)) {\n if (!props?.collections?.[node?.relationTo]?.fields?.length) {\n return\n }\n recurseNestedFields({\n context,\n currentDepth,\n data: node.fields || {},\n depth,\n draft,\n editorPopulationPromises,\n fieldPromises,\n fields: props?.collections?.[node?.relationTo]?.fields,\n findMany,\n flattenLocales: false, // Disable localization handling which does not work properly yet. Once we fully support hooks, this can be enabled (pass through flattenLocales again)\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n siblingDoc: node.fields || {},\n })\n }\n }\n }\n}\n"],"names":["populate","recurseNestedFields","uploadPopulationPromiseHOC","props","context","currentDepth","depth","draft","editorPopulationPromises","field","fieldPromises","findMany","flattenLocales","node","overrideAccess","populationPromises","req","showHiddenFields","value","collection","payload","collections","relationTo","id","populateDepth","maxDepth","undefined","push","data","key","Array","isArray","fields","length","siblingDoc"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,QAAQ,QAAQ,gCAA+B;AACxD,SAASC,mBAAmB,QAAQ,2CAA0C;AAE9E,OAAO,MAAMC,6BAA6B,CACxCC;IAEA,OAAO,CAAC,EACNC,OAAO,EACPC,YAAY,EACZC,KAAK,EACLC,KAAK,EACLC,wBAAwB,EACxBC,KAAK,EACLC,aAAa,EACbC,QAAQ,EACRC,cAAc,EACdC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EACjB;QACC,IAAIJ,MAAMK,OAAO;YACf,MAAMC,aAAaH,IAAII,OAAO,CAACC,WAAW,CAACR,MAAMS,WAAW;YAE5D,IAAIH,YAAY;gBACd,mBAAmB;gBACnB,MAAMI,KAAKV,MAAMK,OAAOK,MAAMV,MAAMK,MAAM,8BAA8B;;gBAExE,MAAMM,gBACJrB,OAAOsB,aAAaC,aAAavB,OAAOsB,WAAWnB,QAAQH,OAAOsB,WAAWnB;gBAE/ES,mBAAmBY,IAAI,CACrB3B,SAAS;oBACPuB;oBACAJ;oBACAd;oBACAuB,MAAMf;oBACNP,OAAOkB;oBACPjB;oBACAE;oBACAoB,KAAK;oBACLf;oBACAE;oBACAC;gBACF;YAEJ;YACA,IAAIa,MAAMC,OAAO,CAAC5B,OAAOkB,aAAa,CAACR,MAAMS,WAAW,EAAEU,SAAS;gBACjE,IAAI,CAAC7B,OAAOkB,aAAa,CAACR,MAAMS,WAAW,EAAEU,QAAQC,QAAQ;oBAC3D;gBACF;gBACAhC,oBAAoB;oBAClBG;oBACAC;oBACAuB,MAAMf,KAAKmB,MAAM,IAAI,CAAC;oBACtB1B;oBACAC;oBACAC;oBACAE;oBACAsB,QAAQ7B,OAAOkB,aAAa,CAACR,MAAMS,WAAW,EAAEU;oBAChDrB;oBACAC,gBAAgB;oBAChBE;oBACAC;oBACAC;oBACAC;oBACAiB,YAAYrB,KAAKmB,MAAM,IAAI,CAAC;gBAC9B;YACF;QACF;IACF;AACF,EAAC"}
@@ -1,7 +1,9 @@
1
1
  import type { FormFieldBase } from '@payloadcms/ui/fields/shared';
2
2
  import type { EditorConfig as LexicalEditorConfig } from 'lexical';
3
3
  import React from 'react';
4
+ import type { LexicalFieldAdminProps } from '../types.js';
4
5
  export declare const RichTextField: React.FC<FormFieldBase & {
6
+ admin?: LexicalFieldAdminProps;
5
7
  lexicalEditorConfig: LexicalEditorConfig;
6
8
  name: string;
7
9
  richTextComponentMap: Map<string, React.ReactNode>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/field/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlE,OAAO,KAA8C,MAAM,OAAO,CAAA;AAclE,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC,aAAa,GAAG;IACd,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;CACnD,CA4GF,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/field/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAA;AACjE,OAAO,KAAK,EAAE,YAAY,IAAI,mBAAmB,EAAE,MAAM,SAAS,CAAA;AAKlE,OAAO,KAA8C,MAAM,OAAO,CAAA;AAElE,OAAO,KAAK,EAAqC,sBAAsB,EAAE,MAAM,aAAa,CAAA;AAY5F,eAAO,MAAM,aAAa,EAAE,KAAK,CAAC,EAAE,CAClC,aAAa,GAAG;IACd,KAAK,CAAC,EAAE,sBAAsB,CAAA;IAC9B,mBAAmB,EAAE,mBAAmB,CAAA;IACxC,IAAI,EAAE,MAAM,CAAA;IACZ,oBAAoB,EAAE,GAAG,CAAC,MAAM,EAAE,KAAK,CAAC,SAAS,CAAC,CAAA;CACnD,CA8GF,CAAA"}
@@ -1,4 +1,5 @@
1
1
  'use client';
2
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
3
  import { ShimmerEffect } from '@payloadcms/ui/elements/ShimmerEffect';
3
4
  import { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider';
4
5
  import { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction';
@@ -10,7 +11,7 @@ const RichTextEditor = /*#__PURE__*/ lazy(()=>import('./Field.js').then((module)
10
11
  default: module.RichText
11
12
  })));
12
13
  export const RichTextField = (props)=>{
13
- const { lexicalEditorConfig, richTextComponentMap } = props;
14
+ const { admin, lexicalEditorConfig, richTextComponentMap } = props;
14
15
  const { schemaPath } = useFieldProps();
15
16
  const clientFunctions = useClientFunctions();
16
17
  const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false);
@@ -46,10 +47,11 @@ export const RichTextField = (props)=>{
46
47
  lexical: lexicalEditorConfig
47
48
  }
48
49
  });
49
- setFinalSanitizedEditorConfig(sanitizeClientEditorConfig(lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig, resolvedClientFeatures));
50
+ setFinalSanitizedEditorConfig(sanitizeClientEditorConfig(lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig, resolvedClientFeatures, admin));
50
51
  }
51
52
  }
52
53
  }, [
54
+ admin,
53
55
  hasLoadedFeatures,
54
56
  clientFunctions,
55
57
  schemaPath,
@@ -60,28 +62,34 @@ export const RichTextField = (props)=>{
60
62
  featureComponentsWithFeaturesLength
61
63
  ]);
62
64
  if (!hasLoadedFeatures) {
63
- return /*#__PURE__*/ React.createElement(React.Fragment, null, Array.isArray(featureProviderComponents) && featureProviderComponents.map((featureProvider)=>{
64
- // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}
65
- const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key)=>key.startsWith(`feature.${featureProvider.key}.components.`));
66
- const featureComponents = featureComponentKeys.map((key)=>{
67
- return richTextComponentMap.get(key);
68
- }) // TODO: Type better
69
- ;
70
- return /*#__PURE__*/ React.createElement(React.Fragment, {
71
- key: featureProvider.key
72
- }, featureComponents?.length ? featureComponents.map((FeatureComponent)=>{
73
- return FeatureComponent;
74
- }) : null, featureProvider.ClientComponent);
75
- }));
65
+ return /*#__PURE__*/ _jsx(React.Fragment, {
66
+ children: Array.isArray(featureProviderComponents) && featureProviderComponents.map((featureProvider)=>{
67
+ // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}
68
+ const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key)=>key.startsWith(`feature.${featureProvider.key}.components.`));
69
+ const featureComponents = featureComponentKeys.map((key)=>{
70
+ return richTextComponentMap.get(key);
71
+ }) // TODO: Type better
72
+ ;
73
+ return /*#__PURE__*/ _jsxs(React.Fragment, {
74
+ children: [
75
+ featureComponents?.length ? featureComponents.map((FeatureComponent)=>{
76
+ return FeatureComponent;
77
+ }) : null,
78
+ featureProvider.ClientComponent
79
+ ]
80
+ }, featureProvider.key);
81
+ })
82
+ });
76
83
  }
77
- return /*#__PURE__*/ React.createElement(Suspense, {
78
- fallback: /*#__PURE__*/ React.createElement(ShimmerEffect, {
84
+ return /*#__PURE__*/ _jsx(Suspense, {
85
+ fallback: /*#__PURE__*/ _jsx(ShimmerEffect, {
79
86
  height: "35vh"
87
+ }),
88
+ children: finalSanitizedEditorConfig && /*#__PURE__*/ _jsx(RichTextEditor, {
89
+ ...props,
90
+ editorConfig: finalSanitizedEditorConfig
80
91
  })
81
- }, finalSanitizedEditorConfig && /*#__PURE__*/ React.createElement(RichTextEditor, {
82
- ...props,
83
- editorConfig: finalSanitizedEditorConfig
84
- }));
92
+ });
85
93
  };
86
94
 
87
95
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/field/index.tsx"],"sourcesContent":["'use client'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { ShimmerEffect } from '@payloadcms/ui/elements/ShimmerEffect'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction'\nimport React, { Suspense, lazy, useEffect, useState } from 'react'\n\nimport type { GeneratedFeatureProviderComponent } from '../types.js'\nimport type { FeatureProviderClient } from './features/types.js'\nimport type { SanitizedClientEditorConfig } from './lexical/config/types.js'\n\nimport { defaultEditorLexicalConfig } from './lexical/config/client/default.js'\nimport { loadClientFeatures } from './lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from './lexical/config/client/sanitize.js'\n\nconst RichTextEditor = lazy(() =>\n import('./Field.js').then((module) => ({ default: module.RichText })),\n)\n\nexport const RichTextField: React.FC<\n FormFieldBase & {\n lexicalEditorConfig: LexicalEditorConfig\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n> = (props) => {\n const { lexicalEditorConfig, richTextComponentMap } = props\n const { schemaPath } = useFieldProps()\n const clientFunctions = useClientFunctions()\n const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false)\n\n const [featureProviders, setFeatureProviders] = useState<FeatureProviderClient<unknown>[]>([])\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<SanitizedClientEditorConfig>(null)\n\n let featureProviderComponents: GeneratedFeatureProviderComponent[] = richTextComponentMap.get(\n 'features',\n ) as GeneratedFeatureProviderComponent[] // TODO: Type better\n // order by order\n featureProviderComponents = featureProviderComponents.sort((a, b) => a.order - b.order)\n\n const featureComponentsWithFeaturesLength =\n Array.from(richTextComponentMap.keys()).filter(\n (key) => key.startsWith(`feature.`) && !key.includes('.fields.'),\n ).length + featureProviderComponents.length\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n const featureProvidersLocal: FeatureProviderClient<unknown>[] = []\n let featureProvidersAndComponentsLoaded = 0\n\n Object.entries(clientFunctions).forEach(([key, plugin]) => {\n if (key.startsWith(`lexicalFeature.${schemaPath}.`)) {\n if (!key.includes('.components.')) {\n featureProvidersLocal.push(plugin)\n }\n featureProvidersAndComponentsLoaded++\n }\n })\n\n if (featureProvidersAndComponentsLoaded === featureComponentsWithFeaturesLength) {\n setFeatureProviders(featureProvidersLocal)\n setHasLoadedFeatures(true)\n\n /**\n * Loaded feature provided => create the final sanitized editor config\n */\n\n const resolvedClientFeatures = loadClientFeatures({\n clientFunctions,\n schemaPath,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: lexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig,\n resolvedClientFeatures,\n ),\n )\n }\n }\n }, [\n hasLoadedFeatures,\n clientFunctions,\n schemaPath,\n featureProviderComponents.length,\n featureProviders,\n finalSanitizedEditorConfig,\n lexicalEditorConfig,\n featureComponentsWithFeaturesLength,\n ])\n\n if (!hasLoadedFeatures) {\n return (\n <React.Fragment>\n {Array.isArray(featureProviderComponents) &&\n featureProviderComponents.map((featureProvider) => {\n // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(`feature.${featureProvider.key}.components.`),\n )\n const featureComponents: React.ReactNode[] = featureComponentKeys.map((key) => {\n return richTextComponentMap.get(key)\n }) // TODO: Type better\n\n return (\n <React.Fragment key={featureProvider.key}>\n {featureComponents?.length\n ? featureComponents.map((FeatureComponent) => {\n return FeatureComponent\n })\n : null}\n {featureProvider.ClientComponent}\n </React.Fragment>\n )\n })}\n </React.Fragment>\n )\n }\n\n return (\n <Suspense fallback={<ShimmerEffect height=\"35vh\" />}>\n {finalSanitizedEditorConfig && (\n <RichTextEditor {...props} editorConfig={finalSanitizedEditorConfig} />\n )}\n </Suspense>\n )\n}\n"],"names":["ShimmerEffect","useFieldProps","useClientFunctions","React","Suspense","lazy","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","RichTextEditor","then","module","default","RichText","RichTextField","props","lexicalEditorConfig","richTextComponentMap","schemaPath","clientFunctions","hasLoadedFeatures","setHasLoadedFeatures","featureProviders","setFeatureProviders","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","featureProviderComponents","get","sort","a","b","order","featureComponentsWithFeaturesLength","Array","from","keys","filter","key","startsWith","includes","length","featureProvidersLocal","featureProvidersAndComponentsLoaded","Object","entries","forEach","plugin","push","resolvedClientFeatures","unSanitizedEditorConfig","features","lexical","Fragment","isArray","map","featureProvider","featureComponentKeys","featureComponents","FeatureComponent","ClientComponent","fallback","height","editorConfig"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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gBI,eAAe;QAGtC;IAGR;IAEA,qBACE,oBAACzD;QAAS0D,wBAAU,oBAAC9D;YAAc+D,QAAO;;OACvCrC,4CACC,oBAACf;QAAgB,GAAGM,KAAK;QAAE+C,cAActC;;AAIjD,EAAC"}
1
+ {"version":3,"sources":["../../src/field/index.tsx"],"sourcesContent":["'use client'\nimport type { FormFieldBase } from '@payloadcms/ui/fields/shared'\nimport type { EditorConfig as LexicalEditorConfig } from 'lexical'\n\nimport { ShimmerEffect } from '@payloadcms/ui/elements/ShimmerEffect'\nimport { useFieldProps } from '@payloadcms/ui/forms/FieldPropsProvider'\nimport { useClientFunctions } from '@payloadcms/ui/providers/ClientFunction'\nimport React, { Suspense, lazy, useEffect, useState } from 'react'\n\nimport type { GeneratedFeatureProviderComponent, LexicalFieldAdminProps } from '../types.js'\nimport type { FeatureProviderClient } from './features/types.js'\nimport type { SanitizedClientEditorConfig } from './lexical/config/types.js'\n\nimport { defaultEditorLexicalConfig } from './lexical/config/client/default.js'\nimport { loadClientFeatures } from './lexical/config/client/loader.js'\nimport { sanitizeClientEditorConfig } from './lexical/config/client/sanitize.js'\n\nconst RichTextEditor = lazy(() =>\n import('./Field.js').then((module) => ({ default: module.RichText })),\n)\n\nexport const RichTextField: React.FC<\n FormFieldBase & {\n admin?: LexicalFieldAdminProps\n lexicalEditorConfig: LexicalEditorConfig\n name: string\n richTextComponentMap: Map<string, React.ReactNode>\n }\n> = (props) => {\n const { admin, lexicalEditorConfig, richTextComponentMap } = props\n const { schemaPath } = useFieldProps()\n const clientFunctions = useClientFunctions()\n const [hasLoadedFeatures, setHasLoadedFeatures] = useState(false)\n\n const [featureProviders, setFeatureProviders] = useState<FeatureProviderClient<unknown>[]>([])\n\n const [finalSanitizedEditorConfig, setFinalSanitizedEditorConfig] =\n useState<SanitizedClientEditorConfig>(null)\n\n let featureProviderComponents: GeneratedFeatureProviderComponent[] = richTextComponentMap.get(\n 'features',\n ) as GeneratedFeatureProviderComponent[] // TODO: Type better\n // order by order\n featureProviderComponents = featureProviderComponents.sort((a, b) => a.order - b.order)\n\n const featureComponentsWithFeaturesLength =\n Array.from(richTextComponentMap.keys()).filter(\n (key) => key.startsWith(`feature.`) && !key.includes('.fields.'),\n ).length + featureProviderComponents.length\n\n useEffect(() => {\n if (!hasLoadedFeatures) {\n const featureProvidersLocal: FeatureProviderClient<unknown>[] = []\n let featureProvidersAndComponentsLoaded = 0\n\n Object.entries(clientFunctions).forEach(([key, plugin]) => {\n if (key.startsWith(`lexicalFeature.${schemaPath}.`)) {\n if (!key.includes('.components.')) {\n featureProvidersLocal.push(plugin)\n }\n featureProvidersAndComponentsLoaded++\n }\n })\n\n if (featureProvidersAndComponentsLoaded === featureComponentsWithFeaturesLength) {\n setFeatureProviders(featureProvidersLocal)\n setHasLoadedFeatures(true)\n\n /**\n * Loaded feature provided => create the final sanitized editor config\n */\n\n const resolvedClientFeatures = loadClientFeatures({\n clientFunctions,\n schemaPath,\n unSanitizedEditorConfig: {\n features: featureProvidersLocal,\n lexical: lexicalEditorConfig,\n },\n })\n\n setFinalSanitizedEditorConfig(\n sanitizeClientEditorConfig(\n lexicalEditorConfig ? lexicalEditorConfig : defaultEditorLexicalConfig,\n resolvedClientFeatures,\n admin,\n ),\n )\n }\n }\n }, [\n admin,\n hasLoadedFeatures,\n clientFunctions,\n schemaPath,\n featureProviderComponents.length,\n featureProviders,\n finalSanitizedEditorConfig,\n lexicalEditorConfig,\n featureComponentsWithFeaturesLength,\n ])\n\n if (!hasLoadedFeatures) {\n return (\n <React.Fragment>\n {Array.isArray(featureProviderComponents) &&\n featureProviderComponents.map((featureProvider) => {\n // get all components starting with key feature.${FeatureProvider.key}.components.{featureComponentKey}\n const featureComponentKeys = Array.from(richTextComponentMap.keys()).filter((key) =>\n key.startsWith(`feature.${featureProvider.key}.components.`),\n )\n const featureComponents: React.ReactNode[] = featureComponentKeys.map((key) => {\n return richTextComponentMap.get(key)\n }) // TODO: Type better\n\n return (\n <React.Fragment key={featureProvider.key}>\n {featureComponents?.length\n ? featureComponents.map((FeatureComponent) => {\n return FeatureComponent\n })\n : null}\n {featureProvider.ClientComponent}\n </React.Fragment>\n )\n })}\n </React.Fragment>\n )\n }\n\n return (\n <Suspense fallback={<ShimmerEffect height=\"35vh\" />}>\n {finalSanitizedEditorConfig && (\n <RichTextEditor {...props} editorConfig={finalSanitizedEditorConfig} />\n )}\n </Suspense>\n )\n}\n"],"names":["ShimmerEffect","useFieldProps","useClientFunctions","React","Suspense","lazy","useEffect","useState","defaultEditorLexicalConfig","loadClientFeatures","sanitizeClientEditorConfig","RichTextEditor","then","module","default","RichText","RichTextField","props","admin","lexicalEditorConfig","richTextComponentMap","schemaPath","clientFunctions","hasLoadedFeatures","setHasLoadedFeatures","featureProviders","setFeatureProviders","finalSanitizedEditorConfig","setFinalSanitizedEditorConfig","featureProviderComponents","get","sort","a","b","order","featureComponentsWithFeaturesLength","Array","from","keys","filter","key","startsWith","includes","length","featureProvidersLocal","featureProvidersAndComponentsLoaded","Object","entries","forEach","plugin","push","resolvedClientFeatures","unSanitizedEditorConfig","features","lexical","Fragment","isArray","map","featureProvider","featureComponentKeys","featureComponents","FeatureComponent","ClientComponent","fallback","height","editorConfig"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;;AAIA,SAASA,aAAa,QAAQ,wCAAuC;AACrE,SAASC,aAAa,QAAQ,0CAAyC;AACvE,SAASC,kBAAkB,QAAQ,0CAAyC;AAC5E,OAAOC,SAASC,QAAQ,EAAEC,IAAI,EAAEC,SAAS,EAAEC,QAAQ,QAAQ,QAAO;AAMlE,SAASC,0BAA0B,QAAQ,qCAAoC;AAC/E,SAASC,kBAAkB,QAAQ,oCAAmC;AACtE,SAASC,0BAA0B,QAAQ,sCAAqC;AAEhF,MAAMC,+BAAiBN,KAAK,IAC1B,MAAM,CAAC,cAAcO,I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yB1C,mBAAmB;oBAChDa;oBACAD;oBACA+B,yBAAyB;wBACvBC,UAAUT;wBACVU,SAASnC;oBACX;gBACF;gBAEAS,8BACElB,2BACES,sBAAsBA,sBAAsBX,4BAC5C2C,wBACAjC;YAGN;QACF;IACF,GAAG;QACDA;QACAK;QACAD;QACAD;QACAQ,0BAA0Bc,MAAM;QAChClB;QACAE;QACAR;QACAgB;KACD;IAED,IAAI,CAACZ,mBAAmB;QACtB,qBACE,KAACpB,MAAMoD,QAAQ;sBACZnB,MAAMoB,OAAO,CAAC3B,8BACbA,0BAA0B4B,GAAG,CAAC,CAACC;gBAC7B,uGAAuG;gBACvG,MAAMC,uBAAuBvB,MAAMC,IAAI,CAACjB,qBAAqBkB,IAAI,IAAIC,MAAM,CAAC,CAACC,MAC3EA,IAAIC,UAAU,CAAC,CAAC,QAAQ,EAAEiB,gBAAgBlB,GAAG,CAAC,YAAY,CAAC;gBAE7D,MAAMoB,oBAAuCD,qBAAqBF,GAAG,CAAC,CAACjB;oBACrE,OAAOpB,qBAAqBU,GAAG,CAACU;gBAClC,GAAG,oBAAoB;;gBAEvB,qBACE,MAACrC,MAAMoD,QAAQ;;wBACZK,mBAAmBjB,SAChBiB,kBAAkBH,GAAG,CAAC,CAACI;4BACrB,OAAOA;wBACT,KACA;wBACHH,gBAAgBI,eAAe;;mBANbJ,gBAAgBlB,GAAG;YAS5C;;IAGR;IAEA,qBACE,KAACpC;QAAS2D,wBAAU,KAAC/D;YAAcgE,QAAO;;kBACvCrC,4CACC,KAAChB;YAAgB,GAAGM,KAAK;YAAEgD,cAActC;;;AAIjD,EAAC"}
@@ -23,22 +23,3 @@
23
23
  }
24
24
  }
25
25
 
26
- html[data-theme='light'] {
27
- .rich-text-lexical {
28
- &.error {
29
- .editor-container {
30
- @include lightInputError;
31
- }
32
- }
33
- }
34
- }
35
-
36
- html[data-theme='dark'] {
37
- .rich-text-lexical {
38
- &.error {
39
- .editor-container {
40
- @include darkInputError;
41
- }
42
- }
43
- }
44
- }
@@ -1,5 +1,4 @@
1
1
  import type { LexicalEditor } from 'lexical';
2
- import React from 'react';
3
2
  import type { EditorConfigContextType } from './config/client/EditorConfigProvider.js';
4
3
  export type EditorFocusContextType = {
5
4
  blurEditor: () => void;
@@ -16,5 +15,5 @@ export type EditorFocusContextType = {
16
15
  export declare const useEditorFocus: () => EditorFocusContextType;
17
16
  export declare const EditorFocusProvider: ({ children }: {
18
17
  children: any;
19
- }) => React.JSX.Element;
18
+ }) => import("react/jsx-runtime").JSX.Element;
20
19
  //# sourceMappingURL=EditorFocusProvider.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditorFocusProvider.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/EditorFocusProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAG5C,OAAO,KAA2D,MAAM,OAAO,CAAA;AAE/E,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AAItF,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,MAAM,EAAE,aAAa,CAAA;IACrB,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,oBAAoB,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC9F,aAAa,EAAE,aAAa,GAAG,IAAI,CAAA;IACnC,0BAA0B,EAAE,uBAAuB,CAAA;IACnD,oBAAoB,EAAE,MAAM,OAAO,CAAA;IACnC,eAAe,EAAE,MAAM,OAAO,CAAA;IAC9B,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC,yBAAyB,EAAE,uBAAuB,CAAA;IAClD,iBAAiB,EAAE,sBAAsB,CAAA;CAC1C,CAAA;AAeD,eAAO,MAAM,cAAc,QAAO,sBAEjC,CAAA;AAED,eAAO,MAAM,mBAAmB;;uBA4D/B,CAAA"}
1
+ {"version":3,"file":"EditorFocusProvider.d.ts","sourceRoot":"","sources":["../../../src/field/lexical/EditorFocusProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAA;AAK5C,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,yCAAyC,CAAA;AAItF,MAAM,MAAM,sBAAsB,GAAG;IACnC,UAAU,EAAE,MAAM,IAAI,CAAA;IACtB,MAAM,EAAE,aAAa,CAAA;IACrB,WAAW,EAAE,CAAC,OAAO,CAAC,EAAE,aAAa,EAAE,oBAAoB,CAAC,EAAE,uBAAuB,KAAK,IAAI,CAAA;IAC9F,aAAa,EAAE,aAAa,GAAG,IAAI,CAAA;IACnC,0BAA0B,EAAE,uBAAuB,CAAA;IACnD,oBAAoB,EAAE,MAAM,OAAO,CAAA;IACnC,eAAe,EAAE,MAAM,OAAO,CAAA;IAC9B,qBAAqB,EAAE,MAAM,OAAO,CAAA;IACpC,yBAAyB,EAAE,uBAAuB,CAAA;IAClD,iBAAiB,EAAE,sBAAsB,CAAA;CAC1C,CAAA;AAeD,eAAO,MAAM,cAAc,QAAO,sBAEjC,CAAA;AAED,eAAO,MAAM,mBAAmB;;6CA4D/B,CAAA"}
@@ -1,3 +1,4 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js';
2
3
  import React, { createContext, useCallback, useContext, useState } from 'react';
3
4
  import { useEditorConfigContext } from './config/client/EditorConfigProvider.js';
@@ -59,7 +60,7 @@ export const EditorFocusProvider = ({ children })=>{
59
60
  editor,
60
61
  focusedEditor
61
62
  ]);
62
- return /*#__PURE__*/ React.createElement(EditorFocusContext.Provider, {
63
+ return /*#__PURE__*/ _jsx(EditorFocusContext.Provider, {
63
64
  value: {
64
65
  blurEditor,
65
66
  editor,
@@ -71,8 +72,9 @@ export const EditorFocusProvider = ({ children })=>{
71
72
  isParentEditorFocused,
72
73
  parentEditorConfigContext,
73
74
  parentEditorFocus
74
- }
75
- }, children);
75
+ },
76
+ children: children
77
+ });
76
78
  };
77
79
 
78
80
  //# sourceMappingURL=EditorFocusProvider.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/field/lexical/EditorFocusProvider.tsx"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport React, { createContext, useCallback, useContext, useState } from 'react'\n\nimport type { EditorConfigContextType } from './config/client/EditorConfigProvider.js'\n\nimport { useEditorConfigContext } from './config/client/EditorConfigProvider.js'\n\nexport type EditorFocusContextType = {\n blurEditor: () => void\n editor: LexicalEditor\n focusEditor: (_editor?: LexicalEditor, _editorConfigContext?: EditorConfigContextType) => void\n focusedEditor: LexicalEditor | null\n focusedEditorConfigContext: EditorConfigContextType\n isChildEditorFocused: () => boolean\n isEditorFocused: () => boolean\n isParentEditorFocused: () => boolean\n parentEditorConfigContext: EditorConfigContextType\n parentEditorFocus: EditorFocusContextType\n}\n\nconst EditorFocusContext = createContext<EditorFocusContextType>({\n blurEditor: null,\n editor: null,\n focusEditor: null,\n focusedEditor: null,\n focusedEditorConfigContext: null,\n isChildEditorFocused: null,\n isEditorFocused: null,\n isParentEditorFocused: null,\n parentEditorConfigContext: null,\n parentEditorFocus: null,\n})\n\nexport const useEditorFocus = (): EditorFocusContextType => {\n return useContext(EditorFocusContext)\n}\n\nexport const EditorFocusProvider = ({ children }) => {\n const parentEditorFocus = useEditorFocus()\n const parentEditorConfigContext = useEditorConfigContext() // Is parent, as this EditorFocusProvider sits outside the EditorConfigProvider\n const [editor] = useLexicalComposerContext()\n\n const [focusedEditor, setFocusedEditor] = useState<LexicalEditor | null>(null)\n const [focusedEditorConfigContext, setFocusedEditorConfigContext] =\n useState<EditorConfigContextType | null>(null)\n\n const focusEditor = useCallback(\n (_editor: LexicalEditor, _editorConfigContext: EditorConfigContextType) => {\n setFocusedEditor(_editor !== undefined ? _editor : editor)\n setFocusedEditorConfigContext(_editorConfigContext)\n if (parentEditorFocus.focusEditor) {\n parentEditorFocus.focusEditor(\n _editor !== undefined ? _editor : editor,\n _editorConfigContext,\n )\n }\n },\n [editor, parentEditorFocus],\n )\n\n const blurEditor = useCallback(() => {\n if (focusedEditor === editor) {\n setFocusedEditor(null)\n setFocusedEditorConfigContext(null)\n }\n }, [editor, focusedEditor])\n\n const isEditorFocused = useCallback(() => {\n return focusedEditor === editor\n }, [editor, focusedEditor])\n\n const isParentEditorFocused = useCallback(() => {\n return parentEditorFocus?.isEditorFocused ? parentEditorFocus.isEditorFocused() : false\n }, [parentEditorFocus])\n\n const isChildEditorFocused = useCallback(() => {\n return focusedEditor !== editor && !!focusedEditor\n }, [editor, focusedEditor])\n\n return (\n <EditorFocusContext.Provider\n value={{\n blurEditor,\n editor,\n focusEditor,\n focusedEditor,\n focusedEditorConfigContext,\n isChildEditorFocused,\n isEditorFocused,\n isParentEditorFocused,\n parentEditorConfigContext,\n parentEditorFocus,\n }}\n >\n {children}\n </EditorFocusContext.Provider>\n )\n}\n"],"names":["useLexicalComposerContext","React","createContext","useCallback","useContext","useState","useEditorConfigContext","EditorFocusContext","blurEditor","editor","focusEditor","focusedEditor","focusedEditorConfigContext","isChildEditorFocused","isEditorFocused","isParentEditorFocused","parentEditorConfigContext","parentEditorFocus","useEditorFocus","EditorFocusProvider","children","setFocusedEditor","setFocusedEditorConfigContext","_editor","_editorConfigContext","undefined","Provider","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,OAAOC,SAASC,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,QAAO;AAI/E,SAASC,sBAAsB,QAAQ,0CAAyC;AAehF,MAAMC,mCAAqBL,cAAsC;IAC/DM,YAAY;IACZC,QAAQ;IACRC,aAAa;IACbC,eAAe;IACfC,4BAA4B;IAC5BC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/EditorFocusProvider.tsx"],"sourcesContent":["import type { LexicalEditor } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport React, { createContext, useCallback, useContext, useState } from 'react'\n\nimport type { EditorConfigContextType } from './config/client/EditorConfigProvider.js'\n\nimport { useEditorConfigContext } from './config/client/EditorConfigProvider.js'\n\nexport type EditorFocusContextType = {\n blurEditor: () => void\n editor: LexicalEditor\n focusEditor: (_editor?: LexicalEditor, _editorConfigContext?: EditorConfigContextType) => void\n focusedEditor: LexicalEditor | null\n focusedEditorConfigContext: EditorConfigContextType\n isChildEditorFocused: () => boolean\n isEditorFocused: () => boolean\n isParentEditorFocused: () => boolean\n parentEditorConfigContext: EditorConfigContextType\n parentEditorFocus: EditorFocusContextType\n}\n\nconst EditorFocusContext = createContext<EditorFocusContextType>({\n blurEditor: null,\n editor: null,\n focusEditor: null,\n focusedEditor: null,\n focusedEditorConfigContext: null,\n isChildEditorFocused: null,\n isEditorFocused: null,\n isParentEditorFocused: null,\n parentEditorConfigContext: null,\n parentEditorFocus: null,\n})\n\nexport const useEditorFocus = (): EditorFocusContextType => {\n return useContext(EditorFocusContext)\n}\n\nexport const EditorFocusProvider = ({ children }) => {\n const parentEditorFocus = useEditorFocus()\n const parentEditorConfigContext = useEditorConfigContext() // Is parent, as this EditorFocusProvider sits outside the EditorConfigProvider\n const [editor] = useLexicalComposerContext()\n\n const [focusedEditor, setFocusedEditor] = useState<LexicalEditor | null>(null)\n const [focusedEditorConfigContext, setFocusedEditorConfigContext] =\n useState<EditorConfigContextType | null>(null)\n\n const focusEditor = useCallback(\n (_editor: LexicalEditor, _editorConfigContext: EditorConfigContextType) => {\n setFocusedEditor(_editor !== undefined ? _editor : editor)\n setFocusedEditorConfigContext(_editorConfigContext)\n if (parentEditorFocus.focusEditor) {\n parentEditorFocus.focusEditor(\n _editor !== undefined ? _editor : editor,\n _editorConfigContext,\n )\n }\n },\n [editor, parentEditorFocus],\n )\n\n const blurEditor = useCallback(() => {\n if (focusedEditor === editor) {\n setFocusedEditor(null)\n setFocusedEditorConfigContext(null)\n }\n }, [editor, focusedEditor])\n\n const isEditorFocused = useCallback(() => {\n return focusedEditor === editor\n }, [editor, focusedEditor])\n\n const isParentEditorFocused = useCallback(() => {\n return parentEditorFocus?.isEditorFocused ? parentEditorFocus.isEditorFocused() : false\n }, [parentEditorFocus])\n\n const isChildEditorFocused = useCallback(() => {\n return focusedEditor !== editor && !!focusedEditor\n }, [editor, focusedEditor])\n\n return (\n <EditorFocusContext.Provider\n value={{\n blurEditor,\n editor,\n focusEditor,\n focusedEditor,\n focusedEditorConfigContext,\n isChildEditorFocused,\n isEditorFocused,\n isParentEditorFocused,\n parentEditorConfigContext,\n parentEditorFocus,\n }}\n >\n {children}\n </EditorFocusContext.Provider>\n )\n}\n"],"names":["useLexicalComposerContext","React","createContext","useCallback","useContext","useState","useEditorConfigContext","EditorFocusContext","blurEditor","editor","focusEditor","focusedEditor","focusedEditorConfigContext","isChildEditorFocused","isEditorFocused","isParentEditorFocused","parentEditorConfigContext","parentEditorFocus","useEditorFocus","EditorFocusProvider","children","setFocusedEditor","setFocusedEditorConfigContext","_editor","_editorConfigContext","undefined","Provider","value"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":";AAEA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,OAAOC,SAASC,aAAa,EAAEC,WAAW,EAAEC,UAAU,EAAEC,QAAQ,QAAQ,QAAO;AAI/E,SAASC,sBAAsB,QAAQ,0CAAyC;AAehF,MAAMC,mCAAqBL,cAAsC;IAC/DM,YAAY;IACZC,QAAQ;IACRC,aAAa;IACbC,eAAe;IACfC,4BAA4B;IAC5BC,sBAAsB;IACtBC,iBAAiB;IACjBC,uBAAuB;IACvBC,2BAA2B;IAC3BC,mBAAmB;AACrB;AAEA,OAAO,MAAMC,iBAAiB;IAC5B,OAAOd,WAAWG;AACpB,EAAC;AAED,OAAO,MAAMY,sBAAsB,CAAC,EAAEC,QAAQ,EAAE;IAC9C,MAAMH,oBAAoBC;IAC1B,MAAMF,4BAA4BV,yBAAyB,+EAA+E;;IAC1I,MAAM,CAACG,OAAO,GAAGT;IAEjB,MAAM,CAACW,eAAeU,iBAAiB,GAAGhB,SAA+B;IACzE,MAAM,CAACO,4BAA4BU,8BAA8B,GAC/DjB,SAAyC;IAE3C,MAAMK,cAAcP,YAClB,CAACoB,SAAwBC;QACvBH,iBAAiBE,YAAYE,YAAYF,UAAUd;QACnDa,8BAA8BE;QAC9B,IAAIP,kBAAkBP,WAAW,EAAE;YACjCO,kBAAkBP,WAAW,CAC3Ba,YAAYE,YAAYF,UAAUd,QAClCe;QAEJ;IACF,GACA;QAACf;QAAQQ;KAAkB;IAG7B,MAAMT,aAAaL,YAAY;QAC7B,IAAIQ,kBAAkBF,QAAQ;YAC5BY,iBAAiB;YACjBC,8BAA8B;QAChC;IACF,GAAG;QAACb;QAAQE;KAAc;IAE1B,MAAMG,kBAAkBX,YAAY;QAClC,OAAOQ,kBAAkBF;IAC3B,GAAG;QAACA;QAAQE;KAAc;IAE1B,MAAMI,wBAAwBZ,YAAY;QACxC,OAAOc,mBAAmBH,kBAAkBG,kBAAkBH,eAAe,KAAK;IACpF,GAAG;QAACG;KAAkB;IAEtB,MAAMJ,uBAAuBV,YAAY;QACvC,OAAOQ,kBAAkBF,UAAU,CAAC,CAACE;IACvC,GAAG;QAACF;QAAQE;KAAc;IAE1B,qBACE,KAACJ,mBAAmBmB,QAAQ;QAC1BC,OAAO;YACLnB;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;YACAC;QACF;kBAECG;;AAGP,EAAC"}
@@ -1,12 +1,13 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
1
2
  import * as React from 'react';
2
3
  export const EditorPlugin = ({ anchorElem, clientProps, plugin })=>{
3
4
  if (plugin.position === 'floatingAnchorElem') {
4
- return plugin.Component && /*#__PURE__*/ React.createElement(plugin.Component, {
5
+ return plugin.Component && /*#__PURE__*/ _jsx(plugin.Component, {
5
6
  anchorElem: anchorElem,
6
7
  clientProps: clientProps
7
8
  });
8
9
  }
9
- return plugin.Component && /*#__PURE__*/ React.createElement(plugin.Component, {
10
+ return plugin.Component && /*#__PURE__*/ _jsx(plugin.Component, {
10
11
  clientProps: clientProps
11
12
  });
12
13
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../src/field/lexical/EditorPlugin.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport type { SanitizedPlugin } from '../features/types.js'\n\nexport const EditorPlugin: React.FC<{\n anchorElem?: HTMLDivElement\n clientProps: any\n plugin: SanitizedPlugin\n}> = ({ anchorElem, clientProps, plugin }) => {\n if (plugin.position === 'floatingAnchorElem') {\n return (\n plugin.Component && <plugin.Component anchorElem={anchorElem} clientProps={clientProps} />\n )\n }\n\n return plugin.Component && <plugin.Component clientProps={clientProps} />\n}\n"],"names":["React","EditorPlugin","anchorElem","clientProps","plugin","position","Component"],"rangeMappings":";;;;;;;;;;;","mappings":"AAAA,YAAYA,WAAW,QAAO;AAI9B,OAAO,MAAMC,eAIR,CAAC,EAAEC,UAAU,EAAEC,WAAW,EAAEC,MAAM,EAAE;IACvC,IAAIA,OAAOC,QAAQ,KAAK,sBAAsB;QAC5C,OACED,OAAOE,SAAS,kBAAI,oBAACF,OAAOE,SAAS;YAACJ,YAAYA;YAAYC,aAAaA;;IAE/E;IAEA,OAAOC,OAAOE,SAAS,kBAAI,oBAACF,OAAOE,SAAS;QAACH,aAAaA;;AAC5D,EAAC"}
1
+ {"version":3,"sources":["../../../src/field/lexical/EditorPlugin.tsx"],"sourcesContent":["import * as React from 'react'\n\nimport type { SanitizedPlugin } from '../features/types.js'\n\nexport const EditorPlugin: React.FC<{\n anchorElem?: HTMLDivElement\n clientProps: any\n plugin: SanitizedPlugin\n}> = ({ anchorElem, clientProps, plugin }) => {\n if (plugin.position === 'floatingAnchorElem') {\n return (\n plugin.Component && <plugin.Component anchorElem={anchorElem} clientProps={clientProps} />\n )\n }\n\n return plugin.Component && <plugin.Component clientProps={clientProps} />\n}\n"],"names":["React","EditorPlugin","anchorElem","clientProps","plugin","position","Component"],"rangeMappings":";;;;;;;;;;;;","mappings":";AAAA,YAAYA,WAAW,QAAO;AAI9B,OAAO,MAAMC,eAIR,CAAC,EAAEC,UAAU,EAAEC,WAAW,EAAEC,MAAM,EAAE;IACvC,IAAIA,OAAOC,QAAQ,KAAK,sBAAsB;QAC5C,OACED,OAAOE,SAAS,kBAAI,KAACF,OAAOE,SAAS;YAACJ,YAAYA;YAAYC,aAAaA;;IAE/E;IAEA,OAAOC,OAAOE,SAAS,kBAAI,KAACF,OAAOE,SAAS;QAACH,aAAaA;;AAC5D,EAAC"}