@strapi/content-manager 0.0.0-experimental.17b4116f461a49b8ce5386f7c8d79c511d40fb3b → 0.0.0-experimental.25e22c6cc9bc6b35392bb55d09f641a0a65e7403
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/{CardDragPreview-DSVYodBX.js → CardDragPreview-C0QyJgRA.js} +10 -14
- package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -0
- package/dist/_chunks/{CardDragPreview-ikSG4M46.mjs → CardDragPreview-DOxamsuj.mjs} +7 -9
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -0
- package/dist/_chunks/{ComponentConfigurationPage-2iOVVhqV.js → ComponentConfigurationPage-WRPUXGd6.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-2iOVVhqV.js.map → ComponentConfigurationPage-WRPUXGd6.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-DjQBdcKF.mjs → ComponentConfigurationPage-gdUj_t-O.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DjQBdcKF.mjs.map → ComponentConfigurationPage-gdUj_t-O.mjs.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BBQsYCVn.js → ComponentIcon-BXdiCGQp.js} +8 -2
- package/dist/_chunks/ComponentIcon-BXdiCGQp.js.map +1 -0
- package/dist/_chunks/{ComponentIcon-BOFnK76n.mjs → ComponentIcon-u4bIXTFY.mjs} +9 -3
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -0
- package/dist/_chunks/{EditConfigurationPage-BoBb-DLH.mjs → EditConfigurationPage-BwuIPOJG.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BoBb-DLH.mjs.map → EditConfigurationPage-BwuIPOJG.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-B7dw5_cS.js → EditConfigurationPage-C1vjMBgy.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-B7dw5_cS.js.map → EditConfigurationPage-C1vjMBgy.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-aUnqL-63.mjs → EditViewPage-0MiFkXa8.mjs} +47 -47
- package/dist/_chunks/EditViewPage-0MiFkXa8.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-KRG56aCq.js → EditViewPage-DbcGfyqK.js} +46 -48
- package/dist/_chunks/EditViewPage-DbcGfyqK.js.map +1 -0
- package/dist/_chunks/{Field-kVFO4ZKB.mjs → Field-BDMSCcy5.mjs} +585 -705
- package/dist/_chunks/Field-BDMSCcy5.mjs.map +1 -0
- package/dist/_chunks/{Field-kq1c2TF1.js → Field-BG1xu38N.js} +637 -758
- package/dist/_chunks/Field-BG1xu38N.js.map +1 -0
- package/dist/_chunks/{Form-CQ67ZifP.js → Form-9BnFyUjy.js} +35 -37
- package/dist/_chunks/Form-9BnFyUjy.js.map +1 -0
- package/dist/_chunks/{Form-Jgh5hGTu.mjs → Form-CPVWavB8.mjs} +35 -36
- package/dist/_chunks/Form-CPVWavB8.mjs.map +1 -0
- package/dist/_chunks/{History-DKhZAPcK.mjs → History-BVpd8LP3.mjs} +121 -48
- package/dist/_chunks/History-BVpd8LP3.mjs.map +1 -0
- package/dist/_chunks/{History-BLEnudTX.js → History-BWWxLt2Z.js} +122 -50
- package/dist/_chunks/History-BWWxLt2Z.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-Zso_LUjn.js → ListConfigurationPage-6swzjdAZ.js} +53 -56
- package/dist/_chunks/ListConfigurationPage-6swzjdAZ.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-nrXcxNYi.mjs → ListConfigurationPage-DozVMKcR.mjs} +49 -51
- package/dist/_chunks/ListConfigurationPage-DozVMKcR.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-DsaOakWQ.js → ListViewPage-BlzfjS2Q.js} +80 -105
- package/dist/_chunks/ListViewPage-BlzfjS2Q.js.map +1 -0
- package/dist/_chunks/{ListViewPage-ChhYmA-L.mjs → ListViewPage-Ds0ulgfG.mjs} +75 -100
- package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-BrdFcN33.mjs → NoContentTypePage-BH11kaKt.mjs} +3 -3
- package/dist/_chunks/NoContentTypePage-BH11kaKt.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-DPCuS9Y1.js → NoContentTypePage-D2nCCWEl.js} +3 -3
- package/dist/_chunks/NoContentTypePage-D2nCCWEl.js.map +1 -0
- package/dist/_chunks/{NoPermissionsPage-B9dqrtTy.mjs → NoPermissionsPage-BT2Tn0D_.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B9dqrtTy.mjs.map → NoPermissionsPage-BT2Tn0D_.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DdyOfdKb.js → NoPermissionsPage-DN_JlsU2.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DdyOfdKb.js.map → NoPermissionsPage-DN_JlsU2.js.map} +1 -1
- package/dist/_chunks/{Relations-CY8Isqdu.js → Relations-CcgFTcWo.js} +70 -61
- package/dist/_chunks/Relations-CcgFTcWo.js.map +1 -0
- package/dist/_chunks/{Relations-DjFiYd7-.mjs → Relations-Dnag3fhV.mjs} +66 -56
- package/dist/_chunks/Relations-Dnag3fhV.mjs.map +1 -0
- package/dist/_chunks/{en-MBPul9Su.mjs → en-Ux26r5pl.mjs} +7 -1
- package/dist/_chunks/{en-MBPul9Su.mjs.map → en-Ux26r5pl.mjs.map} +1 -1
- package/dist/_chunks/{en-C-V1_90f.js → en-fbKQxLGn.js} +7 -1
- package/dist/_chunks/{en-C-V1_90f.js.map → en-fbKQxLGn.js.map} +1 -1
- package/dist/_chunks/{index-DNa1J4HE.js → index-CWpLBSt0.js} +1391 -808
- package/dist/_chunks/index-CWpLBSt0.js.map +1 -0
- package/dist/_chunks/{index-CAc9yTnx.mjs → index-JNNNKUHs.mjs} +1465 -881
- package/dist/_chunks/index-JNNNKUHs.mjs.map +1 -0
- package/dist/_chunks/{layout-BqtLA6Lb.js → layout--iHdZzRk.js} +26 -23
- package/dist/_chunks/layout--iHdZzRk.js.map +1 -0
- package/dist/_chunks/{layout-CXsHbc3E.mjs → layout-DC503LnF.mjs} +24 -19
- package/dist/_chunks/layout-DC503LnF.mjs.map +1 -0
- package/dist/_chunks/{relations-BHY_KDJ_.js → relations-BbHizA5K.js} +2 -2
- package/dist/_chunks/{relations-BHY_KDJ_.js.map → relations-BbHizA5K.js.map} +1 -1
- package/dist/_chunks/{relations-mMFEcZRq.mjs → relations-CTje5t-a.mjs} +2 -2
- package/dist/_chunks/{relations-mMFEcZRq.mjs.map → relations-CTje5t-a.mjs.map} +1 -1
- package/dist/_chunks/useDragAndDrop-DdHgKsqq.mjs.map +1 -1
- package/dist/_chunks/useDragAndDrop-J0TUUbR6.js.map +1 -1
- package/dist/_chunks/usePrev-B9w_-eYc.js +15 -0
- package/dist/_chunks/usePrev-B9w_-eYc.js.map +1 -0
- package/dist/_chunks/usePrev-DH6iah0A.mjs +16 -0
- package/dist/_chunks/usePrev-DH6iah0A.mjs.map +1 -0
- package/dist/admin/index.js +2 -1
- package/dist/admin/index.js.map +1 -1
- package/dist/admin/index.mjs +8 -7
- package/dist/admin/src/components/ComponentIcon.d.ts +6 -3
- package/dist/admin/src/content-manager.d.ts +3 -3
- package/dist/admin/src/exports.d.ts +1 -0
- package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
- package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
- package/dist/admin/src/hooks/useDocument.d.ts +5 -8
- package/dist/admin/src/hooks/useDocumentActions.d.ts +24 -3
- package/dist/admin/src/hooks/useDocumentLayout.d.ts +2 -2
- package/dist/admin/src/hooks/useDragAndDrop.d.ts +4 -4
- package/dist/admin/src/hooks/useKeyboardDragAndDrop.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +10 -4
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/BlocksInput.d.ts +3 -3
- package/dist/admin/src/pages/EditView/components/FormInputs/Component/Input.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/ComponentCategory.d.ts +3 -5
- package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +10 -18
- package/dist/admin/src/pages/EditView/components/FormInputs/UID.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/EditorLayout.d.ts +3 -49
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/Field.d.ts +2 -2
- package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +59 -52
- package/dist/admin/src/pages/EditView/components/InputRenderer.d.ts +2 -10
- package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
- package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
- package/dist/admin/src/pages/ListView/components/BulkActions/PublishAction.d.ts +9 -26
- package/dist/admin/src/services/api.d.ts +2 -3
- package/dist/admin/src/services/components.d.ts +2 -2
- package/dist/admin/src/services/contentTypes.d.ts +5 -5
- package/dist/admin/src/services/documents.d.ts +29 -17
- package/dist/admin/src/services/init.d.ts +2 -2
- package/dist/admin/src/services/relations.d.ts +3 -3
- package/dist/admin/src/services/uid.d.ts +3 -3
- package/dist/admin/src/utils/api.d.ts +4 -18
- package/dist/admin/src/utils/validation.d.ts +1 -6
- package/dist/server/index.js +285 -197
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +287 -199
- 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/single-types.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +8 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts +9 -0
- package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -0
- package/dist/server/src/controllers/validation/index.d.ts +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/index.d.ts +17 -33
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts +11 -6
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +8 -29
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +17 -33
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/utils/populate.d.ts +8 -1
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/dist/shared/contracts/collection-types.d.ts +14 -6
- package/dist/shared/contracts/collection-types.d.ts.map +1 -1
- package/dist/shared/contracts/relations.d.ts +2 -2
- package/dist/shared/contracts/relations.d.ts.map +1 -1
- package/package.json +13 -14
- package/dist/_chunks/CardDragPreview-DSVYodBX.js.map +0 -1
- package/dist/_chunks/CardDragPreview-ikSG4M46.mjs.map +0 -1
- package/dist/_chunks/ComponentIcon-BBQsYCVn.js.map +0 -1
- package/dist/_chunks/ComponentIcon-BOFnK76n.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-KRG56aCq.js.map +0 -1
- package/dist/_chunks/EditViewPage-aUnqL-63.mjs.map +0 -1
- package/dist/_chunks/Field-kVFO4ZKB.mjs.map +0 -1
- package/dist/_chunks/Field-kq1c2TF1.js.map +0 -1
- package/dist/_chunks/Form-CQ67ZifP.js.map +0 -1
- package/dist/_chunks/Form-Jgh5hGTu.mjs.map +0 -1
- package/dist/_chunks/History-BLEnudTX.js.map +0 -1
- package/dist/_chunks/History-DKhZAPcK.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-Zso_LUjn.js.map +0 -1
- package/dist/_chunks/ListConfigurationPage-nrXcxNYi.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-ChhYmA-L.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-DsaOakWQ.js.map +0 -1
- package/dist/_chunks/NoContentTypePage-BrdFcN33.mjs.map +0 -1
- package/dist/_chunks/NoContentTypePage-DPCuS9Y1.js.map +0 -1
- package/dist/_chunks/Relations-CY8Isqdu.js.map +0 -1
- package/dist/_chunks/Relations-DjFiYd7-.mjs.map +0 -1
- package/dist/_chunks/index-CAc9yTnx.mjs.map +0 -1
- package/dist/_chunks/index-DNa1J4HE.js.map +0 -1
- package/dist/_chunks/layout-BqtLA6Lb.js.map +0 -1
- package/dist/_chunks/layout-CXsHbc3E.mjs.map +0 -1
- package/dist/_chunks/urls-CbOsUOoW.mjs +0 -7
- package/dist/_chunks/urls-CbOsUOoW.mjs.map +0 -1
- package/dist/_chunks/urls-DzZya_gm.js +0 -6
- package/dist/_chunks/urls-DzZya_gm.js.map +0 -1
- package/dist/server/src/controllers/utils/dimensions.d.ts +0 -5
- package/dist/server/src/controllers/utils/dimensions.d.ts.map +0 -1
@@ -5,19 +5,19 @@ const strapiAdmin = require("@strapi/admin/strapi-admin");
|
|
5
5
|
const designSystem = require("@strapi/design-system");
|
6
6
|
const pipe$1 = require("lodash/fp/pipe");
|
7
7
|
const reactIntl = require("react-intl");
|
8
|
-
const index = require("./index-
|
8
|
+
const index = require("./index-CWpLBSt0.js");
|
9
9
|
const fractionalIndexing = require("fractional-indexing");
|
10
|
-
const Relations = require("./Relations-
|
10
|
+
const Relations = require("./Relations-CcgFTcWo.js");
|
11
11
|
const Icons = require("@strapi/icons");
|
12
|
-
const
|
13
|
-
const ComponentIcon = require("./ComponentIcon-
|
12
|
+
const styledComponents = require("styled-components");
|
13
|
+
const ComponentIcon = require("./ComponentIcon-BXdiCGQp.js");
|
14
14
|
const reactDndHtml5Backend = require("react-dnd-html5-backend");
|
15
15
|
const useDragAndDrop = require("./useDragAndDrop-J0TUUbR6.js");
|
16
16
|
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 usePrev = require("./usePrev-B9w_-eYc.js");
|
21
21
|
const Toolbar = require("@radix-ui/react-toolbar");
|
22
22
|
const reactRouterDom = require("react-router-dom");
|
23
23
|
const CodeMirror = require("codemirror5");
|
@@ -56,7 +56,6 @@ function _interopNamespace(e) {
|
|
56
56
|
}
|
57
57
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
58
58
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe$1);
|
59
|
-
const styled__default = /* @__PURE__ */ _interopDefault(styled);
|
60
59
|
const Toolbar__namespace = /* @__PURE__ */ _interopNamespace(Toolbar);
|
61
60
|
const CodeMirror__default = /* @__PURE__ */ _interopDefault(CodeMirror);
|
62
61
|
const sanitizeHtml__default = /* @__PURE__ */ _interopDefault(sanitizeHtml);
|
@@ -258,7 +257,7 @@ const pressEnterTwiceToExit = (editor) => {
|
|
258
257
|
});
|
259
258
|
}
|
260
259
|
};
|
261
|
-
const CodeBlock =
|
260
|
+
const CodeBlock = styledComponents.styled.pre`
|
262
261
|
border-radius: ${({ theme }) => theme.borderRadius};
|
263
262
|
background-color: ${({ theme }) => theme.colors.neutral100};
|
264
263
|
max-width: 100%;
|
@@ -293,27 +292,27 @@ const codeBlocks = {
|
|
293
292
|
dragHandleTopMargin: "10px"
|
294
293
|
}
|
295
294
|
};
|
296
|
-
const H1 =
|
295
|
+
const H1 = styledComponents.styled(designSystem.Typography).attrs({ tag: "h1" })`
|
297
296
|
font-size: 4.2rem;
|
298
297
|
line-height: ${({ theme }) => theme.lineHeights[1]};
|
299
298
|
`;
|
300
|
-
const H2 =
|
299
|
+
const H2 = styledComponents.styled(designSystem.Typography).attrs({ tag: "h2" })`
|
301
300
|
font-size: 3.5rem;
|
302
301
|
line-height: ${({ theme }) => theme.lineHeights[1]};
|
303
302
|
`;
|
304
|
-
const H3 =
|
303
|
+
const H3 = styledComponents.styled(designSystem.Typography).attrs({ tag: "h3" })`
|
305
304
|
font-size: 2.9rem;
|
306
305
|
line-height: ${({ theme }) => theme.lineHeights[1]};
|
307
306
|
`;
|
308
|
-
const H4 =
|
307
|
+
const H4 = styledComponents.styled(designSystem.Typography).attrs({ tag: "h4" })`
|
309
308
|
font-size: 2.4rem;
|
310
309
|
line-height: ${({ theme }) => theme.lineHeights[1]};
|
311
310
|
`;
|
312
|
-
const H5 =
|
311
|
+
const H5 = styledComponents.styled(designSystem.Typography).attrs({ tag: "h5" })`
|
313
312
|
font-size: 2rem;
|
314
313
|
line-height: ${({ theme }) => theme.lineHeights[1]};
|
315
314
|
`;
|
316
|
-
const H6 =
|
315
|
+
const H6 = styledComponents.styled(designSystem.Typography).attrs({ tag: "h6" })`
|
317
316
|
font-size: 1.6rem;
|
318
317
|
line-height: ${({ theme }) => theme.lineHeights[1]};
|
319
318
|
`;
|
@@ -399,10 +398,10 @@ const headingBlocks = {
|
|
399
398
|
dragHandleTopMargin: "-2px"
|
400
399
|
}
|
401
400
|
};
|
402
|
-
const ImageWrapper =
|
401
|
+
const ImageWrapper = styledComponents.styled(designSystem.Flex)`
|
403
402
|
transition-property: box-shadow;
|
404
403
|
transition-duration: 0.2s;
|
405
|
-
${(props) => props
|
404
|
+
${(props) => props.$isFocused && styledComponents.css`
|
406
405
|
box-shadow: ${props.theme.colors.primary600} 0px 0px 0px 3px;
|
407
406
|
`}
|
408
407
|
|
@@ -454,7 +453,7 @@ const Image = ({ attributes, children, element }) => {
|
|
454
453
|
background: "neutral100",
|
455
454
|
contentEditable: false,
|
456
455
|
justifyContent: "center",
|
457
|
-
isFocused: editorIsFocused && imageIsSelected,
|
456
|
+
$isFocused: editorIsFocused && imageIsSelected,
|
458
457
|
hasRadius: true,
|
459
458
|
children: /* @__PURE__ */ jsxRuntime.jsx("img", { src: url, alt: alternativeText, width, height })
|
460
459
|
}
|
@@ -502,7 +501,7 @@ const ImageDialog = () => {
|
|
502
501
|
const nodeImage = {
|
503
502
|
...expectedImage,
|
504
503
|
alternativeText: expectedImage.alternativeText || expectedImage.name,
|
505
|
-
url:
|
504
|
+
url: usePrev.prefixFileUrlWithBackendUrl(image.url)
|
506
505
|
};
|
507
506
|
return nodeImage;
|
508
507
|
});
|
@@ -610,11 +609,11 @@ const isLinkNode = (element) => {
|
|
610
609
|
const isListNode$1 = (element) => {
|
611
610
|
return element.type === "list";
|
612
611
|
};
|
613
|
-
const StyledBaseLink =
|
612
|
+
const StyledBaseLink = styledComponents.styled(designSystem.BaseLink)`
|
614
613
|
text-decoration: none;
|
615
614
|
`;
|
616
|
-
const RemoveButton =
|
617
|
-
visibility: ${(props) => props
|
615
|
+
const RemoveButton = styledComponents.styled(designSystem.Button)`
|
616
|
+
visibility: ${(props) => props.$visible ? "visible" : "hidden"};
|
618
617
|
`;
|
619
618
|
const LinkContent = React__namespace.forwardRef(
|
620
619
|
({ link, children, attributes }, forwardedRef) => {
|
@@ -624,17 +623,23 @@ const LinkContent = React__namespace.forwardRef(
|
|
624
623
|
const [popoverOpen, setPopoverOpen] = React__namespace.useState(
|
625
624
|
editor.lastInsertedLinkPath ? slate.Path.equals(path, editor.lastInsertedLinkPath) : false
|
626
625
|
);
|
627
|
-
const linkRef = React__namespace.useRef(null);
|
628
626
|
const elementText = link.children.map((child) => child.text).join("");
|
629
627
|
const [linkText, setLinkText] = React__namespace.useState(elementText);
|
630
628
|
const [linkUrl, setLinkUrl] = React__namespace.useState(link.url);
|
631
629
|
const linkInputRef = React__namespace.useRef(null);
|
632
630
|
const [showRemoveButton, setShowRemoveButton] = React__namespace.useState(false);
|
633
631
|
const [isSaveDisabled, setIsSaveDisabled] = React__namespace.useState(false);
|
634
|
-
const
|
635
|
-
|
636
|
-
|
637
|
-
|
632
|
+
const handleOpenChange = (isOpen) => {
|
633
|
+
if (isOpen) {
|
634
|
+
setPopoverOpen(isOpen);
|
635
|
+
setShowRemoveButton(isOpen);
|
636
|
+
} else {
|
637
|
+
setPopoverOpen(isOpen);
|
638
|
+
if (link.url === "") {
|
639
|
+
removeLink(editor);
|
640
|
+
}
|
641
|
+
slateReact.ReactEditor.focus(editor);
|
642
|
+
}
|
638
643
|
};
|
639
644
|
const onLinkChange = (e) => {
|
640
645
|
setIsSaveDisabled(false);
|
@@ -657,39 +662,21 @@ const LinkContent = React__namespace.forwardRef(
|
|
657
662
|
setPopoverOpen(false);
|
658
663
|
editor.lastInsertedLinkPath = null;
|
659
664
|
};
|
660
|
-
const handleDismiss = () => {
|
661
|
-
setPopoverOpen(false);
|
662
|
-
if (link.url === "") {
|
663
|
-
removeLink(editor);
|
664
|
-
}
|
665
|
-
slateReact.ReactEditor.focus(editor);
|
666
|
-
};
|
667
|
-
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
668
|
-
const composedRefs = designSystem.useComposedRefs(linkRef, forwardedRef);
|
669
665
|
React__namespace.useEffect(() => {
|
670
666
|
if (popoverOpen)
|
671
667
|
linkInputRef.current?.focus();
|
672
668
|
}, [popoverOpen]);
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
href: link.url,
|
680
|
-
onClick: handleOpenEditPopover,
|
681
|
-
color: "primary600",
|
682
|
-
children
|
683
|
-
}
|
684
|
-
),
|
685
|
-
popoverOpen && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover, { source: linkRef, onDismiss: handleDismiss, padding: 4, contentEditable: false, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { as: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
|
686
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
|
687
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.FieldLabel, { children: formatMessage({
|
669
|
+
const inputNotDirty = !linkText || !linkUrl || link.url && link.url === linkUrl && elementText && elementText === linkText;
|
670
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { onOpenChange: handleOpenChange, open: popoverOpen, children: [
|
671
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(StyledBaseLink, { ...attributes, ref: forwardedRef, href: link.url, color: "primary600", children }) }),
|
672
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, tag: "form", onSubmit: handleSave, direction: "column", gap: 4, children: [
|
673
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
|
674
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
688
675
|
id: "components.Blocks.popover.text",
|
689
676
|
defaultMessage: "Text"
|
690
677
|
}) }),
|
691
678
|
/* @__PURE__ */ jsxRuntime.jsx(
|
692
|
-
designSystem.
|
679
|
+
designSystem.Field.Input,
|
693
680
|
{
|
694
681
|
name: "text",
|
695
682
|
placeholder: formatMessage({
|
@@ -703,13 +690,13 @@ const LinkContent = React__namespace.forwardRef(
|
|
703
690
|
}
|
704
691
|
)
|
705
692
|
] }) }),
|
706
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
|
707
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
693
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { width: "368px", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "stretch", children: [
|
694
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
|
708
695
|
id: "components.Blocks.popover.link",
|
709
696
|
defaultMessage: "Link"
|
710
697
|
}) }),
|
711
698
|
/* @__PURE__ */ jsxRuntime.jsx(
|
712
|
-
designSystem.
|
699
|
+
designSystem.Field.Input,
|
713
700
|
{
|
714
701
|
ref: linkInputRef,
|
715
702
|
name: "url",
|
@@ -728,7 +715,7 @@ const LinkContent = React__namespace.forwardRef(
|
|
728
715
|
{
|
729
716
|
variant: "danger-light",
|
730
717
|
onClick: () => removeLink(editor),
|
731
|
-
visible: showRemoveButton,
|
718
|
+
$visible: showRemoveButton,
|
732
719
|
children: formatMessage({
|
733
720
|
id: "components.Blocks.popover.remove",
|
734
721
|
defaultMessage: "Remove"
|
@@ -736,7 +723,7 @@ const LinkContent = React__namespace.forwardRef(
|
|
736
723
|
}
|
737
724
|
),
|
738
725
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
|
739
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick:
|
726
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", onClick: () => handleOpenChange(false), children: formatMessage({
|
740
727
|
id: "components.Blocks.popover.cancel",
|
741
728
|
defaultMessage: "Cancel"
|
742
729
|
}) }),
|
@@ -764,7 +751,7 @@ const linkBlocks = {
|
|
764
751
|
isInBlocksSelector: false
|
765
752
|
}
|
766
753
|
};
|
767
|
-
const listStyle =
|
754
|
+
const listStyle = styledComponents.css`
|
768
755
|
display: flex;
|
769
756
|
flex-direction: column;
|
770
757
|
gap: ${({ theme }) => theme.spaces[2]};
|
@@ -782,12 +769,12 @@ const listStyle = styled.css`
|
|
782
769
|
margin-inline-start: ${({ theme }) => theme.spaces[3]};
|
783
770
|
}
|
784
771
|
`;
|
785
|
-
const Orderedlist =
|
786
|
-
list-style-type: ${(props) => props
|
772
|
+
const Orderedlist = styledComponents.styled.ol`
|
773
|
+
list-style-type: ${(props) => props.$listStyleType};
|
787
774
|
${listStyle}
|
788
775
|
`;
|
789
|
-
const Unorderedlist =
|
790
|
-
list-style-type: ${(props) => props
|
776
|
+
const Unorderedlist = styledComponents.styled.ul`
|
777
|
+
list-style-type: ${(props) => props.$listStyleType};
|
791
778
|
${listStyle}
|
792
779
|
`;
|
793
780
|
const orderedStyles = ["decimal", "lower-alpha", "upper-roman"];
|
@@ -800,9 +787,9 @@ const List = ({ attributes, children, element }) => {
|
|
800
787
|
const nextIndex = (element.indentLevel || 0) % listStyles.length;
|
801
788
|
const listStyleType = listStyles[nextIndex];
|
802
789
|
if (element.format === "ordered") {
|
803
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Orderedlist, { listStyleType, ...attributes, children });
|
790
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Orderedlist, { $listStyleType: listStyleType, ...attributes, children });
|
804
791
|
}
|
805
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Unorderedlist, { listStyleType, ...attributes, children });
|
792
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Unorderedlist, { $listStyleType: listStyleType, ...attributes, children });
|
806
793
|
};
|
807
794
|
const replaceListWithEmptyBlock = (editor, currentListPath) => {
|
808
795
|
slate.Transforms.removeNodes(editor, { at: currentListPath });
|
@@ -999,7 +986,7 @@ const listBlocks = {
|
|
999
986
|
snippets: ["-", "*", "+"]
|
1000
987
|
},
|
1001
988
|
"list-item": {
|
1002
|
-
renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
989
|
+
renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "li", ...props.attributes, children: props.children }),
|
1003
990
|
// No handleConvert, list items are created when converting to the parent list
|
1004
991
|
matchNode: (node) => node.type === "list-item",
|
1005
992
|
isInBlocksSelector: false,
|
@@ -1008,7 +995,7 @@ const listBlocks = {
|
|
1008
995
|
};
|
1009
996
|
const paragraphBlocks = {
|
1010
997
|
paragraph: {
|
1011
|
-
renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
|
998
|
+
renderElement: (props) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "p", variant: "omega", ...props.attributes, children: props.children }),
|
1012
999
|
icon: Icons.Paragraph,
|
1013
1000
|
label: {
|
1014
1001
|
id: "components.Blocks.blocks.text",
|
@@ -1056,7 +1043,7 @@ const paragraphBlocks = {
|
|
1056
1043
|
}
|
1057
1044
|
}
|
1058
1045
|
};
|
1059
|
-
const Blockquote =
|
1046
|
+
const Blockquote = styledComponents.styled.blockquote.attrs({ role: "blockquote" })`
|
1060
1047
|
font-weight: ${({ theme }) => theme.fontWeights.regular};
|
1061
1048
|
border-left: ${({ theme }) => `${theme.spaces[1]} solid ${theme.colors.neutral200}`};
|
1062
1049
|
padding: ${({ theme }) => theme.spaces[2]} ${({ theme }) => theme.spaces[4]};
|
@@ -1086,17 +1073,17 @@ const quoteBlocks = {
|
|
1086
1073
|
dragHandleTopMargin: "6px"
|
1087
1074
|
}
|
1088
1075
|
};
|
1089
|
-
const ToolbarWrapper =
|
1076
|
+
const ToolbarWrapper = styledComponents.styled(designSystem.Flex)`
|
1090
1077
|
&[aria-disabled='true'] {
|
1091
1078
|
cursor: not-allowed;
|
1092
1079
|
}
|
1093
1080
|
`;
|
1094
|
-
const Separator =
|
1081
|
+
const Separator = styledComponents.styled(Toolbar__namespace.Separator)`
|
1095
1082
|
background: ${({ theme }) => theme.colors.neutral150};
|
1096
1083
|
width: 1px;
|
1097
1084
|
height: 2.4rem;
|
1098
1085
|
`;
|
1099
|
-
const FlexButton =
|
1086
|
+
const FlexButton = styledComponents.styled(designSystem.Flex)`
|
1100
1087
|
// Inherit the not-allowed cursor from ToolbarWrapper when disabled
|
1101
1088
|
&[aria-disabled] {
|
1102
1089
|
cursor: inherit;
|
@@ -1111,7 +1098,7 @@ const FlexButton = styled__default.default(designSystem.Flex)`
|
|
1111
1098
|
}
|
1112
1099
|
}
|
1113
1100
|
`;
|
1114
|
-
const SelectWrapper =
|
1101
|
+
const SelectWrapper = styledComponents.styled(designSystem.Box)`
|
1115
1102
|
// Styling changes to SingleSelect component don't work, so adding wrapper to target SingleSelect
|
1116
1103
|
div[role='combobox'] {
|
1117
1104
|
border: none;
|
@@ -1174,7 +1161,7 @@ const ToolbarButton = ({
|
|
1174
1161
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
1175
1162
|
FlexButton,
|
1176
1163
|
{
|
1177
|
-
|
1164
|
+
tag: "button",
|
1178
1165
|
background: isActive ? "primary100" : "",
|
1179
1166
|
alignItems: "center",
|
1180
1167
|
justifyContent: "center",
|
@@ -1458,7 +1445,7 @@ const BlocksToolbar = () => {
|
|
1458
1445
|
] }) })
|
1459
1446
|
] }) });
|
1460
1447
|
};
|
1461
|
-
const StyledEditable =
|
1448
|
+
const StyledEditable = styledComponents.styled(slateReact.Editable)`
|
1462
1449
|
// The outline style is set on the wrapper with :focus-within
|
1463
1450
|
outline: none;
|
1464
1451
|
display: flex;
|
@@ -1473,20 +1460,20 @@ const StyledEditable = styled__default.default(slateReact.Editable)`
|
|
1473
1460
|
padding-bottom: ${({ theme }) => theme.spaces[3]};
|
1474
1461
|
}
|
1475
1462
|
`;
|
1476
|
-
const Wrapper$1 =
|
1463
|
+
const Wrapper$1 = styledComponents.styled(designSystem.Box)`
|
1477
1464
|
position: ${({ isOverDropTarget }) => isOverDropTarget && "relative"};
|
1478
1465
|
`;
|
1479
|
-
const DropPlaceholder =
|
1466
|
+
const DropPlaceholder = styledComponents.styled(designSystem.Box)`
|
1480
1467
|
position: absolute;
|
1481
1468
|
right: 0;
|
1482
1469
|
|
1483
1470
|
// Show drop placeholder 8px above or below the drop target
|
1484
|
-
${({ dragDirection, theme, placeholderMargin }) =>
|
1471
|
+
${({ dragDirection, theme, placeholderMargin }) => styledComponents.css`
|
1485
1472
|
top: ${dragDirection === useDragAndDrop.DIRECTIONS.UPWARD && `-${theme.spaces[placeholderMargin]}`};
|
1486
1473
|
bottom: ${dragDirection === useDragAndDrop.DIRECTIONS.DOWNWARD && `-${theme.spaces[placeholderMargin]}`};
|
1487
1474
|
`}
|
1488
1475
|
`;
|
1489
|
-
const DragItem =
|
1476
|
+
const DragItem = styledComponents.styled(designSystem.Flex)`
|
1490
1477
|
// Style each block rendered using renderElement()
|
1491
1478
|
& > [data-slate-node='element'] {
|
1492
1479
|
width: 100%;
|
@@ -1495,14 +1482,14 @@ const DragItem = styled__default.default(designSystem.Flex)`
|
|
1495
1482
|
|
1496
1483
|
// Set the visibility of drag button
|
1497
1484
|
[role='button'] {
|
1498
|
-
visibility: ${(props) => props
|
1485
|
+
visibility: ${(props) => props.$dragVisibility};
|
1499
1486
|
opacity: inherit;
|
1500
1487
|
}
|
1501
1488
|
&[aria-disabled='true'] {
|
1502
1489
|
user-drag: none;
|
1503
1490
|
}
|
1504
1491
|
`;
|
1505
|
-
const DragIconButton =
|
1492
|
+
const DragIconButton = styledComponents.styled(designSystem.IconButton)`
|
1506
1493
|
display: flex;
|
1507
1494
|
align-items: center;
|
1508
1495
|
justify-content: center;
|
@@ -1512,7 +1499,7 @@ const DragIconButton = styled__default.default(designSystem.IconButton)`
|
|
1512
1499
|
visibility: hidden;
|
1513
1500
|
cursor: grab;
|
1514
1501
|
opacity: inherit;
|
1515
|
-
margin-top: ${(props) => props
|
1502
|
+
margin-top: ${(props) => props.$dragHandleTopMargin ?? 0};
|
1516
1503
|
|
1517
1504
|
&:hover {
|
1518
1505
|
background: ${({ theme }) => theme.colors.neutral200};
|
@@ -1587,7 +1574,7 @@ const DragAndDropElement = ({
|
|
1587
1574
|
React__namespace.useEffect(() => {
|
1588
1575
|
setDragVisibility("hidden");
|
1589
1576
|
}, [editor.selection]);
|
1590
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$1, { ref:
|
1577
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(Wrapper$1, { ref: composedBoxRefs, isOverDropTarget, children: [
|
1591
1578
|
isOverDropTarget && /* @__PURE__ */ jsxRuntime.jsx(
|
1592
1579
|
DropPlaceholder,
|
1593
1580
|
{
|
@@ -1625,15 +1612,16 @@ const DragAndDropElement = ({
|
|
1625
1612
|
onSelect: () => setDragVisibility("visible"),
|
1626
1613
|
onMouseLeave: () => setDragVisibility("hidden"),
|
1627
1614
|
"aria-disabled": disabled,
|
1628
|
-
dragVisibility,
|
1615
|
+
$dragVisibility: dragVisibility,
|
1629
1616
|
children: [
|
1630
1617
|
/* @__PURE__ */ jsxRuntime.jsx(
|
1631
1618
|
DragIconButton,
|
1632
1619
|
{
|
1633
|
-
|
1620
|
+
tag: "div",
|
1634
1621
|
role: "button",
|
1635
1622
|
tabIndex: 0,
|
1636
|
-
|
1623
|
+
withTooltip: false,
|
1624
|
+
label: formatMessage({
|
1637
1625
|
id: index.getTranslation("components.DragHandle-label"),
|
1638
1626
|
defaultMessage: "Drag"
|
1639
1627
|
}),
|
@@ -1641,7 +1629,7 @@ const DragAndDropElement = ({
|
|
1641
1629
|
"aria-disabled": disabled,
|
1642
1630
|
disabled,
|
1643
1631
|
draggable: true,
|
1644
|
-
dragHandleTopMargin,
|
1632
|
+
$dragHandleTopMargin: dragHandleTopMargin,
|
1645
1633
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "neutral600" })
|
1646
1634
|
}
|
1647
1635
|
),
|
@@ -1653,17 +1641,18 @@ const DragAndDropElement = ({
|
|
1653
1641
|
};
|
1654
1642
|
const CloneDragItem = ({ children, dragHandleTopMargin }) => {
|
1655
1643
|
const { formatMessage } = reactIntl.useIntl();
|
1656
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(DragItem, { gap: 2, paddingLeft: 2, alignItems: "start", dragVisibility: "visible", children: [
|
1644
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(DragItem, { gap: 2, paddingLeft: 2, alignItems: "start", $dragVisibility: "visible", children: [
|
1657
1645
|
/* @__PURE__ */ jsxRuntime.jsx(
|
1658
1646
|
DragIconButton,
|
1659
1647
|
{
|
1660
|
-
|
1648
|
+
tag: "div",
|
1661
1649
|
role: "button",
|
1662
|
-
|
1650
|
+
withTooltip: false,
|
1651
|
+
label: formatMessage({
|
1663
1652
|
id: index.getTranslation("components.DragHandle-label"),
|
1664
1653
|
defaultMessage: "Drag"
|
1665
1654
|
}),
|
1666
|
-
dragHandleTopMargin,
|
1655
|
+
$dragHandleTopMargin: dragHandleTopMargin,
|
1667
1656
|
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, { color: "neutral600" })
|
1668
1657
|
}
|
1669
1658
|
),
|
@@ -1910,12 +1899,12 @@ const BlocksContent = ({ placeholder, ariaLabelId }) => {
|
|
1910
1899
|
}
|
1911
1900
|
);
|
1912
1901
|
};
|
1913
|
-
const CollapseIconButton =
|
1902
|
+
const CollapseIconButton = styledComponents.styled(designSystem.IconButton)`
|
1914
1903
|
position: absolute;
|
1915
1904
|
bottom: 1.2rem;
|
1916
1905
|
right: 1.2rem;
|
1917
1906
|
`;
|
1918
|
-
const ExpandWrapper$1 =
|
1907
|
+
const ExpandWrapper$1 = styledComponents.styled(designSystem.Flex)`
|
1919
1908
|
// Background with 20% opacity
|
1920
1909
|
background: ${({ theme }) => `${theme.colors.neutral800}1F`};
|
1921
1910
|
`;
|
@@ -1980,13 +1969,13 @@ const EditorLayout$1 = ({
|
|
1980
1969
|
) }) });
|
1981
1970
|
}
|
1982
1971
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
1983
|
-
|
1972
|
+
InputWrapper,
|
1984
1973
|
{
|
1985
1974
|
direction: "column",
|
1986
1975
|
alignItems: "flex-start",
|
1987
1976
|
height: "512px",
|
1988
|
-
disabled,
|
1989
|
-
hasError: Boolean(error),
|
1977
|
+
$disabled: disabled,
|
1978
|
+
$hasError: Boolean(error),
|
1990
1979
|
style: { overflow: "hidden" },
|
1991
1980
|
"aria-describedby": ariaDescriptionId,
|
1992
1981
|
position: "relative",
|
@@ -1994,25 +1983,52 @@ const EditorLayout$1 = ({
|
|
1994
1983
|
}
|
1995
1984
|
);
|
1996
1985
|
};
|
1997
|
-
const
|
1986
|
+
const InputWrapper = styledComponents.styled(designSystem.Flex)`
|
1987
|
+
border: 1px solid
|
1988
|
+
${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral200};
|
1989
|
+
border-radius: ${({ theme }) => theme.borderRadius};
|
1990
|
+
background: ${({ theme }) => theme.colors.neutral0};
|
1991
|
+
|
1992
|
+
${({ theme, $hasError = false }) => styledComponents.css`
|
1993
|
+
outline: none;
|
1994
|
+
box-shadow: 0;
|
1995
|
+
transition-property: border-color, box-shadow, fill;
|
1996
|
+
transition-duration: 0.2s;
|
1997
|
+
|
1998
|
+
&:focus-within {
|
1999
|
+
border: 1px solid ${$hasError ? theme.colors.danger600 : theme.colors.primary600};
|
2000
|
+
box-shadow: ${$hasError ? theme.colors.danger600 : theme.colors.primary600} 0px 0px 0px 2px;
|
2001
|
+
}
|
2002
|
+
`}
|
2003
|
+
|
2004
|
+
${({ theme, $disabled }) => $disabled ? styledComponents.css`
|
2005
|
+
color: ${theme.colors.neutral600};
|
2006
|
+
background: ${theme.colors.neutral150};
|
2007
|
+
` : void 0}
|
2008
|
+
`;
|
2009
|
+
const stylesToInherit = styledComponents.css`
|
1998
2010
|
font-size: inherit;
|
1999
2011
|
color: inherit;
|
2000
2012
|
line-height: inherit;
|
2001
2013
|
`;
|
2002
|
-
const BoldText =
|
2014
|
+
const BoldText = styledComponents.styled(designSystem.Typography).attrs({ fontWeight: "bold" })`
|
2003
2015
|
${stylesToInherit}
|
2004
2016
|
`;
|
2005
|
-
const ItalicText =
|
2017
|
+
const ItalicText = styledComponents.styled(designSystem.Typography)`
|
2006
2018
|
font-style: italic;
|
2007
2019
|
${stylesToInherit}
|
2008
2020
|
`;
|
2009
|
-
const UnderlineText =
|
2021
|
+
const UnderlineText = styledComponents.styled(designSystem.Typography).attrs({
|
2022
|
+
textDecoration: "underline"
|
2023
|
+
})`
|
2010
2024
|
${stylesToInherit}
|
2011
2025
|
`;
|
2012
|
-
const StrikeThroughText =
|
2026
|
+
const StrikeThroughText = styledComponents.styled(designSystem.Typography).attrs({
|
2027
|
+
textDecoration: "line-through"
|
2028
|
+
})`
|
2013
2029
|
${stylesToInherit}
|
2014
2030
|
`;
|
2015
|
-
const InlineCode =
|
2031
|
+
const InlineCode = styledComponents.styled.code`
|
2016
2032
|
background-color: ${({ theme }) => theme.colors.neutral150};
|
2017
2033
|
border-radius: ${({ theme }) => theme.borderRadius};
|
2018
2034
|
padding: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
@@ -2182,10 +2198,10 @@ function useBlocksEditorContext(consumerName) {
|
|
2182
2198
|
editor
|
2183
2199
|
};
|
2184
2200
|
}
|
2185
|
-
const EditorDivider =
|
2201
|
+
const EditorDivider = styledComponents.styled(designSystem.Divider)`
|
2186
2202
|
background: ${({ theme }) => theme.colors.neutral200};
|
2187
2203
|
`;
|
2188
|
-
const ExpandIconButton =
|
2204
|
+
const ExpandIconButton = styledComponents.styled(designSystem.IconButton)`
|
2189
2205
|
position: absolute;
|
2190
2206
|
bottom: 1.2rem;
|
2191
2207
|
right: 1.2rem;
|
@@ -2300,8 +2316,8 @@ const BlocksInput = React__namespace.forwardRef(
|
|
2300
2316
|
({ label, name: name2, required = false, hint, labelAction, ...editorProps }, forwardedRef) => {
|
2301
2317
|
const id = React__namespace.useId();
|
2302
2318
|
const field = strapiAdmin.useField(name2);
|
2303
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field, { id, name: name2, hint, error: field.error, required, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
2304
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
2319
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { id, name: name2, hint, error: field.error, required, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
2320
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
|
2305
2321
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2306
2322
|
BlocksEditor,
|
2307
2323
|
{
|
@@ -2314,11 +2330,12 @@ const BlocksInput = React__namespace.forwardRef(
|
|
2314
2330
|
...editorProps
|
2315
2331
|
}
|
2316
2332
|
),
|
2317
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
2318
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
2333
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
|
2334
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
2319
2335
|
] }) });
|
2320
2336
|
}
|
2321
2337
|
);
|
2338
|
+
const MemoizedBlocksInput = React__namespace.memo(BlocksInput);
|
2322
2339
|
const createDefaultForm = (contentType, components = {}) => {
|
2323
2340
|
const traverseSchema = (attributes) => {
|
2324
2341
|
return Object.entries(attributes).reduce((acc, [key, attribute]) => {
|
@@ -2346,7 +2363,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2346
2363
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2347
2364
|
designSystem.Box,
|
2348
2365
|
{
|
2349
|
-
|
2366
|
+
tag: "button",
|
2350
2367
|
background: "neutral100",
|
2351
2368
|
borderColor: field.error ? "danger600" : "neutral200",
|
2352
2369
|
hasRadius: true,
|
@@ -2367,7 +2384,7 @@ const Initializer = ({ disabled, name: name2, onClick }) => {
|
|
2367
2384
|
field.error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "pi", children: field.error })
|
2368
2385
|
] });
|
2369
2386
|
};
|
2370
|
-
const CircleIcon =
|
2387
|
+
const CircleIcon = styledComponents.styled(Icons.PlusCircle)`
|
2371
2388
|
width: 2.4rem;
|
2372
2389
|
height: 2.4rem;
|
2373
2390
|
> circle {
|
@@ -2397,9 +2414,9 @@ const NonRepeatableComponent = ({
|
|
2397
2414
|
hasRadius: isNested,
|
2398
2415
|
borderColor: isNested ? "neutral200" : void 0,
|
2399
2416
|
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: layout.map((row, index2) => {
|
2400
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid, { gap: 4, children: row.map(({ size, ...field }) => {
|
2417
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2401
2418
|
const completeFieldName = `${name2}.${field.name}`;
|
2402
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
2419
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
|
2403
2420
|
}) }, index2);
|
2404
2421
|
}) })
|
2405
2422
|
}
|
@@ -2423,7 +2440,7 @@ const RepeatableComponent = ({
|
|
2423
2440
|
const moveFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.moveFieldRow);
|
2424
2441
|
const removeFieldRow = strapiAdmin.useForm("RepeatableComponent", (state) => state.removeFieldRow);
|
2425
2442
|
const { max = Infinity } = attribute;
|
2426
|
-
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState(
|
2443
|
+
const [collapseToOpen, setCollapseToOpen] = React__namespace.useState("");
|
2427
2444
|
const [liveText, setLiveText] = React__namespace.useState("");
|
2428
2445
|
const componentTmpKeyWithFocussedField = React__namespace.useMemo(() => {
|
2429
2446
|
if (search.has("field")) {
|
@@ -2439,13 +2456,19 @@ const RepeatableComponent = ({
|
|
2439
2456
|
}
|
2440
2457
|
return void 0;
|
2441
2458
|
}, [search, name2, value]);
|
2459
|
+
const prevValue = usePrev.usePrev(value);
|
2460
|
+
React__namespace.useEffect(() => {
|
2461
|
+
if (prevValue && prevValue.length < value.length) {
|
2462
|
+
setCollapseToOpen(value[value.length - 1].__temp_key__);
|
2463
|
+
}
|
2464
|
+
}, [value, prevValue]);
|
2442
2465
|
React__namespace.useEffect(() => {
|
2443
|
-
if (typeof componentTmpKeyWithFocussedField === "
|
2466
|
+
if (typeof componentTmpKeyWithFocussedField === "string") {
|
2444
2467
|
setCollapseToOpen(componentTmpKeyWithFocussedField);
|
2445
2468
|
}
|
2446
2469
|
}, [componentTmpKeyWithFocussedField]);
|
2447
2470
|
const toggleCollapses = () => {
|
2448
|
-
setCollapseToOpen(
|
2471
|
+
setCollapseToOpen("");
|
2449
2472
|
};
|
2450
2473
|
const handleClick = () => {
|
2451
2474
|
if (value.length < max) {
|
@@ -2477,12 +2500,8 @@ const RepeatableComponent = ({
|
|
2477
2500
|
);
|
2478
2501
|
moveFieldRow(name2, currentIndex, newIndex);
|
2479
2502
|
};
|
2480
|
-
const
|
2481
|
-
|
2482
|
-
setCollapseToOpen(null);
|
2483
|
-
} else {
|
2484
|
-
setCollapseToOpen(key);
|
2485
|
-
}
|
2503
|
+
const handleValueChange = (key) => {
|
2504
|
+
setCollapseToOpen(key);
|
2486
2505
|
};
|
2487
2506
|
const getItemPos = (index2) => `${index2 + 1} of ${value.length}`;
|
2488
2507
|
const handleCancel = (index$1) => {
|
@@ -2537,158 +2556,104 @@ const RepeatableComponent = ({
|
|
2537
2556
|
defaultMessage: `Press spacebar to grab and re-order`
|
2538
2557
|
}) }),
|
2539
2558
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { "aria-live": "assertive", children: liveText }),
|
2540
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
2541
|
-
|
2542
|
-
|
2543
|
-
|
2544
|
-
|
2545
|
-
|
2546
|
-
|
2547
|
-
|
2548
|
-
|
2549
|
-
|
2550
|
-
|
2551
|
-
|
2559
|
+
/* @__PURE__ */ jsxRuntime.jsxs(
|
2560
|
+
AccordionRoot,
|
2561
|
+
{
|
2562
|
+
$error: error,
|
2563
|
+
value: collapseToOpen,
|
2564
|
+
onValueChange: handleValueChange,
|
2565
|
+
"aria-describedby": ariaDescriptionId,
|
2566
|
+
children: [
|
2567
|
+
value.map(({ __temp_key__: key, id }, index2) => {
|
2568
|
+
const nameWithIndex = `${name2}.${index2}`;
|
2569
|
+
return /* @__PURE__ */ jsxRuntime.jsx(
|
2570
|
+
Relations.ComponentProvider,
|
2552
2571
|
{
|
2553
|
-
|
2554
|
-
|
2555
|
-
|
2556
|
-
|
2557
|
-
|
2558
|
-
|
2559
|
-
|
2560
|
-
|
2561
|
-
|
2562
|
-
|
2563
|
-
|
2564
|
-
|
2565
|
-
|
2566
|
-
|
2567
|
-
|
2568
|
-
|
2569
|
-
|
2570
|
-
|
2571
|
-
|
2572
|
-
|
2573
|
-
|
2574
|
-
|
2575
|
-
|
2576
|
-
|
2577
|
-
|
2578
|
-
|
2579
|
-
|
2580
|
-
|
2581
|
-
|
2582
|
-
|
2583
|
-
|
2584
|
-
|
2585
|
-
|
2572
|
+
id,
|
2573
|
+
uid: attribute.component,
|
2574
|
+
level: level + 1,
|
2575
|
+
type: "repeatable",
|
2576
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(
|
2577
|
+
Component,
|
2578
|
+
{
|
2579
|
+
disabled,
|
2580
|
+
name: nameWithIndex,
|
2581
|
+
attribute,
|
2582
|
+
index: index2,
|
2583
|
+
mainField,
|
2584
|
+
onMoveItem: handleMoveComponentField,
|
2585
|
+
onDeleteComponent: () => {
|
2586
|
+
removeFieldRow(name2, index2);
|
2587
|
+
toggleCollapses();
|
2588
|
+
},
|
2589
|
+
toggleCollapses,
|
2590
|
+
onCancel: handleCancel,
|
2591
|
+
onDropItem: handleDropItem,
|
2592
|
+
onGrabItem: handleGrabItem,
|
2593
|
+
__temp_key__: key,
|
2594
|
+
children: layout.map((row, index22) => {
|
2595
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Root, { gap: 4, children: row.map(({ size, ...field }) => {
|
2596
|
+
const completeFieldName = `${nameWithIndex}.${field.name}`;
|
2597
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: children({ ...field, name: completeFieldName }) }, completeFieldName);
|
2598
|
+
}) }, index22);
|
2599
|
+
})
|
2600
|
+
}
|
2601
|
+
)
|
2602
|
+
},
|
2603
|
+
key
|
2604
|
+
);
|
2605
|
+
}),
|
2606
|
+
/* @__PURE__ */ jsxRuntime.jsx(TextButtonCustom, { disabled, onClick: handleClick, startIcon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Plus, {}), children: formatMessage({
|
2607
|
+
id: index.getTranslation("containers.EditView.add.new-entry"),
|
2608
|
+
defaultMessage: "Add an entry"
|
2609
|
+
}) })
|
2610
|
+
]
|
2611
|
+
}
|
2612
|
+
)
|
2586
2613
|
] });
|
2587
2614
|
};
|
2588
|
-
const
|
2589
|
-
|
2615
|
+
const AccordionRoot = styledComponents.styled(designSystem.Accordion.Root)`
|
2616
|
+
border: 1px solid
|
2617
|
+
${({ theme, $error }) => $error ? theme.colors.danger600 : theme.colors.neutral200};
|
2618
|
+
`;
|
2619
|
+
const TextButtonCustom = styledComponents.styled(designSystem.TextButton)`
|
2590
2620
|
width: 100%;
|
2591
|
-
border-radius: 0 0 4px 4px;
|
2592
2621
|
display: flex;
|
2593
2622
|
justify-content: center;
|
2594
|
-
|
2595
|
-
|
2596
|
-
|
2597
|
-
}
|
2598
|
-
`;
|
2599
|
-
const AccordionFooter = styled__default.default(designSystem.Box)`
|
2600
|
-
overflow: hidden;
|
2601
|
-
border-bottom: 1px solid ${({ theme }) => theme.colors.neutral200};
|
2602
|
-
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
2603
|
-
border-left: 1px solid ${({ theme }) => theme.colors.neutral200};
|
2604
|
-
border-radius: 0 0 ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius};
|
2605
|
-
`;
|
2606
|
-
const AccordionContent = styled__default.default(designSystem.Box)`
|
2607
|
-
border-bottom: none;
|
2608
|
-
|
2609
|
-
/* add the borders and make sure the top is transparent to avoid jumping with the hover effect */
|
2610
|
-
& > div > div {
|
2611
|
-
border: 1px solid ${({ theme }) => theme.colors.neutral200};
|
2612
|
-
border-top-color: transparent;
|
2613
|
-
}
|
2623
|
+
border-top: 1px solid ${({ theme }) => theme.colors.neutral200};
|
2624
|
+
padding-inline: ${(props) => props.theme.spaces[6]};
|
2625
|
+
padding-block: ${(props) => props.theme.spaces[3]};
|
2614
2626
|
|
2615
|
-
|
2616
|
-
|
2617
|
-
border-top: 1px solid ${({ theme }) => theme.colors.neutral200};
|
2618
|
-
}
|
2619
|
-
|
2620
|
-
/* Reset all the border-radius' */
|
2621
|
-
& > div > div,
|
2622
|
-
& > div > div > div {
|
2623
|
-
border-radius: unset;
|
2624
|
-
}
|
2625
|
-
|
2626
|
-
/* Give the border radius back to the first accordion */
|
2627
|
-
& > div:first-child > div,
|
2628
|
-
& > div:first-child > div > div {
|
2629
|
-
border-radius: ${({ theme }) => theme.borderRadius} ${({ theme }) => theme.borderRadius} 0 0;
|
2630
|
-
}
|
2631
|
-
|
2632
|
-
& > div > div[data-strapi-expanded='true'] {
|
2633
|
-
border: 1px solid ${({ theme }) => theme.colors.primary600};
|
2634
|
-
}
|
2635
|
-
`;
|
2636
|
-
const AccordionGroup = ({ children, error }) => {
|
2637
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.KeyboardNavigable, { attributeName: "data-strapi-accordion-toggle", children: [
|
2638
|
-
children,
|
2639
|
-
error && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "danger600", children: error }) })
|
2640
|
-
] });
|
2641
|
-
};
|
2642
|
-
const CustomIconButton$1 = styled__default.default(designSystem.IconButton)`
|
2643
|
-
background-color: transparent;
|
2627
|
+
&:not([disabled]) {
|
2628
|
+
cursor: pointer;
|
2644
2629
|
|
2645
|
-
|
2646
|
-
|
2647
|
-
fill: ${({ theme, expanded }) => expanded ? theme.colors.primary600 : theme.colors.neutral600};
|
2630
|
+
&:hover {
|
2631
|
+
background-color: ${(props) => props.theme.colors.primary100};
|
2648
2632
|
}
|
2649
2633
|
}
|
2650
2634
|
|
2651
|
-
|
2652
|
-
|
2653
|
-
|
2654
|
-
|
2655
|
-
}
|
2656
|
-
}
|
2635
|
+
span {
|
2636
|
+
font-weight: 600;
|
2637
|
+
font-size: 1.4rem;
|
2638
|
+
line-height: 2.4rem;
|
2657
2639
|
}
|
2658
|
-
`;
|
2659
|
-
const ActionsFlex$1 = styled__default.default(designSystem.Flex)`
|
2660
|
-
& .drag-handle {
|
2661
|
-
background: unset;
|
2662
2640
|
|
2663
|
-
|
2664
|
-
|
2665
|
-
fill: ${({ theme, expanded }) => expanded ? theme.colors.primary600 : void 0};
|
2666
|
-
}
|
2667
|
-
}
|
2668
|
-
|
2669
|
-
&:hover {
|
2670
|
-
svg {
|
2671
|
-
path {
|
2672
|
-
/* keeps the hover style of the accordion */
|
2673
|
-
fill: ${({ theme }) => theme.colors.primary600};
|
2674
|
-
}
|
2675
|
-
}
|
2676
|
-
}
|
2641
|
+
@media (prefers-reduced-motion: no-preference) {
|
2642
|
+
transition: background-color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
|
2677
2643
|
}
|
2678
2644
|
`;
|
2679
2645
|
const Component = ({
|
2680
2646
|
disabled,
|
2681
2647
|
index: index$1,
|
2682
|
-
isOpen,
|
2683
2648
|
name: name2,
|
2684
2649
|
mainField = {
|
2685
2650
|
name: "id",
|
2686
2651
|
type: "integer"
|
2687
2652
|
},
|
2688
2653
|
children,
|
2689
|
-
onClickToggle,
|
2690
2654
|
onDeleteComponent,
|
2691
2655
|
toggleCollapses,
|
2656
|
+
__temp_key__,
|
2692
2657
|
...dragProps
|
2693
2658
|
}) => {
|
2694
2659
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2713,50 +2678,44 @@ const Component = ({
|
|
2713
2678
|
dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
|
2714
2679
|
}, [dragPreviewRef, index$1]);
|
2715
2680
|
const composedAccordionRefs = designSystem.useComposedRefs(accordionRef, dragRef);
|
2716
|
-
const composedBoxRefs = designSystem.useComposedRefs(
|
2717
|
-
|
2718
|
-
|
2719
|
-
|
2720
|
-
|
2721
|
-
|
2722
|
-
|
2723
|
-
|
2724
|
-
|
2725
|
-
|
2726
|
-
|
2727
|
-
|
2728
|
-
|
2729
|
-
|
2730
|
-
|
2731
|
-
|
2732
|
-
|
2733
|
-
}
|
2734
|
-
|
2735
|
-
|
2736
|
-
|
2737
|
-
|
2738
|
-
|
2739
|
-
|
2740
|
-
|
2741
|
-
|
2742
|
-
|
2743
|
-
|
2744
|
-
|
2745
|
-
"
|
2746
|
-
|
2747
|
-
|
2748
|
-
|
2749
|
-
|
2750
|
-
|
2751
|
-
|
2752
|
-
|
2753
|
-
|
2754
|
-
] }),
|
2755
|
-
title: displayValue,
|
2756
|
-
togglePosition: "left"
|
2757
|
-
}
|
2758
|
-
),
|
2759
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.AccordionContent, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
2681
|
+
const composedBoxRefs = designSystem.useComposedRefs(
|
2682
|
+
boxRef,
|
2683
|
+
dropRef
|
2684
|
+
);
|
2685
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview$1, {}) : /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { ref: composedBoxRefs, value: __temp_key__, children: [
|
2686
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
|
2687
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Trigger, { children: displayValue }),
|
2688
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Actions, { children: [
|
2689
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2690
|
+
designSystem.IconButton,
|
2691
|
+
{
|
2692
|
+
borderWidth: 0,
|
2693
|
+
onClick: onDeleteComponent,
|
2694
|
+
label: formatMessage({
|
2695
|
+
id: index.getTranslation("containers.Edit.delete"),
|
2696
|
+
defaultMessage: "Delete"
|
2697
|
+
}),
|
2698
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Trash, {})
|
2699
|
+
}
|
2700
|
+
),
|
2701
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2702
|
+
designSystem.IconButton,
|
2703
|
+
{
|
2704
|
+
ref: composedAccordionRefs,
|
2705
|
+
borderWidth: 0,
|
2706
|
+
onClick: (e) => e.stopPropagation(),
|
2707
|
+
"data-handler-id": handlerId,
|
2708
|
+
label: formatMessage({
|
2709
|
+
id: index.getTranslation("components.DragHandle-label"),
|
2710
|
+
defaultMessage: "Drag"
|
2711
|
+
}),
|
2712
|
+
onKeyDown: handleKeyDown,
|
2713
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Drag, {})
|
2714
|
+
}
|
2715
|
+
)
|
2716
|
+
] })
|
2717
|
+
] }),
|
2718
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
2760
2719
|
designSystem.Flex,
|
2761
2720
|
{
|
2762
2721
|
direction: "column",
|
@@ -2770,9 +2729,9 @@ const Component = ({
|
|
2770
2729
|
] }) });
|
2771
2730
|
};
|
2772
2731
|
const Preview$1 = () => {
|
2773
|
-
return /* @__PURE__ */ jsxRuntime.jsx(StyledSpan, {
|
2732
|
+
return /* @__PURE__ */ jsxRuntime.jsx(StyledSpan, { tag: "span", padding: 6, background: "primary100" });
|
2774
2733
|
};
|
2775
|
-
const StyledSpan =
|
2734
|
+
const StyledSpan = styledComponents.styled(designSystem.Box)`
|
2776
2735
|
display: block;
|
2777
2736
|
outline: 1px dashed ${({ theme }) => theme.colors.primary500};
|
2778
2737
|
outline-offset: -1px;
|
@@ -2796,29 +2755,15 @@ const ComponentInput = ({
|
|
2796
2755
|
const data = transformDocument(schema, components)(form);
|
2797
2756
|
field.onChange(name2, data);
|
2798
2757
|
};
|
2799
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.
|
2758
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error: field.error, required, children: [
|
2800
2759
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", children: [
|
2801
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.
|
2802
|
-
|
2803
|
-
|
2804
|
-
|
2805
|
-
|
2806
|
-
|
2807
|
-
|
2808
|
-
fontWeight: "bold",
|
2809
|
-
as: "label",
|
2810
|
-
children: [
|
2811
|
-
label,
|
2812
|
-
attribute.repeatable && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
2813
|
-
" (",
|
2814
|
-
Array.isArray(field.value) ? field.value.length : 0,
|
2815
|
-
")"
|
2816
|
-
] }),
|
2817
|
-
required && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", children: "*" })
|
2818
|
-
]
|
2819
|
-
}
|
2820
|
-
),
|
2821
|
-
labelAction && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingLeft: 1, children: labelAction })
|
2760
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Label, { action: labelAction, children: [
|
2761
|
+
label,
|
2762
|
+
attribute.repeatable && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
2763
|
+
" (",
|
2764
|
+
Array.isArray(field.value) ? field.value.length : 0,
|
2765
|
+
")"
|
2766
|
+
] })
|
2822
2767
|
] }),
|
2823
2768
|
showResetComponent && /* @__PURE__ */ jsxRuntime.jsx(
|
2824
2769
|
designSystem.IconButton,
|
@@ -2827,21 +2772,21 @@ const ComponentInput = ({
|
|
2827
2772
|
id: index.getTranslation("components.reset-entry"),
|
2828
2773
|
defaultMessage: "Reset Entry"
|
2829
2774
|
}),
|
2830
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Trash, {}),
|
2831
2775
|
borderWidth: 0,
|
2832
2776
|
onClick: () => {
|
2833
2777
|
field.onChange(name2, null);
|
2834
|
-
}
|
2778
|
+
},
|
2779
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Trash, {})
|
2835
2780
|
}
|
2836
2781
|
)
|
2837
2782
|
] }),
|
2838
|
-
/* @__PURE__ */ jsxRuntime.
|
2839
|
-
|
2840
|
-
|
2841
|
-
|
2842
|
-
] })
|
2783
|
+
!attribute.repeatable && !field.value && /* @__PURE__ */ jsxRuntime.jsx(Initializer, { disabled, name: name2, onClick: handleInitialisationClick }),
|
2784
|
+
!attribute.repeatable && field.value ? /* @__PURE__ */ jsxRuntime.jsx(NonRepeatableComponent, { attribute, name: name2, disabled, ...props, children: props.children }) : null,
|
2785
|
+
attribute.repeatable && /* @__PURE__ */ jsxRuntime.jsx(RepeatableComponent, { attribute, name: name2, disabled, ...props, children: props.children }),
|
2786
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
2843
2787
|
] });
|
2844
2788
|
};
|
2789
|
+
const MemoizedComponentInput = React__namespace.memo(ComponentInput);
|
2845
2790
|
const AddComponentButton = ({
|
2846
2791
|
hasError,
|
2847
2792
|
isDisabled,
|
@@ -2861,10 +2806,10 @@ const AddComponentButton = ({
|
|
2861
2806
|
paddingLeft: 4,
|
2862
2807
|
paddingRight: 4,
|
2863
2808
|
style: { cursor: isDisabled ? "not-allowed" : "pointer" },
|
2864
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, {
|
2809
|
+
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
|
2865
2810
|
/* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true, $isOpen: isOpen, $hasError: hasError && !isOpen }),
|
2866
2811
|
/* @__PURE__ */ jsxRuntime.jsx(
|
2867
|
-
|
2812
|
+
AddComponentTitle,
|
2868
2813
|
{
|
2869
2814
|
variant: "pi",
|
2870
2815
|
fontWeight: "bold",
|
@@ -2876,7 +2821,7 @@ const AddComponentButton = ({
|
|
2876
2821
|
}
|
2877
2822
|
);
|
2878
2823
|
};
|
2879
|
-
const StyledAddIcon =
|
2824
|
+
const StyledAddIcon = styledComponents.styled(Icons.PlusCircle)`
|
2880
2825
|
height: ${({ theme }) => theme.spaces[6]};
|
2881
2826
|
width: ${({ theme }) => theme.spaces[6]};
|
2882
2827
|
transform: ${({ $isOpen }) => $isOpen ? "rotate(45deg)" : "rotate(0deg)"};
|
@@ -2888,13 +2833,14 @@ const StyledAddIcon = styled__default.default(Icons.PlusCircle)`
|
|
2888
2833
|
fill: ${({ theme, $hasError }) => $hasError ? theme.colors.danger600 : theme.colors.neutral600};
|
2889
2834
|
}
|
2890
2835
|
`;
|
2891
|
-
const
|
2836
|
+
const AddComponentTitle = styledComponents.styled(designSystem.Typography)``;
|
2837
|
+
const StyledButton = styledComponents.styled(designSystem.BaseButton)`
|
2892
2838
|
border-radius: 26px;
|
2893
2839
|
border-color: ${({ theme }) => theme.colors.neutral150};
|
2894
2840
|
box-shadow: ${({ theme }) => theme.shadows.filterShadow};
|
2895
2841
|
|
2896
2842
|
&:hover {
|
2897
|
-
${
|
2843
|
+
${AddComponentTitle} {
|
2898
2844
|
color: ${({ theme }) => theme.colors.primary600};
|
2899
2845
|
}
|
2900
2846
|
|
@@ -2908,7 +2854,7 @@ const StyledButton = styled__default.default(designSystem.BaseButton)`
|
|
2908
2854
|
}
|
2909
2855
|
}
|
2910
2856
|
&:active {
|
2911
|
-
${
|
2857
|
+
${AddComponentTitle} {
|
2912
2858
|
color: ${({ theme }) => theme.colors.primary600};
|
2913
2859
|
}
|
2914
2860
|
${StyledAddIcon} {
|
@@ -2925,27 +2871,15 @@ const ComponentCategory = ({
|
|
2925
2871
|
category,
|
2926
2872
|
components = [],
|
2927
2873
|
variant = "primary",
|
2928
|
-
|
2929
|
-
onAddComponent,
|
2930
|
-
onToggle
|
2874
|
+
onAddComponent
|
2931
2875
|
}) => {
|
2932
2876
|
const { formatMessage } = reactIntl.useIntl();
|
2933
|
-
|
2934
|
-
|
2935
|
-
|
2936
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion, { expanded: isOpen, onToggle: handleToggle, size: "S", children: [
|
2937
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
2938
|
-
designSystem.AccordionToggle,
|
2939
|
-
{
|
2940
|
-
variant,
|
2941
|
-
title: formatMessage({ id: category, defaultMessage: category }),
|
2942
|
-
togglePosition: "left"
|
2943
|
-
}
|
2944
|
-
),
|
2945
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.AccordionContent, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 4, paddingBottom: 4, paddingLeft: 3, paddingRight: 3, children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { children: components.map(({ uid, displayName, icon }) => /* @__PURE__ */ jsxRuntime.jsx(
|
2877
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: category, children: [
|
2878
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Header, { variant, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Trigger, { children: formatMessage({ id: category, defaultMessage: category }) }) }),
|
2879
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(Grid, { paddingTop: 4, paddingBottom: 4, paddingLeft: 3, paddingRight: 3, children: components.map(({ uid, displayName, icon }) => /* @__PURE__ */ jsxRuntime.jsx(
|
2946
2880
|
ComponentBox,
|
2947
2881
|
{
|
2948
|
-
|
2882
|
+
tag: "button",
|
2949
2883
|
type: "button",
|
2950
2884
|
background: "neutral100",
|
2951
2885
|
justifyContent: "center",
|
@@ -2955,34 +2889,32 @@ const ComponentCategory = ({
|
|
2955
2889
|
shrink: 0,
|
2956
2890
|
borderColor: "neutral200",
|
2957
2891
|
children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", gap: 1, alignItems: "center", justifyContent: "center", children: [
|
2958
|
-
/* @__PURE__ */ jsxRuntime.jsx(ComponentIcon.ComponentIcon, { icon }),
|
2959
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold",
|
2892
|
+
/* @__PURE__ */ jsxRuntime.jsx(ComponentIcon.ComponentIcon, { color: "currentColor", background: "primary200", icon }),
|
2893
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: displayName })
|
2960
2894
|
] })
|
2961
2895
|
},
|
2962
2896
|
uid
|
2963
|
-
)) }) })
|
2897
|
+
)) }) })
|
2964
2898
|
] });
|
2965
2899
|
};
|
2966
|
-
const Grid =
|
2900
|
+
const Grid = styledComponents.styled(designSystem.Box)`
|
2967
2901
|
display: grid;
|
2968
2902
|
grid-template-columns: repeat(auto-fit, 14rem);
|
2969
2903
|
grid-gap: ${({ theme }) => theme.spaces[1]};
|
2970
2904
|
`;
|
2971
|
-
const ComponentBox =
|
2905
|
+
const ComponentBox = styledComponents.styled(designSystem.Flex)`
|
2906
|
+
color: ${({ theme }) => theme.colors.neutral600};
|
2907
|
+
cursor: pointer;
|
2908
|
+
|
2909
|
+
@media (prefers-reduced-motion: no-preference) {
|
2910
|
+
transition: color 120ms ${(props) => props.theme.motion.easings.easeOutQuad};
|
2911
|
+
}
|
2912
|
+
|
2972
2913
|
&:focus,
|
2973
2914
|
&:hover {
|
2974
2915
|
border: 1px solid ${({ theme }) => theme.colors.primary200};
|
2975
2916
|
background: ${({ theme }) => theme.colors.primary100};
|
2976
|
-
|
2977
|
-
${designSystem.Typography} {
|
2978
|
-
color: ${({ theme }) => theme.colors.primary600};
|
2979
|
-
}
|
2980
|
-
|
2981
|
-
/* > Flex > ComponentIcon */
|
2982
|
-
> div > div:first-child {
|
2983
|
-
background: ${({ theme }) => theme.colors.primary200};
|
2984
|
-
color: ${({ theme }) => theme.colors.primary600};
|
2985
|
-
}
|
2917
|
+
color: ${({ theme }) => theme.colors.primary600};
|
2986
2918
|
}
|
2987
2919
|
`;
|
2988
2920
|
const ComponentPicker = ({
|
@@ -2991,19 +2923,8 @@ const ComponentPicker = ({
|
|
2991
2923
|
onClickAddComponent
|
2992
2924
|
}) => {
|
2993
2925
|
const { formatMessage } = reactIntl.useIntl();
|
2994
|
-
const [categoryToOpen, setCategoryToOpen] = React__namespace.useState("");
|
2995
|
-
React__namespace.useEffect(() => {
|
2996
|
-
const categoryKeys = Object.keys(dynamicComponentsByCategory);
|
2997
|
-
if (isOpen && categoryKeys.length > 0) {
|
2998
|
-
setCategoryToOpen(categoryKeys[0]);
|
2999
|
-
}
|
3000
|
-
}, [isOpen, dynamicComponentsByCategory]);
|
3001
2926
|
const handleAddComponentToDz = (componentUid) => () => {
|
3002
2927
|
onClickAddComponent(componentUid);
|
3003
|
-
setCategoryToOpen("");
|
3004
|
-
};
|
3005
|
-
const handleClickToggle = (categoryName) => {
|
3006
|
-
setCategoryToOpen((currentCat) => currentCat === categoryName ? "" : categoryName);
|
3007
2928
|
};
|
3008
2929
|
if (!isOpen) {
|
3009
2930
|
return null;
|
@@ -3024,14 +2945,12 @@ const ComponentPicker = ({
|
|
3024
2945
|
id: index.getTranslation("components.DynamicZone.ComponentPicker-label"),
|
3025
2946
|
defaultMessage: "Pick one component"
|
3026
2947
|
}) }) }),
|
3027
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
2948
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingTop: 2, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { defaultValue: Object.keys(dynamicComponentsByCategory)[0], children: Object.entries(dynamicComponentsByCategory).map(([category, components], index2) => /* @__PURE__ */ jsxRuntime.jsx(
|
3028
2949
|
ComponentCategory,
|
3029
2950
|
{
|
3030
2951
|
category,
|
3031
2952
|
components,
|
3032
2953
|
onAddComponent: handleAddComponentToDz,
|
3033
|
-
isOpen: category === categoryToOpen,
|
3034
|
-
onToggle: handleClickToggle,
|
3035
2954
|
variant: index2 % 2 === 1 ? "primary" : "secondary"
|
3036
2955
|
},
|
3037
2956
|
category
|
@@ -3046,27 +2965,21 @@ const NotAllowedInput = ({ hint, label, required, name: name2 }) => {
|
|
3046
2965
|
id: "components.NotAllowedInput.text",
|
3047
2966
|
defaultMessage: "No permissions to see this field"
|
3048
2967
|
});
|
3049
|
-
return /* @__PURE__ */ jsxRuntime.
|
3050
|
-
designSystem.
|
3051
|
-
|
3052
|
-
|
3053
|
-
|
3054
|
-
|
3055
|
-
|
3056
|
-
|
3057
|
-
|
3058
|
-
|
3059
|
-
|
3060
|
-
|
3061
|
-
|
3062
|
-
|
3063
|
-
);
|
2968
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { id: name2, hint, name: name2, required, children: [
|
2969
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: label }),
|
2970
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2971
|
+
designSystem.TextInput,
|
2972
|
+
{
|
2973
|
+
disabled: true,
|
2974
|
+
placeholder,
|
2975
|
+
startAction: /* @__PURE__ */ jsxRuntime.jsx(Icons.EyeStriked, { fill: "neutral600" }),
|
2976
|
+
type: "text",
|
2977
|
+
value: ""
|
2978
|
+
}
|
2979
|
+
),
|
2980
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
2981
|
+
] });
|
3064
2982
|
};
|
3065
|
-
const StyledIcon = styled__default.default(Icons.EyeStriked)`
|
3066
|
-
& > path {
|
3067
|
-
fill: ${({ theme }) => theme.colors.neutral600};
|
3068
|
-
}
|
3069
|
-
`;
|
3070
2983
|
function useDebounce(value, delay) {
|
3071
2984
|
const [debouncedValue, setDebouncedValue] = React.useState(value);
|
3072
2985
|
React.useEffect(() => {
|
@@ -3119,188 +3032,193 @@ const uidApi = index.contentManagerApi.injectEndpoints({
|
|
3119
3032
|
});
|
3120
3033
|
const { useGenerateUIDMutation, useGetDefaultUIDQuery, useGetAvailabilityQuery } = uidApi;
|
3121
3034
|
const UID_REGEX = /^[A-Za-z0-9-_.~]*$/;
|
3122
|
-
const UIDInput = React__namespace.forwardRef(
|
3123
|
-
|
3124
|
-
|
3125
|
-
|
3126
|
-
|
3127
|
-
|
3128
|
-
|
3129
|
-
|
3130
|
-
|
3131
|
-
|
3132
|
-
|
3133
|
-
|
3134
|
-
|
3135
|
-
|
3136
|
-
|
3137
|
-
|
3138
|
-
|
3139
|
-
|
3140
|
-
|
3141
|
-
field: props.name,
|
3142
|
-
data: {
|
3143
|
-
id: id ?? "",
|
3144
|
-
...allFormValues
|
3145
|
-
},
|
3146
|
-
params
|
3147
|
-
},
|
3148
|
-
{
|
3149
|
-
skip: field.value || !props.required
|
3150
|
-
}
|
3151
|
-
);
|
3152
|
-
React__namespace.useEffect(() => {
|
3153
|
-
if (apiError) {
|
3154
|
-
toggleNotification({
|
3155
|
-
type: "warning",
|
3156
|
-
message: formatAPIError(apiError)
|
3157
|
-
});
|
3158
|
-
}
|
3159
|
-
}, [apiError, formatAPIError, toggleNotification]);
|
3160
|
-
React__namespace.useEffect(() => {
|
3161
|
-
if (defaultGeneratedUID && field.value === void 0) {
|
3162
|
-
field.onChange(props.name, defaultGeneratedUID);
|
3163
|
-
}
|
3164
|
-
}, [defaultGeneratedUID, field, props.name]);
|
3165
|
-
const [generateUID, { isLoading: isGeneratingUID }] = useGenerateUIDMutation();
|
3166
|
-
const handleRegenerateClick = async () => {
|
3167
|
-
try {
|
3168
|
-
const res = await generateUID({
|
3035
|
+
const UIDInput = React__namespace.forwardRef(
|
3036
|
+
({ hint, label, labelAction, name: name2, required, ...props }, ref) => {
|
3037
|
+
const { model, id } = index.useDoc();
|
3038
|
+
const allFormValues = strapiAdmin.useForm("InputUID", (form) => form.values);
|
3039
|
+
const [availability, setAvailability] = React__namespace.useState();
|
3040
|
+
const [showRegenerate, setShowRegenerate] = React__namespace.useState(false);
|
3041
|
+
const field = strapiAdmin.useField(name2);
|
3042
|
+
const debouncedValue = useDebounce(field.value, 300);
|
3043
|
+
const { toggleNotification } = strapiAdmin.useNotification();
|
3044
|
+
const { _unstableFormatAPIError: formatAPIError } = strapiAdmin.useAPIErrorHandler();
|
3045
|
+
const { formatMessage } = reactIntl.useIntl();
|
3046
|
+
const [{ query }] = strapiAdmin.useQueryParams();
|
3047
|
+
const params = React__namespace.useMemo(() => index.buildValidParams(query), [query]);
|
3048
|
+
const {
|
3049
|
+
data: defaultGeneratedUID,
|
3050
|
+
isLoading: isGeneratingDefaultUID,
|
3051
|
+
error: apiError
|
3052
|
+
} = useGetDefaultUIDQuery(
|
3053
|
+
{
|
3169
3054
|
contentTypeUID: model,
|
3170
|
-
field:
|
3171
|
-
data: {
|
3055
|
+
field: name2,
|
3056
|
+
data: {
|
3057
|
+
id: id ?? "",
|
3058
|
+
...allFormValues
|
3059
|
+
},
|
3172
3060
|
params
|
3173
|
-
}
|
3174
|
-
|
3175
|
-
field.
|
3176
|
-
}
|
3061
|
+
},
|
3062
|
+
{
|
3063
|
+
skip: field.value || !required
|
3064
|
+
}
|
3065
|
+
);
|
3066
|
+
React__namespace.useEffect(() => {
|
3067
|
+
if (apiError) {
|
3177
3068
|
toggleNotification({
|
3178
|
-
type: "
|
3179
|
-
message: formatAPIError(
|
3069
|
+
type: "warning",
|
3070
|
+
message: formatAPIError(apiError)
|
3180
3071
|
});
|
3181
3072
|
}
|
3182
|
-
}
|
3183
|
-
|
3184
|
-
|
3185
|
-
|
3186
|
-
|
3187
|
-
|
3188
|
-
|
3189
|
-
|
3190
|
-
|
3191
|
-
|
3192
|
-
|
3193
|
-
|
3194
|
-
|
3195
|
-
|
3196
|
-
|
3197
|
-
|
3198
|
-
|
3199
|
-
|
3200
|
-
|
3201
|
-
|
3202
|
-
|
3203
|
-
|
3204
|
-
|
3205
|
-
|
3206
|
-
|
3207
|
-
|
3208
|
-
|
3209
|
-
|
3210
|
-
|
3211
|
-
|
3212
|
-
|
3213
|
-
message: formatAPIError(availabilityError)
|
3214
|
-
});
|
3215
|
-
}
|
3216
|
-
}, [availabilityError, formatAPIError, toggleNotification]);
|
3217
|
-
React__namespace.useEffect(() => {
|
3218
|
-
setAvailability(availabilityData);
|
3219
|
-
let timer;
|
3220
|
-
if (availabilityData?.isAvailable) {
|
3221
|
-
timer = window.setTimeout(() => {
|
3222
|
-
setAvailability(void 0);
|
3223
|
-
}, 4e3);
|
3224
|
-
}
|
3225
|
-
return () => {
|
3226
|
-
if (timer) {
|
3227
|
-
clearTimeout(timer);
|
3073
|
+
}, [apiError, formatAPIError, toggleNotification]);
|
3074
|
+
React__namespace.useEffect(() => {
|
3075
|
+
if (defaultGeneratedUID && field.value === void 0) {
|
3076
|
+
field.onChange(name2, defaultGeneratedUID);
|
3077
|
+
}
|
3078
|
+
}, [defaultGeneratedUID, field, name2]);
|
3079
|
+
const [generateUID, { isLoading: isGeneratingUID }] = useGenerateUIDMutation();
|
3080
|
+
const handleRegenerateClick = async () => {
|
3081
|
+
try {
|
3082
|
+
const res = await generateUID({
|
3083
|
+
contentTypeUID: model,
|
3084
|
+
field: name2,
|
3085
|
+
data: { id: id ?? "", ...allFormValues },
|
3086
|
+
params
|
3087
|
+
});
|
3088
|
+
if ("data" in res) {
|
3089
|
+
field.onChange(name2, res.data);
|
3090
|
+
} else {
|
3091
|
+
toggleNotification({
|
3092
|
+
type: "danger",
|
3093
|
+
message: formatAPIError(res.error)
|
3094
|
+
});
|
3095
|
+
}
|
3096
|
+
} catch (err) {
|
3097
|
+
toggleNotification({
|
3098
|
+
type: "danger",
|
3099
|
+
message: formatMessage({
|
3100
|
+
id: "notification.error",
|
3101
|
+
defaultMessage: "An error occurred."
|
3102
|
+
})
|
3103
|
+
});
|
3228
3104
|
}
|
3229
3105
|
};
|
3230
|
-
|
3231
|
-
|
3232
|
-
|
3233
|
-
|
3234
|
-
|
3235
|
-
// @ts-expect-error – label _could_ be a ReactNode since it's a child, this should be fixed in the DS.
|
3236
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
3237
|
-
designSystem.TextInput,
|
3106
|
+
const {
|
3107
|
+
data: availabilityData,
|
3108
|
+
isLoading: isCheckingAvailability,
|
3109
|
+
error: availabilityError
|
3110
|
+
} = useGetAvailabilityQuery(
|
3238
3111
|
{
|
3239
|
-
|
3240
|
-
|
3241
|
-
|
3242
|
-
|
3243
|
-
|
3244
|
-
|
3245
|
-
|
3246
|
-
|
3247
|
-
|
3248
|
-
|
3249
|
-
|
3250
|
-
|
3251
|
-
|
3252
|
-
|
3253
|
-
|
3254
|
-
|
3255
|
-
|
3256
|
-
|
3257
|
-
|
3258
|
-
|
3259
|
-
|
3260
|
-
|
3261
|
-
|
3262
|
-
|
3263
|
-
|
3264
|
-
|
3265
|
-
|
3266
|
-
|
3267
|
-
|
3268
|
-
|
3269
|
-
|
3270
|
-
|
3271
|
-
|
3272
|
-
|
3273
|
-
|
3274
|
-
|
3275
|
-
|
3276
|
-
|
3277
|
-
|
3278
|
-
|
3279
|
-
|
3280
|
-
|
3281
|
-
|
3282
|
-
|
3112
|
+
contentTypeUID: model,
|
3113
|
+
field: name2,
|
3114
|
+
value: debouncedValue ? debouncedValue.trim() : "",
|
3115
|
+
params
|
3116
|
+
},
|
3117
|
+
{
|
3118
|
+
skip: !Boolean(
|
3119
|
+
debouncedValue !== field.initialValue && debouncedValue && UID_REGEX.test(debouncedValue.trim())
|
3120
|
+
)
|
3121
|
+
}
|
3122
|
+
);
|
3123
|
+
React__namespace.useEffect(() => {
|
3124
|
+
if (availabilityError) {
|
3125
|
+
toggleNotification({
|
3126
|
+
type: "warning",
|
3127
|
+
message: formatAPIError(availabilityError)
|
3128
|
+
});
|
3129
|
+
}
|
3130
|
+
}, [availabilityError, formatAPIError, toggleNotification]);
|
3131
|
+
React__namespace.useEffect(() => {
|
3132
|
+
setAvailability(availabilityData);
|
3133
|
+
let timer;
|
3134
|
+
if (availabilityData?.isAvailable) {
|
3135
|
+
timer = window.setTimeout(() => {
|
3136
|
+
setAvailability(void 0);
|
3137
|
+
}, 4e3);
|
3138
|
+
}
|
3139
|
+
return () => {
|
3140
|
+
if (timer) {
|
3141
|
+
clearTimeout(timer);
|
3142
|
+
}
|
3143
|
+
};
|
3144
|
+
}, [availabilityData]);
|
3145
|
+
const isLoading = isGeneratingDefaultUID || isGeneratingUID || isCheckingAvailability;
|
3146
|
+
const fieldRef = strapiAdmin.useFocusInputField(name2);
|
3147
|
+
const composedRefs = designSystem.useComposedRefs(ref, fieldRef);
|
3148
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { hint, name: name2, error: field.error, required, children: [
|
3149
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
|
3150
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
3151
|
+
designSystem.TextInput,
|
3152
|
+
{
|
3153
|
+
ref: composedRefs,
|
3154
|
+
disabled: props.disabled,
|
3155
|
+
endAction: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { position: "relative", gap: 1, children: [
|
3156
|
+
availability && !showRegenerate && /* @__PURE__ */ jsxRuntime.jsxs(
|
3157
|
+
TextValidation,
|
3283
3158
|
{
|
3284
|
-
|
3285
|
-
|
3286
|
-
|
3287
|
-
|
3288
|
-
|
3289
|
-
|
3290
|
-
|
3291
|
-
|
3159
|
+
alignItems: "center",
|
3160
|
+
gap: 1,
|
3161
|
+
justifyContent: "flex-end",
|
3162
|
+
$available: !!availability?.isAvailable,
|
3163
|
+
"data-not-here-outer": true,
|
3164
|
+
position: "absolute",
|
3165
|
+
pointerEvents: "none",
|
3166
|
+
right: 6,
|
3167
|
+
width: "100px",
|
3168
|
+
children: [
|
3169
|
+
availability?.isAvailable ? /* @__PURE__ */ jsxRuntime.jsx(Icons.CheckCircle, {}) : /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}),
|
3170
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
3171
|
+
designSystem.Typography,
|
3172
|
+
{
|
3173
|
+
textColor: availability.isAvailable ? "success600" : "danger600",
|
3174
|
+
variant: "pi",
|
3175
|
+
children: formatMessage(
|
3176
|
+
availability.isAvailable ? {
|
3177
|
+
id: "content-manager.components.uid.available",
|
3178
|
+
defaultMessage: "Available"
|
3179
|
+
} : {
|
3180
|
+
id: "content-manager.components.uid.unavailable",
|
3181
|
+
defaultMessage: "Unavailable"
|
3182
|
+
}
|
3183
|
+
)
|
3184
|
+
}
|
3185
|
+
)
|
3186
|
+
]
|
3292
3187
|
}
|
3293
|
-
)
|
3294
|
-
|
3295
|
-
|
3296
|
-
|
3297
|
-
|
3298
|
-
|
3299
|
-
|
3300
|
-
|
3301
|
-
|
3302
|
-
|
3303
|
-
|
3188
|
+
),
|
3189
|
+
!props.disabled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
3190
|
+
showRegenerate && /* @__PURE__ */ jsxRuntime.jsx(TextValidation, { alignItems: "center", justifyContent: "flex-end", gap: 1, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "primary600", variant: "pi", children: formatMessage({
|
3191
|
+
id: "content-manager.components.uid.regenerate",
|
3192
|
+
defaultMessage: "Regenerate"
|
3193
|
+
}) }) }),
|
3194
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
3195
|
+
FieldActionWrapper,
|
3196
|
+
{
|
3197
|
+
onClick: handleRegenerateClick,
|
3198
|
+
label: formatMessage({
|
3199
|
+
id: "content-manager.components.uid.regenerate",
|
3200
|
+
defaultMessage: "Regenerate"
|
3201
|
+
}),
|
3202
|
+
onMouseEnter: () => setShowRegenerate(true),
|
3203
|
+
onMouseLeave: () => setShowRegenerate(false),
|
3204
|
+
children: isLoading ? /* @__PURE__ */ jsxRuntime.jsx(LoadingWrapper, { "data-testid": "loading-wrapper", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Loader, {}) }) : /* @__PURE__ */ jsxRuntime.jsx(Icons.ArrowClockwise, {})
|
3205
|
+
}
|
3206
|
+
)
|
3207
|
+
] })
|
3208
|
+
] }),
|
3209
|
+
onChange: field.onChange,
|
3210
|
+
value: field.value ?? "",
|
3211
|
+
...props
|
3212
|
+
}
|
3213
|
+
),
|
3214
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {}),
|
3215
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
|
3216
|
+
] });
|
3217
|
+
}
|
3218
|
+
);
|
3219
|
+
const FieldActionWrapper = styledComponents.styled(designSystem.Field.Action)`
|
3220
|
+
width: 1.6rem;
|
3221
|
+
|
3304
3222
|
svg {
|
3305
3223
|
height: 1.6rem;
|
3306
3224
|
width: 1.6rem;
|
@@ -3315,17 +3233,17 @@ const FieldActionWrapper = styled__default.default(designSystem.FieldAction)`
|
|
3315
3233
|
}
|
3316
3234
|
}
|
3317
3235
|
`;
|
3318
|
-
const TextValidation =
|
3236
|
+
const TextValidation = styledComponents.styled(designSystem.Flex)`
|
3319
3237
|
svg {
|
3320
3238
|
height: 1.2rem;
|
3321
3239
|
width: 1.2rem;
|
3322
3240
|
|
3323
3241
|
path {
|
3324
|
-
fill: ${({ theme, available }) => available ? theme.colors.success600 : theme.colors.danger600};
|
3242
|
+
fill: ${({ theme, $available }) => $available ? theme.colors.success600 : theme.colors.danger600};
|
3325
3243
|
}
|
3326
3244
|
}
|
3327
3245
|
`;
|
3328
|
-
const rotation =
|
3246
|
+
const rotation = styledComponents.keyframes`
|
3329
3247
|
from {
|
3330
3248
|
transform: rotate(0deg);
|
3331
3249
|
}
|
@@ -3333,9 +3251,10 @@ const rotation = styled.keyframes`
|
|
3333
3251
|
transform: rotate(359deg);
|
3334
3252
|
}
|
3335
3253
|
`;
|
3336
|
-
const LoadingWrapper =
|
3254
|
+
const LoadingWrapper = styledComponents.styled(designSystem.Flex)`
|
3337
3255
|
animation: ${rotation} 2s infinite linear;
|
3338
3256
|
`;
|
3257
|
+
const MemoizedUIDInput = React__namespace.memo(UIDInput);
|
3339
3258
|
const md = new Markdown__default.default({
|
3340
3259
|
html: true,
|
3341
3260
|
// Enable HTML tags in source
|
@@ -3378,7 +3297,7 @@ const PreviewWysiwyg = ({ data = "" }) => {
|
|
3378
3297
|
);
|
3379
3298
|
return /* @__PURE__ */ jsxRuntime.jsx(Wrapper, { children: /* @__PURE__ */ jsxRuntime.jsx("div", { dangerouslySetInnerHTML: { __html: html } }) });
|
3380
3299
|
};
|
3381
|
-
const Wrapper =
|
3300
|
+
const Wrapper = styledComponents.styled.div`
|
3382
3301
|
position: absolute;
|
3383
3302
|
top: 0;
|
3384
3303
|
width: 100%;
|
@@ -3670,17 +3589,17 @@ const Editor = React__namespace.forwardRef(
|
|
3670
3589
|
[editorRef]
|
3671
3590
|
);
|
3672
3591
|
return /* @__PURE__ */ jsxRuntime.jsxs(EditorAndPreviewWrapper, { children: [
|
3673
|
-
/* @__PURE__ */ jsxRuntime.jsx(EditorStylesContainer, { isExpandMode, disabled: disabled || isPreviewMode, children: /* @__PURE__ */ jsxRuntime.jsx("textarea", { ref: textareaRef }) }),
|
3592
|
+
/* @__PURE__ */ jsxRuntime.jsx(EditorStylesContainer, { $isExpandMode: isExpandMode, $disabled: disabled || isPreviewMode, children: /* @__PURE__ */ jsxRuntime.jsx("textarea", { ref: textareaRef }) }),
|
3674
3593
|
isPreviewMode && /* @__PURE__ */ jsxRuntime.jsx(PreviewWysiwyg, { data: value })
|
3675
3594
|
] });
|
3676
3595
|
}
|
3677
3596
|
);
|
3678
|
-
const EditorAndPreviewWrapper =
|
3597
|
+
const EditorAndPreviewWrapper = styledComponents.styled.div`
|
3679
3598
|
position: relative;
|
3680
3599
|
height: calc(100% - 48px);
|
3681
3600
|
`;
|
3682
|
-
const EditorStylesContainer =
|
3683
|
-
cursor: ${({ disabled }) => disabled ? "not-allowed !important" : "auto"};
|
3601
|
+
const EditorStylesContainer = styledComponents.styled.div`
|
3602
|
+
cursor: ${({ $disabled }) => $disabled ? "not-allowed !important" : "auto"};
|
3684
3603
|
height: 100%;
|
3685
3604
|
/* BASICS */
|
3686
3605
|
.CodeMirror-placeholder {
|
@@ -3690,7 +3609,7 @@ const EditorStylesContainer = styled__default.default.div`
|
|
3690
3609
|
.CodeMirror {
|
3691
3610
|
/* Set height, width, borders, and global font properties here */
|
3692
3611
|
font-size: 1.4rem;
|
3693
|
-
height: ${({ isExpandMode }) => isExpandMode ? "100%" : "410px"}; // 512px(total height) - 48px (header) - 52px(footer) - 2px border
|
3612
|
+
height: ${({ $isExpandMode }) => $isExpandMode ? "100%" : "410px"}; // 512px(total height) - 48px (header) - 52px(footer) - 2px border
|
3694
3613
|
color: ${({ theme }) => theme.colors.neutral800};
|
3695
3614
|
direction: ltr;
|
3696
3615
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell,
|
@@ -4096,13 +4015,13 @@ const EditorLayout = ({
|
|
4096
4015
|
}
|
4097
4016
|
);
|
4098
4017
|
};
|
4099
|
-
const ExpandWrapper =
|
4018
|
+
const ExpandWrapper = styledComponents.styled(designSystem.Flex)`
|
4100
4019
|
background: ${({ theme }) => `${theme.colors.neutral800}${Math.floor(0.2 * 255).toString(16).padStart(2, "0")}`};
|
4101
4020
|
`;
|
4102
|
-
const BoxWithBorder =
|
4021
|
+
const BoxWithBorder = styledComponents.styled(designSystem.Box)`
|
4103
4022
|
border-right: 1px solid ${({ theme }) => theme.colors.neutral200};
|
4104
4023
|
`;
|
4105
|
-
const ExpandButton$1 =
|
4024
|
+
const ExpandButton$1 = styledComponents.styled(designSystem.BaseButton)`
|
4106
4025
|
background-color: transparent;
|
4107
4026
|
border: none;
|
4108
4027
|
align-items: center;
|
@@ -4373,26 +4292,24 @@ const quoteAndCodeHandler = (editor, markdownType) => {
|
|
4373
4292
|
insertWithoutTextToEdit(editor, markdownType, line, contentLength);
|
4374
4293
|
}
|
4375
4294
|
};
|
4376
|
-
const CustomIconButton =
|
4295
|
+
const CustomIconButton = styledComponents.styled(designSystem.IconButton)`
|
4377
4296
|
padding: ${({ theme }) => theme.spaces[2]};
|
4378
|
-
/* Trick to prevent the outline from overflowing because of the general outline-offset */
|
4379
|
-
outline-offset: -2px !important;
|
4380
4297
|
|
4381
4298
|
svg {
|
4382
4299
|
width: 1.8rem;
|
4383
4300
|
height: 1.8rem;
|
4384
4301
|
}
|
4385
4302
|
`;
|
4386
|
-
const CustomLinkIconButton =
|
4303
|
+
const CustomLinkIconButton = styledComponents.styled(CustomIconButton)`
|
4387
4304
|
svg {
|
4388
4305
|
width: 0.8rem;
|
4389
4306
|
height: 0.8rem;
|
4390
4307
|
}
|
4391
4308
|
`;
|
4392
|
-
const MainButtons =
|
4309
|
+
const MainButtons = styledComponents.styled(designSystem.IconButtonGroup)`
|
4393
4310
|
margin-left: ${({ theme }) => theme.spaces[4]};
|
4394
4311
|
`;
|
4395
|
-
const MoreButton =
|
4312
|
+
const MoreButton = styledComponents.styled(designSystem.IconButton)`
|
4396
4313
|
margin: ${({ theme }) => `0 ${theme.spaces[2]}`};
|
4397
4314
|
padding: ${({ theme }) => theme.spaces[2]};
|
4398
4315
|
|
@@ -4401,10 +4318,10 @@ const MoreButton = styled__default.default(designSystem.IconButton)`
|
|
4401
4318
|
height: 1.8rem;
|
4402
4319
|
}
|
4403
4320
|
`;
|
4404
|
-
const IconButtonGroupMargin =
|
4321
|
+
const IconButtonGroupMargin = styledComponents.styled(designSystem.IconButtonGroup)`
|
4405
4322
|
margin-right: ${({ theme }) => `${theme.spaces[2]}`};
|
4406
4323
|
`;
|
4407
|
-
const ExpandButton =
|
4324
|
+
const ExpandButton = styledComponents.styled(designSystem.BaseButton)`
|
4408
4325
|
background-color: transparent;
|
4409
4326
|
border: none;
|
4410
4327
|
align-items: center;
|
@@ -4443,7 +4360,7 @@ const WysiwygNav = ({
|
|
4443
4360
|
id: "components.Wysiwyg.selectOptions.title",
|
4444
4361
|
defaultMessage: "Add a title"
|
4445
4362
|
});
|
4446
|
-
|
4363
|
+
React__namespace.useRef(null);
|
4447
4364
|
const handleTogglePopover = () => {
|
4448
4365
|
setVisiblePopover((prev) => !prev);
|
4449
4366
|
};
|
@@ -4456,21 +4373,21 @@ const WysiwygNav = ({
|
|
4456
4373
|
justifyContent: "space-between",
|
4457
4374
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4458
4375
|
children: [
|
4459
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
4460
|
-
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelect, { disabled: true, placeholder: selectPlaceholder,
|
4376
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
4377
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.SingleSelect, { disabled: true, placeholder: selectPlaceholder, "aria-label": selectPlaceholder, children: [
|
4461
4378
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
4462
4379
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h2", children: "h2" }),
|
4463
4380
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h3", children: "h3" }),
|
4464
4381
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h4", children: "h4" }),
|
4465
4382
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h5", children: "h5" }),
|
4466
4383
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
|
4467
|
-
] }),
|
4384
|
+
] }) }),
|
4468
4385
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4469
|
-
/* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold",
|
4470
|
-
/* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic",
|
4471
|
-
/* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline",
|
4386
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Bold", name: "Bold", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {}) }),
|
4387
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Italic", name: "Italic", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {}) }),
|
4388
|
+
/* @__PURE__ */ jsxRuntime.jsx(CustomIconButton, { disabled: true, label: "Underline", name: "Underline", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {}) })
|
4472
4389
|
] }),
|
4473
|
-
/* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More",
|
4390
|
+
/* @__PURE__ */ jsxRuntime.jsx(MoreButton, { disabled: true, label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) })
|
4474
4391
|
] }),
|
4475
4392
|
!isExpandMode && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onTogglePreviewMode, variant: "tertiary", children: formatMessage({
|
4476
4393
|
id: "components.Wysiwyg.ToggleMode.markdown-mode",
|
@@ -4488,13 +4405,12 @@ const WysiwygNav = ({
|
|
4488
4405
|
justifyContent: "space-between",
|
4489
4406
|
borderRadius: `0.4rem 0.4rem 0 0`,
|
4490
4407
|
children: [
|
4491
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
4492
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
4408
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
|
4409
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(
|
4493
4410
|
designSystem.SingleSelect,
|
4494
4411
|
{
|
4495
4412
|
placeholder: selectPlaceholder,
|
4496
|
-
label: selectPlaceholder,
|
4497
|
-
size: "S",
|
4413
|
+
"aria-label": selectPlaceholder,
|
4498
4414
|
onChange: (value) => onActionClick(value, editorRef),
|
4499
4415
|
children: [
|
4500
4416
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h1", children: "h1" }),
|
@@ -4505,7 +4421,7 @@ const WysiwygNav = ({
|
|
4505
4421
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: "h6", children: "h6" })
|
4506
4422
|
]
|
4507
4423
|
}
|
4508
|
-
),
|
4424
|
+
) }),
|
4509
4425
|
/* @__PURE__ */ jsxRuntime.jsxs(MainButtons, { children: [
|
4510
4426
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4511
4427
|
CustomIconButton,
|
@@ -4513,7 +4429,7 @@ const WysiwygNav = ({
|
|
4513
4429
|
onClick: () => onActionClick("Bold", editorRef),
|
4514
4430
|
label: "Bold",
|
4515
4431
|
name: "Bold",
|
4516
|
-
|
4432
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Bold, {})
|
4517
4433
|
}
|
4518
4434
|
),
|
4519
4435
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -4522,7 +4438,7 @@ const WysiwygNav = ({
|
|
4522
4438
|
onClick: () => onActionClick("Italic", editorRef),
|
4523
4439
|
label: "Italic",
|
4524
4440
|
name: "Italic",
|
4525
|
-
|
4441
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Italic, {})
|
4526
4442
|
}
|
4527
4443
|
),
|
4528
4444
|
/* @__PURE__ */ jsxRuntime.jsx(
|
@@ -4531,91 +4447,85 @@ const WysiwygNav = ({
|
|
4531
4447
|
onClick: () => onActionClick("Underline", editorRef),
|
4532
4448
|
label: "Underline",
|
4533
4449
|
name: "Underline",
|
4534
|
-
|
4450
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Underline, {})
|
4535
4451
|
}
|
4536
4452
|
)
|
4537
4453
|
] }),
|
4538
|
-
/* @__PURE__ */ jsxRuntime.
|
4539
|
-
MoreButton,
|
4540
|
-
{
|
4541
|
-
|
4542
|
-
|
4543
|
-
|
4544
|
-
|
4545
|
-
|
4546
|
-
|
4547
|
-
|
4548
|
-
|
4549
|
-
|
4550
|
-
|
4551
|
-
|
4552
|
-
|
4553
|
-
|
4554
|
-
|
4555
|
-
|
4556
|
-
|
4557
|
-
|
4558
|
-
|
4559
|
-
|
4560
|
-
|
4561
|
-
|
4562
|
-
|
4563
|
-
|
4564
|
-
|
4565
|
-
|
4566
|
-
|
4567
|
-
|
4568
|
-
|
4569
|
-
|
4570
|
-
|
4571
|
-
|
4572
|
-
|
4573
|
-
|
4574
|
-
|
4575
|
-
|
4576
|
-
|
4577
|
-
|
4578
|
-
|
4579
|
-
|
4580
|
-
|
4581
|
-
|
4582
|
-
|
4583
|
-
|
4584
|
-
|
4585
|
-
|
4586
|
-
|
4587
|
-
|
4588
|
-
|
4589
|
-
|
4590
|
-
|
4591
|
-
|
4592
|
-
|
4593
|
-
|
4594
|
-
|
4595
|
-
|
4596
|
-
|
4597
|
-
|
4598
|
-
|
4599
|
-
|
4600
|
-
|
4601
|
-
|
4602
|
-
|
4603
|
-
|
4604
|
-
|
4605
|
-
|
4606
|
-
|
4607
|
-
|
4608
|
-
|
4609
|
-
|
4610
|
-
|
4611
|
-
|
4612
|
-
|
4613
|
-
name: "Quote",
|
4614
|
-
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.Quotes, {})
|
4615
|
-
}
|
4616
|
-
)
|
4617
|
-
] })
|
4618
|
-
] }) })
|
4454
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Popover.Root, { children: [
|
4455
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Trigger, { children: /* @__PURE__ */ jsxRuntime.jsx(MoreButton, { label: "More", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.More, {}) }) }),
|
4456
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Popover.Content, { sideOffset: 12, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 2, children: [
|
4457
|
+
/* @__PURE__ */ jsxRuntime.jsxs(IconButtonGroupMargin, { children: [
|
4458
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
4459
|
+
CustomIconButton,
|
4460
|
+
{
|
4461
|
+
onClick: () => onActionClick("Strikethrough", editorRef, handleTogglePopover),
|
4462
|
+
label: "Strikethrough",
|
4463
|
+
name: "Strikethrough",
|
4464
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.StrikeThrough, {})
|
4465
|
+
}
|
4466
|
+
),
|
4467
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
4468
|
+
CustomIconButton,
|
4469
|
+
{
|
4470
|
+
onClick: () => onActionClick("BulletList", editorRef, handleTogglePopover),
|
4471
|
+
label: "BulletList",
|
4472
|
+
name: "BulletList",
|
4473
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.BulletList, {})
|
4474
|
+
}
|
4475
|
+
),
|
4476
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
4477
|
+
CustomIconButton,
|
4478
|
+
{
|
4479
|
+
onClick: () => onActionClick("NumberList", editorRef, handleTogglePopover),
|
4480
|
+
label: "NumberList",
|
4481
|
+
name: "NumberList",
|
4482
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.NumberList, {})
|
4483
|
+
}
|
4484
|
+
)
|
4485
|
+
] }),
|
4486
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.IconButtonGroup, { children: [
|
4487
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
4488
|
+
CustomIconButton,
|
4489
|
+
{
|
4490
|
+
onClick: () => onActionClick("Code", editorRef, handleTogglePopover),
|
4491
|
+
label: "Code",
|
4492
|
+
name: "Code",
|
4493
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Code, {})
|
4494
|
+
}
|
4495
|
+
),
|
4496
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
4497
|
+
CustomIconButton,
|
4498
|
+
{
|
4499
|
+
onClick: () => {
|
4500
|
+
handleTogglePopover();
|
4501
|
+
onToggleMediaLib();
|
4502
|
+
},
|
4503
|
+
label: "Image",
|
4504
|
+
name: "Image",
|
4505
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Image, {})
|
4506
|
+
}
|
4507
|
+
),
|
4508
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
4509
|
+
CustomLinkIconButton,
|
4510
|
+
{
|
4511
|
+
onClick: () => onActionClick("Link", editorRef, handleTogglePopover),
|
4512
|
+
label: "Link",
|
4513
|
+
name: "Link",
|
4514
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Link, {})
|
4515
|
+
}
|
4516
|
+
),
|
4517
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
4518
|
+
CustomIconButton,
|
4519
|
+
{
|
4520
|
+
onClick: () => onActionClick("Quote", editorRef, handleTogglePopover),
|
4521
|
+
label: "Quote",
|
4522
|
+
name: "Quote",
|
4523
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(Icons.Quotes, {})
|
4524
|
+
}
|
4525
|
+
)
|
4526
|
+
] })
|
4527
|
+
] }) })
|
4528
|
+
] })
|
4619
4529
|
] }),
|
4620
4530
|
onTogglePreviewMode && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onTogglePreviewMode, variant: "tertiary", children: formatMessage({
|
4621
4531
|
id: "components.Wysiwyg.ToggleMode.preview-mode",
|
@@ -4625,19 +4535,6 @@ const WysiwygNav = ({
|
|
4625
4535
|
}
|
4626
4536
|
);
|
4627
4537
|
};
|
4628
|
-
const StyledFlex = styled__default.default(designSystem.Flex)`
|
4629
|
-
/* Hide the label, every input needs a label. */
|
4630
|
-
label {
|
4631
|
-
border: 0;
|
4632
|
-
clip: rect(0 0 0 0);
|
4633
|
-
height: 1px;
|
4634
|
-
margin: -1px;
|
4635
|
-
overflow: hidden;
|
4636
|
-
padding: 0;
|
4637
|
-
position: absolute;
|
4638
|
-
width: 1px;
|
4639
|
-
}
|
4640
|
-
`;
|
4641
4538
|
const Wysiwyg = React__namespace.forwardRef(
|
4642
4539
|
({ hint, disabled, label, name: name2, placeholder, required, labelAction }, forwardedRef) => {
|
4643
4540
|
const field = strapiAdmin.useField(name2);
|
@@ -4696,15 +4593,15 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4696
4593
|
const handleSelectAssets = (files) => {
|
4697
4594
|
const formattedFiles = files.map((f) => ({
|
4698
4595
|
alt: f.alternativeText || f.name,
|
4699
|
-
url:
|
4596
|
+
url: usePrev.prefixFileUrlWithBackendUrl(f.url),
|
4700
4597
|
mime: f.mime
|
4701
4598
|
}));
|
4702
4599
|
insertFile(editorRef, formattedFiles);
|
4703
4600
|
setMediaLibVisible(false);
|
4704
4601
|
};
|
4705
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field, { name: name2, hint, error: field.error, required, children: [
|
4602
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: name2, hint, error: field.error, required, children: [
|
4706
4603
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 1, children: [
|
4707
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
4604
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { action: labelAction, children: label }),
|
4708
4605
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
4709
4606
|
EditorLayout,
|
4710
4607
|
{
|
@@ -4745,14 +4642,15 @@ const Wysiwyg = React__namespace.forwardRef(
|
|
4745
4642
|
]
|
4746
4643
|
}
|
4747
4644
|
),
|
4748
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
4749
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
4645
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {}),
|
4646
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
|
4750
4647
|
] }),
|
4751
4648
|
mediaLibVisible && // @ts-expect-error – TODO: fix this way of injecting because it's not really typeable without a registry.
|
4752
4649
|
/* @__PURE__ */ jsxRuntime.jsx(MediaLibraryDialog, { onClose: handleToggleMediaLib, onSelectAssets: handleSelectAssets })
|
4753
4650
|
] });
|
4754
4651
|
}
|
4755
4652
|
);
|
4653
|
+
const MemoizedWysiwyg = React__namespace.memo(Wysiwyg);
|
4756
4654
|
const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
4757
4655
|
const { id } = index.useDoc();
|
4758
4656
|
const isFormDisabled = strapiAdmin.useForm("InputRenderer", (state) => state.disabled);
|
@@ -4802,10 +4700,10 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4802
4700
|
}
|
4803
4701
|
switch (props.type) {
|
4804
4702
|
case "blocks":
|
4805
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
4703
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MemoizedBlocksInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
4806
4704
|
case "component":
|
4807
4705
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4808
|
-
|
4706
|
+
MemoizedComponentInput,
|
4809
4707
|
{
|
4810
4708
|
...props,
|
4811
4709
|
hint,
|
@@ -4817,11 +4715,11 @@ const InputRenderer = ({ visible, hint: providedHint, ...props }) => {
|
|
4817
4715
|
case "dynamiczone":
|
4818
4716
|
return /* @__PURE__ */ jsxRuntime.jsx(DynamicZone, { ...props, hint, disabled: fieldIsDisabled });
|
4819
4717
|
case "relation":
|
4820
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Relations.
|
4718
|
+
return /* @__PURE__ */ jsxRuntime.jsx(Relations.MemoizedRelationsField, { ...props, hint, disabled: fieldIsDisabled });
|
4821
4719
|
case "richtext":
|
4822
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
4720
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MemoizedWysiwyg, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
4823
4721
|
case "uid":
|
4824
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
4722
|
+
return /* @__PURE__ */ jsxRuntime.jsx(MemoizedUIDInput, { ...props, hint, type: props.type, disabled: fieldIsDisabled });
|
4825
4723
|
case "enumeration":
|
4826
4724
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
4827
4725
|
strapiAdmin.InputRenderer,
|
@@ -4893,6 +4791,7 @@ const getMinMax = (attribute) => {
|
|
4893
4791
|
return { maximum: void 0, minimum: void 0 };
|
4894
4792
|
}
|
4895
4793
|
};
|
4794
|
+
const MemoizedInputRenderer = React.memo(InputRenderer);
|
4896
4795
|
const DynamicComponent = ({
|
4897
4796
|
componentUid,
|
4898
4797
|
disabled,
|
@@ -4906,7 +4805,6 @@ const DynamicComponent = ({
|
|
4906
4805
|
dynamicComponentsByCategory = {},
|
4907
4806
|
onAddComponent
|
4908
4807
|
}) => {
|
4909
|
-
const [isOpen, setIsOpen] = React__namespace.useState(true);
|
4910
4808
|
const { formatMessage } = reactIntl.useIntl();
|
4911
4809
|
const formValues = strapiAdmin.useForm("DynamicComponent", (state) => state.values);
|
4912
4810
|
const {
|
@@ -4915,7 +4813,7 @@ const DynamicComponent = ({
|
|
4915
4813
|
const title = React__namespace.useMemo(() => {
|
4916
4814
|
const { mainField } = components[componentUid]?.settings ?? { mainField: "id" };
|
4917
4815
|
const mainFieldValue = objects.getIn(formValues, `${name2}.${index$1}.${mainField}`);
|
4918
|
-
const displayedValue = mainField === "id" ? "" : String(mainFieldValue).trim();
|
4816
|
+
const displayedValue = mainField === "id" || !mainFieldValue ? "" : String(mainFieldValue).trim();
|
4919
4817
|
const mainValue = displayedValue.length > 0 ? `- ${displayedValue}` : displayedValue;
|
4920
4818
|
return mainValue;
|
4921
4819
|
}, [componentUid, components, formValues, name2, index$1]);
|
@@ -4926,9 +4824,6 @@ const DynamicComponent = ({
|
|
4926
4824
|
) ?? { icon: null, displayName: null };
|
4927
4825
|
return { icon: icon2, displayName: displayName2 };
|
4928
4826
|
}, [componentUid, dynamicComponentsByCategory]);
|
4929
|
-
const handleToggle = () => {
|
4930
|
-
setIsOpen((s) => !s);
|
4931
|
-
};
|
4932
4827
|
const [{ handlerId, isDragging, handleKeyDown }, boxRef, dropRef, dragRef, dragPreviewRef] = useDragAndDrop.useDragAndDrop(!disabled, {
|
4933
4828
|
type: `${useDragAndDrop.ItemTypes.DYNAMIC_ZONE}_${name2}`,
|
4934
4829
|
index: index$1,
|
@@ -4946,9 +4841,9 @@ const DynamicComponent = ({
|
|
4946
4841
|
dragPreviewRef(reactDndHtml5Backend.getEmptyImage(), { captureDraggingState: false });
|
4947
4842
|
}, [dragPreviewRef, index$1]);
|
4948
4843
|
const composedBoxRefs = designSystem.useComposedRefs(boxRef, dropRef);
|
4949
|
-
const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(
|
4844
|
+
const accordionActions = disabled ? null : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
4950
4845
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4951
|
-
|
4846
|
+
designSystem.IconButton,
|
4952
4847
|
{
|
4953
4848
|
borderWidth: 0,
|
4954
4849
|
label: formatMessage(
|
@@ -4965,10 +4860,7 @@ const DynamicComponent = ({
|
|
4965
4860
|
/* @__PURE__ */ jsxRuntime.jsx(
|
4966
4861
|
designSystem.IconButton,
|
4967
4862
|
{
|
4968
|
-
forwardedAs: "div",
|
4969
|
-
role: "button",
|
4970
4863
|
borderWidth: 0,
|
4971
|
-
tabIndex: 0,
|
4972
4864
|
onClick: (e) => e.stopPropagation(),
|
4973
4865
|
"data-handler-id": handlerId,
|
4974
4866
|
ref: dragRef,
|
@@ -4983,7 +4875,7 @@ const DynamicComponent = ({
|
|
4983
4875
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
|
4984
4876
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Trigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
|
4985
4877
|
/* @__PURE__ */ jsxRuntime.jsx(Icons.More, { "aria-hidden": true, focusable: false }),
|
4986
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, {
|
4878
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { tag: "span", children: formatMessage({
|
4987
4879
|
id: index.getTranslation("components.DynamicZone.more-actions"),
|
4988
4880
|
defaultMessage: "More actions"
|
4989
4881
|
}) })
|
@@ -5012,62 +4904,48 @@ const DynamicComponent = ({
|
|
5012
4904
|
] })
|
5013
4905
|
] })
|
5014
4906
|
] });
|
5015
|
-
|
4907
|
+
const accordionTitle = title ? `${displayName} ${title}` : displayName;
|
4908
|
+
const accordionValue = React__namespace.useId();
|
4909
|
+
return /* @__PURE__ */ jsxRuntime.jsxs(ComponentContainer, { tag: "li", width: "100%", children: [
|
5016
4910
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Rectangle, { background: "neutral200" }) }),
|
5017
|
-
/* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.
|
5018
|
-
/* @__PURE__ */ jsxRuntime.
|
5019
|
-
|
5020
|
-
|
5021
|
-
|
5022
|
-
|
5023
|
-
|
5024
|
-
|
5025
|
-
|
5026
|
-
|
5027
|
-
|
4911
|
+
/* @__PURE__ */ jsxRuntime.jsx(StyledBox, { ref: composedBoxRefs, hasRadius: true, children: isDragging ? /* @__PURE__ */ jsxRuntime.jsx(Preview, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Root, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Item, { value: accordionValue, children: [
|
4912
|
+
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Accordion.Header, { children: [
|
4913
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
4914
|
+
designSystem.Accordion.Trigger,
|
4915
|
+
{
|
4916
|
+
icon: icon && ComponentIcon.COMPONENT_ICONS[icon] ? ComponentIcon.COMPONENT_ICONS[icon] : ComponentIcon.COMPONENT_ICONS.dashboard,
|
4917
|
+
children: accordionTitle
|
4918
|
+
}
|
4919
|
+
),
|
4920
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Accordion.Actions, { children: accordionActions })
|
4921
|
+
] }),
|
4922
|
+
/* @__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 }) => {
|
5028
4923
|
const fieldName = `${name2}.${index$1}.${field.name}`;
|
5029
|
-
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.
|
4924
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Grid.Item, { col: size, s: 12, xs: 12, children: /* @__PURE__ */ jsxRuntime.jsx(MemoizedInputRenderer, { ...field, name: fieldName }) }, fieldName);
|
5030
4925
|
}) }, rowInd)) }) }) })
|
5031
|
-
] }) })
|
4926
|
+
] }) }) })
|
5032
4927
|
] });
|
5033
4928
|
};
|
5034
|
-
const
|
5035
|
-
/*
|
5036
|
-
we need to remove the background from the button but we can't
|
5037
|
-
wrap the element in styled because it breaks the forwardedAs which
|
5038
|
-
we need for drag handler to work on firefox
|
5039
|
-
*/
|
5040
|
-
div[role='button'] {
|
5041
|
-
background: transparent;
|
5042
|
-
}
|
5043
|
-
`;
|
5044
|
-
const IconButtonCustom = styled__default.default(designSystem.IconButton)`
|
5045
|
-
background-color: transparent;
|
5046
|
-
|
5047
|
-
svg path {
|
5048
|
-
fill: ${({ theme, expanded }) => expanded ? theme.colors.primary600 : theme.colors.neutral600};
|
5049
|
-
}
|
5050
|
-
`;
|
5051
|
-
const StyledBox = styled__default.default(designSystem.Box)`
|
4929
|
+
const StyledBox = styledComponents.styled(designSystem.Box)`
|
5052
4930
|
> div:first-child {
|
5053
4931
|
box-shadow: ${({ theme }) => theme.shadows.tableShadow};
|
5054
4932
|
}
|
5055
4933
|
`;
|
5056
|
-
const AccordionContentRadius =
|
4934
|
+
const AccordionContentRadius = styledComponents.styled(designSystem.Box)`
|
5057
4935
|
border-radius: 0 0 ${({ theme }) => theme.spaces[1]} ${({ theme }) => theme.spaces[1]};
|
5058
4936
|
`;
|
5059
|
-
const Rectangle =
|
4937
|
+
const Rectangle = styledComponents.styled(designSystem.Box)`
|
5060
4938
|
width: ${({ theme }) => theme.spaces[2]};
|
5061
4939
|
height: ${({ theme }) => theme.spaces[4]};
|
5062
4940
|
`;
|
5063
|
-
const Preview =
|
4941
|
+
const Preview = styledComponents.styled.span`
|
5064
4942
|
display: block;
|
5065
4943
|
background-color: ${({ theme }) => theme.colors.primary100};
|
5066
4944
|
outline: 1px dashed ${({ theme }) => theme.colors.primary500};
|
5067
4945
|
outline-offset: -1px;
|
5068
4946
|
padding: ${({ theme }) => theme.spaces[6]};
|
5069
4947
|
`;
|
5070
|
-
const ComponentContainer =
|
4948
|
+
const ComponentContainer = styledComponents.styled(designSystem.Box)`
|
5071
4949
|
list-style: none;
|
5072
4950
|
padding: 0;
|
5073
4951
|
margin: 0;
|
@@ -5118,7 +4996,7 @@ const [DynamicZoneProvider, useDynamicZone] = strapiAdmin.createContext(
|
|
5118
4996
|
);
|
5119
4997
|
const DynamicZone = ({
|
5120
4998
|
attribute,
|
5121
|
-
disabled,
|
4999
|
+
disabled: disabledProp,
|
5122
5000
|
hint,
|
5123
5001
|
label,
|
5124
5002
|
labelAction,
|
@@ -5128,7 +5006,8 @@ const DynamicZone = ({
|
|
5128
5006
|
const { max = Infinity, min = -Infinity } = attribute ?? {};
|
5129
5007
|
const [addComponentIsOpen, setAddComponentIsOpen] = React__namespace.useState(false);
|
5130
5008
|
const [liveText, setLiveText] = React__namespace.useState("");
|
5131
|
-
const { components } = index.useDoc();
|
5009
|
+
const { components, isLoading } = index.useDoc();
|
5010
|
+
const disabled = disabledProp || isLoading;
|
5132
5011
|
const { addFieldRow, removeFieldRow, moveFieldRow } = strapiAdmin.useForm(
|
5133
5012
|
"DynamicZone",
|
5134
5013
|
({ addFieldRow: addFieldRow2, removeFieldRow: removeFieldRow2, moveFieldRow: moveFieldRow2 }) => ({
|
@@ -5335,13 +5214,13 @@ const DynamicZone = ({
|
|
5335
5214
|
)
|
5336
5215
|
] }) });
|
5337
5216
|
};
|
5338
|
-
exports.BlocksInput = BlocksInput;
|
5339
|
-
exports.ComponentInput = ComponentInput;
|
5340
5217
|
exports.DynamicZone = DynamicZone;
|
5341
|
-
exports.
|
5218
|
+
exports.MemoizedBlocksInput = MemoizedBlocksInput;
|
5219
|
+
exports.MemoizedComponentInput = MemoizedComponentInput;
|
5220
|
+
exports.MemoizedInputRenderer = MemoizedInputRenderer;
|
5221
|
+
exports.MemoizedUIDInput = MemoizedUIDInput;
|
5222
|
+
exports.MemoizedWysiwyg = MemoizedWysiwyg;
|
5342
5223
|
exports.NotAllowedInput = NotAllowedInput;
|
5343
|
-
exports.UIDInput = UIDInput;
|
5344
|
-
exports.Wysiwyg = Wysiwyg;
|
5345
5224
|
exports.createDefaultForm = createDefaultForm;
|
5346
5225
|
exports.prepareTempKeys = prepareTempKeys;
|
5347
5226
|
exports.removeFieldsThatDontExistOnSchema = removeFieldsThatDontExistOnSchema;
|
@@ -5349,4 +5228,4 @@ exports.transformDocument = transformDocument;
|
|
5349
5228
|
exports.useDynamicZone = useDynamicZone;
|
5350
5229
|
exports.useFieldHint = useFieldHint;
|
5351
5230
|
exports.useLazyComponents = useLazyComponents;
|
5352
|
-
//# sourceMappingURL=Field-
|
5231
|
+
//# sourceMappingURL=Field-BG1xu38N.js.map
|