@strapi/content-manager 0.0.0-experimental.81dfdf02b1367004c7deed9e01afa9d3a15d0fa5 → 0.0.0-experimental.8f5736f39974781dca58cef1d1dea9d54580fbf1
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-qemkOlnj.mjs → ComponentConfigurationPage-DfFSZQxe.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-qemkOlnj.mjs.map → ComponentConfigurationPage-DfFSZQxe.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js → ComponentConfigurationPage-FqfsxQ1j.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-D_M8iBw5.js.map → ComponentConfigurationPage-FqfsxQ1j.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js → EditConfigurationPage-Cn0e8t3I.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BePwPuHy.js.map → EditConfigurationPage-Cn0e8t3I.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs → EditConfigurationPage-DdPNAbl3.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CjUrEewK.mjs.map → EditConfigurationPage-DdPNAbl3.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-De8GyU8P.mjs → EditViewPage-B82x_x1b.mjs} +15 -5
- package/dist/_chunks/EditViewPage-B82x_x1b.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-B-RJeiJD.js → EditViewPage-DlxEHhUt.js} +15 -5
- package/dist/_chunks/EditViewPage-DlxEHhUt.js.map +1 -0
- package/dist/_chunks/{Field-dq8Tg1M_.js → Field-COL25JiC.js} +90 -84
- package/dist/_chunks/Field-COL25JiC.js.map +1 -0
- package/dist/_chunks/{Field-pb2o8uBe.mjs → Field-DufHXW17.mjs} +86 -80
- package/dist/_chunks/Field-DufHXW17.mjs.map +1 -0
- package/dist/_chunks/{Form-DGIf4jQU.js → Form-BssUwrTO.js} +16 -8
- package/dist/_chunks/Form-BssUwrTO.js.map +1 -0
- package/dist/_chunks/{Form-DJn0Dxha.mjs → Form-u_kAOhwB.mjs} +16 -8
- package/dist/_chunks/Form-u_kAOhwB.mjs.map +1 -0
- package/dist/_chunks/{History-Dh2NEHnR.js → History-C9t9UqpO.js} +23 -10
- package/dist/_chunks/History-C9t9UqpO.js.map +1 -0
- package/dist/_chunks/{History-BowL3JKP.mjs → History-DRwA3oMM.mjs} +24 -11
- package/dist/_chunks/History-DRwA3oMM.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BxYCWz9e.js → ListConfigurationPage-BXYPohh-.js} +2 -2
- package/dist/_chunks/{ListConfigurationPage-BxYCWz9e.js.map → ListConfigurationPage-BXYPohh-.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BpVOB-hn.mjs → ListConfigurationPage-BxfQJzPk.mjs} +2 -2
- package/dist/_chunks/{ListConfigurationPage-BpVOB-hn.mjs.map → ListConfigurationPage-BxfQJzPk.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-CXFUjZQC.mjs → ListViewPage-CELx2ysp.mjs} +40 -36
- package/dist/_chunks/ListViewPage-CELx2ysp.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-4XsciqHZ.js → ListViewPage-D2VD8Szg.js} +43 -39
- package/dist/_chunks/ListViewPage-D2VD8Szg.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js → NoContentTypePage-BV9IjJSM.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C8OpoHeU.js.map → NoContentTypePage-BV9IjJSM.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs → NoContentTypePage-DtJ9jcfk.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-DuhOTp3x.mjs.map → NoContentTypePage-DtJ9jcfk.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs → NoPermissionsPage-DWleVYK7.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DVz3mzDz.mjs.map → NoPermissionsPage-DWleVYK7.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js → NoPermissionsPage-Dp8NpF9I.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-y_r7DVA2.js.map → NoPermissionsPage-Dp8NpF9I.js.map} +1 -1
- package/dist/_chunks/{Relations-CVNLrn1Y.mjs → Relations-BTcf5xaw.mjs} +32 -23
- package/dist/_chunks/Relations-BTcf5xaw.mjs.map +1 -0
- package/dist/_chunks/{Relations-DPFCAa7b.js → Relations-DR7EUgyC.js} +32 -23
- package/dist/_chunks/Relations-DR7EUgyC.js.map +1 -0
- package/dist/_chunks/{en-uOUIxfcQ.js → en-Bm0D0IWz.js} +13 -12
- package/dist/_chunks/{en-uOUIxfcQ.js.map → en-Bm0D0IWz.js.map} +1 -1
- package/dist/_chunks/{en-BrCTWlZv.mjs → en-DKV44jRb.mjs} +13 -12
- package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-DKV44jRb.mjs.map} +1 -1
- package/dist/_chunks/{index-C3fJE-1-.js → index-BdMf2lfT.js} +1877 -1767
- package/dist/_chunks/index-BdMf2lfT.js.map +1 -0
- package/dist/_chunks/{index-DiMrfcfy.mjs → index-wnqzm4Q8.mjs} +1881 -1771
- package/dist/_chunks/index-wnqzm4Q8.mjs.map +1 -0
- package/dist/_chunks/{layout-ls3gxfpH.mjs → layout-2CfjL0T9.mjs} +5 -4
- package/dist/_chunks/{layout-ls3gxfpH.mjs.map → layout-2CfjL0T9.mjs.map} +1 -1
- package/dist/_chunks/{layout-C788OmNr.js → layout-B2MyZU-_.js} +5 -4
- package/dist/_chunks/{layout-C788OmNr.js.map → layout-B2MyZU-_.js.map} +1 -1
- package/dist/_chunks/{relations-DYeotliT.js → relations-BH7JJGGe.js} +2 -2
- package/dist/_chunks/{relations-DYeotliT.js.map → relations-BH7JJGGe.js.map} +1 -1
- package/dist/_chunks/{relations-CLcOmGO0.mjs → relations-C0w0GcXi.mjs} +2 -2
- package/dist/_chunks/{relations-CLcOmGO0.mjs.map → relations-C0w0GcXi.mjs.map} +1 -1
- 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/FormInputs/Wysiwyg/WysiwygStyles.d.ts +0 -32
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/services/documents.d.ts +3 -1
- package/dist/server/index.js +48 -21
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +48 -21
- 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/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +1 -0
- package/dist/server/src/history/services/utils.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/package.json +12 -12
- package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +0 -1
- package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +0 -1
- package/dist/_chunks/Field-dq8Tg1M_.js.map +0 -1
- package/dist/_chunks/Field-pb2o8uBe.mjs.map +0 -1
- package/dist/_chunks/Form-DGIf4jQU.js.map +0 -1
- package/dist/_chunks/Form-DJn0Dxha.mjs.map +0 -1
- package/dist/_chunks/History-BowL3JKP.mjs.map +0 -1
- package/dist/_chunks/History-Dh2NEHnR.js.map +0 -1
- package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +0 -1
- package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +0 -1
- package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +0 -1
- package/dist/_chunks/Relations-DPFCAa7b.js.map +0 -1
- package/dist/_chunks/index-C3fJE-1-.js.map +0 -1
- package/dist/_chunks/index-DiMrfcfy.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,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";
|
@@ -17,7 +17,7 @@ import { g as getIn } from "./objects-mKMAmfec.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";
|
@@ -1407,7 +1407,7 @@ const ToolbarButton = ({
|
|
1407
1407
|
width: 7,
|
1408
1408
|
height: 7,
|
1409
1409
|
hasRadius: true,
|
1410
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
1410
|
+
children: /* @__PURE__ */ jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
|
1411
1411
|
}
|
1412
1412
|
)
|
1413
1413
|
}
|
@@ -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,
|
@@ -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({
|
@@ -4585,31 +4596,11 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4585
4596
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4586
4597
|
}
|
4587
4598
|
};
|
4588
|
-
const CustomIconButton = styled(IconButton)`
|
4589
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4590
|
-
|
4591
|
-
svg {
|
4592
|
-
width: 1.8rem;
|
4593
|
-
height: 1.8rem;
|
4594
|
-
}
|
4595
|
-
`;
|
4596
|
-
const CustomLinkIconButton = styled(CustomIconButton)`
|
4597
|
-
svg {
|
4598
|
-
width: 0.8rem;
|
4599
|
-
height: 0.8rem;
|
4600
|
-
}
|
4601
|
-
`;
|
4602
4599
|
const MainButtons = styled(IconButtonGroup)`
|
4603
4600
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4604
4601
|
`;
|
4605
4602
|
const MoreButton = styled(IconButton)`
|
4606
4603
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4607
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4608
|
-
|
4609
|
-
svg {
|
4610
|
-
width: 1.8rem;
|
4611
|
-
height: 1.8rem;
|
4612
|
-
}
|
4613
4604
|
`;
|
4614
4605
|
const IconButtonGroupMargin = styled(IconButtonGroup)`
|
4615
4606
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
@@ -4693,9 +4684,9 @@ const WysiwygNav = ({
|
|
4693
4684
|
}
|
4694
4685
|
) }),
|
4695
4686
|
/* @__PURE__ */ jsxs(MainButtons, { children: [
|
4696
|
-
/* @__PURE__ */ jsx(
|
4697
|
-
/* @__PURE__ */ jsx(
|
4698
|
-
/* @__PURE__ */ jsx(
|
4687
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
|
4688
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
|
4689
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
|
4699
4690
|
] }),
|
4700
4691
|
/* @__PURE__ */ jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsx(More, {}) })
|
4701
4692
|
] }),
|
@@ -4734,17 +4725,9 @@ const WysiwygNav = ({
|
|
4734
4725
|
}
|
4735
4726
|
) }),
|
4736
4727
|
/* @__PURE__ */ jsxs(MainButtons, { children: [
|
4728
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
|
4737
4729
|
/* @__PURE__ */ jsx(
|
4738
|
-
|
4739
|
-
{
|
4740
|
-
onClick: () => onActionClick("Bold", editorRef),
|
4741
|
-
label: "Bold",
|
4742
|
-
name: "Bold",
|
4743
|
-
children: /* @__PURE__ */ jsx(Bold, {})
|
4744
|
-
}
|
4745
|
-
),
|
4746
|
-
/* @__PURE__ */ jsx(
|
4747
|
-
CustomIconButton,
|
4730
|
+
IconButton,
|
4748
4731
|
{
|
4749
4732
|
onClick: () => onActionClick("Italic", editorRef),
|
4750
4733
|
label: "Italic",
|
@@ -4753,7 +4736,7 @@ const WysiwygNav = ({
|
|
4753
4736
|
}
|
4754
4737
|
),
|
4755
4738
|
/* @__PURE__ */ jsx(
|
4756
|
-
|
4739
|
+
IconButton,
|
4757
4740
|
{
|
4758
4741
|
onClick: () => onActionClick("Underline", editorRef),
|
4759
4742
|
label: "Underline",
|
@@ -4767,7 +4750,7 @@ const WysiwygNav = ({
|
|
4767
4750
|
/* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
|
4768
4751
|
/* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
|
4769
4752
|
/* @__PURE__ */ jsx(
|
4770
|
-
|
4753
|
+
IconButton,
|
4771
4754
|
{
|
4772
4755
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4773
4756
|
label: "Strikethrough",
|
@@ -4776,7 +4759,7 @@ const WysiwygNav = ({
|
|
4776
4759
|
}
|
4777
4760
|
),
|
4778
4761
|
/* @__PURE__ */ jsx(
|
4779
|
-
|
4762
|
+
IconButton,
|
4780
4763
|
{
|
4781
4764
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4782
4765
|
label: "BulletList",
|
@@ -4785,7 +4768,7 @@ const WysiwygNav = ({
|
|
4785
4768
|
}
|
4786
4769
|
),
|
4787
4770
|
/* @__PURE__ */ jsx(
|
4788
|
-
|
4771
|
+
IconButton,
|
4789
4772
|
{
|
4790
4773
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4791
4774
|
label: "NumberList",
|
@@ -4796,7 +4779,7 @@ const WysiwygNav = ({
|
|
4796
4779
|
] }),
|
4797
4780
|
/* @__PURE__ */ jsxs(IconButtonGroup, { children: [
|
4798
4781
|
/* @__PURE__ */ jsx(
|
4799
|
-
|
4782
|
+
IconButton,
|
4800
4783
|
{
|
4801
4784
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4802
4785
|
label: "Code",
|
@@ -4805,7 +4788,7 @@ const WysiwygNav = ({
|
|
4805
4788
|
}
|
4806
4789
|
),
|
4807
4790
|
/* @__PURE__ */ jsx(
|
4808
|
-
|
4791
|
+
IconButton,
|
4809
4792
|
{
|
4810
4793
|
onClick: () => {
|
4811
4794
|
handleTogglePopover();
|
@@ -4817,7 +4800,7 @@ const WysiwygNav = ({
|
|
4817
4800
|
}
|
4818
4801
|
),
|
4819
4802
|
/* @__PURE__ */ jsx(
|
4820
|
-
|
4803
|
+
IconButton,
|
4821
4804
|
{
|
4822
4805
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4823
4806
|
label: "Link",
|
@@ -4826,7 +4809,7 @@ const WysiwygNav = ({
|
|
4826
4809
|
}
|
4827
4810
|
),
|
4828
4811
|
/* @__PURE__ */ jsx(
|
4829
|
-
|
4812
|
+
IconButton,
|
4830
4813
|
{
|
4831
4814
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4832
4815
|
label: "Quote",
|
@@ -4963,15 +4946,19 @@ const Wysiwyg = React.forwardRef(
|
|
4963
4946
|
);
|
4964
4947
|
const MemoizedWysiwyg = React.memo(Wysiwyg);
|
4965
4948
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4966
|
-
const { id } = useDoc();
|
4949
|
+
const { id, document: document2, collectionType } = useDoc();
|
4967
4950
|
const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
|
4968
4951
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4969
4952
|
const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4970
4953
|
const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4971
4954
|
const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4972
4955
|
const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4973
|
-
|
4974
|
-
|
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;
|
4975
4962
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4976
4963
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4977
4964
|
const fields = useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4982,6 +4969,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4982
4969
|
const {
|
4983
4970
|
edit: { components }
|
4984
4971
|
} = useDocLayout();
|
4972
|
+
const field = useField(props.name);
|
4985
4973
|
if (!visible) {
|
4986
4974
|
return null;
|
4987
4975
|
}
|
@@ -4992,7 +4980,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4992
4980
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4993
4981
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4994
4982
|
if (CustomInput) {
|
4995
|
-
return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
4983
|
+
return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4996
4984
|
}
|
4997
4985
|
return /* @__PURE__ */ jsx(
|
4998
4986
|
InputRenderer$1,
|
@@ -5153,6 +5141,14 @@ const DynamicComponent = ({
|
|
5153
5141
|
React.useEffect(() => {
|
5154
5142
|
dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
|
5155
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]);
|
5156
5152
|
const composedBoxRefs = useComposedRefs(boxRef, dropRef);
|
5157
5153
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
5158
5154
|
/* @__PURE__ */ jsx(
|
@@ -5218,10 +5214,9 @@ const DynamicComponent = ({
|
|
5218
5214
|
] })
|
5219
5215
|
] });
|
5220
5216
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5221
|
-
const accordionValue = React.useId();
|
5222
5217
|
return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5223
5218
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
|
5224
|
-
/* @__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: [
|
5225
5220
|
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
5226
5221
|
/* @__PURE__ */ jsx(
|
5227
5222
|
Accordion.Trigger,
|
@@ -5232,21 +5227,32 @@ const DynamicComponent = ({
|
|
5232
5227
|
),
|
5233
5228
|
/* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
|
5234
5229
|
] }),
|
5235
|
-
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5236
|
-
|
5237
|
-
|
5238
|
-
|
5239
|
-
|
5240
|
-
|
5241
|
-
|
5242
|
-
|
5243
|
-
|
5244
|
-
|
5245
|
-
|
5246
|
-
|
5247
|
-
|
5248
|
-
|
5249
|
-
|
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
|
+
)) }) }) }) })
|
5250
5256
|
] }) }) })
|
5251
5257
|
] });
|
5252
5258
|
};
|
@@ -5554,4 +5560,4 @@ export {
|
|
5554
5560
|
transformDocument as t,
|
5555
5561
|
useLazyComponents as u
|
5556
5562
|
};
|
5557
|
-
//# sourceMappingURL=Field-
|
5563
|
+
//# sourceMappingURL=Field-DufHXW17.mjs.map
|