@strapi/content-manager 0.0.0-experimental.e02b4637b3906c6d31048d00600d09a23a0edc3d → 0.0.0-experimental.e0df4d50334a17a1beb3d203bff414fbbff62f7b

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 (491) 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-BN2kOtDm.mjs +277 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-BN2kOtDm.mjs.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-C5H-5L1u.js +299 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-C5H-5L1u.js.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-BExtZuB7.js +181 -0
  14. package/dist/admin/chunks/EditConfigurationPage-BExtZuB7.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-tMgOELQG.mjs +159 -0
  16. package/dist/admin/chunks/EditConfigurationPage-tMgOELQG.mjs.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-CYe7wAXF.mjs +314 -0
  18. package/dist/admin/chunks/EditViewPage-CYe7wAXF.mjs.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-DFkloeMZ.js +337 -0
  20. package/dist/admin/chunks/EditViewPage-DFkloeMZ.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-DGUP3zQO.js +978 -0
  26. package/dist/admin/chunks/Form-DGUP3zQO.js.map +1 -0
  27. package/dist/admin/chunks/Form-DTO0ZIaB.mjs +955 -0
  28. package/dist/admin/chunks/Form-DTO0ZIaB.mjs.map +1 -0
  29. package/dist/admin/chunks/History-C333pgXF.mjs +1357 -0
  30. package/dist/admin/chunks/History-C333pgXF.mjs.map +1 -0
  31. package/dist/admin/chunks/History-CQznK1pG.js +1380 -0
  32. package/dist/admin/chunks/History-CQznK1pG.js.map +1 -0
  33. package/dist/admin/chunks/Input-BexkC_pp.mjs +7190 -0
  34. package/dist/admin/chunks/Input-BexkC_pp.mjs.map +1 -0
  35. package/dist/admin/chunks/Input-DLJZHw9Y.js +7221 -0
  36. package/dist/admin/chunks/Input-DLJZHw9Y.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-71I_stAM.js +819 -0
  38. package/dist/admin/chunks/ListConfigurationPage-71I_stAM.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-BX2WR7MI.mjs +796 -0
  40. package/dist/admin/chunks/ListConfigurationPage-BX2WR7MI.mjs.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-BDeT3Dkk.mjs +1133 -0
  42. package/dist/admin/chunks/ListViewPage-BDeT3Dkk.mjs.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-DV3heO4F.js +1155 -0
  44. package/dist/admin/chunks/ListViewPage-DV3heO4F.js.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-9JHYpYVX.mjs +58 -0
  46. package/dist/admin/chunks/NoContentTypePage-9JHYpYVX.mjs.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-COih9y2J.js +60 -0
  48. package/dist/admin/chunks/NoContentTypePage-COih9y2J.js.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-DGAwRIlN.js +39 -0
  50. package/dist/admin/chunks/NoPermissionsPage-DGAwRIlN.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-DTe9I47q.mjs +37 -0
  52. package/dist/admin/chunks/NoPermissionsPage-DTe9I47q.mjs.map +1 -0
  53. package/dist/admin/chunks/Preview-BEq0FXda.mjs +551 -0
  54. package/dist/admin/chunks/Preview-BEq0FXda.mjs.map +1 -0
  55. package/dist/admin/chunks/Preview-CXtc9yEV.js +573 -0
  56. package/dist/admin/chunks/Preview-CXtc9yEV.js.map +1 -0
  57. package/dist/admin/chunks/Relations-o7_hVGyK.js +1318 -0
  58. package/dist/admin/chunks/Relations-o7_hVGyK.js.map +1 -0
  59. package/dist/admin/chunks/Relations-qeZyLDgQ.mjs +1291 -0
  60. package/dist/admin/chunks/Relations-qeZyLDgQ.mjs.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-C1CjdAtC.js +313 -0
  78. package/dist/{_chunks/en-Bm0D0IWz.js.map → admin/chunks/en-C1CjdAtC.js.map} +1 -1
  79. package/dist/admin/chunks/en-LfhocNG2.mjs +308 -0
  80. package/dist/{_chunks/en-DKV44jRb.mjs.map → admin/chunks/en-LfhocNG2.mjs.map} +1 -1
  81. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  82. package/dist/{_chunks/es-EUonQTon.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-CtsUxOvk.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-BHimg6jW.js +5417 -0
  114. package/dist/admin/chunks/index-BHimg6jW.js.map +1 -0
  115. package/dist/admin/chunks/index-Cs6qwFQu.mjs +5351 -0
  116. package/dist/admin/chunks/index-Cs6qwFQu.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-CeXiYflN.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-CcFe8diO.js.map → admin/chunks/ko-k46sEyzt.js.map} +1 -1
  129. package/dist/admin/chunks/layout-DStNia_P.mjs +599 -0
  130. package/dist/admin/chunks/layout-DStNia_P.mjs.map +1 -0
  131. package/dist/admin/chunks/layout-Dtahn4Ue.js +619 -0
  132. package/dist/admin/chunks/layout-Dtahn4Ue.js.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-Cq8NRUto.mjs +173 -0
  162. package/dist/admin/chunks/relations-Cq8NRUto.mjs.map +1 -0
  163. package/dist/admin/chunks/relations-XOYEEqMz.js +178 -0
  164. package/dist/admin/chunks/relations-XOYEEqMz.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/th-BqbI8lIT.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-B24MoTVg.js +145 -0
  190. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/uk-B24MoTVg.js.map} +1 -1
  191. package/dist/admin/chunks/uk-Cpgmm7gE.mjs +140 -0
  192. package/dist/{_chunks/uk-CR-zDhAY.mjs.map → admin/chunks/uk-Cpgmm7gE.mjs.map} +1 -1
  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/content-manager.d.ts +3 -2
  218. package/dist/admin/src/exports.d.ts +1 -0
  219. package/dist/admin/src/history/services/historyVersion.d.ts +2 -2
  220. package/dist/admin/src/hooks/useDocument.d.ts +21 -4
  221. package/dist/admin/src/index.d.ts +1 -0
  222. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  223. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  224. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  225. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  226. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +55 -0
  227. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  228. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  229. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  230. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +2 -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/PreviewContent.d.ts +3 -0
  235. package/dist/admin/src/preview/components/PreviewHeader.d.ts +3 -0
  236. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  237. package/dist/admin/src/preview/index.d.ts +3 -0
  238. package/dist/admin/src/preview/pages/Preview.d.ts +13 -0
  239. package/dist/admin/src/preview/routes.d.ts +3 -0
  240. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  241. package/dist/admin/src/router.d.ts +1 -1
  242. package/dist/admin/src/services/api.d.ts +1 -1
  243. package/dist/admin/src/services/components.d.ts +2 -2
  244. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  245. package/dist/admin/src/services/documents.d.ts +16 -19
  246. package/dist/admin/src/services/init.d.ts +1 -1
  247. package/dist/admin/src/services/relations.d.ts +2 -2
  248. package/dist/admin/src/services/uid.d.ts +3 -3
  249. package/dist/server/index.js +5472 -4157
  250. package/dist/server/index.js.map +1 -1
  251. package/dist/server/index.mjs +5457 -4139
  252. package/dist/server/index.mjs.map +1 -1
  253. package/dist/server/src/bootstrap.d.ts.map +1 -1
  254. package/dist/server/src/controllers/index.d.ts.map +1 -1
  255. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  256. package/dist/server/src/controllers/utils/metadata.d.ts +17 -2
  257. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  258. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  259. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  260. package/dist/server/src/history/services/history.d.ts +3 -3
  261. package/dist/server/src/history/services/history.d.ts.map +1 -1
  262. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  263. package/dist/server/src/history/services/utils.d.ts +6 -11
  264. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  265. package/dist/server/src/index.d.ts +7 -6
  266. package/dist/server/src/index.d.ts.map +1 -1
  267. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  268. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  269. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  270. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  271. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  272. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  273. package/dist/server/src/preview/index.d.ts +4 -0
  274. package/dist/server/src/preview/index.d.ts.map +1 -0
  275. package/dist/server/src/preview/routes/index.d.ts +8 -0
  276. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  277. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  278. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  279. package/dist/server/src/preview/services/index.d.ts +16 -0
  280. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  281. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  282. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  283. package/dist/server/src/preview/services/preview.d.ts +12 -0
  284. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  285. package/dist/server/src/preview/utils.d.ts +19 -0
  286. package/dist/server/src/preview/utils.d.ts.map +1 -0
  287. package/dist/server/src/register.d.ts.map +1 -1
  288. package/dist/server/src/routes/index.d.ts.map +1 -1
  289. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  290. package/dist/server/src/services/document-metadata.d.ts +12 -10
  291. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  292. package/dist/server/src/services/index.d.ts +7 -6
  293. package/dist/server/src/services/index.d.ts.map +1 -1
  294. package/dist/server/src/services/utils/count.d.ts +1 -1
  295. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  296. package/dist/server/src/services/utils/populate.d.ts +3 -3
  297. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  298. package/dist/server/src/utils/index.d.ts +2 -0
  299. package/dist/server/src/utils/index.d.ts.map +1 -1
  300. package/dist/shared/contracts/collection-types.d.ts +0 -1
  301. package/dist/shared/contracts/components.d.ts +0 -1
  302. package/dist/shared/contracts/content-types.d.ts +0 -1
  303. package/dist/shared/contracts/history-versions.d.ts +0 -1
  304. package/dist/shared/contracts/index.d.ts +1 -1
  305. package/dist/shared/contracts/index.d.ts.map +1 -1
  306. package/dist/shared/contracts/init.d.ts +0 -1
  307. package/dist/shared/contracts/preview.d.ts +26 -0
  308. package/dist/shared/contracts/preview.d.ts.map +1 -0
  309. package/dist/shared/contracts/relations.d.ts +1 -2
  310. package/dist/shared/contracts/relations.d.ts.map +1 -1
  311. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  312. package/dist/shared/contracts/single-types.d.ts +0 -1
  313. package/dist/shared/contracts/uid.d.ts +0 -1
  314. package/dist/shared/index.d.ts +0 -1
  315. package/dist/shared/index.js +37 -22
  316. package/dist/shared/index.js.map +1 -1
  317. package/dist/shared/index.mjs +36 -23
  318. package/dist/shared/index.mjs.map +1 -1
  319. package/package.json +20 -16
  320. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  321. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  322. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  323. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  324. package/dist/_chunks/ComponentConfigurationPage-DfFSZQxe.mjs +0 -236
  325. package/dist/_chunks/ComponentConfigurationPage-DfFSZQxe.mjs.map +0 -1
  326. package/dist/_chunks/ComponentConfigurationPage-FqfsxQ1j.js +0 -255
  327. package/dist/_chunks/ComponentConfigurationPage-FqfsxQ1j.js.map +0 -1
  328. package/dist/_chunks/ComponentIcon-BXdiCGQp.js +0 -176
  329. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +0 -1
  330. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  331. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  332. package/dist/_chunks/EditConfigurationPage-Cn0e8t3I.js +0 -151
  333. package/dist/_chunks/EditConfigurationPage-Cn0e8t3I.js.map +0 -1
  334. package/dist/_chunks/EditConfigurationPage-DdPNAbl3.mjs +0 -132
  335. package/dist/_chunks/EditConfigurationPage-DdPNAbl3.mjs.map +0 -1
  336. package/dist/_chunks/EditViewPage-B82x_x1b.mjs +0 -224
  337. package/dist/_chunks/EditViewPage-B82x_x1b.mjs.map +0 -1
  338. package/dist/_chunks/EditViewPage-DlxEHhUt.js +0 -243
  339. package/dist/_chunks/EditViewPage-DlxEHhUt.js.map +0 -1
  340. package/dist/_chunks/Field-COL25JiC.js +0 -5595
  341. package/dist/_chunks/Field-COL25JiC.js.map +0 -1
  342. package/dist/_chunks/Field-DufHXW17.mjs +0 -5563
  343. package/dist/_chunks/Field-DufHXW17.mjs.map +0 -1
  344. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  345. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  346. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  347. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  348. package/dist/_chunks/Form-BssUwrTO.js +0 -779
  349. package/dist/_chunks/Form-BssUwrTO.js.map +0 -1
  350. package/dist/_chunks/Form-u_kAOhwB.mjs +0 -758
  351. package/dist/_chunks/Form-u_kAOhwB.mjs.map +0 -1
  352. package/dist/_chunks/History-C9t9UqpO.js +0 -1066
  353. package/dist/_chunks/History-C9t9UqpO.js.map +0 -1
  354. package/dist/_chunks/History-DRwA3oMM.mjs +0 -1045
  355. package/dist/_chunks/History-DRwA3oMM.mjs.map +0 -1
  356. package/dist/_chunks/ListConfigurationPage-BXYPohh-.js +0 -652
  357. package/dist/_chunks/ListConfigurationPage-BXYPohh-.js.map +0 -1
  358. package/dist/_chunks/ListConfigurationPage-BxfQJzPk.mjs +0 -632
  359. package/dist/_chunks/ListConfigurationPage-BxfQJzPk.mjs.map +0 -1
  360. package/dist/_chunks/ListViewPage-CELx2ysp.mjs +0 -828
  361. package/dist/_chunks/ListViewPage-CELx2ysp.mjs.map +0 -1
  362. package/dist/_chunks/ListViewPage-D2VD8Szg.js +0 -852
  363. package/dist/_chunks/ListViewPage-D2VD8Szg.js.map +0 -1
  364. package/dist/_chunks/NoContentTypePage-BV9IjJSM.js +0 -51
  365. package/dist/_chunks/NoContentTypePage-BV9IjJSM.js.map +0 -1
  366. package/dist/_chunks/NoContentTypePage-DtJ9jcfk.mjs +0 -51
  367. package/dist/_chunks/NoContentTypePage-DtJ9jcfk.mjs.map +0 -1
  368. package/dist/_chunks/NoPermissionsPage-DWleVYK7.mjs +0 -23
  369. package/dist/_chunks/NoPermissionsPage-DWleVYK7.mjs.map +0 -1
  370. package/dist/_chunks/NoPermissionsPage-Dp8NpF9I.js +0 -23
  371. package/dist/_chunks/NoPermissionsPage-Dp8NpF9I.js.map +0 -1
  372. package/dist/_chunks/Relations-BTcf5xaw.mjs +0 -703
  373. package/dist/_chunks/Relations-BTcf5xaw.mjs.map +0 -1
  374. package/dist/_chunks/Relations-DR7EUgyC.js +0 -723
  375. package/dist/_chunks/Relations-DR7EUgyC.js.map +0 -1
  376. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  377. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  378. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  379. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  380. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  381. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  382. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  383. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  384. package/dist/_chunks/de-CCEmbAah.js +0 -199
  385. package/dist/_chunks/en-Bm0D0IWz.js +0 -293
  386. package/dist/_chunks/en-DKV44jRb.mjs +0 -293
  387. package/dist/_chunks/es-CeXiYflN.mjs +0 -196
  388. package/dist/_chunks/es-EUonQTon.js +0 -196
  389. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  390. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  391. package/dist/_chunks/fr-B7kGGg3E.js +0 -206
  392. package/dist/_chunks/fr-B7kGGg3E.js.map +0 -1
  393. package/dist/_chunks/fr-CD9VFbPM.mjs +0 -206
  394. package/dist/_chunks/fr-CD9VFbPM.mjs.map +0 -1
  395. package/dist/_chunks/gu-BRmF601H.js +0 -200
  396. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  397. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  398. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  399. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  400. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  401. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  402. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  403. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  404. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  405. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  406. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  407. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  408. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  409. package/dist/_chunks/id-B5Ser98A.js +0 -160
  410. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  411. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  412. package/dist/_chunks/index-BdMf2lfT.js +0 -4109
  413. package/dist/_chunks/index-BdMf2lfT.js.map +0 -1
  414. package/dist/_chunks/index-wnqzm4Q8.mjs +0 -4090
  415. package/dist/_chunks/index-wnqzm4Q8.mjs.map +0 -1
  416. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  417. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  418. package/dist/_chunks/ja-CcFe8diO.js +0 -196
  419. package/dist/_chunks/ja-CtsUxOvk.mjs +0 -196
  420. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  421. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  422. package/dist/_chunks/layout-2CfjL0T9.mjs +0 -471
  423. package/dist/_chunks/layout-2CfjL0T9.mjs.map +0 -1
  424. package/dist/_chunks/layout-B2MyZU-_.js +0 -489
  425. package/dist/_chunks/layout-B2MyZU-_.js.map +0 -1
  426. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  427. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  428. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  429. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  430. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  431. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  432. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  433. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  434. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  435. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  436. package/dist/_chunks/objects-gigeqt7s.js +0 -49
  437. package/dist/_chunks/objects-gigeqt7s.js.map +0 -1
  438. package/dist/_chunks/objects-mKMAmfec.mjs +0 -47
  439. package/dist/_chunks/objects-mKMAmfec.mjs.map +0 -1
  440. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  441. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  442. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  443. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  444. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  445. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  446. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  447. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  448. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  449. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  450. package/dist/_chunks/relations-BH7JJGGe.js +0 -134
  451. package/dist/_chunks/relations-BH7JJGGe.js.map +0 -1
  452. package/dist/_chunks/relations-C0w0GcXi.mjs +0 -135
  453. package/dist/_chunks/relations-C0w0GcXi.mjs.map +0 -1
  454. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  455. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  456. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  457. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  458. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  459. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  460. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  461. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  462. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  463. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  464. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  465. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  466. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  467. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  468. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  469. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  470. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  471. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  472. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  473. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  474. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  475. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  476. package/dist/_chunks/useDebounce-CtcjDB3L.js +0 -28
  477. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +0 -1
  478. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +0 -29
  479. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +0 -1
  480. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs +0 -231
  481. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +0 -1
  482. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js +0 -249
  483. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +0 -1
  484. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  485. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  486. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  487. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  488. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  489. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  490. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  491. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
@@ -1,703 +0,0 @@
1
- import { jsxs, jsx } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { createContext, useQueryParams, useField, useNotification, useFocusInputField, useForm } from "@strapi/admin/strapi-admin";
4
- import { Flex, TextButton, Field, Combobox, ComboboxOption, Typography, VisuallyHidden, Box, useComposedRefs, IconButton, Tooltip, Link } 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-wnqzm4Q8.mjs";
14
- import { u as useDragAndDrop, I as ItemTypes, D as DROP_SENSITIVITY } from "./useDragAndDrop-DdHgKsqq.mjs";
15
- import { u as useGetRelationsQuery, g as getRelationLabel, a as useLazySearchRelationsQuery } from "./relations-C0w0GcXi.mjs";
16
- const [ComponentProvider, useComponent] = createContext("ComponentContext", {
17
- id: void 0,
18
- level: -1,
19
- uid: void 0,
20
- type: void 0
21
- });
22
- function useHandleDisconnect(fieldName, consumerName) {
23
- const field = useField(fieldName);
24
- const removeFieldRow = useForm(consumerName, (state) => state.removeFieldRow);
25
- const addFieldRow = useForm(consumerName, (state) => state.addFieldRow);
26
- const handleDisconnect = (relation) => {
27
- if (field.value && field.value.connect) {
28
- const indexOfRelationInConnectArray = field.value.connect.findIndex(
29
- (rel) => rel.id === relation.id
30
- );
31
- if (indexOfRelationInConnectArray >= 0) {
32
- removeFieldRow(`${fieldName}.connect`, indexOfRelationInConnectArray);
33
- return;
34
- }
35
- }
36
- addFieldRow(`${fieldName}.disconnect`, { id: relation.id });
37
- };
38
- return handleDisconnect;
39
- }
40
- const RELATIONS_TO_DISPLAY = 5;
41
- const ONE_WAY_RELATIONS = ["oneWay", "oneToOne", "manyToOne", "oneToManyMorph", "oneToOneMorph"];
42
- const RelationsField = React.forwardRef(
43
- ({ disabled, label, ...props }, ref) => {
44
- const [currentPage, setCurrentPage] = React.useState(1);
45
- const { document, model: documentModel } = useDoc();
46
- const documentId = document?.documentId;
47
- const { formatMessage } = useIntl();
48
- const [{ query }] = useQueryParams();
49
- const params = buildValidParams(query);
50
- const isMorph = props.attribute.relation.toLowerCase().includes("morph");
51
- const isDisabled = isMorph || disabled;
52
- const { id: componentId, uid } = useComponent("RelationsField", ({ uid: uid2, id: id2 }) => ({ id: id2, uid: uid2 }));
53
- const id = componentId ? componentId.toString() : documentId;
54
- const model = uid ?? documentModel;
55
- const [targetField] = props.name.split(".").slice(-1);
56
- const { data, isLoading, isFetching } = useGetRelationsQuery(
57
- {
58
- model,
59
- targetField,
60
- // below we don't run the query if there is no id.
61
- id,
62
- params: {
63
- ...params,
64
- pageSize: RELATIONS_TO_DISPLAY,
65
- page: currentPage
66
- }
67
- },
68
- {
69
- refetchOnMountOrArgChange: true,
70
- skip: !id,
71
- selectFromResult: (result) => {
72
- return {
73
- ...result,
74
- data: {
75
- ...result.data,
76
- results: result.data?.results ? result.data.results : []
77
- }
78
- };
79
- }
80
- }
81
- );
82
- const handleLoadMore = () => {
83
- setCurrentPage((prev) => prev + 1);
84
- };
85
- const field = useField(props.name);
86
- const isFetchingMoreRelations = isLoading || isFetching;
87
- const realServerRelationsCount = "pagination" in data && data.pagination ? data.pagination.total : 0;
88
- const relationsConnected = (field.value?.connect ?? []).filter(
89
- (rel) => data.results.findIndex((relation) => relation.id === rel.id) === -1
90
- ).length ?? 0;
91
- const relationsDisconnected = field.value?.disconnect?.length ?? 0;
92
- const relationsCount = realServerRelationsCount + relationsConnected - relationsDisconnected;
93
- const relations = React.useMemo(() => {
94
- const ctx = {
95
- field: field.value,
96
- // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
97
- href: `../${COLLECTION_TYPES}/${props.attribute.targetModel}`,
98
- mainField: props.mainField
99
- };
100
- const transformations = pipe(
101
- removeConnected(ctx),
102
- removeDisconnected(ctx),
103
- addLabelAndHref(ctx)
104
- );
105
- const transformedRels = transformations([...data.results]);
106
- return [...transformedRels, ...field.value?.connect ?? []].sort((a, b) => {
107
- if (a.__temp_key__ < b.__temp_key__)
108
- return -1;
109
- if (a.__temp_key__ > b.__temp_key__)
110
- return 1;
111
- return 0;
112
- });
113
- }, [
114
- data.results,
115
- field.value,
116
- // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
117
- props.attribute.targetModel,
118
- props.mainField
119
- ]);
120
- const handleDisconnect = useHandleDisconnect(props.name, "RelationsField");
121
- const handleConnect = (relation) => {
122
- const [lastItemInList] = relations.slice(-1);
123
- const item = {
124
- id: relation.id,
125
- status: relation.status,
126
- /**
127
- * If there's a last item, that's the first key we use to generate out next one.
128
- */
129
- __temp_key__: generateNKeysBetween(lastItemInList?.__temp_key__ ?? null, null, 1)[0],
130
- // Fallback to `id` if there is no `mainField` value, which will overwrite the above `id` property with the exact same data.
131
- [props.mainField?.name ?? "documentId"]: relation[props.mainField?.name ?? "documentId"],
132
- label: getRelationLabel(relation, props.mainField),
133
- // @ts-expect-error – targetModel does exist on the attribute, but it's not typed.
134
- href: `../${COLLECTION_TYPES}/${props.attribute.targetModel}/${relation.documentId}`
135
- };
136
- if (ONE_WAY_RELATIONS.includes(props.attribute.relation)) {
137
- field.value?.connect?.forEach(handleDisconnect);
138
- relations.forEach(handleDisconnect);
139
- field.onChange(`${props.name}.connect`, [item]);
140
- } else {
141
- field.onChange(`${props.name}.connect`, [...field.value?.connect ?? [], item]);
142
- }
143
- };
144
- return /* @__PURE__ */ jsxs(
145
- Flex,
146
- {
147
- ref,
148
- direction: "column",
149
- gap: 3,
150
- justifyContent: "space-between",
151
- alignItems: "stretch",
152
- wrap: "wrap",
153
- children: [
154
- /* @__PURE__ */ jsxs(StyledFlex, { direction: "column", alignItems: "start", gap: 2, width: "100%", children: [
155
- /* @__PURE__ */ jsx(
156
- RelationsInput,
157
- {
158
- disabled: isDisabled,
159
- id,
160
- label: `${label} ${relationsCount > 0 ? `(${relationsCount})` : ""}`,
161
- model,
162
- onChange: handleConnect,
163
- ...props
164
- }
165
- ),
166
- "pagination" in data && data.pagination && data.pagination.pageCount > data.pagination.page ? /* @__PURE__ */ jsx(
167
- TextButton,
168
- {
169
- disabled: isFetchingMoreRelations,
170
- onClick: handleLoadMore,
171
- loading: isFetchingMoreRelations,
172
- startIcon: /* @__PURE__ */ jsx(ArrowClockwise, {}),
173
- shrink: 0,
174
- children: formatMessage({
175
- id: getTranslation("relation.loadMore"),
176
- defaultMessage: "Load More"
177
- })
178
- }
179
- ) : null
180
- ] }),
181
- /* @__PURE__ */ jsx(
182
- RelationsList,
183
- {
184
- data: relations,
185
- serverData: data.results,
186
- disabled: isDisabled,
187
- name: props.name,
188
- isLoading: isFetchingMoreRelations,
189
- relationType: props.attribute.relation
190
- }
191
- )
192
- ]
193
- }
194
- );
195
- }
196
- );
197
- const StyledFlex = styled(Flex)`
198
- & > div {
199
- width: 100%;
200
- }
201
- `;
202
- const removeConnected = ({ field }) => (relations) => {
203
- return relations.filter((relation) => {
204
- const connectedRelations = field?.connect ?? [];
205
- return connectedRelations.findIndex((rel) => rel.id === relation.id) === -1;
206
- });
207
- };
208
- const removeDisconnected = ({ field }) => (relations) => relations.filter((relation) => {
209
- const disconnectedRelations = field?.disconnect ?? [];
210
- return disconnectedRelations.findIndex((rel) => rel.id === relation.id) === -1;
211
- });
212
- const addLabelAndHref = ({ mainField, href }) => (relations) => relations.map((relation) => {
213
- return {
214
- ...relation,
215
- // Fallback to `id` if there is no `mainField` value, which will overwrite the above `documentId` property with the exact same data.
216
- [mainField?.name ?? "documentId"]: relation[mainField?.name ?? "documentId"],
217
- label: getRelationLabel(relation, mainField),
218
- href: `${href}/${relation.documentId}`
219
- };
220
- });
221
- const RelationsInput = ({
222
- hint,
223
- id,
224
- model,
225
- label,
226
- labelAction,
227
- name,
228
- mainField,
229
- placeholder,
230
- required,
231
- unique: _unique,
232
- "aria-label": _ariaLabel,
233
- onChange,
234
- ...props
235
- }) => {
236
- const [textValue, setTextValue] = React.useState("");
237
- const [searchParams, setSearchParams] = React.useState({
238
- _q: "",
239
- page: 1
240
- });
241
- const { toggleNotification } = useNotification();
242
- const [{ query }] = useQueryParams();
243
- const { formatMessage } = useIntl();
244
- const fieldRef = useFocusInputField(name);
245
- const field = useField(name);
246
- const [searchForTrigger, { data, isLoading }] = useLazySearchRelationsQuery();
247
- React.useEffect(() => {
248
- const [targetField] = name.split(".").slice(-1);
249
- searchForTrigger({
250
- model,
251
- targetField,
252
- params: {
253
- ...buildValidParams(query),
254
- id: id ?? "",
255
- pageSize: 10,
256
- idsToInclude: field.value?.disconnect?.map((rel) => rel.id.toString()) ?? [],
257
- idsToOmit: field.value?.connect?.map((rel) => rel.id.toString()) ?? [],
258
- ...searchParams
259
- }
260
- });
261
- }, [
262
- field.value?.connect,
263
- field.value?.disconnect,
264
- id,
265
- model,
266
- name,
267
- query,
268
- searchForTrigger,
269
- searchParams
270
- ]);
271
- const handleSearch = async (search) => {
272
- setSearchParams((s) => ({ ...s, _q: search, page: 1 }));
273
- };
274
- const hasNextPage = data?.pagination ? data.pagination.page < data.pagination.pageCount : false;
275
- const options = data?.results ?? [];
276
- const handleChange = (relationId) => {
277
- if (!relationId) {
278
- return;
279
- }
280
- const relation = options.find((opt) => opt.id.toString() === relationId);
281
- if (!relation) {
282
- console.error(
283
- "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."
284
- );
285
- toggleNotification({
286
- message: formatMessage({
287
- id: getTranslation("relation.error-adding-relation"),
288
- defaultMessage: "An error occurred while trying to add the relation."
289
- }),
290
- type: "danger"
291
- });
292
- return;
293
- }
294
- onChange(relation);
295
- };
296
- const handleLoadMore = () => {
297
- if (!data || !data.pagination) {
298
- return;
299
- } else if (data.pagination.page < data.pagination.pageCount) {
300
- setSearchParams((s) => ({ ...s, page: s.page + 1 }));
301
- }
302
- };
303
- React.useLayoutEffect(() => {
304
- setTextValue("");
305
- }, [field.value]);
306
- return /* @__PURE__ */ jsxs(Field.Root, { error: field.error, hint, name, required, children: [
307
- /* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
308
- /* @__PURE__ */ jsx(
309
- Combobox,
310
- {
311
- ref: fieldRef,
312
- name,
313
- autocomplete: "list",
314
- placeholder: placeholder || formatMessage({
315
- id: getTranslation("relation.add"),
316
- defaultMessage: "Add relation"
317
- }),
318
- hasMoreItems: hasNextPage,
319
- loading: isLoading,
320
- onOpenChange: () => {
321
- handleSearch(textValue ?? "");
322
- },
323
- noOptionsMessage: () => formatMessage({
324
- id: getTranslation("relation.notAvailable"),
325
- defaultMessage: "No relations available"
326
- }),
327
- loadingMessage: formatMessage({
328
- id: getTranslation("relation.isLoading"),
329
- defaultMessage: "Relations are loading"
330
- }),
331
- onLoadMore: handleLoadMore,
332
- textValue,
333
- onChange: handleChange,
334
- onTextValueChange: (text) => {
335
- setTextValue(text);
336
- },
337
- onInputChange: (event) => {
338
- handleSearch(event.currentTarget.value);
339
- },
340
- ...props,
341
- children: options.map((opt) => {
342
- const textValue2 = getRelationLabel(opt, mainField);
343
- return /* @__PURE__ */ jsx(ComboboxOption, { value: opt.id.toString(), textValue: textValue2, children: /* @__PURE__ */ jsxs(Flex, { gap: 2, justifyContent: "space-between", children: [
344
- /* @__PURE__ */ jsx(Typography, { ellipsis: true, children: textValue2 }),
345
- opt.status ? /* @__PURE__ */ jsx(DocumentStatus, { status: opt.status }) : null
346
- ] }) }, opt.id);
347
- })
348
- }
349
- ),
350
- /* @__PURE__ */ jsx(Field.Error, {}),
351
- /* @__PURE__ */ jsx(Field.Hint, {})
352
- ] });
353
- };
354
- const RELATION_ITEM_HEIGHT = 50;
355
- const RELATION_GUTTER = 4;
356
- const RelationsList = ({
357
- data,
358
- serverData,
359
- disabled,
360
- name,
361
- isLoading,
362
- relationType
363
- }) => {
364
- const ariaDescriptionId = React.useId();
365
- const { formatMessage } = useIntl();
366
- const listRef = React.useRef(null);
367
- const outerListRef = React.useRef(null);
368
- const [overflow, setOverflow] = React.useState();
369
- const [liveText, setLiveText] = React.useState("");
370
- const field = useField(name);
371
- React.useEffect(() => {
372
- if (data.length <= RELATIONS_TO_DISPLAY) {
373
- return setOverflow(void 0);
374
- }
375
- const handleNativeScroll = (e) => {
376
- const el = e.target;
377
- const parentScrollContainerHeight = el.parentNode.scrollHeight;
378
- const maxScrollBottom = el.scrollHeight - el.scrollTop;
379
- if (el.scrollTop === 0) {
380
- return setOverflow("bottom");
381
- }
382
- if (maxScrollBottom === parentScrollContainerHeight) {
383
- return setOverflow("top");
384
- }
385
- return setOverflow("top-bottom");
386
- };
387
- const outerListRefCurrent = outerListRef?.current;
388
- if (!isLoading && data.length > 0 && outerListRefCurrent) {
389
- outerListRef.current.addEventListener("scroll", handleNativeScroll);
390
- }
391
- return () => {
392
- if (outerListRefCurrent) {
393
- outerListRefCurrent.removeEventListener("scroll", handleNativeScroll);
394
- }
395
- };
396
- }, [isLoading, data.length]);
397
- const getItemPos = (index) => `${index + 1} of ${data.length}`;
398
- const handleMoveItem = (newIndex, oldIndex) => {
399
- const item = data[oldIndex];
400
- setLiveText(
401
- formatMessage(
402
- {
403
- id: getTranslation("dnd.reorder"),
404
- defaultMessage: "{item}, moved. New position in list: {position}."
405
- },
406
- {
407
- item: item.label ?? item.documentId,
408
- position: getItemPos(newIndex)
409
- }
410
- )
411
- );
412
- const newData = [...data];
413
- const currentRow = data[oldIndex];
414
- const startKey = oldIndex > newIndex ? newData[newIndex - 1]?.__temp_key__ : newData[newIndex]?.__temp_key__;
415
- const endKey = oldIndex > newIndex ? newData[newIndex]?.__temp_key__ : newData[newIndex + 1]?.__temp_key__;
416
- const [newKey] = generateNKeysBetween(startKey, endKey, 1);
417
- newData.splice(oldIndex, 1);
418
- newData.splice(newIndex, 0, { ...currentRow, __temp_key__: newKey });
419
- const connectedRelations = newData.reduce((acc, relation, currentIndex, array) => {
420
- const relationOnServer = serverData.find(
421
- (oldRelation) => oldRelation.documentId === relation.documentId
422
- );
423
- const relationInFront = array[currentIndex + 1];
424
- if (!relationOnServer || relationOnServer.__temp_key__ !== relation.__temp_key__) {
425
- const position = relationInFront ? {
426
- before: relationInFront.documentId,
427
- locale: relationInFront.locale,
428
- status: relationInFront.status
429
- } : { end: true };
430
- const relationWithPosition = { ...relation, position };
431
- return [...acc, relationWithPosition];
432
- }
433
- return acc;
434
- }, []).toReversed();
435
- field.onChange(`${name}.connect`, connectedRelations);
436
- };
437
- const handleGrabItem = (index) => {
438
- const item = data[index];
439
- setLiveText(
440
- formatMessage(
441
- {
442
- id: getTranslation("dnd.grab-item"),
443
- defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`
444
- },
445
- {
446
- item: item.label ?? item.documentId,
447
- position: getItemPos(index)
448
- }
449
- )
450
- );
451
- };
452
- const handleDropItem = (index) => {
453
- const { href: _href, label, ...item } = data[index];
454
- setLiveText(
455
- formatMessage(
456
- {
457
- id: getTranslation("dnd.drop-item"),
458
- defaultMessage: `{item}, dropped. Final position in list: {position}.`
459
- },
460
- {
461
- item: label ?? item.documentId,
462
- position: getItemPos(index)
463
- }
464
- )
465
- );
466
- };
467
- const handleCancel = (index) => {
468
- const item = data[index];
469
- setLiveText(
470
- formatMessage(
471
- {
472
- id: getTranslation("dnd.cancel-item"),
473
- defaultMessage: "{item}, dropped. Re-order cancelled."
474
- },
475
- {
476
- item: item.label ?? item.documentId
477
- }
478
- )
479
- );
480
- };
481
- const handleDisconnect = useHandleDisconnect(name, "RelationsList");
482
- const canReorder = !ONE_WAY_RELATIONS.includes(relationType);
483
- 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);
484
- return /* @__PURE__ */ jsxs(ShadowBox, { $overflowDirection: overflow, children: [
485
- /* @__PURE__ */ jsx(VisuallyHidden, { id: ariaDescriptionId, children: formatMessage({
486
- id: getTranslation("dnd.instructions"),
487
- defaultMessage: `Press spacebar to grab and re-order`
488
- }) }),
489
- /* @__PURE__ */ jsx(VisuallyHidden, { "aria-live": "assertive", children: liveText }),
490
- /* @__PURE__ */ jsx(
491
- FixedSizeList,
492
- {
493
- height: dynamicListHeight,
494
- ref: listRef,
495
- outerRef: outerListRef,
496
- itemCount: data.length,
497
- itemSize: RELATION_ITEM_HEIGHT + RELATION_GUTTER,
498
- itemData: {
499
- ariaDescribedBy: ariaDescriptionId,
500
- canDrag: canReorder,
501
- disabled,
502
- handleCancel,
503
- handleDropItem,
504
- handleGrabItem,
505
- handleMoveItem,
506
- name,
507
- handleDisconnect,
508
- relations: data
509
- },
510
- itemKey: (index) => data[index].id,
511
- innerElementType: "ol",
512
- children: ListItem
513
- }
514
- )
515
- ] });
516
- };
517
- const ShadowBox = styled(Box)`
518
- position: relative;
519
- overflow: hidden;
520
- flex: 1;
521
-
522
- &:before,
523
- &:after {
524
- position: absolute;
525
- width: 100%;
526
- height: 4px;
527
- z-index: 1;
528
- }
529
-
530
- &:before {
531
- /* TODO: as for DS Table component we would need this to be handled by the DS theme */
532
- content: '';
533
- background: linear-gradient(rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
534
- top: 0;
535
- opacity: ${({ $overflowDirection }) => $overflowDirection === "top-bottom" || $overflowDirection === "top" ? 1 : 0};
536
- transition: opacity 0.2s ease-in-out;
537
- }
538
-
539
- &:after {
540
- /* TODO: as for DS Table component we would need this to be handled by the DS theme */
541
- content: '';
542
- background: linear-gradient(0deg, rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
543
- bottom: 0;
544
- opacity: ${({ $overflowDirection }) => $overflowDirection === "top-bottom" || $overflowDirection === "bottom" ? 1 : 0};
545
- transition: opacity 0.2s ease-in-out;
546
- }
547
- `;
548
- const ListItem = ({ data, index, style }) => {
549
- const {
550
- ariaDescribedBy,
551
- canDrag = false,
552
- disabled = false,
553
- handleCancel,
554
- handleDisconnect,
555
- handleDropItem,
556
- handleGrabItem,
557
- handleMoveItem,
558
- name,
559
- relations
560
- } = data;
561
- const { formatMessage } = useIntl();
562
- const { href, documentId, label, status } = relations[index];
563
- const [{ handlerId, isDragging, handleKeyDown }, relationRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop(
564
- canDrag && !disabled,
565
- {
566
- type: `${ItemTypes.RELATION}_${name}`,
567
- index,
568
- item: {
569
- displayedValue: label,
570
- status,
571
- id: documentId,
572
- index
573
- },
574
- onMoveItem: handleMoveItem,
575
- onDropItem: handleDropItem,
576
- onGrabItem: handleGrabItem,
577
- onCancel: handleCancel,
578
- dropSensitivity: DROP_SENSITIVITY.REGULAR
579
- }
580
- );
581
- const composedRefs = useComposedRefs(relationRef, dragRef);
582
- React.useEffect(() => {
583
- dragPreviewRef(getEmptyImage());
584
- }, [dragPreviewRef]);
585
- return /* @__PURE__ */ jsx(
586
- Box,
587
- {
588
- style,
589
- tag: "li",
590
- ref: dropRef,
591
- "aria-describedby": ariaDescribedBy,
592
- cursor: canDrag ? "all-scroll" : "default",
593
- children: isDragging ? /* @__PURE__ */ jsx(RelationItemPlaceholder, {}) : /* @__PURE__ */ jsxs(
594
- Flex,
595
- {
596
- paddingTop: 2,
597
- paddingBottom: 2,
598
- paddingLeft: canDrag ? 2 : 4,
599
- paddingRight: 4,
600
- hasRadius: true,
601
- borderColor: "neutral200",
602
- background: disabled ? "neutral150" : "neutral0",
603
- justifyContent: "space-between",
604
- ref: composedRefs,
605
- "data-handler-id": handlerId,
606
- children: [
607
- /* @__PURE__ */ jsxs(FlexWrapper, { gap: 1, children: [
608
- canDrag ? /* @__PURE__ */ jsx(
609
- IconButton,
610
- {
611
- tag: "div",
612
- role: "button",
613
- tabIndex: 0,
614
- withTooltip: false,
615
- label: formatMessage({
616
- id: getTranslation("components.RelationInput.icon-button-aria-label"),
617
- defaultMessage: "Drag"
618
- }),
619
- variant: "ghost",
620
- onKeyDown: handleKeyDown,
621
- disabled,
622
- children: /* @__PURE__ */ jsx(Drag, {})
623
- }
624
- ) : null,
625
- /* @__PURE__ */ jsxs(Flex, { width: "100%", minWidth: 0, justifyContent: "space-between", children: [
626
- /* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { description: label, children: href ? /* @__PURE__ */ jsx(LinkEllipsis, { tag: NavLink, to: href, isExternal: false, children: label }) : /* @__PURE__ */ jsx(Typography, { textColor: disabled ? "neutral600" : "primary600", ellipsis: true, children: label }) }) }),
627
- status ? /* @__PURE__ */ jsx(DocumentStatus, { status }) : null
628
- ] })
629
- ] }),
630
- /* @__PURE__ */ jsx(Box, { paddingLeft: 4, children: /* @__PURE__ */ jsx(
631
- IconButton,
632
- {
633
- onClick: () => handleDisconnect(relations[index]),
634
- disabled,
635
- label: formatMessage({
636
- id: getTranslation("relation.disconnect"),
637
- defaultMessage: "Remove"
638
- }),
639
- variant: "ghost",
640
- size: "S",
641
- children: /* @__PURE__ */ jsx(Cross, {})
642
- }
643
- ) })
644
- ]
645
- }
646
- )
647
- }
648
- );
649
- };
650
- const FlexWrapper = styled(Flex)`
651
- width: 100%;
652
- /* Used to prevent endAction to be pushed out of container */
653
- min-width: 0;
654
-
655
- & > div[role='button'] {
656
- cursor: all-scroll;
657
- }
658
- `;
659
- const DisconnectButton = styled.button`
660
- svg path {
661
- fill: ${({ theme, disabled }) => disabled ? theme.colors.neutral600 : theme.colors.neutral500};
662
- }
663
-
664
- &:hover svg path,
665
- &:focus svg path {
666
- fill: ${({ theme, disabled }) => !disabled && theme.colors.neutral600};
667
- }
668
- `;
669
- const LinkEllipsis = styled(Link)`
670
- display: block;
671
-
672
- & > span {
673
- white-space: nowrap;
674
- overflow: hidden;
675
- text-overflow: ellipsis;
676
- display: block;
677
- }
678
- `;
679
- const RelationItemPlaceholder = () => /* @__PURE__ */ jsx(
680
- Box,
681
- {
682
- paddingTop: 2,
683
- paddingBottom: 2,
684
- paddingLeft: 4,
685
- paddingRight: 4,
686
- hasRadius: true,
687
- borderStyle: "dashed",
688
- borderColor: "primary600",
689
- borderWidth: "1px",
690
- background: "primary100",
691
- height: `calc(100% - ${RELATION_GUTTER}px)`
692
- }
693
- );
694
- const MemoizedRelationsField = React.memo(RelationsField);
695
- export {
696
- ComponentProvider as C,
697
- DisconnectButton as D,
698
- FlexWrapper as F,
699
- LinkEllipsis as L,
700
- MemoizedRelationsField as M,
701
- useComponent as u
702
- };
703
- //# sourceMappingURL=Relations-BTcf5xaw.mjs.map