@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.
Files changed (94) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-DywpTZeV.js → ComponentConfigurationPage-BlzvDpbX.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-DywpTZeV.js.map → ComponentConfigurationPage-BlzvDpbX.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-BgCLcjXO.mjs → ComponentConfigurationPage-DaPOlQaD.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-BgCLcjXO.mjs.map → ComponentConfigurationPage-DaPOlQaD.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-BNjOAHNS.mjs → EditConfigurationPage-BZPXItXo.mjs} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-BNjOAHNS.mjs.map → EditConfigurationPage-BZPXItXo.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-CxRlP5if.js → EditConfigurationPage-uy-v43AR.js} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-CxRlP5if.js.map → EditConfigurationPage-uy-v43AR.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-BRewdTqE.js → EditViewPage-DT6A4ayX.js} +3 -3
  10. package/dist/_chunks/{EditViewPage-BRewdTqE.js.map → EditViewPage-DT6A4ayX.js.map} +1 -1
  11. package/dist/_chunks/{EditViewPage-CD_hqc1J.mjs → EditViewPage-oOLeTySr.mjs} +3 -3
  12. package/dist/_chunks/{EditViewPage-CD_hqc1J.mjs.map → EditViewPage-oOLeTySr.mjs.map} +1 -1
  13. package/dist/_chunks/{Field-BPkQ-3Ku.mjs → Field-D7dv2aUX.mjs} +109 -57
  14. package/dist/_chunks/Field-D7dv2aUX.mjs.map +1 -0
  15. package/dist/_chunks/{Field-DwvmENVf.js → Field-kYFVIGiP.js} +110 -57
  16. package/dist/_chunks/Field-kYFVIGiP.js.map +1 -0
  17. package/dist/_chunks/{Form-Czi0cf_2.mjs → Form-BxR6sc29.mjs} +2 -2
  18. package/dist/_chunks/{Form-Czi0cf_2.mjs.map → Form-BxR6sc29.mjs.map} +1 -1
  19. package/dist/_chunks/{Form-C_Gwv8P_.js → Form-CCijSg3V.js} +2 -2
  20. package/dist/_chunks/{Form-C_Gwv8P_.js.map → Form-CCijSg3V.js.map} +1 -1
  21. package/dist/_chunks/{History-C1TKAig-.js → History-BMndx49M.js} +4 -4
  22. package/dist/_chunks/{History-C1TKAig-.js.map → History-BMndx49M.js.map} +1 -1
  23. package/dist/_chunks/{History-CIQHyi4T.mjs → History-D8F7aYQU.mjs} +4 -4
  24. package/dist/_chunks/{History-CIQHyi4T.mjs.map → History-D8F7aYQU.mjs.map} +1 -1
  25. package/dist/_chunks/{ListConfigurationPage-D-NGRLYu.js → ListConfigurationPage-DouY1EWM.js} +2 -2
  26. package/dist/_chunks/{ListConfigurationPage-D-NGRLYu.js.map → ListConfigurationPage-DouY1EWM.js.map} +1 -1
  27. package/dist/_chunks/{ListConfigurationPage-DcZsfyEL.mjs → ListConfigurationPage-DqAdSPwC.mjs} +2 -2
  28. package/dist/_chunks/{ListConfigurationPage-DcZsfyEL.mjs.map → ListConfigurationPage-DqAdSPwC.mjs.map} +1 -1
  29. package/dist/_chunks/{ListViewPage-xv5IQoZp.js → ListViewPage-BPVmh9pq.js} +3 -3
  30. package/dist/_chunks/{ListViewPage-xv5IQoZp.js.map → ListViewPage-BPVmh9pq.js.map} +1 -1
  31. package/dist/_chunks/{ListViewPage-C10McTK1.mjs → ListViewPage-C73F0jPh.mjs} +3 -3
  32. package/dist/_chunks/{ListViewPage-C10McTK1.mjs.map → ListViewPage-C73F0jPh.mjs.map} +1 -1
  33. package/dist/_chunks/{NoContentTypePage-CPc0Cd3S.mjs → NoContentTypePage-B5w7iJOF.mjs} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-CPc0Cd3S.mjs.map → NoContentTypePage-B5w7iJOF.mjs.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-Dzw5Yj5u.js → NoContentTypePage-BwcL--4H.js} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-Dzw5Yj5u.js.map → NoContentTypePage-BwcL--4H.js.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DAe5CDCC.js → NoPermissionsPage-BMFKVcwJ.js} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DAe5CDCC.js.map → NoPermissionsPage-BMFKVcwJ.js.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-wfPBh2_0.mjs → NoPermissionsPage-UnEgMGK4.mjs} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-wfPBh2_0.mjs.map → NoPermissionsPage-UnEgMGK4.mjs.map} +1 -1
  41. package/dist/_chunks/{Preview-B7LyGT_b.js → Preview-B7PR3Ok_.js} +32 -10
  42. package/dist/_chunks/Preview-B7PR3Ok_.js.map +1 -0
  43. package/dist/_chunks/{Preview-BVFFm7uB.mjs → Preview-DECOhK0D.mjs} +33 -11
  44. package/dist/_chunks/Preview-DECOhK0D.mjs.map +1 -0
  45. package/dist/_chunks/{Relations-JPhWxk-s.mjs → Relations-DinMQJ4B.mjs} +3 -3
  46. package/dist/_chunks/{Relations-JPhWxk-s.mjs.map → Relations-DinMQJ4B.mjs.map} +1 -1
  47. package/dist/_chunks/{Relations-BmYR1AjY.js → Relations-lndx3aQk.js} +3 -3
  48. package/dist/_chunks/{Relations-BmYR1AjY.js.map → Relations-lndx3aQk.js.map} +1 -1
  49. package/dist/_chunks/{index-DLIkNVnQ.mjs → index-C2SagWVW.mjs} +151 -99
  50. package/dist/_chunks/index-C2SagWVW.mjs.map +1 -0
  51. package/dist/_chunks/{index-C2Q_PLWj.js → index-Cnw4gqee.js} +151 -99
  52. package/dist/_chunks/index-Cnw4gqee.js.map +1 -0
  53. package/dist/_chunks/{layout-qE8qkNH_.mjs → layout-DY_D9MGA.mjs} +3 -3
  54. package/dist/_chunks/{layout-qE8qkNH_.mjs.map → layout-DY_D9MGA.mjs.map} +1 -1
  55. package/dist/_chunks/{layout-7AsWJzZJ.js → layout-ivwIVPnV.js} +3 -3
  56. package/dist/_chunks/{layout-7AsWJzZJ.js.map → layout-ivwIVPnV.js.map} +1 -1
  57. package/dist/_chunks/{relations-EifVzf_2.js → relations-B7C7O_Pv.js} +2 -2
  58. package/dist/_chunks/{relations-EifVzf_2.js.map → relations-B7C7O_Pv.js.map} +1 -1
  59. package/dist/_chunks/{relations-BjHH_1Am.mjs → relations-Boc5Y9kX.mjs} +2 -2
  60. package/dist/_chunks/{relations-BjHH_1Am.mjs.map → relations-Boc5Y9kX.mjs.map} +1 -1
  61. package/dist/admin/index.js +1 -1
  62. package/dist/admin/index.mjs +1 -1
  63. package/dist/admin/src/content-manager.d.ts +3 -2
  64. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  65. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  66. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  67. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  68. package/dist/server/index.js +74 -66
  69. package/dist/server/index.js.map +1 -1
  70. package/dist/server/index.mjs +75 -67
  71. package/dist/server/index.mjs.map +1 -1
  72. package/dist/server/src/controllers/utils/metadata.d.ts +1 -0
  73. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  74. package/dist/server/src/index.d.ts +3 -2
  75. package/dist/server/src/index.d.ts.map +1 -1
  76. package/dist/server/src/preview/index.d.ts.map +1 -1
  77. package/dist/server/src/services/document-metadata.d.ts +4 -2
  78. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  79. package/dist/server/src/services/index.d.ts +3 -2
  80. package/dist/server/src/services/index.d.ts.map +1 -1
  81. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  82. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  83. package/dist/server/src/services/utils/populate.d.ts +2 -2
  84. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  85. package/package.json +8 -6
  86. package/dist/_chunks/Field-BPkQ-3Ku.mjs.map +0 -1
  87. package/dist/_chunks/Field-DwvmENVf.js.map +0 -1
  88. package/dist/_chunks/Preview-B7LyGT_b.js.map +0 -1
  89. package/dist/_chunks/Preview-BVFFm7uB.mjs.map +0 -1
  90. package/dist/_chunks/index-C2Q_PLWj.js.map +0 -1
  91. package/dist/_chunks/index-DLIkNVnQ.mjs.map +0 -1
  92. package/dist/admin/src/preview/constants.d.ts +0 -1
  93. package/dist/server/src/preview/constants.d.ts +0 -2
  94. package/dist/server/src/preview/constants.d.ts.map +0 -1
@@ -1688,7 +1688,7 @@ const useDocumentActions = () => {
1688
1688
  };
1689
1689
  };
1690
1690
  const ProtectedHistoryPage = React__namespace.lazy(
1691
- () => Promise.resolve().then(() => require("./History-C1TKAig-.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1691
+ () => Promise.resolve().then(() => require("./History-BMndx49M.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1692
1692
  );
1693
1693
  const routes$2 = [
1694
1694
  {
@@ -1701,7 +1701,7 @@ const routes$2 = [
1701
1701
  }
1702
1702
  ];
1703
1703
  const ProtectedPreviewPage = React__namespace.lazy(
1704
- () => Promise.resolve().then(() => require("./Preview-B7LyGT_b.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
1704
+ () => Promise.resolve().then(() => require("./Preview-B7PR3Ok_.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
1705
1705
  );
1706
1706
  const routes$1 = [
1707
1707
  {
@@ -1714,31 +1714,31 @@ const routes$1 = [
1714
1714
  }
1715
1715
  ];
1716
1716
  const ProtectedEditViewPage = React.lazy(
1717
- () => Promise.resolve().then(() => require("./EditViewPage-BRewdTqE.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1717
+ () => Promise.resolve().then(() => require("./EditViewPage-DT6A4ayX.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1718
1718
  );
1719
1719
  const ProtectedListViewPage = React.lazy(
1720
- () => Promise.resolve().then(() => require("./ListViewPage-xv5IQoZp.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1720
+ () => Promise.resolve().then(() => require("./ListViewPage-BPVmh9pq.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1721
1721
  );
1722
1722
  const ProtectedListConfiguration = React.lazy(
1723
- () => Promise.resolve().then(() => require("./ListConfigurationPage-D-NGRLYu.js")).then((mod) => ({
1723
+ () => Promise.resolve().then(() => require("./ListConfigurationPage-DouY1EWM.js")).then((mod) => ({
1724
1724
  default: mod.ProtectedListConfiguration
1725
1725
  }))
1726
1726
  );
1727
1727
  const ProtectedEditConfigurationPage = React.lazy(
1728
- () => Promise.resolve().then(() => require("./EditConfigurationPage-CxRlP5if.js")).then((mod) => ({
1728
+ () => Promise.resolve().then(() => require("./EditConfigurationPage-uy-v43AR.js")).then((mod) => ({
1729
1729
  default: mod.ProtectedEditConfigurationPage
1730
1730
  }))
1731
1731
  );
1732
1732
  const ProtectedComponentConfigurationPage = React.lazy(
1733
- () => Promise.resolve().then(() => require("./ComponentConfigurationPage-DywpTZeV.js")).then((mod) => ({
1733
+ () => Promise.resolve().then(() => require("./ComponentConfigurationPage-BlzvDpbX.js")).then((mod) => ({
1734
1734
  default: mod.ProtectedComponentConfigurationPage
1735
1735
  }))
1736
1736
  );
1737
1737
  const NoPermissions = React.lazy(
1738
- () => Promise.resolve().then(() => require("./NoPermissionsPage-DAe5CDCC.js")).then((mod) => ({ default: mod.NoPermissions }))
1738
+ () => Promise.resolve().then(() => require("./NoPermissionsPage-BMFKVcwJ.js")).then((mod) => ({ default: mod.NoPermissions }))
1739
1739
  );
1740
1740
  const NoContentType = React.lazy(
1741
- () => Promise.resolve().then(() => require("./NoContentTypePage-Dzw5Yj5u.js")).then((mod) => ({ default: mod.NoContentType }))
1741
+ () => Promise.resolve().then(() => require("./NoContentTypePage-BwcL--4H.js")).then((mod) => ({ default: mod.NoContentType }))
1742
1742
  );
1743
1743
  const CollectionTypePages = () => {
1744
1744
  const { collectionType } = reactRouterDom.useParams();
@@ -2269,6 +2269,7 @@ const PublishAction$1 = ({
2269
2269
  };
2270
2270
  };
2271
2271
  PublishAction$1.type = "publish";
2272
+ PublishAction$1.position = "panel";
2272
2273
  const UpdateAction = ({
2273
2274
  activeTab,
2274
2275
  documentId,
@@ -2291,6 +2292,117 @@ const UpdateAction = ({
2291
2292
  const validate = strapiAdmin.useForm("UpdateAction", (state) => state.validate);
2292
2293
  const setErrors = strapiAdmin.useForm("UpdateAction", (state) => state.setErrors);
2293
2294
  const resetForm = strapiAdmin.useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
2295
+ const handleUpdate = React__namespace.useCallback(async () => {
2296
+ setSubmitting(true);
2297
+ try {
2298
+ if (!modified) {
2299
+ return;
2300
+ }
2301
+ const { errors } = await validate(true, {
2302
+ status: "draft"
2303
+ });
2304
+ if (errors) {
2305
+ toggleNotification({
2306
+ type: "danger",
2307
+ message: formatMessage({
2308
+ id: "content-manager.validation.error",
2309
+ defaultMessage: "There are validation errors in your document. Please fix them before saving."
2310
+ })
2311
+ });
2312
+ return;
2313
+ }
2314
+ if (isCloning) {
2315
+ const res = await clone(
2316
+ {
2317
+ model,
2318
+ documentId: cloneMatch.params.origin,
2319
+ params
2320
+ },
2321
+ transformData(document)
2322
+ );
2323
+ if ("data" in res) {
2324
+ navigate(
2325
+ {
2326
+ pathname: `../${res.data.documentId}`,
2327
+ search: rawQuery
2328
+ },
2329
+ { relative: "path" }
2330
+ );
2331
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2332
+ setErrors(formatValidationErrors(res.error));
2333
+ }
2334
+ } else if (documentId || collectionType === SINGLE_TYPES) {
2335
+ const res = await update(
2336
+ {
2337
+ collectionType,
2338
+ model,
2339
+ documentId,
2340
+ params
2341
+ },
2342
+ transformData(document)
2343
+ );
2344
+ if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2345
+ setErrors(formatValidationErrors(res.error));
2346
+ } else {
2347
+ resetForm();
2348
+ }
2349
+ } else {
2350
+ const res = await create(
2351
+ {
2352
+ model,
2353
+ params
2354
+ },
2355
+ transformData(document)
2356
+ );
2357
+ if ("data" in res && collectionType !== SINGLE_TYPES) {
2358
+ navigate(
2359
+ {
2360
+ pathname: `../${res.data.documentId}`,
2361
+ search: rawQuery
2362
+ },
2363
+ { replace: true, relative: "path" }
2364
+ );
2365
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2366
+ setErrors(formatValidationErrors(res.error));
2367
+ }
2368
+ }
2369
+ } finally {
2370
+ setSubmitting(false);
2371
+ }
2372
+ }, [
2373
+ clone,
2374
+ cloneMatch?.params.origin,
2375
+ collectionType,
2376
+ create,
2377
+ document,
2378
+ documentId,
2379
+ formatMessage,
2380
+ formatValidationErrors,
2381
+ isCloning,
2382
+ model,
2383
+ modified,
2384
+ navigate,
2385
+ params,
2386
+ rawQuery,
2387
+ resetForm,
2388
+ setErrors,
2389
+ setSubmitting,
2390
+ toggleNotification,
2391
+ update,
2392
+ validate
2393
+ ]);
2394
+ React__namespace.useEffect(() => {
2395
+ const handleKeyDown = (e) => {
2396
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
2397
+ e.preventDefault();
2398
+ handleUpdate();
2399
+ }
2400
+ };
2401
+ window.addEventListener("keydown", handleKeyDown);
2402
+ return () => {
2403
+ window.removeEventListener("keydown", handleKeyDown);
2404
+ };
2405
+ }, [handleUpdate]);
2294
2406
  return {
2295
2407
  /**
2296
2408
  * Disabled when:
@@ -2303,84 +2415,11 @@ const UpdateAction = ({
2303
2415
  id: "global.save",
2304
2416
  defaultMessage: "Save"
2305
2417
  }),
2306
- onClick: async () => {
2307
- setSubmitting(true);
2308
- try {
2309
- const { errors } = await validate(true, {
2310
- status: "draft"
2311
- });
2312
- if (errors) {
2313
- toggleNotification({
2314
- type: "danger",
2315
- message: formatMessage({
2316
- id: "content-manager.validation.error",
2317
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
2318
- })
2319
- });
2320
- return;
2321
- }
2322
- if (isCloning) {
2323
- const res = await clone(
2324
- {
2325
- model,
2326
- documentId: cloneMatch.params.origin,
2327
- params
2328
- },
2329
- transformData(document)
2330
- );
2331
- if ("data" in res) {
2332
- navigate(
2333
- {
2334
- pathname: `../${res.data.documentId}`,
2335
- search: rawQuery
2336
- },
2337
- { relative: "path" }
2338
- );
2339
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2340
- setErrors(formatValidationErrors(res.error));
2341
- }
2342
- } else if (documentId || collectionType === SINGLE_TYPES) {
2343
- const res = await update(
2344
- {
2345
- collectionType,
2346
- model,
2347
- documentId,
2348
- params
2349
- },
2350
- transformData(document)
2351
- );
2352
- if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2353
- setErrors(formatValidationErrors(res.error));
2354
- } else {
2355
- resetForm();
2356
- }
2357
- } else {
2358
- const res = await create(
2359
- {
2360
- model,
2361
- params
2362
- },
2363
- transformData(document)
2364
- );
2365
- if ("data" in res && collectionType !== SINGLE_TYPES) {
2366
- navigate(
2367
- {
2368
- pathname: `../${res.data.documentId}`,
2369
- search: rawQuery
2370
- },
2371
- { replace: true, relative: "path" }
2372
- );
2373
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2374
- setErrors(formatValidationErrors(res.error));
2375
- }
2376
- }
2377
- } finally {
2378
- setSubmitting(false);
2379
- }
2380
- }
2418
+ onClick: handleUpdate
2381
2419
  };
2382
2420
  };
2383
2421
  UpdateAction.type = "update";
2422
+ UpdateAction.position = "panel";
2384
2423
  const UNPUBLISH_DRAFT_OPTIONS = {
2385
2424
  KEEP: "keep",
2386
2425
  DISCARD: "discard"
@@ -2503,6 +2542,7 @@ const UnpublishAction$1 = ({
2503
2542
  };
2504
2543
  };
2505
2544
  UnpublishAction$1.type = "unpublish";
2545
+ UnpublishAction$1.position = "panel";
2506
2546
  const DiscardAction = ({
2507
2547
  activeTab,
2508
2548
  documentId,
@@ -2553,6 +2593,7 @@ const DiscardAction = ({
2553
2593
  };
2554
2594
  };
2555
2595
  DiscardAction.type = "discard";
2596
+ DiscardAction.position = "panel";
2556
2597
  const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
2557
2598
  const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
2558
2599
  const RelativeTime = React__namespace.forwardRef(
@@ -2672,7 +2713,7 @@ const HeaderToolbar = () => {
2672
2713
  meta: isCloning ? void 0 : meta,
2673
2714
  collectionType
2674
2715
  },
2675
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
2716
+ descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
2676
2717
  children: (actions2) => {
2677
2718
  const headerActions = actions2.filter((action) => {
2678
2719
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -2880,6 +2921,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
2880
2921
  };
2881
2922
  };
2882
2923
  ConfigureTheViewAction.type = "configure-the-view";
2924
+ ConfigureTheViewAction.position = "header";
2883
2925
  const EditTheModelAction = ({ model }) => {
2884
2926
  const navigate = reactRouterDom.useNavigate();
2885
2927
  const { formatMessage } = reactIntl.useIntl();
@@ -2896,6 +2938,7 @@ const EditTheModelAction = ({ model }) => {
2896
2938
  };
2897
2939
  };
2898
2940
  EditTheModelAction.type = "edit-the-model";
2941
+ EditTheModelAction.position = "header";
2899
2942
  const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2900
2943
  const navigate = reactRouterDom.useNavigate();
2901
2944
  const { formatMessage } = reactIntl.useIntl();
@@ -2969,6 +3012,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2969
3012
  };
2970
3013
  };
2971
3014
  DeleteAction$1.type = "delete";
3015
+ DeleteAction$1.position = ["header", "table-row"];
2972
3016
  const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
2973
3017
  const Panels = () => {
2974
3018
  const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
@@ -3031,7 +3075,7 @@ const ActionsPanelContent = () => {
3031
3075
  strapiAdmin.DescriptionComponentRenderer,
3032
3076
  {
3033
3077
  props,
3034
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
3078
+ descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
3035
3079
  children: (actions2) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActions, { actions: actions2 })
3036
3080
  }
3037
3081
  ),
@@ -3707,7 +3751,7 @@ const TableActions = ({ document }) => {
3707
3751
  strapiAdmin.DescriptionComponentRenderer,
3708
3752
  {
3709
3753
  props,
3710
- descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
3754
+ descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
3711
3755
  children: (actions2) => {
3712
3756
  const tableRowActions = actions2.filter((action) => {
3713
3757
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -3766,6 +3810,7 @@ const EditAction = ({ documentId }) => {
3766
3810
  };
3767
3811
  };
3768
3812
  EditAction.type = "edit";
3813
+ EditAction.position = "table-row";
3769
3814
  const StyledPencil = styledComponents.styled(Icons.Pencil)`
3770
3815
  path {
3771
3816
  fill: currentColor;
@@ -3842,6 +3887,7 @@ const CloneAction = ({ model, documentId }) => {
3842
3887
  };
3843
3888
  };
3844
3889
  CloneAction.type = "clone";
3890
+ CloneAction.position = "table-row";
3845
3891
  const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
3846
3892
  path {
3847
3893
  fill: currentColor;
@@ -3928,7 +3974,14 @@ class ContentManagerPlugin {
3928
3974
  addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
3929
3975
  addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
3930
3976
  getBulkActions: () => this.bulkActions,
3931
- getDocumentActions: () => this.documentActions,
3977
+ getDocumentActions: (position) => {
3978
+ if (position) {
3979
+ return this.documentActions.filter(
3980
+ (action) => action.position == void 0 || [action.position].flat().includes(position)
3981
+ );
3982
+ }
3983
+ return this.documentActions;
3984
+ },
3932
3985
  getEditViewSidePanels: () => this.editViewSidePanels,
3933
3986
  getHeaderActions: () => this.headerActions
3934
3987
  }
@@ -3992,6 +4045,7 @@ const HistoryAction = ({ model, document }) => {
3992
4045
  };
3993
4046
  };
3994
4047
  HistoryAction.type = "history";
4048
+ HistoryAction.position = "header";
3995
4049
  const historyAdmin = {
3996
4050
  bootstrap(app) {
3997
4051
  const { addDocumentAction } = app.getPlugin("content-manager").apis;
@@ -4085,7 +4139,7 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
4085
4139
  };
4086
4140
  return {
4087
4141
  title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4088
- content: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
4142
+ content: /* @__PURE__ */ jsxRuntime.jsx(
4089
4143
  ConditionalTooltip,
4090
4144
  {
4091
4145
  label: formatMessage({
@@ -4093,31 +4147,29 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
4093
4147
  defaultMessage: "Please save to open the preview"
4094
4148
  }),
4095
4149
  isShown: isModified,
4096
- children: /* @__PURE__ */ jsxRuntime.jsx(
4150
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
4097
4151
  designSystem.Button,
4098
4152
  {
4099
4153
  variant: "tertiary",
4100
4154
  tag: reactRouterDom.Link,
4101
4155
  to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
4102
4156
  onClick: trackNavigation,
4103
- flex: "auto",
4157
+ width: "100%",
4104
4158
  disabled: isModified,
4159
+ pointerEvents: isModified ? "none" : void 0,
4160
+ tabIndex: isModified ? -1 : void 0,
4105
4161
  children: formatMessage({
4106
4162
  id: "content-manager.preview.panel.button",
4107
4163
  defaultMessage: "Open preview"
4108
4164
  })
4109
4165
  }
4110
- )
4166
+ ) })
4111
4167
  }
4112
- ) })
4168
+ )
4113
4169
  };
4114
4170
  };
4115
- const FEATURE_ID = "preview";
4116
4171
  const previewAdmin = {
4117
4172
  bootstrap(app) {
4118
- if (!window.strapi.future.isEnabled(FEATURE_ID)) {
4119
- return;
4120
- }
4121
4173
  const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4122
4174
  contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4123
4175
  }
@@ -4141,7 +4193,7 @@ const index = {
4141
4193
  app.router.addRoute({
4142
4194
  path: "content-manager/*",
4143
4195
  lazy: async () => {
4144
- const { Layout } = await Promise.resolve().then(() => require("./layout-7AsWJzZJ.js"));
4196
+ const { Layout } = await Promise.resolve().then(() => require("./layout-ivwIVPnV.js"));
4145
4197
  return {
4146
4198
  Component: Layout
4147
4199
  };
@@ -4221,4 +4273,4 @@ exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuer
4221
4273
  exports.useGetInitialDataQuery = useGetInitialDataQuery;
4222
4274
  exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
4223
4275
  exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
4224
- //# sourceMappingURL=index-C2Q_PLWj.js.map
4276
+ //# sourceMappingURL=index-Cnw4gqee.js.map