@strapi/content-manager 0.0.0-next.185e16fdc3e6f1895610ab73932bc3f044bb59e9 → 0.0.0-next.1a574eb92501bf5230c6126b73f8e992690d8da1

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 (468) hide show
  1. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs +80 -0
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.map +1 -0
  3. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +82 -0
  4. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +1 -0
  5. package/dist/admin/chunks/ComponentConfigurationPage-C6-yVoE3.js +299 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-C6-yVoE3.js.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-DuN0XVMW.mjs +277 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-DuN0XVMW.mjs.map +1 -0
  9. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs +153 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.map +1 -0
  11. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +176 -0
  12. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +1 -0
  13. package/dist/admin/chunks/EditConfigurationPage-CGLkm6-l.js +181 -0
  14. package/dist/admin/chunks/EditConfigurationPage-CGLkm6-l.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-dMHIBbF1.mjs +159 -0
  16. package/dist/admin/chunks/EditConfigurationPage-dMHIBbF1.mjs.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-C6t9zIMh.mjs +311 -0
  18. package/dist/admin/chunks/EditViewPage-C6t9zIMh.mjs.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-DXT_1NHv.js +334 -0
  20. package/dist/admin/chunks/EditViewPage-DXT_1NHv.js.map +1 -0
  21. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs +56 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.map +1 -0
  23. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +58 -0
  24. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +1 -0
  25. package/dist/admin/chunks/Form-CYwwV0U-.mjs +955 -0
  26. package/dist/admin/chunks/Form-CYwwV0U-.mjs.map +1 -0
  27. package/dist/admin/chunks/Form-D7GCEkaE.js +978 -0
  28. package/dist/admin/chunks/Form-D7GCEkaE.js.map +1 -0
  29. package/dist/admin/chunks/History-CZ9Cnw23.mjs +1357 -0
  30. package/dist/admin/chunks/History-CZ9Cnw23.mjs.map +1 -0
  31. package/dist/admin/chunks/History-CZP7hLUV.js +1380 -0
  32. package/dist/admin/chunks/History-CZP7hLUV.js.map +1 -0
  33. package/dist/admin/chunks/Input-BR5JpzSp.mjs +7184 -0
  34. package/dist/admin/chunks/Input-BR5JpzSp.mjs.map +1 -0
  35. package/dist/admin/chunks/Input-ZnF7wer5.js +7215 -0
  36. package/dist/admin/chunks/Input-ZnF7wer5.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-CSHB8jY5.mjs +796 -0
  38. package/dist/admin/chunks/ListConfigurationPage-CSHB8jY5.mjs.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-DqDJ3esz.js +819 -0
  40. package/dist/admin/chunks/ListConfigurationPage-DqDJ3esz.js.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-o7MuKWe7.mjs +1133 -0
  42. package/dist/admin/chunks/ListViewPage-o7MuKWe7.mjs.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-uGHyqfkp.js +1155 -0
  44. package/dist/admin/chunks/ListViewPage-uGHyqfkp.js.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-CJTJmAcN.js +60 -0
  46. package/dist/admin/chunks/NoContentTypePage-CJTJmAcN.js.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-Ci7qKVSj.mjs +58 -0
  48. package/dist/admin/chunks/NoContentTypePage-Ci7qKVSj.mjs.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-C_oTwBmY.js +39 -0
  50. package/dist/admin/chunks/NoPermissionsPage-C_oTwBmY.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-DgYW5cC4.mjs +37 -0
  52. package/dist/admin/chunks/NoPermissionsPage-DgYW5cC4.mjs.map +1 -0
  53. package/dist/admin/chunks/Preview-BIEc2-KZ.mjs +678 -0
  54. package/dist/admin/chunks/Preview-BIEc2-KZ.mjs.map +1 -0
  55. package/dist/admin/chunks/Preview-DFV3Bgia.js +700 -0
  56. package/dist/admin/chunks/Preview-DFV3Bgia.js.map +1 -0
  57. package/dist/admin/chunks/Relations-B6iGFlMU.mjs +827 -0
  58. package/dist/admin/chunks/Relations-B6iGFlMU.mjs.map +1 -0
  59. package/dist/admin/chunks/Relations-BhhL2fE7.js +853 -0
  60. package/dist/admin/chunks/Relations-BhhL2fE7.js.map +1 -0
  61. package/dist/admin/chunks/ar-DckYq_WK.mjs +222 -0
  62. package/dist/{_chunks/ar-CCEVvqGG.mjs.map → admin/chunks/ar-DckYq_WK.mjs.map} +1 -1
  63. package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
  64. package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
  65. package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
  66. package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
  67. package/dist/admin/chunks/ca-DviY7mRj.mjs +197 -0
  68. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  69. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  70. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  71. package/dist/admin/chunks/cs-C7OSYFQ7.mjs +122 -0
  72. package/dist/{_chunks/cs-CM2aBUar.mjs.map → admin/chunks/cs-C7OSYFQ7.mjs.map} +1 -1
  73. package/dist/admin/chunks/de-5QRlDHyR.mjs +195 -0
  74. package/dist/{_chunks/eu-CdALomew.mjs.map → admin/chunks/de-5QRlDHyR.mjs.map} +1 -1
  75. package/dist/admin/chunks/de-CbImAUA5.js +200 -0
  76. package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
  77. package/dist/admin/chunks/en-CImiNxXE.mjs +310 -0
  78. package/dist/{_chunks/en-DhFUjrNW.mjs.map → admin/chunks/en-CImiNxXE.mjs.map} +1 -1
  79. package/dist/admin/chunks/en-CLf4SuMQ.js +315 -0
  80. package/dist/{_chunks/en-Ic0kXjxB.js.map → admin/chunks/en-CLf4SuMQ.js.map} +1 -1
  81. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  82. package/dist/{_chunks/es-9K52xZIr.js.map → admin/chunks/es-C8vLuvZL.js.map} +1 -1
  83. package/dist/admin/chunks/es-DkoWSExG.mjs +192 -0
  84. package/dist/{_chunks/ja-BHqhDq4V.mjs.map → admin/chunks/es-DkoWSExG.mjs.map} +1 -1
  85. package/dist/admin/chunks/eu-BG1xX7HK.mjs +198 -0
  86. package/dist/admin/chunks/eu-BG1xX7HK.mjs.map +1 -0
  87. package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
  88. package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
  89. package/dist/admin/chunks/fr-CFdRaRVj.mjs +215 -0
  90. package/dist/admin/chunks/fr-CFdRaRVj.mjs.map +1 -0
  91. package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
  92. package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
  93. package/dist/admin/chunks/gu-D5MMMXRs.mjs +196 -0
  94. package/dist/admin/chunks/gu-D5MMMXRs.mjs.map +1 -0
  95. package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
  96. package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
  97. package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
  98. package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
  99. package/dist/admin/chunks/hi-lp17SCjr.mjs +196 -0
  100. package/dist/admin/chunks/hi-lp17SCjr.mjs.map +1 -0
  101. package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
  102. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
  103. package/dist/admin/chunks/hooks-DMvik5y_.mjs +7 -0
  104. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  105. package/dist/admin/chunks/hu-CLka1U2C.mjs +198 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.mjs.map +1 -0
  107. package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
  108. package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
  109. package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
  110. package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
  111. package/dist/admin/chunks/id-USfY9m1g.mjs +156 -0
  112. package/dist/{_chunks/id-BtwA9WJT.mjs.map → admin/chunks/id-USfY9m1g.mjs.map} +1 -1
  113. package/dist/admin/chunks/index-BHsh5hLe.js +5466 -0
  114. package/dist/admin/chunks/index-BHsh5hLe.js.map +1 -0
  115. package/dist/admin/chunks/index-D_xHP7Sa.mjs +5399 -0
  116. package/dist/admin/chunks/index-D_xHP7Sa.mjs.map +1 -0
  117. package/dist/admin/chunks/it-BAHrwmYS.mjs +158 -0
  118. package/dist/{_chunks/it-BrVPqaf1.mjs.map → admin/chunks/it-BAHrwmYS.mjs.map} +1 -1
  119. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  120. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  121. package/dist/admin/chunks/ja-BWKmBJFT.mjs +192 -0
  122. package/dist/{_chunks/ko-HVQRlfUI.mjs.map → admin/chunks/ja-BWKmBJFT.mjs.map} +1 -1
  123. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  124. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ja-jdQM-B79.js.map} +1 -1
  125. package/dist/admin/chunks/ko-CgADGBNt.mjs +191 -0
  126. package/dist/{_chunks/es-D34tqjMw.mjs.map → admin/chunks/ko-CgADGBNt.mjs.map} +1 -1
  127. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  128. package/dist/{_chunks/ja-7sfIbjxE.js.map → admin/chunks/ko-k46sEyzt.js.map} +1 -1
  129. package/dist/admin/chunks/layout-C3DUumtc.js +619 -0
  130. package/dist/admin/chunks/layout-C3DUumtc.js.map +1 -0
  131. package/dist/admin/chunks/layout-Dp806Nqc.mjs +599 -0
  132. package/dist/admin/chunks/layout-Dp806Nqc.mjs.map +1 -0
  133. package/dist/admin/chunks/ml-CnhCfOn_.mjs +196 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.mjs.map +1 -0
  135. package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
  136. package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
  137. package/dist/admin/chunks/ms-Bh09NFff.mjs +140 -0
  138. package/dist/{_chunks/ms-m_WjyWx7.mjs.map → admin/chunks/ms-Bh09NFff.mjs.map} +1 -1
  139. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  140. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/ms-CvSC0OdG.js.map} +1 -1
  141. package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
  142. package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
  143. package/dist/admin/chunks/nl-C8HYflTc.mjs +198 -0
  144. package/dist/admin/chunks/nl-C8HYflTc.mjs.map +1 -0
  145. package/dist/admin/chunks/objects-C3EebVVe.js +76 -0
  146. package/dist/admin/chunks/objects-C3EebVVe.js.map +1 -0
  147. package/dist/admin/chunks/objects-wl73iEma.mjs +73 -0
  148. package/dist/admin/chunks/objects-wl73iEma.mjs.map +1 -0
  149. package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
  150. package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
  151. package/dist/admin/chunks/pl-MFCZJZuZ.mjs +195 -0
  152. package/dist/{_chunks/ca-5U32ON2v.mjs.map → admin/chunks/pl-MFCZJZuZ.mjs.map} +1 -1
  153. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  154. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CPtAXD-4.js.map} +1 -1
  155. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs +197 -0
  156. package/dist/{_chunks/pt-BR-C71iDxnh.mjs.map → admin/chunks/pt-BR-CcotyBGJ.mjs.map} +1 -1
  157. package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
  158. package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
  159. package/dist/admin/chunks/pt-HbmgeiYO.mjs +93 -0
  160. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  161. package/dist/admin/chunks/relations-ksVp_JdY.mjs +173 -0
  162. package/dist/admin/chunks/relations-ksVp_JdY.mjs.map +1 -0
  163. package/dist/admin/chunks/relations-yfvNHWQO.js +178 -0
  164. package/dist/admin/chunks/relations-yfvNHWQO.js.map +1 -0
  165. package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
  166. package/dist/admin/chunks/ru-C0op0ALG.js.map +1 -0
  167. package/dist/admin/chunks/ru-CB4BUyQp.mjs +230 -0
  168. package/dist/{_chunks/ru-BE6A4Exp.mjs.map → admin/chunks/ru-CB4BUyQp.mjs.map} +1 -1
  169. package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
  170. package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
  171. package/dist/admin/chunks/sa-n_aPA-pU.mjs +196 -0
  172. package/dist/admin/chunks/sa-n_aPA-pU.mjs.map +1 -0
  173. package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
  174. package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
  175. package/dist/admin/chunks/sk-tn_BDjE2.mjs +198 -0
  176. package/dist/admin/chunks/sk-tn_BDjE2.mjs.map +1 -0
  177. package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
  178. package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
  179. package/dist/admin/chunks/sv-cq4ZrQRd.mjs +198 -0
  180. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.map +1 -0
  181. package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
  182. package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
  183. package/dist/admin/chunks/th-mUH7hEtc.mjs +144 -0
  184. package/dist/{_chunks/uk-CR-zDhAY.mjs.map → admin/chunks/th-mUH7hEtc.mjs.map} +1 -1
  185. package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
  186. package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
  187. package/dist/admin/chunks/tr-Yt38daxh.mjs +195 -0
  188. package/dist/{_chunks/de-C72KDNOl.mjs.map → admin/chunks/tr-Yt38daxh.mjs.map} +1 -1
  189. package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
  190. package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
  191. package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
  192. package/dist/admin/chunks/uk-DB6OgySY.js.map +1 -0
  193. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs +247 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.map +1 -0
  195. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +271 -0
  196. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +1 -0
  197. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs +18 -0
  198. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.map +1 -0
  199. package/dist/admin/chunks/usePrev-DIYl-IAL.js +21 -0
  200. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +1 -0
  201. package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
  202. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-BGr1X_HZ.js.map} +1 -1
  203. package/dist/admin/chunks/vi-CvBGlTjr.mjs +108 -0
  204. package/dist/{_chunks/vi-DUXIk_fw.mjs.map → admin/chunks/vi-CvBGlTjr.mjs.map} +1 -1
  205. package/dist/admin/chunks/zh-BmF-sHaT.mjs +205 -0
  206. package/dist/admin/chunks/zh-BmF-sHaT.mjs.map +1 -0
  207. package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
  208. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
  209. package/dist/admin/chunks/zh-Hans-CI0HKio3.mjs +934 -0
  210. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-CI0HKio3.mjs.map} +1 -1
  211. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  212. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  213. package/dist/admin/index.js +25 -4
  214. package/dist/admin/index.js.map +1 -1
  215. package/dist/admin/index.mjs +17 -12
  216. package/dist/admin/index.mjs.map +1 -1
  217. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  218. package/dist/admin/src/content-manager.d.ts +7 -2
  219. package/dist/admin/src/exports.d.ts +1 -0
  220. package/dist/admin/src/history/services/historyVersion.d.ts +2 -2
  221. package/dist/admin/src/hooks/useDocument.d.ts +23 -4
  222. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  223. package/dist/admin/src/index.d.ts +1 -0
  224. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +3 -2
  225. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +1 -1
  226. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  227. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +55 -0
  228. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  229. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  230. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  231. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  232. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +29 -1
  233. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  234. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -1
  235. package/dist/admin/src/preview/index.d.ts +2 -3
  236. package/dist/admin/src/preview/pages/Preview.d.ts +5 -1
  237. package/dist/admin/src/preview/services/preview.d.ts +1 -1
  238. package/dist/admin/src/services/api.d.ts +1 -1
  239. package/dist/admin/src/services/components.d.ts +2 -2
  240. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  241. package/dist/admin/src/services/documents.d.ts +16 -19
  242. package/dist/admin/src/services/init.d.ts +1 -1
  243. package/dist/admin/src/services/relations.d.ts +2 -2
  244. package/dist/admin/src/services/uid.d.ts +3 -3
  245. package/dist/server/index.js +5457 -4389
  246. package/dist/server/index.js.map +1 -1
  247. package/dist/server/index.mjs +5437 -4366
  248. package/dist/server/index.mjs.map +1 -1
  249. package/dist/server/src/controllers/utils/metadata.d.ts +2 -1
  250. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  251. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  252. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  253. package/dist/server/src/history/services/history.d.ts +3 -3
  254. package/dist/server/src/history/services/history.d.ts.map +1 -1
  255. package/dist/server/src/history/services/utils.d.ts +6 -10
  256. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  257. package/dist/server/src/index.d.ts +3 -2
  258. package/dist/server/src/index.d.ts.map +1 -1
  259. package/dist/server/src/preview/index.d.ts.map +1 -1
  260. package/dist/server/src/services/document-metadata.d.ts +4 -2
  261. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  262. package/dist/server/src/services/index.d.ts +3 -2
  263. package/dist/server/src/services/index.d.ts.map +1 -1
  264. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  265. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  266. package/dist/server/src/services/utils/count.d.ts +1 -1
  267. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  268. package/dist/server/src/services/utils/populate.d.ts +3 -3
  269. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  270. package/dist/shared/contracts/collection-types.d.ts +0 -1
  271. package/dist/shared/contracts/components.d.ts +0 -1
  272. package/dist/shared/contracts/content-types.d.ts +0 -1
  273. package/dist/shared/contracts/history-versions.d.ts +0 -1
  274. package/dist/shared/contracts/index.d.ts +0 -1
  275. package/dist/shared/contracts/init.d.ts +0 -1
  276. package/dist/shared/contracts/preview.d.ts +0 -1
  277. package/dist/shared/contracts/relations.d.ts +1 -2
  278. package/dist/shared/contracts/relations.d.ts.map +1 -1
  279. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  280. package/dist/shared/contracts/single-types.d.ts +0 -1
  281. package/dist/shared/contracts/uid.d.ts +0 -1
  282. package/dist/shared/index.d.ts +0 -1
  283. package/dist/shared/index.js +35 -24
  284. package/dist/shared/index.js.map +1 -1
  285. package/dist/shared/index.mjs +34 -25
  286. package/dist/shared/index.mjs.map +1 -1
  287. package/package.json +19 -15
  288. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  289. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  290. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  291. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  292. package/dist/_chunks/ComponentConfigurationPage-BH5297nw.js +0 -255
  293. package/dist/_chunks/ComponentConfigurationPage-BH5297nw.js.map +0 -1
  294. package/dist/_chunks/ComponentConfigurationPage-CBRYXx1V.mjs +0 -236
  295. package/dist/_chunks/ComponentConfigurationPage-CBRYXx1V.mjs.map +0 -1
  296. package/dist/_chunks/ComponentIcon-BXdiCGQp.js +0 -176
  297. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +0 -1
  298. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  299. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  300. package/dist/_chunks/EditConfigurationPage-CKkb0EW6.js +0 -151
  301. package/dist/_chunks/EditConfigurationPage-CKkb0EW6.js.map +0 -1
  302. package/dist/_chunks/EditConfigurationPage-DCFTHMFy.mjs +0 -132
  303. package/dist/_chunks/EditConfigurationPage-DCFTHMFy.mjs.map +0 -1
  304. package/dist/_chunks/EditViewPage-B7qtO55B.mjs +0 -254
  305. package/dist/_chunks/EditViewPage-B7qtO55B.mjs.map +0 -1
  306. package/dist/_chunks/EditViewPage-CtYyxyPW.js +0 -273
  307. package/dist/_chunks/EditViewPage-CtYyxyPW.js.map +0 -1
  308. package/dist/_chunks/Field-BMv9ud3N.mjs +0 -5582
  309. package/dist/_chunks/Field-BMv9ud3N.mjs.map +0 -1
  310. package/dist/_chunks/Field-oqDBIPId.js +0 -5614
  311. package/dist/_chunks/Field-oqDBIPId.js.map +0 -1
  312. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  313. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  314. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  315. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  316. package/dist/_chunks/Form-BtsYj5GQ.js +0 -779
  317. package/dist/_chunks/Form-BtsYj5GQ.js.map +0 -1
  318. package/dist/_chunks/Form-Drwa2T5R.mjs +0 -758
  319. package/dist/_chunks/Form-Drwa2T5R.mjs.map +0 -1
  320. package/dist/_chunks/History-CxGvvWhH.js +0 -996
  321. package/dist/_chunks/History-CxGvvWhH.js.map +0 -1
  322. package/dist/_chunks/History-dUA1IWvK.mjs +0 -975
  323. package/dist/_chunks/History-dUA1IWvK.mjs.map +0 -1
  324. package/dist/_chunks/ListConfigurationPage-C-dzvcr-.mjs +0 -633
  325. package/dist/_chunks/ListConfigurationPage-C-dzvcr-.mjs.map +0 -1
  326. package/dist/_chunks/ListConfigurationPage-fJRHoZ-W.js +0 -653
  327. package/dist/_chunks/ListConfigurationPage-fJRHoZ-W.js.map +0 -1
  328. package/dist/_chunks/ListViewPage-BjPkVAd6.js +0 -886
  329. package/dist/_chunks/ListViewPage-BjPkVAd6.js.map +0 -1
  330. package/dist/_chunks/ListViewPage-Dq1Q0T3K.mjs +0 -862
  331. package/dist/_chunks/ListViewPage-Dq1Q0T3K.mjs.map +0 -1
  332. package/dist/_chunks/NoContentTypePage-B2qw4pa9.mjs +0 -51
  333. package/dist/_chunks/NoContentTypePage-B2qw4pa9.mjs.map +0 -1
  334. package/dist/_chunks/NoContentTypePage-DoosCI8K.js +0 -51
  335. package/dist/_chunks/NoContentTypePage-DoosCI8K.js.map +0 -1
  336. package/dist/_chunks/NoPermissionsPage-BthC4KSZ.mjs +0 -23
  337. package/dist/_chunks/NoPermissionsPage-BthC4KSZ.mjs.map +0 -1
  338. package/dist/_chunks/NoPermissionsPage-Eb2ZWoy6.js +0 -23
  339. package/dist/_chunks/NoPermissionsPage-Eb2ZWoy6.js.map +0 -1
  340. package/dist/_chunks/Preview-DAZ8xXys.js +0 -291
  341. package/dist/_chunks/Preview-DAZ8xXys.js.map +0 -1
  342. package/dist/_chunks/Preview-kpxJkIOq.mjs +0 -272
  343. package/dist/_chunks/Preview-kpxJkIOq.mjs.map +0 -1
  344. package/dist/_chunks/Relations-30DATMsp.js +0 -750
  345. package/dist/_chunks/Relations-30DATMsp.js.map +0 -1
  346. package/dist/_chunks/Relations-BVKe5d6m.mjs +0 -730
  347. package/dist/_chunks/Relations-BVKe5d6m.mjs.map +0 -1
  348. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  349. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  350. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  351. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  352. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  353. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  354. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  355. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  356. package/dist/_chunks/de-CCEmbAah.js +0 -199
  357. package/dist/_chunks/en-DhFUjrNW.mjs +0 -304
  358. package/dist/_chunks/en-Ic0kXjxB.js +0 -304
  359. package/dist/_chunks/es-9K52xZIr.js +0 -196
  360. package/dist/_chunks/es-D34tqjMw.mjs +0 -196
  361. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  362. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  363. package/dist/_chunks/fr--pg5jUbt.mjs +0 -216
  364. package/dist/_chunks/fr--pg5jUbt.mjs.map +0 -1
  365. package/dist/_chunks/fr-B2Kyv8Z9.js +0 -216
  366. package/dist/_chunks/fr-B2Kyv8Z9.js.map +0 -1
  367. package/dist/_chunks/gu-BRmF601H.js +0 -200
  368. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  369. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  370. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  371. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  372. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  373. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  374. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  375. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  376. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  377. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  378. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  379. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  380. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  381. package/dist/_chunks/id-B5Ser98A.js +0 -160
  382. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  383. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  384. package/dist/_chunks/index-C-rEZYIo.mjs +0 -4189
  385. package/dist/_chunks/index-C-rEZYIo.mjs.map +0 -1
  386. package/dist/_chunks/index-CliQLPIn.js +0 -4209
  387. package/dist/_chunks/index-CliQLPIn.js.map +0 -1
  388. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  389. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  390. package/dist/_chunks/ja-7sfIbjxE.js +0 -196
  391. package/dist/_chunks/ja-BHqhDq4V.mjs +0 -196
  392. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  393. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  394. package/dist/_chunks/layout-Ap9UjC0q.js +0 -489
  395. package/dist/_chunks/layout-Ap9UjC0q.js.map +0 -1
  396. package/dist/_chunks/layout-Cc0Kovb9.mjs +0 -471
  397. package/dist/_chunks/layout-Cc0Kovb9.mjs.map +0 -1
  398. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  399. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  400. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  401. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  402. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  403. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  404. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  405. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  406. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  407. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  408. package/dist/_chunks/objects-BcXOv6_9.js +0 -47
  409. package/dist/_chunks/objects-BcXOv6_9.js.map +0 -1
  410. package/dist/_chunks/objects-D6yBsdmx.mjs +0 -45
  411. package/dist/_chunks/objects-D6yBsdmx.mjs.map +0 -1
  412. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  413. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  414. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  415. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  416. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  417. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  418. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  419. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  420. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  421. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  422. package/dist/_chunks/relations-CMPpsYC4.mjs +0 -134
  423. package/dist/_chunks/relations-CMPpsYC4.mjs.map +0 -1
  424. package/dist/_chunks/relations-Quzh1sDm.js +0 -133
  425. package/dist/_chunks/relations-Quzh1sDm.js.map +0 -1
  426. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  427. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  428. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  429. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  430. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  431. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  432. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  433. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  434. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  435. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  436. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  437. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  438. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  439. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  440. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  441. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  442. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  443. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  444. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  445. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  446. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  447. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  448. package/dist/_chunks/uk-C8EiqJY7.js.map +0 -1
  449. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  450. package/dist/_chunks/useDebounce-CtcjDB3L.js +0 -28
  451. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +0 -1
  452. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +0 -29
  453. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +0 -1
  454. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs +0 -231
  455. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +0 -1
  456. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js +0 -249
  457. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +0 -1
  458. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  459. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  460. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  461. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  462. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  463. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  464. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  465. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  466. package/dist/admin/src/preview/constants.d.ts +0 -1
  467. package/dist/server/src/preview/constants.d.ts +0 -2
  468. package/dist/server/src/preview/constants.d.ts.map +0 -1
@@ -0,0 +1,827 @@
1
+ import { jsxs, jsx } from 'react/jsx-runtime';
2
+ import * as React from 'react';
3
+ import { createContext, useQueryParams, useForm, useField, useNotification, useFocusInputField } from '@strapi/admin/strapi-admin';
4
+ import { Flex, Box, Link, TextButton, Field, Combobox, ComboboxOption, Typography, VisuallyHidden, useComposedRefs, IconButton, Tooltip } from '@strapi/design-system';
5
+ import { ArrowClockwise, Drag, Cross } from '@strapi/icons';
6
+ import { generateNKeysBetween } from 'fractional-indexing';
7
+ import pipe from 'lodash/fp/pipe';
8
+ import { getEmptyImage } from 'react-dnd-html5-backend';
9
+ import { useIntl } from 'react-intl';
10
+ import { NavLink } from 'react-router-dom';
11
+ import { FixedSizeList } from 'react-window';
12
+ import { styled } from 'styled-components';
13
+ import { c as useDoc, d as buildValidParams, C as COLLECTION_TYPES, g as getTranslation, D as DocumentStatus } from './index-D_xHP7Sa.mjs';
14
+ import { u as useDragAndDrop, I as ItemTypes, D as DROP_SENSITIVITY } from './useDragAndDrop-HYwNDExe.mjs';
15
+ import { u as useGetRelationsQuery, g as getRelationLabel, a as useDebounce, b as useLazySearchRelationsQuery } from './relations-ksVp_JdY.mjs';
16
+
17
+ /**
18
+ * We use this component to wrap any individual component field in the Edit View,
19
+ * this could be a component field in a dynamic zone, a component within a repeatable space,
20
+ * or even nested components.
21
+ *
22
+ * We primarily need this to provide the component id to the components so that they can
23
+ * correctly fetch their relations.
24
+ */ const [ComponentProvider, useComponent] = createContext('ComponentContext', {
25
+ id: undefined,
26
+ level: -1,
27
+ uid: undefined,
28
+ type: undefined
29
+ });
30
+
31
+ /**
32
+ * Remove a relation, whether it's been already saved or not.
33
+ * It's used both in RelationsList, where the "remove relation" button is, and in the input,
34
+ * because we sometimes need to remove a previous relation when selecting a new one.
35
+ */ function useHandleDisconnect(fieldName, consumerName) {
36
+ const field = useField(fieldName);
37
+ const removeFieldRow = useForm(consumerName, (state)=>state.removeFieldRow);
38
+ const addFieldRow = useForm(consumerName, (state)=>state.addFieldRow);
39
+ const handleDisconnect = (relation)=>{
40
+ if (field.value && field.value.connect) {
41
+ /**
42
+ * A relation will exist in the `connect` array _if_ it has
43
+ * been added without saving. In this case, we just remove it
44
+ * from the connect array
45
+ */ const indexOfRelationInConnectArray = field.value.connect.findIndex((rel)=>rel.id === relation.id);
46
+ if (indexOfRelationInConnectArray >= 0) {
47
+ removeFieldRow(`${fieldName}.connect`, indexOfRelationInConnectArray);
48
+ return;
49
+ }
50
+ }
51
+ addFieldRow(`${fieldName}.disconnect`, {
52
+ id: relation.id,
53
+ apiData: {
54
+ id: relation.id,
55
+ documentId: relation.documentId,
56
+ locale: relation.locale
57
+ }
58
+ });
59
+ };
60
+ return handleDisconnect;
61
+ }
62
+ /* -------------------------------------------------------------------------------------------------
63
+ * RelationsField
64
+ * -----------------------------------------------------------------------------------------------*/ const RELATIONS_TO_DISPLAY = 5;
65
+ const ONE_WAY_RELATIONS = [
66
+ 'oneWay',
67
+ 'oneToOne',
68
+ 'manyToOne',
69
+ 'oneToManyMorph',
70
+ 'oneToOneMorph'
71
+ ];
72
+ /**
73
+ * TODO: we get a rather ugly flash when we remove a single relation from the list leaving
74
+ * no other relations when we press save. The initial relation re-renders, probably because
75
+ * of the lag in the Form cleaning it's "disconnect" array, whilst our data has not been invalidated.
76
+ *
77
+ * Could we invalidate relation data on the document actions? Should we?
78
+ */ /**
79
+ * @internal
80
+ * @description The relations field holds a lot of domain logic for handling relations which is rather complicated
81
+ * At present we do not expose this to plugin developers, however, they are able to overwrite it themselves should
82
+ * they wish to do so.
83
+ */ const RelationsField = /*#__PURE__*/ React.forwardRef(({ disabled, label, ...props }, ref)=>{
84
+ const [currentPage, setCurrentPage] = React.useState(1);
85
+ const { document, model: documentModel } = useDoc();
86
+ const documentId = document?.documentId;
87
+ const { formatMessage } = useIntl();
88
+ const [{ query }] = useQueryParams();
89
+ const params = buildValidParams(query);
90
+ const isMorph = props.attribute.relation.toLowerCase().includes('morph');
91
+ const isDisabled = isMorph || disabled;
92
+ const { componentId, componentUID } = useComponent('RelationsField', ({ uid, id })=>({
93
+ componentId: id,
94
+ componentUID: uid
95
+ }));
96
+ const isSubmitting = useForm('RelationsList', (state)=>state.isSubmitting);
97
+ React.useEffect(()=>{
98
+ setCurrentPage(1);
99
+ }, [
100
+ isSubmitting
101
+ ]);
102
+ /**
103
+ * We'll always have a documentId in a created entry, so we look for a componentId first.
104
+ * Same with `uid` and `documentModel`.
105
+ */ const id = componentId ? componentId.toString() : documentId;
106
+ const model = componentUID ?? documentModel;
107
+ /**
108
+ * The `name` prop is a complete path to the field, e.g. `field1.field2.field3`.
109
+ * Where the above example would a nested field within two components, however
110
+ * we only require the field on the component not the complete path since we query
111
+ * individual components. Therefore we split the string and take the last item.
112
+ */ const [targetField] = props.name.split('.').slice(-1);
113
+ const { data, isLoading, isFetching } = useGetRelationsQuery({
114
+ model,
115
+ targetField,
116
+ // below we don't run the query if there is no id.
117
+ id: id,
118
+ params: {
119
+ ...params,
120
+ pageSize: RELATIONS_TO_DISPLAY,
121
+ page: currentPage
122
+ }
123
+ }, {
124
+ refetchOnMountOrArgChange: true,
125
+ skip: !id,
126
+ selectFromResult: (result)=>{
127
+ return {
128
+ ...result,
129
+ data: {
130
+ ...result.data,
131
+ results: result.data?.results ? result.data.results : []
132
+ }
133
+ };
134
+ }
135
+ });
136
+ const handleLoadMore = ()=>{
137
+ setCurrentPage((prev)=>prev + 1);
138
+ };
139
+ const field = useField(props.name);
140
+ const isFetchingMoreRelations = isLoading || isFetching;
141
+ const realServerRelationsCount = 'pagination' in data && data.pagination ? data.pagination.total : 0;
142
+ /**
143
+ * Items that are already connected, but reordered would be in
144
+ * this list, so to get an accurate figure, we remove them.
145
+ */ const relationsConnected = (field.value?.connect ?? []).filter((rel)=>data.results.findIndex((relation)=>relation.id === rel.id) === -1).length ?? 0;
146
+ const relationsDisconnected = field.value?.disconnect?.length ?? 0;
147
+ const relationsCount = realServerRelationsCount + relationsConnected - relationsDisconnected;
148
+ /**
149
+ * This is it, the source of truth for reordering in conjunction with partial loading & updating
150
+ * of relations. Relations on load are given __temp_key__ when fetched, because we don't want to
151
+ * create brand new keys everytime the data updates, just keep adding them onto the newly loaded ones.
152
+ */ const relations = React.useMemo(()=>{
153
+ const ctx = {
154
+ field: field.value,
155
+ // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
156
+ href: `../${COLLECTION_TYPES}/${props.attribute.targetModel}`,
157
+ mainField: props.mainField
158
+ };
159
+ /**
160
+ * Tidy up our data.
161
+ */ const transformations = pipe(removeConnected(ctx), removeDisconnected(ctx), addLabelAndHref(ctx));
162
+ const transformedRels = transformations([
163
+ ...data.results
164
+ ]);
165
+ /**
166
+ * THIS IS CRUCIAL. If you don't sort by the __temp_key__ which comes from fractional indexing
167
+ * then the list will be in the wrong order.
168
+ */ return [
169
+ ...transformedRels,
170
+ ...field.value?.connect ?? []
171
+ ].sort((a, b)=>{
172
+ if (a.__temp_key__ < b.__temp_key__) return -1;
173
+ if (a.__temp_key__ > b.__temp_key__) return 1;
174
+ return 0;
175
+ });
176
+ }, [
177
+ data.results,
178
+ field.value,
179
+ // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
180
+ props.attribute.targetModel,
181
+ props.mainField
182
+ ]);
183
+ const handleDisconnect = useHandleDisconnect(props.name, 'RelationsField');
184
+ const handleConnect = (relation)=>{
185
+ const [lastItemInList] = relations.slice(-1);
186
+ const item = {
187
+ id: relation.id,
188
+ apiData: {
189
+ id: relation.id,
190
+ documentId: relation.documentId,
191
+ locale: relation.locale
192
+ },
193
+ status: relation.status,
194
+ /**
195
+ * If there's a last item, that's the first key we use to generate out next one.
196
+ */ __temp_key__: generateNKeysBetween(lastItemInList?.__temp_key__ ?? null, null, 1)[0],
197
+ // Fallback to `id` if there is no `mainField` value, which will overwrite the above `id` property with the exact same data.
198
+ [props.mainField?.name ?? 'documentId']: relation[props.mainField?.name ?? 'documentId'],
199
+ label: getRelationLabel(relation, props.mainField),
200
+ // @ts-expect-error – targetModel does exist on the attribute, but it's not typed.
201
+ href: `../${COLLECTION_TYPES}/${props.attribute.targetModel}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ''}`
202
+ };
203
+ if (ONE_WAY_RELATIONS.includes(props.attribute.relation)) {
204
+ // Remove any existing relation so they can be replaced with the new one
205
+ field.value?.connect?.forEach(handleDisconnect);
206
+ relations.forEach(handleDisconnect);
207
+ field.onChange(`${props.name}.connect`, [
208
+ item
209
+ ]);
210
+ } else {
211
+ field.onChange(`${props.name}.connect`, [
212
+ ...field.value?.connect ?? [],
213
+ item
214
+ ]);
215
+ }
216
+ };
217
+ return /*#__PURE__*/ jsxs(Flex, {
218
+ ref: ref,
219
+ direction: "column",
220
+ gap: 3,
221
+ justifyContent: "space-between",
222
+ alignItems: "stretch",
223
+ wrap: "wrap",
224
+ children: [
225
+ /*#__PURE__*/ jsxs(StyledFlex, {
226
+ direction: "column",
227
+ alignItems: "start",
228
+ gap: 2,
229
+ width: "100%",
230
+ children: [
231
+ /*#__PURE__*/ jsx(RelationsInput, {
232
+ disabled: isDisabled,
233
+ // NOTE: we should not default to using the documentId if the component is being created (componentUID is undefined)
234
+ id: componentUID ? componentId ? `${componentId}` : '' : documentId,
235
+ label: `${label} ${relationsCount > 0 ? `(${relationsCount})` : ''}`,
236
+ model: model,
237
+ onChange: handleConnect,
238
+ ...props
239
+ }),
240
+ 'pagination' in data && data.pagination && data.pagination.pageCount > data.pagination.page ? /*#__PURE__*/ jsx(TextButton, {
241
+ disabled: isFetchingMoreRelations,
242
+ onClick: handleLoadMore,
243
+ loading: isFetchingMoreRelations,
244
+ startIcon: /*#__PURE__*/ jsx(ArrowClockwise, {}),
245
+ // prevent the label from line-wrapping
246
+ shrink: 0,
247
+ children: formatMessage({
248
+ id: getTranslation('relation.loadMore'),
249
+ defaultMessage: 'Load More'
250
+ })
251
+ }) : null
252
+ ]
253
+ }),
254
+ /*#__PURE__*/ jsx(RelationsList, {
255
+ data: relations,
256
+ serverData: data.results,
257
+ disabled: isDisabled,
258
+ name: props.name,
259
+ isLoading: isFetchingMoreRelations,
260
+ relationType: props.attribute.relation
261
+ })
262
+ ]
263
+ });
264
+ });
265
+ /**
266
+ * TODO: this can be removed once we stop shipping Inputs with
267
+ * labels wrapped round in DS@2.
268
+ */ const StyledFlex = styled(Flex)`
269
+ & > div {
270
+ width: 100%;
271
+ }
272
+ `;
273
+ /**
274
+ * If it's in the connected array, it can get out of our data array,
275
+ * we'll be putting it back in later and sorting it anyway.
276
+ */ const removeConnected = ({ field })=>(relations)=>{
277
+ return relations.filter((relation)=>{
278
+ const connectedRelations = field?.connect ?? [];
279
+ return connectedRelations.findIndex((rel)=>rel.id === relation.id) === -1;
280
+ });
281
+ };
282
+ /**
283
+ * @description Removes relations that are in the `disconnect` array of the field
284
+ */ const removeDisconnected = ({ field })=>(relations)=>relations.filter((relation)=>{
285
+ const disconnectedRelations = field?.disconnect ?? [];
286
+ return disconnectedRelations.findIndex((rel)=>rel.id === relation.id) === -1;
287
+ });
288
+ /**
289
+ * @description Adds a label and href to the relation object we use this to render
290
+ * a better UI where we can link to the relation and display a human-readable label.
291
+ */ const addLabelAndHref = ({ mainField, href })=>(relations)=>relations.map((relation)=>{
292
+ return {
293
+ ...relation,
294
+ // Fallback to `id` if there is no `mainField` value, which will overwrite the above `documentId` property with the exact same data.
295
+ [mainField?.name ?? 'documentId']: relation[mainField?.name ?? 'documentId'],
296
+ label: getRelationLabel(relation, mainField),
297
+ href: `${href}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ''}`
298
+ };
299
+ });
300
+ /**
301
+ * @description Contains all the logic for the combobox that can search
302
+ * for relations and then add them to the field's connect array.
303
+ */ const RelationsInput = ({ hint, id, model, label, labelAction, name, mainField, placeholder, required, unique: _unique, 'aria-label': _ariaLabel, onChange, ...props })=>{
304
+ const [textValue, setTextValue] = React.useState('');
305
+ const [searchParams, setSearchParams] = React.useState({
306
+ _q: '',
307
+ page: 1
308
+ });
309
+ const { toggleNotification } = useNotification();
310
+ const [{ query }] = useQueryParams();
311
+ const { formatMessage } = useIntl();
312
+ const fieldRef = useFocusInputField(name);
313
+ const field = useField(name);
314
+ const searchParamsDebounced = useDebounce(searchParams, 300);
315
+ const [searchForTrigger, { data, isLoading }] = useLazySearchRelationsQuery();
316
+ /**
317
+ * Because we're using a lazy query, we need to trigger the search
318
+ * when the component mounts and when the search params change.
319
+ * We also need to trigger the search when the field value changes
320
+ * so that we can filter out the relations that are already connected.
321
+ */ React.useEffect(()=>{
322
+ /**
323
+ * The `name` prop is a complete path to the field, e.g. `field1.field2.field3`.
324
+ * Where the above example would a nested field within two components, however
325
+ * we only require the field on the component not the complete path since we query
326
+ * individual components. Therefore we split the string and take the last item.
327
+ */ const [targetField] = name.split('.').slice(-1);
328
+ searchForTrigger({
329
+ model,
330
+ targetField,
331
+ params: {
332
+ ...buildValidParams(query),
333
+ id: id ?? '',
334
+ pageSize: 10,
335
+ idsToInclude: field.value?.disconnect?.map((rel)=>rel.id.toString()) ?? [],
336
+ idsToOmit: field.value?.connect?.map((rel)=>rel.id.toString()) ?? [],
337
+ ...searchParamsDebounced
338
+ }
339
+ });
340
+ }, [
341
+ field.value?.connect,
342
+ field.value?.disconnect,
343
+ id,
344
+ model,
345
+ name,
346
+ query,
347
+ searchForTrigger,
348
+ searchParamsDebounced
349
+ ]);
350
+ const handleSearch = async (search)=>{
351
+ setSearchParams((s)=>({
352
+ ...s,
353
+ _q: search,
354
+ page: 1
355
+ }));
356
+ };
357
+ const hasNextPage = data?.pagination ? data.pagination.page < data.pagination.pageCount : false;
358
+ const options = data?.results ?? [];
359
+ const handleChange = (relationId)=>{
360
+ if (!relationId) {
361
+ return;
362
+ }
363
+ const relation = options.find((opt)=>opt.id.toString() === relationId);
364
+ if (!relation) {
365
+ // This is very unlikely to happen, but it ensures we don't have any data for.
366
+ console.error("You've tried to add a relation with an id that does not exist in the options you can see, this is likely a bug with Strapi. Please open an issue.");
367
+ toggleNotification({
368
+ message: formatMessage({
369
+ id: getTranslation('relation.error-adding-relation'),
370
+ defaultMessage: 'An error occurred while trying to add the relation.'
371
+ }),
372
+ type: 'danger'
373
+ });
374
+ return;
375
+ }
376
+ /**
377
+ * You need to give this relation a correct _temp_key_ but
378
+ * this component doesn't know about those ones, you can't rely
379
+ * on the connect array because that doesn't hold items that haven't
380
+ * moved. So use a callback to fill in the gaps when connecting.
381
+ *
382
+ */ onChange(relation);
383
+ };
384
+ const handleLoadMore = ()=>{
385
+ if (!data || !data.pagination) {
386
+ return;
387
+ } else if (data.pagination.page < data.pagination.pageCount) {
388
+ setSearchParams((s)=>({
389
+ ...s,
390
+ page: s.page + 1
391
+ }));
392
+ }
393
+ };
394
+ React.useLayoutEffect(()=>{
395
+ setTextValue('');
396
+ }, [
397
+ field.value
398
+ ]);
399
+ return /*#__PURE__*/ jsxs(Field.Root, {
400
+ error: field.error,
401
+ hint: hint,
402
+ name: name,
403
+ required: required,
404
+ children: [
405
+ /*#__PURE__*/ jsx(Field.Label, {
406
+ action: labelAction,
407
+ children: label
408
+ }),
409
+ /*#__PURE__*/ jsx(Combobox, {
410
+ ref: fieldRef,
411
+ name: name,
412
+ autocomplete: "list",
413
+ placeholder: placeholder || formatMessage({
414
+ id: getTranslation('relation.add'),
415
+ defaultMessage: 'Add relation'
416
+ }),
417
+ hasMoreItems: hasNextPage,
418
+ loading: isLoading,
419
+ onOpenChange: ()=>{
420
+ handleSearch(textValue ?? '');
421
+ },
422
+ noOptionsMessage: ()=>formatMessage({
423
+ id: getTranslation('relation.notAvailable'),
424
+ defaultMessage: 'No relations available'
425
+ }),
426
+ loadingMessage: formatMessage({
427
+ id: getTranslation('relation.isLoading'),
428
+ defaultMessage: 'Relations are loading'
429
+ }),
430
+ onLoadMore: handleLoadMore,
431
+ textValue: textValue,
432
+ onChange: handleChange,
433
+ onTextValueChange: (text)=>{
434
+ setTextValue(text);
435
+ },
436
+ onInputChange: (event)=>{
437
+ handleSearch(event.currentTarget.value);
438
+ },
439
+ ...props,
440
+ children: options.map((opt)=>{
441
+ const textValue = getRelationLabel(opt, mainField);
442
+ return /*#__PURE__*/ jsx(ComboboxOption, {
443
+ value: opt.id.toString(),
444
+ textValue: textValue,
445
+ children: /*#__PURE__*/ jsxs(Flex, {
446
+ gap: 2,
447
+ justifyContent: "space-between",
448
+ children: [
449
+ /*#__PURE__*/ jsx(Typography, {
450
+ ellipsis: true,
451
+ children: textValue
452
+ }),
453
+ opt.status ? /*#__PURE__*/ jsx(DocumentStatus, {
454
+ status: opt.status
455
+ }) : null
456
+ ]
457
+ })
458
+ }, opt.id);
459
+ })
460
+ }),
461
+ /*#__PURE__*/ jsx(Field.Error, {}),
462
+ /*#__PURE__*/ jsx(Field.Hint, {})
463
+ ]
464
+ });
465
+ };
466
+ /* -------------------------------------------------------------------------------------------------
467
+ * RelationsList
468
+ * -----------------------------------------------------------------------------------------------*/ const RELATION_ITEM_HEIGHT = 50;
469
+ const RELATION_GUTTER = 4;
470
+ const RelationsList = ({ data, serverData, disabled, name, isLoading, relationType })=>{
471
+ const ariaDescriptionId = React.useId();
472
+ const { formatMessage } = useIntl();
473
+ const listRef = React.useRef(null);
474
+ const outerListRef = React.useRef(null);
475
+ const [overflow, setOverflow] = React.useState();
476
+ const [liveText, setLiveText] = React.useState('');
477
+ const field = useField(name);
478
+ React.useEffect(()=>{
479
+ if (data.length <= RELATIONS_TO_DISPLAY) {
480
+ return setOverflow(undefined);
481
+ }
482
+ const handleNativeScroll = (e)=>{
483
+ const el = e.target;
484
+ const parentScrollContainerHeight = el.parentNode.scrollHeight;
485
+ const maxScrollBottom = el.scrollHeight - el.scrollTop;
486
+ if (el.scrollTop === 0) {
487
+ return setOverflow('bottom');
488
+ }
489
+ if (maxScrollBottom === parentScrollContainerHeight) {
490
+ return setOverflow('top');
491
+ }
492
+ return setOverflow('top-bottom');
493
+ };
494
+ const outerListRefCurrent = outerListRef?.current;
495
+ if (!isLoading && data.length > 0 && outerListRefCurrent) {
496
+ outerListRef.current.addEventListener('scroll', handleNativeScroll);
497
+ }
498
+ return ()=>{
499
+ if (outerListRefCurrent) {
500
+ outerListRefCurrent.removeEventListener('scroll', handleNativeScroll);
501
+ }
502
+ };
503
+ }, [
504
+ isLoading,
505
+ data.length
506
+ ]);
507
+ const getItemPos = (index)=>`${index + 1} of ${data.length}`;
508
+ const handleMoveItem = (newIndex, oldIndex)=>{
509
+ const item = data[oldIndex];
510
+ setLiveText(formatMessage({
511
+ id: getTranslation('dnd.reorder'),
512
+ defaultMessage: '{item}, moved. New position in list: {position}.'
513
+ }, {
514
+ item: item.label ?? item.documentId,
515
+ position: getItemPos(newIndex)
516
+ }));
517
+ /**
518
+ * Splicing mutates the array, so we need to create a new array
519
+ */ const newData = [
520
+ ...data
521
+ ];
522
+ const currentRow = data[oldIndex];
523
+ const startKey = oldIndex > newIndex ? newData[newIndex - 1]?.__temp_key__ : newData[newIndex]?.__temp_key__;
524
+ const endKey = oldIndex > newIndex ? newData[newIndex]?.__temp_key__ : newData[newIndex + 1]?.__temp_key__;
525
+ /**
526
+ * We're moving the relation between two other relations, so
527
+ * we need to generate a new key that keeps the order
528
+ */ const [newKey] = generateNKeysBetween(startKey, endKey, 1);
529
+ newData.splice(oldIndex, 1);
530
+ newData.splice(newIndex, 0, {
531
+ ...currentRow,
532
+ __temp_key__: newKey
533
+ });
534
+ /**
535
+ * Now we diff against the server to understand what's different so we
536
+ * can keep the connect array nice and tidy. It also needs reversing because
537
+ * we reverse the relations from the server in the first place.
538
+ */ const connectedRelations = newData.reduce((acc, relation, currentIndex, array)=>{
539
+ const relationOnServer = serverData.find((oldRelation)=>oldRelation.id === relation.id);
540
+ const relationInFront = array[currentIndex + 1];
541
+ if (!relationOnServer || relationOnServer.__temp_key__ !== relation.__temp_key__) {
542
+ const position = relationInFront ? {
543
+ before: relationInFront.documentId,
544
+ locale: relationInFront.locale,
545
+ status: 'publishedAt' in relationInFront && relationInFront.publishedAt ? 'published' : 'draft'
546
+ } : {
547
+ end: true
548
+ };
549
+ const relationWithPosition = {
550
+ ...relation,
551
+ ...{
552
+ apiData: {
553
+ id: relation.id,
554
+ documentId: relation.documentId,
555
+ locale: relation.locale,
556
+ position
557
+ }
558
+ }
559
+ };
560
+ return [
561
+ ...acc,
562
+ relationWithPosition
563
+ ];
564
+ }
565
+ return acc;
566
+ }, []).toReversed();
567
+ field.onChange(`${name}.connect`, connectedRelations);
568
+ };
569
+ const handleGrabItem = (index)=>{
570
+ const item = data[index];
571
+ setLiveText(formatMessage({
572
+ id: getTranslation('dnd.grab-item'),
573
+ defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`
574
+ }, {
575
+ item: item.label ?? item.documentId,
576
+ position: getItemPos(index)
577
+ }));
578
+ };
579
+ const handleDropItem = (index)=>{
580
+ const { href: _href, label, ...item } = data[index];
581
+ setLiveText(formatMessage({
582
+ id: getTranslation('dnd.drop-item'),
583
+ defaultMessage: `{item}, dropped. Final position in list: {position}.`
584
+ }, {
585
+ item: label ?? item.documentId,
586
+ position: getItemPos(index)
587
+ }));
588
+ };
589
+ const handleCancel = (index)=>{
590
+ const item = data[index];
591
+ setLiveText(formatMessage({
592
+ id: getTranslation('dnd.cancel-item'),
593
+ defaultMessage: '{item}, dropped. Re-order cancelled.'
594
+ }, {
595
+ item: item.label ?? item.documentId
596
+ }));
597
+ };
598
+ const handleDisconnect = useHandleDisconnect(name, 'RelationsList');
599
+ /**
600
+ * These relation types will only ever have one item
601
+ * in their list, so you can't reorder a single item!
602
+ */ const canReorder = !ONE_WAY_RELATIONS.includes(relationType);
603
+ const dynamicListHeight = data.length > RELATIONS_TO_DISPLAY ? Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER) + RELATION_ITEM_HEIGHT / 2 : Math.min(data.length, RELATIONS_TO_DISPLAY) * (RELATION_ITEM_HEIGHT + RELATION_GUTTER);
604
+ return /*#__PURE__*/ jsxs(ShadowBox, {
605
+ $overflowDirection: overflow,
606
+ children: [
607
+ /*#__PURE__*/ jsx(VisuallyHidden, {
608
+ id: ariaDescriptionId,
609
+ children: formatMessage({
610
+ id: getTranslation('dnd.instructions'),
611
+ defaultMessage: `Press spacebar to grab and re-order`
612
+ })
613
+ }),
614
+ /*#__PURE__*/ jsx(VisuallyHidden, {
615
+ "aria-live": "assertive",
616
+ children: liveText
617
+ }),
618
+ /*#__PURE__*/ jsx(FixedSizeList, {
619
+ height: dynamicListHeight,
620
+ ref: listRef,
621
+ outerRef: outerListRef,
622
+ itemCount: data.length,
623
+ itemSize: RELATION_ITEM_HEIGHT + RELATION_GUTTER,
624
+ itemData: {
625
+ ariaDescribedBy: ariaDescriptionId,
626
+ canDrag: canReorder,
627
+ disabled,
628
+ handleCancel,
629
+ handleDropItem,
630
+ handleGrabItem,
631
+ handleMoveItem,
632
+ name,
633
+ handleDisconnect,
634
+ relations: data
635
+ },
636
+ itemKey: (index)=>data[index].id,
637
+ innerElementType: "ol",
638
+ children: ListItem
639
+ })
640
+ ]
641
+ });
642
+ };
643
+ const ShadowBox = styled(Box)`
644
+ position: relative;
645
+ overflow: hidden;
646
+ flex: 1;
647
+
648
+ &:before,
649
+ &:after {
650
+ position: absolute;
651
+ width: 100%;
652
+ height: 4px;
653
+ z-index: 1;
654
+ }
655
+
656
+ &:before {
657
+ /* TODO: as for DS Table component we would need this to be handled by the DS theme */
658
+ content: '';
659
+ background: linear-gradient(rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
660
+ top: 0;
661
+ opacity: ${({ $overflowDirection })=>$overflowDirection === 'top-bottom' || $overflowDirection === 'top' ? 1 : 0};
662
+ transition: opacity 0.2s ease-in-out;
663
+ }
664
+
665
+ &:after {
666
+ /* TODO: as for DS Table component we would need this to be handled by the DS theme */
667
+ content: '';
668
+ background: linear-gradient(0deg, rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
669
+ bottom: 0;
670
+ opacity: ${({ $overflowDirection })=>$overflowDirection === 'top-bottom' || $overflowDirection === 'bottom' ? 1 : 0};
671
+ transition: opacity 0.2s ease-in-out;
672
+ }
673
+ `;
674
+ const ListItem = ({ data, index, style })=>{
675
+ const { ariaDescribedBy, canDrag = false, disabled = false, handleCancel, handleDisconnect, handleDropItem, handleGrabItem, handleMoveItem, name, relations } = data;
676
+ const { formatMessage } = useIntl();
677
+ const { href, id, label, status } = relations[index];
678
+ const [{ handlerId, isDragging, handleKeyDown }, relationRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop(canDrag && !disabled, {
679
+ type: `${ItemTypes.RELATION}_${name}`,
680
+ index,
681
+ item: {
682
+ displayedValue: label,
683
+ status,
684
+ id: id,
685
+ index
686
+ },
687
+ onMoveItem: handleMoveItem,
688
+ onDropItem: handleDropItem,
689
+ onGrabItem: handleGrabItem,
690
+ onCancel: handleCancel,
691
+ dropSensitivity: DROP_SENSITIVITY.REGULAR
692
+ });
693
+ const composedRefs = useComposedRefs(relationRef, dragRef);
694
+ React.useEffect(()=>{
695
+ dragPreviewRef(getEmptyImage());
696
+ }, [
697
+ dragPreviewRef
698
+ ]);
699
+ return /*#__PURE__*/ jsx(Box, {
700
+ style: style,
701
+ tag: "li",
702
+ ref: dropRef,
703
+ "aria-describedby": ariaDescribedBy,
704
+ cursor: canDrag ? 'all-scroll' : 'default',
705
+ children: isDragging ? /*#__PURE__*/ jsx(RelationItemPlaceholder, {}) : /*#__PURE__*/ jsxs(Flex, {
706
+ paddingTop: 2,
707
+ paddingBottom: 2,
708
+ paddingLeft: canDrag ? 2 : 4,
709
+ paddingRight: 4,
710
+ hasRadius: true,
711
+ borderColor: "neutral200",
712
+ background: disabled ? 'neutral150' : 'neutral0',
713
+ justifyContent: "space-between",
714
+ ref: composedRefs,
715
+ "data-handler-id": handlerId,
716
+ children: [
717
+ /*#__PURE__*/ jsxs(FlexWrapper, {
718
+ gap: 1,
719
+ children: [
720
+ canDrag ? /*#__PURE__*/ jsx(IconButton, {
721
+ tag: "div",
722
+ role: "button",
723
+ tabIndex: 0,
724
+ withTooltip: false,
725
+ label: formatMessage({
726
+ id: getTranslation('components.RelationInput.icon-button-aria-label'),
727
+ defaultMessage: 'Drag'
728
+ }),
729
+ variant: "ghost",
730
+ onKeyDown: handleKeyDown,
731
+ disabled: disabled,
732
+ children: /*#__PURE__*/ jsx(Drag, {})
733
+ }) : null,
734
+ /*#__PURE__*/ jsxs(Flex, {
735
+ width: "100%",
736
+ minWidth: 0,
737
+ justifyContent: "space-between",
738
+ children: [
739
+ /*#__PURE__*/ jsx(Box, {
740
+ minWidth: 0,
741
+ paddingTop: 1,
742
+ paddingBottom: 1,
743
+ paddingRight: 4,
744
+ children: /*#__PURE__*/ jsx(Tooltip, {
745
+ description: label,
746
+ children: href ? /*#__PURE__*/ jsx(LinkEllipsis, {
747
+ tag: NavLink,
748
+ to: href,
749
+ isExternal: false,
750
+ children: label
751
+ }) : /*#__PURE__*/ jsx(Typography, {
752
+ textColor: disabled ? 'neutral600' : 'primary600',
753
+ ellipsis: true,
754
+ children: label
755
+ })
756
+ })
757
+ }),
758
+ status ? /*#__PURE__*/ jsx(DocumentStatus, {
759
+ status: status
760
+ }) : null
761
+ ]
762
+ })
763
+ ]
764
+ }),
765
+ /*#__PURE__*/ jsx(Box, {
766
+ paddingLeft: 4,
767
+ children: /*#__PURE__*/ jsx(IconButton, {
768
+ onClick: ()=>handleDisconnect(relations[index]),
769
+ disabled: disabled,
770
+ label: formatMessage({
771
+ id: getTranslation('relation.disconnect'),
772
+ defaultMessage: 'Remove'
773
+ }),
774
+ variant: "ghost",
775
+ size: "S",
776
+ children: /*#__PURE__*/ jsx(Cross, {})
777
+ })
778
+ })
779
+ ]
780
+ })
781
+ });
782
+ };
783
+ const FlexWrapper = styled(Flex)`
784
+ width: 100%;
785
+ /* Used to prevent endAction to be pushed out of container */
786
+ min-width: 0;
787
+
788
+ & > div[role='button'] {
789
+ cursor: all-scroll;
790
+ }
791
+ `;
792
+ const DisconnectButton = styled.button`
793
+ svg path {
794
+ fill: ${({ theme, disabled })=>disabled ? theme.colors.neutral600 : theme.colors.neutral500};
795
+ }
796
+
797
+ &:hover svg path,
798
+ &:focus svg path {
799
+ fill: ${({ theme, disabled })=>!disabled && theme.colors.neutral600};
800
+ }
801
+ `;
802
+ const LinkEllipsis = styled(Link)`
803
+ display: block;
804
+
805
+ & > span {
806
+ white-space: nowrap;
807
+ overflow: hidden;
808
+ text-overflow: ellipsis;
809
+ display: block;
810
+ }
811
+ `;
812
+ const RelationItemPlaceholder = ()=>/*#__PURE__*/ jsx(Box, {
813
+ paddingTop: 2,
814
+ paddingBottom: 2,
815
+ paddingLeft: 4,
816
+ paddingRight: 4,
817
+ hasRadius: true,
818
+ borderStyle: "dashed",
819
+ borderColor: "primary600",
820
+ borderWidth: "1px",
821
+ background: "primary100",
822
+ height: `calc(100% - ${RELATION_GUTTER}px)`
823
+ });
824
+ const MemoizedRelationsField = /*#__PURE__*/ React.memo(RelationsField);
825
+
826
+ export { ComponentProvider as C, DisconnectButton as D, FlexWrapper as F, LinkEllipsis as L, MemoizedRelationsField as M, useComponent as u };
827
+ //# sourceMappingURL=Relations-B6iGFlMU.mjs.map