@strapi/content-manager 0.0.0-experimental.fed75ee8e64c57dbed0b670b25ef026b69baab10 → 0.0.0-next.16399698bd270e78290e5afc9cd317bd05bb0c6e

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 (181) 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-DNRPa10q.js → ComponentConfigurationPage-BTR_hQow.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-DNRPa10q.js.map → ComponentConfigurationPage-BTR_hQow.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-BVM7LScS.mjs → ComponentConfigurationPage-bLQr82ce.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-BVM7LScS.mjs.map → ComponentConfigurationPage-bLQr82ce.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-BWq-9Zhk.mjs → EditConfigurationPage-BhRSnUsL.mjs} +4 -4
  11. package/dist/_chunks/{EditConfigurationPage-BWq-9Zhk.mjs.map → EditConfigurationPage-BhRSnUsL.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-BrG0mEfF.js → EditConfigurationPage-z39Wv3E6.js} +5 -6
  13. package/dist/_chunks/{EditConfigurationPage-BrG0mEfF.js.map → EditConfigurationPage-z39Wv3E6.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-Dx0QnTxn.mjs → EditViewPage-BCjNxNlY.mjs} +38 -8
  15. package/dist/_chunks/EditViewPage-BCjNxNlY.mjs.map +1 -0
  16. package/dist/_chunks/{EditViewPage-BbY0bNNE.js → EditViewPage-wujOq90c.js} +38 -9
  17. package/dist/_chunks/EditViewPage-wujOq90c.js.map +1 -0
  18. package/dist/_chunks/{Field-CglKum3X.js → Field-B5QXnctJ.js} +152 -73
  19. package/dist/_chunks/Field-B5QXnctJ.js.map +1 -0
  20. package/dist/_chunks/{Field-DVZSGAon.mjs → Field-Byr3mPTl.mjs} +150 -71
  21. package/dist/_chunks/Field-Byr3mPTl.mjs.map +1 -0
  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-BQwxPqu3.mjs → Form-BZgvE8C8.mjs} +3 -3
  25. package/dist/_chunks/{Form-BQwxPqu3.mjs.map → Form-BZgvE8C8.mjs.map} +1 -1
  26. package/dist/_chunks/{Form-B7nYNIUm.js → Form-D7mexvm3.js} +5 -6
  27. package/dist/_chunks/{Form-B7nYNIUm.js.map → Form-D7mexvm3.js.map} +1 -1
  28. package/dist/_chunks/{History-Bmu6tx6s.mjs → History-CqNgxkqK.mjs} +23 -93
  29. package/dist/_chunks/History-CqNgxkqK.mjs.map +1 -0
  30. package/dist/_chunks/{History-3JN4BIS1.js → History-DYl2A8Z_.js} +23 -94
  31. package/dist/_chunks/History-DYl2A8Z_.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-BcC28SV0.js → ListConfigurationPage-BXnu_OoY.js} +7 -7
  33. package/dist/_chunks/ListConfigurationPage-BXnu_OoY.js.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-DwijcJ17.mjs → ListConfigurationPage-BbQjzKkQ.mjs} +7 -6
  35. package/dist/_chunks/ListConfigurationPage-BbQjzKkQ.mjs.map +1 -0
  36. package/dist/_chunks/{ListViewPage-ZPNQ6jWC.js → ListViewPage-BtSi8C1l.js} +63 -41
  37. package/dist/_chunks/ListViewPage-BtSi8C1l.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-DzhuS3CW.mjs → ListViewPage-D4ofkbjR.mjs} +62 -39
  39. package/dist/_chunks/ListViewPage-D4ofkbjR.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-DzwJNXvn.js → NoContentTypePage-CitJeOq4.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-DzwJNXvn.js.map → NoContentTypePage-CitJeOq4.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-BKMgOyd3.mjs → NoContentTypePage-DyUx5mXh.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-BKMgOyd3.mjs.map → NoContentTypePage-DyUx5mXh.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-DBbGJqL9.mjs → NoPermissionsPage-DhIiyWkk.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-DBbGJqL9.mjs.map → NoPermissionsPage-DhIiyWkk.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-GaweP-NG.js → NoPermissionsPage-DzgWz0M-.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-GaweP-NG.js.map → NoPermissionsPage-DzgWz0M-.js.map} +1 -1
  48. package/dist/_chunks/Preview-BaYGJ0nb.mjs +293 -0
  49. package/dist/_chunks/Preview-BaYGJ0nb.mjs.map +1 -0
  50. package/dist/_chunks/Preview-DfNx8Ke-.js +311 -0
  51. package/dist/_chunks/Preview-DfNx8Ke-.js.map +1 -0
  52. package/dist/_chunks/{Relations-B7VtRA3g.mjs → Relations-DM2yUTST.mjs} +47 -23
  53. package/dist/_chunks/Relations-DM2yUTST.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-BHXq_cKF.js → Relations-DuKCaXrv.js} +47 -24
  55. package/dist/_chunks/Relations-DuKCaXrv.js.map +1 -0
  56. package/dist/_chunks/{en-Bm0D0IWz.js → en-BK8Xyl5I.js} +16 -4
  57. package/dist/_chunks/{en-Bm0D0IWz.js.map → en-BK8Xyl5I.js.map} +1 -1
  58. package/dist/_chunks/{en-DKV44jRb.mjs → en-Dtk_ot79.mjs} +16 -4
  59. package/dist/_chunks/{en-DKV44jRb.mjs.map → en-Dtk_ot79.mjs.map} +1 -1
  60. package/dist/_chunks/{es-EUonQTon.js → es-9K52xZIr.js} +2 -2
  61. package/dist/_chunks/{ja-CcFe8diO.js.map → es-9K52xZIr.js.map} +1 -1
  62. package/dist/_chunks/{es-CeXiYflN.mjs → es-D34tqjMw.mjs} +2 -2
  63. package/dist/_chunks/{es-CeXiYflN.mjs.map → es-D34tqjMw.mjs.map} +1 -1
  64. package/dist/_chunks/{fr-CD9VFbPM.mjs → fr--pg5jUbt.mjs} +13 -3
  65. package/dist/_chunks/{fr-CD9VFbPM.mjs.map → fr--pg5jUbt.mjs.map} +1 -1
  66. package/dist/_chunks/{fr-B7kGGg3E.js → fr-B2Kyv8Z9.js} +13 -3
  67. package/dist/_chunks/{fr-B7kGGg3E.js.map → fr-B2Kyv8Z9.js.map} +1 -1
  68. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  69. package/dist/_chunks/{index-DcA8_tJw.js → index-BUWEmX8m.js} +349 -212
  70. package/dist/_chunks/index-BUWEmX8m.js.map +1 -0
  71. package/dist/_chunks/{index-TaRzG09p.mjs → index-DVAIIsOs.mjs} +351 -214
  72. package/dist/_chunks/index-DVAIIsOs.mjs.map +1 -0
  73. package/dist/_chunks/{ja-CcFe8diO.js → ja-7sfIbjxE.js} +2 -2
  74. package/dist/_chunks/{es-EUonQTon.js.map → ja-7sfIbjxE.js.map} +1 -1
  75. package/dist/_chunks/{ja-CtsUxOvk.mjs → ja-BHqhDq4V.mjs} +2 -2
  76. package/dist/_chunks/{ja-CtsUxOvk.mjs.map → ja-BHqhDq4V.mjs.map} +1 -1
  77. package/dist/_chunks/{layout-aX-RJhd5.mjs → layout-Bxsv5mP7.mjs} +4 -4
  78. package/dist/_chunks/{layout-aX-RJhd5.mjs.map → layout-Bxsv5mP7.mjs.map} +1 -1
  79. package/dist/_chunks/{layout-CrgXpOxT.js → layout-C3fN7Ejz.js} +5 -6
  80. package/dist/_chunks/{layout-CrgXpOxT.js.map → layout-C3fN7Ejz.js.map} +1 -1
  81. package/dist/_chunks/{objects-gigeqt7s.js → objects-BcXOv6_9.js} +2 -4
  82. package/dist/_chunks/{objects-gigeqt7s.js.map → objects-BcXOv6_9.js.map} +1 -1
  83. package/dist/_chunks/{objects-mKMAmfec.mjs → objects-D6yBsdmx.mjs} +2 -4
  84. package/dist/_chunks/{objects-mKMAmfec.mjs.map → objects-D6yBsdmx.mjs.map} +1 -1
  85. package/dist/_chunks/{relations-Z6RA1sBS.js → relations-BPZKAoEY.js} +6 -7
  86. package/dist/_chunks/relations-BPZKAoEY.js.map +1 -0
  87. package/dist/_chunks/{relations-D3Hlx6QX.mjs → relations-o3pPhzY4.mjs} +6 -7
  88. package/dist/_chunks/relations-o3pPhzY4.mjs.map +1 -0
  89. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -1
  90. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -1
  91. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  92. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  93. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  94. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  95. package/dist/admin/index.js +1 -1
  96. package/dist/admin/index.mjs +4 -4
  97. package/dist/admin/src/content-manager.d.ts +3 -2
  98. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  99. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  100. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +2 -2
  101. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  102. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  103. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  104. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  105. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  106. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  107. package/dist/admin/src/preview/index.d.ts +4 -0
  108. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  109. package/dist/admin/src/preview/routes.d.ts +3 -0
  110. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  111. package/dist/admin/src/router.d.ts +1 -1
  112. package/dist/admin/src/services/documents.d.ts +0 -3
  113. package/dist/server/index.js +405 -180
  114. package/dist/server/index.js.map +1 -1
  115. package/dist/server/index.mjs +405 -179
  116. package/dist/server/index.mjs.map +1 -1
  117. package/dist/server/src/bootstrap.d.ts.map +1 -1
  118. package/dist/server/src/controllers/index.d.ts.map +1 -1
  119. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  120. package/dist/server/src/controllers/utils/metadata.d.ts +15 -1
  121. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  122. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  123. package/dist/server/src/history/services/utils.d.ts +2 -3
  124. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  125. package/dist/server/src/index.d.ts +4 -4
  126. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  127. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  128. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  129. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  130. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  131. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  132. package/dist/server/src/preview/index.d.ts +4 -0
  133. package/dist/server/src/preview/index.d.ts.map +1 -0
  134. package/dist/server/src/preview/routes/index.d.ts +8 -0
  135. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  136. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  137. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  138. package/dist/server/src/preview/services/index.d.ts +16 -0
  139. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  140. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  141. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  142. package/dist/server/src/preview/services/preview.d.ts +12 -0
  143. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  144. package/dist/server/src/preview/utils.d.ts +19 -0
  145. package/dist/server/src/preview/utils.d.ts.map +1 -0
  146. package/dist/server/src/register.d.ts.map +1 -1
  147. package/dist/server/src/routes/index.d.ts.map +1 -1
  148. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  149. package/dist/server/src/services/document-metadata.d.ts +8 -8
  150. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  151. package/dist/server/src/services/index.d.ts +4 -4
  152. package/dist/server/src/services/index.d.ts.map +1 -1
  153. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  154. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  155. package/dist/server/src/utils/index.d.ts +2 -0
  156. package/dist/server/src/utils/index.d.ts.map +1 -1
  157. package/dist/shared/contracts/index.d.ts +1 -0
  158. package/dist/shared/contracts/index.d.ts.map +1 -1
  159. package/dist/shared/contracts/preview.d.ts +27 -0
  160. package/dist/shared/contracts/preview.d.ts.map +1 -0
  161. package/dist/shared/index.js +4 -0
  162. package/dist/shared/index.js.map +1 -1
  163. package/dist/shared/index.mjs +4 -0
  164. package/dist/shared/index.mjs.map +1 -1
  165. package/package.json +13 -11
  166. package/dist/_chunks/EditViewPage-BbY0bNNE.js.map +0 -1
  167. package/dist/_chunks/EditViewPage-Dx0QnTxn.mjs.map +0 -1
  168. package/dist/_chunks/Field-CglKum3X.js.map +0 -1
  169. package/dist/_chunks/Field-DVZSGAon.mjs.map +0 -1
  170. package/dist/_chunks/History-3JN4BIS1.js.map +0 -1
  171. package/dist/_chunks/History-Bmu6tx6s.mjs.map +0 -1
  172. package/dist/_chunks/ListConfigurationPage-BcC28SV0.js.map +0 -1
  173. package/dist/_chunks/ListConfigurationPage-DwijcJ17.mjs.map +0 -1
  174. package/dist/_chunks/ListViewPage-DzhuS3CW.mjs.map +0 -1
  175. package/dist/_chunks/ListViewPage-ZPNQ6jWC.js.map +0 -1
  176. package/dist/_chunks/Relations-B7VtRA3g.mjs.map +0 -1
  177. package/dist/_chunks/Relations-BHXq_cKF.js.map +0 -1
  178. package/dist/_chunks/index-DcA8_tJw.js.map +0 -1
  179. package/dist/_chunks/index-TaRzG09p.mjs.map +0 -1
  180. package/dist/_chunks/relations-D3Hlx6QX.mjs.map +0 -1
  181. package/dist/_chunks/relations-Z6RA1sBS.js.map +0 -1
@@ -4,18 +4,18 @@ const jsxRuntime = require("react/jsx-runtime");
4
4
  const strapiAdmin = require("@strapi/admin/strapi-admin");
5
5
  const React = require("react");
6
6
  const designSystem = require("@strapi/design-system");
7
+ const mapValues = require("lodash/fp/mapValues");
7
8
  const reactIntl = require("react-intl");
8
9
  const reactRouterDom = require("react-router-dom");
10
+ const styledComponents = require("styled-components");
9
11
  const yup = require("yup");
12
+ const qs = require("qs");
10
13
  const pipe = require("lodash/fp/pipe");
11
14
  const dateFns = require("date-fns");
12
- const styledComponents = require("styled-components");
13
- const qs = require("qs");
14
15
  const toolkit = require("@reduxjs/toolkit");
15
16
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
16
17
  function _interopNamespace(e) {
17
- if (e && e.__esModule)
18
- return e;
18
+ if (e && e.__esModule) return e;
19
19
  const n = Object.create(null, { [Symbol.toStringTag]: { value: "Module" } });
20
20
  if (e) {
21
21
  for (const k in e) {
@@ -32,15 +32,23 @@ function _interopNamespace(e) {
32
32
  return Object.freeze(n);
33
33
  }
34
34
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
35
+ const mapValues__default = /* @__PURE__ */ _interopDefault(mapValues);
35
36
  const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
36
37
  const pipe__default = /* @__PURE__ */ _interopDefault(pipe);
37
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
38
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
38
39
  const v = glob[path];
39
40
  if (v) {
40
41
  return typeof v === "function" ? v() : Promise.resolve(v);
41
42
  }
42
43
  return new Promise((_, reject) => {
43
- (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
+ );
44
52
  });
45
53
  };
46
54
  const PLUGIN_ID = "content-manager";
@@ -294,7 +302,7 @@ const documentApi = contentManagerApi.injectEndpoints({
294
302
  url: `/content-manager/collection-types/${model}`,
295
303
  method: "GET",
296
304
  config: {
297
- params
305
+ params: qs.stringify(params, { encode: true })
298
306
  }
299
307
  }),
300
308
  providesTags: (result, _error, arg) => {
@@ -473,8 +481,7 @@ const {
473
481
  useUnpublishManyDocumentsMutation
474
482
  } = documentApi;
475
483
  const buildValidParams = (query) => {
476
- if (!query)
477
- return query;
484
+ if (!query) return query;
478
485
  const { plugins: _, ...validQueryParams } = {
479
486
  ...query,
480
487
  ...Object.values(query?.plugins ?? {}).reduce(
@@ -482,9 +489,6 @@ const buildValidParams = (query) => {
482
489
  {}
483
490
  )
484
491
  };
485
- if ("_q" in validQueryParams) {
486
- validQueryParams._q = encodeURIComponent(validQueryParams._q);
487
- }
488
492
  return validQueryParams;
489
493
  };
490
494
  const isBaseQueryError = (error) => {
@@ -989,9 +993,10 @@ const formatEditLayout = (data, {
989
993
  currentPanelIndex += 2;
990
994
  } else {
991
995
  if (!panels[currentPanelIndex]) {
992
- panels.push([]);
996
+ panels.push([row]);
997
+ } else {
998
+ panels[currentPanelIndex].push(row);
993
999
  }
994
- panels[currentPanelIndex].push(row);
995
1000
  }
996
1001
  return panels;
997
1002
  }, []);
@@ -1249,9 +1254,6 @@ const useContentManagerContext = () => {
1249
1254
  };
1250
1255
  };
1251
1256
  const prefixPluginTranslations = (trad, pluginId) => {
1252
- if (!pluginId) {
1253
- throw new TypeError("pluginId can't be empty");
1254
- }
1255
1257
  return Object.keys(trad).reduce((acc, current) => {
1256
1258
  acc[`${pluginId}.${current}`] = trad[current];
1257
1259
  return acc;
@@ -1685,10 +1687,10 @@ const useDocumentActions = () => {
1685
1687
  update
1686
1688
  };
1687
1689
  };
1688
- const ProtectedHistoryPage = React.lazy(
1689
- () => Promise.resolve().then(() => require("./History-3JN4BIS1.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1690
+ const ProtectedHistoryPage = React__namespace.lazy(
1691
+ () => Promise.resolve().then(() => require("./History-DYl2A8Z_.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1690
1692
  );
1691
- const routes$1 = [
1693
+ const routes$2 = [
1692
1694
  {
1693
1695
  path: ":collectionType/:slug/:id/history",
1694
1696
  Component: ProtectedHistoryPage
@@ -1698,32 +1700,45 @@ const routes$1 = [
1698
1700
  Component: ProtectedHistoryPage
1699
1701
  }
1700
1702
  ];
1703
+ const ProtectedPreviewPage = React__namespace.lazy(
1704
+ () => Promise.resolve().then(() => require("./Preview-DfNx8Ke-.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
1705
+ );
1706
+ const routes$1 = [
1707
+ {
1708
+ path: ":collectionType/:slug/:id/preview",
1709
+ Component: ProtectedPreviewPage
1710
+ },
1711
+ {
1712
+ path: ":collectionType/:slug/preview",
1713
+ Component: ProtectedPreviewPage
1714
+ }
1715
+ ];
1701
1716
  const ProtectedEditViewPage = React.lazy(
1702
- () => Promise.resolve().then(() => require("./EditViewPage-BbY0bNNE.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1717
+ () => Promise.resolve().then(() => require("./EditViewPage-wujOq90c.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1703
1718
  );
1704
1719
  const ProtectedListViewPage = React.lazy(
1705
- () => Promise.resolve().then(() => require("./ListViewPage-ZPNQ6jWC.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1720
+ () => Promise.resolve().then(() => require("./ListViewPage-BtSi8C1l.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1706
1721
  );
1707
1722
  const ProtectedListConfiguration = React.lazy(
1708
- () => Promise.resolve().then(() => require("./ListConfigurationPage-BcC28SV0.js")).then((mod) => ({
1723
+ () => Promise.resolve().then(() => require("./ListConfigurationPage-BXnu_OoY.js")).then((mod) => ({
1709
1724
  default: mod.ProtectedListConfiguration
1710
1725
  }))
1711
1726
  );
1712
1727
  const ProtectedEditConfigurationPage = React.lazy(
1713
- () => Promise.resolve().then(() => require("./EditConfigurationPage-BrG0mEfF.js")).then((mod) => ({
1728
+ () => Promise.resolve().then(() => require("./EditConfigurationPage-z39Wv3E6.js")).then((mod) => ({
1714
1729
  default: mod.ProtectedEditConfigurationPage
1715
1730
  }))
1716
1731
  );
1717
1732
  const ProtectedComponentConfigurationPage = React.lazy(
1718
- () => Promise.resolve().then(() => require("./ComponentConfigurationPage-DNRPa10q.js")).then((mod) => ({
1733
+ () => Promise.resolve().then(() => require("./ComponentConfigurationPage-BTR_hQow.js")).then((mod) => ({
1719
1734
  default: mod.ProtectedComponentConfigurationPage
1720
1735
  }))
1721
1736
  );
1722
1737
  const NoPermissions = React.lazy(
1723
- () => Promise.resolve().then(() => require("./NoPermissionsPage-GaweP-NG.js")).then((mod) => ({ default: mod.NoPermissions }))
1738
+ () => Promise.resolve().then(() => require("./NoPermissionsPage-DzgWz0M-.js")).then((mod) => ({ default: mod.NoPermissions }))
1724
1739
  );
1725
1740
  const NoContentType = React.lazy(
1726
- () => Promise.resolve().then(() => require("./NoContentTypePage-DzwJNXvn.js")).then((mod) => ({ default: mod.NoContentType }))
1741
+ () => Promise.resolve().then(() => require("./NoContentTypePage-CitJeOq4.js")).then((mod) => ({ default: mod.NoContentType }))
1727
1742
  );
1728
1743
  const CollectionTypePages = () => {
1729
1744
  const { collectionType } = reactRouterDom.useParams();
@@ -1735,7 +1750,7 @@ const CollectionTypePages = () => {
1735
1750
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1736
1751
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1737
1752
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1738
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1753
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1739
1754
  const routes = [
1740
1755
  {
1741
1756
  path: LIST_RELATIVE_PATH,
@@ -1769,6 +1784,7 @@ const routes = [
1769
1784
  path: "no-content-types",
1770
1785
  Component: NoContentType
1771
1786
  },
1787
+ ...routes$2,
1772
1788
  ...routes$1
1773
1789
  ];
1774
1790
  const DocumentActions = ({ actions: actions2 }) => {
@@ -1867,6 +1883,11 @@ const DocumentActionButton = (action) => {
1867
1883
  ) : null
1868
1884
  ] });
1869
1885
  };
1886
+ const MenuItem = styledComponents.styled(designSystem.Menu.Item)`
1887
+ &:hover {
1888
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
1889
+ }
1890
+ `;
1870
1891
  const DocumentActionsMenu = ({
1871
1892
  actions: actions2,
1872
1893
  children,
@@ -1925,48 +1946,32 @@ const DocumentActionsMenu = ({
1925
1946
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1926
1947
  actions2.map((action) => {
1927
1948
  return /* @__PURE__ */ jsxRuntime.jsx(
1928
- designSystem.Menu.Item,
1949
+ MenuItem,
1929
1950
  {
1930
1951
  disabled: action.disabled,
1931
1952
  onSelect: handleClick(action),
1932
1953
  display: "block",
1933
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: [
1934
- /* @__PURE__ */ jsxRuntime.jsxs(
1935
- designSystem.Flex,
1936
- {
1937
- color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1938
- gap: 2,
1939
- tag: "span",
1940
- children: [
1941
- /* @__PURE__ */ jsxRuntime.jsx(
1942
- designSystem.Flex,
1943
- {
1944
- tag: "span",
1945
- color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1946
- children: action.icon
1947
- }
1948
- ),
1949
- action.label
1950
- ]
1951
- }
1952
- ),
1953
- action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsxRuntime.jsx(
1954
- designSystem.Flex,
1955
- {
1956
- alignItems: "center",
1957
- background: "alternative100",
1958
- borderStyle: "solid",
1959
- borderColor: "alternative200",
1960
- borderWidth: "1px",
1961
- height: 5,
1962
- paddingLeft: 2,
1963
- paddingRight: 2,
1964
- hasRadius: true,
1965
- color: "alternative600",
1966
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
1967
- }
1968
- )
1969
- ] })
1954
+ isVariantDanger: action.variant === "danger",
1955
+ isDisabled: action.disabled,
1956
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(
1957
+ designSystem.Flex,
1958
+ {
1959
+ color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1960
+ gap: 2,
1961
+ tag: "span",
1962
+ children: [
1963
+ /* @__PURE__ */ jsxRuntime.jsx(
1964
+ designSystem.Flex,
1965
+ {
1966
+ tag: "span",
1967
+ color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1968
+ children: action.icon
1969
+ }
1970
+ ),
1971
+ action.label
1972
+ ]
1973
+ }
1974
+ ) })
1970
1975
  },
1971
1976
  action.id
1972
1977
  );
@@ -2077,6 +2082,18 @@ const DocumentActionModal = ({
2077
2082
  typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer
2078
2083
  ] }) });
2079
2084
  };
2085
+ const transformData = (data) => {
2086
+ if (Array.isArray(data)) {
2087
+ return data.map(transformData);
2088
+ }
2089
+ if (typeof data === "object" && data !== null) {
2090
+ if ("apiData" in data) {
2091
+ return data.apiData;
2092
+ }
2093
+ return mapValues__default.default(transformData)(data);
2094
+ }
2095
+ return data;
2096
+ };
2080
2097
  const PublishAction$1 = ({
2081
2098
  activeTab,
2082
2099
  documentId,
@@ -2091,6 +2108,7 @@ const PublishAction$1 = ({
2091
2108
  const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
2092
2109
  const isListView = reactRouterDom.useMatch(LIST_PATH) !== null;
2093
2110
  const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
2111
+ const { id } = reactRouterDom.useParams();
2094
2112
  const { formatMessage } = reactIntl.useIntl();
2095
2113
  const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
2096
2114
  const { publish } = useDocumentActions();
@@ -2190,13 +2208,15 @@ const PublishAction$1 = ({
2190
2208
  documentId,
2191
2209
  params
2192
2210
  },
2193
- formDocumentToData(formValues)
2211
+ transformData(formValues)
2194
2212
  );
2195
2213
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2196
- navigate({
2197
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2198
- search: rawQuery
2199
- });
2214
+ if (id === "create") {
2215
+ navigate({
2216
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2217
+ search: rawQuery
2218
+ });
2219
+ }
2200
2220
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2201
2221
  setErrors(formatValidationErrors(res.error));
2202
2222
  }
@@ -2249,36 +2269,7 @@ const PublishAction$1 = ({
2249
2269
  };
2250
2270
  };
2251
2271
  PublishAction$1.type = "publish";
2252
- const formDocumentToData = (document) => {
2253
- return Object.keys(document).reduce((acc, key) => {
2254
- if (document[key] !== void 0) {
2255
- acc[key] = document[key];
2256
- }
2257
- if (typeof document[key] === "object" && document[key] !== null) {
2258
- if ("connect" in document[key] && document[key].connect !== null) {
2259
- acc[key] = {
2260
- ...acc[key],
2261
- connect: document[key].connect.map((item) => {
2262
- return {
2263
- documentId: item.documentId
2264
- };
2265
- })
2266
- };
2267
- }
2268
- if ("disconnect" in document[key] && document[key].disconnect !== null) {
2269
- acc[key] = {
2270
- ...acc[key],
2271
- disconnect: document[key].disconnect.map((item) => {
2272
- return {
2273
- documentId: item.documentId
2274
- };
2275
- })
2276
- };
2277
- }
2278
- }
2279
- return acc;
2280
- }, {});
2281
- };
2272
+ PublishAction$1.position = "panel";
2282
2273
  const UpdateAction = ({
2283
2274
  activeTab,
2284
2275
  documentId,
@@ -2301,96 +2292,134 @@ const UpdateAction = ({
2301
2292
  const validate = strapiAdmin.useForm("UpdateAction", (state) => state.validate);
2302
2293
  const setErrors = strapiAdmin.useForm("UpdateAction", (state) => state.setErrors);
2303
2294
  const resetForm = strapiAdmin.useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
2304
- return {
2305
- /**
2306
- * Disabled when:
2307
- * - the form is submitting
2308
- * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2309
- * - the active tab is the published tab
2310
- */
2311
- disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2312
- label: formatMessage({
2313
- id: "content-manager.containers.Edit.save",
2314
- defaultMessage: "Save"
2315
- }),
2316
- onClick: async () => {
2317
- setSubmitting(true);
2318
- try {
2319
- const { errors } = await validate(true, {
2320
- status: "draft"
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
+ })
2321
2311
  });
2322
- if (errors) {
2323
- toggleNotification({
2324
- type: "danger",
2325
- message: formatMessage({
2326
- id: "content-manager.validation.error",
2327
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
2328
- })
2329
- });
2330
- return;
2331
- }
2332
- if (isCloning) {
2333
- const res = await clone(
2334
- {
2335
- model,
2336
- documentId: cloneMatch.params.origin,
2337
- params
2338
- },
2339
- formDocumentToData(document)
2340
- );
2341
- if ("data" in res) {
2342
- navigate(
2343
- {
2344
- pathname: `../${res.data.documentId}`,
2345
- search: rawQuery
2346
- },
2347
- { relative: "path" }
2348
- );
2349
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2350
- setErrors(formatValidationErrors(res.error));
2351
- }
2352
- } else if (documentId || collectionType === SINGLE_TYPES) {
2353
- const res = await update(
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(
2354
2325
  {
2355
- collectionType,
2356
- model,
2357
- documentId,
2358
- params
2326
+ pathname: `../${res.data.documentId}`,
2327
+ search: rawQuery
2359
2328
  },
2360
- formDocumentToData(document)
2329
+ { relative: "path" }
2361
2330
  );
2362
- if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2363
- setErrors(formatValidationErrors(res.error));
2364
- } else {
2365
- resetForm();
2366
- }
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));
2367
2346
  } else {
2368
- const res = await create(
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(
2369
2359
  {
2370
- model,
2371
- params
2360
+ pathname: `../${res.data.documentId}`,
2361
+ search: rawQuery
2372
2362
  },
2373
- formDocumentToData(document)
2363
+ { replace: true, relative: "path" }
2374
2364
  );
2375
- if ("data" in res && collectionType !== SINGLE_TYPES) {
2376
- navigate(
2377
- {
2378
- pathname: `../${res.data.documentId}`,
2379
- search: rawQuery
2380
- },
2381
- { replace: true, relative: "path" }
2382
- );
2383
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2384
- setErrors(formatValidationErrors(res.error));
2385
- }
2365
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2366
+ setErrors(formatValidationErrors(res.error));
2386
2367
  }
2387
- } finally {
2388
- setSubmitting(false);
2389
2368
  }
2369
+ } finally {
2370
+ setSubmitting(false);
2390
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]);
2406
+ return {
2407
+ /**
2408
+ * Disabled when:
2409
+ * - the form is submitting
2410
+ * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2411
+ * - the active tab is the published tab
2412
+ */
2413
+ disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2414
+ label: formatMessage({
2415
+ id: "global.save",
2416
+ defaultMessage: "Save"
2417
+ }),
2418
+ onClick: handleUpdate
2391
2419
  };
2392
2420
  };
2393
2421
  UpdateAction.type = "update";
2422
+ UpdateAction.position = "panel";
2394
2423
  const UNPUBLISH_DRAFT_OPTIONS = {
2395
2424
  KEEP: "keep",
2396
2425
  DISCARD: "discard"
@@ -2513,6 +2542,7 @@ const UnpublishAction$1 = ({
2513
2542
  };
2514
2543
  };
2515
2544
  UnpublishAction$1.type = "unpublish";
2545
+ UnpublishAction$1.position = "panel";
2516
2546
  const DiscardAction = ({
2517
2547
  activeTab,
2518
2548
  documentId,
@@ -2563,6 +2593,7 @@ const DiscardAction = ({
2563
2593
  };
2564
2594
  };
2565
2595
  DiscardAction.type = "discard";
2596
+ DiscardAction.position = "panel";
2566
2597
  const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
2567
2598
  const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
2568
2599
  const RelativeTime = React__namespace.forwardRef(
@@ -2575,7 +2606,7 @@ const RelativeTime = React__namespace.forwardRef(
2575
2606
  });
2576
2607
  const unit = intervals.find((intervalUnit) => {
2577
2608
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2578
- });
2609
+ }) ?? "seconds";
2579
2610
  const relativeTime = dateFns.isPast(timestamp) ? -interval[unit] : interval[unit];
2580
2611
  const customInterval = customIntervals.find(
2581
2612
  (custom) => interval[custom.unit] < custom.threshold
@@ -2609,19 +2640,29 @@ const getDisplayName = ({
2609
2640
  return email ?? "";
2610
2641
  };
2611
2642
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2612
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2643
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2613
2644
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2614
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: capitalise(status) }) });
2645
+ const { formatMessage } = reactIntl.useIntl();
2646
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
2647
+ id: `content-manager.containers.List.${status}`,
2648
+ defaultMessage: capitalise(status)
2649
+ }) }) });
2615
2650
  };
2616
2651
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2617
2652
  const { formatMessage } = reactIntl.useIntl();
2618
2653
  const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
2654
+ const params = reactRouterDom.useParams();
2619
2655
  const title = isCreating ? formatMessage({
2620
2656
  id: "content-manager.containers.edit.title.new",
2621
2657
  defaultMessage: "Create an entry"
2622
2658
  }) : documentTitle;
2623
2659
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2624
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
2660
+ /* @__PURE__ */ jsxRuntime.jsx(
2661
+ strapiAdmin.BackButton,
2662
+ {
2663
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2664
+ }
2665
+ ),
2625
2666
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2626
2667
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: title }),
2627
2668
  /* @__PURE__ */ jsxRuntime.jsx(HeaderToolbar, {})
@@ -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
  ),
@@ -3058,7 +3102,7 @@ const Panel = React__namespace.forwardRef(({ children, title }, ref) => {
3058
3102
  justifyContent: "stretch",
3059
3103
  alignItems: "flex-start",
3060
3104
  children: [
3061
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", children: title }),
3105
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", textColor: "neutral600", children: title }),
3062
3106
  children
3063
3107
  ]
3064
3108
  }
@@ -3308,18 +3352,10 @@ const SelectedEntriesTableContent = ({
3308
3352
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3309
3353
  },
3310
3354
  state: { from: pathname },
3311
- label: formatMessage(
3312
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3313
- {
3314
- target: formatMessage(
3315
- {
3316
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3317
- defaultMessage: "item line {number}"
3318
- },
3319
- { number: index2 + 1 }
3320
- )
3321
- }
3322
- ),
3355
+ label: formatMessage({
3356
+ id: "content-manager.bulk-publish.edit",
3357
+ defaultMessage: "Edit"
3358
+ }),
3323
3359
  target: "_blank",
3324
3360
  marginLeft: "auto",
3325
3361
  variant: "ghost",
@@ -3493,8 +3529,7 @@ const PublishAction = ({ documents, model }) => {
3493
3529
  const refetchList = () => {
3494
3530
  contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
3495
3531
  };
3496
- if (!showPublishButton)
3497
- return null;
3532
+ if (!showPublishButton) return null;
3498
3533
  return {
3499
3534
  actionType: "publish",
3500
3535
  variant: "tertiary",
@@ -3562,8 +3597,7 @@ const DeleteAction = ({ documents, model }) => {
3562
3597
  selectRow([]);
3563
3598
  }
3564
3599
  };
3565
- if (!hasDeletePermission)
3566
- return null;
3600
+ if (!hasDeletePermission) return null;
3567
3601
  return {
3568
3602
  variant: "danger-light",
3569
3603
  label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
@@ -3612,8 +3646,7 @@ const UnpublishAction = ({ documents, model }) => {
3612
3646
  }
3613
3647
  };
3614
3648
  const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
3615
- if (!showUnpublishButton)
3616
- return null;
3649
+ if (!showUnpublishButton) return null;
3617
3650
  return {
3618
3651
  variant: "tertiary",
3619
3652
  label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
@@ -3718,7 +3751,7 @@ const TableActions = ({ document }) => {
3718
3751
  strapiAdmin.DescriptionComponentRenderer,
3719
3752
  {
3720
3753
  props,
3721
- 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"),
3722
3755
  children: (actions2) => {
3723
3756
  const tableRowActions = actions2.filter((action) => {
3724
3757
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -3777,6 +3810,7 @@ const EditAction = ({ documentId }) => {
3777
3810
  };
3778
3811
  };
3779
3812
  EditAction.type = "edit";
3813
+ EditAction.position = "table-row";
3780
3814
  const StyledPencil = styledComponents.styled(Icons.Pencil)`
3781
3815
  path {
3782
3816
  fill: currentColor;
@@ -3853,6 +3887,7 @@ const CloneAction = ({ model, documentId }) => {
3853
3887
  };
3854
3888
  };
3855
3889
  CloneAction.type = "clone";
3890
+ CloneAction.position = "table-row";
3856
3891
  const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
3857
3892
  path {
3858
3893
  fill: currentColor;
@@ -3939,7 +3974,14 @@ class ContentManagerPlugin {
3939
3974
  addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
3940
3975
  addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
3941
3976
  getBulkActions: () => this.bulkActions,
3942
- 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
+ },
3943
3985
  getEditViewSidePanels: () => this.editViewSidePanels,
3944
3986
  getHeaderActions: () => this.headerActions
3945
3987
  }
@@ -3949,10 +3991,8 @@ class ContentManagerPlugin {
3949
3991
  const getPrintableType = (value) => {
3950
3992
  const nativeType = typeof value;
3951
3993
  if (nativeType === "object") {
3952
- if (value === null)
3953
- return "null";
3954
- if (Array.isArray(value))
3955
- return "array";
3994
+ if (value === null) return "null";
3995
+ if (Array.isArray(value)) return "array";
3956
3996
  if (value instanceof Object && value.constructor.name !== "Object") {
3957
3997
  return value.constructor.name;
3958
3998
  }
@@ -3963,17 +4003,27 @@ const HistoryAction = ({ model, document }) => {
3963
4003
  const { formatMessage } = reactIntl.useIntl();
3964
4004
  const [{ query }] = strapiAdmin.useQueryParams();
3965
4005
  const navigate = reactRouterDom.useNavigate();
4006
+ const { trackUsage } = strapiAdmin.useTracking();
4007
+ const { pathname } = reactRouterDom.useLocation();
3966
4008
  const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
3967
4009
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3968
4010
  return null;
3969
4011
  }
4012
+ const handleOnClick = () => {
4013
+ const destination = { pathname: "history", search: pluginsQueryParams };
4014
+ trackUsage("willNavigate", {
4015
+ from: pathname,
4016
+ to: `${pathname}/${destination.pathname}`
4017
+ });
4018
+ navigate(destination);
4019
+ };
3970
4020
  return {
3971
4021
  icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
3972
4022
  label: formatMessage({
3973
4023
  id: "content-manager.history.document-action",
3974
4024
  defaultMessage: "Content History"
3975
4025
  }),
3976
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
4026
+ onClick: handleOnClick,
3977
4027
  disabled: (
3978
4028
  /**
3979
4029
  * The user is creating a new document.
@@ -3995,6 +4045,7 @@ const HistoryAction = ({ model, document }) => {
3995
4045
  };
3996
4046
  };
3997
4047
  HistoryAction.type = "history";
4048
+ HistoryAction.position = "header";
3998
4049
  const historyAdmin = {
3999
4050
  bootstrap(app) {
4000
4051
  const { addDocumentAction } = app.getPlugin("content-manager").apis;
@@ -4041,6 +4092,88 @@ const { setInitialData } = actions;
4041
4092
  const reducer = toolkit.combineReducers({
4042
4093
  app: reducer$1
4043
4094
  });
4095
+ const previewApi = contentManagerApi.injectEndpoints({
4096
+ endpoints: (builder) => ({
4097
+ getPreviewUrl: builder.query({
4098
+ query({ query, params }) {
4099
+ return {
4100
+ url: `/content-manager/preview/url/${params.contentType}`,
4101
+ method: "GET",
4102
+ config: {
4103
+ params: query
4104
+ }
4105
+ };
4106
+ }
4107
+ })
4108
+ })
4109
+ });
4110
+ const { useGetPreviewUrlQuery } = previewApi;
4111
+ const ConditionalTooltip = ({ isShown, label, children }) => {
4112
+ if (isShown) {
4113
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label, children });
4114
+ }
4115
+ return children;
4116
+ };
4117
+ const PreviewSidePanel = ({ model, documentId, document }) => {
4118
+ const { formatMessage } = reactIntl.useIntl();
4119
+ const { trackUsage } = strapiAdmin.useTracking();
4120
+ const { pathname } = reactRouterDom.useLocation();
4121
+ const [{ query }] = strapiAdmin.useQueryParams();
4122
+ const isModified = strapiAdmin.useForm("PreviewSidePanel", (state) => state.modified);
4123
+ const { data, error } = useGetPreviewUrlQuery({
4124
+ params: {
4125
+ contentType: model
4126
+ },
4127
+ query: {
4128
+ documentId,
4129
+ locale: document?.locale,
4130
+ status: document?.status
4131
+ }
4132
+ });
4133
+ if (!data?.data?.url || error) {
4134
+ return null;
4135
+ }
4136
+ const trackNavigation = () => {
4137
+ const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
4138
+ trackUsage("willNavigate", { from: pathname, to: destinationPathname });
4139
+ };
4140
+ return {
4141
+ title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4142
+ content: /* @__PURE__ */ jsxRuntime.jsx(
4143
+ ConditionalTooltip,
4144
+ {
4145
+ label: formatMessage({
4146
+ id: "content-manager.preview.panel.button-disabled-tooltip",
4147
+ defaultMessage: "Please save to open the preview"
4148
+ }),
4149
+ isShown: isModified,
4150
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
4151
+ designSystem.Button,
4152
+ {
4153
+ variant: "tertiary",
4154
+ tag: reactRouterDom.Link,
4155
+ to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
4156
+ onClick: trackNavigation,
4157
+ width: "100%",
4158
+ disabled: isModified,
4159
+ pointerEvents: isModified ? "none" : void 0,
4160
+ tabIndex: isModified ? -1 : void 0,
4161
+ children: formatMessage({
4162
+ id: "content-manager.preview.panel.button",
4163
+ defaultMessage: "Open preview"
4164
+ })
4165
+ }
4166
+ ) })
4167
+ }
4168
+ )
4169
+ };
4170
+ };
4171
+ const previewAdmin = {
4172
+ bootstrap(app) {
4173
+ const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4174
+ contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4175
+ }
4176
+ };
4044
4177
  const index = {
4045
4178
  register(app) {
4046
4179
  const cm = new ContentManagerPlugin();
@@ -4060,7 +4193,7 @@ const index = {
4060
4193
  app.router.addRoute({
4061
4194
  path: "content-manager/*",
4062
4195
  lazy: async () => {
4063
- const { Layout } = await Promise.resolve().then(() => require("./layout-CrgXpOxT.js"));
4196
+ const { Layout } = await Promise.resolve().then(() => require("./layout-C3fN7Ejz.js"));
4064
4197
  return {
4065
4198
  Component: Layout
4066
4199
  };
@@ -4073,11 +4206,14 @@ const index = {
4073
4206
  if (typeof historyAdmin.bootstrap === "function") {
4074
4207
  historyAdmin.bootstrap(app);
4075
4208
  }
4209
+ if (typeof previewAdmin.bootstrap === "function") {
4210
+ previewAdmin.bootstrap(app);
4211
+ }
4076
4212
  },
4077
4213
  async registerTrads({ locales }) {
4078
4214
  const importedTrads = await Promise.all(
4079
4215
  locales.map((locale) => {
4080
- 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-Bm0D0IWz.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-EUonQTon.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B7kGGg3E.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-CcFe8diO.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 }) => {
4216
+ 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 }) => {
4081
4217
  return {
4082
4218
  data: prefixPluginTranslations(data, PLUGIN_ID),
4083
4219
  locale
@@ -4135,5 +4271,6 @@ exports.useGetAllContentTypeSettingsQuery = useGetAllContentTypeSettingsQuery;
4135
4271
  exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
4136
4272
  exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
4137
4273
  exports.useGetInitialDataQuery = useGetInitialDataQuery;
4274
+ exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
4138
4275
  exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
4139
- //# sourceMappingURL=index-DcA8_tJw.js.map
4276
+ //# sourceMappingURL=index-BUWEmX8m.js.map