@strapi/content-manager 0.0.0-next.72ea34aaac6f60a1e1b8041850c21bed9eceb064 → 0.0.0-next.7315bad3dd6542d457c3c837db874e3e6336ae9f
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-D3ZWDAHG.mjs → ComponentConfigurationPage-D4J64ny7.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-D3ZWDAHG.mjs.map → ComponentConfigurationPage-D4J64ny7.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-ClKl_TA2.js → ComponentConfigurationPage-DHV8IFbd.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-ClKl_TA2.js.map → ComponentConfigurationPage-DHV8IFbd.js.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-BYCBSJxP.mjs → EditConfigurationPage-DMnf8orh.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BYCBSJxP.mjs.map → EditConfigurationPage-DMnf8orh.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-OWez0Kxp.js → EditConfigurationPage-q76oeVU1.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-OWez0Kxp.js.map → EditConfigurationPage-q76oeVU1.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-BEs5iGDi.js → EditViewPage-BXoY-ITh.js} +4 -5
- package/dist/_chunks/{EditViewPage-BEs5iGDi.js.map → EditViewPage-BXoY-ITh.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-5pdbvsO_.mjs → EditViewPage-COVXj9bh.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-5pdbvsO_.mjs.map → EditViewPage-COVXj9bh.mjs.map} +1 -1
- package/dist/_chunks/{Field-DcKuFHYK.mjs → Field-CcppsFQR.mjs} +25 -44
- package/dist/_chunks/Field-CcppsFQR.mjs.map +1 -0
- package/dist/_chunks/{Field-DNHm4wHx.js → Field-Dj1nOvt8.js} +26 -46
- package/dist/_chunks/Field-Dj1nOvt8.js.map +1 -0
- package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
- package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
- package/dist/_chunks/{Form-CGwM_-5c.mjs → Form-DbWwH0-A.mjs} +3 -3
- package/dist/_chunks/{Form-CGwM_-5c.mjs.map → Form-DbWwH0-A.mjs.map} +1 -1
- package/dist/_chunks/{Form-CoRxWJOz.js → Form-aTchNxab.js} +5 -6
- package/dist/_chunks/{Form-CoRxWJOz.js.map → Form-aTchNxab.js.map} +1 -1
- package/dist/_chunks/{History-BcUTQrfG.js → History-Cs6XM6EU.js} +6 -7
- package/dist/_chunks/History-Cs6XM6EU.js.map +1 -0
- package/dist/_chunks/{History-DEvr3Q_V.mjs → History-tU567_hc.mjs} +5 -5
- package/dist/_chunks/History-tU567_hc.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BE_Ho7tV.js → ListConfigurationPage-7LeytuFD.js} +4 -5
- package/dist/_chunks/{ListConfigurationPage-BE_Ho7tV.js.map → ListConfigurationPage-7LeytuFD.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BM4zZZcM.mjs → ListConfigurationPage-DQryo_4i.mjs} +3 -3
- package/dist/_chunks/{ListConfigurationPage-BM4zZZcM.mjs.map → ListConfigurationPage-DQryo_4i.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-BK2mkrql.mjs → ListViewPage-B50esy_x.mjs} +50 -49
- package/dist/_chunks/ListViewPage-B50esy_x.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-BkT8Eao0.js → ListViewPage-CaGBu5H5.js} +51 -51
- package/dist/_chunks/ListViewPage-CaGBu5H5.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C8mtyc4H.js → NoContentTypePage-BaBE00IO.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C8mtyc4H.js.map → NoContentTypePage-BaBE00IO.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BvcAutu9.mjs → NoContentTypePage-CiPP8cLx.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-BvcAutu9.mjs.map → NoContentTypePage-CiPP8cLx.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BmbRz7PR.mjs → NoPermissionsPage-0-CW106p.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BmbRz7PR.mjs.map → NoPermissionsPage-0-CW106p.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B5Y9Y78B.js → NoPermissionsPage-DQn5cqZz.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B5Y9Y78B.js.map → NoPermissionsPage-DQn5cqZz.js.map} +1 -1
- package/dist/_chunks/{Preview-DcexhKJE.mjs → Preview-C1dBkhXf.mjs} +10 -5
- package/dist/_chunks/Preview-C1dBkhXf.mjs.map +1 -0
- package/dist/_chunks/{Preview-BF8ZDYqS.js → Preview-DH1h7kJ6.js} +10 -6
- package/dist/_chunks/Preview-DH1h7kJ6.js.map +1 -0
- package/dist/_chunks/{Relations-BjIzc4EK.mjs → Relations-Bvne4TvU.mjs} +6 -8
- package/dist/_chunks/{Relations-BjIzc4EK.mjs.map → Relations-Bvne4TvU.mjs.map} +1 -1
- package/dist/_chunks/{Relations-BKnoK1R0.js → Relations-CkECnBOd.js} +7 -10
- package/dist/_chunks/{Relations-BKnoK1R0.js.map → Relations-CkECnBOd.js.map} +1 -1
- package/dist/_chunks/{en-DTWPCdTS.js → en-BK8Xyl5I.js} +3 -2
- package/dist/_chunks/{en-DTWPCdTS.js.map → en-BK8Xyl5I.js.map} +1 -1
- package/dist/_chunks/{en-CfIXaZf9.mjs → en-Dtk_ot79.mjs} +3 -2
- package/dist/_chunks/{en-CfIXaZf9.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-DOzAG2cq.js → index-BN1pPa5v.js} +86 -51
- package/dist/_chunks/index-BN1pPa5v.js.map +1 -0
- package/dist/_chunks/{index-BW-rXkjn.mjs → index-ByPZ754U.mjs} +85 -49
- package/dist/_chunks/index-ByPZ754U.mjs.map +1 -0
- package/dist/_chunks/{layout-DFVbgjp2.mjs → layout-CUTOYU8I.mjs} +4 -4
- package/dist/_chunks/{layout-DFVbgjp2.mjs.map → layout-CUTOYU8I.mjs.map} +1 -1
- package/dist/_chunks/{layout-RC3W2obV.js → layout-nBPDlXjr.js} +5 -6
- package/dist/_chunks/{layout-RC3W2obV.js.map → layout-nBPDlXjr.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-zam7-5H7.js → relations-B6B-b7lI.js} +2 -2
- package/dist/_chunks/{relations-zam7-5H7.js.map → relations-B6B-b7lI.js.map} +1 -1
- package/dist/_chunks/{relations-Dogh8HWI.mjs → relations-CBc5HYHC.mjs} +2 -2
- package/dist/_chunks/{relations-Dogh8HWI.mjs.map → relations-CBc5HYHC.mjs.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/admin/src/services/documents.d.ts +0 -3
- package/dist/server/index.js +74 -45
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +74 -44
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -1
- package/dist/server/src/preview/index.d.ts.map +1 -1
- package/dist/server/src/preview/services/index.d.ts +1 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -1
- package/dist/server/src/preview/services/preview-config.d.ts +2 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -1
- package/dist/server/src/preview/utils.d.ts +1 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -1
- package/dist/server/src/register.d.ts.map +1 -1
- package/package.json +9 -9
- package/dist/_chunks/Field-DNHm4wHx.js.map +0 -1
- package/dist/_chunks/Field-DcKuFHYK.mjs.map +0 -1
- package/dist/_chunks/History-BcUTQrfG.js.map +0 -1
- package/dist/_chunks/History-DEvr3Q_V.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BK2mkrql.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-BkT8Eao0.js.map +0 -1
- package/dist/_chunks/Preview-BF8ZDYqS.js.map +0 -1
- package/dist/_chunks/Preview-DcexhKJE.mjs.map +0 -1
- package/dist/_chunks/index-BW-rXkjn.mjs.map +0 -1
- package/dist/_chunks/index-DOzAG2cq.js.map +0 -1
@@ -10,17 +10,24 @@ import { useParams, useNavigate, Navigate, useMatch, useLocation, Link, NavLink
|
|
10
10
|
import { styled } from "styled-components";
|
11
11
|
import * as yup from "yup";
|
12
12
|
import { ValidationError } from "yup";
|
13
|
+
import { stringify } from "qs";
|
13
14
|
import pipe from "lodash/fp/pipe";
|
14
15
|
import { intervalToDuration, isPast } from "date-fns";
|
15
|
-
import { stringify } from "qs";
|
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";
|
@@ -274,7 +281,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
274
281
|
url: `/content-manager/collection-types/${model}`,
|
275
282
|
method: "GET",
|
276
283
|
config: {
|
277
|
-
params
|
284
|
+
params: stringify(params, { encode: true })
|
278
285
|
}
|
279
286
|
}),
|
280
287
|
providesTags: (result, _error, arg) => {
|
@@ -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(
|
@@ -462,9 +468,6 @@ const buildValidParams = (query) => {
|
|
462
468
|
{}
|
463
469
|
)
|
464
470
|
};
|
465
|
-
if ("_q" in validQueryParams) {
|
466
|
-
validQueryParams._q = encodeURIComponent(validQueryParams._q);
|
467
|
-
}
|
468
471
|
return validQueryParams;
|
469
472
|
};
|
470
473
|
const isBaseQueryError = (error) => {
|
@@ -1664,7 +1667,7 @@ const useDocumentActions = () => {
|
|
1664
1667
|
};
|
1665
1668
|
};
|
1666
1669
|
const ProtectedHistoryPage = React.lazy(
|
1667
|
-
() => import("./History-
|
1670
|
+
() => import("./History-tU567_hc.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1668
1671
|
);
|
1669
1672
|
const routes$2 = [
|
1670
1673
|
{
|
@@ -1677,7 +1680,7 @@ const routes$2 = [
|
|
1677
1680
|
}
|
1678
1681
|
];
|
1679
1682
|
const ProtectedPreviewPage = React.lazy(
|
1680
|
-
() => import("./Preview-
|
1683
|
+
() => import("./Preview-C1dBkhXf.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1681
1684
|
);
|
1682
1685
|
const routes$1 = [
|
1683
1686
|
{
|
@@ -1690,31 +1693,31 @@ const routes$1 = [
|
|
1690
1693
|
}
|
1691
1694
|
];
|
1692
1695
|
const ProtectedEditViewPage = lazy(
|
1693
|
-
() => import("./EditViewPage-
|
1696
|
+
() => import("./EditViewPage-COVXj9bh.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1694
1697
|
);
|
1695
1698
|
const ProtectedListViewPage = lazy(
|
1696
|
-
() => import("./ListViewPage-
|
1699
|
+
() => import("./ListViewPage-B50esy_x.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1697
1700
|
);
|
1698
1701
|
const ProtectedListConfiguration = lazy(
|
1699
|
-
() => import("./ListConfigurationPage-
|
1702
|
+
() => import("./ListConfigurationPage-DQryo_4i.mjs").then((mod) => ({
|
1700
1703
|
default: mod.ProtectedListConfiguration
|
1701
1704
|
}))
|
1702
1705
|
);
|
1703
1706
|
const ProtectedEditConfigurationPage = lazy(
|
1704
|
-
() => import("./EditConfigurationPage-
|
1707
|
+
() => import("./EditConfigurationPage-DMnf8orh.mjs").then((mod) => ({
|
1705
1708
|
default: mod.ProtectedEditConfigurationPage
|
1706
1709
|
}))
|
1707
1710
|
);
|
1708
1711
|
const ProtectedComponentConfigurationPage = lazy(
|
1709
|
-
() => import("./ComponentConfigurationPage-
|
1712
|
+
() => import("./ComponentConfigurationPage-D4J64ny7.mjs").then((mod) => ({
|
1710
1713
|
default: mod.ProtectedComponentConfigurationPage
|
1711
1714
|
}))
|
1712
1715
|
);
|
1713
1716
|
const NoPermissions = lazy(
|
1714
|
-
() => import("./NoPermissionsPage-
|
1717
|
+
() => import("./NoPermissionsPage-0-CW106p.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1715
1718
|
);
|
1716
1719
|
const NoContentType = lazy(
|
1717
|
-
() => import("./NoContentTypePage-
|
1720
|
+
() => import("./NoContentTypePage-CiPP8cLx.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1718
1721
|
);
|
1719
1722
|
const CollectionTypePages = () => {
|
1720
1723
|
const { collectionType } = useParams();
|
@@ -2084,6 +2087,7 @@ const PublishAction$1 = ({
|
|
2084
2087
|
const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
|
2085
2088
|
const isListView = useMatch(LIST_PATH) !== null;
|
2086
2089
|
const isCloning = useMatch(CLONE_PATH) !== null;
|
2090
|
+
const { id } = useParams();
|
2087
2091
|
const { formatMessage } = useIntl();
|
2088
2092
|
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
2089
2093
|
const { publish } = useDocumentActions();
|
@@ -2186,10 +2190,12 @@ const PublishAction$1 = ({
|
|
2186
2190
|
transformData(formValues)
|
2187
2191
|
);
|
2188
2192
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2189
|
-
|
2190
|
-
|
2191
|
-
|
2192
|
-
|
2193
|
+
if (id === "create") {
|
2194
|
+
navigate({
|
2195
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
2196
|
+
search: rawQuery
|
2197
|
+
});
|
2198
|
+
}
|
2193
2199
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2194
2200
|
setErrors(formatValidationErrors(res.error));
|
2195
2201
|
}
|
@@ -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
|
@@ -4057,17 +4082,28 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4057
4082
|
return {
|
4058
4083
|
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4059
4084
|
content: /* @__PURE__ */ jsx(Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsx(
|
4060
|
-
|
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(
|
4093
|
+
Button,
|
4094
|
+
{
|
4095
|
+
variant: "tertiary",
|
4096
|
+
tag: Link,
|
4097
|
+
to: { pathname: "preview", search: stringify(query, { encode: false }) },
|
4098
|
+
onClick: trackNavigation,
|
4099
|
+
flex: "auto",
|
4100
|
+
disabled: isModified,
|
4101
|
+
children: formatMessage({
|
4102
|
+
id: "content-manager.preview.panel.button",
|
4103
|
+
defaultMessage: "Open preview"
|
4104
|
+
})
|
4105
|
+
}
|
4106
|
+
)
|
4071
4107
|
}
|
4072
4108
|
) })
|
4073
4109
|
};
|
@@ -4101,7 +4137,7 @@ const index = {
|
|
4101
4137
|
app.router.addRoute({
|
4102
4138
|
path: "content-manager/*",
|
4103
4139
|
lazy: async () => {
|
4104
|
-
const { Layout } = await import("./layout-
|
4140
|
+
const { Layout } = await import("./layout-CUTOYU8I.mjs");
|
4105
4141
|
return {
|
4106
4142
|
Component: Layout
|
4107
4143
|
};
|
@@ -4121,7 +4157,7 @@ const index = {
|
|
4121
4157
|
async registerTrads({ locales }) {
|
4122
4158
|
const importedTrads = await Promise.all(
|
4123
4159
|
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-
|
4160
|
+
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
4161
|
return {
|
4126
4162
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4127
4163
|
locale
|
@@ -4183,4 +4219,4 @@ export {
|
|
4183
4219
|
capitalise as y,
|
4184
4220
|
useUpdateContentTypeConfigurationMutation as z
|
4185
4221
|
};
|
4186
|
-
//# sourceMappingURL=index-
|
4222
|
+
//# sourceMappingURL=index-ByPZ754U.mjs.map
|