@strapi/content-manager 0.0.0-experimental.145e7d7ddefd1aef71aaf3d9bb86440d013035bf → 0.0.0-experimental.1610404a03d98b65f497f9adda35815021b8fd76
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-DJEJ49QD.mjs → ComponentConfigurationPage-C5xJlht8.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-DJEJ49QD.mjs.map → ComponentConfigurationPage-C5xJlht8.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-D_g11bYV.js → ComponentConfigurationPage-CyzIs3Wp.js} +5 -6
- package/dist/_chunks/{ComponentConfigurationPage-D_g11bYV.js.map → ComponentConfigurationPage-CyzIs3Wp.js.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-QBZdUYyG.mjs → EditConfigurationPage-B1JTGbDa.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-QBZdUYyG.mjs.map → EditConfigurationPage-B1JTGbDa.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CeL712KW.js → EditConfigurationPage-BoY4_TQp.js} +5 -6
- package/dist/_chunks/{EditConfigurationPage-CeL712KW.js.map → EditConfigurationPage-BoY4_TQp.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-CvRUUpVh.mjs → EditViewPage-B8Uz26ZK.mjs} +15 -5
- package/dist/_chunks/EditViewPage-B8Uz26ZK.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-g5TwrgRY.js → EditViewPage-DxszpwJd.js} +16 -7
- package/dist/_chunks/EditViewPage-DxszpwJd.js.map +1 -0
- package/dist/_chunks/{Field-reyvfnop.mjs → Field-CquZadQb.mjs} +93 -78
- package/dist/_chunks/Field-CquZadQb.mjs.map +1 -0
- package/dist/_chunks/{Field-ncdInvxS.js → Field-DzgX4ael.js} +99 -85
- package/dist/_chunks/Field-DzgX4ael.js.map +1 -0
- package/dist/_chunks/{Form-BJ7bYiUx.js → Form-C8a2ftQg.js} +17 -12
- package/dist/_chunks/Form-C8a2ftQg.js.map +1 -0
- package/dist/_chunks/{Form-DoMGsYxH.mjs → Form-DuJm__5A.mjs} +15 -9
- package/dist/_chunks/Form-DuJm__5A.mjs.map +1 -0
- package/dist/_chunks/{History-pbhkxIrf.js → History-B1sa22d-.js} +25 -13
- package/dist/_chunks/History-B1sa22d-.js.map +1 -0
- package/dist/_chunks/{History-BseDJOrj.mjs → History-C7xPTX16.mjs} +25 -12
- package/dist/_chunks/History-C7xPTX16.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DWE_fr5B.mjs → ListConfigurationPage-C6zgYhFZ.mjs} +4 -4
- package/dist/_chunks/{ListConfigurationPage-DWE_fr5B.mjs.map → ListConfigurationPage-C6zgYhFZ.mjs.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-Bna8zfjr.js → ListConfigurationPage-CYWB9ZNc.js} +5 -6
- package/dist/_chunks/{ListConfigurationPage-Bna8zfjr.js.map → ListConfigurationPage-CYWB9ZNc.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-lQ-VLV2G.mjs → ListViewPage-BkzGZ8pS.mjs} +36 -13
- package/dist/_chunks/ListViewPage-BkzGZ8pS.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-Dymsvnv6.js → ListViewPage-D7jZkQ1q.js} +41 -19
- package/dist/_chunks/ListViewPage-D7jZkQ1q.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-B4t_OsDR.js → NoContentTypePage-C-eluJ5b.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-B4t_OsDR.js.map → NoContentTypePage-C-eluJ5b.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-VCQOMwlf.mjs → NoContentTypePage-CNTp9Je-.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-VCQOMwlf.mjs.map → NoContentTypePage-CNTp9Je-.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BOwB6hki.js → NoPermissionsPage-5BRSh_ql.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BOwB6hki.js.map → NoPermissionsPage-5BRSh_ql.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-TV830k4P.mjs → NoPermissionsPage-B1-Nl_T8.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-TV830k4P.mjs.map → NoPermissionsPage-B1-Nl_T8.mjs.map} +1 -1
- package/dist/_chunks/{Relations-DdlstXTu.js → Relations-CXy88hPa.js} +72 -42
- package/dist/_chunks/Relations-CXy88hPa.js.map +1 -0
- package/dist/_chunks/{Relations-D6NAlnsl.mjs → Relations-DqHS7-Cx.mjs} +72 -41
- package/dist/_chunks/Relations-DqHS7-Cx.mjs.map +1 -0
- package/dist/_chunks/{en-Cf41pH5f.js → en-Bm0D0IWz.js} +9 -9
- package/dist/_chunks/{en-Cf41pH5f.js.map → en-Bm0D0IWz.js.map} +1 -1
- package/dist/_chunks/{en-DCszE74t.mjs → en-DKV44jRb.mjs} +9 -9
- package/dist/_chunks/{en-DCszE74t.mjs.map → en-DKV44jRb.mjs.map} +1 -1
- package/dist/_chunks/{index-CQos-KS0.js → index-BwWfprNi.js} +1905 -1763
- package/dist/_chunks/index-BwWfprNi.js.map +1 -0
- package/dist/_chunks/{index-BYSWwHBJ.mjs → index-LwSbWlvf.mjs} +1906 -1764
- package/dist/_chunks/index-LwSbWlvf.mjs.map +1 -0
- package/dist/_chunks/{layout-0TY7UtKO.mjs → layout-BS7u3JUZ.mjs} +6 -5
- package/dist/_chunks/{layout-0TY7UtKO.mjs.map → layout-BS7u3JUZ.mjs.map} +1 -1
- package/dist/_chunks/{layout-B4XAqu1v.js → layout-a7hNwceU.js} +7 -7
- package/dist/_chunks/{layout-B4XAqu1v.js.map → layout-a7hNwceU.js.map} +1 -1
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-xZ2tMj1G.js → relations-DedckVWc.js} +3 -7
- package/dist/_chunks/relations-DedckVWc.js.map +1 -0
- package/dist/_chunks/{relations-DFDWfa0s.mjs → relations-L9TlNEnv.mjs} +3 -7
- package/dist/_chunks/relations-L9TlNEnv.mjs.map +1 -0
- 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/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
- 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/Header.d.ts +11 -11
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/server/index.js +104 -69
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +103 -67
- 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/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/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/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- 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/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/package.json +13 -13
- package/dist/_chunks/EditViewPage-CvRUUpVh.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-g5TwrgRY.js.map +0 -1
- package/dist/_chunks/Field-ncdInvxS.js.map +0 -1
- package/dist/_chunks/Field-reyvfnop.mjs.map +0 -1
- package/dist/_chunks/Form-BJ7bYiUx.js.map +0 -1
- package/dist/_chunks/Form-DoMGsYxH.mjs.map +0 -1
- package/dist/_chunks/History-BseDJOrj.mjs.map +0 -1
- package/dist/_chunks/History-pbhkxIrf.js.map +0 -1
- package/dist/_chunks/ListViewPage-Dymsvnv6.js.map +0 -1
- package/dist/_chunks/ListViewPage-lQ-VLV2G.mjs.map +0 -1
- package/dist/_chunks/Relations-D6NAlnsl.mjs.map +0 -1
- package/dist/_chunks/Relations-DdlstXTu.js.map +0 -1
- package/dist/_chunks/index-BYSWwHBJ.mjs.map +0 -1
- package/dist/_chunks/index-CQos-KS0.js.map +0 -1
- package/dist/_chunks/relations-DFDWfa0s.mjs.map +0 -1
- package/dist/_chunks/relations-xZ2tMj1G.js.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,19 +5,19 @@ 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-LwSbWlvf.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-DqHS7-Cx.mjs";
|
11
11
|
import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
|
12
12
|
import { styled, css, keyframes } from "styled-components";
|
13
13
|
import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
|
14
14
|
import { getEmptyImage } from "react-dnd-html5-backend";
|
15
|
-
import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-
|
16
|
-
import { g as getIn } from "./objects-
|
15
|
+
import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DJ6jqvZN.mjs";
|
16
|
+
import { g as getIn } from "./objects-D6yBsdmx.mjs";
|
17
17
|
import { Editor as Editor$1, Transforms, Node, Element, Range, Path, Point, createEditor } from "slate";
|
18
18
|
import { withHistory } from "slate-history";
|
19
19
|
import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
|
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";
|
@@ -697,8 +697,7 @@ const ImageDialog = () => {
|
|
697
697
|
const [isOpen, setIsOpen] = React.useState(true);
|
698
698
|
const { editor } = useBlocksEditorContext("ImageDialog");
|
699
699
|
const components = useStrapiApp("ImageDialog", (state) => state.components);
|
700
|
-
if (!components || !isOpen)
|
701
|
-
return null;
|
700
|
+
if (!components || !isOpen) return null;
|
702
701
|
const MediaLibraryDialog = components["media-library"];
|
703
702
|
const insertImages = (images) => {
|
704
703
|
Transforms.unwrapNodes(editor, {
|
@@ -707,14 +706,12 @@ const ImageDialog = () => {
|
|
707
706
|
});
|
708
707
|
const nodeEntryBeingReplaced = Editor$1.above(editor, {
|
709
708
|
match(node) {
|
710
|
-
if (Editor$1.isEditor(node))
|
711
|
-
return false;
|
709
|
+
if (Editor$1.isEditor(node)) return false;
|
712
710
|
const isInlineNode = ["text", "link"].includes(node.type);
|
713
711
|
return !isInlineNode;
|
714
712
|
}
|
715
713
|
});
|
716
|
-
if (!nodeEntryBeingReplaced)
|
717
|
-
return;
|
714
|
+
if (!nodeEntryBeingReplaced) return;
|
718
715
|
const [, pathToInsert] = nodeEntryBeingReplaced;
|
719
716
|
Transforms.removeNodes(editor);
|
720
717
|
const nodesToInsert = images.map((image) => {
|
@@ -892,8 +889,7 @@ const LinkContent = React.forwardRef(
|
|
892
889
|
ReactEditor.focus(editor);
|
893
890
|
};
|
894
891
|
React.useEffect(() => {
|
895
|
-
if (popoverOpen)
|
896
|
-
linkInputRef.current?.focus();
|
892
|
+
if (popoverOpen) linkInputRef.current?.focus();
|
897
893
|
}, [popoverOpen]);
|
898
894
|
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
899
895
|
return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
|
@@ -1048,8 +1044,7 @@ const isText$1 = (node) => {
|
|
1048
1044
|
return Node.isNode(node) && !Editor$1.isEditor(node) && node.type === "text";
|
1049
1045
|
};
|
1050
1046
|
const handleBackspaceKeyOnList = (editor, event) => {
|
1051
|
-
if (!editor.selection)
|
1052
|
-
return;
|
1047
|
+
if (!editor.selection) return;
|
1053
1048
|
const [currentListItem, currentListItemPath] = Editor$1.parent(editor, editor.selection.anchor);
|
1054
1049
|
const [currentList, currentListPath] = Editor$1.parent(editor, currentListItemPath);
|
1055
1050
|
const isListEmpty = currentList.children.length === 1 && isText$1(currentListItem.children[0]) && currentListItem.children[0].text === "";
|
@@ -1158,8 +1153,7 @@ const handleEnterKeyOnList = (editor) => {
|
|
1158
1153
|
};
|
1159
1154
|
const handleConvertToList = (editor, format) => {
|
1160
1155
|
const convertedPath = baseHandleConvert(editor, { type: "list-item" });
|
1161
|
-
if (!convertedPath)
|
1162
|
-
return;
|
1156
|
+
if (!convertedPath) return;
|
1163
1157
|
Transforms.wrapNodes(editor, { type: "list", format, children: [] }, { at: convertedPath });
|
1164
1158
|
};
|
1165
1159
|
const handleTabOnList = (editor) => {
|
@@ -1171,8 +1165,7 @@ const handleTabOnList = (editor) => {
|
|
1171
1165
|
}
|
1172
1166
|
const [currentListItem, currentListItemPath] = currentListItemEntry;
|
1173
1167
|
const [currentList] = Editor$1.parent(editor, currentListItemPath);
|
1174
|
-
if (currentListItem === currentList.children[0])
|
1175
|
-
return;
|
1168
|
+
if (currentListItem === currentList.children[0]) return;
|
1176
1169
|
const currentListItemIndex = currentList.children.findIndex((item) => item === currentListItem);
|
1177
1170
|
const previousNode = currentList.children[currentListItemIndex - 1];
|
1178
1171
|
if (previousNode.type === "list") {
|
@@ -1539,8 +1532,7 @@ const isListNode = (node) => {
|
|
1539
1532
|
const ListButton = ({ block, format }) => {
|
1540
1533
|
const { editor, disabled, blocks } = useBlocksEditorContext("ListButton");
|
1541
1534
|
const isListActive = () => {
|
1542
|
-
if (!editor.selection)
|
1543
|
-
return false;
|
1535
|
+
if (!editor.selection) return false;
|
1544
1536
|
const currentListEntry = Editor$1.above(editor, {
|
1545
1537
|
match: (node) => !Editor$1.isEditor(node) && node.type === "list",
|
1546
1538
|
at: editor.selection.anchor
|
@@ -1614,8 +1606,7 @@ const LinkButton = ({ disabled }) => {
|
|
1614
1606
|
const { editor } = useBlocksEditorContext("LinkButton");
|
1615
1607
|
const isLinkActive = () => {
|
1616
1608
|
const { selection } = editor;
|
1617
|
-
if (!selection)
|
1618
|
-
return false;
|
1609
|
+
if (!selection) return false;
|
1619
1610
|
const [match] = Array.from(
|
1620
1611
|
Editor$1.nodes(editor, {
|
1621
1612
|
at: Editor$1.unhangRange(editor, selection),
|
@@ -1749,6 +1740,7 @@ const DragItem = styled(Flex)`
|
|
1749
1740
|
}
|
1750
1741
|
`;
|
1751
1742
|
const DragIconButton = styled(IconButton)`
|
1743
|
+
user-select: none;
|
1752
1744
|
display: flex;
|
1753
1745
|
align-items: center;
|
1754
1746
|
justify-content: center;
|
@@ -1820,8 +1812,7 @@ const DragAndDropElement = ({
|
|
1820
1812
|
displayedValue: children
|
1821
1813
|
},
|
1822
1814
|
onDropItem(currentIndex, newIndex) {
|
1823
|
-
if (newIndex)
|
1824
|
-
handleMoveBlock(newIndex, currentIndex);
|
1815
|
+
if (newIndex) handleMoveBlock(newIndex, currentIndex);
|
1825
1816
|
}
|
1826
1817
|
});
|
1827
1818
|
const composedBoxRefs = useComposedRefs(blockRef, dropRef);
|
@@ -1877,6 +1868,7 @@ const DragAndDropElement = ({
|
|
1877
1868
|
DragIconButton,
|
1878
1869
|
{
|
1879
1870
|
tag: "div",
|
1871
|
+
contentEditable: false,
|
1880
1872
|
role: "button",
|
1881
1873
|
tabIndex: 0,
|
1882
1874
|
withTooltip: false,
|
@@ -1964,8 +1956,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
1964
1956
|
[modifiers2]
|
1965
1957
|
);
|
1966
1958
|
const handleMoveBlocks = (editor2, event) => {
|
1967
|
-
if (!editor2.selection)
|
1968
|
-
return;
|
1959
|
+
if (!editor2.selection) return;
|
1969
1960
|
const start = Range.start(editor2.selection);
|
1970
1961
|
const currentIndex = [start.path[0]];
|
1971
1962
|
let newIndexPosition = 0;
|
@@ -2102,8 +2093,7 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
2102
2093
|
}
|
2103
2094
|
};
|
2104
2095
|
const handleScrollSelectionIntoView = () => {
|
2105
|
-
if (!editor.selection)
|
2106
|
-
return;
|
2096
|
+
if (!editor.selection) return;
|
2107
2097
|
const domRange = ReactEditor.toDOMRange(editor, editor.selection);
|
2108
2098
|
const domRect = domRange.getBoundingClientRect();
|
2109
2099
|
const blocksInput = blocksRef.current;
|
@@ -2297,8 +2287,7 @@ const InlineCode = styled.code`
|
|
2297
2287
|
`;
|
2298
2288
|
const baseCheckIsActive = (editor, name2) => {
|
2299
2289
|
const marks = Editor$1.marks(editor);
|
2300
|
-
if (!marks)
|
2301
|
-
return false;
|
2290
|
+
if (!marks) return false;
|
2302
2291
|
return Boolean(marks[name2]);
|
2303
2292
|
};
|
2304
2293
|
const baseHandleToggle = (editor, name2) => {
|
@@ -2702,13 +2691,34 @@ const RepeatableComponent = ({
|
|
2702
2691
|
const { search: searchString } = useLocation();
|
2703
2692
|
const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2704
2693
|
const { components } = useDoc();
|
2705
|
-
const {
|
2694
|
+
const {
|
2695
|
+
value = [],
|
2696
|
+
error,
|
2697
|
+
rawError
|
2698
|
+
} = useField(name2);
|
2706
2699
|
const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2707
2700
|
const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2708
2701
|
const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2709
2702
|
const { max = Infinity } = attribute;
|
2710
2703
|
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
2711
2704
|
const [liveText, setLiveText] = React.useState("");
|
2705
|
+
React.useEffect(() => {
|
2706
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2707
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2708
|
+
if (hasNestedErrors && hasNestedValue) {
|
2709
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2710
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2711
|
+
}).filter((value2) => !!value2);
|
2712
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2713
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2714
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2715
|
+
return errorOpenItems[0];
|
2716
|
+
}
|
2717
|
+
return collapseToOpen2;
|
2718
|
+
});
|
2719
|
+
}
|
2720
|
+
}
|
2721
|
+
}, [rawError, value]);
|
2712
2722
|
const componentTmpKeyWithFocussedField = React.useMemo(() => {
|
2713
2723
|
if (search.has("field")) {
|
2714
2724
|
const fieldParam = search.get("field");
|
@@ -3256,18 +3266,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3256
3266
|
/* @__PURE__ */ jsx(Field.Hint, {})
|
3257
3267
|
] });
|
3258
3268
|
};
|
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
3269
|
const uidApi = contentManagerApi.injectEndpoints({
|
3272
3270
|
endpoints: (builder) => ({
|
3273
3271
|
getDefaultUID: builder.query({
|
@@ -3725,8 +3723,7 @@ const Wrapper = styled.div`
|
|
3725
3723
|
`;
|
3726
3724
|
var listRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]\s|[*+-]\s|(\d+)([.)]))(\s*)/, emptyListRE = /^(\s*)(>[> ]*|[*+-] \[[x ]\]|[*+-]|(\d+)[.)])(\s*)$/, unorderedListRE = /[*+-]\s/;
|
3727
3725
|
function newlineAndIndentContinueMarkdownList(cm) {
|
3728
|
-
if (cm.getOption("disableInput"))
|
3729
|
-
return CodeMirror.Pass;
|
3726
|
+
if (cm.getOption("disableInput")) return CodeMirror.Pass;
|
3730
3727
|
var ranges = cm.listSelections(), replacements = [];
|
3731
3728
|
for (var i = 0; i < ranges.length; i++) {
|
3732
3729
|
var pos = ranges[i].head;
|
@@ -3760,8 +3757,7 @@ function newlineAndIndentContinueMarkdownList(cm) {
|
|
3760
3757
|
var numbered = !(unorderedListRE.test(match[2]) || match[2].indexOf(">") >= 0);
|
3761
3758
|
var bullet = numbered ? parseInt(match[3], 10) + 1 + match[4] : match[2].replace("x", " ");
|
3762
3759
|
replacements[i] = "\n" + indent + bullet + after;
|
3763
|
-
if (numbered)
|
3764
|
-
incrementRemainingMarkdownListNumbers(cm, pos);
|
3760
|
+
if (numbered) incrementRemainingMarkdownListNumbers(cm, pos);
|
3765
3761
|
}
|
3766
3762
|
}
|
3767
3763
|
cm.replaceSelections(replacements);
|
@@ -3779,10 +3775,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3779
3775
|
var newNumber = parseInt(startItem[3], 10) + lookAhead - skipCount;
|
3780
3776
|
var nextNumber = parseInt(nextItem[3], 10), itemNumber = nextNumber;
|
3781
3777
|
if (startIndent === nextIndent && !isNaN(nextNumber)) {
|
3782
|
-
if (newNumber === nextNumber)
|
3783
|
-
|
3784
|
-
if (newNumber > nextNumber)
|
3785
|
-
itemNumber = newNumber + 1;
|
3778
|
+
if (newNumber === nextNumber) itemNumber = nextNumber + 1;
|
3779
|
+
if (newNumber > nextNumber) itemNumber = newNumber + 1;
|
3786
3780
|
cm.replaceRange(
|
3787
3781
|
nextLine.replace(listRE, nextIndent + itemNumber + nextItem[4] + nextItem[5]),
|
3788
3782
|
{
|
@@ -3795,10 +3789,8 @@ function incrementRemainingMarkdownListNumbers(cm, pos) {
|
|
3795
3789
|
}
|
3796
3790
|
);
|
3797
3791
|
} else {
|
3798
|
-
if (startIndent.length > nextIndent.length)
|
3799
|
-
|
3800
|
-
if (startIndent.length < nextIndent.length && lookAhead === 1)
|
3801
|
-
return;
|
3792
|
+
if (startIndent.length > nextIndent.length) return;
|
3793
|
+
if (startIndent.length < nextIndent.length && lookAhead === 1) return;
|
3802
3794
|
skipCount += 1;
|
3803
3795
|
}
|
3804
3796
|
}
|
@@ -4935,15 +4927,19 @@ const Wysiwyg = React.forwardRef(
|
|
4935
4927
|
);
|
4936
4928
|
const MemoizedWysiwyg = React.memo(Wysiwyg);
|
4937
4929
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4938
|
-
const { id } = useDoc();
|
4930
|
+
const { id, document: document2, collectionType } = useDoc();
|
4939
4931
|
const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
|
4940
4932
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4941
4933
|
const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4942
4934
|
const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4943
4935
|
const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4944
4936
|
const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4945
|
-
|
4946
|
-
|
4937
|
+
let idToCheck = id;
|
4938
|
+
if (collectionType === SINGLE_TYPES) {
|
4939
|
+
idToCheck = document2?.documentId;
|
4940
|
+
}
|
4941
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
4942
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
4947
4943
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4948
4944
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4949
4945
|
const fields = useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4954,6 +4950,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4954
4950
|
const {
|
4955
4951
|
edit: { components }
|
4956
4952
|
} = useDocLayout();
|
4953
|
+
const field = useField(props.name);
|
4957
4954
|
if (!visible) {
|
4958
4955
|
return null;
|
4959
4956
|
}
|
@@ -4964,7 +4961,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4964
4961
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4965
4962
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4966
4963
|
if (CustomInput) {
|
4967
|
-
return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
4964
|
+
return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4968
4965
|
}
|
4969
4966
|
return /* @__PURE__ */ jsx(
|
4970
4967
|
InputRenderer$1,
|
@@ -5125,6 +5122,14 @@ const DynamicComponent = ({
|
|
5125
5122
|
React.useEffect(() => {
|
5126
5123
|
dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
|
5127
5124
|
}, [dragPreviewRef, index]);
|
5125
|
+
const accordionValue = React.useId();
|
5126
|
+
const { value = [], rawError } = useField(`${name2}.${index}`);
|
5127
|
+
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
5128
|
+
React.useEffect(() => {
|
5129
|
+
if (rawError && value) {
|
5130
|
+
setCollapseToOpen(accordionValue);
|
5131
|
+
}
|
5132
|
+
}, [rawError, value, accordionValue]);
|
5128
5133
|
const composedBoxRefs = useComposedRefs(boxRef, dropRef);
|
5129
5134
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
5130
5135
|
/* @__PURE__ */ jsx(
|
@@ -5190,10 +5195,9 @@ const DynamicComponent = ({
|
|
5190
5195
|
] })
|
5191
5196
|
] });
|
5192
5197
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5193
|
-
const accordionValue = React.useId();
|
5194
5198
|
return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5195
5199
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
|
5196
|
-
/* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
|
5200
|
+
/* @__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: [
|
5197
5201
|
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
5198
5202
|
/* @__PURE__ */ jsx(
|
5199
5203
|
Accordion.Trigger,
|
@@ -5204,21 +5208,32 @@ const DynamicComponent = ({
|
|
5204
5208
|
),
|
5205
5209
|
/* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
|
5206
5210
|
] }),
|
5207
|
-
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5208
|
-
|
5209
|
-
|
5210
|
-
|
5211
|
-
|
5212
|
-
|
5213
|
-
|
5214
|
-
|
5215
|
-
|
5216
|
-
|
5217
|
-
|
5218
|
-
|
5219
|
-
|
5220
|
-
|
5221
|
-
|
5211
|
+
/* @__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(
|
5212
|
+
Grid$1.Item,
|
5213
|
+
{
|
5214
|
+
col: 12,
|
5215
|
+
s: 12,
|
5216
|
+
xs: 12,
|
5217
|
+
direction: "column",
|
5218
|
+
alignItems: "stretch",
|
5219
|
+
children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5220
|
+
const fieldName = `${name2}.${index}.${field.name}`;
|
5221
|
+
return /* @__PURE__ */ jsx(
|
5222
|
+
Grid$1.Item,
|
5223
|
+
{
|
5224
|
+
col: size,
|
5225
|
+
s: 12,
|
5226
|
+
xs: 12,
|
5227
|
+
direction: "column",
|
5228
|
+
alignItems: "stretch",
|
5229
|
+
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
|
5230
|
+
},
|
5231
|
+
fieldName
|
5232
|
+
);
|
5233
|
+
}) })
|
5234
|
+
},
|
5235
|
+
rowInd
|
5236
|
+
)) }) }) }) })
|
5222
5237
|
] }) }) })
|
5223
5238
|
] });
|
5224
5239
|
};
|
@@ -5526,4 +5541,4 @@ export {
|
|
5526
5541
|
transformDocument as t,
|
5527
5542
|
useLazyComponents as u
|
5528
5543
|
};
|
5529
|
-
//# sourceMappingURL=Field-
|
5544
|
+
//# sourceMappingURL=Field-CquZadQb.mjs.map
|