@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
@@ -7,13 +7,13 @@ const designSystem = require("@strapi/design-system");
|
|
7
7
|
const qs = require("qs");
|
8
8
|
const reactIntl = require("react-intl");
|
9
9
|
const reactRouterDom = require("react-router-dom");
|
10
|
-
const index = require("./index-
|
10
|
+
const index = require("./index-T-aWjbj2.js");
|
11
11
|
const pipe = require("lodash/fp/pipe");
|
12
12
|
const hooks = require("./hooks-BAaaKPS_.js");
|
13
|
-
const Field = require("./Field-
|
13
|
+
const Field = require("./Field-DUK83cfh.js");
|
14
14
|
const Icons = require("@strapi/icons");
|
15
|
-
const
|
16
|
-
const relations = require("./relations-
|
15
|
+
const styledComponents = require("styled-components");
|
16
|
+
const relations = require("./relations-kLcuobLk.js");
|
17
17
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
18
18
|
function _interopNamespace(e) {
|
19
19
|
if (e && e.__esModule)
|
@@ -35,14 +35,13 @@ function _interopNamespace(e) {
|
|
35
35
|
}
|
36
36
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
37
37
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
|
38
|
-
const
|
39
|
-
|
40
|
-
} })`
|
38
|
+
const StyledAlert = styledComponents.styled(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
|
39
|
+
}, shadow: "none" })`
|
41
40
|
button {
|
42
41
|
display: none;
|
43
42
|
}
|
44
43
|
`;
|
45
|
-
const LinkEllipsis =
|
44
|
+
const LinkEllipsis = styledComponents.styled(designSystem.Link)`
|
46
45
|
display: block;
|
47
46
|
|
48
47
|
& > span {
|
@@ -55,13 +54,13 @@ const LinkEllipsis = styled__default.default(designSystem.Link)`
|
|
55
54
|
const CustomRelationInput = (props) => {
|
56
55
|
const { formatMessage } = reactIntl.useIntl();
|
57
56
|
const field = strapiAdmin.useField(props.name);
|
58
|
-
|
59
|
-
|
60
|
-
meta: { missingCount: 0 }
|
61
|
-
}
|
62
|
-
if (!formattedFieldValue || formattedFieldValue.results.length === 0) {
|
57
|
+
let formattedFieldValue;
|
58
|
+
if (field) {
|
59
|
+
formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
|
60
|
+
}
|
61
|
+
if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
|
63
62
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
64
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
63
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: props.labelAction, children: props.label }),
|
65
64
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { variant: "default", children: formatMessage({
|
66
65
|
id: "content-manager.history.content.no-relations",
|
67
66
|
defaultMessage: "No relations."
|
@@ -70,10 +69,12 @@ const CustomRelationInput = (props) => {
|
|
70
69
|
}
|
71
70
|
const { results, meta } = formattedFieldValue;
|
72
71
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { children: [
|
73
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
72
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
|
74
73
|
results.length > 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 2, marginTop: 1, alignItems: "stretch", children: results.map((relationData) => {
|
75
|
-
const
|
74
|
+
const { targetModel } = props.attribute;
|
75
|
+
const href = `../${index.COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;
|
76
76
|
const label = relations.getRelationLabel(relationData, props.mainField);
|
77
|
+
const isAdminUserRelation = targetModel === "admin::user";
|
77
78
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
78
79
|
designSystem.Flex,
|
79
80
|
{
|
@@ -86,14 +87,15 @@ const CustomRelationInput = (props) => {
|
|
86
87
|
background: "neutral150",
|
87
88
|
justifyContent: "space-between",
|
88
89
|
children: [
|
89
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, {
|
90
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label, children: isAdminUserRelation ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: label }) : /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, { tag: reactRouterDom.NavLink, to: href, children: label }) }) }),
|
90
91
|
/* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: relationData.status })
|
91
92
|
]
|
92
93
|
},
|
93
|
-
relationData.documentId
|
94
|
+
relationData.documentId ?? relationData.id
|
94
95
|
);
|
95
96
|
}) }),
|
96
|
-
meta.missingCount > 0 && /* @
|
97
|
+
meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
|
98
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
97
99
|
StyledAlert,
|
98
100
|
{
|
99
101
|
marginTop: 1,
|
@@ -113,17 +115,13 @@ const CustomRelationInput = (props) => {
|
|
113
115
|
{ number: meta.missingCount }
|
114
116
|
)
|
115
117
|
}
|
116
|
-
)
|
117
|
-
results.length === 0 && meta.missingCount === 0 && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(StyledAlert, { variant: "default", children: formatMessage({
|
118
|
-
id: "content-manager.history.content.no-relations",
|
119
|
-
defaultMessage: "No relations."
|
120
|
-
}) }) })
|
118
|
+
)
|
121
119
|
] });
|
122
120
|
};
|
123
121
|
const CustomMediaInput = (props) => {
|
124
|
-
const {
|
125
|
-
|
126
|
-
|
122
|
+
const { value } = strapiAdmin.useField(props.name);
|
123
|
+
const results = value ? value.results : [];
|
124
|
+
const meta = value ? value.meta : { missingCount: 0 };
|
127
125
|
const { formatMessage } = reactIntl.useIntl();
|
128
126
|
const fields = strapiAdmin.useStrapiApp("CustomMediaInput", (state) => state.fields);
|
129
127
|
const MediaLibrary = fields.media;
|
@@ -154,12 +152,39 @@ const CustomMediaInput = (props) => {
|
|
154
152
|
)
|
155
153
|
] });
|
156
154
|
};
|
155
|
+
const getLabelAction = (labelAction) => {
|
156
|
+
if (!React__namespace.isValidElement(labelAction)) {
|
157
|
+
return labelAction;
|
158
|
+
}
|
159
|
+
const labelActionTitleId = labelAction.props.title.id;
|
160
|
+
if (labelActionTitleId === "i18n.Field.localized") {
|
161
|
+
return React__namespace.cloneElement(labelAction, {
|
162
|
+
...labelAction.props,
|
163
|
+
title: {
|
164
|
+
id: "history.content.localized",
|
165
|
+
defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
|
166
|
+
}
|
167
|
+
});
|
168
|
+
}
|
169
|
+
if (labelActionTitleId === "i18n.Field.not-localized") {
|
170
|
+
return React__namespace.cloneElement(labelAction, {
|
171
|
+
...labelAction.props,
|
172
|
+
title: {
|
173
|
+
id: "history.content.not-localized",
|
174
|
+
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."
|
175
|
+
}
|
176
|
+
});
|
177
|
+
}
|
178
|
+
return labelAction;
|
179
|
+
};
|
157
180
|
const VersionInputRenderer = ({
|
158
181
|
visible,
|
159
182
|
hint: providedHint,
|
160
183
|
shouldIgnoreRBAC = false,
|
184
|
+
labelAction,
|
161
185
|
...props
|
162
186
|
}) => {
|
187
|
+
const customLabelAction = getLabelAction(labelAction);
|
163
188
|
const { formatMessage } = reactIntl.useIntl();
|
164
189
|
const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
|
165
190
|
const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
|
@@ -193,7 +218,7 @@ const VersionInputRenderer = ({
|
|
193
218
|
const addedAttributes = version.meta.unknownAttributes.added;
|
194
219
|
if (Object.keys(addedAttributes).includes(props.name)) {
|
195
220
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
196
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
221
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
|
197
222
|
/* @__PURE__ */ jsxRuntime.jsx(
|
198
223
|
StyledAlert,
|
199
224
|
{
|
@@ -217,29 +242,46 @@ const VersionInputRenderer = ({
|
|
217
242
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
218
243
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
219
244
|
if (CustomInput) {
|
220
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
245
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
246
|
+
CustomInput,
|
247
|
+
{
|
248
|
+
...props,
|
249
|
+
hint,
|
250
|
+
labelAction: customLabelAction,
|
251
|
+
disabled: fieldIsDisabled
|
252
|
+
}
|
253
|
+
);
|
221
254
|
}
|
222
255
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
223
256
|
strapiAdmin.InputRenderer,
|
224
257
|
{
|
225
258
|
...props,
|
226
259
|
hint,
|
260
|
+
labelAction: customLabelAction,
|
227
261
|
type: props.attribute.customField,
|
228
262
|
disabled: fieldIsDisabled
|
229
263
|
}
|
230
264
|
);
|
231
265
|
}
|
232
266
|
if (props.type === "media") {
|
233
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, disabled: fieldIsDisabled });
|
267
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
|
234
268
|
}
|
235
269
|
const addedInputTypes = Object.keys(fields);
|
236
270
|
if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
|
237
271
|
const CustomInput = fields[props.type];
|
238
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
272
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
273
|
+
CustomInput,
|
274
|
+
{
|
275
|
+
...props,
|
276
|
+
hint,
|
277
|
+
labelAction: customLabelAction,
|
278
|
+
disabled: fieldIsDisabled
|
279
|
+
}
|
280
|
+
);
|
239
281
|
}
|
240
282
|
switch (props.type) {
|
241
283
|
case "blocks":
|
242
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Field.
|
284
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
243
285
|
case "component":
|
244
286
|
const { layout } = componentsLayout[props.attribute.component];
|
245
287
|
const [remainingFieldsLayout] = getRemaingFieldsLayout({
|
@@ -249,29 +291,65 @@ const VersionInputRenderer = ({
|
|
249
291
|
schemaAttributes: components[props.attribute.component].attributes
|
250
292
|
});
|
251
293
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
252
|
-
Field.
|
294
|
+
Field.MemoizedComponentInput,
|
253
295
|
{
|
254
296
|
...props,
|
255
297
|
layout: [...layout, ...remainingFieldsLayout || []],
|
256
298
|
hint,
|
299
|
+
labelAction: customLabelAction,
|
257
300
|
disabled: fieldIsDisabled,
|
258
301
|
children: (inputProps) => /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
|
259
302
|
}
|
260
303
|
);
|
261
304
|
case "dynamiczone":
|
262
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
305
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
306
|
+
Field.DynamicZone,
|
307
|
+
{
|
308
|
+
...props,
|
309
|
+
hint,
|
310
|
+
labelAction: customLabelAction,
|
311
|
+
disabled: fieldIsDisabled
|
312
|
+
}
|
313
|
+
);
|
263
314
|
case "relation":
|
264
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
315
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
316
|
+
CustomRelationInput,
|
317
|
+
{
|
318
|
+
...props,
|
319
|
+
hint,
|
320
|
+
labelAction: customLabelAction,
|
321
|
+
disabled: fieldIsDisabled
|
322
|
+
}
|
323
|
+
);
|
265
324
|
case "richtext":
|
266
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
325
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
326
|
+
Field.MemoizedWysiwyg,
|
327
|
+
{
|
328
|
+
...props,
|
329
|
+
hint,
|
330
|
+
type: props.type,
|
331
|
+
labelAction: customLabelAction,
|
332
|
+
disabled: fieldIsDisabled
|
333
|
+
}
|
334
|
+
);
|
267
335
|
case "uid":
|
268
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
336
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
337
|
+
Field.MemoizedUIDInput,
|
338
|
+
{
|
339
|
+
...props,
|
340
|
+
hint,
|
341
|
+
type: props.type,
|
342
|
+
labelAction: customLabelAction,
|
343
|
+
disabled: fieldIsDisabled
|
344
|
+
}
|
345
|
+
);
|
269
346
|
case "enumeration":
|
270
347
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
271
348
|
strapiAdmin.InputRenderer,
|
272
349
|
{
|
273
350
|
...props,
|
274
351
|
hint,
|
352
|
+
labelAction: customLabelAction,
|
275
353
|
options: props.attribute.enum.map((value) => ({ value })),
|
276
354
|
type: props.customField ? "custom-field" : props.type,
|
277
355
|
disabled: fieldIsDisabled
|
@@ -284,6 +362,7 @@ const VersionInputRenderer = ({
|
|
284
362
|
{
|
285
363
|
...restProps,
|
286
364
|
hint,
|
365
|
+
labelAction: customLabelAction,
|
287
366
|
type: props.customField ? "custom-field" : props.type,
|
288
367
|
disabled: fieldIsDisabled
|
289
368
|
}
|
@@ -337,7 +416,7 @@ const FormPanel = ({ panel }) => {
|
|
337
416
|
if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
|
338
417
|
const [row] = panel;
|
339
418
|
const [field] = row;
|
340
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
419
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }) }, field.name);
|
341
420
|
}
|
342
421
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
343
422
|
designSystem.Box,
|
@@ -350,8 +429,19 @@ const FormPanel = ({ panel }) => {
|
|
350
429
|
paddingTop: 6,
|
351
430
|
paddingBottom: 6,
|
352
431
|
borderColor: "neutral150",
|
353
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
|
354
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
432
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
433
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
434
|
+
designSystem.Grid.Item,
|
435
|
+
{
|
436
|
+
col: size,
|
437
|
+
s: 12,
|
438
|
+
xs: 12,
|
439
|
+
direction: "column",
|
440
|
+
alignItems: "stretch",
|
441
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field })
|
442
|
+
},
|
443
|
+
field.name
|
444
|
+
);
|
355
445
|
}) }, gridRowIndex)) })
|
356
446
|
}
|
357
447
|
);
|
@@ -466,6 +556,7 @@ const VersionHeader = ({ headerId }) => {
|
|
466
556
|
const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React__namespace.useState(false);
|
467
557
|
const navigate = reactRouterDom.useNavigate();
|
468
558
|
const { formatMessage, formatDate } = reactIntl.useIntl();
|
559
|
+
const { trackUsage } = strapiAdmin.useTracking();
|
469
560
|
const { toggleNotification } = strapiAdmin.useNotification();
|
470
561
|
const [{ query }] = strapiAdmin.useQueryParams();
|
471
562
|
const { collectionType, slug } = reactRouterDom.useParams();
|
@@ -481,14 +572,8 @@ const VersionHeader = ({ headerId }) => {
|
|
481
572
|
const mainFieldValue = version.data[mainField];
|
482
573
|
const getNextNavigation = () => {
|
483
574
|
const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
|
484
|
-
if (collectionType === index.COLLECTION_TYPES) {
|
485
|
-
return {
|
486
|
-
pathname: `/content-manager/${collectionType}/${version.contentType}/${version.relatedDocumentId}`,
|
487
|
-
search: pluginsQueryParams
|
488
|
-
};
|
489
|
-
}
|
490
575
|
return {
|
491
|
-
pathname:
|
576
|
+
pathname: "..",
|
492
577
|
search: pluginsQueryParams
|
493
578
|
};
|
494
579
|
};
|
@@ -504,7 +589,7 @@ const VersionHeader = ({ headerId }) => {
|
|
504
589
|
body: { contentType: version.contentType }
|
505
590
|
});
|
506
591
|
if ("data" in response) {
|
507
|
-
navigate(getNextNavigation());
|
592
|
+
navigate(getNextNavigation(), { relative: "path" });
|
508
593
|
toggleNotification({
|
509
594
|
type: "success",
|
510
595
|
title: formatMessage({
|
@@ -513,9 +598,10 @@ const VersionHeader = ({ headerId }) => {
|
|
513
598
|
}),
|
514
599
|
message: formatMessage({
|
515
600
|
id: "content-manager.restore.success.message",
|
516
|
-
defaultMessage: "
|
601
|
+
defaultMessage: "A past version of the content was restored."
|
517
602
|
})
|
518
603
|
});
|
604
|
+
trackUsage("didRestoreHistoryVersion");
|
519
605
|
}
|
520
606
|
if ("error" in response) {
|
521
607
|
toggleNotification({
|
@@ -533,7 +619,7 @@ const VersionHeader = ({ headerId }) => {
|
|
533
619
|
});
|
534
620
|
}
|
535
621
|
};
|
536
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
622
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
|
537
623
|
/* @__PURE__ */ jsxRuntime.jsx(
|
538
624
|
strapiAdmin.Layouts.BaseHeader,
|
539
625
|
{
|
@@ -545,7 +631,7 @@ const VersionHeader = ({ headerId }) => {
|
|
545
631
|
hour: "numeric",
|
546
632
|
minute: "numeric"
|
547
633
|
}),
|
548
|
-
subtitle: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", children: formatMessage(
|
634
|
+
subtitle: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
|
549
635
|
{
|
550
636
|
id: "content-manager.history.version.subtitle",
|
551
637
|
defaultMessage: "{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}"
|
@@ -560,8 +646,10 @@ const VersionHeader = ({ headerId }) => {
|
|
560
646
|
designSystem.Link,
|
561
647
|
{
|
562
648
|
startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowLeft, {}),
|
563
|
-
|
649
|
+
tag: reactRouterDom.NavLink,
|
564
650
|
to: getNextNavigation(),
|
651
|
+
relative: "path",
|
652
|
+
isExternal: false,
|
565
653
|
children: formatMessage({
|
566
654
|
id: "global.back",
|
567
655
|
defaultMessage: "Back"
|
@@ -569,7 +657,7 @@ const VersionHeader = ({ headerId }) => {
|
|
569
657
|
}
|
570
658
|
),
|
571
659
|
sticky: false,
|
572
|
-
primaryAction: /* @__PURE__ */ jsxRuntime.jsx(
|
660
|
+
primaryAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
573
661
|
designSystem.Button,
|
574
662
|
{
|
575
663
|
disabled: !allowedActions.canUpdate || isCurrentVersion,
|
@@ -581,16 +669,13 @@ const VersionHeader = ({ headerId }) => {
|
|
581
669
|
defaultMessage: "Restore"
|
582
670
|
})
|
583
671
|
}
|
584
|
-
)
|
672
|
+
) })
|
585
673
|
}
|
586
674
|
),
|
587
675
|
/* @__PURE__ */ jsxRuntime.jsx(
|
588
676
|
strapiAdmin.ConfirmDialog,
|
589
677
|
{
|
590
|
-
isOpen: isConfirmDialogOpen,
|
591
|
-
onClose: () => setIsConfirmDialogOpen(false),
|
592
678
|
onConfirm: handleRestore,
|
593
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}),
|
594
679
|
endAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
|
595
680
|
id: "content-manager.history.restore.confirm.button",
|
596
681
|
defaultMessage: "Restore"
|
@@ -604,6 +689,7 @@ const VersionHeader = ({ headerId }) => {
|
|
604
689
|
gap: 2,
|
605
690
|
textAlign: "center",
|
606
691
|
children: [
|
692
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
|
607
693
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
608
694
|
id: "content-manager.history.restore.confirm.title",
|
609
695
|
defaultMessage: "Are you sure you want to restore this version?"
|
@@ -624,46 +710,10 @@ const VersionHeader = ({ headerId }) => {
|
|
624
710
|
)
|
625
711
|
] });
|
626
712
|
};
|
627
|
-
const BlueText = (children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", children });
|
713
|
+
const BlueText = (children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", children });
|
628
714
|
const VersionCard = ({ version, isCurrent }) => {
|
629
715
|
const { formatDate, formatMessage } = reactIntl.useIntl();
|
630
716
|
const [{ query }] = strapiAdmin.useQueryParams();
|
631
|
-
const statusData = (() => {
|
632
|
-
switch (version.status) {
|
633
|
-
case "draft":
|
634
|
-
return {
|
635
|
-
background: "secondary100",
|
636
|
-
border: "secondary200",
|
637
|
-
text: "secondary700",
|
638
|
-
message: {
|
639
|
-
id: "content-manager.containers.List.draft",
|
640
|
-
defaultMessage: "Draft"
|
641
|
-
}
|
642
|
-
};
|
643
|
-
case "modified":
|
644
|
-
return {
|
645
|
-
background: "alternative100",
|
646
|
-
border: "alternative200",
|
647
|
-
text: "alternative700",
|
648
|
-
message: {
|
649
|
-
// TODO: check the translation key once D&P v5 is done
|
650
|
-
id: "content-manager.containers.List.modified",
|
651
|
-
defaultMessage: "Modified"
|
652
|
-
}
|
653
|
-
};
|
654
|
-
case "published":
|
655
|
-
default:
|
656
|
-
return {
|
657
|
-
background: "success100",
|
658
|
-
border: "success200",
|
659
|
-
text: "success700",
|
660
|
-
message: {
|
661
|
-
id: "content-manager.containers.List.published",
|
662
|
-
defaultMessage: "Published"
|
663
|
-
}
|
664
|
-
};
|
665
|
-
}
|
666
|
-
})();
|
667
717
|
const isActive = query.id === version.id.toString();
|
668
718
|
const author = version.createdBy && index.getDisplayName(version.createdBy);
|
669
719
|
return /* @__PURE__ */ jsxRuntime.jsxs(
|
@@ -676,23 +726,21 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
676
726
|
borderWidth: "1px",
|
677
727
|
borderStyle: "solid",
|
678
728
|
borderColor: isActive ? "primary600" : "neutral200",
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
paddingRight: 5,
|
683
|
-
as: reactRouterDom.Link,
|
729
|
+
color: "neutral800",
|
730
|
+
padding: 5,
|
731
|
+
tag: reactRouterDom.Link,
|
684
732
|
to: `?${qs.stringify({ ...query, id: version.id })}`,
|
685
733
|
style: { textDecoration: "none" },
|
686
734
|
children: [
|
687
735
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
|
688
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
736
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
|
689
737
|
day: "numeric",
|
690
738
|
month: "numeric",
|
691
739
|
year: "numeric",
|
692
740
|
hour: "2-digit",
|
693
741
|
minute: "2-digit"
|
694
742
|
}) }),
|
695
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
743
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
|
696
744
|
{
|
697
745
|
id: "content-manager.history.sidebar.versionDescription",
|
698
746
|
defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
|
@@ -706,21 +754,7 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
706
754
|
}
|
707
755
|
) })
|
708
756
|
] }),
|
709
|
-
version.status && /* @__PURE__ */ jsxRuntime.jsx(
|
710
|
-
designSystem.Box,
|
711
|
-
{
|
712
|
-
background: statusData.background,
|
713
|
-
borderStyle: "solid",
|
714
|
-
borderWidth: "1px",
|
715
|
-
borderColor: statusData.border,
|
716
|
-
hasRadius: true,
|
717
|
-
paddingLeft: "6px",
|
718
|
-
paddingRight: "6px",
|
719
|
-
paddingTop: "2px",
|
720
|
-
paddingBottom: "2px",
|
721
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: statusData.text, children: formatMessage(statusData.message) })
|
722
|
-
}
|
723
|
-
)
|
757
|
+
version.status && /* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: version.status, size: "XS" })
|
724
758
|
]
|
725
759
|
}
|
726
760
|
);
|
@@ -748,7 +782,7 @@ const VersionsList = () => {
|
|
748
782
|
borderColor: "neutral200",
|
749
783
|
borderWidth: "0 0 0 1px",
|
750
784
|
borderStyle: "solid",
|
751
|
-
|
785
|
+
tag: "aside",
|
752
786
|
children: [
|
753
787
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
754
788
|
designSystem.Flex,
|
@@ -759,9 +793,9 @@ const VersionsList = () => {
|
|
759
793
|
borderColor: "neutral200",
|
760
794
|
borderWidth: "0 0 1px",
|
761
795
|
borderStyle: "solid",
|
762
|
-
|
796
|
+
tag: "header",
|
763
797
|
children: [
|
764
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
798
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
|
765
799
|
id: "content-manager.history.sidebar.title",
|
766
800
|
defaultMessage: "Versions"
|
767
801
|
}) }),
|
@@ -774,31 +808,18 @@ const VersionsList = () => {
|
|
774
808
|
id: "content-manager.history.sidebar.show-newer",
|
775
809
|
defaultMessage: "Show newer versions"
|
776
810
|
}) }) }),
|
777
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
778
|
-
|
811
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", gap: 3, padding: 4, tag: "ul", alignItems: "stretch", children: versions.data.map((version, index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
812
|
+
"li",
|
779
813
|
{
|
780
|
-
|
781
|
-
|
782
|
-
|
783
|
-
|
784
|
-
|
785
|
-
|
786
|
-
|
787
|
-
|
788
|
-
|
789
|
-
"li",
|
790
|
-
{
|
791
|
-
"aria-label": formatMessage({
|
792
|
-
id: "content-manager.history.sidebar.title.version-card.aria-label",
|
793
|
-
defaultMessage: "Version card"
|
794
|
-
}),
|
795
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(VersionCard, { version, isCurrent: page === 1 && index2 === 0 })
|
796
|
-
},
|
797
|
-
version.id
|
798
|
-
))
|
799
|
-
}
|
800
|
-
),
|
801
|
-
versions.meta.pagination.page < versions.meta.pagination.pageCount && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 5, textAlign: "center", children: /* @__PURE__ */ jsxRuntime.jsx(PaginationButton, { page: page + 1, children: formatMessage({
|
814
|
+
"aria-label": formatMessage({
|
815
|
+
id: "content-manager.history.sidebar.title.version-card.aria-label",
|
816
|
+
defaultMessage: "Version card"
|
817
|
+
}),
|
818
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(VersionCard, { version, isCurrent: page === 1 && index2 === 0 })
|
819
|
+
},
|
820
|
+
version.id
|
821
|
+
)) }),
|
822
|
+
versions.meta.pagination.page < versions.meta.pagination.pageCount && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 4, textAlign: "center", children: /* @__PURE__ */ jsxRuntime.jsx(PaginationButton, { page: page + 1, children: formatMessage({
|
802
823
|
id: "content-manager.history.sidebar.show-older",
|
803
824
|
defaultMessage: "Show older versions"
|
804
825
|
}) }) })
|
@@ -850,7 +871,22 @@ const HistoryPage = () => {
|
|
850
871
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
851
872
|
}
|
852
873
|
if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
|
853
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
874
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
875
|
+
strapiAdmin.Page.NoData,
|
876
|
+
{
|
877
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(
|
878
|
+
designSystem.Link,
|
879
|
+
{
|
880
|
+
tag: reactRouterDom.NavLink,
|
881
|
+
to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
|
882
|
+
children: formatMessage({
|
883
|
+
id: "global.back",
|
884
|
+
defaultMessage: "Back"
|
885
|
+
})
|
886
|
+
}
|
887
|
+
)
|
888
|
+
}
|
889
|
+
) });
|
854
890
|
}
|
855
891
|
if (versionsResponse.data?.data?.length && !selectedVersionId) {
|
856
892
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -957,4 +993,4 @@ const ProtectedHistoryPage = () => {
|
|
957
993
|
exports.HistoryProvider = HistoryProvider;
|
958
994
|
exports.ProtectedHistoryPage = ProtectedHistoryPage;
|
959
995
|
exports.useHistoryContext = useHistoryContext;
|
960
|
-
//# sourceMappingURL=History-
|
996
|
+
//# sourceMappingURL=History-Di3zm4HT.js.map
|