@strapi/content-manager 0.0.0-experimental.17b4116f461a49b8ce5386f7c8d79c511d40fb3b → 0.0.0-experimental.baa6cf22298e591b4d52d8e59c60406d7a9f137f
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/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-DjQBdcKF.mjs → ComponentConfigurationPage-CYqQv0ne.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DjQBdcKF.mjs.map → ComponentConfigurationPage-CYqQv0ne.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-2iOVVhqV.js → ComponentConfigurationPage-DiigqkCf.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-2iOVVhqV.js.map → ComponentConfigurationPage-DiigqkCf.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-BoBb-DLH.mjs → EditConfigurationPage-BArY-b8_.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BoBb-DLH.mjs.map → EditConfigurationPage-BArY-b8_.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-B7dw5_cS.js → EditConfigurationPage-BeeGw2RI.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-B7dw5_cS.js.map → EditConfigurationPage-BeeGw2RI.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-aUnqL-63.mjs → EditViewPage-B8ETGsFo.mjs} +6 -6
- package/dist/_chunks/EditViewPage-B8ETGsFo.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-KRG56aCq.js → EditViewPage-DZPDqo_G.js} +7 -9
- package/dist/_chunks/EditViewPage-DZPDqo_G.js.map +1 -0
- package/dist/_chunks/{Field-kVFO4ZKB.mjs → Field-Dn4ThnFB.mjs} +500 -608
- package/dist/_chunks/Field-Dn4ThnFB.mjs.map +1 -0
- package/dist/_chunks/{Field-kq1c2TF1.js → Field-DnJMS8cB.js} +552 -661
- package/dist/_chunks/Field-DnJMS8cB.js.map +1 -0
- package/dist/_chunks/{Form-Jgh5hGTu.mjs → Form-DY721B6y.mjs} +16 -13
- package/dist/_chunks/Form-DY721B6y.mjs.map +1 -0
- package/dist/_chunks/{Form-CQ67ZifP.js → Form-DiTmWq2k.js} +18 -16
- package/dist/_chunks/Form-DiTmWq2k.js.map +1 -0
- package/dist/_chunks/{History-DKhZAPcK.mjs → History-CwWN_uNp.mjs} +28 -34
- package/dist/_chunks/History-CwWN_uNp.mjs.map +1 -0
- package/dist/_chunks/{History-BLEnudTX.js → History-DShoVAh0.js} +29 -36
- package/dist/_chunks/History-DShoVAh0.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Zso_LUjn.js → ListConfigurationPage-COIRGF5b.js} +14 -16
- package/dist/_chunks/ListConfigurationPage-COIRGF5b.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-nrXcxNYi.mjs → ListConfigurationPage-D062TiTL.mjs} +9 -9
- package/dist/_chunks/ListConfigurationPage-D062TiTL.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-ChhYmA-L.mjs → ListViewPage-BeHTsIr5.mjs} +21 -41
- package/dist/_chunks/ListViewPage-BeHTsIr5.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-DsaOakWQ.js → ListViewPage-CFuXPZ_r.js} +28 -48
- package/dist/_chunks/ListViewPage-CFuXPZ_r.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-BrdFcN33.mjs → NoContentTypePage-B_KLijrG.mjs} +3 -3
- package/dist/_chunks/NoContentTypePage-B_KLijrG.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DPCuS9Y1.js → NoContentTypePage-rdH0Zp0A.js} +3 -3
- package/dist/_chunks/NoContentTypePage-rdH0Zp0A.js.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-B9dqrtTy.mjs → NoPermissionsPage-BPU-v48V.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B9dqrtTy.mjs.map → NoPermissionsPage-BPU-v48V.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DdyOfdKb.js → NoPermissionsPage-D8gbX1Y_.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DdyOfdKb.js.map → NoPermissionsPage-D8gbX1Y_.js.map} +1 -1
- package/dist/_chunks/{Relations-DjFiYd7-.mjs → Relations-Bbz90ZWv.mjs} +66 -56
- package/dist/_chunks/Relations-Bbz90ZWv.mjs.map +1 -0
- package/dist/_chunks/{Relations-CY8Isqdu.js → Relations-wHyjWWT5.js} +70 -61
- package/dist/_chunks/Relations-wHyjWWT5.js.map +1 -0
- package/dist/_chunks/{en-C-V1_90f.js → en-BN1bvFK7.js} +4 -1
- package/dist/_chunks/{en-C-V1_90f.js.map → en-BN1bvFK7.js.map} +1 -1
- package/dist/_chunks/{en-MBPul9Su.mjs → en-Dzv55oQw.mjs} +4 -1
- package/dist/_chunks/{en-MBPul9Su.mjs.map → en-Dzv55oQw.mjs.map} +1 -1
- package/dist/_chunks/{index-DNa1J4HE.js → index-BRHpg0az.js} +1535 -789
- package/dist/_chunks/index-BRHpg0az.js.map +1 -0
- package/dist/_chunks/{index-CAc9yTnx.mjs → index-Dv4oDn11.mjs} +1538 -791
- package/dist/_chunks/index-Dv4oDn11.mjs.map +1 -0
- package/dist/_chunks/{layout-CXsHbc3E.mjs → layout-hInnLBbA.mjs} +10 -10
- package/dist/_chunks/layout-hInnLBbA.mjs.map +1 -0
- package/dist/_chunks/{layout-BqtLA6Lb.js → layout-pZc2Q3bK.js} +12 -14
- package/dist/_chunks/layout-pZc2Q3bK.js.map +1 -0
- package/dist/_chunks/{relations-mMFEcZRq.mjs → relations-BcPI8XhI.mjs} +2 -2
- package/dist/_chunks/{relations-mMFEcZRq.mjs.map → relations-BcPI8XhI.mjs.map} +1 -1
- package/dist/_chunks/{relations-BHY_KDJ_.js → relations-CVE30dYt.js} +2 -2
- package/dist/_chunks/{relations-BHY_KDJ_.js.map → relations-CVE30dYt.js.map} +1 -1
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js +15 -0
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +1 -0
- package/dist/_chunks/usePrev-DH6iah0A.mjs +16 -0
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +1 -0
- 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/components/ComponentIcon.d.ts +6 -3
- package/dist/admin/src/content-manager.d.ts +3 -3
- package/dist/admin/src/exports.d.ts +1 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +5 -8
- 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/pages/EditView/components/DocumentActions.d.ts +3 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
- 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 +10 -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/WysiwygStyles.d.ts +67 -52
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
- package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
- 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 +29 -17
- 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 +1 -6
- package/dist/server/index.js +267 -186
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +269 -188
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/single-types.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +8 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts +9 -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/index.d.ts +17 -33
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts +11 -6
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +8 -29
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +17 -33
- package/dist/server/src/services/index.d.ts.map +1 -1
- 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/shared/contracts/collection-types.d.ts +14 -6
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/relations.d.ts +2 -2
- package/dist/shared/contracts/relations.d.ts.map +1 -1
- package/package.json +13 -14
- 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-KRG56aCq.js.map +0 -1
- package/dist/_chunks/EditViewPage-aUnqL-63.mjs.map +0 -1
- package/dist/_chunks/Field-kVFO4ZKB.mjs.map +0 -1
- package/dist/_chunks/Field-kq1c2TF1.js.map +0 -1
- package/dist/_chunks/Form-CQ67ZifP.js.map +0 -1
- package/dist/_chunks/Form-Jgh5hGTu.mjs.map +0 -1
- package/dist/_chunks/History-BLEnudTX.js.map +0 -1
- package/dist/_chunks/History-DKhZAPcK.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Zso_LUjn.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-nrXcxNYi.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-ChhYmA-L.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-DsaOakWQ.js.map +0 -1
- package/dist/_chunks/NoContentTypePage-BrdFcN33.mjs.map +0 -1
- package/dist/_chunks/NoContentTypePage-DPCuS9Y1.js.map +0 -1
- package/dist/_chunks/Relations-CY8Isqdu.js.map +0 -1
- package/dist/_chunks/Relations-DjFiYd7-.mjs.map +0 -1
- package/dist/_chunks/index-CAc9yTnx.mjs.map +0 -1
- package/dist/_chunks/index-DNa1J4HE.js.map +0 -1
- package/dist/_chunks/layout-BqtLA6Lb.js.map +0 -1
- package/dist/_chunks/layout-CXsHbc3E.mjs.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
@@ -1,17 +1,17 @@
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
2
2
|
import * as React from "react";
|
3
3
|
import { useForm, useStrapiApp, InputRenderer, useField, Form, Layouts, useNotification, useQueryParams, useRBAC, ConfirmDialog, createContext, Page } from "@strapi/admin/strapi-admin";
|
4
|
-
import { Alert, Link, Flex,
|
4
|
+
import { Alert, Link, Flex, Field, Box, Tooltip, Divider, Typography, Grid, GridItem, Button, Portal, FocusTrap, Main } from "@strapi/design-system";
|
5
5
|
import { stringify } from "qs";
|
6
6
|
import { useIntl } from "react-intl";
|
7
7
|
import { NavLink, useNavigate, useParams, Link as Link$1, Navigate } from "react-router-dom";
|
8
|
-
import { b as useDoc, e as useDocumentRBAC, m as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, d as contentManagerApi, j as PERMISSIONS, t as getDisplayName, R as RelativeTime, k as DocumentRBAC,
|
8
|
+
import { b as useDoc, e as useDocumentRBAC, m as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, d as contentManagerApi, j as PERMISSIONS, t as getDisplayName, R as RelativeTime, k as DocumentRBAC, J as useDocument, f as useDocumentLayout, o as useGetContentTypeConfigurationQuery, c as buildValidParams } from "./index-Dv4oDn11.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-Dn4ThnFB.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-BcPI8XhI.mjs";
|
15
15
|
const StyledAlert = styled(Alert).attrs({ closeLabel: "Close", onClose: () => {
|
16
16
|
} })`
|
17
17
|
button {
|
@@ -37,7 +37,7 @@ const CustomRelationInput = (props) => {
|
|
37
37
|
} : field.value;
|
38
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, { 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,7 +46,7 @@ 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
51
|
const href = `../${COLLECTION_TYPES}/${props.attribute.targetModel}/${relationData.documentId}`;
|
52
52
|
const label = getRelationLabel(relationData, props.mainField);
|
@@ -62,14 +62,15 @@ const CustomRelationInput = (props) => {
|
|
62
62
|
background: "neutral150",
|
63
63
|
justifyContent: "space-between",
|
64
64
|
children: [
|
65
|
-
/* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { description: label, children: /* @__PURE__ */ jsx(LinkEllipsis, {
|
65
|
+
/* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { description: label, children: /* @__PURE__ */ jsx(LinkEllipsis, { tag: NavLink, to: href, children: label }) }) }),
|
66
66
|
/* @__PURE__ */ jsx(DocumentStatus, { status: relationData.status })
|
67
67
|
]
|
68
68
|
},
|
69
69
|
relationData.documentId
|
70
70
|
);
|
71
71
|
}) }),
|
72
|
-
meta.missingCount > 0 && /* @
|
72
|
+
meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
|
73
|
+
/* @__PURE__ */ jsx(
|
73
74
|
StyledAlert,
|
74
75
|
{
|
75
76
|
marginTop: 1,
|
@@ -165,7 +166,7 @@ const VersionInputRenderer = ({
|
|
165
166
|
const addedAttributes = version.meta.unknownAttributes.added;
|
166
167
|
if (Object.keys(addedAttributes).includes(props.name)) {
|
167
168
|
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
168
|
-
/* @__PURE__ */ jsx(
|
169
|
+
/* @__PURE__ */ jsx(Field.Label, { children: props.label }),
|
169
170
|
/* @__PURE__ */ jsx(
|
170
171
|
StyledAlert,
|
171
172
|
{
|
@@ -211,7 +212,7 @@ const VersionInputRenderer = ({
|
|
211
212
|
}
|
212
213
|
switch (props.type) {
|
213
214
|
case "blocks":
|
214
|
-
return /* @__PURE__ */ jsx(
|
215
|
+
return /* @__PURE__ */ jsx(MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
215
216
|
case "component":
|
216
217
|
const { layout } = componentsLayout[props.attribute.component];
|
217
218
|
const [remainingFieldsLayout] = getRemaingFieldsLayout({
|
@@ -221,7 +222,7 @@ const VersionInputRenderer = ({
|
|
221
222
|
schemaAttributes: components[props.attribute.component].attributes
|
222
223
|
});
|
223
224
|
return /* @__PURE__ */ jsx(
|
224
|
-
|
225
|
+
MemoizedComponentInput,
|
225
226
|
{
|
226
227
|
...props,
|
227
228
|
layout: [...layout, ...remainingFieldsLayout || []],
|
@@ -235,9 +236,9 @@ const VersionInputRenderer = ({
|
|
235
236
|
case "relation":
|
236
237
|
return /* @__PURE__ */ jsx(CustomRelationInput, { ...props, hint, disabled: fieldIsDisabled });
|
237
238
|
case "richtext":
|
238
|
-
return /* @__PURE__ */ jsx(
|
239
|
+
return /* @__PURE__ */ jsx(MemoizedWysiwyg, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
239
240
|
case "uid":
|
240
|
-
return /* @__PURE__ */ jsx(
|
241
|
+
return /* @__PURE__ */ jsx(MemoizedUIDInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
241
242
|
case "enumeration":
|
242
243
|
return /* @__PURE__ */ jsx(
|
243
244
|
InputRenderer,
|
@@ -528,18 +529,10 @@ const VersionHeader = ({ headerId }) => {
|
|
528
529
|
locale: version.locale?.name
|
529
530
|
}
|
530
531
|
) }),
|
531
|
-
navigationAction: /* @__PURE__ */ jsx(
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
as: NavLink,
|
536
|
-
to: getNextNavigation(),
|
537
|
-
children: formatMessage({
|
538
|
-
id: "global.back",
|
539
|
-
defaultMessage: "Back"
|
540
|
-
})
|
541
|
-
}
|
542
|
-
),
|
532
|
+
navigationAction: /* @__PURE__ */ jsx(Link, { startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}), tag: NavLink, to: getNextNavigation(), isExternal: false, children: formatMessage({
|
533
|
+
id: "global.back",
|
534
|
+
defaultMessage: "Back"
|
535
|
+
}) }),
|
543
536
|
sticky: false,
|
544
537
|
primaryAction: /* @__PURE__ */ jsx(
|
545
538
|
Button,
|
@@ -648,23 +641,24 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
648
641
|
borderWidth: "1px",
|
649
642
|
borderStyle: "solid",
|
650
643
|
borderColor: isActive ? "primary600" : "neutral200",
|
644
|
+
color: "neutral800",
|
651
645
|
paddingTop: 4,
|
652
646
|
paddingBottom: 4,
|
653
647
|
paddingLeft: 5,
|
654
648
|
paddingRight: 5,
|
655
|
-
|
649
|
+
tag: Link$1,
|
656
650
|
to: `?${stringify({ ...query, id: version.id })}`,
|
657
651
|
style: { textDecoration: "none" },
|
658
652
|
children: [
|
659
653
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
|
660
|
-
/* @__PURE__ */ jsx(Typography, {
|
654
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
|
661
655
|
day: "numeric",
|
662
656
|
month: "numeric",
|
663
657
|
year: "numeric",
|
664
658
|
hour: "2-digit",
|
665
659
|
minute: "2-digit"
|
666
660
|
}) }),
|
667
|
-
/* @__PURE__ */ jsx(Typography, {
|
661
|
+
/* @__PURE__ */ jsx(Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
|
668
662
|
{
|
669
663
|
id: "content-manager.history.sidebar.versionDescription",
|
670
664
|
defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
|
@@ -720,7 +714,7 @@ const VersionsList = () => {
|
|
720
714
|
borderColor: "neutral200",
|
721
715
|
borderWidth: "0 0 0 1px",
|
722
716
|
borderStyle: "solid",
|
723
|
-
|
717
|
+
tag: "aside",
|
724
718
|
children: [
|
725
719
|
/* @__PURE__ */ jsxs(
|
726
720
|
Flex,
|
@@ -731,9 +725,9 @@ const VersionsList = () => {
|
|
731
725
|
borderColor: "neutral200",
|
732
726
|
borderWidth: "0 0 1px",
|
733
727
|
borderStyle: "solid",
|
734
|
-
|
728
|
+
tag: "header",
|
735
729
|
children: [
|
736
|
-
/* @__PURE__ */ jsx(Typography, {
|
730
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
|
737
731
|
id: "content-manager.history.sidebar.title",
|
738
732
|
defaultMessage: "Versions"
|
739
733
|
}) }),
|
@@ -755,7 +749,7 @@ const VersionsList = () => {
|
|
755
749
|
paddingBottom: 5,
|
756
750
|
paddingLeft: 4,
|
757
751
|
paddingRight: 4,
|
758
|
-
|
752
|
+
tag: "ul",
|
759
753
|
alignItems: "stretch",
|
760
754
|
children: versions.data.map((version, index) => /* @__PURE__ */ jsx(
|
761
755
|
"li",
|
@@ -931,4 +925,4 @@ export {
|
|
931
925
|
ProtectedHistoryPage,
|
932
926
|
useHistoryContext
|
933
927
|
};
|
934
|
-
//# sourceMappingURL=History-
|
928
|
+
//# sourceMappingURL=History-CwWN_uNp.mjs.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"History-CwWN_uNp.mjs","sources":["../../admin/src/history/components/VersionInputRenderer.tsx","../../admin/src/history/components/VersionContent.tsx","../../admin/src/history/services/historyVersion.ts","../../admin/src/history/components/VersionHeader.tsx","../../admin/src/history/components/VersionsList.tsx","../../admin/src/history/pages/History.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport {\n useStrapiApp,\n useForm,\n InputRenderer as FormInputRenderer,\n useField,\n Form,\n} from '@strapi/admin/strapi-admin';\nimport { Alert, Box, Field, Flex, Link, Tooltip } 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: () => {} })`\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 const formattedFieldValue = Array.isArray(field.value)\n ? {\n results: field.value,\n meta: { missingCount: 0 },\n }\n : field.value;\n\n if (\n !formattedFieldValue ||\n (formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0)\n ) {\n return (\n <>\n <Field.Label>{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 href = `../${COLLECTION_TYPES}/${props.attribute.targetModel}/${relationData.documentId}`;\n const label = getRelationLabel(relationData, props.mainField);\n\n return (\n <Flex\n key={relationData.documentId}\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 description={label}>\n <LinkEllipsis tag={NavLink} to={href}>\n {label}\n </LinkEllipsis>\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 {\n value: { results, meta },\n } = useField(props.name);\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 * @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 ...props\n}: VersionInputRendererProps) => {\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 // @ts-expect-error – TODO: fix this type error in the useLazyComponents hook.\n return <CustomInput {...props} hint={hint} disabled={fieldIsDisabled} />;\n }\n\n return (\n <FormInputRenderer\n {...props}\n hint={hint}\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 <CustomMediaInput {...props} disabled={fieldIsDisabled} />;\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 // @ts-expect-error – TODO: fix this type error in the useLibrary hook.\n return <CustomInput {...props} hint={hint} disabled={fieldIsDisabled} />;\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 disabled={fieldIsDisabled}\n >\n {(inputProps) => <VersionInputRenderer {...inputProps} shouldIgnoreRBAC={true} />}\n </ComponentInput>\n );\n case 'dynamiczone':\n return <DynamicZone {...props} hint={hint} disabled={fieldIsDisabled} />;\n case 'relation':\n return <CustomRelationInput {...props} hint={hint} disabled={fieldIsDisabled} />;\n case 'richtext':\n return <Wysiwyg {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\n case 'uid':\n return <UIDInput {...props} hint={hint} type={props.type} disabled={fieldIsDisabled} />;\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 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 // @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, GridItem, 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 key={field.name} gap={4}>\n <GridItem col={12} s={12} xs={12}>\n <VersionInputRenderer {...field} />\n </GridItem>\n </Grid>\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 key={gridRowIndex} gap={4}>\n {row.map(({ size, ...field }) => {\n return (\n <GridItem col={size} key={field.name} s={12} xs={12}>\n <VersionInputRenderer {...field} />\n </GridItem>\n );\n })}\n </Grid>\n ))}\n </Flex>\n </Box>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * VersionContent\n * -----------------------------------------------------------------------------------------------*/\n\ntype UnknownField = EditFieldLayout & { shouldIgnoreRBAC: boolean };\n\nconst VersionContent = () => {\n const { formatMessage } = useIntl();\n const { fieldSizes } = useTypedSelector((state) => state['content-manager'].app);\n const version = useHistoryContext('VersionContent', (state) => state.selectedVersion);\n const layout = useHistoryContext('VersionContent', (state) => state.layout);\n const configuration = useHistoryContext('VersionContent', (state) => state.configuration);\n const schema = useHistoryContext('VersionContent', (state) => state.schema);\n\n // Build a layout for the unknown fields section\n const removedAttributes = version.meta.unknownAttributes.removed;\n const removedAttributesAsFields = Object.entries(removedAttributes).map(\n ([attributeName, attribute]) => {\n const field = {\n attribute,\n shouldIgnoreRBAC: true,\n type: attribute.type,\n visible: true,\n disabled: true,\n label: attributeName,\n name: attributeName,\n size: fieldSizes[attribute.type].default ?? 12,\n } as UnknownField;\n\n return field;\n }\n );\n const unknownFieldsLayout = createLayoutFromFields(removedAttributesAsFields);\n\n // Build a layout for the fields that are were deleted from the layout\n const remainingFieldsLayout = getRemaingFieldsLayout({\n metadatas: configuration.contentType.metadatas,\n layout,\n schemaAttributes: schema.attributes,\n fieldSizes,\n });\n\n const { components } = useDoc();\n\n /**\n * Transform the data before passing it to the form so that each field\n * has a uniquely generated key\n */\n const transformedData = React.useMemo(() => {\n const transform =\n (schemaAttributes: Schema.Attributes, components: ComponentsDictionary = {}) =>\n (document: Omit<Document, 'id'>) => {\n const schema = { attributes: schemaAttributes };\n const transformations = pipe(\n removeFieldsThatDontExistOnSchema(schema),\n prepareTempKeys(schema, components)\n );\n return transformations(document);\n };\n\n return transform(version.schema, components)(version.data);\n }, [components, version.data, version.schema]);\n\n return (\n <Layouts.Content>\n <Box paddingBottom={8}>\n <Form disabled={true} method=\"PUT\" initialValues={transformedData}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6} position=\"relative\">\n {[...layout, ...remainingFieldsLayout].map((panel, index) => {\n return <FormPanel key={index} panel={panel} />;\n })}\n </Flex>\n </Form>\n </Box>\n {removedAttributesAsFields.length > 0 && (\n <>\n <Divider />\n <Box paddingTop={8}>\n <Flex direction=\"column\" alignItems=\"flex-start\" paddingBottom={6} gap={1}>\n <Typography variant=\"delta\">\n {formatMessage({\n id: 'content-manager.history.content.unknown-fields.title',\n defaultMessage: 'Unknown fields',\n })}\n </Typography>\n <Typography variant=\"pi\">\n {formatMessage(\n {\n id: 'content-manager.history.content.unknown-fields.message',\n defaultMessage:\n 'These fields have been deleted or renamed in the Content-Type Builder. <b>These fields will not be restored.</b>',\n },\n {\n b: (chunks: React.ReactNode) => (\n <Typography variant=\"pi\" fontWeight=\"bold\">\n {chunks}\n </Typography>\n ),\n }\n )}\n </Typography>\n </Flex>\n <Form disabled={true} method=\"PUT\" initialValues={version.data}>\n <Flex direction=\"column\" alignItems=\"stretch\" gap={6} position=\"relative\">\n {unknownFieldsLayout.map((panel, index) => {\n return <FormPanel key={index} panel={panel} />;\n })}\n </Flex>\n </Form>\n </Box>\n </>\n )}\n </Layouts.Content>\n );\n};\n\nexport { VersionContent, getRemaingFieldsLayout };\n","import { Data } from '@strapi/types';\n\nimport {\n GetHistoryVersions,\n RestoreHistoryVersion,\n} from '../../../../shared/contracts/history-versions';\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { contentManagerApi } from '../../services/api';\n\ninterface RestoreVersion extends RestoreHistoryVersion.Request {\n documentId: Data.ID;\n collectionType?: string;\n}\n\nconst historyVersionsApi = contentManagerApi.injectEndpoints({\n endpoints: (builder) => ({\n getHistoryVersions: builder.query<\n GetHistoryVersions.Response,\n GetHistoryVersions.Request['query']\n >({\n query(params) {\n return {\n url: `/content-manager/history-versions`,\n method: 'GET',\n config: {\n params,\n },\n };\n },\n providesTags: ['HistoryVersion'],\n }),\n restoreVersion: builder.mutation<RestoreHistoryVersion.Response, RestoreVersion>({\n query({ params, body }) {\n return {\n url: `/content-manager/history-versions/${params.versionId}/restore`,\n method: 'PUT',\n data: body,\n };\n },\n invalidatesTags: (_res, _error, { documentId, collectionType, params }) => {\n return [\n 'HistoryVersion',\n {\n type: 'Document',\n id:\n collectionType === COLLECTION_TYPES\n ? `${params.contentType}_${documentId}`\n : params.contentType,\n },\n ];\n },\n }),\n }),\n});\n\nconst { useGetHistoryVersionsQuery, useRestoreVersionMutation } = historyVersionsApi;\n\nexport { useGetHistoryVersionsQuery, useRestoreVersionMutation };\n","import * as React from 'react';\n\nimport {\n ConfirmDialog,\n useNotification,\n useQueryParams,\n useRBAC,\n Layouts,\n} from '@strapi/admin/strapi-admin';\nimport { Button, Typography, Flex, Link } from '@strapi/design-system';\nimport { ArrowLeft, WarningCircle } from '@strapi/icons';\nimport { UID } from '@strapi/types';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { NavLink, useNavigate, useParams, type To } from 'react-router-dom';\n\nimport { COLLECTION_TYPES } from '../../constants/collections';\nimport { PERMISSIONS } from '../../constants/plugin';\nimport { useHistoryContext } from '../pages/History';\nimport { useRestoreVersionMutation } from '../services/historyVersion';\n\ninterface VersionHeaderProps {\n headerId: string;\n}\n\nexport const VersionHeader = ({ headerId }: VersionHeaderProps) => {\n const [isConfirmDialogOpen, setIsConfirmDialogOpen] = React.useState(false);\n const navigate = useNavigate();\n const { formatMessage, formatDate } = useIntl();\n const { toggleNotification } = useNotification();\n const [{ query }] = useQueryParams<{\n plugins?: Record<string, unknown>;\n }>();\n const { collectionType, slug } = useParams<{ collectionType: string; slug: UID.ContentType }>();\n const [restoreVersion, { isLoading }] = useRestoreVersionMutation();\n const { allowedActions } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));\n\n const version = useHistoryContext('VersionHeader', (state) => state.selectedVersion);\n const mainField = useHistoryContext('VersionHeader', (state) => state.mainField);\n const schema = useHistoryContext('VersionHeader', (state) => state.schema);\n const isCurrentVersion = useHistoryContext(\n 'VersionHeader',\n (state) => state.page === 1 && state.versions.data[0].id === state.selectedVersion.id\n );\n\n const mainFieldValue = version.data[mainField];\n\n const getNextNavigation = (): To => {\n const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });\n\n if (collectionType === COLLECTION_TYPES) {\n return {\n pathname: `/content-manager/${collectionType}/${version.contentType}/${version.relatedDocumentId}`,\n search: pluginsQueryParams,\n };\n }\n\n return {\n pathname: `/content-manager/${collectionType}/${version.contentType}`,\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());\n\n toggleNotification({\n type: 'success',\n title: formatMessage({\n id: 'content-manager.restore.success.title',\n defaultMessage: 'Version restored.',\n }),\n message: formatMessage({\n id: 'content-manager.restore.success.message',\n defaultMessage: 'The content of the restored version is not published yet.',\n }),\n });\n }\n\n if ('error' in response) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({\n id: 'content-manager.history.restore.error.message',\n defaultMessage: 'Could not restore version.',\n }),\n });\n }\n } catch (error) {\n toggleNotification({\n type: 'danger',\n message: formatMessage({ id: 'notification.error', defaultMessage: 'An error occurred' }),\n });\n }\n };\n\n return (\n <>\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\">\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 startIcon={<ArrowLeft />} tag={NavLink} to={getNextNavigation()} isExternal={false}>\n {formatMessage({\n id: 'global.back',\n defaultMessage: 'Back',\n })}\n </Link>\n }\n sticky={false}\n primaryAction={\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 }\n />\n <ConfirmDialog\n isOpen={isConfirmDialogOpen}\n onClose={() => setIsConfirmDialogOpen(false)}\n onConfirm={handleRestore}\n icon={<WarningCircle />}\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 <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 </>\n );\n};\n","import * as React from 'react';\n\nimport { useQueryParams } from '@strapi/admin/strapi-admin';\nimport { Box, Flex, Typography, type BoxProps } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { type MessageDescriptor, useIntl } from 'react-intl';\nimport { Link } from 'react-router-dom';\n\nimport { RelativeTime } from '../../components/RelativeTime';\nimport { getDisplayName } from '../../utils/users';\nimport { useHistoryContext } from '../pages/History';\n\nimport type { HistoryVersions } from '../../../../shared/contracts';\n\n/* -------------------------------------------------------------------------------------------------\n * BlueText\n * -----------------------------------------------------------------------------------------------*/\n\nconst BlueText = (children: React.ReactNode) => (\n <Typography textColor=\"primary600\">{children}</Typography>\n);\n\n/* -------------------------------------------------------------------------------------------------\n * VersionCard\n * -----------------------------------------------------------------------------------------------*/\n\ninterface StatusData {\n background: BoxProps['background'];\n border: BoxProps['borderColor'];\n text: BoxProps['color'];\n message: MessageDescriptor;\n}\n\ninterface VersionCardProps {\n version: HistoryVersions.HistoryVersionDataResponse;\n isCurrent: boolean;\n}\n\nconst VersionCard = ({ version, isCurrent }: VersionCardProps) => {\n const { formatDate, formatMessage } = useIntl();\n const [{ query }] = useQueryParams<{ id?: string }>();\n\n const statusData = ((): StatusData => {\n switch (version.status) {\n case 'draft':\n return {\n background: 'secondary100',\n border: 'secondary200',\n text: 'secondary700',\n message: {\n id: 'content-manager.containers.List.draft',\n defaultMessage: 'Draft',\n },\n };\n case 'modified':\n return {\n background: 'alternative100',\n border: 'alternative200',\n text: 'alternative700',\n message: {\n // TODO: check the translation key once D&P v5 is done\n id: 'content-manager.containers.List.modified',\n defaultMessage: 'Modified',\n },\n };\n case 'published':\n default:\n return {\n background: 'success100',\n border: 'success200',\n text: 'success700',\n message: {\n id: 'content-manager.containers.List.published',\n defaultMessage: 'Published',\n },\n };\n }\n })();\n const isActive = query.id === version.id.toString();\n const author = version.createdBy && getDisplayName(version.createdBy);\n\n return (\n <Flex\n direction=\"column\"\n alignItems=\"flex-start\"\n gap={3}\n hasRadius\n borderWidth=\"1px\"\n borderStyle=\"solid\"\n borderColor={isActive ? 'primary600' : 'neutral200'}\n color=\"neutral800\"\n paddingTop={4}\n paddingBottom={4}\n paddingLeft={5}\n paddingRight={5}\n tag={Link}\n to={`?${stringify({ ...query, id: version.id })}`}\n style={{ textDecoration: 'none' }}\n >\n <Flex direction=\"column\" gap={1} alignItems=\"flex-start\">\n <Typography tag=\"h3\" fontWeight=\"semiBold\">\n {formatDate(version.createdAt, {\n day: 'numeric',\n month: 'numeric',\n year: 'numeric',\n hour: '2-digit',\n minute: '2-digit',\n })}\n </Typography>\n <Typography tag=\"p\" variant=\"pi\" textColor=\"neutral600\">\n {formatMessage(\n {\n id: 'content-manager.history.sidebar.versionDescription',\n defaultMessage:\n '{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}',\n },\n {\n distanceToNow: <RelativeTime timestamp={new Date(version.createdAt)} />,\n author,\n isAnonymous: !Boolean(version.createdBy),\n isCurrent,\n b: BlueText,\n }\n )}\n </Typography>\n </Flex>\n {version.status && (\n <Box\n background={statusData.background}\n borderStyle=\"solid\"\n borderWidth=\"1px\"\n borderColor={statusData.border}\n hasRadius\n paddingLeft=\"6px\"\n paddingRight=\"6px\"\n paddingTop=\"2px\"\n paddingBottom=\"2px\"\n >\n <Typography variant=\"pi\" fontWeight=\"bold\" textColor={statusData.text}>\n {formatMessage(statusData.message)}\n </Typography>\n </Box>\n )}\n </Flex>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * PaginationButton\n * -----------------------------------------------------------------------------------------------*/\n\ninterface PaginationButtonProps {\n page: number;\n children: React.ReactNode;\n}\n\nconst PaginationButton = ({ page, children }: PaginationButtonProps) => {\n const [{ query }] = useQueryParams<{ id?: string }>();\n\n // Remove the id from the pagination link, so that the history page can redirect\n // to the id of the first history version in the new page once it's loaded\n const { id: _id, ...queryRest } = query;\n\n return (\n <Link to={{ search: stringify({ ...queryRest, page }) }} style={{ textDecoration: 'none' }}>\n <Typography variant=\"omega\" textColor=\"primary600\">\n {children}\n </Typography>\n </Link>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * VersionsList\n * -----------------------------------------------------------------------------------------------*/\n\nconst VersionsList = () => {\n const { formatMessage } = useIntl();\n const { versions, page } = useHistoryContext('VersionsList', (state) => ({\n versions: state.versions,\n page: state.page,\n }));\n\n return (\n <Flex\n shrink={0}\n direction=\"column\"\n alignItems=\"stretch\"\n width=\"320px\"\n height=\"100vh\"\n background=\"neutral0\"\n borderColor=\"neutral200\"\n borderWidth=\"0 0 0 1px\"\n borderStyle=\"solid\"\n tag=\"aside\"\n >\n <Flex\n direction=\"row\"\n justifyContent=\"space-between\"\n padding={4}\n borderColor=\"neutral200\"\n borderWidth=\"0 0 1px\"\n borderStyle=\"solid\"\n tag=\"header\"\n >\n <Typography tag=\"h2\" variant=\"omega\" fontWeight=\"semiBold\">\n {formatMessage({\n id: 'content-manager.history.sidebar.title',\n defaultMessage: 'Versions',\n })}\n </Typography>\n <Box background=\"neutral150\" hasRadius padding={1}>\n <Typography variant=\"sigma\" textColor=\"neutral600\">\n {versions.meta.pagination.total}\n </Typography>\n </Box>\n </Flex>\n <Box flex={1} overflow=\"auto\">\n {versions.meta.pagination.page > 1 && (\n <Box paddingTop={4} textAlign=\"center\">\n <PaginationButton page={page - 1}>\n {formatMessage({\n id: 'content-manager.history.sidebar.show-newer',\n defaultMessage: 'Show newer versions',\n })}\n </PaginationButton>\n </Box>\n )}\n <Flex\n direction=\"column\"\n gap={3}\n paddingTop={5}\n paddingBottom={5}\n paddingLeft={4}\n paddingRight={4}\n tag=\"ul\"\n alignItems=\"stretch\"\n >\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={5} 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 } from '@strapi/design-system';\nimport { stringify } from 'qs';\nimport { useIntl } from 'react-intl';\nimport { Navigate, useParams } 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 <Page.NoData />;\n }\n\n // We have data, handle selected version\n if (versionsResponse.data?.data?.length && !selectedVersionId) {\n return (\n <Navigate\n to={{ search: stringify({ ...query, id: versionsResponse.data.data[0].id }) }}\n replace\n />\n );\n }\n\n const selectedVersion = versionsResponse.data?.data?.find(\n (version) => version.id.toString() === selectedVersionId\n );\n if (\n versionsResponse.isError ||\n !layout ||\n !schema ||\n !selectedVersion ||\n !configuration ||\n // This should not happen as it's covered by versionsResponse.isError, but we need it for TS\n versionsResponse.data.error\n ) {\n return <Page.Error />;\n }\n\n return (\n <>\n <Page.Title>\n {formatMessage(\n {\n id: 'content-manager.history.page-title',\n defaultMessage: '{contentType} history',\n },\n {\n contentType: displayName,\n }\n )}\n </Page.Title>\n <HistoryProvider\n contentType={slug}\n id={documentId}\n schema={schema}\n layout={layout}\n configuration={configuration}\n selectedVersion={selectedVersion}\n versions={versionsResponse.data}\n page={page}\n mainField={mainField}\n >\n <Flex direction=\"row\" alignItems=\"flex-start\">\n <Main\n grow={1}\n height=\"100vh\"\n background=\"neutral100\"\n paddingBottom={6}\n overflow=\"auto\"\n labelledBy={headerId}\n >\n <VersionHeader headerId={headerId} />\n <VersionContent />\n </Main>\n <VersionsList />\n </Flex>\n </HistoryProvider>\n </>\n );\n};\n\n/* -------------------------------------------------------------------------------------------------\n * ProtectedHistoryPage\n * -----------------------------------------------------------------------------------------------*/\n\nconst ProtectedHistoryPageImpl = () => {\n const { slug } = useParams<{\n slug: string;\n }>();\n const {\n permissions = [],\n isLoading,\n error,\n } = useRBAC(PERMISSIONS.map((action) => ({ action, subject: slug })));\n\n if (isLoading) {\n return <Page.Loading />;\n }\n\n if (error || !slug) {\n return (\n <Box\n height=\"100vh\"\n width=\"100vw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={2}\n background=\"neutral0\"\n >\n <Page.Error />\n </Box>\n );\n }\n\n return (\n <Box\n height=\"100vh\"\n width=\"100vw\"\n position=\"fixed\"\n top={0}\n left={0}\n zIndex={2}\n background=\"neutral0\"\n >\n <Page.Protect permissions={permissions}>\n {({ permissions }) => (\n <DocumentRBAC permissions={permissions}>\n <HistoryPage />\n </DocumentRBAC>\n )}\n </Page.Protect>\n </Box>\n );\n};\n\nconst ProtectedHistoryPage = () => {\n return (\n <Portal>\n <FocusTrap>\n <ProtectedHistoryPageImpl />\n </FocusTrap>\n </Portal>\n );\n};\n\nexport { ProtectedHistoryPage, HistoryProvider, useHistoryContext };\nexport type { HistoryContextValue };\n"],"names":["FormInputRenderer","BlocksInput","ComponentInput","Wysiwyg","UIDInput","components","schema","Link","permissions"],"mappings":";;;;;;;;;;;;;;AA0CA,MAAM,cAAc,OAAO,KAAK,EAAE,MAAM,EAAE,YAAY,SAAS,SAAS,MAAM;AAAC,EAAA,CAAG;AAAA;AAAA;AAAA;AAAA;AAUlF,MAAM,eAAe,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAWhC,MAAM,sBAAsB,CAAC,UAA+B;AACpD,QAAA,EAAE,kBAAkB;AACpB,QAAA,QAAQ,SAEZ,MAAM,IAAI;AAMZ,QAAM,sBAAsB,MAAM,QAAQ,MAAM,KAAK,IACjD;AAAA,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AA,IACA;AAAA,EACF,IAAI,QAAQ,YAAY,IAAI,CAAC,YAAY,EAAE,QAAQ,SAAS,OAAO,CAAC;AAEpE,MAAI,WAAW;AACN,WAAA,oBAAC,KAAK,SAAL,CAAa,CAAA;AAAA,EACvB;AAEI,MAAA,SAAS,CAAC,MAAM;AAEhB,WAAA;AAAA,MAAC;AAAA,MAAA;AAAA,QACC,QAAO;AAAA,QACP,OAAM;AAAA,QACN,UAAS;AAAA,QACT,KAAK;AAAA,QACL,MAAM;AAAA,QACN,QAAQ;AAAA,QACR,YAAW;AAAA,QAEX,UAAA,oBAAC,KAAK,OAAL,CAAA,CAAW;AAAA,MAAA;AAAA,IAAA;AAAA,EAGlB;AAGE,SAAA;AAAA,IAAC;AAAA,IAAA;AAAA,MACC,QAAO;AAAA,MACP,OAAM;AAAA,MACN,UAAS;AAAA,MACT,KAAK;AAAA,MACL,MAAM;AAAA,MACN,QAAQ;AAAA,MACR,YAAW;AAAA,MAEX,8BAAC,KAAK,SAAL,EAAa,aACX,WAAC,EAAE,aAAAC,aAAY,0BACb,cAAa,EAAA,aAAaA,cACzB,UAAC,oBAAA,aAAA,CAAA,CAAY,EACf,CAAA,GAEJ;AAAA,IAAA;AAAA,EAAA;AAGN;AAEA,MAAM,uBAAuB,MAAM;AACjC,6BACG,QACC,EAAA,UAAA,oBAAC,aACC,UAAC,oBAAA,0BAAA,CAAyB,CAAA,EAC5B,CAAA,EACF,CAAA;AAEJ;"}
|
@@ -7,13 +7,13 @@ const designSystem = require("@strapi/design-system");
|
|
7
7
|
const qs = require("qs");
|
8
8
|
const reactIntl = require("react-intl");
|
9
9
|
const reactRouterDom = require("react-router-dom");
|
10
|
-
const index = require("./index-
|
10
|
+
const index = require("./index-BRHpg0az.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-DnJMS8cB.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-CVE30dYt.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
|
-
const StyledAlert = styled__default.default(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
|
38
|
+
const StyledAlert = styledComponents.styled(designSystem.Alert).attrs({ closeLabel: "Close", onClose: () => {
|
40
39
|
} })`
|
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 {
|
@@ -61,7 +60,7 @@ const CustomRelationInput = (props) => {
|
|
61
60
|
} : field.value;
|
62
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, { 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,7 +69,7 @@ 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
74
|
const href = `../${index.COLLECTION_TYPES}/${props.attribute.targetModel}/${relationData.documentId}`;
|
76
75
|
const label = relations.getRelationLabel(relationData, props.mainField);
|
@@ -86,14 +85,15 @@ const CustomRelationInput = (props) => {
|
|
86
85
|
background: "neutral150",
|
87
86
|
justifyContent: "space-between",
|
88
87
|
children: [
|
89
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: label, children: /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, {
|
88
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { description: label, children: /* @__PURE__ */ jsxRuntime.jsx(LinkEllipsis, { tag: reactRouterDom.NavLink, to: href, children: label }) }) }),
|
90
89
|
/* @__PURE__ */ jsxRuntime.jsx(index.DocumentStatus, { status: relationData.status })
|
91
90
|
]
|
92
91
|
},
|
93
92
|
relationData.documentId
|
94
93
|
);
|
95
94
|
}) }),
|
96
|
-
meta.missingCount > 0 && /* @
|
95
|
+
meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
|
96
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
97
97
|
StyledAlert,
|
98
98
|
{
|
99
99
|
marginTop: 1,
|
@@ -189,7 +189,7 @@ const VersionInputRenderer = ({
|
|
189
189
|
const addedAttributes = version.meta.unknownAttributes.added;
|
190
190
|
if (Object.keys(addedAttributes).includes(props.name)) {
|
191
191
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
192
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
192
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
|
193
193
|
/* @__PURE__ */ jsxRuntime.jsx(
|
194
194
|
StyledAlert,
|
195
195
|
{
|
@@ -235,7 +235,7 @@ const VersionInputRenderer = ({
|
|
235
235
|
}
|
236
236
|
switch (props.type) {
|
237
237
|
case "blocks":
|
238
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Field.
|
238
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
239
239
|
case "component":
|
240
240
|
const { layout } = componentsLayout[props.attribute.component];
|
241
241
|
const [remainingFieldsLayout] = getRemaingFieldsLayout({
|
@@ -245,7 +245,7 @@ const VersionInputRenderer = ({
|
|
245
245
|
schemaAttributes: components[props.attribute.component].attributes
|
246
246
|
});
|
247
247
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
248
|
-
Field.
|
248
|
+
Field.MemoizedComponentInput,
|
249
249
|
{
|
250
250
|
...props,
|
251
251
|
layout: [...layout, ...remainingFieldsLayout || []],
|
@@ -259,9 +259,9 @@ const VersionInputRenderer = ({
|
|
259
259
|
case "relation":
|
260
260
|
return /* @__PURE__ */ jsxRuntime.jsx(CustomRelationInput, { ...props, hint, disabled: fieldIsDisabled });
|
261
261
|
case "richtext":
|
262
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Field.
|
262
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedWysiwyg, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
263
263
|
case "uid":
|
264
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Field.
|
264
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedUIDInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
265
265
|
case "enumeration":
|
266
266
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
267
267
|
strapiAdmin.InputRenderer,
|
@@ -552,18 +552,10 @@ const VersionHeader = ({ headerId }) => {
|
|
552
552
|
locale: version.locale?.name
|
553
553
|
}
|
554
554
|
) }),
|
555
|
-
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(
|
556
|
-
|
557
|
-
|
558
|
-
|
559
|
-
as: reactRouterDom.NavLink,
|
560
|
-
to: getNextNavigation(),
|
561
|
-
children: formatMessage({
|
562
|
-
id: "global.back",
|
563
|
-
defaultMessage: "Back"
|
564
|
-
})
|
565
|
-
}
|
566
|
-
),
|
555
|
+
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowLeft, {}), tag: reactRouterDom.NavLink, to: getNextNavigation(), isExternal: false, children: formatMessage({
|
556
|
+
id: "global.back",
|
557
|
+
defaultMessage: "Back"
|
558
|
+
}) }),
|
567
559
|
sticky: false,
|
568
560
|
primaryAction: /* @__PURE__ */ jsxRuntime.jsx(
|
569
561
|
designSystem.Button,
|
@@ -672,23 +664,24 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
672
664
|
borderWidth: "1px",
|
673
665
|
borderStyle: "solid",
|
674
666
|
borderColor: isActive ? "primary600" : "neutral200",
|
667
|
+
color: "neutral800",
|
675
668
|
paddingTop: 4,
|
676
669
|
paddingBottom: 4,
|
677
670
|
paddingLeft: 5,
|
678
671
|
paddingRight: 5,
|
679
|
-
|
672
|
+
tag: reactRouterDom.Link,
|
680
673
|
to: `?${qs.stringify({ ...query, id: version.id })}`,
|
681
674
|
style: { textDecoration: "none" },
|
682
675
|
children: [
|
683
676
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
|
684
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
677
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
|
685
678
|
day: "numeric",
|
686
679
|
month: "numeric",
|
687
680
|
year: "numeric",
|
688
681
|
hour: "2-digit",
|
689
682
|
minute: "2-digit"
|
690
683
|
}) }),
|
691
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
684
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
|
692
685
|
{
|
693
686
|
id: "content-manager.history.sidebar.versionDescription",
|
694
687
|
defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
|
@@ -744,7 +737,7 @@ const VersionsList = () => {
|
|
744
737
|
borderColor: "neutral200",
|
745
738
|
borderWidth: "0 0 0 1px",
|
746
739
|
borderStyle: "solid",
|
747
|
-
|
740
|
+
tag: "aside",
|
748
741
|
children: [
|
749
742
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
750
743
|
designSystem.Flex,
|
@@ -755,9 +748,9 @@ const VersionsList = () => {
|
|
755
748
|
borderColor: "neutral200",
|
756
749
|
borderWidth: "0 0 1px",
|
757
750
|
borderStyle: "solid",
|
758
|
-
|
751
|
+
tag: "header",
|
759
752
|
children: [
|
760
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
753
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
|
761
754
|
id: "content-manager.history.sidebar.title",
|
762
755
|
defaultMessage: "Versions"
|
763
756
|
}) }),
|
@@ -779,7 +772,7 @@ const VersionsList = () => {
|
|
779
772
|
paddingBottom: 5,
|
780
773
|
paddingLeft: 4,
|
781
774
|
paddingRight: 4,
|
782
|
-
|
775
|
+
tag: "ul",
|
783
776
|
alignItems: "stretch",
|
784
777
|
children: versions.data.map((version, index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
785
778
|
"li",
|
@@ -953,4 +946,4 @@ const ProtectedHistoryPage = () => {
|
|
953
946
|
exports.HistoryProvider = HistoryProvider;
|
954
947
|
exports.ProtectedHistoryPage = ProtectedHistoryPage;
|
955
948
|
exports.useHistoryContext = useHistoryContext;
|
956
|
-
//# sourceMappingURL=History-
|
949
|
+
//# sourceMappingURL=History-DShoVAh0.js.map
|