@strapi/content-manager 5.0.6 → 5.1.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/{ComponentConfigurationPage-DfFSZQxe.mjs → ComponentConfigurationPage-BpM_Hc7r.mjs} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-DfFSZQxe.mjs.map → ComponentConfigurationPage-BpM_Hc7r.mjs.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-FqfsxQ1j.js → ComponentConfigurationPage-CL9CAMaL.js} +4 -4
- package/dist/_chunks/{ComponentConfigurationPage-FqfsxQ1j.js.map → ComponentConfigurationPage-CL9CAMaL.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-Cn0e8t3I.js → EditConfigurationPage-ILWo0h1e.js} +4 -4
- package/dist/_chunks/{EditConfigurationPage-Cn0e8t3I.js.map → EditConfigurationPage-ILWo0h1e.js.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-DdPNAbl3.mjs → EditConfigurationPage-_prbqpTM.mjs} +4 -4
- package/dist/_chunks/{EditConfigurationPage-DdPNAbl3.mjs.map → EditConfigurationPage-_prbqpTM.mjs.map} +1 -1
- package/dist/_chunks/{EditViewPage-DlxEHhUt.js → EditViewPage-BqZvBN4s.js} +3 -3
- package/dist/_chunks/EditViewPage-BqZvBN4s.js.map +1 -0
- package/dist/_chunks/{EditViewPage-B82x_x1b.mjs → EditViewPage-DAtscabN.mjs} +3 -3
- package/dist/_chunks/EditViewPage-DAtscabN.mjs.map +1 -0
- package/dist/_chunks/{Field-COL25JiC.js → Field-CcoQiiz1.js} +5 -5
- package/dist/_chunks/Field-CcoQiiz1.js.map +1 -0
- package/dist/_chunks/{Field-DufHXW17.mjs → Field-D-mgn1tH.mjs} +5 -5
- package/dist/_chunks/Field-D-mgn1tH.mjs.map +1 -0
- package/dist/_chunks/{Form-u_kAOhwB.mjs → Form-BxyeWiXW.mjs} +2 -2
- package/dist/_chunks/{Form-u_kAOhwB.mjs.map → Form-BxyeWiXW.mjs.map} +1 -1
- package/dist/_chunks/{Form-BssUwrTO.js → Form-CmLbZDfi.js} +2 -2
- package/dist/_chunks/{Form-BssUwrTO.js.map → Form-CmLbZDfi.js.map} +1 -1
- package/dist/_chunks/{History-DRwA3oMM.mjs → History-BOhLaq_g.mjs} +18 -34
- package/dist/_chunks/History-BOhLaq_g.mjs.map +1 -0
- package/dist/_chunks/{History-C9t9UqpO.js → History-uECUbCZB.js} +18 -34
- package/dist/_chunks/History-uECUbCZB.js.map +1 -0
- package/dist/_chunks/{ListConfigurationPage-BxfQJzPk.mjs → ListConfigurationPage-D0vQez6F.mjs} +3 -3
- package/dist/_chunks/{ListConfigurationPage-BxfQJzPk.mjs.map → ListConfigurationPage-D0vQez6F.mjs.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-BXYPohh-.js → ListConfigurationPage-D_bBSFNW.js} +3 -3
- package/dist/_chunks/{ListConfigurationPage-BXYPohh-.js.map → ListConfigurationPage-D_bBSFNW.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-D2VD8Szg.js → ListViewPage-BkZ83b1A.js} +15 -4
- package/dist/_chunks/ListViewPage-BkZ83b1A.js.map +1 -0
- package/dist/_chunks/{ListViewPage-CELx2ysp.mjs → ListViewPage-ns-bmy5C.mjs} +15 -4
- package/dist/_chunks/{ListViewPage-CELx2ysp.mjs.map → ListViewPage-ns-bmy5C.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-DtJ9jcfk.mjs → NoContentTypePage-BA5ZKMDR.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-DtJ9jcfk.mjs.map → NoContentTypePage-BA5ZKMDR.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-BV9IjJSM.js → NoContentTypePage-C1439s4s.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-BV9IjJSM.js.map → NoContentTypePage-C1439s4s.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DWleVYK7.mjs → NoPermissionsPage-B0GdMw1Q.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DWleVYK7.mjs.map → NoPermissionsPage-B0GdMw1Q.mjs.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-Dp8NpF9I.js → NoPermissionsPage-CPGwsVfb.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-Dp8NpF9I.js.map → NoPermissionsPage-CPGwsVfb.js.map} +1 -1
- package/dist/_chunks/{Relations-BTcf5xaw.mjs → Relations-BIGPMSW4.mjs} +44 -17
- package/dist/_chunks/Relations-BIGPMSW4.mjs.map +1 -0
- package/dist/_chunks/{Relations-DR7EUgyC.js → Relations-d-8Uef_-.js} +43 -16
- package/dist/_chunks/Relations-d-8Uef_-.js.map +1 -0
- package/dist/_chunks/{en-Bm0D0IWz.js → en-Bdpa50w3.js} +6 -2
- package/dist/_chunks/{en-Bm0D0IWz.js.map → en-Bdpa50w3.js.map} +1 -1
- package/dist/_chunks/{en-DKV44jRb.mjs → en-CZw4xdPY.mjs} +6 -2
- package/dist/_chunks/{en-DKV44jRb.mjs.map → en-CZw4xdPY.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-wnqzm4Q8.mjs → index-3_WeHXYp.mjs} +113 -23
- package/dist/_chunks/index-3_WeHXYp.mjs.map +1 -0
- package/dist/_chunks/{index-BdMf2lfT.js → index-BgaeYWIy.js} +112 -21
- package/dist/_chunks/index-BgaeYWIy.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-B2MyZU-_.js → layout-ByFyQRDH.js} +3 -3
- package/dist/_chunks/{layout-B2MyZU-_.js.map → layout-ByFyQRDH.js.map} +1 -1
- package/dist/_chunks/{layout-2CfjL0T9.mjs → layout-CrTxOnCy.mjs} +3 -3
- package/dist/_chunks/{layout-2CfjL0T9.mjs.map → layout-CrTxOnCy.mjs.map} +1 -1
- package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
- package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
- package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
- package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
- package/dist/_chunks/{relations-C0w0GcXi.mjs → relations-BlpLgngh.mjs} +3 -7
- package/dist/_chunks/relations-BlpLgngh.mjs.map +1 -0
- package/dist/_chunks/{relations-BH7JJGGe.js → relations-C5RSW926.js} +3 -7
- package/dist/_chunks/relations-C5RSW926.js.map +1 -0
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- 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/services/preview.d.ts +3 -0
- package/dist/server/index.js +344 -144
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +344 -144
- 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 +15 -0
- package/dist/server/src/preview/services/index.d.ts.map +1 -0
- package/dist/server/src/preview/services/preview-config.d.ts +30 -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 +18 -0
- package/dist/server/src/preview/utils.d.ts.map +1 -0
- package/dist/server/src/routes/index.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 +6 -6
- package/dist/_chunks/EditViewPage-B82x_x1b.mjs.map +0 -1
- package/dist/_chunks/EditViewPage-DlxEHhUt.js.map +0 -1
- package/dist/_chunks/Field-COL25JiC.js.map +0 -1
- package/dist/_chunks/Field-DufHXW17.mjs.map +0 -1
- package/dist/_chunks/History-C9t9UqpO.js.map +0 -1
- package/dist/_chunks/History-DRwA3oMM.mjs.map +0 -1
- package/dist/_chunks/ListViewPage-D2VD8Szg.js.map +0 -1
- package/dist/_chunks/Relations-BTcf5xaw.mjs.map +0 -1
- package/dist/_chunks/Relations-DR7EUgyC.js.map +0 -1
- package/dist/_chunks/index-BdMf2lfT.js.map +0 -1
- package/dist/_chunks/index-wnqzm4Q8.mjs.map +0 -1
- package/dist/_chunks/relations-BH7JJGGe.js.map +0 -1
- package/dist/_chunks/relations-C0w0GcXi.mjs.map +0 -1
@@ -1,9 +1,10 @@
|
|
1
|
-
import { More, Cross, WarningCircle, ListPlus, Pencil, Trash, Check, CrossCircle, CheckCircle, ArrowsCounterClockwise, ChevronRight, Duplicate, ClockCounterClockwise, Feather } from "@strapi/icons";
|
1
|
+
import { More, Cross, WarningCircle, ListPlus, Pencil, Trash, Check, CrossCircle, CheckCircle, ArrowsCounterClockwise, ChevronRight, Duplicate, ClockCounterClockwise, Link as Link$1, Feather } from "@strapi/icons";
|
2
2
|
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
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";
|
3
|
+
import { useStrapiApp, createContext, useQueryParams, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useForm, useTracking, useGuidedTour, BackButton, DescriptionComponentRenderer, useTable, Table, useClipboard } from "@strapi/admin/strapi-admin";
|
4
4
|
import * as React from "react";
|
5
5
|
import { lazy } from "react";
|
6
6
|
import { Button, Menu, VisuallyHidden, Flex, Typography, Dialog, Modal, 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";
|
9
10
|
import * as yup from "yup";
|
@@ -968,9 +969,10 @@ const formatEditLayout = (data, {
|
|
968
969
|
currentPanelIndex += 2;
|
969
970
|
} else {
|
970
971
|
if (!panels[currentPanelIndex]) {
|
971
|
-
panels.push([]);
|
972
|
+
panels.push([row]);
|
973
|
+
} else {
|
974
|
+
panels[currentPanelIndex].push(row);
|
972
975
|
}
|
973
|
-
panels[currentPanelIndex].push(row);
|
974
976
|
}
|
975
977
|
return panels;
|
976
978
|
}, []);
|
@@ -1228,9 +1230,6 @@ const useContentManagerContext = () => {
|
|
1228
1230
|
};
|
1229
1231
|
};
|
1230
1232
|
const prefixPluginTranslations = (trad, pluginId) => {
|
1231
|
-
if (!pluginId) {
|
1232
|
-
throw new TypeError("pluginId can't be empty");
|
1233
|
-
}
|
1234
1233
|
return Object.keys(trad).reduce((acc, current) => {
|
1235
1234
|
acc[`${pluginId}.${current}`] = trad[current];
|
1236
1235
|
return acc;
|
@@ -1665,7 +1664,7 @@ const useDocumentActions = () => {
|
|
1665
1664
|
};
|
1666
1665
|
};
|
1667
1666
|
const ProtectedHistoryPage = lazy(
|
1668
|
-
() => import("./History-
|
1667
|
+
() => import("./History-BOhLaq_g.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1669
1668
|
);
|
1670
1669
|
const routes$1 = [
|
1671
1670
|
{
|
@@ -1678,31 +1677,31 @@ const routes$1 = [
|
|
1678
1677
|
}
|
1679
1678
|
];
|
1680
1679
|
const ProtectedEditViewPage = lazy(
|
1681
|
-
() => import("./EditViewPage-
|
1680
|
+
() => import("./EditViewPage-DAtscabN.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1682
1681
|
);
|
1683
1682
|
const ProtectedListViewPage = lazy(
|
1684
|
-
() => import("./ListViewPage-
|
1683
|
+
() => import("./ListViewPage-ns-bmy5C.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1685
1684
|
);
|
1686
1685
|
const ProtectedListConfiguration = lazy(
|
1687
|
-
() => import("./ListConfigurationPage-
|
1686
|
+
() => import("./ListConfigurationPage-D0vQez6F.mjs").then((mod) => ({
|
1688
1687
|
default: mod.ProtectedListConfiguration
|
1689
1688
|
}))
|
1690
1689
|
);
|
1691
1690
|
const ProtectedEditConfigurationPage = lazy(
|
1692
|
-
() => import("./EditConfigurationPage-
|
1691
|
+
() => import("./EditConfigurationPage-_prbqpTM.mjs").then((mod) => ({
|
1693
1692
|
default: mod.ProtectedEditConfigurationPage
|
1694
1693
|
}))
|
1695
1694
|
);
|
1696
1695
|
const ProtectedComponentConfigurationPage = lazy(
|
1697
|
-
() => import("./ComponentConfigurationPage-
|
1696
|
+
() => import("./ComponentConfigurationPage-BpM_Hc7r.mjs").then((mod) => ({
|
1698
1697
|
default: mod.ProtectedComponentConfigurationPage
|
1699
1698
|
}))
|
1700
1699
|
);
|
1701
1700
|
const NoPermissions = lazy(
|
1702
|
-
() => import("./NoPermissionsPage-
|
1701
|
+
() => import("./NoPermissionsPage-B0GdMw1Q.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1703
1702
|
);
|
1704
1703
|
const NoContentType = lazy(
|
1705
|
-
() => import("./NoContentTypePage-
|
1704
|
+
() => import("./NoContentTypePage-BA5ZKMDR.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1706
1705
|
);
|
1707
1706
|
const CollectionTypePages = () => {
|
1708
1707
|
const { collectionType } = useParams();
|
@@ -2056,6 +2055,18 @@ const DocumentActionModal = ({
|
|
2056
2055
|
typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
|
2057
2056
|
] }) });
|
2058
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
|
+
};
|
2059
2070
|
const PublishAction$1 = ({
|
2060
2071
|
activeTab,
|
2061
2072
|
documentId,
|
@@ -2169,7 +2180,7 @@ const PublishAction$1 = ({
|
|
2169
2180
|
documentId,
|
2170
2181
|
params
|
2171
2182
|
},
|
2172
|
-
formValues
|
2183
|
+
transformData(formValues)
|
2173
2184
|
);
|
2174
2185
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2175
2186
|
navigate({
|
@@ -2285,7 +2296,7 @@ const UpdateAction = ({
|
|
2285
2296
|
documentId: cloneMatch.params.origin,
|
2286
2297
|
params
|
2287
2298
|
},
|
2288
|
-
document
|
2299
|
+
transformData(document)
|
2289
2300
|
);
|
2290
2301
|
if ("data" in res) {
|
2291
2302
|
navigate(
|
@@ -2306,7 +2317,7 @@ const UpdateAction = ({
|
|
2306
2317
|
documentId,
|
2307
2318
|
params
|
2308
2319
|
},
|
2309
|
-
document
|
2320
|
+
transformData(document)
|
2310
2321
|
);
|
2311
2322
|
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2312
2323
|
setErrors(formatValidationErrors(res.error));
|
@@ -2319,7 +2330,7 @@ const UpdateAction = ({
|
|
2319
2330
|
model,
|
2320
2331
|
params
|
2321
2332
|
},
|
2322
|
-
document
|
2333
|
+
transformData(document)
|
2323
2334
|
);
|
2324
2335
|
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2325
2336
|
navigate(
|
@@ -3007,7 +3018,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
|
|
3007
3018
|
justifyContent: "stretch",
|
3008
3019
|
alignItems: "flex-start",
|
3009
3020
|
children: [
|
3010
|
-
/* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", children: title }),
|
3021
|
+
/* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", textColor: "neutral600", children: title }),
|
3011
3022
|
children
|
3012
3023
|
]
|
3013
3024
|
}
|
@@ -3990,6 +4001,82 @@ const { setInitialData } = actions;
|
|
3990
4001
|
const reducer = combineReducers({
|
3991
4002
|
app: reducer$1
|
3992
4003
|
});
|
4004
|
+
const previewApi = contentManagerApi.injectEndpoints({
|
4005
|
+
endpoints: (builder) => ({
|
4006
|
+
getPreviewUrl: builder.query({
|
4007
|
+
query({ query, params }) {
|
4008
|
+
return {
|
4009
|
+
url: `/content-manager/preview/url/${params.contentType}`,
|
4010
|
+
method: "GET",
|
4011
|
+
config: {
|
4012
|
+
params: query
|
4013
|
+
}
|
4014
|
+
};
|
4015
|
+
}
|
4016
|
+
})
|
4017
|
+
})
|
4018
|
+
});
|
4019
|
+
const { useGetPreviewUrlQuery } = previewApi;
|
4020
|
+
const PreviewSidePanel = ({ model, documentId, document }) => {
|
4021
|
+
const { formatMessage } = useIntl();
|
4022
|
+
const { toggleNotification } = useNotification();
|
4023
|
+
const { copy } = useClipboard();
|
4024
|
+
const { data, error } = useGetPreviewUrlQuery({
|
4025
|
+
params: {
|
4026
|
+
contentType: model
|
4027
|
+
},
|
4028
|
+
query: {
|
4029
|
+
documentId,
|
4030
|
+
locale: document?.locale,
|
4031
|
+
status: document?.status
|
4032
|
+
}
|
4033
|
+
});
|
4034
|
+
if (!data?.data?.url || error) {
|
4035
|
+
return null;
|
4036
|
+
}
|
4037
|
+
const { url } = data.data;
|
4038
|
+
const handleCopyLink = () => {
|
4039
|
+
copy(url);
|
4040
|
+
toggleNotification({
|
4041
|
+
message: formatMessage({
|
4042
|
+
id: "content-manager.preview.copy.success",
|
4043
|
+
defaultMessage: "Copied preview link"
|
4044
|
+
}),
|
4045
|
+
type: "success"
|
4046
|
+
});
|
4047
|
+
};
|
4048
|
+
return {
|
4049
|
+
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4050
|
+
content: /* @__PURE__ */ jsxs(Flex, { gap: 2, width: "100%", children: [
|
4051
|
+
/* @__PURE__ */ jsx(Button, { variant: "tertiary", tag: Link, to: url, target: "_blank", flex: "auto", children: formatMessage({
|
4052
|
+
id: "content-manager.preview.panel.button",
|
4053
|
+
defaultMessage: "Open preview"
|
4054
|
+
}) }),
|
4055
|
+
/* @__PURE__ */ jsx(
|
4056
|
+
IconButton,
|
4057
|
+
{
|
4058
|
+
type: "button",
|
4059
|
+
label: formatMessage({
|
4060
|
+
id: "preview.copy.label",
|
4061
|
+
defaultMessage: "Copy preview link"
|
4062
|
+
}),
|
4063
|
+
onClick: handleCopyLink,
|
4064
|
+
children: /* @__PURE__ */ jsx(Link$1, {})
|
4065
|
+
}
|
4066
|
+
)
|
4067
|
+
] })
|
4068
|
+
};
|
4069
|
+
};
|
4070
|
+
const FEATURE_ID = "preview";
|
4071
|
+
const previewAdmin = {
|
4072
|
+
bootstrap(app) {
|
4073
|
+
if (!window.strapi.future.isEnabled(FEATURE_ID)) {
|
4074
|
+
return;
|
4075
|
+
}
|
4076
|
+
const contentManagerPluginApis = app.getPlugin("content-manager").apis;
|
4077
|
+
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
|
4078
|
+
}
|
4079
|
+
};
|
3993
4080
|
const index = {
|
3994
4081
|
register(app) {
|
3995
4082
|
const cm = new ContentManagerPlugin();
|
@@ -4009,7 +4096,7 @@ const index = {
|
|
4009
4096
|
app.router.addRoute({
|
4010
4097
|
path: "content-manager/*",
|
4011
4098
|
lazy: async () => {
|
4012
|
-
const { Layout } = await import("./layout-
|
4099
|
+
const { Layout } = await import("./layout-CrTxOnCy.mjs");
|
4013
4100
|
return {
|
4014
4101
|
Component: Layout
|
4015
4102
|
};
|
@@ -4022,11 +4109,14 @@ const index = {
|
|
4022
4109
|
if (typeof historyAdmin.bootstrap === "function") {
|
4023
4110
|
historyAdmin.bootstrap(app);
|
4024
4111
|
}
|
4112
|
+
if (typeof previewAdmin.bootstrap === "function") {
|
4113
|
+
previewAdmin.bootstrap(app);
|
4114
|
+
}
|
4025
4115
|
},
|
4026
4116
|
async registerTrads({ locales }) {
|
4027
4117
|
const importedTrads = await Promise.all(
|
4028
4118
|
locales.map((locale) => {
|
4029
|
-
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-
|
4119
|
+
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-CZw4xdPY.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 }) => {
|
4030
4120
|
return {
|
4031
4121
|
data: prefixPluginTranslations(data, PLUGIN_ID),
|
4032
4122
|
locale
|
@@ -4087,4 +4177,4 @@ export {
|
|
4087
4177
|
capitalise as y,
|
4088
4178
|
useUpdateContentTypeConfigurationMutation as z
|
4089
4179
|
};
|
4090
|
-
//# sourceMappingURL=index-
|
4180
|
+
//# sourceMappingURL=index-3_WeHXYp.mjs.map
|