@strapi/content-manager 0.0.0-experimental.dd3311938ac827f1fa8560c8840a9a394f5896c0 → 0.0.0-experimental.ddb35414098c2a2816cae28a6abd5be1c4d8a58a

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 (524) hide show
  1. package/LICENSE +18 -3
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js +80 -0
  3. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +1 -0
  4. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +82 -0
  5. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +1 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-F9hz3-8Q.js +298 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-F9hz3-8Q.js.map +1 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-Rh9EprfI.js +276 -0
  9. package/dist/admin/chunks/ComponentConfigurationPage-Rh9EprfI.js.map +1 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js +153 -0
  11. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +1 -0
  12. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +176 -0
  13. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +1 -0
  14. package/dist/admin/chunks/EditConfigurationPage-BSyU4QSr.js +180 -0
  15. package/dist/admin/chunks/EditConfigurationPage-BSyU4QSr.js.map +1 -0
  16. package/dist/admin/chunks/EditConfigurationPage-qTV90Q1w.js +158 -0
  17. package/dist/admin/chunks/EditConfigurationPage-qTV90Q1w.js.map +1 -0
  18. package/dist/admin/chunks/EditViewPage-Bg0R6Ket.js +337 -0
  19. package/dist/admin/chunks/EditViewPage-Bg0R6Ket.js.map +1 -0
  20. package/dist/admin/chunks/EditViewPage-DQJnwri9.js +314 -0
  21. package/dist/admin/chunks/EditViewPage-DQJnwri9.js.map +1 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js +56 -0
  23. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +1 -0
  24. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +58 -0
  25. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +1 -0
  26. package/dist/admin/chunks/Form-CoCZb7X4.js +955 -0
  27. package/dist/admin/chunks/Form-CoCZb7X4.js.map +1 -0
  28. package/dist/admin/chunks/Form-NF3WNWJi.js +978 -0
  29. package/dist/admin/chunks/Form-NF3WNWJi.js.map +1 -0
  30. package/dist/admin/chunks/History-D9gkCdWM.js +1380 -0
  31. package/dist/admin/chunks/History-D9gkCdWM.js.map +1 -0
  32. package/dist/admin/chunks/History-DhTXQ3vJ.js +1357 -0
  33. package/dist/admin/chunks/History-DhTXQ3vJ.js.map +1 -0
  34. package/dist/admin/chunks/Input-B-PHs6Qx.js +6762 -0
  35. package/dist/admin/chunks/Input-B-PHs6Qx.js.map +1 -0
  36. package/dist/admin/chunks/Input-BUaeK7Zs.js +6793 -0
  37. package/dist/admin/chunks/Input-BUaeK7Zs.js.map +1 -0
  38. package/dist/admin/chunks/ListConfigurationPage-C9USjNkF.js +795 -0
  39. package/dist/admin/chunks/ListConfigurationPage-C9USjNkF.js.map +1 -0
  40. package/dist/admin/chunks/ListConfigurationPage-Deuq9sl8.js +818 -0
  41. package/dist/admin/chunks/ListConfigurationPage-Deuq9sl8.js.map +1 -0
  42. package/dist/admin/chunks/ListViewPage-CRR7JZM8.js +1132 -0
  43. package/dist/admin/chunks/ListViewPage-CRR7JZM8.js.map +1 -0
  44. package/dist/admin/chunks/ListViewPage-Dykcj1kY.js +1154 -0
  45. package/dist/admin/chunks/ListViewPage-Dykcj1kY.js.map +1 -0
  46. package/dist/admin/chunks/NoContentTypePage-CKhx-nS3.js +57 -0
  47. package/dist/admin/chunks/NoContentTypePage-CKhx-nS3.js.map +1 -0
  48. package/dist/admin/chunks/NoContentTypePage-bJYP8vEF.js +59 -0
  49. package/dist/admin/chunks/NoContentTypePage-bJYP8vEF.js.map +1 -0
  50. package/dist/admin/chunks/NoPermissionsPage-BoK43tp1.js +38 -0
  51. package/dist/admin/chunks/NoPermissionsPage-BoK43tp1.js.map +1 -0
  52. package/dist/admin/chunks/NoPermissionsPage-aAytAGle.js +36 -0
  53. package/dist/admin/chunks/NoPermissionsPage-aAytAGle.js.map +1 -0
  54. package/dist/admin/chunks/Preview-BagRf65F.js +553 -0
  55. package/dist/admin/chunks/Preview-BagRf65F.js.map +1 -0
  56. package/dist/admin/chunks/Preview-DX-20QKo.js +531 -0
  57. package/dist/admin/chunks/Preview-DX-20QKo.js.map +1 -0
  58. package/dist/admin/chunks/Relations-CIVG7vfG.js +1318 -0
  59. package/dist/admin/chunks/Relations-CIVG7vfG.js.map +1 -0
  60. package/dist/admin/chunks/Relations-DRXwCu-N.js +1291 -0
  61. package/dist/admin/chunks/Relations-DRXwCu-N.js.map +1 -0
  62. package/dist/admin/chunks/ar-DckYq_WK.js +222 -0
  63. package/dist/admin/chunks/ar-DckYq_WK.js.map +1 -0
  64. package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
  65. package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
  66. package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
  67. package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
  68. package/dist/admin/chunks/ca-DviY7mRj.js +197 -0
  69. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ca-DviY7mRj.js.map} +1 -1
  70. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  71. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  72. package/dist/admin/chunks/cs-C7OSYFQ7.js +122 -0
  73. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-C7OSYFQ7.js.map} +1 -1
  74. package/dist/admin/chunks/de-5QRlDHyR.js +195 -0
  75. package/dist/{_chunks/ja-CcFe8diO.js.map → admin/chunks/de-5QRlDHyR.js.map} +1 -1
  76. package/dist/admin/chunks/de-CbImAUA5.js +200 -0
  77. package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
  78. package/dist/admin/chunks/en-C1CjdAtC.js +313 -0
  79. package/dist/admin/chunks/en-C1CjdAtC.js.map +1 -0
  80. package/dist/admin/chunks/en-LfhocNG2.js +308 -0
  81. package/dist/admin/chunks/en-LfhocNG2.js.map +1 -0
  82. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  83. package/dist/admin/chunks/es-C8vLuvZL.js.map +1 -0
  84. package/dist/admin/chunks/es-DkoWSExG.js +192 -0
  85. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/es-DkoWSExG.js.map} +1 -1
  86. package/dist/admin/chunks/eu-BG1xX7HK.js +198 -0
  87. package/dist/admin/chunks/eu-BG1xX7HK.js.map +1 -0
  88. package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
  89. package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
  90. package/dist/admin/chunks/fr-CFdRaRVj.js +215 -0
  91. package/dist/admin/chunks/fr-CFdRaRVj.js.map +1 -0
  92. package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
  93. package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
  94. package/dist/admin/chunks/gu-D5MMMXRs.js +196 -0
  95. package/dist/admin/chunks/gu-D5MMMXRs.js.map +1 -0
  96. package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
  97. package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
  98. package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
  99. package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
  100. package/dist/admin/chunks/hi-lp17SCjr.js +196 -0
  101. package/dist/admin/chunks/hi-lp17SCjr.js.map +1 -0
  102. package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
  103. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
  104. package/dist/admin/chunks/hooks-DMvik5y_.js +7 -0
  105. package/dist/admin/chunks/hooks-DMvik5y_.js.map +1 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.js +198 -0
  107. package/dist/admin/chunks/hu-CLka1U2C.js.map +1 -0
  108. package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
  109. package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
  110. package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
  111. package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
  112. package/dist/admin/chunks/id-USfY9m1g.js +156 -0
  113. package/dist/admin/chunks/id-USfY9m1g.js.map +1 -0
  114. package/dist/admin/chunks/index-BFvBqzd6.js +5416 -0
  115. package/dist/admin/chunks/index-BFvBqzd6.js.map +1 -0
  116. package/dist/admin/chunks/index-DjnPfPx8.js +5350 -0
  117. package/dist/admin/chunks/index-DjnPfPx8.js.map +1 -0
  118. package/dist/admin/chunks/it-BAHrwmYS.js +158 -0
  119. package/dist/admin/chunks/it-BAHrwmYS.js.map +1 -0
  120. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  121. package/dist/{_chunks/es-EUonQTon.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  122. package/dist/admin/chunks/ja-BWKmBJFT.js +192 -0
  123. package/dist/admin/chunks/ja-BWKmBJFT.js.map +1 -0
  124. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  125. package/dist/admin/chunks/ja-jdQM-B79.js.map +1 -0
  126. package/dist/admin/chunks/ko-CgADGBNt.js +191 -0
  127. package/dist/admin/chunks/ko-CgADGBNt.js.map +1 -0
  128. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  129. package/dist/admin/chunks/ko-k46sEyzt.js.map +1 -0
  130. package/dist/admin/chunks/layout-BBZkZkME.js +618 -0
  131. package/dist/admin/chunks/layout-BBZkZkME.js.map +1 -0
  132. package/dist/admin/chunks/layout-DsbCNcEH.js +598 -0
  133. package/dist/admin/chunks/layout-DsbCNcEH.js.map +1 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.js +196 -0
  135. package/dist/admin/chunks/ml-CnhCfOn_.js.map +1 -0
  136. package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
  137. package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
  138. package/dist/admin/chunks/ms-Bh09NFff.js +140 -0
  139. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/ms-Bh09NFff.js.map} +1 -1
  140. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  141. package/dist/admin/chunks/ms-CvSC0OdG.js.map +1 -0
  142. package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
  143. package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
  144. package/dist/admin/chunks/nl-C8HYflTc.js +198 -0
  145. package/dist/admin/chunks/nl-C8HYflTc.js.map +1 -0
  146. package/dist/admin/chunks/objects-C3EebVVe.js +76 -0
  147. package/dist/admin/chunks/objects-C3EebVVe.js.map +1 -0
  148. package/dist/admin/chunks/objects-wl73iEma.js +73 -0
  149. package/dist/admin/chunks/objects-wl73iEma.js.map +1 -0
  150. package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
  151. package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
  152. package/dist/admin/chunks/pl-MFCZJZuZ.js +195 -0
  153. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +1 -0
  154. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  155. package/dist/admin/chunks/pt-BR-CPtAXD-4.js.map +1 -0
  156. package/dist/admin/chunks/pt-BR-CcotyBGJ.js +197 -0
  157. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CcotyBGJ.js.map} +1 -1
  158. package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
  159. package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
  160. package/dist/admin/chunks/pt-HbmgeiYO.js +93 -0
  161. package/dist/admin/chunks/pt-HbmgeiYO.js.map +1 -0
  162. package/dist/admin/chunks/relations-CbrYJQqU.js +173 -0
  163. package/dist/admin/chunks/relations-CbrYJQqU.js.map +1 -0
  164. package/dist/admin/chunks/relations-DPq9jPO4.js +178 -0
  165. package/dist/admin/chunks/relations-DPq9jPO4.js.map +1 -0
  166. package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
  167. package/dist/{_chunks/en-fbKQxLGn.js.map → admin/chunks/ru-C0op0ALG.js.map} +1 -1
  168. package/dist/admin/chunks/ru-CB4BUyQp.js +230 -0
  169. package/dist/admin/chunks/ru-CB4BUyQp.js.map +1 -0
  170. package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
  171. package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
  172. package/dist/admin/chunks/sa-n_aPA-pU.js +196 -0
  173. package/dist/admin/chunks/sa-n_aPA-pU.js.map +1 -0
  174. package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
  175. package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
  176. package/dist/admin/chunks/sk-tn_BDjE2.js +198 -0
  177. package/dist/admin/chunks/sk-tn_BDjE2.js.map +1 -0
  178. package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
  179. package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
  180. package/dist/admin/chunks/sv-cq4ZrQRd.js +198 -0
  181. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +1 -0
  182. package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
  183. package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
  184. package/dist/admin/chunks/th-mUH7hEtc.js +144 -0
  185. package/dist/admin/chunks/th-mUH7hEtc.js.map +1 -0
  186. package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
  187. package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
  188. package/dist/admin/chunks/tr-Yt38daxh.js +195 -0
  189. package/dist/admin/chunks/tr-Yt38daxh.js.map +1 -0
  190. package/dist/admin/chunks/uk-B24MoTVg.js +145 -0
  191. package/dist/admin/chunks/uk-B24MoTVg.js.map +1 -0
  192. package/dist/admin/chunks/uk-Cpgmm7gE.js +140 -0
  193. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +1 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js +247 -0
  195. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +1 -0
  196. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +271 -0
  197. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +1 -0
  198. package/dist/admin/chunks/usePrev-Bjw2dhmq.js +18 -0
  199. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +1 -0
  200. package/dist/admin/chunks/usePrev-DIYl-IAL.js +21 -0
  201. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +1 -0
  202. package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
  203. package/dist/admin/chunks/vi-BGr1X_HZ.js.map +1 -0
  204. package/dist/admin/chunks/vi-CvBGlTjr.js +108 -0
  205. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-CvBGlTjr.js.map} +1 -1
  206. package/dist/admin/chunks/zh-BmF-sHaT.js +205 -0
  207. package/dist/admin/chunks/zh-BmF-sHaT.js.map +1 -0
  208. package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
  209. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
  210. package/dist/admin/chunks/zh-Hans-CI0HKio3.js +934 -0
  211. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-CI0HKio3.js.map} +1 -1
  212. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  213. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  214. package/dist/admin/index.js +25 -4
  215. package/dist/admin/index.js.map +1 -1
  216. package/dist/admin/index.mjs +16 -11
  217. package/dist/admin/index.mjs.map +1 -1
  218. package/dist/admin/src/content-manager.d.ts +3 -2
  219. package/dist/admin/src/exports.d.ts +2 -1
  220. package/dist/admin/src/history/index.d.ts +3 -0
  221. package/dist/admin/src/history/services/historyVersion.d.ts +2 -2
  222. package/dist/admin/src/hooks/useDocument.d.ts +50 -2
  223. package/dist/admin/src/index.d.ts +1 -0
  224. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  225. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +9 -4
  226. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  227. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  228. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  229. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +5 -0
  230. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  231. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  232. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +22 -1
  233. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  234. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  235. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +6 -58
  236. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +27 -0
  237. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  238. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  239. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  240. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  241. package/dist/admin/src/preview/components/PreviewContent.d.ts +3 -0
  242. package/dist/admin/src/preview/components/PreviewHeader.d.ts +3 -0
  243. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  244. package/dist/admin/src/preview/index.d.ts +3 -0
  245. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  246. package/dist/admin/src/preview/routes.d.ts +3 -0
  247. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  248. package/dist/admin/src/router.d.ts +1 -1
  249. package/dist/admin/src/services/api.d.ts +1 -1
  250. package/dist/admin/src/services/components.d.ts +2 -2
  251. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  252. package/dist/admin/src/services/documents.d.ts +19 -20
  253. package/dist/admin/src/services/init.d.ts +1 -1
  254. package/dist/admin/src/services/relations.d.ts +2 -2
  255. package/dist/admin/src/services/uid.d.ts +3 -3
  256. package/dist/admin/src/utils/validation.d.ts +4 -1
  257. package/dist/server/index.js +5483 -4083
  258. package/dist/server/index.js.map +1 -1
  259. package/dist/server/index.mjs +5504 -4101
  260. package/dist/server/index.mjs.map +1 -1
  261. package/dist/server/src/bootstrap.d.ts.map +1 -1
  262. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  263. package/dist/server/src/controllers/index.d.ts.map +1 -1
  264. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  265. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  266. package/dist/server/src/controllers/utils/metadata.d.ts +17 -2
  267. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  268. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  269. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  270. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  271. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  272. package/dist/server/src/history/services/history.d.ts +3 -3
  273. package/dist/server/src/history/services/history.d.ts.map +1 -1
  274. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  275. package/dist/server/src/history/services/utils.d.ts +8 -12
  276. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  277. package/dist/server/src/index.d.ts +7 -6
  278. package/dist/server/src/index.d.ts.map +1 -1
  279. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  280. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  281. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  282. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  283. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  284. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  285. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  286. package/dist/server/src/preview/index.d.ts +4 -0
  287. package/dist/server/src/preview/index.d.ts.map +1 -0
  288. package/dist/server/src/preview/routes/index.d.ts +8 -0
  289. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  290. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  291. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  292. package/dist/server/src/preview/services/index.d.ts +16 -0
  293. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  294. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  295. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  296. package/dist/server/src/preview/services/preview.d.ts +12 -0
  297. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  298. package/dist/server/src/preview/utils.d.ts +19 -0
  299. package/dist/server/src/preview/utils.d.ts.map +1 -0
  300. package/dist/server/src/register.d.ts.map +1 -1
  301. package/dist/server/src/routes/index.d.ts.map +1 -1
  302. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  303. package/dist/server/src/services/document-metadata.d.ts +12 -10
  304. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  305. package/dist/server/src/services/index.d.ts +7 -6
  306. package/dist/server/src/services/index.d.ts.map +1 -1
  307. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  308. package/dist/server/src/services/utils/count.d.ts +1 -1
  309. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  310. package/dist/server/src/services/utils/populate.d.ts +3 -3
  311. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  312. package/dist/server/src/utils/index.d.ts +2 -0
  313. package/dist/server/src/utils/index.d.ts.map +1 -1
  314. package/dist/shared/contracts/collection-types.d.ts +3 -2
  315. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  316. package/dist/shared/contracts/components.d.ts +0 -1
  317. package/dist/shared/contracts/content-types.d.ts +0 -1
  318. package/dist/shared/contracts/history-versions.d.ts +0 -1
  319. package/dist/shared/contracts/index.d.ts +1 -1
  320. package/dist/shared/contracts/index.d.ts.map +1 -1
  321. package/dist/shared/contracts/init.d.ts +0 -1
  322. package/dist/shared/contracts/preview.d.ts +26 -0
  323. package/dist/shared/contracts/preview.d.ts.map +1 -0
  324. package/dist/shared/contracts/relations.d.ts +1 -2
  325. package/dist/shared/contracts/relations.d.ts.map +1 -1
  326. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  327. package/dist/shared/contracts/single-types.d.ts +0 -1
  328. package/dist/shared/contracts/uid.d.ts +0 -1
  329. package/dist/shared/index.d.ts +0 -1
  330. package/dist/shared/index.js +37 -22
  331. package/dist/shared/index.js.map +1 -1
  332. package/dist/shared/index.mjs +36 -23
  333. package/dist/shared/index.mjs.map +1 -1
  334. package/package.json +24 -20
  335. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  336. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  337. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  338. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  339. package/dist/_chunks/ComponentConfigurationPage-BMajAl1u.mjs +0 -236
  340. package/dist/_chunks/ComponentConfigurationPage-BMajAl1u.mjs.map +0 -1
  341. package/dist/_chunks/ComponentConfigurationPage-y_7iLdmB.js +0 -255
  342. package/dist/_chunks/ComponentConfigurationPage-y_7iLdmB.js.map +0 -1
  343. package/dist/_chunks/ComponentIcon-BXdiCGQp.js +0 -176
  344. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +0 -1
  345. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  346. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  347. package/dist/_chunks/EditConfigurationPage-CPVB8Uqc.js +0 -151
  348. package/dist/_chunks/EditConfigurationPage-CPVB8Uqc.js.map +0 -1
  349. package/dist/_chunks/EditConfigurationPage-CcOoD26O.mjs +0 -132
  350. package/dist/_chunks/EditConfigurationPage-CcOoD26O.mjs.map +0 -1
  351. package/dist/_chunks/EditViewPage-CTTDHKkQ.js +0 -222
  352. package/dist/_chunks/EditViewPage-CTTDHKkQ.js.map +0 -1
  353. package/dist/_chunks/EditViewPage-DWb0DE7R.mjs +0 -203
  354. package/dist/_chunks/EditViewPage-DWb0DE7R.mjs.map +0 -1
  355. package/dist/_chunks/Field-C5Z1Ivdv.js +0 -5243
  356. package/dist/_chunks/Field-C5Z1Ivdv.js.map +0 -1
  357. package/dist/_chunks/Field-DnStdvQw.mjs +0 -5211
  358. package/dist/_chunks/Field-DnStdvQw.mjs.map +0 -1
  359. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  360. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  361. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  362. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  363. package/dist/_chunks/Form-B81OtW-k.js +0 -761
  364. package/dist/_chunks/Form-B81OtW-k.js.map +0 -1
  365. package/dist/_chunks/Form-DqGgE55Q.mjs +0 -740
  366. package/dist/_chunks/Form-DqGgE55Q.mjs.map +0 -1
  367. package/dist/_chunks/History-4NbOq2dX.js +0 -1030
  368. package/dist/_chunks/History-4NbOq2dX.js.map +0 -1
  369. package/dist/_chunks/History-DS6-HCYX.mjs +0 -1009
  370. package/dist/_chunks/History-DS6-HCYX.mjs.map +0 -1
  371. package/dist/_chunks/ListConfigurationPage-CpfstlYY.js +0 -641
  372. package/dist/_chunks/ListConfigurationPage-CpfstlYY.js.map +0 -1
  373. package/dist/_chunks/ListConfigurationPage-DQJJltko.mjs +0 -622
  374. package/dist/_chunks/ListConfigurationPage-DQJJltko.mjs.map +0 -1
  375. package/dist/_chunks/ListViewPage-CA3I75m5.js +0 -851
  376. package/dist/_chunks/ListViewPage-CA3I75m5.js.map +0 -1
  377. package/dist/_chunks/ListViewPage-nQrOQuVo.mjs +0 -827
  378. package/dist/_chunks/ListViewPage-nQrOQuVo.mjs.map +0 -1
  379. package/dist/_chunks/NoContentTypePage-DbnHE22g.mjs +0 -51
  380. package/dist/_chunks/NoContentTypePage-DbnHE22g.mjs.map +0 -1
  381. package/dist/_chunks/NoContentTypePage-Dldu-_Mx.js +0 -51
  382. package/dist/_chunks/NoContentTypePage-Dldu-_Mx.js.map +0 -1
  383. package/dist/_chunks/NoPermissionsPage-CO2MK200.js +0 -23
  384. package/dist/_chunks/NoPermissionsPage-CO2MK200.js.map +0 -1
  385. package/dist/_chunks/NoPermissionsPage-fOIkQM0v.mjs +0 -23
  386. package/dist/_chunks/NoPermissionsPage-fOIkQM0v.mjs.map +0 -1
  387. package/dist/_chunks/Relations-BDRl99Ux.mjs +0 -694
  388. package/dist/_chunks/Relations-BDRl99Ux.mjs.map +0 -1
  389. package/dist/_chunks/Relations-DG2jnOcr.js +0 -714
  390. package/dist/_chunks/Relations-DG2jnOcr.js.map +0 -1
  391. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  392. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  393. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  394. package/dist/_chunks/ar-CCEVvqGG.mjs.map +0 -1
  395. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  396. package/dist/_chunks/ca-5U32ON2v.mjs.map +0 -1
  397. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  398. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  399. package/dist/_chunks/cs-CM2aBUar.mjs.map +0 -1
  400. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  401. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  402. package/dist/_chunks/de-C72KDNOl.mjs.map +0 -1
  403. package/dist/_chunks/de-CCEmbAah.js +0 -199
  404. package/dist/_chunks/en-Ux26r5pl.mjs +0 -291
  405. package/dist/_chunks/en-Ux26r5pl.mjs.map +0 -1
  406. package/dist/_chunks/en-fbKQxLGn.js +0 -291
  407. package/dist/_chunks/es-CeXiYflN.mjs +0 -196
  408. package/dist/_chunks/es-CeXiYflN.mjs.map +0 -1
  409. package/dist/_chunks/es-EUonQTon.js +0 -196
  410. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  411. package/dist/_chunks/eu-CdALomew.mjs.map +0 -1
  412. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  413. package/dist/_chunks/fr-B7kGGg3E.js +0 -206
  414. package/dist/_chunks/fr-B7kGGg3E.js.map +0 -1
  415. package/dist/_chunks/fr-CD9VFbPM.mjs +0 -206
  416. package/dist/_chunks/fr-CD9VFbPM.mjs.map +0 -1
  417. package/dist/_chunks/gu-BRmF601H.js +0 -200
  418. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  419. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  420. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  421. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  422. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  423. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  424. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  425. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  426. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  427. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  428. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  429. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  430. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  431. package/dist/_chunks/id-B5Ser98A.js +0 -160
  432. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  433. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  434. package/dist/_chunks/id-BtwA9WJT.mjs.map +0 -1
  435. package/dist/_chunks/index-BZoNZMXL.js +0 -3956
  436. package/dist/_chunks/index-BZoNZMXL.js.map +0 -1
  437. package/dist/_chunks/index-Drt2DN7v.mjs +0 -3937
  438. package/dist/_chunks/index-Drt2DN7v.mjs.map +0 -1
  439. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  440. package/dist/_chunks/it-BrVPqaf1.mjs.map +0 -1
  441. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  442. package/dist/_chunks/ja-CcFe8diO.js +0 -196
  443. package/dist/_chunks/ja-CtsUxOvk.mjs +0 -196
  444. package/dist/_chunks/ja-CtsUxOvk.mjs.map +0 -1
  445. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  446. package/dist/_chunks/ko-HVQRlfUI.mjs.map +0 -1
  447. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  448. package/dist/_chunks/layout-BzAbmoO6.mjs +0 -458
  449. package/dist/_chunks/layout-BzAbmoO6.mjs.map +0 -1
  450. package/dist/_chunks/layout-DEYBqgF1.js +0 -476
  451. package/dist/_chunks/layout-DEYBqgF1.js.map +0 -1
  452. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  453. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  454. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  455. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  456. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  457. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  458. package/dist/_chunks/ms-m_WjyWx7.mjs.map +0 -1
  459. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  460. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  461. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  462. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  463. package/dist/_chunks/objects-gigeqt7s.js +0 -49
  464. package/dist/_chunks/objects-gigeqt7s.js.map +0 -1
  465. package/dist/_chunks/objects-mKMAmfec.mjs +0 -47
  466. package/dist/_chunks/objects-mKMAmfec.mjs.map +0 -1
  467. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  468. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  469. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  470. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  471. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  472. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  473. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +0 -1
  474. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  475. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  476. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  477. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  478. package/dist/_chunks/relations-D0eZ4VWw.js +0 -134
  479. package/dist/_chunks/relations-D0eZ4VWw.js.map +0 -1
  480. package/dist/_chunks/relations-D26zVRdi.mjs +0 -135
  481. package/dist/_chunks/relations-D26zVRdi.mjs.map +0 -1
  482. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  483. package/dist/_chunks/ru-BE6A4Exp.mjs.map +0 -1
  484. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  485. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  486. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  487. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  488. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  489. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  490. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  491. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  492. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  493. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  494. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  495. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  496. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  497. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  498. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  499. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  500. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  501. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  502. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  503. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  504. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  505. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  506. package/dist/_chunks/uk-CR-zDhAY.mjs.map +0 -1
  507. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs +0 -231
  508. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +0 -1
  509. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js +0 -249
  510. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +0 -1
  511. package/dist/_chunks/usePrev-B9w_-eYc.js +0 -15
  512. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  513. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  514. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  515. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  516. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  517. package/dist/_chunks/vi-DUXIk_fw.mjs.map +0 -1
  518. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  519. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  520. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  521. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  522. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  523. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  524. package/strapi-server.js +0 -3
@@ -1,851 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const strapiAdmin = require("@strapi/admin/strapi-admin");
6
- const designSystem = require("@strapi/design-system");
7
- const Icons = require("@strapi/icons");
8
- const isEqual = require("lodash/isEqual");
9
- const qs = require("qs");
10
- const reactIntl = require("react-intl");
11
- const reactRouterDom = require("react-router-dom");
12
- const styledComponents = require("styled-components");
13
- const index = require("./index-BZoNZMXL.js");
14
- const usePrev = require("./usePrev-B9w_-eYc.js");
15
- const isEmpty = require("lodash/isEmpty");
16
- const parseISO = require("date-fns/parseISO");
17
- const toString = require("lodash/toString");
18
- const relations = require("./relations-D0eZ4VWw.js");
19
- const hooks = require("./hooks-BAaaKPS_.js");
20
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
21
- function _interopNamespace(e) {
22
- if (e && e.__esModule)
23
- return e;
24
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
25
- if (e) {
26
- for (const k in e) {
27
- if (k !== "default") {
28
- const d = Object.getOwnPropertyDescriptor(e, k);
29
- Object.defineProperty(n, k, d.get ? d : {
30
- enumerable: true,
31
- get: () => e[k]
32
- });
33
- }
34
- }
35
- }
36
- n.default = e;
37
- return Object.freeze(n);
38
- }
39
- const React__namespace = /* @__PURE__ */ _interopNamespace(React);
40
- const isEqual__default = /* @__PURE__ */ _interopDefault(isEqual);
41
- const isEmpty__default = /* @__PURE__ */ _interopDefault(isEmpty);
42
- const parseISO__default = /* @__PURE__ */ _interopDefault(parseISO);
43
- const toString__default = /* @__PURE__ */ _interopDefault(toString);
44
- const NOT_ALLOWED_FILTERS = [
45
- "json",
46
- "component",
47
- "media",
48
- "richtext",
49
- "dynamiczone",
50
- "password",
51
- "blocks"
52
- ];
53
- const DEFAULT_ALLOWED_FILTERS = ["createdAt", "updatedAt"];
54
- const USER_FILTER_ATTRIBUTES = [...index.CREATOR_FIELDS, "strapi_assignee"];
55
- const FiltersImpl = ({ disabled, schema }) => {
56
- const { attributes, uid: model, options } = schema;
57
- const { formatMessage, locale } = reactIntl.useIntl();
58
- const { trackUsage } = strapiAdmin.useTracking();
59
- const allPermissions = strapiAdmin.useAuth("FiltersImpl", (state) => state.permissions);
60
- const [{ query }] = strapiAdmin.useQueryParams();
61
- const { schemas } = index.useContentTypeSchema();
62
- const canReadAdminUsers = React__namespace.useMemo(
63
- () => allPermissions.filter(
64
- (permission) => permission.action === "admin::users.read" && permission.subject === null
65
- ).length > 0,
66
- [allPermissions]
67
- );
68
- const selectedUserIds = (query?.filters?.$and ?? []).reduce((acc, filter) => {
69
- const [key, value] = Object.entries(filter)[0];
70
- if (typeof value.id !== "object") {
71
- return acc;
72
- }
73
- const id = value.id.$eq || value.id.$ne;
74
- if (id && USER_FILTER_ATTRIBUTES.includes(key) && !acc.includes(id)) {
75
- acc.push(id);
76
- }
77
- return acc;
78
- }, []);
79
- const { data: userData, isLoading: isLoadingAdminUsers } = strapiAdmin.useAdminUsers(
80
- { filters: { id: { $in: selectedUserIds } } },
81
- {
82
- // fetch the list of admin users only if the filter contains users and the
83
- // current user has permissions to display users
84
- skip: selectedUserIds.length === 0 || !canReadAdminUsers
85
- }
86
- );
87
- const { users = [] } = userData ?? {};
88
- const { metadata } = index.useGetContentTypeConfigurationQuery(model, {
89
- selectFromResult: ({ data }) => ({ metadata: data?.contentType.metadatas ?? {} })
90
- });
91
- const formatter = designSystem.useCollator(locale, {
92
- sensitivity: "base"
93
- });
94
- const displayedFilters = React__namespace.useMemo(() => {
95
- const [{ properties: { fields = [] } = { fields: [] } }] = allPermissions.filter(
96
- (permission) => permission.action === "plugin::content-manager.explorer.read" && permission.subject === model
97
- );
98
- const allowedFields = fields.filter((field) => {
99
- const attribute = attributes[field] ?? {};
100
- return attribute.type && !NOT_ALLOWED_FILTERS.includes(attribute.type);
101
- });
102
- return [
103
- "id",
104
- ...allowedFields,
105
- ...DEFAULT_ALLOWED_FILTERS,
106
- ...canReadAdminUsers ? index.CREATOR_FIELDS : []
107
- ].map((name) => {
108
- const attribute = attributes[name];
109
- if (NOT_ALLOWED_FILTERS.includes(attribute.type)) {
110
- return null;
111
- }
112
- const { mainField: mainFieldName = "", label } = metadata[name].list;
113
- let filter = {
114
- name,
115
- label: label ?? "",
116
- mainField: index.getMainField(attribute, mainFieldName, { schemas, components: {} }),
117
- // @ts-expect-error – TODO: this is filtered out above in the `allowedFields` call but TS complains, is there a better way to solve this?
118
- type: attribute.type
119
- };
120
- if (attribute.type === "relation" && "target" in attribute && attribute.target === "admin::user") {
121
- filter = {
122
- ...filter,
123
- input: AdminUsersFilter,
124
- options: users.map((user) => ({
125
- label: index.getDisplayName(user),
126
- value: user.id.toString()
127
- })),
128
- operators: [
129
- {
130
- label: formatMessage({
131
- id: "components.FilterOptions.FILTER_TYPES.$eq",
132
- defaultMessage: "is"
133
- }),
134
- value: "$eq"
135
- },
136
- {
137
- label: formatMessage({
138
- id: "components.FilterOptions.FILTER_TYPES.$ne",
139
- defaultMessage: "is not"
140
- }),
141
- value: "$ne"
142
- }
143
- ],
144
- mainField: {
145
- name: "id",
146
- type: "integer"
147
- }
148
- };
149
- }
150
- return filter;
151
- }).filter(Boolean).toSorted((a, b) => formatter.compare(a.label, b.label));
152
- }, [
153
- allPermissions,
154
- canReadAdminUsers,
155
- model,
156
- attributes,
157
- metadata,
158
- schemas,
159
- users,
160
- formatMessage,
161
- formatter
162
- ]);
163
- const onOpenChange = (isOpen) => {
164
- if (isOpen) {
165
- trackUsage("willFilterEntries");
166
- }
167
- };
168
- const handleFilterChange = (data) => {
169
- const attribute = attributes[data.name];
170
- if (attribute) {
171
- trackUsage("didFilterEntries", {
172
- useRelation: attribute.type === "relation"
173
- });
174
- }
175
- };
176
- return /* @__PURE__ */ jsxRuntime.jsxs(
177
- strapiAdmin.Filters.Root,
178
- {
179
- disabled,
180
- options: displayedFilters,
181
- onOpenChange,
182
- onChange: handleFilterChange,
183
- children: [
184
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Filters.Trigger, {}),
185
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Filters.Popover, {}),
186
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Filters.List, {})
187
- ]
188
- }
189
- );
190
- };
191
- const AdminUsersFilter = ({ name }) => {
192
- const [page, setPage] = React__namespace.useState(1);
193
- const { formatMessage } = reactIntl.useIntl();
194
- const { data, isLoading } = strapiAdmin.useAdminUsers({
195
- page
196
- });
197
- const field = strapiAdmin.useField(name);
198
- const handleOpenChange = (isOpen) => {
199
- if (!isOpen) {
200
- setPage(1);
201
- }
202
- };
203
- const users = data?.users || [];
204
- return /* @__PURE__ */ jsxRuntime.jsx(
205
- designSystem.Combobox,
206
- {
207
- value: field.value,
208
- "aria-label": formatMessage({
209
- id: "content-manager.components.Filters.usersSelect.label",
210
- defaultMessage: "Search and select a user to filter"
211
- }),
212
- onOpenChange: handleOpenChange,
213
- onChange: (value) => field.onChange(name, value),
214
- loading: isLoading,
215
- onLoadMore: () => setPage((prev) => prev + 1),
216
- children: users.map((user) => {
217
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: user.id.toString(), children: index.getDisplayName(user) }, user.id);
218
- })
219
- }
220
- );
221
- };
222
- const CellValue = ({ type, value }) => {
223
- const { formatDate, formatTime, formatNumber } = reactIntl.useIntl();
224
- let formattedValue = value;
225
- if (type === "date") {
226
- formattedValue = formatDate(parseISO__default.default(value), { dateStyle: "full" });
227
- }
228
- if (type === "datetime") {
229
- formattedValue = formatDate(value, { dateStyle: "full", timeStyle: "short" });
230
- }
231
- if (type === "time") {
232
- const [hour, minute, second] = value.split(":");
233
- const date = /* @__PURE__ */ new Date();
234
- date.setHours(hour);
235
- date.setMinutes(minute);
236
- date.setSeconds(second);
237
- formattedValue = formatTime(date, {
238
- timeStyle: "short"
239
- });
240
- }
241
- if (["float", "decimal"].includes(type)) {
242
- formattedValue = formatNumber(value, {
243
- // Should be kept in sync with the corresponding value
244
- // in the design-system/NumberInput: https://github.com/strapi/design-system/blob/main/packages/strapi-design-system/src/NumberInput/NumberInput.js#L53
245
- maximumFractionDigits: 20
246
- });
247
- }
248
- if (["integer", "biginteger"].includes(type)) {
249
- formattedValue = formatNumber(value, { maximumFractionDigits: 0 });
250
- }
251
- return toString__default.default(formattedValue);
252
- };
253
- const SingleComponent = ({ content, mainField }) => {
254
- if (!mainField) {
255
- return null;
256
- }
257
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label: content[mainField.name], children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "25rem", textColor: "neutral800", ellipsis: true, children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: mainField.type, value: content[mainField.name] }) }) });
258
- };
259
- const RepeatableComponent = ({ content, mainField }) => {
260
- const { formatMessage } = reactIntl.useIntl();
261
- if (!mainField) {
262
- return null;
263
- }
264
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
265
- /* @__PURE__ */ jsxRuntime.jsxs(MenuTrigger$1, { onClick: (e) => e.stopPropagation(), children: [
266
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: content.length }),
267
- " ",
268
- formatMessage(
269
- {
270
- id: "content-manager.containers.list.items",
271
- defaultMessage: "{number, plural, =0 {items} one {item} other {items}}"
272
- },
273
- { number: content.length }
274
- )
275
- ] }),
276
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { children: content.map((item) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "50rem", ellipsis: true, children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: mainField.type, value: item[mainField.name] }) }) }, item.id)) })
277
- ] });
278
- };
279
- const MenuTrigger$1 = styledComponents.styled(designSystem.Menu.Trigger)`
280
- svg {
281
- width: 0.6rem;
282
- height: 0.4rem;
283
- }
284
- `;
285
- const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
286
- const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
287
- const fileURL = usePrev.prefixFileUrlWithBackendUrl(url);
288
- if (mime.includes("image")) {
289
- const thumbnail = formats?.thumbnail?.url;
290
- const mediaURL = usePrev.prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
291
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Avatar, { src: mediaURL, alt: alternativeText || name, preview: true });
292
- }
293
- const fileExtension = getFileExtension(ext);
294
- const fileName = name.length > 100 ? `${name.substring(0, 100)}...` : name;
295
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: fileName, children: /* @__PURE__ */ jsxRuntime.jsx(FileWrapper, { children: fileExtension }) });
296
- };
297
- const FileWrapper = ({ children }) => {
298
- return /* @__PURE__ */ jsxRuntime.jsx(
299
- designSystem.Flex,
300
- {
301
- tag: "span",
302
- position: "relative",
303
- borderRadius: "50%",
304
- width: "26px",
305
- height: "26px",
306
- borderColor: "neutral200",
307
- background: "neutral150",
308
- paddingLeft: "1px",
309
- justifyContent: "center",
310
- alignItems: "center",
311
- children: /* @__PURE__ */ jsxRuntime.jsx(FileTypography, { variant: "sigma", textColor: "neutral600", children })
312
- }
313
- );
314
- };
315
- const FileTypography = styledComponents.styled(designSystem.Typography)`
316
- font-size: 0.9rem;
317
- line-height: 0.9rem;
318
- `;
319
- const MediaMultiple = ({ content }) => {
320
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.AvatarGroup, { children: content.map((file, index2) => {
321
- const key = `${file.id}${index2}`;
322
- if (index2 === 3) {
323
- const remainingFiles = `+${content.length - 3}`;
324
- return /* @__PURE__ */ jsxRuntime.jsx(FileWrapper, { children: remainingFiles }, key);
325
- }
326
- if (index2 > 3) {
327
- return null;
328
- }
329
- return /* @__PURE__ */ jsxRuntime.jsx(MediaSingle, { ...file }, key);
330
- }) });
331
- };
332
- const RelationSingle = ({ mainField, content }) => {
333
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "50rem", textColor: "neutral800", ellipsis: true, children: relations.getRelationLabel(content, mainField) });
334
- };
335
- const RelationMultiple = ({ mainField, content, rowId, name }) => {
336
- const { model } = index.useDoc();
337
- const { formatMessage } = reactIntl.useIntl();
338
- const { notifyStatus } = designSystem.useNotifyAT();
339
- const [isOpen, setIsOpen] = React__namespace.useState(false);
340
- const [targetField] = name.split(".");
341
- const { data, isLoading } = relations.useGetRelationsQuery(
342
- {
343
- model,
344
- id: rowId,
345
- targetField
346
- },
347
- {
348
- skip: !isOpen,
349
- refetchOnMountOrArgChange: true
350
- }
351
- );
352
- React__namespace.useEffect(() => {
353
- if (data) {
354
- notifyStatus(
355
- formatMessage({
356
- id: index.getTranslation("DynamicTable.relation-loaded"),
357
- defaultMessage: "Relations have been loaded"
358
- })
359
- );
360
- }
361
- }, [data, formatMessage, notifyStatus]);
362
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { onOpenChange: (isOpen2) => setIsOpen(isOpen2), children: [
363
- /* @__PURE__ */ jsxRuntime.jsx(MenuTrigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, wrap: "nowrap", children: [
364
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: content.count }),
365
- formatMessage(
366
- {
367
- id: "content-manager.containers.list.items",
368
- defaultMessage: "{number, plural, =0 {items} one {item} other {items}}"
369
- },
370
- { number: content.count }
371
- )
372
- ] }) }),
373
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { children: [
374
- isLoading && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage({
375
- id: index.getTranslation("ListViewTable.relation-loading"),
376
- defaultMessage: "Relations are loading"
377
- }) }) }),
378
- data?.results && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
379
- data.results.map((entry) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "50rem", ellipsis: true, children: relations.getRelationLabel(entry, mainField) }) }, entry.documentId)),
380
- data?.pagination && data?.pagination.total > 10 && /* @__PURE__ */ jsxRuntime.jsx(
381
- designSystem.Menu.Item,
382
- {
383
- "aria-disabled": true,
384
- "aria-label": formatMessage({
385
- id: index.getTranslation("ListViewTable.relation-more"),
386
- defaultMessage: "This relation contains more entities than displayed"
387
- }),
388
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: "…" })
389
- }
390
- )
391
- ] })
392
- ] })
393
- ] });
394
- };
395
- const MenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
396
- svg {
397
- width: 0.6rem;
398
- height: 0.4rem;
399
- }
400
- `;
401
- const CellContent = ({ content, mainField, attribute, rowId, name }) => {
402
- if (!hasContent(content, mainField, attribute)) {
403
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: "-" });
404
- }
405
- switch (attribute.type) {
406
- case "media":
407
- if (!attribute.multiple) {
408
- return /* @__PURE__ */ jsxRuntime.jsx(MediaSingle, { ...content });
409
- }
410
- return /* @__PURE__ */ jsxRuntime.jsx(MediaMultiple, { content });
411
- case "relation": {
412
- if (isSingleRelation(attribute.relation)) {
413
- return /* @__PURE__ */ jsxRuntime.jsx(RelationSingle, { mainField, content });
414
- }
415
- return /* @__PURE__ */ jsxRuntime.jsx(RelationMultiple, { rowId, mainField, content, name });
416
- }
417
- case "component":
418
- if (attribute.repeatable) {
419
- return /* @__PURE__ */ jsxRuntime.jsx(RepeatableComponent, { mainField, content });
420
- }
421
- return /* @__PURE__ */ jsxRuntime.jsx(SingleComponent, { mainField, content });
422
- case "string":
423
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: content, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: attribute.type, value: content }) }) });
424
- default:
425
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: attribute.type, value: content }) });
426
- }
427
- };
428
- const hasContent = (content, mainField, attribute) => {
429
- if (attribute.type === "component") {
430
- if (attribute.repeatable || !mainField) {
431
- return content?.length > 0;
432
- }
433
- const value = content?.[mainField.name];
434
- if (mainField.name === "id" && ![void 0, null].includes(value)) {
435
- return true;
436
- }
437
- return !isEmpty__default.default(value);
438
- }
439
- if (attribute.type === "relation") {
440
- if (isSingleRelation(attribute.relation)) {
441
- return !isEmpty__default.default(content);
442
- }
443
- return content?.count > 0;
444
- }
445
- if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
446
- return typeof content === "number";
447
- }
448
- if (attribute.type === "boolean") {
449
- return content !== null;
450
- }
451
- return !isEmpty__default.default(content);
452
- };
453
- const isSingleRelation = (type) => ["oneToOne", "manyToOne", "oneToOneMorph"].includes(type);
454
- const ViewSettingsMenu = (props) => {
455
- const [isVisible, setIsVisible] = React__namespace.useState(false);
456
- const cogButtonRef = React__namespace.useRef(null);
457
- const permissions = hooks.useTypedSelector(
458
- (state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []
459
- );
460
- const [{ query }] = strapiAdmin.useQueryParams();
461
- const { formatMessage } = reactIntl.useIntl();
462
- const {
463
- allowedActions: { canConfigureView }
464
- } = strapiAdmin.useRBAC(permissions);
465
- const handleToggle = () => {
466
- setIsVisible((prev) => !prev);
467
- };
468
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
469
- /* @__PURE__ */ jsxRuntime.jsx(
470
- designSystem.IconButton,
471
- {
472
- label: formatMessage({
473
- id: "components.ViewSettings.tooltip",
474
- defaultMessage: "View Settings"
475
- }),
476
- ref: cogButtonRef,
477
- onClick: handleToggle,
478
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cog, {})
479
- }
480
- ),
481
- isVisible && /* @__PURE__ */ jsxRuntime.jsx(
482
- designSystem.Popover,
483
- {
484
- placement: "bottom-end",
485
- source: cogButtonRef,
486
- onDismiss: handleToggle,
487
- spacing: 4,
488
- padding: 3,
489
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "stretch", direction: "column", gap: 3, children: [
490
- canConfigureView ? /* @__PURE__ */ jsxRuntime.jsx(
491
- designSystem.LinkButton,
492
- {
493
- size: "S",
494
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ListPlus, {}),
495
- variant: "secondary",
496
- tag: reactRouterDom.NavLink,
497
- to: {
498
- pathname: "configurations/list",
499
- search: query.plugins ? qs.stringify({ plugins: query.plugins }, { encode: false }) : ""
500
- },
501
- children: formatMessage({
502
- id: "app.links.configure-view",
503
- defaultMessage: "Configure the view"
504
- })
505
- }
506
- ) : null,
507
- /* @__PURE__ */ jsxRuntime.jsx(FieldPicker, { ...props })
508
- ] })
509
- }
510
- )
511
- ] });
512
- };
513
- const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
514
- const { trackUsage } = strapiAdmin.useTracking();
515
- const { formatMessage, locale } = reactIntl.useIntl();
516
- const { schema, model } = index.useDoc();
517
- const { list } = index.useDocumentLayout(model);
518
- const formatter = designSystem.useCollator(locale, {
519
- sensitivity: "base"
520
- });
521
- const attributes = schema?.attributes ?? {};
522
- const columns = Object.keys(attributes).filter((name) => index.checkIfAttributeIsDisplayable(attributes[name])).map((name) => ({
523
- name,
524
- label: list.metadatas[name]?.label ?? ""
525
- })).sort((a, b) => formatter.compare(a.label, b.label));
526
- const handleChange = (name) => {
527
- trackUsage("didChangeDisplayedFields");
528
- const newHeaders = headers.includes(name) ? headers.filter((header) => header !== name) : [...headers, name];
529
- setHeaders(newHeaders);
530
- };
531
- const handleReset = () => {
532
- resetHeaders();
533
- };
534
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "fieldset", direction: "column", alignItems: "stretch", gap: 3, borderWidth: 0, children: [
535
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
536
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
537
- id: "containers.list.displayedFields",
538
- defaultMessage: "Displayed fields"
539
- }) }),
540
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TextButton, { onClick: handleReset, children: formatMessage({
541
- id: "app.components.Button.reset",
542
- defaultMessage: "Reset"
543
- }) })
544
- ] }),
545
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", children: columns.map((header) => {
546
- const isActive = headers.includes(header.name);
547
- return /* @__PURE__ */ jsxRuntime.jsxs(
548
- ChackboxWrapper,
549
- {
550
- wrap: "wrap",
551
- gap: 2,
552
- tag: "label",
553
- background: isActive ? "primary100" : "transparent",
554
- hasRadius: true,
555
- padding: 2,
556
- children: [
557
- /* @__PURE__ */ jsxRuntime.jsx(
558
- designSystem.BaseCheckbox,
559
- {
560
- onChange: () => handleChange(header.name),
561
- value: isActive,
562
- name: header.name
563
- }
564
- ),
565
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 1, children: header.label })
566
- ]
567
- },
568
- header.name
569
- );
570
- }) })
571
- ] });
572
- };
573
- const ChackboxWrapper = styledComponents.styled(designSystem.Flex)`
574
- :hover {
575
- background-color: ${(props) => props.theme.colors.primary100};
576
- }
577
- `;
578
- const { INJECT_COLUMN_IN_TABLE } = index.HOOKS;
579
- const ListViewPage = () => {
580
- const { trackUsage } = strapiAdmin.useTracking();
581
- const navigate = reactRouterDom.useNavigate();
582
- const { formatMessage } = reactIntl.useIntl();
583
- const { toggleNotification } = strapiAdmin.useNotification();
584
- const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler(index.getTranslation);
585
- const { collectionType, model, schema } = index.useDoc();
586
- const { list } = index.useDocumentLayout(model);
587
- const [displayedHeaders, setDisplayedHeaders] = React__namespace.useState([]);
588
- const listLayout = usePrev.usePrev(list.layout);
589
- React__namespace.useEffect(() => {
590
- if (!isEqual__default.default(listLayout, list.layout)) {
591
- setDisplayedHeaders(list.layout);
592
- }
593
- }, [list.layout, listLayout]);
594
- const handleSetHeaders = (headers) => {
595
- setDisplayedHeaders(
596
- index.convertListLayoutToFieldLayouts(headers, schema.attributes, list.metadatas)
597
- );
598
- };
599
- const [{ query }] = strapiAdmin.useQueryParams({
600
- page: "1",
601
- pageSize: list.settings.pageSize.toString(),
602
- sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
603
- });
604
- const params = React__namespace.useMemo(() => index.buildValidParams(query), [query]);
605
- const { data, error, isLoading } = index.useGetAllDocumentsQuery({
606
- model,
607
- params
608
- });
609
- React__namespace.useEffect(() => {
610
- if (error) {
611
- toggleNotification({
612
- type: "danger",
613
- message: formatAPIError(error)
614
- });
615
- }
616
- }, [error, formatAPIError, toggleNotification]);
617
- const { results = [], pagination } = data ?? {};
618
- React__namespace.useEffect(() => {
619
- if (pagination && pagination.pageCount > 0 && pagination.page > pagination.pageCount) {
620
- navigate(
621
- {
622
- search: qs.stringify({
623
- ...query,
624
- page: pagination.pageCount
625
- })
626
- },
627
- { replace: true }
628
- );
629
- }
630
- }, [pagination, formatMessage, query, navigate]);
631
- const { canCreate } = index.useDocumentRBAC("ListViewPage", ({ canCreate: canCreate2 }) => ({
632
- canCreate: canCreate2
633
- }));
634
- const runHookWaterfall = strapiAdmin.useStrapiApp("ListViewPage", ({ runHookWaterfall: runHookWaterfall2 }) => runHookWaterfall2);
635
- const tableHeaders = React__namespace.useMemo(() => {
636
- const headers = runHookWaterfall(INJECT_COLUMN_IN_TABLE, {
637
- displayedHeaders,
638
- layout: list
639
- });
640
- const formattedHeaders = headers.displayedHeaders.map((header) => {
641
- return {
642
- ...header,
643
- label: typeof header.label === "string" ? header.label : formatMessage(header.label),
644
- name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
645
- };
646
- });
647
- if (schema?.options?.draftAndPublish) {
648
- formattedHeaders.push({
649
- attribute: {
650
- type: "custom"
651
- },
652
- name: "status",
653
- label: formatMessage({
654
- id: index.getTranslation(`containers.list.table-headers.status`),
655
- defaultMessage: "status"
656
- }),
657
- searchable: false,
658
- sortable: false
659
- });
660
- }
661
- return formattedHeaders;
662
- }, [displayedHeaders, formatMessage, list, runHookWaterfall, schema?.options?.draftAndPublish]);
663
- if (isLoading) {
664
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
665
- }
666
- if (error) {
667
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
668
- }
669
- const contentTypeTitle = schema?.info.displayName ?? "Untitled";
670
- const handleRowClick = (id) => () => {
671
- trackUsage("willEditEntryFromList");
672
- navigate({
673
- pathname: id.toString(),
674
- search: qs.stringify({ plugins: query.plugins })
675
- });
676
- };
677
- return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Page.Main, { children: [
678
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Title, { children: `${contentTypeTitle}` }),
679
- /* @__PURE__ */ jsxRuntime.jsx(
680
- strapiAdmin.Layouts.Header,
681
- {
682
- primaryAction: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(CreateButton, {}) : null,
683
- subtitle: formatMessage(
684
- {
685
- id: index.getTranslation("pages.ListView.header-subtitle"),
686
- defaultMessage: "{number, plural, =0 {# entries} one {# entry} other {# entries}} found"
687
- },
688
- { number: pagination?.total }
689
- ),
690
- title: contentTypeTitle,
691
- navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {})
692
- }
693
- ),
694
- /* @__PURE__ */ jsxRuntime.jsx(
695
- strapiAdmin.Layouts.Action,
696
- {
697
- endActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
698
- /* @__PURE__ */ jsxRuntime.jsx(index.InjectionZone, { area: "listView.actions" }),
699
- /* @__PURE__ */ jsxRuntime.jsx(
700
- ViewSettingsMenu,
701
- {
702
- setHeaders: handleSetHeaders,
703
- resetHeaders: () => setDisplayedHeaders(list.layout),
704
- headers: displayedHeaders.map((header) => header.name)
705
- }
706
- )
707
- ] }),
708
- startActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
709
- list.settings.searchable && /* @__PURE__ */ jsxRuntime.jsx(
710
- strapiAdmin.SearchInput,
711
- {
712
- disabled: results.length === 0,
713
- label: formatMessage(
714
- { id: "app.component.search.label", defaultMessage: "Search for {target}" },
715
- { target: contentTypeTitle }
716
- ),
717
- placeholder: formatMessage({
718
- id: "global.search",
719
- defaultMessage: "Search"
720
- }),
721
- trackedEvent: "didSearch"
722
- }
723
- ),
724
- list.settings.filterable && schema ? /* @__PURE__ */ jsxRuntime.jsx(FiltersImpl, { disabled: results.length === 0, schema }) : null
725
- ] })
726
- }
727
- ),
728
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
729
- /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Root, { rows: results, headers: tableHeaders, isLoading, children: [
730
- /* @__PURE__ */ jsxRuntime.jsx(TableActionsBar, {}),
731
- /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Content, { children: [
732
- /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Head, { children: [
733
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCheckboxCell, {}),
734
- tableHeaders.map((header) => /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCell, { ...header }, header.name))
735
- ] }),
736
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Loading, {}),
737
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Empty, { action: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(CreateButton, { variant: "secondary" }) : null }),
738
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Body, { children: results.map((row) => {
739
- return /* @__PURE__ */ jsxRuntime.jsxs(
740
- strapiAdmin.Table.Row,
741
- {
742
- cursor: "pointer",
743
- onClick: handleRowClick(row.documentId),
744
- children: [
745
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.CheckboxCell, { id: row.id }),
746
- tableHeaders.map(({ cellFormatter, ...header }) => {
747
- if (header.name === "status") {
748
- const { status } = row;
749
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status, maxWidth: "min-content" }) }, header.name);
750
- }
751
- if (["createdBy", "updatedBy"].includes(header.name.split(".")[0])) {
752
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: row[header.name.split(".")[0]] ? index.getDisplayName(row[header.name.split(".")[0]]) : "-" }) }, header.name);
753
- }
754
- if (typeof cellFormatter === "function") {
755
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: cellFormatter(row, header, { collectionType, model }) }, header.name);
756
- }
757
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(
758
- CellContent,
759
- {
760
- content: row[header.name.split(".")[0]],
761
- rowId: row.documentId,
762
- ...header
763
- }
764
- ) }, header.name);
765
- }),
766
- /* @__PURE__ */ jsxRuntime.jsx(ActionsCell, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(index.TableActions, { document: row }) })
767
- ]
768
- },
769
- row.id
770
- );
771
- }) })
772
- ] })
773
- ] }),
774
- /* @__PURE__ */ jsxRuntime.jsxs(
775
- strapiAdmin.Pagination.Root,
776
- {
777
- ...pagination,
778
- onPageSizeChange: () => trackUsage("willChangeNumberOfEntriesPerPage"),
779
- children: [
780
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Pagination.PageSize, {}),
781
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Pagination.Links, {})
782
- ]
783
- }
784
- )
785
- ] }) })
786
- ] });
787
- };
788
- const ActionsCell = styledComponents.styled(strapiAdmin.Table.Cell)`
789
- display: flex;
790
- justify-content: flex-end;
791
- `;
792
- const TableActionsBar = () => {
793
- const selectRow = strapiAdmin.useTable("TableActionsBar", (state) => state.selectRow);
794
- const [{ query }] = strapiAdmin.useQueryParams();
795
- const locale = query?.plugins?.i18n?.locale;
796
- const prevLocale = usePrev.usePrev(locale);
797
- React__namespace.useEffect(() => {
798
- if (prevLocale !== locale) {
799
- selectRow([]);
800
- }
801
- }, [selectRow, prevLocale, locale]);
802
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.ActionBar, { children: /* @__PURE__ */ jsxRuntime.jsx(index.BulkActionsRenderer, {}) });
803
- };
804
- const CreateButton = ({ variant }) => {
805
- const { formatMessage } = reactIntl.useIntl();
806
- const { trackUsage } = strapiAdmin.useTracking();
807
- const [{ query }] = strapiAdmin.useQueryParams();
808
- return /* @__PURE__ */ jsxRuntime.jsx(
809
- designSystem.Button,
810
- {
811
- variant,
812
- tag: reactRouterDom.Link,
813
- onClick: () => {
814
- trackUsage("willCreateEntry", { status: "draft" });
815
- },
816
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Plus, {}),
817
- style: { textDecoration: "none" },
818
- to: {
819
- pathname: "create",
820
- search: qs.stringify({ plugins: query.plugins })
821
- },
822
- children: formatMessage({
823
- id: index.getTranslation("HeaderLayout.button.label-add-entry"),
824
- defaultMessage: "Create new entry"
825
- })
826
- }
827
- );
828
- };
829
- const ProtectedListViewPage = () => {
830
- const { slug = "" } = reactRouterDom.useParams();
831
- const {
832
- permissions = [],
833
- isLoading,
834
- error
835
- } = strapiAdmin.useRBAC(
836
- index.PERMISSIONS.map((action) => ({
837
- action,
838
- subject: slug
839
- }))
840
- );
841
- if (isLoading) {
842
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
843
- }
844
- if (error || !slug) {
845
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
846
- }
847
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsxRuntime.jsx(index.DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsxRuntime.jsx(ListViewPage, {}) }) });
848
- };
849
- exports.ListViewPage = ListViewPage;
850
- exports.ProtectedListViewPage = ProtectedListViewPage;
851
- //# sourceMappingURL=ListViewPage-CA3I75m5.js.map