@strapi/content-manager 0.0.0-next.76a9dc5ca66301db734af3bc2111406c17ccb860 → 0.0.0-next.7e9928491527b4d1767954c3372ad33d9c409f14

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 (435) hide show
  1. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs +80 -0
  2. package/dist/admin/chunks/CardDragPreview-DwuraT0K.mjs.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-BN2kOtDm.mjs +277 -0
  6. package/dist/admin/chunks/ComponentConfigurationPage-BN2kOtDm.mjs.map +1 -0
  7. package/dist/admin/chunks/ComponentConfigurationPage-C5H-5L1u.js +299 -0
  8. package/dist/admin/chunks/ComponentConfigurationPage-C5H-5L1u.js.map +1 -0
  9. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs +153 -0
  10. package/dist/admin/chunks/ComponentIcon-BZcTc4rj.mjs.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-BExtZuB7.js +181 -0
  14. package/dist/admin/chunks/EditConfigurationPage-BExtZuB7.js.map +1 -0
  15. package/dist/admin/chunks/EditConfigurationPage-tMgOELQG.mjs +159 -0
  16. package/dist/admin/chunks/EditConfigurationPage-tMgOELQG.mjs.map +1 -0
  17. package/dist/admin/chunks/EditViewPage-CYe7wAXF.mjs +314 -0
  18. package/dist/admin/chunks/EditViewPage-CYe7wAXF.mjs.map +1 -0
  19. package/dist/admin/chunks/EditViewPage-DFkloeMZ.js +337 -0
  20. package/dist/admin/chunks/EditViewPage-DFkloeMZ.js.map +1 -0
  21. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs +56 -0
  22. package/dist/admin/chunks/FieldTypeIcon-BY6MrVF4.mjs.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-DGUP3zQO.js +978 -0
  26. package/dist/admin/chunks/Form-DGUP3zQO.js.map +1 -0
  27. package/dist/admin/chunks/Form-DTO0ZIaB.mjs +955 -0
  28. package/dist/admin/chunks/Form-DTO0ZIaB.mjs.map +1 -0
  29. package/dist/admin/chunks/History-C333pgXF.mjs +1357 -0
  30. package/dist/admin/chunks/History-C333pgXF.mjs.map +1 -0
  31. package/dist/admin/chunks/History-CQznK1pG.js +1380 -0
  32. package/dist/admin/chunks/History-CQznK1pG.js.map +1 -0
  33. package/dist/admin/chunks/Input-BexkC_pp.mjs +7190 -0
  34. package/dist/admin/chunks/Input-BexkC_pp.mjs.map +1 -0
  35. package/dist/admin/chunks/Input-DLJZHw9Y.js +7221 -0
  36. package/dist/admin/chunks/Input-DLJZHw9Y.js.map +1 -0
  37. package/dist/admin/chunks/ListConfigurationPage-71I_stAM.js +819 -0
  38. package/dist/admin/chunks/ListConfigurationPage-71I_stAM.js.map +1 -0
  39. package/dist/admin/chunks/ListConfigurationPage-BX2WR7MI.mjs +796 -0
  40. package/dist/admin/chunks/ListConfigurationPage-BX2WR7MI.mjs.map +1 -0
  41. package/dist/admin/chunks/ListViewPage-BDeT3Dkk.mjs +1133 -0
  42. package/dist/admin/chunks/ListViewPage-BDeT3Dkk.mjs.map +1 -0
  43. package/dist/admin/chunks/ListViewPage-DV3heO4F.js +1155 -0
  44. package/dist/admin/chunks/ListViewPage-DV3heO4F.js.map +1 -0
  45. package/dist/admin/chunks/NoContentTypePage-9JHYpYVX.mjs +58 -0
  46. package/dist/admin/chunks/NoContentTypePage-9JHYpYVX.mjs.map +1 -0
  47. package/dist/admin/chunks/NoContentTypePage-COih9y2J.js +60 -0
  48. package/dist/admin/chunks/NoContentTypePage-COih9y2J.js.map +1 -0
  49. package/dist/admin/chunks/NoPermissionsPage-DGAwRIlN.js +39 -0
  50. package/dist/admin/chunks/NoPermissionsPage-DGAwRIlN.js.map +1 -0
  51. package/dist/admin/chunks/NoPermissionsPage-DTe9I47q.mjs +37 -0
  52. package/dist/admin/chunks/NoPermissionsPage-DTe9I47q.mjs.map +1 -0
  53. package/dist/admin/chunks/Preview-BEq0FXda.mjs +551 -0
  54. package/dist/admin/chunks/Preview-BEq0FXda.mjs.map +1 -0
  55. package/dist/admin/chunks/Preview-CXtc9yEV.js +573 -0
  56. package/dist/admin/chunks/Preview-CXtc9yEV.js.map +1 -0
  57. package/dist/admin/chunks/Relations-o7_hVGyK.js +1318 -0
  58. package/dist/admin/chunks/Relations-o7_hVGyK.js.map +1 -0
  59. package/dist/admin/chunks/Relations-qeZyLDgQ.mjs +1291 -0
  60. package/dist/admin/chunks/Relations-qeZyLDgQ.mjs.map +1 -0
  61. package/dist/admin/chunks/ar-DckYq_WK.mjs +222 -0
  62. package/dist/{_chunks/ar-CCEVvqGG.mjs.map → admin/chunks/ar-DckYq_WK.mjs.map} +1 -1
  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.mjs +197 -0
  68. package/dist/admin/chunks/ca-DviY7mRj.mjs.map +1 -0
  69. package/dist/admin/chunks/cs-BJFxwIWj.js +126 -0
  70. package/dist/{_chunks/cs-CkJy6B2v.js.map → admin/chunks/cs-BJFxwIWj.js.map} +1 -1
  71. package/dist/admin/chunks/cs-C7OSYFQ7.mjs +122 -0
  72. package/dist/{_chunks/cs-CM2aBUar.mjs.map → admin/chunks/cs-C7OSYFQ7.mjs.map} +1 -1
  73. package/dist/admin/chunks/de-5QRlDHyR.mjs +195 -0
  74. package/dist/{_chunks/eu-CdALomew.mjs.map → admin/chunks/de-5QRlDHyR.mjs.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/{_chunks/en-BzQmavmK.js.map → admin/chunks/en-C1CjdAtC.js.map} +1 -1
  79. package/dist/admin/chunks/en-LfhocNG2.mjs +308 -0
  80. package/dist/{_chunks/en-CSxLmrh1.mjs.map → admin/chunks/en-LfhocNG2.mjs.map} +1 -1
  81. package/dist/admin/chunks/es-C8vLuvZL.js +197 -0
  82. package/dist/{_chunks/es-9K52xZIr.js.map → admin/chunks/es-C8vLuvZL.js.map} +1 -1
  83. package/dist/admin/chunks/es-DkoWSExG.mjs +192 -0
  84. package/dist/{_chunks/ja-BHqhDq4V.mjs.map → admin/chunks/es-DkoWSExG.mjs.map} +1 -1
  85. package/dist/admin/chunks/eu-BG1xX7HK.mjs +198 -0
  86. package/dist/admin/chunks/eu-BG1xX7HK.mjs.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.mjs +215 -0
  90. package/dist/admin/chunks/fr-CFdRaRVj.mjs.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.mjs +196 -0
  94. package/dist/admin/chunks/gu-D5MMMXRs.mjs.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.mjs +196 -0
  100. package/dist/admin/chunks/hi-lp17SCjr.mjs.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_.mjs +7 -0
  104. package/dist/admin/chunks/hooks-DMvik5y_.mjs.map +1 -0
  105. package/dist/admin/chunks/hu-CLka1U2C.mjs +198 -0
  106. package/dist/admin/chunks/hu-CLka1U2C.mjs.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.mjs +156 -0
  112. package/dist/{_chunks/id-BtwA9WJT.mjs.map → admin/chunks/id-USfY9m1g.mjs.map} +1 -1
  113. package/dist/admin/chunks/index-BHimg6jW.js +5417 -0
  114. package/dist/admin/chunks/index-BHimg6jW.js.map +1 -0
  115. package/dist/admin/chunks/index-Cs6qwFQu.mjs +5351 -0
  116. package/dist/admin/chunks/index-Cs6qwFQu.mjs.map +1 -0
  117. package/dist/admin/chunks/it-BAHrwmYS.mjs +158 -0
  118. package/dist/{_chunks/it-BrVPqaf1.mjs.map → admin/chunks/it-BAHrwmYS.mjs.map} +1 -1
  119. package/dist/admin/chunks/it-CQFpa_Dc.js +163 -0
  120. package/dist/{_chunks/ko-woFZPmLk.js.map → admin/chunks/it-CQFpa_Dc.js.map} +1 -1
  121. package/dist/admin/chunks/ja-BWKmBJFT.mjs +192 -0
  122. package/dist/{_chunks/ko-HVQRlfUI.mjs.map → admin/chunks/ja-BWKmBJFT.mjs.map} +1 -1
  123. package/dist/admin/chunks/ja-jdQM-B79.js +197 -0
  124. package/dist/{_chunks/de-CCEmbAah.js.map → admin/chunks/ja-jdQM-B79.js.map} +1 -1
  125. package/dist/admin/chunks/ko-CgADGBNt.mjs +191 -0
  126. package/dist/{_chunks/es-D34tqjMw.mjs.map → admin/chunks/ko-CgADGBNt.mjs.map} +1 -1
  127. package/dist/admin/chunks/ko-k46sEyzt.js +196 -0
  128. package/dist/{_chunks/ja-7sfIbjxE.js.map → admin/chunks/ko-k46sEyzt.js.map} +1 -1
  129. package/dist/admin/chunks/layout-DStNia_P.mjs +599 -0
  130. package/dist/admin/chunks/layout-DStNia_P.mjs.map +1 -0
  131. package/dist/admin/chunks/layout-Dtahn4Ue.js +619 -0
  132. package/dist/admin/chunks/layout-Dtahn4Ue.js.map +1 -0
  133. package/dist/admin/chunks/ml-CnhCfOn_.mjs +196 -0
  134. package/dist/admin/chunks/ml-CnhCfOn_.mjs.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.mjs +140 -0
  138. package/dist/{_chunks/ms-m_WjyWx7.mjs.map → admin/chunks/ms-Bh09NFff.mjs.map} +1 -1
  139. package/dist/admin/chunks/ms-CvSC0OdG.js +145 -0
  140. package/dist/{_chunks/ms-BuFotyP_.js.map → admin/chunks/ms-CvSC0OdG.js.map} +1 -1
  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.mjs +198 -0
  144. package/dist/admin/chunks/nl-C8HYflTc.mjs.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.mjs +73 -0
  148. package/dist/admin/chunks/objects-wl73iEma.mjs.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.mjs +195 -0
  152. package/dist/{_chunks/ca-5U32ON2v.mjs.map → admin/chunks/pl-MFCZJZuZ.mjs.map} +1 -1
  153. package/dist/admin/chunks/pt-BR-CPtAXD-4.js +202 -0
  154. package/dist/{_chunks/pt-BR-BiOz37D9.js.map → admin/chunks/pt-BR-CPtAXD-4.js.map} +1 -1
  155. package/dist/admin/chunks/pt-BR-CcotyBGJ.mjs +197 -0
  156. package/dist/{_chunks/pt-BR-C71iDxnh.mjs.map → admin/chunks/pt-BR-CcotyBGJ.mjs.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.mjs +93 -0
  160. package/dist/admin/chunks/pt-HbmgeiYO.mjs.map +1 -0
  161. package/dist/admin/chunks/relations-Cq8NRUto.mjs +173 -0
  162. package/dist/admin/chunks/relations-Cq8NRUto.mjs.map +1 -0
  163. package/dist/admin/chunks/relations-XOYEEqMz.js +178 -0
  164. package/dist/admin/chunks/relations-XOYEEqMz.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.mjs +230 -0
  168. package/dist/{_chunks/ru-BE6A4Exp.mjs.map → admin/chunks/ru-CB4BUyQp.mjs.map} +1 -1
  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.mjs +196 -0
  172. package/dist/admin/chunks/sa-n_aPA-pU.mjs.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.mjs +198 -0
  176. package/dist/admin/chunks/sk-tn_BDjE2.mjs.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.mjs +198 -0
  180. package/dist/admin/chunks/sv-cq4ZrQRd.mjs.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.mjs +144 -0
  184. package/dist/{_chunks/th-BqbI8lIT.mjs.map → admin/chunks/th-mUH7hEtc.mjs.map} +1 -1
  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.mjs +195 -0
  188. package/dist/{_chunks/de-C72KDNOl.mjs.map → admin/chunks/tr-Yt38daxh.mjs.map} +1 -1
  189. package/dist/admin/chunks/uk-B24MoTVg.js +145 -0
  190. package/dist/{_chunks/uk-C8EiqJY7.js.map → admin/chunks/uk-B24MoTVg.js.map} +1 -1
  191. package/dist/admin/chunks/uk-Cpgmm7gE.mjs +140 -0
  192. package/dist/{_chunks/uk-CR-zDhAY.mjs.map → admin/chunks/uk-Cpgmm7gE.mjs.map} +1 -1
  193. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs +247 -0
  194. package/dist/admin/chunks/useDragAndDrop-HYwNDExe.mjs.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.mjs +18 -0
  198. package/dist/admin/chunks/usePrev-Bjw2dhmq.mjs.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/{_chunks/vi-CJlYDheJ.js.map → admin/chunks/vi-BGr1X_HZ.js.map} +1 -1
  203. package/dist/admin/chunks/vi-CvBGlTjr.mjs +108 -0
  204. package/dist/{_chunks/vi-DUXIk_fw.mjs.map → admin/chunks/vi-CvBGlTjr.mjs.map} +1 -1
  205. package/dist/admin/chunks/zh-BmF-sHaT.mjs +205 -0
  206. package/dist/admin/chunks/zh-BmF-sHaT.mjs.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.mjs +934 -0
  210. package/dist/{_chunks/zh-Hans-BPQcRIyH.mjs.map → admin/chunks/zh-Hans-CI0HKio3.mjs.map} +1 -1
  211. package/dist/admin/chunks/zh-Hans-JVK9x7xr.js +953 -0
  212. package/dist/{_chunks/zh-Hans-9kOncHGw.js.map → admin/chunks/zh-Hans-JVK9x7xr.js.map} +1 -1
  213. package/dist/admin/index.js +24 -4
  214. package/dist/admin/index.js.map +1 -1
  215. package/dist/admin/index.mjs +17 -13
  216. package/dist/admin/index.mjs.map +1 -1
  217. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  218. package/dist/admin/src/hooks/useDocument.d.ts +21 -4
  219. package/dist/admin/src/index.d.ts +1 -0
  220. package/dist/admin/src/pages/EditView/components/EditorToolbarObserver.d.ts +11 -0
  221. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +49 -1
  222. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +2 -1
  223. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygNav.d.ts +1 -2
  224. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +29 -1
  225. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  226. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -1
  227. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -1
  228. package/dist/admin/src/preview/index.d.ts +2 -3
  229. package/dist/admin/src/preview/pages/Preview.d.ts +3 -1
  230. package/dist/server/index.js +5459 -4387
  231. package/dist/server/index.js.map +1 -1
  232. package/dist/server/index.mjs +5446 -4372
  233. package/dist/server/index.mjs.map +1 -1
  234. package/dist/server/src/controllers/utils/metadata.d.ts +1 -1
  235. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  236. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  237. package/dist/server/src/services/utils/count.d.ts +1 -1
  238. package/dist/server/src/services/utils/count.d.ts.map +1 -1
  239. package/dist/server/src/services/utils/populate.d.ts +1 -1
  240. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  241. package/dist/shared/contracts/collection-types.d.ts +0 -1
  242. package/dist/shared/contracts/components.d.ts +0 -1
  243. package/dist/shared/contracts/content-types.d.ts +0 -1
  244. package/dist/shared/contracts/history-versions.d.ts +0 -1
  245. package/dist/shared/contracts/index.d.ts +0 -1
  246. package/dist/shared/contracts/init.d.ts +0 -1
  247. package/dist/shared/contracts/preview.d.ts +0 -1
  248. package/dist/shared/contracts/relations.d.ts +1 -2
  249. package/dist/shared/contracts/relations.d.ts.map +1 -1
  250. package/dist/shared/contracts/review-workflows.d.ts +0 -1
  251. package/dist/shared/contracts/single-types.d.ts +0 -1
  252. package/dist/shared/contracts/uid.d.ts +0 -1
  253. package/dist/shared/index.d.ts +0 -1
  254. package/dist/shared/index.js +35 -24
  255. package/dist/shared/index.js.map +1 -1
  256. package/dist/shared/index.mjs +34 -25
  257. package/dist/shared/index.mjs.map +1 -1
  258. package/package.json +15 -12
  259. package/dist/_chunks/CardDragPreview-C0QyJgRA.js +0 -69
  260. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +0 -1
  261. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs +0 -70
  262. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +0 -1
  263. package/dist/_chunks/ComponentConfigurationPage-BLWQy8ru.js +0 -254
  264. package/dist/_chunks/ComponentConfigurationPage-BLWQy8ru.js.map +0 -1
  265. package/dist/_chunks/ComponentConfigurationPage-CtIa3aa2.mjs +0 -236
  266. package/dist/_chunks/ComponentConfigurationPage-CtIa3aa2.mjs.map +0 -1
  267. package/dist/_chunks/ComponentIcon-CRbtQEUV.js +0 -175
  268. package/dist/_chunks/ComponentIcon-CRbtQEUV.js.map +0 -1
  269. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs +0 -157
  270. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +0 -1
  271. package/dist/_chunks/EditConfigurationPage-DsPR2DVk.mjs +0 -132
  272. package/dist/_chunks/EditConfigurationPage-DsPR2DVk.mjs.map +0 -1
  273. package/dist/_chunks/EditConfigurationPage-RQkymxCy.js +0 -150
  274. package/dist/_chunks/EditConfigurationPage-RQkymxCy.js.map +0 -1
  275. package/dist/_chunks/EditViewPage-B-kExt8C.js +0 -272
  276. package/dist/_chunks/EditViewPage-B-kExt8C.js.map +0 -1
  277. package/dist/_chunks/EditViewPage-BPyVuPfM.mjs +0 -254
  278. package/dist/_chunks/EditViewPage-BPyVuPfM.mjs.map +0 -1
  279. package/dist/_chunks/Field-DPIsQRre.js +0 -5650
  280. package/dist/_chunks/Field-DPIsQRre.js.map +0 -1
  281. package/dist/_chunks/Field-Dltnt1km.mjs +0 -5618
  282. package/dist/_chunks/Field-Dltnt1km.mjs.map +0 -1
  283. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs +0 -50
  284. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +0 -1
  285. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js +0 -49
  286. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +0 -1
  287. package/dist/_chunks/Form-BFi4MXMT.js +0 -778
  288. package/dist/_chunks/Form-BFi4MXMT.js.map +0 -1
  289. package/dist/_chunks/Form-C1IcWm1u.mjs +0 -758
  290. package/dist/_chunks/Form-C1IcWm1u.mjs.map +0 -1
  291. package/dist/_chunks/History-04ChQ4pl.mjs +0 -999
  292. package/dist/_chunks/History-04ChQ4pl.mjs.map +0 -1
  293. package/dist/_chunks/History-wjcK4L0C.js +0 -1019
  294. package/dist/_chunks/History-wjcK4L0C.js.map +0 -1
  295. package/dist/_chunks/ListConfigurationPage-BYqPYLSU.mjs +0 -633
  296. package/dist/_chunks/ListConfigurationPage-BYqPYLSU.mjs.map +0 -1
  297. package/dist/_chunks/ListConfigurationPage-CRbxIC3J.js +0 -652
  298. package/dist/_chunks/ListConfigurationPage-CRbxIC3J.js.map +0 -1
  299. package/dist/_chunks/ListViewPage-D5NY9183.js +0 -874
  300. package/dist/_chunks/ListViewPage-D5NY9183.js.map +0 -1
  301. package/dist/_chunks/ListViewPage-FU2LBuhl.mjs +0 -851
  302. package/dist/_chunks/ListViewPage-FU2LBuhl.mjs.map +0 -1
  303. package/dist/_chunks/NoContentTypePage-BgQVE_Qb.js +0 -51
  304. package/dist/_chunks/NoContentTypePage-BgQVE_Qb.js.map +0 -1
  305. package/dist/_chunks/NoContentTypePage-DCKUkwb8.mjs +0 -51
  306. package/dist/_chunks/NoContentTypePage-DCKUkwb8.mjs.map +0 -1
  307. package/dist/_chunks/NoPermissionsPage-C5jwn70o.js +0 -23
  308. package/dist/_chunks/NoPermissionsPage-C5jwn70o.js.map +0 -1
  309. package/dist/_chunks/NoPermissionsPage-jqve7C8l.mjs +0 -23
  310. package/dist/_chunks/NoPermissionsPage-jqve7C8l.mjs.map +0 -1
  311. package/dist/_chunks/Preview-BMYN548c.mjs +0 -294
  312. package/dist/_chunks/Preview-BMYN548c.mjs.map +0 -1
  313. package/dist/_chunks/Preview-DaOihysv.js +0 -312
  314. package/dist/_chunks/Preview-DaOihysv.js.map +0 -1
  315. package/dist/_chunks/Relations-CTGM7Hv5.js +0 -747
  316. package/dist/_chunks/Relations-CTGM7Hv5.js.map +0 -1
  317. package/dist/_chunks/Relations-gscPkxjF.mjs +0 -728
  318. package/dist/_chunks/Relations-gscPkxjF.mjs.map +0 -1
  319. package/dist/_chunks/ar-BUUWXIYu.js +0 -226
  320. package/dist/_chunks/ar-BUUWXIYu.js.map +0 -1
  321. package/dist/_chunks/ar-CCEVvqGG.mjs +0 -226
  322. package/dist/_chunks/ca-5U32ON2v.mjs +0 -201
  323. package/dist/_chunks/ca-Cmk45QO6.js +0 -201
  324. package/dist/_chunks/cs-CM2aBUar.mjs +0 -125
  325. package/dist/_chunks/cs-CkJy6B2v.js +0 -125
  326. package/dist/_chunks/de-C72KDNOl.mjs +0 -199
  327. package/dist/_chunks/de-CCEmbAah.js +0 -199
  328. package/dist/_chunks/en-BzQmavmK.js +0 -310
  329. package/dist/_chunks/en-CSxLmrh1.mjs +0 -310
  330. package/dist/_chunks/es-9K52xZIr.js +0 -196
  331. package/dist/_chunks/es-D34tqjMw.mjs +0 -196
  332. package/dist/_chunks/eu-CdALomew.mjs +0 -202
  333. package/dist/_chunks/eu-VDH-3ovk.js +0 -202
  334. package/dist/_chunks/fr--pg5jUbt.mjs +0 -216
  335. package/dist/_chunks/fr--pg5jUbt.mjs.map +0 -1
  336. package/dist/_chunks/fr-B2Kyv8Z9.js +0 -216
  337. package/dist/_chunks/fr-B2Kyv8Z9.js.map +0 -1
  338. package/dist/_chunks/gu-BRmF601H.js +0 -200
  339. package/dist/_chunks/gu-CNpaMDpH.mjs +0 -200
  340. package/dist/_chunks/gu-CNpaMDpH.mjs.map +0 -1
  341. package/dist/_chunks/hi-CCJBptSq.js +0 -200
  342. package/dist/_chunks/hi-CCJBptSq.js.map +0 -1
  343. package/dist/_chunks/hi-Dwvd04m3.mjs +0 -200
  344. package/dist/_chunks/hi-Dwvd04m3.mjs.map +0 -1
  345. package/dist/_chunks/hooks-BAaaKPS_.js.map +0 -1
  346. package/dist/_chunks/hooks-E5u1mcgM.mjs +0 -8
  347. package/dist/_chunks/hooks-E5u1mcgM.mjs.map +0 -1
  348. package/dist/_chunks/hu-CeYvaaO0.mjs +0 -202
  349. package/dist/_chunks/hu-CeYvaaO0.mjs.map +0 -1
  350. package/dist/_chunks/hu-sNV_yLYy.js +0 -202
  351. package/dist/_chunks/hu-sNV_yLYy.js.map +0 -1
  352. package/dist/_chunks/id-B5Ser98A.js +0 -160
  353. package/dist/_chunks/id-B5Ser98A.js.map +0 -1
  354. package/dist/_chunks/id-BtwA9WJT.mjs +0 -160
  355. package/dist/_chunks/index-Ca7YWlAA.js +0 -4303
  356. package/dist/_chunks/index-Ca7YWlAA.js.map +0 -1
  357. package/dist/_chunks/index-DqasUQ6Q.mjs +0 -4284
  358. package/dist/_chunks/index-DqasUQ6Q.mjs.map +0 -1
  359. package/dist/_chunks/it-BrVPqaf1.mjs +0 -162
  360. package/dist/_chunks/it-DkBIs7vD.js +0 -162
  361. package/dist/_chunks/ja-7sfIbjxE.js +0 -196
  362. package/dist/_chunks/ja-BHqhDq4V.mjs +0 -196
  363. package/dist/_chunks/ko-HVQRlfUI.mjs +0 -195
  364. package/dist/_chunks/ko-woFZPmLk.js +0 -195
  365. package/dist/_chunks/layout-BW80JSCd.js +0 -488
  366. package/dist/_chunks/layout-BW80JSCd.js.map +0 -1
  367. package/dist/_chunks/layout-W3clJSCy.mjs +0 -471
  368. package/dist/_chunks/layout-W3clJSCy.mjs.map +0 -1
  369. package/dist/_chunks/ml-BihZwQit.mjs +0 -200
  370. package/dist/_chunks/ml-BihZwQit.mjs.map +0 -1
  371. package/dist/_chunks/ml-C2W8N8k1.js +0 -200
  372. package/dist/_chunks/ml-C2W8N8k1.js.map +0 -1
  373. package/dist/_chunks/ms-BuFotyP_.js +0 -144
  374. package/dist/_chunks/ms-m_WjyWx7.mjs +0 -144
  375. package/dist/_chunks/nl-D4R9gHx5.mjs +0 -202
  376. package/dist/_chunks/nl-D4R9gHx5.mjs.map +0 -1
  377. package/dist/_chunks/nl-bbEOHChV.js +0 -202
  378. package/dist/_chunks/nl-bbEOHChV.js.map +0 -1
  379. package/dist/_chunks/objects-BcXOv6_9.js +0 -47
  380. package/dist/_chunks/objects-BcXOv6_9.js.map +0 -1
  381. package/dist/_chunks/objects-D6yBsdmx.mjs +0 -45
  382. package/dist/_chunks/objects-D6yBsdmx.mjs.map +0 -1
  383. package/dist/_chunks/pl-sbx9mSt_.mjs +0 -199
  384. package/dist/_chunks/pl-sbx9mSt_.mjs.map +0 -1
  385. package/dist/_chunks/pl-uzwG-hk7.js +0 -199
  386. package/dist/_chunks/pl-uzwG-hk7.js.map +0 -1
  387. package/dist/_chunks/pt-BR-BiOz37D9.js +0 -201
  388. package/dist/_chunks/pt-BR-C71iDxnh.mjs +0 -201
  389. package/dist/_chunks/pt-BsaFvS8-.mjs +0 -95
  390. package/dist/_chunks/pt-BsaFvS8-.mjs.map +0 -1
  391. package/dist/_chunks/pt-CeXQuq50.js +0 -95
  392. package/dist/_chunks/pt-CeXQuq50.js.map +0 -1
  393. package/dist/_chunks/relations-BlDkoeWh.mjs +0 -134
  394. package/dist/_chunks/relations-BlDkoeWh.mjs.map +0 -1
  395. package/dist/_chunks/relations-C9Usz9k5.js +0 -133
  396. package/dist/_chunks/relations-C9Usz9k5.js.map +0 -1
  397. package/dist/_chunks/ru-BE6A4Exp.mjs +0 -231
  398. package/dist/_chunks/ru-BT3ybNny.js +0 -231
  399. package/dist/_chunks/sa-CcvkYInH.js +0 -200
  400. package/dist/_chunks/sa-CcvkYInH.js.map +0 -1
  401. package/dist/_chunks/sa-Dag0k-Z8.mjs +0 -200
  402. package/dist/_chunks/sa-Dag0k-Z8.mjs.map +0 -1
  403. package/dist/_chunks/sk-BFg-R8qJ.mjs +0 -202
  404. package/dist/_chunks/sk-BFg-R8qJ.mjs.map +0 -1
  405. package/dist/_chunks/sk-CvY09Xjv.js +0 -202
  406. package/dist/_chunks/sk-CvY09Xjv.js.map +0 -1
  407. package/dist/_chunks/sv-CUnfWGsh.mjs +0 -202
  408. package/dist/_chunks/sv-CUnfWGsh.mjs.map +0 -1
  409. package/dist/_chunks/sv-MYDuzgvT.js +0 -202
  410. package/dist/_chunks/sv-MYDuzgvT.js.map +0 -1
  411. package/dist/_chunks/th-BqbI8lIT.mjs +0 -148
  412. package/dist/_chunks/th-D9_GfAjc.js +0 -148
  413. package/dist/_chunks/tr-CgeK3wJM.mjs +0 -199
  414. package/dist/_chunks/tr-CgeK3wJM.mjs.map +0 -1
  415. package/dist/_chunks/tr-D9UH-O_R.js +0 -199
  416. package/dist/_chunks/tr-D9UH-O_R.js.map +0 -1
  417. package/dist/_chunks/uk-C8EiqJY7.js +0 -144
  418. package/dist/_chunks/uk-CR-zDhAY.mjs +0 -144
  419. package/dist/_chunks/useDebounce-CtcjDB3L.js +0 -28
  420. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +0 -1
  421. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +0 -29
  422. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +0 -1
  423. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js +0 -245
  424. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +0 -1
  425. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs +0 -228
  426. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +0 -1
  427. package/dist/_chunks/vi-CJlYDheJ.js +0 -111
  428. package/dist/_chunks/vi-DUXIk_fw.mjs +0 -111
  429. package/dist/_chunks/zh-BWZspA60.mjs +0 -209
  430. package/dist/_chunks/zh-BWZspA60.mjs.map +0 -1
  431. package/dist/_chunks/zh-CQQfszqR.js +0 -209
  432. package/dist/_chunks/zh-CQQfszqR.js.map +0 -1
  433. package/dist/_chunks/zh-Hans-9kOncHGw.js +0 -952
  434. package/dist/_chunks/zh-Hans-BPQcRIyH.mjs +0 -952
  435. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +0 -49
@@ -1,999 +0,0 @@
1
- import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
- import * as React from "react";
3
- import { useForm, useStrapiApp, InputRenderer, useField, Form, Layouts, useTracking, useNotification, useQueryParams, useRBAC, ConfirmDialog, createContext, Page } from "@strapi/admin/strapi-admin";
4
- import { Alert, Link, Flex, Field, Box, Tooltip, Typography, Divider, Grid, Dialog, Button, Portal, FocusTrap, Main } from "@strapi/design-system";
5
- import { stringify } from "qs";
6
- import { useIntl } from "react-intl";
7
- import { NavLink, useNavigate, useParams, Link as Link$1, Navigate } from "react-router-dom";
8
- import { c as useDoc, f as useDocumentRBAC, o as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, e as contentManagerApi, k as PERMISSIONS, t as getDisplayName, R as RelativeTime, l as DocumentRBAC, J as useDocument, h as useDocumentLayout, p as useGetContentTypeConfigurationQuery, d as buildValidParams } from "./index-DqasUQ6Q.mjs";
9
- import pipe from "lodash/fp/pipe";
10
- import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
11
- import { a as useDynamicZone, u as useLazyComponents, b as useFieldHint, N as NotAllowedInput, d as MemoizedUIDInput, e as MemoizedWysiwyg, D as DynamicZone, f as MemoizedComponentInput, g as MemoizedBlocksInput, r as removeFieldsThatDontExistOnSchema, p as prepareTempKeys } from "./Field-Dltnt1km.mjs";
12
- import { ArrowLeft, WarningCircle } from "@strapi/icons";
13
- import { styled } from "styled-components";
14
- import { g as getRelationLabel } from "./relations-BlDkoeWh.mjs";
15
- const StyledAlert = styled(Alert).attrs({ closeLabel: "Close", onClose: () => {
16
- }, shadow: "none" })`
17
- button {
18
- display: none;
19
- }
20
- `;
21
- const LinkEllipsis = styled(Link)`
22
- display: block;
23
-
24
- & > span {
25
- white-space: nowrap;
26
- overflow: hidden;
27
- text-overflow: ellipsis;
28
- display: block;
29
- }
30
- `;
31
- const CustomRelationInput = (props) => {
32
- const { formatMessage } = useIntl();
33
- const field = useField(props.name);
34
- let formattedFieldValue;
35
- if (field) {
36
- formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
37
- }
38
- if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
39
- return /* @__PURE__ */ jsxs(Fragment, { children: [
40
- /* @__PURE__ */ jsx(Field.Label, { action: props.labelAction, children: props.label }),
41
- /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(StyledAlert, { variant: "default", children: formatMessage({
42
- id: "content-manager.history.content.no-relations",
43
- defaultMessage: "No relations."
44
- }) }) })
45
- ] });
46
- }
47
- const { results, meta } = formattedFieldValue;
48
- return /* @__PURE__ */ jsxs(Box, { children: [
49
- /* @__PURE__ */ jsx(Field.Label, { children: props.label }),
50
- results.length > 0 && /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 2, marginTop: 1, alignItems: "stretch", children: results.map((relationData) => {
51
- const { targetModel } = props.attribute;
52
- const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;
53
- const label = getRelationLabel(relationData, props.mainField);
54
- const isAdminUserRelation = targetModel === "admin::user";
55
- return /* @__PURE__ */ jsxs(
56
- Flex,
57
- {
58
- paddingTop: 2,
59
- paddingBottom: 2,
60
- paddingLeft: 4,
61
- paddingRight: 4,
62
- hasRadius: true,
63
- borderColor: "neutral200",
64
- background: "neutral150",
65
- justifyContent: "space-between",
66
- children: [
67
- /* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { label, children: isAdminUserRelation ? /* @__PURE__ */ jsx(Typography, { children: label }) : /* @__PURE__ */ jsx(LinkEllipsis, { tag: NavLink, to: href, children: label }) }) }),
68
- /* @__PURE__ */ jsx(DocumentStatus, { status: relationData.status })
69
- ]
70
- },
71
- relationData.documentId ?? relationData.id
72
- );
73
- }) }),
74
- meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
75
- /* @__PURE__ */ jsx(
76
- StyledAlert,
77
- {
78
- marginTop: 1,
79
- variant: "warning",
80
- title: formatMessage(
81
- {
82
- id: "content-manager.history.content.missing-relations.title",
83
- defaultMessage: "{number, plural, =1 {Missing relation} other {{number} missing relations}}"
84
- },
85
- { number: meta.missingCount }
86
- ),
87
- children: formatMessage(
88
- {
89
- id: "content-manager.history.content.missing-relations.message",
90
- defaultMessage: "{number, plural, =1 {It has} other {They have}} been deleted and can't be restored."
91
- },
92
- { number: meta.missingCount }
93
- )
94
- }
95
- )
96
- ] });
97
- };
98
- const createInitialValuesForPath = (keyPath, value) => {
99
- const keys = keyPath.split(".");
100
- const root = {};
101
- let node = root;
102
- keys.forEach((key, index) => {
103
- if (key === "__proto__" || key === "constructor") return;
104
- if (index === keys.length - 1) {
105
- node[key] = value;
106
- } else {
107
- node[key] = node[key] || {};
108
- }
109
- node = node[key];
110
- });
111
- return root;
112
- };
113
- const CustomMediaInput = (props) => {
114
- const { value } = useField(props.name);
115
- const results = value?.results ?? [];
116
- const meta = value?.meta ?? { missingCount: 0 };
117
- const { formatMessage } = useIntl();
118
- const fields = useStrapiApp("CustomMediaInput", (state) => state.fields);
119
- const MediaLibrary = fields.media;
120
- return /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, alignItems: "stretch", children: [
121
- /* @__PURE__ */ jsx(
122
- Form,
123
- {
124
- method: "PUT",
125
- disabled: true,
126
- initialValues: createInitialValuesForPath(props.name, results),
127
- children: /* @__PURE__ */ jsx(MediaLibrary, { ...props, disabled: true, multiple: results.length > 1 })
128
- }
129
- ),
130
- meta.missingCount > 0 && /* @__PURE__ */ jsx(
131
- StyledAlert,
132
- {
133
- variant: "warning",
134
- closeLabel: "Close",
135
- onClose: () => {
136
- },
137
- title: formatMessage(
138
- {
139
- id: "content-manager.history.content.missing-assets.title",
140
- defaultMessage: "{number, plural, =1 {Missing asset} other {{number} missing assets}}"
141
- },
142
- { number: meta.missingCount }
143
- ),
144
- children: formatMessage(
145
- {
146
- id: "content-manager.history.content.missing-assets.message",
147
- defaultMessage: "{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored."
148
- },
149
- { number: meta.missingCount }
150
- )
151
- }
152
- )
153
- ] });
154
- };
155
- const getLabelAction = (labelAction) => {
156
- if (!React.isValidElement(labelAction)) {
157
- return labelAction;
158
- }
159
- const labelActionTitleId = labelAction.props.title.id;
160
- if (labelActionTitleId === "i18n.Field.localized") {
161
- return React.cloneElement(labelAction, {
162
- ...labelAction.props,
163
- title: {
164
- id: "history.content.localized",
165
- defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
166
- }
167
- });
168
- }
169
- if (labelActionTitleId === "i18n.Field.not-localized") {
170
- return React.cloneElement(labelAction, {
171
- ...labelAction.props,
172
- title: {
173
- id: "history.content.not-localized",
174
- defaultMessage: "This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales."
175
- }
176
- });
177
- }
178
- return labelAction;
179
- };
180
- const VersionInputRenderer = ({
181
- visible,
182
- hint: providedHint,
183
- shouldIgnoreRBAC = false,
184
- labelAction,
185
- ...props
186
- }) => {
187
- const customLabelAction = getLabelAction(labelAction);
188
- const { formatMessage } = useIntl();
189
- const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
190
- const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
191
- const fieldSizes = useTypedSelector((state) => state["content-manager"].app.fieldSizes);
192
- const { id, components } = useDoc();
193
- const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
194
- const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
195
- const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
196
- const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
197
- const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
198
- const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
199
- const editableFields = id ? canUpdateFields : canCreateFields;
200
- const readableFields = id ? canReadFields : canCreateFields;
201
- const canUserReadField = canUserAction(props.name, readableFields, props.type);
202
- const canUserEditField = canUserAction(props.name, editableFields, props.type);
203
- const fields = useStrapiApp("InputRenderer", (app) => app.fields);
204
- const { lazyComponentStore } = useLazyComponents(
205
- attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : void 0
206
- );
207
- const hint = useFieldHint(providedHint, props.attribute);
208
- const {
209
- edit: { components: componentsLayout }
210
- } = useDocLayout();
211
- if (!visible) {
212
- return null;
213
- }
214
- if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {
215
- return /* @__PURE__ */ jsx(NotAllowedInput, { hint, ...props });
216
- }
217
- const fieldIsDisabled = !canUserEditField && !isInDynamicZone || props.disabled || isFormDisabled;
218
- const addedAttributes = version.meta.unknownAttributes.added;
219
- if (Object.keys(addedAttributes).includes(props.name)) {
220
- return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
221
- /* @__PURE__ */ jsx(Field.Label, { children: props.label }),
222
- /* @__PURE__ */ jsx(
223
- StyledAlert,
224
- {
225
- width: "100%",
226
- closeLabel: "Close",
227
- onClose: () => {
228
- },
229
- variant: "warning",
230
- title: formatMessage({
231
- id: "content-manager.history.content.new-field.title",
232
- defaultMessage: "New field"
233
- }),
234
- children: formatMessage({
235
- id: "content-manager.history.content.new-field.message",
236
- defaultMessage: "This field didn't exist when this version was saved. If you restore this version, it will be empty."
237
- })
238
- }
239
- )
240
- ] });
241
- }
242
- if (attributeHasCustomFieldProperty(props.attribute)) {
243
- const CustomInput = lazyComponentStore[props.attribute.customField];
244
- if (CustomInput) {
245
- return /* @__PURE__ */ jsx(
246
- CustomInput,
247
- {
248
- ...props,
249
- hint,
250
- labelAction: customLabelAction,
251
- disabled: fieldIsDisabled
252
- }
253
- );
254
- }
255
- return /* @__PURE__ */ jsx(
256
- InputRenderer,
257
- {
258
- ...props,
259
- hint,
260
- labelAction: customLabelAction,
261
- type: props.attribute.customField,
262
- disabled: fieldIsDisabled
263
- }
264
- );
265
- }
266
- if (props.type === "media") {
267
- return /* @__PURE__ */ jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
268
- }
269
- const addedInputTypes = Object.keys(fields);
270
- if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
271
- const CustomInput = fields[props.type];
272
- return /* @__PURE__ */ jsx(
273
- CustomInput,
274
- {
275
- ...props,
276
- hint,
277
- labelAction: customLabelAction,
278
- disabled: fieldIsDisabled
279
- }
280
- );
281
- }
282
- switch (props.type) {
283
- case "blocks":
284
- return /* @__PURE__ */ jsx(MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
285
- case "component":
286
- const { layout } = componentsLayout[props.attribute.component];
287
- const [remainingFieldsLayout] = getRemaingFieldsLayout({
288
- layout: [layout],
289
- metadatas: configuration.components[props.attribute.component].metadatas,
290
- fieldSizes,
291
- schemaAttributes: components[props.attribute.component].attributes
292
- });
293
- return /* @__PURE__ */ jsx(
294
- MemoizedComponentInput,
295
- {
296
- ...props,
297
- layout: [...layout, ...remainingFieldsLayout || []],
298
- hint,
299
- labelAction: customLabelAction,
300
- disabled: fieldIsDisabled,
301
- children: (inputProps) => /* @__PURE__ */ jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
302
- }
303
- );
304
- case "dynamiczone":
305
- return /* @__PURE__ */ jsx(
306
- DynamicZone,
307
- {
308
- ...props,
309
- hint,
310
- labelAction: customLabelAction,
311
- disabled: fieldIsDisabled,
312
- children: (inputProps) => /* @__PURE__ */ jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
313
- }
314
- );
315
- case "relation":
316
- return /* @__PURE__ */ jsx(
317
- CustomRelationInput,
318
- {
319
- ...props,
320
- hint,
321
- labelAction: customLabelAction,
322
- disabled: fieldIsDisabled
323
- }
324
- );
325
- case "richtext":
326
- return /* @__PURE__ */ jsx(
327
- MemoizedWysiwyg,
328
- {
329
- ...props,
330
- hint,
331
- type: props.type,
332
- labelAction: customLabelAction,
333
- disabled: fieldIsDisabled
334
- }
335
- );
336
- case "uid":
337
- return /* @__PURE__ */ jsx(
338
- MemoizedUIDInput,
339
- {
340
- ...props,
341
- hint,
342
- type: props.type,
343
- labelAction: customLabelAction,
344
- disabled: fieldIsDisabled
345
- }
346
- );
347
- case "enumeration":
348
- return /* @__PURE__ */ jsx(
349
- InputRenderer,
350
- {
351
- ...props,
352
- hint,
353
- labelAction: customLabelAction,
354
- options: props.attribute.enum.map((value) => ({ value })),
355
- type: props.customField ? "custom-field" : props.type,
356
- disabled: fieldIsDisabled
357
- }
358
- );
359
- default:
360
- const { unique: _unique, mainField: _mainField, ...restProps } = props;
361
- return /* @__PURE__ */ jsx(
362
- InputRenderer,
363
- {
364
- ...restProps,
365
- hint,
366
- labelAction: customLabelAction,
367
- type: props.customField ? "custom-field" : props.type,
368
- disabled: fieldIsDisabled
369
- }
370
- );
371
- }
372
- };
373
- const attributeHasCustomFieldProperty = (attribute) => "customField" in attribute && typeof attribute.customField === "string";
374
- const createLayoutFromFields = (fields) => {
375
- return fields.reduce((rows, field) => {
376
- if (field.type === "dynamiczone") {
377
- rows.push([field]);
378
- return rows;
379
- }
380
- if (!rows[rows.length - 1]) {
381
- rows.push([]);
382
- }
383
- rows[rows.length - 1].push(field);
384
- return rows;
385
- }, []).map((row) => [row]);
386
- };
387
- function getRemaingFieldsLayout({
388
- layout,
389
- metadatas,
390
- schemaAttributes,
391
- fieldSizes
392
- }) {
393
- const fieldsInLayout = layout.flatMap(
394
- (panel) => panel.flatMap((row) => row.flatMap((field) => field.name))
395
- );
396
- const remainingFields = Object.entries(metadatas).reduce(
397
- (currentRemainingFields, [name, field]) => {
398
- if (!fieldsInLayout.includes(name) && field.edit.visible === true) {
399
- const attribute = schemaAttributes[name];
400
- currentRemainingFields.push({
401
- attribute,
402
- type: attribute.type,
403
- visible: true,
404
- disabled: true,
405
- label: field.edit.label || name,
406
- name,
407
- size: fieldSizes[attribute.type].default ?? 12
408
- });
409
- }
410
- return currentRemainingFields;
411
- },
412
- []
413
- );
414
- return createLayoutFromFields(remainingFields);
415
- }
416
- const FormPanel = ({ panel }) => {
417
- if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
418
- const [row] = panel;
419
- const [field] = row;
420
- return /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: /* @__PURE__ */ jsx(Grid.Item, { col: 12, s: 12, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }) }, field.name);
421
- }
422
- return /* @__PURE__ */ jsx(
423
- Box,
424
- {
425
- hasRadius: true,
426
- background: "neutral0",
427
- shadow: "tableShadow",
428
- paddingLeft: 6,
429
- paddingRight: 6,
430
- paddingTop: 6,
431
- paddingBottom: 6,
432
- borderColor: "neutral150",
433
- children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
434
- return /* @__PURE__ */ jsx(
435
- Grid.Item,
436
- {
437
- col: size,
438
- s: 12,
439
- xs: 12,
440
- direction: "column",
441
- alignItems: "stretch",
442
- children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field })
443
- },
444
- field.name
445
- );
446
- }) }, gridRowIndex)) })
447
- }
448
- );
449
- };
450
- const VersionContent = () => {
451
- const { formatMessage } = useIntl();
452
- const { fieldSizes } = useTypedSelector((state) => state["content-manager"].app);
453
- const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
454
- const layout = useHistoryContext("VersionContent", (state) => state.layout);
455
- const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
456
- const schema = useHistoryContext("VersionContent", (state) => state.schema);
457
- const removedAttributes = version.meta.unknownAttributes.removed;
458
- const removedAttributesAsFields = Object.entries(removedAttributes).map(
459
- ([attributeName, attribute]) => {
460
- const field = {
461
- attribute,
462
- shouldIgnoreRBAC: true,
463
- type: attribute.type,
464
- visible: true,
465
- disabled: true,
466
- label: attributeName,
467
- name: attributeName,
468
- size: fieldSizes[attribute.type].default ?? 12
469
- };
470
- return field;
471
- }
472
- );
473
- const unknownFieldsLayout = createLayoutFromFields(removedAttributesAsFields);
474
- const remainingFieldsLayout = getRemaingFieldsLayout({
475
- metadatas: configuration.contentType.metadatas,
476
- layout,
477
- schemaAttributes: schema.attributes,
478
- fieldSizes
479
- });
480
- const { components } = useDoc();
481
- const transformedData = React.useMemo(() => {
482
- const transform = (schemaAttributes, components2 = {}) => (document) => {
483
- const schema2 = { attributes: schemaAttributes };
484
- const transformations = pipe(
485
- removeFieldsThatDontExistOnSchema(schema2),
486
- prepareTempKeys(schema2, components2)
487
- );
488
- return transformations(document);
489
- };
490
- return transform(version.schema, components)(version.data);
491
- }, [components, version.data, version.schema]);
492
- return /* @__PURE__ */ jsxs(Layouts.Content, { children: [
493
- /* @__PURE__ */ jsx(Box, { paddingBottom: 8, children: /* @__PURE__ */ jsx(Form, { disabled: true, method: "PUT", initialValues: transformedData, children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", children: [...layout, ...remainingFieldsLayout].map((panel, index) => {
494
- return /* @__PURE__ */ jsx(FormPanel, { panel }, index);
495
- }) }) }) }),
496
- removedAttributesAsFields.length > 0 && /* @__PURE__ */ jsxs(Fragment, { children: [
497
- /* @__PURE__ */ jsx(Divider, {}),
498
- /* @__PURE__ */ jsxs(Box, { paddingTop: 8, children: [
499
- /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingBottom: 6, gap: 1, children: [
500
- /* @__PURE__ */ jsx(Typography, { variant: "delta", children: formatMessage({
501
- id: "content-manager.history.content.unknown-fields.title",
502
- defaultMessage: "Unknown fields"
503
- }) }),
504
- /* @__PURE__ */ jsx(Typography, { variant: "pi", children: formatMessage(
505
- {
506
- id: "content-manager.history.content.unknown-fields.message",
507
- defaultMessage: "These fields have been deleted or renamed in the Content-Type Builder. <b>These fields will not be restored.</b>"
508
- },
509
- {
510
- b: (chunks) => /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", children: chunks })
511
- }
512
- ) })
513
- ] }),
514
- /* @__PURE__ */ jsx(Form, { disabled: true, method: "PUT", initialValues: version.data, children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", children: unknownFieldsLayout.map((panel, index) => {
515
- return /* @__PURE__ */ jsx(FormPanel, { panel }, index);
516
- }) }) })
517
- ] })
518
- ] })
519
- ] });
520
- };
521
- const historyVersionsApi = contentManagerApi.injectEndpoints({
522
- endpoints: (builder) => ({
523
- getHistoryVersions: builder.query({
524
- query(params) {
525
- return {
526
- url: `/content-manager/history-versions`,
527
- method: "GET",
528
- config: {
529
- params
530
- }
531
- };
532
- },
533
- providesTags: ["HistoryVersion"]
534
- }),
535
- restoreVersion: builder.mutation({
536
- query({ params, body }) {
537
- return {
538
- url: `/content-manager/history-versions/${params.versionId}/restore`,
539
- method: "PUT",
540
- data: body
541
- };
542
- },
543
- invalidatesTags: (_res, _error, { documentId, collectionType, params }) => {
544
- return [
545
- "HistoryVersion",
546
- {
547
- type: "Document",
548
- id: collectionType === COLLECTION_TYPES ? `${params.contentType}_${documentId}` : params.contentType
549
- }
550
- ];
551
- }
552
- })
553
- })
554
- });
555
- const { useGetHistoryVersionsQuery, useRestoreVersionMutation } = historyVersionsApi;
556
- const VersionHeader = ({ headerId }) => {
557
- const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React.useState(false);
558
- const navigate = useNavigate();
559
- const { formatMessage, formatDate } = useIntl();
560
- const { trackUsage } = useTracking();
561
- const { toggleNotification } = useNotification();
562
- const [{ query }] = useQueryParams();
563
- const { collectionType, slug } = useParams();
564
- const [restoreVersion, { isLoading }] = useRestoreVersionMutation();
565
- const { allowedActions } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));
566
- const version = useHistoryContext("VersionHeader", (state) => state.selectedVersion);
567
- const mainField = useHistoryContext("VersionHeader", (state) => state.mainField);
568
- const schema = useHistoryContext("VersionHeader", (state) => state.schema);
569
- const isCurrentVersion = useHistoryContext(
570
- "VersionHeader",
571
- (state) => state.page === 1 && state.versions.data[0].id === state.selectedVersion.id
572
- );
573
- const mainFieldValue = version.data[mainField];
574
- const getNextNavigation = () => {
575
- const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
576
- return {
577
- pathname: "..",
578
- search: pluginsQueryParams
579
- };
580
- };
581
- const handleRestore = async () => {
582
- try {
583
- const response = await restoreVersion({
584
- documentId: version.relatedDocumentId,
585
- collectionType,
586
- params: {
587
- versionId: version.id,
588
- contentType: version.contentType
589
- },
590
- body: { contentType: version.contentType }
591
- });
592
- if ("data" in response) {
593
- navigate(getNextNavigation(), { relative: "path" });
594
- toggleNotification({
595
- type: "success",
596
- title: formatMessage({
597
- id: "content-manager.restore.success.title",
598
- defaultMessage: "Version restored."
599
- }),
600
- message: formatMessage({
601
- id: "content-manager.restore.success.message",
602
- defaultMessage: "A past version of the content was restored."
603
- })
604
- });
605
- trackUsage("didRestoreHistoryVersion");
606
- }
607
- if ("error" in response) {
608
- toggleNotification({
609
- type: "danger",
610
- message: formatMessage({
611
- id: "content-manager.history.restore.error.message",
612
- defaultMessage: "Could not restore version."
613
- })
614
- });
615
- }
616
- } catch (error) {
617
- toggleNotification({
618
- type: "danger",
619
- message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
620
- });
621
- }
622
- };
623
- return /* @__PURE__ */ jsxs(Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
624
- /* @__PURE__ */ jsx(
625
- Layouts.BaseHeader,
626
- {
627
- id: headerId,
628
- title: formatDate(new Date(version.createdAt), {
629
- year: "numeric",
630
- month: "numeric",
631
- day: "numeric",
632
- hour: "numeric",
633
- minute: "numeric"
634
- }),
635
- subtitle: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
636
- {
637
- id: "content-manager.history.version.subtitle",
638
- defaultMessage: "{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}"
639
- },
640
- {
641
- hasLocale: Boolean(version.locale),
642
- subtitle: `${mainFieldValue || ""} (${schema.info.singularName})`.trim(),
643
- locale: version.locale?.name
644
- }
645
- ) }),
646
- navigationAction: /* @__PURE__ */ jsx(
647
- Link,
648
- {
649
- startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
650
- tag: NavLink,
651
- to: getNextNavigation(),
652
- relative: "path",
653
- isExternal: false,
654
- children: formatMessage({
655
- id: "global.back",
656
- defaultMessage: "Back"
657
- })
658
- }
659
- ),
660
- sticky: false,
661
- primaryAction: /* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
662
- Button,
663
- {
664
- disabled: !allowedActions.canUpdate || isCurrentVersion,
665
- onClick: () => {
666
- setIsConfirmDialogOpen(true);
667
- },
668
- children: formatMessage({
669
- id: "content-manager.history.restore.confirm.button",
670
- defaultMessage: "Restore"
671
- })
672
- }
673
- ) })
674
- }
675
- ),
676
- /* @__PURE__ */ jsx(
677
- ConfirmDialog,
678
- {
679
- onConfirm: handleRestore,
680
- endAction: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
681
- id: "content-manager.history.restore.confirm.button",
682
- defaultMessage: "Restore"
683
- }) }),
684
- children: /* @__PURE__ */ jsxs(
685
- Flex,
686
- {
687
- direction: "column",
688
- alignItems: "center",
689
- justifyContent: "center",
690
- gap: 2,
691
- textAlign: "center",
692
- children: [
693
- /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
694
- /* @__PURE__ */ jsx(Typography, { children: formatMessage({
695
- id: "content-manager.history.restore.confirm.title",
696
- defaultMessage: "Are you sure you want to restore this version?"
697
- }) }),
698
- /* @__PURE__ */ jsx(Typography, { children: formatMessage(
699
- {
700
- id: "content-manager.history.restore.confirm.message",
701
- defaultMessage: "{isDraft, select, true {The restored content will override your draft.} other {The restored content won't be published, it will override the draft and be saved as pending changes. You'll be able to publish the changes at anytime.}}"
702
- },
703
- {
704
- isDraft: version.status === "draft"
705
- }
706
- ) })
707
- ]
708
- }
709
- )
710
- }
711
- )
712
- ] });
713
- };
714
- const BlueText = (children) => /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", children });
715
- const VersionCard = ({ version, isCurrent }) => {
716
- const { formatDate, formatMessage } = useIntl();
717
- const [{ query }] = useQueryParams();
718
- const isActive = query.id === version.id.toString();
719
- const author = version.createdBy && getDisplayName(version.createdBy);
720
- return /* @__PURE__ */ jsxs(
721
- Flex,
722
- {
723
- direction: "column",
724
- alignItems: "flex-start",
725
- gap: 3,
726
- hasRadius: true,
727
- borderWidth: "1px",
728
- borderStyle: "solid",
729
- borderColor: isActive ? "primary600" : "neutral200",
730
- color: "neutral800",
731
- padding: 5,
732
- tag: Link$1,
733
- to: `?${stringify({ ...query, id: version.id })}`,
734
- style: { textDecoration: "none" },
735
- children: [
736
- /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
737
- /* @__PURE__ */ jsx(Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
738
- day: "numeric",
739
- month: "numeric",
740
- year: "numeric",
741
- hour: "2-digit",
742
- minute: "2-digit"
743
- }) }),
744
- /* @__PURE__ */ jsx(Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
745
- {
746
- id: "content-manager.history.sidebar.versionDescription",
747
- defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
748
- },
749
- {
750
- distanceToNow: /* @__PURE__ */ jsx(RelativeTime, { timestamp: new Date(version.createdAt) }),
751
- author,
752
- isAnonymous: !Boolean(version.createdBy),
753
- isCurrent,
754
- b: BlueText
755
- }
756
- ) })
757
- ] }),
758
- version.status && /* @__PURE__ */ jsx(DocumentStatus, { status: version.status, size: "XS" })
759
- ]
760
- }
761
- );
762
- };
763
- const PaginationButton = ({ page, children }) => {
764
- const [{ query }] = useQueryParams();
765
- const { id: _id, ...queryRest } = query;
766
- return /* @__PURE__ */ jsx(Link$1, { to: { search: stringify({ ...queryRest, page }) }, style: { textDecoration: "none" }, children: /* @__PURE__ */ jsx(Typography, { variant: "omega", textColor: "primary600", children }) });
767
- };
768
- const VersionsList = () => {
769
- const { formatMessage } = useIntl();
770
- const { versions, page } = useHistoryContext("VersionsList", (state) => ({
771
- versions: state.versions,
772
- page: state.page
773
- }));
774
- return /* @__PURE__ */ jsxs(
775
- Flex,
776
- {
777
- shrink: 0,
778
- direction: "column",
779
- alignItems: "stretch",
780
- width: "320px",
781
- height: "100vh",
782
- background: "neutral0",
783
- borderColor: "neutral200",
784
- borderWidth: "0 0 0 1px",
785
- borderStyle: "solid",
786
- tag: "aside",
787
- children: [
788
- /* @__PURE__ */ jsxs(
789
- Flex,
790
- {
791
- direction: "row",
792
- justifyContent: "space-between",
793
- padding: 4,
794
- borderColor: "neutral200",
795
- borderWidth: "0 0 1px",
796
- borderStyle: "solid",
797
- tag: "header",
798
- children: [
799
- /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
800
- id: "content-manager.history.sidebar.title",
801
- defaultMessage: "Versions"
802
- }) }),
803
- /* @__PURE__ */ jsx(Box, { background: "neutral150", hasRadius: true, padding: 1, children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", textColor: "neutral600", children: versions.meta.pagination.total }) })
804
- ]
805
- }
806
- ),
807
- /* @__PURE__ */ jsxs(Box, { flex: 1, overflow: "auto", children: [
808
- versions.meta.pagination.page > 1 && /* @__PURE__ */ jsx(Box, { paddingTop: 4, textAlign: "center", children: /* @__PURE__ */ jsx(PaginationButton, { page: page - 1, children: formatMessage({
809
- id: "content-manager.history.sidebar.show-newer",
810
- defaultMessage: "Show newer versions"
811
- }) }) }),
812
- /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 3, padding: 4, tag: "ul", alignItems: "stretch", children: versions.data.map((version, index) => /* @__PURE__ */ jsx(
813
- "li",
814
- {
815
- "aria-label": formatMessage({
816
- id: "content-manager.history.sidebar.title.version-card.aria-label",
817
- defaultMessage: "Version card"
818
- }),
819
- children: /* @__PURE__ */ jsx(VersionCard, { version, isCurrent: page === 1 && index === 0 })
820
- },
821
- version.id
822
- )) }),
823
- versions.meta.pagination.page < versions.meta.pagination.pageCount && /* @__PURE__ */ jsx(Box, { paddingBottom: 4, textAlign: "center", children: /* @__PURE__ */ jsx(PaginationButton, { page: page + 1, children: formatMessage({
824
- id: "content-manager.history.sidebar.show-older",
825
- defaultMessage: "Show older versions"
826
- }) }) })
827
- ] })
828
- ]
829
- }
830
- );
831
- };
832
- const [HistoryProvider, useHistoryContext] = createContext("HistoryPage");
833
- const HistoryPage = () => {
834
- const headerId = React.useId();
835
- const { formatMessage } = useIntl();
836
- const {
837
- slug,
838
- id: documentId,
839
- collectionType
840
- } = useParams();
841
- const { isLoading: isLoadingDocument, schema } = useDocument({
842
- collectionType,
843
- model: slug
844
- });
845
- const {
846
- isLoading: isLoadingLayout,
847
- edit: {
848
- layout,
849
- settings: { displayName, mainField }
850
- }
851
- } = useDocumentLayout(slug);
852
- const { data: configuration, isLoading: isLoadingConfiguration } = useGetContentTypeConfigurationQuery(slug);
853
- const [{ query }] = useQueryParams();
854
- const { id: selectedVersionId, ...queryWithoutId } = query;
855
- const validQueryParamsWithoutId = buildValidParams(queryWithoutId);
856
- const page = validQueryParamsWithoutId.page ? Number(validQueryParamsWithoutId.page) : 1;
857
- const versionsResponse = useGetHistoryVersionsQuery(
858
- {
859
- contentType: slug,
860
- ...documentId ? { documentId } : {},
861
- // Omit id since it's not needed by the endpoint and caused extra refetches
862
- ...validQueryParamsWithoutId
863
- },
864
- { refetchOnMountOrArgChange: true }
865
- );
866
- const initialRequestId = React.useRef(versionsResponse.requestId);
867
- const isStaleRequest = versionsResponse.requestId === initialRequestId.current;
868
- if (!slug || collectionType === COLLECTION_TYPES && !documentId) {
869
- return /* @__PURE__ */ jsx(Navigate, { to: "/content-manager" });
870
- }
871
- if (isLoadingDocument || isLoadingLayout || versionsResponse.isFetching || isStaleRequest || isLoadingConfiguration) {
872
- return /* @__PURE__ */ jsx(Page.Loading, {});
873
- }
874
- if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
875
- return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
876
- Page.NoData,
877
- {
878
- action: /* @__PURE__ */ jsx(
879
- Link,
880
- {
881
- tag: NavLink,
882
- to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
883
- children: formatMessage({
884
- id: "global.back",
885
- defaultMessage: "Back"
886
- })
887
- }
888
- )
889
- }
890
- ) });
891
- }
892
- if (versionsResponse.data?.data?.length && !selectedVersionId) {
893
- return /* @__PURE__ */ jsx(
894
- Navigate,
895
- {
896
- to: { search: stringify({ ...query, id: versionsResponse.data.data[0].id }) },
897
- replace: true
898
- }
899
- );
900
- }
901
- const selectedVersion = versionsResponse.data?.data?.find(
902
- (version) => version.id.toString() === selectedVersionId
903
- );
904
- if (versionsResponse.isError || !layout || !schema || !selectedVersion || !configuration || // This should not happen as it's covered by versionsResponse.isError, but we need it for TS
905
- versionsResponse.data.error) {
906
- return /* @__PURE__ */ jsx(Page.Error, {});
907
- }
908
- return /* @__PURE__ */ jsxs(Fragment, { children: [
909
- /* @__PURE__ */ jsx(Page.Title, { children: formatMessage(
910
- {
911
- id: "content-manager.history.page-title",
912
- defaultMessage: "{contentType} history"
913
- },
914
- {
915
- contentType: displayName
916
- }
917
- ) }),
918
- /* @__PURE__ */ jsx(
919
- HistoryProvider,
920
- {
921
- contentType: slug,
922
- id: documentId,
923
- schema,
924
- layout,
925
- configuration,
926
- selectedVersion,
927
- versions: versionsResponse.data,
928
- page,
929
- mainField,
930
- children: /* @__PURE__ */ jsxs(Flex, { direction: "row", alignItems: "flex-start", children: [
931
- /* @__PURE__ */ jsxs(
932
- Main,
933
- {
934
- grow: 1,
935
- height: "100vh",
936
- background: "neutral100",
937
- paddingBottom: 6,
938
- overflow: "auto",
939
- labelledBy: headerId,
940
- children: [
941
- /* @__PURE__ */ jsx(VersionHeader, { headerId }),
942
- /* @__PURE__ */ jsx(VersionContent, {})
943
- ]
944
- }
945
- ),
946
- /* @__PURE__ */ jsx(VersionsList, {})
947
- ] })
948
- }
949
- )
950
- ] });
951
- };
952
- const ProtectedHistoryPageImpl = () => {
953
- const { slug } = useParams();
954
- const {
955
- permissions = [],
956
- isLoading,
957
- error
958
- } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));
959
- if (isLoading) {
960
- return /* @__PURE__ */ jsx(Page.Loading, {});
961
- }
962
- if (error || !slug) {
963
- return /* @__PURE__ */ jsx(
964
- Box,
965
- {
966
- height: "100vh",
967
- width: "100vw",
968
- position: "fixed",
969
- top: 0,
970
- left: 0,
971
- zIndex: 2,
972
- background: "neutral0",
973
- children: /* @__PURE__ */ jsx(Page.Error, {})
974
- }
975
- );
976
- }
977
- return /* @__PURE__ */ jsx(
978
- Box,
979
- {
980
- height: "100vh",
981
- width: "100vw",
982
- position: "fixed",
983
- top: 0,
984
- left: 0,
985
- zIndex: 2,
986
- background: "neutral0",
987
- children: /* @__PURE__ */ jsx(Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsx(DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsx(HistoryPage, {}) }) })
988
- }
989
- );
990
- };
991
- const ProtectedHistoryPage = () => {
992
- return /* @__PURE__ */ jsx(Portal, { children: /* @__PURE__ */ jsx(FocusTrap, { children: /* @__PURE__ */ jsx(ProtectedHistoryPageImpl, {}) }) });
993
- };
994
- export {
995
- HistoryProvider,
996
- ProtectedHistoryPage,
997
- useHistoryContext
998
- };
999
- //# sourceMappingURL=History-04ChQ4pl.mjs.map