@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 @@ 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-BdMf2lfT.js");
|
9
9
|
const fractionalIndexing = require("fractional-indexing");
|
10
|
-
const Relations = require("./Relations-
|
10
|
+
const Relations = require("./Relations-DR7EUgyC.js");
|
11
11
|
const Icons = require("@strapi/icons");
|
12
12
|
const styledComponents = require("styled-components");
|
13
13
|
const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
|
@@ -17,7 +17,7 @@ const objects = require("./objects-gigeqt7s.js");
|
|
17
17
|
const slate = require("slate");
|
18
18
|
const slateHistory = require("slate-history");
|
19
19
|
const slateReact = require("slate-react");
|
20
|
-
const
|
20
|
+
const useDebounce = require("./useDebounce-CtcjDB3L.js");
|
21
21
|
const Toolbar = require("@radix-ui/react-toolbar");
|
22
22
|
const reactRouterDom = require("react-router-dom");
|
23
23
|
const CodeMirror = require("codemirror5");
|
@@ -768,7 +768,7 @@ const ImageDialog = () => {
|
|
768
768
|
const nodeImage = {
|
769
769
|
...expectedImage,
|
770
770
|
alternativeText: expectedImage.alternativeText || expectedImage.name,
|
771
|
-
url:
|
771
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(image.url)
|
772
772
|
};
|
773
773
|
return nodeImage;
|
774
774
|
});
|
@@ -1441,7 +1441,7 @@ const ToolbarButton = ({
|
|
1441
1441
|
width: 7,
|
1442
1442
|
height: 7,
|
1443
1443
|
hasRadius: true,
|
1444
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {
|
1444
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
|
1445
1445
|
}
|
1446
1446
|
)
|
1447
1447
|
}
|
@@ -1783,6 +1783,7 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
|
|
1783
1783
|
}
|
1784
1784
|
`;
|
1785
1785
|
const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
1786
|
+
user-select: none;
|
1786
1787
|
display: flex;
|
1787
1788
|
align-items: center;
|
1788
1789
|
justify-content: center;
|
@@ -1911,6 +1912,7 @@ const DragAndDropElement = ({
|
|
1911
1912
|
DragIconButton,
|
1912
1913
|
{
|
1913
1914
|
tag: "div",
|
1915
|
+
contentEditable: false,
|
1914
1916
|
role: "button",
|
1915
1917
|
tabIndex: 0,
|
1916
1918
|
withTooltip: false,
|
@@ -2736,13 +2738,34 @@ const RepeatableComponent = ({
|
|
2736
2738
|
const { search: searchString } = reactRouterDom.useLocation();
|
2737
2739
|
const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2738
2740
|
const { components } = index.useDoc();
|
2739
|
-
const {
|
2741
|
+
const {
|
2742
|
+
value = [],
|
2743
|
+
error,
|
2744
|
+
rawError
|
2745
|
+
} = strapiAdmin.useField(name2);
|
2740
2746
|
const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2741
2747
|
const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2742
2748
|
const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2743
2749
|
const { max = Infinity } = attribute;
|
2744
2750
|
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
2745
2751
|
const [liveText, setLiveText] = React__namespace.useState("");
|
2752
|
+
React__namespace.useEffect(() => {
|
2753
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2754
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2755
|
+
if (hasNestedErrors && hasNestedValue) {
|
2756
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2757
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2758
|
+
}).filter((value2) => !!value2);
|
2759
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2760
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2761
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2762
|
+
return errorOpenItems[0];
|
2763
|
+
}
|
2764
|
+
return collapseToOpen2;
|
2765
|
+
});
|
2766
|
+
}
|
2767
|
+
}
|
2768
|
+
}, [rawError, value]);
|
2746
2769
|
const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
|
2747
2770
|
if (search.has("field")) {
|
2748
2771
|
const fieldParam = search.get("field");
|
@@ -2757,7 +2780,7 @@ const RepeatableComponent = ({
|
|
2757
2780
|
}
|
2758
2781
|
return void 0;
|
2759
2782
|
}, [search, name2, value]);
|
2760
|
-
const prevValue =
|
2783
|
+
const prevValue = useDebounce.usePrev(value);
|
2761
2784
|
React__namespace.useEffect(() => {
|
2762
2785
|
if (prevValue && prevValue.length < value.length) {
|
2763
2786
|
setCollapseToOpen(value[value.length - 1].__temp_key__);
|
@@ -3290,18 +3313,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3290
3313
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
3291
3314
|
] });
|
3292
3315
|
};
|
3293
|
-
function useDebounce(value, delay) {
|
3294
|
-
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
3295
|
-
React.useEffect(() => {
|
3296
|
-
const handler = setTimeout(() => {
|
3297
|
-
setDebouncedValue(value);
|
3298
|
-
}, delay);
|
3299
|
-
return () => {
|
3300
|
-
clearTimeout(handler);
|
3301
|
-
};
|
3302
|
-
}, [value, delay]);
|
3303
|
-
return debouncedValue;
|
3304
|
-
}
|
3305
3316
|
const uidApi = index.contentManagerApi.injectEndpoints({
|
3306
3317
|
endpoints: (builder) => ({
|
3307
3318
|
getDefaultUID: builder.query({
|
@@ -3353,7 +3364,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3353
3364
|
const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
|
3354
3365
|
const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
|
3355
3366
|
const field = strapiAdmin.useField(name2);
|
3356
|
-
const debouncedValue = useDebounce(field.value, 300);
|
3367
|
+
const debouncedValue = useDebounce.useDebounce(field.value, 300);
|
3357
3368
|
const hasChanged = debouncedValue !== field.initialValue;
|
3358
3369
|
const { toggleNotification } = strapiAdmin.useNotification();
|
3359
3370
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
@@ -4619,31 +4630,11 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4619
4630
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4620
4631
|
}
|
4621
4632
|
};
|
4622
|
-
const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
|
4623
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4624
|
-
|
4625
|
-
svg {
|
4626
|
-
width: 1.8rem;
|
4627
|
-
height: 1.8rem;
|
4628
|
-
}
|
4629
|
-
`;
|
4630
|
-
const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
|
4631
|
-
svg {
|
4632
|
-
width: 0.8rem;
|
4633
|
-
height: 0.8rem;
|
4634
|
-
}
|
4635
|
-
`;
|
4636
4633
|
const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
|
4637
4634
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4638
4635
|
`;
|
4639
4636
|
const MoreButton = styledComponents.styled(designSystem.IconButton)`
|
4640
4637
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4641
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4642
|
-
|
4643
|
-
svg {
|
4644
|
-
width: 1.8rem;
|
4645
|
-
height: 1.8rem;
|
4646
|
-
}
|
4647
4638
|
`;
|
4648
4639
|
const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
|
4649
4640
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
@@ -4727,9 +4718,9 @@ const WysiwygNav = ({
|
|
4727
4718
|
}
|
4728
4719
|
) }),
|
4729
4720
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4730
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4731
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4732
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4721
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4722
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
|
4723
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
|
4733
4724
|
] }),
|
4734
4725
|
/* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
|
4735
4726
|
] }),
|
@@ -4768,17 +4759,9 @@ const WysiwygNav = ({
|
|
4768
4759
|
}
|
4769
4760
|
) }),
|
4770
4761
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4762
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4771
4763
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4772
|
-
|
4773
|
-
{
|
4774
|
-
onClick: () => onActionClick("Bold", editorRef),
|
4775
|
-
label: "Bold",
|
4776
|
-
name: "Bold",
|
4777
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
|
4778
|
-
}
|
4779
|
-
),
|
4780
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4781
|
-
CustomIconButton,
|
4764
|
+
designSystem.IconButton,
|
4782
4765
|
{
|
4783
4766
|
onClick: () => onActionClick("Italic", editorRef),
|
4784
4767
|
label: "Italic",
|
@@ -4787,7 +4770,7 @@ const WysiwygNav = ({
|
|
4787
4770
|
}
|
4788
4771
|
),
|
4789
4772
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4790
|
-
|
4773
|
+
designSystem.IconButton,
|
4791
4774
|
{
|
4792
4775
|
onClick: () => onActionClick("Underline", editorRef),
|
4793
4776
|
label: "Underline",
|
@@ -4801,7 +4784,7 @@ const WysiwygNav = ({
|
|
4801
4784
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
|
4802
4785
|
/* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
|
4803
4786
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4804
|
-
|
4787
|
+
designSystem.IconButton,
|
4805
4788
|
{
|
4806
4789
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4807
4790
|
label: "Strikethrough",
|
@@ -4810,7 +4793,7 @@ const WysiwygNav = ({
|
|
4810
4793
|
}
|
4811
4794
|
),
|
4812
4795
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4813
|
-
|
4796
|
+
designSystem.IconButton,
|
4814
4797
|
{
|
4815
4798
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4816
4799
|
label: "BulletList",
|
@@ -4819,7 +4802,7 @@ const WysiwygNav = ({
|
|
4819
4802
|
}
|
4820
4803
|
),
|
4821
4804
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4822
|
-
|
4805
|
+
designSystem.IconButton,
|
4823
4806
|
{
|
4824
4807
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4825
4808
|
label: "NumberList",
|
@@ -4830,7 +4813,7 @@ const WysiwygNav = ({
|
|
4830
4813
|
] }),
|
4831
4814
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
|
4832
4815
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4833
|
-
|
4816
|
+
designSystem.IconButton,
|
4834
4817
|
{
|
4835
4818
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4836
4819
|
label: "Code",
|
@@ -4839,7 +4822,7 @@ const WysiwygNav = ({
|
|
4839
4822
|
}
|
4840
4823
|
),
|
4841
4824
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4842
|
-
|
4825
|
+
designSystem.IconButton,
|
4843
4826
|
{
|
4844
4827
|
onClick: () => {
|
4845
4828
|
handleTogglePopover();
|
@@ -4851,7 +4834,7 @@ const WysiwygNav = ({
|
|
4851
4834
|
}
|
4852
4835
|
),
|
4853
4836
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4854
|
-
|
4837
|
+
designSystem.IconButton,
|
4855
4838
|
{
|
4856
4839
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4857
4840
|
label: "Link",
|
@@ -4860,7 +4843,7 @@ const WysiwygNav = ({
|
|
4860
4843
|
}
|
4861
4844
|
),
|
4862
4845
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4863
|
-
|
4846
|
+
designSystem.IconButton,
|
4864
4847
|
{
|
4865
4848
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4866
4849
|
label: "Quote",
|
@@ -4938,7 +4921,7 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4938
4921
|
const handleSelectAssets = (files) => {
|
4939
4922
|
const formattedFiles = files.map((f) => ({
|
4940
4923
|
alt: f.alternativeText || f.name,
|
4941
|
-
url:
|
4924
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
|
4942
4925
|
mime: f.mime
|
4943
4926
|
}));
|
4944
4927
|
insertFile(editorRef, formattedFiles);
|
@@ -4997,15 +4980,19 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4997
4980
|
);
|
4998
4981
|
const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
|
4999
4982
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
5000
|
-
const { id } = index.useDoc();
|
4983
|
+
const { id, document: document2, collectionType } = index.useDoc();
|
5001
4984
|
const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
|
5002
4985
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
5003
4986
|
const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
5004
4987
|
const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
5005
4988
|
const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
5006
4989
|
const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
5007
|
-
|
5008
|
-
|
4990
|
+
let idToCheck = id;
|
4991
|
+
if (collectionType === index.SINGLE_TYPES) {
|
4992
|
+
idToCheck = document2?.documentId;
|
4993
|
+
}
|
4994
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
4995
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
5009
4996
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
5010
4997
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
5011
4998
|
const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -5016,6 +5003,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
5016
5003
|
const {
|
5017
5004
|
edit: { components }
|
5018
5005
|
} = index.useDocLayout();
|
5006
|
+
const field = strapiAdmin.useField(props.name);
|
5019
5007
|
if (!visible) {
|
5020
5008
|
return null;
|
5021
5009
|
}
|
@@ -5026,7 +5014,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
5026
5014
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
5027
5015
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
5028
5016
|
if (CustomInput) {
|
5029
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
5017
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
5030
5018
|
}
|
5031
5019
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
5032
5020
|
strapiAdmin.InputRenderer,
|
@@ -5187,6 +5175,14 @@ const DynamicComponent = ({
|
|
5187
5175
|
React__namespace.useEffect(() => {
|
5188
5176
|
dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
|
5189
5177
|
}, [dragPreviewRef, index$1]);
|
5178
|
+
const accordionValue = React__namespace.useId();
|
5179
|
+
const { value = [], rawError } = strapiAdmin.useField(`${name2}.${index$1}`);
|
5180
|
+
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
5181
|
+
React__namespace.useEffect(() => {
|
5182
|
+
if (rawError && value) {
|
5183
|
+
setCollapseToOpen(accordionValue);
|
5184
|
+
}
|
5185
|
+
}, [rawError, value, accordionValue]);
|
5190
5186
|
const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
|
5191
5187
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
5192
5188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -5252,10 +5248,9 @@ const DynamicComponent = ({
|
|
5252
5248
|
] })
|
5253
5249
|
] });
|
5254
5250
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5255
|
-
const accordionValue = React__namespace.useId();
|
5256
5251
|
return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5257
5252
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
|
5258
|
-
/* @__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: [
|
5253
|
+
/* @__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: [
|
5259
5254
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
|
5260
5255
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5261
5256
|
designSystem.Accordion.Trigger,
|
@@ -5266,21 +5261,32 @@ const DynamicComponent = ({
|
|
5266
5261
|
),
|
5267
5262
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
|
5268
5263
|
] }),
|
5269
|
-
/* @__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:
|
5270
|
-
|
5271
|
-
|
5272
|
-
|
5273
|
-
|
5274
|
-
|
5275
|
-
|
5276
|
-
|
5277
|
-
|
5278
|
-
|
5279
|
-
|
5280
|
-
|
5281
|
-
|
5282
|
-
|
5283
|
-
|
5264
|
+
/* @__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(
|
5265
|
+
designSystem.Grid.Item,
|
5266
|
+
{
|
5267
|
+
col: 12,
|
5268
|
+
s: 12,
|
5269
|
+
xs: 12,
|
5270
|
+
direction: "column",
|
5271
|
+
alignItems: "stretch",
|
5272
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5273
|
+
const fieldName = `${name2}.${index$1}.${field.name}`;
|
5274
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
5275
|
+
designSystem.Grid.Item,
|
5276
|
+
{
|
5277
|
+
col: size,
|
5278
|
+
s: 12,
|
5279
|
+
xs: 12,
|
5280
|
+
direction: "column",
|
5281
|
+
alignItems: "stretch",
|
5282
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName })
|
5283
|
+
},
|
5284
|
+
fieldName
|
5285
|
+
);
|
5286
|
+
}) })
|
5287
|
+
},
|
5288
|
+
rowInd
|
5289
|
+
)) }) }) }) })
|
5284
5290
|
] }) }) })
|
5285
5291
|
] });
|
5286
5292
|
};
|
@@ -5586,4 +5592,4 @@ exports.transformDocument = transformDocument;
|
|
5586
5592
|
exports.useDynamicZone = useDynamicZone;
|
5587
5593
|
exports.useFieldHint = useFieldHint;
|
5588
5594
|
exports.useLazyComponents = useLazyComponents;
|
5589
|
-
//# sourceMappingURL=Field-
|
5595
|
+
//# sourceMappingURL=Field-COL25JiC.js.map
|