@strapi/content-manager 0.0.0-experimental.d53e940834bf72ddc725f1d2fd36dac9abec30cb → 0.0.0-experimental.d65615a2b9130dd742d3c396674457d7971da928
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/LICENSE +18 -3
- package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js → ComponentConfigurationPage-CO977CPh.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js.map → ComponentConfigurationPage-CO977CPh.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs → ComponentConfigurationPage-CQroR9Qk.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs.map → ComponentConfigurationPage-CQroR9Qk.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js → EditConfigurationPage-BPgoE-kf.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js.map → EditConfigurationPage-BPgoE-kf.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs → EditConfigurationPage-tVCJ5vWC.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs.map → EditConfigurationPage-tVCJ5vWC.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-CPj61RMh.mjs → EditViewPage-8mOu02ji.mjs} +30 -9
- package/dist/_chunks/EditViewPage-8mOu02ji.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-zT3fBr4Y.js → EditViewPage-BMVgUNOX.js} +30 -9
- package/dist/_chunks/EditViewPage-BMVgUNOX.js.map +1 -0
- package/dist/_chunks/{Field-dha5VnIQ.mjs → Field-CJPYzwD7.mjs} +249 -152
- package/dist/_chunks/Field-CJPYzwD7.mjs.map +1 -0
- package/dist/_chunks/{Field-Boxf9Ajp.js → Field-CdSLKFQk.js} +251 -154
- package/dist/_chunks/Field-CdSLKFQk.js.map +1 -0
- package/dist/_chunks/{Form-DHrru2AV.mjs → Form-DJOJ-GF1.mjs} +36 -17
- package/dist/_chunks/Form-DJOJ-GF1.mjs.map +1 -0
- package/dist/_chunks/{Form-y5g1SRsh.js → Form-eP5bZwap.js} +36 -17
- package/dist/_chunks/Form-eP5bZwap.js.map +1 -0
- package/dist/_chunks/{History-CqN6K7SX.js → History-B-Mrquzu.js} +63 -25
- package/dist/_chunks/History-B-Mrquzu.js.map +1 -0
- package/dist/_chunks/{History-Bru_KoeP.mjs → History-MnQLtk1g.mjs} +64 -26
- package/dist/_chunks/History-MnQLtk1g.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-D8wGABj0.mjs → ListConfigurationPage-BcycI8Lw.mjs} +21 -9
- package/dist/_chunks/ListConfigurationPage-BcycI8Lw.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-R_p-SbHZ.js → ListConfigurationPage-C0n4rUzH.js} +21 -9
- package/dist/_chunks/ListConfigurationPage-C0n4rUzH.js.map +1 -0
- package/dist/_chunks/{ListViewPage-SID6TRb9.mjs → ListViewPage-CRXONXwZ.mjs} +59 -41
- package/dist/_chunks/ListViewPage-CRXONXwZ.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-pEw_zug9.js → ListViewPage-q0SHVPUS.js} +61 -43
- package/dist/_chunks/ListViewPage-q0SHVPUS.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C5dcQojD.js → NoContentTypePage-Bh3komDV.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C5dcQojD.js.map → NoContentTypePage-Bh3komDV.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs → NoContentTypePage-ukzFRF3z.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs.map → NoContentTypePage-ukzFRF3z.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs → NoPermissionsPage-B4sD7Ble.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs.map → NoPermissionsPage-B4sD7Ble.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js → NoPermissionsPage-BGBpj_Y1.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js.map → NoPermissionsPage-BGBpj_Y1.js.map} +1 -1
- package/dist/_chunks/{Relations-DjTQ5kGB.js → Relations-B53wYe8g.js} +33 -24
- package/dist/_chunks/Relations-B53wYe8g.js.map +1 -0
- package/dist/_chunks/{Relations-B9Crnhnn.mjs → Relations-CIexb8gr.mjs} +33 -24
- package/dist/_chunks/Relations-CIexb8gr.mjs.map +1 -0
- package/dist/_chunks/{en-fbKQxLGn.js → en-Bm0D0IWz.js} +17 -15
- package/dist/_chunks/{en-fbKQxLGn.js.map → en-Bm0D0IWz.js.map} +1 -1
- package/dist/_chunks/{en-Ux26r5pl.mjs → en-DKV44jRb.mjs} +17 -15
- package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-DKV44jRb.mjs.map} +1 -1
- package/dist/_chunks/{index-DJXJw9V5.mjs → index-CJ2vYwuT.mjs} +997 -690
- package/dist/_chunks/index-CJ2vYwuT.mjs.map +1 -0
- package/dist/_chunks/{index-DVPWZkbS.js → index-DbT2sx-Q.js} +978 -671
- package/dist/_chunks/index-DbT2sx-Q.js.map +1 -0
- package/dist/_chunks/{layout-Dm6fbiQj.js → layout-CeBSIkmP.js} +24 -11
- package/dist/_chunks/layout-CeBSIkmP.js.map +1 -0
- package/dist/_chunks/{layout-Bau7ZfLV.mjs → layout-vzKSrr7p.mjs} +25 -12
- package/dist/_chunks/layout-vzKSrr7p.mjs.map +1 -0
- 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-CKnpRgrN.js → relations-Cl-6t9iz.js} +2 -2
- package/dist/_chunks/{relations-CKnpRgrN.js.map → relations-Cl-6t9iz.js.map} +1 -1
- package/dist/_chunks/{relations-BH_kBSJ0.mjs → relations-DI0lguF0.mjs} +2 -2
- package/dist/_chunks/{relations-BH_kBSJ0.mjs.map → relations-DI0lguF0.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 +5 -4
- package/dist/admin/src/exports.d.ts +1 -1
- package/dist/admin/src/history/index.d.ts +3 -0
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +32 -1
- package/dist/admin/src/index.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygFooter.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +4 -48
- package/dist/admin/src/pages/EditView/components/Header.d.ts +11 -11
- package/dist/admin/src/services/api.d.ts +1 -1
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +3 -3
- package/dist/admin/src/services/documents.d.ts +19 -17
- package/dist/admin/src/services/init.d.ts +1 -1
- package/dist/admin/src/services/relations.d.ts +2 -2
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/validation.d.ts +4 -1
- package/dist/server/index.js +207 -120
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +208 -121
- 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/controllers/uid.d.ts.map +1 -1
- package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +2 -1
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.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-CPj61RMh.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-zT3fBr4Y.js.map +0 -1
- package/dist/_chunks/Field-Boxf9Ajp.js.map +0 -1
- package/dist/_chunks/Field-dha5VnIQ.mjs.map +0 -1
- package/dist/_chunks/Form-DHrru2AV.mjs.map +0 -1
- package/dist/_chunks/Form-y5g1SRsh.js.map +0 -1
- package/dist/_chunks/History-Bru_KoeP.mjs.map +0 -1
- package/dist/_chunks/History-CqN6K7SX.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-D8wGABj0.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-R_p-SbHZ.js.map +0 -1
- package/dist/_chunks/ListViewPage-SID6TRb9.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-pEw_zug9.js.map +0 -1
- package/dist/_chunks/Relations-B9Crnhnn.mjs.map +0 -1
- package/dist/_chunks/Relations-DjTQ5kGB.js.map +0 -1
- package/dist/_chunks/index-DJXJw9V5.mjs.map +0 -1
- package/dist/_chunks/index-DVPWZkbS.js.map +0 -1
- package/dist/_chunks/layout-Bau7ZfLV.mjs.map +0 -1
- package/dist/_chunks/layout-Dm6fbiQj.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 @@ 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-DbT2sx-Q.js");
|
9
9
|
const fractionalIndexing = require("fractional-indexing");
|
10
|
-
const Relations = require("./Relations-
|
10
|
+
const Relations = require("./Relations-B53wYe8g.js");
|
11
11
|
const Icons = require("@strapi/icons");
|
12
12
|
const styledComponents = require("styled-components");
|
13
13
|
const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
|
14
14
|
const reactDndHtml5Backend = require("react-dnd-html5-backend");
|
15
15
|
const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
|
16
|
-
const objects = require("./objects-
|
16
|
+
const objects = require("./objects-BcXOv6_9.js");
|
17
17
|
const slate = require("slate");
|
18
18
|
const slateHistory = require("slate-history");
|
19
19
|
const slateReact = require("slate-react");
|
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
|
});
|
@@ -894,20 +894,8 @@ const LinkContent = React__namespace.forwardRef(
|
|
894
894
|
const [linkText, setLinkText] = React__namespace.useState(elementText);
|
895
895
|
const [linkUrl, setLinkUrl] = React__namespace.useState(link.url);
|
896
896
|
const linkInputRef = React__namespace.useRef(null);
|
897
|
-
const
|
897
|
+
const isLastInsertedLink = editor.lastInsertedLinkPath ? !slate.Path.equals(path, editor.lastInsertedLinkPath) : true;
|
898
898
|
const [isSaveDisabled, setIsSaveDisabled] = React__namespace.useState(false);
|
899
|
-
const handleOpenChange = (isOpen) => {
|
900
|
-
if (isOpen) {
|
901
|
-
setPopoverOpen(isOpen);
|
902
|
-
setShowRemoveButton(isOpen);
|
903
|
-
} else {
|
904
|
-
setPopoverOpen(isOpen);
|
905
|
-
if (link.url === "") {
|
906
|
-
removeLink(editor);
|
907
|
-
}
|
908
|
-
slateReact.ReactEditor.focus(editor);
|
909
|
-
}
|
910
|
-
};
|
911
899
|
const onLinkChange = (e) => {
|
912
900
|
setIsSaveDisabled(false);
|
913
901
|
setLinkUrl(e.target.value);
|
@@ -928,15 +916,33 @@ const LinkContent = React__namespace.forwardRef(
|
|
928
916
|
editLink(editor, { url: linkUrl, text: linkText });
|
929
917
|
setPopoverOpen(false);
|
930
918
|
editor.lastInsertedLinkPath = null;
|
919
|
+
slateReact.ReactEditor.focus(editor);
|
920
|
+
};
|
921
|
+
const handleClose = () => {
|
922
|
+
if (link.url === "") {
|
923
|
+
removeLink(editor);
|
924
|
+
}
|
925
|
+
setPopoverOpen(false);
|
926
|
+
slateReact.ReactEditor.focus(editor);
|
931
927
|
};
|
932
928
|
React__namespace.useEffect(() => {
|
933
929
|
if (popoverOpen)
|
934
930
|
linkInputRef.current?.focus();
|
935
931
|
}, [popoverOpen]);
|
936
932
|
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
937
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, {
|
938
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
939
|
-
|
933
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { open: popoverOpen, children: [
|
934
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
935
|
+
StyledBaseLink,
|
936
|
+
{
|
937
|
+
...attributes,
|
938
|
+
ref: forwardedRef,
|
939
|
+
href: link.url,
|
940
|
+
onClick: () => setPopoverOpen(true),
|
941
|
+
color: "primary600",
|
942
|
+
children
|
943
|
+
}
|
944
|
+
) }),
|
945
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 4, children: [
|
940
946
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
|
941
947
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
942
948
|
id: "components.Blocks.popover.text",
|
@@ -982,7 +988,7 @@ const LinkContent = React__namespace.forwardRef(
|
|
982
988
|
{
|
983
989
|
variant: "danger-light",
|
984
990
|
onClick: () => removeLink(editor),
|
985
|
-
$visible:
|
991
|
+
$visible: isLastInsertedLink,
|
986
992
|
children: formatMessage({
|
987
993
|
id: "components.Blocks.popover.remove",
|
988
994
|
defaultMessage: "Remove"
|
@@ -990,11 +996,11 @@ const LinkContent = React__namespace.forwardRef(
|
|
990
996
|
}
|
991
997
|
),
|
992
998
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
993
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick:
|
999
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
|
994
1000
|
id: "components.Blocks.popover.cancel",
|
995
1001
|
defaultMessage: "Cancel"
|
996
1002
|
}) }),
|
997
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, {
|
1003
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
|
998
1004
|
id: "components.Blocks.popover.save",
|
999
1005
|
defaultMessage: "Save"
|
1000
1006
|
}) })
|
@@ -1435,7 +1441,7 @@ const ToolbarButton = ({
|
|
1435
1441
|
width: 7,
|
1436
1442
|
height: 7,
|
1437
1443
|
hasRadius: true,
|
1438
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, {
|
1444
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
|
1439
1445
|
}
|
1440
1446
|
)
|
1441
1447
|
}
|
@@ -1580,6 +1586,26 @@ const ListButton = ({ block, format }) => {
|
|
1580
1586
|
}
|
1581
1587
|
return false;
|
1582
1588
|
};
|
1589
|
+
const isListDisabled = () => {
|
1590
|
+
if (disabled) {
|
1591
|
+
return true;
|
1592
|
+
}
|
1593
|
+
if (!editor.selection) {
|
1594
|
+
return false;
|
1595
|
+
}
|
1596
|
+
const anchorNodeEntry = slate.Editor.above(editor, {
|
1597
|
+
at: editor.selection.anchor,
|
1598
|
+
match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
|
1599
|
+
});
|
1600
|
+
const focusNodeEntry = slate.Editor.above(editor, {
|
1601
|
+
at: editor.selection.focus,
|
1602
|
+
match: (node) => !slate.Editor.isEditor(node) && node.type !== "text"
|
1603
|
+
});
|
1604
|
+
if (!anchorNodeEntry || !focusNodeEntry) {
|
1605
|
+
return false;
|
1606
|
+
}
|
1607
|
+
return anchorNodeEntry[0] !== focusNodeEntry[0];
|
1608
|
+
};
|
1583
1609
|
const toggleList = (format2) => {
|
1584
1610
|
let currentListEntry;
|
1585
1611
|
if (editor.selection) {
|
@@ -1613,7 +1639,7 @@ const ListButton = ({ block, format }) => {
|
|
1613
1639
|
name: format,
|
1614
1640
|
label: block.label,
|
1615
1641
|
isActive: isListActive(),
|
1616
|
-
disabled,
|
1642
|
+
disabled: isListDisabled(),
|
1617
1643
|
handleClick: () => toggleList(format)
|
1618
1644
|
}
|
1619
1645
|
);
|
@@ -1757,6 +1783,7 @@ const DragItem = styledComponents.styled(designSystem.Flex)`
|
|
1757
1783
|
}
|
1758
1784
|
`;
|
1759
1785
|
const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
1786
|
+
user-select: none;
|
1760
1787
|
display: flex;
|
1761
1788
|
align-items: center;
|
1762
1789
|
justify-content: center;
|
@@ -1780,7 +1807,7 @@ const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
|
1780
1807
|
}
|
1781
1808
|
svg {
|
1782
1809
|
height: auto;
|
1783
|
-
width: ${({ theme }) => theme.spaces[3]};
|
1810
|
+
min-width: ${({ theme }) => theme.spaces[3]};
|
1784
1811
|
|
1785
1812
|
path {
|
1786
1813
|
fill: ${({ theme }) => theme.colors.neutral700};
|
@@ -1885,6 +1912,7 @@ const DragAndDropElement = ({
|
|
1885
1912
|
DragIconButton,
|
1886
1913
|
{
|
1887
1914
|
tag: "div",
|
1915
|
+
contentEditable: false,
|
1888
1916
|
role: "button",
|
1889
1917
|
tabIndex: 0,
|
1890
1918
|
withTooltip: false,
|
@@ -1897,7 +1925,7 @@ const DragAndDropElement = ({
|
|
1897
1925
|
disabled,
|
1898
1926
|
draggable: true,
|
1899
1927
|
$dragHandleTopMargin: dragHandleTopMargin,
|
1900
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "
|
1928
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "primary500" })
|
1901
1929
|
}
|
1902
1930
|
),
|
1903
1931
|
children
|
@@ -2221,7 +2249,7 @@ const EditorLayout$1 = ({
|
|
2221
2249
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2222
2250
|
CollapseIconButton,
|
2223
2251
|
{
|
2224
|
-
|
2252
|
+
label: formatMessage({
|
2225
2253
|
id: index.getTranslation("components.Blocks.collapse"),
|
2226
2254
|
defaultMessage: "Collapse"
|
2227
2255
|
}),
|
@@ -2560,7 +2588,7 @@ const BlocksEditor = React__namespace.forwardRef(
|
|
2560
2588
|
!isExpandedMode && /* @__PURE__ */ jsxRuntime.jsx(
|
2561
2589
|
ExpandIconButton,
|
2562
2590
|
{
|
2563
|
-
|
2591
|
+
label: formatMessage({
|
2564
2592
|
id: index.getTranslation("components.Blocks.expand"),
|
2565
2593
|
defaultMessage: "Expand"
|
2566
2594
|
}),
|
@@ -2626,30 +2654,27 @@ const createDefaultForm = (contentType, components = {}) => {
|
|
2626
2654
|
const Initializer = ({ disabled, name: name2, onClick }) => {
|
2627
2655
|
const { formatMessage } = reactIntl.useIntl();
|
2628
2656
|
const field = strapiAdmin.useField(name2);
|
2629
|
-
return /* @__PURE__ */ jsxRuntime.
|
2630
|
-
|
2631
|
-
|
2632
|
-
|
2633
|
-
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
|
2643
|
-
|
2644
|
-
|
2645
|
-
|
2646
|
-
|
2647
|
-
|
2648
|
-
|
2649
|
-
|
2650
|
-
),
|
2651
|
-
field.error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "pi", children: field.error })
|
2652
|
-
] });
|
2657
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
2658
|
+
designSystem.Box,
|
2659
|
+
{
|
2660
|
+
tag: "button",
|
2661
|
+
background: "neutral100",
|
2662
|
+
borderColor: field.error ? "danger600" : "neutral200",
|
2663
|
+
hasRadius: true,
|
2664
|
+
disabled,
|
2665
|
+
onClick,
|
2666
|
+
paddingTop: 9,
|
2667
|
+
paddingBottom: 9,
|
2668
|
+
type: "button",
|
2669
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 2, children: [
|
2670
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(CircleIcon, {}) }),
|
2671
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
|
2672
|
+
id: index.getTranslation("components.empty-repeatable"),
|
2673
|
+
defaultMessage: "No entry yet. Click on the button below to add one."
|
2674
|
+
}) }) })
|
2675
|
+
] })
|
2676
|
+
}
|
2677
|
+
) });
|
2653
2678
|
};
|
2654
2679
|
const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
|
2655
2680
|
width: 2.4rem;
|
@@ -2683,7 +2708,18 @@ const NonRepeatableComponent = ({
|
|
2683
2708
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
|
2684
2709
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2685
2710
|
const completeFieldName = `${name2}.${field.name}`;
|
2686
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2711
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2712
|
+
designSystem.Grid.Item,
|
2713
|
+
{
|
2714
|
+
col: size,
|
2715
|
+
s: 12,
|
2716
|
+
xs: 12,
|
2717
|
+
direction: "column",
|
2718
|
+
alignItems: "stretch",
|
2719
|
+
children: children({ ...field, name: completeFieldName })
|
2720
|
+
},
|
2721
|
+
completeFieldName
|
2722
|
+
);
|
2687
2723
|
}) }, index2);
|
2688
2724
|
}) })
|
2689
2725
|
}
|
@@ -2702,13 +2738,34 @@ const RepeatableComponent = ({
|
|
2702
2738
|
const { search: searchString } = reactRouterDom.useLocation();
|
2703
2739
|
const search = React__namespace.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2704
2740
|
const { components } = index.useDoc();
|
2705
|
-
const {
|
2741
|
+
const {
|
2742
|
+
value = [],
|
2743
|
+
error,
|
2744
|
+
rawError
|
2745
|
+
} = strapiAdmin.useField(name2);
|
2706
2746
|
const addFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2707
2747
|
const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2708
2748
|
const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2709
2749
|
const { max = Infinity } = attribute;
|
2710
2750
|
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
2711
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]);
|
2712
2769
|
const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
|
2713
2770
|
if (search.has("field")) {
|
2714
2771
|
const fieldParam = search.get("field");
|
@@ -2723,7 +2780,7 @@ const RepeatableComponent = ({
|
|
2723
2780
|
}
|
2724
2781
|
return void 0;
|
2725
2782
|
}, [search, name2, value]);
|
2726
|
-
const prevValue =
|
2783
|
+
const prevValue = useDebounce.usePrev(value);
|
2727
2784
|
React__namespace.useEffect(() => {
|
2728
2785
|
if (prevValue && prevValue.length < value.length) {
|
2729
2786
|
setCollapseToOpen(value[value.length - 1].__temp_key__);
|
@@ -2861,7 +2918,18 @@ const RepeatableComponent = ({
|
|
2861
2918
|
children: layout.map((row, index22) => {
|
2862
2919
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2863
2920
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2864
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2921
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2922
|
+
designSystem.Grid.Item,
|
2923
|
+
{
|
2924
|
+
col: size,
|
2925
|
+
s: 12,
|
2926
|
+
xs: 12,
|
2927
|
+
direction: "column",
|
2928
|
+
alignItems: "stretch",
|
2929
|
+
children: children({ ...field, name: completeFieldName })
|
2930
|
+
},
|
2931
|
+
completeFieldName
|
2932
|
+
);
|
2865
2933
|
}) }, index22);
|
2866
2934
|
})
|
2867
2935
|
}
|
@@ -2956,7 +3024,7 @@ const Component = ({
|
|
2956
3024
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2957
3025
|
designSystem.IconButton,
|
2958
3026
|
{
|
2959
|
-
|
3027
|
+
variant: "ghost",
|
2960
3028
|
onClick: onDeleteComponent,
|
2961
3029
|
label: formatMessage({
|
2962
3030
|
id: index.getTranslation("containers.Edit.delete"),
|
@@ -2969,7 +3037,7 @@ const Component = ({
|
|
2969
3037
|
designSystem.IconButton,
|
2970
3038
|
{
|
2971
3039
|
ref: composedAccordionRefs,
|
2972
|
-
|
3040
|
+
variant: "ghost",
|
2973
3041
|
onClick: (e) => e.stopPropagation(),
|
2974
3042
|
"data-handler-id": handlerId,
|
2975
3043
|
label: formatMessage({
|
@@ -3039,7 +3107,7 @@ const ComponentInput = ({
|
|
3039
3107
|
id: index.getTranslation("components.reset-entry"),
|
3040
3108
|
defaultMessage: "Reset Entry"
|
3041
3109
|
}),
|
3042
|
-
|
3110
|
+
variant: "ghost",
|
3043
3111
|
onClick: () => {
|
3044
3112
|
field.onChange(name2, null);
|
3045
3113
|
},
|
@@ -3068,11 +3136,8 @@ const AddComponentButton = ({
|
|
3068
3136
|
onClick,
|
3069
3137
|
disabled: isDisabled,
|
3070
3138
|
background: "neutral0",
|
3071
|
-
paddingTop: 3,
|
3072
|
-
paddingBottom: 3,
|
3073
|
-
paddingLeft: 4,
|
3074
|
-
paddingRight: 4,
|
3075
3139
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
3140
|
+
variant: "tertiary",
|
3076
3141
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
|
3077
3142
|
/* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
3078
3143
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3101,10 +3166,11 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
|
|
3101
3166
|
}
|
3102
3167
|
`;
|
3103
3168
|
const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
|
3104
|
-
const StyledButton = styledComponents.styled(designSystem.
|
3169
|
+
const StyledButton = styledComponents.styled(designSystem.Button)`
|
3105
3170
|
border-radius: 26px;
|
3106
3171
|
border-color: ${({ theme }) => theme.colors.neutral150};
|
3107
3172
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3173
|
+
height: 5rem;
|
3108
3174
|
|
3109
3175
|
&:hover {
|
3110
3176
|
${AddComponentTitle} {
|
@@ -3116,7 +3182,7 @@ const StyledButton = styledComponents.styled(designSystem.BaseButton)`
|
|
3116
3182
|
fill: ${({ theme }) => theme.colors.primary600};
|
3117
3183
|
}
|
3118
3184
|
> path {
|
3119
|
-
fill: ${({ theme }) => theme.colors.
|
3185
|
+
fill: ${({ theme }) => theme.colors.primary600};
|
3120
3186
|
}
|
3121
3187
|
}
|
3122
3188
|
}
|
@@ -3247,18 +3313,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3247
3313
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
3248
3314
|
] });
|
3249
3315
|
};
|
3250
|
-
function useDebounce(value, delay) {
|
3251
|
-
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
3252
|
-
React.useEffect(() => {
|
3253
|
-
const handler = setTimeout(() => {
|
3254
|
-
setDebouncedValue(value);
|
3255
|
-
}, delay);
|
3256
|
-
return () => {
|
3257
|
-
clearTimeout(handler);
|
3258
|
-
};
|
3259
|
-
}, [value, delay]);
|
3260
|
-
return debouncedValue;
|
3261
|
-
}
|
3262
3316
|
const uidApi = index.contentManagerApi.injectEndpoints({
|
3263
3317
|
endpoints: (builder) => ({
|
3264
3318
|
getDefaultUID: builder.query({
|
@@ -3293,7 +3347,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
|
|
3293
3347
|
config: {
|
3294
3348
|
params
|
3295
3349
|
}
|
3296
|
-
})
|
3350
|
+
}),
|
3351
|
+
providesTags: (_res, _error, params) => [
|
3352
|
+
{ type: "UidAvailability", id: params.contentTypeUID }
|
3353
|
+
]
|
3297
3354
|
})
|
3298
3355
|
})
|
3299
3356
|
});
|
@@ -3305,8 +3362,10 @@ const UIDInput = React__namespace.forwardRef(
|
|
3305
3362
|
const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
|
3306
3363
|
const [availability, setAvailability] = React__namespace.useState();
|
3307
3364
|
const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
|
3365
|
+
const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
|
3308
3366
|
const field = strapiAdmin.useField(name2);
|
3309
|
-
const debouncedValue = useDebounce(field.value, 300);
|
3367
|
+
const debouncedValue = useDebounce.useDebounce(field.value, 300);
|
3368
|
+
const hasChanged = debouncedValue !== field.initialValue;
|
3310
3369
|
const { toggleNotification } = strapiAdmin.useNotification();
|
3311
3370
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
3312
3371
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -3382,8 +3441,9 @@ const UIDInput = React__namespace.forwardRef(
|
|
3382
3441
|
params
|
3383
3442
|
},
|
3384
3443
|
{
|
3444
|
+
// Don't check availability if the value is empty or wasn't changed
|
3385
3445
|
skip: !Boolean(
|
3386
|
-
|
3446
|
+
(hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3387
3447
|
)
|
3388
3448
|
}
|
3389
3449
|
);
|
@@ -3412,6 +3472,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3412
3472
|
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3413
3473
|
const fieldRef = strapiAdmin.useFocusInputField(name2);
|
3414
3474
|
const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
|
3475
|
+
const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
|
3415
3476
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3416
3477
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
|
3417
3478
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3420,7 +3481,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3420
3481
|
ref: composedRefs,
|
3421
3482
|
disabled: props.disabled,
|
3422
3483
|
endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
|
3423
|
-
|
3484
|
+
shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
|
3424
3485
|
TextValidation,
|
3425
3486
|
{
|
3426
3487
|
alignItems: "center",
|
@@ -4254,7 +4315,7 @@ const EditorLayout = ({
|
|
4254
4315
|
justifyContent: "flex-end",
|
4255
4316
|
shrink: 0,
|
4256
4317
|
width: "100%",
|
4257
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
|
4318
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
|
4258
4319
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
4259
4320
|
id: "components.Wysiwyg.collapse",
|
4260
4321
|
defaultMessage: "Collapse"
|
@@ -4272,12 +4333,14 @@ const EditorLayout = ({
|
|
4272
4333
|
) }) });
|
4273
4334
|
}
|
4274
4335
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4275
|
-
designSystem.
|
4336
|
+
designSystem.Flex,
|
4276
4337
|
{
|
4277
4338
|
borderColor: error ? "danger600" : "neutral200",
|
4278
4339
|
borderStyle: "solid",
|
4279
4340
|
borderWidth: "1px",
|
4280
4341
|
hasRadius: true,
|
4342
|
+
direction: "column",
|
4343
|
+
alignItems: "stretch",
|
4281
4344
|
children
|
4282
4345
|
}
|
4283
4346
|
);
|
@@ -4288,11 +4351,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
|
|
4288
4351
|
const BoxWithBorder = styledComponents.styled(designSystem.Box)`
|
4289
4352
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
4290
4353
|
`;
|
4291
|
-
const ExpandButton$1 = styledComponents.styled(designSystem.
|
4354
|
+
const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
|
4292
4355
|
background-color: transparent;
|
4293
4356
|
border: none;
|
4294
4357
|
align-items: center;
|
4295
4358
|
|
4359
|
+
& > span {
|
4360
|
+
display: flex;
|
4361
|
+
justify-content: space-between;
|
4362
|
+
align-items: center;
|
4363
|
+
width: 100%;
|
4364
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4365
|
+
}
|
4366
|
+
|
4296
4367
|
svg {
|
4297
4368
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4298
4369
|
|
@@ -4559,40 +4630,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4559
4630
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4560
4631
|
}
|
4561
4632
|
};
|
4562
|
-
const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
|
4563
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4564
|
-
|
4565
|
-
svg {
|
4566
|
-
width: 1.8rem;
|
4567
|
-
height: 1.8rem;
|
4568
|
-
}
|
4569
|
-
`;
|
4570
|
-
const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
|
4571
|
-
svg {
|
4572
|
-
width: 0.8rem;
|
4573
|
-
height: 0.8rem;
|
4574
|
-
}
|
4575
|
-
`;
|
4576
4633
|
const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
|
4577
4634
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4578
4635
|
`;
|
4579
4636
|
const MoreButton = styledComponents.styled(designSystem.IconButton)`
|
4580
4637
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4581
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4582
|
-
|
4583
|
-
svg {
|
4584
|
-
width: 1.8rem;
|
4585
|
-
height: 1.8rem;
|
4586
|
-
}
|
4587
4638
|
`;
|
4588
4639
|
const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
|
4589
4640
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4590
4641
|
`;
|
4591
|
-
const ExpandButton = styledComponents.styled(designSystem.
|
4642
|
+
const ExpandButton = styledComponents.styled(designSystem.Button)`
|
4592
4643
|
background-color: transparent;
|
4593
4644
|
border: none;
|
4594
4645
|
align-items: center;
|
4595
4646
|
|
4647
|
+
& > span {
|
4648
|
+
display: flex;
|
4649
|
+
justify-content: space-between;
|
4650
|
+
align-items: center;
|
4651
|
+
width: 100%;
|
4652
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4653
|
+
}
|
4654
|
+
|
4596
4655
|
svg {
|
4597
4656
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4598
4657
|
path {
|
@@ -4604,8 +4663,8 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
|
|
4604
4663
|
`;
|
4605
4664
|
const WysiwygFooter = ({ onToggleExpand }) => {
|
4606
4665
|
const { formatMessage } = reactIntl.useIntl();
|
4607
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
|
4608
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
4666
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
|
4667
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
|
4609
4668
|
id: "components.WysiwygBottomControls.fullscreen",
|
4610
4669
|
defaultMessage: "Expand"
|
4611
4670
|
}) }),
|
@@ -4641,18 +4700,27 @@ const WysiwygNav = ({
|
|
4641
4700
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4642
4701
|
children: [
|
4643
4702
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
4644
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4645
|
-
|
4646
|
-
|
4647
|
-
|
4648
|
-
|
4649
|
-
|
4650
|
-
|
4651
|
-
|
4703
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4704
|
+
designSystem.SingleSelect,
|
4705
|
+
{
|
4706
|
+
disabled: true,
|
4707
|
+
placeholder: selectPlaceholder,
|
4708
|
+
"aria-label": selectPlaceholder,
|
4709
|
+
size: "S",
|
4710
|
+
children: [
|
4711
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4712
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
4713
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
|
4714
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
|
4715
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
|
4716
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
|
4717
|
+
]
|
4718
|
+
}
|
4719
|
+
) }),
|
4652
4720
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4653
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4654
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4655
|
-
/* @__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, {}) })
|
4656
4724
|
] }),
|
4657
4725
|
/* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
|
4658
4726
|
] }),
|
@@ -4679,6 +4747,7 @@ const WysiwygNav = ({
|
|
4679
4747
|
placeholder: selectPlaceholder,
|
4680
4748
|
"aria-label": selectPlaceholder,
|
4681
4749
|
onChange: (value) => onActionClick(value, editorRef),
|
4750
|
+
size: "S",
|
4682
4751
|
children: [
|
4683
4752
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4684
4753
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
@@ -4690,17 +4759,9 @@ const WysiwygNav = ({
|
|
4690
4759
|
}
|
4691
4760
|
) }),
|
4692
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, {}) }),
|
4693
4763
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4694
|
-
|
4695
|
-
{
|
4696
|
-
onClick: () => onActionClick("Bold", editorRef),
|
4697
|
-
label: "Bold",
|
4698
|
-
name: "Bold",
|
4699
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
|
4700
|
-
}
|
4701
|
-
),
|
4702
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4703
|
-
CustomIconButton,
|
4764
|
+
designSystem.IconButton,
|
4704
4765
|
{
|
4705
4766
|
onClick: () => onActionClick("Italic", editorRef),
|
4706
4767
|
label: "Italic",
|
@@ -4709,7 +4770,7 @@ const WysiwygNav = ({
|
|
4709
4770
|
}
|
4710
4771
|
),
|
4711
4772
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4712
|
-
|
4773
|
+
designSystem.IconButton,
|
4713
4774
|
{
|
4714
4775
|
onClick: () => onActionClick("Underline", editorRef),
|
4715
4776
|
label: "Underline",
|
@@ -4723,7 +4784,7 @@ const WysiwygNav = ({
|
|
4723
4784
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
|
4724
4785
|
/* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
|
4725
4786
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4726
|
-
|
4787
|
+
designSystem.IconButton,
|
4727
4788
|
{
|
4728
4789
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4729
4790
|
label: "Strikethrough",
|
@@ -4732,7 +4793,7 @@ const WysiwygNav = ({
|
|
4732
4793
|
}
|
4733
4794
|
),
|
4734
4795
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4735
|
-
|
4796
|
+
designSystem.IconButton,
|
4736
4797
|
{
|
4737
4798
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4738
4799
|
label: "BulletList",
|
@@ -4741,7 +4802,7 @@ const WysiwygNav = ({
|
|
4741
4802
|
}
|
4742
4803
|
),
|
4743
4804
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4744
|
-
|
4805
|
+
designSystem.IconButton,
|
4745
4806
|
{
|
4746
4807
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4747
4808
|
label: "NumberList",
|
@@ -4752,7 +4813,7 @@ const WysiwygNav = ({
|
|
4752
4813
|
] }),
|
4753
4814
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
|
4754
4815
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4755
|
-
|
4816
|
+
designSystem.IconButton,
|
4756
4817
|
{
|
4757
4818
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4758
4819
|
label: "Code",
|
@@ -4761,7 +4822,7 @@ const WysiwygNav = ({
|
|
4761
4822
|
}
|
4762
4823
|
),
|
4763
4824
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4764
|
-
|
4825
|
+
designSystem.IconButton,
|
4765
4826
|
{
|
4766
4827
|
onClick: () => {
|
4767
4828
|
handleTogglePopover();
|
@@ -4773,7 +4834,7 @@ const WysiwygNav = ({
|
|
4773
4834
|
}
|
4774
4835
|
),
|
4775
4836
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4776
|
-
|
4837
|
+
designSystem.IconButton,
|
4777
4838
|
{
|
4778
4839
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4779
4840
|
label: "Link",
|
@@ -4782,7 +4843,7 @@ const WysiwygNav = ({
|
|
4782
4843
|
}
|
4783
4844
|
),
|
4784
4845
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4785
|
-
|
4846
|
+
designSystem.IconButton,
|
4786
4847
|
{
|
4787
4848
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4788
4849
|
label: "Quote",
|
@@ -4860,7 +4921,7 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4860
4921
|
const handleSelectAssets = (files) => {
|
4861
4922
|
const formattedFiles = files.map((f) => ({
|
4862
4923
|
alt: f.alternativeText || f.name,
|
4863
|
-
url:
|
4924
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
|
4864
4925
|
mime: f.mime
|
4865
4926
|
}));
|
4866
4927
|
insertFile(editorRef, formattedFiles);
|
@@ -4919,15 +4980,19 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4919
4980
|
);
|
4920
4981
|
const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
|
4921
4982
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4922
|
-
const { id } = index.useDoc();
|
4983
|
+
const { id, document: document2, collectionType } = index.useDoc();
|
4923
4984
|
const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
|
4924
4985
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4925
4986
|
const canCreateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4926
4987
|
const canReadFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4927
4988
|
const canUpdateFields = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4928
4989
|
const canUserAction = index.useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4929
|
-
|
4930
|
-
|
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;
|
4931
4996
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4932
4997
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4933
4998
|
const fields = strapiAdmin.useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4938,6 +5003,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4938
5003
|
const {
|
4939
5004
|
edit: { components }
|
4940
5005
|
} = index.useDocLayout();
|
5006
|
+
const field = strapiAdmin.useField(props.name);
|
4941
5007
|
if (!visible) {
|
4942
5008
|
return null;
|
4943
5009
|
}
|
@@ -4948,7 +5014,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4948
5014
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4949
5015
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4950
5016
|
if (CustomInput) {
|
4951
|
-
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
5017
|
+
return /* @__PURE__ */ jsxRuntime.jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4952
5018
|
}
|
4953
5019
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4954
5020
|
strapiAdmin.InputRenderer,
|
@@ -5018,7 +5084,9 @@ const useFieldHint = (hint = void 0, attribute) => {
|
|
5018
5084
|
if (!maximum && !minimum) {
|
5019
5085
|
return hint;
|
5020
5086
|
}
|
5021
|
-
const units = !["biginteger", "integer", "number"].includes(
|
5087
|
+
const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
|
5088
|
+
attribute.type
|
5089
|
+
) ? formatMessage(
|
5022
5090
|
{
|
5023
5091
|
id: "content-manager.form.Input.hint.character.unit",
|
5024
5092
|
defaultMessage: "{maxValue, plural, one { character} other { characters}}"
|
@@ -5107,12 +5175,20 @@ const DynamicComponent = ({
|
|
5107
5175
|
React__namespace.useEffect(() => {
|
5108
5176
|
dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
|
5109
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]);
|
5110
5186
|
const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
|
5111
5187
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
5112
5188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5113
5189
|
designSystem.IconButton,
|
5114
5190
|
{
|
5115
|
-
|
5191
|
+
variant: "ghost",
|
5116
5192
|
label: formatMessage(
|
5117
5193
|
{
|
5118
5194
|
id: index.getTranslation("components.DynamicZone.delete-label"),
|
@@ -5127,7 +5203,7 @@ const DynamicComponent = ({
|
|
5127
5203
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5128
5204
|
designSystem.IconButton,
|
5129
5205
|
{
|
5130
|
-
|
5206
|
+
variant: "ghost",
|
5131
5207
|
onClick: (e) => e.stopPropagation(),
|
5132
5208
|
"data-handler-id": handlerId,
|
5133
5209
|
ref: dragRef,
|
@@ -5172,10 +5248,9 @@ const DynamicComponent = ({
|
|
5172
5248
|
] })
|
5173
5249
|
] });
|
5174
5250
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5175
|
-
const accordionValue = React__namespace.useId();
|
5176
5251
|
return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5177
5252
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
|
5178
|
-
/* @__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: [
|
5179
5254
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
|
5180
5255
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5181
5256
|
designSystem.Accordion.Trigger,
|
@@ -5186,10 +5261,32 @@ const DynamicComponent = ({
|
|
5186
5261
|
),
|
5187
5262
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
|
5188
5263
|
] }),
|
5189
|
-
/* @__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:
|
5190
|
-
|
5191
|
-
|
5192
|
-
|
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
|
+
)) }) }) }) })
|
5193
5290
|
] }) }) })
|
5194
5291
|
] });
|
5195
5292
|
};
|
@@ -5381,7 +5478,7 @@ const DynamicZone = ({
|
|
5381
5478
|
const handleRemoveComponent = (name22, currentIndex) => () => {
|
5382
5479
|
removeFieldRow(name22, currentIndex);
|
5383
5480
|
};
|
5384
|
-
const hasError = error !== void 0
|
5481
|
+
const hasError = error !== void 0;
|
5385
5482
|
const renderButtonLabel = () => {
|
5386
5483
|
if (addComponentIsOpen) {
|
5387
5484
|
return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
|
@@ -5495,4 +5592,4 @@ exports.transformDocument = transformDocument;
|
|
5495
5592
|
exports.useDynamicZone = useDynamicZone;
|
5496
5593
|
exports.useFieldHint = useFieldHint;
|
5497
5594
|
exports.useLazyComponents = useLazyComponents;
|
5498
|
-
//# sourceMappingURL=Field-
|
5595
|
+
//# sourceMappingURL=Field-CdSLKFQk.js.map
|