@strapi/content-manager 0.0.0-experimental.da85533897155e719d784f0271223c866d2f69ab → 0.0.0-experimental.dd1d47ef78ef6cfec4ed62576108500bd9f13740
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/{ComponentConfigurationPage-9lRmRdIr.mjs → ComponentConfigurationPage-BpM_Hc7r.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-9lRmRdIr.mjs.map → ComponentConfigurationPage-BpM_Hc7r.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DyDkPajU.js → ComponentConfigurationPage-CL9CAMaL.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-DyDkPajU.js.map → ComponentConfigurationPage-CL9CAMaL.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DValmA0m.js → EditConfigurationPage-ILWo0h1e.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-DValmA0m.js.map → EditConfigurationPage-ILWo0h1e.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-Bk893vVY.mjs → EditConfigurationPage-_prbqpTM.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-Bk893vVY.mjs.map → EditConfigurationPage-_prbqpTM.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-Dk7Eaft4.js → EditViewPage-BqZvBN4s.js} +15 -5
- package/dist/_chunks/EditViewPage-BqZvBN4s.js.map +1 -0
- package/dist/_chunks/{EditViewPage-DiNFdFqP.mjs → EditViewPage-DAtscabN.mjs} +15 -5
- package/dist/_chunks/EditViewPage-DAtscabN.mjs.map +1 -0
- package/dist/_chunks/{Field-DH2OaqUP.js → Field-CcoQiiz1.js} +78 -44
- package/dist/_chunks/Field-CcoQiiz1.js.map +1 -0
- package/dist/_chunks/{Field-Dv_HTFTa.mjs → Field-D-mgn1tH.mjs} +74 -40
- package/dist/_chunks/Field-D-mgn1tH.mjs.map +1 -0
- package/dist/_chunks/{Form-Dy6P4HgH.mjs → Form-BxyeWiXW.mjs} +16 -8
- package/dist/_chunks/Form-BxyeWiXW.mjs.map +1 -0
- package/dist/_chunks/{Form-B_dUDizM.js → Form-CmLbZDfi.js} +16 -8
- package/dist/_chunks/Form-CmLbZDfi.js.map +1 -0
- package/dist/_chunks/{History-DrwsD1Vc.mjs → History-BOhLaq_g.mjs} +38 -41
- package/dist/_chunks/History-BOhLaq_g.mjs.map +1 -0
- package/dist/_chunks/{History-BT4w83Oa.js → History-uECUbCZB.js} +37 -40
- package/dist/_chunks/History-uECUbCZB.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BxIP0jRy.mjs → ListConfigurationPage-D0vQez6F.mjs} +3 -3
- package/dist/_chunks/{ListConfigurationPage-BxIP0jRy.mjs.map → ListConfigurationPage-D0vQez6F.mjs.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-CuYrMcW3.js → ListConfigurationPage-D_bBSFNW.js} +3 -3
- package/dist/_chunks/{ListConfigurationPage-CuYrMcW3.js.map → ListConfigurationPage-D_bBSFNW.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-BvpwNur7.js → ListViewPage-BkZ83b1A.js} +40 -17
- package/dist/_chunks/ListViewPage-BkZ83b1A.js.map +1 -0
- package/dist/_chunks/{ListViewPage-5a1vw-OK.mjs → ListViewPage-ns-bmy5C.mjs} +36 -13
- package/dist/_chunks/ListViewPage-ns-bmy5C.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Bm6tRcd3.mjs → NoContentTypePage-BA5ZKMDR.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-Bm6tRcd3.mjs.map → NoContentTypePage-BA5ZKMDR.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-UqEiWKkM.js → NoContentTypePage-C1439s4s.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-UqEiWKkM.js.map → NoContentTypePage-C1439s4s.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BHPqn_tQ.mjs → NoPermissionsPage-B0GdMw1Q.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BHPqn_tQ.mjs.map → NoPermissionsPage-B0GdMw1Q.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-C_vGRo8Q.js → NoPermissionsPage-CPGwsVfb.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-C_vGRo8Q.js.map → NoPermissionsPage-CPGwsVfb.js.map} +1 -1
- package/dist/_chunks/{Relations-C7fPyh5P.mjs → Relations-BIGPMSW4.mjs} +72 -36
- package/dist/_chunks/Relations-BIGPMSW4.mjs.map +1 -0
- package/dist/_chunks/{Relations-CznVF6LS.js → Relations-d-8Uef_-.js} +71 -35
- package/dist/_chunks/Relations-d-8Uef_-.js.map +1 -0
- package/dist/_chunks/{en-otD_UBJi.js → en-Bdpa50w3.js} +17 -12
- package/dist/_chunks/{en-otD_UBJi.js.map → en-Bdpa50w3.js.map} +1 -1
- package/dist/_chunks/{en-CbaIuYoB.mjs → en-CZw4xdPY.mjs} +17 -12
- package/dist/_chunks/{en-CbaIuYoB.mjs.map → en-CZw4xdPY.mjs.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/{index-BJ6uTqLL.mjs → index-3_WeHXYp.mjs} +890 -685
- package/dist/_chunks/index-3_WeHXYp.mjs.map +1 -0
- package/dist/_chunks/{index-D9UmmBcM.js → index-BgaeYWIy.js} +887 -681
- package/dist/_chunks/index-BgaeYWIy.js.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout-kfu5Wtix.js → layout-ByFyQRDH.js} +5 -4
- package/dist/_chunks/{layout-kfu5Wtix.js.map → layout-ByFyQRDH.js.map} +1 -1
- package/dist/_chunks/{layout-uomiIGbG.mjs → layout-CrTxOnCy.mjs} +5 -4
- package/dist/_chunks/{layout-uomiIGbG.mjs.map → layout-CrTxOnCy.mjs.map} +1 -1
- 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-DiDufGSA.mjs → relations-BlpLgngh.mjs} +3 -7
- package/dist/_chunks/relations-BlpLgngh.mjs.map +1 -0
- package/dist/_chunks/{relations-DKENrxko.js → relations-C5RSW926.js} +3 -7
- package/dist/_chunks/relations-C5RSW926.js.map +1 -0
- package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
- 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/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +3 -2
- package/dist/admin/src/exports.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +32 -1
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/services/documents.d.ts +3 -1
- package/dist/server/index.js +378 -162
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +378 -162
- 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/utils/metadata.d.ts +15 -1
- package/dist/server/src/controllers/utils/metadata.d.ts.map +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 -3
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +4 -4
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +15 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +30 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +18 -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-metadata.d.ts +8 -8
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -4
- package/dist/server/src/services/index.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/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 +3 -1
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +13 -13
- package/dist/_chunks/EditViewPage-DiNFdFqP.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-Dk7Eaft4.js.map +0 -1
- package/dist/_chunks/Field-DH2OaqUP.js.map +0 -1
- package/dist/_chunks/Field-Dv_HTFTa.mjs.map +0 -1
- package/dist/_chunks/Form-B_dUDizM.js.map +0 -1
- package/dist/_chunks/Form-Dy6P4HgH.mjs.map +0 -1
- package/dist/_chunks/History-BT4w83Oa.js.map +0 -1
- package/dist/_chunks/History-DrwsD1Vc.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-5a1vw-OK.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BvpwNur7.js.map +0 -1
- package/dist/_chunks/Relations-C7fPyh5P.mjs.map +0 -1
- package/dist/_chunks/Relations-CznVF6LS.js.map +0 -1
- package/dist/_chunks/index-BJ6uTqLL.mjs.map +0 -1
- package/dist/_chunks/index-D9UmmBcM.js.map +0 -1
- package/dist/_chunks/relations-DKENrxko.js.map +0 -1
- package/dist/_chunks/relations-DiDufGSA.mjs.map +0 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +0 -1
- package/dist/_chunks/usePrev-DH6iah0A.mjs +0 -16
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +0 -1
- package/strapi-server.js +0 -3
@@ -5,19 +5,19 @@ import { useStrapiApp, createContext, useField, useNotification, useForm, useAPI
|
|
5
5
|
import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
|
6
6
|
import pipe$1 from "lodash/fp/pipe";
|
7
7
|
import { useIntl } from "react-intl";
|
8
|
-
import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, o as useDocLayout } from "./index-
|
8
|
+
import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, S as SINGLE_TYPES, o as useDocLayout } from "./index-3_WeHXYp.mjs";
|
9
9
|
import { generateNKeysBetween } from "fractional-indexing";
|
10
|
-
import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-
|
10
|
+
import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-BIGPMSW4.mjs";
|
11
11
|
import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
|
12
12
|
import { styled, css, keyframes } from "styled-components";
|
13
13
|
import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
|
14
14
|
import { getEmptyImage } from "react-dnd-html5-backend";
|
15
15
|
import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DdHgKsqq.mjs";
|
16
|
-
import { g as getIn } from "./objects-
|
16
|
+
import { g as getIn } from "./objects-D6yBsdmx.mjs";
|
17
17
|
import { Editor as Editor$1, Transforms, Node, Element, Range, Path, Point, createEditor } from "slate";
|
18
18
|
import { withHistory } from "slate-history";
|
19
19
|
import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
|
20
|
-
import { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./
|
20
|
+
import { p as prefixFileUrlWithBackendUrl, u as usePrev, a as useDebounce } from "./useDebounce-DmuSJIF3.mjs";
|
21
21
|
import * as Toolbar from "@radix-ui/react-toolbar";
|
22
22
|
import { useLocation, useMatch } from "react-router-dom";
|
23
23
|
import CodeMirror from "codemirror5";
|
@@ -1749,6 +1749,7 @@ const DragItem = styled(Flex)`
|
|
1749
1749
|
}
|
1750
1750
|
`;
|
1751
1751
|
const DragIconButton = styled(IconButton)`
|
1752
|
+
user-select: none;
|
1752
1753
|
display: flex;
|
1753
1754
|
align-items: center;
|
1754
1755
|
justify-content: center;
|
@@ -1877,6 +1878,7 @@ const DragAndDropElement = ({
|
|
1877
1878
|
DragIconButton,
|
1878
1879
|
{
|
1879
1880
|
tag: "div",
|
1881
|
+
contentEditable: false,
|
1880
1882
|
role: "button",
|
1881
1883
|
tabIndex: 0,
|
1882
1884
|
withTooltip: false,
|
@@ -2634,7 +2636,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2634
2636
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
|
2635
2637
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
|
2636
2638
|
id: getTranslation("components.empty-repeatable"),
|
2637
|
-
defaultMessage: "No entry yet. Click
|
2639
|
+
defaultMessage: "No entry yet. Click to add one."
|
2638
2640
|
}) }) })
|
2639
2641
|
] })
|
2640
2642
|
}
|
@@ -2702,13 +2704,34 @@ const RepeatableComponent = ({
|
|
2702
2704
|
const { search: searchString } = useLocation();
|
2703
2705
|
const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2704
2706
|
const { components } = useDoc();
|
2705
|
-
const {
|
2707
|
+
const {
|
2708
|
+
value = [],
|
2709
|
+
error,
|
2710
|
+
rawError
|
2711
|
+
} = useField(name2);
|
2706
2712
|
const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2707
2713
|
const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2708
2714
|
const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2709
2715
|
const { max = Infinity } = attribute;
|
2710
2716
|
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
2711
2717
|
const [liveText, setLiveText] = React.useState("");
|
2718
|
+
React.useEffect(() => {
|
2719
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2720
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2721
|
+
if (hasNestedErrors && hasNestedValue) {
|
2722
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2723
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2724
|
+
}).filter((value2) => !!value2);
|
2725
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2726
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2727
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2728
|
+
return errorOpenItems[0];
|
2729
|
+
}
|
2730
|
+
return collapseToOpen2;
|
2731
|
+
});
|
2732
|
+
}
|
2733
|
+
}
|
2734
|
+
}, [rawError, value]);
|
2712
2735
|
const componentTmpKeyWithFocussedField = React.useMemo(() => {
|
2713
2736
|
if (search.has("field")) {
|
2714
2737
|
const fieldParam = search.get("field");
|
@@ -3256,18 +3279,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3256
3279
|
/* @__PURE__ */ jsx(Field.Hint, {})
|
3257
3280
|
] });
|
3258
3281
|
};
|
3259
|
-
function useDebounce(value, delay) {
|
3260
|
-
const [debouncedValue, setDebouncedValue] = useState(value);
|
3261
|
-
useEffect(() => {
|
3262
|
-
const handler = setTimeout(() => {
|
3263
|
-
setDebouncedValue(value);
|
3264
|
-
}, delay);
|
3265
|
-
return () => {
|
3266
|
-
clearTimeout(handler);
|
3267
|
-
};
|
3268
|
-
}, [value, delay]);
|
3269
|
-
return debouncedValue;
|
3270
|
-
}
|
3271
3282
|
const uidApi = contentManagerApi.injectEndpoints({
|
3272
3283
|
endpoints: (builder) => ({
|
3273
3284
|
getDefaultUID: builder.query({
|
@@ -4935,15 +4946,19 @@ const Wysiwyg = React.forwardRef(
|
|
4935
4946
|
);
|
4936
4947
|
const MemoizedWysiwyg = React.memo(Wysiwyg);
|
4937
4948
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4938
|
-
const { id } = useDoc();
|
4949
|
+
const { id, document: document2, collectionType } = useDoc();
|
4939
4950
|
const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
|
4940
4951
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4941
4952
|
const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4942
4953
|
const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4943
4954
|
const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4944
4955
|
const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4945
|
-
|
4946
|
-
|
4956
|
+
let idToCheck = id;
|
4957
|
+
if (collectionType === SINGLE_TYPES) {
|
4958
|
+
idToCheck = document2?.documentId;
|
4959
|
+
}
|
4960
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
4961
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
4947
4962
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4948
4963
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4949
4964
|
const fields = useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4954,6 +4969,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4954
4969
|
const {
|
4955
4970
|
edit: { components }
|
4956
4971
|
} = useDocLayout();
|
4972
|
+
const field = useField(props.name);
|
4957
4973
|
if (!visible) {
|
4958
4974
|
return null;
|
4959
4975
|
}
|
@@ -4964,7 +4980,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4964
4980
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4965
4981
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4966
4982
|
if (CustomInput) {
|
4967
|
-
return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
4983
|
+
return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4968
4984
|
}
|
4969
4985
|
return /* @__PURE__ */ jsx(
|
4970
4986
|
InputRenderer$1,
|
@@ -5125,6 +5141,14 @@ const DynamicComponent = ({
|
|
5125
5141
|
React.useEffect(() => {
|
5126
5142
|
dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
|
5127
5143
|
}, [dragPreviewRef, index]);
|
5144
|
+
const accordionValue = React.useId();
|
5145
|
+
const { value = [], rawError } = useField(`${name2}.${index}`);
|
5146
|
+
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
5147
|
+
React.useEffect(() => {
|
5148
|
+
if (rawError && value) {
|
5149
|
+
setCollapseToOpen(accordionValue);
|
5150
|
+
}
|
5151
|
+
}, [rawError, value, accordionValue]);
|
5128
5152
|
const composedBoxRefs = useComposedRefs(boxRef, dropRef);
|
5129
5153
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
5130
5154
|
/* @__PURE__ */ jsx(
|
@@ -5190,10 +5214,9 @@ const DynamicComponent = ({
|
|
5190
5214
|
] })
|
5191
5215
|
] });
|
5192
5216
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5193
|
-
const accordionValue = React.useId();
|
5194
5217
|
return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5195
5218
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
|
5196
|
-
/* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
|
5219
|
+
/* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
|
5197
5220
|
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
5198
5221
|
/* @__PURE__ */ jsx(
|
5199
5222
|
Accordion.Trigger,
|
@@ -5204,21 +5227,32 @@ const DynamicComponent = ({
|
|
5204
5227
|
),
|
5205
5228
|
/* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
|
5206
5229
|
] }),
|
5207
|
-
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5208
|
-
|
5209
|
-
|
5210
|
-
|
5211
|
-
|
5212
|
-
|
5213
|
-
|
5214
|
-
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5218
|
-
|
5219
|
-
|
5220
|
-
|
5221
|
-
|
5230
|
+
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(
|
5231
|
+
Grid$1.Item,
|
5232
|
+
{
|
5233
|
+
col: 12,
|
5234
|
+
s: 12,
|
5235
|
+
xs: 12,
|
5236
|
+
direction: "column",
|
5237
|
+
alignItems: "stretch",
|
5238
|
+
children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5239
|
+
const fieldName = `${name2}.${index}.${field.name}`;
|
5240
|
+
return /* @__PURE__ */ jsx(
|
5241
|
+
Grid$1.Item,
|
5242
|
+
{
|
5243
|
+
col: size,
|
5244
|
+
s: 12,
|
5245
|
+
xs: 12,
|
5246
|
+
direction: "column",
|
5247
|
+
alignItems: "stretch",
|
5248
|
+
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
|
5249
|
+
},
|
5250
|
+
fieldName
|
5251
|
+
);
|
5252
|
+
}) })
|
5253
|
+
},
|
5254
|
+
rowInd
|
5255
|
+
)) }) }) }) })
|
5222
5256
|
] }) }) })
|
5223
5257
|
] });
|
5224
5258
|
};
|
@@ -5526,4 +5560,4 @@ export {
|
|
5526
5560
|
transformDocument as t,
|
5527
5561
|
useLazyComponents as u
|
5528
5562
|
};
|
5529
|
-
//# sourceMappingURL=Field-
|
5563
|
+
//# sourceMappingURL=Field-D-mgn1tH.mjs.map
|