@strapi/content-manager 5.4.1 → 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-ClKl_TA2.js → ComponentConfigurationPage-BPiQrhZ6.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-ClKl_TA2.js.map → ComponentConfigurationPage-BPiQrhZ6.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-D3ZWDAHG.mjs → ComponentConfigurationPage-viOAdZM6.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-D3ZWDAHG.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-OWez0Kxp.js → EditConfigurationPage-CZRKq8CN.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-OWez0Kxp.js.map → EditConfigurationPage-CZRKq8CN.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BYCBSJxP.mjs → EditConfigurationPage-DKtPyjs_.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BYCBSJxP.mjs.map → EditConfigurationPage-DKtPyjs_.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-BEs5iGDi.js → EditViewPage-C-TZmK5r.js} +4 -5
- package/dist/_chunks/{EditViewPage-BEs5iGDi.js.map → EditViewPage-C-TZmK5r.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-5pdbvsO_.mjs → EditViewPage-D2FPb5Mh.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-5pdbvsO_.mjs.map → EditViewPage-D2FPb5Mh.mjs.map} +1 -1
- package/dist/_chunks/{Field-DNHm4wHx.js → Field-IMBnqF-k.js} +26 -46
- package/dist/_chunks/Field-IMBnqF-k.js.map +1 -0
- package/dist/_chunks/{Field-DcKuFHYK.mjs → Field-hD0Y00Mt.mjs} +25 -44
- package/dist/_chunks/Field-hD0Y00Mt.mjs.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-CoRxWJOz.js → Form-BaURS01O.js} +5 -6
- package/dist/_chunks/{Form-CoRxWJOz.js.map → Form-BaURS01O.js.map} +1 -1
- package/dist/_chunks/{Form-CGwM_-5c.mjs → Form-ZQ9fzWkd.mjs} +3 -3
- package/dist/_chunks/{Form-CGwM_-5c.mjs.map → Form-ZQ9fzWkd.mjs.map} +1 -1
- package/dist/_chunks/{History-BcUTQrfG.js → History-BqRQm2Lc.js} +6 -7
- package/dist/_chunks/History-BqRQm2Lc.js.map +1 -0
- package/dist/_chunks/{History-DEvr3Q_V.mjs → History-C4X3jiQJ.mjs} +5 -5
- package/dist/_chunks/History-C4X3jiQJ.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BE_Ho7tV.js → ListConfigurationPage-BT69-TvF.js} +4 -5
- package/dist/_chunks/{ListConfigurationPage-BE_Ho7tV.js.map → ListConfigurationPage-BT69-TvF.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BM4zZZcM.mjs → ListConfigurationPage-CwMU6tWQ.mjs} +3 -3
- package/dist/_chunks/{ListConfigurationPage-BM4zZZcM.mjs.map → ListConfigurationPage-CwMU6tWQ.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-BkT8Eao0.js → ListViewPage-CYkrfWsm.js} +51 -51
- package/dist/_chunks/ListViewPage-CYkrfWsm.js.map +1 -0
- package/dist/_chunks/{ListViewPage-BK2mkrql.mjs → ListViewPage-CvxfiNTc.mjs} +50 -49
- package/dist/_chunks/ListViewPage-CvxfiNTc.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-C8mtyc4H.js → NoContentTypePage-BZMfRsrg.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-C8mtyc4H.js.map → NoContentTypePage-BZMfRsrg.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BvcAutu9.mjs → NoContentTypePage-Dy6sa9LT.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-BvcAutu9.mjs.map → NoContentTypePage-Dy6sa9LT.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BmbRz7PR.mjs → NoPermissionsPage-DiW-TIzq.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BmbRz7PR.mjs.map → NoPermissionsPage-DiW-TIzq.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B5Y9Y78B.js → NoPermissionsPage-DjUdvhJ6.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B5Y9Y78B.js.map → NoPermissionsPage-DjUdvhJ6.js.map} +1 -1
- package/dist/_chunks/{Preview-BF8ZDYqS.js → Preview-BqRUSbFU.js} +17 -7
- package/dist/_chunks/Preview-BqRUSbFU.js.map +1 -0
- package/dist/_chunks/{Preview-DcexhKJE.mjs → Preview-DwWET-X7.mjs} +17 -6
- package/dist/_chunks/Preview-DwWET-X7.mjs.map +1 -0
- package/dist/_chunks/{Relations-BjIzc4EK.mjs → Relations-BOTC_ZqE.mjs} +6 -8
- package/dist/_chunks/{Relations-BjIzc4EK.mjs.map → Relations-BOTC_ZqE.mjs.map} +1 -1
- package/dist/_chunks/{Relations-BKnoK1R0.js → Relations-DnCdLzq_.js} +7 -10
- package/dist/_chunks/{Relations-BKnoK1R0.js.map → Relations-DnCdLzq_.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-BW-rXkjn.mjs → index-BeYsz0Vi.mjs} +89 -51
- package/dist/_chunks/index-BeYsz0Vi.mjs.map +1 -0
- package/dist/_chunks/{index-DOzAG2cq.js → index-CptTdHNy.js} +90 -53
- package/dist/_chunks/index-CptTdHNy.js.map +1 -0
- package/dist/_chunks/{layout-DFVbgjp2.mjs → layout-CzSSEy9b.mjs} +4 -4
- package/dist/_chunks/{layout-DFVbgjp2.mjs.map → layout-CzSSEy9b.mjs.map} +1 -1
- package/dist/_chunks/{layout-RC3W2obV.js → layout-szfTCeYm.js} +5 -6
- package/dist/_chunks/{layout-RC3W2obV.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-Dogh8HWI.mjs → relations-DvzmDbWc.mjs} +2 -2
- package/dist/_chunks/{relations-Dogh8HWI.mjs.map → relations-DvzmDbWc.mjs.map} +1 -1
- package/dist/_chunks/{relations-zam7-5H7.js → relations-qssSbh1V.js} +2 -2
- package/dist/_chunks/{relations-zam7-5H7.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/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
@@ -9,14 +9,13 @@ const reactIntl = require("react-intl");
|
|
9
9
|
const reactRouterDom = require("react-router-dom");
|
10
10
|
const styledComponents = require("styled-components");
|
11
11
|
const yup = require("yup");
|
12
|
+
const qs = require("qs");
|
12
13
|
const pipe = require("lodash/fp/pipe");
|
13
14
|
const dateFns = require("date-fns");
|
14
|
-
const qs = require("qs");
|
15
15
|
const toolkit = require("@reduxjs/toolkit");
|
16
16
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
17
17
|
function _interopNamespace(e) {
|
18
|
-
if (e && e.__esModule)
|
19
|
-
return e;
|
18
|
+
if (e && e.__esModule) return e;
|
20
19
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
21
20
|
if (e) {
|
22
21
|
for (const k in e) {
|
@@ -36,13 +35,20 @@ const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
|
36
35
|
const mapValues__default = /* @__PURE__ */ _interopDefault(mapValues);
|
37
36
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
38
37
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
|
39
|
-
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
38
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
40
39
|
const v = glob[path];
|
41
40
|
if (v) {
|
42
41
|
return typeof v === "function" ? v() : Promise.resolve(v);
|
43
42
|
}
|
44
43
|
return new Promise((_, reject) => {
|
45
|
-
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
44
|
+
(typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
|
45
|
+
reject.bind(
|
46
|
+
null,
|
47
|
+
new Error(
|
48
|
+
"Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
|
49
|
+
)
|
50
|
+
)
|
51
|
+
);
|
46
52
|
});
|
47
53
|
};
|
48
54
|
const PLUGIN_ID = "content-manager";
|
@@ -296,7 +302,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
296
302
|
url: `/content-manager/collection-types/${model}`,
|
297
303
|
method: "GET",
|
298
304
|
config: {
|
299
|
-
params
|
305
|
+
params: qs.stringify(params, { encode: true })
|
300
306
|
}
|
301
307
|
}),
|
302
308
|
providesTags: (result, _error, arg) => {
|
@@ -475,8 +481,7 @@ const {
|
|
475
481
|
useUnpublishManyDocumentsMutation
|
476
482
|
} = documentApi;
|
477
483
|
const buildValidParams = (query) => {
|
478
|
-
if (!query)
|
479
|
-
return query;
|
484
|
+
if (!query) return query;
|
480
485
|
const { plugins: _, ...validQueryParams } = {
|
481
486
|
...query,
|
482
487
|
...Object.values(query?.plugins ?? {}).reduce(
|
@@ -484,9 +489,6 @@ const buildValidParams = (query) => {
|
|
484
489
|
{}
|
485
490
|
)
|
486
491
|
};
|
487
|
-
if ("_q" in validQueryParams) {
|
488
|
-
validQueryParams._q = encodeURIComponent(validQueryParams._q);
|
489
|
-
}
|
490
492
|
return validQueryParams;
|
491
493
|
};
|
492
494
|
const isBaseQueryError = (error) => {
|
@@ -1686,7 +1688,7 @@ const useDocumentActions = () => {
|
|
1686
1688
|
};
|
1687
1689
|
};
|
1688
1690
|
const ProtectedHistoryPage = React__namespace.lazy(
|
1689
|
-
() => Promise.resolve().then(() => require("./History-
|
1691
|
+
() => Promise.resolve().then(() => require("./History-BqRQm2Lc.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1690
1692
|
);
|
1691
1693
|
const routes$2 = [
|
1692
1694
|
{
|
@@ -1699,7 +1701,7 @@ const routes$2 = [
|
|
1699
1701
|
}
|
1700
1702
|
];
|
1701
1703
|
const ProtectedPreviewPage = React__namespace.lazy(
|
1702
|
-
() => Promise.resolve().then(() => require("./Preview-
|
1704
|
+
() => Promise.resolve().then(() => require("./Preview-BqRUSbFU.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1703
1705
|
);
|
1704
1706
|
const routes$1 = [
|
1705
1707
|
{
|
@@ -1712,31 +1714,31 @@ const routes$1 = [
|
|
1712
1714
|
}
|
1713
1715
|
];
|
1714
1716
|
const ProtectedEditViewPage = React.lazy(
|
1715
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1717
|
+
() => Promise.resolve().then(() => require("./EditViewPage-C-TZmK5r.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1716
1718
|
);
|
1717
1719
|
const ProtectedListViewPage = React.lazy(
|
1718
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1720
|
+
() => Promise.resolve().then(() => require("./ListViewPage-CYkrfWsm.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1719
1721
|
);
|
1720
1722
|
const ProtectedListConfiguration = React.lazy(
|
1721
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1723
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-BT69-TvF.js")).then((mod) => ({
|
1722
1724
|
default: mod.ProtectedListConfiguration
|
1723
1725
|
}))
|
1724
1726
|
);
|
1725
1727
|
const ProtectedEditConfigurationPage = React.lazy(
|
1726
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1728
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-CZRKq8CN.js")).then((mod) => ({
|
1727
1729
|
default: mod.ProtectedEditConfigurationPage
|
1728
1730
|
}))
|
1729
1731
|
);
|
1730
1732
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1731
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1733
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-BPiQrhZ6.js")).then((mod) => ({
|
1732
1734
|
default: mod.ProtectedComponentConfigurationPage
|
1733
1735
|
}))
|
1734
1736
|
);
|
1735
1737
|
const NoPermissions = React.lazy(
|
1736
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1738
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-DjUdvhJ6.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1737
1739
|
);
|
1738
1740
|
const NoContentType = React.lazy(
|
1739
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1741
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-BZMfRsrg.js")).then((mod) => ({ default: mod.NoContentType }))
|
1740
1742
|
);
|
1741
1743
|
const CollectionTypePages = () => {
|
1742
1744
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -2106,6 +2108,7 @@ const PublishAction$1 = ({
|
|
2106
2108
|
const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
|
2107
2109
|
const isListView = reactRouterDom.useMatch(LIST_PATH) !== null;
|
2108
2110
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
2111
|
+
const { id } = reactRouterDom.useParams();
|
2109
2112
|
const { formatMessage } = reactIntl.useIntl();
|
2110
2113
|
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
2111
2114
|
const { publish } = useDocumentActions();
|
@@ -2208,10 +2211,12 @@ const PublishAction$1 = ({
|
|
2208
2211
|
transformData(formValues)
|
2209
2212
|
);
|
2210
2213
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2211
|
-
|
2212
|
-
|
2213
|
-
|
2214
|
-
|
2214
|
+
if (id === "create") {
|
2215
|
+
navigate({
|
2216
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
2217
|
+
search: rawQuery
|
2218
|
+
});
|
2219
|
+
}
|
2215
2220
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2216
2221
|
setErrors(formatValidationErrors(res.error));
|
2217
2222
|
}
|
@@ -2264,6 +2269,7 @@ const PublishAction$1 = ({
|
|
2264
2269
|
};
|
2265
2270
|
};
|
2266
2271
|
PublishAction$1.type = "publish";
|
2272
|
+
PublishAction$1.position = "panel";
|
2267
2273
|
const UpdateAction = ({
|
2268
2274
|
activeTab,
|
2269
2275
|
documentId,
|
@@ -2376,6 +2382,7 @@ const UpdateAction = ({
|
|
2376
2382
|
};
|
2377
2383
|
};
|
2378
2384
|
UpdateAction.type = "update";
|
2385
|
+
UpdateAction.position = "panel";
|
2379
2386
|
const UNPUBLISH_DRAFT_OPTIONS = {
|
2380
2387
|
KEEP: "keep",
|
2381
2388
|
DISCARD: "discard"
|
@@ -2498,6 +2505,7 @@ const UnpublishAction$1 = ({
|
|
2498
2505
|
};
|
2499
2506
|
};
|
2500
2507
|
UnpublishAction$1.type = "unpublish";
|
2508
|
+
UnpublishAction$1.position = "panel";
|
2501
2509
|
const DiscardAction = ({
|
2502
2510
|
activeTab,
|
2503
2511
|
documentId,
|
@@ -2548,6 +2556,7 @@ const DiscardAction = ({
|
|
2548
2556
|
};
|
2549
2557
|
};
|
2550
2558
|
DiscardAction.type = "discard";
|
2559
|
+
DiscardAction.position = "panel";
|
2551
2560
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2552
2561
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2553
2562
|
const RelativeTime = React__namespace.forwardRef(
|
@@ -2667,7 +2676,7 @@ const HeaderToolbar = () => {
|
|
2667
2676
|
meta: isCloning ? void 0 : meta,
|
2668
2677
|
collectionType
|
2669
2678
|
},
|
2670
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
2679
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
|
2671
2680
|
children: (actions2) => {
|
2672
2681
|
const headerActions = actions2.filter((action) => {
|
2673
2682
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -2875,6 +2884,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2875
2884
|
};
|
2876
2885
|
};
|
2877
2886
|
ConfigureTheViewAction.type = "configure-the-view";
|
2887
|
+
ConfigureTheViewAction.position = "header";
|
2878
2888
|
const EditTheModelAction = ({ model }) => {
|
2879
2889
|
const navigate = reactRouterDom.useNavigate();
|
2880
2890
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2891,6 +2901,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2891
2901
|
};
|
2892
2902
|
};
|
2893
2903
|
EditTheModelAction.type = "edit-the-model";
|
2904
|
+
EditTheModelAction.position = "header";
|
2894
2905
|
const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
2895
2906
|
const navigate = reactRouterDom.useNavigate();
|
2896
2907
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2964,6 +2975,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
|
2964
2975
|
};
|
2965
2976
|
};
|
2966
2977
|
DeleteAction$1.type = "delete";
|
2978
|
+
DeleteAction$1.position = ["header", "table-row"];
|
2967
2979
|
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
|
2968
2980
|
const Panels = () => {
|
2969
2981
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
@@ -3026,7 +3038,7 @@ const ActionsPanelContent = () => {
|
|
3026
3038
|
strapiAdmin.DescriptionComponentRenderer,
|
3027
3039
|
{
|
3028
3040
|
props,
|
3029
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3041
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
|
3030
3042
|
children: (actions2) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActions, { actions: actions2 })
|
3031
3043
|
}
|
3032
3044
|
),
|
@@ -3480,8 +3492,7 @@ const PublishAction = ({ documents, model }) => {
|
|
3480
3492
|
const refetchList = () => {
|
3481
3493
|
contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
|
3482
3494
|
};
|
3483
|
-
if (!showPublishButton)
|
3484
|
-
return null;
|
3495
|
+
if (!showPublishButton) return null;
|
3485
3496
|
return {
|
3486
3497
|
actionType: "publish",
|
3487
3498
|
variant: "tertiary",
|
@@ -3549,8 +3560,7 @@ const DeleteAction = ({ documents, model }) => {
|
|
3549
3560
|
selectRow([]);
|
3550
3561
|
}
|
3551
3562
|
};
|
3552
|
-
if (!hasDeletePermission)
|
3553
|
-
return null;
|
3563
|
+
if (!hasDeletePermission) return null;
|
3554
3564
|
return {
|
3555
3565
|
variant: "danger-light",
|
3556
3566
|
label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
|
@@ -3599,8 +3609,7 @@ const UnpublishAction = ({ documents, model }) => {
|
|
3599
3609
|
}
|
3600
3610
|
};
|
3601
3611
|
const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
|
3602
|
-
if (!showUnpublishButton)
|
3603
|
-
return null;
|
3612
|
+
if (!showUnpublishButton) return null;
|
3604
3613
|
return {
|
3605
3614
|
variant: "tertiary",
|
3606
3615
|
label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
|
@@ -3705,7 +3714,7 @@ const TableActions = ({ document }) => {
|
|
3705
3714
|
strapiAdmin.DescriptionComponentRenderer,
|
3706
3715
|
{
|
3707
3716
|
props,
|
3708
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
|
3717
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
|
3709
3718
|
children: (actions2) => {
|
3710
3719
|
const tableRowActions = actions2.filter((action) => {
|
3711
3720
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3764,6 +3773,7 @@ const EditAction = ({ documentId }) => {
|
|
3764
3773
|
};
|
3765
3774
|
};
|
3766
3775
|
EditAction.type = "edit";
|
3776
|
+
EditAction.position = "table-row";
|
3767
3777
|
const StyledPencil = styledComponents.styled(Icons.Pencil)`
|
3768
3778
|
path {
|
3769
3779
|
fill: currentColor;
|
@@ -3840,6 +3850,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3840
3850
|
};
|
3841
3851
|
};
|
3842
3852
|
CloneAction.type = "clone";
|
3853
|
+
CloneAction.position = "table-row";
|
3843
3854
|
const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
|
3844
3855
|
path {
|
3845
3856
|
fill: currentColor;
|
@@ -3926,7 +3937,14 @@ class ContentManagerPlugin {
|
|
3926
3937
|
addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
|
3927
3938
|
addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
|
3928
3939
|
getBulkActions: () => this.bulkActions,
|
3929
|
-
getDocumentActions: () =>
|
3940
|
+
getDocumentActions: (position) => {
|
3941
|
+
if (position) {
|
3942
|
+
return this.documentActions.filter(
|
3943
|
+
(action) => action.position == void 0 || [action.position].flat().includes(position)
|
3944
|
+
);
|
3945
|
+
}
|
3946
|
+
return this.documentActions;
|
3947
|
+
},
|
3930
3948
|
getEditViewSidePanels: () => this.editViewSidePanels,
|
3931
3949
|
getHeaderActions: () => this.headerActions
|
3932
3950
|
}
|
@@ -3936,10 +3954,8 @@ class ContentManagerPlugin {
|
|
3936
3954
|
const getPrintableType = (value) => {
|
3937
3955
|
const nativeType = typeof value;
|
3938
3956
|
if (nativeType === "object") {
|
3939
|
-
if (value === null)
|
3940
|
-
|
3941
|
-
if (Array.isArray(value))
|
3942
|
-
return "array";
|
3957
|
+
if (value === null) return "null";
|
3958
|
+
if (Array.isArray(value)) return "array";
|
3943
3959
|
if (value instanceof Object && value.constructor.name !== "Object") {
|
3944
3960
|
return value.constructor.name;
|
3945
3961
|
}
|
@@ -3992,6 +4008,7 @@ const HistoryAction = ({ model, document }) => {
|
|
3992
4008
|
};
|
3993
4009
|
};
|
3994
4010
|
HistoryAction.type = "history";
|
4011
|
+
HistoryAction.position = "header";
|
3995
4012
|
const historyAdmin = {
|
3996
4013
|
bootstrap(app) {
|
3997
4014
|
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
@@ -4054,11 +4071,18 @@ const previewApi = contentManagerApi.injectEndpoints({
|
|
4054
4071
|
})
|
4055
4072
|
});
|
4056
4073
|
const { useGetPreviewUrlQuery } = previewApi;
|
4074
|
+
const ConditionalTooltip = ({ isShown, label, children }) => {
|
4075
|
+
if (isShown) {
|
4076
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label, children });
|
4077
|
+
}
|
4078
|
+
return children;
|
4079
|
+
};
|
4057
4080
|
const PreviewSidePanel = ({ model, documentId, document }) => {
|
4058
4081
|
const { formatMessage } = reactIntl.useIntl();
|
4059
4082
|
const { trackUsage } = strapiAdmin.useTracking();
|
4060
4083
|
const { pathname } = reactRouterDom.useLocation();
|
4061
4084
|
const [{ query }] = strapiAdmin.useQueryParams();
|
4085
|
+
const isModified = strapiAdmin.useForm("PreviewSidePanel", (state) => state.modified);
|
4062
4086
|
const { data, error } = useGetPreviewUrlQuery({
|
4063
4087
|
params: {
|
4064
4088
|
contentType: model
|
@@ -4078,20 +4102,33 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4078
4102
|
};
|
4079
4103
|
return {
|
4080
4104
|
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4081
|
-
content: /* @__PURE__ */ jsxRuntime.jsx(
|
4082
|
-
|
4105
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(
|
4106
|
+
ConditionalTooltip,
|
4083
4107
|
{
|
4084
|
-
|
4085
|
-
|
4086
|
-
|
4087
|
-
|
4088
|
-
|
4089
|
-
children:
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4108
|
+
label: formatMessage({
|
4109
|
+
id: "content-manager.preview.panel.button-disabled-tooltip",
|
4110
|
+
defaultMessage: "Please save to open the preview"
|
4111
|
+
}),
|
4112
|
+
isShown: isModified,
|
4113
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
4114
|
+
designSystem.Button,
|
4115
|
+
{
|
4116
|
+
variant: "tertiary",
|
4117
|
+
tag: reactRouterDom.Link,
|
4118
|
+
to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
|
4119
|
+
onClick: trackNavigation,
|
4120
|
+
width: "100%",
|
4121
|
+
disabled: isModified,
|
4122
|
+
pointerEvents: isModified ? "none" : void 0,
|
4123
|
+
tabIndex: isModified ? -1 : void 0,
|
4124
|
+
children: formatMessage({
|
4125
|
+
id: "content-manager.preview.panel.button",
|
4126
|
+
defaultMessage: "Open preview"
|
4127
|
+
})
|
4128
|
+
}
|
4129
|
+
) })
|
4093
4130
|
}
|
4094
|
-
)
|
4131
|
+
)
|
4095
4132
|
};
|
4096
4133
|
};
|
4097
4134
|
const FEATURE_ID = "preview";
|
@@ -4123,7 +4160,7 @@ const index = {
|
|
4123
4160
|
app.router.addRoute({
|
4124
4161
|
path: "content-manager/*",
|
4125
4162
|
lazy: async () => {
|
4126
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
4163
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-szfTCeYm.js"));
|
4127
4164
|
return {
|
4128
4165
|
Component: Layout
|
4129
4166
|
};
|
@@ -4143,7 +4180,7 @@ const index = {
|
|
4143
4180
|
async registerTrads({ locales }) {
|
4144
4181
|
const importedTrads = await Promise.all(
|
4145
4182
|
locales.map((locale) => {
|
4146
|
-
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-
|
4183
|
+
return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BK8Xyl5I.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-9K52xZIr.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B2Kyv8Z9.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-7sfIbjxE.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
|
4147
4184
|
return {
|
4148
4185
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4149
4186
|
locale
|
@@ -4203,4 +4240,4 @@ exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuer
|
|
4203
4240
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
4204
4241
|
exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
|
4205
4242
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
4206
|
-
//# sourceMappingURL=index-
|
4243
|
+
//# sourceMappingURL=index-CptTdHNy.js.map
|