@strapi/content-manager 0.0.0-experimental.e9122b401c96877b6707775c4f893660eab93ae3 → 0.0.0-experimental.e9144fc8a193f9875a2c0832d689c14001c79f00

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