@strapi/content-manager 0.0.0-experimental.d53e940834bf72ddc725f1d2fd36dac9abec30cb → 0.0.0-experimental.d834c9e658d1fb037e6da1105150593521c667cc
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-D_M8iBw5.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-C-49MccQ.js.map → ComponentConfigurationPage-D_M8iBw5.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs → ComponentConfigurationPage-qemkOlnj.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DmwmiFQy.mjs.map → ComponentConfigurationPage-qemkOlnj.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js → EditConfigurationPage-BePwPuHy.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-DjFJw56M.js.map → EditConfigurationPage-BePwPuHy.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs → EditConfigurationPage-CjUrEewK.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-JT3E7NZy.mjs.map → EditConfigurationPage-CjUrEewK.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-zT3fBr4Y.js → EditViewPage-B-RJeiJD.js} +19 -8
- package/dist/_chunks/EditViewPage-B-RJeiJD.js.map +1 -0
- package/dist/_chunks/{EditViewPage-CPj61RMh.mjs → EditViewPage-De8GyU8P.mjs} +19 -8
- package/dist/_chunks/EditViewPage-De8GyU8P.mjs.map +1 -0
- package/dist/_chunks/{Field-Boxf9Ajp.js → Field-dq8Tg1M_.js} +175 -84
- package/dist/_chunks/Field-dq8Tg1M_.js.map +1 -0
- package/dist/_chunks/{Field-dha5VnIQ.mjs → Field-pb2o8uBe.mjs} +177 -86
- package/dist/_chunks/Field-pb2o8uBe.mjs.map +1 -0
- package/dist/_chunks/{Form-y5g1SRsh.js → Form-DGIf4jQU.js} +22 -11
- package/dist/_chunks/Form-DGIf4jQU.js.map +1 -0
- package/dist/_chunks/{Form-DHrru2AV.mjs → Form-DJn0Dxha.mjs} +22 -11
- package/dist/_chunks/Form-DJn0Dxha.mjs.map +1 -0
- package/dist/_chunks/{History-Bru_KoeP.mjs → History-BowL3JKP.mjs} +44 -19
- package/dist/_chunks/History-BowL3JKP.mjs.map +1 -0
- package/dist/_chunks/{History-CqN6K7SX.js → History-Dh2NEHnR.js} +44 -19
- package/dist/_chunks/History-Dh2NEHnR.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-D8wGABj0.mjs → ListConfigurationPage-BpVOB-hn.mjs} +20 -8
- package/dist/_chunks/ListConfigurationPage-BpVOB-hn.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-R_p-SbHZ.js → ListConfigurationPage-BxYCWz9e.js} +20 -8
- package/dist/_chunks/ListConfigurationPage-BxYCWz9e.js.map +1 -0
- package/dist/_chunks/{ListViewPage-pEw_zug9.js → ListViewPage-4XsciqHZ.js} +21 -7
- package/dist/_chunks/ListViewPage-4XsciqHZ.js.map +1 -0
- package/dist/_chunks/{ListViewPage-SID6TRb9.mjs → ListViewPage-CXFUjZQC.mjs} +22 -8
- package/dist/_chunks/ListViewPage-CXFUjZQC.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C5dcQojD.js → NoContentTypePage-C8OpoHeU.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C5dcQojD.js.map → NoContentTypePage-C8OpoHeU.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs → NoContentTypePage-DuhOTp3x.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CJ7UXwrQ.mjs.map → NoContentTypePage-DuhOTp3x.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs → NoPermissionsPage-DVz3mzDz.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B7syEq5E.mjs.map → NoPermissionsPage-DVz3mzDz.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js → NoPermissionsPage-y_r7DVA2.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BtPrImPP.js.map → NoPermissionsPage-y_r7DVA2.js.map} +1 -1
- package/dist/_chunks/{Relations-B9Crnhnn.mjs → Relations-CVNLrn1Y.mjs} +4 -4
- package/dist/_chunks/Relations-CVNLrn1Y.mjs.map +1 -0
- package/dist/_chunks/{Relations-DjTQ5kGB.js → Relations-DPFCAa7b.js} +4 -4
- package/dist/_chunks/Relations-DPFCAa7b.js.map +1 -0
- package/dist/_chunks/{en-Ux26r5pl.mjs → en-BrCTWlZv.mjs} +5 -4
- package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
- package/dist/_chunks/{en-fbKQxLGn.js → en-uOUIxfcQ.js} +5 -4
- package/dist/_chunks/{en-fbKQxLGn.js.map → en-uOUIxfcQ.js.map} +1 -1
- package/dist/_chunks/{index-DVPWZkbS.js → index-C3fJE-1-.js} +368 -168
- package/dist/_chunks/index-C3fJE-1-.js.map +1 -0
- package/dist/_chunks/{index-DJXJw9V5.mjs → index-DiMrfcfy.mjs} +387 -187
- package/dist/_chunks/index-DiMrfcfy.mjs.map +1 -0
- package/dist/_chunks/{layout-Dm6fbiQj.js → layout-C788OmNr.js} +22 -10
- package/dist/_chunks/layout-C788OmNr.js.map +1 -0
- package/dist/_chunks/{layout-Bau7ZfLV.mjs → layout-ls3gxfpH.mjs} +23 -11
- package/dist/_chunks/layout-ls3gxfpH.mjs.map +1 -0
- package/dist/_chunks/{relations-BH_kBSJ0.mjs → relations-CLcOmGO0.mjs} +2 -2
- package/dist/_chunks/{relations-BH_kBSJ0.mjs.map → relations-CLcOmGO0.mjs.map} +1 -1
- package/dist/_chunks/{relations-CKnpRgrN.js → relations-DYeotliT.js} +2 -2
- package/dist/_chunks/{relations-CKnpRgrN.js.map → relations-DYeotliT.js.map} +1 -1
- 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 +10 -22
- 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 +16 -16
- 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 +165 -105
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +166 -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/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +1 -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/package.json +8 -8
- 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
@@ -2,12 +2,12 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import * as React from "react";
|
3
3
|
import { useState, useEffect, useCallback, memo } from "react";
|
4
4
|
import { useStrapiApp, createContext, useField, useNotification, useForm, useAPIErrorHandler, useQueryParams, useFocusInputField, InputRenderer as InputRenderer$1 } from "@strapi/admin/strapi-admin";
|
5
|
-
import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton,
|
5
|
+
import { Box, SingleSelect, SingleSelectOption, Typography, Flex, BaseLink, Button, Popover, Field, Tooltip, IconButton, useComposedRefs, Portal, FocusTrap, Divider, VisuallyHidden, Grid as Grid$1, Accordion, TextButton, TextInput, IconButtonGroup, Menu, MenuItem } from "@strapi/design-system";
|
6
6
|
import pipe$1 from "lodash/fp/pipe";
|
7
7
|
import { useIntl } from "react-intl";
|
8
|
-
import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, d as buildValidParams, f as useDocumentRBAC,
|
8
|
+
import { m as DOCUMENT_META_FIELDS, g as getTranslation, c as useDoc, e as contentManagerApi, n as CLONE_PATH, d as buildValidParams, f as useDocumentRBAC, o as useDocLayout } from "./index-DiMrfcfy.mjs";
|
9
9
|
import { generateNKeysBetween } from "fractional-indexing";
|
10
|
-
import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-
|
10
|
+
import { u as useComponent, C as ComponentProvider, M as MemoizedRelationsField } from "./Relations-CVNLrn1Y.mjs";
|
11
11
|
import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
|
12
12
|
import { styled, css, keyframes } from "styled-components";
|
13
13
|
import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
|
@@ -19,7 +19,7 @@ import { withHistory } from "slate-history";
|
|
19
19
|
import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
|
20
20
|
import { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./usePrev-DH6iah0A.mjs";
|
21
21
|
import * as Toolbar from "@radix-ui/react-toolbar";
|
22
|
-
import { useLocation } from "react-router-dom";
|
22
|
+
import { useLocation, useMatch } from "react-router-dom";
|
23
23
|
import CodeMirror from "codemirror5";
|
24
24
|
import sanitizeHtml from "sanitize-html";
|
25
25
|
import { getLanguage, highlight, highlightAuto } from "highlight.js";
|
@@ -860,20 +860,8 @@ const LinkContent = React.forwardRef(
|
|
860
860
|
const [linkText, setLinkText] = React.useState(elementText);
|
861
861
|
const [linkUrl, setLinkUrl] = React.useState(link.url);
|
862
862
|
const linkInputRef = React.useRef(null);
|
863
|
-
const
|
863
|
+
const isLastInsertedLink = editor.lastInsertedLinkPath ? !Path.equals(path, editor.lastInsertedLinkPath) : true;
|
864
864
|
const [isSaveDisabled, setIsSaveDisabled] = React.useState(false);
|
865
|
-
const handleOpenChange = (isOpen) => {
|
866
|
-
if (isOpen) {
|
867
|
-
setPopoverOpen(isOpen);
|
868
|
-
setShowRemoveButton(isOpen);
|
869
|
-
} else {
|
870
|
-
setPopoverOpen(isOpen);
|
871
|
-
if (link.url === "") {
|
872
|
-
removeLink(editor);
|
873
|
-
}
|
874
|
-
ReactEditor.focus(editor);
|
875
|
-
}
|
876
|
-
};
|
877
865
|
const onLinkChange = (e) => {
|
878
866
|
setIsSaveDisabled(false);
|
879
867
|
setLinkUrl(e.target.value);
|
@@ -894,15 +882,33 @@ const LinkContent = React.forwardRef(
|
|
894
882
|
editLink(editor, { url: linkUrl, text: linkText });
|
895
883
|
setPopoverOpen(false);
|
896
884
|
editor.lastInsertedLinkPath = null;
|
885
|
+
ReactEditor.focus(editor);
|
886
|
+
};
|
887
|
+
const handleClose = () => {
|
888
|
+
if (link.url === "") {
|
889
|
+
removeLink(editor);
|
890
|
+
}
|
891
|
+
setPopoverOpen(false);
|
892
|
+
ReactEditor.focus(editor);
|
897
893
|
};
|
898
894
|
React.useEffect(() => {
|
899
895
|
if (popoverOpen)
|
900
896
|
linkInputRef.current?.focus();
|
901
897
|
}, [popoverOpen]);
|
902
898
|
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
903
|
-
return /* @__PURE__ */ jsxs(Popover.Root, {
|
904
|
-
/* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
905
|
-
|
899
|
+
return /* @__PURE__ */ jsxs(Popover.Root, { open: popoverOpen, children: [
|
900
|
+
/* @__PURE__ */ jsx(Popover.Trigger, { children: /* @__PURE__ */ jsx(
|
901
|
+
StyledBaseLink,
|
902
|
+
{
|
903
|
+
...attributes,
|
904
|
+
ref: forwardedRef,
|
905
|
+
href: link.url,
|
906
|
+
onClick: () => setPopoverOpen(true),
|
907
|
+
color: "primary600",
|
908
|
+
children
|
909
|
+
}
|
910
|
+
) }),
|
911
|
+
/* @__PURE__ */ jsx(Popover.Content, { onPointerDownOutside: handleClose, children: /* @__PURE__ */ jsxs(Flex, { padding: 4, direction: "column", gap: 4, children: [
|
906
912
|
/* @__PURE__ */ jsx(Field.Root, { width: "368px", children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
|
907
913
|
/* @__PURE__ */ jsx(Field.Label, { children: formatMessage({
|
908
914
|
id: "components.Blocks.popover.text",
|
@@ -948,7 +954,7 @@ const LinkContent = React.forwardRef(
|
|
948
954
|
{
|
949
955
|
variant: "danger-light",
|
950
956
|
onClick: () => removeLink(editor),
|
951
|
-
$visible:
|
957
|
+
$visible: isLastInsertedLink,
|
952
958
|
children: formatMessage({
|
953
959
|
id: "components.Blocks.popover.remove",
|
954
960
|
defaultMessage: "Remove"
|
@@ -956,11 +962,11 @@ const LinkContent = React.forwardRef(
|
|
956
962
|
}
|
957
963
|
),
|
958
964
|
/* @__PURE__ */ jsxs(Flex, { gap: 2, children: [
|
959
|
-
/* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick:
|
965
|
+
/* @__PURE__ */ jsx(Button, { variant: "tertiary", onClick: handleClose, children: formatMessage({
|
960
966
|
id: "components.Blocks.popover.cancel",
|
961
967
|
defaultMessage: "Cancel"
|
962
968
|
}) }),
|
963
|
-
/* @__PURE__ */ jsx(Button, {
|
969
|
+
/* @__PURE__ */ jsx(Button, { disabled: Boolean(inputNotDirty) || isSaveDisabled, onClick: handleSave, children: formatMessage({
|
964
970
|
id: "components.Blocks.popover.save",
|
965
971
|
defaultMessage: "Save"
|
966
972
|
}) })
|
@@ -1546,6 +1552,26 @@ const ListButton = ({ block, format }) => {
|
|
1546
1552
|
}
|
1547
1553
|
return false;
|
1548
1554
|
};
|
1555
|
+
const isListDisabled = () => {
|
1556
|
+
if (disabled) {
|
1557
|
+
return true;
|
1558
|
+
}
|
1559
|
+
if (!editor.selection) {
|
1560
|
+
return false;
|
1561
|
+
}
|
1562
|
+
const anchorNodeEntry = Editor$1.above(editor, {
|
1563
|
+
at: editor.selection.anchor,
|
1564
|
+
match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
|
1565
|
+
});
|
1566
|
+
const focusNodeEntry = Editor$1.above(editor, {
|
1567
|
+
at: editor.selection.focus,
|
1568
|
+
match: (node) => !Editor$1.isEditor(node) && node.type !== "text"
|
1569
|
+
});
|
1570
|
+
if (!anchorNodeEntry || !focusNodeEntry) {
|
1571
|
+
return false;
|
1572
|
+
}
|
1573
|
+
return anchorNodeEntry[0] !== focusNodeEntry[0];
|
1574
|
+
};
|
1549
1575
|
const toggleList = (format2) => {
|
1550
1576
|
let currentListEntry;
|
1551
1577
|
if (editor.selection) {
|
@@ -1579,7 +1605,7 @@ const ListButton = ({ block, format }) => {
|
|
1579
1605
|
name: format,
|
1580
1606
|
label: block.label,
|
1581
1607
|
isActive: isListActive(),
|
1582
|
-
disabled,
|
1608
|
+
disabled: isListDisabled(),
|
1583
1609
|
handleClick: () => toggleList(format)
|
1584
1610
|
}
|
1585
1611
|
);
|
@@ -1746,7 +1772,7 @@ const DragIconButton = styled(IconButton)`
|
|
1746
1772
|
}
|
1747
1773
|
svg {
|
1748
1774
|
height: auto;
|
1749
|
-
width: ${({ theme }) => theme.spaces[3]};
|
1775
|
+
min-width: ${({ theme }) => theme.spaces[3]};
|
1750
1776
|
|
1751
1777
|
path {
|
1752
1778
|
fill: ${({ theme }) => theme.colors.neutral700};
|
@@ -1863,7 +1889,7 @@ const DragAndDropElement = ({
|
|
1863
1889
|
disabled,
|
1864
1890
|
draggable: true,
|
1865
1891
|
$dragHandleTopMargin: dragHandleTopMargin,
|
1866
|
-
children: /* @__PURE__ */ jsx(Drag, { color: "
|
1892
|
+
children: /* @__PURE__ */ jsx(Drag, { color: "primary500" })
|
1867
1893
|
}
|
1868
1894
|
),
|
1869
1895
|
children
|
@@ -2187,7 +2213,7 @@ const EditorLayout$1 = ({
|
|
2187
2213
|
/* @__PURE__ */ jsx(
|
2188
2214
|
CollapseIconButton,
|
2189
2215
|
{
|
2190
|
-
|
2216
|
+
label: formatMessage({
|
2191
2217
|
id: getTranslation("components.Blocks.collapse"),
|
2192
2218
|
defaultMessage: "Collapse"
|
2193
2219
|
}),
|
@@ -2526,7 +2552,7 @@ const BlocksEditor = React.forwardRef(
|
|
2526
2552
|
!isExpandedMode && /* @__PURE__ */ jsx(
|
2527
2553
|
ExpandIconButton,
|
2528
2554
|
{
|
2529
|
-
|
2555
|
+
label: formatMessage({
|
2530
2556
|
id: getTranslation("components.Blocks.expand"),
|
2531
2557
|
defaultMessage: "Expand"
|
2532
2558
|
}),
|
@@ -2592,30 +2618,27 @@ const createDefaultForm = (contentType, components = {}) => {
|
|
2592
2618
|
const Initializer = ({ disabled, name: name2, onClick }) => {
|
2593
2619
|
const { formatMessage } = useIntl();
|
2594
2620
|
const field = useField(name2);
|
2595
|
-
return /* @__PURE__ */
|
2596
|
-
|
2597
|
-
|
2598
|
-
|
2599
|
-
|
2600
|
-
|
2601
|
-
|
2602
|
-
|
2603
|
-
|
2604
|
-
|
2605
|
-
|
2606
|
-
|
2607
|
-
|
2608
|
-
|
2609
|
-
|
2610
|
-
|
2611
|
-
|
2612
|
-
|
2613
|
-
|
2614
|
-
|
2615
|
-
|
2616
|
-
),
|
2617
|
-
field.error && /* @__PURE__ */ jsx(Typography, { textColor: "danger600", variant: "pi", children: field.error })
|
2618
|
-
] });
|
2621
|
+
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(
|
2622
|
+
Box,
|
2623
|
+
{
|
2624
|
+
tag: "button",
|
2625
|
+
background: "neutral100",
|
2626
|
+
borderColor: field.error ? "danger600" : "neutral200",
|
2627
|
+
hasRadius: true,
|
2628
|
+
disabled,
|
2629
|
+
onClick,
|
2630
|
+
paddingTop: 9,
|
2631
|
+
paddingBottom: 9,
|
2632
|
+
type: "button",
|
2633
|
+
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
2634
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(CircleIcon, {}) }),
|
2635
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Typography, { textColor: "primary600", variant: "pi", fontWeight: "bold", children: formatMessage({
|
2636
|
+
id: getTranslation("components.empty-repeatable"),
|
2637
|
+
defaultMessage: "No entry yet. Click on the button below to add one."
|
2638
|
+
}) }) })
|
2639
|
+
] })
|
2640
|
+
}
|
2641
|
+
) });
|
2619
2642
|
};
|
2620
2643
|
const CircleIcon = styled(PlusCircle)`
|
2621
2644
|
width: 2.4rem;
|
@@ -2649,7 +2672,18 @@ const NonRepeatableComponent = ({
|
|
2649
2672
|
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
|
2650
2673
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2651
2674
|
const completeFieldName = `${name2}.${field.name}`;
|
2652
|
-
return /* @__PURE__ */ jsx(
|
2675
|
+
return /* @__PURE__ */ jsx(
|
2676
|
+
Grid$1.Item,
|
2677
|
+
{
|
2678
|
+
col: size,
|
2679
|
+
s: 12,
|
2680
|
+
xs: 12,
|
2681
|
+
direction: "column",
|
2682
|
+
alignItems: "stretch",
|
2683
|
+
children: children({ ...field, name: completeFieldName })
|
2684
|
+
},
|
2685
|
+
completeFieldName
|
2686
|
+
);
|
2653
2687
|
}) }, index);
|
2654
2688
|
}) })
|
2655
2689
|
}
|
@@ -2827,7 +2861,18 @@ const RepeatableComponent = ({
|
|
2827
2861
|
children: layout.map((row, index2) => {
|
2828
2862
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2829
2863
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2830
|
-
return /* @__PURE__ */ jsx(
|
2864
|
+
return /* @__PURE__ */ jsx(
|
2865
|
+
Grid$1.Item,
|
2866
|
+
{
|
2867
|
+
col: size,
|
2868
|
+
s: 12,
|
2869
|
+
xs: 12,
|
2870
|
+
direction: "column",
|
2871
|
+
alignItems: "stretch",
|
2872
|
+
children: children({ ...field, name: completeFieldName })
|
2873
|
+
},
|
2874
|
+
completeFieldName
|
2875
|
+
);
|
2831
2876
|
}) }, index2);
|
2832
2877
|
})
|
2833
2878
|
}
|
@@ -2922,7 +2967,7 @@ const Component = ({
|
|
2922
2967
|
/* @__PURE__ */ jsx(
|
2923
2968
|
IconButton,
|
2924
2969
|
{
|
2925
|
-
|
2970
|
+
variant: "ghost",
|
2926
2971
|
onClick: onDeleteComponent,
|
2927
2972
|
label: formatMessage({
|
2928
2973
|
id: getTranslation("containers.Edit.delete"),
|
@@ -2935,7 +2980,7 @@ const Component = ({
|
|
2935
2980
|
IconButton,
|
2936
2981
|
{
|
2937
2982
|
ref: composedAccordionRefs,
|
2938
|
-
|
2983
|
+
variant: "ghost",
|
2939
2984
|
onClick: (e) => e.stopPropagation(),
|
2940
2985
|
"data-handler-id": handlerId,
|
2941
2986
|
label: formatMessage({
|
@@ -3005,7 +3050,7 @@ const ComponentInput = ({
|
|
3005
3050
|
id: getTranslation("components.reset-entry"),
|
3006
3051
|
defaultMessage: "Reset Entry"
|
3007
3052
|
}),
|
3008
|
-
|
3053
|
+
variant: "ghost",
|
3009
3054
|
onClick: () => {
|
3010
3055
|
field.onChange(name2, null);
|
3011
3056
|
},
|
@@ -3034,11 +3079,8 @@ const AddComponentButton = ({
|
|
3034
3079
|
onClick,
|
3035
3080
|
disabled: isDisabled,
|
3036
3081
|
background: "neutral0",
|
3037
|
-
paddingTop: 3,
|
3038
|
-
paddingBottom: 3,
|
3039
|
-
paddingLeft: 4,
|
3040
|
-
paddingRight: 4,
|
3041
3082
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
3083
|
+
variant: "tertiary",
|
3042
3084
|
children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
|
3043
3085
|
/* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
3044
3086
|
/* @__PURE__ */ jsx(
|
@@ -3067,10 +3109,11 @@ const StyledAddIcon = styled(PlusCircle)`
|
|
3067
3109
|
}
|
3068
3110
|
`;
|
3069
3111
|
const AddComponentTitle = styled(Typography)``;
|
3070
|
-
const StyledButton = styled(
|
3112
|
+
const StyledButton = styled(Button)`
|
3071
3113
|
border-radius: 26px;
|
3072
3114
|
border-color: ${({ theme }) => theme.colors.neutral150};
|
3073
3115
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3116
|
+
height: 5rem;
|
3074
3117
|
|
3075
3118
|
&:hover {
|
3076
3119
|
${AddComponentTitle} {
|
@@ -3082,7 +3125,7 @@ const StyledButton = styled(BaseButton)`
|
|
3082
3125
|
fill: ${({ theme }) => theme.colors.primary600};
|
3083
3126
|
}
|
3084
3127
|
> path {
|
3085
|
-
fill: ${({ theme }) => theme.colors.
|
3128
|
+
fill: ${({ theme }) => theme.colors.primary600};
|
3086
3129
|
}
|
3087
3130
|
}
|
3088
3131
|
}
|
@@ -3259,7 +3302,10 @@ const uidApi = contentManagerApi.injectEndpoints({
|
|
3259
3302
|
config: {
|
3260
3303
|
params
|
3261
3304
|
}
|
3262
|
-
})
|
3305
|
+
}),
|
3306
|
+
providesTags: (_res, _error, params) => [
|
3307
|
+
{ type: "UidAvailability", id: params.contentTypeUID }
|
3308
|
+
]
|
3263
3309
|
})
|
3264
3310
|
})
|
3265
3311
|
});
|
@@ -3271,8 +3317,10 @@ const UIDInput = React.forwardRef(
|
|
3271
3317
|
const allFormValues = useForm("InputUID", (form) => form.values);
|
3272
3318
|
const [availability, setAvailability] = React.useState();
|
3273
3319
|
const [showRegenerate, setShowRegenerate] = React.useState(false);
|
3320
|
+
const isCloning = useMatch(CLONE_PATH) !== null;
|
3274
3321
|
const field = useField(name2);
|
3275
3322
|
const debouncedValue = useDebounce(field.value, 300);
|
3323
|
+
const hasChanged = debouncedValue !== field.initialValue;
|
3276
3324
|
const { toggleNotification } = useNotification();
|
3277
3325
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
3278
3326
|
const { formatMessage } = useIntl();
|
@@ -3348,8 +3396,9 @@ const UIDInput = React.forwardRef(
|
|
3348
3396
|
params
|
3349
3397
|
},
|
3350
3398
|
{
|
3399
|
+
// Don't check availability if the value is empty or wasn't changed
|
3351
3400
|
skip: !Boolean(
|
3352
|
-
|
3401
|
+
(hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3353
3402
|
)
|
3354
3403
|
}
|
3355
3404
|
);
|
@@ -3378,6 +3427,7 @@ const UIDInput = React.forwardRef(
|
|
3378
3427
|
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3379
3428
|
const fieldRef = useFocusInputField(name2);
|
3380
3429
|
const composedRefs = useComposedRefs(ref, fieldRef);
|
3430
|
+
const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
|
3381
3431
|
return /* @__PURE__ */ jsxs(Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3382
3432
|
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
|
3383
3433
|
/* @__PURE__ */ jsx(
|
@@ -3386,7 +3436,7 @@ const UIDInput = React.forwardRef(
|
|
3386
3436
|
ref: composedRefs,
|
3387
3437
|
disabled: props.disabled,
|
3388
3438
|
endAction: /* @__PURE__ */ jsxs(Flex, { position: "relative", gap: 1, children: [
|
3389
|
-
|
3439
|
+
shouldShowAvailability && /* @__PURE__ */ jsxs(
|
3390
3440
|
TextValidation,
|
3391
3441
|
{
|
3392
3442
|
alignItems: "center",
|
@@ -4220,7 +4270,7 @@ const EditorLayout = ({
|
|
4220
4270
|
justifyContent: "flex-end",
|
4221
4271
|
shrink: 0,
|
4222
4272
|
width: "100%",
|
4223
|
-
children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, children: [
|
4273
|
+
children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
|
4224
4274
|
/* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
4225
4275
|
id: "components.Wysiwyg.collapse",
|
4226
4276
|
defaultMessage: "Collapse"
|
@@ -4238,12 +4288,14 @@ const EditorLayout = ({
|
|
4238
4288
|
) }) });
|
4239
4289
|
}
|
4240
4290
|
return /* @__PURE__ */ jsx(
|
4241
|
-
|
4291
|
+
Flex,
|
4242
4292
|
{
|
4243
4293
|
borderColor: error ? "danger600" : "neutral200",
|
4244
4294
|
borderStyle: "solid",
|
4245
4295
|
borderWidth: "1px",
|
4246
4296
|
hasRadius: true,
|
4297
|
+
direction: "column",
|
4298
|
+
alignItems: "stretch",
|
4247
4299
|
children
|
4248
4300
|
}
|
4249
4301
|
);
|
@@ -4254,11 +4306,19 @@ const ExpandWrapper = styled(Flex)`
|
|
4254
4306
|
const BoxWithBorder = styled(Box)`
|
4255
4307
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
4256
4308
|
`;
|
4257
|
-
const ExpandButton$1 = styled(
|
4309
|
+
const ExpandButton$1 = styled(Button)`
|
4258
4310
|
background-color: transparent;
|
4259
4311
|
border: none;
|
4260
4312
|
align-items: center;
|
4261
4313
|
|
4314
|
+
& > span {
|
4315
|
+
display: flex;
|
4316
|
+
justify-content: space-between;
|
4317
|
+
align-items: center;
|
4318
|
+
width: 100%;
|
4319
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4320
|
+
}
|
4321
|
+
|
4262
4322
|
svg {
|
4263
4323
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4264
4324
|
|
@@ -4554,11 +4614,19 @@ const MoreButton = styled(IconButton)`
|
|
4554
4614
|
const IconButtonGroupMargin = styled(IconButtonGroup)`
|
4555
4615
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4556
4616
|
`;
|
4557
|
-
const ExpandButton = styled(
|
4617
|
+
const ExpandButton = styled(Button)`
|
4558
4618
|
background-color: transparent;
|
4559
4619
|
border: none;
|
4560
4620
|
align-items: center;
|
4561
4621
|
|
4622
|
+
& > span {
|
4623
|
+
display: flex;
|
4624
|
+
justify-content: space-between;
|
4625
|
+
align-items: center;
|
4626
|
+
width: 100%;
|
4627
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4628
|
+
}
|
4629
|
+
|
4562
4630
|
svg {
|
4563
4631
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4564
4632
|
path {
|
@@ -4570,8 +4638,8 @@ const ExpandButton = styled(BaseButton)`
|
|
4570
4638
|
`;
|
4571
4639
|
const WysiwygFooter = ({ onToggleExpand }) => {
|
4572
4640
|
const { formatMessage } = useIntl();
|
4573
|
-
return /* @__PURE__ */ jsx(Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, children: [
|
4574
|
-
/* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
4641
|
+
return /* @__PURE__ */ jsx(Box, { padding: 2, background: "neutral100", borderRadius: `0 0 0.4rem 0.4rem`, children: /* @__PURE__ */ jsx(Flex, { justifyContent: "flex-end", alignItems: "flex-end", children: /* @__PURE__ */ jsxs(ExpandButton, { id: "expand", onClick: onToggleExpand, variant: "tertiary", size: "M", children: [
|
4642
|
+
/* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
|
4575
4643
|
id: "components.WysiwygBottomControls.fullscreen",
|
4576
4644
|
defaultMessage: "Expand"
|
4577
4645
|
}) }),
|
@@ -4607,14 +4675,23 @@ const WysiwygNav = ({
|
|
4607
4675
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4608
4676
|
children: [
|
4609
4677
|
/* @__PURE__ */ jsxs(Flex, { children: [
|
4610
|
-
/* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
|
4611
|
-
|
4612
|
-
|
4613
|
-
|
4614
|
-
|
4615
|
-
|
4616
|
-
|
4617
|
-
|
4678
|
+
/* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
|
4679
|
+
SingleSelect,
|
4680
|
+
{
|
4681
|
+
disabled: true,
|
4682
|
+
placeholder: selectPlaceholder,
|
4683
|
+
"aria-label": selectPlaceholder,
|
4684
|
+
size: "S",
|
4685
|
+
children: [
|
4686
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
|
4687
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
|
4688
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
|
4689
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
|
4690
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
|
4691
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
|
4692
|
+
]
|
4693
|
+
}
|
4694
|
+
) }),
|
4618
4695
|
/* @__PURE__ */ jsxs(MainButtons, { children: [
|
4619
4696
|
/* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
|
4620
4697
|
/* @__PURE__ */ jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
|
@@ -4645,6 +4722,7 @@ const WysiwygNav = ({
|
|
4645
4722
|
placeholder: selectPlaceholder,
|
4646
4723
|
"aria-label": selectPlaceholder,
|
4647
4724
|
onChange: (value) => onActionClick(value, editorRef),
|
4725
|
+
size: "S",
|
4648
4726
|
children: [
|
4649
4727
|
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
|
4650
4728
|
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
|
@@ -4984,7 +5062,9 @@ const useFieldHint = (hint = void 0, attribute) => {
|
|
4984
5062
|
if (!maximum && !minimum) {
|
4985
5063
|
return hint;
|
4986
5064
|
}
|
4987
|
-
const units = !["biginteger", "integer", "number"].includes(
|
5065
|
+
const units = !["biginteger", "integer", "number", "dynamiczone", "component"].includes(
|
5066
|
+
attribute.type
|
5067
|
+
) ? formatMessage(
|
4988
5068
|
{
|
4989
5069
|
id: "content-manager.form.Input.hint.character.unit",
|
4990
5070
|
defaultMessage: "{maxValue, plural, one { character} other { characters}}"
|
@@ -5078,7 +5158,7 @@ const DynamicComponent = ({
|
|
5078
5158
|
/* @__PURE__ */ jsx(
|
5079
5159
|
IconButton,
|
5080
5160
|
{
|
5081
|
-
|
5161
|
+
variant: "ghost",
|
5082
5162
|
label: formatMessage(
|
5083
5163
|
{
|
5084
5164
|
id: getTranslation("components.DynamicZone.delete-label"),
|
@@ -5093,7 +5173,7 @@ const DynamicComponent = ({
|
|
5093
5173
|
/* @__PURE__ */ jsx(
|
5094
5174
|
IconButton,
|
5095
5175
|
{
|
5096
|
-
|
5176
|
+
variant: "ghost",
|
5097
5177
|
onClick: (e) => e.stopPropagation(),
|
5098
5178
|
"data-handler-id": handlerId,
|
5099
5179
|
ref: dragRef,
|
@@ -5154,7 +5234,18 @@ const DynamicComponent = ({
|
|
5154
5234
|
] }),
|
5155
5235
|
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5156
5236
|
const fieldName = `${name2}.${index}.${field.name}`;
|
5157
|
-
return /* @__PURE__ */ jsx(
|
5237
|
+
return /* @__PURE__ */ jsx(
|
5238
|
+
Grid$1.Item,
|
5239
|
+
{
|
5240
|
+
col: size,
|
5241
|
+
s: 12,
|
5242
|
+
xs: 12,
|
5243
|
+
direction: "column",
|
5244
|
+
alignItems: "stretch",
|
5245
|
+
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...field, name: fieldName })
|
5246
|
+
},
|
5247
|
+
fieldName
|
5248
|
+
);
|
5158
5249
|
}) }, rowInd)) }) }) })
|
5159
5250
|
] }) }) })
|
5160
5251
|
] });
|
@@ -5347,7 +5438,7 @@ const DynamicZone = ({
|
|
5347
5438
|
const handleRemoveComponent = (name22, currentIndex) => () => {
|
5348
5439
|
removeFieldRow(name22, currentIndex);
|
5349
5440
|
};
|
5350
|
-
const hasError = error !== void 0
|
5441
|
+
const hasError = error !== void 0;
|
5351
5442
|
const renderButtonLabel = () => {
|
5352
5443
|
if (addComponentIsOpen) {
|
5353
5444
|
return formatMessage({ id: "app.utils.close-label", defaultMessage: "Close" });
|
@@ -5463,4 +5554,4 @@ export {
|
|
5463
5554
|
transformDocument as t,
|
5464
5555
|
useLazyComponents as u
|
5465
5556
|
};
|
5466
|
-
//# sourceMappingURL=Field-
|
5557
|
+
//# sourceMappingURL=Field-pb2o8uBe.mjs.map
|