@strapi/content-manager 0.0.0-experimental.d53e940834bf72ddc725f1d2fd36dac9abec30cb → 0.0.0-experimental.d6bba97c7ed8309e57888e84d4788fa279d473fd
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.
- package/LICENSE +18 -3
- package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs → ComponentConfigurationPage-D4J64ny7.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs.map → ComponentConfigurationPage-D4J64ny7.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js → ComponentConfigurationPage-DHV8IFbd.js} +5 -6
- package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js.map → ComponentConfigurationPage-DHV8IFbd.js.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
- package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs → EditConfigurationPage-DMnf8orh.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs.map → EditConfigurationPage-DMnf8orh.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js → EditConfigurationPage-q76oeVU1.js} +5 -6
- package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js.map → EditConfigurationPage-q76oeVU1.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-zT3fBr4Y.js → EditViewPage-BXoY-ITh.js} +63 -13
- package/dist/_chunks/EditViewPage-BXoY-ITh.js.map +1 -0
- package/dist/_chunks/{EditViewPage-CPj61RMh.mjs → EditViewPage-COVXj9bh.mjs} +63 -12
- package/dist/_chunks/EditViewPage-COVXj9bh.mjs.map +1 -0
- package/dist/_chunks/{Field-dha5VnIQ.mjs → Field-CcppsFQR.mjs} +300 -203
- package/dist/_chunks/Field-CcppsFQR.mjs.map +1 -0
- package/dist/_chunks/{Field-Boxf9Ajp.js → Field-Dj1nOvt8.js} +303 -207
- package/dist/_chunks/Field-Dj1nOvt8.js.map +1 -0
- package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
- package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
- package/dist/_chunks/{Form-DHrru2AV.mjs → Form-DbWwH0-A.mjs} +37 -18
- package/dist/_chunks/Form-DbWwH0-A.mjs.map +1 -0
- package/dist/_chunks/{Form-y5g1SRsh.js → Form-aTchNxab.js} +39 -21
- package/dist/_chunks/Form-aTchNxab.js.map +1 -0
- package/dist/_chunks/{History-CqN6K7SX.js → History-Cs6XM6EU.js} +81 -114
- package/dist/_chunks/History-Cs6XM6EU.js.map +1 -0
- package/dist/_chunks/{History-Bru_KoeP.mjs → History-tU567_hc.mjs} +82 -114
- package/dist/_chunks/History-tU567_hc.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-R_p-SbHZ.js → ListConfigurationPage-7LeytuFD.js} +25 -13
- package/dist/_chunks/ListConfigurationPage-7LeytuFD.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-D8wGABj0.mjs → ListConfigurationPage-DQryo_4i.mjs} +25 -12
- package/dist/_chunks/ListConfigurationPage-DQryo_4i.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-SID6TRb9.mjs → ListViewPage-B50esy_x.mjs} +118 -77
- package/dist/_chunks/ListViewPage-B50esy_x.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-pEw_zug9.js → ListViewPage-CaGBu5H5.js} +121 -81
- package/dist/_chunks/ListViewPage-CaGBu5H5.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C5dcQojD.js → NoContentTypePage-BaBE00IO.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C5dcQojD.js.map → NoContentTypePage-BaBE00IO.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs → NoContentTypePage-CiPP8cLx.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs.map → NoContentTypePage-CiPP8cLx.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs → NoPermissionsPage-0-CW106p.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs.map → NoPermissionsPage-0-CW106p.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js → NoPermissionsPage-DQn5cqZz.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js.map → NoPermissionsPage-DQn5cqZz.js.map} +1 -1
- package/dist/_chunks/Preview-C1dBkhXf.mjs +272 -0
- package/dist/_chunks/Preview-C1dBkhXf.mjs.map +1 -0
- package/dist/_chunks/Preview-DH1h7kJ6.js +290 -0
- package/dist/_chunks/Preview-DH1h7kJ6.js.map +1 -0
- package/dist/_chunks/{Relations-B9Crnhnn.mjs → Relations-Bvne4TvU.mjs} +76 -42
- package/dist/_chunks/Relations-Bvne4TvU.mjs.map +1 -0
- package/dist/_chunks/{Relations-DjTQ5kGB.js → Relations-CkECnBOd.js} +76 -43
- package/dist/_chunks/Relations-CkECnBOd.js.map +1 -0
- package/dist/_chunks/{en-fbKQxLGn.js → en-BK8Xyl5I.js} +32 -18
- package/dist/_chunks/{en-fbKQxLGn.js.map → en-BK8Xyl5I.js.map} +1 -1
- package/dist/_chunks/{en-Ux26r5pl.mjs → en-Dtk_ot79.mjs} +32 -18
- package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-DVPWZkbS.js → index-BN1pPa5v.js} +1135 -693
- package/dist/_chunks/index-BN1pPa5v.js.map +1 -0
- package/dist/_chunks/{index-DJXJw9V5.mjs → index-ByPZ754U.mjs} +1156 -714
- package/dist/_chunks/index-ByPZ754U.mjs.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout-Bau7ZfLV.mjs → layout-CUTOYU8I.mjs} +26 -13
- package/dist/_chunks/layout-CUTOYU8I.mjs.map +1 -0
- package/dist/_chunks/{layout-Dm6fbiQj.js → layout-nBPDlXjr.js} +26 -14
- package/dist/_chunks/layout-nBPDlXjr.js.map +1 -0
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-CKnpRgrN.js → relations-B6B-b7lI.js} +6 -7
- package/dist/_chunks/relations-B6B-b7lI.js.map +1 -0
- package/dist/_chunks/{relations-BH_kBSJ0.mjs → relations-CBc5HYHC.mjs} +6 -7
- package/dist/_chunks/relations-CBc5HYHC.mjs.map +1 -0
- package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +5 -4
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/exports.d.ts +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +32 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +2 -1
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
- package/dist/admin/src/preview/routes.d.ts +3 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/router.d.ts +1 -1
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +3 -3
- package/dist/admin/src/services/documents.d.ts +19 -20
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/validation.d.ts +4 -1
- package/dist/server/index.js +615 -299
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +615 -298
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +4 -4
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +4 -4
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +16 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +32 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +19 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +8 -8
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -4
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +3 -1
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +15 -15
- package/dist/_chunks/EditViewPage-CPj61RMh.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-zT3fBr4Y.js.map +0 -1
- package/dist/_chunks/Field-Boxf9Ajp.js.map +0 -1
- package/dist/_chunks/Field-dha5VnIQ.mjs.map +0 -1
- package/dist/_chunks/Form-DHrru2AV.mjs.map +0 -1
- package/dist/_chunks/Form-y5g1SRsh.js.map +0 -1
- package/dist/_chunks/History-Bru_KoeP.mjs.map +0 -1
- package/dist/_chunks/History-CqN6K7SX.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-D8wGABj0.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-R_p-SbHZ.js.map +0 -1
- package/dist/_chunks/ListViewPage-SID6TRb9.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-pEw_zug9.js.map +0 -1
- package/dist/_chunks/Relations-B9Crnhnn.mjs.map +0 -1
- package/dist/_chunks/Relations-DjTQ5kGB.js.map +0 -1
- package/dist/_chunks/index-DJXJw9V5.mjs.map +0 -1
- package/dist/_chunks/index-DVPWZkbS.js.map +0 -1
- package/dist/_chunks/layout-Bau7ZfLV.mjs.map +0 -1
- package/dist/_chunks/layout-Dm6fbiQj.js.map +0 -1
- package/dist/_chunks/relations-BH_kBSJ0.mjs.map +0 -1
- package/dist/_chunks/relations-CKnpRgrN.js.map +0 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
- package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
- package/strapi-server.js +0 -3
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"History-Cs6XM6EU.js","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 useTracking,\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 { 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 { trackUsage } = useTracking();\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 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: 'A past version of the content was restored.',\n }),\n });\n\n trackUsage('didRestoreHistoryVersion');\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 } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Link } from 'react-router-dom';\n\nimport { RelativeTime } from '../../components/RelativeTime';\nimport { DocumentStatus } from '../../pages/EditView/components/DocumentStatus';\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 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 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 && <DocumentStatus status={version.status} size=\"XS\" />}\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 { useQueryParams, Page, createContext, useRBAC } 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":["styled","Alert","Link","useIntl","useField","jsxs","Fragment","jsx","Field","Box","Flex","COLLECTION_TYPES","getRelationLabel","Tooltip","Typography","NavLink","DocumentStatus","useStrapiApp","Form","React","useTypedSelector","useDoc","useForm","useDynamicZone","useDocumentRBAC","useLazyComponents","useFieldHint","useDocLayout","NotAllowedInput","FormInputRenderer","BlocksInput","ComponentInput","DynamicZone","Wysiwyg","UIDInput","Grid","components","schema","pipe","removeFieldsThatDontExistOnSchema","prepareTempKeys","Layouts","index","Divider","contentManagerApi","useNavigate","useTracking","useNotification","useQueryParams","useParams","useRBAC","PERMISSIONS","stringify","Dialog","ArrowLeft","Button","ConfirmDialog","WarningCircle","getDisplayName","RelativeTime","createContext","useDocument","useDocumentLayout","useGetContentTypeConfigurationQuery","build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ACzB,UAAC7D,2BAAAA,IAAA,aAAA,EAAY,GACf,EAEJ,CAAA;AAAA,IAAA;AAAA,EACF;AAEJ;AAEA,MAAM,uBAAuB,MAAM;AACjC,wCACG+D,aACC,QAAA,EAAA,UAAA/D,2BAAA,IAACgE,0BACC,UAAChE,2BAAA,IAAA,0BAAA,EAAyB,GAC5B,EACF,CAAA;AAEJ;;;;"}
|
@@ -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, Field, Box, Tooltip,
|
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 { c as useDoc, f as useDocumentRBAC,
|
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-ByPZ754U.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, d as MemoizedUIDInput, e as MemoizedWysiwyg, D as DynamicZone, f as MemoizedComponentInput, g as MemoizedBlocksInput, r as removeFieldsThatDontExistOnSchema, p as prepareTempKeys } from "./Field-
|
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-CcppsFQR.mjs";
|
12
12
|
import { ArrowLeft, WarningCircle } from "@strapi/icons";
|
13
13
|
import { styled } from "styled-components";
|
14
|
-
import { g as getRelationLabel } from "./relations-
|
14
|
+
import { g as getRelationLabel } from "./relations-CBc5HYHC.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,10 +31,10 @@ const LinkEllipsis = styled(Link)`
|
|
31
31
|
const CustomRelationInput = (props) => {
|
32
32
|
const { formatMessage } = useIntl();
|
33
33
|
const field = useField(props.name);
|
34
|
-
|
35
|
-
|
36
|
-
meta: { missingCount: 0 }
|
37
|
-
}
|
34
|
+
let formattedFieldValue;
|
35
|
+
if (field) {
|
36
|
+
formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
|
37
|
+
}
|
38
38
|
if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
|
39
39
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
40
40
|
/* @__PURE__ */ jsx(Field.Label, { action: props.labelAction, children: props.label }),
|
@@ -48,8 +48,10 @@ const CustomRelationInput = (props) => {
|
|
48
48
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
49
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
|
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,11 +64,11 @@ 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, {
|
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
74
|
meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
|
@@ -94,9 +96,9 @@ const CustomRelationInput = (props) => {
|
|
94
96
|
] });
|
95
97
|
};
|
96
98
|
const CustomMediaInput = (props) => {
|
97
|
-
const {
|
98
|
-
|
99
|
-
|
99
|
+
const { value } = useField(props.name);
|
100
|
+
const results = value ? value.results : [];
|
101
|
+
const meta = value ? value.meta : { missingCount: 0 };
|
100
102
|
const { formatMessage } = useIntl();
|
101
103
|
const fields = useStrapiApp("CustomMediaInput", (state) => state.fields);
|
102
104
|
const MediaLibrary = fields.media;
|
@@ -391,7 +393,7 @@ const FormPanel = ({ panel }) => {
|
|
391
393
|
if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
|
392
394
|
const [row] = panel;
|
393
395
|
const [field] = row;
|
394
|
-
return /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: /* @__PURE__ */ jsx(Grid.Item, { 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);
|
395
397
|
}
|
396
398
|
return /* @__PURE__ */ jsx(
|
397
399
|
Box,
|
@@ -405,7 +407,18 @@ const FormPanel = ({ panel }) => {
|
|
405
407
|
paddingBottom: 6,
|
406
408
|
borderColor: "neutral150",
|
407
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 }) => {
|
408
|
-
return /* @__PURE__ */ jsx(
|
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
|
+
);
|
409
422
|
}) }, gridRowIndex)) })
|
410
423
|
}
|
411
424
|
);
|
@@ -520,6 +533,7 @@ const VersionHeader = ({ headerId }) => {
|
|
520
533
|
const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React.useState(false);
|
521
534
|
const navigate = useNavigate();
|
522
535
|
const { formatMessage, formatDate } = useIntl();
|
536
|
+
const { trackUsage } = useTracking();
|
523
537
|
const { toggleNotification } = useNotification();
|
524
538
|
const [{ query }] = useQueryParams();
|
525
539
|
const { collectionType, slug } = useParams();
|
@@ -535,14 +549,8 @@ const VersionHeader = ({ headerId }) => {
|
|
535
549
|
const mainFieldValue = version.data[mainField];
|
536
550
|
const getNextNavigation = () => {
|
537
551
|
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
|
538
|
-
if (collectionType === COLLECTION_TYPES) {
|
539
|
-
return {
|
540
|
-
pathname: `/content-manager/${collectionType}/${version.contentType}/${version.relatedDocumentId}`,
|
541
|
-
search: pluginsQueryParams
|
542
|
-
};
|
543
|
-
}
|
544
552
|
return {
|
545
|
-
pathname:
|
553
|
+
pathname: "..",
|
546
554
|
search: pluginsQueryParams
|
547
555
|
};
|
548
556
|
};
|
@@ -558,7 +566,7 @@ const VersionHeader = ({ headerId }) => {
|
|
558
566
|
body: { contentType: version.contentType }
|
559
567
|
});
|
560
568
|
if ("data" in response) {
|
561
|
-
navigate(getNextNavigation());
|
569
|
+
navigate(getNextNavigation(), { relative: "path" });
|
562
570
|
toggleNotification({
|
563
571
|
type: "success",
|
564
572
|
title: formatMessage({
|
@@ -567,9 +575,10 @@ const VersionHeader = ({ headerId }) => {
|
|
567
575
|
}),
|
568
576
|
message: formatMessage({
|
569
577
|
id: "content-manager.restore.success.message",
|
570
|
-
defaultMessage: "
|
578
|
+
defaultMessage: "A past version of the content was restored."
|
571
579
|
})
|
572
580
|
});
|
581
|
+
trackUsage("didRestoreHistoryVersion");
|
573
582
|
}
|
574
583
|
if ("error" in response) {
|
575
584
|
toggleNotification({
|
@@ -599,7 +608,7 @@ const VersionHeader = ({ headerId }) => {
|
|
599
608
|
hour: "numeric",
|
600
609
|
minute: "numeric"
|
601
610
|
}),
|
602
|
-
subtitle: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", children: formatMessage(
|
611
|
+
subtitle: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
|
603
612
|
{
|
604
613
|
id: "content-manager.history.version.subtitle",
|
605
614
|
defaultMessage: "{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}"
|
@@ -610,10 +619,20 @@ const VersionHeader = ({ headerId }) => {
|
|
610
619
|
locale: version.locale?.name
|
611
620
|
}
|
612
621
|
) }),
|
613
|
-
navigationAction: /* @__PURE__ */ jsx(
|
614
|
-
|
615
|
-
|
616
|
-
|
622
|
+
navigationAction: /* @__PURE__ */ jsx(
|
623
|
+
Link,
|
624
|
+
{
|
625
|
+
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
626
|
+
tag: NavLink,
|
627
|
+
to: getNextNavigation(),
|
628
|
+
relative: "path",
|
629
|
+
isExternal: false,
|
630
|
+
children: formatMessage({
|
631
|
+
id: "global.back",
|
632
|
+
defaultMessage: "Back"
|
633
|
+
})
|
634
|
+
}
|
635
|
+
),
|
617
636
|
sticky: false,
|
618
637
|
primaryAction: /* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
|
619
638
|
Button,
|
@@ -668,46 +687,10 @@ const VersionHeader = ({ headerId }) => {
|
|
668
687
|
)
|
669
688
|
] });
|
670
689
|
};
|
671
|
-
const BlueText = (children) => /* @__PURE__ */ jsx(Typography, { textColor: "primary600", children });
|
690
|
+
const BlueText = (children) => /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", children });
|
672
691
|
const VersionCard = ({ version, isCurrent }) => {
|
673
692
|
const { formatDate, formatMessage } = useIntl();
|
674
693
|
const [{ query }] = useQueryParams();
|
675
|
-
const statusData = (() => {
|
676
|
-
switch (version.status) {
|
677
|
-
case "draft":
|
678
|
-
return {
|
679
|
-
background: "secondary100",
|
680
|
-
border: "secondary200",
|
681
|
-
text: "secondary700",
|
682
|
-
message: {
|
683
|
-
id: "content-manager.containers.List.draft",
|
684
|
-
defaultMessage: "Draft"
|
685
|
-
}
|
686
|
-
};
|
687
|
-
case "modified":
|
688
|
-
return {
|
689
|
-
background: "alternative100",
|
690
|
-
border: "alternative200",
|
691
|
-
text: "alternative700",
|
692
|
-
message: {
|
693
|
-
// TODO: check the translation key once D&P v5 is done
|
694
|
-
id: "content-manager.containers.List.modified",
|
695
|
-
defaultMessage: "Modified"
|
696
|
-
}
|
697
|
-
};
|
698
|
-
case "published":
|
699
|
-
default:
|
700
|
-
return {
|
701
|
-
background: "success100",
|
702
|
-
border: "success200",
|
703
|
-
text: "success700",
|
704
|
-
message: {
|
705
|
-
id: "content-manager.containers.List.published",
|
706
|
-
defaultMessage: "Published"
|
707
|
-
}
|
708
|
-
};
|
709
|
-
}
|
710
|
-
})();
|
711
694
|
const isActive = query.id === version.id.toString();
|
712
695
|
const author = version.createdBy && getDisplayName(version.createdBy);
|
713
696
|
return /* @__PURE__ */ jsxs(
|
@@ -721,10 +704,7 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
721
704
|
borderStyle: "solid",
|
722
705
|
borderColor: isActive ? "primary600" : "neutral200",
|
723
706
|
color: "neutral800",
|
724
|
-
|
725
|
-
paddingBottom: 4,
|
726
|
-
paddingLeft: 5,
|
727
|
-
paddingRight: 5,
|
707
|
+
padding: 5,
|
728
708
|
tag: Link$1,
|
729
709
|
to: `?${stringify({ ...query, id: version.id })}`,
|
730
710
|
style: { textDecoration: "none" },
|
@@ -751,21 +731,7 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
751
731
|
}
|
752
732
|
) })
|
753
733
|
] }),
|
754
|
-
version.status && /* @__PURE__ */ jsx(
|
755
|
-
Box,
|
756
|
-
{
|
757
|
-
background: statusData.background,
|
758
|
-
borderStyle: "solid",
|
759
|
-
borderWidth: "1px",
|
760
|
-
borderColor: statusData.border,
|
761
|
-
hasRadius: true,
|
762
|
-
paddingLeft: "6px",
|
763
|
-
paddingRight: "6px",
|
764
|
-
paddingTop: "2px",
|
765
|
-
paddingBottom: "2px",
|
766
|
-
children: /* @__PURE__ */ jsx(Typography, { variant: "pi", fontWeight: "bold", textColor: statusData.text, children: formatMessage(statusData.message) })
|
767
|
-
}
|
768
|
-
)
|
734
|
+
version.status && /* @__PURE__ */ jsx(DocumentStatus, { status: version.status, size: "XS" })
|
769
735
|
]
|
770
736
|
}
|
771
737
|
);
|
@@ -819,31 +785,18 @@ const VersionsList = () => {
|
|
819
785
|
id: "content-manager.history.sidebar.show-newer",
|
820
786
|
defaultMessage: "Show newer versions"
|
821
787
|
}) }) }),
|
822
|
-
/* @__PURE__ */ jsx(
|
823
|
-
|
788
|
+
/* @__PURE__ */ jsx(Flex, { direction: "column", gap: 3, padding: 4, tag: "ul", alignItems: "stretch", children: versions.data.map((version, index) => /* @__PURE__ */ jsx(
|
789
|
+
"li",
|
824
790
|
{
|
825
|
-
|
826
|
-
|
827
|
-
|
828
|
-
|
829
|
-
|
830
|
-
|
831
|
-
|
832
|
-
|
833
|
-
|
834
|
-
"li",
|
835
|
-
{
|
836
|
-
"aria-label": formatMessage({
|
837
|
-
id: "content-manager.history.sidebar.title.version-card.aria-label",
|
838
|
-
defaultMessage: "Version card"
|
839
|
-
}),
|
840
|
-
children: /* @__PURE__ */ jsx(VersionCard, { version, isCurrent: page === 1 && index === 0 })
|
841
|
-
},
|
842
|
-
version.id
|
843
|
-
))
|
844
|
-
}
|
845
|
-
),
|
846
|
-
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({
|
847
800
|
id: "content-manager.history.sidebar.show-older",
|
848
801
|
defaultMessage: "Show older versions"
|
849
802
|
}) }) })
|
@@ -895,7 +848,22 @@ const HistoryPage = () => {
|
|
895
848
|
return /* @__PURE__ */ jsx(Page.Loading, {});
|
896
849
|
}
|
897
850
|
if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
|
898
|
-
return /* @__PURE__ */ jsx(
|
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
|
+
) });
|
899
867
|
}
|
900
868
|
if (versionsResponse.data?.data?.length && !selectedVersionId) {
|
901
869
|
return /* @__PURE__ */ jsx(
|
@@ -1004,4 +972,4 @@ export {
|
|
1004
972
|
ProtectedHistoryPage,
|
1005
973
|
useHistoryContext
|
1006
974
|
};
|
1007
|
-
//# sourceMappingURL=History-
|
975
|
+
//# sourceMappingURL=History-tU567_hc.mjs.map
|