@strapi/content-manager 0.0.0-experimental.e9122b401c96877b6707775c4f893660eab93ae3 → 0.0.0-experimental.eba25ec571b091c6bde1104eb6c753debdf15462
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-CpBFh6_r.mjs → ComponentConfigurationPage-BaJMOQyq.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-CpBFh6_r.mjs.map → ComponentConfigurationPage-BaJMOQyq.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-_zF8p6CY.js → ComponentConfigurationPage-N-CTtgQa.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-_zF8p6CY.js.map → ComponentConfigurationPage-N-CTtgQa.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-_aG2DJSU.js → EditConfigurationPage-BHkjAbxH.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-_aG2DJSU.js.map → EditConfigurationPage-BHkjAbxH.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CE_yavTi.mjs → EditConfigurationPage-CKK-5LfX.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-CE_yavTi.mjs.map → EditConfigurationPage-CKK-5LfX.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-DeTn7rAF.mjs → EditViewPage-B11aeMcf.mjs} +50 -10
- package/dist/_chunks/EditViewPage-B11aeMcf.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-G9uNzwYL.js → EditViewPage-QPUftxUd.js} +49 -9
- package/dist/_chunks/EditViewPage-QPUftxUd.js.map +1 -0
- package/dist/_chunks/{Field-CnCKhI1R.mjs → Field-Bj_RgtGo.mjs} +109 -46
- package/dist/_chunks/Field-Bj_RgtGo.mjs.map +1 -0
- package/dist/_chunks/{Field-DDHUWEfV.js → Field-DUK83cfh.js} +108 -45
- package/dist/_chunks/Field-DUK83cfh.js.map +1 -0
- package/dist/_chunks/{Form-DYETaKUX.js → Form-DHmBRlHd.js} +3 -3
- package/dist/_chunks/Form-DHmBRlHd.js.map +1 -0
- package/dist/_chunks/{Form-IvVVwqRL.mjs → Form-DLMSoXV7.mjs} +3 -3
- package/dist/_chunks/Form-DLMSoXV7.mjs.map +1 -0
- package/dist/_chunks/{History-BMunT-do.mjs → History-CfCSNlG9.mjs} +43 -100
- package/dist/_chunks/History-CfCSNlG9.mjs.map +1 -0
- package/dist/_chunks/{History-CnZDctSO.js → History-Di3zm4HT.js} +41 -98
- package/dist/_chunks/History-Di3zm4HT.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-CDqkCxgV.mjs → ListConfigurationPage-0mtv_iqk.mjs} +6 -5
- package/dist/_chunks/ListConfigurationPage-0mtv_iqk.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BynalOp8.js → ListConfigurationPage-Cq361KIt.js} +5 -4
- package/dist/_chunks/ListConfigurationPage-Cq361KIt.js.map +1 -0
- package/dist/_chunks/{ListViewPage-_5gS-DOF.mjs → ListViewPage-BxLVROX8.mjs} +69 -42
- package/dist/_chunks/ListViewPage-BxLVROX8.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-I88Ouzoq.js → ListViewPage-DFDcG8gM.js} +69 -42
- package/dist/_chunks/ListViewPage-DFDcG8gM.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Dht-55hr.mjs → NoContentTypePage-BRfDd67_.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-Dht-55hr.mjs.map → NoContentTypePage-BRfDd67_.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BaWQ7HsA.js → NoContentTypePage-BSyvnDZZ.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BaWQ7HsA.js.map → NoContentTypePage-BSyvnDZZ.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-Bs8D5W_v.mjs → NoPermissionsPage-CV9V8KWa.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-Bs8D5W_v.mjs.map → NoPermissionsPage-CV9V8KWa.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DCVUh5at.js → NoPermissionsPage-DyLphsn_.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DCVUh5at.js.map → NoPermissionsPage-DyLphsn_.js.map} +1 -1
- package/dist/_chunks/Preview-C_B1nx3g.mjs +272 -0
- package/dist/_chunks/Preview-C_B1nx3g.mjs.map +1 -0
- package/dist/_chunks/Preview-D_3aO6Ly.js +291 -0
- package/dist/_chunks/Preview-D_3aO6Ly.js.map +1 -0
- package/dist/_chunks/{Relations-Chdt5qWc.mjs → Relations-C6pwmDXh.mjs} +72 -36
- package/dist/_chunks/Relations-C6pwmDXh.mjs.map +1 -0
- package/dist/_chunks/{Relations-BPgFQeGj.js → Relations-Cne2AlrL.js} +71 -35
- package/dist/_chunks/Relations-Cne2AlrL.js.map +1 -0
- package/dist/_chunks/{en-CPTj6CjC.mjs → en-DhFUjrNW.mjs} +22 -11
- package/dist/_chunks/{en-CPTj6CjC.mjs.map → en-DhFUjrNW.mjs.map} +1 -1
- package/dist/_chunks/{en-BVzUkPxZ.js → en-Ic0kXjxB.js} +22 -11
- package/dist/_chunks/{en-BVzUkPxZ.js.map → en-Ic0kXjxB.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-D4UGPFZC.mjs → index-BpxR3En4.mjs} +887 -726
- package/dist/_chunks/index-BpxR3En4.mjs.map +1 -0
- package/dist/_chunks/{index-BhbLFX4l.js → index-T-aWjbj2.js} +884 -722
- package/dist/_chunks/index-T-aWjbj2.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-CYA7s0qO.js → layout-BEuNwv-F.js} +3 -3
- package/dist/_chunks/{layout-CYA7s0qO.js.map → layout-BEuNwv-F.js.map} +1 -1
- package/dist/_chunks/{layout-D4HI4_PS.mjs → layout-DhMZ_lDx.mjs} +3 -3
- package/dist/_chunks/{layout-D4HI4_PS.mjs.map → layout-DhMZ_lDx.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-1pXaYpBK.mjs → relations-BdnxoX6f.mjs} +6 -7
- package/dist/_chunks/relations-BdnxoX6f.mjs.map +1 -0
- package/dist/_chunks/{relations-DDZ9OxNo.js → relations-kLcuobLk.js} +6 -7
- package/dist/_chunks/relations-kLcuobLk.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/admin/src/services/documents.d.ts +0 -3
- package/dist/server/index.js +421 -160
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +422 -161
- 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 +16 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +32 -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 +19 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/register.d.ts.map +1 -1
- 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-DeTn7rAF.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-G9uNzwYL.js.map +0 -1
- package/dist/_chunks/Field-CnCKhI1R.mjs.map +0 -1
- package/dist/_chunks/Field-DDHUWEfV.js.map +0 -1
- package/dist/_chunks/Form-DYETaKUX.js.map +0 -1
- package/dist/_chunks/Form-IvVVwqRL.mjs.map +0 -1
- package/dist/_chunks/History-BMunT-do.mjs.map +0 -1
- package/dist/_chunks/History-CnZDctSO.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-BynalOp8.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-CDqkCxgV.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-I88Ouzoq.js.map +0 -1
- package/dist/_chunks/ListViewPage-_5gS-DOF.mjs.map +0 -1
- package/dist/_chunks/Relations-BPgFQeGj.js.map +0 -1
- package/dist/_chunks/Relations-Chdt5qWc.mjs.map +0 -1
- package/dist/_chunks/index-BhbLFX4l.js.map +0 -1
- package/dist/_chunks/index-D4UGPFZC.mjs.map +0 -1
- package/dist/_chunks/relations-1pXaYpBK.mjs.map +0 -1
- package/dist/_chunks/relations-DDZ9OxNo.js.map +0 -1
- package/strapi-server.js +0 -3
@@ -5,15 +5,15 @@ const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
6
6
|
const pipe$1 = require("lodash/fp/pipe");
|
7
7
|
const reactIntl = require("react-intl");
|
8
|
-
const index = require("./index-
|
8
|
+
const index = require("./index-T-aWjbj2.js");
|
9
9
|
const fractionalIndexing = require("fractional-indexing");
|
10
|
-
const Relations = require("./Relations-
|
10
|
+
const Relations = require("./Relations-Cne2AlrL.js");
|
11
11
|
const Icons = require("@strapi/icons");
|
12
12
|
const styledComponents = require("styled-components");
|
13
13
|
const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
|
14
14
|
const reactDndHtml5Backend = require("react-dnd-html5-backend");
|
15
15
|
const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
|
16
|
-
const objects = require("./objects-
|
16
|
+
const objects = require("./objects-BcXOv6_9.js");
|
17
17
|
const slate = require("slate");
|
18
18
|
const slateHistory = require("slate-history");
|
19
19
|
const slateReact = require("slate-react");
|
@@ -542,7 +542,7 @@ const CodeEditor = (props) => {
|
|
542
542
|
const codeBlocks = {
|
543
543
|
code: {
|
544
544
|
renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(CodeEditor, { ...props }),
|
545
|
-
icon: Icons.
|
545
|
+
icon: Icons.CodeBlock,
|
546
546
|
label: {
|
547
547
|
id: "components.Blocks.blocks.code",
|
548
548
|
defaultMessage: "Code block"
|
@@ -2658,7 +2658,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2658
2658
|
designSystem.Box,
|
2659
2659
|
{
|
2660
2660
|
tag: "button",
|
2661
|
-
background: "neutral100",
|
2661
|
+
background: disabled ? "neutral150" : "neutral100",
|
2662
2662
|
borderColor: field.error ? "danger600" : "neutral200",
|
2663
2663
|
hasRadius: true,
|
2664
2664
|
disabled,
|
@@ -2666,32 +2666,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2666
2666
|
paddingTop: 9,
|
2667
2667
|
paddingBottom: 9,
|
2668
2668
|
type: "button",
|
2669
|
+
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
2669
2670
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
2670
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
2671
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
2672
|
-
|
2673
|
-
|
2674
|
-
|
2671
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
|
2672
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(
|
2673
|
+
designSystem.Typography,
|
2674
|
+
{
|
2675
|
+
textColor: disabled ? "neutral600" : "primary600",
|
2676
|
+
variant: "pi",
|
2677
|
+
fontWeight: "bold",
|
2678
|
+
children: formatMessage({
|
2679
|
+
id: index.getTranslation("components.empty-repeatable"),
|
2680
|
+
defaultMessage: "No entry yet. Click to add one."
|
2681
|
+
})
|
2682
|
+
}
|
2683
|
+
) })
|
2675
2684
|
] })
|
2676
2685
|
}
|
2677
2686
|
) });
|
2678
2687
|
};
|
2679
|
-
const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
|
2680
|
-
width: 2.4rem;
|
2681
|
-
height: 2.4rem;
|
2682
|
-
> circle {
|
2683
|
-
fill: ${({ theme }) => theme.colors.primary200};
|
2684
|
-
}
|
2685
|
-
> path {
|
2686
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
2687
|
-
}
|
2688
|
-
`;
|
2689
2688
|
const NonRepeatableComponent = ({
|
2690
2689
|
attribute,
|
2691
2690
|
name: name2,
|
2692
2691
|
children,
|
2693
2692
|
layout
|
2694
2693
|
}) => {
|
2694
|
+
const { formatMessage } = reactIntl.useIntl();
|
2695
2695
|
const { value } = strapiAdmin.useField(name2);
|
2696
2696
|
const level = Relations.useComponent("NonRepeatableComponent", (state) => state.level);
|
2697
2697
|
const isNested = level > 0;
|
@@ -2708,6 +2708,10 @@ const NonRepeatableComponent = ({
|
|
2708
2708
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
|
2709
2709
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2710
2710
|
const completeFieldName = `${name2}.${field.name}`;
|
2711
|
+
const translatedLabel = formatMessage({
|
2712
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2713
|
+
defaultMessage: field.label
|
2714
|
+
});
|
2711
2715
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
2712
2716
|
designSystem.Grid.Item,
|
2713
2717
|
{
|
@@ -2716,7 +2720,7 @@ const NonRepeatableComponent = ({
|
|
2716
2720
|
xs: 12,
|
2717
2721
|
direction: "column",
|
2718
2722
|
alignItems: "stretch",
|
2719
|
-
children: children({ ...field, name: completeFieldName })
|
2723
|
+
children: children({ ...field, label: translatedLabel, name: completeFieldName })
|
2720
2724
|
},
|
2721
2725
|
completeFieldName
|
2722
2726
|
);
|
@@ -2738,13 +2742,34 @@ const RepeatableComponent = ({
|
|
2738
2742
|
const { search: searchString } = reactRouterDom.useLocation();
|
2739
2743
|
const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2740
2744
|
const { components } = index.useDoc();
|
2741
|
-
const {
|
2745
|
+
const {
|
2746
|
+
value = [],
|
2747
|
+
error,
|
2748
|
+
rawError
|
2749
|
+
} = strapiAdmin.useField(name2);
|
2742
2750
|
const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2743
2751
|
const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2744
2752
|
const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2745
2753
|
const { max = Infinity } = attribute;
|
2746
2754
|
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
2747
2755
|
const [liveText, setLiveText] = React__namespace.useState("");
|
2756
|
+
React__namespace.useEffect(() => {
|
2757
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2758
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2759
|
+
if (hasNestedErrors && hasNestedValue) {
|
2760
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2761
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2762
|
+
}).filter((value2) => !!value2);
|
2763
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2764
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2765
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2766
|
+
return errorOpenItems[0];
|
2767
|
+
}
|
2768
|
+
return collapseToOpen2;
|
2769
|
+
});
|
2770
|
+
}
|
2771
|
+
}
|
2772
|
+
}, [rawError, value]);
|
2748
2773
|
const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
|
2749
2774
|
if (search.has("field")) {
|
2750
2775
|
const fieldParam = search.get("field");
|
@@ -2897,6 +2922,10 @@ const RepeatableComponent = ({
|
|
2897
2922
|
children: layout.map((row, index22) => {
|
2898
2923
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2899
2924
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2925
|
+
const translatedLabel = formatMessage({
|
2926
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2927
|
+
defaultMessage: field.label
|
2928
|
+
});
|
2900
2929
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
2901
2930
|
designSystem.Grid.Item,
|
2902
2931
|
{
|
@@ -2905,7 +2934,11 @@ const RepeatableComponent = ({
|
|
2905
2934
|
xs: 12,
|
2906
2935
|
direction: "column",
|
2907
2936
|
alignItems: "stretch",
|
2908
|
-
children: children({
|
2937
|
+
children: children({
|
2938
|
+
...field,
|
2939
|
+
label: translatedLabel,
|
2940
|
+
name: completeFieldName
|
2941
|
+
})
|
2909
2942
|
},
|
2910
2943
|
completeFieldName
|
2911
2944
|
);
|
@@ -4959,15 +4992,19 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4959
4992
|
);
|
4960
4993
|
const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
|
4961
4994
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4962
|
-
const { id } = index.useDoc();
|
4995
|
+
const { id, document: document2, collectionType } = index.useDoc();
|
4963
4996
|
const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
|
4964
4997
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4965
4998
|
const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4966
4999
|
const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4967
5000
|
const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4968
5001
|
const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4969
|
-
|
4970
|
-
|
5002
|
+
let idToCheck = id;
|
5003
|
+
if (collectionType === index.SINGLE_TYPES) {
|
5004
|
+
idToCheck = document2?.documentId;
|
5005
|
+
}
|
5006
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
5007
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
4971
5008
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4972
5009
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4973
5010
|
const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4978,6 +5015,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4978
5015
|
const {
|
4979
5016
|
edit: { components }
|
4980
5017
|
} = index.useDocLayout();
|
5018
|
+
const field = strapiAdmin.useField(props.name);
|
4981
5019
|
if (!visible) {
|
4982
5020
|
return null;
|
4983
5021
|
}
|
@@ -4988,7 +5026,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4988
5026
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4989
5027
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4990
5028
|
if (CustomInput) {
|
4991
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
5029
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4992
5030
|
}
|
4993
5031
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4994
5032
|
strapiAdmin.InputRenderer,
|
@@ -5149,6 +5187,14 @@ const DynamicComponent = ({
|
|
5149
5187
|
React__namespace.useEffect(() => {
|
5150
5188
|
dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
|
5151
5189
|
}, [dragPreviewRef, index$1]);
|
5190
|
+
const accordionValue = React__namespace.useId();
|
5191
|
+
const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
|
5192
|
+
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
5193
|
+
React__namespace.useEffect(() => {
|
5194
|
+
if (rawError && value) {
|
5195
|
+
setCollapseToOpen(accordionValue);
|
5196
|
+
}
|
5197
|
+
}, [rawError, value, accordionValue]);
|
5152
5198
|
const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
|
5153
5199
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
5154
5200
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -5214,10 +5260,9 @@ const DynamicComponent = ({
|
|
5214
5260
|
] })
|
5215
5261
|
] });
|
5216
5262
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5217
|
-
const accordionValue = React__namespace.useId();
|
5218
5263
|
return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5219
5264
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
|
5220
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
|
5265
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
|
5221
5266
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
|
5222
5267
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5223
5268
|
designSystem.Accordion.Trigger,
|
@@ -5228,21 +5273,39 @@ const DynamicComponent = ({
|
|
5228
5273
|
),
|
5229
5274
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
|
5230
5275
|
] }),
|
5231
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5232
|
-
|
5233
|
-
|
5234
|
-
|
5235
|
-
|
5236
|
-
|
5237
|
-
|
5238
|
-
|
5239
|
-
|
5240
|
-
|
5241
|
-
|
5242
|
-
|
5243
|
-
|
5244
|
-
|
5245
|
-
|
5276
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(
|
5277
|
+
designSystem.Grid.Item,
|
5278
|
+
{
|
5279
|
+
col: 12,
|
5280
|
+
s: 12,
|
5281
|
+
xs: 12,
|
5282
|
+
direction: "column",
|
5283
|
+
alignItems: "stretch",
|
5284
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5285
|
+
const fieldName = `${name2}.${index$1}.${field.name}`;
|
5286
|
+
const fieldWithTranslatedLabel = {
|
5287
|
+
...field,
|
5288
|
+
label: formatMessage({
|
5289
|
+
id: `content-manager.components.${componentUid}.${field.name}`,
|
5290
|
+
defaultMessage: field.label
|
5291
|
+
})
|
5292
|
+
};
|
5293
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
5294
|
+
designSystem.Grid.Item,
|
5295
|
+
{
|
5296
|
+
col: size,
|
5297
|
+
s: 12,
|
5298
|
+
xs: 12,
|
5299
|
+
direction: "column",
|
5300
|
+
alignItems: "stretch",
|
5301
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
|
5302
|
+
},
|
5303
|
+
fieldName
|
5304
|
+
);
|
5305
|
+
}) })
|
5306
|
+
},
|
5307
|
+
rowInd
|
5308
|
+
)) }) }) }) })
|
5246
5309
|
] }) }) })
|
5247
5310
|
] });
|
5248
5311
|
};
|
@@ -5548,4 +5611,4 @@ exports.transformDocument = transformDocument;
|
|
5548
5611
|
exports.useDynamicZone = useDynamicZone;
|
5549
5612
|
exports.useFieldHint = useFieldHint;
|
5550
5613
|
exports.useLazyComponents = useLazyComponents;
|
5551
|
-
//# sourceMappingURL=Field-
|
5614
|
+
//# sourceMappingURL=Field-DUK83cfh.js.map
|