@strapi/content-manager 0.0.0-experimental.f2351bcfa3965c60f063a492da51faa2c636eee8 → 0.0.0-experimental.f49f46a1c17445a39e8af3f63124bcccf73842e6
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-BlAzljQ6.js → ComponentConfigurationPage-ClKl_TA2.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-BlAzljQ6.js.map → ComponentConfigurationPage-ClKl_TA2.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-Ccwb19Qj.mjs → ComponentConfigurationPage-D3ZWDAHG.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-Ccwb19Qj.mjs.map → ComponentConfigurationPage-D3ZWDAHG.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-C19b_9RL.mjs → EditConfigurationPage-BYCBSJxP.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-C19b_9RL.mjs.map → EditConfigurationPage-BYCBSJxP.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BPoOzhCM.js → EditConfigurationPage-OWez0Kxp.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-BPoOzhCM.js.map → EditConfigurationPage-OWez0Kxp.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-nmrHNiJ9.mjs → EditViewPage-5pdbvsO_.mjs} +50 -10
- package/dist/_chunks/EditViewPage-5pdbvsO_.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-D9xH8HYD.js → EditViewPage-BEs5iGDi.js} +49 -9
- package/dist/_chunks/EditViewPage-BEs5iGDi.js.map +1 -0
- package/dist/_chunks/{Field-BB_pHo6D.js → Field-DNHm4wHx.js} +107 -44
- package/dist/_chunks/Field-DNHm4wHx.js.map +1 -0
- package/dist/_chunks/{Field--kmlJuSb.mjs → Field-DcKuFHYK.mjs} +107 -44
- package/dist/_chunks/Field-DcKuFHYK.mjs.map +1 -0
- package/dist/_chunks/{Form-CUtOiC4S.mjs → Form-CGwM_-5c.mjs} +3 -3
- package/dist/_chunks/Form-CGwM_-5c.mjs.map +1 -0
- package/dist/_chunks/{Form-iwbkoaAF.js → Form-CoRxWJOz.js} +3 -3
- package/dist/_chunks/Form-CoRxWJOz.js.map +1 -0
- package/dist/_chunks/{History-guuZF4lR.js → History-BcUTQrfG.js} +40 -97
- package/dist/_chunks/History-BcUTQrfG.js.map +1 -0
- package/dist/_chunks/{History-BKR3KyU3.mjs → History-DEvr3Q_V.mjs} +42 -99
- package/dist/_chunks/History-DEvr3Q_V.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Cu26t5sE.js → ListConfigurationPage-BE_Ho7tV.js} +5 -4
- package/dist/_chunks/ListConfigurationPage-BE_Ho7tV.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-B_O3hiLT.mjs → ListConfigurationPage-BM4zZZcM.mjs} +6 -5
- package/dist/_chunks/ListConfigurationPage-BM4zZZcM.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-B4sTBfu6.mjs → ListViewPage-BK2mkrql.mjs} +29 -7
- package/dist/_chunks/{ListViewPage-B4sTBfu6.mjs.map → ListViewPage-BK2mkrql.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-DWqqGno8.js → ListViewPage-BkT8Eao0.js} +29 -7
- package/dist/_chunks/ListViewPage-BkT8Eao0.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Daktt4t9.mjs → NoContentTypePage-BvcAutu9.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-Daktt4t9.mjs.map → NoContentTypePage-BvcAutu9.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-TTkwA8uk.js → NoContentTypePage-C8mtyc4H.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-TTkwA8uk.js.map → NoContentTypePage-C8mtyc4H.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-D8_k39Q0.js → NoPermissionsPage-B5Y9Y78B.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-D8_k39Q0.js.map → NoPermissionsPage-B5Y9Y78B.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CBUXY2Pt.mjs → NoPermissionsPage-BmbRz7PR.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CBUXY2Pt.mjs.map → NoPermissionsPage-BmbRz7PR.mjs.map} +1 -1
- package/dist/_chunks/Preview-BF8ZDYqS.js +286 -0
- package/dist/_chunks/Preview-BF8ZDYqS.js.map +1 -0
- package/dist/_chunks/Preview-DcexhKJE.mjs +267 -0
- package/dist/_chunks/Preview-DcexhKJE.mjs.map +1 -0
- package/dist/_chunks/{Relations-DjvmZ_XQ.js → Relations-BKnoK1R0.js} +71 -35
- package/dist/_chunks/Relations-BKnoK1R0.js.map +1 -0
- package/dist/_chunks/{Relations-HKmXF7eO.mjs → Relations-BjIzc4EK.mjs} +72 -36
- package/dist/_chunks/Relations-BjIzc4EK.mjs.map +1 -0
- package/dist/_chunks/{en-CPTj6CjC.mjs → en-CfIXaZf9.mjs} +21 -10
- package/dist/_chunks/{en-CPTj6CjC.mjs.map → en-CfIXaZf9.mjs.map} +1 -1
- package/dist/_chunks/{en-BVzUkPxZ.js → en-DTWPCdTS.js} +21 -10
- package/dist/_chunks/{en-BVzUkPxZ.js.map → en-DTWPCdTS.js.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/{index-CB1AN26E.mjs → index-BW-rXkjn.mjs} +882 -721
- package/dist/_chunks/index-BW-rXkjn.mjs.map +1 -0
- package/dist/_chunks/{index-jDJgW_Lf.js → index-DOzAG2cq.js} +879 -717
- package/dist/_chunks/index-DOzAG2cq.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-BCzDsMgN.mjs → layout-DFVbgjp2.mjs} +3 -3
- package/dist/_chunks/{layout-BCzDsMgN.mjs.map → layout-DFVbgjp2.mjs.map} +1 -1
- package/dist/_chunks/{layout-D6A3K-ut.js → layout-RC3W2obV.js} +3 -3
- package/dist/_chunks/{layout-D6A3K-ut.js.map → layout-RC3W2obV.js.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-B5Jnw32V.mjs → relations-Dogh8HWI.mjs} +6 -7
- package/dist/_chunks/relations-Dogh8HWI.mjs.map +1 -0
- package/dist/_chunks/{relations-C10QoukP.js → relations-zam7-5H7.js} +6 -7
- package/dist/_chunks/relations-zam7-5H7.js.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +4 -3
- 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/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/Header.d.ts +1 -0
- package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
- package/dist/admin/src/preview/routes.d.ts +3 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/router.d.ts +1 -1
- package/dist/server/index.js +374 -160
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +374 -160
- 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-manager.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/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-D9xH8HYD.js.map +0 -1
- package/dist/_chunks/EditViewPage-nmrHNiJ9.mjs.map +0 -1
- package/dist/_chunks/Field--kmlJuSb.mjs.map +0 -1
- package/dist/_chunks/Field-BB_pHo6D.js.map +0 -1
- package/dist/_chunks/Form-CUtOiC4S.mjs.map +0 -1
- package/dist/_chunks/Form-iwbkoaAF.js.map +0 -1
- package/dist/_chunks/History-BKR3KyU3.mjs.map +0 -1
- package/dist/_chunks/History-guuZF4lR.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-B_O3hiLT.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Cu26t5sE.js.map +0 -1
- package/dist/_chunks/ListViewPage-DWqqGno8.js.map +0 -1
- package/dist/_chunks/Relations-DjvmZ_XQ.js.map +0 -1
- package/dist/_chunks/Relations-HKmXF7eO.mjs.map +0 -1
- package/dist/_chunks/index-CB1AN26E.mjs.map +0 -1
- package/dist/_chunks/index-jDJgW_Lf.js.map +0 -1
- package/dist/_chunks/relations-B5Jnw32V.mjs.map +0 -1
- package/dist/_chunks/relations-C10QoukP.js.map +0 -1
- package/strapi-server.js +0 -3
@@ -5,15 +5,15 @@ 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-BW-rXkjn.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-BjIzc4EK.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";
|
@@ -2624,7 +2624,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2624
2624
|
Box,
|
2625
2625
|
{
|
2626
2626
|
tag: "button",
|
2627
|
-
background: "neutral100",
|
2627
|
+
background: disabled ? "neutral150" : "neutral100",
|
2628
2628
|
borderColor: field.error ? "danger600" : "neutral200",
|
2629
2629
|
hasRadius: true,
|
2630
2630
|
disabled,
|
@@ -2632,32 +2632,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2632
2632
|
paddingTop: 9,
|
2633
2633
|
paddingBottom: 9,
|
2634
2634
|
type: "button",
|
2635
|
+
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
2635
2636
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
2636
|
-
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2637
|
-
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2637
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsx(PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
|
2638
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2639
|
+
Typography,
|
2640
|
+
{
|
2641
|
+
textColor: disabled ? "neutral600" : "primary600",
|
2642
|
+
variant: "pi",
|
2643
|
+
fontWeight: "bold",
|
2644
|
+
children: formatMessage({
|
2645
|
+
id: getTranslation("components.empty-repeatable"),
|
2646
|
+
defaultMessage: "No entry yet. Click to add one."
|
2647
|
+
})
|
2648
|
+
}
|
2649
|
+
) })
|
2641
2650
|
] })
|
2642
2651
|
}
|
2643
2652
|
) });
|
2644
2653
|
};
|
2645
|
-
const CircleIcon = styled(PlusCircle)`
|
2646
|
-
width: 2.4rem;
|
2647
|
-
height: 2.4rem;
|
2648
|
-
> circle {
|
2649
|
-
fill: ${({ theme }) => theme.colors.primary200};
|
2650
|
-
}
|
2651
|
-
> path {
|
2652
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
2653
|
-
}
|
2654
|
-
`;
|
2655
2654
|
const NonRepeatableComponent = ({
|
2656
2655
|
attribute,
|
2657
2656
|
name: name2,
|
2658
2657
|
children,
|
2659
2658
|
layout
|
2660
2659
|
}) => {
|
2660
|
+
const { formatMessage } = useIntl();
|
2661
2661
|
const { value } = useField(name2);
|
2662
2662
|
const level = useComponent("NonRepeatableComponent", (state) => state.level);
|
2663
2663
|
const isNested = level > 0;
|
@@ -2674,6 +2674,10 @@ const NonRepeatableComponent = ({
|
|
2674
2674
|
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
|
2675
2675
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2676
2676
|
const completeFieldName = `${name2}.${field.name}`;
|
2677
|
+
const translatedLabel = formatMessage({
|
2678
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2679
|
+
defaultMessage: field.label
|
2680
|
+
});
|
2677
2681
|
return /* @__PURE__ */ jsx(
|
2678
2682
|
Grid$1.Item,
|
2679
2683
|
{
|
@@ -2682,7 +2686,7 @@ const NonRepeatableComponent = ({
|
|
2682
2686
|
xs: 12,
|
2683
2687
|
direction: "column",
|
2684
2688
|
alignItems: "stretch",
|
2685
|
-
children: children({ ...field, name: completeFieldName })
|
2689
|
+
children: children({ ...field, label: translatedLabel, name: completeFieldName })
|
2686
2690
|
},
|
2687
2691
|
completeFieldName
|
2688
2692
|
);
|
@@ -2704,13 +2708,34 @@ const RepeatableComponent = ({
|
|
2704
2708
|
const { search: searchString } = useLocation();
|
2705
2709
|
const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2706
2710
|
const { components } = useDoc();
|
2707
|
-
const {
|
2711
|
+
const {
|
2712
|
+
value = [],
|
2713
|
+
error,
|
2714
|
+
rawError
|
2715
|
+
} = useField(name2);
|
2708
2716
|
const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2709
2717
|
const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2710
2718
|
const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2711
2719
|
const { max = Infinity } = attribute;
|
2712
2720
|
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
2713
2721
|
const [liveText, setLiveText] = React.useState("");
|
2722
|
+
React.useEffect(() => {
|
2723
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2724
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2725
|
+
if (hasNestedErrors && hasNestedValue) {
|
2726
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2727
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2728
|
+
}).filter((value2) => !!value2);
|
2729
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2730
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2731
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2732
|
+
return errorOpenItems[0];
|
2733
|
+
}
|
2734
|
+
return collapseToOpen2;
|
2735
|
+
});
|
2736
|
+
}
|
2737
|
+
}
|
2738
|
+
}, [rawError, value]);
|
2714
2739
|
const componentTmpKeyWithFocussedField = React.useMemo(() => {
|
2715
2740
|
if (search.has("field")) {
|
2716
2741
|
const fieldParam = search.get("field");
|
@@ -2863,6 +2888,10 @@ const RepeatableComponent = ({
|
|
2863
2888
|
children: layout.map((row, index2) => {
|
2864
2889
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2865
2890
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2891
|
+
const translatedLabel = formatMessage({
|
2892
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2893
|
+
defaultMessage: field.label
|
2894
|
+
});
|
2866
2895
|
return /* @__PURE__ */ jsx(
|
2867
2896
|
Grid$1.Item,
|
2868
2897
|
{
|
@@ -2871,7 +2900,11 @@ const RepeatableComponent = ({
|
|
2871
2900
|
xs: 12,
|
2872
2901
|
direction: "column",
|
2873
2902
|
alignItems: "stretch",
|
2874
|
-
children: children({
|
2903
|
+
children: children({
|
2904
|
+
...field,
|
2905
|
+
label: translatedLabel,
|
2906
|
+
name: completeFieldName
|
2907
|
+
})
|
2875
2908
|
},
|
2876
2909
|
completeFieldName
|
2877
2910
|
);
|
@@ -4925,15 +4958,19 @@ const Wysiwyg = React.forwardRef(
|
|
4925
4958
|
);
|
4926
4959
|
const MemoizedWysiwyg = React.memo(Wysiwyg);
|
4927
4960
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4928
|
-
const { id } = useDoc();
|
4961
|
+
const { id, document: document2, collectionType } = useDoc();
|
4929
4962
|
const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
|
4930
4963
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4931
4964
|
const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4932
4965
|
const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4933
4966
|
const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4934
4967
|
const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4935
|
-
|
4936
|
-
|
4968
|
+
let idToCheck = id;
|
4969
|
+
if (collectionType === SINGLE_TYPES) {
|
4970
|
+
idToCheck = document2?.documentId;
|
4971
|
+
}
|
4972
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
4973
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
4937
4974
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4938
4975
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4939
4976
|
const fields = useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4944,6 +4981,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4944
4981
|
const {
|
4945
4982
|
edit: { components }
|
4946
4983
|
} = useDocLayout();
|
4984
|
+
const field = useField(props.name);
|
4947
4985
|
if (!visible) {
|
4948
4986
|
return null;
|
4949
4987
|
}
|
@@ -4954,7 +4992,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4954
4992
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4955
4993
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4956
4994
|
if (CustomInput) {
|
4957
|
-
return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
4995
|
+
return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4958
4996
|
}
|
4959
4997
|
return /* @__PURE__ */ jsx(
|
4960
4998
|
InputRenderer$1,
|
@@ -5115,6 +5153,14 @@ const DynamicComponent = ({
|
|
5115
5153
|
React.useEffect(() => {
|
5116
5154
|
dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
|
5117
5155
|
}, [dragPreviewRef, index]);
|
5156
|
+
const accordionValue = React.useId();
|
5157
|
+
const { value = [], rawError } = useField(`${name2}.${index}`);
|
5158
|
+
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
5159
|
+
React.useEffect(() => {
|
5160
|
+
if (rawError && value) {
|
5161
|
+
setCollapseToOpen(accordionValue);
|
5162
|
+
}
|
5163
|
+
}, [rawError, value, accordionValue]);
|
5118
5164
|
const composedBoxRefs = useComposedRefs(boxRef, dropRef);
|
5119
5165
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
5120
5166
|
/* @__PURE__ */ jsx(
|
@@ -5180,10 +5226,9 @@ const DynamicComponent = ({
|
|
5180
5226
|
] })
|
5181
5227
|
] });
|
5182
5228
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5183
|
-
const accordionValue = React.useId();
|
5184
5229
|
return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5185
5230
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
|
5186
|
-
/* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
|
5231
|
+
/* @__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: [
|
5187
5232
|
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
5188
5233
|
/* @__PURE__ */ jsx(
|
5189
5234
|
Accordion.Trigger,
|
@@ -5194,21 +5239,39 @@ const DynamicComponent = ({
|
|
5194
5239
|
),
|
5195
5240
|
/* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
|
5196
5241
|
] }),
|
5197
|
-
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5198
|
-
|
5199
|
-
|
5200
|
-
|
5201
|
-
|
5202
|
-
|
5203
|
-
|
5204
|
-
|
5205
|
-
|
5206
|
-
|
5207
|
-
|
5208
|
-
|
5209
|
-
|
5210
|
-
|
5211
|
-
|
5242
|
+
/* @__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(
|
5243
|
+
Grid$1.Item,
|
5244
|
+
{
|
5245
|
+
col: 12,
|
5246
|
+
s: 12,
|
5247
|
+
xs: 12,
|
5248
|
+
direction: "column",
|
5249
|
+
alignItems: "stretch",
|
5250
|
+
children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5251
|
+
const fieldName = `${name2}.${index}.${field.name}`;
|
5252
|
+
const fieldWithTranslatedLabel = {
|
5253
|
+
...field,
|
5254
|
+
label: formatMessage({
|
5255
|
+
id: `content-manager.components.${componentUid}.${field.name}`,
|
5256
|
+
defaultMessage: field.label
|
5257
|
+
})
|
5258
|
+
};
|
5259
|
+
return /* @__PURE__ */ jsx(
|
5260
|
+
Grid$1.Item,
|
5261
|
+
{
|
5262
|
+
col: size,
|
5263
|
+
s: 12,
|
5264
|
+
xs: 12,
|
5265
|
+
direction: "column",
|
5266
|
+
alignItems: "stretch",
|
5267
|
+
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
|
5268
|
+
},
|
5269
|
+
fieldName
|
5270
|
+
);
|
5271
|
+
}) })
|
5272
|
+
},
|
5273
|
+
rowInd
|
5274
|
+
)) }) }) }) })
|
5212
5275
|
] }) }) })
|
5213
5276
|
] });
|
5214
5277
|
};
|
@@ -5516,4 +5579,4 @@ export {
|
|
5516
5579
|
transformDocument as t,
|
5517
5580
|
useLazyComponents as u
|
5518
5581
|
};
|
5519
|
-
//# sourceMappingURL=Field
|
5582
|
+
//# sourceMappingURL=Field-DcKuFHYK.mjs.map
|