@strapi/content-manager 5.4.2 → 5.5.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.
Files changed (93) hide show
  1. package/dist/_chunks/CardDragPreview-C0QyJgRA.js.map +1 -1
  2. package/dist/_chunks/CardDragPreview-DOxamsuj.mjs.map +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-N-CTtgQa.js → ComponentConfigurationPage-BPiQrhZ6.js} +4 -5
  4. package/dist/_chunks/{ComponentConfigurationPage-N-CTtgQa.js.map → ComponentConfigurationPage-BPiQrhZ6.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-BaJMOQyq.mjs → ComponentConfigurationPage-viOAdZM6.mjs} +3 -3
  6. package/dist/_chunks/{ComponentConfigurationPage-BaJMOQyq.mjs.map → ComponentConfigurationPage-viOAdZM6.mjs.map} +1 -1
  7. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js → ComponentIcon-CRbtQEUV.js} +2 -3
  8. package/dist/_chunks/{ComponentIcon-BXdiCGQp.js.map → ComponentIcon-CRbtQEUV.js.map} +1 -1
  9. package/dist/_chunks/ComponentIcon-u4bIXTFY.mjs.map +1 -1
  10. package/dist/_chunks/{EditConfigurationPage-BHkjAbxH.js → EditConfigurationPage-CZRKq8CN.js} +4 -5
  11. package/dist/_chunks/{EditConfigurationPage-BHkjAbxH.js.map → EditConfigurationPage-CZRKq8CN.js.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-CKK-5LfX.mjs → EditConfigurationPage-DKtPyjs_.mjs} +3 -3
  13. package/dist/_chunks/{EditConfigurationPage-CKK-5LfX.mjs.map → EditConfigurationPage-DKtPyjs_.mjs.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-QPUftxUd.js → EditViewPage-C-TZmK5r.js} +4 -5
  15. package/dist/_chunks/{EditViewPage-QPUftxUd.js.map → EditViewPage-C-TZmK5r.js.map} +1 -1
  16. package/dist/_chunks/{EditViewPage-B11aeMcf.mjs → EditViewPage-D2FPb5Mh.mjs} +3 -3
  17. package/dist/_chunks/{EditViewPage-B11aeMcf.mjs.map → EditViewPage-D2FPb5Mh.mjs.map} +1 -1
  18. package/dist/_chunks/{Field-DUK83cfh.js → Field-IMBnqF-k.js} +25 -45
  19. package/dist/_chunks/{Field-DUK83cfh.js.map → Field-IMBnqF-k.js.map} +1 -1
  20. package/dist/_chunks/{Field-Bj_RgtGo.mjs → Field-hD0Y00Mt.mjs} +23 -42
  21. package/dist/_chunks/{Field-Bj_RgtGo.mjs.map → Field-hD0Y00Mt.mjs.map} +1 -1
  22. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  23. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  24. package/dist/_chunks/{Form-DHmBRlHd.js → Form-BaURS01O.js} +5 -6
  25. package/dist/_chunks/{Form-DHmBRlHd.js.map → Form-BaURS01O.js.map} +1 -1
  26. package/dist/_chunks/{Form-DLMSoXV7.mjs → Form-ZQ9fzWkd.mjs} +3 -3
  27. package/dist/_chunks/{Form-DLMSoXV7.mjs.map → Form-ZQ9fzWkd.mjs.map} +1 -1
  28. package/dist/_chunks/{History-Di3zm4HT.js → History-BqRQm2Lc.js} +5 -6
  29. package/dist/_chunks/{History-Di3zm4HT.js.map → History-BqRQm2Lc.js.map} +1 -1
  30. package/dist/_chunks/{History-CfCSNlG9.mjs → History-C4X3jiQJ.mjs} +4 -4
  31. package/dist/_chunks/{History-CfCSNlG9.mjs.map → History-C4X3jiQJ.mjs.map} +1 -1
  32. package/dist/_chunks/{ListConfigurationPage-Cq361KIt.js → ListConfigurationPage-BT69-TvF.js} +4 -5
  33. package/dist/_chunks/{ListConfigurationPage-Cq361KIt.js.map → ListConfigurationPage-BT69-TvF.js.map} +1 -1
  34. package/dist/_chunks/{ListConfigurationPage-0mtv_iqk.mjs → ListConfigurationPage-CwMU6tWQ.mjs} +3 -3
  35. package/dist/_chunks/{ListConfigurationPage-0mtv_iqk.mjs.map → ListConfigurationPage-CwMU6tWQ.mjs.map} +1 -1
  36. package/dist/_chunks/{ListViewPage-DFDcG8gM.js → ListViewPage-CYkrfWsm.js} +4 -5
  37. package/dist/_chunks/{ListViewPage-DFDcG8gM.js.map → ListViewPage-CYkrfWsm.js.map} +1 -1
  38. package/dist/_chunks/{ListViewPage-BxLVROX8.mjs → ListViewPage-CvxfiNTc.mjs} +3 -3
  39. package/dist/_chunks/{ListViewPage-BxLVROX8.mjs.map → ListViewPage-CvxfiNTc.mjs.map} +1 -1
  40. package/dist/_chunks/{NoContentTypePage-BSyvnDZZ.js → NoContentTypePage-BZMfRsrg.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-BSyvnDZZ.js.map → NoContentTypePage-BZMfRsrg.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-BRfDd67_.mjs → NoContentTypePage-Dy6sa9LT.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-BRfDd67_.mjs.map → NoContentTypePage-Dy6sa9LT.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-CV9V8KWa.mjs → NoPermissionsPage-DiW-TIzq.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-CV9V8KWa.mjs.map → NoPermissionsPage-DiW-TIzq.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-DyLphsn_.js → NoPermissionsPage-DjUdvhJ6.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-DyLphsn_.js.map → NoPermissionsPage-DjUdvhJ6.js.map} +1 -1
  48. package/dist/_chunks/{Preview-D_3aO6Ly.js → Preview-BqRUSbFU.js} +12 -7
  49. package/dist/_chunks/Preview-BqRUSbFU.js.map +1 -0
  50. package/dist/_chunks/{Preview-C_B1nx3g.mjs → Preview-DwWET-X7.mjs} +11 -5
  51. package/dist/_chunks/Preview-DwWET-X7.mjs.map +1 -0
  52. package/dist/_chunks/{Relations-C6pwmDXh.mjs → Relations-BOTC_ZqE.mjs} +6 -8
  53. package/dist/_chunks/{Relations-C6pwmDXh.mjs.map → Relations-BOTC_ZqE.mjs.map} +1 -1
  54. package/dist/_chunks/{Relations-Cne2AlrL.js → Relations-DnCdLzq_.js} +7 -10
  55. package/dist/_chunks/{Relations-Cne2AlrL.js.map → Relations-DnCdLzq_.js.map} +1 -1
  56. package/dist/_chunks/{en-Ic0kXjxB.js → en-BK8Xyl5I.js} +2 -1
  57. package/dist/_chunks/{en-Ic0kXjxB.js.map → en-BK8Xyl5I.js.map} +1 -1
  58. package/dist/_chunks/{en-DhFUjrNW.mjs → en-Dtk_ot79.mjs} +2 -1
  59. package/dist/_chunks/{en-DhFUjrNW.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
  60. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  61. package/dist/_chunks/{index-BpxR3En4.mjs → index-BeYsz0Vi.mjs} +80 -42
  62. package/dist/_chunks/index-BeYsz0Vi.mjs.map +1 -0
  63. package/dist/_chunks/{index-T-aWjbj2.js → index-CptTdHNy.js} +81 -44
  64. package/dist/_chunks/index-CptTdHNy.js.map +1 -0
  65. package/dist/_chunks/{layout-DhMZ_lDx.mjs → layout-CzSSEy9b.mjs} +4 -4
  66. package/dist/_chunks/{layout-DhMZ_lDx.mjs.map → layout-CzSSEy9b.mjs.map} +1 -1
  67. package/dist/_chunks/{layout-BEuNwv-F.js → layout-szfTCeYm.js} +5 -6
  68. package/dist/_chunks/{layout-BEuNwv-F.js.map → layout-szfTCeYm.js.map} +1 -1
  69. package/dist/_chunks/objects-BcXOv6_9.js.map +1 -1
  70. package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -1
  71. package/dist/_chunks/{relations-BdnxoX6f.mjs → relations-DvzmDbWc.mjs} +2 -2
  72. package/dist/_chunks/{relations-BdnxoX6f.mjs.map → relations-DvzmDbWc.mjs.map} +1 -1
  73. package/dist/_chunks/{relations-kLcuobLk.js → relations-qssSbh1V.js} +2 -2
  74. package/dist/_chunks/{relations-kLcuobLk.js.map → relations-qssSbh1V.js.map} +1 -1
  75. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -1
  76. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -1
  77. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  78. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  79. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  80. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  81. package/dist/admin/index.js +1 -1
  82. package/dist/admin/index.mjs +1 -1
  83. package/dist/admin/src/content-manager.d.ts +3 -2
  84. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  85. package/dist/server/index.js +18 -36
  86. package/dist/server/index.js.map +1 -1
  87. package/dist/server/index.mjs +17 -34
  88. package/dist/server/index.mjs.map +1 -1
  89. package/package.json +9 -9
  90. package/dist/_chunks/Preview-C_B1nx3g.mjs.map +0 -1
  91. package/dist/_chunks/Preview-D_3aO6Ly.js.map +0 -1
  92. package/dist/_chunks/index-BpxR3En4.mjs.map +0 -1
  93. package/dist/_chunks/index-T-aWjbj2.js.map +0 -1
@@ -15,8 +15,7 @@ const dateFns = require("date-fns");
15
15
  const toolkit = require("@reduxjs/toolkit");
16
16
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
17
17
  function _interopNamespace(e) {
18
- if (e && e.__esModule)
19
- return e;
18
+ if (e && e.__esModule) return e;
20
19
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
21
20
  if (e) {
22
21
  for (const k in e) {
@@ -36,13 +35,20 @@ const React__namespace = /* @__PURE__ */ _interopNamespace(React);
36
35
  const mapValues__default = /* @__PURE__ */ _interopDefault(mapValues);
37
36
  const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
38
37
  const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
39
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
38
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
40
39
  const v = glob[path];
41
40
  if (v) {
42
41
  return typeof v === "function" ? v() : Promise.resolve(v);
43
42
  }
44
43
  return new Promise((_, reject) => {
45
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path)));
44
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
45
+ reject.bind(
46
+ null,
47
+ new Error(
48
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
49
+ )
50
+ )
51
+ );
46
52
  });
47
53
  };
48
54
  const PLUGIN_ID = "content-manager";
@@ -475,8 +481,7 @@ const {
475
481
  useUnpublishManyDocumentsMutation
476
482
  } = documentApi;
477
483
  const buildValidParams = (query) => {
478
- if (!query)
479
- return query;
484
+ if (!query) return query;
480
485
  const { plugins: _, ...validQueryParams } = {
481
486
  ...query,
482
487
  ...Object.values(query?.plugins ?? {}).reduce(
@@ -1683,7 +1688,7 @@ const useDocumentActions = () => {
1683
1688
  };
1684
1689
  };
1685
1690
  const ProtectedHistoryPage = React__namespace.lazy(
1686
- () => Promise.resolve().then(() => require("./History-Di3zm4HT.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1691
+ () => Promise.resolve().then(() => require("./History-BqRQm2Lc.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1687
1692
  );
1688
1693
  const routes$2 = [
1689
1694
  {
@@ -1696,7 +1701,7 @@ const routes$2 = [
1696
1701
  }
1697
1702
  ];
1698
1703
  const ProtectedPreviewPage = React__namespace.lazy(
1699
- () => Promise.resolve().then(() => require("./Preview-D_3aO6Ly.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
1704
+ () => Promise.resolve().then(() => require("./Preview-BqRUSbFU.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
1700
1705
  );
1701
1706
  const routes$1 = [
1702
1707
  {
@@ -1709,31 +1714,31 @@ const routes$1 = [
1709
1714
  }
1710
1715
  ];
1711
1716
  const ProtectedEditViewPage = React.lazy(
1712
- () => Promise.resolve().then(() => require("./EditViewPage-QPUftxUd.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1717
+ () => Promise.resolve().then(() => require("./EditViewPage-C-TZmK5r.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1713
1718
  );
1714
1719
  const ProtectedListViewPage = React.lazy(
1715
- () => Promise.resolve().then(() => require("./ListViewPage-DFDcG8gM.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1720
+ () => Promise.resolve().then(() => require("./ListViewPage-CYkrfWsm.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1716
1721
  );
1717
1722
  const ProtectedListConfiguration = React.lazy(
1718
- () => Promise.resolve().then(() => require("./ListConfigurationPage-Cq361KIt.js")).then((mod) => ({
1723
+ () => Promise.resolve().then(() => require("./ListConfigurationPage-BT69-TvF.js")).then((mod) => ({
1719
1724
  default: mod.ProtectedListConfiguration
1720
1725
  }))
1721
1726
  );
1722
1727
  const ProtectedEditConfigurationPage = React.lazy(
1723
- () => Promise.resolve().then(() => require("./EditConfigurationPage-BHkjAbxH.js")).then((mod) => ({
1728
+ () => Promise.resolve().then(() => require("./EditConfigurationPage-CZRKq8CN.js")).then((mod) => ({
1724
1729
  default: mod.ProtectedEditConfigurationPage
1725
1730
  }))
1726
1731
  );
1727
1732
  const ProtectedComponentConfigurationPage = React.lazy(
1728
- () => Promise.resolve().then(() => require("./ComponentConfigurationPage-N-CTtgQa.js")).then((mod) => ({
1733
+ () => Promise.resolve().then(() => require("./ComponentConfigurationPage-BPiQrhZ6.js")).then((mod) => ({
1729
1734
  default: mod.ProtectedComponentConfigurationPage
1730
1735
  }))
1731
1736
  );
1732
1737
  const NoPermissions = React.lazy(
1733
- () => Promise.resolve().then(() => require("./NoPermissionsPage-DyLphsn_.js")).then((mod) => ({ default: mod.NoPermissions }))
1738
+ () => Promise.resolve().then(() => require("./NoPermissionsPage-DjUdvhJ6.js")).then((mod) => ({ default: mod.NoPermissions }))
1734
1739
  );
1735
1740
  const NoContentType = React.lazy(
1736
- () => Promise.resolve().then(() => require("./NoContentTypePage-BSyvnDZZ.js")).then((mod) => ({ default: mod.NoContentType }))
1741
+ () => Promise.resolve().then(() => require("./NoContentTypePage-BZMfRsrg.js")).then((mod) => ({ default: mod.NoContentType }))
1737
1742
  );
1738
1743
  const CollectionTypePages = () => {
1739
1744
  const { collectionType } = reactRouterDom.useParams();
@@ -2264,6 +2269,7 @@ const PublishAction$1 = ({
2264
2269
  };
2265
2270
  };
2266
2271
  PublishAction$1.type = "publish";
2272
+ PublishAction$1.position = "panel";
2267
2273
  const UpdateAction = ({
2268
2274
  activeTab,
2269
2275
  documentId,
@@ -2376,6 +2382,7 @@ const UpdateAction = ({
2376
2382
  };
2377
2383
  };
2378
2384
  UpdateAction.type = "update";
2385
+ UpdateAction.position = "panel";
2379
2386
  const UNPUBLISH_DRAFT_OPTIONS = {
2380
2387
  KEEP: "keep",
2381
2388
  DISCARD: "discard"
@@ -2498,6 +2505,7 @@ const UnpublishAction$1 = ({
2498
2505
  };
2499
2506
  };
2500
2507
  UnpublishAction$1.type = "unpublish";
2508
+ UnpublishAction$1.position = "panel";
2501
2509
  const DiscardAction = ({
2502
2510
  activeTab,
2503
2511
  documentId,
@@ -2548,6 +2556,7 @@ const DiscardAction = ({
2548
2556
  };
2549
2557
  };
2550
2558
  DiscardAction.type = "discard";
2559
+ DiscardAction.position = "panel";
2551
2560
  const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
2552
2561
  const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
2553
2562
  const RelativeTime = React__namespace.forwardRef(
@@ -2667,7 +2676,7 @@ const HeaderToolbar = () => {
2667
2676
  meta: isCloning ? void 0 : meta,
2668
2677
  collectionType
2669
2678
  },
2670
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
2679
+ descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
2671
2680
  children: (actions2) => {
2672
2681
  const headerActions = actions2.filter((action) => {
2673
2682
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -2875,6 +2884,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
2875
2884
  };
2876
2885
  };
2877
2886
  ConfigureTheViewAction.type = "configure-the-view";
2887
+ ConfigureTheViewAction.position = "header";
2878
2888
  const EditTheModelAction = ({ model }) => {
2879
2889
  const navigate = reactRouterDom.useNavigate();
2880
2890
  const { formatMessage } = reactIntl.useIntl();
@@ -2891,6 +2901,7 @@ const EditTheModelAction = ({ model }) => {
2891
2901
  };
2892
2902
  };
2893
2903
  EditTheModelAction.type = "edit-the-model";
2904
+ EditTheModelAction.position = "header";
2894
2905
  const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2895
2906
  const navigate = reactRouterDom.useNavigate();
2896
2907
  const { formatMessage } = reactIntl.useIntl();
@@ -2964,6 +2975,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2964
2975
  };
2965
2976
  };
2966
2977
  DeleteAction$1.type = "delete";
2978
+ DeleteAction$1.position = ["header", "table-row"];
2967
2979
  const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
2968
2980
  const Panels = () => {
2969
2981
  const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
@@ -3026,7 +3038,7 @@ const ActionsPanelContent = () => {
3026
3038
  strapiAdmin.DescriptionComponentRenderer,
3027
3039
  {
3028
3040
  props,
3029
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
3041
+ descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
3030
3042
  children: (actions2) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActions, { actions: actions2 })
3031
3043
  }
3032
3044
  ),
@@ -3480,8 +3492,7 @@ const PublishAction = ({ documents, model }) => {
3480
3492
  const refetchList = () => {
3481
3493
  contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
3482
3494
  };
3483
- if (!showPublishButton)
3484
- return null;
3495
+ if (!showPublishButton) return null;
3485
3496
  return {
3486
3497
  actionType: "publish",
3487
3498
  variant: "tertiary",
@@ -3549,8 +3560,7 @@ const DeleteAction = ({ documents, model }) => {
3549
3560
  selectRow([]);
3550
3561
  }
3551
3562
  };
3552
- if (!hasDeletePermission)
3553
- return null;
3563
+ if (!hasDeletePermission) return null;
3554
3564
  return {
3555
3565
  variant: "danger-light",
3556
3566
  label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
@@ -3599,8 +3609,7 @@ const UnpublishAction = ({ documents, model }) => {
3599
3609
  }
3600
3610
  };
3601
3611
  const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
3602
- if (!showUnpublishButton)
3603
- return null;
3612
+ if (!showUnpublishButton) return null;
3604
3613
  return {
3605
3614
  variant: "tertiary",
3606
3615
  label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
@@ -3705,7 +3714,7 @@ const TableActions = ({ document }) => {
3705
3714
  strapiAdmin.DescriptionComponentRenderer,
3706
3715
  {
3707
3716
  props,
3708
- descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
3717
+ descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
3709
3718
  children: (actions2) => {
3710
3719
  const tableRowActions = actions2.filter((action) => {
3711
3720
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -3764,6 +3773,7 @@ const EditAction = ({ documentId }) => {
3764
3773
  };
3765
3774
  };
3766
3775
  EditAction.type = "edit";
3776
+ EditAction.position = "table-row";
3767
3777
  const StyledPencil = styledComponents.styled(Icons.Pencil)`
3768
3778
  path {
3769
3779
  fill: currentColor;
@@ -3840,6 +3850,7 @@ const CloneAction = ({ model, documentId }) => {
3840
3850
  };
3841
3851
  };
3842
3852
  CloneAction.type = "clone";
3853
+ CloneAction.position = "table-row";
3843
3854
  const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
3844
3855
  path {
3845
3856
  fill: currentColor;
@@ -3926,7 +3937,14 @@ class ContentManagerPlugin {
3926
3937
  addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
3927
3938
  addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
3928
3939
  getBulkActions: () => this.bulkActions,
3929
- getDocumentActions: () => this.documentActions,
3940
+ getDocumentActions: (position) => {
3941
+ if (position) {
3942
+ return this.documentActions.filter(
3943
+ (action) => action.position == void 0 || [action.position].flat().includes(position)
3944
+ );
3945
+ }
3946
+ return this.documentActions;
3947
+ },
3930
3948
  getEditViewSidePanels: () => this.editViewSidePanels,
3931
3949
  getHeaderActions: () => this.headerActions
3932
3950
  }
@@ -3936,10 +3954,8 @@ class ContentManagerPlugin {
3936
3954
  const getPrintableType = (value) => {
3937
3955
  const nativeType = typeof value;
3938
3956
  if (nativeType === "object") {
3939
- if (value === null)
3940
- return "null";
3941
- if (Array.isArray(value))
3942
- return "array";
3957
+ if (value === null) return "null";
3958
+ if (Array.isArray(value)) return "array";
3943
3959
  if (value instanceof Object && value.constructor.name !== "Object") {
3944
3960
  return value.constructor.name;
3945
3961
  }
@@ -3992,6 +4008,7 @@ const HistoryAction = ({ model, document }) => {
3992
4008
  };
3993
4009
  };
3994
4010
  HistoryAction.type = "history";
4011
+ HistoryAction.position = "header";
3995
4012
  const historyAdmin = {
3996
4013
  bootstrap(app) {
3997
4014
  const { addDocumentAction } = app.getPlugin("content-manager").apis;
@@ -4054,11 +4071,18 @@ const previewApi = contentManagerApi.injectEndpoints({
4054
4071
  })
4055
4072
  });
4056
4073
  const { useGetPreviewUrlQuery } = previewApi;
4074
+ const ConditionalTooltip = ({ isShown, label, children }) => {
4075
+ if (isShown) {
4076
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label, children });
4077
+ }
4078
+ return children;
4079
+ };
4057
4080
  const PreviewSidePanel = ({ model, documentId, document }) => {
4058
4081
  const { formatMessage } = reactIntl.useIntl();
4059
4082
  const { trackUsage } = strapiAdmin.useTracking();
4060
4083
  const { pathname } = reactRouterDom.useLocation();
4061
4084
  const [{ query }] = strapiAdmin.useQueryParams();
4085
+ const isModified = strapiAdmin.useForm("PreviewSidePanel", (state) => state.modified);
4062
4086
  const { data, error } = useGetPreviewUrlQuery({
4063
4087
  params: {
4064
4088
  contentType: model
@@ -4078,20 +4102,33 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
4078
4102
  };
4079
4103
  return {
4080
4104
  title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4081
- content: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
4082
- designSystem.Button,
4105
+ content: /* @__PURE__ */ jsxRuntime.jsx(
4106
+ ConditionalTooltip,
4083
4107
  {
4084
- variant: "tertiary",
4085
- tag: reactRouterDom.Link,
4086
- to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
4087
- onClick: trackNavigation,
4088
- flex: "auto",
4089
- children: formatMessage({
4090
- id: "content-manager.preview.panel.button",
4091
- defaultMessage: "Open preview"
4092
- })
4108
+ label: formatMessage({
4109
+ id: "content-manager.preview.panel.button-disabled-tooltip",
4110
+ defaultMessage: "Please save to open the preview"
4111
+ }),
4112
+ isShown: isModified,
4113
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
4114
+ designSystem.Button,
4115
+ {
4116
+ variant: "tertiary",
4117
+ tag: reactRouterDom.Link,
4118
+ to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
4119
+ onClick: trackNavigation,
4120
+ width: "100%",
4121
+ disabled: isModified,
4122
+ pointerEvents: isModified ? "none" : void 0,
4123
+ tabIndex: isModified ? -1 : void 0,
4124
+ children: formatMessage({
4125
+ id: "content-manager.preview.panel.button",
4126
+ defaultMessage: "Open preview"
4127
+ })
4128
+ }
4129
+ ) })
4093
4130
  }
4094
- ) })
4131
+ )
4095
4132
  };
4096
4133
  };
4097
4134
  const FEATURE_ID = "preview";
@@ -4123,7 +4160,7 @@ const index = {
4123
4160
  app.router.addRoute({
4124
4161
  path: "content-manager/*",
4125
4162
  lazy: async () => {
4126
- const { Layout } = await Promise.resolve().then(() => require("./layout-BEuNwv-F.js"));
4163
+ const { Layout } = await Promise.resolve().then(() => require("./layout-szfTCeYm.js"));
4127
4164
  return {
4128
4165
  Component: Layout
4129
4166
  };
@@ -4143,7 +4180,7 @@ const index = {
4143
4180
  async registerTrads({ locales }) {
4144
4181
  const importedTrads = await Promise.all(
4145
4182
  locales.map((locale) => {
4146
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-Ic0kXjxB.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-9K52xZIr.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B2Kyv8Z9.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-7sfIbjxE.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
4183
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BK8Xyl5I.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-9K52xZIr.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B2Kyv8Z9.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-7sfIbjxE.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
4147
4184
  return {
4148
4185
  data: prefixPluginTranslations(data, PLUGIN_ID),
4149
4186
  locale
@@ -4203,4 +4240,4 @@ exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuer
4203
4240
  exports.useGetInitialDataQuery = useGetInitialDataQuery;
4204
4241
  exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
4205
4242
  exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
4206
- //# sourceMappingURL=index-T-aWjbj2.js.map
4243
+ //# sourceMappingURL=index-CptTdHNy.js.map