@strapi/content-manager 0.0.0-experimental.e9122b401c96877b6707775c4f893660eab93ae3 → 0.0.0-experimental.e9144fc8a193f9875a2c0832d689c14001c79f00

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 (507) hide show
  1. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js +80 -0
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.js.map +1 -0
  3. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js +82 -0
  4. package/dist/admin/chunks/CardDragPreview-_dubYgXO.js.map +1 -0
  5. package/dist/admin/chunks/ComponentConfigurationPage-BnZmgOiE.js +276 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-BnZmgOiE.js.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-DLYW6wzP.js +298 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-DLYW6wzP.js.map +1 -0
  9. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js +153 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.js.map +1 -0
  11. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js +176 -0
  12. package/dist/admin/chunks/ComponentIcon-C-EjOUPA.js.map +1 -0
  13. package/dist/admin/chunks/EditConfigurationPage-D343zenK.js +158 -0
  14. package/dist/admin/chunks/EditConfigurationPage-D343zenK.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-D6MAzDx9.js +180 -0
  16. package/dist/admin/chunks/EditConfigurationPage-D6MAzDx9.js.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-BEiXdIh3.js +337 -0
  18. package/dist/admin/chunks/EditViewPage-BEiXdIh3.js.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-CAgp5yFQ.js +314 -0
  20. package/dist/admin/chunks/EditViewPage-CAgp5yFQ.js.map +1 -0
  21. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js +56 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.js.map +1 -0
  23. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js +58 -0
  24. package/dist/admin/chunks/FieldTypeIcon-Bxh-7Jin.js.map +1 -0
  25. package/dist/admin/chunks/Form-DT-mJpeC.js +978 -0
  26. package/dist/admin/chunks/Form-DT-mJpeC.js.map +1 -0
  27. package/dist/admin/chunks/Form-DnpEddIm.js +955 -0
  28. package/dist/admin/chunks/Form-DnpEddIm.js.map +1 -0
  29. package/dist/admin/chunks/History-CAcsKxvW.js +1357 -0
  30. package/dist/admin/chunks/History-CAcsKxvW.js.map +1 -0
  31. package/dist/admin/chunks/History-DcmMS40h.js +1380 -0
  32. package/dist/admin/chunks/History-DcmMS40h.js.map +1 -0
  33. package/dist/admin/chunks/Input-Bn_9U9AX.js +6755 -0
  34. package/dist/admin/chunks/Input-Bn_9U9AX.js.map +1 -0
  35. package/dist/admin/chunks/Input-DKc071zK.js +6785 -0
  36. package/dist/admin/chunks/Input-DKc071zK.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-9g-kIzuq.js +818 -0
  38. package/dist/admin/chunks/ListConfigurationPage-9g-kIzuq.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-CCkKvrdu.js +795 -0
  40. package/dist/admin/chunks/ListConfigurationPage-CCkKvrdu.js.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-C4RIOx9_.js +1132 -0
  42. package/dist/admin/chunks/ListViewPage-C4RIOx9_.js.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-CkbK_jTo.js +1154 -0
  44. package/dist/admin/chunks/ListViewPage-CkbK_jTo.js.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-B2sy8eF1.js +59 -0
  46. package/dist/admin/chunks/NoContentTypePage-B2sy8eF1.js.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-B37btBcO.js +57 -0
  48. package/dist/admin/chunks/NoContentTypePage-B37btBcO.js.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-BZp87Adj.js +38 -0
  50. package/dist/admin/chunks/NoPermissionsPage-BZp87Adj.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-CGuHcAGX.js +36 -0
  52. package/dist/admin/chunks/NoPermissionsPage-CGuHcAGX.js.map +1 -0
  53. package/dist/admin/chunks/Preview-C7doSaZl.js +553 -0
  54. package/dist/admin/chunks/Preview-C7doSaZl.js.map +1 -0
  55. package/dist/admin/chunks/Preview-D1A984oV.js +531 -0
  56. package/dist/admin/chunks/Preview-D1A984oV.js.map +1 -0
  57. package/dist/admin/chunks/Relations-B9xxwrI5.js +827 -0
  58. package/dist/admin/chunks/Relations-B9xxwrI5.js.map +1 -0
  59. package/dist/admin/chunks/Relations-DFmdcIeQ.js +853 -0
  60. package/dist/admin/chunks/Relations-DFmdcIeQ.js.map +1 -0
  61. package/dist/admin/chunks/ar-DckYq_WK.js +222 -0
  62. package/dist/admin/chunks/ar-DckYq_WK.js.map +1 -0
  63. package/dist/admin/chunks/ar-DeQBSsfl.js +227 -0
  64. package/dist/{_chunks/ru-BT3ybNny.js.map → admin/chunks/ar-DeQBSsfl.js.map} +1 -1
  65. package/dist/admin/chunks/ca-ClDTvatJ.js +202 -0
  66. package/dist/admin/chunks/ca-ClDTvatJ.js.map +1 -0
  67. package/dist/admin/chunks/ca-DviY7mRj.js +197 -0
  68. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ca-DviY7mRj.js.map} +1 -1
  69. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  70. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  71. package/dist/admin/chunks/cs-C7OSYFQ7.js +122 -0
  72. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-C7OSYFQ7.js.map} +1 -1
  73. package/dist/admin/chunks/de-5QRlDHyR.js +195 -0
  74. package/dist/{_chunks/ja-CcFe8diO.js.map → admin/chunks/de-5QRlDHyR.js.map} +1 -1
  75. package/dist/admin/chunks/de-CbImAUA5.js +200 -0
  76. package/dist/{_chunks/gu-BRmF601H.js.map → admin/chunks/de-CbImAUA5.js.map} +1 -1
  77. package/dist/admin/chunks/en-C1CjdAtC.js +313 -0
  78. package/dist/admin/chunks/en-C1CjdAtC.js.map +1 -0
  79. package/dist/admin/chunks/en-LfhocNG2.js +308 -0
  80. package/dist/{_chunks/en-BVzUkPxZ.js.map → admin/chunks/en-LfhocNG2.js.map} +1 -1
  81. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  82. package/dist/admin/chunks/es-C8vLuvZL.js.map +1 -0
  83. package/dist/admin/chunks/es-DkoWSExG.js +192 -0
  84. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/es-DkoWSExG.js.map} +1 -1
  85. package/dist/admin/chunks/eu-BG1xX7HK.js +198 -0
  86. package/dist/admin/chunks/eu-BG1xX7HK.js.map +1 -0
  87. package/dist/admin/chunks/eu-BJW3AvXu.js +203 -0
  88. package/dist/admin/chunks/eu-BJW3AvXu.js.map +1 -0
  89. package/dist/admin/chunks/fr-CFdRaRVj.js +215 -0
  90. package/dist/admin/chunks/fr-CFdRaRVj.js.map +1 -0
  91. package/dist/admin/chunks/fr-gQSilC7w.js +220 -0
  92. package/dist/admin/chunks/fr-gQSilC7w.js.map +1 -0
  93. package/dist/admin/chunks/gu-D5MMMXRs.js +196 -0
  94. package/dist/admin/chunks/gu-D5MMMXRs.js.map +1 -0
  95. package/dist/admin/chunks/gu-DPU4wyx7.js +201 -0
  96. package/dist/{_chunks/eu-VDH-3ovk.js.map → admin/chunks/gu-DPU4wyx7.js.map} +1 -1
  97. package/dist/admin/chunks/hi-Dp4omeBb.js +201 -0
  98. package/dist/admin/chunks/hi-Dp4omeBb.js.map +1 -0
  99. package/dist/admin/chunks/hi-lp17SCjr.js +196 -0
  100. package/dist/admin/chunks/hi-lp17SCjr.js.map +1 -0
  101. package/dist/{_chunks/hooks-BAaaKPS_.js → admin/chunks/hooks-D-sOYd1s.js} +6 -3
  102. package/dist/admin/chunks/hooks-D-sOYd1s.js.map +1 -0
  103. package/dist/admin/chunks/hooks-DMvik5y_.js +7 -0
  104. package/dist/admin/chunks/hooks-DMvik5y_.js.map +1 -0
  105. package/dist/admin/chunks/hu-CLka1U2C.js +198 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.js.map +1 -0
  107. package/dist/admin/chunks/hu-CtFJuhTd.js +203 -0
  108. package/dist/admin/chunks/hu-CtFJuhTd.js.map +1 -0
  109. package/dist/admin/chunks/id-D7V5S1rB.js +161 -0
  110. package/dist/{_chunks/it-DkBIs7vD.js.map → admin/chunks/id-D7V5S1rB.js.map} +1 -1
  111. package/dist/admin/chunks/id-USfY9m1g.js +156 -0
  112. package/dist/admin/chunks/id-USfY9m1g.js.map +1 -0
  113. package/dist/admin/chunks/index-Cj2lSt7S.js +5350 -0
  114. package/dist/admin/chunks/index-Cj2lSt7S.js.map +1 -0
  115. package/dist/admin/chunks/index-OSrndyon.js +5416 -0
  116. package/dist/admin/chunks/index-OSrndyon.js.map +1 -0
  117. package/dist/admin/chunks/it-BAHrwmYS.js +158 -0
  118. package/dist/admin/chunks/it-BAHrwmYS.js.map +1 -0
  119. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  120. package/dist/{_chunks/es-EUonQTon.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  121. package/dist/admin/chunks/ja-BWKmBJFT.js +192 -0
  122. package/dist/admin/chunks/ja-BWKmBJFT.js.map +1 -0
  123. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  124. package/dist/admin/chunks/ja-jdQM-B79.js.map +1 -0
  125. package/dist/admin/chunks/ko-CgADGBNt.js +191 -0
  126. package/dist/admin/chunks/ko-CgADGBNt.js.map +1 -0
  127. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  128. package/dist/admin/chunks/ko-k46sEyzt.js.map +1 -0
  129. package/dist/admin/chunks/layout-DZO1GLQr.js +598 -0
  130. package/dist/admin/chunks/layout-DZO1GLQr.js.map +1 -0
  131. package/dist/admin/chunks/layout-ixNm7FpJ.js +618 -0
  132. package/dist/admin/chunks/layout-ixNm7FpJ.js.map +1 -0
  133. package/dist/admin/chunks/ml-CnhCfOn_.js +196 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.js.map +1 -0
  135. package/dist/admin/chunks/ml-DqxPwODx.js +201 -0
  136. package/dist/admin/chunks/ml-DqxPwODx.js.map +1 -0
  137. package/dist/admin/chunks/ms-Bh09NFff.js +140 -0
  138. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/ms-Bh09NFff.js.map} +1 -1
  139. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  140. package/dist/admin/chunks/ms-CvSC0OdG.js.map +1 -0
  141. package/dist/admin/chunks/nl-BEubhS8C.js +203 -0
  142. package/dist/admin/chunks/nl-BEubhS8C.js.map +1 -0
  143. package/dist/admin/chunks/nl-C8HYflTc.js +198 -0
  144. package/dist/admin/chunks/nl-C8HYflTc.js.map +1 -0
  145. package/dist/admin/chunks/objects-C3EebVVe.js +76 -0
  146. package/dist/admin/chunks/objects-C3EebVVe.js.map +1 -0
  147. package/dist/admin/chunks/objects-wl73iEma.js +73 -0
  148. package/dist/admin/chunks/objects-wl73iEma.js.map +1 -0
  149. package/dist/admin/chunks/pl-DWhGDzmM.js +200 -0
  150. package/dist/{_chunks/ca-Cmk45QO6.js.map → admin/chunks/pl-DWhGDzmM.js.map} +1 -1
  151. package/dist/admin/chunks/pl-MFCZJZuZ.js +195 -0
  152. package/dist/admin/chunks/pl-MFCZJZuZ.js.map +1 -0
  153. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  154. package/dist/admin/chunks/pt-BR-CPtAXD-4.js.map +1 -0
  155. package/dist/admin/chunks/pt-BR-CcotyBGJ.js +197 -0
  156. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CcotyBGJ.js.map} +1 -1
  157. package/dist/admin/chunks/pt-BoPxN80n.js +96 -0
  158. package/dist/admin/chunks/pt-BoPxN80n.js.map +1 -0
  159. package/dist/admin/chunks/pt-HbmgeiYO.js +93 -0
  160. package/dist/admin/chunks/pt-HbmgeiYO.js.map +1 -0
  161. package/dist/admin/chunks/relations-CQOKwshG.js +178 -0
  162. package/dist/admin/chunks/relations-CQOKwshG.js.map +1 -0
  163. package/dist/admin/chunks/relations-Cdrtwdwh.js +173 -0
  164. package/dist/admin/chunks/relations-Cdrtwdwh.js.map +1 -0
  165. package/dist/admin/chunks/ru-C0op0ALG.js +232 -0
  166. package/dist/admin/chunks/ru-C0op0ALG.js.map +1 -0
  167. package/dist/admin/chunks/ru-CB4BUyQp.js +230 -0
  168. package/dist/admin/chunks/ru-CB4BUyQp.js.map +1 -0
  169. package/dist/admin/chunks/sa-B_FuPyMw.js +201 -0
  170. package/dist/admin/chunks/sa-B_FuPyMw.js.map +1 -0
  171. package/dist/admin/chunks/sa-n_aPA-pU.js +196 -0
  172. package/dist/admin/chunks/sa-n_aPA-pU.js.map +1 -0
  173. package/dist/admin/chunks/sk-D_iXML2C.js +203 -0
  174. package/dist/admin/chunks/sk-D_iXML2C.js.map +1 -0
  175. package/dist/admin/chunks/sk-tn_BDjE2.js +198 -0
  176. package/dist/admin/chunks/sk-tn_BDjE2.js.map +1 -0
  177. package/dist/admin/chunks/sv-BstBC1Yp.js +203 -0
  178. package/dist/admin/chunks/sv-BstBC1Yp.js.map +1 -0
  179. package/dist/admin/chunks/sv-cq4ZrQRd.js +198 -0
  180. package/dist/admin/chunks/sv-cq4ZrQRd.js.map +1 -0
  181. package/dist/admin/chunks/th-lXoOCqPC.js +149 -0
  182. package/dist/{_chunks/th-D9_GfAjc.js.map → admin/chunks/th-lXoOCqPC.js.map} +1 -1
  183. package/dist/admin/chunks/th-mUH7hEtc.js +144 -0
  184. package/dist/admin/chunks/th-mUH7hEtc.js.map +1 -0
  185. package/dist/admin/chunks/tr-CkS6sLIE.js +200 -0
  186. package/dist/admin/chunks/tr-CkS6sLIE.js.map +1 -0
  187. package/dist/admin/chunks/tr-Yt38daxh.js +195 -0
  188. package/dist/admin/chunks/tr-Yt38daxh.js.map +1 -0
  189. package/dist/admin/chunks/uk-B24MoTVg.js +145 -0
  190. package/dist/admin/chunks/uk-B24MoTVg.js.map +1 -0
  191. package/dist/admin/chunks/uk-Cpgmm7gE.js +140 -0
  192. package/dist/admin/chunks/uk-Cpgmm7gE.js.map +1 -0
  193. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js +247 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.js.map +1 -0
  195. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js +271 -0
  196. package/dist/admin/chunks/useDragAndDrop-gcqEJMnO.js.map +1 -0
  197. package/dist/admin/chunks/usePrev-Bjw2dhmq.js +18 -0
  198. package/dist/admin/chunks/usePrev-Bjw2dhmq.js.map +1 -0
  199. package/dist/admin/chunks/usePrev-DIYl-IAL.js +21 -0
  200. package/dist/admin/chunks/usePrev-DIYl-IAL.js.map +1 -0
  201. package/dist/admin/chunks/vi-BGr1X_HZ.js +112 -0
  202. package/dist/admin/chunks/vi-BGr1X_HZ.js.map +1 -0
  203. package/dist/admin/chunks/vi-CvBGlTjr.js +108 -0
  204. package/dist/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-CvBGlTjr.js.map} +1 -1
  205. package/dist/admin/chunks/zh-BmF-sHaT.js +205 -0
  206. package/dist/admin/chunks/zh-BmF-sHaT.js.map +1 -0
  207. package/dist/admin/chunks/zh-DwFu_Kfj.js +210 -0
  208. package/dist/admin/chunks/zh-DwFu_Kfj.js.map +1 -0
  209. package/dist/admin/chunks/zh-Hans-CI0HKio3.js +934 -0
  210. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-CI0HKio3.js.map} +1 -1
  211. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  212. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  213. package/dist/admin/index.js +25 -4
  214. package/dist/admin/index.js.map +1 -1
  215. package/dist/admin/index.mjs +16 -11
  216. package/dist/admin/index.mjs.map +1 -1
  217. package/dist/admin/src/content-manager.d.ts +3 -2
  218. package/dist/admin/src/exports.d.ts +2 -1
  219. package/dist/admin/src/history/services/historyVersion.d.ts +2 -2
  220. package/dist/admin/src/hooks/useDocument.d.ts +50 -2
  221. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  222. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  223. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  224. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +55 -0
  225. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  226. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  227. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  228. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +27 -0
  229. package/dist/admin/src/pages/EditView/components/Header.d.ts +1 -0
  230. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  231. package/dist/admin/src/preview/components/PreviewContent.d.ts +3 -0
  232. package/dist/admin/src/preview/components/PreviewHeader.d.ts +3 -0
  233. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  234. package/dist/admin/src/preview/index.d.ts +3 -0
  235. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  236. package/dist/admin/src/preview/routes.d.ts +3 -0
  237. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  238. package/dist/admin/src/router.d.ts +1 -1
  239. package/dist/admin/src/services/api.d.ts +1 -1
  240. package/dist/admin/src/services/components.d.ts +2 -2
  241. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  242. package/dist/admin/src/services/documents.d.ts +16 -19
  243. package/dist/admin/src/services/init.d.ts +1 -1
  244. package/dist/admin/src/services/relations.d.ts +2 -2
  245. package/dist/admin/src/services/uid.d.ts +3 -3
  246. package/dist/server/index.js +5473 -4144
  247. package/dist/server/index.js.map +1 -1
  248. package/dist/server/index.mjs +5452 -4120
  249. package/dist/server/index.mjs.map +1 -1
  250. package/dist/server/src/bootstrap.d.ts.map +1 -1
  251. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  252. package/dist/server/src/controllers/index.d.ts.map +1 -1
  253. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  254. package/dist/server/src/controllers/utils/metadata.d.ts +17 -2
  255. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  256. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  257. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  258. package/dist/server/src/history/services/history.d.ts +3 -3
  259. package/dist/server/src/history/services/history.d.ts.map +1 -1
  260. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  261. package/dist/server/src/history/services/utils.d.ts +6 -11
  262. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  263. package/dist/server/src/index.d.ts +7 -6
  264. package/dist/server/src/index.d.ts.map +1 -1
  265. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  266. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  267. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  268. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  269. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  270. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  271. package/dist/server/src/preview/index.d.ts +4 -0
  272. package/dist/server/src/preview/index.d.ts.map +1 -0
  273. package/dist/server/src/preview/routes/index.d.ts +8 -0
  274. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  275. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  276. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  277. package/dist/server/src/preview/services/index.d.ts +16 -0
  278. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  279. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  280. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  281. package/dist/server/src/preview/services/preview.d.ts +12 -0
  282. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  283. package/dist/server/src/preview/utils.d.ts +19 -0
  284. package/dist/server/src/preview/utils.d.ts.map +1 -0
  285. package/dist/server/src/register.d.ts.map +1 -1
  286. package/dist/server/src/routes/index.d.ts.map +1 -1
  287. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  288. package/dist/server/src/services/document-metadata.d.ts +12 -10
  289. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  290. package/dist/server/src/services/index.d.ts +7 -6
  291. package/dist/server/src/services/index.d.ts.map +1 -1
  292. package/dist/server/src/services/utils/count.d.ts +1 -1
  293. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  294. package/dist/server/src/services/utils/populate.d.ts +3 -3
  295. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  296. package/dist/server/src/utils/index.d.ts +2 -0
  297. package/dist/server/src/utils/index.d.ts.map +1 -1
  298. package/dist/shared/contracts/collection-types.d.ts +0 -1
  299. package/dist/shared/contracts/components.d.ts +0 -1
  300. package/dist/shared/contracts/content-types.d.ts +0 -1
  301. package/dist/shared/contracts/history-versions.d.ts +0 -1
  302. package/dist/shared/contracts/index.d.ts +1 -1
  303. package/dist/shared/contracts/index.d.ts.map +1 -1
  304. package/dist/shared/contracts/init.d.ts +0 -1
  305. package/dist/shared/contracts/preview.d.ts +26 -0
  306. package/dist/shared/contracts/preview.d.ts.map +1 -0
  307. package/dist/shared/contracts/relations.d.ts +1 -2
  308. package/dist/shared/contracts/relations.d.ts.map +1 -1
  309. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  310. package/dist/shared/contracts/single-types.d.ts +0 -1
  311. package/dist/shared/contracts/uid.d.ts +0 -1
  312. package/dist/shared/index.d.ts +0 -1
  313. package/dist/shared/index.js +37 -22
  314. package/dist/shared/index.js.map +1 -1
  315. package/dist/shared/index.mjs +36 -23
  316. package/dist/shared/index.mjs.map +1 -1
  317. package/package.json +23 -19
  318. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  319. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  320. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  321. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  322. package/dist/_chunks/ComponentConfigurationPage-CpBFh6_r.mjs +0 -236
  323. package/dist/_chunks/ComponentConfigurationPage-CpBFh6_r.mjs.map +0 -1
  324. package/dist/_chunks/ComponentConfigurationPage-_zF8p6CY.js +0 -255
  325. package/dist/_chunks/ComponentConfigurationPage-_zF8p6CY.js.map +0 -1
  326. package/dist/_chunks/ComponentIcon-BXdiCGQp.js +0 -176
  327. package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +0 -1
  328. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  329. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  330. package/dist/_chunks/EditConfigurationPage-CE_yavTi.mjs +0 -132
  331. package/dist/_chunks/EditConfigurationPage-CE_yavTi.mjs.map +0 -1
  332. package/dist/_chunks/EditConfigurationPage-_aG2DJSU.js +0 -151
  333. package/dist/_chunks/EditConfigurationPage-_aG2DJSU.js.map +0 -1
  334. package/dist/_chunks/EditViewPage-DeTn7rAF.mjs +0 -214
  335. package/dist/_chunks/EditViewPage-DeTn7rAF.mjs.map +0 -1
  336. package/dist/_chunks/EditViewPage-G9uNzwYL.js +0 -233
  337. package/dist/_chunks/EditViewPage-G9uNzwYL.js.map +0 -1
  338. package/dist/_chunks/Field-CnCKhI1R.mjs +0 -5519
  339. package/dist/_chunks/Field-CnCKhI1R.mjs.map +0 -1
  340. package/dist/_chunks/Field-DDHUWEfV.js +0 -5551
  341. package/dist/_chunks/Field-DDHUWEfV.js.map +0 -1
  342. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  343. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  344. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  345. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  346. package/dist/_chunks/Form-DYETaKUX.js +0 -779
  347. package/dist/_chunks/Form-DYETaKUX.js.map +0 -1
  348. package/dist/_chunks/Form-IvVVwqRL.mjs +0 -758
  349. package/dist/_chunks/Form-IvVVwqRL.mjs.map +0 -1
  350. package/dist/_chunks/History-BMunT-do.mjs +0 -1032
  351. package/dist/_chunks/History-BMunT-do.mjs.map +0 -1
  352. package/dist/_chunks/History-CnZDctSO.js +0 -1053
  353. package/dist/_chunks/History-CnZDctSO.js.map +0 -1
  354. package/dist/_chunks/ListConfigurationPage-BynalOp8.js +0 -652
  355. package/dist/_chunks/ListConfigurationPage-BynalOp8.js.map +0 -1
  356. package/dist/_chunks/ListConfigurationPage-CDqkCxgV.mjs +0 -632
  357. package/dist/_chunks/ListConfigurationPage-CDqkCxgV.mjs.map +0 -1
  358. package/dist/_chunks/ListViewPage-I88Ouzoq.js +0 -848
  359. package/dist/_chunks/ListViewPage-I88Ouzoq.js.map +0 -1
  360. package/dist/_chunks/ListViewPage-_5gS-DOF.mjs +0 -824
  361. package/dist/_chunks/ListViewPage-_5gS-DOF.mjs.map +0 -1
  362. package/dist/_chunks/NoContentTypePage-BaWQ7HsA.js +0 -51
  363. package/dist/_chunks/NoContentTypePage-BaWQ7HsA.js.map +0 -1
  364. package/dist/_chunks/NoContentTypePage-Dht-55hr.mjs +0 -51
  365. package/dist/_chunks/NoContentTypePage-Dht-55hr.mjs.map +0 -1
  366. package/dist/_chunks/NoPermissionsPage-Bs8D5W_v.mjs +0 -23
  367. package/dist/_chunks/NoPermissionsPage-Bs8D5W_v.mjs.map +0 -1
  368. package/dist/_chunks/NoPermissionsPage-DCVUh5at.js +0 -23
  369. package/dist/_chunks/NoPermissionsPage-DCVUh5at.js.map +0 -1
  370. package/dist/_chunks/Relations-BPgFQeGj.js +0 -714
  371. package/dist/_chunks/Relations-BPgFQeGj.js.map +0 -1
  372. package/dist/_chunks/Relations-Chdt5qWc.mjs +0 -694
  373. package/dist/_chunks/Relations-Chdt5qWc.mjs.map +0 -1
  374. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  375. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  376. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  377. package/dist/_chunks/ar-CCEVvqGG.mjs.map +0 -1
  378. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  379. package/dist/_chunks/ca-5U32ON2v.mjs.map +0 -1
  380. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  381. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  382. package/dist/_chunks/cs-CM2aBUar.mjs.map +0 -1
  383. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  384. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  385. package/dist/_chunks/de-C72KDNOl.mjs.map +0 -1
  386. package/dist/_chunks/de-CCEmbAah.js +0 -199
  387. package/dist/_chunks/en-BVzUkPxZ.js +0 -293
  388. package/dist/_chunks/en-CPTj6CjC.mjs +0 -293
  389. package/dist/_chunks/en-CPTj6CjC.mjs.map +0 -1
  390. package/dist/_chunks/es-CeXiYflN.mjs +0 -196
  391. package/dist/_chunks/es-CeXiYflN.mjs.map +0 -1
  392. package/dist/_chunks/es-EUonQTon.js +0 -196
  393. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  394. package/dist/_chunks/eu-CdALomew.mjs.map +0 -1
  395. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  396. package/dist/_chunks/fr-B7kGGg3E.js +0 -206
  397. package/dist/_chunks/fr-B7kGGg3E.js.map +0 -1
  398. package/dist/_chunks/fr-CD9VFbPM.mjs +0 -206
  399. package/dist/_chunks/fr-CD9VFbPM.mjs.map +0 -1
  400. package/dist/_chunks/gu-BRmF601H.js +0 -200
  401. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  402. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  403. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  404. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  405. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  406. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  407. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  408. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  409. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  410. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  411. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  412. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  413. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  414. package/dist/_chunks/id-B5Ser98A.js +0 -160
  415. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  416. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  417. package/dist/_chunks/id-BtwA9WJT.mjs.map +0 -1
  418. package/dist/_chunks/index-BhbLFX4l.js +0 -4044
  419. package/dist/_chunks/index-BhbLFX4l.js.map +0 -1
  420. package/dist/_chunks/index-D4UGPFZC.mjs +0 -4025
  421. package/dist/_chunks/index-D4UGPFZC.mjs.map +0 -1
  422. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  423. package/dist/_chunks/it-BrVPqaf1.mjs.map +0 -1
  424. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  425. package/dist/_chunks/ja-CcFe8diO.js +0 -196
  426. package/dist/_chunks/ja-CtsUxOvk.mjs +0 -196
  427. package/dist/_chunks/ja-CtsUxOvk.mjs.map +0 -1
  428. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  429. package/dist/_chunks/ko-HVQRlfUI.mjs.map +0 -1
  430. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  431. package/dist/_chunks/layout-CYA7s0qO.js +0 -489
  432. package/dist/_chunks/layout-CYA7s0qO.js.map +0 -1
  433. package/dist/_chunks/layout-D4HI4_PS.mjs +0 -471
  434. package/dist/_chunks/layout-D4HI4_PS.mjs.map +0 -1
  435. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  436. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  437. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  438. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  439. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  440. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  441. package/dist/_chunks/ms-m_WjyWx7.mjs.map +0 -1
  442. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  443. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  444. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  445. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  446. package/dist/_chunks/objects-gigeqt7s.js +0 -49
  447. package/dist/_chunks/objects-gigeqt7s.js.map +0 -1
  448. package/dist/_chunks/objects-mKMAmfec.mjs +0 -47
  449. package/dist/_chunks/objects-mKMAmfec.mjs.map +0 -1
  450. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  451. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  452. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  453. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  454. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  455. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  456. package/dist/_chunks/pt-BR-C71iDxnh.mjs.map +0 -1
  457. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  458. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  459. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  460. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  461. package/dist/_chunks/relations-1pXaYpBK.mjs +0 -135
  462. package/dist/_chunks/relations-1pXaYpBK.mjs.map +0 -1
  463. package/dist/_chunks/relations-DDZ9OxNo.js +0 -134
  464. package/dist/_chunks/relations-DDZ9OxNo.js.map +0 -1
  465. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  466. package/dist/_chunks/ru-BE6A4Exp.mjs.map +0 -1
  467. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  468. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  469. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  470. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  471. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  472. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  473. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  474. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  475. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  476. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  477. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  478. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  479. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  480. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  481. package/dist/_chunks/th-BqbI8lIT.mjs.map +0 -1
  482. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  483. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  484. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  485. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  486. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  487. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  488. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  489. package/dist/_chunks/uk-CR-zDhAY.mjs.map +0 -1
  490. package/dist/_chunks/useDebounce-CtcjDB3L.js +0 -28
  491. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +0 -1
  492. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +0 -29
  493. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +0 -1
  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/vi-CJlYDheJ.js +0 -111
  499. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  500. package/dist/_chunks/vi-DUXIk_fw.mjs.map +0 -1
  501. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  502. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  503. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  504. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  505. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  506. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  507. package/strapi-server.js +0 -3
@@ -1,824 +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, Layouts, useNotification, useAPIErrorHandler, useStrapiApp, Page, BackButton, SearchInput, Table, Pagination, useTable } from "@strapi/admin/strapi-admin";
4
- import { useCollator, Combobox, ComboboxOption, Tooltip, Typography, Menu, Badge, Avatar, Flex, useNotifyAT, Loader, Popover, IconButton, LinkButton, TextButton, Checkbox, 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, p as useGetContentTypeConfigurationQuery, q as CREATOR_FIELDS, r 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-D4UGPFZC.mjs";
12
- import { a as useDebounce, p as prefixFileUrlWithBackendUrl, u as usePrev } from "./useDebounce-DmuSJIF3.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-1pXaYpBK.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
- if (attribute.type === "enumeration") {
125
- filter = {
126
- ...filter,
127
- options: attribute.enum.map((value) => ({
128
- label: value,
129
- value
130
- }))
131
- };
132
- }
133
- return filter;
134
- }).filter(Boolean).toSorted((a, b) => formatter.compare(a.label, b.label));
135
- }, [
136
- allPermissions,
137
- canReadAdminUsers,
138
- model,
139
- attributes,
140
- metadata,
141
- schemas,
142
- users,
143
- formatMessage,
144
- formatter
145
- ]);
146
- const onOpenChange = (isOpen) => {
147
- if (isOpen) {
148
- trackUsage("willFilterEntries");
149
- }
150
- };
151
- const handleFilterChange = (data) => {
152
- const attribute = attributes[data.name];
153
- if (attribute) {
154
- trackUsage("didFilterEntries", {
155
- useRelation: attribute.type === "relation"
156
- });
157
- }
158
- };
159
- return /* @__PURE__ */ jsxs(
160
- Filters.Root,
161
- {
162
- disabled,
163
- options: displayedFilters,
164
- onOpenChange,
165
- onChange: handleFilterChange,
166
- children: [
167
- /* @__PURE__ */ jsx(Filters.Trigger, {}),
168
- /* @__PURE__ */ jsx(Filters.Popover, {}),
169
- /* @__PURE__ */ jsx(Filters.List, {})
170
- ]
171
- }
172
- );
173
- };
174
- const AdminUsersFilter = ({ name }) => {
175
- const [pageSize, setPageSize] = React.useState(10);
176
- const [search, setSearch] = React.useState("");
177
- const { formatMessage } = useIntl();
178
- const debouncedSearch = useDebounce(search, 300);
179
- const { data, isLoading } = useAdminUsers({
180
- pageSize,
181
- _q: debouncedSearch
182
- });
183
- const field = useField(name);
184
- const handleOpenChange = (isOpen) => {
185
- if (!isOpen) {
186
- setPageSize(10);
187
- }
188
- };
189
- const { users = [], pagination } = data ?? {};
190
- const { pageCount = 1, page = 1 } = pagination ?? {};
191
- return /* @__PURE__ */ jsx(
192
- Combobox,
193
- {
194
- value: field.value,
195
- "aria-label": formatMessage({
196
- id: "content-manager.components.Filters.usersSelect.label",
197
- defaultMessage: "Search and select a user to filter"
198
- }),
199
- onOpenChange: handleOpenChange,
200
- onChange: (value) => field.onChange(name, value),
201
- loading: isLoading,
202
- onLoadMore: () => setPageSize(pageSize + 10),
203
- hasMoreItems: page < pageCount,
204
- onInputChange: (e) => {
205
- setSearch(e.currentTarget.value);
206
- },
207
- children: users.map((user) => {
208
- return /* @__PURE__ */ jsx(ComboboxOption, { value: user.id.toString(), children: getDisplayName(user) }, user.id);
209
- })
210
- }
211
- );
212
- };
213
- const CellValue = ({ type, value }) => {
214
- const { formatDate, formatTime, formatNumber } = useIntl();
215
- let formattedValue = value;
216
- if (type === "date") {
217
- formattedValue = formatDate(parseISO(value), { dateStyle: "full" });
218
- }
219
- if (type === "datetime") {
220
- formattedValue = formatDate(value, { dateStyle: "full", timeStyle: "short" });
221
- }
222
- if (type === "time") {
223
- const [hour, minute, second] = value.split(":");
224
- const date = /* @__PURE__ */ new Date();
225
- date.setHours(hour);
226
- date.setMinutes(minute);
227
- date.setSeconds(second);
228
- formattedValue = formatTime(date, {
229
- timeStyle: "short"
230
- });
231
- }
232
- if (["float", "decimal"].includes(type)) {
233
- formattedValue = formatNumber(value, {
234
- // Should be kept in sync with the corresponding value
235
- // in the design-system/NumberInput: https://github.com/strapi/design-system/blob/main/packages/strapi-design-system/src/NumberInput/NumberInput.js#L53
236
- maximumFractionDigits: 20
237
- });
238
- }
239
- if (["integer", "biginteger"].includes(type)) {
240
- formattedValue = formatNumber(value, { maximumFractionDigits: 0 });
241
- }
242
- return toString(formattedValue);
243
- };
244
- const SingleComponent = ({ content, mainField }) => {
245
- if (!mainField) {
246
- return null;
247
- }
248
- 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] }) }) });
249
- };
250
- const RepeatableComponent = ({ content, mainField }) => {
251
- const { formatMessage } = useIntl();
252
- if (!mainField) {
253
- return null;
254
- }
255
- return /* @__PURE__ */ jsxs(Menu.Root, { children: [
256
- /* @__PURE__ */ jsxs(Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: [
257
- /* @__PURE__ */ jsx(Badge, { children: content.length }),
258
- formatMessage(
259
- {
260
- id: "content-manager.containers.list.items",
261
- defaultMessage: "{number, plural, =0 {items} one {item} other {items}}"
262
- },
263
- { number: content.length }
264
- )
265
- ] }),
266
- /* @__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)) })
267
- ] });
268
- };
269
- const getFileExtension = (ext) => ext && ext[0] === "." ? ext.substring(1) : ext;
270
- const MediaSingle = ({ url, mime, alternativeText, name, ext, formats }) => {
271
- const fileURL = prefixFileUrlWithBackendUrl(url);
272
- if (mime.includes("image")) {
273
- const thumbnail = formats?.thumbnail?.url;
274
- const mediaURL = prefixFileUrlWithBackendUrl(thumbnail) || fileURL;
275
- return /* @__PURE__ */ jsx(
276
- Avatar.Item,
277
- {
278
- src: mediaURL,
279
- alt: alternativeText || name,
280
- fallback: alternativeText || name,
281
- preview: true
282
- }
283
- );
284
- }
285
- const fileExtension = getFileExtension(ext);
286
- const fileName = name.length > 100 ? `${name.substring(0, 100)}...` : name;
287
- return /* @__PURE__ */ jsx(Tooltip, { description: fileName, children: /* @__PURE__ */ jsx(FileWrapper, { children: fileExtension }) });
288
- };
289
- const FileWrapper = ({ children }) => {
290
- return /* @__PURE__ */ jsx(
291
- Flex,
292
- {
293
- tag: "span",
294
- position: "relative",
295
- borderRadius: "50%",
296
- width: "26px",
297
- height: "26px",
298
- borderColor: "neutral200",
299
- background: "neutral150",
300
- paddingLeft: "1px",
301
- justifyContent: "center",
302
- alignItems: "center",
303
- children: /* @__PURE__ */ jsx(FileTypography, { variant: "sigma", textColor: "neutral600", children })
304
- }
305
- );
306
- };
307
- const FileTypography = styled(Typography)`
308
- font-size: 0.9rem;
309
- line-height: 0.9rem;
310
- `;
311
- const MediaMultiple = ({ content }) => {
312
- return /* @__PURE__ */ jsx(Avatar.Group, { children: content.map((file, index) => {
313
- const key = `${file.id}${index}`;
314
- if (index === 3) {
315
- const remainingFiles = `+${content.length - 3}`;
316
- return /* @__PURE__ */ jsx(FileWrapper, { children: remainingFiles }, key);
317
- }
318
- if (index > 3) {
319
- return null;
320
- }
321
- return /* @__PURE__ */ jsx(MediaSingle, { ...file }, key);
322
- }) });
323
- };
324
- const RelationSingle = ({ mainField, content }) => {
325
- return /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", textColor: "neutral800", ellipsis: true, children: getRelationLabel(content, mainField) });
326
- };
327
- const RelationMultiple = ({ mainField, content, rowId, name }) => {
328
- const { model } = useDoc();
329
- const { formatMessage } = useIntl();
330
- const { notifyStatus } = useNotifyAT();
331
- const [isOpen, setIsOpen] = React.useState(false);
332
- const [targetField] = name.split(".");
333
- const { data, isLoading } = useGetRelationsQuery(
334
- {
335
- model,
336
- id: rowId,
337
- targetField
338
- },
339
- {
340
- skip: !isOpen,
341
- refetchOnMountOrArgChange: true
342
- }
343
- );
344
- React.useEffect(() => {
345
- if (data) {
346
- notifyStatus(
347
- formatMessage({
348
- id: getTranslation("DynamicTable.relation-loaded"),
349
- defaultMessage: "Relations have been loaded"
350
- })
351
- );
352
- }
353
- }, [data, formatMessage, notifyStatus]);
354
- return /* @__PURE__ */ jsxs(Menu.Root, { onOpenChange: (isOpen2) => setIsOpen(isOpen2), children: [
355
- /* @__PURE__ */ jsx(Menu.Trigger, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(Typography, { style: { cursor: "pointer" }, textColor: "neutral800", fontWeight: "regular", children: content.count > 0 ? formatMessage(
356
- {
357
- id: "content-manager.containers.list.items",
358
- defaultMessage: "{number} {number, plural, =0 {items} one {item} other {items}}"
359
- },
360
- { number: content.count }
361
- ) : "-" }) }),
362
- /* @__PURE__ */ jsxs(Menu.Content, { children: [
363
- isLoading && /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Loader, { small: true, children: formatMessage({
364
- id: getTranslation("ListViewTable.relation-loading"),
365
- defaultMessage: "Relations are loading"
366
- }) }) }),
367
- data?.results && /* @__PURE__ */ jsxs(Fragment, { children: [
368
- data.results.map((entry) => /* @__PURE__ */ jsx(Menu.Item, { disabled: true, children: /* @__PURE__ */ jsx(Typography, { maxWidth: "50rem", ellipsis: true, children: getRelationLabel(entry, mainField) }) }, entry.documentId)),
369
- data?.pagination && data?.pagination.total > 10 && /* @__PURE__ */ jsx(
370
- Menu.Item,
371
- {
372
- "aria-disabled": true,
373
- "aria-label": formatMessage({
374
- id: getTranslation("ListViewTable.relation-more"),
375
- defaultMessage: "This relation contains more entities than displayed"
376
- }),
377
- children: /* @__PURE__ */ jsx(Typography, { children: "…" })
378
- }
379
- )
380
- ] })
381
- ] })
382
- ] });
383
- };
384
- const CellContent = ({ content, mainField, attribute, rowId, name }) => {
385
- if (!hasContent(content, mainField, attribute)) {
386
- return /* @__PURE__ */ jsx(
387
- Typography,
388
- {
389
- textColor: "neutral800",
390
- paddingLeft: attribute.type === "relation" ? "1.6rem" : 0,
391
- paddingRight: attribute.type === "relation" ? "1.6rem" : 0,
392
- children: "-"
393
- }
394
- );
395
- }
396
- switch (attribute.type) {
397
- case "media":
398
- if (!attribute.multiple) {
399
- return /* @__PURE__ */ jsx(MediaSingle, { ...content });
400
- }
401
- return /* @__PURE__ */ jsx(MediaMultiple, { content });
402
- case "relation": {
403
- if (isSingleRelation(attribute.relation)) {
404
- return /* @__PURE__ */ jsx(RelationSingle, { mainField, content });
405
- }
406
- return /* @__PURE__ */ jsx(RelationMultiple, { rowId, mainField, content, name });
407
- }
408
- case "component":
409
- if (attribute.repeatable) {
410
- return /* @__PURE__ */ jsx(RepeatableComponent, { mainField, content });
411
- }
412
- return /* @__PURE__ */ jsx(SingleComponent, { mainField, content });
413
- case "string":
414
- 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 }) }) });
415
- default:
416
- return /* @__PURE__ */ jsx(Typography, { maxWidth: "30rem", ellipsis: true, textColor: "neutral800", children: /* @__PURE__ */ jsx(CellValue, { type: attribute.type, value: content }) });
417
- }
418
- };
419
- const hasContent = (content, mainField, attribute) => {
420
- if (attribute.type === "component") {
421
- if (attribute.repeatable || !mainField) {
422
- return content?.length > 0;
423
- }
424
- const value = content?.[mainField.name];
425
- if (mainField.name === "id" && ![void 0, null].includes(value)) {
426
- return true;
427
- }
428
- return !isEmpty(value);
429
- }
430
- if (attribute.type === "relation") {
431
- if (isSingleRelation(attribute.relation)) {
432
- return !isEmpty(content);
433
- }
434
- return content?.count > 0;
435
- }
436
- if (["integer", "decimal", "float", "number"].includes(attribute.type)) {
437
- return typeof content === "number";
438
- }
439
- if (attribute.type === "boolean") {
440
- return content !== null;
441
- }
442
- return !isEmpty(content);
443
- };
444
- const isSingleRelation = (type) => ["oneToOne", "manyToOne", "oneToOneMorph"].includes(type);
445
- const ViewSettingsMenu = (props) => {
446
- const permissions = useTypedSelector(
447
- (state) => state.admin_app.permissions.contentManager?.collectionTypesConfigurations ?? []
448
- );
449
- const [{ query }] = useQueryParams();
450
- const { formatMessage } = useIntl();
451
- const {
452
- allowedActions: { canConfigureView }
453
- } = useRBAC(permissions);
454
- return /* @__PURE__ */ jsxs(Popover.Root, { children: [
455
- /* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
456
- IconButton,
457
- {
458
- label: formatMessage({
459
- id: "components.ViewSettings.tooltip",
460
- defaultMessage: "View Settings"
461
- }),
462
- children: /* @__PURE__ */ jsx(Cog, {})
463
- }
464
- ) }),
465
- /* @__PURE__ */ jsx(Popover.Content, { side: "bottom", align: "end", sideOffset: 4, children: /* @__PURE__ */ jsxs(Flex, { alignItems: "stretch", direction: "column", padding: 3, gap: 3, children: [
466
- canConfigureView ? /* @__PURE__ */ jsx(
467
- LinkButton,
468
- {
469
- size: "S",
470
- startIcon: /* @__PURE__ */ jsx(ListPlus, {}),
471
- variant: "secondary",
472
- tag: NavLink,
473
- to: {
474
- pathname: "configurations/list",
475
- search: query.plugins ? stringify({ plugins: query.plugins }, { encode: false }) : ""
476
- },
477
- children: formatMessage({
478
- id: "app.links.configure-view",
479
- defaultMessage: "Configure the view"
480
- })
481
- }
482
- ) : null,
483
- /* @__PURE__ */ jsx(FieldPicker, { ...props })
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__ */ jsx(
522
- Flex,
523
- {
524
- wrap: "wrap",
525
- gap: 2,
526
- background: isActive ? "primary100" : "transparent",
527
- hasRadius: true,
528
- padding: 2,
529
- children: /* @__PURE__ */ jsx(
530
- Checkbox,
531
- {
532
- onCheckedChange: () => handleChange(header.name),
533
- checked: isActive,
534
- name: header.name,
535
- children: /* @__PURE__ */ jsx(Typography, { fontSize: 1, children: header.label })
536
- }
537
- )
538
- },
539
- header.name
540
- );
541
- }) })
542
- ] });
543
- };
544
- const { INJECT_COLUMN_IN_TABLE } = HOOKS;
545
- const LayoutsHeaderCustom = styled(Layouts.Header)`
546
- overflow-wrap: anywhere;
547
- `;
548
- const ListViewPage = () => {
549
- const { trackUsage } = useTracking();
550
- const navigate = useNavigate();
551
- const { formatMessage } = useIntl();
552
- const { toggleNotification } = useNotification();
553
- const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler(getTranslation);
554
- const { collectionType, model, schema } = useDoc();
555
- const { list } = useDocumentLayout(model);
556
- const [displayedHeaders, setDisplayedHeaders] = React.useState([]);
557
- const listLayout = usePrev(list.layout);
558
- React.useEffect(() => {
559
- if (!isEqual(listLayout, list.layout)) {
560
- setDisplayedHeaders(list.layout);
561
- }
562
- }, [list.layout, listLayout]);
563
- const handleSetHeaders = (headers) => {
564
- setDisplayedHeaders(
565
- convertListLayoutToFieldLayouts(headers, schema.attributes, list.metadatas)
566
- );
567
- };
568
- const [{ query }] = useQueryParams({
569
- page: "1",
570
- pageSize: list.settings.pageSize.toString(),
571
- sort: list.settings.defaultSortBy ? `${list.settings.defaultSortBy}:${list.settings.defaultSortOrder}` : ""
572
- });
573
- const params = React.useMemo(() => buildValidParams(query), [query]);
574
- const { data, error, isFetching } = useGetAllDocumentsQuery({
575
- model,
576
- params
577
- });
578
- React.useEffect(() => {
579
- if (error) {
580
- toggleNotification({
581
- type: "danger",
582
- message: formatAPIError(error)
583
- });
584
- }
585
- }, [error, formatAPIError, toggleNotification]);
586
- const { results = [], pagination } = data ?? {};
587
- React.useEffect(() => {
588
- if (pagination && pagination.pageCount > 0 && pagination.page > pagination.pageCount) {
589
- navigate(
590
- {
591
- search: stringify({
592
- ...query,
593
- page: pagination.pageCount
594
- })
595
- },
596
- { replace: true }
597
- );
598
- }
599
- }, [pagination, formatMessage, query, navigate]);
600
- const { canCreate } = useDocumentRBAC("ListViewPage", ({ canCreate: canCreate2 }) => ({
601
- canCreate: canCreate2
602
- }));
603
- const runHookWaterfall = useStrapiApp("ListViewPage", ({ runHookWaterfall: runHookWaterfall2 }) => runHookWaterfall2);
604
- const tableHeaders = React.useMemo(() => {
605
- const headers = runHookWaterfall(INJECT_COLUMN_IN_TABLE, {
606
- displayedHeaders,
607
- layout: list
608
- });
609
- const formattedHeaders = headers.displayedHeaders.map((header) => {
610
- return {
611
- ...header,
612
- label: typeof header.label === "string" ? header.label : formatMessage(header.label),
613
- name: `${header.name}${header.mainField ? `.${header.mainField}` : ""}`
614
- };
615
- });
616
- if (schema?.options?.draftAndPublish) {
617
- formattedHeaders.push({
618
- attribute: {
619
- type: "custom"
620
- },
621
- name: "status",
622
- label: formatMessage({
623
- id: getTranslation(`containers.list.table-headers.status`),
624
- defaultMessage: "status"
625
- }),
626
- searchable: false,
627
- sortable: false
628
- });
629
- }
630
- return formattedHeaders;
631
- }, [displayedHeaders, formatMessage, list, runHookWaterfall, schema?.options?.draftAndPublish]);
632
- if (isFetching) {
633
- return /* @__PURE__ */ jsx(Page.Loading, {});
634
- }
635
- if (error) {
636
- return /* @__PURE__ */ jsx(Page.Error, {});
637
- }
638
- const contentTypeTitle = schema?.info.displayName ?? "Untitled";
639
- const handleRowClick = (id) => () => {
640
- trackUsage("willEditEntryFromList");
641
- navigate({
642
- pathname: id.toString(),
643
- search: stringify({ plugins: query.plugins })
644
- });
645
- };
646
- return /* @__PURE__ */ jsxs(Page.Main, { children: [
647
- /* @__PURE__ */ jsx(Page.Title, { children: `${contentTypeTitle}` }),
648
- /* @__PURE__ */ jsx(
649
- LayoutsHeaderCustom,
650
- {
651
- primaryAction: canCreate ? /* @__PURE__ */ jsx(CreateButton, {}) : null,
652
- subtitle: formatMessage(
653
- {
654
- id: getTranslation("pages.ListView.header-subtitle"),
655
- defaultMessage: "{number, plural, =0 {# entries} one {# entry} other {# entries}} found"
656
- },
657
- { number: pagination?.total }
658
- ),
659
- title: contentTypeTitle,
660
- navigationAction: /* @__PURE__ */ jsx(BackButton, {})
661
- }
662
- ),
663
- /* @__PURE__ */ jsx(
664
- Layouts.Action,
665
- {
666
- endActions: /* @__PURE__ */ jsxs(Fragment, { children: [
667
- /* @__PURE__ */ jsx(InjectionZone, { area: "listView.actions" }),
668
- /* @__PURE__ */ jsx(
669
- ViewSettingsMenu,
670
- {
671
- setHeaders: handleSetHeaders,
672
- resetHeaders: () => setDisplayedHeaders(list.layout),
673
- headers: displayedHeaders.map((header) => header.name)
674
- }
675
- )
676
- ] }),
677
- startActions: /* @__PURE__ */ jsxs(Fragment, { children: [
678
- list.settings.searchable && /* @__PURE__ */ jsx(
679
- SearchInput,
680
- {
681
- disabled: results.length === 0,
682
- label: formatMessage(
683
- { id: "app.component.search.label", defaultMessage: "Search for {target}" },
684
- { target: contentTypeTitle }
685
- ),
686
- placeholder: formatMessage({
687
- id: "global.search",
688
- defaultMessage: "Search"
689
- }),
690
- trackedEvent: "didSearch"
691
- }
692
- ),
693
- list.settings.filterable && schema ? /* @__PURE__ */ jsx(FiltersImpl, { disabled: results.length === 0, schema }) : null
694
- ] })
695
- }
696
- ),
697
- /* @__PURE__ */ jsx(Layouts.Content, { children: /* @__PURE__ */ jsxs(Flex, { gap: 4, direction: "column", alignItems: "stretch", children: [
698
- /* @__PURE__ */ jsxs(Table.Root, { rows: results, headers: tableHeaders, isLoading: isFetching, children: [
699
- /* @__PURE__ */ jsx(TableActionsBar, {}),
700
- /* @__PURE__ */ jsxs(Table.Content, { children: [
701
- /* @__PURE__ */ jsxs(Table.Head, { children: [
702
- /* @__PURE__ */ jsx(Table.HeaderCheckboxCell, {}),
703
- tableHeaders.map((header) => /* @__PURE__ */ jsx(Table.HeaderCell, { ...header }, header.name))
704
- ] }),
705
- /* @__PURE__ */ jsx(Table.Loading, {}),
706
- /* @__PURE__ */ jsx(Table.Empty, { action: canCreate ? /* @__PURE__ */ jsx(CreateButton, { variant: "secondary" }) : null }),
707
- /* @__PURE__ */ jsx(Table.Body, { children: results.map((row) => {
708
- return /* @__PURE__ */ jsxs(
709
- Table.Row,
710
- {
711
- cursor: "pointer",
712
- onClick: handleRowClick(row.documentId),
713
- children: [
714
- /* @__PURE__ */ jsx(Table.CheckboxCell, { id: row.id }),
715
- tableHeaders.map(({ cellFormatter, ...header }) => {
716
- if (header.name === "status") {
717
- const { status } = row;
718
- return /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(DocumentStatus, { status, maxWidth: "min-content" }) }, header.name);
719
- }
720
- if (["createdBy", "updatedBy"].includes(header.name.split(".")[0])) {
721
- 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);
722
- }
723
- if (typeof cellFormatter === "function") {
724
- return /* @__PURE__ */ jsx(Table.Cell, { children: cellFormatter(row, header, { collectionType, model }) }, header.name);
725
- }
726
- return /* @__PURE__ */ jsx(Table.Cell, { children: /* @__PURE__ */ jsx(
727
- CellContent,
728
- {
729
- content: row[header.name.split(".")[0]],
730
- rowId: row.documentId,
731
- ...header
732
- }
733
- ) }, header.name);
734
- }),
735
- /* @__PURE__ */ jsx(ActionsCell, { onClick: (e) => e.stopPropagation(), children: /* @__PURE__ */ jsx(TableActions, { document: row }) })
736
- ]
737
- },
738
- row.id
739
- );
740
- }) })
741
- ] })
742
- ] }),
743
- /* @__PURE__ */ jsxs(
744
- Pagination.Root,
745
- {
746
- ...pagination,
747
- onPageSizeChange: () => trackUsage("willChangeNumberOfEntriesPerPage"),
748
- children: [
749
- /* @__PURE__ */ jsx(Pagination.PageSize, {}),
750
- /* @__PURE__ */ jsx(Pagination.Links, {})
751
- ]
752
- }
753
- )
754
- ] }) })
755
- ] });
756
- };
757
- const ActionsCell = styled(Table.Cell)`
758
- display: flex;
759
- justify-content: flex-end;
760
- `;
761
- const TableActionsBar = () => {
762
- const selectRow = useTable("TableActionsBar", (state) => state.selectRow);
763
- const [{ query }] = useQueryParams();
764
- const locale = query?.plugins?.i18n?.locale;
765
- const prevLocale = usePrev(locale);
766
- React.useEffect(() => {
767
- if (prevLocale !== locale) {
768
- selectRow([]);
769
- }
770
- }, [selectRow, prevLocale, locale]);
771
- return /* @__PURE__ */ jsx(Table.ActionBar, { children: /* @__PURE__ */ jsx(BulkActionsRenderer, {}) });
772
- };
773
- const CreateButton = ({ variant }) => {
774
- const { formatMessage } = useIntl();
775
- const { trackUsage } = useTracking();
776
- const [{ query }] = useQueryParams();
777
- return /* @__PURE__ */ jsx(
778
- Button,
779
- {
780
- variant,
781
- tag: Link,
782
- onClick: () => {
783
- trackUsage("willCreateEntry", { status: "draft" });
784
- },
785
- startIcon: /* @__PURE__ */ jsx(Plus, {}),
786
- style: { textDecoration: "none" },
787
- to: {
788
- pathname: "create",
789
- search: stringify({ plugins: query.plugins })
790
- },
791
- minWidth: "max-content",
792
- marginLeft: 2,
793
- children: formatMessage({
794
- id: getTranslation("HeaderLayout.button.label-add-entry"),
795
- defaultMessage: "Create new entry"
796
- })
797
- }
798
- );
799
- };
800
- const ProtectedListViewPage = () => {
801
- const { slug = "" } = useParams();
802
- const {
803
- permissions = [],
804
- isLoading,
805
- error
806
- } = useRBAC(
807
- PERMISSIONS.map((action) => ({
808
- action,
809
- subject: slug
810
- }))
811
- );
812
- if (isLoading) {
813
- return /* @__PURE__ */ jsx(Page.Loading, {});
814
- }
815
- if (error || !slug) {
816
- return /* @__PURE__ */ jsx(Page.Error, {});
817
- }
818
- return /* @__PURE__ */ jsx(Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsx(DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsx(ListViewPage, {}) }) });
819
- };
820
- export {
821
- ListViewPage,
822
- ProtectedListViewPage
823
- };
824
- //# sourceMappingURL=ListViewPage-_5gS-DOF.mjs.map