@strapi/content-manager 0.0.0-experimental.f31889311d753b5f7d95198ae84d8fce1d156cd6 → 0.0.0-experimental.f49f46a1c17445a39e8af3f63124bcccf73842e6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_chunks/{ComponentConfigurationPage-BNxtMIfV.js → ComponentConfigurationPage-ClKl_TA2.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-BNxtMIfV.js.map → ComponentConfigurationPage-ClKl_TA2.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BWOQWCv2.mjs → ComponentConfigurationPage-D3ZWDAHG.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-BWOQWCv2.mjs.map → ComponentConfigurationPage-D3ZWDAHG.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-GTp-Ucnw.mjs → EditConfigurationPage-BYCBSJxP.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-GTp-Ucnw.mjs.map → EditConfigurationPage-BYCBSJxP.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-D340bYlT.js → EditConfigurationPage-OWez0Kxp.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-D340bYlT.js.map → EditConfigurationPage-OWez0Kxp.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-BVMS5hT-.mjs → EditViewPage-5pdbvsO_.mjs} +63 -12
- package/dist/_chunks/EditViewPage-5pdbvsO_.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-CXkmnAvI.js → EditViewPage-BEs5iGDi.js} +62 -11
- package/dist/_chunks/EditViewPage-BEs5iGDi.js.map +1 -0
- package/dist/_chunks/{Field-Ibi32diw.js → Field-DNHm4wHx.js} +210 -119
- package/dist/_chunks/Field-DNHm4wHx.js.map +1 -0
- package/dist/_chunks/{Field-nNgv5bpd.mjs → Field-DcKuFHYK.mjs} +208 -117
- package/dist/_chunks/Field-DcKuFHYK.mjs.map +1 -0
- package/dist/_chunks/{Form-DodJsI2A.mjs → Form-CGwM_-5c.mjs} +36 -17
- package/dist/_chunks/Form-CGwM_-5c.mjs.map +1 -0
- package/dist/_chunks/{Form-Dhnh34ym.js → Form-CoRxWJOz.js} +36 -17
- package/dist/_chunks/Form-CoRxWJOz.js.map +1 -0
- package/dist/_chunks/{History-C9auUkDi.js → History-BcUTQrfG.js} +40 -97
- package/dist/_chunks/History-BcUTQrfG.js.map +1 -0
- package/dist/_chunks/{History-CKCSQXz_.mjs → History-DEvr3Q_V.mjs} +42 -99
- package/dist/_chunks/History-DEvr3Q_V.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Bg4rWUjX.js → ListConfigurationPage-BE_Ho7tV.js} +17 -6
- package/dist/_chunks/ListConfigurationPage-BE_Ho7tV.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-CKEC4ttG.mjs → ListConfigurationPage-BM4zZZcM.mjs} +18 -7
- package/dist/_chunks/ListConfigurationPage-BM4zZZcM.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-B7_WJUjG.mjs → ListViewPage-BK2mkrql.mjs} +65 -39
- package/dist/_chunks/ListViewPage-BK2mkrql.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-C2gIeYHG.js → ListViewPage-BkT8Eao0.js} +68 -42
- package/dist/_chunks/ListViewPage-BkT8Eao0.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Ckem6Ll6.mjs → NoContentTypePage-BvcAutu9.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-Ckem6Ll6.mjs.map → NoContentTypePage-BvcAutu9.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-DqgdUfyn.js → NoContentTypePage-C8mtyc4H.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-DqgdUfyn.js.map → NoContentTypePage-C8mtyc4H.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CF29Q-sW.js → NoPermissionsPage-B5Y9Y78B.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CF29Q-sW.js.map → NoPermissionsPage-B5Y9Y78B.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BO-GEjA4.mjs → NoPermissionsPage-BmbRz7PR.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BO-GEjA4.mjs.map → NoPermissionsPage-BmbRz7PR.mjs.map} +1 -1
- package/dist/_chunks/Preview-BF8ZDYqS.js +286 -0
- package/dist/_chunks/Preview-BF8ZDYqS.js.map +1 -0
- package/dist/_chunks/Preview-DcexhKJE.mjs +267 -0
- package/dist/_chunks/Preview-DcexhKJE.mjs.map +1 -0
- package/dist/_chunks/{Relations-C0uC9J4f.js → Relations-BKnoK1R0.js} +72 -36
- package/dist/_chunks/Relations-BKnoK1R0.js.map +1 -0
- package/dist/_chunks/{Relations-DItV5eow.mjs → Relations-BjIzc4EK.mjs} +73 -37
- package/dist/_chunks/Relations-BjIzc4EK.mjs.map +1 -0
- package/dist/_chunks/{en-BrCTWlZv.mjs → en-CfIXaZf9.mjs} +26 -14
- package/dist/_chunks/{en-BrCTWlZv.mjs.map → en-CfIXaZf9.mjs.map} +1 -1
- package/dist/_chunks/{en-uOUIxfcQ.js → en-DTWPCdTS.js} +26 -14
- package/dist/_chunks/{en-uOUIxfcQ.js.map → en-DTWPCdTS.js.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/{index-DrNe6ctw.mjs → index-BW-rXkjn.mjs} +1027 -761
- package/dist/_chunks/index-BW-rXkjn.mjs.map +1 -0
- package/dist/_chunks/{index-Dd0nXyJF.js → index-DOzAG2cq.js} +1008 -741
- package/dist/_chunks/index-DOzAG2cq.js.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout-B3ez7kvr.mjs → layout-DFVbgjp2.mjs} +8 -7
- package/dist/_chunks/layout-DFVbgjp2.mjs.map +1 -0
- package/dist/_chunks/{layout-CLLtt_5O.js → layout-RC3W2obV.js} +8 -7
- package/dist/_chunks/layout-RC3W2obV.js.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-B0hlsUU_.mjs → relations-Dogh8HWI.mjs} +6 -7
- package/dist/_chunks/relations-Dogh8HWI.mjs.map +1 -0
- package/dist/_chunks/{relations-bRxcNv1q.js → relations-zam7-5H7.js} +6 -7
- package/dist/_chunks/relations-zam7-5H7.js.map +1 -0
- package/dist/_chunks/{usePrev-B9w_-eYc.js → useDebounce-CtcjDB3L.js} +14 -1
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs +29 -0
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -0
- package/dist/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/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +32 -1
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
- 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/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
- package/dist/admin/src/preview/routes.d.ts +3 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/router.d.ts +1 -1
- 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 +421 -183
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +421 -183
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/history/services/history.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +3 -3
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +4 -4
- package/dist/server/src/policies/hasPermissions.d.ts.map +1 -1
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +15 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +30 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +18 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/routes/index.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 +8 -8
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -4
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/permission-checker.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +3 -1
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +14 -14
- package/dist/_chunks/EditViewPage-BVMS5hT-.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-CXkmnAvI.js.map +0 -1
- package/dist/_chunks/Field-Ibi32diw.js.map +0 -1
- package/dist/_chunks/Field-nNgv5bpd.mjs.map +0 -1
- package/dist/_chunks/Form-Dhnh34ym.js.map +0 -1
- package/dist/_chunks/Form-DodJsI2A.mjs.map +0 -1
- package/dist/_chunks/History-C9auUkDi.js.map +0 -1
- package/dist/_chunks/History-CKCSQXz_.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Bg4rWUjX.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-CKEC4ttG.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-B7_WJUjG.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-C2gIeYHG.js.map +0 -1
- package/dist/_chunks/Relations-C0uC9J4f.js.map +0 -1
- package/dist/_chunks/Relations-DItV5eow.mjs.map +0 -1
- package/dist/_chunks/index-Dd0nXyJF.js.map +0 -1
- package/dist/_chunks/index-DrNe6ctw.mjs.map +0 -1
- package/dist/_chunks/layout-B3ez7kvr.mjs.map +0 -1
- package/dist/_chunks/layout-CLLtt_5O.js.map +0 -1
- package/dist/_chunks/relations-B0hlsUU_.mjs.map +0 -1
- package/dist/_chunks/relations-bRxcNv1q.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
@@ -2,24 +2,24 @@ 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, S as SINGLE_TYPES, o as useDocLayout } from "./index-BW-rXkjn.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-BjIzc4EK.mjs";
|
11
11
|
import { Code, HeadingOne, HeadingTwo, HeadingThree, HeadingFour, HeadingFive, HeadingSix, Image as Image$1, NumberList, BulletList, Paragraph, Quotes, Link as Link$1, Drag, Collapse, Bold, Italic, Underline, StrikeThrough, Expand, PlusCircle, Plus, Trash, EyeStriked, CheckCircle, WarningCircle, Loader, ArrowClockwise, More } from "@strapi/icons";
|
12
12
|
import { styled, css, keyframes } from "styled-components";
|
13
13
|
import { C as ComponentIcon, a as COMPONENT_ICONS } from "./ComponentIcon-u4bIXTFY.mjs";
|
14
14
|
import { getEmptyImage } from "react-dnd-html5-backend";
|
15
15
|
import { a as DIRECTIONS, u as useDragAndDrop, I as ItemTypes } from "./useDragAndDrop-DdHgKsqq.mjs";
|
16
|
-
import { g as getIn } from "./objects-
|
16
|
+
import { g as getIn } from "./objects-D6yBsdmx.mjs";
|
17
17
|
import { Editor as Editor$1, Transforms, Node, Element, Range, Path, Point, createEditor } from "slate";
|
18
18
|
import { withHistory } from "slate-history";
|
19
19
|
import { useFocused, useSelected, ReactEditor, Editable, useSlate, Slate, withReact } from "slate-react";
|
20
|
-
import { p as prefixFileUrlWithBackendUrl, u as usePrev } from "./
|
20
|
+
import { p as prefixFileUrlWithBackendUrl, u as usePrev, a as useDebounce } from "./useDebounce-DmuSJIF3.mjs";
|
21
21
|
import * as Toolbar from "@radix-ui/react-toolbar";
|
22
|
-
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";
|
@@ -1407,7 +1407,7 @@ const ToolbarButton = ({
|
|
1407
1407
|
width: 7,
|
1408
1408
|
height: 7,
|
1409
1409
|
hasRadius: true,
|
1410
|
-
children: /* @__PURE__ */ jsx(Icon, {
|
1410
|
+
children: /* @__PURE__ */ jsx(Icon, { fill: disabled ? "neutral300" : enabledColor })
|
1411
1411
|
}
|
1412
1412
|
)
|
1413
1413
|
}
|
@@ -1749,6 +1749,7 @@ const DragItem = styled(Flex)`
|
|
1749
1749
|
}
|
1750
1750
|
`;
|
1751
1751
|
const DragIconButton = styled(IconButton)`
|
1752
|
+
user-select: none;
|
1752
1753
|
display: flex;
|
1753
1754
|
align-items: center;
|
1754
1755
|
justify-content: center;
|
@@ -1877,6 +1878,7 @@ const DragAndDropElement = ({
|
|
1877
1878
|
DragIconButton,
|
1878
1879
|
{
|
1879
1880
|
tag: "div",
|
1881
|
+
contentEditable: false,
|
1880
1882
|
role: "button",
|
1881
1883
|
tabIndex: 0,
|
1882
1884
|
withTooltip: false,
|
@@ -2622,7 +2624,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2622
2624
|
Box,
|
2623
2625
|
{
|
2624
2626
|
tag: "button",
|
2625
|
-
background: "neutral100",
|
2627
|
+
background: disabled ? "neutral150" : "neutral100",
|
2626
2628
|
borderColor: field.error ? "danger600" : "neutral200",
|
2627
2629
|
hasRadius: true,
|
2628
2630
|
disabled,
|
@@ -2630,32 +2632,32 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2630
2632
|
paddingTop: 9,
|
2631
2633
|
paddingBottom: 9,
|
2632
2634
|
type: "button",
|
2635
|
+
style: { cursor: disabled ? "not-allowed" : "pointer" },
|
2633
2636
|
children: /* @__PURE__ */ jsxs(Flex, { direction: "column", gap: 2, children: [
|
2634
|
-
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2635
|
-
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2637
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", color: disabled ? "neutral500" : "primary600", children: /* @__PURE__ */ jsx(PlusCircle, { width: "3.2rem", height: "3.2rem" }) }),
|
2638
|
+
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(
|
2639
|
+
Typography,
|
2640
|
+
{
|
2641
|
+
textColor: disabled ? "neutral600" : "primary600",
|
2642
|
+
variant: "pi",
|
2643
|
+
fontWeight: "bold",
|
2644
|
+
children: formatMessage({
|
2645
|
+
id: getTranslation("components.empty-repeatable"),
|
2646
|
+
defaultMessage: "No entry yet. Click to add one."
|
2647
|
+
})
|
2648
|
+
}
|
2649
|
+
) })
|
2639
2650
|
] })
|
2640
2651
|
}
|
2641
2652
|
) });
|
2642
2653
|
};
|
2643
|
-
const CircleIcon = styled(PlusCircle)`
|
2644
|
-
width: 2.4rem;
|
2645
|
-
height: 2.4rem;
|
2646
|
-
> circle {
|
2647
|
-
fill: ${({ theme }) => theme.colors.primary200};
|
2648
|
-
}
|
2649
|
-
> path {
|
2650
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
2651
|
-
}
|
2652
|
-
`;
|
2653
2654
|
const NonRepeatableComponent = ({
|
2654
2655
|
attribute,
|
2655
2656
|
name: name2,
|
2656
2657
|
children,
|
2657
2658
|
layout
|
2658
2659
|
}) => {
|
2660
|
+
const { formatMessage } = useIntl();
|
2659
2661
|
const { value } = useField(name2);
|
2660
2662
|
const level = useComponent("NonRepeatableComponent", (state) => state.level);
|
2661
2663
|
const isNested = level > 0;
|
@@ -2672,7 +2674,22 @@ const NonRepeatableComponent = ({
|
|
2672
2674
|
children: /* @__PURE__ */ jsx(Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index) => {
|
2673
2675
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2674
2676
|
const completeFieldName = `${name2}.${field.name}`;
|
2675
|
-
|
2677
|
+
const translatedLabel = formatMessage({
|
2678
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2679
|
+
defaultMessage: field.label
|
2680
|
+
});
|
2681
|
+
return /* @__PURE__ */ jsx(
|
2682
|
+
Grid$1.Item,
|
2683
|
+
{
|
2684
|
+
col: size,
|
2685
|
+
s: 12,
|
2686
|
+
xs: 12,
|
2687
|
+
direction: "column",
|
2688
|
+
alignItems: "stretch",
|
2689
|
+
children: children({ ...field, label: translatedLabel, name: completeFieldName })
|
2690
|
+
},
|
2691
|
+
completeFieldName
|
2692
|
+
);
|
2676
2693
|
}) }, index);
|
2677
2694
|
}) })
|
2678
2695
|
}
|
@@ -2691,13 +2708,34 @@ const RepeatableComponent = ({
|
|
2691
2708
|
const { search: searchString } = useLocation();
|
2692
2709
|
const search = React.useMemo(() => new URLSearchParams(searchString), [searchString]);
|
2693
2710
|
const { components } = useDoc();
|
2694
|
-
const {
|
2711
|
+
const {
|
2712
|
+
value = [],
|
2713
|
+
error,
|
2714
|
+
rawError
|
2715
|
+
} = useField(name2);
|
2695
2716
|
const addFieldRow = useForm("RepeatableComponent", (state) => state.addFieldRow);
|
2696
2717
|
const moveFieldRow = useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2697
2718
|
const removeFieldRow = useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2698
2719
|
const { max = Infinity } = attribute;
|
2699
2720
|
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
2700
2721
|
const [liveText, setLiveText] = React.useState("");
|
2722
|
+
React.useEffect(() => {
|
2723
|
+
const hasNestedErrors = rawError && Array.isArray(rawError) && rawError.length > 0;
|
2724
|
+
const hasNestedValue = value && Array.isArray(value) && value.length > 0;
|
2725
|
+
if (hasNestedErrors && hasNestedValue) {
|
2726
|
+
const errorOpenItems = rawError.map((_, idx) => {
|
2727
|
+
return value[idx] ? value[idx].__temp_key__ : null;
|
2728
|
+
}).filter((value2) => !!value2);
|
2729
|
+
if (errorOpenItems && errorOpenItems.length > 0) {
|
2730
|
+
setCollapseToOpen((collapseToOpen2) => {
|
2731
|
+
if (!errorOpenItems.includes(collapseToOpen2)) {
|
2732
|
+
return errorOpenItems[0];
|
2733
|
+
}
|
2734
|
+
return collapseToOpen2;
|
2735
|
+
});
|
2736
|
+
}
|
2737
|
+
}
|
2738
|
+
}, [rawError, value]);
|
2701
2739
|
const componentTmpKeyWithFocussedField = React.useMemo(() => {
|
2702
2740
|
if (search.has("field")) {
|
2703
2741
|
const fieldParam = search.get("field");
|
@@ -2850,7 +2888,26 @@ const RepeatableComponent = ({
|
|
2850
2888
|
children: layout.map((row, index2) => {
|
2851
2889
|
return /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2852
2890
|
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2853
|
-
|
2891
|
+
const translatedLabel = formatMessage({
|
2892
|
+
id: `content-manager.components.${attribute.component}.${field.name}`,
|
2893
|
+
defaultMessage: field.label
|
2894
|
+
});
|
2895
|
+
return /* @__PURE__ */ jsx(
|
2896
|
+
Grid$1.Item,
|
2897
|
+
{
|
2898
|
+
col: size,
|
2899
|
+
s: 12,
|
2900
|
+
xs: 12,
|
2901
|
+
direction: "column",
|
2902
|
+
alignItems: "stretch",
|
2903
|
+
children: children({
|
2904
|
+
...field,
|
2905
|
+
label: translatedLabel,
|
2906
|
+
name: completeFieldName
|
2907
|
+
})
|
2908
|
+
},
|
2909
|
+
completeFieldName
|
2910
|
+
);
|
2854
2911
|
}) }, index2);
|
2855
2912
|
})
|
2856
2913
|
}
|
@@ -2945,7 +3002,7 @@ const Component = ({
|
|
2945
3002
|
/* @__PURE__ */ jsx(
|
2946
3003
|
IconButton,
|
2947
3004
|
{
|
2948
|
-
|
3005
|
+
variant: "ghost",
|
2949
3006
|
onClick: onDeleteComponent,
|
2950
3007
|
label: formatMessage({
|
2951
3008
|
id: getTranslation("containers.Edit.delete"),
|
@@ -2958,7 +3015,7 @@ const Component = ({
|
|
2958
3015
|
IconButton,
|
2959
3016
|
{
|
2960
3017
|
ref: composedAccordionRefs,
|
2961
|
-
|
3018
|
+
variant: "ghost",
|
2962
3019
|
onClick: (e) => e.stopPropagation(),
|
2963
3020
|
"data-handler-id": handlerId,
|
2964
3021
|
label: formatMessage({
|
@@ -3028,7 +3085,7 @@ const ComponentInput = ({
|
|
3028
3085
|
id: getTranslation("components.reset-entry"),
|
3029
3086
|
defaultMessage: "Reset Entry"
|
3030
3087
|
}),
|
3031
|
-
|
3088
|
+
variant: "ghost",
|
3032
3089
|
onClick: () => {
|
3033
3090
|
field.onChange(name2, null);
|
3034
3091
|
},
|
@@ -3057,11 +3114,8 @@ const AddComponentButton = ({
|
|
3057
3114
|
onClick,
|
3058
3115
|
disabled: isDisabled,
|
3059
3116
|
background: "neutral0",
|
3060
|
-
paddingTop: 3,
|
3061
|
-
paddingBottom: 3,
|
3062
|
-
paddingLeft: 4,
|
3063
|
-
paddingRight: 4,
|
3064
3117
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
3118
|
+
variant: "tertiary",
|
3065
3119
|
children: /* @__PURE__ */ jsxs(Flex, { tag: "span", gap: 2, children: [
|
3066
3120
|
/* @__PURE__ */ jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
3067
3121
|
/* @__PURE__ */ jsx(
|
@@ -3090,10 +3144,11 @@ const StyledAddIcon = styled(PlusCircle)`
|
|
3090
3144
|
}
|
3091
3145
|
`;
|
3092
3146
|
const AddComponentTitle = styled(Typography)``;
|
3093
|
-
const StyledButton = styled(
|
3147
|
+
const StyledButton = styled(Button)`
|
3094
3148
|
border-radius: 26px;
|
3095
3149
|
border-color: ${({ theme }) => theme.colors.neutral150};
|
3096
3150
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
3151
|
+
height: 5rem;
|
3097
3152
|
|
3098
3153
|
&:hover {
|
3099
3154
|
${AddComponentTitle} {
|
@@ -3105,7 +3160,7 @@ const StyledButton = styled(BaseButton)`
|
|
3105
3160
|
fill: ${({ theme }) => theme.colors.primary600};
|
3106
3161
|
}
|
3107
3162
|
> path {
|
3108
|
-
fill: ${({ theme }) => theme.colors.
|
3163
|
+
fill: ${({ theme }) => theme.colors.primary600};
|
3109
3164
|
}
|
3110
3165
|
}
|
3111
3166
|
}
|
@@ -3236,18 +3291,6 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3236
3291
|
/* @__PURE__ */ jsx(Field.Hint, {})
|
3237
3292
|
] });
|
3238
3293
|
};
|
3239
|
-
function useDebounce(value, delay) {
|
3240
|
-
const [debouncedValue, setDebouncedValue] = useState(value);
|
3241
|
-
useEffect(() => {
|
3242
|
-
const handler = setTimeout(() => {
|
3243
|
-
setDebouncedValue(value);
|
3244
|
-
}, delay);
|
3245
|
-
return () => {
|
3246
|
-
clearTimeout(handler);
|
3247
|
-
};
|
3248
|
-
}, [value, delay]);
|
3249
|
-
return debouncedValue;
|
3250
|
-
}
|
3251
3294
|
const uidApi = contentManagerApi.injectEndpoints({
|
3252
3295
|
endpoints: (builder) => ({
|
3253
3296
|
getDefaultUID: builder.query({
|
@@ -3282,7 +3325,10 @@ const uidApi = contentManagerApi.injectEndpoints({
|
|
3282
3325
|
config: {
|
3283
3326
|
params
|
3284
3327
|
}
|
3285
|
-
})
|
3328
|
+
}),
|
3329
|
+
providesTags: (_res, _error, params) => [
|
3330
|
+
{ type: "UidAvailability", id: params.contentTypeUID }
|
3331
|
+
]
|
3286
3332
|
})
|
3287
3333
|
})
|
3288
3334
|
});
|
@@ -3294,8 +3340,10 @@ const UIDInput = React.forwardRef(
|
|
3294
3340
|
const allFormValues = useForm("InputUID", (form) => form.values);
|
3295
3341
|
const [availability, setAvailability] = React.useState();
|
3296
3342
|
const [showRegenerate, setShowRegenerate] = React.useState(false);
|
3343
|
+
const isCloning = useMatch(CLONE_PATH) !== null;
|
3297
3344
|
const field = useField(name2);
|
3298
3345
|
const debouncedValue = useDebounce(field.value, 300);
|
3346
|
+
const hasChanged = debouncedValue !== field.initialValue;
|
3299
3347
|
const { toggleNotification } = useNotification();
|
3300
3348
|
const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
|
3301
3349
|
const { formatMessage } = useIntl();
|
@@ -3371,8 +3419,9 @@ const UIDInput = React.forwardRef(
|
|
3371
3419
|
params
|
3372
3420
|
},
|
3373
3421
|
{
|
3422
|
+
// Don't check availability if the value is empty or wasn't changed
|
3374
3423
|
skip: !Boolean(
|
3375
|
-
|
3424
|
+
(hasChanged || isCloning) && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3376
3425
|
)
|
3377
3426
|
}
|
3378
3427
|
);
|
@@ -3401,6 +3450,7 @@ const UIDInput = React.forwardRef(
|
|
3401
3450
|
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3402
3451
|
const fieldRef = useFocusInputField(name2);
|
3403
3452
|
const composedRefs = useComposedRefs(ref, fieldRef);
|
3453
|
+
const shouldShowAvailability = (hasChanged || isCloning) && debouncedValue != null && availability && !showRegenerate;
|
3404
3454
|
return /* @__PURE__ */ jsxs(Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3405
3455
|
/* @__PURE__ */ jsx(Field.Label, { action: labelAction, children: label }),
|
3406
3456
|
/* @__PURE__ */ jsx(
|
@@ -3409,7 +3459,7 @@ const UIDInput = React.forwardRef(
|
|
3409
3459
|
ref: composedRefs,
|
3410
3460
|
disabled: props.disabled,
|
3411
3461
|
endAction: /* @__PURE__ */ jsxs(Flex, { position: "relative", gap: 1, children: [
|
3412
|
-
|
3462
|
+
shouldShowAvailability && /* @__PURE__ */ jsxs(
|
3413
3463
|
TextValidation,
|
3414
3464
|
{
|
3415
3465
|
alignItems: "center",
|
@@ -4243,7 +4293,7 @@ const EditorLayout = ({
|
|
4243
4293
|
justifyContent: "flex-end",
|
4244
4294
|
shrink: 0,
|
4245
4295
|
width: "100%",
|
4246
|
-
children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, children: [
|
4296
|
+
children: /* @__PURE__ */ jsxs(ExpandButton$1, { onClick: onCollapse, variant: "tertiary", size: "M", children: [
|
4247
4297
|
/* @__PURE__ */ jsx(Typography, { children: formatMessage({
|
4248
4298
|
id: "components.Wysiwyg.collapse",
|
4249
4299
|
defaultMessage: "Collapse"
|
@@ -4261,12 +4311,14 @@ const EditorLayout = ({
|
|
4261
4311
|
) }) });
|
4262
4312
|
}
|
4263
4313
|
return /* @__PURE__ */ jsx(
|
4264
|
-
|
4314
|
+
Flex,
|
4265
4315
|
{
|
4266
4316
|
borderColor: error ? "danger600" : "neutral200",
|
4267
4317
|
borderStyle: "solid",
|
4268
4318
|
borderWidth: "1px",
|
4269
4319
|
hasRadius: true,
|
4320
|
+
direction: "column",
|
4321
|
+
alignItems: "stretch",
|
4270
4322
|
children
|
4271
4323
|
}
|
4272
4324
|
);
|
@@ -4277,11 +4329,19 @@ const ExpandWrapper = styled(Flex)`
|
|
4277
4329
|
const BoxWithBorder = styled(Box)`
|
4278
4330
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
4279
4331
|
`;
|
4280
|
-
const ExpandButton$1 = styled(
|
4332
|
+
const ExpandButton$1 = styled(Button)`
|
4281
4333
|
background-color: transparent;
|
4282
4334
|
border: none;
|
4283
4335
|
align-items: center;
|
4284
4336
|
|
4337
|
+
& > span {
|
4338
|
+
display: flex;
|
4339
|
+
justify-content: space-between;
|
4340
|
+
align-items: center;
|
4341
|
+
width: 100%;
|
4342
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4343
|
+
}
|
4344
|
+
|
4285
4345
|
svg {
|
4286
4346
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4287
4347
|
|
@@ -4548,40 +4608,28 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4548
4608
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4549
4609
|
}
|
4550
4610
|
};
|
4551
|
-
const CustomIconButton = styled(IconButton)`
|
4552
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4553
|
-
|
4554
|
-
svg {
|
4555
|
-
width: 1.8rem;
|
4556
|
-
height: 1.8rem;
|
4557
|
-
}
|
4558
|
-
`;
|
4559
|
-
const CustomLinkIconButton = styled(CustomIconButton)`
|
4560
|
-
svg {
|
4561
|
-
width: 0.8rem;
|
4562
|
-
height: 0.8rem;
|
4563
|
-
}
|
4564
|
-
`;
|
4565
4611
|
const MainButtons = styled(IconButtonGroup)`
|
4566
4612
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4567
4613
|
`;
|
4568
4614
|
const MoreButton = styled(IconButton)`
|
4569
4615
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4570
|
-
padding: ${({ theme }) => theme.spaces[2]};
|
4571
|
-
|
4572
|
-
svg {
|
4573
|
-
width: 1.8rem;
|
4574
|
-
height: 1.8rem;
|
4575
|
-
}
|
4576
4616
|
`;
|
4577
4617
|
const IconButtonGroupMargin = styled(IconButtonGroup)`
|
4578
4618
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4579
4619
|
`;
|
4580
|
-
const ExpandButton = styled(
|
4620
|
+
const ExpandButton = styled(Button)`
|
4581
4621
|
background-color: transparent;
|
4582
4622
|
border: none;
|
4583
4623
|
align-items: center;
|
4584
4624
|
|
4625
|
+
& > span {
|
4626
|
+
display: flex;
|
4627
|
+
justify-content: space-between;
|
4628
|
+
align-items: center;
|
4629
|
+
width: 100%;
|
4630
|
+
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
4631
|
+
}
|
4632
|
+
|
4585
4633
|
svg {
|
4586
4634
|
margin-left: ${({ theme }) => `${theme.spaces[2]}`};
|
4587
4635
|
path {
|
@@ -4593,7 +4641,7 @@ const ExpandButton = styled(BaseButton)`
|
|
4593
4641
|
`;
|
4594
4642
|
const WysiwygFooter = ({ onToggleExpand }) => {
|
4595
4643
|
const { formatMessage } = useIntl();
|
4596
|
-
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: [
|
4644
|
+
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: [
|
4597
4645
|
/* @__PURE__ */ jsx(Typography, { textColor: "neutral800", children: formatMessage({
|
4598
4646
|
id: "components.WysiwygBottomControls.fullscreen",
|
4599
4647
|
defaultMessage: "Expand"
|
@@ -4630,18 +4678,27 @@ const WysiwygNav = ({
|
|
4630
4678
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4631
4679
|
children: [
|
4632
4680
|
/* @__PURE__ */ jsxs(Flex, { children: [
|
4633
|
-
/* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
|
4634
|
-
|
4635
|
-
|
4636
|
-
|
4637
|
-
|
4638
|
-
|
4639
|
-
|
4640
|
-
|
4681
|
+
/* @__PURE__ */ jsx(Field.Root, { children: /* @__PURE__ */ jsxs(
|
4682
|
+
SingleSelect,
|
4683
|
+
{
|
4684
|
+
disabled: true,
|
4685
|
+
placeholder: selectPlaceholder,
|
4686
|
+
"aria-label": selectPlaceholder,
|
4687
|
+
size: "S",
|
4688
|
+
children: [
|
4689
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
|
4690
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
|
4691
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h3", children: "h3" }),
|
4692
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h4", children: "h4" }),
|
4693
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h5", children: "h5" }),
|
4694
|
+
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h6", children: "h6" })
|
4695
|
+
]
|
4696
|
+
}
|
4697
|
+
) }),
|
4641
4698
|
/* @__PURE__ */ jsxs(MainButtons, { children: [
|
4642
|
-
/* @__PURE__ */ jsx(
|
4643
|
-
/* @__PURE__ */ jsx(
|
4644
|
-
/* @__PURE__ */ jsx(
|
4699
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
|
4700
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsx(Italic, {}) }),
|
4701
|
+
/* @__PURE__ */ jsx(IconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsx(Underline, {}) })
|
4645
4702
|
] }),
|
4646
4703
|
/* @__PURE__ */ jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsx(More, {}) })
|
4647
4704
|
] }),
|
@@ -4668,6 +4725,7 @@ const WysiwygNav = ({
|
|
4668
4725
|
placeholder: selectPlaceholder,
|
4669
4726
|
"aria-label": selectPlaceholder,
|
4670
4727
|
onChange: (value) => onActionClick(value, editorRef),
|
4728
|
+
size: "S",
|
4671
4729
|
children: [
|
4672
4730
|
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h1", children: "h1" }),
|
4673
4731
|
/* @__PURE__ */ jsx(SingleSelectOption, { value: "h2", children: "h2" }),
|
@@ -4679,17 +4737,9 @@ const WysiwygNav = ({
|
|
4679
4737
|
}
|
4680
4738
|
) }),
|
4681
4739
|
/* @__PURE__ */ jsxs(MainButtons, { children: [
|
4740
|
+
/* @__PURE__ */ jsx(IconButton, { onClick: () => onActionClick("Bold", editorRef), label: "Bold", name: "Bold", children: /* @__PURE__ */ jsx(Bold, {}) }),
|
4682
4741
|
/* @__PURE__ */ jsx(
|
4683
|
-
|
4684
|
-
{
|
4685
|
-
onClick: () => onActionClick("Bold", editorRef),
|
4686
|
-
label: "Bold",
|
4687
|
-
name: "Bold",
|
4688
|
-
children: /* @__PURE__ */ jsx(Bold, {})
|
4689
|
-
}
|
4690
|
-
),
|
4691
|
-
/* @__PURE__ */ jsx(
|
4692
|
-
CustomIconButton,
|
4742
|
+
IconButton,
|
4693
4743
|
{
|
4694
4744
|
onClick: () => onActionClick("Italic", editorRef),
|
4695
4745
|
label: "Italic",
|
@@ -4698,7 +4748,7 @@ const WysiwygNav = ({
|
|
4698
4748
|
}
|
4699
4749
|
),
|
4700
4750
|
/* @__PURE__ */ jsx(
|
4701
|
-
|
4751
|
+
IconButton,
|
4702
4752
|
{
|
4703
4753
|
onClick: () => onActionClick("Underline", editorRef),
|
4704
4754
|
label: "Underline",
|
@@ -4712,7 +4762,7 @@ const WysiwygNav = ({
|
|
4712
4762
|
/* @__PURE__ */ jsx(Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxs(Flex, { padding: 2, children: [
|
4713
4763
|
/* @__PURE__ */ jsxs(IconButtonGroupMargin, { children: [
|
4714
4764
|
/* @__PURE__ */ jsx(
|
4715
|
-
|
4765
|
+
IconButton,
|
4716
4766
|
{
|
4717
4767
|
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4718
4768
|
label: "Strikethrough",
|
@@ -4721,7 +4771,7 @@ const WysiwygNav = ({
|
|
4721
4771
|
}
|
4722
4772
|
),
|
4723
4773
|
/* @__PURE__ */ jsx(
|
4724
|
-
|
4774
|
+
IconButton,
|
4725
4775
|
{
|
4726
4776
|
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4727
4777
|
label: "BulletList",
|
@@ -4730,7 +4780,7 @@ const WysiwygNav = ({
|
|
4730
4780
|
}
|
4731
4781
|
),
|
4732
4782
|
/* @__PURE__ */ jsx(
|
4733
|
-
|
4783
|
+
IconButton,
|
4734
4784
|
{
|
4735
4785
|
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4736
4786
|
label: "NumberList",
|
@@ -4741,7 +4791,7 @@ const WysiwygNav = ({
|
|
4741
4791
|
] }),
|
4742
4792
|
/* @__PURE__ */ jsxs(IconButtonGroup, { children: [
|
4743
4793
|
/* @__PURE__ */ jsx(
|
4744
|
-
|
4794
|
+
IconButton,
|
4745
4795
|
{
|
4746
4796
|
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4747
4797
|
label: "Code",
|
@@ -4750,7 +4800,7 @@ const WysiwygNav = ({
|
|
4750
4800
|
}
|
4751
4801
|
),
|
4752
4802
|
/* @__PURE__ */ jsx(
|
4753
|
-
|
4803
|
+
IconButton,
|
4754
4804
|
{
|
4755
4805
|
onClick: () => {
|
4756
4806
|
handleTogglePopover();
|
@@ -4762,7 +4812,7 @@ const WysiwygNav = ({
|
|
4762
4812
|
}
|
4763
4813
|
),
|
4764
4814
|
/* @__PURE__ */ jsx(
|
4765
|
-
|
4815
|
+
IconButton,
|
4766
4816
|
{
|
4767
4817
|
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4768
4818
|
label: "Link",
|
@@ -4771,7 +4821,7 @@ const WysiwygNav = ({
|
|
4771
4821
|
}
|
4772
4822
|
),
|
4773
4823
|
/* @__PURE__ */ jsx(
|
4774
|
-
|
4824
|
+
IconButton,
|
4775
4825
|
{
|
4776
4826
|
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4777
4827
|
label: "Quote",
|
@@ -4908,15 +4958,19 @@ const Wysiwyg = React.forwardRef(
|
|
4908
4958
|
);
|
4909
4959
|
const MemoizedWysiwyg = React.memo(Wysiwyg);
|
4910
4960
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4911
|
-
const { id } = useDoc();
|
4961
|
+
const { id, document: document2, collectionType } = useDoc();
|
4912
4962
|
const isFormDisabled = useForm("InputRenderer", (state) => state.disabled);
|
4913
4963
|
const isInDynamicZone = useDynamicZone("isInDynamicZone", (state) => state.isInDynamicZone);
|
4914
4964
|
const canCreateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canCreateFields);
|
4915
4965
|
const canReadFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canReadFields);
|
4916
4966
|
const canUpdateFields = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUpdateFields);
|
4917
4967
|
const canUserAction = useDocumentRBAC("InputRenderer", (rbac) => rbac.canUserAction);
|
4918
|
-
|
4919
|
-
|
4968
|
+
let idToCheck = id;
|
4969
|
+
if (collectionType === SINGLE_TYPES) {
|
4970
|
+
idToCheck = document2?.documentId;
|
4971
|
+
}
|
4972
|
+
const editableFields = idToCheck ? canUpdateFields : canCreateFields;
|
4973
|
+
const readableFields = idToCheck ? canReadFields : canCreateFields;
|
4920
4974
|
const canUserReadField = canUserAction(props.name, readableFields, props.type);
|
4921
4975
|
const canUserEditField = canUserAction(props.name, editableFields, props.type);
|
4922
4976
|
const fields = useStrapiApp("InputRenderer", (app) => app.fields);
|
@@ -4927,6 +4981,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4927
4981
|
const {
|
4928
4982
|
edit: { components }
|
4929
4983
|
} = useDocLayout();
|
4984
|
+
const field = useField(props.name);
|
4930
4985
|
if (!visible) {
|
4931
4986
|
return null;
|
4932
4987
|
}
|
@@ -4937,7 +4992,7 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4937
4992
|
if (attributeHasCustomFieldProperty(props.attribute)) {
|
4938
4993
|
const CustomInput = lazyComponentStore[props.attribute.customField];
|
4939
4994
|
if (CustomInput) {
|
4940
|
-
return /* @__PURE__ */ jsx(CustomInput, { ...props, hint, disabled: fieldIsDisabled });
|
4995
|
+
return /* @__PURE__ */ jsx(CustomInput, { ...props, ...field, hint, disabled: fieldIsDisabled });
|
4941
4996
|
}
|
4942
4997
|
return /* @__PURE__ */ jsx(
|
4943
4998
|
InputRenderer$1,
|
@@ -5098,12 +5153,20 @@ const DynamicComponent = ({
|
|
5098
5153
|
React.useEffect(() => {
|
5099
5154
|
dragPreviewRef(getEmptyImage(), { captureDraggingState: false });
|
5100
5155
|
}, [dragPreviewRef, index]);
|
5156
|
+
const accordionValue = React.useId();
|
5157
|
+
const { value = [], rawError } = useField(`${name2}.${index}`);
|
5158
|
+
const [collapseToOpen, setCollapseToOpen] = React.useState("");
|
5159
|
+
React.useEffect(() => {
|
5160
|
+
if (rawError && value) {
|
5161
|
+
setCollapseToOpen(accordionValue);
|
5162
|
+
}
|
5163
|
+
}, [rawError, value, accordionValue]);
|
5101
5164
|
const composedBoxRefs = useComposedRefs(boxRef, dropRef);
|
5102
5165
|
const accordionActions = disabled ? null : /* @__PURE__ */ jsxs(Fragment, { children: [
|
5103
5166
|
/* @__PURE__ */ jsx(
|
5104
5167
|
IconButton,
|
5105
5168
|
{
|
5106
|
-
|
5169
|
+
variant: "ghost",
|
5107
5170
|
label: formatMessage(
|
5108
5171
|
{
|
5109
5172
|
id: getTranslation("components.DynamicZone.delete-label"),
|
@@ -5118,7 +5181,7 @@ const DynamicComponent = ({
|
|
5118
5181
|
/* @__PURE__ */ jsx(
|
5119
5182
|
IconButton,
|
5120
5183
|
{
|
5121
|
-
|
5184
|
+
variant: "ghost",
|
5122
5185
|
onClick: (e) => e.stopPropagation(),
|
5123
5186
|
"data-handler-id": handlerId,
|
5124
5187
|
ref: dragRef,
|
@@ -5163,10 +5226,9 @@ const DynamicComponent = ({
|
|
5163
5226
|
] })
|
5164
5227
|
] });
|
5165
5228
|
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
5166
|
-
const accordionValue = React.useId();
|
5167
5229
|
return /* @__PURE__ */ jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5168
5230
|
/* @__PURE__ */ jsx(Flex, { justifyContent: "center", children: /* @__PURE__ */ jsx(Rectangle, { background: "neutral200" }) }),
|
5169
|
-
/* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
|
5231
|
+
/* @__PURE__ */ jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsx(Preview, {}) : /* @__PURE__ */ jsx(Accordion.Root, { value: collapseToOpen, onValueChange: setCollapseToOpen, children: /* @__PURE__ */ jsxs(Accordion.Item, { value: accordionValue, children: [
|
5170
5232
|
/* @__PURE__ */ jsxs(Accordion.Header, { children: [
|
5171
5233
|
/* @__PURE__ */ jsx(
|
5172
5234
|
Accordion.Trigger,
|
@@ -5177,10 +5239,39 @@ const DynamicComponent = ({
|
|
5177
5239
|
),
|
5178
5240
|
/* @__PURE__ */ jsx(Accordion.Actions, { children: accordionActions })
|
5179
5241
|
] }),
|
5180
|
-
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children:
|
5181
|
-
|
5182
|
-
|
5183
|
-
|
5242
|
+
/* @__PURE__ */ jsx(Accordion.Content, { children: /* @__PURE__ */ jsx(AccordionContentRadius, { background: "neutral0", children: /* @__PURE__ */ jsx(Box, { paddingLeft: 6, paddingRight: 6, paddingTop: 6, paddingBottom: 6, children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: components[componentUid]?.layout?.map((row, rowInd) => /* @__PURE__ */ jsx(
|
5243
|
+
Grid$1.Item,
|
5244
|
+
{
|
5245
|
+
col: 12,
|
5246
|
+
s: 12,
|
5247
|
+
xs: 12,
|
5248
|
+
direction: "column",
|
5249
|
+
alignItems: "stretch",
|
5250
|
+
children: /* @__PURE__ */ jsx(Grid$1.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
5251
|
+
const fieldName = `${name2}.${index}.${field.name}`;
|
5252
|
+
const fieldWithTranslatedLabel = {
|
5253
|
+
...field,
|
5254
|
+
label: formatMessage({
|
5255
|
+
id: `content-manager.components.${componentUid}.${field.name}`,
|
5256
|
+
defaultMessage: field.label
|
5257
|
+
})
|
5258
|
+
};
|
5259
|
+
return /* @__PURE__ */ jsx(
|
5260
|
+
Grid$1.Item,
|
5261
|
+
{
|
5262
|
+
col: size,
|
5263
|
+
s: 12,
|
5264
|
+
xs: 12,
|
5265
|
+
direction: "column",
|
5266
|
+
alignItems: "stretch",
|
5267
|
+
children: /* @__PURE__ */ jsx(MemoizedInputRenderer, { ...fieldWithTranslatedLabel, name: fieldName })
|
5268
|
+
},
|
5269
|
+
fieldName
|
5270
|
+
);
|
5271
|
+
}) })
|
5272
|
+
},
|
5273
|
+
rowInd
|
5274
|
+
)) }) }) }) })
|
5184
5275
|
] }) }) })
|
5185
5276
|
] });
|
5186
5277
|
};
|
@@ -5488,4 +5579,4 @@ export {
|
|
5488
5579
|
transformDocument as t,
|
5489
5580
|
useLazyComponents as u
|
5490
5581
|
};
|
5491
|
-
//# sourceMappingURL=Field-
|
5582
|
+
//# sourceMappingURL=Field-DcKuFHYK.mjs.map
|