@payloadcms/richtext-lexical 3.0.0-beta.24 → 3.0.0-beta.26

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 (359) hide show
  1. package/dist/exports/components.d.ts +8 -2
  2. package/dist/exports/components.d.ts.map +1 -1
  3. package/dist/exports/components.js +8 -2
  4. package/dist/exports/components.js.map +1 -1
  5. package/dist/field/features/align/feature.client.d.ts.map +1 -1
  6. package/dist/field/features/align/feature.client.js +126 -46
  7. package/dist/field/features/align/feature.client.js.map +1 -1
  8. package/dist/field/features/align/toolbarAlignGroup.d.ts +3 -0
  9. package/dist/field/features/align/toolbarAlignGroup.d.ts.map +1 -0
  10. package/dist/field/features/align/{inlineToolbarAlignGroup.js → toolbarAlignGroup.js} +3 -3
  11. package/dist/field/features/align/toolbarAlignGroup.js.map +1 -0
  12. package/dist/field/features/blockquote/feature.client.d.ts +1 -1
  13. package/dist/field/features/blockquote/feature.client.d.ts.map +1 -1
  14. package/dist/field/features/blockquote/feature.client.js +39 -25
  15. package/dist/field/features/blockquote/feature.client.js.map +1 -1
  16. package/dist/field/features/blockquote/feature.server.d.ts +1 -1
  17. package/dist/field/features/blockquote/feature.server.js +3 -3
  18. package/dist/field/features/blockquote/feature.server.js.map +1 -1
  19. package/dist/field/features/blocks/component/index.d.ts.map +1 -1
  20. package/dist/field/features/blocks/component/index.js +1 -1
  21. package/dist/field/features/blocks/component/index.js.map +1 -1
  22. package/dist/field/features/blocks/feature.client.d.ts.map +1 -1
  23. package/dist/field/features/blocks/feature.client.js +39 -8
  24. package/dist/field/features/blocks/feature.client.js.map +1 -1
  25. package/dist/field/features/blocks/feature.server.d.ts +2 -5
  26. package/dist/field/features/blocks/feature.server.d.ts.map +1 -1
  27. package/dist/field/features/blocks/feature.server.js +2 -2
  28. package/dist/field/features/blocks/feature.server.js.map +1 -1
  29. package/dist/field/features/blocks/plugin/index.d.ts +3 -2
  30. package/dist/field/features/blocks/plugin/index.d.ts.map +1 -1
  31. package/dist/field/features/blocks/plugin/index.js +2 -2
  32. package/dist/field/features/blocks/plugin/index.js.map +1 -1
  33. package/dist/field/features/blocks/populationPromise.d.ts.map +1 -1
  34. package/dist/field/features/blocks/populationPromise.js +2 -1
  35. package/dist/field/features/blocks/populationPromise.js.map +1 -1
  36. package/dist/field/features/debug/testRecorder/plugin/index.d.ts +2 -2
  37. package/dist/field/features/debug/testRecorder/plugin/index.d.ts.map +1 -1
  38. package/dist/field/features/debug/testRecorder/plugin/index.js.map +1 -1
  39. package/dist/field/features/debug/treeView/plugin/index.d.ts +2 -2
  40. package/dist/field/features/debug/treeView/plugin/index.d.ts.map +1 -1
  41. package/dist/field/features/debug/treeView/plugin/index.js +2 -2
  42. package/dist/field/features/debug/treeView/plugin/index.js.map +1 -1
  43. package/dist/field/features/format/bold/feature.client.d.ts.map +1 -1
  44. package/dist/field/features/format/bold/feature.client.js +23 -19
  45. package/dist/field/features/format/bold/feature.client.js.map +1 -1
  46. package/dist/field/features/format/inlineCode/feature.client.d.ts.map +1 -1
  47. package/dist/field/features/format/inlineCode/feature.client.js +23 -19
  48. package/dist/field/features/format/inlineCode/feature.client.js.map +1 -1
  49. package/dist/field/features/format/italic/feature.client.d.ts.map +1 -1
  50. package/dist/field/features/format/italic/feature.client.js +23 -19
  51. package/dist/field/features/format/italic/feature.client.js.map +1 -1
  52. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts +3 -0
  53. package/dist/field/features/format/shared/toolbarFormatGroup.d.ts.map +1 -0
  54. package/dist/field/features/format/shared/toolbarFormatGroup.js +10 -0
  55. package/dist/field/features/format/shared/toolbarFormatGroup.js.map +1 -0
  56. package/dist/field/features/format/strikethrough/feature.client.d.ts.map +1 -1
  57. package/dist/field/features/format/strikethrough/feature.client.js +23 -19
  58. package/dist/field/features/format/strikethrough/feature.client.js.map +1 -1
  59. package/dist/field/features/format/subscript/feature.client.d.ts.map +1 -1
  60. package/dist/field/features/format/subscript/feature.client.js +23 -19
  61. package/dist/field/features/format/subscript/feature.client.js.map +1 -1
  62. package/dist/field/features/format/superscript/feature.client.d.ts.map +1 -1
  63. package/dist/field/features/format/superscript/feature.client.js +23 -19
  64. package/dist/field/features/format/superscript/feature.client.js.map +1 -1
  65. package/dist/field/features/format/underline/feature.client.d.ts.map +1 -1
  66. package/dist/field/features/format/underline/feature.client.js +23 -19
  67. package/dist/field/features/format/underline/feature.client.js.map +1 -1
  68. package/dist/field/features/heading/feature.client.d.ts.map +1 -1
  69. package/dist/field/features/heading/feature.client.js +49 -29
  70. package/dist/field/features/heading/feature.client.js.map +1 -1
  71. package/dist/field/features/horizontalRule/feature.client.d.ts.map +1 -1
  72. package/dist/field/features/horizontalRule/feature.client.js +27 -4
  73. package/dist/field/features/horizontalRule/feature.client.js.map +1 -1
  74. package/dist/field/features/horizontalRule/plugin/index.d.ts +2 -1
  75. package/dist/field/features/horizontalRule/plugin/index.d.ts.map +1 -1
  76. package/dist/field/features/horizontalRule/plugin/index.js +2 -2
  77. package/dist/field/features/horizontalRule/plugin/index.js.map +1 -1
  78. package/dist/field/features/indent/feature.client.d.ts.map +1 -1
  79. package/dist/field/features/indent/feature.client.js +41 -37
  80. package/dist/field/features/indent/feature.client.js.map +1 -1
  81. package/dist/field/features/indent/toolbarIndentGroup.d.ts +3 -0
  82. package/dist/field/features/indent/toolbarIndentGroup.d.ts.map +1 -0
  83. package/dist/field/features/indent/toolbarIndentGroup.js +10 -0
  84. package/dist/field/features/indent/toolbarIndentGroup.js.map +1 -0
  85. package/dist/field/features/link/drawer/baseFields.d.ts +2 -2
  86. package/dist/field/features/link/drawer/baseFields.d.ts.map +1 -1
  87. package/dist/field/features/link/drawer/baseFields.js +2 -1
  88. package/dist/field/features/link/drawer/baseFields.js.map +1 -1
  89. package/dist/field/features/link/drawer/types.d.ts +2 -2
  90. package/dist/field/features/link/drawer/types.d.ts.map +1 -1
  91. package/dist/field/features/link/drawer/types.js.map +1 -1
  92. package/dist/field/features/link/feature.client.d.ts.map +1 -1
  93. package/dist/field/features/link/feature.client.js +54 -40
  94. package/dist/field/features/link/feature.client.js.map +1 -1
  95. package/dist/field/features/link/feature.server.d.ts +10 -3
  96. package/dist/field/features/link/feature.server.d.ts.map +1 -1
  97. package/dist/field/features/link/feature.server.js +3 -3
  98. package/dist/field/features/link/feature.server.js.map +1 -1
  99. package/dist/field/features/link/plugins/autoLink/index.d.ts +3 -2
  100. package/dist/field/features/link/plugins/autoLink/index.d.ts.map +1 -1
  101. package/dist/field/features/link/plugins/autoLink/index.js +2 -2
  102. package/dist/field/features/link/plugins/autoLink/index.js.map +1 -1
  103. package/dist/field/features/link/plugins/clickableLink/index.d.ts +3 -2
  104. package/dist/field/features/link/plugins/clickableLink/index.d.ts.map +1 -1
  105. package/dist/field/features/link/plugins/clickableLink/index.js +2 -2
  106. package/dist/field/features/link/plugins/clickableLink/index.js.map +1 -1
  107. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.d.ts.map +1 -1
  108. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js +75 -68
  109. package/dist/field/features/link/plugins/floatingLinkEditor/LinkEditor/index.js.map +1 -1
  110. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts +3 -4
  111. package/dist/field/features/link/plugins/floatingLinkEditor/index.d.ts.map +1 -1
  112. package/dist/field/features/link/plugins/floatingLinkEditor/index.js.map +1 -1
  113. package/dist/field/features/link/plugins/floatingLinkEditor/index.scss +2 -2
  114. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts +3 -3
  115. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.d.ts.map +1 -1
  116. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js +2 -2
  117. package/dist/field/features/link/plugins/floatingLinkEditor/utilities.js.map +1 -1
  118. package/dist/field/features/link/plugins/link/index.d.ts +3 -1
  119. package/dist/field/features/link/plugins/link/index.d.ts.map +1 -1
  120. package/dist/field/features/link/plugins/link/index.js +2 -2
  121. package/dist/field/features/link/plugins/link/index.js.map +1 -1
  122. package/dist/field/features/link/populationPromise.d.ts.map +1 -1
  123. package/dist/field/features/link/populationPromise.js +2 -1
  124. package/dist/field/features/link/populationPromise.js.map +1 -1
  125. package/dist/field/features/link/validate.js.map +1 -1
  126. package/dist/field/features/lists/checklist/feature.client.d.ts.map +1 -1
  127. package/dist/field/features/lists/checklist/feature.client.js +44 -19
  128. package/dist/field/features/lists/checklist/feature.client.js.map +1 -1
  129. package/dist/field/features/lists/checklist/plugin/index.d.ts +2 -2
  130. package/dist/field/features/lists/checklist/plugin/index.d.ts.map +1 -1
  131. package/dist/field/features/lists/checklist/plugin/index.js +2 -2
  132. package/dist/field/features/lists/checklist/plugin/index.js.map +1 -1
  133. package/dist/field/features/lists/orderedList/feature.client.d.ts.map +1 -1
  134. package/dist/field/features/lists/orderedList/feature.client.js +44 -19
  135. package/dist/field/features/lists/orderedList/feature.client.js.map +1 -1
  136. package/dist/field/features/lists/plugin/index.d.ts +2 -2
  137. package/dist/field/features/lists/plugin/index.d.ts.map +1 -1
  138. package/dist/field/features/lists/plugin/index.js +2 -2
  139. package/dist/field/features/lists/plugin/index.js.map +1 -1
  140. package/dist/field/features/lists/unorderedList/feature.client.d.ts.map +1 -1
  141. package/dist/field/features/lists/unorderedList/feature.client.js +44 -19
  142. package/dist/field/features/lists/unorderedList/feature.client.js.map +1 -1
  143. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.d.ts +1 -1
  144. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js +1 -1
  145. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/client.js.map +1 -1
  146. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js +2 -2
  147. package/dist/field/features/migrations/slateToLexical/converter/converters/blockquote/index.js.map +1 -1
  148. package/dist/field/features/paragraph/feature.client.d.ts.map +1 -1
  149. package/dist/field/features/paragraph/feature.client.js +36 -22
  150. package/dist/field/features/paragraph/feature.client.js.map +1 -1
  151. package/dist/field/features/relationship/feature.client.d.ts.map +1 -1
  152. package/dist/field/features/relationship/feature.client.js +31 -9
  153. package/dist/field/features/relationship/feature.client.js.map +1 -1
  154. package/dist/field/features/relationship/feature.server.d.ts +10 -1
  155. package/dist/field/features/relationship/feature.server.d.ts.map +1 -1
  156. package/dist/field/features/relationship/feature.server.js +2 -2
  157. package/dist/field/features/relationship/feature.server.js.map +1 -1
  158. package/dist/field/features/relationship/nodes/components/RelationshipComponent.d.ts.map +1 -1
  159. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js +4 -2
  160. package/dist/field/features/relationship/nodes/components/RelationshipComponent.js.map +1 -1
  161. package/dist/field/features/relationship/plugins/index.d.ts +2 -2
  162. package/dist/field/features/relationship/plugins/index.d.ts.map +1 -1
  163. package/dist/field/features/relationship/plugins/index.js +6 -6
  164. package/dist/field/features/relationship/plugins/index.js.map +1 -1
  165. package/dist/field/features/relationship/populationPromise.d.ts +2 -1
  166. package/dist/field/features/relationship/populationPromise.d.ts.map +1 -1
  167. package/dist/field/features/relationship/populationPromise.js +25 -20
  168. package/dist/field/features/relationship/populationPromise.js.map +1 -1
  169. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts +3 -0
  170. package/dist/field/features/shared/toolbar/addDropdownGroup.d.ts.map +1 -0
  171. package/dist/field/features/shared/toolbar/addDropdownGroup.js +12 -0
  172. package/dist/field/features/shared/toolbar/addDropdownGroup.js.map +1 -0
  173. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts +3 -0
  174. package/dist/field/features/shared/toolbar/featureButtonsGroup.d.ts.map +1 -0
  175. package/dist/field/features/shared/toolbar/featureButtonsGroup.js +10 -0
  176. package/dist/field/features/shared/toolbar/featureButtonsGroup.js.map +1 -0
  177. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts +3 -0
  178. package/dist/field/features/shared/toolbar/textDropdownGroup.d.ts.map +1 -0
  179. package/dist/field/features/shared/{inlineToolbar → toolbar}/textDropdownGroup.js +2 -2
  180. package/dist/field/features/shared/toolbar/textDropdownGroup.js.map +1 -0
  181. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts +4 -0
  182. package/dist/field/features/toolbars/fixed/Toolbar/index.d.ts.map +1 -0
  183. package/dist/field/features/toolbars/fixed/Toolbar/index.js +152 -0
  184. package/dist/field/features/toolbars/fixed/Toolbar/index.js.map +1 -0
  185. package/dist/field/features/toolbars/fixed/Toolbar/index.scss +81 -0
  186. package/dist/field/features/toolbars/fixed/feature.client.d.ts +3 -0
  187. package/dist/field/features/toolbars/fixed/feature.client.d.ts.map +1 -0
  188. package/dist/field/features/toolbars/fixed/feature.client.js +20 -0
  189. package/dist/field/features/toolbars/fixed/feature.client.js.map +1 -0
  190. package/dist/field/features/toolbars/fixed/feature.server.d.ts +3 -0
  191. package/dist/field/features/toolbars/fixed/feature.server.d.ts.map +1 -0
  192. package/dist/field/features/toolbars/fixed/feature.server.js +16 -0
  193. package/dist/field/features/toolbars/fixed/feature.server.js.map +1 -0
  194. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts +4 -0
  195. package/dist/field/features/toolbars/inline/Toolbar/index.d.ts.map +1 -0
  196. package/dist/field/{lexical/plugins → features}/toolbars/inline/Toolbar/index.js +67 -23
  197. package/dist/field/features/toolbars/inline/Toolbar/index.js.map +1 -0
  198. package/dist/field/{lexical/plugins → features}/toolbars/inline/Toolbar/index.scss +3 -8
  199. package/dist/field/features/toolbars/inline/feature.client.d.ts +3 -0
  200. package/dist/field/features/toolbars/inline/feature.client.d.ts.map +1 -0
  201. package/dist/field/features/toolbars/inline/feature.client.js +20 -0
  202. package/dist/field/features/toolbars/inline/feature.client.js.map +1 -0
  203. package/dist/field/features/toolbars/inline/feature.server.d.ts +3 -0
  204. package/dist/field/features/toolbars/inline/feature.server.d.ts.map +1 -0
  205. package/dist/field/features/toolbars/inline/feature.server.js +16 -0
  206. package/dist/field/features/toolbars/inline/feature.server.js.map +1 -0
  207. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts +10 -0
  208. package/dist/field/features/toolbars/shared/ToolbarButton/index.d.ts.map +1 -0
  209. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarButton/index.js +21 -8
  210. package/dist/field/features/toolbars/shared/ToolbarButton/index.js.map +1 -0
  211. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarButton/index.scss +3 -1
  212. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts +23 -0
  213. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.d.ts.map +1 -0
  214. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarDropdown/DropDown.js +25 -67
  215. package/dist/field/features/toolbars/shared/ToolbarDropdown/DropDown.js.map +1 -0
  216. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts +23 -0
  217. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.d.ts.map +1 -0
  218. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js +139 -0
  219. package/dist/field/features/toolbars/shared/ToolbarDropdown/index.js.map +1 -0
  220. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars/shared}/ToolbarDropdown/index.scss +25 -13
  221. package/dist/field/{lexical/plugins/toolbars/inline → features/toolbars}/types.d.ts +16 -8
  222. package/dist/field/features/toolbars/types.d.ts.map +1 -0
  223. package/dist/field/features/toolbars/types.js.map +1 -0
  224. package/dist/field/features/types.d.ts +27 -19
  225. package/dist/field/features/types.d.ts.map +1 -1
  226. package/dist/field/features/types.js.map +1 -1
  227. package/dist/field/features/upload/component/index.d.ts.map +1 -1
  228. package/dist/field/features/upload/component/index.js +6 -2
  229. package/dist/field/features/upload/component/index.js.map +1 -1
  230. package/dist/field/features/upload/feature.client.d.ts.map +1 -1
  231. package/dist/field/features/upload/feature.client.js +29 -4
  232. package/dist/field/features/upload/feature.client.js.map +1 -1
  233. package/dist/field/features/upload/feature.server.d.ts +10 -3
  234. package/dist/field/features/upload/feature.server.d.ts.map +1 -1
  235. package/dist/field/features/upload/feature.server.js +2 -2
  236. package/dist/field/features/upload/feature.server.js.map +1 -1
  237. package/dist/field/features/upload/nodes/UploadNode.d.ts.map +1 -1
  238. package/dist/field/features/upload/nodes/UploadNode.js +18 -2
  239. package/dist/field/features/upload/nodes/UploadNode.js.map +1 -1
  240. package/dist/field/features/upload/plugin/index.d.ts +3 -2
  241. package/dist/field/features/upload/plugin/index.d.ts.map +1 -1
  242. package/dist/field/features/upload/plugin/index.js +2 -2
  243. package/dist/field/features/upload/plugin/index.js.map +1 -1
  244. package/dist/field/features/upload/populationPromise.d.ts.map +1 -1
  245. package/dist/field/features/upload/populationPromise.js +5 -2
  246. package/dist/field/features/upload/populationPromise.js.map +1 -1
  247. package/dist/field/features/upload/validate.d.ts.map +1 -1
  248. package/dist/field/features/upload/validate.js +3 -0
  249. package/dist/field/features/upload/validate.js.map +1 -1
  250. package/dist/field/lexical/EditorFocusProvider.d.ts +20 -0
  251. package/dist/field/lexical/EditorFocusProvider.d.ts.map +1 -0
  252. package/dist/field/lexical/EditorFocusProvider.js +78 -0
  253. package/dist/field/lexical/EditorFocusProvider.js.map +1 -0
  254. package/dist/field/lexical/EditorPlugin.d.ts +1 -0
  255. package/dist/field/lexical/EditorPlugin.d.ts.map +1 -1
  256. package/dist/field/lexical/EditorPlugin.js +6 -3
  257. package/dist/field/lexical/EditorPlugin.js.map +1 -1
  258. package/dist/field/lexical/LexicalEditor.d.ts.map +1 -1
  259. package/dist/field/lexical/LexicalEditor.js +25 -4
  260. package/dist/field/lexical/LexicalEditor.js.map +1 -1
  261. package/dist/field/lexical/LexicalProvider.d.ts.map +1 -1
  262. package/dist/field/lexical/LexicalProvider.js +3 -2
  263. package/dist/field/lexical/LexicalProvider.js.map +1 -1
  264. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts +2 -3
  265. package/dist/field/lexical/config/client/EditorConfigProvider.d.ts.map +1 -1
  266. package/dist/field/lexical/config/client/EditorConfigProvider.js.map +1 -1
  267. package/dist/field/lexical/config/client/sanitize.d.ts.map +1 -1
  268. package/dist/field/lexical/config/client/sanitize.js +1 -0
  269. package/dist/field/lexical/config/client/sanitize.js.map +1 -1
  270. package/dist/field/lexical/config/server/default.d.ts.map +1 -1
  271. package/dist/field/lexical/config/server/default.js +5 -3
  272. package/dist/field/lexical/config/server/default.js.map +1 -1
  273. package/dist/field/lexical/config/server/loader.d.ts +2 -1
  274. package/dist/field/lexical/config/server/loader.d.ts.map +1 -1
  275. package/dist/field/lexical/config/server/loader.js +2 -1
  276. package/dist/field/lexical/config/server/loader.js.map +1 -1
  277. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts +6 -6
  278. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.d.ts.map +1 -1
  279. package/dist/field/lexical/plugins/SlashMenu/LexicalTypeaheadMenuPlugin/types.js.map +1 -1
  280. package/dist/field/lexical/plugins/SlashMenu/index.d.ts.map +1 -1
  281. package/dist/field/lexical/plugins/SlashMenu/index.js +10 -10
  282. package/dist/field/lexical/plugins/SlashMenu/index.js.map +1 -1
  283. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts +1 -1
  284. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.d.ts.map +1 -1
  285. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js +2 -2
  286. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/getNodeCloseToPoint.js.map +1 -1
  287. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.d.ts.map +1 -1
  288. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js +6 -3
  289. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.js.map +1 -1
  290. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/index.scss +8 -0
  291. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.d.ts.map +1 -1
  292. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js +25 -6
  293. package/dist/field/lexical/plugins/handles/DraggableBlockPlugin/setTargetLine.js.map +1 -1
  294. package/dist/field/lexical/ui/icons/Add/index.d.ts +3 -0
  295. package/dist/field/lexical/ui/icons/Add/index.d.ts.map +1 -0
  296. package/dist/field/lexical/ui/icons/Add/index.js +16 -0
  297. package/dist/field/lexical/ui/icons/Add/index.js.map +1 -0
  298. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts +11 -1
  299. package/dist/field/lexical/utils/setFloatingElemPosition.d.ts.map +1 -1
  300. package/dist/field/lexical/utils/setFloatingElemPosition.js +3 -2
  301. package/dist/field/lexical/utils/setFloatingElemPosition.js.map +1 -1
  302. package/dist/index.d.ts +11 -9
  303. package/dist/index.d.ts.map +1 -1
  304. package/dist/index.js +11 -7
  305. package/dist/index.js.map +1 -1
  306. package/dist/populate/populate.d.ts +2 -1
  307. package/dist/populate/populate.d.ts.map +1 -1
  308. package/dist/populate/populate.js +13 -11
  309. package/dist/populate/populate.js.map +1 -1
  310. package/dist/populate/populateLexicalPopulationPromises.d.ts +1 -1
  311. package/dist/populate/populateLexicalPopulationPromises.d.ts.map +1 -1
  312. package/dist/populate/populateLexicalPopulationPromises.js +2 -1
  313. package/dist/populate/populateLexicalPopulationPromises.js.map +1 -1
  314. package/dist/populate/recurseNestedFields.d.ts +2 -1
  315. package/dist/populate/recurseNestedFields.d.ts.map +1 -1
  316. package/dist/populate/recurseNestedFields.js +2 -1
  317. package/dist/populate/recurseNestedFields.js.map +1 -1
  318. package/dist/types.d.ts +2 -1
  319. package/dist/types.d.ts.map +1 -1
  320. package/dist/types.js.map +1 -1
  321. package/package.json +11 -11
  322. package/dist/field/features/align/inlineToolbarAlignGroup.d.ts +0 -3
  323. package/dist/field/features/align/inlineToolbarAlignGroup.d.ts.map +0 -1
  324. package/dist/field/features/align/inlineToolbarAlignGroup.js.map +0 -1
  325. package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts +0 -3
  326. package/dist/field/features/format/shared/inlineToolbarFormatGroup.d.ts.map +0 -1
  327. package/dist/field/features/format/shared/inlineToolbarFormatGroup.js +0 -10
  328. package/dist/field/features/format/shared/inlineToolbarFormatGroup.js.map +0 -1
  329. package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts +0 -3
  330. package/dist/field/features/indent/inlineToolbarIndentGroup.d.ts.map +0 -1
  331. package/dist/field/features/indent/inlineToolbarIndentGroup.js +0 -10
  332. package/dist/field/features/indent/inlineToolbarIndentGroup.js.map +0 -1
  333. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts +0 -3
  334. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.d.ts.map +0 -1
  335. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js +0 -10
  336. package/dist/field/features/shared/inlineToolbar/featureButtonsGroup.js.map +0 -1
  337. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts +0 -3
  338. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.d.ts.map +0 -1
  339. package/dist/field/features/shared/inlineToolbar/textDropdownGroup.js.map +0 -1
  340. package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts +0 -40
  341. package/dist/field/lexical/plugins/toolbars/fixed/types.d.ts.map +0 -1
  342. package/dist/field/lexical/plugins/toolbars/fixed/types.js.map +0 -1
  343. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts +0 -6
  344. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.d.ts.map +0 -1
  345. package/dist/field/lexical/plugins/toolbars/inline/Toolbar/index.js.map +0 -1
  346. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts +0 -8
  347. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.d.ts.map +0 -1
  348. package/dist/field/lexical/plugins/toolbars/inline/ToolbarButton/index.js.map +0 -1
  349. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts +0 -17
  350. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.d.ts.map +0 -1
  351. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/DropDown.js.map +0 -1
  352. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts +0 -18
  353. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.d.ts.map +0 -1
  354. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js +0 -42
  355. package/dist/field/lexical/plugins/toolbars/inline/ToolbarDropdown/index.js.map +0 -1
  356. package/dist/field/lexical/plugins/toolbars/inline/types.d.ts.map +0 -1
  357. package/dist/field/lexical/plugins/toolbars/inline/types.js +0 -3
  358. package/dist/field/lexical/plugins/toolbars/inline/types.js.map +0 -1
  359. /package/dist/field/{lexical/plugins/toolbars/fixed → features/toolbars}/types.js +0 -0
@@ -1,9 +1,10 @@
1
1
  'use client';
2
- import { withMergedProps } from '@payloadcms/ui/elements/withMergedProps';
2
+ import { $isNodeSelection } from 'lexical';
3
3
  import { RelationshipIcon } from '../../lexical/ui/icons/Relationship/index.js';
4
4
  import { createClientComponent } from '../createClientComponent.js';
5
+ import { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js';
5
6
  import { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands.js';
6
- import { RelationshipNode } from './nodes/RelationshipNode.js';
7
+ import { $isRelationshipNode, RelationshipNode } from './nodes/RelationshipNode.js';
7
8
  import { RelationshipPlugin } from './plugins/index.js';
8
9
  const RelationshipFeatureClient = (props)=>{
9
10
  return {
@@ -15,27 +16,23 @@ const RelationshipFeatureClient = (props)=>{
15
16
  ],
16
17
  plugins: [
17
18
  {
18
- Component: withMergedProps({
19
- Component: RelationshipPlugin,
20
- toMergeIntoProps: props
21
- }),
19
+ Component: RelationshipPlugin,
22
20
  position: 'normal'
23
21
  }
24
22
  ],
25
23
  slashMenu: {
26
24
  groups: [
27
25
  {
28
- displayName: 'Basic',
29
26
  items: [
30
27
  {
31
28
  Icon: RelationshipIcon,
32
- displayName: 'Relationship',
33
29
  key: 'relationship',
34
30
  keywords: [
35
31
  'relationship',
36
32
  'relation',
37
33
  'rel'
38
34
  ],
35
+ label: 'Relationship',
39
36
  onSelect: ({ editor })=>{
40
37
  // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND
41
38
  editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {
@@ -44,9 +41,34 @@ const RelationshipFeatureClient = (props)=>{
44
41
  }
45
42
  }
46
43
  ],
47
- key: 'basic'
44
+ key: 'basic',
45
+ label: 'Basic'
48
46
  }
49
47
  ]
48
+ },
49
+ toolbarFixed: {
50
+ groups: [
51
+ toolbarAddDropdownGroupWithItems([
52
+ {
53
+ ChildComponent: RelationshipIcon,
54
+ isActive: ({ selection })=>{
55
+ if (!$isNodeSelection(selection) || !selection.getNodes().length) {
56
+ return false;
57
+ }
58
+ const firstNode = selection.getNodes()[0];
59
+ return $isRelationshipNode(firstNode);
60
+ },
61
+ key: 'relationship',
62
+ label: 'Relationship',
63
+ onSelect: ({ editor })=>{
64
+ // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND
65
+ editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {
66
+ replace: false
67
+ });
68
+ }
69
+ }
70
+ ])
71
+ ]
50
72
  }
51
73
  })
52
74
  };
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/relationship/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { withMergedProps } from '@payloadcms/ui/elements/withMergedProps'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { RelationshipFeatureProps } from './feature.server.js'\n\nimport { RelationshipIcon } from '../../lexical/ui/icons/Relationship/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands.js'\nimport { RelationshipNode } from './nodes/RelationshipNode.js'\nimport { RelationshipPlugin } from './plugins/index.js'\n\nconst RelationshipFeatureClient: FeatureProviderProviderClient<RelationshipFeatureProps> = (\n props,\n) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n nodes: [RelationshipNode],\n plugins: [\n {\n Component: withMergedProps({\n Component: RelationshipPlugin,\n toMergeIntoProps: props,\n }),\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n {\n displayName: 'Basic',\n items: [\n {\n Icon: RelationshipIcon,\n displayName: 'Relationship',\n key: 'relationship',\n keywords: ['relationship', 'relation', 'rel'],\n onSelect: ({ editor }) => {\n // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: false,\n })\n },\n },\n ],\n key: 'basic',\n },\n ],\n },\n }),\n }\n}\n\nexport const RelationshipFeatureClientComponent = createClientComponent(RelationshipFeatureClient)\n"],"names":["withMergedProps","RelationshipIcon","createClientComponent","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","RelationshipNode","RelationshipPlugin","RelationshipFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","toMergeIntoProps","position","slashMenu","groups","displayName","items","Icon","key","keywords","onSelect","editor","dispatchCommand","replace","RelationshipFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,eAAe,QAAQ,0CAAyC;AAKzE,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,uCAAuC,QAAQ,uBAAsB;AAC9E,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,kBAAkB,QAAQ,qBAAoB;AAEvD,MAAMC,4BAAqF,CACzFC;IAEA,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,OAAO;oBAACN;iBAAiB;gBACzBO,SAAS;oBACP;wBACEC,WAAWZ,gBAAgB;4BACzBY,WAAWP;4BACXQ,kBAAkBN;wBACpB;wBACAO,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,QAAQ;wBACN;4BACEC,aAAa;4BACbC,OAAO;gCACL;oCACEC,MAAMlB;oCACNgB,aAAa;oCACbG,KAAK;oCACLC,UAAU;wCAAC;wCAAgB;wCAAY;qCAAM;oCAC7CC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnB,mDAAmD;wCACnDA,OAAOC,eAAe,CAACrB,yCAAyC;4CAC9DsB,SAAS;wCACX;oCACF;gCACF;6BACD;4BACDL,KAAK;wBACP;qBACD;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMM,qCAAqCxB,sBAAsBI,2BAA0B"}
1
+ {"version":3,"sources":["../../../../src/field/features/relationship/feature.client.tsx"],"sourcesContent":["'use client'\n\nimport { $isNodeSelection } from 'lexical'\n\nimport type { FeatureProviderProviderClient } from '../types.js'\nimport type { RelationshipFeatureProps } from './feature.server.js'\n\nimport { RelationshipIcon } from '../../lexical/ui/icons/Relationship/index.js'\nimport { createClientComponent } from '../createClientComponent.js'\nimport { toolbarAddDropdownGroupWithItems } from '../shared/toolbar/addDropdownGroup.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from './drawer/commands.js'\nimport { $isRelationshipNode, RelationshipNode } from './nodes/RelationshipNode.js'\nimport { RelationshipPlugin } from './plugins/index.js'\n\nconst RelationshipFeatureClient: FeatureProviderProviderClient<RelationshipFeatureProps> = (\n props,\n) => {\n return {\n clientFeatureProps: props,\n feature: () => ({\n clientFeatureProps: props,\n nodes: [RelationshipNode],\n plugins: [\n {\n Component: RelationshipPlugin,\n position: 'normal',\n },\n ],\n slashMenu: {\n groups: [\n {\n items: [\n {\n Icon: RelationshipIcon,\n key: 'relationship',\n keywords: ['relationship', 'relation', 'rel'],\n label: 'Relationship',\n onSelect: ({ editor }) => {\n // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: false,\n })\n },\n },\n ],\n key: 'basic',\n label: 'Basic',\n },\n ],\n },\n toolbarFixed: {\n groups: [\n toolbarAddDropdownGroupWithItems([\n {\n ChildComponent: RelationshipIcon,\n isActive: ({ selection }) => {\n if (!$isNodeSelection(selection) || !selection.getNodes().length) {\n return false\n }\n\n const firstNode = selection.getNodes()[0]\n return $isRelationshipNode(firstNode)\n },\n key: 'relationship',\n label: 'Relationship',\n onSelect: ({ editor }) => {\n // dispatch INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: false,\n })\n },\n },\n ]),\n ],\n },\n }),\n }\n}\n\nexport const RelationshipFeatureClientComponent = createClientComponent(RelationshipFeatureClient)\n"],"names":["$isNodeSelection","RelationshipIcon","createClientComponent","toolbarAddDropdownGroupWithItems","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","RelationshipNode","RelationshipPlugin","RelationshipFeatureClient","props","clientFeatureProps","feature","nodes","plugins","Component","position","slashMenu","groups","items","Icon","key","keywords","label","onSelect","editor","dispatchCommand","replace","toolbarFixed","ChildComponent","isActive","selection","getNodes","length","firstNode","RelationshipFeatureClientComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAEA,SAASA,gBAAgB,QAAQ,UAAS;AAK1C,SAASC,gBAAgB,QAAQ,+CAA8C;AAC/E,SAASC,qBAAqB,QAAQ,8BAA6B;AACnE,SAASC,gCAAgC,QAAQ,wCAAuC;AACxF,SAASC,uCAAuC,QAAQ,uBAAsB;AAC9E,SAASC,mBAAmB,EAAEC,gBAAgB,QAAQ,8BAA6B;AACnF,SAASC,kBAAkB,QAAQ,qBAAoB;AAEvD,MAAMC,4BAAqF,CACzFC;IAEA,OAAO;QACLC,oBAAoBD;QACpBE,SAAS,IAAO,CAAA;gBACdD,oBAAoBD;gBACpBG,OAAO;oBAACN;iBAAiB;gBACzBO,SAAS;oBACP;wBACEC,WAAWP;wBACXQ,UAAU;oBACZ;iBACD;gBACDC,WAAW;oBACTC,QAAQ;wBACN;4BACEC,OAAO;gCACL;oCACEC,MAAMlB;oCACNmB,KAAK;oCACLC,UAAU;wCAAC;wCAAgB;wCAAY;qCAAM;oCAC7CC,OAAO;oCACPC,UAAU,CAAC,EAAEC,MAAM,EAAE;wCACnB,mDAAmD;wCACnDA,OAAOC,eAAe,CAACrB,yCAAyC;4CAC9DsB,SAAS;wCACX;oCACF;gCACF;6BACD;4BACDN,KAAK;4BACLE,OAAO;wBACT;qBACD;gBACH;gBACAK,cAAc;oBACZV,QAAQ;wBACNd,iCAAiC;4BAC/B;gCACEyB,gBAAgB3B;gCAChB4B,UAAU,CAAC,EAAEC,SAAS,EAAE;oCACtB,IAAI,CAAC9B,iBAAiB8B,cAAc,CAACA,UAAUC,QAAQ,GAAGC,MAAM,EAAE;wCAChE,OAAO;oCACT;oCAEA,MAAMC,YAAYH,UAAUC,QAAQ,EAAE,CAAC,EAAE;oCACzC,OAAO1B,oBAAoB4B;gCAC7B;gCACAb,KAAK;gCACLE,OAAO;gCACPC,UAAU,CAAC,EAAEC,MAAM,EAAE;oCACnB,mDAAmD;oCACnDA,OAAOC,eAAe,CAACrB,yCAAyC;wCAC9DsB,SAAS;oCACX;gCACF;4BACF;yBACD;qBACF;gBACH;YACF,CAAA;IACF;AACF;AAEA,OAAO,MAAMQ,qCAAqChC,sBAAsBM,2BAA0B"}
@@ -1,5 +1,5 @@
1
1
  import type { FeatureProviderProviderServer } from '../types.js';
2
- export type RelationshipFeatureProps = {
2
+ export type ExclusiveRelationshipFeatureProps = {
3
3
  /**
4
4
  * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.
5
5
  * When this property is set, `enabledCollections` will not be available.
@@ -14,5 +14,14 @@ export type RelationshipFeatureProps = {
14
14
  **/
15
15
  enabledCollections?: string[];
16
16
  };
17
+ export type RelationshipFeatureProps = ExclusiveRelationshipFeatureProps & {
18
+ /**
19
+ * Sets a maximum population depth for this relationship, regardless of the remaining depth when the respective field is reached.
20
+ * This behaves exactly like the maxDepth properties of relationship and upload fields.
21
+ *
22
+ * {@link https://payloadcms.com/docs/getting-started/concepts#field-level-max-depth}
23
+ */
24
+ maxDepth?: number;
25
+ };
17
26
  export declare const RelationshipFeature: FeatureProviderProviderServer<RelationshipFeatureProps, RelationshipFeatureProps>;
18
27
  //# sourceMappingURL=feature.server.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAOhE,MAAM,MAAM,wBAAwB,GAChC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAG9B,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AAEL,eAAO,MAAM,mBAAmB,EAAE,6BAA6B,CAC7D,wBAAwB,EACxB,wBAAwB,CAoBzB,CAAA"}
1
+ {"version":3,"file":"feature.server.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/feature.server.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,aAAa,CAAA;AAOhE,MAAM,MAAM,iCAAiC,GACzC;IACE;;;QAGI;IACJ,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAA;IAG9B,kBAAkB,CAAC,EAAE,KAAK,CAAA;CAC3B,GACD;IAEE,mBAAmB,CAAC,EAAE,KAAK,CAAA;IAE3B;;;QAGI;IACJ,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AAEL,MAAM,MAAM,wBAAwB,GAAG,iCAAiC,GAAG;IACzE;;;;;OAKG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,mBAAmB,EAAE,6BAA6B,CAC7D,wBAAwB,EACxB,wBAAwB,CAmBzB,CAAA"}
@@ -1,7 +1,7 @@
1
1
  import { createNode } from '../typeUtilities.js';
2
2
  import { RelationshipFeatureClientComponent } from './feature.client.js';
3
3
  import { RelationshipNode } from './nodes/RelationshipNode.js';
4
- import { relationshipPopulationPromise } from './populationPromise.js';
4
+ import { relationshipPopulationPromiseHOC } from './populationPromise.js';
5
5
  export const RelationshipFeature = (props)=>{
6
6
  return {
7
7
  feature: ()=>{
@@ -12,7 +12,7 @@ export const RelationshipFeature = (props)=>{
12
12
  createNode({
13
13
  node: RelationshipNode,
14
14
  populationPromises: [
15
- relationshipPopulationPromise
15
+ relationshipPopulationPromiseHOC(props)
16
16
  ]
17
17
  })
18
18
  ],
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/relationship/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { RelationshipFeatureClientComponent } from './feature.client.js'\nimport { RelationshipNode } from './nodes/RelationshipNode.js'\nimport { relationshipPopulationPromise } from './populationPromise.js'\n\nexport type RelationshipFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: string[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: string[]\n }\n\nexport const RelationshipFeature: FeatureProviderProviderServer<\n RelationshipFeatureProps,\n RelationshipFeatureProps\n> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: RelationshipFeatureClientComponent,\n clientFeatureProps: props,\n nodes: [\n createNode({\n node: RelationshipNode,\n populationPromises: [relationshipPopulationPromise],\n // TODO: Add validation similar to upload\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'relationship',\n serverFeatureProps: props,\n }\n}\n"],"names":["createNode","RelationshipFeatureClientComponent","RelationshipNode","relationshipPopulationPromise","RelationshipFeature","props","feature","ClientComponent","clientFeatureProps","nodes","node","populationPromises","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,UAAU,QAAQ,sBAAqB;AAChD,SAASC,kCAAkC,QAAQ,sBAAqB;AACxE,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,6BAA6B,QAAQ,yBAAwB;AAwBtE,OAAO,MAAMC,sBAGT,CAACC;IACH,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,oBAAoBH;gBACpBI,OAAO;oBACLT,WAAW;wBACTU,MAAMR;wBACNS,oBAAoB;4BAACR;yBAA8B;oBAErD;iBACD;gBACDS,oBAAoBP;YACtB;QACF;QACAQ,KAAK;QACLD,oBAAoBP;IACtB;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/relationship/feature.server.ts"],"sourcesContent":["import type { FeatureProviderProviderServer } from '../types.js'\n\nimport { createNode } from '../typeUtilities.js'\nimport { RelationshipFeatureClientComponent } from './feature.client.js'\nimport { RelationshipNode } from './nodes/RelationshipNode.js'\nimport { relationshipPopulationPromiseHOC } from './populationPromise.js'\n\nexport type ExclusiveRelationshipFeatureProps =\n | {\n /**\n * The collections that should be disabled. Overrides the `enableRichTextRelationship` property in the collection config.\n * When this property is set, `enabledCollections` will not be available.\n **/\n disabledCollections?: string[]\n\n // Ensures that enabledCollections is not available when disabledCollections is set\n enabledCollections?: never\n }\n | {\n // Ensures that disabledCollections is not available when enabledCollections is set\n disabledCollections?: never\n\n /**\n * The collections that should be enabled. Overrides the `enableRichTextRelationship` property in the collection config\n * When this property is set, `disabledCollections` will not be available.\n **/\n enabledCollections?: string[]\n }\n\nexport type RelationshipFeatureProps = ExclusiveRelationshipFeatureProps & {\n /**\n * Sets a maximum population depth for this relationship, 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\nexport const RelationshipFeature: FeatureProviderProviderServer<\n RelationshipFeatureProps,\n RelationshipFeatureProps\n> = (props) => {\n return {\n feature: () => {\n return {\n ClientComponent: RelationshipFeatureClientComponent,\n clientFeatureProps: props,\n nodes: [\n createNode({\n node: RelationshipNode,\n populationPromises: [relationshipPopulationPromiseHOC(props)],\n }),\n ],\n serverFeatureProps: props,\n }\n },\n key: 'relationship',\n serverFeatureProps: props,\n }\n}\n"],"names":["createNode","RelationshipFeatureClientComponent","RelationshipNode","relationshipPopulationPromiseHOC","RelationshipFeature","props","feature","ClientComponent","clientFeatureProps","nodes","node","populationPromises","serverFeatureProps","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAEA,SAASA,UAAU,QAAQ,sBAAqB;AAChD,SAASC,kCAAkC,QAAQ,sBAAqB;AACxE,SAASC,gBAAgB,QAAQ,8BAA6B;AAC9D,SAASC,gCAAgC,QAAQ,yBAAwB;AAkCzE,OAAO,MAAMC,sBAGT,CAACC;IACH,OAAO;QACLC,SAAS;YACP,OAAO;gBACLC,iBAAiBN;gBACjBO,oBAAoBH;gBACpBI,OAAO;oBACLT,WAAW;wBACTU,MAAMR;wBACNS,oBAAoB;4BAACR,iCAAiCE;yBAAO;oBAC/D;iBACD;gBACDO,oBAAoBP;YACtB;QACF;QACAQ,KAAK;QACLD,oBAAoBP;IACtB;AACF,EAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"RelationshipComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAoBhD,OAAO,KAA+D,MAAM,OAAO,CAAA;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAK9D,OAAO,cAAc,CAAA;AAQrB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AA4JD,eAAO,MAAM,qBAAqB,UAAW,KAAK,KAAG,MAAM,SAE1D,CAAA"}
1
+ {"version":3,"file":"RelationshipComponent.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAoBhD,OAAO,KAA+D,MAAM,OAAO,CAAA;AAEnF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAK9D,OAAO,cAAc,CAAA;AAQrB,KAAK,KAAK,GAAG;IACX,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,IAAI,EAAE,gBAAgB,CAAA;IACtB,MAAM,CAAC,EAAE,iBAAiB,CAAA;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AA8JD,eAAO,MAAM,qBAAqB,UAAW,KAAK,KAAG,MAAM,SAE1D,CAAA"}
@@ -78,8 +78,10 @@ const Component = (props)=>{
78
78
  if (event.shiftKey) {
79
79
  setSelected(!isSelected);
80
80
  } else {
81
- clearSelection();
82
- setSelected(true);
81
+ if (!isSelected) {
82
+ clearSelection();
83
+ setSelected(true);
84
+ }
83
85
  }
84
86
  return true;
85
87
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"sourcesContent":["'use client'\nimport type { ElementFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button } from '@payloadcms/ui/elements/Button'\nimport { useDocumentDrawer } from '@payloadcms/ui/elements/DocumentDrawer'\nimport usePayloadAPI from '@payloadcms/ui/hooks/usePayloadAPI'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport {\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'\n\nimport type { RelationshipData } from '../RelationshipNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../../drawer/commands.js'\nimport { $isRelationshipNode } from '../RelationshipNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-relationship'\n\nconst initialParams = {\n depth: 0,\n}\n\ntype Props = {\n children?: React.ReactNode\n className?: string\n data: RelationshipData\n format?: ElementFormatType\n nodeKey?: string\n}\n\nconst Component: React.FC<Props> = (props) => {\n const {\n children,\n data: { relationTo, value: id },\n nodeKey,\n } = props\n\n const relationshipElemRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n const { field } = useEditorConfigContext()\n const {\n collections,\n routes: { api },\n serverURL,\n } = useConfig()\n\n const [relatedCollection, setRelatedCollection] = useState(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${id}`,\n { initialParams },\n )\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id,\n collectionSlug: relatedCollection.slug,\n })\n\n const removeRelationship = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateRelationship = React.useCallback(\n ({ doc }) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n closeDrawer()\n dispatchCacheBust()\n },\n [cacheBust, setParams, closeDrawer],\n )\n\n const onDelete = useCallback(\n (payload: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n const event: KeyboardEvent = payload\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isRelationshipNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if relationshipElemRef.target or anything WITHIN relationshipElemRef.target was clicked\n if (\n event.target === relationshipElemRef.current ||\n relationshipElemRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n clearSelection()\n setSelected(true)\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected, onClick])\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={relationshipElemRef}\n >\n <div className={`${baseClass}__wrap`}>\n <p className={`${baseClass}__label`}>\n {t('fields:labelRelationship', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n </p>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <p className={`${baseClass}__title`}>\n {data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : id}\n </p>\n </DocumentDrawerToggler>\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swapButton`}\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapRelationship')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeRelationship()\n }}\n round\n tooltip={t('fields:removeRelationship')}\n />\n </div>\n )}\n\n {id && <DocumentDrawer onSave={updateRelationship} />}\n {children}\n </div>\n )\n}\n\nexport const RelationshipComponent = (props: Props): React.ReactNode => {\n return <Component {...props} />\n}\n"],"names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","useDocumentDrawer","usePayloadAPI","useConfig","useTranslation","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","$getNodeByKey","React","useCallback","useEffect","useReducer","useRef","useState","useEditorConfigContext","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","baseClass","initialParams","depth","Component","props","children","data","relationTo","value","id","nodeKey","relationshipElemRef","editor","isSelected","setSelected","clearSelection","field","collections","routes","api","serverURL","relatedCollection","setRelatedCollection","find","coll","slug","i18n","t","cacheBust","dispatchCacheBust","state","setParams","DocumentDrawer","DocumentDrawerToggler","closeDrawer","collectionSlug","removeRelationship","update","remove","updateRelationship","doc","onDelete","payload","event","preventDefault","node","onClick","target","current","contains","shiftKey","registerCommand","div","className","filter","Boolean","join","contentEditable","ref","p","label","labels","singular","admin","useAsTitle","isEditable","buttonStyle","disabled","readOnly","el","icon","dispatchCommand","replace","round","tooltip","e","onSave","RelationshipComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,uBAAuB,QAAQ,4CAA2C;AACnF,SAASC,aAAa,QAAQ,iBAAgB;AAC9C,SAASC,cAAc,QAAQ,2BAA0B;AACzD,SAASC,MAAM,QAAQ,iCAAgC;AACvD,SAASC,iBAAiB,QAAQ,yCAAwC;AAC1E,OAAOC,mBAAmB,qCAAoC;AAC9D,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SAASC,cAAc,QAAQ,uCAAsC;AACrE,SACEC,aAAa,EACbC,gBAAgB,EAChBC,aAAa,EACbC,oBAAoB,EACpBC,qBAAqB,EACrBC,kBAAkB,QACb,UAAS;AAChB,SAASC,aAAa,QAAQ,UAAS;AACvC,OAAOC,SAASC,WAAW,EAAEC,SAAS,EAAEC,UAAU,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,QAAO;AAInF,SAASC,sBAAsB,QAAQ,4DAA2D;AAClG,SAASC,uCAAuC,QAAQ,2BAA0B;AAClF,SAASC,mBAAmB,QAAQ,yBAAwB;AAC5D,OAAO,eAAc;AAErB,MAAMC,YAAY;AAElB,MAAMC,gBAAgB;IACpBC,OAAO;AACT;AAUA,MAAMC,YAA6B,CAACC;IAClC,MAAM,EACJC,QAAQ,EACRC,MAAM,EAAEC,UAAU,EAAEC,OAAOC,EAAE,EAAE,EAC/BC,OAAO,EACR,GAAGN;IAEJ,MAAMO,sBAAsBhB,OAA8B;IAE1D,MAAM,CAACiB,OAAO,GAAGrC;IACjB,MAAM,CAACsC,YAAYC,aAAaC,eAAe,GAAGvC,wBAAwBkC;IAC1E,MAAM,EAAEM,KAAK,EAAE,GAAGnB;IAClB,MAAM,EACJoB,WAAW,EACXC,QAAQ,EAAEC,GAAG,EAAE,EACfC,SAAS,EACV,GAAGtC;IAEJ,MAAM,CAACuC,mBAAmBC,qBAAqB,GAAG1B,SAAS,IACzDqB,YAAYM,IAAI,CAAC,CAACC,OAASA,KAAKC,IAAI,KAAKlB;IAG3C,MAAM,EAAEmB,IAAI,EAAEC,CAAC,EAAE,GAAG5C;IACpB,MAAM,CAAC6C,WAAWC,kBAAkB,GAAGnC,WAAW,CAACoC,QAAUA,QAAQ,GAAG;IACxE,MAAM,CAAC,EAAExB,IAAI,EAAE,EAAE,EAAEyB,SAAS,EAAE,CAAC,GAAGlD,cAChC,CAAC,EAAEuC,UAAU,EAAED,IAAI,CAAC,EAAEE,kBAAkBI,IAAI,CAAC,CAAC,EAAEhB,GAAG,CAAC,EACpD;QAAER;IAAc;IAGlB,MAAM,CAAC+B,gBAAgBC,uBAAuB,EAAEC,WAAW,EAAE,CAAC,GAAGtD,kBAAkB;QACjF6B;QACA0B,gBAAgBd,kBAAkBI,IAAI;IACxC;IAEA,MAAMW,qBAAqB5C,YAAY;QACrCoB,OAAOyB,MAAM,CAAC;YACZ/C,cAAcoB,SAAS4B,MAAM;QAC/B;IACF,GAAG;QAAC1B;QAAQF;KAAQ;IAEpB,MAAM6B,qBAAqBhD,MAAMC,WAAW,CAC1C,CAAC,EAAEgD,GAAG,EAAE;QACNT,UAAU;YACR,GAAG9B,aAAa;YAChB2B;QACF;QAEAM;QACAL;IACF,GACA;QAACD;QAAWG;QAAWG;KAAY;IAGrC,MAAMO,WAAWjD,YACf,CAACkD;QACC,IAAI7B,cAAc5B,iBAAiBD,kBAAkB;YACnD,MAAM2D,QAAuBD;YAC7BC,MAAMC,cAAc;YACpB,MAAMC,OAAOvD,cAAcoB;YAC3B,IAAIX,oBAAoB8C,OAAO;gBAC7BA,KAAKP,MAAM;gBACX,OAAO;YACT;QACF;QACA,OAAO;IACT,GACA;QAACzB;QAAYH;KAAQ;IAEvB,MAAMoC,UAAUtD,YACd,CAACkD;QACC,MAAMC,QAAQD;QACd,gGAAgG;QAChG,IACEC,MAAMI,MAAM,KAAKpC,oBAAoBqC,OAAO,IAC5CrC,oBAAoBqC,OAAO,EAAEC,SAASN,MAAMI,MAAM,GAClD;YACA,IAAIJ,MAAMO,QAAQ,EAAE;gBAClBpC,YAAY,CAACD;YACf,OAAO;gBACLE;gBACAD,YAAY;YACd;YACA,OAAO;QACT;QAEA,OAAO;IACT,GACA;QAACD;QAAYC;QAAaC;KAAe;IAG3CtB,UAAU;QACR,OAAOhB,cACLmC,OAAOuC,eAAe,CAAajE,eAAe4D,SAAS3D,uBAE3DyB,OAAOuC,eAAe,CAAC9D,oBAAoBoD,UAAUtD,uBACrDyB,OAAOuC,eAAe,CAAC/D,uBAAuBqD,UAAUtD;IAE5D,GAAG;QAAC4B;QAAgBH;QAAQC;QAAYH;QAAS+B;QAAU3B;QAAagC;KAAQ;IAEhF,qBACE,oBAACM;QACCC,WAAW;YAACrD;YAAWa,cAAc,CAAC,EAAEb,UAAU,UAAU,CAAC;SAAC,CAACsD,MAAM,CAACC,SAASC,IAAI,CAAC;QACpFC,iBAAiB;QACjBC,KAAK/C;qBAEL,oBAACyC;QAAIC,WAAW,CAAC,EAAErD,UAAU,MAAM,CAAC;qBAClC,oBAAC2D;QAAEN,WAAW,CAAC,EAAErD,UAAU,OAAO,CAAC;OAChC2B,EAAE,4BAA4B;QAC7BiC,OAAOlF,eAAe2C,kBAAkBwC,MAAM,CAACC,QAAQ,EAAEpC;IAC3D,mBAEF,oBAACO;QAAsBoB,WAAW,CAAC,EAAErD,UAAU,oBAAoB,CAAC;qBAClE,oBAAC2D;QAAEN,WAAW,CAAC,EAAErD,UAAU,OAAO,CAAC;OAChCM,OAAOA,IAAI,CAACe,mBAAmB0C,OAAOC,cAAc,KAAK,GAAGvD,OAIlEG,OAAOqD,UAAU,oBAChB,oBAACb;QAAIC,WAAW,CAAC,EAAErD,UAAU,SAAS,CAAC;qBACrC,oBAACrB;QACCuF,aAAY;QACZb,WAAW,CAAC,EAAErD,UAAU,YAAY,CAAC;QACrCmE,UAAUnD,OAAOoD;QACjBC,IAAG;QACHC,MAAK;QACLxB,SAAS;YACPlC,OAAO2D,eAAe,CAACzE,yCAAyC;gBAC9D0E,SAAS;oBAAE9D;gBAAQ;YACrB;QACF;QACA+D,OAAAA;QACAC,SAAS/C,EAAE;sBAEb,oBAAChD;QACCuF,aAAY;QACZb,WAAW,CAAC,EAAErD,UAAU,cAAc,CAAC;QACvCmE,UAAUnD,OAAOoD;QACjBE,MAAK;QACLxB,SAAS,CAAC6B;YACRA,EAAE/B,cAAc;YAChBR;QACF;QACAqC,OAAAA;QACAC,SAAS/C,EAAE;SAKhBlB,oBAAM,oBAACuB;QAAe4C,QAAQrC;QAC9BlC;AAGP;AAEA,OAAO,MAAMwE,wBAAwB,CAACzE;IACpC,qBAAO,oBAACD,WAAcC;AACxB,EAAC"}
1
+ {"version":3,"sources":["../../../../../../src/field/features/relationship/nodes/components/RelationshipComponent.tsx"],"sourcesContent":["'use client'\nimport type { ElementFormatType } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { useLexicalNodeSelection } from '@lexical/react/useLexicalNodeSelection.js'\nimport { mergeRegister } from '@lexical/utils'\nimport { getTranslation } from '@payloadcms/translations'\nimport { Button } from '@payloadcms/ui/elements/Button'\nimport { useDocumentDrawer } from '@payloadcms/ui/elements/DocumentDrawer'\nimport usePayloadAPI from '@payloadcms/ui/hooks/usePayloadAPI'\nimport { useConfig } from '@payloadcms/ui/providers/Config'\nimport { useTranslation } from '@payloadcms/ui/providers/Translation'\nimport {\n $getSelection,\n $isNodeSelection,\n CLICK_COMMAND,\n COMMAND_PRIORITY_LOW,\n KEY_BACKSPACE_COMMAND,\n KEY_DELETE_COMMAND,\n} from 'lexical'\nimport { $getNodeByKey } from 'lexical'\nimport React, { useCallback, useEffect, useReducer, useRef, useState } from 'react'\n\nimport type { RelationshipData } from '../RelationshipNode.js'\n\nimport { useEditorConfigContext } from '../../../../lexical/config/client/EditorConfigProvider.js'\nimport { INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND } from '../../drawer/commands.js'\nimport { $isRelationshipNode } from '../RelationshipNode.js'\nimport './index.scss'\n\nconst baseClass = 'lexical-relationship'\n\nconst initialParams = {\n depth: 0,\n}\n\ntype Props = {\n children?: React.ReactNode\n className?: string\n data: RelationshipData\n format?: ElementFormatType\n nodeKey?: string\n}\n\nconst Component: React.FC<Props> = (props) => {\n const {\n children,\n data: { relationTo, value: id },\n nodeKey,\n } = props\n\n const relationshipElemRef = useRef<HTMLDivElement | null>(null)\n\n const [editor] = useLexicalComposerContext()\n const [isSelected, setSelected, clearSelection] = useLexicalNodeSelection(nodeKey)\n const { field } = useEditorConfigContext()\n const {\n collections,\n routes: { api },\n serverURL,\n } = useConfig()\n\n const [relatedCollection, setRelatedCollection] = useState(() =>\n collections.find((coll) => coll.slug === relationTo),\n )\n\n const { i18n, t } = useTranslation()\n const [cacheBust, dispatchCacheBust] = useReducer((state) => state + 1, 0)\n const [{ data }, { setParams }] = usePayloadAPI(\n `${serverURL}${api}/${relatedCollection.slug}/${id}`,\n { initialParams },\n )\n\n const [DocumentDrawer, DocumentDrawerToggler, { closeDrawer }] = useDocumentDrawer({\n id,\n collectionSlug: relatedCollection.slug,\n })\n\n const removeRelationship = useCallback(() => {\n editor.update(() => {\n $getNodeByKey(nodeKey).remove()\n })\n }, [editor, nodeKey])\n\n const updateRelationship = React.useCallback(\n ({ doc }) => {\n setParams({\n ...initialParams,\n cacheBust, // do this to get the usePayloadAPI to re-fetch the data even though the URL string hasn't changed\n })\n\n closeDrawer()\n dispatchCacheBust()\n },\n [cacheBust, setParams, closeDrawer],\n )\n\n const onDelete = useCallback(\n (payload: KeyboardEvent) => {\n if (isSelected && $isNodeSelection($getSelection())) {\n const event: KeyboardEvent = payload\n event.preventDefault()\n const node = $getNodeByKey(nodeKey)\n if ($isRelationshipNode(node)) {\n node.remove()\n return true\n }\n }\n return false\n },\n [isSelected, nodeKey],\n )\n const onClick = useCallback(\n (payload: MouseEvent) => {\n const event = payload\n // Check if relationshipElemRef.target or anything WITHIN relationshipElemRef.target was clicked\n if (\n event.target === relationshipElemRef.current ||\n relationshipElemRef.current?.contains(event.target as Node)\n ) {\n if (event.shiftKey) {\n setSelected(!isSelected)\n } else {\n if (!isSelected) {\n clearSelection()\n setSelected(true)\n }\n }\n return true\n }\n\n return false\n },\n [isSelected, setSelected, clearSelection],\n )\n\n useEffect(() => {\n return mergeRegister(\n editor.registerCommand<MouseEvent>(CLICK_COMMAND, onClick, COMMAND_PRIORITY_LOW),\n\n editor.registerCommand(KEY_DELETE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n editor.registerCommand(KEY_BACKSPACE_COMMAND, onDelete, COMMAND_PRIORITY_LOW),\n )\n }, [clearSelection, editor, isSelected, nodeKey, onDelete, setSelected, onClick])\n\n return (\n <div\n className={[baseClass, isSelected && `${baseClass}--selected`].filter(Boolean).join(' ')}\n contentEditable={false}\n ref={relationshipElemRef}\n >\n <div className={`${baseClass}__wrap`}>\n <p className={`${baseClass}__label`}>\n {t('fields:labelRelationship', {\n label: getTranslation(relatedCollection.labels.singular, i18n),\n })}\n </p>\n <DocumentDrawerToggler className={`${baseClass}__doc-drawer-toggler`}>\n <p className={`${baseClass}__title`}>\n {data ? data[relatedCollection?.admin?.useAsTitle || 'id'] : id}\n </p>\n </DocumentDrawerToggler>\n </div>\n {editor.isEditable() && (\n <div className={`${baseClass}__actions`}>\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__swapButton`}\n disabled={field?.readOnly}\n el=\"div\"\n icon=\"swap\"\n onClick={() => {\n editor.dispatchCommand(INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND, {\n replace: { nodeKey },\n })\n }}\n round\n tooltip={t('fields:swapRelationship')}\n />\n <Button\n buttonStyle=\"icon-label\"\n className={`${baseClass}__removeButton`}\n disabled={field?.readOnly}\n icon=\"x\"\n onClick={(e) => {\n e.preventDefault()\n removeRelationship()\n }}\n round\n tooltip={t('fields:removeRelationship')}\n />\n </div>\n )}\n\n {id && <DocumentDrawer onSave={updateRelationship} />}\n {children}\n </div>\n )\n}\n\nexport const RelationshipComponent = (props: Props): React.ReactNode => {\n return <Component {...props} />\n}\n"],"names":["useLexicalComposerContext","useLexicalNodeSelection","mergeRegister","getTranslation","Button","useDocumentDrawer","usePayloadAPI","useConfig","useTranslation","$getSelection","$isNodeSelection","CLICK_COMMAND","COMMAND_PRIORITY_LOW","KEY_BACKSPACE_COMMAND","KEY_DELETE_COMMAND","$getNodeByKey","React","useCallback","useEffect","useReducer","useRef","useState","useEditorConfigContext","INSERT_RELATIONSHIP_WITH_DRAWER_COMMAND","$isRelationshipNode","baseClass","initialParams","depth","Component","props","children","data","relationTo","value","id","nodeKey","relationshipElemRef","editor","isSelected","setSelected","clearSelection","field","collections","routes","api","serverURL","relatedCollection","setRelatedCollection","find","coll","slug","i18n","t","cacheBust","dispatchCacheBust","state","setParams","DocumentDrawer","DocumentDrawerToggler","closeDrawer","collectionSlug","removeRelationship","update","remove","updateRelationship","doc","onDelete","payload","event","preventDefault","node","onClick","target","current","contains","shiftKey","registerCommand","div","className","filter","Boolean","join","contentEditable","ref","p","label","labels","singular","admin","useAsTitle","isEditable","buttonStyle","disabled","readOnly","el","icon","dispatchCommand","replace","round","tooltip","e","onSave","RelationshipComponent"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"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"}
@@ -1,7 +1,7 @@
1
1
  import type { LexicalCommand } from 'lexical';
2
- import React from 'react';
2
+ import type { PluginComponent } from '../../types.js';
3
3
  import type { RelationshipFeatureProps } from '../feature.server.js';
4
4
  import type { RelationshipData } from '../nodes/RelationshipNode.js';
5
5
  export declare const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData>;
6
- export declare function RelationshipPlugin(props?: RelationshipFeatureProps): React.ReactNode;
6
+ export declare const RelationshipPlugin: PluginComponent<RelationshipFeatureProps>;
7
7
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/relationship/plugins/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAc7C,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAKpE,eAAO,MAAM,2BAA2B,EAAE,cAAc,CAAC,gBAAgB,CAExE,CAAA;AAED,wBAAgB,kBAAkB,CAAC,KAAK,CAAC,EAAE,wBAAwB,GAAG,KAAK,CAAC,SAAS,CAqDpF"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/relationship/plugins/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAgB7C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AACrD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,sBAAsB,CAAA;AACpE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAA;AAKpE,eAAO,MAAM,2BAA2B,EAAE,cAAc,CAAC,gBAAgB,CAExE,CAAA;AAED,eAAO,MAAM,kBAAkB,EAAE,eAAe,CAAC,wBAAwB,CAqDxE,CAAA"}
@@ -8,14 +8,14 @@ import React from 'react';
8
8
  import { RelationshipDrawer } from '../drawer/index.js';
9
9
  import { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js';
10
10
  export const INSERT_RELATIONSHIP_COMMAND = createCommand('INSERT_RELATIONSHIP_COMMAND');
11
- export function RelationshipPlugin(props) {
11
+ export const RelationshipPlugin = ({ clientProps })=>{
12
12
  const [editor] = useLexicalComposerContext();
13
13
  const { collections } = useConfig();
14
14
  let enabledRelations = null;
15
- if (props?.enabledCollections) {
16
- enabledRelations = props?.enabledCollections;
17
- } else if (props?.disabledCollections) {
18
- enabledRelations = collections.filter(({ slug })=>!props?.disabledCollections?.includes(slug)).map(({ slug })=>slug);
15
+ if (clientProps?.enabledCollections) {
16
+ enabledRelations = clientProps?.enabledCollections;
17
+ } else if (clientProps?.disabledCollections) {
18
+ enabledRelations = collections.filter(({ slug })=>!clientProps?.disabledCollections?.includes(slug)).map(({ slug })=>slug);
19
19
  }
20
20
  useEffect(()=>{
21
21
  if (!editor.hasNodes([
@@ -44,6 +44,6 @@ export function RelationshipPlugin(props) {
44
44
  return /*#__PURE__*/ React.createElement(RelationshipDrawer, {
45
45
  enabledCollectionSlugs: enabledRelations
46
46
  });
47
- }
47
+ };
48
48
 
49
49
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../../src/field/features/relationship/plugins/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } 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 { useEffect } from 'react'\nimport React from 'react'\n\nimport type { RelationshipFeatureProps } from '../feature.server.js'\nimport type { RelationshipData } from '../nodes/RelationshipNode.js'\n\nimport { RelationshipDrawer } from '../drawer/index.js'\nimport { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js'\n\nexport const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = createCommand(\n 'INSERT_RELATIONSHIP_COMMAND',\n)\n\nexport function RelationshipPlugin(props?: RelationshipFeatureProps): React.ReactNode {\n const [editor] = useLexicalComposerContext()\n const { collections } = useConfig()\n\n let enabledRelations: string[] = null\n\n if (props?.enabledCollections) {\n enabledRelations = props?.enabledCollections\n } else if (props?.disabledCollections) {\n enabledRelations = collections\n .filter(({ slug }) => !props?.disabledCollections?.includes(slug))\n .map(({ slug }) => slug)\n }\n\n useEffect(() => {\n if (!editor.hasNodes([RelationshipNode])) {\n throw new Error('RelationshipPlugin: RelationshipNode not registered on editor')\n }\n\n return editor.registerCommand<RelationshipData>(\n INSERT_RELATIONSHIP_COMMAND,\n (payload) => {\n const relationshipNode = $createRelationshipNode(payload)\n\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\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 $insertNodeToNearestRoot(relationshipNode)\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return <RelationshipDrawer enabledCollectionSlugs={enabledRelations} />\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","React","RelationshipDrawer","$createRelationshipNode","RelationshipNode","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","props","editor","collections","enabledRelations","enabledCollections","disabledCollections","filter","slug","includes","map","hasNodes","Error","registerCommand","payload","relationshipNode","selection","focus","focusNode","getNode","getTextContentSize","getParent","getChildren","node","length","remove","enabledCollectionSlugs"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,QAAQ,iBAAgB;AACzD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR,UAAS;AAChB,SAASC,SAAS,QAAQ,QAAO;AACjC,OAAOC,WAAW,QAAO;AAKzB,SAASC,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ,+BAA8B;AAExF,OAAO,MAAMC,8BAAgEN,cAC3E,+BACD;AAED,OAAO,SAASO,mBAAmBC,KAAgC;IACjE,MAAM,CAACC,OAAO,GAAGjB;IACjB,MAAM,EAAEkB,WAAW,EAAE,GAAGhB;IAExB,IAAIiB,mBAA6B;IAEjC,IAAIH,OAAOI,oBAAoB;QAC7BD,mBAAmBH,OAAOI;IAC5B,OAAO,IAAIJ,OAAOK,qBAAqB;QACrCF,mBAAmBD,YAChBI,MAAM,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAK,CAACP,OAAOK,qBAAqBG,SAASD,OAC3DE,GAAG,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAKA;IACvB;IAEAd,UAAU;QACR,IAAI,CAACQ,OAAOS,QAAQ,CAAC;YAACb;SAAiB,GAAG;YACxC,MAAM,IAAIc,MAAM;QAClB;QAEA,OAAOV,OAAOW,eAAe,CAC3Bd,6BACA,CAACe;YACC,MAAMC,mBAAmBlB,wBAAwBiB;YAEjD,MAAME,YAAY3B,mBAAmBD;YAErC,IAAIG,kBAAkByB,YAAY;gBAChC,MAAM,EAAEC,KAAK,EAAE,GAAGD;gBAClB,MAAME,YAAYD,MAAME,OAAO;gBAE/B,+FAA+F;gBAC/F,0FAA0F;gBAC1F,IACE7B,iBAAiB4B,cACjBA,UAAUE,kBAAkB,OAAO,KACnCF,UACGG,SAAS,GACTC,WAAW,GACXf,MAAM,CAAC,CAACgB,OAASjC,iBAAiBiC,OAAOC,MAAM,GAAG,GACrD;oBACAN,UAAUO,MAAM;gBAClB;gBAEAvC,yBAAyB6B;YAC3B;YAEA,OAAO;QACT,GACAvB;IAEJ,GAAG;QAACU;KAAO;IAEX,qBAAO,oBAACN;QAAmB8B,wBAAwBtB;;AACrD"}
1
+ {"version":3,"sources":["../../../../../src/field/features/relationship/plugins/index.tsx"],"sourcesContent":["'use client'\nimport type { LexicalCommand } from 'lexical'\n\nimport { useLexicalComposerContext } from '@lexical/react/LexicalComposerContext.js'\nimport { $insertNodeToNearestRoot } 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 { useEffect } from 'react'\nimport React from 'react'\n\nimport type { PluginComponent } from '../../types.js'\nimport type { RelationshipFeatureProps } from '../feature.server.js'\nimport type { RelationshipData } from '../nodes/RelationshipNode.js'\n\nimport { RelationshipDrawer } from '../drawer/index.js'\nimport { $createRelationshipNode, RelationshipNode } from '../nodes/RelationshipNode.js'\n\nexport const INSERT_RELATIONSHIP_COMMAND: LexicalCommand<RelationshipData> = createCommand(\n 'INSERT_RELATIONSHIP_COMMAND',\n)\n\nexport const RelationshipPlugin: PluginComponent<RelationshipFeatureProps> = ({ clientProps }) => {\n const [editor] = useLexicalComposerContext()\n const { collections } = useConfig()\n\n let enabledRelations: string[] = null\n\n if (clientProps?.enabledCollections) {\n enabledRelations = clientProps?.enabledCollections\n } else if (clientProps?.disabledCollections) {\n enabledRelations = collections\n .filter(({ slug }) => !clientProps?.disabledCollections?.includes(slug))\n .map(({ slug }) => slug)\n }\n\n useEffect(() => {\n if (!editor.hasNodes([RelationshipNode])) {\n throw new Error('RelationshipPlugin: RelationshipNode not registered on editor')\n }\n\n return editor.registerCommand<RelationshipData>(\n INSERT_RELATIONSHIP_COMMAND,\n (payload) => {\n const relationshipNode = $createRelationshipNode(payload)\n\n const selection = $getSelection() || $getPreviousSelection()\n\n if ($isRangeSelection(selection)) {\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 $insertNodeToNearestRoot(relationshipNode)\n }\n\n return true\n },\n COMMAND_PRIORITY_EDITOR,\n )\n }, [editor])\n\n return <RelationshipDrawer enabledCollectionSlugs={enabledRelations} />\n}\n"],"names":["useLexicalComposerContext","$insertNodeToNearestRoot","useConfig","$getPreviousSelection","$getSelection","$isParagraphNode","$isRangeSelection","COMMAND_PRIORITY_EDITOR","createCommand","useEffect","React","RelationshipDrawer","$createRelationshipNode","RelationshipNode","INSERT_RELATIONSHIP_COMMAND","RelationshipPlugin","clientProps","editor","collections","enabledRelations","enabledCollections","disabledCollections","filter","slug","includes","map","hasNodes","Error","registerCommand","payload","relationshipNode","selection","focus","focusNode","getNode","getTextContentSize","getParent","getChildren","node","length","remove","enabledCollectionSlugs"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAAA;AAGA,SAASA,yBAAyB,QAAQ,2CAA0C;AACpF,SAASC,wBAAwB,QAAQ,iBAAgB;AACzD,SAASC,SAAS,QAAQ,kCAAiC;AAC3D,SACEC,qBAAqB,EACrBC,aAAa,EACbC,gBAAgB,EAChBC,iBAAiB,EACjBC,uBAAuB,EACvBC,aAAa,QACR,UAAS;AAChB,SAASC,SAAS,QAAQ,QAAO;AACjC,OAAOC,WAAW,QAAO;AAMzB,SAASC,kBAAkB,QAAQ,qBAAoB;AACvD,SAASC,uBAAuB,EAAEC,gBAAgB,QAAQ,+BAA8B;AAExF,OAAO,MAAMC,8BAAgEN,cAC3E,+BACD;AAED,OAAO,MAAMO,qBAAgE,CAAC,EAAEC,WAAW,EAAE;IAC3F,MAAM,CAACC,OAAO,GAAGjB;IACjB,MAAM,EAAEkB,WAAW,EAAE,GAAGhB;IAExB,IAAIiB,mBAA6B;IAEjC,IAAIH,aAAaI,oBAAoB;QACnCD,mBAAmBH,aAAaI;IAClC,OAAO,IAAIJ,aAAaK,qBAAqB;QAC3CF,mBAAmBD,YAChBI,MAAM,CAAC,CAAC,EAAEC,IAAI,EAAE,GAAK,CAACP,aAAaK,qBAAqBG,SAASD,OACjEE,GAAG,CAAC,CAAC,EAAEF,IAAI,EAAE,GAAKA;IACvB;IAEAd,UAAU;QACR,IAAI,CAACQ,OAAOS,QAAQ,CAAC;YAACb;SAAiB,GAAG;YACxC,MAAM,IAAIc,MAAM;QAClB;QAEA,OAAOV,OAAOW,eAAe,CAC3Bd,6BACA,CAACe;YACC,MAAMC,mBAAmBlB,wBAAwBiB;YAEjD,MAAME,YAAY3B,mBAAmBD;YAErC,IAAIG,kBAAkByB,YAAY;gBAChC,MAAM,EAAEC,KAAK,EAAE,GAAGD;gBAClB,MAAME,YAAYD,MAAME,OAAO;gBAE/B,+FAA+F;gBAC/F,0FAA0F;gBAC1F,IACE7B,iBAAiB4B,cACjBA,UAAUE,kBAAkB,OAAO,KACnCF,UACGG,SAAS,GACTC,WAAW,GACXf,MAAM,CAAC,CAACgB,OAASjC,iBAAiBiC,OAAOC,MAAM,GAAG,GACrD;oBACAN,UAAUO,MAAM;gBAClB;gBAEAvC,yBAAyB6B;YAC3B;YAEA,OAAO;QACT,GACAvB;IAEJ,GAAG;QAACU;KAAO;IAEX,qBAAO,oBAACN;QAAmB8B,wBAAwBtB;;AACrD,EAAC"}
@@ -1,4 +1,5 @@
1
1
  import type { PopulationPromise } from '../types.js';
2
+ import type { RelationshipFeatureProps } from './feature.server.js';
2
3
  import type { SerializedRelationshipNode } from './nodes/RelationshipNode.js';
3
- export declare const relationshipPopulationPromise: PopulationPromise<SerializedRelationshipNode>;
4
+ export declare const relationshipPopulationPromiseHOC: (props: RelationshipFeatureProps) => PopulationPromise<SerializedRelationshipNode>;
4
5
  //# sourceMappingURL=populationPromise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"populationPromise.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/populationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAI7E,eAAO,MAAM,6BAA6B,EAAE,iBAAiB,CAAC,0BAA0B,CAiCvF,CAAA"}
1
+ {"version":3,"file":"populationPromise.d.ts","sourceRoot":"","sources":["../../../../src/field/features/relationship/populationPromise.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAA;AACpD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,qBAAqB,CAAA;AACnE,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,6BAA6B,CAAA;AAI7E,eAAO,MAAM,gCAAgC,UACpC,wBAAwB,KAC9B,kBAAkB,0BAA0B,CA0C9C,CAAA"}
@@ -1,25 +1,30 @@
1
1
  import { populate } from '../../../populate/populate.js';
2
- export const relationshipPopulationPromise = ({ currentDepth, depth, field, node, overrideAccess, populationPromises, req, showHiddenFields })=>{
3
- if (node?.value) {
4
- // @ts-expect-error
5
- const id = node?.value?.id || node?.value // for backwards-compatibility
6
- ;
7
- const collection = req.payload.collections[node?.relationTo];
8
- if (collection) {
9
- populationPromises.push(populate({
10
- id,
11
- collection,
12
- currentDepth,
13
- data: node,
14
- depth,
15
- field,
16
- key: 'value',
17
- overrideAccess,
18
- req,
19
- showHiddenFields
20
- }));
2
+ export const relationshipPopulationPromiseHOC = (props)=>{
3
+ const relationshipPopulationPromise = ({ currentDepth, depth, draft, field, node, overrideAccess, populationPromises, req, showHiddenFields })=>{
4
+ if (node?.value) {
5
+ // @ts-expect-error
6
+ const id = node?.value?.id || node?.value // for backwards-compatibility
7
+ ;
8
+ const collection = req.payload.collections[node?.relationTo];
9
+ if (collection) {
10
+ const populateDepth = props?.maxDepth !== undefined && props?.maxDepth < depth ? props?.maxDepth : depth;
11
+ populationPromises.push(populate({
12
+ id,
13
+ collection,
14
+ currentDepth,
15
+ data: node,
16
+ depth: populateDepth,
17
+ draft,
18
+ field,
19
+ key: 'value',
20
+ overrideAccess,
21
+ req,
22
+ showHiddenFields
23
+ }));
24
+ }
21
25
  }
22
- }
26
+ };
27
+ return relationshipPopulationPromise;
23
28
  };
24
29
 
25
30
  //# sourceMappingURL=populationPromise.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../../src/field/features/relationship/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { SerializedRelationshipNode } from './nodes/RelationshipNode.js'\n\nimport { populate } from '../../../populate/populate.js'\n\nexport const relationshipPopulationPromise: PopulationPromise<SerializedRelationshipNode> = ({\n currentDepth,\n depth,\n field,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n}) => {\n if (node?.value) {\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const collection = req.payload.collections[node?.relationTo]\n\n if (collection) {\n populationPromises.push(\n populate({\n id,\n collection,\n currentDepth,\n data: node,\n depth,\n field,\n key: 'value',\n overrideAccess,\n req,\n showHiddenFields,\n }),\n )\n }\n }\n}\n"],"names":["populate","relationshipPopulationPromise","currentDepth","depth","field","node","overrideAccess","populationPromises","req","showHiddenFields","value","id","collection","payload","collections","relationTo","push","data","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;","mappings":"AAGA,SAASA,QAAQ,QAAQ,gCAA+B;AAExD,OAAO,MAAMC,gCAA+E,CAAC,EAC3FC,YAAY,EACZC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EACjB;IACC,IAAIJ,MAAMK,OAAO;QACf,mBAAmB;QACnB,MAAMC,KAAKN,MAAMK,OAAOC,MAAMN,MAAMK,MAAM,8BAA8B;;QAExE,MAAME,aAAaJ,IAAIK,OAAO,CAACC,WAAW,CAACT,MAAMU,WAAW;QAE5D,IAAIH,YAAY;YACdL,mBAAmBS,IAAI,CACrBhB,SAAS;gBACPW;gBACAC;gBACAV;gBACAe,MAAMZ;gBACNF;gBACAC;gBACAc,KAAK;gBACLZ;gBACAE;gBACAC;YACF;QAEJ;IACF;AACF,EAAC"}
1
+ {"version":3,"sources":["../../../../src/field/features/relationship/populationPromise.ts"],"sourcesContent":["import type { PopulationPromise } from '../types.js'\nimport type { RelationshipFeatureProps } from './feature.server.js'\nimport type { SerializedRelationshipNode } from './nodes/RelationshipNode.js'\n\nimport { populate } from '../../../populate/populate.js'\n\nexport const relationshipPopulationPromiseHOC = (\n props: RelationshipFeatureProps,\n): PopulationPromise<SerializedRelationshipNode> => {\n const relationshipPopulationPromise: PopulationPromise<SerializedRelationshipNode> = ({\n currentDepth,\n depth,\n draft,\n field,\n node,\n overrideAccess,\n populationPromises,\n req,\n showHiddenFields,\n }) => {\n if (node?.value) {\n // @ts-expect-error\n const id = node?.value?.id || node?.value // for backwards-compatibility\n\n const collection = req.payload.collections[node?.relationTo]\n\n if (collection) {\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 }\n }\n\n return relationshipPopulationPromise\n}\n"],"names":["populate","relationshipPopulationPromiseHOC","props","relationshipPopulationPromise","currentDepth","depth","draft","field","node","overrideAccess","populationPromises","req","showHiddenFields","value","id","collection","payload","collections","relationTo","populateDepth","maxDepth","undefined","push","data","key"],"rangeMappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;","mappings":"AAIA,SAASA,QAAQ,QAAQ,gCAA+B;AAExD,OAAO,MAAMC,mCAAmC,CAC9CC;IAEA,MAAMC,gCAA+E,CAAC,EACpFC,YAAY,EACZC,KAAK,EACLC,KAAK,EACLC,KAAK,EACLC,IAAI,EACJC,cAAc,EACdC,kBAAkB,EAClBC,GAAG,EACHC,gBAAgB,EACjB;QACC,IAAIJ,MAAMK,OAAO;YACf,mBAAmB;YACnB,MAAMC,KAAKN,MAAMK,OAAOC,MAAMN,MAAMK,MAAM,8BAA8B;;YAExE,MAAME,aAAaJ,IAAIK,OAAO,CAACC,WAAW,CAACT,MAAMU,WAAW;YAE5D,IAAIH,YAAY;gBACd,MAAMI,gBACJjB,OAAOkB,aAAaC,aAAanB,OAAOkB,WAAWf,QAAQH,OAAOkB,WAAWf;gBAE/EK,mBAAmBY,IAAI,CACrBtB,SAAS;oBACPc;oBACAC;oBACAX;oBACAmB,MAAMf;oBACNH,OAAOc;oBACPb;oBACAC;oBACAiB,KAAK;oBACLf;oBACAE;oBACAC;gBACF;YAEJ;QACF;IACF;IAEA,OAAOT;AACT,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js';
2
+ export declare const toolbarAddDropdownGroupWithItems: (items: ToolbarGroupItem[]) => ToolbarGroup;
3
+ //# sourceMappingURL=addDropdownGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"addDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/shared/toolbar/addDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,gCAAgC,UAAW,gBAAgB,EAAE,KAAG,YAQ5E,CAAA"}
@@ -0,0 +1,12 @@
1
+ import { AddIcon } from '../../../lexical/ui/icons/Add/index.js';
2
+ export const toolbarAddDropdownGroupWithItems = (items)=>{
3
+ return {
4
+ type: 'dropdown',
5
+ ChildComponent: AddIcon,
6
+ items,
7
+ key: 'add',
8
+ order: 10
9
+ };
10
+ };
11
+
12
+ //# sourceMappingURL=addDropdownGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/shared/toolbar/addDropdownGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nimport { AddIcon } from '../../../lexical/ui/icons/Add/index.js'\n\nexport const toolbarAddDropdownGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'dropdown',\n ChildComponent: AddIcon,\n items,\n key: 'add',\n order: 10,\n }\n}\n"],"names":["AddIcon","toolbarAddDropdownGroupWithItems","items","type","ChildComponent","key","order"],"rangeMappings":";;;;;;;;;","mappings":"AAEA,SAASA,OAAO,QAAQ,yCAAwC;AAEhE,OAAO,MAAMC,mCAAmC,CAACC;IAC/C,OAAO;QACLC,MAAM;QACNC,gBAAgBJ;QAChBE;QACAG,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js';
2
+ export declare const toolbarFeatureButtonsGroupWithItems: (items: ToolbarGroupItem[]) => ToolbarGroup;
3
+ //# sourceMappingURL=featureButtonsGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"featureButtonsGroup.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/shared/toolbar/featureButtonsGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAE7E,eAAO,MAAM,mCAAmC,UAAW,gBAAgB,EAAE,KAAG,YAO/E,CAAA"}
@@ -0,0 +1,10 @@
1
+ export const toolbarFeatureButtonsGroupWithItems = (items)=>{
2
+ return {
3
+ type: 'buttons',
4
+ items,
5
+ key: 'features',
6
+ order: 50
7
+ };
8
+ };
9
+
10
+ //# sourceMappingURL=featureButtonsGroup.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/shared/toolbar/featureButtonsGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nexport const toolbarFeatureButtonsGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'buttons',\n items,\n key: 'features',\n order: 50,\n }\n}\n"],"names":["toolbarFeatureButtonsGroupWithItems","items","type","key","order"],"rangeMappings":";;;;;;;","mappings":"AAEA,OAAO,MAAMA,sCAAsC,CAACC;IAClD,OAAO;QACLC,MAAM;QACND;QACAE,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -0,0 +1,3 @@
1
+ import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js';
2
+ export declare const toolbarTextDropdownGroupWithItems: (items: ToolbarGroupItem[]) => ToolbarGroup;
3
+ //# sourceMappingURL=textDropdownGroup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"textDropdownGroup.d.ts","sourceRoot":"","sources":["../../../../../src/field/features/shared/toolbar/textDropdownGroup.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAI7E,eAAO,MAAM,iCAAiC,UAAW,gBAAgB,EAAE,KAAG,YAQ7E,CAAA"}
@@ -1,11 +1,11 @@
1
1
  import { TextIcon } from '../../../lexical/ui/icons/Text/index.js';
2
- export const inlineToolbarTextDropdownGroupWithItems = (items)=>{
2
+ export const toolbarTextDropdownGroupWithItems = (items)=>{
3
3
  return {
4
4
  type: 'dropdown',
5
5
  ChildComponent: TextIcon,
6
6
  items,
7
7
  key: 'text',
8
- order: 1
8
+ order: 25
9
9
  };
10
10
  };
11
11
 
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../../../src/field/features/shared/toolbar/textDropdownGroup.ts"],"sourcesContent":["import type { ToolbarGroup, ToolbarGroupItem } from '../../toolbars/types.js'\n\nimport { TextIcon } from '../../../lexical/ui/icons/Text/index.js'\n\nexport const toolbarTextDropdownGroupWithItems = (items: ToolbarGroupItem[]): ToolbarGroup => {\n return {\n type: 'dropdown',\n ChildComponent: TextIcon,\n items,\n key: 'text',\n order: 25,\n }\n}\n"],"names":["TextIcon","toolbarTextDropdownGroupWithItems","items","type","ChildComponent","key","order"],"rangeMappings":";;;;;;;;;","mappings":"AAEA,SAASA,QAAQ,QAAQ,0CAAyC;AAElE,OAAO,MAAMC,oCAAoC,CAACC;IAChD,OAAO;QACLC,MAAM;QACNC,gBAAgBJ;QAChBE;QACAG,KAAK;QACLC,OAAO;IACT;AACF,EAAC"}
@@ -0,0 +1,4 @@
1
+ import type { PluginComponentWithAnchor } from '../../../types.js';
2
+ import './index.scss';
3
+ export declare const FixedToolbarPlugin: PluginComponentWithAnchor<undefined>;
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/field/features/toolbars/fixed/Toolbar/index.tsx"],"names":[],"mappings":"AASA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mBAAmB,CAAA;AAOlE,OAAO,cAAc,CAAA;AA2KrB,eAAO,MAAM,kBAAkB,EAAE,yBAAyB,CAAC,SAAS,CAqBnE,CAAA"}