@strapi/content-manager 0.0.0-experimental.65b9961ce81496e349024ceb95be1d5946f2c429 → 0.0.0-experimental.6665eb3c1eed3f48d650cca09220447cd02aa7c2

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 (195) 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-CO977CPh.js → ComponentConfigurationPage-BLWQy8ru.js} +4 -5
  4. package/dist/_chunks/{ComponentConfigurationPage-CO977CPh.js.map → ComponentConfigurationPage-BLWQy8ru.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-CQroR9Qk.mjs → ComponentConfigurationPage-CtIa3aa2.mjs} +3 -3
  6. package/dist/_chunks/{ComponentConfigurationPage-CQroR9Qk.mjs.map → ComponentConfigurationPage-CtIa3aa2.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-tVCJ5vWC.mjs → EditConfigurationPage-DsPR2DVk.mjs} +3 -3
  11. package/dist/_chunks/{EditConfigurationPage-tVCJ5vWC.mjs.map → EditConfigurationPage-DsPR2DVk.mjs.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-BPgoE-kf.js → EditConfigurationPage-RQkymxCy.js} +4 -5
  13. package/dist/_chunks/{EditConfigurationPage-BPgoE-kf.js.map → EditConfigurationPage-RQkymxCy.js.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-BMVgUNOX.js → EditViewPage-B-kExt8C.js} +38 -9
  15. package/dist/_chunks/EditViewPage-B-kExt8C.js.map +1 -0
  16. package/dist/_chunks/{EditViewPage-8mOu02ji.mjs → EditViewPage-BPyVuPfM.mjs} +38 -8
  17. package/dist/_chunks/EditViewPage-BPyVuPfM.mjs.map +1 -0
  18. package/dist/_chunks/{Field-CdSLKFQk.js → Field-DPIsQRre.js} +177 -122
  19. package/dist/_chunks/Field-DPIsQRre.js.map +1 -0
  20. package/dist/_chunks/{Field-CJPYzwD7.mjs → Field-Dltnt1km.mjs} +175 -120
  21. package/dist/_chunks/Field-Dltnt1km.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-eP5bZwap.js → Form-BFi4MXMT.js} +5 -6
  25. package/dist/_chunks/{Form-eP5bZwap.js.map → Form-BFi4MXMT.js.map} +1 -1
  26. package/dist/_chunks/{Form-DJOJ-GF1.mjs → Form-C1IcWm1u.mjs} +3 -3
  27. package/dist/_chunks/{Form-DJOJ-GF1.mjs.map → Form-C1IcWm1u.mjs.map} +1 -1
  28. package/dist/_chunks/{History-MnQLtk1g.mjs → History-04ChQ4pl.mjs} +51 -97
  29. package/dist/_chunks/History-04ChQ4pl.mjs.map +1 -0
  30. package/dist/_chunks/{History-B-Mrquzu.js → History-wjcK4L0C.js} +51 -98
  31. package/dist/_chunks/History-wjcK4L0C.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-BcycI8Lw.mjs → ListConfigurationPage-BYqPYLSU.mjs} +6 -5
  33. package/dist/_chunks/ListConfigurationPage-BYqPYLSU.mjs.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-C0n4rUzH.js → ListConfigurationPage-CRbxIC3J.js} +6 -6
  35. package/dist/_chunks/ListConfigurationPage-CRbxIC3J.js.map +1 -0
  36. package/dist/_chunks/{ListViewPage-q0SHVPUS.js → ListViewPage-D5NY9183.js} +63 -41
  37. package/dist/_chunks/ListViewPage-D5NY9183.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-CRXONXwZ.mjs → ListViewPage-FU2LBuhl.mjs} +62 -39
  39. package/dist/_chunks/ListViewPage-FU2LBuhl.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-Bh3komDV.js → NoContentTypePage-BgQVE_Qb.js} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-Bh3komDV.js.map → NoContentTypePage-BgQVE_Qb.js.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-ukzFRF3z.mjs → NoContentTypePage-DCKUkwb8.mjs} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-ukzFRF3z.mjs.map → NoContentTypePage-DCKUkwb8.mjs.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-BGBpj_Y1.js → NoPermissionsPage-C5jwn70o.js} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-BGBpj_Y1.js.map → NoPermissionsPage-C5jwn70o.js.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-B4sD7Ble.mjs → NoPermissionsPage-jqve7C8l.mjs} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-B4sD7Ble.mjs.map → NoPermissionsPage-jqve7C8l.mjs.map} +1 -1
  48. package/dist/_chunks/Preview-BMYN548c.mjs +294 -0
  49. package/dist/_chunks/Preview-BMYN548c.mjs.map +1 -0
  50. package/dist/_chunks/Preview-DaOihysv.js +312 -0
  51. package/dist/_chunks/Preview-DaOihysv.js.map +1 -0
  52. package/dist/_chunks/{Relations-B53wYe8g.js → Relations-CTGM7Hv5.js} +47 -23
  53. package/dist/_chunks/Relations-CTGM7Hv5.js.map +1 -0
  54. package/dist/_chunks/{Relations-CIexb8gr.mjs → Relations-gscPkxjF.mjs} +47 -22
  55. package/dist/_chunks/Relations-gscPkxjF.mjs.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-DbT2sx-Q.js → index-Ca7YWlAA.js} +388 -191
  70. package/dist/_chunks/index-Ca7YWlAA.js.map +1 -0
  71. package/dist/_chunks/{index-CJ2vYwuT.mjs → index-DqasUQ6Q.mjs} +390 -193
  72. package/dist/_chunks/index-DqasUQ6Q.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-CeBSIkmP.js → layout-BW80JSCd.js} +5 -6
  78. package/dist/_chunks/{layout-CeBSIkmP.js.map → layout-BW80JSCd.js.map} +1 -1
  79. package/dist/_chunks/{layout-vzKSrr7p.mjs → layout-W3clJSCy.mjs} +4 -4
  80. package/dist/_chunks/{layout-vzKSrr7p.mjs.map → layout-W3clJSCy.mjs.map} +1 -1
  81. package/dist/_chunks/objects-BcXOv6_9.js.map +1 -1
  82. package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -1
  83. package/dist/_chunks/{relations-DI0lguF0.mjs → relations-BlDkoeWh.mjs} +6 -7
  84. package/dist/_chunks/relations-BlDkoeWh.mjs.map +1 -0
  85. package/dist/_chunks/{relations-Cl-6t9iz.js → relations-C9Usz9k5.js} +6 -7
  86. package/dist/_chunks/relations-C9Usz9k5.js.map +1 -0
  87. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +1 -1
  88. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +1 -1
  89. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  90. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  91. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  92. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  93. package/dist/admin/index.js +2 -1
  94. package/dist/admin/index.js.map +1 -1
  95. package/dist/admin/index.mjs +5 -4
  96. package/dist/admin/src/content-manager.d.ts +3 -2
  97. package/dist/admin/src/exports.d.ts +1 -0
  98. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  99. package/dist/admin/src/pages/EditView/EditViewPage.d.ts +9 -1
  100. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  101. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  102. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  103. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  104. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  105. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  106. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  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 +560 -317
  123. package/dist/server/index.js.map +1 -1
  124. package/dist/server/index.mjs +561 -317
  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/controllers/history-version.d.ts +1 -1
  132. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  133. package/dist/server/src/history/services/history.d.ts +3 -3
  134. package/dist/server/src/history/services/history.d.ts.map +1 -1
  135. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  136. package/dist/server/src/history/services/utils.d.ts +6 -11
  137. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  138. package/dist/server/src/index.d.ts +7 -6
  139. package/dist/server/src/index.d.ts.map +1 -1
  140. package/dist/server/src/preview/controllers/index.d.ts +2 -0
  141. package/dist/server/src/preview/controllers/index.d.ts.map +1 -0
  142. package/dist/server/src/preview/controllers/preview.d.ts +13 -0
  143. package/dist/server/src/preview/controllers/preview.d.ts.map +1 -0
  144. package/dist/server/src/preview/controllers/validation/preview.d.ts +6 -0
  145. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -0
  146. package/dist/server/src/preview/index.d.ts +4 -0
  147. package/dist/server/src/preview/index.d.ts.map +1 -0
  148. package/dist/server/src/preview/routes/index.d.ts +8 -0
  149. package/dist/server/src/preview/routes/index.d.ts.map +1 -0
  150. package/dist/server/src/preview/routes/preview.d.ts +4 -0
  151. package/dist/server/src/preview/routes/preview.d.ts.map +1 -0
  152. package/dist/server/src/preview/services/index.d.ts +16 -0
  153. package/dist/server/src/preview/services/index.d.ts.map +1 -0
  154. package/dist/server/src/preview/services/preview-config.d.ts +32 -0
  155. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -0
  156. package/dist/server/src/preview/services/preview.d.ts +12 -0
  157. package/dist/server/src/preview/services/preview.d.ts.map +1 -0
  158. package/dist/server/src/preview/utils.d.ts +19 -0
  159. package/dist/server/src/preview/utils.d.ts.map +1 -0
  160. package/dist/server/src/register.d.ts.map +1 -1
  161. package/dist/server/src/routes/index.d.ts.map +1 -1
  162. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  163. package/dist/server/src/services/document-metadata.d.ts +12 -10
  164. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  165. package/dist/server/src/services/index.d.ts +7 -6
  166. package/dist/server/src/services/index.d.ts.map +1 -1
  167. package/dist/server/src/services/utils/populate.d.ts +2 -2
  168. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  169. package/dist/server/src/utils/index.d.ts +2 -0
  170. package/dist/server/src/utils/index.d.ts.map +1 -1
  171. package/dist/shared/contracts/index.d.ts +1 -0
  172. package/dist/shared/contracts/index.d.ts.map +1 -1
  173. package/dist/shared/contracts/preview.d.ts +27 -0
  174. package/dist/shared/contracts/preview.d.ts.map +1 -0
  175. package/dist/shared/index.js +4 -0
  176. package/dist/shared/index.js.map +1 -1
  177. package/dist/shared/index.mjs +4 -0
  178. package/dist/shared/index.mjs.map +1 -1
  179. package/package.json +13 -11
  180. package/dist/_chunks/EditViewPage-8mOu02ji.mjs.map +0 -1
  181. package/dist/_chunks/EditViewPage-BMVgUNOX.js.map +0 -1
  182. package/dist/_chunks/Field-CJPYzwD7.mjs.map +0 -1
  183. package/dist/_chunks/Field-CdSLKFQk.js.map +0 -1
  184. package/dist/_chunks/History-B-Mrquzu.js.map +0 -1
  185. package/dist/_chunks/History-MnQLtk1g.mjs.map +0 -1
  186. package/dist/_chunks/ListConfigurationPage-BcycI8Lw.mjs.map +0 -1
  187. package/dist/_chunks/ListConfigurationPage-C0n4rUzH.js.map +0 -1
  188. package/dist/_chunks/ListViewPage-CRXONXwZ.mjs.map +0 -1
  189. package/dist/_chunks/ListViewPage-q0SHVPUS.js.map +0 -1
  190. package/dist/_chunks/Relations-B53wYe8g.js.map +0 -1
  191. package/dist/_chunks/Relations-CIexb8gr.mjs.map +0 -1
  192. package/dist/_chunks/index-CJ2vYwuT.mjs.map +0 -1
  193. package/dist/_chunks/index-DbT2sx-Q.js.map +0 -1
  194. package/dist/_chunks/relations-Cl-6t9iz.js.map +0 -1
  195. package/dist/_chunks/relations-DI0lguF0.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
  }, []);
@@ -1661,10 +1693,10 @@ const useDocumentActions = () => {
1661
1693
  update
1662
1694
  };
1663
1695
  };
1664
- const ProtectedHistoryPage = lazy(
1665
- () => import("./History-MnQLtk1g.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1696
+ const ProtectedHistoryPage = React.lazy(
1697
+ () => import("./History-04ChQ4pl.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1666
1698
  );
1667
- const routes$1 = [
1699
+ const routes$2 = [
1668
1700
  {
1669
1701
  path: ":collectionType/:slug/:id/history",
1670
1702
  Component: ProtectedHistoryPage
@@ -1674,32 +1706,45 @@ const routes$1 = [
1674
1706
  Component: ProtectedHistoryPage
1675
1707
  }
1676
1708
  ];
1709
+ const ProtectedPreviewPage = React.lazy(
1710
+ () => import("./Preview-BMYN548c.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
+ ];
1677
1722
  const ProtectedEditViewPage = lazy(
1678
- () => import("./EditViewPage-8mOu02ji.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1723
+ () => import("./EditViewPage-BPyVuPfM.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1679
1724
  );
1680
1725
  const ProtectedListViewPage = lazy(
1681
- () => import("./ListViewPage-CRXONXwZ.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1726
+ () => import("./ListViewPage-FU2LBuhl.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1682
1727
  );
1683
1728
  const ProtectedListConfiguration = lazy(
1684
- () => import("./ListConfigurationPage-BcycI8Lw.mjs").then((mod) => ({
1729
+ () => import("./ListConfigurationPage-BYqPYLSU.mjs").then((mod) => ({
1685
1730
  default: mod.ProtectedListConfiguration
1686
1731
  }))
1687
1732
  );
1688
1733
  const ProtectedEditConfigurationPage = lazy(
1689
- () => import("./EditConfigurationPage-tVCJ5vWC.mjs").then((mod) => ({
1734
+ () => import("./EditConfigurationPage-DsPR2DVk.mjs").then((mod) => ({
1690
1735
  default: mod.ProtectedEditConfigurationPage
1691
1736
  }))
1692
1737
  );
1693
1738
  const ProtectedComponentConfigurationPage = lazy(
1694
- () => import("./ComponentConfigurationPage-CQroR9Qk.mjs").then((mod) => ({
1739
+ () => import("./ComponentConfigurationPage-CtIa3aa2.mjs").then((mod) => ({
1695
1740
  default: mod.ProtectedComponentConfigurationPage
1696
1741
  }))
1697
1742
  );
1698
1743
  const NoPermissions = lazy(
1699
- () => import("./NoPermissionsPage-B4sD7Ble.mjs").then((mod) => ({ default: mod.NoPermissions }))
1744
+ () => import("./NoPermissionsPage-jqve7C8l.mjs").then((mod) => ({ default: mod.NoPermissions }))
1700
1745
  );
1701
1746
  const NoContentType = lazy(
1702
- () => import("./NoContentTypePage-ukzFRF3z.mjs").then((mod) => ({ default: mod.NoContentType }))
1747
+ () => import("./NoContentTypePage-DCKUkwb8.mjs").then((mod) => ({ default: mod.NoContentType }))
1703
1748
  );
1704
1749
  const CollectionTypePages = () => {
1705
1750
  const { collectionType } = useParams();
@@ -1711,7 +1756,7 @@ const CollectionTypePages = () => {
1711
1756
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1712
1757
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1713
1758
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1714
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1759
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1715
1760
  const routes = [
1716
1761
  {
1717
1762
  path: LIST_RELATIVE_PATH,
@@ -1745,6 +1790,7 @@ const routes = [
1745
1790
  path: "no-content-types",
1746
1791
  Component: NoContentType
1747
1792
  },
1793
+ ...routes$2,
1748
1794
  ...routes$1
1749
1795
  ];
1750
1796
  const DocumentActions = ({ actions: actions2 }) => {
@@ -1843,6 +1889,11 @@ const DocumentActionButton = (action) => {
1843
1889
  ) : null
1844
1890
  ] });
1845
1891
  };
1892
+ const MenuItem = styled(Menu.Item)`
1893
+ &:hover {
1894
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
1895
+ }
1896
+ `;
1846
1897
  const DocumentActionsMenu = ({
1847
1898
  actions: actions2,
1848
1899
  children,
@@ -1901,48 +1952,32 @@ const DocumentActionsMenu = ({
1901
1952
  /* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1902
1953
  actions2.map((action) => {
1903
1954
  return /* @__PURE__ */ jsx(
1904
- Menu.Item,
1955
+ MenuItem,
1905
1956
  {
1906
1957
  disabled: action.disabled,
1907
1958
  onSelect: handleClick(action),
1908
1959
  display: "block",
1909
- children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
1910
- /* @__PURE__ */ jsxs(
1911
- Flex,
1912
- {
1913
- color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1914
- gap: 2,
1915
- tag: "span",
1916
- children: [
1917
- /* @__PURE__ */ jsx(
1918
- Flex,
1919
- {
1920
- tag: "span",
1921
- color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1922
- children: action.icon
1923
- }
1924
- ),
1925
- action.label
1926
- ]
1927
- }
1928
- ),
1929
- action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
1930
- Flex,
1931
- {
1932
- alignItems: "center",
1933
- background: "alternative100",
1934
- borderStyle: "solid",
1935
- borderColor: "alternative200",
1936
- borderWidth: "1px",
1937
- height: 5,
1938
- paddingLeft: 2,
1939
- paddingRight: 2,
1940
- hasRadius: true,
1941
- color: "alternative600",
1942
- children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
1943
- }
1944
- )
1945
- ] })
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
+ ) })
1946
1981
  },
1947
1982
  action.id
1948
1983
  );
@@ -2053,6 +2088,18 @@ const DocumentActionModal = ({
2053
2088
  typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
2054
2089
  ] }) });
2055
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
+ };
2056
2103
  const PublishAction$1 = ({
2057
2104
  activeTab,
2058
2105
  documentId,
@@ -2067,6 +2114,7 @@ const PublishAction$1 = ({
2067
2114
  const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
2068
2115
  const isListView = useMatch(LIST_PATH) !== null;
2069
2116
  const isCloning = useMatch(CLONE_PATH) !== null;
2117
+ const { id } = useParams();
2070
2118
  const { formatMessage } = useIntl();
2071
2119
  const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
2072
2120
  const { publish } = useDocumentActions();
@@ -2166,13 +2214,15 @@ const PublishAction$1 = ({
2166
2214
  documentId,
2167
2215
  params
2168
2216
  },
2169
- formValues
2217
+ transformData(formValues)
2170
2218
  );
2171
2219
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2172
- navigate({
2173
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2174
- search: rawQuery
2175
- });
2220
+ if (id === "create") {
2221
+ navigate({
2222
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2223
+ search: rawQuery
2224
+ });
2225
+ }
2176
2226
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2177
2227
  setErrors(formatValidationErrors(res.error));
2178
2228
  }
@@ -2225,6 +2275,7 @@ const PublishAction$1 = ({
2225
2275
  };
2226
2276
  };
2227
2277
  PublishAction$1.type = "publish";
2278
+ PublishAction$1.position = "panel";
2228
2279
  const UpdateAction = ({
2229
2280
  activeTab,
2230
2281
  documentId,
@@ -2247,96 +2298,134 @@ const UpdateAction = ({
2247
2298
  const validate = useForm("UpdateAction", (state) => state.validate);
2248
2299
  const setErrors = useForm("UpdateAction", (state) => state.setErrors);
2249
2300
  const resetForm = useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
2250
- return {
2251
- /**
2252
- * Disabled when:
2253
- * - the form is submitting
2254
- * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2255
- * - the active tab is the published tab
2256
- */
2257
- disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2258
- label: formatMessage({
2259
- id: "content-manager.containers.Edit.save",
2260
- defaultMessage: "Save"
2261
- }),
2262
- onClick: async () => {
2263
- setSubmitting(true);
2264
- try {
2265
- const { errors } = await validate(true, {
2266
- 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
+ })
2267
2317
  });
2268
- if (errors) {
2269
- toggleNotification({
2270
- type: "danger",
2271
- message: formatMessage({
2272
- id: "content-manager.validation.error",
2273
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
2274
- })
2275
- });
2276
- return;
2277
- }
2278
- if (isCloning) {
2279
- const res = await clone(
2280
- {
2281
- model,
2282
- documentId: cloneMatch.params.origin,
2283
- params
2284
- },
2285
- document
2286
- );
2287
- if ("data" in res) {
2288
- navigate(
2289
- {
2290
- pathname: `../${res.data.documentId}`,
2291
- search: rawQuery
2292
- },
2293
- { relative: "path" }
2294
- );
2295
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2296
- setErrors(formatValidationErrors(res.error));
2297
- }
2298
- } else if (documentId || collectionType === SINGLE_TYPES) {
2299
- 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(
2300
2331
  {
2301
- collectionType,
2302
- model,
2303
- documentId,
2304
- params
2332
+ pathname: `../${res.data.documentId}`,
2333
+ search: rawQuery
2305
2334
  },
2306
- document
2335
+ { relative: "path" }
2307
2336
  );
2308
- if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2309
- setErrors(formatValidationErrors(res.error));
2310
- } else {
2311
- resetForm();
2312
- }
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));
2313
2352
  } else {
2314
- 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(
2315
2365
  {
2316
- model,
2317
- params
2366
+ pathname: `../${res.data.documentId}`,
2367
+ search: rawQuery
2318
2368
  },
2319
- document
2369
+ { replace: true, relative: "path" }
2320
2370
  );
2321
- if ("data" in res && collectionType !== SINGLE_TYPES) {
2322
- navigate(
2323
- {
2324
- pathname: `../${res.data.documentId}`,
2325
- search: rawQuery
2326
- },
2327
- { replace: true, relative: "path" }
2328
- );
2329
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2330
- setErrors(formatValidationErrors(res.error));
2331
- }
2371
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2372
+ setErrors(formatValidationErrors(res.error));
2332
2373
  }
2333
- } finally {
2334
- setSubmitting(false);
2335
2374
  }
2375
+ } finally {
2376
+ setSubmitting(false);
2336
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
2337
2425
  };
2338
2426
  };
2339
2427
  UpdateAction.type = "update";
2428
+ UpdateAction.position = "panel";
2340
2429
  const UNPUBLISH_DRAFT_OPTIONS = {
2341
2430
  KEEP: "keep",
2342
2431
  DISCARD: "discard"
@@ -2459,6 +2548,7 @@ const UnpublishAction$1 = ({
2459
2548
  };
2460
2549
  };
2461
2550
  UnpublishAction$1.type = "unpublish";
2551
+ UnpublishAction$1.position = "panel";
2462
2552
  const DiscardAction = ({
2463
2553
  activeTab,
2464
2554
  documentId,
@@ -2509,6 +2599,7 @@ const DiscardAction = ({
2509
2599
  };
2510
2600
  };
2511
2601
  DiscardAction.type = "discard";
2602
+ DiscardAction.position = "panel";
2512
2603
  const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
2513
2604
  const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
2514
2605
  const RelativeTime = React.forwardRef(
@@ -2521,7 +2612,7 @@ const RelativeTime = React.forwardRef(
2521
2612
  });
2522
2613
  const unit = intervals.find((intervalUnit) => {
2523
2614
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2524
- });
2615
+ }) ?? "seconds";
2525
2616
  const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
2526
2617
  const customInterval = customIntervals.find(
2527
2618
  (custom) => interval[custom.unit] < custom.threshold
@@ -2555,19 +2646,29 @@ const getDisplayName = ({
2555
2646
  return email ?? "";
2556
2647
  };
2557
2648
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2558
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2649
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2559
2650
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2560
- 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
+ }) }) });
2561
2656
  };
2562
2657
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2563
2658
  const { formatMessage } = useIntl();
2564
2659
  const isCloning = useMatch(CLONE_PATH) !== null;
2660
+ const params = useParams();
2565
2661
  const title = isCreating ? formatMessage({
2566
2662
  id: "content-manager.containers.edit.title.new",
2567
2663
  defaultMessage: "Create an entry"
2568
2664
  }) : documentTitle;
2569
2665
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2570
- /* @__PURE__ */ jsx(BackButton, {}),
2666
+ /* @__PURE__ */ jsx(
2667
+ BackButton,
2668
+ {
2669
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2670
+ }
2671
+ ),
2571
2672
  /* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2572
2673
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
2573
2674
  /* @__PURE__ */ jsx(HeaderToolbar, {})
@@ -2618,7 +2719,7 @@ const HeaderToolbar = () => {
2618
2719
  meta: isCloning ? void 0 : meta,
2619
2720
  collectionType
2620
2721
  },
2621
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
2722
+ descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
2622
2723
  children: (actions2) => {
2623
2724
  const headerActions = actions2.filter((action) => {
2624
2725
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -2826,6 +2927,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
2826
2927
  };
2827
2928
  };
2828
2929
  ConfigureTheViewAction.type = "configure-the-view";
2930
+ ConfigureTheViewAction.position = "header";
2829
2931
  const EditTheModelAction = ({ model }) => {
2830
2932
  const navigate = useNavigate();
2831
2933
  const { formatMessage } = useIntl();
@@ -2842,6 +2944,7 @@ const EditTheModelAction = ({ model }) => {
2842
2944
  };
2843
2945
  };
2844
2946
  EditTheModelAction.type = "edit-the-model";
2947
+ EditTheModelAction.position = "header";
2845
2948
  const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2846
2949
  const navigate = useNavigate();
2847
2950
  const { formatMessage } = useIntl();
@@ -2915,6 +3018,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2915
3018
  };
2916
3019
  };
2917
3020
  DeleteAction$1.type = "delete";
3021
+ DeleteAction$1.position = ["header", "table-row"];
2918
3022
  const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
2919
3023
  const Panels = () => {
2920
3024
  const isCloning = useMatch(CLONE_PATH) !== null;
@@ -2977,7 +3081,7 @@ const ActionsPanelContent = () => {
2977
3081
  DescriptionComponentRenderer,
2978
3082
  {
2979
3083
  props,
2980
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
3084
+ descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
2981
3085
  children: (actions2) => /* @__PURE__ */ jsx(DocumentActions, { actions: actions2 })
2982
3086
  }
2983
3087
  ),
@@ -3004,7 +3108,7 @@ const Panel = React.forwardRef(({ children, title }, ref) => {
3004
3108
  justifyContent: "stretch",
3005
3109
  alignItems: "flex-start",
3006
3110
  children: [
3007
- /* @__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 }),
3008
3112
  children
3009
3113
  ]
3010
3114
  }
@@ -3254,18 +3358,10 @@ const SelectedEntriesTableContent = ({
3254
3358
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3255
3359
  },
3256
3360
  state: { from: pathname },
3257
- label: formatMessage(
3258
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3259
- {
3260
- target: formatMessage(
3261
- {
3262
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3263
- defaultMessage: "item line {number}"
3264
- },
3265
- { number: index2 + 1 }
3266
- )
3267
- }
3268
- ),
3361
+ label: formatMessage({
3362
+ id: "content-manager.bulk-publish.edit",
3363
+ defaultMessage: "Edit"
3364
+ }),
3269
3365
  target: "_blank",
3270
3366
  marginLeft: "auto",
3271
3367
  variant: "ghost",
@@ -3439,8 +3535,7 @@ const PublishAction = ({ documents, model }) => {
3439
3535
  const refetchList = () => {
3440
3536
  contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
3441
3537
  };
3442
- if (!showPublishButton)
3443
- return null;
3538
+ if (!showPublishButton) return null;
3444
3539
  return {
3445
3540
  actionType: "publish",
3446
3541
  variant: "tertiary",
@@ -3508,8 +3603,7 @@ const DeleteAction = ({ documents, model }) => {
3508
3603
  selectRow([]);
3509
3604
  }
3510
3605
  };
3511
- if (!hasDeletePermission)
3512
- return null;
3606
+ if (!hasDeletePermission) return null;
3513
3607
  return {
3514
3608
  variant: "danger-light",
3515
3609
  label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
@@ -3558,8 +3652,7 @@ const UnpublishAction = ({ documents, model }) => {
3558
3652
  }
3559
3653
  };
3560
3654
  const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
3561
- if (!showUnpublishButton)
3562
- return null;
3655
+ if (!showUnpublishButton) return null;
3563
3656
  return {
3564
3657
  variant: "tertiary",
3565
3658
  label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
@@ -3664,7 +3757,7 @@ const TableActions = ({ document }) => {
3664
3757
  DescriptionComponentRenderer,
3665
3758
  {
3666
3759
  props,
3667
- 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"),
3668
3761
  children: (actions2) => {
3669
3762
  const tableRowActions = actions2.filter((action) => {
3670
3763
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -3723,6 +3816,7 @@ const EditAction = ({ documentId }) => {
3723
3816
  };
3724
3817
  };
3725
3818
  EditAction.type = "edit";
3819
+ EditAction.position = "table-row";
3726
3820
  const StyledPencil = styled(Pencil)`
3727
3821
  path {
3728
3822
  fill: currentColor;
@@ -3799,6 +3893,7 @@ const CloneAction = ({ model, documentId }) => {
3799
3893
  };
3800
3894
  };
3801
3895
  CloneAction.type = "clone";
3896
+ CloneAction.position = "table-row";
3802
3897
  const StyledDuplicate = styled(Duplicate)`
3803
3898
  path {
3804
3899
  fill: currentColor;
@@ -3885,7 +3980,14 @@ class ContentManagerPlugin {
3885
3980
  addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
3886
3981
  addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
3887
3982
  getBulkActions: () => this.bulkActions,
3888
- 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
+ },
3889
3991
  getEditViewSidePanels: () => this.editViewSidePanels,
3890
3992
  getHeaderActions: () => this.headerActions
3891
3993
  }
@@ -3895,10 +3997,8 @@ class ContentManagerPlugin {
3895
3997
  const getPrintableType = (value) => {
3896
3998
  const nativeType = typeof value;
3897
3999
  if (nativeType === "object") {
3898
- if (value === null)
3899
- return "null";
3900
- if (Array.isArray(value))
3901
- return "array";
4000
+ if (value === null) return "null";
4001
+ if (Array.isArray(value)) return "array";
3902
4002
  if (value instanceof Object && value.constructor.name !== "Object") {
3903
4003
  return value.constructor.name;
3904
4004
  }
@@ -3909,17 +4009,27 @@ const HistoryAction = ({ model, document }) => {
3909
4009
  const { formatMessage } = useIntl();
3910
4010
  const [{ query }] = useQueryParams();
3911
4011
  const navigate = useNavigate();
4012
+ const { trackUsage } = useTracking();
4013
+ const { pathname } = useLocation();
3912
4014
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
3913
4015
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3914
4016
  return null;
3915
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
+ };
3916
4026
  return {
3917
4027
  icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
3918
4028
  label: formatMessage({
3919
4029
  id: "content-manager.history.document-action",
3920
4030
  defaultMessage: "Content History"
3921
4031
  }),
3922
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
4032
+ onClick: handleOnClick,
3923
4033
  disabled: (
3924
4034
  /**
3925
4035
  * The user is creating a new document.
@@ -3941,6 +4051,7 @@ const HistoryAction = ({ model, document }) => {
3941
4051
  };
3942
4052
  };
3943
4053
  HistoryAction.type = "history";
4054
+ HistoryAction.position = "header";
3944
4055
  const historyAdmin = {
3945
4056
  bootstrap(app) {
3946
4057
  const { addDocumentAction } = app.getPlugin("content-manager").apis;
@@ -3987,6 +4098,88 @@ const { setInitialData } = actions;
3987
4098
  const reducer = combineReducers({
3988
4099
  app: reducer$1
3989
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
+ };
3990
4183
  const index = {
3991
4184
  register(app) {
3992
4185
  const cm = new ContentManagerPlugin();
@@ -4006,7 +4199,7 @@ const index = {
4006
4199
  app.router.addRoute({
4007
4200
  path: "content-manager/*",
4008
4201
  lazy: async () => {
4009
- const { Layout } = await import("./layout-vzKSrr7p.mjs");
4202
+ const { Layout } = await import("./layout-W3clJSCy.mjs");
4010
4203
  return {
4011
4204
  Component: Layout
4012
4205
  };
@@ -4019,11 +4212,14 @@ const index = {
4019
4212
  if (typeof historyAdmin.bootstrap === "function") {
4020
4213
  historyAdmin.bootstrap(app);
4021
4214
  }
4215
+ if (typeof previewAdmin.bootstrap === "function") {
4216
+ previewAdmin.bootstrap(app);
4217
+ }
4022
4218
  },
4023
4219
  async registerTrads({ locales }) {
4024
4220
  const importedTrads = await Promise.all(
4025
4221
  locales.map((locale) => {
4026
- 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 }) => {
4027
4223
  return {
4028
4224
  data: prefixPluginTranslations(data, PLUGIN_ID),
4029
4225
  locale
@@ -4050,9 +4246,10 @@ export {
4050
4246
  HOOKS as H,
4051
4247
  InjectionZone as I,
4052
4248
  useDocument as J,
4053
- index as K,
4054
- useContentManagerContext as L,
4055
- useDocumentActions as M,
4249
+ useGetPreviewUrlQuery as K,
4250
+ index as L,
4251
+ useContentManagerContext as M,
4252
+ useDocumentActions as N,
4056
4253
  Panels as P,
4057
4254
  RelativeTime as R,
4058
4255
  SINGLE_TYPES as S,
@@ -4084,4 +4281,4 @@ export {
4084
4281
  capitalise as y,
4085
4282
  useUpdateContentTypeConfigurationMutation as z
4086
4283
  };
4087
- //# sourceMappingURL=index-CJ2vYwuT.mjs.map
4284
+ //# sourceMappingURL=index-DqasUQ6Q.mjs.map