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