@strapi/content-manager 0.0.0-experimental.d65615a2b9130dd742d3c396674457d7971da928 → 0.0.0-experimental.d6bba97c7ed8309e57888e84d4788fa279d473fd
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-CQroR9Qk.mjs → ComponentConfigurationPage-D4J64ny7.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-CQroR9Qk.mjs.map → ComponentConfigurationPage-D4J64ny7.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-CO977CPh.js → ComponentConfigurationPage-DHV8IFbd.js} +4 -5
- package/dist/_chunks/{ComponentConfigurationPage-CO977CPh.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-tVCJ5vWC.mjs → EditConfigurationPage-DMnf8orh.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-tVCJ5vWC.mjs.map → EditConfigurationPage-DMnf8orh.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BPgoE-kf.js → EditConfigurationPage-q76oeVU1.js} +4 -5
- package/dist/_chunks/{EditConfigurationPage-BPgoE-kf.js.map → EditConfigurationPage-q76oeVU1.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-BMVgUNOX.js → EditViewPage-BXoY-ITh.js} +38 -9
- package/dist/_chunks/EditViewPage-BXoY-ITh.js.map +1 -0
- package/dist/_chunks/{EditViewPage-8mOu02ji.mjs → EditViewPage-COVXj9bh.mjs} +38 -8
- package/dist/_chunks/EditViewPage-COVXj9bh.mjs.map +1 -0
- package/dist/_chunks/{Field-CJPYzwD7.mjs → Field-CcppsFQR.mjs} +63 -63
- package/dist/_chunks/Field-CcppsFQR.mjs.map +1 -0
- package/dist/_chunks/{Field-CdSLKFQk.js → Field-Dj1nOvt8.js} +64 -65
- 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-DJOJ-GF1.mjs → Form-DbWwH0-A.mjs} +3 -3
- package/dist/_chunks/{Form-DJOJ-GF1.mjs.map → Form-DbWwH0-A.mjs.map} +1 -1
- package/dist/_chunks/{Form-eP5bZwap.js → Form-aTchNxab.js} +5 -6
- package/dist/_chunks/{Form-eP5bZwap.js.map → Form-aTchNxab.js.map} +1 -1
- package/dist/_chunks/{History-B-Mrquzu.js → History-Cs6XM6EU.js} +23 -94
- package/dist/_chunks/History-Cs6XM6EU.js.map +1 -0
- package/dist/_chunks/{History-MnQLtk1g.mjs → History-tU567_hc.mjs} +23 -93
- package/dist/_chunks/History-tU567_hc.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-C0n4rUzH.js → ListConfigurationPage-7LeytuFD.js} +6 -6
- package/dist/_chunks/ListConfigurationPage-7LeytuFD.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BcycI8Lw.mjs → ListConfigurationPage-DQryo_4i.mjs} +6 -5
- package/dist/_chunks/ListConfigurationPage-DQryo_4i.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-CRXONXwZ.mjs → ListViewPage-B50esy_x.mjs} +62 -39
- package/dist/_chunks/ListViewPage-B50esy_x.mjs.map +1 -0
- package/dist/_chunks/{ListViewPage-q0SHVPUS.js → ListViewPage-CaGBu5H5.js} +63 -41
- package/dist/_chunks/ListViewPage-CaGBu5H5.js.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Bh3komDV.js → NoContentTypePage-BaBE00IO.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-Bh3komDV.js.map → NoContentTypePage-BaBE00IO.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-ukzFRF3z.mjs → NoContentTypePage-CiPP8cLx.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-ukzFRF3z.mjs.map → NoContentTypePage-CiPP8cLx.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B4sD7Ble.mjs → NoPermissionsPage-0-CW106p.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B4sD7Ble.mjs.map → NoPermissionsPage-0-CW106p.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BGBpj_Y1.js → NoPermissionsPage-DQn5cqZz.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BGBpj_Y1.js.map → NoPermissionsPage-DQn5cqZz.js.map} +1 -1
- package/dist/_chunks/Preview-C1dBkhXf.mjs +272 -0
- package/dist/_chunks/Preview-C1dBkhXf.mjs.map +1 -0
- package/dist/_chunks/Preview-DH1h7kJ6.js +290 -0
- package/dist/_chunks/Preview-DH1h7kJ6.js.map +1 -0
- package/dist/_chunks/{Relations-CIexb8gr.mjs → Relations-Bvne4TvU.mjs} +47 -22
- package/dist/_chunks/Relations-Bvne4TvU.mjs.map +1 -0
- package/dist/_chunks/{Relations-B53wYe8g.js → Relations-CkECnBOd.js} +47 -23
- package/dist/_chunks/Relations-CkECnBOd.js.map +1 -0
- package/dist/_chunks/{en-Bm0D0IWz.js → en-BK8Xyl5I.js} +16 -4
- package/dist/_chunks/{en-Bm0D0IWz.js.map → en-BK8Xyl5I.js.map} +1 -1
- package/dist/_chunks/{en-DKV44jRb.mjs → en-Dtk_ot79.mjs} +16 -4
- package/dist/_chunks/{en-DKV44jRb.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
- package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
- package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
- package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
- package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
- package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
- package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
- package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
- package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
- package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
- package/dist/_chunks/{index-DbT2sx-Q.js → index-BN1pPa5v.js} +242 -107
- package/dist/_chunks/index-BN1pPa5v.js.map +1 -0
- package/dist/_chunks/{index-CJ2vYwuT.mjs → index-ByPZ754U.mjs} +244 -109
- package/dist/_chunks/index-ByPZ754U.mjs.map +1 -0
- package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
- package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
- package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
- package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
- package/dist/_chunks/{layout-vzKSrr7p.mjs → layout-CUTOYU8I.mjs} +4 -4
- package/dist/_chunks/{layout-vzKSrr7p.mjs.map → layout-CUTOYU8I.mjs.map} +1 -1
- package/dist/_chunks/{layout-CeBSIkmP.js → layout-nBPDlXjr.js} +5 -6
- package/dist/_chunks/{layout-CeBSIkmP.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-Cl-6t9iz.js → relations-B6B-b7lI.js} +6 -7
- package/dist/_chunks/relations-B6B-b7lI.js.map +1 -0
- package/dist/_chunks/{relations-DI0lguF0.mjs → relations-CBc5HYHC.mjs} +6 -7
- package/dist/_chunks/relations-CBc5HYHC.mjs.map +1 -0
- 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 +4 -4
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
- package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
- package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
- package/dist/admin/src/preview/constants.d.ts +1 -0
- package/dist/admin/src/preview/index.d.ts +4 -0
- package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
- package/dist/admin/src/preview/routes.d.ts +3 -0
- package/dist/admin/src/preview/services/preview.d.ts +3 -0
- package/dist/admin/src/router.d.ts +1 -1
- package/dist/admin/src/services/documents.d.ts +0 -3
- package/dist/server/index.js +409 -180
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +409 -179
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/bootstrap.d.ts.map +1 -1
- package/dist/server/src/controllers/index.d.ts.map +1 -1
- package/dist/server/src/controllers/relations.d.ts.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
- package/dist/server/src/history/services/utils.d.ts +2 -3
- package/dist/server/src/history/services/utils.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +4 -4
- package/dist/server/src/preview/constants.d.ts +2 -0
- package/dist/server/src/preview/constants.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/index.d.ts +2 -0
- package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/preview.d.ts +13 -0
- package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
- package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
- package/dist/server/src/preview/index.d.ts +4 -0
- package/dist/server/src/preview/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/index.d.ts +8 -0
- package/dist/server/src/preview/routes/index.d.ts.map +1 -0
- package/dist/server/src/preview/routes/preview.d.ts +4 -0
- package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
- package/dist/server/src/preview/services/index.d.ts +16 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +32 -0
- package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview.d.ts +12 -0
- package/dist/server/src/preview/services/preview.d.ts.map +1 -0
- package/dist/server/src/preview/utils.d.ts +19 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/register.d.ts.map +1 -1
- package/dist/server/src/routes/index.d.ts.map +1 -1
- package/dist/server/src/services/document-manager.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +8 -8
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +4 -4
- package/dist/server/src/services/index.d.ts.map +1 -1
- package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
- package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
- package/dist/server/src/utils/index.d.ts +2 -0
- package/dist/server/src/utils/index.d.ts.map +1 -1
- package/dist/shared/contracts/index.d.ts +1 -0
- package/dist/shared/contracts/index.d.ts.map +1 -1
- package/dist/shared/contracts/preview.d.ts +27 -0
- package/dist/shared/contracts/preview.d.ts.map +1 -0
- package/dist/shared/index.js +4 -0
- package/dist/shared/index.js.map +1 -1
- package/dist/shared/index.mjs +4 -0
- package/dist/shared/index.mjs.map +1 -1
- package/package.json +11 -11
- package/dist/_chunks/EditViewPage-8mOu02ji.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-BMVgUNOX.js.map +0 -1
- package/dist/_chunks/Field-CJPYzwD7.mjs.map +0 -1
- package/dist/_chunks/Field-CdSLKFQk.js.map +0 -1
- package/dist/_chunks/History-B-Mrquzu.js.map +0 -1
- package/dist/_chunks/History-MnQLtk1g.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-BcycI8Lw.mjs.map +0 -1
- package/dist/_chunks/ListConfigurationPage-C0n4rUzH.js.map +0 -1
- package/dist/_chunks/ListViewPage-CRXONXwZ.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-q0SHVPUS.js.map +0 -1
- package/dist/_chunks/Relations-B53wYe8g.js.map +0 -1
- package/dist/_chunks/Relations-CIexb8gr.mjs.map +0 -1
- package/dist/_chunks/index-CJ2vYwuT.mjs.map +0 -1
- package/dist/_chunks/index-DbT2sx-Q.js.map +0 -1
- package/dist/_chunks/relations-Cl-6t9iz.js.map +0 -1
- package/dist/_chunks/relations-DI0lguF0.mjs.map +0 -1
@@ -4,18 +4,18 @@ const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const strapiAdmin = require("@strapi/admin/strapi-admin");
|
5
5
|
const React = require("react");
|
6
6
|
const designSystem = require("@strapi/design-system");
|
7
|
+
const mapValues = require("lodash/fp/mapValues");
|
7
8
|
const reactIntl = require("react-intl");
|
8
9
|
const reactRouterDom = require("react-router-dom");
|
10
|
+
const styledComponents = require("styled-components");
|
9
11
|
const yup = require("yup");
|
12
|
+
const qs = require("qs");
|
10
13
|
const pipe = require("lodash/fp/pipe");
|
11
14
|
const dateFns = require("date-fns");
|
12
|
-
const styledComponents = require("styled-components");
|
13
|
-
const qs = require("qs");
|
14
15
|
const toolkit = require("@reduxjs/toolkit");
|
15
16
|
const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
|
16
17
|
function _interopNamespace(e) {
|
17
|
-
if (e && e.__esModule)
|
18
|
-
return e;
|
18
|
+
if (e && e.__esModule) return e;
|
19
19
|
const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
|
20
20
|
if (e) {
|
21
21
|
for (const k in e) {
|
@@ -32,15 +32,23 @@ function _interopNamespace(e) {
|
|
32
32
|
return Object.freeze(n);
|
33
33
|
}
|
34
34
|
const React__namespace = /* @__PURE__ */ _interopNamespace(React);
|
35
|
+
const mapValues__default = /* @__PURE__ */ _interopDefault(mapValues);
|
35
36
|
const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
|
36
37
|
const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
|
37
|
-
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
38
|
+
const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
|
38
39
|
const v = glob[path];
|
39
40
|
if (v) {
|
40
41
|
return typeof v === "function" ? v() : Promise.resolve(v);
|
41
42
|
}
|
42
43
|
return new Promise((_, reject) => {
|
43
|
-
(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
|
+
);
|
44
52
|
});
|
45
53
|
};
|
46
54
|
const PLUGIN_ID = "content-manager";
|
@@ -294,7 +302,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
294
302
|
url: `/content-manager/collection-types/${model}`,
|
295
303
|
method: "GET",
|
296
304
|
config: {
|
297
|
-
params
|
305
|
+
params: qs.stringify(params, { encode: true })
|
298
306
|
}
|
299
307
|
}),
|
300
308
|
providesTags: (result, _error, arg) => {
|
@@ -473,8 +481,7 @@ const {
|
|
473
481
|
useUnpublishManyDocumentsMutation
|
474
482
|
} = documentApi;
|
475
483
|
const buildValidParams = (query) => {
|
476
|
-
if (!query)
|
477
|
-
return query;
|
484
|
+
if (!query) return query;
|
478
485
|
const { plugins: _, ...validQueryParams } = {
|
479
486
|
...query,
|
480
487
|
...Object.values(query?.plugins ?? {}).reduce(
|
@@ -482,9 +489,6 @@ const buildValidParams = (query) => {
|
|
482
489
|
{}
|
483
490
|
)
|
484
491
|
};
|
485
|
-
if ("_q" in validQueryParams) {
|
486
|
-
validQueryParams._q = encodeURIComponent(validQueryParams._q);
|
487
|
-
}
|
488
492
|
return validQueryParams;
|
489
493
|
};
|
490
494
|
const isBaseQueryError = (error) => {
|
@@ -989,9 +993,10 @@ const formatEditLayout = (data, {
|
|
989
993
|
currentPanelIndex += 2;
|
990
994
|
} else {
|
991
995
|
if (!panels[currentPanelIndex]) {
|
992
|
-
panels.push([]);
|
996
|
+
panels.push([row]);
|
997
|
+
} else {
|
998
|
+
panels[currentPanelIndex].push(row);
|
993
999
|
}
|
994
|
-
panels[currentPanelIndex].push(row);
|
995
1000
|
}
|
996
1001
|
return panels;
|
997
1002
|
}, []);
|
@@ -1682,10 +1687,10 @@ const useDocumentActions = () => {
|
|
1682
1687
|
update
|
1683
1688
|
};
|
1684
1689
|
};
|
1685
|
-
const ProtectedHistoryPage =
|
1686
|
-
() => Promise.resolve().then(() => require("./History-
|
1690
|
+
const ProtectedHistoryPage = React__namespace.lazy(
|
1691
|
+
() => Promise.resolve().then(() => require("./History-Cs6XM6EU.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1687
1692
|
);
|
1688
|
-
const routes$
|
1693
|
+
const routes$2 = [
|
1689
1694
|
{
|
1690
1695
|
path: ":collectionType/:slug/:id/history",
|
1691
1696
|
Component: ProtectedHistoryPage
|
@@ -1695,32 +1700,45 @@ const routes$1 = [
|
|
1695
1700
|
Component: ProtectedHistoryPage
|
1696
1701
|
}
|
1697
1702
|
];
|
1703
|
+
const ProtectedPreviewPage = React__namespace.lazy(
|
1704
|
+
() => Promise.resolve().then(() => require("./Preview-DH1h7kJ6.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1705
|
+
);
|
1706
|
+
const routes$1 = [
|
1707
|
+
{
|
1708
|
+
path: ":collectionType/:slug/:id/preview",
|
1709
|
+
Component: ProtectedPreviewPage
|
1710
|
+
},
|
1711
|
+
{
|
1712
|
+
path: ":collectionType/:slug/preview",
|
1713
|
+
Component: ProtectedPreviewPage
|
1714
|
+
}
|
1715
|
+
];
|
1698
1716
|
const ProtectedEditViewPage = React.lazy(
|
1699
|
-
() => Promise.resolve().then(() => require("./EditViewPage-
|
1717
|
+
() => Promise.resolve().then(() => require("./EditViewPage-BXoY-ITh.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1700
1718
|
);
|
1701
1719
|
const ProtectedListViewPage = React.lazy(
|
1702
|
-
() => Promise.resolve().then(() => require("./ListViewPage-
|
1720
|
+
() => Promise.resolve().then(() => require("./ListViewPage-CaGBu5H5.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1703
1721
|
);
|
1704
1722
|
const ProtectedListConfiguration = React.lazy(
|
1705
|
-
() => Promise.resolve().then(() => require("./ListConfigurationPage-
|
1723
|
+
() => Promise.resolve().then(() => require("./ListConfigurationPage-7LeytuFD.js")).then((mod) => ({
|
1706
1724
|
default: mod.ProtectedListConfiguration
|
1707
1725
|
}))
|
1708
1726
|
);
|
1709
1727
|
const ProtectedEditConfigurationPage = React.lazy(
|
1710
|
-
() => Promise.resolve().then(() => require("./EditConfigurationPage-
|
1728
|
+
() => Promise.resolve().then(() => require("./EditConfigurationPage-q76oeVU1.js")).then((mod) => ({
|
1711
1729
|
default: mod.ProtectedEditConfigurationPage
|
1712
1730
|
}))
|
1713
1731
|
);
|
1714
1732
|
const ProtectedComponentConfigurationPage = React.lazy(
|
1715
|
-
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-
|
1733
|
+
() => Promise.resolve().then(() => require("./ComponentConfigurationPage-DHV8IFbd.js")).then((mod) => ({
|
1716
1734
|
default: mod.ProtectedComponentConfigurationPage
|
1717
1735
|
}))
|
1718
1736
|
);
|
1719
1737
|
const NoPermissions = React.lazy(
|
1720
|
-
() => Promise.resolve().then(() => require("./NoPermissionsPage-
|
1738
|
+
() => Promise.resolve().then(() => require("./NoPermissionsPage-DQn5cqZz.js")).then((mod) => ({ default: mod.NoPermissions }))
|
1721
1739
|
);
|
1722
1740
|
const NoContentType = React.lazy(
|
1723
|
-
() => Promise.resolve().then(() => require("./NoContentTypePage-
|
1741
|
+
() => Promise.resolve().then(() => require("./NoContentTypePage-BaBE00IO.js")).then((mod) => ({ default: mod.NoContentType }))
|
1724
1742
|
);
|
1725
1743
|
const CollectionTypePages = () => {
|
1726
1744
|
const { collectionType } = reactRouterDom.useParams();
|
@@ -1732,7 +1750,7 @@ const CollectionTypePages = () => {
|
|
1732
1750
|
const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
|
1733
1751
|
const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
|
1734
1752
|
const LIST_RELATIVE_PATH = ":collectionType/:slug";
|
1735
|
-
const LIST_PATH = `/content-manager
|
1753
|
+
const LIST_PATH = `/content-manager/collection-types/:slug`;
|
1736
1754
|
const routes = [
|
1737
1755
|
{
|
1738
1756
|
path: LIST_RELATIVE_PATH,
|
@@ -1766,6 +1784,7 @@ const routes = [
|
|
1766
1784
|
path: "no-content-types",
|
1767
1785
|
Component: NoContentType
|
1768
1786
|
},
|
1787
|
+
...routes$2,
|
1769
1788
|
...routes$1
|
1770
1789
|
];
|
1771
1790
|
const DocumentActions = ({ actions: actions2 }) => {
|
@@ -1864,6 +1883,11 @@ const DocumentActionButton = (action) => {
|
|
1864
1883
|
) : null
|
1865
1884
|
] });
|
1866
1885
|
};
|
1886
|
+
const MenuItem = styledComponents.styled(designSystem.Menu.Item)`
|
1887
|
+
&:hover {
|
1888
|
+
background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
|
1889
|
+
}
|
1890
|
+
`;
|
1867
1891
|
const DocumentActionsMenu = ({
|
1868
1892
|
actions: actions2,
|
1869
1893
|
children,
|
@@ -1922,48 +1946,32 @@ const DocumentActionsMenu = ({
|
|
1922
1946
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
|
1923
1947
|
actions2.map((action) => {
|
1924
1948
|
return /* @__PURE__ */ jsxRuntime.jsx(
|
1925
|
-
|
1949
|
+
MenuItem,
|
1926
1950
|
{
|
1927
1951
|
disabled: action.disabled,
|
1928
1952
|
onSelect: handleClick(action),
|
1929
1953
|
display: "block",
|
1930
|
-
|
1931
|
-
|
1932
|
-
|
1933
|
-
|
1934
|
-
|
1935
|
-
|
1936
|
-
|
1937
|
-
|
1938
|
-
|
1939
|
-
|
1940
|
-
|
1941
|
-
|
1942
|
-
|
1943
|
-
|
1944
|
-
|
1945
|
-
|
1946
|
-
|
1947
|
-
|
1948
|
-
|
1949
|
-
|
1950
|
-
|
1951
|
-
designSystem.Flex,
|
1952
|
-
{
|
1953
|
-
alignItems: "center",
|
1954
|
-
background: "alternative100",
|
1955
|
-
borderStyle: "solid",
|
1956
|
-
borderColor: "alternative200",
|
1957
|
-
borderWidth: "1px",
|
1958
|
-
height: 5,
|
1959
|
-
paddingLeft: 2,
|
1960
|
-
paddingRight: 2,
|
1961
|
-
hasRadius: true,
|
1962
|
-
color: "alternative600",
|
1963
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
|
1964
|
-
}
|
1965
|
-
)
|
1966
|
-
] })
|
1954
|
+
isVariantDanger: action.variant === "danger",
|
1955
|
+
isDisabled: action.disabled,
|
1956
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
1957
|
+
designSystem.Flex,
|
1958
|
+
{
|
1959
|
+
color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
|
1960
|
+
gap: 2,
|
1961
|
+
tag: "span",
|
1962
|
+
children: [
|
1963
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
1964
|
+
designSystem.Flex,
|
1965
|
+
{
|
1966
|
+
tag: "span",
|
1967
|
+
color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
|
1968
|
+
children: action.icon
|
1969
|
+
}
|
1970
|
+
),
|
1971
|
+
action.label
|
1972
|
+
]
|
1973
|
+
}
|
1974
|
+
) })
|
1967
1975
|
},
|
1968
1976
|
action.id
|
1969
1977
|
);
|
@@ -2074,6 +2082,18 @@ const DocumentActionModal = ({
|
|
2074
2082
|
typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer
|
2075
2083
|
] }) });
|
2076
2084
|
};
|
2085
|
+
const transformData = (data) => {
|
2086
|
+
if (Array.isArray(data)) {
|
2087
|
+
return data.map(transformData);
|
2088
|
+
}
|
2089
|
+
if (typeof data === "object" && data !== null) {
|
2090
|
+
if ("apiData" in data) {
|
2091
|
+
return data.apiData;
|
2092
|
+
}
|
2093
|
+
return mapValues__default.default(transformData)(data);
|
2094
|
+
}
|
2095
|
+
return data;
|
2096
|
+
};
|
2077
2097
|
const PublishAction$1 = ({
|
2078
2098
|
activeTab,
|
2079
2099
|
documentId,
|
@@ -2088,6 +2108,7 @@ const PublishAction$1 = ({
|
|
2088
2108
|
const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
|
2089
2109
|
const isListView = reactRouterDom.useMatch(LIST_PATH) !== null;
|
2090
2110
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
2111
|
+
const { id } = reactRouterDom.useParams();
|
2091
2112
|
const { formatMessage } = reactIntl.useIntl();
|
2092
2113
|
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
2093
2114
|
const { publish } = useDocumentActions();
|
@@ -2187,13 +2208,15 @@ const PublishAction$1 = ({
|
|
2187
2208
|
documentId,
|
2188
2209
|
params
|
2189
2210
|
},
|
2190
|
-
formValues
|
2211
|
+
transformData(formValues)
|
2191
2212
|
);
|
2192
2213
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2193
|
-
|
2194
|
-
|
2195
|
-
|
2196
|
-
|
2214
|
+
if (id === "create") {
|
2215
|
+
navigate({
|
2216
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
2217
|
+
search: rawQuery
|
2218
|
+
});
|
2219
|
+
}
|
2197
2220
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2198
2221
|
setErrors(formatValidationErrors(res.error));
|
2199
2222
|
}
|
@@ -2246,6 +2269,7 @@ const PublishAction$1 = ({
|
|
2246
2269
|
};
|
2247
2270
|
};
|
2248
2271
|
PublishAction$1.type = "publish";
|
2272
|
+
PublishAction$1.position = "panel";
|
2249
2273
|
const UpdateAction = ({
|
2250
2274
|
activeTab,
|
2251
2275
|
documentId,
|
@@ -2277,7 +2301,7 @@ const UpdateAction = ({
|
|
2277
2301
|
*/
|
2278
2302
|
disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
|
2279
2303
|
label: formatMessage({
|
2280
|
-
id: "
|
2304
|
+
id: "global.save",
|
2281
2305
|
defaultMessage: "Save"
|
2282
2306
|
}),
|
2283
2307
|
onClick: async () => {
|
@@ -2303,7 +2327,7 @@ const UpdateAction = ({
|
|
2303
2327
|
documentId: cloneMatch.params.origin,
|
2304
2328
|
params
|
2305
2329
|
},
|
2306
|
-
document
|
2330
|
+
transformData(document)
|
2307
2331
|
);
|
2308
2332
|
if ("data" in res) {
|
2309
2333
|
navigate(
|
@@ -2324,7 +2348,7 @@ const UpdateAction = ({
|
|
2324
2348
|
documentId,
|
2325
2349
|
params
|
2326
2350
|
},
|
2327
|
-
document
|
2351
|
+
transformData(document)
|
2328
2352
|
);
|
2329
2353
|
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2330
2354
|
setErrors(formatValidationErrors(res.error));
|
@@ -2337,7 +2361,7 @@ const UpdateAction = ({
|
|
2337
2361
|
model,
|
2338
2362
|
params
|
2339
2363
|
},
|
2340
|
-
document
|
2364
|
+
transformData(document)
|
2341
2365
|
);
|
2342
2366
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2343
2367
|
navigate(
|
@@ -2358,6 +2382,7 @@ const UpdateAction = ({
|
|
2358
2382
|
};
|
2359
2383
|
};
|
2360
2384
|
UpdateAction.type = "update";
|
2385
|
+
UpdateAction.position = "panel";
|
2361
2386
|
const UNPUBLISH_DRAFT_OPTIONS = {
|
2362
2387
|
KEEP: "keep",
|
2363
2388
|
DISCARD: "discard"
|
@@ -2480,6 +2505,7 @@ const UnpublishAction$1 = ({
|
|
2480
2505
|
};
|
2481
2506
|
};
|
2482
2507
|
UnpublishAction$1.type = "unpublish";
|
2508
|
+
UnpublishAction$1.position = "panel";
|
2483
2509
|
const DiscardAction = ({
|
2484
2510
|
activeTab,
|
2485
2511
|
documentId,
|
@@ -2530,6 +2556,7 @@ const DiscardAction = ({
|
|
2530
2556
|
};
|
2531
2557
|
};
|
2532
2558
|
DiscardAction.type = "discard";
|
2559
|
+
DiscardAction.position = "panel";
|
2533
2560
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2534
2561
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2535
2562
|
const RelativeTime = React__namespace.forwardRef(
|
@@ -2542,7 +2569,7 @@ const RelativeTime = React__namespace.forwardRef(
|
|
2542
2569
|
});
|
2543
2570
|
const unit = intervals.find((intervalUnit) => {
|
2544
2571
|
return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
|
2545
|
-
});
|
2572
|
+
}) ?? "seconds";
|
2546
2573
|
const relativeTime = dateFns.isPast(timestamp) ? -interval[unit] : interval[unit];
|
2547
2574
|
const customInterval = customIntervals.find(
|
2548
2575
|
(custom) => interval[custom.unit] < custom.threshold
|
@@ -2576,19 +2603,29 @@ const getDisplayName = ({
|
|
2576
2603
|
return email ?? "";
|
2577
2604
|
};
|
2578
2605
|
const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
2579
|
-
const DocumentStatus = ({ status = "draft", ...restProps }) => {
|
2606
|
+
const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
|
2580
2607
|
const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
|
2581
|
-
|
2608
|
+
const { formatMessage } = reactIntl.useIntl();
|
2609
|
+
return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
|
2610
|
+
id: `content-manager.containers.List.${status}`,
|
2611
|
+
defaultMessage: capitalise(status)
|
2612
|
+
}) }) });
|
2582
2613
|
};
|
2583
2614
|
const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
2584
2615
|
const { formatMessage } = reactIntl.useIntl();
|
2585
2616
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
2617
|
+
const params = reactRouterDom.useParams();
|
2586
2618
|
const title = isCreating ? formatMessage({
|
2587
2619
|
id: "content-manager.containers.edit.title.new",
|
2588
2620
|
defaultMessage: "Create an entry"
|
2589
2621
|
}) : documentTitle;
|
2590
2622
|
return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
|
2591
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
2623
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
2624
|
+
strapiAdmin.BackButton,
|
2625
|
+
{
|
2626
|
+
fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
|
2627
|
+
}
|
2628
|
+
),
|
2592
2629
|
/* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
|
2593
2630
|
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: title }),
|
2594
2631
|
/* @__PURE__ */ jsxRuntime.jsx(HeaderToolbar, {})
|
@@ -2639,7 +2676,7 @@ const HeaderToolbar = () => {
|
|
2639
2676
|
meta: isCloning ? void 0 : meta,
|
2640
2677
|
collectionType
|
2641
2678
|
},
|
2642
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
2679
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
|
2643
2680
|
children: (actions2) => {
|
2644
2681
|
const headerActions = actions2.filter((action) => {
|
2645
2682
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -2847,6 +2884,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2847
2884
|
};
|
2848
2885
|
};
|
2849
2886
|
ConfigureTheViewAction.type = "configure-the-view";
|
2887
|
+
ConfigureTheViewAction.position = "header";
|
2850
2888
|
const EditTheModelAction = ({ model }) => {
|
2851
2889
|
const navigate = reactRouterDom.useNavigate();
|
2852
2890
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2863,6 +2901,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2863
2901
|
};
|
2864
2902
|
};
|
2865
2903
|
EditTheModelAction.type = "edit-the-model";
|
2904
|
+
EditTheModelAction.position = "header";
|
2866
2905
|
const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
2867
2906
|
const navigate = reactRouterDom.useNavigate();
|
2868
2907
|
const { formatMessage } = reactIntl.useIntl();
|
@@ -2936,6 +2975,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
|
2936
2975
|
};
|
2937
2976
|
};
|
2938
2977
|
DeleteAction$1.type = "delete";
|
2978
|
+
DeleteAction$1.position = ["header", "table-row"];
|
2939
2979
|
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
|
2940
2980
|
const Panels = () => {
|
2941
2981
|
const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
|
@@ -2998,7 +3038,7 @@ const ActionsPanelContent = () => {
|
|
2998
3038
|
strapiAdmin.DescriptionComponentRenderer,
|
2999
3039
|
{
|
3000
3040
|
props,
|
3001
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3041
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
|
3002
3042
|
children: (actions2) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActions, { actions: actions2 })
|
3003
3043
|
}
|
3004
3044
|
),
|
@@ -3025,7 +3065,7 @@ const Panel = React__namespace.forwardRef(({ children, title }, ref) => {
|
|
3025
3065
|
justifyContent: "stretch",
|
3026
3066
|
alignItems: "flex-start",
|
3027
3067
|
children: [
|
3028
|
-
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", children: title }),
|
3068
|
+
/* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", textColor: "neutral600", children: title }),
|
3029
3069
|
children
|
3030
3070
|
]
|
3031
3071
|
}
|
@@ -3275,18 +3315,10 @@ const SelectedEntriesTableContent = ({
|
|
3275
3315
|
search: row.locale && `?plugins[i18n][locale]=${row.locale}`
|
3276
3316
|
},
|
3277
3317
|
state: { from: pathname },
|
3278
|
-
label: formatMessage(
|
3279
|
-
|
3280
|
-
|
3281
|
-
|
3282
|
-
{
|
3283
|
-
id: "content-manager.components.ListViewHelperPluginTable.row-line",
|
3284
|
-
defaultMessage: "item line {number}"
|
3285
|
-
},
|
3286
|
-
{ number: index2 + 1 }
|
3287
|
-
)
|
3288
|
-
}
|
3289
|
-
),
|
3318
|
+
label: formatMessage({
|
3319
|
+
id: "content-manager.bulk-publish.edit",
|
3320
|
+
defaultMessage: "Edit"
|
3321
|
+
}),
|
3290
3322
|
target: "_blank",
|
3291
3323
|
marginLeft: "auto",
|
3292
3324
|
variant: "ghost",
|
@@ -3460,8 +3492,7 @@ const PublishAction = ({ documents, model }) => {
|
|
3460
3492
|
const refetchList = () => {
|
3461
3493
|
contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
|
3462
3494
|
};
|
3463
|
-
if (!showPublishButton)
|
3464
|
-
return null;
|
3495
|
+
if (!showPublishButton) return null;
|
3465
3496
|
return {
|
3466
3497
|
actionType: "publish",
|
3467
3498
|
variant: "tertiary",
|
@@ -3529,8 +3560,7 @@ const DeleteAction = ({ documents, model }) => {
|
|
3529
3560
|
selectRow([]);
|
3530
3561
|
}
|
3531
3562
|
};
|
3532
|
-
if (!hasDeletePermission)
|
3533
|
-
return null;
|
3563
|
+
if (!hasDeletePermission) return null;
|
3534
3564
|
return {
|
3535
3565
|
variant: "danger-light",
|
3536
3566
|
label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
|
@@ -3579,8 +3609,7 @@ const UnpublishAction = ({ documents, model }) => {
|
|
3579
3609
|
}
|
3580
3610
|
};
|
3581
3611
|
const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
|
3582
|
-
if (!showUnpublishButton)
|
3583
|
-
return null;
|
3612
|
+
if (!showUnpublishButton) return null;
|
3584
3613
|
return {
|
3585
3614
|
variant: "tertiary",
|
3586
3615
|
label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
|
@@ -3685,7 +3714,7 @@ const TableActions = ({ document }) => {
|
|
3685
3714
|
strapiAdmin.DescriptionComponentRenderer,
|
3686
3715
|
{
|
3687
3716
|
props,
|
3688
|
-
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"),
|
3689
3718
|
children: (actions2) => {
|
3690
3719
|
const tableRowActions = actions2.filter((action) => {
|
3691
3720
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3744,6 +3773,7 @@ const EditAction = ({ documentId }) => {
|
|
3744
3773
|
};
|
3745
3774
|
};
|
3746
3775
|
EditAction.type = "edit";
|
3776
|
+
EditAction.position = "table-row";
|
3747
3777
|
const StyledPencil = styledComponents.styled(Icons.Pencil)`
|
3748
3778
|
path {
|
3749
3779
|
fill: currentColor;
|
@@ -3820,6 +3850,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3820
3850
|
};
|
3821
3851
|
};
|
3822
3852
|
CloneAction.type = "clone";
|
3853
|
+
CloneAction.position = "table-row";
|
3823
3854
|
const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
|
3824
3855
|
path {
|
3825
3856
|
fill: currentColor;
|
@@ -3906,7 +3937,14 @@ class ContentManagerPlugin {
|
|
3906
3937
|
addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
|
3907
3938
|
addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
|
3908
3939
|
getBulkActions: () => this.bulkActions,
|
3909
|
-
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
|
+
},
|
3910
3948
|
getEditViewSidePanels: () => this.editViewSidePanels,
|
3911
3949
|
getHeaderActions: () => this.headerActions
|
3912
3950
|
}
|
@@ -3916,10 +3954,8 @@ class ContentManagerPlugin {
|
|
3916
3954
|
const getPrintableType = (value) => {
|
3917
3955
|
const nativeType = typeof value;
|
3918
3956
|
if (nativeType === "object") {
|
3919
|
-
if (value === null)
|
3920
|
-
|
3921
|
-
if (Array.isArray(value))
|
3922
|
-
return "array";
|
3957
|
+
if (value === null) return "null";
|
3958
|
+
if (Array.isArray(value)) return "array";
|
3923
3959
|
if (value instanceof Object && value.constructor.name !== "Object") {
|
3924
3960
|
return value.constructor.name;
|
3925
3961
|
}
|
@@ -3930,17 +3966,27 @@ const HistoryAction = ({ model, document }) => {
|
|
3930
3966
|
const { formatMessage } = reactIntl.useIntl();
|
3931
3967
|
const [{ query }] = strapiAdmin.useQueryParams();
|
3932
3968
|
const navigate = reactRouterDom.useNavigate();
|
3969
|
+
const { trackUsage } = strapiAdmin.useTracking();
|
3970
|
+
const { pathname } = reactRouterDom.useLocation();
|
3933
3971
|
const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
|
3934
3972
|
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
3935
3973
|
return null;
|
3936
3974
|
}
|
3975
|
+
const handleOnClick = () => {
|
3976
|
+
const destination = { pathname: "history", search: pluginsQueryParams };
|
3977
|
+
trackUsage("willNavigate", {
|
3978
|
+
from: pathname,
|
3979
|
+
to: `${pathname}/${destination.pathname}`
|
3980
|
+
});
|
3981
|
+
navigate(destination);
|
3982
|
+
};
|
3937
3983
|
return {
|
3938
3984
|
icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
|
3939
3985
|
label: formatMessage({
|
3940
3986
|
id: "content-manager.history.document-action",
|
3941
3987
|
defaultMessage: "Content History"
|
3942
3988
|
}),
|
3943
|
-
onClick:
|
3989
|
+
onClick: handleOnClick,
|
3944
3990
|
disabled: (
|
3945
3991
|
/**
|
3946
3992
|
* The user is creating a new document.
|
@@ -3962,6 +4008,7 @@ const HistoryAction = ({ model, document }) => {
|
|
3962
4008
|
};
|
3963
4009
|
};
|
3964
4010
|
HistoryAction.type = "history";
|
4011
|
+
HistoryAction.position = "header";
|
3965
4012
|
const historyAdmin = {
|
3966
4013
|
bootstrap(app) {
|
3967
4014
|
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
@@ -4008,6 +4055,90 @@ const { setInitialData } = actions;
|
|
4008
4055
|
const reducer = toolkit.combineReducers({
|
4009
4056
|
app: reducer$1
|
4010
4057
|
});
|
4058
|
+
const previewApi = contentManagerApi.injectEndpoints({
|
4059
|
+
endpoints: (builder) => ({
|
4060
|
+
getPreviewUrl: builder.query({
|
4061
|
+
query({ query, params }) {
|
4062
|
+
return {
|
4063
|
+
url: `/content-manager/preview/url/${params.contentType}`,
|
4064
|
+
method: "GET",
|
4065
|
+
config: {
|
4066
|
+
params: query
|
4067
|
+
}
|
4068
|
+
};
|
4069
|
+
}
|
4070
|
+
})
|
4071
|
+
})
|
4072
|
+
});
|
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
|
+
};
|
4080
|
+
const PreviewSidePanel = ({ model, documentId, document }) => {
|
4081
|
+
const { formatMessage } = reactIntl.useIntl();
|
4082
|
+
const { trackUsage } = strapiAdmin.useTracking();
|
4083
|
+
const { pathname } = reactRouterDom.useLocation();
|
4084
|
+
const [{ query }] = strapiAdmin.useQueryParams();
|
4085
|
+
const isModified = strapiAdmin.useForm("PreviewSidePanel", (state) => state.modified);
|
4086
|
+
const { data, error } = useGetPreviewUrlQuery({
|
4087
|
+
params: {
|
4088
|
+
contentType: model
|
4089
|
+
},
|
4090
|
+
query: {
|
4091
|
+
documentId,
|
4092
|
+
locale: document?.locale,
|
4093
|
+
status: document?.status
|
4094
|
+
}
|
4095
|
+
});
|
4096
|
+
if (!data?.data?.url || error) {
|
4097
|
+
return null;
|
4098
|
+
}
|
4099
|
+
const trackNavigation = () => {
|
4100
|
+
const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
|
4101
|
+
trackUsage("willNavigate", { from: pathname, to: destinationPathname });
|
4102
|
+
};
|
4103
|
+
return {
|
4104
|
+
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4105
|
+
content: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
|
4106
|
+
ConditionalTooltip,
|
4107
|
+
{
|
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(
|
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
|
+
flex: "auto",
|
4121
|
+
disabled: isModified,
|
4122
|
+
children: formatMessage({
|
4123
|
+
id: "content-manager.preview.panel.button",
|
4124
|
+
defaultMessage: "Open preview"
|
4125
|
+
})
|
4126
|
+
}
|
4127
|
+
)
|
4128
|
+
}
|
4129
|
+
) })
|
4130
|
+
};
|
4131
|
+
};
|
4132
|
+
const FEATURE_ID = "preview";
|
4133
|
+
const previewAdmin = {
|
4134
|
+
bootstrap(app) {
|
4135
|
+
if (!window.strapi.future.isEnabled(FEATURE_ID)) {
|
4136
|
+
return;
|
4137
|
+
}
|
4138
|
+
const contentManagerPluginApis = app.getPlugin("content-manager").apis;
|
4139
|
+
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
|
4140
|
+
}
|
4141
|
+
};
|
4011
4142
|
const index = {
|
4012
4143
|
register(app) {
|
4013
4144
|
const cm = new ContentManagerPlugin();
|
@@ -4027,7 +4158,7 @@ const index = {
|
|
4027
4158
|
app.router.addRoute({
|
4028
4159
|
path: "content-manager/*",
|
4029
4160
|
lazy: async () => {
|
4030
|
-
const { Layout } = await Promise.resolve().then(() => require("./layout-
|
4161
|
+
const { Layout } = await Promise.resolve().then(() => require("./layout-nBPDlXjr.js"));
|
4031
4162
|
return {
|
4032
4163
|
Component: Layout
|
4033
4164
|
};
|
@@ -4040,11 +4171,14 @@ const index = {
|
|
4040
4171
|
if (typeof historyAdmin.bootstrap === "function") {
|
4041
4172
|
historyAdmin.bootstrap(app);
|
4042
4173
|
}
|
4174
|
+
if (typeof previewAdmin.bootstrap === "function") {
|
4175
|
+
previewAdmin.bootstrap(app);
|
4176
|
+
}
|
4043
4177
|
},
|
4044
4178
|
async registerTrads({ locales }) {
|
4045
4179
|
const importedTrads = await Promise.all(
|
4046
4180
|
locales.map((locale) => {
|
4047
|
-
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-
|
4181
|
+
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 }) => {
|
4048
4182
|
return {
|
4049
4183
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4050
4184
|
locale
|
@@ -4102,5 +4236,6 @@ exports.useGetAllContentTypeSettingsQuery = useGetAllContentTypeSettingsQuery;
|
|
4102
4236
|
exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
|
4103
4237
|
exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
|
4104
4238
|
exports.useGetInitialDataQuery = useGetInitialDataQuery;
|
4239
|
+
exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
|
4105
4240
|
exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
|
4106
|
-
//# sourceMappingURL=index-
|
4241
|
+
//# sourceMappingURL=index-BN1pPa5v.js.map
|