@strapi/content-manager 5.4.2 → 5.5.0
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-C0QyJgRA.js.map +1 -1
- package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-N-CTtgQa.js → ComponentConfigurationPage-BPiQrhZ6.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-N-CTtgQa.js.map → ComponentConfigurationPage-BPiQrhZ6.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BaJMOQyq.mjs → ComponentConfigurationPage-viOAdZM6.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BaJMOQyq.mjs.map → ComponentConfigurationPage-viOAdZM6.mjs.map} +1 -1
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
- package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
- package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
- package/dist/_chunks/{EditConfigurationPage-BHkjAbxH.js → EditConfigurationPage-CZRKq8CN.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-BHkjAbxH.js.map → EditConfigurationPage-CZRKq8CN.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CKK-5LfX.mjs → EditConfigurationPage-DKtPyjs_.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CKK-5LfX.mjs.map → EditConfigurationPage-DKtPyjs_.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-QPUftxUd.js → EditViewPage-C-TZmK5r.js} +4 -5
- package/dist/_chunks/{EditViewPage-QPUftxUd.js.map → EditViewPage-C-TZmK5r.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-B11aeMcf.mjs → EditViewPage-D2FPb5Mh.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-B11aeMcf.mjs.map → EditViewPage-D2FPb5Mh.mjs.map} +1 -1
- package/dist/_chunks/{Field-DUK83cfh.js → Field-IMBnqF-k.js} +25 -45
- package/dist/_chunks/{Field-DUK83cfh.js.map → Field-IMBnqF-k.js.map} +1 -1
- package/dist/_chunks/{Field-Bj_RgtGo.mjs → Field-hD0Y00Mt.mjs} +23 -42
- package/dist/_chunks/{Field-Bj_RgtGo.mjs.map → Field-hD0Y00Mt.mjs.map} +1 -1
- package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
- package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
- package/dist/_chunks/{Form-DHmBRlHd.js → Form-BaURS01O.js} +5 -6
- package/dist/_chunks/{Form-DHmBRlHd.js.map → Form-BaURS01O.js.map} +1 -1
- package/dist/_chunks/{Form-DLMSoXV7.mjs → Form-ZQ9fzWkd.mjs} +3 -3
- package/dist/_chunks/{Form-DLMSoXV7.mjs.map → Form-ZQ9fzWkd.mjs.map} +1 -1
- package/dist/_chunks/{History-Di3zm4HT.js → History-BqRQm2Lc.js} +5 -6
- package/dist/_chunks/{History-Di3zm4HT.js.map → History-BqRQm2Lc.js.map} +1 -1
- package/dist/_chunks/{History-CfCSNlG9.mjs → History-C4X3jiQJ.mjs} +4 -4
- package/dist/_chunks/{History-CfCSNlG9.mjs.map → History-C4X3jiQJ.mjs.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-Cq361KIt.js → ListConfigurationPage-BT69-TvF.js} +4 -5
- package/dist/_chunks/{ListConfigurationPage-Cq361KIt.js.map → ListConfigurationPage-BT69-TvF.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-0mtv_iqk.mjs → ListConfigurationPage-CwMU6tWQ.mjs} +3 -3
- package/dist/_chunks/{ListConfigurationPage-0mtv_iqk.mjs.map → ListConfigurationPage-CwMU6tWQ.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-DFDcG8gM.js → ListViewPage-CYkrfWsm.js} +4 -5
- package/dist/_chunks/{ListViewPage-DFDcG8gM.js.map → ListViewPage-CYkrfWsm.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-BxLVROX8.mjs → ListViewPage-CvxfiNTc.mjs} +3 -3
- package/dist/_chunks/{ListViewPage-BxLVROX8.mjs.map → ListViewPage-CvxfiNTc.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BSyvnDZZ.js → NoContentTypePage-BZMfRsrg.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BSyvnDZZ.js.map → NoContentTypePage-BZMfRsrg.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BRfDd67_.mjs → NoContentTypePage-Dy6sa9LT.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-BRfDd67_.mjs.map → NoContentTypePage-Dy6sa9LT.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-CV9V8KWa.mjs → NoPermissionsPage-DiW-TIzq.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-CV9V8KWa.mjs.map → NoPermissionsPage-DiW-TIzq.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DyLphsn_.js → NoPermissionsPage-DjUdvhJ6.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DyLphsn_.js.map → NoPermissionsPage-DjUdvhJ6.js.map} +1 -1
- package/dist/_chunks/{Preview-D_3aO6Ly.js → Preview-BqRUSbFU.js} +12 -7
- package/dist/_chunks/Preview-BqRUSbFU.js.map +1 -0
- package/dist/_chunks/{Preview-C_B1nx3g.mjs → Preview-DwWET-X7.mjs} +11 -5
- package/dist/_chunks/Preview-DwWET-X7.mjs.map +1 -0
- package/dist/_chunks/{Relations-C6pwmDXh.mjs → Relations-BOTC_ZqE.mjs} +6 -8
- package/dist/_chunks/{Relations-C6pwmDXh.mjs.map → Relations-BOTC_ZqE.mjs.map} +1 -1
- package/dist/_chunks/{Relations-Cne2AlrL.js → Relations-DnCdLzq_.js} +7 -10
- package/dist/_chunks/{Relations-Cne2AlrL.js.map → Relations-DnCdLzq_.js.map} +1 -1
- package/dist/_chunks/{en-Ic0kXjxB.js → en-BK8Xyl5I.js} +2 -1
- package/dist/_chunks/{en-Ic0kXjxB.js.map → en-BK8Xyl5I.js.map} +1 -1
- package/dist/_chunks/{en-DhFUjrNW.mjs → en-Dtk_ot79.mjs} +2 -1
- package/dist/_chunks/{en-DhFUjrNW.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-BpxR3En4.mjs → index-BeYsz0Vi.mjs} +80 -42
- package/dist/_chunks/index-BeYsz0Vi.mjs.map +1 -0
- package/dist/_chunks/{index-T-aWjbj2.js → index-CptTdHNy.js} +81 -44
- package/dist/_chunks/index-CptTdHNy.js.map +1 -0
- package/dist/_chunks/{layout-DhMZ_lDx.mjs → layout-CzSSEy9b.mjs} +4 -4
- package/dist/_chunks/{layout-DhMZ_lDx.mjs.map → layout-CzSSEy9b.mjs.map} +1 -1
- package/dist/_chunks/{layout-BEuNwv-F.js → layout-szfTCeYm.js} +5 -6
- package/dist/_chunks/{layout-BEuNwv-F.js.map → layout-szfTCeYm.js.map} +1 -1
- package/dist/_chunks/objects-BcXOv6_9.js.map +1 -1
- package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -1
- package/dist/_chunks/{relations-BdnxoX6f.mjs → relations-DvzmDbWc.mjs} +2 -2
- package/dist/_chunks/{relations-BdnxoX6f.mjs.map → relations-DvzmDbWc.mjs.map} +1 -1
- package/dist/_chunks/{relations-kLcuobLk.js → relations-qssSbh1V.js} +2 -2
- package/dist/_chunks/{relations-kLcuobLk.js.map → relations-qssSbh1V.js.map} +1 -1
- package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -1
- package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -1
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
- package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
- package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
- package/dist/server/index.js +18 -36
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +17 -34
- package/dist/server/index.mjs.map +1 -1
- package/package.json +9 -9
- package/dist/_chunks/Preview-C_B1nx3g.mjs.map +0 -1
- package/dist/_chunks/Preview-D_3aO6Ly.js.map +0 -1
- package/dist/_chunks/index-BpxR3En4.mjs.map +0 -1
- package/dist/_chunks/index-T-aWjbj2.js.map +0 -1
@@ -14,13 +14,20 @@ import { stringify } from "qs";
|
|
14
14
|
import pipe from "lodash/fp/pipe";
|
15
15
|
import { intervalToDuration, isPast } from "date-fns";
|
16
16
|
import { createSlice, combineReducers } from "@reduxjs/toolkit";
|
17
|
-
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
17
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
18
18
|
const v = glob[path];
|
19
19
|
if (v) {
|
20
20
|
return typeof v === "function" ? v() : Promise.resolve(v);
|
21
21
|
}
|
22
22
|
return new Promise((_, reject) => {
|
23
|
-
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
23
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
24
|
+
reject.bind(
|
25
|
+
null,
|
26
|
+
new Error(
|
27
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
28
|
+
)
|
29
|
+
)
|
30
|
+
);
|
24
31
|
});
|
25
32
|
};
|
26
33
|
const PLUGIN_ID = "content-manager";
|
@@ -453,8 +460,7 @@ const {
|
|
453
460
|
useUnpublishManyDocumentsMutation
|
454
461
|
} = documentApi;
|
455
462
|
const buildValidParams = (query) => {
|
456
|
-
if (!query)
|
457
|
-
return query;
|
463
|
+
if (!query) return query;
|
458
464
|
const { plugins: _, ...validQueryParams } = {
|
459
465
|
...query,
|
460
466
|
...Object.values(query?.plugins ?? {}).reduce(
|
@@ -1661,7 +1667,7 @@ const useDocumentActions = () => {
|
|
1661
1667
|
};
|
1662
1668
|
};
|
1663
1669
|
const ProtectedHistoryPage = React.lazy(
|
1664
|
-
() => import("./History-
|
1670
|
+
() => import("./History-C4X3jiQJ.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1665
1671
|
);
|
1666
1672
|
const routes$2 = [
|
1667
1673
|
{
|
@@ -1674,7 +1680,7 @@ const routes$2 = [
|
|
1674
1680
|
}
|
1675
1681
|
];
|
1676
1682
|
const ProtectedPreviewPage = React.lazy(
|
1677
|
-
() => import("./Preview-
|
1683
|
+
() => import("./Preview-DwWET-X7.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1678
1684
|
);
|
1679
1685
|
const routes$1 = [
|
1680
1686
|
{
|
@@ -1687,31 +1693,31 @@ const routes$1 = [
|
|
1687
1693
|
}
|
1688
1694
|
];
|
1689
1695
|
const ProtectedEditViewPage = lazy(
|
1690
|
-
() => import("./EditViewPage-
|
1696
|
+
() => import("./EditViewPage-D2FPb5Mh.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1691
1697
|
);
|
1692
1698
|
const ProtectedListViewPage = lazy(
|
1693
|
-
() => import("./ListViewPage-
|
1699
|
+
() => import("./ListViewPage-CvxfiNTc.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1694
1700
|
);
|
1695
1701
|
const ProtectedListConfiguration = lazy(
|
1696
|
-
() => import("./ListConfigurationPage-
|
1702
|
+
() => import("./ListConfigurationPage-CwMU6tWQ.mjs").then((mod) => ({
|
1697
1703
|
default: mod.ProtectedListConfiguration
|
1698
1704
|
}))
|
1699
1705
|
);
|
1700
1706
|
const ProtectedEditConfigurationPage = lazy(
|
1701
|
-
() => import("./EditConfigurationPage-
|
1707
|
+
() => import("./EditConfigurationPage-DKtPyjs_.mjs").then((mod) => ({
|
1702
1708
|
default: mod.ProtectedEditConfigurationPage
|
1703
1709
|
}))
|
1704
1710
|
);
|
1705
1711
|
const ProtectedComponentConfigurationPage = lazy(
|
1706
|
-
() => import("./ComponentConfigurationPage-
|
1712
|
+
() => import("./ComponentConfigurationPage-viOAdZM6.mjs").then((mod) => ({
|
1707
1713
|
default: mod.ProtectedComponentConfigurationPage
|
1708
1714
|
}))
|
1709
1715
|
);
|
1710
1716
|
const NoPermissions = lazy(
|
1711
|
-
() => import("./NoPermissionsPage-
|
1717
|
+
() => import("./NoPermissionsPage-DiW-TIzq.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1712
1718
|
);
|
1713
1719
|
const NoContentType = lazy(
|
1714
|
-
() => import("./NoContentTypePage-
|
1720
|
+
() => import("./NoContentTypePage-Dy6sa9LT.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1715
1721
|
);
|
1716
1722
|
const CollectionTypePages = () => {
|
1717
1723
|
const { collectionType } = useParams();
|
@@ -2242,6 +2248,7 @@ const PublishAction$1 = ({
|
|
2242
2248
|
};
|
2243
2249
|
};
|
2244
2250
|
PublishAction$1.type = "publish";
|
2251
|
+
PublishAction$1.position = "panel";
|
2245
2252
|
const UpdateAction = ({
|
2246
2253
|
activeTab,
|
2247
2254
|
documentId,
|
@@ -2354,6 +2361,7 @@ const UpdateAction = ({
|
|
2354
2361
|
};
|
2355
2362
|
};
|
2356
2363
|
UpdateAction.type = "update";
|
2364
|
+
UpdateAction.position = "panel";
|
2357
2365
|
const UNPUBLISH_DRAFT_OPTIONS = {
|
2358
2366
|
KEEP: "keep",
|
2359
2367
|
DISCARD: "discard"
|
@@ -2476,6 +2484,7 @@ const UnpublishAction$1 = ({
|
|
2476
2484
|
};
|
2477
2485
|
};
|
2478
2486
|
UnpublishAction$1.type = "unpublish";
|
2487
|
+
UnpublishAction$1.position = "panel";
|
2479
2488
|
const DiscardAction = ({
|
2480
2489
|
activeTab,
|
2481
2490
|
documentId,
|
@@ -2526,6 +2535,7 @@ const DiscardAction = ({
|
|
2526
2535
|
};
|
2527
2536
|
};
|
2528
2537
|
DiscardAction.type = "discard";
|
2538
|
+
DiscardAction.position = "panel";
|
2529
2539
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2530
2540
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2531
2541
|
const RelativeTime = React.forwardRef(
|
@@ -2645,7 +2655,7 @@ const HeaderToolbar = () => {
|
|
2645
2655
|
meta: isCloning ? void 0 : meta,
|
2646
2656
|
collectionType
|
2647
2657
|
},
|
2648
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
2658
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
|
2649
2659
|
children: (actions2) => {
|
2650
2660
|
const headerActions = actions2.filter((action) => {
|
2651
2661
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -2853,6 +2863,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2853
2863
|
};
|
2854
2864
|
};
|
2855
2865
|
ConfigureTheViewAction.type = "configure-the-view";
|
2866
|
+
ConfigureTheViewAction.position = "header";
|
2856
2867
|
const EditTheModelAction = ({ model }) => {
|
2857
2868
|
const navigate = useNavigate();
|
2858
2869
|
const { formatMessage } = useIntl();
|
@@ -2869,6 +2880,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2869
2880
|
};
|
2870
2881
|
};
|
2871
2882
|
EditTheModelAction.type = "edit-the-model";
|
2883
|
+
EditTheModelAction.position = "header";
|
2872
2884
|
const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
2873
2885
|
const navigate = useNavigate();
|
2874
2886
|
const { formatMessage } = useIntl();
|
@@ -2942,6 +2954,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
|
2942
2954
|
};
|
2943
2955
|
};
|
2944
2956
|
DeleteAction$1.type = "delete";
|
2957
|
+
DeleteAction$1.position = ["header", "table-row"];
|
2945
2958
|
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
|
2946
2959
|
const Panels = () => {
|
2947
2960
|
const isCloning = useMatch(CLONE_PATH) !== null;
|
@@ -3004,7 +3017,7 @@ const ActionsPanelContent = () => {
|
|
3004
3017
|
DescriptionComponentRenderer,
|
3005
3018
|
{
|
3006
3019
|
props,
|
3007
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3020
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
|
3008
3021
|
children: (actions2) => /* @__PURE__ */ jsx(DocumentActions, { actions: actions2 })
|
3009
3022
|
}
|
3010
3023
|
),
|
@@ -3458,8 +3471,7 @@ const PublishAction = ({ documents, model }) => {
|
|
3458
3471
|
const refetchList = () => {
|
3459
3472
|
contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
|
3460
3473
|
};
|
3461
|
-
if (!showPublishButton)
|
3462
|
-
return null;
|
3474
|
+
if (!showPublishButton) return null;
|
3463
3475
|
return {
|
3464
3476
|
actionType: "publish",
|
3465
3477
|
variant: "tertiary",
|
@@ -3527,8 +3539,7 @@ const DeleteAction = ({ documents, model }) => {
|
|
3527
3539
|
selectRow([]);
|
3528
3540
|
}
|
3529
3541
|
};
|
3530
|
-
if (!hasDeletePermission)
|
3531
|
-
return null;
|
3542
|
+
if (!hasDeletePermission) return null;
|
3532
3543
|
return {
|
3533
3544
|
variant: "danger-light",
|
3534
3545
|
label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
|
@@ -3577,8 +3588,7 @@ const UnpublishAction = ({ documents, model }) => {
|
|
3577
3588
|
}
|
3578
3589
|
};
|
3579
3590
|
const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
|
3580
|
-
if (!showUnpublishButton)
|
3581
|
-
return null;
|
3591
|
+
if (!showUnpublishButton) return null;
|
3582
3592
|
return {
|
3583
3593
|
variant: "tertiary",
|
3584
3594
|
label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
|
@@ -3683,7 +3693,7 @@ const TableActions = ({ document }) => {
|
|
3683
3693
|
DescriptionComponentRenderer,
|
3684
3694
|
{
|
3685
3695
|
props,
|
3686
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
|
3696
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
|
3687
3697
|
children: (actions2) => {
|
3688
3698
|
const tableRowActions = actions2.filter((action) => {
|
3689
3699
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3742,6 +3752,7 @@ const EditAction = ({ documentId }) => {
|
|
3742
3752
|
};
|
3743
3753
|
};
|
3744
3754
|
EditAction.type = "edit";
|
3755
|
+
EditAction.position = "table-row";
|
3745
3756
|
const StyledPencil = styled(Pencil)`
|
3746
3757
|
path {
|
3747
3758
|
fill: currentColor;
|
@@ -3818,6 +3829,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3818
3829
|
};
|
3819
3830
|
};
|
3820
3831
|
CloneAction.type = "clone";
|
3832
|
+
CloneAction.position = "table-row";
|
3821
3833
|
const StyledDuplicate = styled(Duplicate)`
|
3822
3834
|
path {
|
3823
3835
|
fill: currentColor;
|
@@ -3904,7 +3916,14 @@ class ContentManagerPlugin {
|
|
3904
3916
|
addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
|
3905
3917
|
addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
|
3906
3918
|
getBulkActions: () => this.bulkActions,
|
3907
|
-
getDocumentActions: () =>
|
3919
|
+
getDocumentActions: (position) => {
|
3920
|
+
if (position) {
|
3921
|
+
return this.documentActions.filter(
|
3922
|
+
(action) => action.position == void 0 || [action.position].flat().includes(position)
|
3923
|
+
);
|
3924
|
+
}
|
3925
|
+
return this.documentActions;
|
3926
|
+
},
|
3908
3927
|
getEditViewSidePanels: () => this.editViewSidePanels,
|
3909
3928
|
getHeaderActions: () => this.headerActions
|
3910
3929
|
}
|
@@ -3914,10 +3933,8 @@ class ContentManagerPlugin {
|
|
3914
3933
|
const getPrintableType = (value) => {
|
3915
3934
|
const nativeType = typeof value;
|
3916
3935
|
if (nativeType === "object") {
|
3917
|
-
if (value === null)
|
3918
|
-
|
3919
|
-
if (Array.isArray(value))
|
3920
|
-
return "array";
|
3936
|
+
if (value === null) return "null";
|
3937
|
+
if (Array.isArray(value)) return "array";
|
3921
3938
|
if (value instanceof Object && value.constructor.name !== "Object") {
|
3922
3939
|
return value.constructor.name;
|
3923
3940
|
}
|
@@ -3970,6 +3987,7 @@ const HistoryAction = ({ model, document }) => {
|
|
3970
3987
|
};
|
3971
3988
|
};
|
3972
3989
|
HistoryAction.type = "history";
|
3990
|
+
HistoryAction.position = "header";
|
3973
3991
|
const historyAdmin = {
|
3974
3992
|
bootstrap(app) {
|
3975
3993
|
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
@@ -4032,11 +4050,18 @@ const previewApi = contentManagerApi.injectEndpoints({
|
|
4032
4050
|
})
|
4033
4051
|
});
|
4034
4052
|
const { useGetPreviewUrlQuery } = previewApi;
|
4053
|
+
const ConditionalTooltip = ({ isShown, label, children }) => {
|
4054
|
+
if (isShown) {
|
4055
|
+
return /* @__PURE__ */ jsx(Tooltip, { label, children });
|
4056
|
+
}
|
4057
|
+
return children;
|
4058
|
+
};
|
4035
4059
|
const PreviewSidePanel = ({ model, documentId, document }) => {
|
4036
4060
|
const { formatMessage } = useIntl();
|
4037
4061
|
const { trackUsage } = useTracking();
|
4038
4062
|
const { pathname } = useLocation();
|
4039
4063
|
const [{ query }] = useQueryParams();
|
4064
|
+
const isModified = useForm("PreviewSidePanel", (state) => state.modified);
|
4040
4065
|
const { data, error } = useGetPreviewUrlQuery({
|
4041
4066
|
params: {
|
4042
4067
|
contentType: model
|
@@ -4056,20 +4081,33 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4056
4081
|
};
|
4057
4082
|
return {
|
4058
4083
|
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4059
|
-
content: /* @__PURE__ */ jsx(
|
4060
|
-
|
4084
|
+
content: /* @__PURE__ */ jsx(
|
4085
|
+
ConditionalTooltip,
|
4061
4086
|
{
|
4062
|
-
|
4063
|
-
|
4064
|
-
|
4065
|
-
|
4066
|
-
|
4067
|
-
children:
|
4068
|
-
|
4069
|
-
|
4070
|
-
|
4087
|
+
label: formatMessage({
|
4088
|
+
id: "content-manager.preview.panel.button-disabled-tooltip",
|
4089
|
+
defaultMessage: "Please save to open the preview"
|
4090
|
+
}),
|
4091
|
+
isShown: isModified,
|
4092
|
+
children: /* @__PURE__ */ jsx(Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsx(
|
4093
|
+
Button,
|
4094
|
+
{
|
4095
|
+
variant: "tertiary",
|
4096
|
+
tag: Link,
|
4097
|
+
to: { pathname: "preview", search: stringify(query, { encode: false }) },
|
4098
|
+
onClick: trackNavigation,
|
4099
|
+
width: "100%",
|
4100
|
+
disabled: isModified,
|
4101
|
+
pointerEvents: isModified ? "none" : void 0,
|
4102
|
+
tabIndex: isModified ? -1 : void 0,
|
4103
|
+
children: formatMessage({
|
4104
|
+
id: "content-manager.preview.panel.button",
|
4105
|
+
defaultMessage: "Open preview"
|
4106
|
+
})
|
4107
|
+
}
|
4108
|
+
) })
|
4071
4109
|
}
|
4072
|
-
)
|
4110
|
+
)
|
4073
4111
|
};
|
4074
4112
|
};
|
4075
4113
|
const FEATURE_ID = "preview";
|
@@ -4101,7 +4139,7 @@ const index = {
|
|
4101
4139
|
app.router.addRoute({
|
4102
4140
|
path: "content-manager/*",
|
4103
4141
|
lazy: async () => {
|
4104
|
-
const { Layout } = await import("./layout-
|
4142
|
+
const { Layout } = await import("./layout-CzSSEy9b.mjs");
|
4105
4143
|
return {
|
4106
4144
|
Component: Layout
|
4107
4145
|
};
|
@@ -4121,7 +4159,7 @@ const index = {
|
|
4121
4159
|
async registerTrads({ locales }) {
|
4122
4160
|
const importedTrads = await Promise.all(
|
4123
4161
|
locales.map((locale) => {
|
4124
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-
|
4162
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-Dtk_ot79.mjs"), "./translations/es.json": () => import("./es-D34tqjMw.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr--pg5jUbt.mjs"), "./translations/gu.json": () => import("./gu-CNpaMDpH.mjs"), "./translations/hi.json": () => import("./hi-Dwvd04m3.mjs"), "./translations/hu.json": () => import("./hu-CeYvaaO0.mjs"), "./translations/id.json": () => import("./id-BtwA9WJT.mjs"), "./translations/it.json": () => import("./it-BrVPqaf1.mjs"), "./translations/ja.json": () => import("./ja-BHqhDq4V.mjs"), "./translations/ko.json": () => import("./ko-HVQRlfUI.mjs"), "./translations/ml.json": () => import("./ml-BihZwQit.mjs"), "./translations/ms.json": () => import("./ms-m_WjyWx7.mjs"), "./translations/nl.json": () => import("./nl-D4R9gHx5.mjs"), "./translations/pl.json": () => import("./pl-sbx9mSt_.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-C71iDxnh.mjs"), "./translations/pt.json": () => import("./pt-BsaFvS8-.mjs"), "./translations/ru.json": () => import("./ru-BE6A4Exp.mjs"), "./translations/sa.json": () => import("./sa-Dag0k-Z8.mjs"), "./translations/sk.json": () => import("./sk-BFg-R8qJ.mjs"), "./translations/sv.json": () => import("./sv-CUnfWGsh.mjs"), "./translations/th.json": () => import("./th-BqbI8lIT.mjs"), "./translations/tr.json": () => import("./tr-CgeK3wJM.mjs"), "./translations/uk.json": () => import("./uk-CR-zDhAY.mjs"), "./translations/vi.json": () => import("./vi-DUXIk_fw.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-BPQcRIyH.mjs"), "./translations/zh.json": () => import("./zh-BWZspA60.mjs") }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
|
4125
4163
|
return {
|
4126
4164
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4127
4165
|
locale
|
@@ -4183,4 +4221,4 @@ export {
|
|
4183
4221
|
capitalise as y,
|
4184
4222
|
useUpdateContentTypeConfigurationMutation as z
|
4185
4223
|
};
|
4186
|
-
//# sourceMappingURL=index-
|
4224
|
+
//# sourceMappingURL=index-BeYsz0Vi.mjs.map
|