@strapi/content-manager 0.0.0-experimental.d954d57341a6623992a0d211daaec8e245c3517d → 0.0.0-experimental.da32ec023171430e0b0185c39f3cdd0f22d36928

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 (510) hide show
  1. package/LICENSE +18 -3
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs +80 -0
  3. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.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-CDdMKAWK.mjs +277 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-CDdMKAWK.mjs.map +1 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-Chgwb2_D.js +299 -0
  9. package/dist/admin/chunks/ComponentConfigurationPage-Chgwb2_D.js.map +1 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs +153 -0
  11. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.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-BoMCCA_K.js +181 -0
  15. package/dist/admin/chunks/EditConfigurationPage-BoMCCA_K.js.map +1 -0
  16. package/dist/admin/chunks/EditConfigurationPage-BpZ-7iS_.mjs +159 -0
  17. package/dist/admin/chunks/EditConfigurationPage-BpZ-7iS_.mjs.map +1 -0
  18. package/dist/admin/chunks/EditViewPage-BxBBDnbA.mjs +311 -0
  19. package/dist/admin/chunks/EditViewPage-BxBBDnbA.mjs.map +1 -0
  20. package/dist/admin/chunks/EditViewPage-DDQJ6nN8.js +334 -0
  21. package/dist/admin/chunks/EditViewPage-DDQJ6nN8.js.map +1 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs +56 -0
  23. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.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-CMXKHUSB.mjs +955 -0
  27. package/dist/admin/chunks/Form-CMXKHUSB.mjs.map +1 -0
  28. package/dist/admin/chunks/Form-Ue9BgNLx.js +978 -0
  29. package/dist/admin/chunks/Form-Ue9BgNLx.js.map +1 -0
  30. package/dist/admin/chunks/History-B4Vjlln_.mjs +1357 -0
  31. package/dist/admin/chunks/History-B4Vjlln_.mjs.map +1 -0
  32. package/dist/admin/chunks/History-DPYlCgmi.js +1380 -0
  33. package/dist/admin/chunks/History-DPYlCgmi.js.map +1 -0
  34. package/dist/admin/chunks/Input-CcT8Vq7h.js +7221 -0
  35. package/dist/admin/chunks/Input-CcT8Vq7h.js.map +1 -0
  36. package/dist/admin/chunks/Input-DcpiXDDO.mjs +7190 -0
  37. package/dist/admin/chunks/Input-DcpiXDDO.mjs.map +1 -0
  38. package/dist/admin/chunks/ListConfigurationPage-CjxVk7kj.js +819 -0
  39. package/dist/admin/chunks/ListConfigurationPage-CjxVk7kj.js.map +1 -0
  40. package/dist/admin/chunks/ListConfigurationPage-G_Cz9WFL.mjs +796 -0
  41. package/dist/admin/chunks/ListConfigurationPage-G_Cz9WFL.mjs.map +1 -0
  42. package/dist/admin/chunks/ListViewPage-BH9y9wWZ.mjs +1133 -0
  43. package/dist/admin/chunks/ListViewPage-BH9y9wWZ.mjs.map +1 -0
  44. package/dist/admin/chunks/ListViewPage-qMhB1UqY.js +1155 -0
  45. package/dist/admin/chunks/ListViewPage-qMhB1UqY.js.map +1 -0
  46. package/dist/admin/chunks/NoContentTypePage-BLUoMKZ_.js +60 -0
  47. package/dist/admin/chunks/NoContentTypePage-BLUoMKZ_.js.map +1 -0
  48. package/dist/admin/chunks/NoContentTypePage-mYArz90T.mjs +58 -0
  49. package/dist/admin/chunks/NoContentTypePage-mYArz90T.mjs.map +1 -0
  50. package/dist/admin/chunks/NoPermissionsPage-BVzIK2Ow.js +39 -0
  51. package/dist/admin/chunks/NoPermissionsPage-BVzIK2Ow.js.map +1 -0
  52. package/dist/admin/chunks/NoPermissionsPage-BqSDIp-C.mjs +37 -0
  53. package/dist/admin/chunks/NoPermissionsPage-BqSDIp-C.mjs.map +1 -0
  54. package/dist/admin/chunks/Preview-DagVJbW4.mjs +678 -0
  55. package/dist/admin/chunks/Preview-DagVJbW4.mjs.map +1 -0
  56. package/dist/admin/chunks/Preview-wmE3ppOA.js +700 -0
  57. package/dist/admin/chunks/Preview-wmE3ppOA.js.map +1 -0
  58. package/dist/admin/chunks/Relations-9myHwMP-.js +1318 -0
  59. package/dist/admin/chunks/Relations-9myHwMP-.js.map +1 -0
  60. package/dist/admin/chunks/Relations-B0zeKfDU.mjs +1291 -0
  61. package/dist/admin/chunks/Relations-B0zeKfDU.mjs.map +1 -0
  62. package/dist/admin/chunks/ar-DckYq_WK.mjs +222 -0
  63. package/dist/{_chunks/ar-CCEVvqGG.mjs.map → admin/chunks/ar-DckYq_WK.mjs.map} +1 -1
  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.mjs +197 -0
  69. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  70. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  71. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  72. package/dist/admin/chunks/cs-C7OSYFQ7.mjs +122 -0
  73. package/dist/{_chunks/cs-CM2aBUar.mjs.map → admin/chunks/cs-C7OSYFQ7.mjs.map} +1 -1
  74. package/dist/admin/chunks/de-5QRlDHyR.mjs +195 -0
  75. package/dist/{_chunks/eu-CdALomew.mjs.map → admin/chunks/de-5QRlDHyR.mjs.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-CImiNxXE.mjs +310 -0
  79. package/dist/{_chunks/en-Ux26r5pl.mjs.map → admin/chunks/en-CImiNxXE.mjs.map} +1 -1
  80. package/dist/admin/chunks/en-CLf4SuMQ.js +315 -0
  81. package/dist/admin/chunks/en-CLf4SuMQ.js.map +1 -0
  82. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  83. package/dist/{_chunks/es-EUonQTon.js.map → admin/chunks/es-C8vLuvZL.js.map} +1 -1
  84. package/dist/admin/chunks/es-DkoWSExG.mjs +192 -0
  85. package/dist/{_chunks/ja-CtsUxOvk.mjs.map → admin/chunks/es-DkoWSExG.mjs.map} +1 -1
  86. package/dist/admin/chunks/eu-BG1xX7HK.mjs +198 -0
  87. package/dist/admin/chunks/eu-BG1xX7HK.mjs.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.mjs +215 -0
  91. package/dist/admin/chunks/fr-CFdRaRVj.mjs.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.mjs +196 -0
  95. package/dist/admin/chunks/gu-D5MMMXRs.mjs.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.mjs +196 -0
  101. package/dist/admin/chunks/hi-lp17SCjr.mjs.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_.mjs +7 -0
  105. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.mjs +198 -0
  107. package/dist/admin/chunks/hu-CLka1U2C.mjs.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.mjs +156 -0
  113. package/dist/{_chunks/id-BtwA9WJT.mjs.map → admin/chunks/id-USfY9m1g.mjs.map} +1 -1
  114. package/dist/admin/chunks/index-Cm9EWJYD.js +5466 -0
  115. package/dist/admin/chunks/index-Cm9EWJYD.js.map +1 -0
  116. package/dist/admin/chunks/index-V7zRKAuL.mjs +5399 -0
  117. package/dist/admin/chunks/index-V7zRKAuL.mjs.map +1 -0
  118. package/dist/admin/chunks/it-BAHrwmYS.mjs +158 -0
  119. package/dist/{_chunks/it-BrVPqaf1.mjs.map → admin/chunks/it-BAHrwmYS.mjs.map} +1 -1
  120. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  121. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  122. package/dist/admin/chunks/ja-BWKmBJFT.mjs +192 -0
  123. package/dist/{_chunks/ko-HVQRlfUI.mjs.map → admin/chunks/ja-BWKmBJFT.mjs.map} +1 -1
  124. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  125. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ja-jdQM-B79.js.map} +1 -1
  126. package/dist/admin/chunks/ko-CgADGBNt.mjs +191 -0
  127. package/dist/{_chunks/es-CeXiYflN.mjs.map → admin/chunks/ko-CgADGBNt.mjs.map} +1 -1
  128. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  129. package/dist/{_chunks/ja-CcFe8diO.js.map → admin/chunks/ko-k46sEyzt.js.map} +1 -1
  130. package/dist/admin/chunks/layout-CKVqgo-g.js +619 -0
  131. package/dist/admin/chunks/layout-CKVqgo-g.js.map +1 -0
  132. package/dist/admin/chunks/layout-SBhyYkaL.mjs +599 -0
  133. package/dist/admin/chunks/layout-SBhyYkaL.mjs.map +1 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.mjs +196 -0
  135. package/dist/admin/chunks/ml-CnhCfOn_.mjs.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.mjs +140 -0
  139. package/dist/{_chunks/ms-m_WjyWx7.mjs.map → admin/chunks/ms-Bh09NFff.mjs.map} +1 -1
  140. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  141. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/ms-CvSC0OdG.js.map} +1 -1
  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.mjs +198 -0
  145. package/dist/admin/chunks/nl-C8HYflTc.mjs.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.mjs +73 -0
  149. package/dist/admin/chunks/objects-wl73iEma.mjs.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.mjs +195 -0
  153. package/dist/{_chunks/ca-5U32ON2v.mjs.map → admin/chunks/pl-MFCZJZuZ.mjs.map} +1 -1
  154. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  155. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CPtAXD-4.js.map} +1 -1
  156. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs +197 -0
  157. package/dist/{_chunks/pt-BR-C71iDxnh.mjs.map → admin/chunks/pt-BR-CcotyBGJ.mjs.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.mjs +93 -0
  161. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  162. package/dist/admin/chunks/relations-CoxkoHVc.js +178 -0
  163. package/dist/admin/chunks/relations-CoxkoHVc.js.map +1 -0
  164. package/dist/admin/chunks/relations-e_OJRH52.mjs +173 -0
  165. package/dist/admin/chunks/relations-e_OJRH52.mjs.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.mjs +230 -0
  169. package/dist/{_chunks/ru-BE6A4Exp.mjs.map → admin/chunks/ru-CB4BUyQp.mjs.map} +1 -1
  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.mjs +196 -0
  173. package/dist/admin/chunks/sa-n_aPA-pU.mjs.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.mjs +198 -0
  177. package/dist/admin/chunks/sk-tn_BDjE2.mjs.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.mjs +198 -0
  181. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.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.mjs +144 -0
  185. package/dist/{_chunks/uk-CR-zDhAY.mjs.map → admin/chunks/th-mUH7hEtc.mjs.map} +1 -1
  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.mjs +195 -0
  189. package/dist/{_chunks/de-C72KDNOl.mjs.map → admin/chunks/tr-Yt38daxh.mjs.map} +1 -1
  190. package/dist/admin/chunks/uk-BtM6WnaE.mjs +313 -0
  191. package/dist/admin/chunks/uk-BtM6WnaE.mjs.map +1 -0
  192. package/dist/admin/chunks/uk-DB6OgySY.js +318 -0
  193. package/dist/admin/chunks/uk-DB6OgySY.js.map +1 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs +247 -0
  195. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.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.mjs +18 -0
  199. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.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/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-BGr1X_HZ.js.map} +1 -1
  204. package/dist/admin/chunks/vi-CvBGlTjr.mjs +108 -0
  205. package/dist/{_chunks/vi-DUXIk_fw.mjs.map → admin/chunks/vi-CvBGlTjr.mjs.map} +1 -1
  206. package/dist/admin/chunks/zh-BmF-sHaT.mjs +205 -0
  207. package/dist/admin/chunks/zh-BmF-sHaT.mjs.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.mjs +934 -0
  211. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-CI0HKio3.mjs.map} +1 -1
  212. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  213. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  214. package/dist/admin/index.js +26 -4
  215. package/dist/admin/index.js.map +1 -1
  216. package/dist/admin/index.mjs +17 -11
  217. package/dist/admin/index.mjs.map +1 -1
  218. package/dist/admin/src/components/InjectionZone.d.ts +7 -1
  219. package/dist/admin/src/content-manager.d.ts +7 -2
  220. package/dist/admin/src/exports.d.ts +2 -1
  221. package/dist/admin/src/history/index.d.ts +3 -0
  222. package/dist/admin/src/history/services/historyVersion.d.ts +2 -2
  223. package/dist/admin/src/hooks/useDocument.d.ts +52 -2
  224. package/dist/admin/src/hooks/useDocumentActions.d.ts +1 -0
  225. package/dist/admin/src/index.d.ts +2 -0
  226. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  227. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +4 -2
  228. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  229. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  230. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +55 -0
  231. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +5 -0
  232. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  233. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  234. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +22 -1
  235. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  236. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  237. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  238. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
  239. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +29 -1
  240. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  241. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  242. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  243. package/dist/admin/src/preview/components/PreviewHeader.d.ts +3 -0
  244. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  245. package/dist/admin/src/preview/index.d.ts +3 -0
  246. package/dist/admin/src/preview/pages/Preview.d.ts +15 -0
  247. package/dist/admin/src/preview/routes.d.ts +3 -0
  248. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  249. package/dist/admin/src/router.d.ts +1 -1
  250. package/dist/admin/src/services/api.d.ts +1 -1
  251. package/dist/admin/src/services/components.d.ts +2 -2
  252. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  253. package/dist/admin/src/services/documents.d.ts +19 -20
  254. package/dist/admin/src/services/init.d.ts +1 -1
  255. package/dist/admin/src/services/relations.d.ts +2 -2
  256. package/dist/admin/src/services/uid.d.ts +3 -3
  257. package/dist/admin/src/utils/validation.d.ts +4 -1
  258. package/dist/server/index.js +5483 -4083
  259. package/dist/server/index.js.map +1 -1
  260. package/dist/server/index.mjs +5504 -4101
  261. package/dist/server/index.mjs.map +1 -1
  262. package/dist/server/src/bootstrap.d.ts.map +1 -1
  263. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  264. package/dist/server/src/controllers/index.d.ts.map +1 -1
  265. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  266. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  267. package/dist/server/src/controllers/utils/metadata.d.ts +17 -2
  268. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  269. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  270. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  271. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  272. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  273. package/dist/server/src/history/services/history.d.ts +3 -3
  274. package/dist/server/src/history/services/history.d.ts.map +1 -1
  275. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  276. package/dist/server/src/history/services/utils.d.ts +8 -12
  277. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  278. package/dist/server/src/index.d.ts +7 -6
  279. package/dist/server/src/index.d.ts.map +1 -1
  280. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  281. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  282. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  283. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  284. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  285. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  286. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  287. package/dist/server/src/preview/index.d.ts +4 -0
  288. package/dist/server/src/preview/index.d.ts.map +1 -0
  289. package/dist/server/src/preview/routes/index.d.ts +8 -0
  290. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  291. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  292. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  293. package/dist/server/src/preview/services/index.d.ts +16 -0
  294. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  295. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  296. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  297. package/dist/server/src/preview/services/preview.d.ts +12 -0
  298. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  299. package/dist/server/src/preview/utils.d.ts +19 -0
  300. package/dist/server/src/preview/utils.d.ts.map +1 -0
  301. package/dist/server/src/register.d.ts.map +1 -1
  302. package/dist/server/src/routes/index.d.ts.map +1 -1
  303. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  304. package/dist/server/src/services/document-metadata.d.ts +12 -10
  305. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  306. package/dist/server/src/services/index.d.ts +7 -6
  307. package/dist/server/src/services/index.d.ts.map +1 -1
  308. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  309. package/dist/server/src/services/utils/count.d.ts +1 -1
  310. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  311. package/dist/server/src/services/utils/populate.d.ts +3 -3
  312. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  313. package/dist/server/src/utils/index.d.ts +2 -0
  314. package/dist/server/src/utils/index.d.ts.map +1 -1
  315. package/dist/shared/contracts/collection-types.d.ts +3 -2
  316. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  317. package/dist/shared/contracts/components.d.ts +0 -1
  318. package/dist/shared/contracts/content-types.d.ts +0 -1
  319. package/dist/shared/contracts/history-versions.d.ts +0 -1
  320. package/dist/shared/contracts/index.d.ts +1 -1
  321. package/dist/shared/contracts/index.d.ts.map +1 -1
  322. package/dist/shared/contracts/init.d.ts +0 -1
  323. package/dist/shared/contracts/preview.d.ts +26 -0
  324. package/dist/shared/contracts/preview.d.ts.map +1 -0
  325. package/dist/shared/contracts/relations.d.ts +1 -2
  326. package/dist/shared/contracts/relations.d.ts.map +1 -1
  327. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  328. package/dist/shared/contracts/single-types.d.ts +0 -1
  329. package/dist/shared/contracts/uid.d.ts +0 -1
  330. package/dist/shared/index.d.ts +0 -1
  331. package/dist/shared/index.js +37 -22
  332. package/dist/shared/index.js.map +1 -1
  333. package/dist/shared/index.mjs +36 -23
  334. package/dist/shared/index.mjs.map +1 -1
  335. package/package.json +25 -21
  336. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  337. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  338. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  339. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  340. package/dist/_chunks/ComponentConfigurationPage-WRPUXGd6.js +0 -255
  341. package/dist/_chunks/ComponentConfigurationPage-WRPUXGd6.js.map +0 -1
  342. package/dist/_chunks/ComponentConfigurationPage-gdUj_t-O.mjs +0 -236
  343. package/dist/_chunks/ComponentConfigurationPage-gdUj_t-O.mjs.map +0 -1
  344. package/dist/_chunks/ComponentIcon-BXdiCGQp.js +0 -176
  345. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +0 -1
  346. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  347. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  348. package/dist/_chunks/EditConfigurationPage-BwuIPOJG.mjs +0 -132
  349. package/dist/_chunks/EditConfigurationPage-BwuIPOJG.mjs.map +0 -1
  350. package/dist/_chunks/EditConfigurationPage-C1vjMBgy.js +0 -151
  351. package/dist/_chunks/EditConfigurationPage-C1vjMBgy.js.map +0 -1
  352. package/dist/_chunks/EditViewPage-0MiFkXa8.mjs +0 -203
  353. package/dist/_chunks/EditViewPage-0MiFkXa8.mjs.map +0 -1
  354. package/dist/_chunks/EditViewPage-DbcGfyqK.js +0 -222
  355. package/dist/_chunks/EditViewPage-DbcGfyqK.js.map +0 -1
  356. package/dist/_chunks/Field-BDMSCcy5.mjs +0 -5199
  357. package/dist/_chunks/Field-BDMSCcy5.mjs.map +0 -1
  358. package/dist/_chunks/Field-BG1xu38N.js +0 -5231
  359. package/dist/_chunks/Field-BG1xu38N.js.map +0 -1
  360. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  361. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  362. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  363. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  364. package/dist/_chunks/Form-9BnFyUjy.js +0 -757
  365. package/dist/_chunks/Form-9BnFyUjy.js.map +0 -1
  366. package/dist/_chunks/Form-CPVWavB8.mjs +0 -736
  367. package/dist/_chunks/Form-CPVWavB8.mjs.map +0 -1
  368. package/dist/_chunks/History-BVpd8LP3.mjs +0 -1007
  369. package/dist/_chunks/History-BVpd8LP3.mjs.map +0 -1
  370. package/dist/_chunks/History-BWWxLt2Z.js +0 -1028
  371. package/dist/_chunks/History-BWWxLt2Z.js.map +0 -1
  372. package/dist/_chunks/ListConfigurationPage-6swzjdAZ.js +0 -640
  373. package/dist/_chunks/ListConfigurationPage-6swzjdAZ.js.map +0 -1
  374. package/dist/_chunks/ListConfigurationPage-DozVMKcR.mjs +0 -620
  375. package/dist/_chunks/ListConfigurationPage-DozVMKcR.mjs.map +0 -1
  376. package/dist/_chunks/ListViewPage-BlzfjS2Q.js +0 -834
  377. package/dist/_chunks/ListViewPage-BlzfjS2Q.js.map +0 -1
  378. package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs +0 -810
  379. package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs.map +0 -1
  380. package/dist/_chunks/NoContentTypePage-BH11kaKt.mjs +0 -51
  381. package/dist/_chunks/NoContentTypePage-BH11kaKt.mjs.map +0 -1
  382. package/dist/_chunks/NoContentTypePage-D2nCCWEl.js +0 -51
  383. package/dist/_chunks/NoContentTypePage-D2nCCWEl.js.map +0 -1
  384. package/dist/_chunks/NoPermissionsPage-BT2Tn0D_.mjs +0 -23
  385. package/dist/_chunks/NoPermissionsPage-BT2Tn0D_.mjs.map +0 -1
  386. package/dist/_chunks/NoPermissionsPage-DN_JlsU2.js +0 -23
  387. package/dist/_chunks/NoPermissionsPage-DN_JlsU2.js.map +0 -1
  388. package/dist/_chunks/Relations-CcgFTcWo.js +0 -714
  389. package/dist/_chunks/Relations-CcgFTcWo.js.map +0 -1
  390. package/dist/_chunks/Relations-Dnag3fhV.mjs +0 -694
  391. package/dist/_chunks/Relations-Dnag3fhV.mjs.map +0 -1
  392. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  393. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  394. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  395. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  396. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  397. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  398. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  399. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  400. package/dist/_chunks/de-CCEmbAah.js +0 -199
  401. package/dist/_chunks/en-Ux26r5pl.mjs +0 -291
  402. package/dist/_chunks/en-fbKQxLGn.js +0 -291
  403. package/dist/_chunks/es-CeXiYflN.mjs +0 -196
  404. package/dist/_chunks/es-EUonQTon.js +0 -196
  405. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  406. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  407. package/dist/_chunks/fr-B7kGGg3E.js +0 -206
  408. package/dist/_chunks/fr-B7kGGg3E.js.map +0 -1
  409. package/dist/_chunks/fr-CD9VFbPM.mjs +0 -206
  410. package/dist/_chunks/fr-CD9VFbPM.mjs.map +0 -1
  411. package/dist/_chunks/gu-BRmF601H.js +0 -200
  412. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  413. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  414. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  415. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  416. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  417. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  418. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  419. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  420. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  421. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  422. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  423. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  424. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  425. package/dist/_chunks/id-B5Ser98A.js +0 -160
  426. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  427. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  428. package/dist/_chunks/index-CWpLBSt0.js +0 -3778
  429. package/dist/_chunks/index-CWpLBSt0.js.map +0 -1
  430. package/dist/_chunks/index-JNNNKUHs.mjs +0 -3759
  431. package/dist/_chunks/index-JNNNKUHs.mjs.map +0 -1
  432. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  433. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  434. package/dist/_chunks/ja-CcFe8diO.js +0 -196
  435. package/dist/_chunks/ja-CtsUxOvk.mjs +0 -196
  436. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  437. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  438. package/dist/_chunks/layout--iHdZzRk.js +0 -476
  439. package/dist/_chunks/layout--iHdZzRk.js.map +0 -1
  440. package/dist/_chunks/layout-DC503LnF.mjs +0 -458
  441. package/dist/_chunks/layout-DC503LnF.mjs.map +0 -1
  442. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  443. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  444. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  445. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  446. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  447. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  448. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  449. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  450. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  451. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  452. package/dist/_chunks/objects-gigeqt7s.js +0 -49
  453. package/dist/_chunks/objects-gigeqt7s.js.map +0 -1
  454. package/dist/_chunks/objects-mKMAmfec.mjs +0 -47
  455. package/dist/_chunks/objects-mKMAmfec.mjs.map +0 -1
  456. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  457. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  458. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  459. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  460. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  461. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  462. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  463. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  464. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  465. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  466. package/dist/_chunks/relations-BbHizA5K.js +0 -134
  467. package/dist/_chunks/relations-BbHizA5K.js.map +0 -1
  468. package/dist/_chunks/relations-CTje5t-a.mjs +0 -135
  469. package/dist/_chunks/relations-CTje5t-a.mjs.map +0 -1
  470. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  471. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  472. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  473. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  474. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  475. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  476. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  477. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  478. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  479. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  480. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  481. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  482. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  483. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  484. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  485. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  486. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  487. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  488. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  489. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  490. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  491. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  492. package/dist/_chunks/uk-C8EiqJY7.js.map +0 -1
  493. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  494. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs +0 -231
  495. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +0 -1
  496. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js +0 -249
  497. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +0 -1
  498. package/dist/_chunks/usePrev-B9w_-eYc.js +0 -15
  499. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  500. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  501. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  502. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  503. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  504. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  505. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  506. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  507. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  508. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  509. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  510. package/strapi-server.js +0 -3
@@ -1,834 +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-CWpLBSt0.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-BbHizA5K.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(
292
- designSystem.Avatar.Item,
293
- {
294
- src: mediaURL,
295
- alt: alternativeText || name,
296
- fallback: alternativeText || name,
297
- preview: true
298
- }
299
- );
300
- }
301
- const fileExtension = getFileExtension(ext);
302
- const fileName = name.length > 100 ? `${name.substring(0, 100)}...` : name;
303
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: fileName, children: /* @__PURE__ */ jsxRuntime.jsx(FileWrapper, { children: fileExtension }) });
304
- };
305
- const FileWrapper = ({ children }) => {
306
- return /* @__PURE__ */ jsxRuntime.jsx(
307
- designSystem.Flex,
308
- {
309
- tag: "span",
310
- position: "relative",
311
- borderRadius: "50%",
312
- width: "26px",
313
- height: "26px",
314
- borderColor: "neutral200",
315
- background: "neutral150",
316
- paddingLeft: "1px",
317
- justifyContent: "center",
318
- alignItems: "center",
319
- children: /* @__PURE__ */ jsxRuntime.jsx(FileTypography, { variant: "sigma", textColor: "neutral600", children })
320
- }
321
- );
322
- };
323
- const FileTypography = styledComponents.styled(designSystem.Typography)`
324
- font-size: 0.9rem;
325
- line-height: 0.9rem;
326
- `;
327
- const MediaMultiple = ({ content }) => {
328
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Avatar.Group, { children: content.map((file, index2) => {
329
- const key = `${file.id}${index2}`;
330
- if (index2 === 3) {
331
- const remainingFiles = `+${content.length - 3}`;
332
- return /* @__PURE__ */ jsxRuntime.jsx(FileWrapper, { children: remainingFiles }, key);
333
- }
334
- if (index2 > 3) {
335
- return null;
336
- }
337
- return /* @__PURE__ */ jsxRuntime.jsx(MediaSingle, { ...file }, key);
338
- }) });
339
- };
340
- const RelationSingle = ({ mainField, content }) => {
341
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "50rem", textColor: "neutral800", ellipsis: true, children: relations.getRelationLabel(content, mainField) });
342
- };
343
- const RelationMultiple = ({ mainField, content, rowId, name }) => {
344
- const { model } = index.useDoc();
345
- const { formatMessage } = reactIntl.useIntl();
346
- const { notifyStatus } = designSystem.useNotifyAT();
347
- const [isOpen, setIsOpen] = React__namespace.useState(false);
348
- const [targetField] = name.split(".");
349
- const { data, isLoading } = relations.useGetRelationsQuery(
350
- {
351
- model,
352
- id: rowId,
353
- targetField
354
- },
355
- {
356
- skip: !isOpen,
357
- refetchOnMountOrArgChange: true
358
- }
359
- );
360
- React__namespace.useEffect(() => {
361
- if (data) {
362
- notifyStatus(
363
- formatMessage({
364
- id: index.getTranslation("DynamicTable.relation-loaded"),
365
- defaultMessage: "Relations have been loaded"
366
- })
367
- );
368
- }
369
- }, [data, formatMessage, notifyStatus]);
370
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { onOpenChange: (isOpen2) => setIsOpen(isOpen2), children: [
371
- /* @__PURE__ */ jsxRuntime.jsx(MenuTrigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 1, wrap: "nowrap", children: [
372
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Badge, { children: content.count }),
373
- formatMessage(
374
- {
375
- id: "content-manager.containers.list.items",
376
- defaultMessage: "{number, plural, =0 {items} one {item} other {items}}"
377
- },
378
- { number: content.count }
379
- )
380
- ] }) }),
381
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { children: [
382
- isLoading && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Item, { disabled: true, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Loader, { small: true, children: formatMessage({
383
- id: index.getTranslation("ListViewTable.relation-loading"),
384
- defaultMessage: "Relations are loading"
385
- }) }) }),
386
- data?.results && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
387
- 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)),
388
- data?.pagination && data?.pagination.total > 10 && /* @__PURE__ */ jsxRuntime.jsx(
389
- designSystem.Menu.Item,
390
- {
391
- "aria-disabled": true,
392
- "aria-label": formatMessage({
393
- id: index.getTranslation("ListViewTable.relation-more"),
394
- defaultMessage: "This relation contains more entities than displayed"
395
- }),
396
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: "…" })
397
- }
398
- )
399
- ] })
400
- ] })
401
- ] });
402
- };
403
- const MenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
404
- svg {
405
- width: 0.6rem;
406
- height: 0.4rem;
407
- }
408
- `;
409
- const CellContent = ({ content, mainField, attribute, rowId, name }) => {
410
- if (!hasContent(content, mainField, attribute)) {
411
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: "-" });
412
- }
413
- switch (attribute.type) {
414
- case "media":
415
- if (!attribute.multiple) {
416
- return /* @__PURE__ */ jsxRuntime.jsx(MediaSingle, { ...content });
417
- }
418
- return /* @__PURE__ */ jsxRuntime.jsx(MediaMultiple, { content });
419
- case "relation": {
420
- if (isSingleRelation(attribute.relation)) {
421
- return /* @__PURE__ */ jsxRuntime.jsx(RelationSingle, { mainField, content });
422
- }
423
- return /* @__PURE__ */ jsxRuntime.jsx(RelationMultiple, { rowId, mainField, content, name });
424
- }
425
- case "component":
426
- if (attribute.repeatable) {
427
- return /* @__PURE__ */ jsxRuntime.jsx(RepeatableComponent, { mainField, content });
428
- }
429
- return /* @__PURE__ */ jsxRuntime.jsx(SingleComponent, { mainField, content });
430
- case "string":
431
- 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 }) }) });
432
- default:
433
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsxRuntime.jsx(CellValue, { type: attribute.type, value: content }) });
434
- }
435
- };
436
- const hasContent = (content, mainField, attribute) => {
437
- if (attribute.type === "component") {
438
- if (attribute.repeatable || !mainField) {
439
- return content?.length > 0;
440
- }
441
- const value = content?.[mainField.name];
442
- if (mainField.name === "id" && ![void 0, null].includes(value)) {
443
- return true;
444
- }
445
- return !isEmpty__default.default(value);
446
- }
447
- if (attribute.type === "relation") {
448
- if (isSingleRelation(attribute.relation)) {
449
- return !isEmpty__default.default(content);
450
- }
451
- return content?.count > 0;
452
- }
453
- if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
454
- return typeof content === "number";
455
- }
456
- if (attribute.type === "boolean") {
457
- return content !== null;
458
- }
459
- return !isEmpty__default.default(content);
460
- };
461
- const isSingleRelation = (type) => ["oneToOne", "manyToOne", "oneToOneMorph"].includes(type);
462
- const ViewSettingsMenu = (props) => {
463
- const permissions = hooks.useTypedSelector(
464
- (state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []
465
- );
466
- const [{ query }] = strapiAdmin.useQueryParams();
467
- const { formatMessage } = reactIntl.useIntl();
468
- const {
469
- allowedActions: { canConfigureView }
470
- } = strapiAdmin.useRBAC(permissions);
471
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { children: [
472
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
473
- designSystem.IconButton,
474
- {
475
- label: formatMessage({
476
- id: "components.ViewSettings.tooltip",
477
- defaultMessage: "View Settings"
478
- }),
479
- children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Cog, {})
480
- }
481
- ) }),
482
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { side: "bottom", align: "end", sideOffset: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "stretch", direction: "column", padding: 3, gap: 3, children: [
483
- canConfigureView ? /* @__PURE__ */ jsxRuntime.jsx(
484
- designSystem.LinkButton,
485
- {
486
- size: "S",
487
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ListPlus, {}),
488
- variant: "secondary",
489
- tag: reactRouterDom.NavLink,
490
- to: {
491
- pathname: "configurations/list",
492
- search: query.plugins ? qs.stringify({ plugins: query.plugins }, { encode: false }) : ""
493
- },
494
- children: formatMessage({
495
- id: "app.links.configure-view",
496
- defaultMessage: "Configure the view"
497
- })
498
- }
499
- ) : null,
500
- /* @__PURE__ */ jsxRuntime.jsx(FieldPicker, { ...props })
501
- ] }) })
502
- ] });
503
- };
504
- const FieldPicker = ({ headers = [], resetHeaders, setHeaders }) => {
505
- const { trackUsage } = strapiAdmin.useTracking();
506
- const { formatMessage, locale } = reactIntl.useIntl();
507
- const { schema, model } = index.useDoc();
508
- const { list } = index.useDocumentLayout(model);
509
- const formatter = designSystem.useCollator(locale, {
510
- sensitivity: "base"
511
- });
512
- const attributes = schema?.attributes ?? {};
513
- const columns = Object.keys(attributes).filter((name) => index.checkIfAttributeIsDisplayable(attributes[name])).map((name) => ({
514
- name,
515
- label: list.metadatas[name]?.label ?? ""
516
- })).sort((a, b) => formatter.compare(a.label, b.label));
517
- const handleChange = (name) => {
518
- trackUsage("didChangeDisplayedFields");
519
- const newHeaders = headers.includes(name) ? headers.filter((header) => header !== name) : [...headers, name];
520
- setHeaders(newHeaders);
521
- };
522
- const handleReset = () => {
523
- resetHeaders();
524
- };
525
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "fieldset", direction: "column", alignItems: "stretch", gap: 3, borderWidth: 0, children: [
526
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
527
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "legend", variant: "pi", fontWeight: "bold", children: formatMessage({
528
- id: "containers.list.displayedFields",
529
- defaultMessage: "Displayed fields"
530
- }) }),
531
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.TextButton, { onClick: handleReset, children: formatMessage({
532
- id: "app.components.Button.reset",
533
- defaultMessage: "Reset"
534
- }) })
535
- ] }),
536
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", children: columns.map((header) => {
537
- const isActive = headers.includes(header.name);
538
- return /* @__PURE__ */ jsxRuntime.jsx(
539
- designSystem.Flex,
540
- {
541
- wrap: "wrap",
542
- gap: 2,
543
- background: isActive ? "primary100" : "transparent",
544
- hasRadius: true,
545
- padding: 2,
546
- children: /* @__PURE__ */ jsxRuntime.jsx(
547
- designSystem.Checkbox,
548
- {
549
- onCheckedChange: () => handleChange(header.name),
550
- checked: isActive,
551
- name: header.name,
552
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 1, children: header.label })
553
- }
554
- )
555
- },
556
- header.name
557
- );
558
- }) })
559
- ] });
560
- };
561
- const { INJECT_COLUMN_IN_TABLE } = index.HOOKS;
562
- const ListViewPage = () => {
563
- const { trackUsage } = strapiAdmin.useTracking();
564
- const navigate = reactRouterDom.useNavigate();
565
- const { formatMessage } = reactIntl.useIntl();
566
- const { toggleNotification } = strapiAdmin.useNotification();
567
- const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler(index.getTranslation);
568
- const { collectionType, model, schema } = index.useDoc();
569
- const { list } = index.useDocumentLayout(model);
570
- const [displayedHeaders, setDisplayedHeaders] = React__namespace.useState([]);
571
- const listLayout = usePrev.usePrev(list.layout);
572
- React__namespace.useEffect(() => {
573
- if (!isEqual__default.default(listLayout, list.layout)) {
574
- setDisplayedHeaders(list.layout);
575
- }
576
- }, [list.layout, listLayout]);
577
- const handleSetHeaders = (headers) => {
578
- setDisplayedHeaders(
579
- index.convertListLayoutToFieldLayouts(headers, schema.attributes, list.metadatas)
580
- );
581
- };
582
- const [{ query }] = strapiAdmin.useQueryParams({
583
- page: "1",
584
- pageSize: list.settings.pageSize.toString(),
585
- sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
586
- });
587
- const params = React__namespace.useMemo(() => index.buildValidParams(query), [query]);
588
- const { data, error, isLoading } = index.useGetAllDocumentsQuery({
589
- model,
590
- params
591
- });
592
- React__namespace.useEffect(() => {
593
- if (error) {
594
- toggleNotification({
595
- type: "danger",
596
- message: formatAPIError(error)
597
- });
598
- }
599
- }, [error, formatAPIError, toggleNotification]);
600
- const { results = [], pagination } = data ?? {};
601
- React__namespace.useEffect(() => {
602
- if (pagination && pagination.pageCount > 0 && pagination.page > pagination.pageCount) {
603
- navigate(
604
- {
605
- search: qs.stringify({
606
- ...query,
607
- page: pagination.pageCount
608
- })
609
- },
610
- { replace: true }
611
- );
612
- }
613
- }, [pagination, formatMessage, query, navigate]);
614
- const { canCreate } = index.useDocumentRBAC("ListViewPage", ({ canCreate: canCreate2 }) => ({
615
- canCreate: canCreate2
616
- }));
617
- const runHookWaterfall = strapiAdmin.useStrapiApp("ListViewPage", ({ runHookWaterfall: runHookWaterfall2 }) => runHookWaterfall2);
618
- const tableHeaders = React__namespace.useMemo(() => {
619
- const headers = runHookWaterfall(INJECT_COLUMN_IN_TABLE, {
620
- displayedHeaders,
621
- layout: list
622
- });
623
- const formattedHeaders = headers.displayedHeaders.map((header) => {
624
- return {
625
- ...header,
626
- label: typeof header.label === "string" ? header.label : formatMessage(header.label),
627
- name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
628
- };
629
- });
630
- if (schema?.options?.draftAndPublish) {
631
- formattedHeaders.push({
632
- attribute: {
633
- type: "custom"
634
- },
635
- name: "status",
636
- label: formatMessage({
637
- id: index.getTranslation(`containers.list.table-headers.status`),
638
- defaultMessage: "status"
639
- }),
640
- searchable: false,
641
- sortable: false
642
- });
643
- }
644
- return formattedHeaders;
645
- }, [displayedHeaders, formatMessage, list, runHookWaterfall, schema?.options?.draftAndPublish]);
646
- if (isLoading) {
647
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
648
- }
649
- if (error) {
650
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
651
- }
652
- const contentTypeTitle = schema?.info.displayName ?? "Untitled";
653
- const handleRowClick = (id) => () => {
654
- trackUsage("willEditEntryFromList");
655
- navigate({
656
- pathname: id.toString(),
657
- search: qs.stringify({ plugins: query.plugins })
658
- });
659
- };
660
- return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Page.Main, { children: [
661
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Title, { children: `${contentTypeTitle}` }),
662
- /* @__PURE__ */ jsxRuntime.jsx(
663
- strapiAdmin.Layouts.Header,
664
- {
665
- primaryAction: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(CreateButton, {}) : null,
666
- subtitle: formatMessage(
667
- {
668
- id: index.getTranslation("pages.ListView.header-subtitle"),
669
- defaultMessage: "{number, plural, =0 {# entries} one {# entry} other {# entries}} found"
670
- },
671
- { number: pagination?.total }
672
- ),
673
- title: contentTypeTitle,
674
- navigationAction: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {})
675
- }
676
- ),
677
- /* @__PURE__ */ jsxRuntime.jsx(
678
- strapiAdmin.Layouts.Action,
679
- {
680
- endActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
681
- /* @__PURE__ */ jsxRuntime.jsx(index.InjectionZone, { area: "listView.actions" }),
682
- /* @__PURE__ */ jsxRuntime.jsx(
683
- ViewSettingsMenu,
684
- {
685
- setHeaders: handleSetHeaders,
686
- resetHeaders: () => setDisplayedHeaders(list.layout),
687
- headers: displayedHeaders.map((header) => header.name)
688
- }
689
- )
690
- ] }),
691
- startActions: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
692
- list.settings.searchable && /* @__PURE__ */ jsxRuntime.jsx(
693
- strapiAdmin.SearchInput,
694
- {
695
- disabled: results.length === 0,
696
- label: formatMessage(
697
- { id: "app.component.search.label", defaultMessage: "Search for {target}" },
698
- { target: contentTypeTitle }
699
- ),
700
- placeholder: formatMessage({
701
- id: "global.search",
702
- defaultMessage: "Search"
703
- }),
704
- trackedEvent: "didSearch"
705
- }
706
- ),
707
- list.settings.filterable && schema ? /* @__PURE__ */ jsxRuntime.jsx(FiltersImpl, { disabled: results.length === 0, schema }) : null
708
- ] })
709
- }
710
- ),
711
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
712
- /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Root, { rows: results, headers: tableHeaders, isLoading, children: [
713
- /* @__PURE__ */ jsxRuntime.jsx(TableActionsBar, {}),
714
- /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Content, { children: [
715
- /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Table.Head, { children: [
716
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCheckboxCell, {}),
717
- tableHeaders.map((header) => /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.HeaderCell, { ...header }, header.name))
718
- ] }),
719
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Loading, {}),
720
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Empty, { action: canCreate ? /* @__PURE__ */ jsxRuntime.jsx(CreateButton, { variant: "secondary" }) : null }),
721
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Body, { children: results.map((row) => {
722
- return /* @__PURE__ */ jsxRuntime.jsxs(
723
- strapiAdmin.Table.Row,
724
- {
725
- cursor: "pointer",
726
- onClick: handleRowClick(row.documentId),
727
- children: [
728
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.CheckboxCell, { id: row.id }),
729
- tableHeaders.map(({ cellFormatter, ...header }) => {
730
- if (header.name === "status") {
731
- const { status } = row;
732
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status, maxWidth: "min-content" }) }, header.name);
733
- }
734
- if (["createdBy", "updatedBy"].includes(header.name.split(".")[0])) {
735
- 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);
736
- }
737
- if (typeof cellFormatter === "function") {
738
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: cellFormatter(row, header, { collectionType, model }) }, header.name);
739
- }
740
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.Cell, { children: /* @__PURE__ */ jsxRuntime.jsx(
741
- CellContent,
742
- {
743
- content: row[header.name.split(".")[0]],
744
- rowId: row.documentId,
745
- ...header
746
- }
747
- ) }, header.name);
748
- }),
749
- /* @__PURE__ */ jsxRuntime.jsx(ActionsCell, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsxRuntime.jsx(index.TableActions, { document: row }) })
750
- ]
751
- },
752
- row.id
753
- );
754
- }) })
755
- ] })
756
- ] }),
757
- /* @__PURE__ */ jsxRuntime.jsxs(
758
- strapiAdmin.Pagination.Root,
759
- {
760
- ...pagination,
761
- onPageSizeChange: () => trackUsage("willChangeNumberOfEntriesPerPage"),
762
- children: [
763
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Pagination.PageSize, {}),
764
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Pagination.Links, {})
765
- ]
766
- }
767
- )
768
- ] }) })
769
- ] });
770
- };
771
- const ActionsCell = styledComponents.styled(strapiAdmin.Table.Cell)`
772
- display: flex;
773
- justify-content: flex-end;
774
- `;
775
- const TableActionsBar = () => {
776
- const selectRow = strapiAdmin.useTable("TableActionsBar", (state) => state.selectRow);
777
- const [{ query }] = strapiAdmin.useQueryParams();
778
- const locale = query?.plugins?.i18n?.locale;
779
- const prevLocale = usePrev.usePrev(locale);
780
- React__namespace.useEffect(() => {
781
- if (prevLocale !== locale) {
782
- selectRow([]);
783
- }
784
- }, [selectRow, prevLocale, locale]);
785
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Table.ActionBar, { children: /* @__PURE__ */ jsxRuntime.jsx(index.BulkActionsRenderer, {}) });
786
- };
787
- const CreateButton = ({ variant }) => {
788
- const { formatMessage } = reactIntl.useIntl();
789
- const { trackUsage } = strapiAdmin.useTracking();
790
- const [{ query }] = strapiAdmin.useQueryParams();
791
- return /* @__PURE__ */ jsxRuntime.jsx(
792
- designSystem.Button,
793
- {
794
- variant,
795
- tag: reactRouterDom.Link,
796
- onClick: () => {
797
- trackUsage("willCreateEntry", { status: "draft" });
798
- },
799
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Plus, {}),
800
- style: { textDecoration: "none" },
801
- to: {
802
- pathname: "create",
803
- search: qs.stringify({ plugins: query.plugins })
804
- },
805
- children: formatMessage({
806
- id: index.getTranslation("HeaderLayout.button.label-add-entry"),
807
- defaultMessage: "Create new entry"
808
- })
809
- }
810
- );
811
- };
812
- const ProtectedListViewPage = () => {
813
- const { slug = "" } = reactRouterDom.useParams();
814
- const {
815
- permissions = [],
816
- isLoading,
817
- error
818
- } = strapiAdmin.useRBAC(
819
- index.PERMISSIONS.map((action) => ({
820
- action,
821
- subject: slug
822
- }))
823
- );
824
- if (isLoading) {
825
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
826
- }
827
- if (error || !slug) {
828
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
829
- }
830
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsxRuntime.jsx(index.DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsxRuntime.jsx(ListViewPage, {}) }) });
831
- };
832
- exports.ListViewPage = ListViewPage;
833
- exports.ProtectedListViewPage = ProtectedListViewPage;
834
- //# sourceMappingURL=ListViewPage-BlzfjS2Q.js.map