@strapi/content-manager 0.0.0-experimental.e60ec1829240dae21c1e1d29076681c322288813 → 0.0.0-experimental.e8d8fc824d0f6a695b2a9ebaa4680ed21c3645ca

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 (257) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
  3. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
  4. package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
  5. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
  6. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js → ComponentConfigurationPage-BlzvDpbX.js} +5 -6
  7. package/dist/_chunks/{ComponentConfigurationPage-DjWJdz6Y.js.map → ComponentConfigurationPage-BlzvDpbX.js.map} +1 -1
  8. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs → ComponentConfigurationPage-DaPOlQaD.mjs} +4 -4
  9. package/dist/_chunks/{ComponentConfigurationPage-BPvzFjM7.mjs.map → ComponentConfigurationPage-DaPOlQaD.mjs.map} +1 -1
  10. package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-CRbtQEUV.js} +9 -4
  11. package/dist/_chunks/ComponentIcon-CRbtQEUV.js.map +1 -0
  12. package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
  13. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
  14. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs → EditConfigurationPage-BZPXItXo.mjs} +4 -4
  15. package/dist/_chunks/{EditConfigurationPage-DacbqQ_f.mjs.map → EditConfigurationPage-BZPXItXo.mjs.map} +1 -1
  16. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js → EditConfigurationPage-uy-v43AR.js} +5 -6
  17. package/dist/_chunks/{EditConfigurationPage-Dmv83RlS.js.map → EditConfigurationPage-uy-v43AR.js.map} +1 -1
  18. package/dist/_chunks/{EditViewPage-DvNpQkam.js → EditViewPage-DT6A4ayX.js} +102 -54
  19. package/dist/_chunks/EditViewPage-DT6A4ayX.js.map +1 -0
  20. package/dist/_chunks/EditViewPage-oOLeTySr.mjs +254 -0
  21. package/dist/_chunks/EditViewPage-oOLeTySr.mjs.map +1 -0
  22. package/dist/_chunks/{Field-6gvGdPBV.mjs → Field-D7dv2aUX.mjs} +1192 -896
  23. package/dist/_chunks/Field-D7dv2aUX.mjs.map +1 -0
  24. package/dist/_chunks/{Field-DmVKIAOo.js → Field-kYFVIGiP.js} +1238 -943
  25. package/dist/_chunks/Field-kYFVIGiP.js.map +1 -0
  26. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  27. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  28. package/dist/_chunks/{Form-DW6K1IH-.mjs → Form-BxR6sc29.mjs} +67 -46
  29. package/dist/_chunks/Form-BxR6sc29.mjs.map +1 -0
  30. package/dist/_chunks/{Form-CPZC9vWa.js → Form-CCijSg3V.js} +68 -49
  31. package/dist/_chunks/Form-CCijSg3V.js.map +1 -0
  32. package/dist/_chunks/{History-DeAPlvtv.js → History-BMndx49M.js} +182 -147
  33. package/dist/_chunks/History-BMndx49M.js.map +1 -0
  34. package/dist/_chunks/{History-Dmr9fmUA.mjs → History-D8F7aYQU.mjs} +181 -144
  35. package/dist/_chunks/History-D8F7aYQU.mjs.map +1 -0
  36. package/dist/_chunks/{ListConfigurationPage-DPCwW5Vr.js → ListConfigurationPage-DouY1EWM.js} +72 -63
  37. package/dist/_chunks/ListConfigurationPage-DouY1EWM.js.map +1 -0
  38. package/dist/_chunks/{ListConfigurationPage-DhwvYcNv.mjs → ListConfigurationPage-DqAdSPwC.mjs} +68 -57
  39. package/dist/_chunks/ListConfigurationPage-DqAdSPwC.mjs.map +1 -0
  40. package/dist/_chunks/{ListViewPage-5ySZ-VUs.js → ListViewPage-BPVmh9pq.js} +179 -164
  41. package/dist/_chunks/ListViewPage-BPVmh9pq.js.map +1 -0
  42. package/dist/_chunks/{ListViewPage-BtAwuYLE.mjs → ListViewPage-C73F0jPh.mjs} +175 -159
  43. package/dist/_chunks/ListViewPage-C73F0jPh.mjs.map +1 -0
  44. package/dist/_chunks/{NoContentTypePage-DSPxnxxp.mjs → NoContentTypePage-B5w7iJOF.mjs} +3 -3
  45. package/dist/_chunks/NoContentTypePage-B5w7iJOF.mjs.map +1 -0
  46. package/dist/_chunks/{NoContentTypePage-DOC_yWOf.js → NoContentTypePage-BwcL--4H.js} +3 -3
  47. package/dist/_chunks/NoContentTypePage-BwcL--4H.js.map +1 -0
  48. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js → NoPermissionsPage-BMFKVcwJ.js} +2 -2
  49. package/dist/_chunks/{NoPermissionsPage-Dwu8rRJu.js.map → NoPermissionsPage-BMFKVcwJ.js.map} +1 -1
  50. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs → NoPermissionsPage-UnEgMGK4.mjs} +2 -2
  51. package/dist/_chunks/{NoPermissionsPage-UWDC-1Tw.mjs.map → NoPermissionsPage-UnEgMGK4.mjs.map} +1 -1
  52. package/dist/_chunks/Preview-B7PR3Ok_.js +312 -0
  53. package/dist/_chunks/Preview-B7PR3Ok_.js.map +1 -0
  54. package/dist/_chunks/Preview-DECOhK0D.mjs +294 -0
  55. package/dist/_chunks/Preview-DECOhK0D.mjs.map +1 -0
  56. package/dist/_chunks/{Relations-J8cscLlR.mjs → Relations-DinMQJ4B.mjs} +138 -94
  57. package/dist/_chunks/Relations-DinMQJ4B.mjs.map +1 -0
  58. package/dist/_chunks/{Relations-CgWtgnPe.js → Relations-lndx3aQk.js} +142 -100
  59. package/dist/_chunks/Relations-lndx3aQk.js.map +1 -0
  60. package/dist/_chunks/{en-C-V1_90f.js → en-BK8Xyl5I.js} +38 -18
  61. package/dist/_chunks/{en-C-V1_90f.js.map → en-BK8Xyl5I.js.map} +1 -1
  62. package/dist/_chunks/{en-MBPul9Su.mjs → en-Dtk_ot79.mjs} +38 -18
  63. package/dist/_chunks/{en-MBPul9Su.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
  64. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  65. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  66. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  67. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  68. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  69. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  70. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  71. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  72. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  73. package/dist/_chunks/{index-CwRRo1V9.mjs → index-C2SagWVW.mjs} +2070 -988
  74. package/dist/_chunks/index-C2SagWVW.mjs.map +1 -0
  75. package/dist/_chunks/{index-C6AH2hEl.js → index-Cnw4gqee.js} +2047 -966
  76. package/dist/_chunks/index-Cnw4gqee.js.map +1 -0
  77. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  78. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  79. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  80. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  81. package/dist/_chunks/{layout-jIDzX0Fp.mjs → layout-DY_D9MGA.mjs} +46 -28
  82. package/dist/_chunks/layout-DY_D9MGA.mjs.map +1 -0
  83. package/dist/_chunks/{layout-B_SXLhqf.js → layout-ivwIVPnV.js} +47 -32
  84. package/dist/_chunks/layout-ivwIVPnV.js.map +1 -0
  85. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  86. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  87. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  88. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  89. package/dist/_chunks/{relations-iBMa_OFG.js → relations-B7C7O_Pv.js} +6 -7
  90. package/dist/_chunks/relations-B7C7O_Pv.js.map +1 -0
  91. package/dist/_chunks/{relations-CuvIgCqI.mjs → relations-Boc5Y9kX.mjs} +6 -7
  92. package/dist/_chunks/relations-Boc5Y9kX.mjs.map +1 -0
  93. package/dist/_chunks/useDebounce-CtcjDB3L.js +28 -0
  94. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  95. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  96. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  97. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  98. package/dist/_chunks/useDragAndDrop-BMtgCYzL.js.map +1 -0
  99. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  100. package/dist/_chunks/useDragAndDrop-DJ6jqvZN.mjs.map +1 -0
  101. package/dist/admin/index.js +3 -1
  102. package/dist/admin/index.js.map +1 -1
  103. package/dist/admin/index.mjs +9 -7
  104. package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
  105. package/dist/admin/src/content-manager.d.ts +6 -5
  106. package/dist/admin/src/exports.d.ts +2 -1
  107. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  108. package/dist/admin/src/history/index.d.ts +3 -0
  109. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  110. package/dist/admin/src/hooks/useDocument.d.ts +37 -9
  111. package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
  112. package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
  113. package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
  114. package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
  115. package/dist/admin/src/index.d.ts +1 -0
  116. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  117. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +12 -5
  118. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  119. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  120. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  121. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
  122. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +5 -0
  123. package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
  124. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
  125. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
  126. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +30 -18
  127. package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
  128. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
  129. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
  130. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  131. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +16 -53
  132. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  133. package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
  134. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  135. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  136. package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
  137. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  138. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  139. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  140. package/dist/admin/src/preview/index.d.ts +4 -0
  141. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  142. package/dist/admin/src/preview/routes.d.ts +3 -0
  143. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  144. package/dist/admin/src/router.d.ts +1 -1
  145. package/dist/admin/src/services/api.d.ts +2 -3
  146. package/dist/admin/src/services/components.d.ts +2 -2
  147. package/dist/admin/src/services/contentTypes.d.ts +5 -5
  148. package/dist/admin/src/services/documents.d.ts +31 -20
  149. package/dist/admin/src/services/init.d.ts +2 -2
  150. package/dist/admin/src/services/relations.d.ts +3 -3
  151. package/dist/admin/src/services/uid.d.ts +3 -3
  152. package/dist/admin/src/utils/api.d.ts +4 -18
  153. package/dist/admin/src/utils/validation.d.ts +5 -7
  154. package/dist/server/index.js +886 -480
  155. package/dist/server/index.js.map +1 -1
  156. package/dist/server/index.mjs +892 -485
  157. package/dist/server/index.mjs.map +1 -1
  158. package/dist/server/src/bootstrap.d.ts.map +1 -1
  159. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  160. package/dist/server/src/controllers/index.d.ts.map +1 -1
  161. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  162. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  163. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  164. package/dist/server/src/controllers/utils/metadata.d.ts +23 -0
  165. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
  166. package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
  167. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
  168. package/dist/server/src/controllers/validation/index.d.ts +1 -1
  169. package/dist/server/src/history/services/history.d.ts.map +1 -1
  170. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  171. package/dist/server/src/history/services/utils.d.ts +4 -4
  172. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  173. package/dist/server/src/index.d.ts +22 -42
  174. package/dist/server/src/index.d.ts.map +1 -1
  175. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  176. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  177. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  178. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  179. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  180. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  181. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  182. package/dist/server/src/preview/index.d.ts +4 -0
  183. package/dist/server/src/preview/index.d.ts.map +1 -0
  184. package/dist/server/src/preview/routes/index.d.ts +8 -0
  185. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  186. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  187. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  188. package/dist/server/src/preview/services/index.d.ts +16 -0
  189. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  190. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  191. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  192. package/dist/server/src/preview/services/preview.d.ts +12 -0
  193. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  194. package/dist/server/src/preview/utils.d.ts +19 -0
  195. package/dist/server/src/preview/utils.d.ts.map +1 -0
  196. package/dist/server/src/register.d.ts.map +1 -1
  197. package/dist/server/src/routes/index.d.ts.map +1 -1
  198. package/dist/server/src/services/document-manager.d.ts +13 -12
  199. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  200. package/dist/server/src/services/document-metadata.d.ts +16 -35
  201. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  202. package/dist/server/src/services/index.d.ts +22 -42
  203. package/dist/server/src/services/index.d.ts.map +1 -1
  204. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  205. package/dist/server/src/services/utils/populate.d.ts +8 -1
  206. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  207. package/dist/server/src/utils/index.d.ts +2 -0
  208. package/dist/server/src/utils/index.d.ts.map +1 -1
  209. package/dist/shared/contracts/collection-types.d.ts +17 -7
  210. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  211. package/dist/shared/contracts/index.d.ts +1 -0
  212. package/dist/shared/contracts/index.d.ts.map +1 -1
  213. package/dist/shared/contracts/preview.d.ts +27 -0
  214. package/dist/shared/contracts/preview.d.ts.map +1 -0
  215. package/dist/shared/contracts/relations.d.ts +2 -2
  216. package/dist/shared/contracts/relations.d.ts.map +1 -1
  217. package/dist/shared/index.js +4 -0
  218. package/dist/shared/index.js.map +1 -1
  219. package/dist/shared/index.mjs +4 -0
  220. package/dist/shared/index.mjs.map +1 -1
  221. package/package.json +22 -21
  222. package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
  223. package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
  224. package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
  225. package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
  226. package/dist/_chunks/EditViewPage-DDS6H9HO.mjs +0 -203
  227. package/dist/_chunks/EditViewPage-DDS6H9HO.mjs.map +0 -1
  228. package/dist/_chunks/EditViewPage-DvNpQkam.js.map +0 -1
  229. package/dist/_chunks/Field-6gvGdPBV.mjs.map +0 -1
  230. package/dist/_chunks/Field-DmVKIAOo.js.map +0 -1
  231. package/dist/_chunks/Form-CPZC9vWa.js.map +0 -1
  232. package/dist/_chunks/Form-DW6K1IH-.mjs.map +0 -1
  233. package/dist/_chunks/History-DeAPlvtv.js.map +0 -1
  234. package/dist/_chunks/History-Dmr9fmUA.mjs.map +0 -1
  235. package/dist/_chunks/ListConfigurationPage-DPCwW5Vr.js.map +0 -1
  236. package/dist/_chunks/ListConfigurationPage-DhwvYcNv.mjs.map +0 -1
  237. package/dist/_chunks/ListViewPage-5ySZ-VUs.js.map +0 -1
  238. package/dist/_chunks/ListViewPage-BtAwuYLE.mjs.map +0 -1
  239. package/dist/_chunks/NoContentTypePage-DOC_yWOf.js.map +0 -1
  240. package/dist/_chunks/NoContentTypePage-DSPxnxxp.mjs.map +0 -1
  241. package/dist/_chunks/Relations-CgWtgnPe.js.map +0 -1
  242. package/dist/_chunks/Relations-J8cscLlR.mjs.map +0 -1
  243. package/dist/_chunks/index-C6AH2hEl.js.map +0 -1
  244. package/dist/_chunks/index-CwRRo1V9.mjs.map +0 -1
  245. package/dist/_chunks/layout-B_SXLhqf.js.map +0 -1
  246. package/dist/_chunks/layout-jIDzX0Fp.mjs.map +0 -1
  247. package/dist/_chunks/relations-CuvIgCqI.mjs.map +0 -1
  248. package/dist/_chunks/relations-iBMa_OFG.js.map +0 -1
  249. package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
  250. package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
  251. package/dist/_chunks/urls-DzZya_gm.js +0 -6
  252. package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
  253. package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +0 -1
  254. package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +0 -1
  255. package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
  256. package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
  257. package/strapi-server.js +0 -3
@@ -1,19 +1,19 @@
1
1
  import { jsx, jsxs, Fragment } from "react/jsx-runtime";
2
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, FieldLabel, Box, Tooltip, Divider, Typography, Grid, GridItem, Button, Portal, FocusTrap, Main } from "@strapi/design-system";
3
+ import { useForm, useStrapiApp, InputRenderer, useField, Form, Layouts, useTracking, useNotification, useQueryParams, useRBAC, ConfirmDialog, createContext, Page } from "@strapi/admin/strapi-admin";
4
+ import { Alert, Link, Flex, Field, Box, Tooltip, Typography, Divider, Grid, Dialog, Button, Portal, FocusTrap, Main } from "@strapi/design-system";
5
5
  import { stringify } from "qs";
6
6
  import { useIntl } from "react-intl";
7
7
  import { NavLink, useNavigate, useParams, Link as Link$1, Navigate } from "react-router-dom";
8
- import { b as useDoc, e as useDocumentRBAC, m as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, d as contentManagerApi, j as PERMISSIONS, t as getDisplayName, R as RelativeTime, k as DocumentRBAC, G as useDocument, f as useDocumentLayout, o as useGetContentTypeConfigurationQuery, c as buildValidParams } from "./index-CwRRo1V9.mjs";
8
+ import { c as useDoc, f as useDocumentRBAC, o as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, e as contentManagerApi, k as PERMISSIONS, t as getDisplayName, R as RelativeTime, l as DocumentRBAC, J as useDocument, h as useDocumentLayout, p as useGetContentTypeConfigurationQuery, d as buildValidParams } from "./index-C2SagWVW.mjs";
9
9
  import pipe from "lodash/fp/pipe";
10
10
  import { u as useTypedSelector } from "./hooks-E5u1mcgM.mjs";
11
- import { a as useDynamicZone, u as useLazyComponents, b as useFieldHint, N as NotAllowedInput, U as UIDInput, W as Wysiwyg, D as DynamicZone, C as ComponentInput, B as BlocksInput, r as removeFieldsThatDontExistOnSchema, p as prepareTempKeys } from "./Field-6gvGdPBV.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-D7dv2aUX.mjs";
12
12
  import { ArrowLeft, WarningCircle } from "@strapi/icons";
13
- import styled from "styled-components";
14
- import { g as getRelationLabel } from "./relations-CuvIgCqI.mjs";
13
+ import { styled } from "styled-components";
14
+ import { g as getRelationLabel } from "./relations-Boc5Y9kX.mjs";
15
15
  const StyledAlert = styled(Alert).attrs({ closeLabel: "Close", onClose: () => {
16
- } })`
16
+ }, shadow: "none" })`
17
17
  button {
18
18
  display: none;
19
19
  }
@@ -31,13 +31,13 @@ const LinkEllipsis = styled(Link)`
31
31
  const CustomRelationInput = (props) => {
32
32
  const { formatMessage } = useIntl();
33
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) {
34
+ let formattedFieldValue;
35
+ if (field) {
36
+ formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
37
+ }
38
+ if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
39
39
  return /* @__PURE__ */ jsxs(Fragment, { children: [
40
- /* @__PURE__ */ jsx(FieldLabel, { children: props.label }),
40
+ /* @__PURE__ */ jsx(Field.Label, { action: props.labelAction, children: props.label }),
41
41
  /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(StyledAlert, { variant: "default", children: formatMessage({
42
42
  id: "content-manager.history.content.no-relations",
43
43
  defaultMessage: "No relations."
@@ -46,10 +46,12 @@ const CustomRelationInput = (props) => {
46
46
  }
47
47
  const { results, meta } = formattedFieldValue;
48
48
  return /* @__PURE__ */ jsxs(Box, { children: [
49
- /* @__PURE__ */ jsx(FieldLabel, { children: props.label }),
49
+ /* @__PURE__ */ jsx(Field.Label, { children: props.label }),
50
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}`;
51
+ const { targetModel } = props.attribute;
52
+ const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;
52
53
  const label = getRelationLabel(relationData, props.mainField);
54
+ const isAdminUserRelation = targetModel === "admin::user";
53
55
  return /* @__PURE__ */ jsxs(
54
56
  Flex,
55
57
  {
@@ -62,14 +64,15 @@ const CustomRelationInput = (props) => {
62
64
  background: "neutral150",
63
65
  justifyContent: "space-between",
64
66
  children: [
65
- /* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { description: label, children: /* @__PURE__ */ jsx(LinkEllipsis, { forwardedAs: NavLink, to: href, children: label }) }) }),
67
+ /* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { label, children: isAdminUserRelation ? /* @__PURE__ */ jsx(Typography, { children: label }) : /* @__PURE__ */ jsx(LinkEllipsis, { tag: NavLink, to: href, children: label }) }) }),
66
68
  /* @__PURE__ */ jsx(DocumentStatus, { status: relationData.status })
67
69
  ]
68
70
  },
69
- relationData.documentId
71
+ relationData.documentId ?? relationData.id
70
72
  );
71
73
  }) }),
72
- meta.missingCount > 0 && /* @__PURE__ */ jsx(
74
+ meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
75
+ /* @__PURE__ */ jsx(
73
76
  StyledAlert,
74
77
  {
75
78
  marginTop: 1,
@@ -89,17 +92,13 @@ const CustomRelationInput = (props) => {
89
92
  { number: meta.missingCount }
90
93
  )
91
94
  }
92
- ),
93
- results.length === 0 && meta.missingCount === 0 && /* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(StyledAlert, { variant: "default", children: formatMessage({
94
- id: "content-manager.history.content.no-relations",
95
- defaultMessage: "No relations."
96
- }) }) })
95
+ )
97
96
  ] });
98
97
  };
99
98
  const CustomMediaInput = (props) => {
100
- const {
101
- value: { results, meta }
102
- } = useField(props.name);
99
+ const { value } = useField(props.name);
100
+ const results = value ? value.results : [];
101
+ const meta = value ? value.meta : { missingCount: 0 };
103
102
  const { formatMessage } = useIntl();
104
103
  const fields = useStrapiApp("CustomMediaInput", (state) => state.fields);
105
104
  const MediaLibrary = fields.media;
@@ -130,12 +129,39 @@ const CustomMediaInput = (props) => {
130
129
  )
131
130
  ] });
132
131
  };
132
+ const getLabelAction = (labelAction) => {
133
+ if (!React.isValidElement(labelAction)) {
134
+ return labelAction;
135
+ }
136
+ const labelActionTitleId = labelAction.props.title.id;
137
+ if (labelActionTitleId === "i18n.Field.localized") {
138
+ return React.cloneElement(labelAction, {
139
+ ...labelAction.props,
140
+ title: {
141
+ id: "history.content.localized",
142
+ defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
143
+ }
144
+ });
145
+ }
146
+ if (labelActionTitleId === "i18n.Field.not-localized") {
147
+ return React.cloneElement(labelAction, {
148
+ ...labelAction.props,
149
+ title: {
150
+ id: "history.content.not-localized",
151
+ 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."
152
+ }
153
+ });
154
+ }
155
+ return labelAction;
156
+ };
133
157
  const VersionInputRenderer = ({
134
158
  visible,
135
159
  hint: providedHint,
136
160
  shouldIgnoreRBAC = false,
161
+ labelAction,
137
162
  ...props
138
163
  }) => {
164
+ const customLabelAction = getLabelAction(labelAction);
139
165
  const { formatMessage } = useIntl();
140
166
  const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
141
167
  const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
@@ -169,7 +195,7 @@ const VersionInputRenderer = ({
169
195
  const addedAttributes = version.meta.unknownAttributes.added;
170
196
  if (Object.keys(addedAttributes).includes(props.name)) {
171
197
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
172
- /* @__PURE__ */ jsx(FieldLabel, { children: props.label }),
198
+ /* @__PURE__ */ jsx(Field.Label, { children: props.label }),
173
199
  /* @__PURE__ */ jsx(
174
200
  StyledAlert,
175
201
  {
@@ -193,29 +219,46 @@ const VersionInputRenderer = ({
193
219
  if (attributeHasCustomFieldProperty(props.attribute)) {
194
220
  const CustomInput = lazyComponentStore[props.attribute.customField];
195
221
  if (CustomInput) {
196
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
222
+ return /* @__PURE__ */ jsx(
223
+ CustomInput,
224
+ {
225
+ ...props,
226
+ hint,
227
+ labelAction: customLabelAction,
228
+ disabled: fieldIsDisabled
229
+ }
230
+ );
197
231
  }
198
232
  return /* @__PURE__ */ jsx(
199
233
  InputRenderer,
200
234
  {
201
235
  ...props,
202
236
  hint,
237
+ labelAction: customLabelAction,
203
238
  type: props.attribute.customField,
204
239
  disabled: fieldIsDisabled
205
240
  }
206
241
  );
207
242
  }
208
243
  if (props.type === "media") {
209
- return /* @__PURE__ */ jsx(CustomMediaInput, { ...props, disabled: fieldIsDisabled });
244
+ return /* @__PURE__ */ jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
210
245
  }
211
246
  const addedInputTypes = Object.keys(fields);
212
247
  if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
213
248
  const CustomInput = fields[props.type];
214
- return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
249
+ return /* @__PURE__ */ jsx(
250
+ CustomInput,
251
+ {
252
+ ...props,
253
+ hint,
254
+ labelAction: customLabelAction,
255
+ disabled: fieldIsDisabled
256
+ }
257
+ );
215
258
  }
216
259
  switch (props.type) {
217
260
  case "blocks":
218
- return /* @__PURE__ */ jsx(BlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
261
+ return /* @__PURE__ */ jsx(MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
219
262
  case "component":
220
263
  const { layout } = componentsLayout[props.attribute.component];
221
264
  const [remainingFieldsLayout] = getRemaingFieldsLayout({
@@ -225,29 +268,65 @@ const VersionInputRenderer = ({
225
268
  schemaAttributes: components[props.attribute.component].attributes
226
269
  });
227
270
  return /* @__PURE__ */ jsx(
228
- ComponentInput,
271
+ MemoizedComponentInput,
229
272
  {
230
273
  ...props,
231
274
  layout: [...layout, ...remainingFieldsLayout || []],
232
275
  hint,
276
+ labelAction: customLabelAction,
233
277
  disabled: fieldIsDisabled,
234
278
  children: (inputProps) => /* @__PURE__ */ jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
235
279
  }
236
280
  );
237
281
  case "dynamiczone":
238
- return /* @__PURE__ */ jsx(DynamicZone, { ...props, hint, disabled: fieldIsDisabled });
282
+ return /* @__PURE__ */ jsx(
283
+ DynamicZone,
284
+ {
285
+ ...props,
286
+ hint,
287
+ labelAction: customLabelAction,
288
+ disabled: fieldIsDisabled
289
+ }
290
+ );
239
291
  case "relation":
240
- return /* @__PURE__ */ jsx(CustomRelationInput, { ...props, hint, disabled: fieldIsDisabled });
292
+ return /* @__PURE__ */ jsx(
293
+ CustomRelationInput,
294
+ {
295
+ ...props,
296
+ hint,
297
+ labelAction: customLabelAction,
298
+ disabled: fieldIsDisabled
299
+ }
300
+ );
241
301
  case "richtext":
242
- return /* @__PURE__ */ jsx(Wysiwyg, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
302
+ return /* @__PURE__ */ jsx(
303
+ MemoizedWysiwyg,
304
+ {
305
+ ...props,
306
+ hint,
307
+ type: props.type,
308
+ labelAction: customLabelAction,
309
+ disabled: fieldIsDisabled
310
+ }
311
+ );
243
312
  case "uid":
244
- return /* @__PURE__ */ jsx(UIDInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
313
+ return /* @__PURE__ */ jsx(
314
+ MemoizedUIDInput,
315
+ {
316
+ ...props,
317
+ hint,
318
+ type: props.type,
319
+ labelAction: customLabelAction,
320
+ disabled: fieldIsDisabled
321
+ }
322
+ );
245
323
  case "enumeration":
246
324
  return /* @__PURE__ */ jsx(
247
325
  InputRenderer,
248
326
  {
249
327
  ...props,
250
328
  hint,
329
+ labelAction: customLabelAction,
251
330
  options: props.attribute.enum.map((value) => ({ value })),
252
331
  type: props.customField ? "custom-field" : props.type,
253
332
  disabled: fieldIsDisabled
@@ -260,6 +339,7 @@ const VersionInputRenderer = ({
260
339
  {
261
340
  ...restProps,
262
341
  hint,
342
+ labelAction: customLabelAction,
263
343
  type: props.customField ? "custom-field" : props.type,
264
344
  disabled: fieldIsDisabled
265
345
  }
@@ -313,7 +393,7 @@ const FormPanel = ({ panel }) => {
313
393
  if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
314
394
  const [row] = panel;
315
395
  const [field] = row;
316
- return /* @__PURE__ */ jsx(Grid, { gap: 4, children: /* @__PURE__ */ jsx(GridItem, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }) }, field.name);
396
+ return /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: /* @__PURE__ */ jsx(Grid.Item, { col: 12, s: 12, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }) }, field.name);
317
397
  }
318
398
  return /* @__PURE__ */ jsx(
319
399
  Box,
@@ -326,8 +406,19 @@ const FormPanel = ({ panel }) => {
326
406
  paddingTop: 6,
327
407
  paddingBottom: 6,
328
408
  borderColor: "neutral150",
329
- 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 }) => {
330
- return /* @__PURE__ */ jsx(GridItem, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }, field.name);
409
+ children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
410
+ return /* @__PURE__ */ jsx(
411
+ Grid.Item,
412
+ {
413
+ col: size,
414
+ s: 12,
415
+ xs: 12,
416
+ direction: "column",
417
+ alignItems: "stretch",
418
+ children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field })
419
+ },
420
+ field.name
421
+ );
331
422
  }) }, gridRowIndex)) })
332
423
  }
333
424
  );
@@ -442,6 +533,7 @@ const VersionHeader = ({ headerId }) => {
442
533
  const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React.useState(false);
443
534
  const navigate = useNavigate();
444
535
  const { formatMessage, formatDate } = useIntl();
536
+ const { trackUsage } = useTracking();
445
537
  const { toggleNotification } = useNotification();
446
538
  const [{ query }] = useQueryParams();
447
539
  const { collectionType, slug } = useParams();
@@ -457,14 +549,8 @@ const VersionHeader = ({ headerId }) => {
457
549
  const mainFieldValue = version.data[mainField];
458
550
  const getNextNavigation = () => {
459
551
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
460
- if (collectionType === COLLECTION_TYPES) {
461
- return {
462
- pathname: `/content-manager/${collectionType}/${version.contentType}/${version.relatedDocumentId}`,
463
- search: pluginsQueryParams
464
- };
465
- }
466
552
  return {
467
- pathname: `/content-manager/${collectionType}/${version.contentType}`,
553
+ pathname: "..",
468
554
  search: pluginsQueryParams
469
555
  };
470
556
  };
@@ -480,7 +566,7 @@ const VersionHeader = ({ headerId }) => {
480
566
  body: { contentType: version.contentType }
481
567
  });
482
568
  if ("data" in response) {
483
- navigate(getNextNavigation());
569
+ navigate(getNextNavigation(), { relative: "path" });
484
570
  toggleNotification({
485
571
  type: "success",
486
572
  title: formatMessage({
@@ -489,9 +575,10 @@ const VersionHeader = ({ headerId }) => {
489
575
  }),
490
576
  message: formatMessage({
491
577
  id: "content-manager.restore.success.message",
492
- defaultMessage: "The content of the restored version is not published yet."
578
+ defaultMessage: "A past version of the content was restored."
493
579
  })
494
580
  });
581
+ trackUsage("didRestoreHistoryVersion");
495
582
  }
496
583
  if ("error" in response) {
497
584
  toggleNotification({
@@ -509,7 +596,7 @@ const VersionHeader = ({ headerId }) => {
509
596
  });
510
597
  }
511
598
  };
512
- return /* @__PURE__ */ jsxs(Fragment, { children: [
599
+ return /* @__PURE__ */ jsxs(Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
513
600
  /* @__PURE__ */ jsx(
514
601
  Layouts.BaseHeader,
515
602
  {
@@ -521,7 +608,7 @@ const VersionHeader = ({ headerId }) => {
521
608
  hour: "numeric",
522
609
  minute: "numeric"
523
610
  }),
524
- subtitle: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", children: formatMessage(
611
+ subtitle: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
525
612
  {
526
613
  id: "content-manager.history.version.subtitle",
527
614
  defaultMessage: "{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}"
@@ -536,8 +623,10 @@ const VersionHeader = ({ headerId }) => {
536
623
  Link,
537
624
  {
538
625
  startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
539
- as: NavLink,
626
+ tag: NavLink,
540
627
  to: getNextNavigation(),
628
+ relative: "path",
629
+ isExternal: false,
541
630
  children: formatMessage({
542
631
  id: "global.back",
543
632
  defaultMessage: "Back"
@@ -545,7 +634,7 @@ const VersionHeader = ({ headerId }) => {
545
634
  }
546
635
  ),
547
636
  sticky: false,
548
- primaryAction: /* @__PURE__ */ jsx(
637
+ primaryAction: /* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
549
638
  Button,
550
639
  {
551
640
  disabled: !allowedActions.canUpdate || isCurrentVersion,
@@ -557,16 +646,13 @@ const VersionHeader = ({ headerId }) => {
557
646
  defaultMessage: "Restore"
558
647
  })
559
648
  }
560
- )
649
+ ) })
561
650
  }
562
651
  ),
563
652
  /* @__PURE__ */ jsx(
564
653
  ConfirmDialog,
565
654
  {
566
- isOpen: isConfirmDialogOpen,
567
- onClose: () => setIsConfirmDialogOpen(false),
568
655
  onConfirm: handleRestore,
569
- icon: /* @__PURE__ */ jsx(WarningCircle, {}),
570
656
  endAction: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
571
657
  id: "content-manager.history.restore.confirm.button",
572
658
  defaultMessage: "Restore"
@@ -580,6 +666,7 @@ const VersionHeader = ({ headerId }) => {
580
666
  gap: 2,
581
667
  textAlign: "center",
582
668
  children: [
669
+ /* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
583
670
  /* @__PURE__ */ jsx(Typography, { children: formatMessage({
584
671
  id: "content-manager.history.restore.confirm.title",
585
672
  defaultMessage: "Are you sure you want to restore this version?"
@@ -600,46 +687,10 @@ const VersionHeader = ({ headerId }) => {
600
687
  )
601
688
  ] });
602
689
  };
603
- const BlueText = (children) => /* @__PURE__ */ jsx(Typography, { textColor: "primary600", children });
690
+ const BlueText = (children) => /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", children });
604
691
  const VersionCard = ({ version, isCurrent }) => {
605
692
  const { formatDate, formatMessage } = useIntl();
606
693
  const [{ query }] = useQueryParams();
607
- const statusData = (() => {
608
- switch (version.status) {
609
- case "draft":
610
- return {
611
- background: "secondary100",
612
- border: "secondary200",
613
- text: "secondary700",
614
- message: {
615
- id: "content-manager.containers.List.draft",
616
- defaultMessage: "Draft"
617
- }
618
- };
619
- case "modified":
620
- return {
621
- background: "alternative100",
622
- border: "alternative200",
623
- text: "alternative700",
624
- message: {
625
- // TODO: check the translation key once D&P v5 is done
626
- id: "content-manager.containers.List.modified",
627
- defaultMessage: "Modified"
628
- }
629
- };
630
- case "published":
631
- default:
632
- return {
633
- background: "success100",
634
- border: "success200",
635
- text: "success700",
636
- message: {
637
- id: "content-manager.containers.List.published",
638
- defaultMessage: "Published"
639
- }
640
- };
641
- }
642
- })();
643
694
  const isActive = query.id === version.id.toString();
644
695
  const author = version.createdBy && getDisplayName(version.createdBy);
645
696
  return /* @__PURE__ */ jsxs(
@@ -652,23 +703,21 @@ const VersionCard = ({ version, isCurrent }) => {
652
703
  borderWidth: "1px",
653
704
  borderStyle: "solid",
654
705
  borderColor: isActive ? "primary600" : "neutral200",
655
- paddingTop: 4,
656
- paddingBottom: 4,
657
- paddingLeft: 5,
658
- paddingRight: 5,
659
- as: Link$1,
706
+ color: "neutral800",
707
+ padding: 5,
708
+ tag: Link$1,
660
709
  to: `?${stringify({ ...query, id: version.id })}`,
661
710
  style: { textDecoration: "none" },
662
711
  children: [
663
712
  /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
664
- /* @__PURE__ */ jsx(Typography, { as: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
713
+ /* @__PURE__ */ jsx(Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
665
714
  day: "numeric",
666
715
  month: "numeric",
667
716
  year: "numeric",
668
717
  hour: "2-digit",
669
718
  minute: "2-digit"
670
719
  }) }),
671
- /* @__PURE__ */ jsx(Typography, { as: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
720
+ /* @__PURE__ */ jsx(Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
672
721
  {
673
722
  id: "content-manager.history.sidebar.versionDescription",
674
723
  defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
@@ -682,21 +731,7 @@ const VersionCard = ({ version, isCurrent }) => {
682
731
  }
683
732
  ) })
684
733
  ] }),
685
- version.status && /* @__PURE__ */ jsx(
686
- Box,
687
- {
688
- background: statusData.background,
689
- borderStyle: "solid",
690
- borderWidth: "1px",
691
- borderColor: statusData.border,
692
- hasRadius: true,
693
- paddingLeft: "6px",
694
- paddingRight: "6px",
695
- paddingTop: "2px",
696
- paddingBottom: "2px",
697
- children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", textColor: statusData.text, children: formatMessage(statusData.message) })
698
- }
699
- )
734
+ version.status && /* @__PURE__ */ jsx(DocumentStatus, { status: version.status, size: "XS" })
700
735
  ]
701
736
  }
702
737
  );
@@ -724,7 +759,7 @@ const VersionsList = () => {
724
759
  borderColor: "neutral200",
725
760
  borderWidth: "0 0 0 1px",
726
761
  borderStyle: "solid",
727
- as: "aside",
762
+ tag: "aside",
728
763
  children: [
729
764
  /* @__PURE__ */ jsxs(
730
765
  Flex,
@@ -735,9 +770,9 @@ const VersionsList = () => {
735
770
  borderColor: "neutral200",
736
771
  borderWidth: "0 0 1px",
737
772
  borderStyle: "solid",
738
- as: "header",
773
+ tag: "header",
739
774
  children: [
740
- /* @__PURE__ */ jsx(Typography, { as: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
775
+ /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
741
776
  id: "content-manager.history.sidebar.title",
742
777
  defaultMessage: "Versions"
743
778
  }) }),
@@ -750,31 +785,18 @@ const VersionsList = () => {
750
785
  id: "content-manager.history.sidebar.show-newer",
751
786
  defaultMessage: "Show newer versions"
752
787
  }) }) }),
753
- /* @__PURE__ */ jsx(
754
- Flex,
788
+ /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 3, padding: 4, tag: "ul", alignItems: "stretch", children: versions.data.map((version, index) => /* @__PURE__ */ jsx(
789
+ "li",
755
790
  {
756
- direction: "column",
757
- gap: 3,
758
- paddingTop: 5,
759
- paddingBottom: 5,
760
- paddingLeft: 4,
761
- paddingRight: 4,
762
- as: "ul",
763
- alignItems: "stretch",
764
- children: versions.data.map((version, index) => /* @__PURE__ */ jsx(
765
- "li",
766
- {
767
- "aria-label": formatMessage({
768
- id: "content-manager.history.sidebar.title.version-card.aria-label",
769
- defaultMessage: "Version card"
770
- }),
771
- children: /* @__PURE__ */ jsx(VersionCard, { version, isCurrent: page === 1 && index === 0 })
772
- },
773
- version.id
774
- ))
775
- }
776
- ),
777
- versions.meta.pagination.page < versions.meta.pagination.pageCount && /* @__PURE__ */ jsx(Box, { paddingBottom: 5, textAlign: "center", children: /* @__PURE__ */ jsx(PaginationButton, { page: page + 1, children: formatMessage({
791
+ "aria-label": formatMessage({
792
+ id: "content-manager.history.sidebar.title.version-card.aria-label",
793
+ defaultMessage: "Version card"
794
+ }),
795
+ children: /* @__PURE__ */ jsx(VersionCard, { version, isCurrent: page === 1 && index === 0 })
796
+ },
797
+ version.id
798
+ )) }),
799
+ versions.meta.pagination.page < versions.meta.pagination.pageCount && /* @__PURE__ */ jsx(Box, { paddingBottom: 4, textAlign: "center", children: /* @__PURE__ */ jsx(PaginationButton, { page: page + 1, children: formatMessage({
778
800
  id: "content-manager.history.sidebar.show-older",
779
801
  defaultMessage: "Show older versions"
780
802
  }) }) })
@@ -826,7 +848,22 @@ const HistoryPage = () => {
826
848
  return /* @__PURE__ */ jsx(Page.Loading, {});
827
849
  }
828
850
  if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
829
- return /* @__PURE__ */ jsx(Page.NoData, {});
851
+ return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
852
+ Page.NoData,
853
+ {
854
+ action: /* @__PURE__ */ jsx(
855
+ Link,
856
+ {
857
+ tag: NavLink,
858
+ to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
859
+ children: formatMessage({
860
+ id: "global.back",
861
+ defaultMessage: "Back"
862
+ })
863
+ }
864
+ )
865
+ }
866
+ ) });
830
867
  }
831
868
  if (versionsResponse.data?.data?.length && !selectedVersionId) {
832
869
  return /* @__PURE__ */ jsx(
@@ -935,4 +972,4 @@ export {
935
972
  ProtectedHistoryPage,
936
973
  useHistoryContext
937
974
  };
938
- //# sourceMappingURL=History-Dmr9fmUA.mjs.map
975
+ //# sourceMappingURL=History-D8F7aYQU.mjs.map