@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,1030 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const jsxRuntime = require("react/jsx-runtime");
4
- const React = require("react");
5
- const strapiAdmin = require("@strapi/admin/strapi-admin");
6
- const designSystem = require("@strapi/design-system");
7
- const qs = require("qs");
8
- const reactIntl = require("react-intl");
9
- const reactRouterDom = require("react-router-dom");
10
- const index = require("./index-BZoNZMXL.js");
11
- const pipe = require("lodash/fp/pipe");
12
- const hooks = require("./hooks-BAaaKPS_.js");
13
- const Field = require("./Field-C5Z1Ivdv.js");
14
- const Icons = require("@strapi/icons");
15
- const styledComponents = require("styled-components");
16
- const relations = require("./relations-D0eZ4VWw.js");
17
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
18
- function _interopNamespace(e) {
19
- if (e && e.__esModule)
20
- return e;
21
- const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
22
- if (e) {
23
- for (const k in e) {
24
- if (k !== "default") {
25
- const d = Object.getOwnPropertyDescriptor(e, k);
26
- Object.defineProperty(n, k, d.get ? d : {
27
- enumerable: true,
28
- get: () => e[k]
29
- });
30
- }
31
- }
32
- }
33
- n.default = e;
34
- return Object.freeze(n);
35
- }
36
- const React__namespace = /* @__PURE__ */ _interopNamespace(React);
37
- const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
38
- const StyledAlert = styledComponents.styled(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
39
- } })`
40
- button {
41
- display: none;
42
- }
43
- `;
44
- const LinkEllipsis = styledComponents.styled(designSystem.Link)`
45
- display: block;
46
-
47
- & > span {
48
- white-space: nowrap;
49
- overflow: hidden;
50
- text-overflow: ellipsis;
51
- display: block;
52
- }
53
- `;
54
- const CustomRelationInput = (props) => {
55
- const { formatMessage } = reactIntl.useIntl();
56
- const field = strapiAdmin.useField(props.name);
57
- const formattedFieldValue = Array.isArray(field.value) ? {
58
- results: field.value,
59
- meta: { missingCount: 0 }
60
- } : field.value;
61
- if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
62
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
63
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: props.labelAction, children: props.label }),
64
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { variant: "default", children: formatMessage({
65
- id: "content-manager.history.content.no-relations",
66
- defaultMessage: "No relations."
67
- }) }) })
68
- ] });
69
- }
70
- const { results, meta } = formattedFieldValue;
71
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
72
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
73
- results.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 2, marginTop: 1, alignItems: "stretch", children: results.map((relationData) => {
74
- const href = `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}/${relationData.documentId}`;
75
- const label = relations.getRelationLabel(relationData, props.mainField);
76
- return /* @__PURE__ */ jsxRuntime.jsxs(
77
- designSystem.Flex,
78
- {
79
- paddingTop: 2,
80
- paddingBottom: 2,
81
- paddingLeft: 4,
82
- paddingRight: 4,
83
- hasRadius: true,
84
- borderColor: "neutral200",
85
- background: "neutral150",
86
- justifyContent: "space-between",
87
- children: [
88
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: label, children: /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, { tag: reactRouterDom.NavLink, to: href, children: label }) }) }),
89
- /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: relationData.status })
90
- ]
91
- },
92
- relationData.documentId
93
- );
94
- }) }),
95
- meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
96
- /* @__PURE__ */ jsxRuntime.jsx(
97
- StyledAlert,
98
- {
99
- marginTop: 1,
100
- variant: "warning",
101
- title: formatMessage(
102
- {
103
- id: "content-manager.history.content.missing-relations.title",
104
- defaultMessage: "{number, plural, =1 {Missing relation} other {{number} missing relations}}"
105
- },
106
- { number: meta.missingCount }
107
- ),
108
- children: formatMessage(
109
- {
110
- id: "content-manager.history.content.missing-relations.message",
111
- defaultMessage: "{number, plural, =1 {It has} other {They have}} been deleted and can't be restored."
112
- },
113
- { number: meta.missingCount }
114
- )
115
- }
116
- )
117
- ] });
118
- };
119
- const CustomMediaInput = (props) => {
120
- const {
121
- value: { results, meta }
122
- } = strapiAdmin.useField(props.name);
123
- const { formatMessage } = reactIntl.useIntl();
124
- const fields = strapiAdmin.useStrapiApp("CustomMediaInput", (state) => state.fields);
125
- const MediaLibrary = fields.media;
126
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, alignItems: "stretch", children: [
127
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Form, { method: "PUT", disabled: true, initialValues: { [props.name]: results }, children: /* @__PURE__ */ jsxRuntime.jsx(MediaLibrary, { ...props, disabled: true, multiple: results.length > 1 }) }),
128
- meta.missingCount > 0 && /* @__PURE__ */ jsxRuntime.jsx(
129
- StyledAlert,
130
- {
131
- variant: "warning",
132
- closeLabel: "Close",
133
- onClose: () => {
134
- },
135
- title: formatMessage(
136
- {
137
- id: "content-manager.history.content.missing-assets.title",
138
- defaultMessage: "{number, plural, =1 {Missing asset} other {{number} missing assets}}"
139
- },
140
- { number: meta.missingCount }
141
- ),
142
- children: formatMessage(
143
- {
144
- id: "content-manager.history.content.missing-assets.message",
145
- defaultMessage: "{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored."
146
- },
147
- { number: meta.missingCount }
148
- )
149
- }
150
- )
151
- ] });
152
- };
153
- const getLabelAction = (labelAction) => {
154
- if (!React__namespace.isValidElement(labelAction)) {
155
- return labelAction;
156
- }
157
- const labelActionTitleId = labelAction.props.title.id;
158
- if (labelActionTitleId === "i18n.Field.localized") {
159
- return React__namespace.cloneElement(labelAction, {
160
- ...labelAction.props,
161
- title: {
162
- id: "history.content.localized",
163
- defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
164
- }
165
- });
166
- }
167
- if (labelActionTitleId === "i18n.Field.not-localized") {
168
- return React__namespace.cloneElement(labelAction, {
169
- ...labelAction.props,
170
- title: {
171
- id: "history.content.not-localized",
172
- 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."
173
- }
174
- });
175
- }
176
- return labelAction;
177
- };
178
- const VersionInputRenderer = ({
179
- visible,
180
- hint: providedHint,
181
- shouldIgnoreRBAC = false,
182
- labelAction,
183
- ...props
184
- }) => {
185
- const customLabelAction = getLabelAction(labelAction);
186
- const { formatMessage } = reactIntl.useIntl();
187
- const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
188
- const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
189
- const fieldSizes = hooks.useTypedSelector((state) => state["content-manager"].app.fieldSizes);
190
- const { id, components } = index.useDoc();
191
- const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
192
- const isInDynamicZone = Field.useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
193
- const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
194
- const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
195
- const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
196
- const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
197
- const editableFields = id ? canUpdateFields : canCreateFields;
198
- const readableFields = id ? canReadFields : canCreateFields;
199
- const canUserReadField = canUserAction(props.name, readableFields, props.type);
200
- const canUserEditField = canUserAction(props.name, editableFields, props.type);
201
- const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
202
- const { lazyComponentStore } = Field.useLazyComponents(
203
- attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : void 0
204
- );
205
- const hint = Field.useFieldHint(providedHint, props.attribute);
206
- const {
207
- edit: { components: componentsLayout }
208
- } = index.useDocLayout();
209
- if (!visible) {
210
- return null;
211
- }
212
- if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {
213
- return /* @__PURE__ */ jsxRuntime.jsx(Field.NotAllowedInput, { hint, ...props });
214
- }
215
- const fieldIsDisabled = !canUserEditField && !isInDynamicZone || props.disabled || isFormDisabled;
216
- const addedAttributes = version.meta.unknownAttributes.added;
217
- if (Object.keys(addedAttributes).includes(props.name)) {
218
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
219
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
220
- /* @__PURE__ */ jsxRuntime.jsx(
221
- StyledAlert,
222
- {
223
- width: "100%",
224
- closeLabel: "Close",
225
- onClose: () => {
226
- },
227
- variant: "warning",
228
- title: formatMessage({
229
- id: "content-manager.history.content.new-field.title",
230
- defaultMessage: "New field"
231
- }),
232
- children: formatMessage({
233
- id: "content-manager.history.content.new-field.message",
234
- defaultMessage: "This field didn't exist when this version was saved. If you restore this version, it will be empty."
235
- })
236
- }
237
- )
238
- ] });
239
- }
240
- if (attributeHasCustomFieldProperty(props.attribute)) {
241
- const CustomInput = lazyComponentStore[props.attribute.customField];
242
- if (CustomInput) {
243
- return /* @__PURE__ */ jsxRuntime.jsx(
244
- CustomInput,
245
- {
246
- ...props,
247
- hint,
248
- labelAction: customLabelAction,
249
- disabled: fieldIsDisabled
250
- }
251
- );
252
- }
253
- return /* @__PURE__ */ jsxRuntime.jsx(
254
- strapiAdmin.InputRenderer,
255
- {
256
- ...props,
257
- hint,
258
- labelAction: customLabelAction,
259
- type: props.attribute.customField,
260
- disabled: fieldIsDisabled
261
- }
262
- );
263
- }
264
- if (props.type === "media") {
265
- return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
266
- }
267
- const addedInputTypes = Object.keys(fields);
268
- if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
269
- const CustomInput = fields[props.type];
270
- return /* @__PURE__ */ jsxRuntime.jsx(
271
- CustomInput,
272
- {
273
- ...props,
274
- hint,
275
- labelAction: customLabelAction,
276
- disabled: fieldIsDisabled
277
- }
278
- );
279
- }
280
- switch (props.type) {
281
- case "blocks":
282
- return /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
283
- case "component":
284
- const { layout } = componentsLayout[props.attribute.component];
285
- const [remainingFieldsLayout] = getRemaingFieldsLayout({
286
- layout: [layout],
287
- metadatas: configuration.components[props.attribute.component].metadatas,
288
- fieldSizes,
289
- schemaAttributes: components[props.attribute.component].attributes
290
- });
291
- return /* @__PURE__ */ jsxRuntime.jsx(
292
- Field.MemoizedComponentInput,
293
- {
294
- ...props,
295
- layout: [...layout, ...remainingFieldsLayout || []],
296
- hint,
297
- labelAction: customLabelAction,
298
- disabled: fieldIsDisabled,
299
- children: (inputProps) => /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
300
- }
301
- );
302
- case "dynamiczone":
303
- return /* @__PURE__ */ jsxRuntime.jsx(
304
- Field.DynamicZone,
305
- {
306
- ...props,
307
- hint,
308
- labelAction: customLabelAction,
309
- disabled: fieldIsDisabled
310
- }
311
- );
312
- case "relation":
313
- return /* @__PURE__ */ jsxRuntime.jsx(
314
- CustomRelationInput,
315
- {
316
- ...props,
317
- hint,
318
- labelAction: customLabelAction,
319
- disabled: fieldIsDisabled
320
- }
321
- );
322
- case "richtext":
323
- return /* @__PURE__ */ jsxRuntime.jsx(
324
- Field.MemoizedWysiwyg,
325
- {
326
- ...props,
327
- hint,
328
- type: props.type,
329
- labelAction: customLabelAction,
330
- disabled: fieldIsDisabled
331
- }
332
- );
333
- case "uid":
334
- return /* @__PURE__ */ jsxRuntime.jsx(
335
- Field.MemoizedUIDInput,
336
- {
337
- ...props,
338
- hint,
339
- type: props.type,
340
- labelAction: customLabelAction,
341
- disabled: fieldIsDisabled
342
- }
343
- );
344
- case "enumeration":
345
- return /* @__PURE__ */ jsxRuntime.jsx(
346
- strapiAdmin.InputRenderer,
347
- {
348
- ...props,
349
- hint,
350
- labelAction: customLabelAction,
351
- options: props.attribute.enum.map((value) => ({ value })),
352
- type: props.customField ? "custom-field" : props.type,
353
- disabled: fieldIsDisabled
354
- }
355
- );
356
- default:
357
- const { unique: _unique, mainField: _mainField, ...restProps } = props;
358
- return /* @__PURE__ */ jsxRuntime.jsx(
359
- strapiAdmin.InputRenderer,
360
- {
361
- ...restProps,
362
- hint,
363
- labelAction: customLabelAction,
364
- type: props.customField ? "custom-field" : props.type,
365
- disabled: fieldIsDisabled
366
- }
367
- );
368
- }
369
- };
370
- const attributeHasCustomFieldProperty = (attribute) => "customField" in attribute && typeof attribute.customField === "string";
371
- const createLayoutFromFields = (fields) => {
372
- return fields.reduce((rows, field) => {
373
- if (field.type === "dynamiczone") {
374
- rows.push([field]);
375
- return rows;
376
- }
377
- if (!rows[rows.length - 1]) {
378
- rows.push([]);
379
- }
380
- rows[rows.length - 1].push(field);
381
- return rows;
382
- }, []).map((row) => [row]);
383
- };
384
- function getRemaingFieldsLayout({
385
- layout,
386
- metadatas,
387
- schemaAttributes,
388
- fieldSizes
389
- }) {
390
- const fieldsInLayout = layout.flatMap(
391
- (panel) => panel.flatMap((row) => row.flatMap((field) => field.name))
392
- );
393
- const remainingFields = Object.entries(metadatas).reduce(
394
- (currentRemainingFields, [name, field]) => {
395
- if (!fieldsInLayout.includes(name) && field.edit.visible === true) {
396
- const attribute = schemaAttributes[name];
397
- currentRemainingFields.push({
398
- attribute,
399
- type: attribute.type,
400
- visible: true,
401
- disabled: true,
402
- label: field.edit.label || name,
403
- name,
404
- size: fieldSizes[attribute.type].default ?? 12
405
- });
406
- }
407
- return currentRemainingFields;
408
- },
409
- []
410
- );
411
- return createLayoutFromFields(remainingFields);
412
- }
413
- const FormPanel = ({ panel }) => {
414
- if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
415
- const [row] = panel;
416
- const [field] = row;
417
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }) }, field.name);
418
- }
419
- return /* @__PURE__ */ jsxRuntime.jsx(
420
- designSystem.Box,
421
- {
422
- hasRadius: true,
423
- background: "neutral0",
424
- shadow: "tableShadow",
425
- paddingLeft: 6,
426
- paddingRight: 6,
427
- paddingTop: 6,
428
- paddingBottom: 6,
429
- borderColor: "neutral150",
430
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
431
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }, field.name);
432
- }) }, gridRowIndex)) })
433
- }
434
- );
435
- };
436
- const VersionContent = () => {
437
- const { formatMessage } = reactIntl.useIntl();
438
- const { fieldSizes } = hooks.useTypedSelector((state) => state["content-manager"].app);
439
- const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
440
- const layout = useHistoryContext("VersionContent", (state) => state.layout);
441
- const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
442
- const schema = useHistoryContext("VersionContent", (state) => state.schema);
443
- const removedAttributes = version.meta.unknownAttributes.removed;
444
- const removedAttributesAsFields = Object.entries(removedAttributes).map(
445
- ([attributeName, attribute]) => {
446
- const field = {
447
- attribute,
448
- shouldIgnoreRBAC: true,
449
- type: attribute.type,
450
- visible: true,
451
- disabled: true,
452
- label: attributeName,
453
- name: attributeName,
454
- size: fieldSizes[attribute.type].default ?? 12
455
- };
456
- return field;
457
- }
458
- );
459
- const unknownFieldsLayout = createLayoutFromFields(removedAttributesAsFields);
460
- const remainingFieldsLayout = getRemaingFieldsLayout({
461
- metadatas: configuration.contentType.metadatas,
462
- layout,
463
- schemaAttributes: schema.attributes,
464
- fieldSizes
465
- });
466
- const { components } = index.useDoc();
467
- const transformedData = React__namespace.useMemo(() => {
468
- const transform = (schemaAttributes, components2 = {}) => (document) => {
469
- const schema2 = { attributes: schemaAttributes };
470
- const transformations = pipe__default.default(
471
- Field.removeFieldsThatDontExistOnSchema(schema2),
472
- Field.prepareTempKeys(schema2, components2)
473
- );
474
- return transformations(document);
475
- };
476
- return transform(version.schema, components)(version.data);
477
- }, [components, version.data, version.schema]);
478
- return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Layouts.Content, { children: [
479
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 8, children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Form, { disabled: true, method: "PUT", initialValues: transformedData, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", children: [...layout, ...remainingFieldsLayout].map((panel, index2) => {
480
- return /* @__PURE__ */ jsxRuntime.jsx(FormPanel, { panel }, index2);
481
- }) }) }) }),
482
- removedAttributesAsFields.length > 0 && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
483
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Divider, {}),
484
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { paddingTop: 8, children: [
485
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingBottom: 6, gap: 1, children: [
486
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "delta", children: formatMessage({
487
- id: "content-manager.history.content.unknown-fields.title",
488
- defaultMessage: "Unknown fields"
489
- }) }),
490
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", children: formatMessage(
491
- {
492
- id: "content-manager.history.content.unknown-fields.message",
493
- defaultMessage: "These fields have been deleted or renamed in the Content-Type Builder. <b>These fields will not be restored.</b>"
494
- },
495
- {
496
- b: (chunks) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: chunks })
497
- }
498
- ) })
499
- ] }),
500
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Form, { disabled: true, method: "PUT", initialValues: version.data, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", children: unknownFieldsLayout.map((panel, index2) => {
501
- return /* @__PURE__ */ jsxRuntime.jsx(FormPanel, { panel }, index2);
502
- }) }) })
503
- ] })
504
- ] })
505
- ] });
506
- };
507
- const historyVersionsApi = index.contentManagerApi.injectEndpoints({
508
- endpoints: (builder) => ({
509
- getHistoryVersions: builder.query({
510
- query(params) {
511
- return {
512
- url: `/content-manager/history-versions`,
513
- method: "GET",
514
- config: {
515
- params
516
- }
517
- };
518
- },
519
- providesTags: ["HistoryVersion"]
520
- }),
521
- restoreVersion: builder.mutation({
522
- query({ params, body }) {
523
- return {
524
- url: `/content-manager/history-versions/${params.versionId}/restore`,
525
- method: "PUT",
526
- data: body
527
- };
528
- },
529
- invalidatesTags: (_res, _error, { documentId, collectionType, params }) => {
530
- return [
531
- "HistoryVersion",
532
- {
533
- type: "Document",
534
- id: collectionType === index.COLLECTION_TYPES ? `${params.contentType}_${documentId}` : params.contentType
535
- }
536
- ];
537
- }
538
- })
539
- })
540
- });
541
- const { useGetHistoryVersionsQuery, useRestoreVersionMutation } = historyVersionsApi;
542
- const VersionHeader = ({ headerId }) => {
543
- const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React__namespace.useState(false);
544
- const navigate = reactRouterDom.useNavigate();
545
- const { formatMessage, formatDate } = reactIntl.useIntl();
546
- const { toggleNotification } = strapiAdmin.useNotification();
547
- const [{ query }] = strapiAdmin.useQueryParams();
548
- const { collectionType, slug } = reactRouterDom.useParams();
549
- const [restoreVersion, { isLoading }] = useRestoreVersionMutation();
550
- const { allowedActions } = strapiAdmin.useRBAC(index.PERMISSIONS.map((action) => ({ action, subject: slug })));
551
- const version = useHistoryContext("VersionHeader", (state) => state.selectedVersion);
552
- const mainField = useHistoryContext("VersionHeader", (state) => state.mainField);
553
- const schema = useHistoryContext("VersionHeader", (state) => state.schema);
554
- const isCurrentVersion = useHistoryContext(
555
- "VersionHeader",
556
- (state) => state.page === 1 && state.versions.data[0].id === state.selectedVersion.id
557
- );
558
- const mainFieldValue = version.data[mainField];
559
- const getNextNavigation = () => {
560
- const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
561
- if (collectionType === index.COLLECTION_TYPES) {
562
- return {
563
- pathname: `/content-manager/${collectionType}/${version.contentType}/${version.relatedDocumentId}`,
564
- search: pluginsQueryParams
565
- };
566
- }
567
- return {
568
- pathname: `/content-manager/${collectionType}/${version.contentType}`,
569
- search: pluginsQueryParams
570
- };
571
- };
572
- const handleRestore = async () => {
573
- try {
574
- const response = await restoreVersion({
575
- documentId: version.relatedDocumentId,
576
- collectionType,
577
- params: {
578
- versionId: version.id,
579
- contentType: version.contentType
580
- },
581
- body: { contentType: version.contentType }
582
- });
583
- if ("data" in response) {
584
- navigate(getNextNavigation());
585
- toggleNotification({
586
- type: "success",
587
- title: formatMessage({
588
- id: "content-manager.restore.success.title",
589
- defaultMessage: "Version restored."
590
- }),
591
- message: formatMessage({
592
- id: "content-manager.restore.success.message",
593
- defaultMessage: "The content of the restored version is not published yet."
594
- })
595
- });
596
- }
597
- if ("error" in response) {
598
- toggleNotification({
599
- type: "danger",
600
- message: formatMessage({
601
- id: "content-manager.history.restore.error.message",
602
- defaultMessage: "Could not restore version."
603
- })
604
- });
605
- }
606
- } catch (error) {
607
- toggleNotification({
608
- type: "danger",
609
- message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
610
- });
611
- }
612
- };
613
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
614
- /* @__PURE__ */ jsxRuntime.jsx(
615
- strapiAdmin.Layouts.BaseHeader,
616
- {
617
- id: headerId,
618
- title: formatDate(new Date(version.createdAt), {
619
- year: "numeric",
620
- month: "numeric",
621
- day: "numeric",
622
- hour: "numeric",
623
- minute: "numeric"
624
- }),
625
- subtitle: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", children: formatMessage(
626
- {
627
- id: "content-manager.history.version.subtitle",
628
- defaultMessage: "{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}"
629
- },
630
- {
631
- hasLocale: Boolean(version.locale),
632
- subtitle: `${mainFieldValue || ""} (${schema.info.singularName})`.trim(),
633
- locale: version.locale?.name
634
- }
635
- ) }),
636
- navigationAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowLeft, {}), tag: reactRouterDom.NavLink, to: getNextNavigation(), isExternal: false, children: formatMessage({
637
- id: "global.back",
638
- defaultMessage: "Back"
639
- }) }),
640
- sticky: false,
641
- primaryAction: /* @__PURE__ */ jsxRuntime.jsx(
642
- designSystem.Button,
643
- {
644
- disabled: !allowedActions.canUpdate || isCurrentVersion,
645
- onClick: () => {
646
- setIsConfirmDialogOpen(true);
647
- },
648
- children: formatMessage({
649
- id: "content-manager.history.restore.confirm.button",
650
- defaultMessage: "Restore"
651
- })
652
- }
653
- )
654
- }
655
- ),
656
- /* @__PURE__ */ jsxRuntime.jsx(
657
- strapiAdmin.ConfirmDialog,
658
- {
659
- isOpen: isConfirmDialogOpen,
660
- onClose: () => setIsConfirmDialogOpen(false),
661
- onConfirm: handleRestore,
662
- icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}),
663
- endAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
664
- id: "content-manager.history.restore.confirm.button",
665
- defaultMessage: "Restore"
666
- }) }),
667
- children: /* @__PURE__ */ jsxRuntime.jsxs(
668
- designSystem.Flex,
669
- {
670
- direction: "column",
671
- alignItems: "center",
672
- justifyContent: "center",
673
- gap: 2,
674
- textAlign: "center",
675
- children: [
676
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
677
- id: "content-manager.history.restore.confirm.title",
678
- defaultMessage: "Are you sure you want to restore this version?"
679
- }) }),
680
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage(
681
- {
682
- id: "content-manager.history.restore.confirm.message",
683
- 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.}}"
684
- },
685
- {
686
- isDraft: version.status === "draft"
687
- }
688
- ) })
689
- ]
690
- }
691
- )
692
- }
693
- )
694
- ] });
695
- };
696
- const BlueText = (children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", children });
697
- const VersionCard = ({ version, isCurrent }) => {
698
- const { formatDate, formatMessage } = reactIntl.useIntl();
699
- const [{ query }] = strapiAdmin.useQueryParams();
700
- const statusData = (() => {
701
- switch (version.status) {
702
- case "draft":
703
- return {
704
- background: "secondary100",
705
- border: "secondary200",
706
- text: "secondary700",
707
- message: {
708
- id: "content-manager.containers.List.draft",
709
- defaultMessage: "Draft"
710
- }
711
- };
712
- case "modified":
713
- return {
714
- background: "alternative100",
715
- border: "alternative200",
716
- text: "alternative700",
717
- message: {
718
- // TODO: check the translation key once D&P v5 is done
719
- id: "content-manager.containers.List.modified",
720
- defaultMessage: "Modified"
721
- }
722
- };
723
- case "published":
724
- default:
725
- return {
726
- background: "success100",
727
- border: "success200",
728
- text: "success700",
729
- message: {
730
- id: "content-manager.containers.List.published",
731
- defaultMessage: "Published"
732
- }
733
- };
734
- }
735
- })();
736
- const isActive = query.id === version.id.toString();
737
- const author = version.createdBy && index.getDisplayName(version.createdBy);
738
- return /* @__PURE__ */ jsxRuntime.jsxs(
739
- designSystem.Flex,
740
- {
741
- direction: "column",
742
- alignItems: "flex-start",
743
- gap: 3,
744
- hasRadius: true,
745
- borderWidth: "1px",
746
- borderStyle: "solid",
747
- borderColor: isActive ? "primary600" : "neutral200",
748
- color: "neutral800",
749
- paddingTop: 4,
750
- paddingBottom: 4,
751
- paddingLeft: 5,
752
- paddingRight: 5,
753
- tag: reactRouterDom.Link,
754
- to: `?${qs.stringify({ ...query, id: version.id })}`,
755
- style: { textDecoration: "none" },
756
- children: [
757
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
758
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
759
- day: "numeric",
760
- month: "numeric",
761
- year: "numeric",
762
- hour: "2-digit",
763
- minute: "2-digit"
764
- }) }),
765
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
766
- {
767
- id: "content-manager.history.sidebar.versionDescription",
768
- defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
769
- },
770
- {
771
- distanceToNow: /* @__PURE__ */ jsxRuntime.jsx(index.RelativeTime, { timestamp: new Date(version.createdAt) }),
772
- author,
773
- isAnonymous: !Boolean(version.createdBy),
774
- isCurrent,
775
- b: BlueText
776
- }
777
- ) })
778
- ] }),
779
- version.status && /* @__PURE__ */ jsxRuntime.jsx(
780
- designSystem.Box,
781
- {
782
- background: statusData.background,
783
- borderStyle: "solid",
784
- borderWidth: "1px",
785
- borderColor: statusData.border,
786
- hasRadius: true,
787
- paddingLeft: "6px",
788
- paddingRight: "6px",
789
- paddingTop: "2px",
790
- paddingBottom: "2px",
791
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: statusData.text, children: formatMessage(statusData.message) })
792
- }
793
- )
794
- ]
795
- }
796
- );
797
- };
798
- const PaginationButton = ({ page, children }) => {
799
- const [{ query }] = strapiAdmin.useQueryParams();
800
- const { id: _id, ...queryRest } = query;
801
- return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Link, { to: { search: qs.stringify({ ...queryRest, page }) }, style: { textDecoration: "none" }, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", textColor: "primary600", children }) });
802
- };
803
- const VersionsList = () => {
804
- const { formatMessage } = reactIntl.useIntl();
805
- const { versions, page } = useHistoryContext("VersionsList", (state) => ({
806
- versions: state.versions,
807
- page: state.page
808
- }));
809
- return /* @__PURE__ */ jsxRuntime.jsxs(
810
- designSystem.Flex,
811
- {
812
- shrink: 0,
813
- direction: "column",
814
- alignItems: "stretch",
815
- width: "320px",
816
- height: "100vh",
817
- background: "neutral0",
818
- borderColor: "neutral200",
819
- borderWidth: "0 0 0 1px",
820
- borderStyle: "solid",
821
- tag: "aside",
822
- children: [
823
- /* @__PURE__ */ jsxRuntime.jsxs(
824
- designSystem.Flex,
825
- {
826
- direction: "row",
827
- justifyContent: "space-between",
828
- padding: 4,
829
- borderColor: "neutral200",
830
- borderWidth: "0 0 1px",
831
- borderStyle: "solid",
832
- tag: "header",
833
- children: [
834
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
835
- id: "content-manager.history.sidebar.title",
836
- defaultMessage: "Versions"
837
- }) }),
838
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { background: "neutral150", hasRadius: true, padding: 1, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", textColor: "neutral600", children: versions.meta.pagination.total }) })
839
- ]
840
- }
841
- ),
842
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { flex: 1, overflow: "auto", children: [
843
- versions.meta.pagination.page > 1 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 4, textAlign: "center", children: /* @__PURE__ */ jsxRuntime.jsx(PaginationButton, { page: page - 1, children: formatMessage({
844
- id: "content-manager.history.sidebar.show-newer",
845
- defaultMessage: "Show newer versions"
846
- }) }) }),
847
- /* @__PURE__ */ jsxRuntime.jsx(
848
- designSystem.Flex,
849
- {
850
- direction: "column",
851
- gap: 3,
852
- paddingTop: 5,
853
- paddingBottom: 5,
854
- paddingLeft: 4,
855
- paddingRight: 4,
856
- tag: "ul",
857
- alignItems: "stretch",
858
- children: versions.data.map((version, index2) => /* @__PURE__ */ jsxRuntime.jsx(
859
- "li",
860
- {
861
- "aria-label": formatMessage({
862
- id: "content-manager.history.sidebar.title.version-card.aria-label",
863
- defaultMessage: "Version card"
864
- }),
865
- children: /* @__PURE__ */ jsxRuntime.jsx(VersionCard, { version, isCurrent: page === 1 && index2 === 0 })
866
- },
867
- version.id
868
- ))
869
- }
870
- ),
871
- versions.meta.pagination.page < versions.meta.pagination.pageCount && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 5, textAlign: "center", children: /* @__PURE__ */ jsxRuntime.jsx(PaginationButton, { page: page + 1, children: formatMessage({
872
- id: "content-manager.history.sidebar.show-older",
873
- defaultMessage: "Show older versions"
874
- }) }) })
875
- ] })
876
- ]
877
- }
878
- );
879
- };
880
- const [HistoryProvider, useHistoryContext] = strapiAdmin.createContext("HistoryPage");
881
- const HistoryPage = () => {
882
- const headerId = React__namespace.useId();
883
- const { formatMessage } = reactIntl.useIntl();
884
- const {
885
- slug,
886
- id: documentId,
887
- collectionType
888
- } = reactRouterDom.useParams();
889
- const { isLoading: isLoadingDocument, schema } = index.useDocument({
890
- collectionType,
891
- model: slug
892
- });
893
- const {
894
- isLoading: isLoadingLayout,
895
- edit: {
896
- layout,
897
- settings: { displayName, mainField }
898
- }
899
- } = index.useDocumentLayout(slug);
900
- const { data: configuration, isLoading: isLoadingConfiguration } = index.useGetContentTypeConfigurationQuery(slug);
901
- const [{ query }] = strapiAdmin.useQueryParams();
902
- const { id: selectedVersionId, ...queryWithoutId } = query;
903
- const validQueryParamsWithoutId = index.buildValidParams(queryWithoutId);
904
- const page = validQueryParamsWithoutId.page ? Number(validQueryParamsWithoutId.page) : 1;
905
- const versionsResponse = useGetHistoryVersionsQuery(
906
- {
907
- contentType: slug,
908
- ...documentId ? { documentId } : {},
909
- // Omit id since it's not needed by the endpoint and caused extra refetches
910
- ...validQueryParamsWithoutId
911
- },
912
- { refetchOnMountOrArgChange: true }
913
- );
914
- const initialRequestId = React__namespace.useRef(versionsResponse.requestId);
915
- const isStaleRequest = versionsResponse.requestId === initialRequestId.current;
916
- if (!slug || collectionType === index.COLLECTION_TYPES && !documentId) {
917
- return /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Navigate, { to: "/content-manager" });
918
- }
919
- if (isLoadingDocument || isLoadingLayout || versionsResponse.isFetching || isStaleRequest || isLoadingConfiguration) {
920
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
921
- }
922
- if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
923
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.NoData, {});
924
- }
925
- if (versionsResponse.data?.data?.length && !selectedVersionId) {
926
- return /* @__PURE__ */ jsxRuntime.jsx(
927
- reactRouterDom.Navigate,
928
- {
929
- to: { search: qs.stringify({ ...query, id: versionsResponse.data.data[0].id }) },
930
- replace: true
931
- }
932
- );
933
- }
934
- const selectedVersion = versionsResponse.data?.data?.find(
935
- (version) => version.id.toString() === selectedVersionId
936
- );
937
- if (versionsResponse.isError || !layout || !schema || !selectedVersion || !configuration || // This should not happen as it's covered by versionsResponse.isError, but we need it for TS
938
- versionsResponse.data.error) {
939
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
940
- }
941
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
942
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Title, { children: formatMessage(
943
- {
944
- id: "content-manager.history.page-title",
945
- defaultMessage: "{contentType} history"
946
- },
947
- {
948
- contentType: displayName
949
- }
950
- ) }),
951
- /* @__PURE__ */ jsxRuntime.jsx(
952
- HistoryProvider,
953
- {
954
- contentType: slug,
955
- id: documentId,
956
- schema,
957
- layout,
958
- configuration,
959
- selectedVersion,
960
- versions: versionsResponse.data,
961
- page,
962
- mainField,
963
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "row", alignItems: "flex-start", children: [
964
- /* @__PURE__ */ jsxRuntime.jsxs(
965
- designSystem.Main,
966
- {
967
- grow: 1,
968
- height: "100vh",
969
- background: "neutral100",
970
- paddingBottom: 6,
971
- overflow: "auto",
972
- labelledBy: headerId,
973
- children: [
974
- /* @__PURE__ */ jsxRuntime.jsx(VersionHeader, { headerId }),
975
- /* @__PURE__ */ jsxRuntime.jsx(VersionContent, {})
976
- ]
977
- }
978
- ),
979
- /* @__PURE__ */ jsxRuntime.jsx(VersionsList, {})
980
- ] })
981
- }
982
- )
983
- ] });
984
- };
985
- const ProtectedHistoryPageImpl = () => {
986
- const { slug } = reactRouterDom.useParams();
987
- const {
988
- permissions = [],
989
- isLoading,
990
- error
991
- } = strapiAdmin.useRBAC(index.PERMISSIONS.map((action) => ({ action, subject: slug })));
992
- if (isLoading) {
993
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
994
- }
995
- if (error || !slug) {
996
- return /* @__PURE__ */ jsxRuntime.jsx(
997
- designSystem.Box,
998
- {
999
- height: "100vh",
1000
- width: "100vw",
1001
- position: "fixed",
1002
- top: 0,
1003
- left: 0,
1004
- zIndex: 2,
1005
- background: "neutral0",
1006
- children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {})
1007
- }
1008
- );
1009
- }
1010
- return /* @__PURE__ */ jsxRuntime.jsx(
1011
- designSystem.Box,
1012
- {
1013
- height: "100vh",
1014
- width: "100vw",
1015
- position: "fixed",
1016
- top: 0,
1017
- left: 0,
1018
- zIndex: 2,
1019
- background: "neutral0",
1020
- children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: ({ permissions: permissions2 }) => /* @__PURE__ */ jsxRuntime.jsx(index.DocumentRBAC, { permissions: permissions2, children: /* @__PURE__ */ jsxRuntime.jsx(HistoryPage, {}) }) })
1021
- }
1022
- );
1023
- };
1024
- const ProtectedHistoryPage = () => {
1025
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Portal, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.FocusTrap, { children: /* @__PURE__ */ jsxRuntime.jsx(ProtectedHistoryPageImpl, {}) }) });
1026
- };
1027
- exports.HistoryProvider = HistoryProvider;
1028
- exports.ProtectedHistoryPage = ProtectedHistoryPage;
1029
- exports.useHistoryContext = useHistoryContext;
1030
- //# sourceMappingURL=History-4NbOq2dX.js.map