@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,750 @@
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-CwbxJQVl.js");
15
+ const useDragAndDrop = require("./useDragAndDrop-BMtgCYzL.js");
16
+ const relations = require("./relations-B6L5kXX8.js");
17
+ const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
18
+ function _interopNamespace(e) {
19
+ if (e && e.__esModule) return e;
20
+ const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
21
+ if (e) {
22
+ for (const k in e) {
23
+ if (k !== "default") {
24
+ const d = Object.getOwnPropertyDescriptor(e, k);
25
+ Object.defineProperty(n, k, d.get ? d : {
26
+ enumerable: true,
27
+ get: () => e[k]
28
+ });
29
+ }
30
+ }
31
+ }
32
+ n.default = e;
33
+ return Object.freeze(n);
34
+ }
35
+ const React__namespace = /* @__PURE__ */ _interopNamespace(React);
36
+ const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
37
+ const [ComponentProvider, useComponent] = strapiAdmin.createContext("ComponentContext", {
38
+ id: void 0,
39
+ level: -1,
40
+ uid: void 0,
41
+ type: void 0
42
+ });
43
+ function useHandleDisconnect(fieldName, consumerName) {
44
+ const field = strapiAdmin.useField(fieldName);
45
+ const removeFieldRow = strapiAdmin.useForm(consumerName, (state) => state.removeFieldRow);
46
+ const addFieldRow = strapiAdmin.useForm(consumerName, (state) => state.addFieldRow);
47
+ const handleDisconnect = (relation) => {
48
+ if (field.value && field.value.connect) {
49
+ const indexOfRelationInConnectArray = field.value.connect.findIndex(
50
+ (rel) => rel.id === relation.id
51
+ );
52
+ if (indexOfRelationInConnectArray >= 0) {
53
+ removeFieldRow(`${fieldName}.connect`, indexOfRelationInConnectArray);
54
+ return;
55
+ }
56
+ }
57
+ addFieldRow(`${fieldName}.disconnect`, {
58
+ id: relation.id,
59
+ apiData: {
60
+ id: relation.id,
61
+ documentId: relation.documentId,
62
+ locale: relation.locale
63
+ }
64
+ });
65
+ };
66
+ return handleDisconnect;
67
+ }
68
+ const RELATIONS_TO_DISPLAY = 5;
69
+ const ONE_WAY_RELATIONS = ["oneWay", "oneToOne", "manyToOne", "oneToManyMorph", "oneToOneMorph"];
70
+ const RelationsField = React__namespace.forwardRef(
71
+ ({ disabled, label, ...props }, ref) => {
72
+ const [currentPage, setCurrentPage] = React__namespace.useState(1);
73
+ const { document, model: documentModel } = index.useDoc();
74
+ const documentId = document?.documentId;
75
+ const { formatMessage } = reactIntl.useIntl();
76
+ const [{ query }] = strapiAdmin.useQueryParams();
77
+ const params = index.buildValidParams(query);
78
+ const isMorph = props.attribute.relation.toLowerCase().includes("morph");
79
+ const isDisabled = isMorph || disabled;
80
+ const { componentId, componentUID } = useComponent("RelationsField", ({ uid, id: id2 }) => ({
81
+ componentId: id2,
82
+ componentUID: uid
83
+ }));
84
+ const isSubmitting = strapiAdmin.useForm("RelationsList", (state) => state.isSubmitting);
85
+ React__namespace.useEffect(() => {
86
+ setCurrentPage(1);
87
+ }, [isSubmitting]);
88
+ const id = componentId ? componentId.toString() : documentId;
89
+ const model = componentUID ?? documentModel;
90
+ const [targetField] = props.name.split(".").slice(-1);
91
+ const { data, isLoading, isFetching } = relations.useGetRelationsQuery(
92
+ {
93
+ model,
94
+ targetField,
95
+ // below we don't run the query if there is no id.
96
+ id,
97
+ params: {
98
+ ...params,
99
+ pageSize: RELATIONS_TO_DISPLAY,
100
+ page: currentPage
101
+ }
102
+ },
103
+ {
104
+ refetchOnMountOrArgChange: true,
105
+ skip: !id,
106
+ selectFromResult: (result) => {
107
+ return {
108
+ ...result,
109
+ data: {
110
+ ...result.data,
111
+ results: result.data?.results ? result.data.results : []
112
+ }
113
+ };
114
+ }
115
+ }
116
+ );
117
+ const handleLoadMore = () => {
118
+ setCurrentPage((prev) => prev + 1);
119
+ };
120
+ const field = strapiAdmin.useField(props.name);
121
+ const isFetchingMoreRelations = isLoading || isFetching;
122
+ const realServerRelationsCount = "pagination" in data && data.pagination ? data.pagination.total : 0;
123
+ const relationsConnected = (field.value?.connect ?? []).filter(
124
+ (rel) => data.results.findIndex((relation) => relation.id === rel.id) === -1
125
+ ).length ?? 0;
126
+ const relationsDisconnected = field.value?.disconnect?.length ?? 0;
127
+ const relationsCount = realServerRelationsCount + relationsConnected - relationsDisconnected;
128
+ const relations$1 = React__namespace.useMemo(() => {
129
+ const ctx = {
130
+ field: field.value,
131
+ // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
132
+ href: `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}`,
133
+ mainField: props.mainField
134
+ };
135
+ const transformations = pipe__default.default(
136
+ removeConnected(ctx),
137
+ removeDisconnected(ctx),
138
+ addLabelAndHref(ctx)
139
+ );
140
+ const transformedRels = transformations([...data.results]);
141
+ return [...transformedRels, ...field.value?.connect ?? []].sort((a, b) => {
142
+ if (a.__temp_key__ < b.__temp_key__) return -1;
143
+ if (a.__temp_key__ > b.__temp_key__) return 1;
144
+ return 0;
145
+ });
146
+ }, [
147
+ data.results,
148
+ field.value,
149
+ // @ts-expect-error – targetModel does exist on the attribute. But it's not typed.
150
+ props.attribute.targetModel,
151
+ props.mainField
152
+ ]);
153
+ const handleDisconnect = useHandleDisconnect(props.name, "RelationsField");
154
+ const handleConnect = (relation) => {
155
+ const [lastItemInList] = relations$1.slice(-1);
156
+ const item = {
157
+ id: relation.id,
158
+ apiData: {
159
+ id: relation.id,
160
+ documentId: relation.documentId,
161
+ locale: relation.locale
162
+ },
163
+ status: relation.status,
164
+ /**
165
+ * If there's a last item, that's the first key we use to generate out next one.
166
+ */
167
+ __temp_key__: fractionalIndexing.generateNKeysBetween(lastItemInList?.__temp_key__ ?? null, null, 1)[0],
168
+ // Fallback to `id` if there is no `mainField` value, which will overwrite the above `id` property with the exact same data.
169
+ [props.mainField?.name ?? "documentId"]: relation[props.mainField?.name ?? "documentId"],
170
+ label: relations.getRelationLabel(relation, props.mainField),
171
+ // @ts-expect-error – targetModel does exist on the attribute, but it's not typed.
172
+ href: `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ""}`
173
+ };
174
+ if (ONE_WAY_RELATIONS.includes(props.attribute.relation)) {
175
+ field.value?.connect?.forEach(handleDisconnect);
176
+ relations$1.forEach(handleDisconnect);
177
+ field.onChange(`${props.name}.connect`, [item]);
178
+ } else {
179
+ field.onChange(`${props.name}.connect`, [...field.value?.connect ?? [], item]);
180
+ }
181
+ };
182
+ return /* @__PURE__ */ jsxRuntime.jsxs(
183
+ designSystem.Flex,
184
+ {
185
+ ref,
186
+ direction: "column",
187
+ gap: 3,
188
+ justifyContent: "space-between",
189
+ alignItems: "stretch",
190
+ wrap: "wrap",
191
+ children: [
192
+ /* @__PURE__ */ jsxRuntime.jsxs(StyledFlex, { direction: "column", alignItems: "start", gap: 2, width: "100%", children: [
193
+ /* @__PURE__ */ jsxRuntime.jsx(
194
+ RelationsInput,
195
+ {
196
+ disabled: isDisabled,
197
+ id: componentUID ? componentId ? `${componentId}` : "" : documentId,
198
+ label: `${label} ${relationsCount > 0 ? `(${relationsCount})` : ""}`,
199
+ model,
200
+ onChange: handleConnect,
201
+ ...props
202
+ }
203
+ ),
204
+ "pagination" in data && data.pagination && data.pagination.pageCount > data.pagination.page ? /* @__PURE__ */ jsxRuntime.jsx(
205
+ designSystem.TextButton,
206
+ {
207
+ disabled: isFetchingMoreRelations,
208
+ onClick: handleLoadMore,
209
+ loading: isFetchingMoreRelations,
210
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowClockwise, {}),
211
+ shrink: 0,
212
+ children: formatMessage({
213
+ id: index.getTranslation("relation.loadMore"),
214
+ defaultMessage: "Load More"
215
+ })
216
+ }
217
+ ) : null
218
+ ] }),
219
+ /* @__PURE__ */ jsxRuntime.jsx(
220
+ RelationsList,
221
+ {
222
+ data: relations$1,
223
+ serverData: data.results,
224
+ disabled: isDisabled,
225
+ name: props.name,
226
+ isLoading: isFetchingMoreRelations,
227
+ relationType: props.attribute.relation
228
+ }
229
+ )
230
+ ]
231
+ }
232
+ );
233
+ }
234
+ );
235
+ const StyledFlex = styledComponents.styled(designSystem.Flex)`
236
+ & > div {
237
+ width: 100%;
238
+ }
239
+ `;
240
+ const removeConnected = ({ field }) => (relations2) => {
241
+ return relations2.filter((relation) => {
242
+ const connectedRelations = field?.connect ?? [];
243
+ return connectedRelations.findIndex((rel) => rel.id === relation.id) === -1;
244
+ });
245
+ };
246
+ const removeDisconnected = ({ field }) => (relations2) => relations2.filter((relation) => {
247
+ const disconnectedRelations = field?.disconnect ?? [];
248
+ return disconnectedRelations.findIndex((rel) => rel.id === relation.id) === -1;
249
+ });
250
+ const addLabelAndHref = ({ mainField, href }) => (relations$1) => relations$1.map((relation) => {
251
+ return {
252
+ ...relation,
253
+ // Fallback to `id` if there is no `mainField` value, which will overwrite the above `documentId` property with the exact same data.
254
+ [mainField?.name ?? "documentId"]: relation[mainField?.name ?? "documentId"],
255
+ label: relations.getRelationLabel(relation, mainField),
256
+ href: `${href}/${relation.documentId}?${relation.locale ? `plugins[i18n][locale]=${relation.locale}` : ""}`
257
+ };
258
+ });
259
+ const RelationsInput = ({
260
+ hint,
261
+ id,
262
+ model,
263
+ label,
264
+ labelAction,
265
+ name,
266
+ mainField,
267
+ placeholder,
268
+ required,
269
+ unique: _unique,
270
+ "aria-label": _ariaLabel,
271
+ onChange,
272
+ ...props
273
+ }) => {
274
+ const [textValue, setTextValue] = React__namespace.useState("");
275
+ const [searchParams, setSearchParams] = React__namespace.useState({
276
+ _q: "",
277
+ page: 1
278
+ });
279
+ const { toggleNotification } = strapiAdmin.useNotification();
280
+ const [{ query }] = strapiAdmin.useQueryParams();
281
+ const { formatMessage } = reactIntl.useIntl();
282
+ const fieldRef = strapiAdmin.useFocusInputField(name);
283
+ const field = strapiAdmin.useField(name);
284
+ const [searchForTrigger, { data, isLoading }] = relations.useLazySearchRelationsQuery();
285
+ React__namespace.useEffect(() => {
286
+ const [targetField] = name.split(".").slice(-1);
287
+ const timeout = setTimeout(() => {
288
+ searchForTrigger({
289
+ model,
290
+ targetField,
291
+ params: {
292
+ ...index.buildValidParams(query),
293
+ id: id ?? "",
294
+ pageSize: 10,
295
+ idsToInclude: field.value?.disconnect?.map((rel) => rel.id.toString()) ?? [],
296
+ idsToOmit: field.value?.connect?.map((rel) => rel.id.toString()) ?? [],
297
+ ...searchParams
298
+ }
299
+ });
300
+ }, 300);
301
+ return () => clearTimeout(timeout);
302
+ }, [
303
+ field.value?.connect,
304
+ field.value?.disconnect,
305
+ id,
306
+ model,
307
+ name,
308
+ query,
309
+ searchForTrigger,
310
+ searchParams
311
+ ]);
312
+ const handleSearch = async (search) => {
313
+ setSearchParams((s) => ({ ...s, _q: search, page: 1 }));
314
+ };
315
+ const hasNextPage = data?.pagination ? data.pagination.page < data.pagination.pageCount : false;
316
+ const options = data?.results ?? [];
317
+ const handleChange = (relationId) => {
318
+ if (!relationId) {
319
+ return;
320
+ }
321
+ const relation = options.find((opt) => opt.id.toString() === relationId);
322
+ if (!relation) {
323
+ console.error(
324
+ "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."
325
+ );
326
+ toggleNotification({
327
+ message: formatMessage({
328
+ id: index.getTranslation("relation.error-adding-relation"),
329
+ defaultMessage: "An error occurred while trying to add the relation."
330
+ }),
331
+ type: "danger"
332
+ });
333
+ return;
334
+ }
335
+ onChange(relation);
336
+ };
337
+ const handleLoadMore = () => {
338
+ if (!data || !data.pagination) {
339
+ return;
340
+ } else if (data.pagination.page < data.pagination.pageCount) {
341
+ setSearchParams((s) => ({ ...s, page: s.page + 1 }));
342
+ }
343
+ };
344
+ React__namespace.useLayoutEffect(() => {
345
+ setTextValue("");
346
+ }, [field.value]);
347
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error: field.error, hint, name, required, children: [
348
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
349
+ /* @__PURE__ */ jsxRuntime.jsx(
350
+ designSystem.Combobox,
351
+ {
352
+ ref: fieldRef,
353
+ name,
354
+ autocomplete: "list",
355
+ placeholder: placeholder || formatMessage({
356
+ id: index.getTranslation("relation.add"),
357
+ defaultMessage: "Add relation"
358
+ }),
359
+ hasMoreItems: hasNextPage,
360
+ loading: isLoading,
361
+ onOpenChange: () => {
362
+ handleSearch(textValue ?? "");
363
+ },
364
+ noOptionsMessage: () => formatMessage({
365
+ id: index.getTranslation("relation.notAvailable"),
366
+ defaultMessage: "No relations available"
367
+ }),
368
+ loadingMessage: formatMessage({
369
+ id: index.getTranslation("relation.isLoading"),
370
+ defaultMessage: "Relations are loading"
371
+ }),
372
+ onLoadMore: handleLoadMore,
373
+ textValue,
374
+ onChange: handleChange,
375
+ onTextValueChange: (text) => {
376
+ setTextValue(text);
377
+ },
378
+ onInputChange: (event) => {
379
+ handleSearch(event.currentTarget.value);
380
+ },
381
+ ...props,
382
+ children: options.map((opt) => {
383
+ const textValue2 = relations.getRelationLabel(opt, mainField);
384
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: opt.id.toString(), textValue: textValue2, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, justifyContent: "space-between", children: [
385
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, children: textValue2 }),
386
+ opt.status ? /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: opt.status }) : null
387
+ ] }) }, opt.id);
388
+ })
389
+ }
390
+ ),
391
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {}),
392
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
393
+ ] });
394
+ };
395
+ const RELATION_ITEM_HEIGHT = 50;
396
+ const RELATION_GUTTER = 4;
397
+ const RelationsList = ({
398
+ data,
399
+ serverData,
400
+ disabled,
401
+ name,
402
+ isLoading,
403
+ relationType
404
+ }) => {
405
+ const ariaDescriptionId = React__namespace.useId();
406
+ const { formatMessage } = reactIntl.useIntl();
407
+ const listRef = React__namespace.useRef(null);
408
+ const outerListRef = React__namespace.useRef(null);
409
+ const [overflow, setOverflow] = React__namespace.useState();
410
+ const [liveText, setLiveText] = React__namespace.useState("");
411
+ const field = strapiAdmin.useField(name);
412
+ React__namespace.useEffect(() => {
413
+ if (data.length <= RELATIONS_TO_DISPLAY) {
414
+ return setOverflow(void 0);
415
+ }
416
+ const handleNativeScroll = (e) => {
417
+ const el = e.target;
418
+ const parentScrollContainerHeight = el.parentNode.scrollHeight;
419
+ const maxScrollBottom = el.scrollHeight - el.scrollTop;
420
+ if (el.scrollTop === 0) {
421
+ return setOverflow("bottom");
422
+ }
423
+ if (maxScrollBottom === parentScrollContainerHeight) {
424
+ return setOverflow("top");
425
+ }
426
+ return setOverflow("top-bottom");
427
+ };
428
+ const outerListRefCurrent = outerListRef?.current;
429
+ if (!isLoading && data.length > 0 && outerListRefCurrent) {
430
+ outerListRef.current.addEventListener("scroll", handleNativeScroll);
431
+ }
432
+ return () => {
433
+ if (outerListRefCurrent) {
434
+ outerListRefCurrent.removeEventListener("scroll", handleNativeScroll);
435
+ }
436
+ };
437
+ }, [isLoading, data.length]);
438
+ const getItemPos = (index2) => `${index2 + 1} of ${data.length}`;
439
+ const handleMoveItem = (newIndex, oldIndex) => {
440
+ const item = data[oldIndex];
441
+ setLiveText(
442
+ formatMessage(
443
+ {
444
+ id: index.getTranslation("dnd.reorder"),
445
+ defaultMessage: "{item}, moved. New position in list: {position}."
446
+ },
447
+ {
448
+ item: item.label ?? item.documentId,
449
+ position: getItemPos(newIndex)
450
+ }
451
+ )
452
+ );
453
+ const newData = [...data];
454
+ const currentRow = data[oldIndex];
455
+ const startKey = oldIndex > newIndex ? newData[newIndex - 1]?.__temp_key__ : newData[newIndex]?.__temp_key__;
456
+ const endKey = oldIndex > newIndex ? newData[newIndex]?.__temp_key__ : newData[newIndex + 1]?.__temp_key__;
457
+ const [newKey] = fractionalIndexing.generateNKeysBetween(startKey, endKey, 1);
458
+ newData.splice(oldIndex, 1);
459
+ newData.splice(newIndex, 0, { ...currentRow, __temp_key__: newKey });
460
+ const connectedRelations = newData.reduce((acc, relation, currentIndex, array) => {
461
+ const relationOnServer = serverData.find((oldRelation) => oldRelation.id === relation.id);
462
+ const relationInFront = array[currentIndex + 1];
463
+ if (!relationOnServer || relationOnServer.__temp_key__ !== relation.__temp_key__) {
464
+ const position = relationInFront ? {
465
+ before: relationInFront.documentId,
466
+ locale: relationInFront.locale,
467
+ status: "publishedAt" in relationInFront && relationInFront.publishedAt ? "published" : "draft"
468
+ } : { end: true };
469
+ const relationWithPosition = {
470
+ ...relation,
471
+ ...{
472
+ apiData: {
473
+ id: relation.id,
474
+ documentId: relation.documentId,
475
+ locale: relation.locale,
476
+ position
477
+ }
478
+ }
479
+ };
480
+ return [...acc, relationWithPosition];
481
+ }
482
+ return acc;
483
+ }, []).toReversed();
484
+ field.onChange(`${name}.connect`, connectedRelations);
485
+ };
486
+ const handleGrabItem = (index$1) => {
487
+ const item = data[index$1];
488
+ setLiveText(
489
+ formatMessage(
490
+ {
491
+ id: index.getTranslation("dnd.grab-item"),
492
+ defaultMessage: `{item}, grabbed. Current position in list: {position}. Press up and down arrow to change position, Spacebar to drop, Escape to cancel.`
493
+ },
494
+ {
495
+ item: item.label ?? item.documentId,
496
+ position: getItemPos(index$1)
497
+ }
498
+ )
499
+ );
500
+ };
501
+ const handleDropItem = (index$1) => {
502
+ const { href: _href, label, ...item } = data[index$1];
503
+ setLiveText(
504
+ formatMessage(
505
+ {
506
+ id: index.getTranslation("dnd.drop-item"),
507
+ defaultMessage: `{item}, dropped. Final position in list: {position}.`
508
+ },
509
+ {
510
+ item: label ?? item.documentId,
511
+ position: getItemPos(index$1)
512
+ }
513
+ )
514
+ );
515
+ };
516
+ const handleCancel = (index$1) => {
517
+ const item = data[index$1];
518
+ setLiveText(
519
+ formatMessage(
520
+ {
521
+ id: index.getTranslation("dnd.cancel-item"),
522
+ defaultMessage: "{item}, dropped. Re-order cancelled."
523
+ },
524
+ {
525
+ item: item.label ?? item.documentId
526
+ }
527
+ )
528
+ );
529
+ };
530
+ const handleDisconnect = useHandleDisconnect(name, "RelationsList");
531
+ const canReorder = !ONE_WAY_RELATIONS.includes(relationType);
532
+ 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);
533
+ return /* @__PURE__ */ jsxRuntime.jsxs(ShadowBox, { $overflowDirection: overflow, children: [
534
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { id: ariaDescriptionId, children: formatMessage({
535
+ id: index.getTranslation("dnd.instructions"),
536
+ defaultMessage: `Press spacebar to grab and re-order`
537
+ }) }),
538
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { "aria-live": "assertive", children: liveText }),
539
+ /* @__PURE__ */ jsxRuntime.jsx(
540
+ reactWindow.FixedSizeList,
541
+ {
542
+ height: dynamicListHeight,
543
+ ref: listRef,
544
+ outerRef: outerListRef,
545
+ itemCount: data.length,
546
+ itemSize: RELATION_ITEM_HEIGHT + RELATION_GUTTER,
547
+ itemData: {
548
+ ariaDescribedBy: ariaDescriptionId,
549
+ canDrag: canReorder,
550
+ disabled,
551
+ handleCancel,
552
+ handleDropItem,
553
+ handleGrabItem,
554
+ handleMoveItem,
555
+ name,
556
+ handleDisconnect,
557
+ relations: data
558
+ },
559
+ itemKey: (index2) => data[index2].id,
560
+ innerElementType: "ol",
561
+ children: ListItem
562
+ }
563
+ )
564
+ ] });
565
+ };
566
+ const ShadowBox = styledComponents.styled(designSystem.Box)`
567
+ position: relative;
568
+ overflow: hidden;
569
+ flex: 1;
570
+
571
+ &:before,
572
+ &:after {
573
+ position: absolute;
574
+ width: 100%;
575
+ height: 4px;
576
+ z-index: 1;
577
+ }
578
+
579
+ &:before {
580
+ /* TODO: as for DS Table component we would need this to be handled by the DS theme */
581
+ content: '';
582
+ background: linear-gradient(rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
583
+ top: 0;
584
+ opacity: ${({ $overflowDirection }) => $overflowDirection === "top-bottom" || $overflowDirection === "top" ? 1 : 0};
585
+ transition: opacity 0.2s ease-in-out;
586
+ }
587
+
588
+ &:after {
589
+ /* TODO: as for DS Table component we would need this to be handled by the DS theme */
590
+ content: '';
591
+ background: linear-gradient(0deg, rgba(3, 3, 5, 0.2) 0%, rgba(0, 0, 0, 0) 100%);
592
+ bottom: 0;
593
+ opacity: ${({ $overflowDirection }) => $overflowDirection === "top-bottom" || $overflowDirection === "bottom" ? 1 : 0};
594
+ transition: opacity 0.2s ease-in-out;
595
+ }
596
+ `;
597
+ const ListItem = ({ data, index: index$1, style }) => {
598
+ const {
599
+ ariaDescribedBy,
600
+ canDrag = false,
601
+ disabled = false,
602
+ handleCancel,
603
+ handleDisconnect,
604
+ handleDropItem,
605
+ handleGrabItem,
606
+ handleMoveItem,
607
+ name,
608
+ relations: relations2
609
+ } = data;
610
+ const { formatMessage } = reactIntl.useIntl();
611
+ const { href, id, label, status } = relations2[index$1];
612
+ const [{ handlerId, isDragging, handleKeyDown }, relationRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop.useDragAndDrop(
613
+ canDrag && !disabled,
614
+ {
615
+ type: `${useDragAndDrop.ItemTypes.RELATION}_${name}`,
616
+ index: index$1,
617
+ item: {
618
+ displayedValue: label,
619
+ status,
620
+ id,
621
+ index: index$1
622
+ },
623
+ onMoveItem: handleMoveItem,
624
+ onDropItem: handleDropItem,
625
+ onGrabItem: handleGrabItem,
626
+ onCancel: handleCancel,
627
+ dropSensitivity: useDragAndDrop.DROP_SENSITIVITY.REGULAR
628
+ }
629
+ );
630
+ const composedRefs = designSystem.useComposedRefs(relationRef, dragRef);
631
+ React__namespace.useEffect(() => {
632
+ dragPreviewRef(reactDndHtml5Backend.getEmptyImage());
633
+ }, [dragPreviewRef]);
634
+ return /* @__PURE__ */ jsxRuntime.jsx(
635
+ designSystem.Box,
636
+ {
637
+ style,
638
+ tag: "li",
639
+ ref: dropRef,
640
+ "aria-describedby": ariaDescribedBy,
641
+ cursor: canDrag ? "all-scroll" : "default",
642
+ children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(RelationItemPlaceholder, {}) : /* @__PURE__ */ jsxRuntime.jsxs(
643
+ designSystem.Flex,
644
+ {
645
+ paddingTop: 2,
646
+ paddingBottom: 2,
647
+ paddingLeft: canDrag ? 2 : 4,
648
+ paddingRight: 4,
649
+ hasRadius: true,
650
+ borderColor: "neutral200",
651
+ background: disabled ? "neutral150" : "neutral0",
652
+ justifyContent: "space-between",
653
+ ref: composedRefs,
654
+ "data-handler-id": handlerId,
655
+ children: [
656
+ /* @__PURE__ */ jsxRuntime.jsxs(FlexWrapper, { gap: 1, children: [
657
+ canDrag ? /* @__PURE__ */ jsxRuntime.jsx(
658
+ designSystem.IconButton,
659
+ {
660
+ tag: "div",
661
+ role: "button",
662
+ tabIndex: 0,
663
+ withTooltip: false,
664
+ label: formatMessage({
665
+ id: index.getTranslation("components.RelationInput.icon-button-aria-label"),
666
+ defaultMessage: "Drag"
667
+ }),
668
+ variant: "ghost",
669
+ onKeyDown: handleKeyDown,
670
+ disabled,
671
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, {})
672
+ }
673
+ ) : null,
674
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", minWidth: 0, justifyContent: "space-between", children: [
675
+ /* @__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 }) }) }),
676
+ status ? /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status }) : null
677
+ ] })
678
+ ] }),
679
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 4, children: /* @__PURE__ */ jsxRuntime.jsx(
680
+ designSystem.IconButton,
681
+ {
682
+ onClick: () => handleDisconnect(relations2[index$1]),
683
+ disabled,
684
+ label: formatMessage({
685
+ id: index.getTranslation("relation.disconnect"),
686
+ defaultMessage: "Remove"
687
+ }),
688
+ variant: "ghost",
689
+ size: "S",
690
+ children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cross, {})
691
+ }
692
+ ) })
693
+ ]
694
+ }
695
+ )
696
+ }
697
+ );
698
+ };
699
+ const FlexWrapper = styledComponents.styled(designSystem.Flex)`
700
+ width: 100%;
701
+ /* Used to prevent endAction to be pushed out of container */
702
+ min-width: 0;
703
+
704
+ & > div[role='button'] {
705
+ cursor: all-scroll;
706
+ }
707
+ `;
708
+ const DisconnectButton = styledComponents.styled.button`
709
+ svg path {
710
+ fill: ${({ theme, disabled }) => disabled ? theme.colors.neutral600 : theme.colors.neutral500};
711
+ }
712
+
713
+ &:hover svg path,
714
+ &:focus svg path {
715
+ fill: ${({ theme, disabled }) => !disabled && theme.colors.neutral600};
716
+ }
717
+ `;
718
+ const LinkEllipsis = styledComponents.styled(designSystem.Link)`
719
+ display: block;
720
+
721
+ & > span {
722
+ white-space: nowrap;
723
+ overflow: hidden;
724
+ text-overflow: ellipsis;
725
+ display: block;
726
+ }
727
+ `;
728
+ const RelationItemPlaceholder = () => /* @__PURE__ */ jsxRuntime.jsx(
729
+ designSystem.Box,
730
+ {
731
+ paddingTop: 2,
732
+ paddingBottom: 2,
733
+ paddingLeft: 4,
734
+ paddingRight: 4,
735
+ hasRadius: true,
736
+ borderStyle: "dashed",
737
+ borderColor: "primary600",
738
+ borderWidth: "1px",
739
+ background: "primary100",
740
+ height: `calc(100% - ${RELATION_GUTTER}px)`
741
+ }
742
+ );
743
+ const MemoizedRelationsField = React__namespace.memo(RelationsField);
744
+ exports.ComponentProvider = ComponentProvider;
745
+ exports.DisconnectButton = DisconnectButton;
746
+ exports.FlexWrapper = FlexWrapper;
747
+ exports.LinkEllipsis = LinkEllipsis;
748
+ exports.MemoizedRelationsField = MemoizedRelationsField;
749
+ exports.useComponent = useComponent;
750
+ //# sourceMappingURL=Relations-CkfzR66V.js.map