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

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 (198) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-y_7iLdmB.js → ComponentConfigurationPage-CpJNPBgk.js} +4 -4
  3. package/dist/_chunks/{ComponentConfigurationPage-y_7iLdmB.js.map → ComponentConfigurationPage-CpJNPBgk.js.map} +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-BMajAl1u.mjs → ComponentConfigurationPage-TYDPg5WG.mjs} +4 -4
  5. package/dist/_chunks/{ComponentConfigurationPage-BMajAl1u.mjs.map → ComponentConfigurationPage-TYDPg5WG.mjs.map} +1 -1
  6. package/dist/_chunks/{EditConfigurationPage-CPVB8Uqc.js → EditConfigurationPage-CFDe6SA1.js} +4 -4
  7. package/dist/_chunks/{EditConfigurationPage-CPVB8Uqc.js.map → EditConfigurationPage-CFDe6SA1.js.map} +1 -1
  8. package/dist/_chunks/{EditConfigurationPage-CcOoD26O.mjs → EditConfigurationPage-DqL8Pq5r.mjs} +4 -4
  9. package/dist/_chunks/{EditConfigurationPage-CcOoD26O.mjs.map → EditConfigurationPage-DqL8Pq5r.mjs.map} +1 -1
  10. package/dist/_chunks/{EditViewPage-DWb0DE7R.mjs → EditViewPage-RXrFLav2.mjs} +69 -48
  11. package/dist/_chunks/EditViewPage-RXrFLav2.mjs.map +1 -0
  12. package/dist/_chunks/{EditViewPage-CTTDHKkQ.js → EditViewPage-khfP2CR3.js} +68 -47
  13. package/dist/_chunks/EditViewPage-khfP2CR3.js.map +1 -0
  14. package/dist/_chunks/{Field-DnStdvQw.mjs → Field--rQeS6Zj.mjs} +580 -228
  15. package/dist/_chunks/Field--rQeS6Zj.mjs.map +1 -0
  16. package/dist/_chunks/{Field-C5Z1Ivdv.js → Field-C1ftmTe9.js} +582 -230
  17. package/dist/_chunks/Field-C1ftmTe9.js.map +1 -0
  18. package/dist/_chunks/{Form-DqGgE55Q.mjs → Form-COtGXyUE.mjs} +54 -36
  19. package/dist/_chunks/Form-COtGXyUE.mjs.map +1 -0
  20. package/dist/_chunks/{Form-B81OtW-k.js → Form-CwdX5oLw.js} +52 -34
  21. package/dist/_chunks/Form-CwdX5oLw.js.map +1 -0
  22. package/dist/_chunks/{History-DS6-HCYX.mjs → History-BevwkPO1.mjs} +83 -63
  23. package/dist/_chunks/History-BevwkPO1.mjs.map +1 -0
  24. package/dist/_chunks/{History-4NbOq2dX.js → History-DKS2aqqM.js} +82 -62
  25. package/dist/_chunks/History-DKS2aqqM.js.map +1 -0
  26. package/dist/_chunks/{ListConfigurationPage-DQJJltko.mjs → ListConfigurationPage-DNfZDtDA.mjs} +59 -49
  27. package/dist/_chunks/ListConfigurationPage-DNfZDtDA.mjs.map +1 -0
  28. package/dist/_chunks/{ListConfigurationPage-CpfstlYY.js → ListConfigurationPage-LSYSPZHH.js} +58 -47
  29. package/dist/_chunks/ListConfigurationPage-LSYSPZHH.js.map +1 -0
  30. package/dist/_chunks/{ListViewPage-nQrOQuVo.mjs → ListViewPage-C1PyuYRS.mjs} +115 -103
  31. package/dist/_chunks/ListViewPage-C1PyuYRS.mjs.map +1 -0
  32. package/dist/_chunks/{ListViewPage-CA3I75m5.js → ListViewPage-DlUpqLIo.js} +117 -105
  33. package/dist/_chunks/ListViewPage-DlUpqLIo.js.map +1 -0
  34. package/dist/_chunks/{NoContentTypePage-DbnHE22g.mjs → NoContentTypePage-C9q744z1.mjs} +2 -2
  35. package/dist/_chunks/{NoContentTypePage-DbnHE22g.mjs.map → NoContentTypePage-C9q744z1.mjs.map} +1 -1
  36. package/dist/_chunks/{NoContentTypePage-Dldu-_Mx.js → NoContentTypePage-m8wt3sf6.js} +2 -2
  37. package/dist/_chunks/{NoContentTypePage-Dldu-_Mx.js.map → NoContentTypePage-m8wt3sf6.js.map} +1 -1
  38. package/dist/_chunks/{NoPermissionsPage-fOIkQM0v.mjs → NoPermissionsPage-8BM-LWta.mjs} +2 -2
  39. package/dist/_chunks/{NoPermissionsPage-fOIkQM0v.mjs.map → NoPermissionsPage-8BM-LWta.mjs.map} +1 -1
  40. package/dist/_chunks/{NoPermissionsPage-CO2MK200.js → NoPermissionsPage-DLfPsA0Q.js} +2 -2
  41. package/dist/_chunks/{NoPermissionsPage-CO2MK200.js.map → NoPermissionsPage-DLfPsA0Q.js.map} +1 -1
  42. package/dist/_chunks/{Relations-BDRl99Ux.mjs → Relations-D25xRcFy.mjs} +73 -37
  43. package/dist/_chunks/Relations-D25xRcFy.mjs.map +1 -0
  44. package/dist/_chunks/{Relations-DG2jnOcr.js → Relations-OMriCP_L.js} +72 -36
  45. package/dist/_chunks/Relations-OMriCP_L.js.map +1 -0
  46. package/dist/_chunks/{en-fbKQxLGn.js → en-Bdpa50w3.js} +22 -16
  47. package/dist/_chunks/{en-fbKQxLGn.js.map → en-Bdpa50w3.js.map} +1 -1
  48. package/dist/_chunks/{en-Ux26r5pl.mjs → en-CZw4xdPY.mjs} +22 -16
  49. package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-CZw4xdPY.mjs.map} +1 -1
  50. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  51. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  52. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  53. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  54. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  55. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  56. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  57. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  58. package/dist/_chunks/{index-Drt2DN7v.mjs → index-BvGihCJp.mjs} +1116 -858
  59. package/dist/_chunks/index-BvGihCJp.mjs.map +1 -0
  60. package/dist/_chunks/{index-BZoNZMXL.js → index-DqZnjo8F.js} +1107 -848
  61. package/dist/_chunks/index-DqZnjo8F.js.map +1 -0
  62. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  63. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  64. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  65. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  66. package/dist/_chunks/{layout-DEYBqgF1.js → layout-CmaemAO3.js} +25 -12
  67. package/dist/_chunks/layout-CmaemAO3.js.map +1 -0
  68. package/dist/_chunks/{layout-BzAbmoO6.mjs → layout-ykHSe2KQ.mjs} +27 -14
  69. package/dist/_chunks/layout-ykHSe2KQ.mjs.map +1 -0
  70. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  71. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  72. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  73. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  74. package/dist/_chunks/{relations-D0eZ4VWw.js → relations-D9fKsCLY.js} +3 -7
  75. package/dist/_chunks/relations-D9fKsCLY.js.map +1 -0
  76. package/dist/_chunks/{relations-D26zVRdi.mjs → relations-u-Vz51Ea.mjs} +3 -7
  77. package/dist/_chunks/relations-u-Vz51Ea.mjs.map +1 -0
  78. package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
  79. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
  80. package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
  81. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
  82. package/dist/admin/index.js +2 -1
  83. package/dist/admin/index.js.map +1 -1
  84. package/dist/admin/index.mjs +3 -2
  85. package/dist/admin/src/exports.d.ts +1 -1
  86. package/dist/admin/src/history/index.d.ts +3 -0
  87. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  88. package/dist/admin/src/hooks/useDocument.d.ts +32 -1
  89. package/dist/admin/src/index.d.ts +1 -0
  90. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +8 -3
  91. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  92. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  93. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
  94. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
  95. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +6 -58
  96. package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
  97. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  98. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  99. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  100. package/dist/admin/src/preview/constants.d.ts +1 -0
  101. package/dist/admin/src/preview/index.d.ts +4 -0
  102. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  103. package/dist/admin/src/services/api.d.ts +1 -1
  104. package/dist/admin/src/services/components.d.ts +2 -2
  105. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  106. package/dist/admin/src/services/documents.d.ts +19 -17
  107. package/dist/admin/src/services/init.d.ts +1 -1
  108. package/dist/admin/src/services/relations.d.ts +2 -2
  109. package/dist/admin/src/services/uid.d.ts +3 -3
  110. package/dist/admin/src/utils/validation.d.ts +4 -1
  111. package/dist/server/index.js +551 -266
  112. package/dist/server/index.js.map +1 -1
  113. package/dist/server/index.mjs +552 -267
  114. package/dist/server/index.mjs.map +1 -1
  115. package/dist/server/src/bootstrap.d.ts.map +1 -1
  116. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  117. package/dist/server/src/controllers/index.d.ts.map +1 -1
  118. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  119. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  120. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  121. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  122. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  123. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  124. package/dist/server/src/history/services/history.d.ts.map +1 -1
  125. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  126. package/dist/server/src/history/services/utils.d.ts +4 -4
  127. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  128. package/dist/server/src/index.d.ts +4 -4
  129. package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
  130. package/dist/server/src/preview/constants.d.ts +2 -0
  131. package/dist/server/src/preview/constants.d.ts.map +1 -0
  132. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  133. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  134. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  135. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  136. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  137. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  138. package/dist/server/src/preview/index.d.ts +4 -0
  139. package/dist/server/src/preview/index.d.ts.map +1 -0
  140. package/dist/server/src/preview/routes/index.d.ts +8 -0
  141. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  142. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  143. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  144. package/dist/server/src/preview/services/index.d.ts +15 -0
  145. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  146. package/dist/server/src/preview/services/preview-config.d.ts +30 -0
  147. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  148. package/dist/server/src/preview/services/preview.d.ts +12 -0
  149. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  150. package/dist/server/src/preview/utils.d.ts +18 -0
  151. package/dist/server/src/preview/utils.d.ts.map +1 -0
  152. package/dist/server/src/routes/index.d.ts.map +1 -1
  153. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  154. package/dist/server/src/services/document-metadata.d.ts +8 -8
  155. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  156. package/dist/server/src/services/index.d.ts +4 -4
  157. package/dist/server/src/services/index.d.ts.map +1 -1
  158. package/dist/server/src/services/permission-checker.d.ts.map +1 -1
  159. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  160. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  161. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  162. package/dist/server/src/utils/index.d.ts +2 -0
  163. package/dist/server/src/utils/index.d.ts.map +1 -1
  164. package/dist/shared/contracts/collection-types.d.ts +3 -1
  165. package/dist/shared/contracts/collection-types.d.ts.map +1 -1
  166. package/dist/shared/contracts/index.d.ts +1 -0
  167. package/dist/shared/contracts/index.d.ts.map +1 -1
  168. package/dist/shared/contracts/preview.d.ts +27 -0
  169. package/dist/shared/contracts/preview.d.ts.map +1 -0
  170. package/dist/shared/index.js +4 -0
  171. package/dist/shared/index.js.map +1 -1
  172. package/dist/shared/index.mjs +4 -0
  173. package/dist/shared/index.mjs.map +1 -1
  174. package/package.json +13 -13
  175. package/dist/_chunks/EditViewPage-CTTDHKkQ.js.map +0 -1
  176. package/dist/_chunks/EditViewPage-DWb0DE7R.mjs.map +0 -1
  177. package/dist/_chunks/Field-C5Z1Ivdv.js.map +0 -1
  178. package/dist/_chunks/Field-DnStdvQw.mjs.map +0 -1
  179. package/dist/_chunks/Form-B81OtW-k.js.map +0 -1
  180. package/dist/_chunks/Form-DqGgE55Q.mjs.map +0 -1
  181. package/dist/_chunks/History-4NbOq2dX.js.map +0 -1
  182. package/dist/_chunks/History-DS6-HCYX.mjs.map +0 -1
  183. package/dist/_chunks/ListConfigurationPage-CpfstlYY.js.map +0 -1
  184. package/dist/_chunks/ListConfigurationPage-DQJJltko.mjs.map +0 -1
  185. package/dist/_chunks/ListViewPage-CA3I75m5.js.map +0 -1
  186. package/dist/_chunks/ListViewPage-nQrOQuVo.mjs.map +0 -1
  187. package/dist/_chunks/Relations-BDRl99Ux.mjs.map +0 -1
  188. package/dist/_chunks/Relations-DG2jnOcr.js.map +0 -1
  189. package/dist/_chunks/index-BZoNZMXL.js.map +0 -1
  190. package/dist/_chunks/index-Drt2DN7v.mjs.map +0 -1
  191. package/dist/_chunks/layout-BzAbmoO6.mjs.map +0 -1
  192. package/dist/_chunks/layout-DEYBqgF1.js.map +0 -1
  193. package/dist/_chunks/relations-D0eZ4VWw.js.map +0 -1
  194. package/dist/_chunks/relations-D26zVRdi.mjs.map +0 -1
  195. package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
  196. package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
  197. package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
  198. package/strapi-server.js +0 -3
@@ -0,0 +1 @@
1
+ {"version":3,"file":"History-BevwkPO1.mjs","sources":["../../admin/src/history/components/VersionInputRenderer.tsx","../../admin/src/history/components/VersionContent.tsx","../../admin/src/history/services/historyVersion.ts","../../admin/src/history/components/VersionHeader.tsx","../../admin/src/history/components/VersionsList.tsx","../../admin/src/history/pages/History.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useStrapiApp,\n useForm,\n InputRenderer as FormInputRenderer,\n useField,\n Form,\n} from '@strapi/admin/strapi-admin';\nimport { Alert, Box, Field, Flex, Link, Tooltip, Typography } from '@strapi/design-system';\nimport { useIntl } from 'react-intl';\nimport { NavLink } from 'react-router-dom';\nimport { styled } from 'styled-components';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { useDocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDoc } from '../../hooks/useDocument';\nimport { useDocLayout } from '../../hooks/useDocumentLayout';\nimport { useLazyComponents } from '../../hooks/useLazyComponents';\nimport { useTypedSelector } from '../../modules/hooks';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\nimport { BlocksInput } from '../../pages/EditView/components/FormInputs/BlocksInput/BlocksInput';\nimport { ComponentInput } from '../../pages/EditView/components/FormInputs/Component/Input';\nimport {\n DynamicZone,\n useDynamicZone,\n} from '../../pages/EditView/components/FormInputs/DynamicZone/Field';\nimport { NotAllowedInput } from '../../pages/EditView/components/FormInputs/NotAllowed';\nimport { UIDInput } from '../../pages/EditView/components/FormInputs/UID';\nimport { Wysiwyg } from '../../pages/EditView/components/FormInputs/Wysiwyg/Field';\nimport { useFieldHint } from '../../pages/EditView/components/InputRenderer';\nimport { getRelationLabel } from '../../utils/relations';\nimport { useHistoryContext } from '../pages/History';\n\nimport { getRemaingFieldsLayout } from './VersionContent';\n\nimport type { EditFieldLayout } from '../../hooks/useDocumentLayout';\nimport type { RelationsFieldProps } from '../../pages/EditView/components/FormInputs/Relations';\nimport type { RelationResult } from '../../services/relations';\nimport type { Schema } from '@strapi/types';\nimport type { DistributiveOmit } from 'react-redux';\n\nconst StyledAlert = styled(Alert).attrs({ closeLabel: 'Close', onClose: () => {}, shadow: 'none' })`\n button {\n display: none;\n }\n`;\n\n/* -------------------------------------------------------------------------------------------------\n * CustomRelationInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst LinkEllipsis = styled(Link)`\n display: block;\n\n & > span {\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n display: block;\n }\n`;\n\nconst CustomRelationInput = (props: RelationsFieldProps) => {\n const { formatMessage } = useIntl();\n const field = useField<\n { results: RelationResult[]; meta: { missingCount: number } } | RelationResult[]\n >(props.name);\n\n /**\n * Ideally the server would return the correct shape, however, for admin user relations\n * it sanitizes everything out when it finds an object for the relation value.\n */\n let formattedFieldValue;\n if (field) {\n formattedFieldValue = Array.isArray(field.value)\n ? { results: field.value, meta: { missingCount: 0 } }\n : field.value;\n }\n\n if (\n !formattedFieldValue ||\n (formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0)\n ) {\n return (\n <>\n <Field.Label action={props.labelAction}>{props.label}</Field.Label>\n <Box marginTop={1}>\n {/* @ts-expect-error – we dont need closeLabel */}\n <StyledAlert variant=\"default\">\n {formatMessage({\n id: 'content-manager.history.content.no-relations',\n defaultMessage: 'No relations.',\n })}\n </StyledAlert>\n </Box>\n </>\n );\n }\n\n const { results, meta } = formattedFieldValue;\n\n return (\n <Box>\n <Field.Label>{props.label}</Field.Label>\n {results.length > 0 && (\n <Flex direction=\"column\" gap={2} marginTop={1} alignItems=\"stretch\">\n {results.map((relationData) => {\n // @ts-expect-error - targetModel does exist on the attribute. But it's not typed.\n const { targetModel } = props.attribute;\n const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;\n const label = getRelationLabel(relationData, props.mainField);\n const isAdminUserRelation = targetModel === 'admin::user';\n\n return (\n <Flex\n key={relationData.documentId ?? relationData.id}\n paddingTop={2}\n paddingBottom={2}\n paddingLeft={4}\n paddingRight={4}\n hasRadius\n borderColor=\"neutral200\"\n background=\"neutral150\"\n justifyContent=\"space-between\"\n >\n <Box minWidth={0} paddingTop={1} paddingBottom={1} paddingRight={4}>\n <Tooltip label={label}>\n {isAdminUserRelation ? (\n <Typography>{label}</Typography>\n ) : (\n <LinkEllipsis tag={NavLink} to={href}>\n {label}\n </LinkEllipsis>\n )}\n </Tooltip>\n </Box>\n <DocumentStatus status={relationData.status as string} />\n </Flex>\n );\n })}\n </Flex>\n )}\n {meta.missingCount > 0 && (\n /* @ts-expect-error – we dont need closeLabel */\n <StyledAlert\n marginTop={1}\n variant=\"warning\"\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.title',\n defaultMessage:\n '{number, plural, =1 {Missing relation} other {{number} missing relations}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-relations.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * CustomMediaInput\n * -----------------------------------------------------------------------------------------------*/\n\nconst CustomMediaInput = (props: VersionInputRendererProps) => {\n const { value } = useField(props.name);\n const results = value ? value.results : [];\n const meta = value ? value.meta : { missingCount: 0 };\n const { formatMessage } = useIntl();\n\n const fields = useStrapiApp('CustomMediaInput', (state) => state.fields);\n const MediaLibrary = fields.media as React.ComponentType<\n VersionInputRendererProps & { multiple: boolean }\n >;\n return (\n <Flex direction=\"column\" gap={2} alignItems=\"stretch\">\n <Form method=\"PUT\" disabled={true} initialValues={{ [props.name]: results }}>\n <MediaLibrary {...props} disabled={true} multiple={results.length > 1} />\n </Form>\n {meta.missingCount > 0 && (\n <StyledAlert\n variant=\"warning\"\n closeLabel=\"Close\"\n onClose={() => {}}\n title={formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.title',\n defaultMessage:\n '{number, plural, =1 {Missing asset} other {{number} missing assets}}',\n },\n { number: meta.missingCount }\n )}\n >\n {formatMessage(\n {\n id: 'content-manager.history.content.missing-assets.message',\n defaultMessage:\n \"{number, plural, =1 {It has} other {They have}} been deleted in the Media Library and can't be restored.\",\n },\n { number: meta.missingCount }\n )}\n </StyledAlert>\n )}\n </Flex>\n );\n};\n\ntype VersionInputRendererProps = DistributiveOmit<EditFieldLayout, 'size'> & {\n /**\n * In the context of content history, deleted fields need to ignore RBAC\n * @default false\n */\n shouldIgnoreRBAC?: boolean;\n};\n\n/**\n * Checks if the i18n plugin added a label action to the field and modifies it\n * to adapt the wording for the history page.\n */\nconst getLabelAction = (labelAction: VersionInputRendererProps['labelAction']) => {\n if (!React.isValidElement(labelAction)) {\n return labelAction;\n }\n\n // TODO: find a better way to do this rather than access internals\n const labelActionTitleId = labelAction.props.title.id;\n\n if (labelActionTitleId === 'i18n.Field.localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.localized',\n defaultMessage:\n 'This value is specific to this locale. If you restore this version, the content will not be replaced for other locales.',\n },\n });\n }\n\n if (labelActionTitleId === 'i18n.Field.not-localized') {\n return React.cloneElement(labelAction, {\n ...labelAction.props,\n title: {\n id: 'history.content.not-localized',\n defaultMessage:\n 'This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales.',\n },\n });\n }\n\n // Label action is unrelated to i18n, don't touch it.\n return labelAction;\n};\n\n/**\n * @internal\n *\n * @description An abstraction around the regular form input renderer designed specifically\n * to be used on the History page in the content-manager. It understands how to render specific\n * inputs within the context of a history version (i.e. relations, media, ignored RBAC, etc...)\n */\nconst VersionInputRenderer = ({\n visible,\n hint: providedHint,\n shouldIgnoreRBAC = false,\n labelAction,\n ...props\n}: VersionInputRendererProps) => {\n const customLabelAction = getLabelAction(labelAction);\n\n const { formatMessage } = useIntl();\n const version = useHistoryContext('VersionContent', (state) => state.selectedVersion);\n const configuration = useHistoryContext('VersionContent', (state) => state.configuration);\n const fieldSizes = useTypedSelector((state) => state['content-manager'].app.fieldSizes);\n\n const { id, components } = useDoc();\n const isFormDisabled = useForm('InputRenderer', (state) => state.disabled);\n\n const isInDynamicZone = useDynamicZone('isInDynamicZone', (state) => state.isInDynamicZone);\n\n const canCreateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canCreateFields);\n const canReadFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canReadFields);\n const canUpdateFields = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUpdateFields);\n const canUserAction = useDocumentRBAC('InputRenderer', (rbac) => rbac.canUserAction);\n\n const editableFields = id ? canUpdateFields : canCreateFields;\n const readableFields = id ? canReadFields : canCreateFields;\n /**\n * Component fields are always readable and editable,\n * however the fields within them may not be.\n */\n const canUserReadField = canUserAction(props.name, readableFields, props.type);\n const canUserEditField = canUserAction(props.name, editableFields, props.type);\n\n const fields = useStrapiApp('InputRenderer', (app) => app.fields);\n const { lazyComponentStore } = useLazyComponents(\n attributeHasCustomFieldProperty(props.attribute) ? [props.attribute.customField] : undefined\n );\n\n const hint = useFieldHint(providedHint, props.attribute);\n const {\n edit: { components: componentsLayout },\n } = useDocLayout();\n\n if (!visible) {\n return null;\n }\n\n /**\n * Don't render the field if the user can't read it.\n */\n if (!shouldIgnoreRBAC && !canUserReadField && !isInDynamicZone) {\n return <NotAllowedInput hint={hint} {...props} />;\n }\n\n const fieldIsDisabled =\n (!canUserEditField && !isInDynamicZone) || props.disabled || isFormDisabled;\n\n /**\n * Attributes found on the current content-type schema cannot be restored. We handle\n * this by displaying a warning alert to the user instead of the input for that field type.\n */\n const addedAttributes = version.meta.unknownAttributes.added;\n if (Object.keys(addedAttributes).includes(props.name)) {\n return (\n <Flex direction=\"column\" alignItems=\"flex-start\" gap={1}>\n <Field.Label>{props.label}</Field.Label>\n <StyledAlert\n width=\"100%\"\n closeLabel=\"Close\"\n onClose={() => {}}\n variant=\"warning\"\n title={formatMessage({\n id: 'content-manager.history.content.new-field.title',\n defaultMessage: 'New field',\n })}\n >\n {formatMessage({\n id: 'content-manager.history.content.new-field.message',\n defaultMessage:\n \"This field didn't exist when this version was saved. If you restore this version, it will be empty.\",\n })}\n </StyledAlert>\n </Flex>\n );\n }\n\n /**\n * Because a custom field has a unique prop but the type could be confused with either\n * the useField hook or the type of the field we need to handle it separately and first.\n */\n if (attributeHasCustomFieldProperty(props.attribute)) {\n const CustomInput = lazyComponentStore[props.attribute.customField];\n\n if (CustomInput) {\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – this workaround lets us display that the custom field is missing.\n type={props.attribute.customField}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * Since media fields use a custom input via the upload plugin provided by the useLibrary hook,\n * we need to handle the them before other custom inputs coming from the useLibrary hook.\n */\n if (props.type === 'media') {\n return (\n <CustomMediaInput {...props} labelAction={customLabelAction} disabled={fieldIsDisabled} />\n );\n }\n /**\n * This is where we handle ONLY the fields from the `useLibrary` hook.\n */\n const addedInputTypes = Object.keys(fields);\n if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {\n const CustomInput = fields[props.type];\n return (\n <CustomInput\n {...props}\n // @ts-expect-error – TODO: fix this type error in the useLibrary hook.\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n }\n\n /**\n * These include the content-manager specific fields, failing that we fall back\n * to the more generic form input renderer.\n */\n switch (props.type) {\n case 'blocks':\n return <BlocksInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'component':\n const { layout } = componentsLayout[props.attribute.component];\n // Components can only have one panel, so only save the first layout item\n const [remainingFieldsLayout] = getRemaingFieldsLayout({\n layout: [layout],\n metadatas: configuration.components[props.attribute.component].metadatas,\n fieldSizes,\n schemaAttributes: components[props.attribute.component].attributes,\n });\n\n return (\n <ComponentInput\n {...props}\n layout={[...layout, ...(remainingFieldsLayout || [])]}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </ComponentInput>\n );\n case 'dynamiczone':\n return (\n <DynamicZone\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'relation':\n return (\n <CustomRelationInput\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'richtext':\n return (\n <Wysiwyg\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n case 'uid':\n return (\n <UIDInput\n {...props}\n hint={hint}\n type={props.type}\n labelAction={customLabelAction}\n disabled={fieldIsDisabled}\n />\n );\n /**\n * Enumerations are a special case because they require options.\n */\n case 'enumeration':\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\n labelAction={customLabelAction}\n options={props.attribute.enum.map((value) => ({ value }))}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n default:\n // These props are not needed for the generic form input renderer.\n const { unique: _unique, mainField: _mainField, ...restProps } = props;\n return (\n <FormInputRenderer\n {...restProps}\n hint={hint}\n labelAction={customLabelAction}\n // @ts-expect-error – Temp workaround so we don't forget custom-fields don't work!\n type={props.customField ? 'custom-field' : props.type}\n disabled={fieldIsDisabled}\n />\n );\n }\n};\n\nconst attributeHasCustomFieldProperty = (\n attribute: Schema.Attribute.AnyAttribute\n): attribute is Schema.Attribute.AnyAttribute & Schema.Attribute.CustomField<string> =>\n 'customField' in attribute && typeof attribute.customField === 'string';\n\nexport type { VersionInputRendererProps };\nexport { VersionInputRenderer };\n","import * as React from 'react';\n\nimport { Form, Layouts } from '@strapi/admin/strapi-admin';\nimport { Box, Divider, Flex, Grid, Typography } from '@strapi/design-system';\nimport { Schema } from '@strapi/types';\nimport pipe from 'lodash/fp/pipe';\nimport { useIntl } from 'react-intl';\n\nimport { useDoc } from '../../hooks/useDocument';\nimport { useTypedSelector } from '../../modules/hooks';\nimport {\n prepareTempKeys,\n removeFieldsThatDontExistOnSchema,\n} from '../../pages/EditView/utils/data';\nimport { HistoryContextValue, useHistoryContext } from '../pages/History';\n\nimport { VersionInputRenderer } from './VersionInputRenderer';\n\nimport type { Metadatas } from '../../../../shared/contracts/content-types';\nimport type { GetInitData } from '../../../../shared/contracts/init';\nimport type { ComponentsDictionary, Document } from '../../hooks/useDocument';\nimport type { EditFieldLayout } from '../../hooks/useDocumentLayout';\n\nconst createLayoutFromFields = <T extends EditFieldLayout | UnknownField>(fields: T[]) => {\n return (\n fields\n .reduce<Array<T[]>>((rows, field) => {\n if (field.type === 'dynamiczone') {\n // Dynamic zones take up all the columns in a row\n rows.push([field]);\n\n return rows;\n }\n\n if (!rows[rows.length - 1]) {\n // Create a new row if there isn't one available\n rows.push([]);\n }\n\n // Push fields to the current row, they wrap and handle their own column size\n rows[rows.length - 1].push(field);\n\n return rows;\n }, [])\n // Map the rows to panels\n .map((row) => [row])\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * getRemainingFieldsLayout\n * -----------------------------------------------------------------------------------------------*/\n\ninterface GetRemainingFieldsLayoutOptions\n extends Pick<HistoryContextValue, 'layout'>,\n Pick<GetInitData.Response['data'], 'fieldSizes'> {\n schemaAttributes: HistoryContextValue['schema']['attributes'];\n metadatas: Metadatas;\n}\n\n/**\n * Build a layout for the fields that are were deleted from the edit view layout\n * via the configure the view page. This layout will be merged with the main one.\n * Those fields would be restored if the user restores the history version, which is why it's\n * important to show them, even if they're not in the normal layout.\n */\nfunction getRemaingFieldsLayout({\n layout,\n metadatas,\n schemaAttributes,\n fieldSizes,\n}: GetRemainingFieldsLayoutOptions) {\n const fieldsInLayout = layout.flatMap((panel) =>\n panel.flatMap((row) => row.flatMap((field) => field.name))\n );\n const remainingFields = Object.entries(metadatas).reduce<EditFieldLayout[]>(\n (currentRemainingFields, [name, field]) => {\n // Make sure we do not fields that are not visible, e.g. \"id\"\n if (!fieldsInLayout.includes(name) && field.edit.visible === true) {\n const attribute = schemaAttributes[name];\n // @ts-expect-error not sure why attribute causes type error\n currentRemainingFields.push({\n attribute,\n type: attribute.type,\n visible: true,\n disabled: true,\n label: field.edit.label || name,\n name: name,\n size: fieldSizes[attribute.type].default ?? 12,\n });\n }\n\n return currentRemainingFields;\n },\n []\n );\n\n return createLayoutFromFields(remainingFields);\n}\n\n/* -------------------------------------------------------------------------------------------------\n * FormPanel\n * -----------------------------------------------------------------------------------------------*/\n\nconst FormPanel = ({ panel }: { panel: EditFieldLayout[][] }) => {\n if (panel.some((row) => row.some((field) => field.type === 'dynamiczone'))) {\n const [row] = panel;\n const [field] = row;\n\n return (\n <Grid.Root key={field.name} gap={4}>\n <Grid.Item col={12} s={12} xs={12} direction=\"column\" alignItems=\"stretch\">\n <VersionInputRenderer {...field} />\n </Grid.Item>\n </Grid.Root>\n );\n }\n\n return (\n <Box\n hasRadius\n background=\"neutral0\"\n shadow=\"tableShadow\"\n paddingLeft={6}\n paddingRight={6}\n paddingTop={6}\n paddingBottom={6}\n borderColor=\"neutral150\"\n >\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6}>\n {panel.map((row, gridRowIndex) => (\n <Grid.Root key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n return (\n <Grid.Item\n col={size}\n key={field.name}\n s={12}\n xs={12}\n direction=\"column\"\n alignItems=\"stretch\"\n >\n <VersionInputRenderer {...field} />\n </Grid.Item>\n );\n })}\n </Grid.Root>\n ))}\n </Flex>\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * VersionContent\n * -----------------------------------------------------------------------------------------------*/\n\ntype UnknownField = EditFieldLayout & { shouldIgnoreRBAC: boolean };\n\nconst VersionContent = () => {\n const { formatMessage } = useIntl();\n const { fieldSizes } = useTypedSelector((state) => state['content-manager'].app);\n const version = useHistoryContext('VersionContent', (state) => state.selectedVersion);\n const layout = useHistoryContext('VersionContent', (state) => state.layout);\n const configuration = useHistoryContext('VersionContent', (state) => state.configuration);\n const schema = useHistoryContext('VersionContent', (state) => state.schema);\n\n // Build a layout for the unknown fields section\n const removedAttributes = version.meta.unknownAttributes.removed;\n const removedAttributesAsFields = Object.entries(removedAttributes).map(\n ([attributeName, attribute]) => {\n const field = {\n attribute,\n shouldIgnoreRBAC: true,\n type: attribute.type,\n visible: true,\n disabled: true,\n label: attributeName,\n name: attributeName,\n size: fieldSizes[attribute.type].default ?? 12,\n } as UnknownField;\n\n return field;\n }\n );\n const unknownFieldsLayout = createLayoutFromFields(removedAttributesAsFields);\n\n // Build a layout for the fields that are were deleted from the layout\n const remainingFieldsLayout = getRemaingFieldsLayout({\n metadatas: configuration.contentType.metadatas,\n layout,\n schemaAttributes: schema.attributes,\n fieldSizes,\n });\n\n const { components } = useDoc();\n\n /**\n * Transform the data before passing it to the form so that each field\n * has a uniquely generated key\n */\n const transformedData = React.useMemo(() => {\n const transform =\n (schemaAttributes: Schema.Attributes, components: ComponentsDictionary = {}) =>\n (document: Omit<Document, 'id'>) => {\n const schema = { attributes: schemaAttributes };\n const transformations = pipe(\n removeFieldsThatDontExistOnSchema(schema),\n prepareTempKeys(schema, components)\n );\n return transformations(document);\n };\n\n return transform(version.schema, components)(version.data);\n }, [components, version.data, version.schema]);\n\n return (\n <Layouts.Content>\n <Box paddingBottom={8}>\n <Form disabled={true} method=\"PUT\" initialValues={transformedData}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6} position=\"relative\">\n {[...layout, ...remainingFieldsLayout].map((panel, index) => {\n return <FormPanel key={index} panel={panel} />;\n })}\n </Flex>\n </Form>\n </Box>\n {removedAttributesAsFields.length > 0 && (\n <>\n <Divider />\n <Box paddingTop={8}>\n <Flex direction=\"column\" alignItems=\"flex-start\" paddingBottom={6} gap={1}>\n <Typography variant=\"delta\">\n {formatMessage({\n id: 'content-manager.history.content.unknown-fields.title',\n defaultMessage: 'Unknown fields',\n })}\n </Typography>\n <Typography variant=\"pi\">\n {formatMessage(\n {\n id: 'content-manager.history.content.unknown-fields.message',\n defaultMessage:\n 'These fields have been deleted or renamed in the Content-Type Builder. <b>These fields will not be restored.</b>',\n },\n {\n b: (chunks: React.ReactNode) => (\n <Typography variant=\"pi\" fontWeight=\"bold\">\n {chunks}\n </Typography>\n ),\n }\n )}\n </Typography>\n </Flex>\n <Form disabled={true} method=\"PUT\" initialValues={version.data}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6} position=\"relative\">\n {unknownFieldsLayout.map((panel, index) => {\n return <FormPanel key={index} panel={panel} />;\n })}\n </Flex>\n </Form>\n </Box>\n </>\n )}\n </Layouts.Content>\n );\n};\n\nexport { VersionContent, getRemaingFieldsLayout };\n","import { Data } from '@strapi/types';\n\nimport {\n GetHistoryVersions,\n RestoreHistoryVersion,\n} from '../../../../shared/contracts/history-versions';\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { contentManagerApi } from '../../services/api';\n\ninterface RestoreVersion extends RestoreHistoryVersion.Request {\n documentId: Data.ID;\n collectionType?: string;\n}\n\nconst historyVersionsApi = contentManagerApi.injectEndpoints({\n endpoints: (builder) => ({\n getHistoryVersions: builder.query<\n GetHistoryVersions.Response,\n GetHistoryVersions.Request['query']\n >({\n query(params) {\n return {\n url: `/content-manager/history-versions`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n providesTags: ['HistoryVersion'],\n }),\n restoreVersion: builder.mutation<RestoreHistoryVersion.Response, RestoreVersion>({\n query({ params, body }) {\n return {\n url: `/content-manager/history-versions/${params.versionId}/restore`,\n method: 'PUT',\n data: body,\n };\n },\n invalidatesTags: (_res, _error, { documentId, collectionType, params }) => {\n return [\n 'HistoryVersion',\n {\n type: 'Document',\n id:\n collectionType === COLLECTION_TYPES\n ? `${params.contentType}_${documentId}`\n : params.contentType,\n },\n ];\n },\n }),\n }),\n});\n\nconst { useGetHistoryVersionsQuery, useRestoreVersionMutation } = historyVersionsApi;\n\nexport { useGetHistoryVersionsQuery, useRestoreVersionMutation };\n","import * as React from 'react';\n\nimport {\n ConfirmDialog,\n useNotification,\n useQueryParams,\n useRBAC,\n Layouts,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Typography, Flex, Link, Dialog } from '@strapi/design-system';\nimport { ArrowLeft, WarningCircle } from '@strapi/icons';\nimport { UID } from '@strapi/types';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { NavLink, useNavigate, useParams, type To } from 'react-router-dom';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { useHistoryContext } from '../pages/History';\nimport { useRestoreVersionMutation } from '../services/historyVersion';\n\ninterface VersionHeaderProps {\n headerId: string;\n}\n\nexport const VersionHeader = ({ headerId }: VersionHeaderProps) => {\n const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React.useState(false);\n const navigate = useNavigate();\n const { formatMessage, formatDate } = useIntl();\n const { toggleNotification } = useNotification();\n const [{ query }] = useQueryParams<{\n plugins?: Record<string, unknown>;\n }>();\n const { collectionType, slug } = useParams<{ collectionType: string; slug: UID.ContentType }>();\n const [restoreVersion, { isLoading }] = useRestoreVersionMutation();\n const { allowedActions } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));\n\n const version = useHistoryContext('VersionHeader', (state) => state.selectedVersion);\n const mainField = useHistoryContext('VersionHeader', (state) => state.mainField);\n const schema = useHistoryContext('VersionHeader', (state) => state.schema);\n const isCurrentVersion = useHistoryContext(\n 'VersionHeader',\n (state) => state.page === 1 && state.versions.data[0].id === state.selectedVersion.id\n );\n\n const mainFieldValue = version.data[mainField];\n\n const getNextNavigation = (): To => {\n const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });\n\n if (collectionType === COLLECTION_TYPES) {\n return {\n pathname: '..',\n search: pluginsQueryParams,\n };\n }\n\n return {\n pathname: '..',\n search: pluginsQueryParams,\n };\n };\n\n const handleRestore = async () => {\n try {\n const response = await restoreVersion({\n documentId: version.relatedDocumentId,\n collectionType,\n params: {\n versionId: version.id,\n contentType: version.contentType,\n },\n body: { contentType: version.contentType },\n });\n\n if ('data' in response) {\n navigate(getNextNavigation(), { relative: 'path' });\n\n toggleNotification({\n type: 'success',\n title: formatMessage({\n id: 'content-manager.restore.success.title',\n defaultMessage: 'Version restored.',\n }),\n message: formatMessage({\n id: 'content-manager.restore.success.message',\n defaultMessage: 'The content of the restored version is not published yet.',\n }),\n });\n }\n\n if ('error' in response) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'content-manager.history.restore.error.message',\n defaultMessage: 'Could not restore version.',\n }),\n });\n }\n } catch (error) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({ id: 'notification.error', defaultMessage: 'An error occurred' }),\n });\n }\n };\n\n return (\n <Dialog.Root open={isConfirmDialogOpen} onOpenChange={setIsConfirmDialogOpen}>\n <Layouts.BaseHeader\n id={headerId}\n title={formatDate(new Date(version.createdAt), {\n year: 'numeric',\n month: 'numeric',\n day: 'numeric',\n hour: 'numeric',\n minute: 'numeric',\n })}\n subtitle={\n <Typography variant=\"epsilon\" textColor=\"neutral600\">\n {formatMessage(\n {\n id: 'content-manager.history.version.subtitle',\n defaultMessage:\n '{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}',\n },\n {\n hasLocale: Boolean(version.locale),\n subtitle: `${mainFieldValue || ''} (${schema.info.singularName})`.trim(),\n locale: version.locale?.name,\n }\n )}\n </Typography>\n }\n navigationAction={\n <Link\n startIcon={<ArrowLeft />}\n tag={NavLink}\n to={getNextNavigation()}\n relative=\"path\"\n isExternal={false}\n >\n {formatMessage({\n id: 'global.back',\n defaultMessage: 'Back',\n })}\n </Link>\n }\n sticky={false}\n primaryAction={\n <Dialog.Trigger>\n <Button\n disabled={!allowedActions.canUpdate || isCurrentVersion}\n onClick={() => {\n setIsConfirmDialogOpen(true);\n }}\n >\n {formatMessage({\n id: 'content-manager.history.restore.confirm.button',\n defaultMessage: 'Restore',\n })}\n </Button>\n </Dialog.Trigger>\n }\n />\n <ConfirmDialog\n onConfirm={handleRestore}\n endAction={\n <Button variant=\"secondary\" onClick={handleRestore} loading={isLoading}>\n {formatMessage({\n id: 'content-manager.history.restore.confirm.button',\n defaultMessage: 'Restore',\n })}\n </Button>\n }\n >\n <Flex\n direction=\"column\"\n alignItems=\"center\"\n justifyContent=\"center\"\n gap={2}\n textAlign=\"center\"\n >\n <Flex justifyContent=\"center\">\n <WarningCircle width=\"24px\" height=\"24px\" fill=\"danger600\" />\n </Flex>\n <Typography>\n {formatMessage({\n id: 'content-manager.history.restore.confirm.title',\n defaultMessage: 'Are you sure you want to restore this version?',\n })}\n </Typography>\n <Typography>\n {formatMessage(\n {\n id: 'content-manager.history.restore.confirm.message',\n defaultMessage:\n \"{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.}}\",\n },\n {\n isDraft: version.status === 'draft',\n }\n )}\n </Typography>\n </Flex>\n </ConfirmDialog>\n </Dialog.Root>\n );\n};\n","import * as React from 'react';\n\nimport { useQueryParams } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Typography, type BoxProps } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { type MessageDescriptor, useIntl } from 'react-intl';\nimport { Link } from 'react-router-dom';\n\nimport { RelativeTime } from '../../components/RelativeTime';\nimport { getDisplayName } from '../../utils/users';\nimport { useHistoryContext } from '../pages/History';\n\nimport type { HistoryVersions } from '../../../../shared/contracts';\n\n/* -------------------------------------------------------------------------------------------------\n * BlueText\n * -----------------------------------------------------------------------------------------------*/\n\nconst BlueText = (children: React.ReactNode) => (\n <Typography textColor=\"primary600\" variant=\"pi\">\n {children}\n </Typography>\n);\n\n/* -------------------------------------------------------------------------------------------------\n * VersionCard\n * -----------------------------------------------------------------------------------------------*/\n\ninterface StatusData {\n background: BoxProps['background'];\n border: BoxProps['borderColor'];\n text: BoxProps['color'];\n message: MessageDescriptor;\n}\n\ninterface VersionCardProps {\n version: HistoryVersions.HistoryVersionDataResponse;\n isCurrent: boolean;\n}\n\nconst VersionCard = ({ version, isCurrent }: VersionCardProps) => {\n const { formatDate, formatMessage } = useIntl();\n const [{ query }] = useQueryParams<{ id?: string }>();\n\n const statusData = ((): StatusData => {\n switch (version.status) {\n case 'draft':\n return {\n background: 'secondary100',\n border: 'secondary200',\n text: 'secondary700',\n message: {\n id: 'content-manager.containers.List.draft',\n defaultMessage: 'Draft',\n },\n };\n case 'modified':\n return {\n background: 'alternative100',\n border: 'alternative200',\n text: 'alternative700',\n message: {\n // TODO: check the translation key once D&P v5 is done\n id: 'content-manager.containers.List.modified',\n defaultMessage: 'Modified',\n },\n };\n case 'published':\n default:\n return {\n background: 'success100',\n border: 'success200',\n text: 'success700',\n message: {\n id: 'content-manager.containers.List.published',\n defaultMessage: 'Published',\n },\n };\n }\n })();\n const isActive = query.id === version.id.toString();\n const author = version.createdBy && getDisplayName(version.createdBy);\n\n return (\n <Flex\n direction=\"column\"\n alignItems=\"flex-start\"\n gap={3}\n hasRadius\n borderWidth=\"1px\"\n borderStyle=\"solid\"\n borderColor={isActive ? 'primary600' : 'neutral200'}\n color=\"neutral800\"\n padding={5}\n tag={Link}\n to={`?${stringify({ ...query, id: version.id })}`}\n style={{ textDecoration: 'none' }}\n >\n <Flex direction=\"column\" gap={1} alignItems=\"flex-start\">\n <Typography tag=\"h3\" fontWeight=\"semiBold\">\n {formatDate(version.createdAt, {\n day: 'numeric',\n month: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n })}\n </Typography>\n <Typography tag=\"p\" variant=\"pi\" textColor=\"neutral600\">\n {formatMessage(\n {\n id: 'content-manager.history.sidebar.versionDescription',\n defaultMessage:\n '{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}',\n },\n {\n distanceToNow: <RelativeTime timestamp={new Date(version.createdAt)} />,\n author,\n isAnonymous: !Boolean(version.createdBy),\n isCurrent,\n b: BlueText,\n }\n )}\n </Typography>\n </Flex>\n {version.status && (\n <Box\n background={statusData.background}\n borderStyle=\"solid\"\n borderWidth=\"1px\"\n borderColor={statusData.border}\n hasRadius\n paddingLeft=\"6px\"\n paddingRight=\"6px\"\n paddingTop=\"2px\"\n paddingBottom=\"2px\"\n >\n <Typography variant=\"pi\" fontWeight=\"bold\" textColor={statusData.text}>\n {formatMessage(statusData.message)}\n </Typography>\n </Box>\n )}\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PaginationButton\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PaginationButtonProps {\n page: number;\n children: React.ReactNode;\n}\n\nconst PaginationButton = ({ page, children }: PaginationButtonProps) => {\n const [{ query }] = useQueryParams<{ id?: string }>();\n\n // Remove the id from the pagination link, so that the history page can redirect\n // to the id of the first history version in the new page once it's loaded\n const { id: _id, ...queryRest } = query;\n\n return (\n <Link to={{ search: stringify({ ...queryRest, page }) }} style={{ textDecoration: 'none' }}>\n <Typography variant=\"omega\" textColor=\"primary600\">\n {children}\n </Typography>\n </Link>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * VersionsList\n * -----------------------------------------------------------------------------------------------*/\n\nconst VersionsList = () => {\n const { formatMessage } = useIntl();\n const { versions, page } = useHistoryContext('VersionsList', (state) => ({\n versions: state.versions,\n page: state.page,\n }));\n\n return (\n <Flex\n shrink={0}\n direction=\"column\"\n alignItems=\"stretch\"\n width=\"320px\"\n height=\"100vh\"\n background=\"neutral0\"\n borderColor=\"neutral200\"\n borderWidth=\"0 0 0 1px\"\n borderStyle=\"solid\"\n tag=\"aside\"\n >\n <Flex\n direction=\"row\"\n justifyContent=\"space-between\"\n padding={4}\n borderColor=\"neutral200\"\n borderWidth=\"0 0 1px\"\n borderStyle=\"solid\"\n tag=\"header\"\n >\n <Typography tag=\"h2\" variant=\"omega\" fontWeight=\"semiBold\">\n {formatMessage({\n id: 'content-manager.history.sidebar.title',\n defaultMessage: 'Versions',\n })}\n </Typography>\n <Box background=\"neutral150\" hasRadius padding={1}>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {versions.meta.pagination.total}\n </Typography>\n </Box>\n </Flex>\n <Box flex={1} overflow=\"auto\">\n {versions.meta.pagination.page > 1 && (\n <Box paddingTop={4} textAlign=\"center\">\n <PaginationButton page={page - 1}>\n {formatMessage({\n id: 'content-manager.history.sidebar.show-newer',\n defaultMessage: 'Show newer versions',\n })}\n </PaginationButton>\n </Box>\n )}\n <Flex direction=\"column\" gap={3} padding={4} tag=\"ul\" alignItems=\"stretch\">\n {versions.data.map((version, index) => (\n <li\n key={version.id}\n aria-label={formatMessage({\n id: 'content-manager.history.sidebar.title.version-card.aria-label',\n defaultMessage: 'Version card',\n })}\n >\n <VersionCard version={version} isCurrent={page === 1 && index === 0} />\n </li>\n ))}\n </Flex>\n {versions.meta.pagination.page < versions.meta.pagination.pageCount && (\n <Box paddingBottom={4} textAlign=\"center\">\n <PaginationButton page={page + 1}>\n {formatMessage({\n id: 'content-manager.history.sidebar.show-older',\n defaultMessage: 'Show older versions',\n })}\n </PaginationButton>\n </Box>\n )}\n </Box>\n </Flex>\n );\n};\n\nexport { VersionsList };\n","import * as React from 'react';\n\nimport {\n useQueryParams,\n Page,\n createContext,\n useRBAC,\n BackButton,\n} from '@strapi/admin/strapi-admin';\nimport { Box, Flex, FocusTrap, Main, Portal, Link } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Navigate, useParams, NavLink } from 'react-router-dom';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { DocumentRBAC } from '../../features/DocumentRBAC';\nimport { useDocument } from '../../hooks/useDocument';\nimport { type EditLayout, useDocumentLayout } from '../../hooks/useDocumentLayout';\nimport { useGetContentTypeConfigurationQuery } from '../../services/contentTypes';\nimport { buildValidParams } from '../../utils/api';\nimport { VersionContent } from '../components/VersionContent';\nimport { VersionHeader } from '../components/VersionHeader';\nimport { VersionsList } from '../components/VersionsList';\nimport { useGetHistoryVersionsQuery } from '../services/historyVersion';\n\nimport type {\n ContentType,\n FindContentTypeConfiguration,\n} from '../../../../shared/contracts/content-types';\nimport type {\n HistoryVersionDataResponse,\n GetHistoryVersions,\n} from '../../../../shared/contracts/history-versions';\nimport type { UID } from '@strapi/types';\n\n/* -------------------------------------------------------------------------------------------------\n * HistoryProvider\n * -----------------------------------------------------------------------------------------------*/\n\ninterface HistoryContextValue {\n contentType: UID.ContentType;\n id?: string; // null for single types\n layout: EditLayout['layout'];\n configuration: FindContentTypeConfiguration.Response['data'];\n selectedVersion: HistoryVersionDataResponse;\n // Errors are handled outside of the provider, so we exclude errors from the response type\n versions: Extract<GetHistoryVersions.Response, { data: Array<HistoryVersionDataResponse> }>;\n page: number;\n mainField: string;\n schema: ContentType;\n}\n\nconst [HistoryProvider, useHistoryContext] = createContext<HistoryContextValue>('HistoryPage');\n\n/* -------------------------------------------------------------------------------------------------\n * HistoryPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst HistoryPage = () => {\n const headerId = React.useId();\n const { formatMessage } = useIntl();\n const {\n slug,\n id: documentId,\n collectionType,\n } = useParams<{\n collectionType: string;\n slug: UID.ContentType;\n id: string;\n }>();\n\n const { isLoading: isLoadingDocument, schema } = useDocument({\n collectionType: collectionType!,\n model: slug!,\n });\n\n const {\n isLoading: isLoadingLayout,\n edit: {\n layout,\n settings: { displayName, mainField },\n },\n } = useDocumentLayout(slug!);\n const { data: configuration, isLoading: isLoadingConfiguration } =\n useGetContentTypeConfigurationQuery(slug!);\n\n // Parse state from query params\n const [{ query }] = useQueryParams<{\n page?: number;\n id?: string;\n plugins?: Record<string, unknown>;\n }>();\n const { id: selectedVersionId, ...queryWithoutId } = query;\n const validQueryParamsWithoutId = buildValidParams(queryWithoutId);\n const page = validQueryParamsWithoutId.page ? Number(validQueryParamsWithoutId.page) : 1;\n\n const versionsResponse = useGetHistoryVersionsQuery(\n {\n contentType: slug!,\n ...(documentId ? { documentId } : {}),\n // Omit id since it's not needed by the endpoint and caused extra refetches\n ...validQueryParamsWithoutId,\n },\n { refetchOnMountOrArgChange: true }\n );\n\n /**\n * When the page is first mounted, if there's already data in the cache, RTK has a fullfilled\n * status for the first render, right before it triggers a new request. This means the code\n * briefly reaches the part that redirects to the first history version (if none is set).\n * But since that data is stale, that means auto-selecting a version that may not be the most\n * recent. To avoid this, we identify through requestId if the query is stale despite the\n * fullfilled status, and show the loader in that case.\n * This means we essentially don't want cache. We always refetch when the page mounts, and\n * we always show the loader until we have the most recent data. That's fine for this page.\n */\n const initialRequestId = React.useRef(versionsResponse.requestId);\n const isStaleRequest = versionsResponse.requestId === initialRequestId.current;\n\n /**\n * Ensure that we have the necessary data to render the page:\n * - slug for single types\n * - slug _and_ documentId for collection types\n */\n if (!slug || (collectionType === COLLECTION_TYPES && !documentId)) {\n return <Navigate to=\"/content-manager\" />;\n }\n\n if (\n isLoadingDocument ||\n isLoadingLayout ||\n versionsResponse.isFetching ||\n isStaleRequest ||\n isLoadingConfiguration\n ) {\n return <Page.Loading />;\n }\n\n // It was a success, handle empty data\n if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {\n return (\n <>\n <Page.NoData\n action={\n <Link\n tag={NavLink}\n to={`/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ''}`}\n >\n {formatMessage({\n id: 'global.back',\n defaultMessage: 'Back',\n })}\n </Link>\n }\n />\n </>\n );\n }\n\n // We have data, handle selected version\n if (versionsResponse.data?.data?.length && !selectedVersionId) {\n return (\n <Navigate\n to={{ search: stringify({ ...query, id: versionsResponse.data.data[0].id }) }}\n replace\n />\n );\n }\n\n const selectedVersion = versionsResponse.data?.data?.find(\n (version) => version.id.toString() === selectedVersionId\n );\n if (\n versionsResponse.isError ||\n !layout ||\n !schema ||\n !selectedVersion ||\n !configuration ||\n // This should not happen as it's covered by versionsResponse.isError, but we need it for TS\n versionsResponse.data.error\n ) {\n return <Page.Error />;\n }\n\n return (\n <>\n <Page.Title>\n {formatMessage(\n {\n id: 'content-manager.history.page-title',\n defaultMessage: '{contentType} history',\n },\n {\n contentType: displayName,\n }\n )}\n </Page.Title>\n <HistoryProvider\n contentType={slug}\n id={documentId}\n schema={schema}\n layout={layout}\n configuration={configuration}\n selectedVersion={selectedVersion}\n versions={versionsResponse.data}\n page={page}\n mainField={mainField}\n >\n <Flex direction=\"row\" alignItems=\"flex-start\">\n <Main\n grow={1}\n height=\"100vh\"\n background=\"neutral100\"\n paddingBottom={6}\n overflow=\"auto\"\n labelledBy={headerId}\n >\n <VersionHeader headerId={headerId} />\n <VersionContent />\n </Main>\n <VersionsList />\n </Flex>\n </HistoryProvider>\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedHistoryPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedHistoryPageImpl = () => {\n const { slug } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return (\n <Box\n height=\"100vh\"\n width=\"100vw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={2}\n background=\"neutral0\"\n >\n <Page.Error />\n </Box>\n );\n }\n\n return (\n <Box\n height=\"100vh\"\n width=\"100vw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={2}\n background=\"neutral0\"\n >\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <HistoryPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n </Box>\n );\n};\n\nconst ProtectedHistoryPage = () => {\n return (\n <Portal>\n <FocusTrap>\n <ProtectedHistoryPageImpl />\n </FocusTrap>\n </Portal>\n );\n};\n\nexport { ProtectedHistoryPage, HistoryProvider, useHistoryContext };\nexport type { HistoryContextValue };\n"],"names":["FormInputRenderer","BlocksInput","ComponentInput","Wysiwyg","UIDInput","components","schema","Link","permissions"],"mappings":";;;;;;;;;;;;;;AA0CA,MAAM,cAAc,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,SAAS,SAAS,MAAM;AAAC,GAAG,QAAQ,QAAQ;AAAA;AAAA;AAAA;AAAA;AAUlG,MAAM,eAAe,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;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,EACf,CAAA,GAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAM,uBAAuB,MAAM;AACjC,6BACG,QACC,EAAA,UAAA,oBAAC,aACC,UAAC,oBAAA,0BAAA,CAAyB,CAAA,EAC5B,CAAA,EACF,CAAA;AAEJ;"}
@@ -7,13 +7,13 @@ const designSystem = require("@strapi/design-system");
7
7
  const qs = require("qs");
8
8
  const reactIntl = require("react-intl");
9
9
  const reactRouterDom = require("react-router-dom");
10
- const index = require("./index-BZoNZMXL.js");
10
+ const index = require("./index-DqZnjo8F.js");
11
11
  const pipe = require("lodash/fp/pipe");
12
12
  const hooks = require("./hooks-BAaaKPS_.js");
13
- const Field = require("./Field-C5Z1Ivdv.js");
13
+ const Field = require("./Field-C1ftmTe9.js");
14
14
  const Icons = require("@strapi/icons");
15
15
  const styledComponents = require("styled-components");
16
- const relations = require("./relations-D0eZ4VWw.js");
16
+ const relations = require("./relations-D9fKsCLY.js");
17
17
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
18
18
  function _interopNamespace(e) {
19
19
  if (e && e.__esModule)
@@ -36,7 +36,7 @@ function _interopNamespace(e) {
36
36
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
37
37
  const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
38
38
  const StyledAlert = styledComponents.styled(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
39
- } })`
39
+ }, shadow: "none" })`
40
40
  button {
41
41
  display: none;
42
42
  }
@@ -54,10 +54,10 @@ const LinkEllipsis = styledComponents.styled(designSystem.Link)`
54
54
  const CustomRelationInput = (props) => {
55
55
  const { formatMessage } = reactIntl.useIntl();
56
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;
57
+ let formattedFieldValue;
58
+ if (field) {
59
+ formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
60
+ }
61
61
  if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
62
62
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
63
63
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: props.labelAction, children: props.label }),
@@ -71,8 +71,10 @@ const CustomRelationInput = (props) => {
71
71
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
72
72
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
73
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}`;
74
+ const { targetModel } = props.attribute;
75
+ const href = `../${index.COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;
75
76
  const label = relations.getRelationLabel(relationData, props.mainField);
77
+ const isAdminUserRelation = targetModel === "admin::user";
76
78
  return /* @__PURE__ */ jsxRuntime.jsxs(
77
79
  designSystem.Flex,
78
80
  {
@@ -85,11 +87,11 @@ const CustomRelationInput = (props) => {
85
87
  background: "neutral150",
86
88
  justifyContent: "space-between",
87
89
  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 }) }) }),
90
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label, children: isAdminUserRelation ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: label }) : /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, { tag: reactRouterDom.NavLink, to: href, children: label }) }) }),
89
91
  /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: relationData.status })
90
92
  ]
91
93
  },
92
- relationData.documentId
94
+ relationData.documentId ?? relationData.id
93
95
  );
94
96
  }) }),
95
97
  meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
@@ -117,9 +119,9 @@ const CustomRelationInput = (props) => {
117
119
  ] });
118
120
  };
119
121
  const CustomMediaInput = (props) => {
120
- const {
121
- value: { results, meta }
122
- } = strapiAdmin.useField(props.name);
122
+ const { value } = strapiAdmin.useField(props.name);
123
+ const results = value ? value.results : [];
124
+ const meta = value ? value.meta : { missingCount: 0 };
123
125
  const { formatMessage } = reactIntl.useIntl();
124
126
  const fields = strapiAdmin.useStrapiApp("CustomMediaInput", (state) => state.fields);
125
127
  const MediaLibrary = fields.media;
@@ -414,7 +416,7 @@ const FormPanel = ({ panel }) => {
414
416
  if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
415
417
  const [row] = panel;
416
418
  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);
419
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }) }, field.name);
418
420
  }
419
421
  return /* @__PURE__ */ jsxRuntime.jsx(
420
422
  designSystem.Box,
@@ -427,8 +429,19 @@ const FormPanel = ({ panel }) => {
427
429
  paddingTop: 6,
428
430
  paddingBottom: 6,
429
431
  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
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
433
+ return /* @__PURE__ */ jsxRuntime.jsx(
434
+ designSystem.Grid.Item,
435
+ {
436
+ col: size,
437
+ s: 12,
438
+ xs: 12,
439
+ direction: "column",
440
+ alignItems: "stretch",
441
+ children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field })
442
+ },
443
+ field.name
444
+ );
432
445
  }) }, gridRowIndex)) })
433
446
  }
434
447
  );
@@ -560,12 +573,12 @@ const VersionHeader = ({ headerId }) => {
560
573
  const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
561
574
  if (collectionType === index.COLLECTION_TYPES) {
562
575
  return {
563
- pathname: `/content-manager/${collectionType}/${version.contentType}/${version.relatedDocumentId}`,
576
+ pathname: "..",
564
577
  search: pluginsQueryParams
565
578
  };
566
579
  }
567
580
  return {
568
- pathname: `/content-manager/${collectionType}/${version.contentType}`,
581
+ pathname: "..",
569
582
  search: pluginsQueryParams
570
583
  };
571
584
  };
@@ -581,7 +594,7 @@ const VersionHeader = ({ headerId }) => {
581
594
  body: { contentType: version.contentType }
582
595
  });
583
596
  if ("data" in response) {
584
- navigate(getNextNavigation());
597
+ navigate(getNextNavigation(), { relative: "path" });
585
598
  toggleNotification({
586
599
  type: "success",
587
600
  title: formatMessage({
@@ -610,7 +623,7 @@ const VersionHeader = ({ headerId }) => {
610
623
  });
611
624
  }
612
625
  };
613
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
626
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
614
627
  /* @__PURE__ */ jsxRuntime.jsx(
615
628
  strapiAdmin.Layouts.BaseHeader,
616
629
  {
@@ -622,7 +635,7 @@ const VersionHeader = ({ headerId }) => {
622
635
  hour: "numeric",
623
636
  minute: "numeric"
624
637
  }),
625
- subtitle: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", children: formatMessage(
638
+ subtitle: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
626
639
  {
627
640
  id: "content-manager.history.version.subtitle",
628
641
  defaultMessage: "{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}"
@@ -633,12 +646,22 @@ const VersionHeader = ({ headerId }) => {
633
646
  locale: version.locale?.name
634
647
  }
635
648
  ) }),
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
- }) }),
649
+ navigationAction: /* @__PURE__ */ jsxRuntime.jsx(
650
+ designSystem.Link,
651
+ {
652
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowLeft, {}),
653
+ tag: reactRouterDom.NavLink,
654
+ to: getNextNavigation(),
655
+ relative: "path",
656
+ isExternal: false,
657
+ children: formatMessage({
658
+ id: "global.back",
659
+ defaultMessage: "Back"
660
+ })
661
+ }
662
+ ),
640
663
  sticky: false,
641
- primaryAction: /* @__PURE__ */ jsxRuntime.jsx(
664
+ primaryAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
642
665
  designSystem.Button,
643
666
  {
644
667
  disabled: !allowedActions.canUpdate || isCurrentVersion,
@@ -650,16 +673,13 @@ const VersionHeader = ({ headerId }) => {
650
673
  defaultMessage: "Restore"
651
674
  })
652
675
  }
653
- )
676
+ ) })
654
677
  }
655
678
  ),
656
679
  /* @__PURE__ */ jsxRuntime.jsx(
657
680
  strapiAdmin.ConfirmDialog,
658
681
  {
659
- isOpen: isConfirmDialogOpen,
660
- onClose: () => setIsConfirmDialogOpen(false),
661
682
  onConfirm: handleRestore,
662
- icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}),
663
683
  endAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
664
684
  id: "content-manager.history.restore.confirm.button",
665
685
  defaultMessage: "Restore"
@@ -673,6 +693,7 @@ const VersionHeader = ({ headerId }) => {
673
693
  gap: 2,
674
694
  textAlign: "center",
675
695
  children: [
696
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
676
697
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
677
698
  id: "content-manager.history.restore.confirm.title",
678
699
  defaultMessage: "Are you sure you want to restore this version?"
@@ -693,7 +714,7 @@ const VersionHeader = ({ headerId }) => {
693
714
  )
694
715
  ] });
695
716
  };
696
- const BlueText = (children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", children });
717
+ const BlueText = (children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", children });
697
718
  const VersionCard = ({ version, isCurrent }) => {
698
719
  const { formatDate, formatMessage } = reactIntl.useIntl();
699
720
  const [{ query }] = strapiAdmin.useQueryParams();
@@ -746,10 +767,7 @@ const VersionCard = ({ version, isCurrent }) => {
746
767
  borderStyle: "solid",
747
768
  borderColor: isActive ? "primary600" : "neutral200",
748
769
  color: "neutral800",
749
- paddingTop: 4,
750
- paddingBottom: 4,
751
- paddingLeft: 5,
752
- paddingRight: 5,
770
+ padding: 5,
753
771
  tag: reactRouterDom.Link,
754
772
  to: `?${qs.stringify({ ...query, id: version.id })}`,
755
773
  style: { textDecoration: "none" },
@@ -844,31 +862,18 @@ const VersionsList = () => {
844
862
  id: "content-manager.history.sidebar.show-newer",
845
863
  defaultMessage: "Show newer versions"
846
864
  }) }) }),
847
- /* @__PURE__ */ jsxRuntime.jsx(
848
- designSystem.Flex,
865
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 3, padding: 4, tag: "ul", alignItems: "stretch", children: versions.data.map((version, index2) => /* @__PURE__ */ jsxRuntime.jsx(
866
+ "li",
849
867
  {
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({
868
+ "aria-label": formatMessage({
869
+ id: "content-manager.history.sidebar.title.version-card.aria-label",
870
+ defaultMessage: "Version card"
871
+ }),
872
+ children: /* @__PURE__ */ jsxRuntime.jsx(VersionCard, { version, isCurrent: page === 1 && index2 === 0 })
873
+ },
874
+ version.id
875
+ )) }),
876
+ versions.meta.pagination.page < versions.meta.pagination.pageCount && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 4, textAlign: "center", children: /* @__PURE__ */ jsxRuntime.jsx(PaginationButton, { page: page + 1, children: formatMessage({
872
877
  id: "content-manager.history.sidebar.show-older",
873
878
  defaultMessage: "Show older versions"
874
879
  }) }) })
@@ -920,7 +925,22 @@ const HistoryPage = () => {
920
925
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
921
926
  }
922
927
  if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
923
- return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.NoData, {});
928
+ return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
929
+ strapiAdmin.Page.NoData,
930
+ {
931
+ action: /* @__PURE__ */ jsxRuntime.jsx(
932
+ designSystem.Link,
933
+ {
934
+ tag: reactRouterDom.NavLink,
935
+ to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
936
+ children: formatMessage({
937
+ id: "global.back",
938
+ defaultMessage: "Back"
939
+ })
940
+ }
941
+ )
942
+ }
943
+ ) });
924
944
  }
925
945
  if (versionsResponse.data?.data?.length && !selectedVersionId) {
926
946
  return /* @__PURE__ */ jsxRuntime.jsx(
@@ -1027,4 +1047,4 @@ const ProtectedHistoryPage = () => {
1027
1047
  exports.HistoryProvider = HistoryProvider;
1028
1048
  exports.ProtectedHistoryPage = ProtectedHistoryPage;
1029
1049
  exports.useHistoryContext = useHistoryContext;
1030
- //# sourceMappingURL=History-4NbOq2dX.js.map
1050
+ //# sourceMappingURL=History-DKS2aqqM.js.map