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

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