@strapi/content-manager 0.0.0-experimental.9612538209f3c68285c5dea8fe26f96e7e470afd → 0.0.0-experimental.997c519cb311bf692e8971f4bbd2e4a92694abee
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-DHNM3YBz.mjs → ComponentConfigurationPage-CnL10QYC.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DHNM3YBz.mjs.map → ComponentConfigurationPage-CnL10QYC.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BvHtG7uH.js → ComponentConfigurationPage-G4EIirP8.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BvHtG7uH.js.map → ComponentConfigurationPage-G4EIirP8.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DOmfCEMo.js → EditConfigurationPage-B2AA1kVF.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DOmfCEMo.js.map → EditConfigurationPage-B2AA1kVF.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-Cp6HAEzN.mjs → EditConfigurationPage-I2kKh9dx.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-Cp6HAEzN.mjs.map → EditConfigurationPage-I2kKh9dx.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-BqNpC6hO.js → EditViewPage-CHgoNwlc.js} +19 -8
- package/dist/_chunks/EditViewPage-CHgoNwlc.js.map +1 -0
- package/dist/_chunks/{EditViewPage-BtkEx339.mjs → EditViewPage-zFjJK0s8.mjs} +19 -8
- package/dist/_chunks/EditViewPage-zFjJK0s8.mjs.map +1 -0
- package/dist/_chunks/{Field-lsPFnAmH.js → Field-9DePZh-0.js} +196 -143
- package/dist/_chunks/Field-9DePZh-0.js.map +1 -0
- package/dist/_chunks/{Field-R5NbffTB.mjs → Field-DPAzUS1M.mjs} +194 -141
- package/dist/_chunks/Field-DPAzUS1M.mjs.map +1 -0
- package/dist/_chunks/{Form-BHmXSfyy.mjs → Form-CEkENbkF.mjs} +35 -16
- package/dist/_chunks/Form-CEkENbkF.mjs.map +1 -0
- package/dist/_chunks/{Form-CcGboku8.js → Form-DPm-KZ1A.js} +35 -16
- package/dist/_chunks/Form-DPm-KZ1A.js.map +1 -0
- package/dist/_chunks/{History-Bsud8jwh.js → History-DXSbTWez.js} +28 -18
- package/dist/_chunks/History-DXSbTWez.js.map +1 -0
- package/dist/_chunks/{History-ByUPL3T3.mjs → History-utls71em.mjs} +28 -18
- package/dist/_chunks/History-utls71em.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Bm5HACXf.mjs → ListConfigurationPage-CuMXWWqb.mjs} +20 -8
- package/dist/_chunks/ListConfigurationPage-CuMXWWqb.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-DiT463qx.js → ListConfigurationPage-D5C7ACZ_.js} +20 -8
- package/dist/_chunks/ListConfigurationPage-D5C7ACZ_.js.map +1 -0
- package/dist/_chunks/{ListViewPage-JSyNAAYu.mjs → ListViewPage-CdKd-PS_.mjs} +46 -37
- package/dist/_chunks/ListViewPage-CdKd-PS_.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-CsrC9L_d.js → ListViewPage-DfuwH1tt.js} +48 -39
- package/dist/_chunks/ListViewPage-DfuwH1tt.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Bsvng4II.js → NoContentTypePage-BIxlkWWi.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-Bsvng4II.js.map → NoContentTypePage-BIxlkWWi.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CsrQUpBE.mjs → NoContentTypePage-DkToTT7u.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CsrQUpBE.mjs.map → NoContentTypePage-DkToTT7u.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CdHNJtEf.js → NoPermissionsPage-Bu4GWYb-.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CdHNJtEf.js.map → NoPermissionsPage-Bu4GWYb-.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DNmf_pj0.mjs → NoPermissionsPage-DlWi4BAH.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DNmf_pj0.mjs.map → NoPermissionsPage-DlWi4BAH.mjs.map} +1 -1
- package/dist/_chunks/{Relations-CghaPv2D.js → Relations-CFjTESWQ.js} +4 -4
- package/dist/_chunks/Relations-CFjTESWQ.js.map +1 -0
- package/dist/_chunks/{Relations-u8-37jK0.mjs → Relations-QP5yn9_z.mjs} +4 -4
- package/dist/_chunks/Relations-QP5yn9_z.mjs.map +1 -0
- package/dist/_chunks/{en-fbKQxLGn.js → en-BVzUkPxZ.js} +10 -8
- package/dist/_chunks/{en-fbKQxLGn.js.map → en-BVzUkPxZ.js.map} +1 -1
- package/dist/_chunks/{en-Ux26r5pl.mjs → en-CPTj6CjC.mjs} +10 -8
- package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-CPTj6CjC.mjs.map} +1 -1
- package/dist/_chunks/{index-CaE6NG4a.mjs → index-BHfS6_D5.mjs} +437 -205
- package/dist/_chunks/index-BHfS6_D5.mjs.map +1 -0
- package/dist/_chunks/{index-BOZx6IMg.js → index-DXiHxy70.js} +418 -186
- package/dist/_chunks/index-DXiHxy70.js.map +1 -0
- package/dist/_chunks/{layout-Bx7svTbY.mjs → layout-DX_52HSH.mjs} +23 -10
- package/dist/_chunks/layout-DX_52HSH.mjs.map +1 -0
- package/dist/_chunks/{layout-Ciz224q5.js → layout-bE-WUnQ0.js} +22 -9
- package/dist/_chunks/layout-bE-WUnQ0.js.map +1 -0
- package/dist/_chunks/{relations-CP8sB2YZ.js → relations-D706vblp.js} +2 -2
- package/dist/_chunks/{relations-CP8sB2YZ.js.map → relations-D706vblp.js.map} +1 -1
- package/dist/_chunks/{relations-Cxc1cEv3.mjs → relations-SCVAL_aJ.mjs} +2 -2
- package/dist/_chunks/{relations-Cxc1cEv3.mjs.map → relations-SCVAL_aJ.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 +1 -1
- package/dist/admin/index.mjs +4 -4
- 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/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 +10 -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 +174 -105
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +175 -106
- 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 +9 -9
- package/dist/_chunks/EditViewPage-BqNpC6hO.js.map +0 -1
- package/dist/_chunks/EditViewPage-BtkEx339.mjs.map +0 -1
- package/dist/_chunks/Field-R5NbffTB.mjs.map +0 -1
- package/dist/_chunks/Field-lsPFnAmH.js.map +0 -1
- package/dist/_chunks/Form-BHmXSfyy.mjs.map +0 -1
- package/dist/_chunks/Form-CcGboku8.js.map +0 -1
- package/dist/_chunks/History-Bsud8jwh.js.map +0 -1
- package/dist/_chunks/History-ByUPL3T3.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Bm5HACXf.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-DiT463qx.js.map +0 -1
- package/dist/_chunks/ListViewPage-CsrC9L_d.js.map +0 -1
- package/dist/_chunks/ListViewPage-JSyNAAYu.mjs.map +0 -1
- package/dist/_chunks/Relations-CghaPv2D.js.map +0 -1
- package/dist/_chunks/Relations-u8-37jK0.mjs.map +0 -1
- package/dist/_chunks/index-BOZx6IMg.js.map +0 -1
- package/dist/_chunks/index-CaE6NG4a.mjs.map +0 -1
- package/dist/_chunks/layout-Bx7svTbY.mjs.map +0 -1
- package/dist/_chunks/layout-Ciz224q5.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
@@ -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-DXiHxy70.js");
|
9
9
|
const fractionalIndexing = require("fractional-indexing");
|
10
|
-
const Relations = require("./Relations-
|
10
|
+
const Relations = require("./Relations-CFjTESWQ.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
|
});
|
@@ -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
|
}
|
@@ -2723,7 +2759,7 @@ const RepeatableComponent = ({
|
|
2723
2759
|
}
|
2724
2760
|
return void 0;
|
2725
2761
|
}, [search, name2, value]);
|
2726
|
-
const prevValue =
|
2762
|
+
const prevValue = useDebounce.usePrev(value);
|
2727
2763
|
React__namespace.useEffect(() => {
|
2728
2764
|
if (prevValue && prevValue.length < value.length) {
|
2729
2765
|
setCollapseToOpen(value[value.length - 1].__temp_key__);
|
@@ -2861,7 +2897,18 @@ const RepeatableComponent = ({
|
|
2861
2897
|
children: layout.map((row, index22) => {
|
2862
2898
|
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2863
2899
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2864
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
2900
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2901
|
+
designSystem.Grid.Item,
|
2902
|
+
{
|
2903
|
+
col: size,
|
2904
|
+
s: 12,
|
2905
|
+
xs: 12,
|
2906
|
+
direction: "column",
|
2907
|
+
alignItems: "stretch",
|
2908
|
+
children: children({ ...field, name: completeFieldName })
|
2909
|
+
},
|
2910
|
+
completeFieldName
|
2911
|
+
);
|
2865
2912
|
}) }, index22);
|
2866
2913
|
})
|
2867
2914
|
}
|
@@ -2956,7 +3003,7 @@ const Component = ({
|
|
2956
3003
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2957
3004
|
designSystem.IconButton,
|
2958
3005
|
{
|
2959
|
-
|
3006
|
+
variant: "ghost",
|
2960
3007
|
onClick: onDeleteComponent,
|
2961
3008
|
label: formatMessage({
|
2962
3009
|
id: index.getTranslation("containers.Edit.delete"),
|
@@ -2969,7 +3016,7 @@ const Component = ({
|
|
2969
3016
|
designSystem.IconButton,
|
2970
3017
|
{
|
2971
3018
|
ref: composedAccordionRefs,
|
2972
|
-
|
3019
|
+
variant: "ghost",
|
2973
3020
|
onClick: (e) => e.stopPropagation(),
|
2974
3021
|
"data-handler-id": handlerId,
|
2975
3022
|
label: formatMessage({
|
@@ -3039,7 +3086,7 @@ const ComponentInput = ({
|
|
3039
3086
|
id: index.getTranslation("components.reset-entry"),
|
3040
3087
|
defaultMessage: "Reset Entry"
|
3041
3088
|
}),
|
3042
|
-
|
3089
|
+
variant: "ghost",
|
3043
3090
|
onClick: () => {
|
3044
3091
|
field.onChange(name2, null);
|
3045
3092
|
},
|
@@ -3068,11 +3115,8 @@ const AddComponentButton = ({
|
|
3068
3115
|
onClick,
|
3069
3116
|
disabled: isDisabled,
|
3070
3117
|
background: "neutral0",
|
3071
|
-
paddingTop: 3,
|
3072
|
-
paddingBottom: 3,
|
3073
|
-
paddingLeft: 4,
|
3074
|
-
paddingRight: 4,
|
3075
3118
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
3119
|
+
variant: "tertiary",
|
3076
3120
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
|
3077
3121
|
/* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
3078
3122
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3101,10 +3145,11 @@ const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
|
|
3101
3145
|
}
|
3102
3146
|
`;
|
3103
3147
|
const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
|
3104
|
-
const StyledButton = styledComponents.styled(designSystem.
|
3148
|
+
const StyledButton = styledComponents.styled(designSystem.Button)`
|
3105
3149
|
border-radius: 26px;
|
3106
3150
|
border-color: ${({ theme }) => theme.colors.neutral150};
|
3107
3151
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3152
|
+
height: 5rem;
|
3108
3153
|
|
3109
3154
|
&:hover {
|
3110
3155
|
${AddComponentTitle} {
|
@@ -3116,7 +3161,7 @@ const StyledButton = styledComponents.styled(designSystem.BaseButton)`
|
|
3116
3161
|
fill: ${({ theme }) => theme.colors.primary600};
|
3117
3162
|
}
|
3118
3163
|
> path {
|
3119
|
-
fill: ${({ theme }) => theme.colors.
|
3164
|
+
fill: ${({ theme }) => theme.colors.primary600};
|
3120
3165
|
}
|
3121
3166
|
}
|
3122
3167
|
}
|
@@ -3247,18 +3292,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3247
3292
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
3248
3293
|
] });
|
3249
3294
|
};
|
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
3295
|
const uidApi = index.contentManagerApi.injectEndpoints({
|
3263
3296
|
endpoints: (builder) => ({
|
3264
3297
|
getDefaultUID: builder.query({
|
@@ -3293,7 +3326,10 @@ const uidApi = index.contentManagerApi.injectEndpoints({
|
|
3293
3326
|
config: {
|
3294
3327
|
params
|
3295
3328
|
}
|
3296
|
-
})
|
3329
|
+
}),
|
3330
|
+
providesTags: (_res, _error, params) => [
|
3331
|
+
{ type: "UidAvailability", id: params.contentTypeUID }
|
3332
|
+
]
|
3297
3333
|
})
|
3298
3334
|
})
|
3299
3335
|
});
|
@@ -3305,8 +3341,10 @@ const UIDInput = React__namespace.forwardRef(
|
|
3305
3341
|
const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
|
3306
3342
|
const [availability, setAvailability] = React__namespace.useState();
|
3307
3343
|
const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
|
3344
|
+
const isCloning = reactRouterDom.useMatch(index.CLONE_PATH) !== null;
|
3308
3345
|
const field = strapiAdmin.useField(name2);
|
3309
|
-
const debouncedValue = useDebounce(field.value, 300);
|
3346
|
+
const debouncedValue = useDebounce.useDebounce(field.value, 300);
|
3347
|
+
const hasChanged = debouncedValue !== field.initialValue;
|
3310
3348
|
const { toggleNotification } = strapiAdmin.useNotification();
|
3311
3349
|
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
3312
3350
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -3382,8 +3420,9 @@ const UIDInput = React__namespace.forwardRef(
|
|
3382
3420
|
params
|
3383
3421
|
},
|
3384
3422
|
{
|
3423
|
+
// Don't check availability if the value is empty or wasn't changed
|
3385
3424
|
skip: !Boolean(
|
3386
|
-
|
3425
|
+
(hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3387
3426
|
)
|
3388
3427
|
}
|
3389
3428
|
);
|
@@ -3412,6 +3451,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3412
3451
|
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3413
3452
|
const fieldRef = strapiAdmin.useFocusInputField(name2);
|
3414
3453
|
const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
|
3454
|
+
const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
|
3415
3455
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3416
3456
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
|
3417
3457
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -3420,7 +3460,7 @@ const UIDInput = React__namespace.forwardRef(
|
|
3420
3460
|
ref: composedRefs,
|
3421
3461
|
disabled: props.disabled,
|
3422
3462
|
endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
|
3423
|
-
|
3463
|
+
shouldShowAvailability && /* @__PURE__ */ jsxRuntime.jsxs(
|
3424
3464
|
TextValidation,
|
3425
3465
|
{
|
3426
3466
|
alignItems: "center",
|
@@ -4254,7 +4294,7 @@ const EditorLayout = ({
|
|
4254
4294
|
justifyContent: "flex-end",
|
4255
4295
|
shrink: 0,
|
4256
4296
|
width: "100%",
|
4257
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, children: [
|
4297
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
|
4258
4298
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: formatMessage({
|
4259
4299
|
id: "components.Wysiwyg.collapse",
|
4260
4300
|
defaultMessage: "Collapse"
|
@@ -4272,12 +4312,14 @@ const EditorLayout = ({
|
|
4272
4312
|
) }) });
|
4273
4313
|
}
|
4274
4314
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4275
|
-
designSystem.
|
4315
|
+
designSystem.Flex,
|
4276
4316
|
{
|
4277
4317
|
borderColor: error ? "danger600" : "neutral200",
|
4278
4318
|
borderStyle: "solid",
|
4279
4319
|
borderWidth: "1px",
|
4280
4320
|
hasRadius: true,
|
4321
|
+
direction: "column",
|
4322
|
+
alignItems: "stretch",
|
4281
4323
|
children
|
4282
4324
|
}
|
4283
4325
|
);
|
@@ -4288,11 +4330,19 @@ const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
|
|
4288
4330
|
const BoxWithBorder = styledComponents.styled(designSystem.Box)`
|
4289
4331
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
4290
4332
|
`;
|
4291
|
-
const ExpandButton$1 = styledComponents.styled(designSystem.
|
4333
|
+
const ExpandButton$1 = styledComponents.styled(designSystem.Button)`
|
4292
4334
|
background-color: transparent;
|
4293
4335
|
border: none;
|
4294
4336
|
align-items: center;
|
4295
4337
|
|
4338
|
+
& > span {
|
4339
|
+
display: flex;
|
4340
|
+
justify-content: space-between;
|
4341
|
+
align-items: center;
|
4342
|
+
width: 100%;
|
4343
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4344
|
+
}
|
4345
|
+
|
4296
4346
|
svg {
|
4297
4347
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4298
4348
|
|
@@ -4559,40 +4609,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4559
4609
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4560
4610
|
}
|
4561
4611
|
};
|
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
4612
|
const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
|
4577
4613
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4578
4614
|
`;
|
4579
4615
|
const MoreButton = styledComponents.styled(designSystem.IconButton)`
|
4580
4616
|
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
4617
|
`;
|
4588
4618
|
const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
|
4589
4619
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4590
4620
|
`;
|
4591
|
-
const ExpandButton = styledComponents.styled(designSystem.
|
4621
|
+
const ExpandButton = styledComponents.styled(designSystem.Button)`
|
4592
4622
|
background-color: transparent;
|
4593
4623
|
border: none;
|
4594
4624
|
align-items: center;
|
4595
4625
|
|
4626
|
+
& > span {
|
4627
|
+
display: flex;
|
4628
|
+
justify-content: space-between;
|
4629
|
+
align-items: center;
|
4630
|
+
width: 100%;
|
4631
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4632
|
+
}
|
4633
|
+
|
4596
4634
|
svg {
|
4597
4635
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4598
4636
|
path {
|
@@ -4604,8 +4642,8 @@ const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
|
|
4604
4642
|
`;
|
4605
4643
|
const WysiwygFooter = ({ onToggleExpand }) => {
|
4606
4644
|
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({
|
4645
|
+
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: [
|
4646
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "neutral800", children: formatMessage({
|
4609
4647
|
id: "components.WysiwygBottomControls.fullscreen",
|
4610
4648
|
defaultMessage: "Expand"
|
4611
4649
|
}) }),
|
@@ -4641,18 +4679,27 @@ const WysiwygNav = ({
|
|
4641
4679
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4642
4680
|
children: [
|
4643
4681
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
4644
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4645
|
-
|
4646
|
-
|
4647
|
-
|
4648
|
-
|
4649
|
-
|
4650
|
-
|
4651
|
-
|
4682
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4683
|
+
designSystem.SingleSelect,
|
4684
|
+
{
|
4685
|
+
disabled: true,
|
4686
|
+
placeholder: selectPlaceholder,
|
4687
|
+
"aria-label": selectPlaceholder,
|
4688
|
+
size: "S",
|
4689
|
+
children: [
|
4690
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4691
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
4692
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
|
4693
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
|
4694
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
|
4695
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
|
4696
|
+
]
|
4697
|
+
}
|
4698
|
+
) }),
|
4652
4699
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4653
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4654
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4655
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
4700
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4701
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
|
4702
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
|
4656
4703
|
] }),
|
4657
4704
|
/* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
|
4658
4705
|
] }),
|
@@ -4679,6 +4726,7 @@ const WysiwygNav = ({
|
|
4679
4726
|
placeholder: selectPlaceholder,
|
4680
4727
|
"aria-label": selectPlaceholder,
|
4681
4728
|
onChange: (value) => onActionClick(value, editorRef),
|
4729
|
+
size: "S",
|
4682
4730
|
children: [
|
4683
4731
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4684
4732
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
@@ -4690,17 +4738,9 @@ const WysiwygNav = ({
|
|
4690
4738
|
}
|
4691
4739
|
) }),
|
4692
4740
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4741
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4693
4742
|
/* @__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,
|
4743
|
+
designSystem.IconButton,
|
4704
4744
|
{
|
4705
4745
|
onClick: () => onActionClick("Italic", editorRef),
|
4706
4746
|
label: "Italic",
|
@@ -4709,7 +4749,7 @@ const WysiwygNav = ({
|
|
4709
4749
|
}
|
4710
4750
|
),
|
4711
4751
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4712
|
-
|
4752
|
+
designSystem.IconButton,
|
4713
4753
|
{
|
4714
4754
|
onClick: () => onActionClick("Underline", editorRef),
|
4715
4755
|
label: "Underline",
|
@@ -4723,7 +4763,7 @@ const WysiwygNav = ({
|
|
4723
4763
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
|
4724
4764
|
/* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
|
4725
4765
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4726
|
-
|
4766
|
+
designSystem.IconButton,
|
4727
4767
|
{
|
4728
4768
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4729
4769
|
label: "Strikethrough",
|
@@ -4732,7 +4772,7 @@ const WysiwygNav = ({
|
|
4732
4772
|
}
|
4733
4773
|
),
|
4734
4774
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4735
|
-
|
4775
|
+
designSystem.IconButton,
|
4736
4776
|
{
|
4737
4777
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4738
4778
|
label: "BulletList",
|
@@ -4741,7 +4781,7 @@ const WysiwygNav = ({
|
|
4741
4781
|
}
|
4742
4782
|
),
|
4743
4783
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4744
|
-
|
4784
|
+
designSystem.IconButton,
|
4745
4785
|
{
|
4746
4786
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4747
4787
|
label: "NumberList",
|
@@ -4752,7 +4792,7 @@ const WysiwygNav = ({
|
|
4752
4792
|
] }),
|
4753
4793
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
|
4754
4794
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4755
|
-
|
4795
|
+
designSystem.IconButton,
|
4756
4796
|
{
|
4757
4797
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4758
4798
|
label: "Code",
|
@@ -4761,7 +4801,7 @@ const WysiwygNav = ({
|
|
4761
4801
|
}
|
4762
4802
|
),
|
4763
4803
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4764
|
-
|
4804
|
+
designSystem.IconButton,
|
4765
4805
|
{
|
4766
4806
|
onClick: () => {
|
4767
4807
|
handleTogglePopover();
|
@@ -4773,7 +4813,7 @@ const WysiwygNav = ({
|
|
4773
4813
|
}
|
4774
4814
|
),
|
4775
4815
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4776
|
-
|
4816
|
+
designSystem.IconButton,
|
4777
4817
|
{
|
4778
4818
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4779
4819
|
label: "Link",
|
@@ -4782,7 +4822,7 @@ const WysiwygNav = ({
|
|
4782
4822
|
}
|
4783
4823
|
),
|
4784
4824
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4785
|
-
|
4825
|
+
designSystem.IconButton,
|
4786
4826
|
{
|
4787
4827
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4788
4828
|
label: "Quote",
|
@@ -4860,7 +4900,7 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4860
4900
|
const handleSelectAssets = (files) => {
|
4861
4901
|
const formattedFiles = files.map((f) => ({
|
4862
4902
|
alt: f.alternativeText || f.name,
|
4863
|
-
url:
|
4903
|
+
url: useDebounce.prefixFileUrlWithBackendUrl(f.url),
|
4864
4904
|
mime: f.mime
|
4865
4905
|
}));
|
4866
4906
|
insertFile(editorRef, formattedFiles);
|
@@ -5018,7 +5058,9 @@ const useFieldHint = (hint = void 0, attribute) => {
|
|
5018
5058
|
if (!maximum && !minimum) {
|
5019
5059
|
return hint;
|
5020
5060
|
}
|
5021
|
-
const units = !["biginteger", "integer", "number"].includes(
|
5061
|
+
const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
|
5062
|
+
attribute.type
|
5063
|
+
) ? formatMessage(
|
5022
5064
|
{
|
5023
5065
|
id: "content-manager.form.Input.hint.character.unit",
|
5024
5066
|
defaultMessage: "{maxValue, plural, one { character} other { characters}}"
|
@@ -5112,7 +5154,7 @@ const DynamicComponent = ({
|
|
5112
5154
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5113
5155
|
designSystem.IconButton,
|
5114
5156
|
{
|
5115
|
-
|
5157
|
+
variant: "ghost",
|
5116
5158
|
label: formatMessage(
|
5117
5159
|
{
|
5118
5160
|
id: index.getTranslation("components.DynamicZone.delete-label"),
|
@@ -5127,7 +5169,7 @@ const DynamicComponent = ({
|
|
5127
5169
|
/* @__PURE__ */ jsxRuntime.jsx(
|
5128
5170
|
designSystem.IconButton,
|
5129
5171
|
{
|
5130
|
-
|
5172
|
+
variant: "ghost",
|
5131
5173
|
onClick: (e) => e.stopPropagation(),
|
5132
5174
|
"data-handler-id": handlerId,
|
5133
5175
|
ref: dragRef,
|
@@ -5188,7 +5230,18 @@ const DynamicComponent = ({
|
|
5188
5230
|
] }),
|
5189
5231
|
/* @__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: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5190
5232
|
const fieldName = `${name2}.${index$1}.${field.name}`;
|
5191
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
5233
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
5234
|
+
designSystem.Grid.Item,
|
5235
|
+
{
|
5236
|
+
col: size,
|
5237
|
+
s: 12,
|
5238
|
+
xs: 12,
|
5239
|
+
direction: "column",
|
5240
|
+
alignItems: "stretch",
|
5241
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName })
|
5242
|
+
},
|
5243
|
+
fieldName
|
5244
|
+
);
|
5192
5245
|
}) }, rowInd)) }) }) })
|
5193
5246
|
] }) }) })
|
5194
5247
|
] });
|
@@ -5381,7 +5434,7 @@ const DynamicZone = ({
|
|
5381
5434
|
const handleRemoveComponent = (name22, currentIndex) => () => {
|
5382
5435
|
removeFieldRow(name22, currentIndex);
|
5383
5436
|
};
|
5384
|
-
const hasError = error !== void 0
|
5437
|
+
const hasError = error !== void 0;
|
5385
5438
|
const renderButtonLabel = () => {
|
5386
5439
|
if (addComponentIsOpen) {
|
5387
5440
|
return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
|
@@ -5495,4 +5548,4 @@ exports.transformDocument = transformDocument;
|
|
5495
5548
|
exports.useDynamicZone = useDynamicZone;
|
5496
5549
|
exports.useFieldHint = useFieldHint;
|
5497
5550
|
exports.useLazyComponents = useLazyComponents;
|
5498
|
-
//# sourceMappingURL=Field-
|
5551
|
+
//# sourceMappingURL=Field-9DePZh-0.js.map
|