@strapi/content-manager 0.0.0-experimental.c592deb623aed3f74ef7fdacfad9757ed59d34f7 → 0.0.0-experimental.d3243594aea3e6fa0ef08580192bb0df29c9162d
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-7-qB29e7.mjs → ComponentConfigurationPage-DfFSZQxe.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-7-qB29e7.mjs.map → ComponentConfigurationPage-DfFSZQxe.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DP7AC0UU.js → ComponentConfigurationPage-FqfsxQ1j.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DP7AC0UU.js.map → ComponentConfigurationPage-FqfsxQ1j.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DITVliEI.js → EditConfigurationPage-Cn0e8t3I.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DITVliEI.js.map → EditConfigurationPage-Cn0e8t3I.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CI4XoymK.mjs → EditConfigurationPage-DdPNAbl3.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CI4XoymK.mjs.map → EditConfigurationPage-DdPNAbl3.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-Dzpno8xI.mjs → EditViewPage-B82x_x1b.mjs} +10 -4
- package/dist/_chunks/EditViewPage-B82x_x1b.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-CUS2EAhB.js → EditViewPage-DlxEHhUt.js} +10 -4
- package/dist/_chunks/EditViewPage-DlxEHhUt.js.map +1 -0
- package/dist/_chunks/{Field-CtUU1Fg8.js → Field-COL25JiC.js} +41 -9
- package/dist/_chunks/Field-COL25JiC.js.map +1 -0
- package/dist/_chunks/{Field-B_jG_EV9.mjs → Field-DufHXW17.mjs} +41 -9
- package/dist/_chunks/Field-DufHXW17.mjs.map +1 -0
- package/dist/_chunks/{Form-DTqO0ymI.js → Form-BssUwrTO.js} +3 -3
- package/dist/_chunks/Form-BssUwrTO.js.map +1 -0
- package/dist/_chunks/{Form-BXHao2mZ.mjs → Form-u_kAOhwB.mjs} +3 -3
- package/dist/_chunks/Form-u_kAOhwB.mjs.map +1 -0
- package/dist/_chunks/{History-C_uSGzO5.js → History-C9t9UqpO.js} +23 -10
- package/dist/_chunks/History-C9t9UqpO.js.map +1 -0
- package/dist/_chunks/{History-2Ah2CQ4T.mjs → History-DRwA3oMM.mjs} +24 -11
- package/dist/_chunks/History-DRwA3oMM.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-nyuP7OSy.js → ListConfigurationPage-BXYPohh-.js} +2 -2
- package/dist/_chunks/{ListConfigurationPage-nyuP7OSy.js.map → ListConfigurationPage-BXYPohh-.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BjSJlaoC.mjs → ListConfigurationPage-BxfQJzPk.mjs} +2 -2
- package/dist/_chunks/{ListConfigurationPage-BjSJlaoC.mjs.map → ListConfigurationPage-BxfQJzPk.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-B75x3nz2.mjs → ListViewPage-CELx2ysp.mjs} +3 -3
- package/dist/_chunks/{ListViewPage-B75x3nz2.mjs.map → ListViewPage-CELx2ysp.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-DHgHD8Xg.js → ListViewPage-D2VD8Szg.js} +3 -3
- package/dist/_chunks/{ListViewPage-DHgHD8Xg.js.map → ListViewPage-D2VD8Szg.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CDUKdZ7d.js → NoContentTypePage-BV9IjJSM.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-CDUKdZ7d.js.map → NoContentTypePage-BV9IjJSM.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-DUacQSyF.mjs → NoContentTypePage-DtJ9jcfk.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-DUacQSyF.mjs.map → NoContentTypePage-DtJ9jcfk.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-SFllMekk.mjs → NoPermissionsPage-DWleVYK7.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-SFllMekk.mjs.map → NoPermissionsPage-DWleVYK7.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-zwIZydDI.js → NoPermissionsPage-Dp8NpF9I.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-zwIZydDI.js.map → NoPermissionsPage-Dp8NpF9I.js.map} +1 -1
- package/dist/_chunks/{Relations-D2NRW8fC.mjs → Relations-BTcf5xaw.mjs} +25 -20
- package/dist/_chunks/Relations-BTcf5xaw.mjs.map +1 -0
- package/dist/_chunks/{Relations-NFLaRNPr.js → Relations-DR7EUgyC.js} +25 -20
- package/dist/_chunks/Relations-DR7EUgyC.js.map +1 -0
- package/dist/_chunks/{en-BlhnxQfj.js → en-Bm0D0IWz.js} +7 -7
- package/dist/_chunks/{en-BlhnxQfj.js.map → en-Bm0D0IWz.js.map} +1 -1
- package/dist/_chunks/{en-C8YBvRrK.mjs → en-DKV44jRb.mjs} +7 -7
- package/dist/_chunks/{en-C8YBvRrK.mjs.map → en-DKV44jRb.mjs.map} +1 -1
- package/dist/_chunks/{index-ovJRE1FM.js → index-BdMf2lfT.js} +84 -72
- package/dist/_chunks/index-BdMf2lfT.js.map +1 -0
- package/dist/_chunks/{index-C9HxCo5R.mjs → index-wnqzm4Q8.mjs} +85 -73
- package/dist/_chunks/index-wnqzm4Q8.mjs.map +1 -0
- package/dist/_chunks/{layout-DaUjDiWQ.mjs → layout-2CfjL0T9.mjs} +3 -3
- package/dist/_chunks/{layout-DaUjDiWQ.mjs.map → layout-2CfjL0T9.mjs.map} +1 -1
- package/dist/_chunks/{layout-UNWstw_s.js → layout-B2MyZU-_.js} +3 -3
- package/dist/_chunks/{layout-UNWstw_s.js.map → layout-B2MyZU-_.js.map} +1 -1
- package/dist/_chunks/{relations-NN3coOG5.js → relations-BH7JJGGe.js} +2 -2
- package/dist/_chunks/{relations-NN3coOG5.js.map → relations-BH7JJGGe.js.map} +1 -1
- package/dist/_chunks/{relations-D8iFAeRu.mjs → relations-C0w0GcXi.mjs} +2 -2
- package/dist/_chunks/{relations-D8iFAeRu.mjs.map → relations-C0w0GcXi.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/server/index.js +17 -10
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +17 -10
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/package.json +7 -7
- package/dist/_chunks/EditViewPage-CUS2EAhB.js.map +0 -1
- package/dist/_chunks/EditViewPage-Dzpno8xI.mjs.map +0 -1
- package/dist/_chunks/Field-B_jG_EV9.mjs.map +0 -1
- package/dist/_chunks/Field-CtUU1Fg8.js.map +0 -1
- package/dist/_chunks/Form-BXHao2mZ.mjs.map +0 -1
- package/dist/_chunks/Form-DTqO0ymI.js.map +0 -1
- package/dist/_chunks/History-2Ah2CQ4T.mjs.map +0 -1
- package/dist/_chunks/History-C_uSGzO5.js.map +0 -1
- package/dist/_chunks/Relations-D2NRW8fC.mjs.map +0 -1
- package/dist/_chunks/Relations-NFLaRNPr.js.map +0 -1
- package/dist/_chunks/index-C9HxCo5R.mjs.map +0 -1
- package/dist/_chunks/index-ovJRE1FM.js.map +0 -1
@@ -5,9 +5,9 @@ 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-wnqzm4Q8.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-BTcf5xaw.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";
|
@@ -2704,13 +2704,34 @@ const RepeatableComponent = ({
|
|
2704
2704
|
const { search: searchString } = useLocation();
|
2705
2705
|
const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2706
2706
|
const { components } = useDoc();
|
2707
|
-
const {
|
2707
|
+
const {
|
2708
|
+
value = [],
|
2709
|
+
error,
|
2710
|
+
rawError
|
2711
|
+
} = useField(name2);
|
2708
2712
|
const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2709
2713
|
const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2710
2714
|
const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2711
2715
|
const { max = Infinity } = attribute;
|
2712
2716
|
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
2713
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]);
|
2714
2735
|
const componentTmpKeyWithFocussedField = React.useMemo(() => {
|
2715
2736
|
if (search.has("field")) {
|
2716
2737
|
const fieldParam = search.get("field");
|
@@ -4925,15 +4946,19 @@ const Wysiwyg = React.forwardRef(
|
|
4925
4946
|
);
|
4926
4947
|
const MemoizedWysiwyg = React.memo(Wysiwyg);
|
4927
4948
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4928
|
-
const { id } = useDoc();
|
4949
|
+
const { id, document: document2, collectionType } = useDoc();
|
4929
4950
|
const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
|
4930
4951
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4931
4952
|
const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4932
4953
|
const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4933
4954
|
const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4934
4955
|
const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4935
|
-
|
4936
|
-
|
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;
|
4937
4962
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4938
4963
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4939
4964
|
const fields = useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -5116,6 +5141,14 @@ const DynamicComponent = ({
|
|
5116
5141
|
React.useEffect(() => {
|
5117
5142
|
dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
|
5118
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]);
|
5119
5152
|
const composedBoxRefs = useComposedRefs(boxRef, dropRef);
|
5120
5153
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
5121
5154
|
/* @__PURE__ */ jsx(
|
@@ -5181,10 +5214,9 @@ const DynamicComponent = ({
|
|
5181
5214
|
] })
|
5182
5215
|
] });
|
5183
5216
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5184
|
-
const accordionValue = React.useId();
|
5185
5217
|
return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5186
5218
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
|
5187
|
-
/* @__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: [
|
5188
5220
|
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
5189
5221
|
/* @__PURE__ */ jsx(
|
5190
5222
|
Accordion.Trigger,
|
@@ -5528,4 +5560,4 @@ export {
|
|
5528
5560
|
transformDocument as t,
|
5529
5561
|
useLazyComponents as u
|
5530
5562
|
};
|
5531
|
-
//# sourceMappingURL=Field-
|
5563
|
+
//# sourceMappingURL=Field-DufHXW17.mjs.map
|