@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,827 +0,0 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { useTracking, useAuth, useQueryParams, useAdminUsers, Filters, useField, useRBAC, useNotification, useAPIErrorHandler, useStrapiApp, Page, Layouts, BackButton, SearchInput, Table, Pagination, useTable } from "@strapi/admin/strapi-admin";
4
- import { useCollator, Combobox, ComboboxOption, Menu, Tooltip, Typography, Badge, Avatar, Flex, AvatarGroup, useNotifyAT, Loader, IconButton, Popover, LinkButton, TextButton, BaseCheckbox, Button } from "@strapi/design-system";
5
- import { Cog, ListPlus, Plus } from "@strapi/icons";
6
- import isEqual from "lodash/isEqual";
7
- import { stringify } from "qs";
8
- import { useIntl } from "react-intl";
9
- import { NavLink, useNavigate, Link, useParams } from "react-router-dom";
10
- import { styled } from "styled-components";
11
- import { u as useContentTypeSchema, o as useGetContentTypeConfigurationQuery, p as CREATOR_FIELDS, q as getMainField, t as getDisplayName, c as useDoc, g as getTranslation, h as useDocumentLayout, v as checkIfAttributeIsDisplayable, d as buildValidParams, w as useGetAllDocumentsQuery, f as useDocumentRBAC, I as InjectionZone, D as DocumentStatus, T as TableActions, B as BulkActionsRenderer, k as PERMISSIONS, l as DocumentRBAC, H as HOOKS, x as convertListLayoutToFieldLayouts } from "./index-Drt2DN7v.mjs";
12
- import { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./usePrev-DH6iah0A.mjs";
13
- import isEmpty from "lodash/isEmpty";
14
- import parseISO from "date-fns/parseISO";
15
- import toString from "lodash/toString";
16
- import { g as getRelationLabel, u as useGetRelationsQuery } from "./relations-D26zVRdi.mjs";
17
- import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
18
- const NOT_ALLOWED_FILTERS = [
19
- "json",
20
- "component",
21
- "media",
22
- "richtext",
23
- "dynamiczone",
24
- "password",
25
- "blocks"
26
- ];
27
- const DEFAULT_ALLOWED_FILTERS = ["createdAt", "updatedAt"];
28
- const USER_FILTER_ATTRIBUTES = [...CREATOR_FIELDS, "strapi_assignee"];
29
- const FiltersImpl = ({ disabled, schema }) => {
30
- const { attributes, uid: model, options } = schema;
31
- const { formatMessage, locale } = useIntl();
32
- const { trackUsage } = useTracking();
33
- const allPermissions = useAuth("FiltersImpl", (state) => state.permissions);
34
- const [{ query }] = useQueryParams();
35
- const { schemas } = useContentTypeSchema();
36
- const canReadAdminUsers = React.useMemo(
37
- () => allPermissions.filter(
38
- (permission) => permission.action === "admin::users.read" && permission.subject === null
39
- ).length > 0,
40
- [allPermissions]
41
- );
42
- const selectedUserIds = (query?.filters?.$and ?? []).reduce((acc, filter) => {
43
- const [key, value] = Object.entries(filter)[0];
44
- if (typeof value.id !== "object") {
45
- return acc;
46
- }
47
- const id = value.id.$eq || value.id.$ne;
48
- if (id && USER_FILTER_ATTRIBUTES.includes(key) && !acc.includes(id)) {
49
- acc.push(id);
50
- }
51
- return acc;
52
- }, []);
53
- const { data: userData, isLoading: isLoadingAdminUsers } = useAdminUsers(
54
- { filters: { id: { $in: selectedUserIds } } },
55
- {
56
- // fetch the list of admin users only if the filter contains users and the
57
- // current user has permissions to display users
58
- skip: selectedUserIds.length === 0 || !canReadAdminUsers
59
- }
60
- );
61
- const { users = [] } = userData ?? {};
62
- const { metadata } = useGetContentTypeConfigurationQuery(model, {
63
- selectFromResult: ({ data }) => ({ metadata: data?.contentType.metadatas ?? {} })
64
- });
65
- const formatter = useCollator(locale, {
66
- sensitivity: "base"
67
- });
68
- const displayedFilters = React.useMemo(() => {
69
- const [{ properties: { fields = [] } = { fields: [] } }] = allPermissions.filter(
70
- (permission) => permission.action === "plugin::content-manager.explorer.read" && permission.subject === model
71
- );
72
- const allowedFields = fields.filter((field) => {
73
- const attribute = attributes[field] ?? {};
74
- return attribute.type && !NOT_ALLOWED_FILTERS.includes(attribute.type);
75
- });
76
- return [
77
- "id",
78
- ...allowedFields,
79
- ...DEFAULT_ALLOWED_FILTERS,
80
- ...canReadAdminUsers ? CREATOR_FIELDS : []
81
- ].map((name) => {
82
- const attribute = attributes[name];
83
- if (NOT_ALLOWED_FILTERS.includes(attribute.type)) {
84
- return null;
85
- }
86
- const { mainField: mainFieldName = "", label } = metadata[name].list;
87
- let filter = {
88
- name,
89
- label: label ?? "",
90
- mainField: getMainField(attribute, mainFieldName, { schemas, components: {} }),
91
- // @ts-expect-error – TODO: this is filtered out above in the `allowedFields` call but TS complains, is there a better way to solve this?
92
- type: attribute.type
93
- };
94
- if (attribute.type === "relation" && "target" in attribute && attribute.target === "admin::user") {
95
- filter = {
96
- ...filter,
97
- input: AdminUsersFilter,
98
- options: users.map((user) => ({
99
- label: getDisplayName(user),
100
- value: user.id.toString()
101
- })),
102
- operators: [
103
- {
104
- label: formatMessage({
105
- id: "components.FilterOptions.FILTER_TYPES.$eq",
106
- defaultMessage: "is"
107
- }),
108
- value: "$eq"
109
- },
110
- {
111
- label: formatMessage({
112
- id: "components.FilterOptions.FILTER_TYPES.$ne",
113
- defaultMessage: "is not"
114
- }),
115
- value: "$ne"
116
- }
117
- ],
118
- mainField: {
119
- name: "id",
120
- type: "integer"
121
- }
122
- };
123
- }
124
- return filter;
125
- }).filter(Boolean).toSorted((a, b) => formatter.compare(a.label, b.label));
126
- }, [
127
- allPermissions,
128
- canReadAdminUsers,
129
- model,
130
- attributes,
131
- metadata,
132
- schemas,
133
- users,
134
- formatMessage,
135
- formatter
136
- ]);
137
- const onOpenChange = (isOpen) => {
138
- if (isOpen) {
139
- trackUsage("willFilterEntries");
140
- }
141
- };
142
- const handleFilterChange = (data) => {
143
- const attribute = attributes[data.name];
144
- if (attribute) {
145
- trackUsage("didFilterEntries", {
146
- useRelation: attribute.type === "relation"
147
- });
148
- }
149
- };
150
- return /* @__PURE__ */ jsxs(
151
- Filters.Root,
152
- {
153
- disabled,
154
- options: displayedFilters,
155
- onOpenChange,
156
- onChange: handleFilterChange,
157
- children: [
158
- /* @__PURE__ */ jsx(Filters.Trigger, {}),
159
- /* @__PURE__ */ jsx(Filters.Popover, {}),
160
- /* @__PURE__ */ jsx(Filters.List, {})
161
- ]
162
- }
163
- );
164
- };
165
- const AdminUsersFilter = ({ name }) => {
166
- const [page, setPage] = React.useState(1);
167
- const { formatMessage } = useIntl();
168
- const { data, isLoading } = useAdminUsers({
169
- page
170
- });
171
- const field = useField(name);
172
- const handleOpenChange = (isOpen) => {
173
- if (!isOpen) {
174
- setPage(1);
175
- }
176
- };
177
- const users = data?.users || [];
178
- return /* @__PURE__ */ jsx(
179
- Combobox,
180
- {
181
- value: field.value,
182
- "aria-label": formatMessage({
183
- id: "content-manager.components.Filters.usersSelect.label",
184
- defaultMessage: "Search and select a user to filter"
185
- }),
186
- onOpenChange: handleOpenChange,
187
- onChange: (value) => field.onChange(name, value),
188
- loading: isLoading,
189
- onLoadMore: () => setPage((prev) => prev + 1),
190
- children: users.map((user) => {
191
- return /* @__PURE__ */ jsx(ComboboxOption, { value: user.id.toString(), children: getDisplayName(user) }, user.id);
192
- })
193
- }
194
- );
195
- };
196
- const CellValue = ({ type, value }) => {
197
- const { formatDate, formatTime, formatNumber } = useIntl();
198
- let formattedValue = value;
199
- if (type === "date") {
200
- formattedValue = formatDate(parseISO(value), { dateStyle: "full" });
201
- }
202
- if (type === "datetime") {
203
- formattedValue = formatDate(value, { dateStyle: "full", timeStyle: "short" });
204
- }
205
- if (type === "time") {
206
- const [hour, minute, second] = value.split(":");
207
- const date = /* @__PURE__ */ new Date();
208
- date.setHours(hour);
209
- date.setMinutes(minute);
210
- date.setSeconds(second);
211
- formattedValue = formatTime(date, {
212
- timeStyle: "short"
213
- });
214
- }
215
- if (["float", "decimal"].includes(type)) {
216
- formattedValue = formatNumber(value, {
217
- // Should be kept in sync with the corresponding value
218
- // in the design-system/NumberInput: https://github.com/strapi/design-system/blob/main/packages/strapi-design-system/src/NumberInput/NumberInput.js#L53
219
- maximumFractionDigits: 20
220
- });
221
- }
222
- if (["integer", "biginteger"].includes(type)) {
223
- formattedValue = formatNumber(value, { maximumFractionDigits: 0 });
224
- }
225
- return toString(formattedValue);
226
- };
227
- const SingleComponent = ({ content, mainField }) => {
228
- if (!mainField) {
229
- return null;
230
- }
231
- return /* @__PURE__ */ jsx(Tooltip, { label: content[mainField.name], children: /* @__PURE__ */ jsx(Typography, { maxWidth: "25rem", textColor: "neutral800", ellipsis: true, children: /* @__PURE__ */ jsx(CellValue, { type: mainField.type, value: content[mainField.name] }) }) });
232
- };
233
- const RepeatableComponent = ({ content, mainField }) => {
234
- const { formatMessage } = useIntl();
235
- if (!mainField) {
236
- return null;
237
- }
238
- return /* @__PURE__ */ jsxs(Menu.Root, { children: [
239
- /* @__PURE__ */ jsxs(MenuTrigger$1, { onClick: (e) => e.stopPropagation(), children: [
240
- /* @__PURE__ */ jsx(Badge, { children: content.length }),
241
- " ",
242
- formatMessage(
243
- {
244
- id: "content-manager.containers.list.items",
245
- defaultMessage: "{number, plural, =0 {items} one {item} other {items}}"
246
- },
247
- { number: content.length }
248
- )
249
- ] }),
250
- /* @__PURE__ */ jsx(Menu.Content, { children: content.map((item) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", ellipsis: true, children: /* @__PURE__ */ jsx(CellValue, { type: mainField.type, value: item[mainField.name] }) }) }, item.id)) })
251
- ] });
252
- };
253
- const MenuTrigger$1 = styled(Menu.Trigger)`
254
- svg {
255
- width: 0.6rem;
256
- height: 0.4rem;
257
- }
258
- `;
259
- const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
260
- const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
261
- const fileURL = prefixFileUrlWithBackendUrl(url);
262
- if (mime.includes("image")) {
263
- const thumbnail = formats?.thumbnail?.url;
264
- const mediaURL = prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
265
- return /* @__PURE__ */ jsx(Avatar, { src: mediaURL, alt: alternativeText || name, preview: true });
266
- }
267
- const fileExtension = getFileExtension(ext);
268
- const fileName = name.length > 100 ? `${name.substring(0, 100)}...` : name;
269
- return /* @__PURE__ */ jsx(Tooltip, { description: fileName, children: /* @__PURE__ */ jsx(FileWrapper, { children: fileExtension }) });
270
- };
271
- const FileWrapper = ({ children }) => {
272
- return /* @__PURE__ */ jsx(
273
- Flex,
274
- {
275
- tag: "span",
276
- position: "relative",
277
- borderRadius: "50%",
278
- width: "26px",
279
- height: "26px",
280
- borderColor: "neutral200",
281
- background: "neutral150",
282
- paddingLeft: "1px",
283
- justifyContent: "center",
284
- alignItems: "center",
285
- children: /* @__PURE__ */ jsx(FileTypography, { variant: "sigma", textColor: "neutral600", children })
286
- }
287
- );
288
- };
289
- const FileTypography = styled(Typography)`
290
- font-size: 0.9rem;
291
- line-height: 0.9rem;
292
- `;
293
- const MediaMultiple = ({ content }) => {
294
- return /* @__PURE__ */ jsx(AvatarGroup, { children: content.map((file, index) => {
295
- const key = `${file.id}${index}`;
296
- if (index === 3) {
297
- const remainingFiles = `+${content.length - 3}`;
298
- return /* @__PURE__ */ jsx(FileWrapper, { children: remainingFiles }, key);
299
- }
300
- if (index > 3) {
301
- return null;
302
- }
303
- return /* @__PURE__ */ jsx(MediaSingle, { ...file }, key);
304
- }) });
305
- };
306
- const RelationSingle = ({ mainField, content }) => {
307
- return /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", textColor: "neutral800", ellipsis: true, children: getRelationLabel(content, mainField) });
308
- };
309
- const RelationMultiple = ({ mainField, content, rowId, name }) => {
310
- const { model } = useDoc();
311
- const { formatMessage } = useIntl();
312
- const { notifyStatus } = useNotifyAT();
313
- const [isOpen, setIsOpen] = React.useState(false);
314
- const [targetField] = name.split(".");
315
- const { data, isLoading } = useGetRelationsQuery(
316
- {
317
- model,
318
- id: rowId,
319
- targetField
320
- },
321
- {
322
- skip: !isOpen,
323
- refetchOnMountOrArgChange: true
324
- }
325
- );
326
- React.useEffect(() => {
327
- if (data) {
328
- notifyStatus(
329
- formatMessage({
330
- id: getTranslation("DynamicTable.relation-loaded"),
331
- defaultMessage: "Relations have been loaded"
332
- })
333
- );
334
- }
335
- }, [data, formatMessage, notifyStatus]);
336
- return /* @__PURE__ */ jsxs(Menu.Root, { onOpenChange: (isOpen2) => setIsOpen(isOpen2), children: [
337
- /* @__PURE__ */ jsx(MenuTrigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxs(Flex, { gap: 1, wrap: "nowrap", children: [
338
- /* @__PURE__ */ jsx(Badge, { children: content.count }),
339
- formatMessage(
340
- {
341
- id: "content-manager.containers.list.items",
342
- defaultMessage: "{number, plural, =0 {items} one {item} other {items}}"
343
- },
344
- { number: content.count }
345
- )
346
- ] }) }),
347
- /* @__PURE__ */ jsxs(Menu.Content, { children: [
348
- isLoading && /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Loader, { small: true, children: formatMessage({
349
- id: getTranslation("ListViewTable.relation-loading"),
350
- defaultMessage: "Relations are loading"
351
- }) }) }),
352
- data?.results && /* @__PURE__ */ jsxs(Fragment, { children: [
353
- data.results.map((entry) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", ellipsis: true, children: getRelationLabel(entry, mainField) }) }, entry.documentId)),
354
- data?.pagination && data?.pagination.total > 10 && /* @__PURE__ */ jsx(
355
- Menu.Item,
356
- {
357
- "aria-disabled": true,
358
- "aria-label": formatMessage({
359
- id: getTranslation("ListViewTable.relation-more"),
360
- defaultMessage: "This relation contains more entities than displayed"
361
- }),
362
- children: /* @__PURE__ */ jsx(Typography, { children: "…" })
363
- }
364
- )
365
- ] })
366
- ] })
367
- ] });
368
- };
369
- const MenuTrigger = styled(Menu.Trigger)`
370
- svg {
371
- width: 0.6rem;
372
- height: 0.4rem;
373
- }
374
- `;
375
- const CellContent = ({ content, mainField, attribute, rowId, name }) => {
376
- if (!hasContent(content, mainField, attribute)) {
377
- return /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: "-" });
378
- }
379
- switch (attribute.type) {
380
- case "media":
381
- if (!attribute.multiple) {
382
- return /* @__PURE__ */ jsx(MediaSingle, { ...content });
383
- }
384
- return /* @__PURE__ */ jsx(MediaMultiple, { content });
385
- case "relation": {
386
- if (isSingleRelation(attribute.relation)) {
387
- return /* @__PURE__ */ jsx(RelationSingle, { mainField, content });
388
- }
389
- return /* @__PURE__ */ jsx(RelationMultiple, { rowId, mainField, content, name });
390
- }
391
- case "component":
392
- if (attribute.repeatable) {
393
- return /* @__PURE__ */ jsx(RepeatableComponent, { mainField, content });
394
- }
395
- return /* @__PURE__ */ jsx(SingleComponent, { mainField, content });
396
- case "string":
397
- return /* @__PURE__ */ jsx(Tooltip, { description: content, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) }) });
398
- default:
399
- return /* @__PURE__ */ jsx(Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) });
400
- }
401
- };
402
- const hasContent = (content, mainField, attribute) => {
403
- if (attribute.type === "component") {
404
- if (attribute.repeatable || !mainField) {
405
- return content?.length > 0;
406
- }
407
- const value = content?.[mainField.name];
408
- if (mainField.name === "id" && ![void 0, null].includes(value)) {
409
- return true;
410
- }
411
- return !isEmpty(value);
412
- }
413
- if (attribute.type === "relation") {
414
- if (isSingleRelation(attribute.relation)) {
415
- return !isEmpty(content);
416
- }
417
- return content?.count > 0;
418
- }
419
- if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
420
- return typeof content === "number";
421
- }
422
- if (attribute.type === "boolean") {
423
- return content !== null;
424
- }
425
- return !isEmpty(content);
426
- };
427
- const isSingleRelation = (type) => ["oneToOne", "manyToOne", "oneToOneMorph"].includes(type);
428
- const ViewSettingsMenu = (props) => {
429
- const [isVisible, setIsVisible] = React.useState(false);
430
- const cogButtonRef = React.useRef(null);
431
- const permissions = useTypedSelector(
432
- (state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []
433
- );
434
- const [{ query }] = useQueryParams();
435
- const { formatMessage } = useIntl();
436
- const {
437
- allowedActions: { canConfigureView }
438
- } = useRBAC(permissions);
439
- const handleToggle = () => {
440
- setIsVisible((prev) => !prev);
441
- };
442
- return /* @__PURE__ */ jsxs(Fragment, { children: [
443
- /* @__PURE__ */ jsx(
444
- IconButton,
445
- {
446
- label: formatMessage({
447
- id: "components.ViewSettings.tooltip",
448
- defaultMessage: "View Settings"
449
- }),
450
- ref: cogButtonRef,
451
- onClick: handleToggle,
452
- children: /* @__PURE__ */ jsx(Cog, {})
453
- }
454
- ),
455
- isVisible && /* @__PURE__ */ jsx(
456
- Popover,
457
- {
458
- placement: "bottom-end",
459
- source: cogButtonRef,
460
- onDismiss: handleToggle,
461
- spacing: 4,
462
- padding: 3,
463
- children: /* @__PURE__ */ jsxs(Flex, { alignItems: "stretch", direction: "column", gap: 3, children: [
464
- canConfigureView ? /* @__PURE__ */ jsx(
465
- LinkButton,
466
- {
467
- size: "S",
468
- startIcon: /* @__PURE__ */ jsx(ListPlus, {}),
469
- variant: "secondary",
470
- tag: NavLink,
471
- to: {
472
- pathname: "configurations/list",
473
- search: query.plugins ? stringify({ plugins: query.plugins }, { encode: false }) : ""
474
- },
475
- children: formatMessage({
476
- id: "app.links.configure-view",
477
- defaultMessage: "Configure the view"
478
- })
479
- }
480
- ) : null,
481
- /* @__PURE__ */ jsx(FieldPicker, { ...props })
482
- ] })
483
- }
484
- )
485
- ] });
486
- };
487
- const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
488
- const { trackUsage } = useTracking();
489
- const { formatMessage, locale } = useIntl();
490
- const { schema, model } = useDoc();
491
- const { list } = useDocumentLayout(model);
492
- const formatter = useCollator(locale, {
493
- sensitivity: "base"
494
- });
495
- const attributes = schema?.attributes ?? {};
496
- const columns = Object.keys(attributes).filter((name) => checkIfAttributeIsDisplayable(attributes[name])).map((name) => ({
497
- name,
498
- label: list.metadatas[name]?.label ?? ""
499
- })).sort((a, b) => formatter.compare(a.label, b.label));
500
- const handleChange = (name) => {
501
- trackUsage("didChangeDisplayedFields");
502
- const newHeaders = headers.includes(name) ? headers.filter((header) => header !== name) : [...headers, name];
503
- setHeaders(newHeaders);
504
- };
505
- const handleReset = () => {
506
- resetHeaders();
507
- };
508
- return /* @__PURE__ */ jsxs(Flex, { tag: "fieldset", direction: "column", alignItems: "stretch", gap: 3, borderWidth: 0, children: [
509
- /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", children: [
510
- /* @__PURE__ */ jsx(Typography, { tag: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
511
- id: "containers.list.displayedFields",
512
- defaultMessage: "Displayed fields"
513
- }) }),
514
- /* @__PURE__ */ jsx(TextButton, { onClick: handleReset, children: formatMessage({
515
- id: "app.components.Button.reset",
516
- defaultMessage: "Reset"
517
- }) })
518
- ] }),
519
- /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", children: columns.map((header) => {
520
- const isActive = headers.includes(header.name);
521
- return /* @__PURE__ */ jsxs(
522
- ChackboxWrapper,
523
- {
524
- wrap: "wrap",
525
- gap: 2,
526
- tag: "label",
527
- background: isActive ? "primary100" : "transparent",
528
- hasRadius: true,
529
- padding: 2,
530
- children: [
531
- /* @__PURE__ */ jsx(
532
- BaseCheckbox,
533
- {
534
- onChange: () => handleChange(header.name),
535
- value: isActive,
536
- name: header.name
537
- }
538
- ),
539
- /* @__PURE__ */ jsx(Typography, { fontSize: 1, children: header.label })
540
- ]
541
- },
542
- header.name
543
- );
544
- }) })
545
- ] });
546
- };
547
- const ChackboxWrapper = styled(Flex)`
548
- :hover {
549
- background-color: ${(props) => props.theme.colors.primary100};
550
- }
551
- `;
552
- const { INJECT_COLUMN_IN_TABLE } = HOOKS;
553
- const ListViewPage = () => {
554
- const { trackUsage } = useTracking();
555
- const navigate = useNavigate();
556
- const { formatMessage } = useIntl();
557
- const { toggleNotification } = useNotification();
558
- const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler(getTranslation);
559
- const { collectionType, model, schema } = useDoc();
560
- const { list } = useDocumentLayout(model);
561
- const [displayedHeaders, setDisplayedHeaders] = React.useState([]);
562
- const listLayout = usePrev(list.layout);
563
- React.useEffect(() => {
564
- if (!isEqual(listLayout, list.layout)) {
565
- setDisplayedHeaders(list.layout);
566
- }
567
- }, [list.layout, listLayout]);
568
- const handleSetHeaders = (headers) => {
569
- setDisplayedHeaders(
570
- convertListLayoutToFieldLayouts(headers, schema.attributes, list.metadatas)
571
- );
572
- };
573
- const [{ query }] = useQueryParams({
574
- page: "1",
575
- pageSize: list.settings.pageSize.toString(),
576
- sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
577
- });
578
- const params = React.useMemo(() => buildValidParams(query), [query]);
579
- const { data, error, isLoading } = useGetAllDocumentsQuery({
580
- model,
581
- params
582
- });
583
- React.useEffect(() => {
584
- if (error) {
585
- toggleNotification({
586
- type: "danger",
587
- message: formatAPIError(error)
588
- });
589
- }
590
- }, [error, formatAPIError, toggleNotification]);
591
- const { results = [], pagination } = data ?? {};
592
- React.useEffect(() => {
593
- if (pagination && pagination.pageCount > 0 && pagination.page > pagination.pageCount) {
594
- navigate(
595
- {
596
- search: stringify({
597
- ...query,
598
- page: pagination.pageCount
599
- })
600
- },
601
- { replace: true }
602
- );
603
- }
604
- }, [pagination, formatMessage, query, navigate]);
605
- const { canCreate } = useDocumentRBAC("ListViewPage", ({ canCreate: canCreate2 }) => ({
606
- canCreate: canCreate2
607
- }));
608
- const runHookWaterfall = useStrapiApp("ListViewPage", ({ runHookWaterfall: runHookWaterfall2 }) => runHookWaterfall2);
609
- const tableHeaders = React.useMemo(() => {
610
- const headers = runHookWaterfall(INJECT_COLUMN_IN_TABLE, {
611
- displayedHeaders,
612
- layout: list
613
- });
614
- const formattedHeaders = headers.displayedHeaders.map((header) => {
615
- return {
616
- ...header,
617
- label: typeof header.label === "string" ? header.label : formatMessage(header.label),
618
- name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
619
- };
620
- });
621
- if (schema?.options?.draftAndPublish) {
622
- formattedHeaders.push({
623
- attribute: {
624
- type: "custom"
625
- },
626
- name: "status",
627
- label: formatMessage({
628
- id: getTranslation(`containers.list.table-headers.status`),
629
- defaultMessage: "status"
630
- }),
631
- searchable: false,
632
- sortable: false
633
- });
634
- }
635
- return formattedHeaders;
636
- }, [displayedHeaders, formatMessage, list, runHookWaterfall, schema?.options?.draftAndPublish]);
637
- if (isLoading) {
638
- return /* @__PURE__ */ jsx(Page.Loading, {});
639
- }
640
- if (error) {
641
- return /* @__PURE__ */ jsx(Page.Error, {});
642
- }
643
- const contentTypeTitle = schema?.info.displayName ?? "Untitled";
644
- const handleRowClick = (id) => () => {
645
- trackUsage("willEditEntryFromList");
646
- navigate({
647
- pathname: id.toString(),
648
- search: stringify({ plugins: query.plugins })
649
- });
650
- };
651
- return /* @__PURE__ */ jsxs(Page.Main, { children: [
652
- /* @__PURE__ */ jsx(Page.Title, { children: `${contentTypeTitle}` }),
653
- /* @__PURE__ */ jsx(
654
- Layouts.Header,
655
- {
656
- primaryAction: canCreate ? /* @__PURE__ */ jsx(CreateButton, {}) : null,
657
- subtitle: formatMessage(
658
- {
659
- id: getTranslation("pages.ListView.header-subtitle"),
660
- defaultMessage: "{number, plural, =0 {# entries} one {# entry} other {# entries}} found"
661
- },
662
- { number: pagination?.total }
663
- ),
664
- title: contentTypeTitle,
665
- navigationAction: /* @__PURE__ */ jsx(BackButton, {})
666
- }
667
- ),
668
- /* @__PURE__ */ jsx(
669
- Layouts.Action,
670
- {
671
- endActions: /* @__PURE__ */ jsxs(Fragment, { children: [
672
- /* @__PURE__ */ jsx(InjectionZone, { area: "listView.actions" }),
673
- /* @__PURE__ */ jsx(
674
- ViewSettingsMenu,
675
- {
676
- setHeaders: handleSetHeaders,
677
- resetHeaders: () => setDisplayedHeaders(list.layout),
678
- headers: displayedHeaders.map((header) => header.name)
679
- }
680
- )
681
- ] }),
682
- startActions: /* @__PURE__ */ jsxs(Fragment, { children: [
683
- list.settings.searchable && /* @__PURE__ */ jsx(
684
- SearchInput,
685
- {
686
- disabled: results.length === 0,
687
- label: formatMessage(
688
- { id: "app.component.search.label", defaultMessage: "Search for {target}" },
689
- { target: contentTypeTitle }
690
- ),
691
- placeholder: formatMessage({
692
- id: "global.search",
693
- defaultMessage: "Search"
694
- }),
695
- trackedEvent: "didSearch"
696
- }
697
- ),
698
- list.settings.filterable && schema ? /* @__PURE__ */ jsx(FiltersImpl, { disabled: results.length === 0, schema }) : null
699
- ] })
700
- }
701
- ),
702
- /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsxs(Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
703
- /* @__PURE__ */ jsxs(Table.Root, { rows: results, headers: tableHeaders, isLoading, children: [
704
- /* @__PURE__ */ jsx(TableActionsBar, {}),
705
- /* @__PURE__ */ jsxs(Table.Content, { children: [
706
- /* @__PURE__ */ jsxs(Table.Head, { children: [
707
- /* @__PURE__ */ jsx(Table.HeaderCheckboxCell, {}),
708
- tableHeaders.map((header) => /* @__PURE__ */ jsx(Table.HeaderCell, { ...header }, header.name))
709
- ] }),
710
- /* @__PURE__ */ jsx(Table.Loading, {}),
711
- /* @__PURE__ */ jsx(Table.Empty, { action: canCreate ? /* @__PURE__ */ jsx(CreateButton, { variant: "secondary" }) : null }),
712
- /* @__PURE__ */ jsx(Table.Body, { children: results.map((row) => {
713
- return /* @__PURE__ */ jsxs(
714
- Table.Row,
715
- {
716
- cursor: "pointer",
717
- onClick: handleRowClick(row.documentId),
718
- children: [
719
- /* @__PURE__ */ jsx(Table.CheckboxCell, { id: row.id }),
720
- tableHeaders.map(({ cellFormatter, ...header }) => {
721
- if (header.name === "status") {
722
- const { status } = row;
723
- return /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(DocumentStatus, { status, maxWidth: "min-content" }) }, header.name);
724
- }
725
- if (["createdBy", "updatedBy"].includes(header.name.split(".")[0])) {
726
- return /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: row[header.name.split(".")[0]] ? getDisplayName(row[header.name.split(".")[0]]) : "-" }) }, header.name);
727
- }
728
- if (typeof cellFormatter === "function") {
729
- return /* @__PURE__ */ jsx(Table.Cell, { children: cellFormatter(row, header, { collectionType, model }) }, header.name);
730
- }
731
- return /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(
732
- CellContent,
733
- {
734
- content: row[header.name.split(".")[0]],
735
- rowId: row.documentId,
736
- ...header
737
- }
738
- ) }, header.name);
739
- }),
740
- /* @__PURE__ */ jsx(ActionsCell, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(TableActions, { document: row }) })
741
- ]
742
- },
743
- row.id
744
- );
745
- }) })
746
- ] })
747
- ] }),
748
- /* @__PURE__ */ jsxs(
749
- Pagination.Root,
750
- {
751
- ...pagination,
752
- onPageSizeChange: () => trackUsage("willChangeNumberOfEntriesPerPage"),
753
- children: [
754
- /* @__PURE__ */ jsx(Pagination.PageSize, {}),
755
- /* @__PURE__ */ jsx(Pagination.Links, {})
756
- ]
757
- }
758
- )
759
- ] }) })
760
- ] });
761
- };
762
- const ActionsCell = styled(Table.Cell)`
763
- display: flex;
764
- justify-content: flex-end;
765
- `;
766
- const TableActionsBar = () => {
767
- const selectRow = useTable("TableActionsBar", (state) => state.selectRow);
768
- const [{ query }] = useQueryParams();
769
- const locale = query?.plugins?.i18n?.locale;
770
- const prevLocale = usePrev(locale);
771
- React.useEffect(() => {
772
- if (prevLocale !== locale) {
773
- selectRow([]);
774
- }
775
- }, [selectRow, prevLocale, locale]);
776
- return /* @__PURE__ */ jsx(Table.ActionBar, { children: /* @__PURE__ */ jsx(BulkActionsRenderer, {}) });
777
- };
778
- const CreateButton = ({ variant }) => {
779
- const { formatMessage } = useIntl();
780
- const { trackUsage } = useTracking();
781
- const [{ query }] = useQueryParams();
782
- return /* @__PURE__ */ jsx(
783
- Button,
784
- {
785
- variant,
786
- tag: Link,
787
- onClick: () => {
788
- trackUsage("willCreateEntry", { status: "draft" });
789
- },
790
- startIcon: /* @__PURE__ */ jsx(Plus, {}),
791
- style: { textDecoration: "none" },
792
- to: {
793
- pathname: "create",
794
- search: stringify({ plugins: query.plugins })
795
- },
796
- children: formatMessage({
797
- id: getTranslation("HeaderLayout.button.label-add-entry"),
798
- defaultMessage: "Create new entry"
799
- })
800
- }
801
- );
802
- };
803
- const ProtectedListViewPage = () => {
804
- const { slug = "" } = useParams();
805
- const {
806
- permissions = [],
807
- isLoading,
808
- error
809
- } = useRBAC(
810
- PERMISSIONS.map((action) => ({
811
- action,
812
- subject: slug
813
- }))
814
- );
815
- if (isLoading) {
816
- return /* @__PURE__ */ jsx(Page.Loading, {});
817
- }
818
- if (error || !slug) {
819
- return /* @__PURE__ */ jsx(Page.Error, {});
820
- }
821
- return /* @__PURE__ */ jsx(Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsx(DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsx(ListViewPage, {}) }) });
822
- };
823
- export {
824
- ListViewPage,
825
- ProtectedListViewPage
826
- };
827
- //# sourceMappingURL=ListViewPage-nQrOQuVo.mjs.map