@strapi/content-manager 0.0.0-next.55dabf6295dfb7987fcab8a6b40212555f0e684c → 0.0.0-next.5d0cd5a1a7d80ae3da90f2331d25161b28f06910

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 (191) 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-FqfsxQ1j.js → ComponentConfigurationPage-CJPoOvy3.js} +5 -6
  4. package/dist/_chunks/{ComponentConfigurationPage-FqfsxQ1j.js.map → ComponentConfigurationPage-CJPoOvy3.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-DfFSZQxe.mjs → ComponentConfigurationPage-CcRDqD0e.mjs} +4 -4
  6. package/dist/_chunks/{ComponentConfigurationPage-DfFSZQxe.mjs.map → ComponentConfigurationPage-CcRDqD0e.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-DdPNAbl3.mjs → EditConfigurationPage-C1ddZ_zf.mjs} +4 -4
  11. package/dist/_chunks/{EditConfigurationPage-DdPNAbl3.mjs.map → EditConfigurationPage-C1ddZ_zf.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-Cn0e8t3I.js → EditConfigurationPage-CF3lxOy2.js} +5 -6
  13. package/dist/_chunks/{EditConfigurationPage-Cn0e8t3I.js.map → EditConfigurationPage-CF3lxOy2.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-B82x_x1b.mjs → EditViewPage-BPFcUbqi.mjs} +38 -8
  15. package/dist/_chunks/EditViewPage-BPFcUbqi.mjs.map +1 -0
  16. package/dist/_chunks/{EditViewPage-DlxEHhUt.js → EditViewPage-CDyTC6aU.js} +38 -9
  17. package/dist/_chunks/EditViewPage-CDyTC6aU.js.map +1 -0
  18. package/dist/_chunks/{Field-COL25JiC.js → Field-DuxAW9q2.js} +172 -120
  19. package/dist/_chunks/Field-DuxAW9q2.js.map +1 -0
  20. package/dist/_chunks/{Field-DufHXW17.mjs → Field-fBnTwgU4.mjs} +170 -118
  21. package/dist/_chunks/Field-fBnTwgU4.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-u_kAOhwB.mjs → Form-BGl7PhlZ.mjs} +3 -3
  25. package/dist/_chunks/{Form-u_kAOhwB.mjs.map → Form-BGl7PhlZ.mjs.map} +1 -1
  26. package/dist/_chunks/{Form-BssUwrTO.js → Form-DSGh_zkz.js} +5 -6
  27. package/dist/_chunks/{Form-BssUwrTO.js.map → Form-DSGh_zkz.js.map} +1 -1
  28. package/dist/_chunks/{History-DRwA3oMM.mjs → History-DTYB9CSB.mjs} +23 -93
  29. package/dist/_chunks/History-DTYB9CSB.mjs.map +1 -0
  30. package/dist/_chunks/{History-C9t9UqpO.js → History-DrDJv698.js} +23 -94
  31. package/dist/_chunks/History-DrDJv698.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-BxfQJzPk.mjs → ListConfigurationPage-qWx8r4D_.mjs} +7 -6
  33. package/dist/_chunks/ListConfigurationPage-qWx8r4D_.mjs.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-BXYPohh-.js → ListConfigurationPage-zurIlUZ7.js} +7 -7
  35. package/dist/_chunks/ListConfigurationPage-zurIlUZ7.js.map +1 -0
  36. package/dist/_chunks/{ListViewPage-D2VD8Szg.js → ListViewPage-DTM2uO_S.js} +63 -41
  37. package/dist/_chunks/ListViewPage-DTM2uO_S.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-CELx2ysp.mjs → ListViewPage-GKpL5p8A.mjs} +62 -39
  39. package/dist/_chunks/ListViewPage-GKpL5p8A.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-DtJ9jcfk.mjs → NoContentTypePage-B5Vc5Cal.mjs} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-DtJ9jcfk.mjs.map → NoContentTypePage-B5Vc5Cal.mjs.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-BV9IjJSM.js → NoContentTypePage-BuZlNroO.js} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-BV9IjJSM.js.map → NoContentTypePage-BuZlNroO.js.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-DWleVYK7.mjs → NoPermissionsPage-BAZlWgJ4.mjs} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-DWleVYK7.mjs.map → NoPermissionsPage-BAZlWgJ4.mjs.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-Dp8NpF9I.js → NoPermissionsPage-DLzkS4Hy.js} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-Dp8NpF9I.js.map → NoPermissionsPage-DLzkS4Hy.js.map} +1 -1
  48. package/dist/_chunks/Preview-VOJ8RuQp.js +312 -0
  49. package/dist/_chunks/Preview-VOJ8RuQp.js.map +1 -0
  50. package/dist/_chunks/Preview-Zzjg2_K_.mjs +294 -0
  51. package/dist/_chunks/Preview-Zzjg2_K_.mjs.map +1 -0
  52. package/dist/_chunks/{Relations-BTcf5xaw.mjs → Relations-BVdRfDkW.mjs} +47 -22
  53. package/dist/_chunks/Relations-BVdRfDkW.mjs.map +1 -0
  54. package/dist/_chunks/{Relations-DR7EUgyC.js → Relations-Dsj0boFJ.js} +47 -23
  55. package/dist/_chunks/Relations-Dsj0boFJ.js.map +1 -0
  56. package/dist/_chunks/{en-Bm0D0IWz.js → en-BzQmavmK.js} +21 -4
  57. package/dist/_chunks/{en-Bm0D0IWz.js.map → en-BzQmavmK.js.map} +1 -1
  58. package/dist/_chunks/{en-DKV44jRb.mjs → en-CSxLmrh1.mjs} +21 -4
  59. package/dist/_chunks/{en-DKV44jRb.mjs.map → en-CSxLmrh1.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-wnqzm4Q8.mjs → index-Bu_-B7ZA.mjs} +390 -196
  70. package/dist/_chunks/index-Bu_-B7ZA.mjs.map +1 -0
  71. package/dist/_chunks/{index-BdMf2lfT.js → index-Ct-GZ0iV.js} +388 -194
  72. package/dist/_chunks/index-Ct-GZ0iV.js.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-B2MyZU-_.js → layout-CDBEgRsM.js} +5 -6
  78. package/dist/_chunks/{layout-B2MyZU-_.js.map → layout-CDBEgRsM.js.map} +1 -1
  79. package/dist/_chunks/{layout-2CfjL0T9.mjs → layout-COzAvgJh.mjs} +4 -4
  80. package/dist/_chunks/{layout-2CfjL0T9.mjs.map → layout-COzAvgJh.mjs.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-BH7JJGGe.js → relations-BjiF1Aad.js} +6 -7
  86. package/dist/_chunks/relations-BjiF1Aad.js.map +1 -0
  87. package/dist/_chunks/{relations-C0w0GcXi.mjs → relations-BtmMFBpM.mjs} +6 -7
  88. package/dist/_chunks/relations-BtmMFBpM.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 +2 -1
  96. package/dist/admin/index.js.map +1 -1
  97. package/dist/admin/index.mjs +5 -4
  98. package/dist/admin/src/content-manager.d.ts +3 -2
  99. package/dist/admin/src/exports.d.ts +1 -0
  100. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  101. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  102. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  103. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  104. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  105. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  106. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  107. package/dist/admin/src/preview/components/PreviewContent.d.ts +2 -0
  108. package/dist/admin/src/preview/components/PreviewHeader.d.ts +2 -0
  109. package/dist/admin/src/preview/components/PreviewSidePanel.d.ts +3 -0
  110. package/dist/admin/src/preview/index.d.ts +4 -0
  111. package/dist/admin/src/preview/pages/Preview.d.ts +11 -0
  112. package/dist/admin/src/preview/routes.d.ts +3 -0
  113. package/dist/admin/src/preview/services/preview.d.ts +3 -0
  114. package/dist/admin/src/router.d.ts +1 -1
  115. package/dist/admin/src/services/api.d.ts +1 -1
  116. package/dist/admin/src/services/components.d.ts +2 -2
  117. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  118. package/dist/admin/src/services/documents.d.ts +16 -19
  119. package/dist/admin/src/services/init.d.ts +1 -1
  120. package/dist/admin/src/services/relations.d.ts +2 -2
  121. package/dist/admin/src/services/uid.d.ts +3 -3
  122. package/dist/server/index.js +482 -243
  123. package/dist/server/index.js.map +1 -1
  124. package/dist/server/index.mjs +483 -243
  125. package/dist/server/index.mjs.map +1 -1
  126. package/dist/server/src/bootstrap.d.ts.map +1 -1
  127. package/dist/server/src/controllers/index.d.ts.map +1 -1
  128. package/dist/server/src/controllers/relations.d.ts.map +1 -1
  129. package/dist/server/src/controllers/utils/metadata.d.ts +16 -1
  130. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  131. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  132. package/dist/server/src/history/services/utils.d.ts +2 -3
  133. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  134. package/dist/server/src/index.d.ts +7 -6
  135. package/dist/server/src/index.d.ts.map +1 -1
  136. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  137. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  138. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  139. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  140. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  141. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  142. package/dist/server/src/preview/index.d.ts +4 -0
  143. package/dist/server/src/preview/index.d.ts.map +1 -0
  144. package/dist/server/src/preview/routes/index.d.ts +8 -0
  145. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  146. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  147. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  148. package/dist/server/src/preview/services/index.d.ts +16 -0
  149. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  150. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  151. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  152. package/dist/server/src/preview/services/preview.d.ts +12 -0
  153. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  154. package/dist/server/src/preview/utils.d.ts +19 -0
  155. package/dist/server/src/preview/utils.d.ts.map +1 -0
  156. package/dist/server/src/register.d.ts.map +1 -1
  157. package/dist/server/src/routes/index.d.ts.map +1 -1
  158. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  159. package/dist/server/src/services/document-metadata.d.ts +12 -10
  160. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  161. package/dist/server/src/services/index.d.ts +7 -6
  162. package/dist/server/src/services/index.d.ts.map +1 -1
  163. package/dist/server/src/services/utils/populate.d.ts +2 -2
  164. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  165. package/dist/server/src/utils/index.d.ts +2 -0
  166. package/dist/server/src/utils/index.d.ts.map +1 -1
  167. package/dist/shared/contracts/index.d.ts +1 -0
  168. package/dist/shared/contracts/index.d.ts.map +1 -1
  169. package/dist/shared/contracts/preview.d.ts +27 -0
  170. package/dist/shared/contracts/preview.d.ts.map +1 -0
  171. package/dist/shared/index.js +4 -0
  172. package/dist/shared/index.js.map +1 -1
  173. package/dist/shared/index.mjs +4 -0
  174. package/dist/shared/index.mjs.map +1 -1
  175. package/package.json +13 -11
  176. package/dist/_chunks/EditViewPage-B82x_x1b.mjs.map +0 -1
  177. package/dist/_chunks/EditViewPage-DlxEHhUt.js.map +0 -1
  178. package/dist/_chunks/Field-COL25JiC.js.map +0 -1
  179. package/dist/_chunks/Field-DufHXW17.mjs.map +0 -1
  180. package/dist/_chunks/History-C9t9UqpO.js.map +0 -1
  181. package/dist/_chunks/History-DRwA3oMM.mjs.map +0 -1
  182. package/dist/_chunks/ListConfigurationPage-BXYPohh-.js.map +0 -1
  183. package/dist/_chunks/ListConfigurationPage-BxfQJzPk.mjs.map +0 -1
  184. package/dist/_chunks/ListViewPage-CELx2ysp.mjs.map +0 -1
  185. package/dist/_chunks/ListViewPage-D2VD8Szg.js.map +0 -1
  186. package/dist/_chunks/Relations-BTcf5xaw.mjs.map +0 -1
  187. package/dist/_chunks/Relations-DR7EUgyC.js.map +0 -1
  188. package/dist/_chunks/index-BdMf2lfT.js.map +0 -1
  189. package/dist/_chunks/index-wnqzm4Q8.mjs.map +0 -1
  190. package/dist/_chunks/relations-BH7JJGGe.js.map +0 -1
  191. package/dist/_chunks/relations-C0w0GcXi.mjs.map +0 -1
@@ -3,23 +3,31 @@ import { jsx, Fragment, jsxs } from "react/jsx-runtime";
3
3
  import { useStrapiApp, createContext, useQueryParams, useAuth, useRBAC, Page, adminApi, translatedErrors, useNotification, useAPIErrorHandler, getYupValidationErrors, useForm, useTracking, useGuidedTour, BackButton, DescriptionComponentRenderer, useTable, Table } from "@strapi/admin/strapi-admin";
4
4
  import * as React from "react";
5
5
  import { lazy } from "react";
6
- import { Button, Menu, VisuallyHidden, Flex, Typography, Dialog, Modal, Radio, Status, Box, SingleSelect, SingleSelectOption, IconButton, Loader, Tooltip, LinkButton } from "@strapi/design-system";
6
+ import { Menu, Button, VisuallyHidden, Flex, Dialog, Modal, Typography, Radio, Status, Box, SingleSelect, SingleSelectOption, IconButton, Loader, Tooltip, LinkButton } from "@strapi/design-system";
7
+ import mapValues from "lodash/fp/mapValues";
7
8
  import { useIntl } from "react-intl";
8
9
  import { useParams, useNavigate, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
10
+ import { styled } from "styled-components";
9
11
  import * as yup from "yup";
10
12
  import { ValidationError } from "yup";
13
+ import { stringify } from "qs";
11
14
  import pipe from "lodash/fp/pipe";
12
15
  import { intervalToDuration, isPast } from "date-fns";
13
- import { styled } from "styled-components";
14
- import { stringify } from "qs";
15
16
  import { createSlice, combineReducers } from "@reduxjs/toolkit";
16
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
17
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
17
18
  const v = glob[path];
18
19
  if (v) {
19
20
  return typeof v === "function" ? v() : Promise.resolve(v);
20
21
  }
21
22
  return new Promise((_, reject) => {
22
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path)));
23
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
24
+ reject.bind(
25
+ null,
26
+ new Error(
27
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
28
+ )
29
+ )
30
+ );
23
31
  });
24
32
  };
25
33
  const PLUGIN_ID = "content-manager";
@@ -167,7 +175,8 @@ const contentManagerApi = adminApi.enhanceEndpoints({
167
175
  "InitialData",
168
176
  "HistoryVersion",
169
177
  "Relations",
170
- "UidAvailability"
178
+ "UidAvailability",
179
+ "RecentDocumentList"
171
180
  ]
172
181
  });
173
182
  const documentApi = contentManagerApi.injectEndpoints({
@@ -185,7 +194,7 @@ const documentApi = contentManagerApi.injectEndpoints({
185
194
  if (error) {
186
195
  return [];
187
196
  }
188
- return [{ type: "Document", id: `${model}_LIST` }];
197
+ return [{ type: "Document", id: `${model}_LIST` }, "RecentDocumentList"];
189
198
  }
190
199
  }),
191
200
  cloneDocument: builder.mutation({
@@ -199,7 +208,8 @@ const documentApi = contentManagerApi.injectEndpoints({
199
208
  }),
200
209
  invalidatesTags: (_result, _error, { model }) => [
201
210
  { type: "Document", id: `${model}_LIST` },
202
- { type: "UidAvailability", id: model }
211
+ { type: "UidAvailability", id: model },
212
+ "RecentDocumentList"
203
213
  ]
204
214
  }),
205
215
  /**
@@ -218,8 +228,21 @@ const documentApi = contentManagerApi.injectEndpoints({
218
228
  invalidatesTags: (result, _error, { model }) => [
219
229
  { type: "Document", id: `${model}_LIST` },
220
230
  "Relations",
221
- { type: "UidAvailability", id: model }
222
- ]
231
+ { type: "UidAvailability", id: model },
232
+ "RecentDocumentList"
233
+ ],
234
+ transformResponse: (response, meta, arg) => {
235
+ if (!("data" in response) && arg.model === "plugin::users-permissions.user") {
236
+ return {
237
+ data: response,
238
+ meta: {
239
+ availableStatus: [],
240
+ availableLocales: []
241
+ }
242
+ };
243
+ }
244
+ return response;
245
+ }
223
246
  }),
224
247
  deleteDocument: builder.mutation({
225
248
  query: ({ collectionType, model, documentId, params }) => ({
@@ -230,7 +253,8 @@ const documentApi = contentManagerApi.injectEndpoints({
230
253
  }
231
254
  }),
232
255
  invalidatesTags: (_result, _error, { collectionType, model }) => [
233
- { type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model }
256
+ { type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },
257
+ "RecentDocumentList"
234
258
  ]
235
259
  }),
236
260
  deleteManyDocuments: builder.mutation({
@@ -242,7 +266,10 @@ const documentApi = contentManagerApi.injectEndpoints({
242
266
  params
243
267
  }
244
268
  }),
245
- invalidatesTags: (_res, _error, { model }) => [{ type: "Document", id: `${model}_LIST` }]
269
+ invalidatesTags: (_res, _error, { model }) => [
270
+ { type: "Document", id: `${model}_LIST` },
271
+ "RecentDocumentList"
272
+ ]
246
273
  }),
247
274
  discardDocument: builder.mutation({
248
275
  query: ({ collectionType, model, documentId, params }) => ({
@@ -260,7 +287,8 @@ const documentApi = contentManagerApi.injectEndpoints({
260
287
  },
261
288
  { type: "Document", id: `${model}_LIST` },
262
289
  "Relations",
263
- { type: "UidAvailability", id: model }
290
+ { type: "UidAvailability", id: model },
291
+ "RecentDocumentList"
264
292
  ];
265
293
  }
266
294
  }),
@@ -273,7 +301,7 @@ const documentApi = contentManagerApi.injectEndpoints({
273
301
  url: `/content-manager/collection-types/${model}`,
274
302
  method: "GET",
275
303
  config: {
276
- params
304
+ params: stringify(params, { encode: true })
277
305
  }
278
306
  }),
279
307
  providesTags: (result, _error, arg) => {
@@ -355,7 +383,8 @@ const documentApi = contentManagerApi.injectEndpoints({
355
383
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
356
384
  },
357
385
  { type: "Document", id: `${model}_LIST` },
358
- "Relations"
386
+ "Relations",
387
+ "RecentDocumentList"
359
388
  ];
360
389
  }
361
390
  }),
@@ -386,7 +415,9 @@ const documentApi = contentManagerApi.injectEndpoints({
386
415
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
387
416
  },
388
417
  "Relations",
389
- { type: "UidAvailability", id: model }
418
+ { type: "UidAvailability", id: model },
419
+ "RecentDocumentList",
420
+ "RecentDocumentList"
390
421
  ];
391
422
  },
392
423
  async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
@@ -416,7 +447,8 @@ const documentApi = contentManagerApi.injectEndpoints({
416
447
  {
417
448
  type: "Document",
418
449
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
419
- }
450
+ },
451
+ "RecentDocumentList"
420
452
  ];
421
453
  }
422
454
  }),
@@ -429,7 +461,10 @@ const documentApi = contentManagerApi.injectEndpoints({
429
461
  params
430
462
  }
431
463
  }),
432
- invalidatesTags: (_res, _error, { model, documentIds }) => documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` }))
464
+ invalidatesTags: (_res, _error, { model, documentIds }) => [
465
+ ...documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` })),
466
+ "RecentDocumentList"
467
+ ]
433
468
  })
434
469
  })
435
470
  });
@@ -452,8 +487,7 @@ const {
452
487
  useUnpublishManyDocumentsMutation
453
488
  } = documentApi;
454
489
  const buildValidParams = (query) => {
455
- if (!query)
456
- return query;
490
+ if (!query) return query;
457
491
  const { plugins: _, ...validQueryParams } = {
458
492
  ...query,
459
493
  ...Object.values(query?.plugins ?? {}).reduce(
@@ -461,9 +495,6 @@ const buildValidParams = (query) => {
461
495
  {}
462
496
  )
463
497
  };
464
- if ("_q" in validQueryParams) {
465
- validQueryParams._q = encodeURIComponent(validQueryParams._q);
466
- }
467
498
  return validQueryParams;
468
499
  };
469
500
  const isBaseQueryError = (error) => {
@@ -968,9 +999,10 @@ const formatEditLayout = (data, {
968
999
  currentPanelIndex += 2;
969
1000
  } else {
970
1001
  if (!panels[currentPanelIndex]) {
971
- panels.push([]);
1002
+ panels.push([row]);
1003
+ } else {
1004
+ panels[currentPanelIndex].push(row);
972
1005
  }
973
- panels[currentPanelIndex].push(row);
974
1006
  }
975
1007
  return panels;
976
1008
  }, []);
@@ -1228,9 +1260,6 @@ const useContentManagerContext = () => {
1228
1260
  };
1229
1261
  };
1230
1262
  const prefixPluginTranslations = (trad, pluginId) => {
1231
- if (!pluginId) {
1232
- throw new TypeError("pluginId can't be empty");
1233
- }
1234
1263
  return Object.keys(trad).reduce((acc, current) => {
1235
1264
  acc[`${pluginId}.${current}`] = trad[current];
1236
1265
  return acc;
@@ -1664,10 +1693,10 @@ const useDocumentActions = () => {
1664
1693
  update
1665
1694
  };
1666
1695
  };
1667
- const ProtectedHistoryPage = lazy(
1668
- () => import("./History-DRwA3oMM.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1696
+ const ProtectedHistoryPage = React.lazy(
1697
+ () => import("./History-DTYB9CSB.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1669
1698
  );
1670
- const routes$1 = [
1699
+ const routes$2 = [
1671
1700
  {
1672
1701
  path: ":collectionType/:slug/:id/history",
1673
1702
  Component: ProtectedHistoryPage
@@ -1677,32 +1706,45 @@ const routes$1 = [
1677
1706
  Component: ProtectedHistoryPage
1678
1707
  }
1679
1708
  ];
1709
+ const ProtectedPreviewPage = React.lazy(
1710
+ () => import("./Preview-Zzjg2_K_.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
1711
+ );
1712
+ const routes$1 = [
1713
+ {
1714
+ path: ":collectionType/:slug/:id/preview",
1715
+ Component: ProtectedPreviewPage
1716
+ },
1717
+ {
1718
+ path: ":collectionType/:slug/preview",
1719
+ Component: ProtectedPreviewPage
1720
+ }
1721
+ ];
1680
1722
  const ProtectedEditViewPage = lazy(
1681
- () => import("./EditViewPage-B82x_x1b.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1723
+ () => import("./EditViewPage-BPFcUbqi.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1682
1724
  );
1683
1725
  const ProtectedListViewPage = lazy(
1684
- () => import("./ListViewPage-CELx2ysp.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1726
+ () => import("./ListViewPage-GKpL5p8A.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1685
1727
  );
1686
1728
  const ProtectedListConfiguration = lazy(
1687
- () => import("./ListConfigurationPage-BxfQJzPk.mjs").then((mod) => ({
1729
+ () => import("./ListConfigurationPage-qWx8r4D_.mjs").then((mod) => ({
1688
1730
  default: mod.ProtectedListConfiguration
1689
1731
  }))
1690
1732
  );
1691
1733
  const ProtectedEditConfigurationPage = lazy(
1692
- () => import("./EditConfigurationPage-DdPNAbl3.mjs").then((mod) => ({
1734
+ () => import("./EditConfigurationPage-C1ddZ_zf.mjs").then((mod) => ({
1693
1735
  default: mod.ProtectedEditConfigurationPage
1694
1736
  }))
1695
1737
  );
1696
1738
  const ProtectedComponentConfigurationPage = lazy(
1697
- () => import("./ComponentConfigurationPage-DfFSZQxe.mjs").then((mod) => ({
1739
+ () => import("./ComponentConfigurationPage-CcRDqD0e.mjs").then((mod) => ({
1698
1740
  default: mod.ProtectedComponentConfigurationPage
1699
1741
  }))
1700
1742
  );
1701
1743
  const NoPermissions = lazy(
1702
- () => import("./NoPermissionsPage-DWleVYK7.mjs").then((mod) => ({ default: mod.NoPermissions }))
1744
+ () => import("./NoPermissionsPage-BAZlWgJ4.mjs").then((mod) => ({ default: mod.NoPermissions }))
1703
1745
  );
1704
1746
  const NoContentType = lazy(
1705
- () => import("./NoContentTypePage-DtJ9jcfk.mjs").then((mod) => ({ default: mod.NoContentType }))
1747
+ () => import("./NoContentTypePage-B5Vc5Cal.mjs").then((mod) => ({ default: mod.NoContentType }))
1706
1748
  );
1707
1749
  const CollectionTypePages = () => {
1708
1750
  const { collectionType } = useParams();
@@ -1714,7 +1756,7 @@ const CollectionTypePages = () => {
1714
1756
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1715
1757
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1716
1758
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1717
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1759
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1718
1760
  const routes = [
1719
1761
  {
1720
1762
  path: LIST_RELATIVE_PATH,
@@ -1748,6 +1790,7 @@ const routes = [
1748
1790
  path: "no-content-types",
1749
1791
  Component: NoContentType
1750
1792
  },
1793
+ ...routes$2,
1751
1794
  ...routes$1
1752
1795
  ];
1753
1796
  const DocumentActions = ({ actions: actions2 }) => {
@@ -1846,6 +1889,11 @@ const DocumentActionButton = (action) => {
1846
1889
  ) : null
1847
1890
  ] });
1848
1891
  };
1892
+ const MenuItem = styled(Menu.Item)`
1893
+ &:hover {
1894
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
1895
+ }
1896
+ `;
1849
1897
  const DocumentActionsMenu = ({
1850
1898
  actions: actions2,
1851
1899
  children,
@@ -1904,48 +1952,32 @@ const DocumentActionsMenu = ({
1904
1952
  /* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1905
1953
  actions2.map((action) => {
1906
1954
  return /* @__PURE__ */ jsx(
1907
- Menu.Item,
1955
+ MenuItem,
1908
1956
  {
1909
1957
  disabled: action.disabled,
1910
1958
  onSelect: handleClick(action),
1911
1959
  display: "block",
1912
- children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
1913
- /* @__PURE__ */ jsxs(
1914
- Flex,
1915
- {
1916
- color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1917
- gap: 2,
1918
- tag: "span",
1919
- children: [
1920
- /* @__PURE__ */ jsx(
1921
- Flex,
1922
- {
1923
- tag: "span",
1924
- color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1925
- children: action.icon
1926
- }
1927
- ),
1928
- action.label
1929
- ]
1930
- }
1931
- ),
1932
- action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
1933
- Flex,
1934
- {
1935
- alignItems: "center",
1936
- background: "alternative100",
1937
- borderStyle: "solid",
1938
- borderColor: "alternative200",
1939
- borderWidth: "1px",
1940
- height: 5,
1941
- paddingLeft: 2,
1942
- paddingRight: 2,
1943
- hasRadius: true,
1944
- color: "alternative600",
1945
- children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
1946
- }
1947
- )
1948
- ] })
1960
+ isVariantDanger: action.variant === "danger",
1961
+ isDisabled: action.disabled,
1962
+ children: /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxs(
1963
+ Flex,
1964
+ {
1965
+ color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1966
+ gap: 2,
1967
+ tag: "span",
1968
+ children: [
1969
+ /* @__PURE__ */ jsx(
1970
+ Flex,
1971
+ {
1972
+ tag: "span",
1973
+ color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1974
+ children: action.icon
1975
+ }
1976
+ ),
1977
+ action.label
1978
+ ]
1979
+ }
1980
+ ) })
1949
1981
  },
1950
1982
  action.id
1951
1983
  );
@@ -2056,6 +2088,18 @@ const DocumentActionModal = ({
2056
2088
  typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
2057
2089
  ] }) });
2058
2090
  };
2091
+ const transformData = (data) => {
2092
+ if (Array.isArray(data)) {
2093
+ return data.map(transformData);
2094
+ }
2095
+ if (typeof data === "object" && data !== null) {
2096
+ if ("apiData" in data) {
2097
+ return data.apiData;
2098
+ }
2099
+ return mapValues(transformData)(data);
2100
+ }
2101
+ return data;
2102
+ };
2059
2103
  const PublishAction$1 = ({
2060
2104
  activeTab,
2061
2105
  documentId,
@@ -2070,6 +2114,7 @@ const PublishAction$1 = ({
2070
2114
  const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
2071
2115
  const isListView = useMatch(LIST_PATH) !== null;
2072
2116
  const isCloning = useMatch(CLONE_PATH) !== null;
2117
+ const { id } = useParams();
2073
2118
  const { formatMessage } = useIntl();
2074
2119
  const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
2075
2120
  const { publish } = useDocumentActions();
@@ -2169,13 +2214,15 @@ const PublishAction$1 = ({
2169
2214
  documentId,
2170
2215
  params
2171
2216
  },
2172
- formValues
2217
+ transformData(formValues)
2173
2218
  );
2174
2219
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2175
- navigate({
2176
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2177
- search: rawQuery
2178
- });
2220
+ if (id === "create") {
2221
+ navigate({
2222
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2223
+ search: rawQuery
2224
+ });
2225
+ }
2179
2226
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2180
2227
  setErrors(formatValidationErrors(res.error));
2181
2228
  }
@@ -2228,6 +2275,7 @@ const PublishAction$1 = ({
2228
2275
  };
2229
2276
  };
2230
2277
  PublishAction$1.type = "publish";
2278
+ PublishAction$1.position = "panel";
2231
2279
  const UpdateAction = ({
2232
2280
  activeTab,
2233
2281
  documentId,
@@ -2250,96 +2298,134 @@ const UpdateAction = ({
2250
2298
  const validate = useForm("UpdateAction", (state) => state.validate);
2251
2299
  const setErrors = useForm("UpdateAction", (state) => state.setErrors);
2252
2300
  const resetForm = useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
2253
- return {
2254
- /**
2255
- * Disabled when:
2256
- * - the form is submitting
2257
- * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2258
- * - the active tab is the published tab
2259
- */
2260
- disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2261
- label: formatMessage({
2262
- id: "content-manager.containers.Edit.save",
2263
- defaultMessage: "Save"
2264
- }),
2265
- onClick: async () => {
2266
- setSubmitting(true);
2267
- try {
2268
- const { errors } = await validate(true, {
2269
- status: "draft"
2301
+ const handleUpdate = React.useCallback(async () => {
2302
+ setSubmitting(true);
2303
+ try {
2304
+ if (!modified) {
2305
+ return;
2306
+ }
2307
+ const { errors } = await validate(true, {
2308
+ status: "draft"
2309
+ });
2310
+ if (errors) {
2311
+ toggleNotification({
2312
+ type: "danger",
2313
+ message: formatMessage({
2314
+ id: "content-manager.validation.error",
2315
+ defaultMessage: "There are validation errors in your document. Please fix them before saving."
2316
+ })
2270
2317
  });
2271
- if (errors) {
2272
- toggleNotification({
2273
- type: "danger",
2274
- message: formatMessage({
2275
- id: "content-manager.validation.error",
2276
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
2277
- })
2278
- });
2279
- return;
2280
- }
2281
- if (isCloning) {
2282
- const res = await clone(
2283
- {
2284
- model,
2285
- documentId: cloneMatch.params.origin,
2286
- params
2287
- },
2288
- document
2289
- );
2290
- if ("data" in res) {
2291
- navigate(
2292
- {
2293
- pathname: `../${res.data.documentId}`,
2294
- search: rawQuery
2295
- },
2296
- { relative: "path" }
2297
- );
2298
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2299
- setErrors(formatValidationErrors(res.error));
2300
- }
2301
- } else if (documentId || collectionType === SINGLE_TYPES) {
2302
- const res = await update(
2318
+ return;
2319
+ }
2320
+ if (isCloning) {
2321
+ const res = await clone(
2322
+ {
2323
+ model,
2324
+ documentId: cloneMatch.params.origin,
2325
+ params
2326
+ },
2327
+ transformData(document)
2328
+ );
2329
+ if ("data" in res) {
2330
+ navigate(
2303
2331
  {
2304
- collectionType,
2305
- model,
2306
- documentId,
2307
- params
2332
+ pathname: `../${res.data.documentId}`,
2333
+ search: rawQuery
2308
2334
  },
2309
- document
2335
+ { relative: "path" }
2310
2336
  );
2311
- if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2312
- setErrors(formatValidationErrors(res.error));
2313
- } else {
2314
- resetForm();
2315
- }
2337
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2338
+ setErrors(formatValidationErrors(res.error));
2339
+ }
2340
+ } else if (documentId || collectionType === SINGLE_TYPES) {
2341
+ const res = await update(
2342
+ {
2343
+ collectionType,
2344
+ model,
2345
+ documentId,
2346
+ params
2347
+ },
2348
+ transformData(document)
2349
+ );
2350
+ if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2351
+ setErrors(formatValidationErrors(res.error));
2316
2352
  } else {
2317
- const res = await create(
2353
+ resetForm();
2354
+ }
2355
+ } else {
2356
+ const res = await create(
2357
+ {
2358
+ model,
2359
+ params
2360
+ },
2361
+ transformData(document)
2362
+ );
2363
+ if ("data" in res && collectionType !== SINGLE_TYPES) {
2364
+ navigate(
2318
2365
  {
2319
- model,
2320
- params
2366
+ pathname: `../${res.data.documentId}`,
2367
+ search: rawQuery
2321
2368
  },
2322
- document
2369
+ { replace: true, relative: "path" }
2323
2370
  );
2324
- if ("data" in res && collectionType !== SINGLE_TYPES) {
2325
- navigate(
2326
- {
2327
- pathname: `../${res.data.documentId}`,
2328
- search: rawQuery
2329
- },
2330
- { replace: true, relative: "path" }
2331
- );
2332
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2333
- setErrors(formatValidationErrors(res.error));
2334
- }
2371
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2372
+ setErrors(formatValidationErrors(res.error));
2335
2373
  }
2336
- } finally {
2337
- setSubmitting(false);
2338
2374
  }
2375
+ } finally {
2376
+ setSubmitting(false);
2339
2377
  }
2378
+ }, [
2379
+ clone,
2380
+ cloneMatch?.params.origin,
2381
+ collectionType,
2382
+ create,
2383
+ document,
2384
+ documentId,
2385
+ formatMessage,
2386
+ formatValidationErrors,
2387
+ isCloning,
2388
+ model,
2389
+ modified,
2390
+ navigate,
2391
+ params,
2392
+ rawQuery,
2393
+ resetForm,
2394
+ setErrors,
2395
+ setSubmitting,
2396
+ toggleNotification,
2397
+ update,
2398
+ validate
2399
+ ]);
2400
+ React.useEffect(() => {
2401
+ const handleKeyDown = (e) => {
2402
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
2403
+ e.preventDefault();
2404
+ handleUpdate();
2405
+ }
2406
+ };
2407
+ window.addEventListener("keydown", handleKeyDown);
2408
+ return () => {
2409
+ window.removeEventListener("keydown", handleKeyDown);
2410
+ };
2411
+ }, [handleUpdate]);
2412
+ return {
2413
+ /**
2414
+ * Disabled when:
2415
+ * - the form is submitting
2416
+ * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2417
+ * - the active tab is the published tab
2418
+ */
2419
+ disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2420
+ label: formatMessage({
2421
+ id: "global.save",
2422
+ defaultMessage: "Save"
2423
+ }),
2424
+ onClick: handleUpdate
2340
2425
  };
2341
2426
  };
2342
2427
  UpdateAction.type = "update";
2428
+ UpdateAction.position = "panel";
2343
2429
  const UNPUBLISH_DRAFT_OPTIONS = {
2344
2430
  KEEP: "keep",
2345
2431
  DISCARD: "discard"
@@ -2462,6 +2548,7 @@ const UnpublishAction$1 = ({
2462
2548
  };
2463
2549
  };
2464
2550
  UnpublishAction$1.type = "unpublish";
2551
+ UnpublishAction$1.position = "panel";
2465
2552
  const DiscardAction = ({
2466
2553
  activeTab,
2467
2554
  documentId,
@@ -2512,6 +2599,7 @@ const DiscardAction = ({
2512
2599
  };
2513
2600
  };
2514
2601
  DiscardAction.type = "discard";
2602
+ DiscardAction.position = "panel";
2515
2603
  const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
2516
2604
  const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
2517
2605
  const RelativeTime = React.forwardRef(
@@ -2524,7 +2612,7 @@ const RelativeTime = React.forwardRef(
2524
2612
  });
2525
2613
  const unit = intervals.find((intervalUnit) => {
2526
2614
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2527
- });
2615
+ }) ?? "seconds";
2528
2616
  const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
2529
2617
  const customInterval = customIntervals.find(
2530
2618
  (custom) => interval[custom.unit] < custom.threshold
@@ -2558,19 +2646,29 @@ const getDisplayName = ({
2558
2646
  return email ?? "";
2559
2647
  };
2560
2648
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2561
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2649
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2562
2650
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2563
- return /* @__PURE__ */ jsx(Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: capitalise(status) }) });
2651
+ const { formatMessage } = useIntl();
2652
+ return /* @__PURE__ */ jsx(Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
2653
+ id: `content-manager.containers.List.${status}`,
2654
+ defaultMessage: capitalise(status)
2655
+ }) }) });
2564
2656
  };
2565
2657
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2566
2658
  const { formatMessage } = useIntl();
2567
2659
  const isCloning = useMatch(CLONE_PATH) !== null;
2660
+ const params = useParams();
2568
2661
  const title = isCreating ? formatMessage({
2569
2662
  id: "content-manager.containers.edit.title.new",
2570
2663
  defaultMessage: "Create an entry"
2571
2664
  }) : documentTitle;
2572
2665
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2573
- /* @__PURE__ */ jsx(BackButton, {}),
2666
+ /* @__PURE__ */ jsx(
2667
+ BackButton,
2668
+ {
2669
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2670
+ }
2671
+ ),
2574
2672
  /* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2575
2673
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
2576
2674
  /* @__PURE__ */ jsx(HeaderToolbar, {})
@@ -2621,7 +2719,7 @@ const HeaderToolbar = () => {
2621
2719
  meta: isCloning ? void 0 : meta,
2622
2720
  collectionType
2623
2721
  },
2624
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
2722
+ descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
2625
2723
  children: (actions2) => {
2626
2724
  const headerActions = actions2.filter((action) => {
2627
2725
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -2829,6 +2927,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
2829
2927
  };
2830
2928
  };
2831
2929
  ConfigureTheViewAction.type = "configure-the-view";
2930
+ ConfigureTheViewAction.position = "header";
2832
2931
  const EditTheModelAction = ({ model }) => {
2833
2932
  const navigate = useNavigate();
2834
2933
  const { formatMessage } = useIntl();
@@ -2845,6 +2944,7 @@ const EditTheModelAction = ({ model }) => {
2845
2944
  };
2846
2945
  };
2847
2946
  EditTheModelAction.type = "edit-the-model";
2947
+ EditTheModelAction.position = "header";
2848
2948
  const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2849
2949
  const navigate = useNavigate();
2850
2950
  const { formatMessage } = useIntl();
@@ -2918,6 +3018,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2918
3018
  };
2919
3019
  };
2920
3020
  DeleteAction$1.type = "delete";
3021
+ DeleteAction$1.position = ["header", "table-row"];
2921
3022
  const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
2922
3023
  const Panels = () => {
2923
3024
  const isCloning = useMatch(CLONE_PATH) !== null;
@@ -2980,7 +3081,7 @@ const ActionsPanelContent = () => {
2980
3081
  DescriptionComponentRenderer,
2981
3082
  {
2982
3083
  props,
2983
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
3084
+ descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
2984
3085
  children: (actions2) => /* @__PURE__ */ jsx(DocumentActions, { actions: actions2 })
2985
3086
  }
2986
3087
  ),
@@ -3007,7 +3108,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
3007
3108
  justifyContent: "stretch",
3008
3109
  alignItems: "flex-start",
3009
3110
  children: [
3010
- /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", children: title }),
3111
+ /* @__PURE__ */ jsx(Typography, { tag: "h2", variant: "sigma", textTransform: "uppercase", textColor: "neutral600", children: title }),
3011
3112
  children
3012
3113
  ]
3013
3114
  }
@@ -3257,18 +3358,10 @@ const SelectedEntriesTableContent = ({
3257
3358
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3258
3359
  },
3259
3360
  state: { from: pathname },
3260
- label: formatMessage(
3261
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3262
- {
3263
- target: formatMessage(
3264
- {
3265
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3266
- defaultMessage: "item line {number}"
3267
- },
3268
- { number: index2 + 1 }
3269
- )
3270
- }
3271
- ),
3361
+ label: formatMessage({
3362
+ id: "content-manager.bulk-publish.edit",
3363
+ defaultMessage: "Edit"
3364
+ }),
3272
3365
  target: "_blank",
3273
3366
  marginLeft: "auto",
3274
3367
  variant: "ghost",
@@ -3442,8 +3535,7 @@ const PublishAction = ({ documents, model }) => {
3442
3535
  const refetchList = () => {
3443
3536
  contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
3444
3537
  };
3445
- if (!showPublishButton)
3446
- return null;
3538
+ if (!showPublishButton) return null;
3447
3539
  return {
3448
3540
  actionType: "publish",
3449
3541
  variant: "tertiary",
@@ -3511,8 +3603,7 @@ const DeleteAction = ({ documents, model }) => {
3511
3603
  selectRow([]);
3512
3604
  }
3513
3605
  };
3514
- if (!hasDeletePermission)
3515
- return null;
3606
+ if (!hasDeletePermission) return null;
3516
3607
  return {
3517
3608
  variant: "danger-light",
3518
3609
  label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
@@ -3561,8 +3652,7 @@ const UnpublishAction = ({ documents, model }) => {
3561
3652
  }
3562
3653
  };
3563
3654
  const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
3564
- if (!showUnpublishButton)
3565
- return null;
3655
+ if (!showUnpublishButton) return null;
3566
3656
  return {
3567
3657
  variant: "tertiary",
3568
3658
  label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
@@ -3667,7 +3757,7 @@ const TableActions = ({ document }) => {
3667
3757
  DescriptionComponentRenderer,
3668
3758
  {
3669
3759
  props,
3670
- descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
3760
+ descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
3671
3761
  children: (actions2) => {
3672
3762
  const tableRowActions = actions2.filter((action) => {
3673
3763
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -3726,6 +3816,7 @@ const EditAction = ({ documentId }) => {
3726
3816
  };
3727
3817
  };
3728
3818
  EditAction.type = "edit";
3819
+ EditAction.position = "table-row";
3729
3820
  const StyledPencil = styled(Pencil)`
3730
3821
  path {
3731
3822
  fill: currentColor;
@@ -3802,6 +3893,7 @@ const CloneAction = ({ model, documentId }) => {
3802
3893
  };
3803
3894
  };
3804
3895
  CloneAction.type = "clone";
3896
+ CloneAction.position = "table-row";
3805
3897
  const StyledDuplicate = styled(Duplicate)`
3806
3898
  path {
3807
3899
  fill: currentColor;
@@ -3888,7 +3980,14 @@ class ContentManagerPlugin {
3888
3980
  addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
3889
3981
  addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
3890
3982
  getBulkActions: () => this.bulkActions,
3891
- getDocumentActions: () => this.documentActions,
3983
+ getDocumentActions: (position) => {
3984
+ if (position) {
3985
+ return this.documentActions.filter(
3986
+ (action) => action.position == void 0 || [action.position].flat().includes(position)
3987
+ );
3988
+ }
3989
+ return this.documentActions;
3990
+ },
3892
3991
  getEditViewSidePanels: () => this.editViewSidePanels,
3893
3992
  getHeaderActions: () => this.headerActions
3894
3993
  }
@@ -3898,10 +3997,8 @@ class ContentManagerPlugin {
3898
3997
  const getPrintableType = (value) => {
3899
3998
  const nativeType = typeof value;
3900
3999
  if (nativeType === "object") {
3901
- if (value === null)
3902
- return "null";
3903
- if (Array.isArray(value))
3904
- return "array";
4000
+ if (value === null) return "null";
4001
+ if (Array.isArray(value)) return "array";
3905
4002
  if (value instanceof Object && value.constructor.name !== "Object") {
3906
4003
  return value.constructor.name;
3907
4004
  }
@@ -3912,17 +4009,27 @@ const HistoryAction = ({ model, document }) => {
3912
4009
  const { formatMessage } = useIntl();
3913
4010
  const [{ query }] = useQueryParams();
3914
4011
  const navigate = useNavigate();
4012
+ const { trackUsage } = useTracking();
4013
+ const { pathname } = useLocation();
3915
4014
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
3916
4015
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3917
4016
  return null;
3918
4017
  }
4018
+ const handleOnClick = () => {
4019
+ const destination = { pathname: "history", search: pluginsQueryParams };
4020
+ trackUsage("willNavigate", {
4021
+ from: pathname,
4022
+ to: `${pathname}/${destination.pathname}`
4023
+ });
4024
+ navigate(destination);
4025
+ };
3919
4026
  return {
3920
4027
  icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
3921
4028
  label: formatMessage({
3922
4029
  id: "content-manager.history.document-action",
3923
4030
  defaultMessage: "Content History"
3924
4031
  }),
3925
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
4032
+ onClick: handleOnClick,
3926
4033
  disabled: (
3927
4034
  /**
3928
4035
  * The user is creating a new document.
@@ -3944,6 +4051,7 @@ const HistoryAction = ({ model, document }) => {
3944
4051
  };
3945
4052
  };
3946
4053
  HistoryAction.type = "history";
4054
+ HistoryAction.position = "header";
3947
4055
  const historyAdmin = {
3948
4056
  bootstrap(app) {
3949
4057
  const { addDocumentAction } = app.getPlugin("content-manager").apis;
@@ -3990,6 +4098,88 @@ const { setInitialData } = actions;
3990
4098
  const reducer = combineReducers({
3991
4099
  app: reducer$1
3992
4100
  });
4101
+ const previewApi = contentManagerApi.injectEndpoints({
4102
+ endpoints: (builder) => ({
4103
+ getPreviewUrl: builder.query({
4104
+ query({ query, params }) {
4105
+ return {
4106
+ url: `/content-manager/preview/url/${params.contentType}`,
4107
+ method: "GET",
4108
+ config: {
4109
+ params: query
4110
+ }
4111
+ };
4112
+ }
4113
+ })
4114
+ })
4115
+ });
4116
+ const { useGetPreviewUrlQuery } = previewApi;
4117
+ const ConditionalTooltip = ({ isShown, label, children }) => {
4118
+ if (isShown) {
4119
+ return /* @__PURE__ */ jsx(Tooltip, { label, children });
4120
+ }
4121
+ return children;
4122
+ };
4123
+ const PreviewSidePanel = ({ model, documentId, document }) => {
4124
+ const { formatMessage } = useIntl();
4125
+ const { trackUsage } = useTracking();
4126
+ const { pathname } = useLocation();
4127
+ const [{ query }] = useQueryParams();
4128
+ const isModified = useForm("PreviewSidePanel", (state) => state.modified);
4129
+ const { data, error } = useGetPreviewUrlQuery({
4130
+ params: {
4131
+ contentType: model
4132
+ },
4133
+ query: {
4134
+ documentId,
4135
+ locale: document?.locale,
4136
+ status: document?.status
4137
+ }
4138
+ });
4139
+ if (!data?.data?.url || error) {
4140
+ return null;
4141
+ }
4142
+ const trackNavigation = () => {
4143
+ const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
4144
+ trackUsage("willNavigate", { from: pathname, to: destinationPathname });
4145
+ };
4146
+ return {
4147
+ title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4148
+ content: /* @__PURE__ */ jsx(
4149
+ ConditionalTooltip,
4150
+ {
4151
+ label: formatMessage({
4152
+ id: "content-manager.preview.panel.button-disabled-tooltip",
4153
+ defaultMessage: "Please save to open the preview"
4154
+ }),
4155
+ isShown: isModified,
4156
+ children: /* @__PURE__ */ jsx(Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsx(
4157
+ Button,
4158
+ {
4159
+ variant: "tertiary",
4160
+ tag: Link,
4161
+ to: { pathname: "preview", search: stringify(query, { encode: false }) },
4162
+ onClick: trackNavigation,
4163
+ width: "100%",
4164
+ disabled: isModified,
4165
+ pointerEvents: isModified ? "none" : void 0,
4166
+ tabIndex: isModified ? -1 : void 0,
4167
+ children: formatMessage({
4168
+ id: "content-manager.preview.panel.button",
4169
+ defaultMessage: "Open preview"
4170
+ })
4171
+ }
4172
+ ) })
4173
+ }
4174
+ )
4175
+ };
4176
+ };
4177
+ const previewAdmin = {
4178
+ bootstrap(app) {
4179
+ const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4180
+ contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4181
+ }
4182
+ };
3993
4183
  const index = {
3994
4184
  register(app) {
3995
4185
  const cm = new ContentManagerPlugin();
@@ -4009,7 +4199,7 @@ const index = {
4009
4199
  app.router.addRoute({
4010
4200
  path: "content-manager/*",
4011
4201
  lazy: async () => {
4012
- const { Layout } = await import("./layout-2CfjL0T9.mjs");
4202
+ const { Layout } = await import("./layout-COzAvgJh.mjs");
4013
4203
  return {
4014
4204
  Component: Layout
4015
4205
  };
@@ -4022,11 +4212,14 @@ const index = {
4022
4212
  if (typeof historyAdmin.bootstrap === "function") {
4023
4213
  historyAdmin.bootstrap(app);
4024
4214
  }
4215
+ if (typeof previewAdmin.bootstrap === "function") {
4216
+ previewAdmin.bootstrap(app);
4217
+ }
4025
4218
  },
4026
4219
  async registerTrads({ locales }) {
4027
4220
  const importedTrads = await Promise.all(
4028
4221
  locales.map((locale) => {
4029
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-DKV44jRb.mjs"), "./translations/es.json": () => import("./es-CeXiYflN.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr-CD9VFbPM.mjs"), "./translations/gu.json": () => import("./gu-CNpaMDpH.mjs"), "./translations/hi.json": () => import("./hi-Dwvd04m3.mjs"), "./translations/hu.json": () => import("./hu-CeYvaaO0.mjs"), "./translations/id.json": () => import("./id-BtwA9WJT.mjs"), "./translations/it.json": () => import("./it-BrVPqaf1.mjs"), "./translations/ja.json": () => import("./ja-CtsUxOvk.mjs"), "./translations/ko.json": () => import("./ko-HVQRlfUI.mjs"), "./translations/ml.json": () => import("./ml-BihZwQit.mjs"), "./translations/ms.json": () => import("./ms-m_WjyWx7.mjs"), "./translations/nl.json": () => import("./nl-D4R9gHx5.mjs"), "./translations/pl.json": () => import("./pl-sbx9mSt_.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-C71iDxnh.mjs"), "./translations/pt.json": () => import("./pt-BsaFvS8-.mjs"), "./translations/ru.json": () => import("./ru-BE6A4Exp.mjs"), "./translations/sa.json": () => import("./sa-Dag0k-Z8.mjs"), "./translations/sk.json": () => import("./sk-BFg-R8qJ.mjs"), "./translations/sv.json": () => import("./sv-CUnfWGsh.mjs"), "./translations/th.json": () => import("./th-BqbI8lIT.mjs"), "./translations/tr.json": () => import("./tr-CgeK3wJM.mjs"), "./translations/uk.json": () => import("./uk-CR-zDhAY.mjs"), "./translations/vi.json": () => import("./vi-DUXIk_fw.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-BPQcRIyH.mjs"), "./translations/zh.json": () => import("./zh-BWZspA60.mjs") }), `./translations/${locale}.json`).then(({ default: data }) => {
4222
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => import("./ar-CCEVvqGG.mjs"), "./translations/ca.json": () => import("./ca-5U32ON2v.mjs"), "./translations/cs.json": () => import("./cs-CM2aBUar.mjs"), "./translations/de.json": () => import("./de-C72KDNOl.mjs"), "./translations/en.json": () => import("./en-CSxLmrh1.mjs"), "./translations/es.json": () => import("./es-D34tqjMw.mjs"), "./translations/eu.json": () => import("./eu-CdALomew.mjs"), "./translations/fr.json": () => import("./fr--pg5jUbt.mjs"), "./translations/gu.json": () => import("./gu-CNpaMDpH.mjs"), "./translations/hi.json": () => import("./hi-Dwvd04m3.mjs"), "./translations/hu.json": () => import("./hu-CeYvaaO0.mjs"), "./translations/id.json": () => import("./id-BtwA9WJT.mjs"), "./translations/it.json": () => import("./it-BrVPqaf1.mjs"), "./translations/ja.json": () => import("./ja-BHqhDq4V.mjs"), "./translations/ko.json": () => import("./ko-HVQRlfUI.mjs"), "./translations/ml.json": () => import("./ml-BihZwQit.mjs"), "./translations/ms.json": () => import("./ms-m_WjyWx7.mjs"), "./translations/nl.json": () => import("./nl-D4R9gHx5.mjs"), "./translations/pl.json": () => import("./pl-sbx9mSt_.mjs"), "./translations/pt-BR.json": () => import("./pt-BR-C71iDxnh.mjs"), "./translations/pt.json": () => import("./pt-BsaFvS8-.mjs"), "./translations/ru.json": () => import("./ru-BE6A4Exp.mjs"), "./translations/sa.json": () => import("./sa-Dag0k-Z8.mjs"), "./translations/sk.json": () => import("./sk-BFg-R8qJ.mjs"), "./translations/sv.json": () => import("./sv-CUnfWGsh.mjs"), "./translations/th.json": () => import("./th-BqbI8lIT.mjs"), "./translations/tr.json": () => import("./tr-CgeK3wJM.mjs"), "./translations/uk.json": () => import("./uk-CR-zDhAY.mjs"), "./translations/vi.json": () => import("./vi-DUXIk_fw.mjs"), "./translations/zh-Hans.json": () => import("./zh-Hans-BPQcRIyH.mjs"), "./translations/zh.json": () => import("./zh-BWZspA60.mjs") }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
4030
4223
  return {
4031
4224
  data: prefixPluginTranslations(data, PLUGIN_ID),
4032
4225
  locale
@@ -4053,9 +4246,10 @@ export {
4053
4246
  HOOKS as H,
4054
4247
  InjectionZone as I,
4055
4248
  useDocument as J,
4056
- index as K,
4057
- useContentManagerContext as L,
4058
- useDocumentActions as M,
4249
+ useGetPreviewUrlQuery as K,
4250
+ index as L,
4251
+ useContentManagerContext as M,
4252
+ useDocumentActions as N,
4059
4253
  Panels as P,
4060
4254
  RelativeTime as R,
4061
4255
  SINGLE_TYPES as S,
@@ -4087,4 +4281,4 @@ export {
4087
4281
  capitalise as y,
4088
4282
  useUpdateContentTypeConfigurationMutation as z
4089
4283
  };
4090
- //# sourceMappingURL=index-wnqzm4Q8.mjs.map
4284
+ //# sourceMappingURL=index-Bu_-B7ZA.mjs.map