@strapi/content-manager 0.0.0-experimental.d1602f22dc638a4c3c5084965fd6126fff5e9d4f → 0.0.0-experimental.d325780feab1caf1b9e4423588eb1cc73b74c376

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