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

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