@strapi/content-manager 0.0.0-experimental.65b9961ce81496e349024ceb95be1d5946f2c429 → 0.0.0-experimental.68e9a4cd6745e351ad90cd57447ce36d35fccf64
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/{ComponentConfigurationPage-CQroR9Qk.mjs → ComponentConfigurationPage-DhWA-JzT.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-CQroR9Qk.mjs.map → ComponentConfigurationPage-DhWA-JzT.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-CO977CPh.js → ComponentConfigurationPage-UduDBv3m.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-CO977CPh.js.map → ComponentConfigurationPage-UduDBv3m.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-tVCJ5vWC.mjs → EditConfigurationPage-5tmx_7Hp.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-tVCJ5vWC.mjs.map → EditConfigurationPage-5tmx_7Hp.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BPgoE-kf.js → EditConfigurationPage-Cp9UzUfs.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BPgoE-kf.js.map → EditConfigurationPage-Cp9UzUfs.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-8mOu02ji.mjs → EditViewPage-BKoISUOu.mjs} +38 -8
- package/dist/_chunks/EditViewPage-BKoISUOu.mjs.map +1 -0
- package/dist/_chunks/{EditViewPage-BMVgUNOX.js → EditViewPage-C7l2Emuj.js} +37 -7
- package/dist/_chunks/EditViewPage-C7l2Emuj.js.map +1 -0
- package/dist/_chunks/{Field-CdSLKFQk.js → Field-BPSJpDfE.js} +42 -23
- package/dist/_chunks/Field-BPSJpDfE.js.map +1 -0
- package/dist/_chunks/{Field-CJPYzwD7.mjs → Field-BZxzYf1x.mjs} +43 -24
- package/dist/_chunks/Field-BZxzYf1x.mjs.map +1 -0
- package/dist/_chunks/{Form-DJOJ-GF1.mjs → Form-8qyOU6YG.mjs} +2 -2
- package/dist/_chunks/{Form-DJOJ-GF1.mjs.map → Form-8qyOU6YG.mjs.map} +1 -1
- package/dist/_chunks/{Form-eP5bZwap.js → Form-DLkqDd2G.js} +2 -2
- package/dist/_chunks/{Form-eP5bZwap.js.map → Form-DLkqDd2G.js.map} +1 -1
- package/dist/_chunks/{History-B-Mrquzu.js → History-DYMicybF.js} +22 -92
- package/dist/_chunks/History-DYMicybF.js.map +1 -0
- package/dist/_chunks/{History-MnQLtk1g.mjs → History-N_kRb1Yr.mjs} +23 -93
- package/dist/_chunks/History-N_kRb1Yr.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BcycI8Lw.mjs → ListConfigurationPage-BM3qVxug.mjs} +5 -4
- package/dist/_chunks/ListConfigurationPage-BM3qVxug.mjs.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-C0n4rUzH.js → ListConfigurationPage-rUF9iGWq.js} +4 -3
- package/dist/_chunks/ListConfigurationPage-rUF9iGWq.js.map +1 -0
- package/dist/_chunks/{ListViewPage-q0SHVPUS.js → ListViewPage-BSLzd7cZ.js} +62 -39
- package/dist/_chunks/ListViewPage-BSLzd7cZ.js.map +1 -0
- package/dist/_chunks/{ListViewPage-CRXONXwZ.mjs → ListViewPage-CWilGbZb.mjs} +62 -39
- package/dist/_chunks/ListViewPage-CWilGbZb.mjs.map +1 -0
- package/dist/_chunks/{NoContentTypePage-Bh3komDV.js → NoContentTypePage-CQccVhIX.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-Bh3komDV.js.map → NoContentTypePage-CQccVhIX.js.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-ukzFRF3z.mjs → NoContentTypePage-VWYlePwI.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-ukzFRF3z.mjs.map → NoContentTypePage-VWYlePwI.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-BGBpj_Y1.js → NoPermissionsPage-Af32Gg2m.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-BGBpj_Y1.js.map → NoPermissionsPage-Af32Gg2m.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-B4sD7Ble.mjs → NoPermissionsPage-CS2tCmfr.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-B4sD7Ble.mjs.map → NoPermissionsPage-CS2tCmfr.mjs.map} +1 -1
- package/dist/_chunks/Preview-D4KzuJFL.js +291 -0
- package/dist/_chunks/Preview-D4KzuJFL.js.map +1 -0
- package/dist/_chunks/Preview-kPkuZbBJ.mjs +272 -0
- package/dist/_chunks/Preview-kPkuZbBJ.mjs.map +1 -0
- package/dist/_chunks/{Relations-CIexb8gr.mjs → Relations-5k27Rh54.mjs} +44 -17
- package/dist/_chunks/Relations-5k27Rh54.mjs.map +1 -0
- package/dist/_chunks/{Relations-B53wYe8g.js → Relations-D_Ki5aVM.js} +43 -16
- package/dist/_chunks/Relations-D_Ki5aVM.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/{index-CJ2vYwuT.mjs → index-BLPa8Dq-.mjs} +208 -91
- package/dist/_chunks/index-BLPa8Dq-.mjs.map +1 -0
- package/dist/_chunks/{index-DbT2sx-Q.js → index-DwOsF7wF.js} +205 -87
- package/dist/_chunks/index-DwOsF7wF.js.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-2Si0j0jO.mjs} +3 -3
- package/dist/_chunks/{layout-vzKSrr7p.mjs.map → layout-2Si0j0jO.mjs.map} +1 -1
- package/dist/_chunks/{layout-CeBSIkmP.js → layout-CN2bFL9V.js} +3 -3
- package/dist/_chunks/{layout-CeBSIkmP.js.map → layout-CN2bFL9V.js.map} +1 -1
- package/dist/_chunks/{relations-Cl-6t9iz.js → relations-B0E0XUY7.js} +6 -7
- package/dist/_chunks/relations-B0E0XUY7.js.map +1 -0
- package/dist/_chunks/{relations-DI0lguF0.mjs → relations-CAxDjUJF.mjs} +6 -7
- package/dist/_chunks/relations-CAxDjUJF.mjs.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +4 -4
- package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -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 +391 -144
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +392 -145
- 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 +10 -10
- 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
@@ -3,15 +3,16 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useStrapiApp, createContext, useQueryParams, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useForm, useTracking, useGuidedTour, BackButton, DescriptionComponentRenderer, useTable, Table } from "@strapi/admin/strapi-admin";
|
4
4
|
import * as React from "react";
|
5
5
|
import { lazy } from "react";
|
6
|
-
import {
|
6
|
+
import { Menu, Button, VisuallyHidden, Flex, Dialog, Modal, Typography, Radio, Status, Box, SingleSelect, SingleSelectOption, IconButton, Loader, Tooltip, LinkButton } from "@strapi/design-system";
|
7
|
+
import mapValues from "lodash/fp/mapValues";
|
7
8
|
import { useIntl } from "react-intl";
|
8
9
|
import { useParams, useNavigate, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
|
10
|
+
import { styled } from "styled-components";
|
9
11
|
import * as yup from "yup";
|
10
12
|
import { ValidationError } from "yup";
|
13
|
+
import { stringify } from "qs";
|
11
14
|
import pipe from "lodash/fp/pipe";
|
12
15
|
import { intervalToDuration, isPast } from "date-fns";
|
13
|
-
import { styled } from "styled-components";
|
14
|
-
import { stringify } from "qs";
|
15
16
|
import { createSlice, combineReducers } from "@reduxjs/toolkit";
|
16
17
|
const __variableDynamicImportRuntimeHelper = (glob, path) => {
|
17
18
|
const v = glob[path];
|
@@ -273,7 +274,7 @@ const documentApi = contentManagerApi.injectEndpoints({
|
|
273
274
|
url: `/content-manager/collection-types/${model}`,
|
274
275
|
method: "GET",
|
275
276
|
config: {
|
276
|
-
params
|
277
|
+
params: stringify(params, { encode: true })
|
277
278
|
}
|
278
279
|
}),
|
279
280
|
providesTags: (result, _error, arg) => {
|
@@ -461,9 +462,6 @@ const buildValidParams = (query) => {
|
|
461
462
|
{}
|
462
463
|
)
|
463
464
|
};
|
464
|
-
if ("_q" in validQueryParams) {
|
465
|
-
validQueryParams._q = encodeURIComponent(validQueryParams._q);
|
466
|
-
}
|
467
465
|
return validQueryParams;
|
468
466
|
};
|
469
467
|
const isBaseQueryError = (error) => {
|
@@ -968,9 +966,10 @@ const formatEditLayout = (data, {
|
|
968
966
|
currentPanelIndex += 2;
|
969
967
|
} else {
|
970
968
|
if (!panels[currentPanelIndex]) {
|
971
|
-
panels.push([]);
|
969
|
+
panels.push([row]);
|
970
|
+
} else {
|
971
|
+
panels[currentPanelIndex].push(row);
|
972
972
|
}
|
973
|
-
panels[currentPanelIndex].push(row);
|
974
973
|
}
|
975
974
|
return panels;
|
976
975
|
}, []);
|
@@ -1661,10 +1660,10 @@ const useDocumentActions = () => {
|
|
1661
1660
|
update
|
1662
1661
|
};
|
1663
1662
|
};
|
1664
|
-
const ProtectedHistoryPage = lazy(
|
1665
|
-
() => import("./History-
|
1663
|
+
const ProtectedHistoryPage = React.lazy(
|
1664
|
+
() => import("./History-N_kRb1Yr.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1666
1665
|
);
|
1667
|
-
const routes$
|
1666
|
+
const routes$2 = [
|
1668
1667
|
{
|
1669
1668
|
path: ":collectionType/:slug/:id/history",
|
1670
1669
|
Component: ProtectedHistoryPage
|
@@ -1674,32 +1673,45 @@ const routes$1 = [
|
|
1674
1673
|
Component: ProtectedHistoryPage
|
1675
1674
|
}
|
1676
1675
|
];
|
1676
|
+
const ProtectedPreviewPage = React.lazy(
|
1677
|
+
() => import("./Preview-kPkuZbBJ.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1678
|
+
);
|
1679
|
+
const routes$1 = [
|
1680
|
+
{
|
1681
|
+
path: ":collectionType/:slug/:id/preview",
|
1682
|
+
Component: ProtectedPreviewPage
|
1683
|
+
},
|
1684
|
+
{
|
1685
|
+
path: ":collectionType/:slug/preview",
|
1686
|
+
Component: ProtectedPreviewPage
|
1687
|
+
}
|
1688
|
+
];
|
1677
1689
|
const ProtectedEditViewPage = lazy(
|
1678
|
-
() => import("./EditViewPage-
|
1690
|
+
() => import("./EditViewPage-BKoISUOu.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1679
1691
|
);
|
1680
1692
|
const ProtectedListViewPage = lazy(
|
1681
|
-
() => import("./ListViewPage-
|
1693
|
+
() => import("./ListViewPage-CWilGbZb.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1682
1694
|
);
|
1683
1695
|
const ProtectedListConfiguration = lazy(
|
1684
|
-
() => import("./ListConfigurationPage-
|
1696
|
+
() => import("./ListConfigurationPage-BM3qVxug.mjs").then((mod) => ({
|
1685
1697
|
default: mod.ProtectedListConfiguration
|
1686
1698
|
}))
|
1687
1699
|
);
|
1688
1700
|
const ProtectedEditConfigurationPage = lazy(
|
1689
|
-
() => import("./EditConfigurationPage-
|
1701
|
+
() => import("./EditConfigurationPage-5tmx_7Hp.mjs").then((mod) => ({
|
1690
1702
|
default: mod.ProtectedEditConfigurationPage
|
1691
1703
|
}))
|
1692
1704
|
);
|
1693
1705
|
const ProtectedComponentConfigurationPage = lazy(
|
1694
|
-
() => import("./ComponentConfigurationPage-
|
1706
|
+
() => import("./ComponentConfigurationPage-DhWA-JzT.mjs").then((mod) => ({
|
1695
1707
|
default: mod.ProtectedComponentConfigurationPage
|
1696
1708
|
}))
|
1697
1709
|
);
|
1698
1710
|
const NoPermissions = lazy(
|
1699
|
-
() => import("./NoPermissionsPage-
|
1711
|
+
() => import("./NoPermissionsPage-CS2tCmfr.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1700
1712
|
);
|
1701
1713
|
const NoContentType = lazy(
|
1702
|
-
() => import("./NoContentTypePage-
|
1714
|
+
() => import("./NoContentTypePage-VWYlePwI.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1703
1715
|
);
|
1704
1716
|
const CollectionTypePages = () => {
|
1705
1717
|
const { collectionType } = useParams();
|
@@ -1711,7 +1723,7 @@ const CollectionTypePages = () => {
|
|
1711
1723
|
const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
|
1712
1724
|
const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
|
1713
1725
|
const LIST_RELATIVE_PATH = ":collectionType/:slug";
|
1714
|
-
const LIST_PATH = `/content-manager
|
1726
|
+
const LIST_PATH = `/content-manager/collection-types/:slug`;
|
1715
1727
|
const routes = [
|
1716
1728
|
{
|
1717
1729
|
path: LIST_RELATIVE_PATH,
|
@@ -1745,6 +1757,7 @@ const routes = [
|
|
1745
1757
|
path: "no-content-types",
|
1746
1758
|
Component: NoContentType
|
1747
1759
|
},
|
1760
|
+
...routes$2,
|
1748
1761
|
...routes$1
|
1749
1762
|
];
|
1750
1763
|
const DocumentActions = ({ actions: actions2 }) => {
|
@@ -1843,6 +1856,11 @@ const DocumentActionButton = (action) => {
|
|
1843
1856
|
) : null
|
1844
1857
|
] });
|
1845
1858
|
};
|
1859
|
+
const MenuItem = styled(Menu.Item)`
|
1860
|
+
&:hover {
|
1861
|
+
background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
|
1862
|
+
}
|
1863
|
+
`;
|
1846
1864
|
const DocumentActionsMenu = ({
|
1847
1865
|
actions: actions2,
|
1848
1866
|
children,
|
@@ -1901,48 +1919,32 @@ const DocumentActionsMenu = ({
|
|
1901
1919
|
/* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
|
1902
1920
|
actions2.map((action) => {
|
1903
1921
|
return /* @__PURE__ */ jsx(
|
1904
|
-
|
1922
|
+
MenuItem,
|
1905
1923
|
{
|
1906
1924
|
disabled: action.disabled,
|
1907
1925
|
onSelect: handleClick(action),
|
1908
1926
|
display: "block",
|
1909
|
-
|
1910
|
-
|
1911
|
-
|
1912
|
-
|
1913
|
-
|
1914
|
-
|
1915
|
-
|
1916
|
-
|
1917
|
-
|
1918
|
-
|
1919
|
-
|
1920
|
-
|
1921
|
-
|
1922
|
-
|
1923
|
-
|
1924
|
-
|
1925
|
-
|
1926
|
-
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
Flex,
|
1931
|
-
{
|
1932
|
-
alignItems: "center",
|
1933
|
-
background: "alternative100",
|
1934
|
-
borderStyle: "solid",
|
1935
|
-
borderColor: "alternative200",
|
1936
|
-
borderWidth: "1px",
|
1937
|
-
height: 5,
|
1938
|
-
paddingLeft: 2,
|
1939
|
-
paddingRight: 2,
|
1940
|
-
hasRadius: true,
|
1941
|
-
color: "alternative600",
|
1942
|
-
children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
|
1943
|
-
}
|
1944
|
-
)
|
1945
|
-
] })
|
1927
|
+
isVariantDanger: action.variant === "danger",
|
1928
|
+
isDisabled: action.disabled,
|
1929
|
+
children: /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxs(
|
1930
|
+
Flex,
|
1931
|
+
{
|
1932
|
+
color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
|
1933
|
+
gap: 2,
|
1934
|
+
tag: "span",
|
1935
|
+
children: [
|
1936
|
+
/* @__PURE__ */ jsx(
|
1937
|
+
Flex,
|
1938
|
+
{
|
1939
|
+
tag: "span",
|
1940
|
+
color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
|
1941
|
+
children: action.icon
|
1942
|
+
}
|
1943
|
+
),
|
1944
|
+
action.label
|
1945
|
+
]
|
1946
|
+
}
|
1947
|
+
) })
|
1946
1948
|
},
|
1947
1949
|
action.id
|
1948
1950
|
);
|
@@ -2053,6 +2055,18 @@ const DocumentActionModal = ({
|
|
2053
2055
|
typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
|
2054
2056
|
] }) });
|
2055
2057
|
};
|
2058
|
+
const transformData = (data) => {
|
2059
|
+
if (Array.isArray(data)) {
|
2060
|
+
return data.map(transformData);
|
2061
|
+
}
|
2062
|
+
if (typeof data === "object" && data !== null) {
|
2063
|
+
if ("apiData" in data) {
|
2064
|
+
return data.apiData;
|
2065
|
+
}
|
2066
|
+
return mapValues(transformData)(data);
|
2067
|
+
}
|
2068
|
+
return data;
|
2069
|
+
};
|
2056
2070
|
const PublishAction$1 = ({
|
2057
2071
|
activeTab,
|
2058
2072
|
documentId,
|
@@ -2067,6 +2081,7 @@ const PublishAction$1 = ({
|
|
2067
2081
|
const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
|
2068
2082
|
const isListView = useMatch(LIST_PATH) !== null;
|
2069
2083
|
const isCloning = useMatch(CLONE_PATH) !== null;
|
2084
|
+
const { id } = useParams();
|
2070
2085
|
const { formatMessage } = useIntl();
|
2071
2086
|
const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
|
2072
2087
|
const { publish } = useDocumentActions();
|
@@ -2166,13 +2181,15 @@ const PublishAction$1 = ({
|
|
2166
2181
|
documentId,
|
2167
2182
|
params
|
2168
2183
|
},
|
2169
|
-
formValues
|
2184
|
+
transformData(formValues)
|
2170
2185
|
);
|
2171
2186
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2172
|
-
|
2173
|
-
|
2174
|
-
|
2175
|
-
|
2187
|
+
if (id === "create") {
|
2188
|
+
navigate({
|
2189
|
+
pathname: `../${collectionType}/${model}/${res.data.documentId}`,
|
2190
|
+
search: rawQuery
|
2191
|
+
});
|
2192
|
+
}
|
2176
2193
|
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2177
2194
|
setErrors(formatValidationErrors(res.error));
|
2178
2195
|
}
|
@@ -2256,7 +2273,7 @@ const UpdateAction = ({
|
|
2256
2273
|
*/
|
2257
2274
|
disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
|
2258
2275
|
label: formatMessage({
|
2259
|
-
id: "
|
2276
|
+
id: "global.save",
|
2260
2277
|
defaultMessage: "Save"
|
2261
2278
|
}),
|
2262
2279
|
onClick: async () => {
|
@@ -2282,7 +2299,7 @@ const UpdateAction = ({
|
|
2282
2299
|
documentId: cloneMatch.params.origin,
|
2283
2300
|
params
|
2284
2301
|
},
|
2285
|
-
document
|
2302
|
+
transformData(document)
|
2286
2303
|
);
|
2287
2304
|
if ("data" in res) {
|
2288
2305
|
navigate(
|
@@ -2303,7 +2320,7 @@ const UpdateAction = ({
|
|
2303
2320
|
documentId,
|
2304
2321
|
params
|
2305
2322
|
},
|
2306
|
-
document
|
2323
|
+
transformData(document)
|
2307
2324
|
);
|
2308
2325
|
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2309
2326
|
setErrors(formatValidationErrors(res.error));
|
@@ -2316,7 +2333,7 @@ const UpdateAction = ({
|
|
2316
2333
|
model,
|
2317
2334
|
params
|
2318
2335
|
},
|
2319
|
-
document
|
2336
|
+
transformData(document)
|
2320
2337
|
);
|
2321
2338
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2322
2339
|
navigate(
|
@@ -2521,7 +2538,7 @@ const RelativeTime = React.forwardRef(
|
|
2521
2538
|
});
|
2522
2539
|
const unit = intervals.find((intervalUnit) => {
|
2523
2540
|
return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
|
2524
|
-
});
|
2541
|
+
}) ?? "seconds";
|
2525
2542
|
const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
|
2526
2543
|
const customInterval = customIntervals.find(
|
2527
2544
|
(custom) => interval[custom.unit] < custom.threshold
|
@@ -2555,19 +2572,29 @@ const getDisplayName = ({
|
|
2555
2572
|
return email ?? "";
|
2556
2573
|
};
|
2557
2574
|
const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
|
2558
|
-
const DocumentStatus = ({ status = "draft", ...restProps }) => {
|
2575
|
+
const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
|
2559
2576
|
const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
|
2560
|
-
|
2577
|
+
const { formatMessage } = useIntl();
|
2578
|
+
return /* @__PURE__ */ jsx(Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
|
2579
|
+
id: `content-manager.containers.List.${status}`,
|
2580
|
+
defaultMessage: capitalise(status)
|
2581
|
+
}) }) });
|
2561
2582
|
};
|
2562
2583
|
const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
|
2563
2584
|
const { formatMessage } = useIntl();
|
2564
2585
|
const isCloning = useMatch(CLONE_PATH) !== null;
|
2586
|
+
const params = useParams();
|
2565
2587
|
const title = isCreating ? formatMessage({
|
2566
2588
|
id: "content-manager.containers.edit.title.new",
|
2567
2589
|
defaultMessage: "Create an entry"
|
2568
2590
|
}) : documentTitle;
|
2569
2591
|
return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
|
2570
|
-
/* @__PURE__ */ jsx(
|
2592
|
+
/* @__PURE__ */ jsx(
|
2593
|
+
BackButton,
|
2594
|
+
{
|
2595
|
+
fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
|
2596
|
+
}
|
2597
|
+
),
|
2571
2598
|
/* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
|
2572
2599
|
/* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
|
2573
2600
|
/* @__PURE__ */ jsx(HeaderToolbar, {})
|
@@ -3004,7 +3031,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
|
|
3004
3031
|
justifyContent: "stretch",
|
3005
3032
|
alignItems: "flex-start",
|
3006
3033
|
children: [
|
3007
|
-
/* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", children: title }),
|
3034
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", textColor: "neutral600", children: title }),
|
3008
3035
|
children
|
3009
3036
|
]
|
3010
3037
|
}
|
@@ -3254,18 +3281,10 @@ const SelectedEntriesTableContent = ({
|
|
3254
3281
|
search: row.locale && `?plugins[i18n][locale]=${row.locale}`
|
3255
3282
|
},
|
3256
3283
|
state: { from: pathname },
|
3257
|
-
label: formatMessage(
|
3258
|
-
|
3259
|
-
|
3260
|
-
|
3261
|
-
{
|
3262
|
-
id: "content-manager.components.ListViewHelperPluginTable.row-line",
|
3263
|
-
defaultMessage: "item line {number}"
|
3264
|
-
},
|
3265
|
-
{ number: index2 + 1 }
|
3266
|
-
)
|
3267
|
-
}
|
3268
|
-
),
|
3284
|
+
label: formatMessage({
|
3285
|
+
id: "content-manager.bulk-publish.edit",
|
3286
|
+
defaultMessage: "Edit"
|
3287
|
+
}),
|
3269
3288
|
target: "_blank",
|
3270
3289
|
marginLeft: "auto",
|
3271
3290
|
variant: "ghost",
|
@@ -3909,17 +3928,27 @@ const HistoryAction = ({ model, document }) => {
|
|
3909
3928
|
const { formatMessage } = useIntl();
|
3910
3929
|
const [{ query }] = useQueryParams();
|
3911
3930
|
const navigate = useNavigate();
|
3931
|
+
const { trackUsage } = useTracking();
|
3932
|
+
const { pathname } = useLocation();
|
3912
3933
|
const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
|
3913
3934
|
if (!window.strapi.features.isEnabled("cms-content-history")) {
|
3914
3935
|
return null;
|
3915
3936
|
}
|
3937
|
+
const handleOnClick = () => {
|
3938
|
+
const destination = { pathname: "history", search: pluginsQueryParams };
|
3939
|
+
trackUsage("willNavigate", {
|
3940
|
+
from: pathname,
|
3941
|
+
to: `${pathname}/${destination.pathname}`
|
3942
|
+
});
|
3943
|
+
navigate(destination);
|
3944
|
+
};
|
3916
3945
|
return {
|
3917
3946
|
icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
|
3918
3947
|
label: formatMessage({
|
3919
3948
|
id: "content-manager.history.document-action",
|
3920
3949
|
defaultMessage: "Content History"
|
3921
3950
|
}),
|
3922
|
-
onClick:
|
3951
|
+
onClick: handleOnClick,
|
3923
3952
|
disabled: (
|
3924
3953
|
/**
|
3925
3954
|
* The user is creating a new document.
|
@@ -3987,6 +4016,90 @@ const { setInitialData } = actions;
|
|
3987
4016
|
const reducer = combineReducers({
|
3988
4017
|
app: reducer$1
|
3989
4018
|
});
|
4019
|
+
const previewApi = contentManagerApi.injectEndpoints({
|
4020
|
+
endpoints: (builder) => ({
|
4021
|
+
getPreviewUrl: builder.query({
|
4022
|
+
query({ query, params }) {
|
4023
|
+
return {
|
4024
|
+
url: `/content-manager/preview/url/${params.contentType}`,
|
4025
|
+
method: "GET",
|
4026
|
+
config: {
|
4027
|
+
params: query
|
4028
|
+
}
|
4029
|
+
};
|
4030
|
+
}
|
4031
|
+
})
|
4032
|
+
})
|
4033
|
+
});
|
4034
|
+
const { useGetPreviewUrlQuery } = previewApi;
|
4035
|
+
const ConditionalTooltip = ({ isShown, label, children }) => {
|
4036
|
+
if (isShown) {
|
4037
|
+
return /* @__PURE__ */ jsx(Tooltip, { label, children });
|
4038
|
+
}
|
4039
|
+
return children;
|
4040
|
+
};
|
4041
|
+
const PreviewSidePanel = ({ model, documentId, document }) => {
|
4042
|
+
const { formatMessage } = useIntl();
|
4043
|
+
const { trackUsage } = useTracking();
|
4044
|
+
const { pathname } = useLocation();
|
4045
|
+
const [{ query }] = useQueryParams();
|
4046
|
+
const isModified = useForm("PreviewSidePanel", (state) => state.modified);
|
4047
|
+
const { data, error } = useGetPreviewUrlQuery({
|
4048
|
+
params: {
|
4049
|
+
contentType: model
|
4050
|
+
},
|
4051
|
+
query: {
|
4052
|
+
documentId,
|
4053
|
+
locale: document?.locale,
|
4054
|
+
status: document?.status
|
4055
|
+
}
|
4056
|
+
});
|
4057
|
+
if (!data?.data?.url || error) {
|
4058
|
+
return null;
|
4059
|
+
}
|
4060
|
+
const trackNavigation = () => {
|
4061
|
+
const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
|
4062
|
+
trackUsage("willNavigate", { from: pathname, to: destinationPathname });
|
4063
|
+
};
|
4064
|
+
return {
|
4065
|
+
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4066
|
+
content: /* @__PURE__ */ jsx(Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsx(
|
4067
|
+
ConditionalTooltip,
|
4068
|
+
{
|
4069
|
+
label: formatMessage({
|
4070
|
+
id: "content-manager.preview.panel.button-disabled-tooltip",
|
4071
|
+
defaultMessage: "Please save to open the preview"
|
4072
|
+
}),
|
4073
|
+
isShown: isModified,
|
4074
|
+
children: /* @__PURE__ */ jsx(
|
4075
|
+
Button,
|
4076
|
+
{
|
4077
|
+
variant: "tertiary",
|
4078
|
+
tag: Link,
|
4079
|
+
to: { pathname: "preview", search: stringify(query, { encode: false }) },
|
4080
|
+
onClick: trackNavigation,
|
4081
|
+
flex: "auto",
|
4082
|
+
disabled: isModified,
|
4083
|
+
children: formatMessage({
|
4084
|
+
id: "content-manager.preview.panel.button",
|
4085
|
+
defaultMessage: "Open preview"
|
4086
|
+
})
|
4087
|
+
}
|
4088
|
+
)
|
4089
|
+
}
|
4090
|
+
) })
|
4091
|
+
};
|
4092
|
+
};
|
4093
|
+
const FEATURE_ID = "preview";
|
4094
|
+
const previewAdmin = {
|
4095
|
+
bootstrap(app) {
|
4096
|
+
if (!window.strapi.future.isEnabled(FEATURE_ID)) {
|
4097
|
+
return;
|
4098
|
+
}
|
4099
|
+
const contentManagerPluginApis = app.getPlugin("content-manager").apis;
|
4100
|
+
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
|
4101
|
+
}
|
4102
|
+
};
|
3990
4103
|
const index = {
|
3991
4104
|
register(app) {
|
3992
4105
|
const cm = new ContentManagerPlugin();
|
@@ -4006,7 +4119,7 @@ const index = {
|
|
4006
4119
|
app.router.addRoute({
|
4007
4120
|
path: "content-manager/*",
|
4008
4121
|
lazy: async () => {
|
4009
|
-
const { Layout } = await import("./layout-
|
4122
|
+
const { Layout } = await import("./layout-2Si0j0jO.mjs");
|
4010
4123
|
return {
|
4011
4124
|
Component: Layout
|
4012
4125
|
};
|
@@ -4019,11 +4132,14 @@ const index = {
|
|
4019
4132
|
if (typeof historyAdmin.bootstrap === "function") {
|
4020
4133
|
historyAdmin.bootstrap(app);
|
4021
4134
|
}
|
4135
|
+
if (typeof previewAdmin.bootstrap === "function") {
|
4136
|
+
previewAdmin.bootstrap(app);
|
4137
|
+
}
|
4022
4138
|
},
|
4023
4139
|
async registerTrads({ locales }) {
|
4024
4140
|
const importedTrads = await Promise.all(
|
4025
4141
|
locales.map((locale) => {
|
4026
|
-
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-
|
4142
|
+
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`).then(({ default: data }) => {
|
4027
4143
|
return {
|
4028
4144
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4029
4145
|
locale
|
@@ -4050,9 +4166,10 @@ export {
|
|
4050
4166
|
HOOKS as H,
|
4051
4167
|
InjectionZone as I,
|
4052
4168
|
useDocument as J,
|
4053
|
-
|
4054
|
-
|
4055
|
-
|
4169
|
+
useGetPreviewUrlQuery as K,
|
4170
|
+
index as L,
|
4171
|
+
useContentManagerContext as M,
|
4172
|
+
useDocumentActions as N,
|
4056
4173
|
Panels as P,
|
4057
4174
|
RelativeTime as R,
|
4058
4175
|
SINGLE_TYPES as S,
|
@@ -4084,4 +4201,4 @@ export {
|
|
4084
4201
|
capitalise as y,
|
4085
4202
|
useUpdateContentTypeConfigurationMutation as z
|
4086
4203
|
};
|
4087
|
-
//# sourceMappingURL=index-
|
4204
|
+
//# sourceMappingURL=index-BLPa8Dq-.mjs.map
|