@strapi/content-manager 0.0.0-next.4052765aa209dd4f3d92b81baee295fc0213c04c → 0.0.0-next.40d132bcf8139c1d691684ec83a5834c98dfd41f

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 (183) 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-BEGp0IOV.js → ComponentConfigurationPage-BSEZcJVB.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-BEGp0IOV.js.map → ComponentConfigurationPage-BSEZcJVB.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-DUXYqQwA.mjs → ComponentConfigurationPage-BiASGi7x.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-DUXYqQwA.mjs.map → ComponentConfigurationPage-BiASGi7x.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-BFAn2GH9.js → EditConfigurationPage-D2rtvneE.js} +5 -6
  11. package/dist/_chunks/{EditConfigurationPage-BFAn2GH9.js.map → EditConfigurationPage-D2rtvneE.js.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-D7PzCWYW.mjs → EditConfigurationPage-vN4zupij.mjs} +4 -4
  13. package/dist/_chunks/{EditConfigurationPage-D7PzCWYW.mjs.map → EditConfigurationPage-vN4zupij.mjs.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-CB017yCP.js → EditViewPage-BwisF04Q.js} +38 -9
  15. package/dist/_chunks/EditViewPage-BwisF04Q.js.map +1 -0
  16. package/dist/_chunks/{EditViewPage-DmKviP3U.mjs → EditViewPage-_A31Cl4g.mjs} +38 -8
  17. package/dist/_chunks/EditViewPage-_A31Cl4g.mjs.map +1 -0
  18. package/dist/_chunks/{Field-DztIyw14.mjs → Field-CvIunNOj.mjs} +170 -118
  19. package/dist/_chunks/Field-CvIunNOj.mjs.map +1 -0
  20. package/dist/_chunks/{Field-ByXbOZL6.js → Field-Dsu6-FrM.js} +172 -120
  21. package/dist/_chunks/Field-Dsu6-FrM.js.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-D993gfLL.mjs → Form-DK0fG0Gj.mjs} +3 -3
  25. package/dist/_chunks/{Form-D993gfLL.mjs.map → Form-DK0fG0Gj.mjs.map} +1 -1
  26. package/dist/_chunks/{Form-WgML3Oqo.js → Form-DUwWcCmA.js} +5 -6
  27. package/dist/_chunks/{Form-WgML3Oqo.js.map → Form-DUwWcCmA.js.map} +1 -1
  28. package/dist/_chunks/{History-BmxGh1cB.js → History-CeCDhoJG.js} +22 -93
  29. package/dist/_chunks/History-CeCDhoJG.js.map +1 -0
  30. package/dist/_chunks/{History-GcW_hfMD.mjs → History-DP8gmXpm.mjs} +22 -92
  31. package/dist/_chunks/History-DP8gmXpm.mjs.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-kBho1y__.mjs → ListConfigurationPage-BCkO5iuN.mjs} +7 -6
  33. package/dist/_chunks/ListConfigurationPage-BCkO5iuN.mjs.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-16rxMcAO.js → ListConfigurationPage-C-bAd44a.js} +7 -7
  35. package/dist/_chunks/ListConfigurationPage-C-bAd44a.js.map +1 -0
  36. package/dist/_chunks/{ListViewPage-BXqw44Ja.js → ListViewPage-BKTZFhsM.js} +64 -53
  37. package/dist/_chunks/ListViewPage-BKTZFhsM.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-6rg02vWk.mjs → ListViewPage-Cf_DgaFV.mjs} +63 -51
  39. package/dist/_chunks/ListViewPage-Cf_DgaFV.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-DYfH0OD-.js → NoContentTypePage-D3Cm3v3q.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-DYfH0OD-.js.map → NoContentTypePage-D3Cm3v3q.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-BVtZUY-U.mjs → NoContentTypePage-nHIyvJcB.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-BVtZUY-U.mjs.map → NoContentTypePage-nHIyvJcB.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-D9R6cWCY.mjs → NoPermissionsPage-BALVSJ7x.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-D9R6cWCY.mjs.map → NoPermissionsPage-BALVSJ7x.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-ClDJKdA9.js → NoPermissionsPage-CChGWBj5.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-ClDJKdA9.js.map → NoPermissionsPage-CChGWBj5.js.map} +1 -1
  48. package/dist/_chunks/Preview-C4NBzKUV.mjs +294 -0
  49. package/dist/_chunks/Preview-C4NBzKUV.mjs.map +1 -0
  50. package/dist/_chunks/Preview-CT28Ckpg.js +312 -0
  51. package/dist/_chunks/Preview-CT28Ckpg.js.map +1 -0
  52. package/dist/_chunks/{Relations-uEN7K10I.mjs → Relations-C8uC89cT.mjs} +47 -22
  53. package/dist/_chunks/Relations-C8uC89cT.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-CvsqEtYj.js → Relations-CvkPCng_.js} +47 -23
  55. package/dist/_chunks/Relations-CvkPCng_.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-BrzMjag-.js → index-CnX_j5h-.js} +355 -188
  70. package/dist/_chunks/index-CnX_j5h-.js.map +1 -0
  71. package/dist/_chunks/{index-BHBrXMdZ.mjs → index-Dh2aGTGJ.mjs} +357 -190
  72. package/dist/_chunks/index-Dh2aGTGJ.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-TDRwTVM6.mjs → layout-B5qsPihj.mjs} +4 -4
  78. package/dist/_chunks/{layout-TDRwTVM6.mjs.map → layout-B5qsPihj.mjs.map} +1 -1
  79. package/dist/_chunks/{layout-Dwmw0D0e.js → layout-B_qdWGny.js} +5 -6
  80. package/dist/_chunks/{layout-Dwmw0D0e.js.map → layout-B_qdWGny.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-CIcMvUXZ.js → relations-ChcieiF5.js} +6 -7
  86. package/dist/_chunks/relations-ChcieiF5.js.map +1 -0
  87. package/dist/_chunks/{relations-41Z1upHL.mjs → relations-DMXpNY-e.mjs} +6 -7
  88. package/dist/_chunks/relations-DMXpNY-e.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 +1 -1
  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 +478 -252
  114. package/dist/server/index.js.map +1 -1
  115. package/dist/server/index.mjs +479 -252
  116. package/dist/server/index.mjs.map +1 -1
  117. package/dist/server/src/controllers/index.d.ts.map +1 -1
  118. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  119. package/dist/server/src/controllers/utils/metadata.d.ts +16 -1
  120. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  121. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  122. package/dist/server/src/history/services/utils.d.ts +2 -3
  123. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  124. package/dist/server/src/index.d.ts +7 -6
  125. package/dist/server/src/index.d.ts.map +1 -1
  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.map +1 -1
  133. package/dist/server/src/preview/routes/index.d.ts +8 -0
  134. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  135. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  136. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  137. package/dist/server/src/preview/services/index.d.ts +16 -0
  138. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  139. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  140. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  141. package/dist/server/src/preview/services/preview.d.ts +12 -0
  142. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  143. package/dist/server/src/preview/utils.d.ts +19 -0
  144. package/dist/server/src/preview/utils.d.ts.map +1 -0
  145. package/dist/server/src/register.d.ts.map +1 -1
  146. package/dist/server/src/routes/index.d.ts.map +1 -1
  147. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  148. package/dist/server/src/services/document-metadata.d.ts +12 -10
  149. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  150. package/dist/server/src/services/index.d.ts +7 -6
  151. package/dist/server/src/services/index.d.ts.map +1 -1
  152. package/dist/server/src/services/utils/populate.d.ts +2 -2
  153. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  154. package/dist/server/src/utils/index.d.ts +2 -0
  155. package/dist/server/src/utils/index.d.ts.map +1 -1
  156. package/dist/shared/contracts/index.d.ts +1 -0
  157. package/dist/shared/contracts/index.d.ts.map +1 -1
  158. package/dist/shared/contracts/preview.d.ts +27 -0
  159. package/dist/shared/contracts/preview.d.ts.map +1 -0
  160. package/dist/shared/index.js +4 -0
  161. package/dist/shared/index.js.map +1 -1
  162. package/dist/shared/index.mjs +4 -0
  163. package/dist/shared/index.mjs.map +1 -1
  164. package/package.json +13 -11
  165. package/dist/_chunks/EditViewPage-CB017yCP.js.map +0 -1
  166. package/dist/_chunks/EditViewPage-DmKviP3U.mjs.map +0 -1
  167. package/dist/_chunks/Field-ByXbOZL6.js.map +0 -1
  168. package/dist/_chunks/Field-DztIyw14.mjs.map +0 -1
  169. package/dist/_chunks/History-BmxGh1cB.js.map +0 -1
  170. package/dist/_chunks/History-GcW_hfMD.mjs.map +0 -1
  171. package/dist/_chunks/ListConfigurationPage-16rxMcAO.js.map +0 -1
  172. package/dist/_chunks/ListConfigurationPage-kBho1y__.mjs.map +0 -1
  173. package/dist/_chunks/ListViewPage-6rg02vWk.mjs.map +0 -1
  174. package/dist/_chunks/ListViewPage-BXqw44Ja.js.map +0 -1
  175. package/dist/_chunks/Relations-CvsqEtYj.js.map +0 -1
  176. package/dist/_chunks/Relations-uEN7K10I.mjs.map +0 -1
  177. package/dist/_chunks/index-BHBrXMdZ.mjs.map +0 -1
  178. package/dist/_chunks/index-BrzMjag-.js.map +0 -1
  179. package/dist/_chunks/relations-41Z1upHL.mjs.map +0 -1
  180. package/dist/_chunks/relations-CIcMvUXZ.js.map +0 -1
  181. package/dist/admin/src/preview/constants.d.ts +0 -1
  182. package/dist/server/src/preview/constants.d.ts +0 -2
  183. package/dist/server/src/preview/constants.d.ts.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";
@@ -240,7 +248,19 @@ const documentApi = contentManagerApi.injectEndpoints({
240
248
  { type: "Document", id: `${model}_LIST` },
241
249
  "Relations",
242
250
  { type: "UidAvailability", id: model }
243
- ]
251
+ ],
252
+ transformResponse: (response, meta, arg) => {
253
+ if (!("data" in response) && arg.model === "plugin::users-permissions.user") {
254
+ return {
255
+ data: response,
256
+ meta: {
257
+ availableStatus: [],
258
+ availableLocales: []
259
+ }
260
+ };
261
+ }
262
+ return response;
263
+ }
244
264
  }),
245
265
  deleteDocument: builder.mutation({
246
266
  query: ({ collectionType, model, documentId, params }) => ({
@@ -291,10 +311,10 @@ const documentApi = contentManagerApi.injectEndpoints({
291
311
  */
292
312
  getAllDocuments: builder.query({
293
313
  query: ({ model, params }) => ({
294
- url: `/content-manager/collection-types/${model}${params ? `?${params}` : ""}`,
314
+ url: `/content-manager/collection-types/${model}`,
295
315
  method: "GET",
296
316
  config: {
297
- params
317
+ params: qs.stringify(params, { encode: true })
298
318
  }
299
319
  }),
300
320
  providesTags: (result, _error, arg) => {
@@ -473,8 +493,7 @@ const {
473
493
  useUnpublishManyDocumentsMutation
474
494
  } = documentApi;
475
495
  const buildValidParams = (query) => {
476
- if (!query)
477
- return query;
496
+ if (!query) return query;
478
497
  const { plugins: _, ...validQueryParams } = {
479
498
  ...query,
480
499
  ...Object.values(query?.plugins ?? {}).reduce(
@@ -482,9 +501,6 @@ const buildValidParams = (query) => {
482
501
  {}
483
502
  )
484
503
  };
485
- if ("_q" in validQueryParams) {
486
- validQueryParams._q = encodeURIComponent(validQueryParams._q);
487
- }
488
504
  return validQueryParams;
489
505
  };
490
506
  const isBaseQueryError = (error) => {
@@ -989,9 +1005,10 @@ const formatEditLayout = (data, {
989
1005
  currentPanelIndex += 2;
990
1006
  } else {
991
1007
  if (!panels[currentPanelIndex]) {
992
- panels.push([]);
1008
+ panels.push([row]);
1009
+ } else {
1010
+ panels[currentPanelIndex].push(row);
993
1011
  }
994
- panels[currentPanelIndex].push(row);
995
1012
  }
996
1013
  return panels;
997
1014
  }, []);
@@ -1249,9 +1266,6 @@ const useContentManagerContext = () => {
1249
1266
  };
1250
1267
  };
1251
1268
  const prefixPluginTranslations = (trad, pluginId) => {
1252
- if (!pluginId) {
1253
- throw new TypeError("pluginId can't be empty");
1254
- }
1255
1269
  return Object.keys(trad).reduce((acc, current) => {
1256
1270
  acc[`${pluginId}.${current}`] = trad[current];
1257
1271
  return acc;
@@ -1685,10 +1699,10 @@ const useDocumentActions = () => {
1685
1699
  update
1686
1700
  };
1687
1701
  };
1688
- const ProtectedHistoryPage = React.lazy(
1689
- () => Promise.resolve().then(() => require("./History-BmxGh1cB.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1702
+ const ProtectedHistoryPage = React__namespace.lazy(
1703
+ () => Promise.resolve().then(() => require("./History-CeCDhoJG.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1690
1704
  );
1691
- const routes$1 = [
1705
+ const routes$2 = [
1692
1706
  {
1693
1707
  path: ":collectionType/:slug/:id/history",
1694
1708
  Component: ProtectedHistoryPage
@@ -1698,32 +1712,45 @@ const routes$1 = [
1698
1712
  Component: ProtectedHistoryPage
1699
1713
  }
1700
1714
  ];
1715
+ const ProtectedPreviewPage = React__namespace.lazy(
1716
+ () => Promise.resolve().then(() => require("./Preview-CT28Ckpg.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
1717
+ );
1718
+ const routes$1 = [
1719
+ {
1720
+ path: ":collectionType/:slug/:id/preview",
1721
+ Component: ProtectedPreviewPage
1722
+ },
1723
+ {
1724
+ path: ":collectionType/:slug/preview",
1725
+ Component: ProtectedPreviewPage
1726
+ }
1727
+ ];
1701
1728
  const ProtectedEditViewPage = React.lazy(
1702
- () => Promise.resolve().then(() => require("./EditViewPage-CB017yCP.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1729
+ () => Promise.resolve().then(() => require("./EditViewPage-BwisF04Q.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1703
1730
  );
1704
1731
  const ProtectedListViewPage = React.lazy(
1705
- () => Promise.resolve().then(() => require("./ListViewPage-BXqw44Ja.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1732
+ () => Promise.resolve().then(() => require("./ListViewPage-BKTZFhsM.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1706
1733
  );
1707
1734
  const ProtectedListConfiguration = React.lazy(
1708
- () => Promise.resolve().then(() => require("./ListConfigurationPage-16rxMcAO.js")).then((mod) => ({
1735
+ () => Promise.resolve().then(() => require("./ListConfigurationPage-C-bAd44a.js")).then((mod) => ({
1709
1736
  default: mod.ProtectedListConfiguration
1710
1737
  }))
1711
1738
  );
1712
1739
  const ProtectedEditConfigurationPage = React.lazy(
1713
- () => Promise.resolve().then(() => require("./EditConfigurationPage-BFAn2GH9.js")).then((mod) => ({
1740
+ () => Promise.resolve().then(() => require("./EditConfigurationPage-D2rtvneE.js")).then((mod) => ({
1714
1741
  default: mod.ProtectedEditConfigurationPage
1715
1742
  }))
1716
1743
  );
1717
1744
  const ProtectedComponentConfigurationPage = React.lazy(
1718
- () => Promise.resolve().then(() => require("./ComponentConfigurationPage-BEGp0IOV.js")).then((mod) => ({
1745
+ () => Promise.resolve().then(() => require("./ComponentConfigurationPage-BSEZcJVB.js")).then((mod) => ({
1719
1746
  default: mod.ProtectedComponentConfigurationPage
1720
1747
  }))
1721
1748
  );
1722
1749
  const NoPermissions = React.lazy(
1723
- () => Promise.resolve().then(() => require("./NoPermissionsPage-ClDJKdA9.js")).then((mod) => ({ default: mod.NoPermissions }))
1750
+ () => Promise.resolve().then(() => require("./NoPermissionsPage-CChGWBj5.js")).then((mod) => ({ default: mod.NoPermissions }))
1724
1751
  );
1725
1752
  const NoContentType = React.lazy(
1726
- () => Promise.resolve().then(() => require("./NoContentTypePage-DYfH0OD-.js")).then((mod) => ({ default: mod.NoContentType }))
1753
+ () => Promise.resolve().then(() => require("./NoContentTypePage-D3Cm3v3q.js")).then((mod) => ({ default: mod.NoContentType }))
1727
1754
  );
1728
1755
  const CollectionTypePages = () => {
1729
1756
  const { collectionType } = reactRouterDom.useParams();
@@ -1735,7 +1762,7 @@ const CollectionTypePages = () => {
1735
1762
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1736
1763
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1737
1764
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1738
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1765
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1739
1766
  const routes = [
1740
1767
  {
1741
1768
  path: LIST_RELATIVE_PATH,
@@ -1769,6 +1796,7 @@ const routes = [
1769
1796
  path: "no-content-types",
1770
1797
  Component: NoContentType
1771
1798
  },
1799
+ ...routes$2,
1772
1800
  ...routes$1
1773
1801
  ];
1774
1802
  const DocumentActions = ({ actions: actions2 }) => {
@@ -1867,6 +1895,11 @@ const DocumentActionButton = (action) => {
1867
1895
  ) : null
1868
1896
  ] });
1869
1897
  };
1898
+ const MenuItem = styledComponents.styled(designSystem.Menu.Item)`
1899
+ &:hover {
1900
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
1901
+ }
1902
+ `;
1870
1903
  const DocumentActionsMenu = ({
1871
1904
  actions: actions2,
1872
1905
  children,
@@ -1925,48 +1958,32 @@ const DocumentActionsMenu = ({
1925
1958
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1926
1959
  actions2.map((action) => {
1927
1960
  return /* @__PURE__ */ jsxRuntime.jsx(
1928
- designSystem.Menu.Item,
1961
+ MenuItem,
1929
1962
  {
1930
1963
  disabled: action.disabled,
1931
1964
  onSelect: handleClick(action),
1932
1965
  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
- ] })
1966
+ isVariantDanger: action.variant === "danger",
1967
+ isDisabled: action.disabled,
1968
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxRuntime.jsxs(
1969
+ designSystem.Flex,
1970
+ {
1971
+ color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1972
+ gap: 2,
1973
+ tag: "span",
1974
+ children: [
1975
+ /* @__PURE__ */ jsxRuntime.jsx(
1976
+ designSystem.Flex,
1977
+ {
1978
+ tag: "span",
1979
+ color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1980
+ children: action.icon
1981
+ }
1982
+ ),
1983
+ action.label
1984
+ ]
1985
+ }
1986
+ ) })
1970
1987
  },
1971
1988
  action.id
1972
1989
  );
@@ -2077,6 +2094,18 @@ const DocumentActionModal = ({
2077
2094
  typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer
2078
2095
  ] }) });
2079
2096
  };
2097
+ const transformData = (data) => {
2098
+ if (Array.isArray(data)) {
2099
+ return data.map(transformData);
2100
+ }
2101
+ if (typeof data === "object" && data !== null) {
2102
+ if ("apiData" in data) {
2103
+ return data.apiData;
2104
+ }
2105
+ return mapValues__default.default(transformData)(data);
2106
+ }
2107
+ return data;
2108
+ };
2080
2109
  const PublishAction$1 = ({
2081
2110
  activeTab,
2082
2111
  documentId,
@@ -2091,6 +2120,7 @@ const PublishAction$1 = ({
2091
2120
  const { _unstableFormatValidationErrors: formatValidationErrors } = strapiAdmin.useAPIErrorHandler();
2092
2121
  const isListView = reactRouterDom.useMatch(LIST_PATH) !== null;
2093
2122
  const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
2123
+ const { id } = reactRouterDom.useParams();
2094
2124
  const { formatMessage } = reactIntl.useIntl();
2095
2125
  const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
2096
2126
  const { publish } = useDocumentActions();
@@ -2190,13 +2220,15 @@ const PublishAction$1 = ({
2190
2220
  documentId,
2191
2221
  params
2192
2222
  },
2193
- formValues
2223
+ transformData(formValues)
2194
2224
  );
2195
2225
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2196
- navigate({
2197
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2198
- search: rawQuery
2199
- });
2226
+ if (id === "create") {
2227
+ navigate({
2228
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2229
+ search: rawQuery
2230
+ });
2231
+ }
2200
2232
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2201
2233
  setErrors(formatValidationErrors(res.error));
2202
2234
  }
@@ -2249,6 +2281,7 @@ const PublishAction$1 = ({
2249
2281
  };
2250
2282
  };
2251
2283
  PublishAction$1.type = "publish";
2284
+ PublishAction$1.position = "panel";
2252
2285
  const UpdateAction = ({
2253
2286
  activeTab,
2254
2287
  documentId,
@@ -2271,96 +2304,134 @@ const UpdateAction = ({
2271
2304
  const validate = strapiAdmin.useForm("UpdateAction", (state) => state.validate);
2272
2305
  const setErrors = strapiAdmin.useForm("UpdateAction", (state) => state.setErrors);
2273
2306
  const resetForm = strapiAdmin.useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
2274
- return {
2275
- /**
2276
- * Disabled when:
2277
- * - the form is submitting
2278
- * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2279
- * - the active tab is the published tab
2280
- */
2281
- disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2282
- label: formatMessage({
2283
- id: "content-manager.containers.Edit.save",
2284
- defaultMessage: "Save"
2285
- }),
2286
- onClick: async () => {
2287
- setSubmitting(true);
2288
- try {
2289
- const { errors } = await validate(true, {
2290
- status: "draft"
2307
+ const handleUpdate = React__namespace.useCallback(async () => {
2308
+ setSubmitting(true);
2309
+ try {
2310
+ if (!modified) {
2311
+ return;
2312
+ }
2313
+ const { errors } = await validate(true, {
2314
+ status: "draft"
2315
+ });
2316
+ if (errors) {
2317
+ toggleNotification({
2318
+ type: "danger",
2319
+ message: formatMessage({
2320
+ id: "content-manager.validation.error",
2321
+ defaultMessage: "There are validation errors in your document. Please fix them before saving."
2322
+ })
2291
2323
  });
2292
- if (errors) {
2293
- toggleNotification({
2294
- type: "danger",
2295
- message: formatMessage({
2296
- id: "content-manager.validation.error",
2297
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
2298
- })
2299
- });
2300
- return;
2301
- }
2302
- if (isCloning) {
2303
- const res = await clone(
2304
- {
2305
- model,
2306
- documentId: cloneMatch.params.origin,
2307
- params
2308
- },
2309
- document
2310
- );
2311
- if ("data" in res) {
2312
- navigate(
2313
- {
2314
- pathname: `../${res.data.documentId}`,
2315
- search: rawQuery
2316
- },
2317
- { relative: "path" }
2318
- );
2319
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2320
- setErrors(formatValidationErrors(res.error));
2321
- }
2322
- } else if (documentId || collectionType === SINGLE_TYPES) {
2323
- const res = await update(
2324
+ return;
2325
+ }
2326
+ if (isCloning) {
2327
+ const res = await clone(
2328
+ {
2329
+ model,
2330
+ documentId: cloneMatch.params.origin,
2331
+ params
2332
+ },
2333
+ transformData(document)
2334
+ );
2335
+ if ("data" in res) {
2336
+ navigate(
2324
2337
  {
2325
- collectionType,
2326
- model,
2327
- documentId,
2328
- params
2338
+ pathname: `../${res.data.documentId}`,
2339
+ search: rawQuery
2329
2340
  },
2330
- document
2341
+ { relative: "path" }
2331
2342
  );
2332
- if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2333
- setErrors(formatValidationErrors(res.error));
2334
- } else {
2335
- resetForm();
2336
- }
2343
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2344
+ setErrors(formatValidationErrors(res.error));
2345
+ }
2346
+ } else if (documentId || collectionType === SINGLE_TYPES) {
2347
+ const res = await update(
2348
+ {
2349
+ collectionType,
2350
+ model,
2351
+ documentId,
2352
+ params
2353
+ },
2354
+ transformData(document)
2355
+ );
2356
+ if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2357
+ setErrors(formatValidationErrors(res.error));
2337
2358
  } else {
2338
- const res = await create(
2359
+ resetForm();
2360
+ }
2361
+ } else {
2362
+ const res = await create(
2363
+ {
2364
+ model,
2365
+ params
2366
+ },
2367
+ transformData(document)
2368
+ );
2369
+ if ("data" in res && collectionType !== SINGLE_TYPES) {
2370
+ navigate(
2339
2371
  {
2340
- model,
2341
- params
2372
+ pathname: `../${res.data.documentId}`,
2373
+ search: rawQuery
2342
2374
  },
2343
- document
2375
+ { replace: true, relative: "path" }
2344
2376
  );
2345
- if ("data" in res && collectionType !== SINGLE_TYPES) {
2346
- navigate(
2347
- {
2348
- pathname: `../${res.data.documentId}`,
2349
- search: rawQuery
2350
- },
2351
- { replace: true, relative: "path" }
2352
- );
2353
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2354
- setErrors(formatValidationErrors(res.error));
2355
- }
2377
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2378
+ setErrors(formatValidationErrors(res.error));
2356
2379
  }
2357
- } finally {
2358
- setSubmitting(false);
2359
2380
  }
2381
+ } finally {
2382
+ setSubmitting(false);
2360
2383
  }
2384
+ }, [
2385
+ clone,
2386
+ cloneMatch?.params.origin,
2387
+ collectionType,
2388
+ create,
2389
+ document,
2390
+ documentId,
2391
+ formatMessage,
2392
+ formatValidationErrors,
2393
+ isCloning,
2394
+ model,
2395
+ modified,
2396
+ navigate,
2397
+ params,
2398
+ rawQuery,
2399
+ resetForm,
2400
+ setErrors,
2401
+ setSubmitting,
2402
+ toggleNotification,
2403
+ update,
2404
+ validate
2405
+ ]);
2406
+ React__namespace.useEffect(() => {
2407
+ const handleKeyDown = (e) => {
2408
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
2409
+ e.preventDefault();
2410
+ handleUpdate();
2411
+ }
2412
+ };
2413
+ window.addEventListener("keydown", handleKeyDown);
2414
+ return () => {
2415
+ window.removeEventListener("keydown", handleKeyDown);
2416
+ };
2417
+ }, [handleUpdate]);
2418
+ return {
2419
+ /**
2420
+ * Disabled when:
2421
+ * - the form is submitting
2422
+ * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2423
+ * - the active tab is the published tab
2424
+ */
2425
+ disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2426
+ label: formatMessage({
2427
+ id: "global.save",
2428
+ defaultMessage: "Save"
2429
+ }),
2430
+ onClick: handleUpdate
2361
2431
  };
2362
2432
  };
2363
2433
  UpdateAction.type = "update";
2434
+ UpdateAction.position = "panel";
2364
2435
  const UNPUBLISH_DRAFT_OPTIONS = {
2365
2436
  KEEP: "keep",
2366
2437
  DISCARD: "discard"
@@ -2483,6 +2554,7 @@ const UnpublishAction$1 = ({
2483
2554
  };
2484
2555
  };
2485
2556
  UnpublishAction$1.type = "unpublish";
2557
+ UnpublishAction$1.position = "panel";
2486
2558
  const DiscardAction = ({
2487
2559
  activeTab,
2488
2560
  documentId,
@@ -2533,6 +2605,7 @@ const DiscardAction = ({
2533
2605
  };
2534
2606
  };
2535
2607
  DiscardAction.type = "discard";
2608
+ DiscardAction.position = "panel";
2536
2609
  const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
2537
2610
  const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
2538
2611
  const RelativeTime = React__namespace.forwardRef(
@@ -2545,7 +2618,7 @@ const RelativeTime = React__namespace.forwardRef(
2545
2618
  });
2546
2619
  const unit = intervals.find((intervalUnit) => {
2547
2620
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2548
- });
2621
+ }) ?? "seconds";
2549
2622
  const relativeTime = dateFns.isPast(timestamp) ? -interval[unit] : interval[unit];
2550
2623
  const customInterval = customIntervals.find(
2551
2624
  (custom) => interval[custom.unit] < custom.threshold
@@ -2579,19 +2652,29 @@ const getDisplayName = ({
2579
2652
  return email ?? "";
2580
2653
  };
2581
2654
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2582
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2655
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2583
2656
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2584
- 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) }) });
2657
+ const { formatMessage } = reactIntl.useIntl();
2658
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
2659
+ id: `content-manager.containers.List.${status}`,
2660
+ defaultMessage: capitalise(status)
2661
+ }) }) });
2585
2662
  };
2586
2663
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2587
2664
  const { formatMessage } = reactIntl.useIntl();
2588
2665
  const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
2666
+ const params = reactRouterDom.useParams();
2589
2667
  const title = isCreating ? formatMessage({
2590
2668
  id: "content-manager.containers.edit.title.new",
2591
2669
  defaultMessage: "Create an entry"
2592
2670
  }) : documentTitle;
2593
2671
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2594
- /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
2672
+ /* @__PURE__ */ jsxRuntime.jsx(
2673
+ strapiAdmin.BackButton,
2674
+ {
2675
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2676
+ }
2677
+ ),
2595
2678
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2596
2679
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: title }),
2597
2680
  /* @__PURE__ */ jsxRuntime.jsx(HeaderToolbar, {})
@@ -2642,7 +2725,7 @@ const HeaderToolbar = () => {
2642
2725
  meta: isCloning ? void 0 : meta,
2643
2726
  collectionType
2644
2727
  },
2645
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
2728
+ descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
2646
2729
  children: (actions2) => {
2647
2730
  const headerActions = actions2.filter((action) => {
2648
2731
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -2850,6 +2933,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
2850
2933
  };
2851
2934
  };
2852
2935
  ConfigureTheViewAction.type = "configure-the-view";
2936
+ ConfigureTheViewAction.position = "header";
2853
2937
  const EditTheModelAction = ({ model }) => {
2854
2938
  const navigate = reactRouterDom.useNavigate();
2855
2939
  const { formatMessage } = reactIntl.useIntl();
@@ -2866,6 +2950,7 @@ const EditTheModelAction = ({ model }) => {
2866
2950
  };
2867
2951
  };
2868
2952
  EditTheModelAction.type = "edit-the-model";
2953
+ EditTheModelAction.position = "header";
2869
2954
  const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2870
2955
  const navigate = reactRouterDom.useNavigate();
2871
2956
  const { formatMessage } = reactIntl.useIntl();
@@ -2939,6 +3024,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2939
3024
  };
2940
3025
  };
2941
3026
  DeleteAction$1.type = "delete";
3027
+ DeleteAction$1.position = ["header", "table-row"];
2942
3028
  const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
2943
3029
  const Panels = () => {
2944
3030
  const isCloning = reactRouterDom.useMatch(CLONE_PATH) !== null;
@@ -3001,7 +3087,7 @@ const ActionsPanelContent = () => {
3001
3087
  strapiAdmin.DescriptionComponentRenderer,
3002
3088
  {
3003
3089
  props,
3004
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
3090
+ descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
3005
3091
  children: (actions2) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActions, { actions: actions2 })
3006
3092
  }
3007
3093
  ),
@@ -3278,18 +3364,10 @@ const SelectedEntriesTableContent = ({
3278
3364
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3279
3365
  },
3280
3366
  state: { from: pathname },
3281
- label: formatMessage(
3282
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3283
- {
3284
- target: formatMessage(
3285
- {
3286
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3287
- defaultMessage: "item line {number}"
3288
- },
3289
- { number: index2 + 1 }
3290
- )
3291
- }
3292
- ),
3367
+ label: formatMessage({
3368
+ id: "content-manager.bulk-publish.edit",
3369
+ defaultMessage: "Edit"
3370
+ }),
3293
3371
  target: "_blank",
3294
3372
  marginLeft: "auto",
3295
3373
  variant: "ghost",
@@ -3463,8 +3541,7 @@ const PublishAction = ({ documents, model }) => {
3463
3541
  const refetchList = () => {
3464
3542
  contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
3465
3543
  };
3466
- if (!showPublishButton)
3467
- return null;
3544
+ if (!showPublishButton) return null;
3468
3545
  return {
3469
3546
  actionType: "publish",
3470
3547
  variant: "tertiary",
@@ -3532,8 +3609,7 @@ const DeleteAction = ({ documents, model }) => {
3532
3609
  selectRow([]);
3533
3610
  }
3534
3611
  };
3535
- if (!hasDeletePermission)
3536
- return null;
3612
+ if (!hasDeletePermission) return null;
3537
3613
  return {
3538
3614
  variant: "danger-light",
3539
3615
  label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
@@ -3582,8 +3658,7 @@ const UnpublishAction = ({ documents, model }) => {
3582
3658
  }
3583
3659
  };
3584
3660
  const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
3585
- if (!showUnpublishButton)
3586
- return null;
3661
+ if (!showUnpublishButton) return null;
3587
3662
  return {
3588
3663
  variant: "tertiary",
3589
3664
  label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
@@ -3688,7 +3763,7 @@ const TableActions = ({ document }) => {
3688
3763
  strapiAdmin.DescriptionComponentRenderer,
3689
3764
  {
3690
3765
  props,
3691
- descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
3766
+ descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
3692
3767
  children: (actions2) => {
3693
3768
  const tableRowActions = actions2.filter((action) => {
3694
3769
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -3747,6 +3822,7 @@ const EditAction = ({ documentId }) => {
3747
3822
  };
3748
3823
  };
3749
3824
  EditAction.type = "edit";
3825
+ EditAction.position = "table-row";
3750
3826
  const StyledPencil = styledComponents.styled(Icons.Pencil)`
3751
3827
  path {
3752
3828
  fill: currentColor;
@@ -3823,6 +3899,7 @@ const CloneAction = ({ model, documentId }) => {
3823
3899
  };
3824
3900
  };
3825
3901
  CloneAction.type = "clone";
3902
+ CloneAction.position = "table-row";
3826
3903
  const StyledDuplicate = styledComponents.styled(Icons.Duplicate)`
3827
3904
  path {
3828
3905
  fill: currentColor;
@@ -3909,7 +3986,14 @@ class ContentManagerPlugin {
3909
3986
  addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
3910
3987
  addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
3911
3988
  getBulkActions: () => this.bulkActions,
3912
- getDocumentActions: () => this.documentActions,
3989
+ getDocumentActions: (position) => {
3990
+ if (position) {
3991
+ return this.documentActions.filter(
3992
+ (action) => action.position == void 0 || [action.position].flat().includes(position)
3993
+ );
3994
+ }
3995
+ return this.documentActions;
3996
+ },
3913
3997
  getEditViewSidePanels: () => this.editViewSidePanels,
3914
3998
  getHeaderActions: () => this.headerActions
3915
3999
  }
@@ -3919,10 +4003,8 @@ class ContentManagerPlugin {
3919
4003
  const getPrintableType = (value) => {
3920
4004
  const nativeType = typeof value;
3921
4005
  if (nativeType === "object") {
3922
- if (value === null)
3923
- return "null";
3924
- if (Array.isArray(value))
3925
- return "array";
4006
+ if (value === null) return "null";
4007
+ if (Array.isArray(value)) return "array";
3926
4008
  if (value instanceof Object && value.constructor.name !== "Object") {
3927
4009
  return value.constructor.name;
3928
4010
  }
@@ -3933,17 +4015,27 @@ const HistoryAction = ({ model, document }) => {
3933
4015
  const { formatMessage } = reactIntl.useIntl();
3934
4016
  const [{ query }] = strapiAdmin.useQueryParams();
3935
4017
  const navigate = reactRouterDom.useNavigate();
4018
+ const { trackUsage } = strapiAdmin.useTracking();
4019
+ const { pathname } = reactRouterDom.useLocation();
3936
4020
  const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
3937
4021
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3938
4022
  return null;
3939
4023
  }
4024
+ const handleOnClick = () => {
4025
+ const destination = { pathname: "history", search: pluginsQueryParams };
4026
+ trackUsage("willNavigate", {
4027
+ from: pathname,
4028
+ to: `${pathname}/${destination.pathname}`
4029
+ });
4030
+ navigate(destination);
4031
+ };
3940
4032
  return {
3941
4033
  icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
3942
4034
  label: formatMessage({
3943
4035
  id: "content-manager.history.document-action",
3944
4036
  defaultMessage: "Content History"
3945
4037
  }),
3946
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
4038
+ onClick: handleOnClick,
3947
4039
  disabled: (
3948
4040
  /**
3949
4041
  * The user is creating a new document.
@@ -3965,6 +4057,7 @@ const HistoryAction = ({ model, document }) => {
3965
4057
  };
3966
4058
  };
3967
4059
  HistoryAction.type = "history";
4060
+ HistoryAction.position = "header";
3968
4061
  const historyAdmin = {
3969
4062
  bootstrap(app) {
3970
4063
  const { addDocumentAction } = app.getPlugin("content-manager").apis;
@@ -4011,13 +4104,86 @@ const { setInitialData } = actions;
4011
4104
  const reducer = toolkit.combineReducers({
4012
4105
  app: reducer$1
4013
4106
  });
4014
- const FEATURE_ID = "preview";
4107
+ const previewApi = contentManagerApi.injectEndpoints({
4108
+ endpoints: (builder) => ({
4109
+ getPreviewUrl: builder.query({
4110
+ query({ query, params }) {
4111
+ return {
4112
+ url: `/content-manager/preview/url/${params.contentType}`,
4113
+ method: "GET",
4114
+ config: {
4115
+ params: query
4116
+ }
4117
+ };
4118
+ }
4119
+ })
4120
+ })
4121
+ });
4122
+ const { useGetPreviewUrlQuery } = previewApi;
4123
+ const ConditionalTooltip = ({ isShown, label, children }) => {
4124
+ if (isShown) {
4125
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Tooltip, { label, children });
4126
+ }
4127
+ return children;
4128
+ };
4129
+ const PreviewSidePanel = ({ model, documentId, document }) => {
4130
+ const { formatMessage } = reactIntl.useIntl();
4131
+ const { trackUsage } = strapiAdmin.useTracking();
4132
+ const { pathname } = reactRouterDom.useLocation();
4133
+ const [{ query }] = strapiAdmin.useQueryParams();
4134
+ const isModified = strapiAdmin.useForm("PreviewSidePanel", (state) => state.modified);
4135
+ const { data, error } = useGetPreviewUrlQuery({
4136
+ params: {
4137
+ contentType: model
4138
+ },
4139
+ query: {
4140
+ documentId,
4141
+ locale: document?.locale,
4142
+ status: document?.status
4143
+ }
4144
+ });
4145
+ if (!data?.data?.url || error) {
4146
+ return null;
4147
+ }
4148
+ const trackNavigation = () => {
4149
+ const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
4150
+ trackUsage("willNavigate", { from: pathname, to: destinationPathname });
4151
+ };
4152
+ return {
4153
+ title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4154
+ content: /* @__PURE__ */ jsxRuntime.jsx(
4155
+ ConditionalTooltip,
4156
+ {
4157
+ label: formatMessage({
4158
+ id: "content-manager.preview.panel.button-disabled-tooltip",
4159
+ defaultMessage: "Please save to open the preview"
4160
+ }),
4161
+ isShown: isModified,
4162
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
4163
+ designSystem.Button,
4164
+ {
4165
+ variant: "tertiary",
4166
+ tag: reactRouterDom.Link,
4167
+ to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
4168
+ onClick: trackNavigation,
4169
+ width: "100%",
4170
+ disabled: isModified,
4171
+ pointerEvents: isModified ? "none" : void 0,
4172
+ tabIndex: isModified ? -1 : void 0,
4173
+ children: formatMessage({
4174
+ id: "content-manager.preview.panel.button",
4175
+ defaultMessage: "Open preview"
4176
+ })
4177
+ }
4178
+ ) })
4179
+ }
4180
+ )
4181
+ };
4182
+ };
4015
4183
  const previewAdmin = {
4016
4184
  bootstrap(app) {
4017
- if (!window.strapi.future.isEnabled(FEATURE_ID)) {
4018
- return {};
4019
- }
4020
- console.log("Bootstrapping preview admin");
4185
+ const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4186
+ contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4021
4187
  }
4022
4188
  };
4023
4189
  const index = {
@@ -4039,7 +4205,7 @@ const index = {
4039
4205
  app.router.addRoute({
4040
4206
  path: "content-manager/*",
4041
4207
  lazy: async () => {
4042
- const { Layout } = await Promise.resolve().then(() => require("./layout-Dwmw0D0e.js"));
4208
+ const { Layout } = await Promise.resolve().then(() => require("./layout-B_qdWGny.js"));
4043
4209
  return {
4044
4210
  Component: Layout
4045
4211
  };
@@ -4059,7 +4225,7 @@ const index = {
4059
4225
  async registerTrads({ locales }) {
4060
4226
  const importedTrads = await Promise.all(
4061
4227
  locales.map((locale) => {
4062
- 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 }) => {
4228
+ 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 }) => {
4063
4229
  return {
4064
4230
  data: prefixPluginTranslations(data, PLUGIN_ID),
4065
4231
  locale
@@ -4117,5 +4283,6 @@ exports.useGetAllContentTypeSettingsQuery = useGetAllContentTypeSettingsQuery;
4117
4283
  exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
4118
4284
  exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
4119
4285
  exports.useGetInitialDataQuery = useGetInitialDataQuery;
4286
+ exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
4120
4287
  exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
4121
- //# sourceMappingURL=index-BrzMjag-.js.map
4288
+ //# sourceMappingURL=index-CnX_j5h-.js.map