@strapi/content-manager 0.0.0-experimental.17b4116f461a49b8ce5386f7c8d79c511d40fb3b → 0.0.0-experimental.1fc4b627b49f713b07ed9f7f2b37741dcf8cf736
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-DjQBdcKF.mjs → ComponentConfigurationPage-CIjXcRAB.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-DjQBdcKF.mjs.map → ComponentConfigurationPage-CIjXcRAB.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-2iOVVhqV.js → ComponentConfigurationPage-gsCd80MU.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-2iOVVhqV.js.map → ComponentConfigurationPage-gsCd80MU.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-BglmD_BF.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-BoBb-DLH.mjs.map → EditConfigurationPage-BglmD_BF.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-B7dw5_cS.js → EditConfigurationPage-DHDQKBzw.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-B7dw5_cS.js.map → EditConfigurationPage-DHDQKBzw.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-KRG56aCq.js → EditViewPage-C4iTxUPU.js} +69 -50
- package/dist/_chunks/EditViewPage-C4iTxUPU.js.map +1 -0
- package/dist/_chunks/{EditViewPage-aUnqL-63.mjs → EditViewPage-CiwVPMaK.mjs} +70 -49
- package/dist/_chunks/EditViewPage-CiwVPMaK.mjs.map +1 -0
- package/dist/_chunks/{Field-kVFO4ZKB.mjs → Field-DIjL1b5d.mjs} +1046 -802
- package/dist/_chunks/Field-DIjL1b5d.mjs.map +1 -0
- package/dist/_chunks/{Field-kq1c2TF1.js → Field-DhXEK8y1.js} +1092 -849
- package/dist/_chunks/Field-DhXEK8y1.js.map +1 -0
- package/dist/_chunks/{Form-Jgh5hGTu.mjs → Form-CmNesrvR.mjs} +66 -45
- package/dist/_chunks/Form-CmNesrvR.mjs.map +1 -0
- package/dist/_chunks/{Form-CQ67ZifP.js → Form-CwmJ4sWe.js} +66 -46
- package/dist/_chunks/Form-CwmJ4sWe.js.map +1 -0
- package/dist/_chunks/{History-BLEnudTX.js → History-BLCCNgCt.js} +164 -54
- package/dist/_chunks/History-BLCCNgCt.js.map +1 -0
- package/dist/_chunks/{History-DKhZAPcK.mjs → History-D-99Wh30.mjs} +163 -52
- package/dist/_chunks/History-D-99Wh30.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Zso_LUjn.js → ListConfigurationPage-DxWpeZrO.js} +68 -59
- package/dist/_chunks/ListConfigurationPage-DxWpeZrO.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-nrXcxNYi.mjs → ListConfigurationPage-JPWZz7Kg.mjs} +64 -54
- package/dist/_chunks/ListConfigurationPage-JPWZz7Kg.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-DsaOakWQ.js → ListViewPage-CIQekSFz.js} +143 -139
- package/dist/_chunks/ListViewPage-CIQekSFz.js.map +1 -0
- package/dist/_chunks/{ListViewPage-ChhYmA-L.mjs → ListViewPage-DSK3f0ST.mjs} +140 -136
- package/dist/_chunks/ListViewPage-DSK3f0ST.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DPCuS9Y1.js → NoContentTypePage-C5cxKvC2.js} +3 -3
- package/dist/_chunks/NoContentTypePage-C5cxKvC2.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-BrdFcN33.mjs → NoContentTypePage-D99LU1YP.mjs} +3 -3
- package/dist/_chunks/NoContentTypePage-D99LU1YP.mjs.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-B9dqrtTy.mjs → NoPermissionsPage-DBrBw-0y.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B9dqrtTy.mjs.map → NoPermissionsPage-DBrBw-0y.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DdyOfdKb.js → NoPermissionsPage-Oy4tmUrW.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DdyOfdKb.js.map → NoPermissionsPage-Oy4tmUrW.js.map} +1 -1
- package/dist/_chunks/{Relations-DjFiYd7-.mjs → Relations-BBmhcWFV.mjs} +132 -89
- package/dist/_chunks/Relations-BBmhcWFV.mjs.map +1 -0
- package/dist/_chunks/{Relations-CY8Isqdu.js → Relations-eG-9p_qS.js} +135 -93
- package/dist/_chunks/Relations-eG-9p_qS.js.map +1 -0
- package/dist/_chunks/{en-C-V1_90f.js → en-Bm0D0IWz.js} +23 -15
- package/dist/_chunks/{en-C-V1_90f.js.map → en-Bm0D0IWz.js.map} +1 -1
- package/dist/_chunks/{en-MBPul9Su.mjs → en-DKV44jRb.mjs} +23 -15
- package/dist/_chunks/{en-MBPul9Su.mjs.map → en-DKV44jRb.mjs.map} +1 -1
- package/dist/_chunks/{index-DNa1J4HE.js → index-BIWDoFLK.js} +1877 -939
- package/dist/_chunks/index-BIWDoFLK.js.map +1 -0
- package/dist/_chunks/{index-CAc9yTnx.mjs → index-BrUzbQ30.mjs} +1902 -964
- package/dist/_chunks/index-BrUzbQ30.mjs.map +1 -0
- package/dist/_chunks/{layout-CXsHbc3E.mjs → layout-_5-cXs34.mjs} +45 -27
- package/dist/_chunks/layout-_5-cXs34.mjs.map +1 -0
- package/dist/_chunks/{layout-BqtLA6Lb.js → layout-lMc9i1-Z.js} +45 -29
- package/dist/_chunks/layout-lMc9i1-Z.js.map +1 -0
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-BHY_KDJ_.js → relations-BRHithi8.js} +3 -7
- package/dist/_chunks/relations-BRHithi8.js.map +1 -0
- package/dist/_chunks/{relations-mMFEcZRq.mjs → relations-B_VLk-DD.mjs} +3 -7
- package/dist/_chunks/relations-B_VLk-DD.mjs.map +1 -0
- package/dist/_chunks/useDebounce-CtcjDB3L.js +28 -0
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
- package/dist/admin/index.js +3 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +9 -7
- package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
- package/dist/admin/src/content-manager.d.ts +3 -3
- package/dist/admin/src/exports.d.ts +2 -1
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +37 -9
- package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
- package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
- package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
- package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/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/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +16 -53
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
- package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
- package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
- package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/services/api.d.ts +2 -3
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +5 -5
- package/dist/admin/src/services/documents.d.ts +31 -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 +5 -7
- package/dist/server/index.js +571 -312
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +573 -314
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/single-types.d.ts.map +1 -1
- package/dist/server/src/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +22 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts +11 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/index.d.ts +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +2 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +20 -36
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +9 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +4 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +6 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +7 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/routes/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 +14 -35
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +20 -36
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts +8 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +17 -7
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/relations.d.ts +2 -2
- package/dist/shared/contracts/relations.d.ts.map +1 -1
- package/package.json +17 -18
- 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/relations-BHY_KDJ_.js.map +0 -1
- package/dist/_chunks/relations-mMFEcZRq.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
- package/strapi-server.js +0 -3
@@ -1,19 +1,19 @@
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
2
2
|
import * as React from "react";
|
3
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, Typography, Divider, Grid, Dialog, Button, Portal, FocusTrap, Main } from "@strapi/design-system";
|
5
5
|
import { stringify } from "qs";
|
6
6
|
import { useIntl } from "react-intl";
|
7
7
|
import { NavLink, useNavigate, useParams, Link as Link$1, Navigate } from "react-router-dom";
|
8
|
-
import {
|
8
|
+
import { c as useDoc, f as useDocumentRBAC, o as useDocLayout, C as COLLECTION_TYPES, D as DocumentStatus, e as contentManagerApi, k as PERMISSIONS, t as getDisplayName, R as RelativeTime, l as DocumentRBAC, J as useDocument, h as useDocumentLayout, p as useGetContentTypeConfigurationQuery, d as buildValidParams } from "./index-BrUzbQ30.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-DIjL1b5d.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-B_VLk-DD.mjs";
|
15
15
|
const StyledAlert = styled(Alert).attrs({ closeLabel: "Close", onClose: () => {
|
16
|
-
} })`
|
16
|
+
}, shadow: "none" })`
|
17
17
|
button {
|
18
18
|
display: none;
|
19
19
|
}
|
@@ -31,13 +31,13 @@ const LinkEllipsis = styled(Link)`
|
|
31
31
|
const CustomRelationInput = (props) => {
|
32
32
|
const { formatMessage } = useIntl();
|
33
33
|
const field = useField(props.name);
|
34
|
-
|
35
|
-
|
36
|
-
meta: { missingCount: 0 }
|
37
|
-
}
|
34
|
+
let formattedFieldValue;
|
35
|
+
if (field) {
|
36
|
+
formattedFieldValue = Array.isArray(field.value) ? { results: field.value, meta: { missingCount: 0 } } : field.value;
|
37
|
+
}
|
38
38
|
if (!formattedFieldValue || formattedFieldValue.results.length === 0 && formattedFieldValue.meta.missingCount === 0) {
|
39
39
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
40
|
-
/* @__PURE__ */ jsx(
|
40
|
+
/* @__PURE__ */ jsx(Field.Label, { action: props.labelAction, children: props.label }),
|
41
41
|
/* @__PURE__ */ jsx(Box, { marginTop: 1, children: /* @__PURE__ */ jsx(StyledAlert, { variant: "default", children: formatMessage({
|
42
42
|
id: "content-manager.history.content.no-relations",
|
43
43
|
defaultMessage: "No relations."
|
@@ -46,10 +46,12 @@ const CustomRelationInput = (props) => {
|
|
46
46
|
}
|
47
47
|
const { results, meta } = formattedFieldValue;
|
48
48
|
return /* @__PURE__ */ jsxs(Box, { children: [
|
49
|
-
/* @__PURE__ */ jsx(
|
49
|
+
/* @__PURE__ */ jsx(Field.Label, { children: props.label }),
|
50
50
|
results.length > 0 && /* @__PURE__ */ jsx(Flex, { direction: "column", gap: 2, marginTop: 1, alignItems: "stretch", children: results.map((relationData) => {
|
51
|
-
const
|
51
|
+
const { targetModel } = props.attribute;
|
52
|
+
const href = `../${COLLECTION_TYPES}/${targetModel}/${relationData.documentId}`;
|
52
53
|
const label = getRelationLabel(relationData, props.mainField);
|
54
|
+
const isAdminUserRelation = targetModel === "admin::user";
|
53
55
|
return /* @__PURE__ */ jsxs(
|
54
56
|
Flex,
|
55
57
|
{
|
@@ -62,14 +64,15 @@ const CustomRelationInput = (props) => {
|
|
62
64
|
background: "neutral150",
|
63
65
|
justifyContent: "space-between",
|
64
66
|
children: [
|
65
|
-
/* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, {
|
67
|
+
/* @__PURE__ */ jsx(Box, { minWidth: 0, paddingTop: 1, paddingBottom: 1, paddingRight: 4, children: /* @__PURE__ */ jsx(Tooltip, { label, children: isAdminUserRelation ? /* @__PURE__ */ jsx(Typography, { children: label }) : /* @__PURE__ */ jsx(LinkEllipsis, { tag: NavLink, to: href, children: label }) }) }),
|
66
68
|
/* @__PURE__ */ jsx(DocumentStatus, { status: relationData.status })
|
67
69
|
]
|
68
70
|
},
|
69
|
-
relationData.documentId
|
71
|
+
relationData.documentId ?? relationData.id
|
70
72
|
);
|
71
73
|
}) }),
|
72
|
-
meta.missingCount > 0 && /* @
|
74
|
+
meta.missingCount > 0 && /* @ts-expect-error – we dont need closeLabel */
|
75
|
+
/* @__PURE__ */ jsx(
|
73
76
|
StyledAlert,
|
74
77
|
{
|
75
78
|
marginTop: 1,
|
@@ -93,9 +96,9 @@ const CustomRelationInput = (props) => {
|
|
93
96
|
] });
|
94
97
|
};
|
95
98
|
const CustomMediaInput = (props) => {
|
96
|
-
const {
|
97
|
-
|
98
|
-
|
99
|
+
const { value } = useField(props.name);
|
100
|
+
const results = value ? value.results : [];
|
101
|
+
const meta = value ? value.meta : { missingCount: 0 };
|
99
102
|
const { formatMessage } = useIntl();
|
100
103
|
const fields = useStrapiApp("CustomMediaInput", (state) => state.fields);
|
101
104
|
const MediaLibrary = fields.media;
|
@@ -126,12 +129,39 @@ const CustomMediaInput = (props) => {
|
|
126
129
|
)
|
127
130
|
] });
|
128
131
|
};
|
132
|
+
const getLabelAction = (labelAction) => {
|
133
|
+
if (!React.isValidElement(labelAction)) {
|
134
|
+
return labelAction;
|
135
|
+
}
|
136
|
+
const labelActionTitleId = labelAction.props.title.id;
|
137
|
+
if (labelActionTitleId === "i18n.Field.localized") {
|
138
|
+
return React.cloneElement(labelAction, {
|
139
|
+
...labelAction.props,
|
140
|
+
title: {
|
141
|
+
id: "history.content.localized",
|
142
|
+
defaultMessage: "This value is specific to this locale. If you restore this version, the content will not be replaced for other locales."
|
143
|
+
}
|
144
|
+
});
|
145
|
+
}
|
146
|
+
if (labelActionTitleId === "i18n.Field.not-localized") {
|
147
|
+
return React.cloneElement(labelAction, {
|
148
|
+
...labelAction.props,
|
149
|
+
title: {
|
150
|
+
id: "history.content.not-localized",
|
151
|
+
defaultMessage: "This value is common to all locales. If you restore this version and save the changes, the content will be replaced for all locales."
|
152
|
+
}
|
153
|
+
});
|
154
|
+
}
|
155
|
+
return labelAction;
|
156
|
+
};
|
129
157
|
const VersionInputRenderer = ({
|
130
158
|
visible,
|
131
159
|
hint: providedHint,
|
132
160
|
shouldIgnoreRBAC = false,
|
161
|
+
labelAction,
|
133
162
|
...props
|
134
163
|
}) => {
|
164
|
+
const customLabelAction = getLabelAction(labelAction);
|
135
165
|
const { formatMessage } = useIntl();
|
136
166
|
const version = useHistoryContext("VersionContent", (state) => state.selectedVersion);
|
137
167
|
const configuration = useHistoryContext("VersionContent", (state) => state.configuration);
|
@@ -165,7 +195,7 @@ const VersionInputRenderer = ({
|
|
165
195
|
const addedAttributes = version.meta.unknownAttributes.added;
|
166
196
|
if (Object.keys(addedAttributes).includes(props.name)) {
|
167
197
|
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", gap: 1, children: [
|
168
|
-
/* @__PURE__ */ jsx(
|
198
|
+
/* @__PURE__ */ jsx(Field.Label, { children: props.label }),
|
169
199
|
/* @__PURE__ */ jsx(
|
170
200
|
StyledAlert,
|
171
201
|
{
|
@@ -189,29 +219,46 @@ const VersionInputRenderer = ({
|
|
189
219
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
190
220
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
191
221
|
if (CustomInput) {
|
192
|
-
return /* @__PURE__ */ jsx(
|
222
|
+
return /* @__PURE__ */ jsx(
|
223
|
+
CustomInput,
|
224
|
+
{
|
225
|
+
...props,
|
226
|
+
hint,
|
227
|
+
labelAction: customLabelAction,
|
228
|
+
disabled: fieldIsDisabled
|
229
|
+
}
|
230
|
+
);
|
193
231
|
}
|
194
232
|
return /* @__PURE__ */ jsx(
|
195
233
|
InputRenderer,
|
196
234
|
{
|
197
235
|
...props,
|
198
236
|
hint,
|
237
|
+
labelAction: customLabelAction,
|
199
238
|
type: props.attribute.customField,
|
200
239
|
disabled: fieldIsDisabled
|
201
240
|
}
|
202
241
|
);
|
203
242
|
}
|
204
243
|
if (props.type === "media") {
|
205
|
-
return /* @__PURE__ */ jsx(CustomMediaInput, { ...props, disabled: fieldIsDisabled });
|
244
|
+
return /* @__PURE__ */ jsx(CustomMediaInput, { ...props, labelAction: customLabelAction, disabled: fieldIsDisabled });
|
206
245
|
}
|
207
246
|
const addedInputTypes = Object.keys(fields);
|
208
247
|
if (!attributeHasCustomFieldProperty(props.attribute) && addedInputTypes.includes(props.type)) {
|
209
248
|
const CustomInput = fields[props.type];
|
210
|
-
return /* @__PURE__ */ jsx(
|
249
|
+
return /* @__PURE__ */ jsx(
|
250
|
+
CustomInput,
|
251
|
+
{
|
252
|
+
...props,
|
253
|
+
hint,
|
254
|
+
labelAction: customLabelAction,
|
255
|
+
disabled: fieldIsDisabled
|
256
|
+
}
|
257
|
+
);
|
211
258
|
}
|
212
259
|
switch (props.type) {
|
213
260
|
case "blocks":
|
214
|
-
return /* @__PURE__ */ jsx(
|
261
|
+
return /* @__PURE__ */ jsx(MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
215
262
|
case "component":
|
216
263
|
const { layout } = componentsLayout[props.attribute.component];
|
217
264
|
const [remainingFieldsLayout] = getRemaingFieldsLayout({
|
@@ -221,29 +268,65 @@ const VersionInputRenderer = ({
|
|
221
268
|
schemaAttributes: components[props.attribute.component].attributes
|
222
269
|
});
|
223
270
|
return /* @__PURE__ */ jsx(
|
224
|
-
|
271
|
+
MemoizedComponentInput,
|
225
272
|
{
|
226
273
|
...props,
|
227
274
|
layout: [...layout, ...remainingFieldsLayout || []],
|
228
275
|
hint,
|
276
|
+
labelAction: customLabelAction,
|
229
277
|
disabled: fieldIsDisabled,
|
230
278
|
children: (inputProps) => /* @__PURE__ */ jsx(VersionInputRenderer, { ...inputProps, shouldIgnoreRBAC: true })
|
231
279
|
}
|
232
280
|
);
|
233
281
|
case "dynamiczone":
|
234
|
-
return /* @__PURE__ */ jsx(
|
282
|
+
return /* @__PURE__ */ jsx(
|
283
|
+
DynamicZone,
|
284
|
+
{
|
285
|
+
...props,
|
286
|
+
hint,
|
287
|
+
labelAction: customLabelAction,
|
288
|
+
disabled: fieldIsDisabled
|
289
|
+
}
|
290
|
+
);
|
235
291
|
case "relation":
|
236
|
-
return /* @__PURE__ */ jsx(
|
292
|
+
return /* @__PURE__ */ jsx(
|
293
|
+
CustomRelationInput,
|
294
|
+
{
|
295
|
+
...props,
|
296
|
+
hint,
|
297
|
+
labelAction: customLabelAction,
|
298
|
+
disabled: fieldIsDisabled
|
299
|
+
}
|
300
|
+
);
|
237
301
|
case "richtext":
|
238
|
-
return /* @__PURE__ */ jsx(
|
302
|
+
return /* @__PURE__ */ jsx(
|
303
|
+
MemoizedWysiwyg,
|
304
|
+
{
|
305
|
+
...props,
|
306
|
+
hint,
|
307
|
+
type: props.type,
|
308
|
+
labelAction: customLabelAction,
|
309
|
+
disabled: fieldIsDisabled
|
310
|
+
}
|
311
|
+
);
|
239
312
|
case "uid":
|
240
|
-
return /* @__PURE__ */ jsx(
|
313
|
+
return /* @__PURE__ */ jsx(
|
314
|
+
MemoizedUIDInput,
|
315
|
+
{
|
316
|
+
...props,
|
317
|
+
hint,
|
318
|
+
type: props.type,
|
319
|
+
labelAction: customLabelAction,
|
320
|
+
disabled: fieldIsDisabled
|
321
|
+
}
|
322
|
+
);
|
241
323
|
case "enumeration":
|
242
324
|
return /* @__PURE__ */ jsx(
|
243
325
|
InputRenderer,
|
244
326
|
{
|
245
327
|
...props,
|
246
328
|
hint,
|
329
|
+
labelAction: customLabelAction,
|
247
330
|
options: props.attribute.enum.map((value) => ({ value })),
|
248
331
|
type: props.customField ? "custom-field" : props.type,
|
249
332
|
disabled: fieldIsDisabled
|
@@ -256,6 +339,7 @@ const VersionInputRenderer = ({
|
|
256
339
|
{
|
257
340
|
...restProps,
|
258
341
|
hint,
|
342
|
+
labelAction: customLabelAction,
|
259
343
|
type: props.customField ? "custom-field" : props.type,
|
260
344
|
disabled: fieldIsDisabled
|
261
345
|
}
|
@@ -309,7 +393,7 @@ const FormPanel = ({ panel }) => {
|
|
309
393
|
if (panel.some((row) => row.some((field) => field.type === "dynamiczone"))) {
|
310
394
|
const [row] = panel;
|
311
395
|
const [field] = row;
|
312
|
-
return /* @__PURE__ */ jsx(Grid, { gap: 4, children: /* @__PURE__ */ jsx(
|
396
|
+
return /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: /* @__PURE__ */ jsx(Grid.Item, { col: 12, s: 12, xs: 12, direction: "column", alignItems: "stretch", children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field }) }) }, field.name);
|
313
397
|
}
|
314
398
|
return /* @__PURE__ */ jsx(
|
315
399
|
Box,
|
@@ -322,8 +406,19 @@ const FormPanel = ({ panel }) => {
|
|
322
406
|
paddingTop: 6,
|
323
407
|
paddingBottom: 6,
|
324
408
|
borderColor: "neutral150",
|
325
|
-
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsx(Grid, { gap: 4, children: row.map(({ size, ...field }) => {
|
326
|
-
return /* @__PURE__ */ jsx(
|
409
|
+
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: panel.map((row, gridRowIndex) => /* @__PURE__ */ jsx(Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
410
|
+
return /* @__PURE__ */ jsx(
|
411
|
+
Grid.Item,
|
412
|
+
{
|
413
|
+
col: size,
|
414
|
+
s: 12,
|
415
|
+
xs: 12,
|
416
|
+
direction: "column",
|
417
|
+
alignItems: "stretch",
|
418
|
+
children: /* @__PURE__ */ jsx(VersionInputRenderer, { ...field })
|
419
|
+
},
|
420
|
+
field.name
|
421
|
+
);
|
327
422
|
}) }, gridRowIndex)) })
|
328
423
|
}
|
329
424
|
);
|
@@ -455,12 +550,12 @@ const VersionHeader = ({ headerId }) => {
|
|
455
550
|
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
|
456
551
|
if (collectionType === COLLECTION_TYPES) {
|
457
552
|
return {
|
458
|
-
pathname:
|
553
|
+
pathname: "..",
|
459
554
|
search: pluginsQueryParams
|
460
555
|
};
|
461
556
|
}
|
462
557
|
return {
|
463
|
-
pathname:
|
558
|
+
pathname: "..",
|
464
559
|
search: pluginsQueryParams
|
465
560
|
};
|
466
561
|
};
|
@@ -476,7 +571,7 @@ const VersionHeader = ({ headerId }) => {
|
|
476
571
|
body: { contentType: version.contentType }
|
477
572
|
});
|
478
573
|
if ("data" in response) {
|
479
|
-
navigate(getNextNavigation());
|
574
|
+
navigate(getNextNavigation(), { relative: "path" });
|
480
575
|
toggleNotification({
|
481
576
|
type: "success",
|
482
577
|
title: formatMessage({
|
@@ -505,7 +600,7 @@ const VersionHeader = ({ headerId }) => {
|
|
505
600
|
});
|
506
601
|
}
|
507
602
|
};
|
508
|
-
return /* @__PURE__ */ jsxs(
|
603
|
+
return /* @__PURE__ */ jsxs(Dialog.Root, { open: isConfirmDialogOpen, onOpenChange: setIsConfirmDialogOpen, children: [
|
509
604
|
/* @__PURE__ */ jsx(
|
510
605
|
Layouts.BaseHeader,
|
511
606
|
{
|
@@ -517,7 +612,7 @@ const VersionHeader = ({ headerId }) => {
|
|
517
612
|
hour: "numeric",
|
518
613
|
minute: "numeric"
|
519
614
|
}),
|
520
|
-
subtitle: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", children: formatMessage(
|
615
|
+
subtitle: /* @__PURE__ */ jsx(Typography, { variant: "epsilon", textColor: "neutral600", children: formatMessage(
|
521
616
|
{
|
522
617
|
id: "content-manager.history.version.subtitle",
|
523
618
|
defaultMessage: "{hasLocale, select, true {{subtitle}, in {locale}} other {{subtitle}}}"
|
@@ -532,8 +627,10 @@ const VersionHeader = ({ headerId }) => {
|
|
532
627
|
Link,
|
533
628
|
{
|
534
629
|
startIcon: /* @__PURE__ */ jsx(ArrowLeft, {}),
|
535
|
-
|
630
|
+
tag: NavLink,
|
536
631
|
to: getNextNavigation(),
|
632
|
+
relative: "path",
|
633
|
+
isExternal: false,
|
537
634
|
children: formatMessage({
|
538
635
|
id: "global.back",
|
539
636
|
defaultMessage: "Back"
|
@@ -541,7 +638,7 @@ const VersionHeader = ({ headerId }) => {
|
|
541
638
|
}
|
542
639
|
),
|
543
640
|
sticky: false,
|
544
|
-
primaryAction: /* @__PURE__ */ jsx(
|
641
|
+
primaryAction: /* @__PURE__ */ jsx(Dialog.Trigger, { children: /* @__PURE__ */ jsx(
|
545
642
|
Button,
|
546
643
|
{
|
547
644
|
disabled: !allowedActions.canUpdate || isCurrentVersion,
|
@@ -553,16 +650,13 @@ const VersionHeader = ({ headerId }) => {
|
|
553
650
|
defaultMessage: "Restore"
|
554
651
|
})
|
555
652
|
}
|
556
|
-
)
|
653
|
+
) })
|
557
654
|
}
|
558
655
|
),
|
559
656
|
/* @__PURE__ */ jsx(
|
560
657
|
ConfirmDialog,
|
561
658
|
{
|
562
|
-
isOpen: isConfirmDialogOpen,
|
563
|
-
onClose: () => setIsConfirmDialogOpen(false),
|
564
659
|
onConfirm: handleRestore,
|
565
|
-
icon: /* @__PURE__ */ jsx(WarningCircle, {}),
|
566
660
|
endAction: /* @__PURE__ */ jsx(Button, { variant: "secondary", onClick: handleRestore, loading: isLoading, children: formatMessage({
|
567
661
|
id: "content-manager.history.restore.confirm.button",
|
568
662
|
defaultMessage: "Restore"
|
@@ -576,6 +670,7 @@ const VersionHeader = ({ headerId }) => {
|
|
576
670
|
gap: 2,
|
577
671
|
textAlign: "center",
|
578
672
|
children: [
|
673
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
|
579
674
|
/* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
580
675
|
id: "content-manager.history.restore.confirm.title",
|
581
676
|
defaultMessage: "Are you sure you want to restore this version?"
|
@@ -648,23 +743,24 @@ const VersionCard = ({ version, isCurrent }) => {
|
|
648
743
|
borderWidth: "1px",
|
649
744
|
borderStyle: "solid",
|
650
745
|
borderColor: isActive ? "primary600" : "neutral200",
|
746
|
+
color: "neutral800",
|
651
747
|
paddingTop: 4,
|
652
748
|
paddingBottom: 4,
|
653
749
|
paddingLeft: 5,
|
654
750
|
paddingRight: 5,
|
655
|
-
|
751
|
+
tag: Link$1,
|
656
752
|
to: `?${stringify({ ...query, id: version.id })}`,
|
657
753
|
style: { textDecoration: "none" },
|
658
754
|
children: [
|
659
755
|
/* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "flex-start", children: [
|
660
|
-
/* @__PURE__ */ jsx(Typography, {
|
756
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h3", fontWeight: "semiBold", children: formatDate(version.createdAt, {
|
661
757
|
day: "numeric",
|
662
758
|
month: "numeric",
|
663
759
|
year: "numeric",
|
664
760
|
hour: "2-digit",
|
665
761
|
minute: "2-digit"
|
666
762
|
}) }),
|
667
|
-
/* @__PURE__ */ jsx(Typography, {
|
763
|
+
/* @__PURE__ */ jsx(Typography, { tag: "p", variant: "pi", textColor: "neutral600", children: formatMessage(
|
668
764
|
{
|
669
765
|
id: "content-manager.history.sidebar.versionDescription",
|
670
766
|
defaultMessage: "{distanceToNow}{isAnonymous, select, true {} other { by {author}}}{isCurrent, select, true { <b>(current)</b>} other {}}"
|
@@ -720,7 +816,7 @@ const VersionsList = () => {
|
|
720
816
|
borderColor: "neutral200",
|
721
817
|
borderWidth: "0 0 0 1px",
|
722
818
|
borderStyle: "solid",
|
723
|
-
|
819
|
+
tag: "aside",
|
724
820
|
children: [
|
725
821
|
/* @__PURE__ */ jsxs(
|
726
822
|
Flex,
|
@@ -731,9 +827,9 @@ const VersionsList = () => {
|
|
731
827
|
borderColor: "neutral200",
|
732
828
|
borderWidth: "0 0 1px",
|
733
829
|
borderStyle: "solid",
|
734
|
-
|
830
|
+
tag: "header",
|
735
831
|
children: [
|
736
|
-
/* @__PURE__ */ jsx(Typography, {
|
832
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "omega", fontWeight: "semiBold", children: formatMessage({
|
737
833
|
id: "content-manager.history.sidebar.title",
|
738
834
|
defaultMessage: "Versions"
|
739
835
|
}) }),
|
@@ -755,7 +851,7 @@ const VersionsList = () => {
|
|
755
851
|
paddingBottom: 5,
|
756
852
|
paddingLeft: 4,
|
757
853
|
paddingRight: 4,
|
758
|
-
|
854
|
+
tag: "ul",
|
759
855
|
alignItems: "stretch",
|
760
856
|
children: versions.data.map((version, index) => /* @__PURE__ */ jsx(
|
761
857
|
"li",
|
@@ -822,7 +918,22 @@ const HistoryPage = () => {
|
|
822
918
|
return /* @__PURE__ */ jsx(Page.Loading, {});
|
823
919
|
}
|
824
920
|
if (!versionsResponse.isError && !versionsResponse.data?.data?.length) {
|
825
|
-
return /* @__PURE__ */ jsx(
|
921
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
922
|
+
Page.NoData,
|
923
|
+
{
|
924
|
+
action: /* @__PURE__ */ jsx(
|
925
|
+
Link,
|
926
|
+
{
|
927
|
+
tag: NavLink,
|
928
|
+
to: `/content-manager/${collectionType}/${slug}${documentId ? `/${documentId}` : ""}`,
|
929
|
+
children: formatMessage({
|
930
|
+
id: "global.back",
|
931
|
+
defaultMessage: "Back"
|
932
|
+
})
|
933
|
+
}
|
934
|
+
)
|
935
|
+
}
|
936
|
+
) });
|
826
937
|
}
|
827
938
|
if (versionsResponse.data?.data?.length && !selectedVersionId) {
|
828
939
|
return /* @__PURE__ */ jsx(
|
@@ -931,4 +1042,4 @@ export {
|
|
931
1042
|
ProtectedHistoryPage,
|
932
1043
|
useHistoryContext
|
933
1044
|
};
|
934
|
-
//# sourceMappingURL=History-
|
1045
|
+
//# sourceMappingURL=History-D-99Wh30.mjs.map
|