@strapi/content-manager 0.0.0-next.d6ed4fcf2c833656b8c91a90909c1e77c79379e5 → 0.0.0-next.e8d8fc824d0f6a695b2a9ebaa4680ed21c3645ca
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-DywpTZeV.js → ComponentConfigurationPage-BlzvDpbX.js} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-DywpTZeV.js.map → ComponentConfigurationPage-BlzvDpbX.js.map} +1 -1
- package/dist/_chunks/{ComponentConfigurationPage-BgCLcjXO.mjs → ComponentConfigurationPage-DaPOlQaD.mjs} +3 -3
- package/dist/_chunks/{ComponentConfigurationPage-BgCLcjXO.mjs.map → ComponentConfigurationPage-DaPOlQaD.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-BNjOAHNS.mjs → EditConfigurationPage-BZPXItXo.mjs} +3 -3
- package/dist/_chunks/{EditConfigurationPage-BNjOAHNS.mjs.map → EditConfigurationPage-BZPXItXo.mjs.map} +1 -1
- package/dist/_chunks/{EditConfigurationPage-CxRlP5if.js → EditConfigurationPage-uy-v43AR.js} +3 -3
- package/dist/_chunks/{EditConfigurationPage-CxRlP5if.js.map → EditConfigurationPage-uy-v43AR.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-BRewdTqE.js → EditViewPage-DT6A4ayX.js} +3 -3
- package/dist/_chunks/{EditViewPage-BRewdTqE.js.map → EditViewPage-DT6A4ayX.js.map} +1 -1
- package/dist/_chunks/{EditViewPage-CD_hqc1J.mjs → EditViewPage-oOLeTySr.mjs} +3 -3
- package/dist/_chunks/{EditViewPage-CD_hqc1J.mjs.map → EditViewPage-oOLeTySr.mjs.map} +1 -1
- package/dist/_chunks/{Field-BPkQ-3Ku.mjs → Field-D7dv2aUX.mjs} +109 -57
- package/dist/_chunks/Field-D7dv2aUX.mjs.map +1 -0
- package/dist/_chunks/{Field-DwvmENVf.js → Field-kYFVIGiP.js} +110 -57
- package/dist/_chunks/Field-kYFVIGiP.js.map +1 -0
- package/dist/_chunks/{Form-Czi0cf_2.mjs → Form-BxR6sc29.mjs} +2 -2
- package/dist/_chunks/{Form-Czi0cf_2.mjs.map → Form-BxR6sc29.mjs.map} +1 -1
- package/dist/_chunks/{Form-C_Gwv8P_.js → Form-CCijSg3V.js} +2 -2
- package/dist/_chunks/{Form-C_Gwv8P_.js.map → Form-CCijSg3V.js.map} +1 -1
- package/dist/_chunks/{History-C1TKAig-.js → History-BMndx49M.js} +4 -4
- package/dist/_chunks/{History-C1TKAig-.js.map → History-BMndx49M.js.map} +1 -1
- package/dist/_chunks/{History-CIQHyi4T.mjs → History-D8F7aYQU.mjs} +4 -4
- package/dist/_chunks/{History-CIQHyi4T.mjs.map → History-D8F7aYQU.mjs.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-D-NGRLYu.js → ListConfigurationPage-DouY1EWM.js} +2 -2
- package/dist/_chunks/{ListConfigurationPage-D-NGRLYu.js.map → ListConfigurationPage-DouY1EWM.js.map} +1 -1
- package/dist/_chunks/{ListConfigurationPage-DcZsfyEL.mjs → ListConfigurationPage-DqAdSPwC.mjs} +2 -2
- package/dist/_chunks/{ListConfigurationPage-DcZsfyEL.mjs.map → ListConfigurationPage-DqAdSPwC.mjs.map} +1 -1
- package/dist/_chunks/{ListViewPage-xv5IQoZp.js → ListViewPage-BPVmh9pq.js} +3 -3
- package/dist/_chunks/{ListViewPage-xv5IQoZp.js.map → ListViewPage-BPVmh9pq.js.map} +1 -1
- package/dist/_chunks/{ListViewPage-C10McTK1.mjs → ListViewPage-C73F0jPh.mjs} +3 -3
- package/dist/_chunks/{ListViewPage-C10McTK1.mjs.map → ListViewPage-C73F0jPh.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-CPc0Cd3S.mjs → NoContentTypePage-B5w7iJOF.mjs} +2 -2
- package/dist/_chunks/{NoContentTypePage-CPc0Cd3S.mjs.map → NoContentTypePage-B5w7iJOF.mjs.map} +1 -1
- package/dist/_chunks/{NoContentTypePage-Dzw5Yj5u.js → NoContentTypePage-BwcL--4H.js} +2 -2
- package/dist/_chunks/{NoContentTypePage-Dzw5Yj5u.js.map → NoContentTypePage-BwcL--4H.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-DAe5CDCC.js → NoPermissionsPage-BMFKVcwJ.js} +2 -2
- package/dist/_chunks/{NoPermissionsPage-DAe5CDCC.js.map → NoPermissionsPage-BMFKVcwJ.js.map} +1 -1
- package/dist/_chunks/{NoPermissionsPage-wfPBh2_0.mjs → NoPermissionsPage-UnEgMGK4.mjs} +2 -2
- package/dist/_chunks/{NoPermissionsPage-wfPBh2_0.mjs.map → NoPermissionsPage-UnEgMGK4.mjs.map} +1 -1
- package/dist/_chunks/{Preview-B7LyGT_b.js → Preview-B7PR3Ok_.js} +32 -10
- package/dist/_chunks/Preview-B7PR3Ok_.js.map +1 -0
- package/dist/_chunks/{Preview-BVFFm7uB.mjs → Preview-DECOhK0D.mjs} +33 -11
- package/dist/_chunks/Preview-DECOhK0D.mjs.map +1 -0
- package/dist/_chunks/{Relations-JPhWxk-s.mjs → Relations-DinMQJ4B.mjs} +3 -3
- package/dist/_chunks/{Relations-JPhWxk-s.mjs.map → Relations-DinMQJ4B.mjs.map} +1 -1
- package/dist/_chunks/{Relations-BmYR1AjY.js → Relations-lndx3aQk.js} +3 -3
- package/dist/_chunks/{Relations-BmYR1AjY.js.map → Relations-lndx3aQk.js.map} +1 -1
- package/dist/_chunks/{index-DLIkNVnQ.mjs → index-C2SagWVW.mjs} +151 -99
- package/dist/_chunks/index-C2SagWVW.mjs.map +1 -0
- package/dist/_chunks/{index-C2Q_PLWj.js → index-Cnw4gqee.js} +151 -99
- package/dist/_chunks/index-Cnw4gqee.js.map +1 -0
- package/dist/_chunks/{layout-qE8qkNH_.mjs → layout-DY_D9MGA.mjs} +3 -3
- package/dist/_chunks/{layout-qE8qkNH_.mjs.map → layout-DY_D9MGA.mjs.map} +1 -1
- package/dist/_chunks/{layout-7AsWJzZJ.js → layout-ivwIVPnV.js} +3 -3
- package/dist/_chunks/{layout-7AsWJzZJ.js.map → layout-ivwIVPnV.js.map} +1 -1
- package/dist/_chunks/{relations-EifVzf_2.js → relations-B7C7O_Pv.js} +2 -2
- package/dist/_chunks/{relations-EifVzf_2.js.map → relations-B7C7O_Pv.js.map} +1 -1
- package/dist/_chunks/{relations-BjHH_1Am.mjs → relations-Boc5Y9kX.mjs} +2 -2
- package/dist/_chunks/{relations-BjHH_1Am.mjs.map → relations-Boc5Y9kX.mjs.map} +1 -1
- package/dist/admin/index.js +1 -1
- package/dist/admin/index.mjs +1 -1
- package/dist/admin/src/content-manager.d.ts +3 -2
- package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
- package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
- package/dist/server/index.js +74 -66
- package/dist/server/index.js.map +1 -1
- package/dist/server/index.mjs +75 -67
- package/dist/server/index.mjs.map +1 -1
- package/dist/server/src/controllers/utils/metadata.d.ts +1 -0
- package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
- package/dist/server/src/index.d.ts +3 -2
- package/dist/server/src/index.d.ts.map +1 -1
- package/dist/server/src/preview/index.d.ts.map +1 -1
- package/dist/server/src/services/document-metadata.d.ts +4 -2
- package/dist/server/src/services/document-metadata.d.ts.map +1 -1
- package/dist/server/src/services/index.d.ts +3 -2
- 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/services/utils/populate.d.ts +2 -2
- package/dist/server/src/services/utils/populate.d.ts.map +1 -1
- package/package.json +8 -6
- package/dist/_chunks/Field-BPkQ-3Ku.mjs.map +0 -1
- package/dist/_chunks/Field-DwvmENVf.js.map +0 -1
- package/dist/_chunks/Preview-B7LyGT_b.js.map +0 -1
- package/dist/_chunks/Preview-BVFFm7uB.mjs.map +0 -1
- package/dist/_chunks/index-C2Q_PLWj.js.map +0 -1
- package/dist/_chunks/index-DLIkNVnQ.mjs.map +0 -1
- package/dist/admin/src/preview/constants.d.ts +0 -1
- package/dist/server/src/preview/constants.d.ts +0 -2
- package/dist/server/src/preview/constants.d.ts.map +0 -1
@@ -1667,7 +1667,7 @@ const useDocumentActions = () => {
|
|
1667
1667
|
};
|
1668
1668
|
};
|
1669
1669
|
const ProtectedHistoryPage = React.lazy(
|
1670
|
-
() => import("./History-
|
1670
|
+
() => import("./History-D8F7aYQU.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
|
1671
1671
|
);
|
1672
1672
|
const routes$2 = [
|
1673
1673
|
{
|
@@ -1680,7 +1680,7 @@ const routes$2 = [
|
|
1680
1680
|
}
|
1681
1681
|
];
|
1682
1682
|
const ProtectedPreviewPage = React.lazy(
|
1683
|
-
() => import("./Preview-
|
1683
|
+
() => import("./Preview-DECOhK0D.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
|
1684
1684
|
);
|
1685
1685
|
const routes$1 = [
|
1686
1686
|
{
|
@@ -1693,31 +1693,31 @@ const routes$1 = [
|
|
1693
1693
|
}
|
1694
1694
|
];
|
1695
1695
|
const ProtectedEditViewPage = lazy(
|
1696
|
-
() => import("./EditViewPage-
|
1696
|
+
() => import("./EditViewPage-oOLeTySr.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
|
1697
1697
|
);
|
1698
1698
|
const ProtectedListViewPage = lazy(
|
1699
|
-
() => import("./ListViewPage-
|
1699
|
+
() => import("./ListViewPage-C73F0jPh.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
|
1700
1700
|
);
|
1701
1701
|
const ProtectedListConfiguration = lazy(
|
1702
|
-
() => import("./ListConfigurationPage-
|
1702
|
+
() => import("./ListConfigurationPage-DqAdSPwC.mjs").then((mod) => ({
|
1703
1703
|
default: mod.ProtectedListConfiguration
|
1704
1704
|
}))
|
1705
1705
|
);
|
1706
1706
|
const ProtectedEditConfigurationPage = lazy(
|
1707
|
-
() => import("./EditConfigurationPage-
|
1707
|
+
() => import("./EditConfigurationPage-BZPXItXo.mjs").then((mod) => ({
|
1708
1708
|
default: mod.ProtectedEditConfigurationPage
|
1709
1709
|
}))
|
1710
1710
|
);
|
1711
1711
|
const ProtectedComponentConfigurationPage = lazy(
|
1712
|
-
() => import("./ComponentConfigurationPage-
|
1712
|
+
() => import("./ComponentConfigurationPage-DaPOlQaD.mjs").then((mod) => ({
|
1713
1713
|
default: mod.ProtectedComponentConfigurationPage
|
1714
1714
|
}))
|
1715
1715
|
);
|
1716
1716
|
const NoPermissions = lazy(
|
1717
|
-
() => import("./NoPermissionsPage-
|
1717
|
+
() => import("./NoPermissionsPage-UnEgMGK4.mjs").then((mod) => ({ default: mod.NoPermissions }))
|
1718
1718
|
);
|
1719
1719
|
const NoContentType = lazy(
|
1720
|
-
() => import("./NoContentTypePage-
|
1720
|
+
() => import("./NoContentTypePage-B5w7iJOF.mjs").then((mod) => ({ default: mod.NoContentType }))
|
1721
1721
|
);
|
1722
1722
|
const CollectionTypePages = () => {
|
1723
1723
|
const { collectionType } = useParams();
|
@@ -2248,6 +2248,7 @@ const PublishAction$1 = ({
|
|
2248
2248
|
};
|
2249
2249
|
};
|
2250
2250
|
PublishAction$1.type = "publish";
|
2251
|
+
PublishAction$1.position = "panel";
|
2251
2252
|
const UpdateAction = ({
|
2252
2253
|
activeTab,
|
2253
2254
|
documentId,
|
@@ -2270,6 +2271,117 @@ const UpdateAction = ({
|
|
2270
2271
|
const validate = useForm("UpdateAction", (state) => state.validate);
|
2271
2272
|
const setErrors = useForm("UpdateAction", (state) => state.setErrors);
|
2272
2273
|
const resetForm = useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
|
2274
|
+
const handleUpdate = React.useCallback(async () => {
|
2275
|
+
setSubmitting(true);
|
2276
|
+
try {
|
2277
|
+
if (!modified) {
|
2278
|
+
return;
|
2279
|
+
}
|
2280
|
+
const { errors } = await validate(true, {
|
2281
|
+
status: "draft"
|
2282
|
+
});
|
2283
|
+
if (errors) {
|
2284
|
+
toggleNotification({
|
2285
|
+
type: "danger",
|
2286
|
+
message: formatMessage({
|
2287
|
+
id: "content-manager.validation.error",
|
2288
|
+
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
2289
|
+
})
|
2290
|
+
});
|
2291
|
+
return;
|
2292
|
+
}
|
2293
|
+
if (isCloning) {
|
2294
|
+
const res = await clone(
|
2295
|
+
{
|
2296
|
+
model,
|
2297
|
+
documentId: cloneMatch.params.origin,
|
2298
|
+
params
|
2299
|
+
},
|
2300
|
+
transformData(document)
|
2301
|
+
);
|
2302
|
+
if ("data" in res) {
|
2303
|
+
navigate(
|
2304
|
+
{
|
2305
|
+
pathname: `../${res.data.documentId}`,
|
2306
|
+
search: rawQuery
|
2307
|
+
},
|
2308
|
+
{ relative: "path" }
|
2309
|
+
);
|
2310
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2311
|
+
setErrors(formatValidationErrors(res.error));
|
2312
|
+
}
|
2313
|
+
} else if (documentId || collectionType === SINGLE_TYPES) {
|
2314
|
+
const res = await update(
|
2315
|
+
{
|
2316
|
+
collectionType,
|
2317
|
+
model,
|
2318
|
+
documentId,
|
2319
|
+
params
|
2320
|
+
},
|
2321
|
+
transformData(document)
|
2322
|
+
);
|
2323
|
+
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2324
|
+
setErrors(formatValidationErrors(res.error));
|
2325
|
+
} else {
|
2326
|
+
resetForm();
|
2327
|
+
}
|
2328
|
+
} else {
|
2329
|
+
const res = await create(
|
2330
|
+
{
|
2331
|
+
model,
|
2332
|
+
params
|
2333
|
+
},
|
2334
|
+
transformData(document)
|
2335
|
+
);
|
2336
|
+
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2337
|
+
navigate(
|
2338
|
+
{
|
2339
|
+
pathname: `../${res.data.documentId}`,
|
2340
|
+
search: rawQuery
|
2341
|
+
},
|
2342
|
+
{ replace: true, relative: "path" }
|
2343
|
+
);
|
2344
|
+
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2345
|
+
setErrors(formatValidationErrors(res.error));
|
2346
|
+
}
|
2347
|
+
}
|
2348
|
+
} finally {
|
2349
|
+
setSubmitting(false);
|
2350
|
+
}
|
2351
|
+
}, [
|
2352
|
+
clone,
|
2353
|
+
cloneMatch?.params.origin,
|
2354
|
+
collectionType,
|
2355
|
+
create,
|
2356
|
+
document,
|
2357
|
+
documentId,
|
2358
|
+
formatMessage,
|
2359
|
+
formatValidationErrors,
|
2360
|
+
isCloning,
|
2361
|
+
model,
|
2362
|
+
modified,
|
2363
|
+
navigate,
|
2364
|
+
params,
|
2365
|
+
rawQuery,
|
2366
|
+
resetForm,
|
2367
|
+
setErrors,
|
2368
|
+
setSubmitting,
|
2369
|
+
toggleNotification,
|
2370
|
+
update,
|
2371
|
+
validate
|
2372
|
+
]);
|
2373
|
+
React.useEffect(() => {
|
2374
|
+
const handleKeyDown = (e) => {
|
2375
|
+
if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
|
2376
|
+
e.preventDefault();
|
2377
|
+
handleUpdate();
|
2378
|
+
}
|
2379
|
+
};
|
2380
|
+
window.addEventListener("keydown", handleKeyDown);
|
2381
|
+
return () => {
|
2382
|
+
window.removeEventListener("keydown", handleKeyDown);
|
2383
|
+
};
|
2384
|
+
}, [handleUpdate]);
|
2273
2385
|
return {
|
2274
2386
|
/**
|
2275
2387
|
* Disabled when:
|
@@ -2282,84 +2394,11 @@ const UpdateAction = ({
|
|
2282
2394
|
id: "global.save",
|
2283
2395
|
defaultMessage: "Save"
|
2284
2396
|
}),
|
2285
|
-
onClick:
|
2286
|
-
setSubmitting(true);
|
2287
|
-
try {
|
2288
|
-
const { errors } = await validate(true, {
|
2289
|
-
status: "draft"
|
2290
|
-
});
|
2291
|
-
if (errors) {
|
2292
|
-
toggleNotification({
|
2293
|
-
type: "danger",
|
2294
|
-
message: formatMessage({
|
2295
|
-
id: "content-manager.validation.error",
|
2296
|
-
defaultMessage: "There are validation errors in your document. Please fix them before saving."
|
2297
|
-
})
|
2298
|
-
});
|
2299
|
-
return;
|
2300
|
-
}
|
2301
|
-
if (isCloning) {
|
2302
|
-
const res = await clone(
|
2303
|
-
{
|
2304
|
-
model,
|
2305
|
-
documentId: cloneMatch.params.origin,
|
2306
|
-
params
|
2307
|
-
},
|
2308
|
-
transformData(document)
|
2309
|
-
);
|
2310
|
-
if ("data" in res) {
|
2311
|
-
navigate(
|
2312
|
-
{
|
2313
|
-
pathname: `../${res.data.documentId}`,
|
2314
|
-
search: rawQuery
|
2315
|
-
},
|
2316
|
-
{ relative: "path" }
|
2317
|
-
);
|
2318
|
-
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2319
|
-
setErrors(formatValidationErrors(res.error));
|
2320
|
-
}
|
2321
|
-
} else if (documentId || collectionType === SINGLE_TYPES) {
|
2322
|
-
const res = await update(
|
2323
|
-
{
|
2324
|
-
collectionType,
|
2325
|
-
model,
|
2326
|
-
documentId,
|
2327
|
-
params
|
2328
|
-
},
|
2329
|
-
transformData(document)
|
2330
|
-
);
|
2331
|
-
if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2332
|
-
setErrors(formatValidationErrors(res.error));
|
2333
|
-
} else {
|
2334
|
-
resetForm();
|
2335
|
-
}
|
2336
|
-
} else {
|
2337
|
-
const res = await create(
|
2338
|
-
{
|
2339
|
-
model,
|
2340
|
-
params
|
2341
|
-
},
|
2342
|
-
transformData(document)
|
2343
|
-
);
|
2344
|
-
if ("data" in res && collectionType !== SINGLE_TYPES) {
|
2345
|
-
navigate(
|
2346
|
-
{
|
2347
|
-
pathname: `../${res.data.documentId}`,
|
2348
|
-
search: rawQuery
|
2349
|
-
},
|
2350
|
-
{ replace: true, relative: "path" }
|
2351
|
-
);
|
2352
|
-
} else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
|
2353
|
-
setErrors(formatValidationErrors(res.error));
|
2354
|
-
}
|
2355
|
-
}
|
2356
|
-
} finally {
|
2357
|
-
setSubmitting(false);
|
2358
|
-
}
|
2359
|
-
}
|
2397
|
+
onClick: handleUpdate
|
2360
2398
|
};
|
2361
2399
|
};
|
2362
2400
|
UpdateAction.type = "update";
|
2401
|
+
UpdateAction.position = "panel";
|
2363
2402
|
const UNPUBLISH_DRAFT_OPTIONS = {
|
2364
2403
|
KEEP: "keep",
|
2365
2404
|
DISCARD: "discard"
|
@@ -2482,6 +2521,7 @@ const UnpublishAction$1 = ({
|
|
2482
2521
|
};
|
2483
2522
|
};
|
2484
2523
|
UnpublishAction$1.type = "unpublish";
|
2524
|
+
UnpublishAction$1.position = "panel";
|
2485
2525
|
const DiscardAction = ({
|
2486
2526
|
activeTab,
|
2487
2527
|
documentId,
|
@@ -2532,6 +2572,7 @@ const DiscardAction = ({
|
|
2532
2572
|
};
|
2533
2573
|
};
|
2534
2574
|
DiscardAction.type = "discard";
|
2575
|
+
DiscardAction.position = "panel";
|
2535
2576
|
const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
|
2536
2577
|
const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
|
2537
2578
|
const RelativeTime = React.forwardRef(
|
@@ -2651,7 +2692,7 @@ const HeaderToolbar = () => {
|
|
2651
2692
|
meta: isCloning ? void 0 : meta,
|
2652
2693
|
collectionType
|
2653
2694
|
},
|
2654
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
2695
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
|
2655
2696
|
children: (actions2) => {
|
2656
2697
|
const headerActions = actions2.filter((action) => {
|
2657
2698
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -2859,6 +2900,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
|
|
2859
2900
|
};
|
2860
2901
|
};
|
2861
2902
|
ConfigureTheViewAction.type = "configure-the-view";
|
2903
|
+
ConfigureTheViewAction.position = "header";
|
2862
2904
|
const EditTheModelAction = ({ model }) => {
|
2863
2905
|
const navigate = useNavigate();
|
2864
2906
|
const { formatMessage } = useIntl();
|
@@ -2875,6 +2917,7 @@ const EditTheModelAction = ({ model }) => {
|
|
2875
2917
|
};
|
2876
2918
|
};
|
2877
2919
|
EditTheModelAction.type = "edit-the-model";
|
2920
|
+
EditTheModelAction.position = "header";
|
2878
2921
|
const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
2879
2922
|
const navigate = useNavigate();
|
2880
2923
|
const { formatMessage } = useIntl();
|
@@ -2948,6 +2991,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
|
|
2948
2991
|
};
|
2949
2992
|
};
|
2950
2993
|
DeleteAction$1.type = "delete";
|
2994
|
+
DeleteAction$1.position = ["header", "table-row"];
|
2951
2995
|
const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
|
2952
2996
|
const Panels = () => {
|
2953
2997
|
const isCloning = useMatch(CLONE_PATH) !== null;
|
@@ -3010,7 +3054,7 @@ const ActionsPanelContent = () => {
|
|
3010
3054
|
DescriptionComponentRenderer,
|
3011
3055
|
{
|
3012
3056
|
props,
|
3013
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions(),
|
3057
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
|
3014
3058
|
children: (actions2) => /* @__PURE__ */ jsx(DocumentActions, { actions: actions2 })
|
3015
3059
|
}
|
3016
3060
|
),
|
@@ -3686,7 +3730,7 @@ const TableActions = ({ document }) => {
|
|
3686
3730
|
DescriptionComponentRenderer,
|
3687
3731
|
{
|
3688
3732
|
props,
|
3689
|
-
descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
|
3733
|
+
descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
|
3690
3734
|
children: (actions2) => {
|
3691
3735
|
const tableRowActions = actions2.filter((action) => {
|
3692
3736
|
const positions = Array.isArray(action.position) ? action.position : [action.position];
|
@@ -3745,6 +3789,7 @@ const EditAction = ({ documentId }) => {
|
|
3745
3789
|
};
|
3746
3790
|
};
|
3747
3791
|
EditAction.type = "edit";
|
3792
|
+
EditAction.position = "table-row";
|
3748
3793
|
const StyledPencil = styled(Pencil)`
|
3749
3794
|
path {
|
3750
3795
|
fill: currentColor;
|
@@ -3821,6 +3866,7 @@ const CloneAction = ({ model, documentId }) => {
|
|
3821
3866
|
};
|
3822
3867
|
};
|
3823
3868
|
CloneAction.type = "clone";
|
3869
|
+
CloneAction.position = "table-row";
|
3824
3870
|
const StyledDuplicate = styled(Duplicate)`
|
3825
3871
|
path {
|
3826
3872
|
fill: currentColor;
|
@@ -3907,7 +3953,14 @@ class ContentManagerPlugin {
|
|
3907
3953
|
addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
|
3908
3954
|
addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
|
3909
3955
|
getBulkActions: () => this.bulkActions,
|
3910
|
-
getDocumentActions: () =>
|
3956
|
+
getDocumentActions: (position) => {
|
3957
|
+
if (position) {
|
3958
|
+
return this.documentActions.filter(
|
3959
|
+
(action) => action.position == void 0 || [action.position].flat().includes(position)
|
3960
|
+
);
|
3961
|
+
}
|
3962
|
+
return this.documentActions;
|
3963
|
+
},
|
3911
3964
|
getEditViewSidePanels: () => this.editViewSidePanels,
|
3912
3965
|
getHeaderActions: () => this.headerActions
|
3913
3966
|
}
|
@@ -3971,6 +4024,7 @@ const HistoryAction = ({ model, document }) => {
|
|
3971
4024
|
};
|
3972
4025
|
};
|
3973
4026
|
HistoryAction.type = "history";
|
4027
|
+
HistoryAction.position = "header";
|
3974
4028
|
const historyAdmin = {
|
3975
4029
|
bootstrap(app) {
|
3976
4030
|
const { addDocumentAction } = app.getPlugin("content-manager").apis;
|
@@ -4064,7 +4118,7 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4064
4118
|
};
|
4065
4119
|
return {
|
4066
4120
|
title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
|
4067
|
-
content: /* @__PURE__ */ jsx(
|
4121
|
+
content: /* @__PURE__ */ jsx(
|
4068
4122
|
ConditionalTooltip,
|
4069
4123
|
{
|
4070
4124
|
label: formatMessage({
|
@@ -4072,31 +4126,29 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
|
|
4072
4126
|
defaultMessage: "Please save to open the preview"
|
4073
4127
|
}),
|
4074
4128
|
isShown: isModified,
|
4075
|
-
children: /* @__PURE__ */ jsx(
|
4129
|
+
children: /* @__PURE__ */ jsx(Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsx(
|
4076
4130
|
Button,
|
4077
4131
|
{
|
4078
4132
|
variant: "tertiary",
|
4079
4133
|
tag: Link,
|
4080
4134
|
to: { pathname: "preview", search: stringify(query, { encode: false }) },
|
4081
4135
|
onClick: trackNavigation,
|
4082
|
-
|
4136
|
+
width: "100%",
|
4083
4137
|
disabled: isModified,
|
4138
|
+
pointerEvents: isModified ? "none" : void 0,
|
4139
|
+
tabIndex: isModified ? -1 : void 0,
|
4084
4140
|
children: formatMessage({
|
4085
4141
|
id: "content-manager.preview.panel.button",
|
4086
4142
|
defaultMessage: "Open preview"
|
4087
4143
|
})
|
4088
4144
|
}
|
4089
|
-
)
|
4145
|
+
) })
|
4090
4146
|
}
|
4091
|
-
)
|
4147
|
+
)
|
4092
4148
|
};
|
4093
4149
|
};
|
4094
|
-
const FEATURE_ID = "preview";
|
4095
4150
|
const previewAdmin = {
|
4096
4151
|
bootstrap(app) {
|
4097
|
-
if (!window.strapi.future.isEnabled(FEATURE_ID)) {
|
4098
|
-
return;
|
4099
|
-
}
|
4100
4152
|
const contentManagerPluginApis = app.getPlugin("content-manager").apis;
|
4101
4153
|
contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
|
4102
4154
|
}
|
@@ -4120,7 +4172,7 @@ const index = {
|
|
4120
4172
|
app.router.addRoute({
|
4121
4173
|
path: "content-manager/*",
|
4122
4174
|
lazy: async () => {
|
4123
|
-
const { Layout } = await import("./layout-
|
4175
|
+
const { Layout } = await import("./layout-DY_D9MGA.mjs");
|
4124
4176
|
return {
|
4125
4177
|
Component: Layout
|
4126
4178
|
};
|
@@ -4202,4 +4254,4 @@ export {
|
|
4202
4254
|
capitalise as y,
|
4203
4255
|
useUpdateContentTypeConfigurationMutation as z
|
4204
4256
|
};
|
4205
|
-
//# sourceMappingURL=index-
|
4257
|
+
//# sourceMappingURL=index-C2SagWVW.mjs.map
|