@strapi/content-manager 0.0.0-experimental.a65a85fdea97faae8679d3ffc5f9d79af61abd26 → 0.0.0-experimental.a9a5a36dd73072c19eadeff5f387e8286b2a4d22
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--2aLCv-G.mjs → ComponentConfigurationPage-B1bIXVuX.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage--2aLCv-G.mjs.map → ComponentConfigurationPage-B1bIXVuX.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-43KmCNQE.js → ComponentConfigurationPage-Bqgx7Mes.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-43KmCNQE.js.map → ComponentConfigurationPage-Bqgx7Mes.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-BfFzJ4Br.js → EditConfigurationPage-BFEwvdMW.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BfFzJ4Br.js.map → EditConfigurationPage-BFEwvdMW.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CUcGHHvQ.mjs → EditConfigurationPage-ZO0vOO8q.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CUcGHHvQ.mjs.map → EditConfigurationPage-ZO0vOO8q.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-CzOT5Kpj.js → EditViewPage-DA95Ha6J.js} +46 -48
- package/dist/_chunks/EditViewPage-DA95Ha6J.js.map +1 -0
- package/dist/_chunks/{EditViewPage-Bm8lgcm6.mjs → EditViewPage-DlLEyUL6.mjs} +47 -47
- package/dist/_chunks/EditViewPage-DlLEyUL6.mjs.map +1 -0
- package/dist/_chunks/{Field-Caef4JjM.js → Field-CnK8dO8N.js} +948 -777
- package/dist/_chunks/Field-CnK8dO8N.js.map +1 -0
- package/dist/_chunks/{Field-Dlh0uGnL.mjs → Field-Dq7bDnuh.mjs} +896 -724
- package/dist/_chunks/Field-Dq7bDnuh.mjs.map +1 -0
- package/dist/_chunks/{Form-EnaQL_6L.mjs → Form-B_JE0dbz.mjs} +43 -41
- package/dist/_chunks/Form-B_JE0dbz.mjs.map +1 -0
- package/dist/_chunks/{Form-BzuAjtRq.js → Form-BpiR4piS.js} +42 -41
- package/dist/_chunks/Form-BpiR4piS.js.map +1 -0
- package/dist/_chunks/{History-D6sbCJvo.mjs → History-CBNGU7a-.mjs} +149 -65
- package/dist/_chunks/History-CBNGU7a-.mjs.map +1 -0
- package/dist/_chunks/{History-C17LiyRg.js → History-DdIstl8b.js} +149 -66
- package/dist/_chunks/History-DdIstl8b.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Ce4qs7qE.mjs → ListConfigurationPage-5dr4qpue.mjs} +58 -58
- package/dist/_chunks/ListConfigurationPage-5dr4qpue.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Dks5SX6f.js → ListConfigurationPage-DkKRparB.js} +61 -62
- package/dist/_chunks/ListConfigurationPage-DkKRparB.js.map +1 -0
- package/dist/_chunks/{ListViewPage-Be7S5aKL.mjs → ListViewPage-DecLrYV6.mjs} +90 -106
- package/dist/_chunks/ListViewPage-DecLrYV6.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BwrZrPsh.js → ListViewPage-wE0lXqoD.js} +95 -111
- package/dist/_chunks/ListViewPage-wE0lXqoD.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-CIPmYQMm.mjs → NoContentTypePage-CiIcfYsd.mjs} +7 -7
- package/dist/_chunks/NoContentTypePage-CiIcfYsd.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Cu5r1-JT.js → NoContentTypePage-DEKR6tf9.js} +5 -5
- package/dist/_chunks/NoContentTypePage-DEKR6tf9.js.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-DhJ7LYrr.mjs → NoPermissionsPage-CM5UD8ee.mjs} +5 -6
- package/dist/_chunks/NoPermissionsPage-CM5UD8ee.mjs.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-C-j6TEUF.js → NoPermissionsPage-DmNfF2Bb.js} +4 -5
- package/dist/_chunks/NoPermissionsPage-DmNfF2Bb.js.map +1 -0
- package/dist/_chunks/{Relations-CY7AtkDA.mjs → Relations-Dqz0C1fz.mjs} +66 -56
- package/dist/_chunks/Relations-Dqz0C1fz.mjs.map +1 -0
- package/dist/_chunks/{Relations-Czs-uZ-s.js → Relations-L0xYRoSQ.js} +70 -61
- package/dist/_chunks/Relations-L0xYRoSQ.js.map +1 -0
- package/dist/_chunks/{en-MBPul9Su.mjs → en-BrCTWlZv.mjs} +11 -4
- package/dist/_chunks/{en-MBPul9Su.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
- package/dist/_chunks/{en-C-V1_90f.js → en-uOUIxfcQ.js} +11 -4
- package/dist/_chunks/{en-C-V1_90f.js.map → en-uOUIxfcQ.js.map} +1 -1
- package/dist/_chunks/{index-DNVx8ssZ.mjs → index-BSn97i8U.mjs} +1644 -911
- package/dist/_chunks/index-BSn97i8U.mjs.map +1 -0
- package/dist/_chunks/{index-X_2tafck.js → index-DyvUPg1a.js} +1622 -890
- package/dist/_chunks/index-DyvUPg1a.js.map +1 -0
- package/dist/_chunks/{layout-Dnh0PNp9.mjs → layout-DPaHUusj.mjs} +32 -27
- package/dist/_chunks/layout-DPaHUusj.mjs.map +1 -0
- package/dist/_chunks/{layout-dBc7wN7L.js → layout-TPqF2oJ5.js} +32 -29
- package/dist/_chunks/layout-TPqF2oJ5.js.map +1 -0
- package/dist/_chunks/{relations-4pHtBrHJ.js → relations-BWYS9gkn.js} +2 -2
- package/dist/_chunks/{relations-4pHtBrHJ.js.map → relations-BWYS9gkn.js.map} +1 -1
- package/dist/_chunks/{relations-Dx7tMKJN.mjs → relations-Ck7-ecDT.mjs} +2 -2
- package/dist/_chunks/{relations-Dx7tMKJN.mjs.map → relations-Ck7-ecDT.mjs.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/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 +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/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +11 -4
- 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/WysiwygStyles.d.ts +59 -52
- 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/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 +547 -416
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +555 -424
- 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 +2 -4
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/index.d.ts +6 -2
- package/dist/server/src/history/services/index.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts +9 -0
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -0
- package/dist/server/src/history/services/utils.d.ts +41 -9
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/history/utils.d.ts +6 -2
- package/dist/server/src/history/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +18 -39
- package/dist/server/src/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 +8 -29
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +18 -39
- 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-Bm8lgcm6.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-CzOT5Kpj.js.map +0 -1
- package/dist/_chunks/Field-Caef4JjM.js.map +0 -1
- package/dist/_chunks/Field-Dlh0uGnL.mjs.map +0 -1
- package/dist/_chunks/Form-BzuAjtRq.js.map +0 -1
- package/dist/_chunks/Form-EnaQL_6L.mjs.map +0 -1
- package/dist/_chunks/History-C17LiyRg.js.map +0 -1
- package/dist/_chunks/History-D6sbCJvo.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Ce4qs7qE.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Dks5SX6f.js.map +0 -1
- package/dist/_chunks/ListViewPage-Be7S5aKL.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BwrZrPsh.js.map +0 -1
- package/dist/_chunks/NoContentTypePage-CIPmYQMm.mjs.map +0 -1
- package/dist/_chunks/NoContentTypePage-Cu5r1-JT.js.map +0 -1
- package/dist/_chunks/NoPermissionsPage-C-j6TEUF.js.map +0 -1
- package/dist/_chunks/NoPermissionsPage-DhJ7LYrr.mjs.map +0 -1
- package/dist/_chunks/Relations-CY7AtkDA.mjs.map +0 -1
- package/dist/_chunks/Relations-Czs-uZ-s.js.map +0 -1
- package/dist/_chunks/index-DNVx8ssZ.mjs.map +0 -1
- package/dist/_chunks/index-X_2tafck.js.map +0 -1
- package/dist/_chunks/layout-Dnh0PNp9.mjs.map +0 -1
- package/dist/_chunks/layout-dBc7wN7L.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
@@ -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-DyvUPg1a.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-CnK8dO8N.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-BWYS9gkn.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 {
|
@@ -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,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,
|
@@ -113,17 +113,13 @@ const CustomRelationInput = (props) => {
|
|
113
113
|
{ number: meta.missingCount }
|
114
114
|
)
|
115
115
|
}
|
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
|
-
}) }) })
|
116
|
+
)
|
121
117
|
] });
|
122
118
|
};
|
123
119
|
const CustomMediaInput = (props) => {
|
124
|
-
const {
|
125
|
-
|
126
|
-
|
120
|
+
const { value } = strapiAdmin.useField(props.name);
|
121
|
+
const results = value ? value.results : [];
|
122
|
+
const meta = value ? value.meta : { missingCount: 0 };
|
127
123
|
const { formatMessage } = reactIntl.useIntl();
|
128
124
|
const fields = strapiAdmin.useStrapiApp("CustomMediaInput", (state) => state.fields);
|
129
125
|
const MediaLibrary = fields.media;
|
@@ -154,12 +150,39 @@ const CustomMediaInput = (props) => {
|
|
154
150
|
)
|
155
151
|
] });
|
156
152
|
};
|
153
|
+
const getLabelAction = (labelAction) => {
|
154
|
+
if (!React__namespace.isValidElement(labelAction)) {
|
155
|
+
return labelAction;
|
156
|
+
}
|
157
|
+
const labelActionTitleId = labelAction.props.title.id;
|
158
|
+
if (labelActionTitleId === "i18n.Field.localized") {
|
159
|
+
return React__namespace.cloneElement(labelAction, {
|
160
|
+
...labelAction.props,
|
161
|
+
title: {
|
162
|
+
id: "history.content.localized",
|
163
|
+
defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
|
164
|
+
}
|
165
|
+
});
|
166
|
+
}
|
167
|
+
if (labelActionTitleId === "i18n.Field.not-localized") {
|
168
|
+
return React__namespace.cloneElement(labelAction, {
|
169
|
+
...labelAction.props,
|
170
|
+
title: {
|
171
|
+
id: "history.content.not-localized",
|
172
|
+
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."
|
173
|
+
}
|
174
|
+
});
|
175
|
+
}
|
176
|
+
return labelAction;
|
177
|
+
};
|
157
178
|
const VersionInputRenderer = ({
|
158
179
|
visible,
|
159
180
|
hint: providedHint,
|
160
181
|
shouldIgnoreRBAC = false,
|
182
|
+
labelAction,
|
161
183
|
...props
|
162
184
|
}) => {
|
185
|
+
const customLabelAction = getLabelAction(labelAction);
|
163
186
|
const { formatMessage } = reactIntl.useIntl();
|
164
187
|
const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
|
165
188
|
const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
|
@@ -193,7 +216,7 @@ const VersionInputRenderer = ({
|
|
193
216
|
const addedAttributes = version.meta.unknownAttributes.added;
|
194
217
|
if (Object.keys(addedAttributes).includes(props.name)) {
|
195
218
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
196
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
219
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: props.label }),
|
197
220
|
/* @__PURE__ */ jsxRuntime.jsx(
|
198
221
|
StyledAlert,
|
199
222
|
{
|
@@ -217,29 +240,46 @@ const VersionInputRenderer = ({
|
|
217
240
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
218
241
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
219
242
|
if (CustomInput) {
|
220
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
243
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
244
|
+
CustomInput,
|
245
|
+
{
|
246
|
+
...props,
|
247
|
+
hint,
|
248
|
+
labelAction: customLabelAction,
|
249
|
+
disabled: fieldIsDisabled
|
250
|
+
}
|
251
|
+
);
|
221
252
|
}
|
222
253
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
223
254
|
strapiAdmin.InputRenderer,
|
224
255
|
{
|
225
256
|
...props,
|
226
257
|
hint,
|
258
|
+
labelAction: customLabelAction,
|
227
259
|
type: props.attribute.customField,
|
228
260
|
disabled: fieldIsDisabled
|
229
261
|
}
|
230
262
|
);
|
231
263
|
}
|
232
264
|
if (props.type === "media") {
|
233
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, disabled: fieldIsDisabled });
|
265
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
|
234
266
|
}
|
235
267
|
const addedInputTypes = Object.keys(fields);
|
236
268
|
if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
|
237
269
|
const CustomInput = fields[props.type];
|
238
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
270
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
271
|
+
CustomInput,
|
272
|
+
{
|
273
|
+
...props,
|
274
|
+
hint,
|
275
|
+
labelAction: customLabelAction,
|
276
|
+
disabled: fieldIsDisabled
|
277
|
+
}
|
278
|
+
);
|
239
279
|
}
|
240
280
|
switch (props.type) {
|
241
281
|
case "blocks":
|
242
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Field.
|
282
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Field.MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
243
283
|
case "component":
|
244
284
|
const { layout } = componentsLayout[props.attribute.component];
|
245
285
|
const [remainingFieldsLayout] = getRemaingFieldsLayout({
|
@@ -249,29 +289,65 @@ const VersionInputRenderer = ({
|
|
249
289
|
schemaAttributes: components[props.attribute.component].attributes
|
250
290
|
});
|
251
291
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
252
|
-
Field.
|
292
|
+
Field.MemoizedComponentInput,
|
253
293
|
{
|
254
294
|
...props,
|
255
295
|
layout: [...layout, ...remainingFieldsLayout || []],
|
256
296
|
hint,
|
297
|
+
labelAction: customLabelAction,
|
257
298
|
disabled: fieldIsDisabled,
|
258
299
|
children: (inputProps) => /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
|
259
300
|
}
|
260
301
|
);
|
261
302
|
case "dynamiczone":
|
262
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
303
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
304
|
+
Field.DynamicZone,
|
305
|
+
{
|
306
|
+
...props,
|
307
|
+
hint,
|
308
|
+
labelAction: customLabelAction,
|
309
|
+
disabled: fieldIsDisabled
|
310
|
+
}
|
311
|
+
);
|
263
312
|
case "relation":
|
264
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
313
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
314
|
+
CustomRelationInput,
|
315
|
+
{
|
316
|
+
...props,
|
317
|
+
hint,
|
318
|
+
labelAction: customLabelAction,
|
319
|
+
disabled: fieldIsDisabled
|
320
|
+
}
|
321
|
+
);
|
265
322
|
case "richtext":
|
266
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
323
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
324
|
+
Field.MemoizedWysiwyg,
|
325
|
+
{
|
326
|
+
...props,
|
327
|
+
hint,
|
328
|
+
type: props.type,
|
329
|
+
labelAction: customLabelAction,
|
330
|
+
disabled: fieldIsDisabled
|
331
|
+
}
|
332
|
+
);
|
267
333
|
case "uid":
|
268
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
334
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
335
|
+
Field.MemoizedUIDInput,
|
336
|
+
{
|
337
|
+
...props,
|
338
|
+
hint,
|
339
|
+
type: props.type,
|
340
|
+
labelAction: customLabelAction,
|
341
|
+
disabled: fieldIsDisabled
|
342
|
+
}
|
343
|
+
);
|
269
344
|
case "enumeration":
|
270
345
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
271
346
|
strapiAdmin.InputRenderer,
|
272
347
|
{
|
273
348
|
...props,
|
274
349
|
hint,
|
350
|
+
labelAction: customLabelAction,
|
275
351
|
options: props.attribute.enum.map((value) => ({ value })),
|
276
352
|
type: props.customField ? "custom-field" : props.type,
|
277
353
|
disabled: fieldIsDisabled
|
@@ -284,6 +360,7 @@ const VersionInputRenderer = ({
|
|
284
360
|
{
|
285
361
|
...restProps,
|
286
362
|
hint,
|
363
|
+
labelAction: customLabelAction,
|
287
364
|
type: props.customField ? "custom-field" : props.type,
|
288
365
|
disabled: fieldIsDisabled
|
289
366
|
}
|
@@ -337,7 +414,7 @@ const FormPanel = ({ panel }) => {
|
|
337
414
|
if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
|
338
415
|
const [row] = panel;
|
339
416
|
const [field] = row;
|
340
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
417
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: 12, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }) }, field.name);
|
341
418
|
}
|
342
419
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
343
420
|
designSystem.Box,
|
@@ -350,8 +427,8 @@ const FormPanel = ({ panel }) => {
|
|
350
427
|
paddingTop: 6,
|
351
428
|
paddingBottom: 6,
|
352
429
|
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(designSystem.
|
430
|
+
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 }) => {
|
431
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(VersionInputRenderer, { ...field }) }, field.name);
|
355
432
|
}) }, gridRowIndex)) })
|
356
433
|
}
|
357
434
|
);
|
@@ -398,7 +475,7 @@ const VersionContent = () => {
|
|
398
475
|
};
|
399
476
|
return transform(version.schema, components)(version.data);
|
400
477
|
}, [components, version.data, version.schema]);
|
401
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
478
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(strapiAdmin.Layouts.Content, { children: [
|
402
479
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 8, children: /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Form, { disabled: true, method: "PUT", initialValues: transformedData, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, position: "relative", children: [...layout, ...remainingFieldsLayout].map((panel, index2) => {
|
403
480
|
return /* @__PURE__ */ jsxRuntime.jsx(FormPanel, { panel }, index2);
|
404
481
|
}) }) }) }),
|
@@ -533,9 +610,9 @@ const VersionHeader = ({ headerId }) => {
|
|
533
610
|
});
|
534
611
|
}
|
535
612
|
};
|
536
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
613
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
|
537
614
|
/* @__PURE__ */ jsxRuntime.jsx(
|
538
|
-
|
615
|
+
strapiAdmin.Layouts.BaseHeader,
|
539
616
|
{
|
540
617
|
id: headerId,
|
541
618
|
title: formatDate(new Date(version.createdAt), {
|
@@ -556,20 +633,12 @@ const VersionHeader = ({ headerId }) => {
|
|
556
633
|
locale: version.locale?.name
|
557
634
|
}
|
558
635
|
) }),
|
559
|
-
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(
|
560
|
-
|
561
|
-
|
562
|
-
|
563
|
-
as: reactRouterDom.NavLink,
|
564
|
-
to: getNextNavigation(),
|
565
|
-
children: formatMessage({
|
566
|
-
id: "global.back",
|
567
|
-
defaultMessage: "Back"
|
568
|
-
})
|
569
|
-
}
|
570
|
-
),
|
636
|
+
navigationAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Link, { startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowLeft, {}), tag: reactRouterDom.NavLink, to: getNextNavigation(), isExternal: false, children: formatMessage({
|
637
|
+
id: "global.back",
|
638
|
+
defaultMessage: "Back"
|
639
|
+
}) }),
|
571
640
|
sticky: false,
|
572
|
-
primaryAction: /* @__PURE__ */ jsxRuntime.jsx(
|
641
|
+
primaryAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
573
642
|
designSystem.Button,
|
574
643
|
{
|
575
644
|
disabled: !allowedActions.canUpdate || isCurrentVersion,
|
@@ -581,16 +650,13 @@ const VersionHeader = ({ headerId }) => {
|
|
581
650
|
defaultMessage: "Restore"
|
582
651
|
})
|
583
652
|
}
|
584
|
-
)
|
653
|
+
) })
|
585
654
|
}
|
586
655
|
),
|
587
656
|
/* @__PURE__ */ jsxRuntime.jsx(
|
588
657
|
strapiAdmin.ConfirmDialog,
|
589
658
|
{
|
590
|
-
isOpen: isConfirmDialogOpen,
|
591
|
-
onClose: () => setIsConfirmDialogOpen(false),
|
592
659
|
onConfirm: handleRestore,
|
593
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}),
|
594
660
|
endAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
|
595
661
|
id: "content-manager.history.restore.confirm.button",
|
596
662
|
defaultMessage: "Restore"
|
@@ -604,6 +670,7 @@ const VersionHeader = ({ headerId }) => {
|
|
604
670
|
gap: 2,
|
605
671
|
textAlign: "center",
|
606
672
|
children: [
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
|
607
674
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
608
675
|
id: "content-manager.history.restore.confirm.title",
|
609
676
|
defaultMessage: "Are you sure you want to restore this version?"
|
@@ -676,23 +743,24 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
676
743
|
borderWidth: "1px",
|
677
744
|
borderStyle: "solid",
|
678
745
|
borderColor: isActive ? "primary600" : "neutral200",
|
746
|
+
color: "neutral800",
|
679
747
|
paddingTop: 4,
|
680
748
|
paddingBottom: 4,
|
681
749
|
paddingLeft: 5,
|
682
750
|
paddingRight: 5,
|
683
|
-
|
751
|
+
tag: reactRouterDom.Link,
|
684
752
|
to: `?${qs.stringify({ ...query, id: version.id })}`,
|
685
753
|
style: { textDecoration: "none" },
|
686
754
|
children: [
|
687
755
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
|
688
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
756
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
|
689
757
|
day: "numeric",
|
690
758
|
month: "numeric",
|
691
759
|
year: "numeric",
|
692
760
|
hour: "2-digit",
|
693
761
|
minute: "2-digit"
|
694
762
|
}) }),
|
695
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
763
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
|
696
764
|
{
|
697
765
|
id: "content-manager.history.sidebar.versionDescription",
|
698
766
|
defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
|
@@ -748,7 +816,7 @@ const VersionsList = () => {
|
|
748
816
|
borderColor: "neutral200",
|
749
817
|
borderWidth: "0 0 0 1px",
|
750
818
|
borderStyle: "solid",
|
751
|
-
|
819
|
+
tag: "aside",
|
752
820
|
children: [
|
753
821
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
754
822
|
designSystem.Flex,
|
@@ -759,9 +827,9 @@ const VersionsList = () => {
|
|
759
827
|
borderColor: "neutral200",
|
760
828
|
borderWidth: "0 0 1px",
|
761
829
|
borderStyle: "solid",
|
762
|
-
|
830
|
+
tag: "header",
|
763
831
|
children: [
|
764
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
832
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
|
765
833
|
id: "content-manager.history.sidebar.title",
|
766
834
|
defaultMessage: "Versions"
|
767
835
|
}) }),
|
@@ -783,7 +851,7 @@ const VersionsList = () => {
|
|
783
851
|
paddingBottom: 5,
|
784
852
|
paddingLeft: 4,
|
785
853
|
paddingRight: 4,
|
786
|
-
|
854
|
+
tag: "ul",
|
787
855
|
alignItems: "stretch",
|
788
856
|
children: versions.data.map((version, index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
789
857
|
"li",
|
@@ -850,7 +918,22 @@ const HistoryPage = () => {
|
|
850
918
|
return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Loading, {});
|
851
919
|
}
|
852
920
|
if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
|
853
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
921
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
922
|
+
strapiAdmin.Page.NoData,
|
923
|
+
{
|
924
|
+
action: /* @__PURE__ */ jsxRuntime.jsx(
|
925
|
+
designSystem.Link,
|
926
|
+
{
|
927
|
+
tag: reactRouterDom.NavLink,
|
928
|
+
to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
|
929
|
+
children: formatMessage({
|
930
|
+
id: "global.back",
|
931
|
+
defaultMessage: "Back"
|
932
|
+
})
|
933
|
+
}
|
934
|
+
)
|
935
|
+
}
|
936
|
+
) });
|
854
937
|
}
|
855
938
|
if (versionsResponse.data?.data?.length && !selectedVersionId) {
|
856
939
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
@@ -957,4 +1040,4 @@ const ProtectedHistoryPage = () => {
|
|
957
1040
|
exports.HistoryProvider = HistoryProvider;
|
958
1041
|
exports.ProtectedHistoryPage = ProtectedHistoryPage;
|
959
1042
|
exports.useHistoryContext = useHistoryContext;
|
960
|
-
//# sourceMappingURL=History-
|
1043
|
+
//# sourceMappingURL=History-DdIstl8b.js.map
|