@strapi/content-manager 0.0.0-next.8f63e1055db761e0213cb6610f80c55658196ae1 → 0.0.0-next.926e9af9369b89a571145e3c8fa1ce6bfd6cc0ab

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 (160) 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-Cmm0LJof.js → ComponentConfigurationPage-DMxUlNOo.js} +4 -5
  4. package/dist/_chunks/{ComponentConfigurationPage-Cmm0LJof.js.map → ComponentConfigurationPage-DMxUlNOo.js.map} +1 -1
  5. package/dist/_chunks/{ComponentConfigurationPage-FQd019My.mjs → ComponentConfigurationPage-baEkO-OV.mjs} +3 -3
  6. package/dist/_chunks/{ComponentConfigurationPage-FQd019My.mjs.map → ComponentConfigurationPage-baEkO-OV.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-CseHna9y.js → EditConfigurationPage-CXxV7mKn.js} +4 -5
  11. package/dist/_chunks/{EditConfigurationPage-CseHna9y.js.map → EditConfigurationPage-CXxV7mKn.js.map} +1 -1
  12. package/dist/_chunks/{EditConfigurationPage-BUJqRuRq.mjs → EditConfigurationPage-YR8-4VCS.mjs} +3 -3
  13. package/dist/_chunks/{EditConfigurationPage-BUJqRuRq.mjs.map → EditConfigurationPage-YR8-4VCS.mjs.map} +1 -1
  14. package/dist/_chunks/{EditViewPage-BhjvFXZr.js → EditViewPage-BfR6jAR6.js} +22 -78
  15. package/dist/_chunks/EditViewPage-BfR6jAR6.js.map +1 -0
  16. package/dist/_chunks/{EditViewPage-BB9VeS-u.mjs → EditViewPage-DFF7c27p.mjs} +19 -74
  17. package/dist/_chunks/EditViewPage-DFF7c27p.mjs.map +1 -0
  18. package/dist/_chunks/FieldTypeIcon-CMlNO8PE.mjs.map +1 -1
  19. package/dist/_chunks/FieldTypeIcon-Dnwq_IRF.js.map +1 -1
  20. package/dist/_chunks/{Form-DH5m7r5s.js → Form-CjcMRP5A.js} +5 -6
  21. package/dist/_chunks/{Form-DH5m7r5s.js.map → Form-CjcMRP5A.js.map} +1 -1
  22. package/dist/_chunks/{Form-B5b7zgoL.mjs → Form-MSOSfGGN.mjs} +3 -3
  23. package/dist/_chunks/{Form-B5b7zgoL.mjs.map → Form-MSOSfGGN.mjs.map} +1 -1
  24. package/dist/_chunks/{History-CNO4Db6U.js → History-BgZ7gVuF.js} +48 -72
  25. package/dist/_chunks/History-BgZ7gVuF.js.map +1 -0
  26. package/dist/_chunks/{History-Dhy0xF0L.mjs → History-WOQNVho-.mjs} +37 -60
  27. package/dist/_chunks/History-WOQNVho-.mjs.map +1 -0
  28. package/dist/_chunks/{Field-CWi7XMCa.mjs → Input-BkKwZ6Qt.mjs} +1245 -1243
  29. package/dist/_chunks/Input-BkKwZ6Qt.mjs.map +1 -0
  30. package/dist/_chunks/{Field-B03STsf9.js → Input-BwOibhc3.js} +1331 -1329
  31. package/dist/_chunks/Input-BwOibhc3.js.map +1 -0
  32. package/dist/_chunks/{ListConfigurationPage-C_FCilGf.mjs → ListConfigurationPage-BeXfr6uW.mjs} +6 -5
  33. package/dist/_chunks/ListConfigurationPage-BeXfr6uW.mjs.map +1 -0
  34. package/dist/_chunks/{ListConfigurationPage-DE7NESsr.js → ListConfigurationPage-DnJ3nbwL.js} +6 -6
  35. package/dist/_chunks/ListConfigurationPage-DnJ3nbwL.js.map +1 -0
  36. package/dist/_chunks/{ListViewPage-C7p0PteR.js → ListViewPage-CJFDudKl.js} +61 -58
  37. package/dist/_chunks/ListViewPage-CJFDudKl.js.map +1 -0
  38. package/dist/_chunks/{ListViewPage-B6Ut2BH0.mjs → ListViewPage-VK2v44Q1.mjs} +55 -51
  39. package/dist/_chunks/ListViewPage-VK2v44Q1.mjs.map +1 -0
  40. package/dist/_chunks/{NoContentTypePage-rR7QwWP5.mjs → NoContentTypePage-T8ttty6K.mjs} +2 -2
  41. package/dist/_chunks/{NoContentTypePage-rR7QwWP5.mjs.map → NoContentTypePage-T8ttty6K.mjs.map} +1 -1
  42. package/dist/_chunks/{NoContentTypePage-BN-8niig.js → NoContentTypePage-en2PwWgI.js} +2 -2
  43. package/dist/_chunks/{NoContentTypePage-BN-8niig.js.map → NoContentTypePage-en2PwWgI.js.map} +1 -1
  44. package/dist/_chunks/{NoPermissionsPage-Bw3b0OQm.js → NoPermissionsPage-CcjILry3.js} +2 -2
  45. package/dist/_chunks/{NoPermissionsPage-Bw3b0OQm.js.map → NoPermissionsPage-CcjILry3.js.map} +1 -1
  46. package/dist/_chunks/{NoPermissionsPage-CGUgxmce.mjs → NoPermissionsPage-CokBHhhy.mjs} +2 -2
  47. package/dist/_chunks/{NoPermissionsPage-CGUgxmce.mjs.map → NoPermissionsPage-CokBHhhy.mjs.map} +1 -1
  48. package/dist/_chunks/{Preview-_gomrUna.mjs → Preview-BF81YhRj.mjs} +75 -76
  49. package/dist/_chunks/Preview-BF81YhRj.mjs.map +1 -0
  50. package/dist/_chunks/{Preview-CICG4cRf.js → Preview-DgzAuzWQ.js} +74 -76
  51. package/dist/_chunks/Preview-DgzAuzWQ.js.map +1 -0
  52. package/dist/_chunks/{Relations-uyLoal2t.js → Relations-1O-JcM4t.js} +7 -10
  53. package/dist/_chunks/{Relations-uyLoal2t.js.map → Relations-1O-JcM4t.js.map} +1 -1
  54. package/dist/_chunks/{Relations-BEvinUkU.mjs → Relations-BncdhGCd.mjs} +6 -8
  55. package/dist/_chunks/{Relations-BEvinUkU.mjs.map → Relations-BncdhGCd.mjs.map} +1 -1
  56. package/dist/_chunks/{en-D_BMf0hT.mjs → en-BZaUty0m.mjs} +12 -3
  57. package/dist/_chunks/{en-D_BMf0hT.mjs.map → en-BZaUty0m.mjs.map} +1 -1
  58. package/dist/_chunks/{en-CHOp_xJv.js → en-CzCnBk4S.js} +12 -3
  59. package/dist/_chunks/{en-CHOp_xJv.js.map → en-CzCnBk4S.js.map} +1 -1
  60. package/dist/_chunks/hooks-BAaaKPS_.js.map +1 -1
  61. package/dist/_chunks/{index-BagcPV6I.mjs → index-DiluOUp6.mjs} +462 -226
  62. package/dist/_chunks/index-DiluOUp6.mjs.map +1 -0
  63. package/dist/_chunks/{index-D_AvCmmG.js → index-EXJvmn4t.js} +445 -210
  64. package/dist/_chunks/index-EXJvmn4t.js.map +1 -0
  65. package/dist/_chunks/{layout-Dk0odfYR.js → layout-4TbKVax8.js} +5 -6
  66. package/dist/_chunks/{layout-Dk0odfYR.js.map → layout-4TbKVax8.js.map} +1 -1
  67. package/dist/_chunks/{layout-DKEX3X49.mjs → layout-mSwsYzxv.mjs} +4 -4
  68. package/dist/_chunks/{layout-DKEX3X49.mjs.map → layout-mSwsYzxv.mjs.map} +1 -1
  69. package/dist/_chunks/objects-BcXOv6_9.js.map +1 -1
  70. package/dist/_chunks/objects-D6yBsdmx.mjs.map +1 -1
  71. package/dist/_chunks/{relations-DDoMdwk6.mjs → relations--YOvQBqv.mjs} +2 -2
  72. package/dist/_chunks/{relations-DDoMdwk6.mjs.map → relations--YOvQBqv.mjs.map} +1 -1
  73. package/dist/_chunks/{relations-C312DwGU.js → relations-Ai6Izh7h.js} +2 -2
  74. package/dist/_chunks/{relations-C312DwGU.js.map → relations-Ai6Izh7h.js.map} +1 -1
  75. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js → useDragAndDrop-BMtgCYzL.js} +5 -9
  76. package/dist/_chunks/{useDragAndDrop-J0TUUbR6.js.map → useDragAndDrop-BMtgCYzL.js.map} +1 -1
  77. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs → useDragAndDrop-DJ6jqvZN.mjs} +4 -7
  78. package/dist/_chunks/{useDragAndDrop-DdHgKsqq.mjs.map → useDragAndDrop-DJ6jqvZN.mjs.map} +1 -1
  79. package/dist/_chunks/{useDebounce-DmuSJIF3.mjs → usePrev-CZGy2Vjf.mjs} +11 -11
  80. package/dist/_chunks/usePrev-CZGy2Vjf.mjs.map +1 -0
  81. package/dist/_chunks/{useDebounce-CtcjDB3L.js → usePrev-D5J_2fEu.js} +8 -8
  82. package/dist/_chunks/usePrev-D5J_2fEu.js.map +1 -0
  83. package/dist/admin/index.js +2 -1
  84. package/dist/admin/index.js.map +1 -1
  85. package/dist/admin/index.mjs +6 -5
  86. package/dist/admin/src/content-manager.d.ts +3 -2
  87. package/dist/admin/src/exports.d.ts +1 -0
  88. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  89. package/dist/admin/src/hooks/useDocument.d.ts +19 -2
  90. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +1 -1
  91. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +3 -3
  92. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  93. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  94. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  95. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  96. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  97. package/dist/admin/src/pages/EditView/components/FormLayout.d.ts +27 -0
  98. package/dist/admin/src/pages/EditView/utils/data.d.ts +1 -0
  99. package/dist/admin/src/preview/pages/Preview.d.ts +1 -1
  100. package/dist/admin/src/preview/services/preview.d.ts +1 -1
  101. package/dist/admin/src/router.d.ts +1 -1
  102. package/dist/admin/src/services/api.d.ts +1 -1
  103. package/dist/admin/src/services/components.d.ts +2 -2
  104. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  105. package/dist/admin/src/services/documents.d.ts +16 -19
  106. package/dist/admin/src/services/init.d.ts +1 -1
  107. package/dist/admin/src/services/relations.d.ts +2 -2
  108. package/dist/admin/src/services/uid.d.ts +3 -3
  109. package/dist/server/index.js +230 -187
  110. package/dist/server/index.js.map +1 -1
  111. package/dist/server/index.mjs +231 -187
  112. package/dist/server/index.mjs.map +1 -1
  113. package/dist/server/src/controllers/utils/metadata.d.ts +1 -0
  114. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  115. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  116. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  117. package/dist/server/src/history/services/history.d.ts +3 -3
  118. package/dist/server/src/history/services/history.d.ts.map +1 -1
  119. package/dist/server/src/history/services/utils.d.ts +6 -10
  120. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  121. package/dist/server/src/index.d.ts +3 -2
  122. package/dist/server/src/index.d.ts.map +1 -1
  123. package/dist/server/src/preview/controllers/validation/preview.d.ts.map +1 -1
  124. package/dist/server/src/preview/index.d.ts.map +1 -1
  125. package/dist/server/src/preview/services/index.d.ts +1 -0
  126. package/dist/server/src/preview/services/index.d.ts.map +1 -1
  127. package/dist/server/src/preview/services/preview-config.d.ts +2 -0
  128. package/dist/server/src/preview/services/preview-config.d.ts.map +1 -1
  129. package/dist/server/src/preview/utils.d.ts +1 -0
  130. package/dist/server/src/preview/utils.d.ts.map +1 -1
  131. package/dist/server/src/register.d.ts.map +1 -1
  132. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  133. package/dist/server/src/services/document-metadata.d.ts +4 -2
  134. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  135. package/dist/server/src/services/index.d.ts +3 -2
  136. package/dist/server/src/services/index.d.ts.map +1 -1
  137. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  138. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  139. package/dist/server/src/services/utils/populate.d.ts +2 -2
  140. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  141. package/package.json +12 -11
  142. package/dist/_chunks/EditViewPage-BB9VeS-u.mjs.map +0 -1
  143. package/dist/_chunks/EditViewPage-BhjvFXZr.js.map +0 -1
  144. package/dist/_chunks/Field-B03STsf9.js.map +0 -1
  145. package/dist/_chunks/Field-CWi7XMCa.mjs.map +0 -1
  146. package/dist/_chunks/History-CNO4Db6U.js.map +0 -1
  147. package/dist/_chunks/History-Dhy0xF0L.mjs.map +0 -1
  148. package/dist/_chunks/ListConfigurationPage-C_FCilGf.mjs.map +0 -1
  149. package/dist/_chunks/ListConfigurationPage-DE7NESsr.js.map +0 -1
  150. package/dist/_chunks/ListViewPage-B6Ut2BH0.mjs.map +0 -1
  151. package/dist/_chunks/ListViewPage-C7p0PteR.js.map +0 -1
  152. package/dist/_chunks/Preview-CICG4cRf.js.map +0 -1
  153. package/dist/_chunks/Preview-_gomrUna.mjs.map +0 -1
  154. package/dist/_chunks/index-BagcPV6I.mjs.map +0 -1
  155. package/dist/_chunks/index-D_AvCmmG.js.map +0 -1
  156. package/dist/_chunks/useDebounce-CtcjDB3L.js.map +0 -1
  157. package/dist/_chunks/useDebounce-DmuSJIF3.mjs.map +0 -1
  158. package/dist/admin/src/preview/constants.d.ts +0 -1
  159. package/dist/server/src/preview/constants.d.ts +0 -2
  160. package/dist/server/src/preview/constants.d.ts.map +0 -1
@@ -3,24 +3,32 @@ 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
7
  import mapValues from "lodash/fp/mapValues";
8
8
  import { useIntl } from "react-intl";
9
9
  import { useParams, useNavigate, Navigate, useMatch, useLocation, Link, NavLink } from "react-router-dom";
10
+ import { styled } from "styled-components";
10
11
  import * as yup from "yup";
11
12
  import { ValidationError } from "yup";
13
+ import { generateNKeysBetween } from "fractional-indexing";
12
14
  import pipe from "lodash/fp/pipe";
13
- import { intervalToDuration, isPast } from "date-fns";
14
- import { styled } from "styled-components";
15
15
  import { stringify } from "qs";
16
+ import { intervalToDuration, isPast } from "date-fns";
16
17
  import { createSlice, combineReducers } from "@reduxjs/toolkit";
17
- const __variableDynamicImportRuntimeHelper = (glob, path) => {
18
+ const __variableDynamicImportRuntimeHelper = (glob, path, segs) => {
18
19
  const v = glob[path];
19
20
  if (v) {
20
21
  return typeof v === "function" ? v() : Promise.resolve(v);
21
22
  }
22
23
  return new Promise((_, reject) => {
23
- (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(reject.bind(null, new Error("Unknown variable dynamic import: " + path)));
24
+ (typeof queueMicrotask === "function" ? queueMicrotask : setTimeout)(
25
+ reject.bind(
26
+ null,
27
+ new Error(
28
+ "Unknown variable dynamic import: " + path + (path.split("/").length !== segs ? ". Note that variables only represent file names one level deep." : "")
29
+ )
30
+ )
31
+ );
24
32
  });
25
33
  };
26
34
  const PLUGIN_ID = "content-manager";
@@ -159,6 +167,113 @@ const extractAndDedupeFields = (permissions = []) => permissions.flatMap((permis
159
167
  (field, index2, arr) => arr.indexOf(field) === index2 && typeof field === "string"
160
168
  );
161
169
  const removeNumericalStrings = (arr) => arr.filter((item) => isNaN(Number(item)));
170
+ const BLOCK_LIST_ATTRIBUTE_KEYS = ["__component", "__temp_key__"];
171
+ const traverseData = (predicate, transform) => (schema, components = {}) => (data = {}) => {
172
+ const traverse = (datum, attributes) => {
173
+ return Object.entries(datum).reduce((acc, [key, value]) => {
174
+ const attribute = attributes[key];
175
+ if (BLOCK_LIST_ATTRIBUTE_KEYS.includes(key) || value === null || value === void 0) {
176
+ acc[key] = value;
177
+ return acc;
178
+ }
179
+ if (attribute.type === "component") {
180
+ if (attribute.repeatable) {
181
+ const componentValue = predicate(attribute, value) ? transform(value, attribute) : value;
182
+ acc[key] = componentValue.map(
183
+ (componentData) => traverse(componentData, components[attribute.component]?.attributes ?? {})
184
+ );
185
+ } else {
186
+ const componentValue = predicate(attribute, value) ? transform(value, attribute) : value;
187
+ acc[key] = traverse(componentValue, components[attribute.component]?.attributes ?? {});
188
+ }
189
+ } else if (attribute.type === "dynamiczone") {
190
+ const dynamicZoneValue = predicate(attribute, value) ? transform(value, attribute) : value;
191
+ acc[key] = dynamicZoneValue.map(
192
+ (componentData) => traverse(componentData, components[componentData.__component]?.attributes ?? {})
193
+ );
194
+ } else if (predicate(attribute, value)) {
195
+ acc[key] = transform(value, attribute);
196
+ } else {
197
+ acc[key] = value;
198
+ }
199
+ return acc;
200
+ }, {});
201
+ };
202
+ return traverse(data, schema.attributes);
203
+ };
204
+ const removeProhibitedFields = (prohibitedFields) => traverseData(
205
+ (attribute) => prohibitedFields.includes(attribute.type),
206
+ () => ""
207
+ );
208
+ const prepareRelations = traverseData(
209
+ (attribute) => attribute.type === "relation",
210
+ () => ({
211
+ connect: [],
212
+ disconnect: []
213
+ })
214
+ );
215
+ const prepareTempKeys = traverseData(
216
+ (attribute) => attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone",
217
+ (data) => {
218
+ if (Array.isArray(data) && data.length > 0) {
219
+ const keys = generateNKeysBetween(void 0, void 0, data.length);
220
+ return data.map((datum, index2) => ({
221
+ ...datum,
222
+ __temp_key__: keys[index2]
223
+ }));
224
+ }
225
+ return data;
226
+ }
227
+ );
228
+ const removeFieldsThatDontExistOnSchema = (schema) => (data) => {
229
+ const schemaKeys = Object.keys(schema.attributes);
230
+ const dataKeys = Object.keys(data);
231
+ const keysToRemove = dataKeys.filter((key) => !schemaKeys.includes(key));
232
+ const revisedData = [...keysToRemove, ...DOCUMENT_META_FIELDS].reduce((acc, key) => {
233
+ delete acc[key];
234
+ return acc;
235
+ }, structuredClone(data));
236
+ return revisedData;
237
+ };
238
+ const removeNullValues = (data) => {
239
+ return Object.entries(data).reduce((acc, [key, value]) => {
240
+ if (value === null) {
241
+ return acc;
242
+ }
243
+ acc[key] = value;
244
+ return acc;
245
+ }, {});
246
+ };
247
+ const transformDocument = (schema, components = {}) => (document) => {
248
+ const transformations = pipe(
249
+ removeFieldsThatDontExistOnSchema(schema),
250
+ removeProhibitedFields(["password"])(schema, components),
251
+ removeNullValues,
252
+ prepareRelations(schema, components),
253
+ prepareTempKeys(schema, components)
254
+ );
255
+ return transformations(document);
256
+ };
257
+ const createDefaultForm = (contentType, components = {}) => {
258
+ const traverseSchema = (attributes) => {
259
+ return Object.entries(attributes).reduce((acc, [key, attribute]) => {
260
+ if ("default" in attribute) {
261
+ acc[key] = attribute.default;
262
+ } else if (attribute.type === "component" && attribute.required) {
263
+ const defaultComponentForm = traverseSchema(components[attribute.component].attributes);
264
+ if (attribute.repeatable) {
265
+ acc[key] = attribute.min ? [...Array(attribute.min).fill(defaultComponentForm)] : [];
266
+ } else {
267
+ acc[key] = defaultComponentForm;
268
+ }
269
+ } else if (attribute.type === "dynamiczone" && attribute.required) {
270
+ acc[key] = [];
271
+ }
272
+ return acc;
273
+ }, {});
274
+ };
275
+ return traverseSchema(contentType.attributes);
276
+ };
162
277
  const contentManagerApi = adminApi.enhanceEndpoints({
163
278
  addTagTypes: [
164
279
  "ComponentConfiguration",
@@ -168,7 +283,8 @@ const contentManagerApi = adminApi.enhanceEndpoints({
168
283
  "InitialData",
169
284
  "HistoryVersion",
170
285
  "Relations",
171
- "UidAvailability"
286
+ "UidAvailability",
287
+ "RecentDocumentList"
172
288
  ]
173
289
  });
174
290
  const documentApi = contentManagerApi.injectEndpoints({
@@ -186,7 +302,7 @@ const documentApi = contentManagerApi.injectEndpoints({
186
302
  if (error) {
187
303
  return [];
188
304
  }
189
- return [{ type: "Document", id: `${model}_LIST` }];
305
+ return [{ type: "Document", id: `${model}_LIST` }, "RecentDocumentList"];
190
306
  }
191
307
  }),
192
308
  cloneDocument: builder.mutation({
@@ -200,7 +316,8 @@ const documentApi = contentManagerApi.injectEndpoints({
200
316
  }),
201
317
  invalidatesTags: (_result, _error, { model }) => [
202
318
  { type: "Document", id: `${model}_LIST` },
203
- { type: "UidAvailability", id: model }
319
+ { type: "UidAvailability", id: model },
320
+ "RecentDocumentList"
204
321
  ]
205
322
  }),
206
323
  /**
@@ -219,8 +336,21 @@ const documentApi = contentManagerApi.injectEndpoints({
219
336
  invalidatesTags: (result, _error, { model }) => [
220
337
  { type: "Document", id: `${model}_LIST` },
221
338
  "Relations",
222
- { type: "UidAvailability", id: model }
223
- ]
339
+ { type: "UidAvailability", id: model },
340
+ "RecentDocumentList"
341
+ ],
342
+ transformResponse: (response, meta, arg) => {
343
+ if (!("data" in response) && arg.model === "plugin::users-permissions.user") {
344
+ return {
345
+ data: response,
346
+ meta: {
347
+ availableStatus: [],
348
+ availableLocales: []
349
+ }
350
+ };
351
+ }
352
+ return response;
353
+ }
224
354
  }),
225
355
  deleteDocument: builder.mutation({
226
356
  query: ({ collectionType, model, documentId, params }) => ({
@@ -231,7 +361,8 @@ const documentApi = contentManagerApi.injectEndpoints({
231
361
  }
232
362
  }),
233
363
  invalidatesTags: (_result, _error, { collectionType, model }) => [
234
- { type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model }
364
+ { type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },
365
+ "RecentDocumentList"
235
366
  ]
236
367
  }),
237
368
  deleteManyDocuments: builder.mutation({
@@ -243,7 +374,10 @@ const documentApi = contentManagerApi.injectEndpoints({
243
374
  params
244
375
  }
245
376
  }),
246
- invalidatesTags: (_res, _error, { model }) => [{ type: "Document", id: `${model}_LIST` }]
377
+ invalidatesTags: (_res, _error, { model }) => [
378
+ { type: "Document", id: `${model}_LIST` },
379
+ "RecentDocumentList"
380
+ ]
247
381
  }),
248
382
  discardDocument: builder.mutation({
249
383
  query: ({ collectionType, model, documentId, params }) => ({
@@ -261,7 +395,8 @@ const documentApi = contentManagerApi.injectEndpoints({
261
395
  },
262
396
  { type: "Document", id: `${model}_LIST` },
263
397
  "Relations",
264
- { type: "UidAvailability", id: model }
398
+ { type: "UidAvailability", id: model },
399
+ "RecentDocumentList"
265
400
  ];
266
401
  }
267
402
  }),
@@ -274,7 +409,7 @@ const documentApi = contentManagerApi.injectEndpoints({
274
409
  url: `/content-manager/collection-types/${model}`,
275
410
  method: "GET",
276
411
  config: {
277
- params
412
+ params: stringify(params, { encode: true })
278
413
  }
279
414
  }),
280
415
  providesTags: (result, _error, arg) => {
@@ -356,7 +491,8 @@ const documentApi = contentManagerApi.injectEndpoints({
356
491
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
357
492
  },
358
493
  { type: "Document", id: `${model}_LIST` },
359
- "Relations"
494
+ "Relations",
495
+ "RecentDocumentList"
360
496
  ];
361
497
  }
362
498
  }),
@@ -387,7 +523,9 @@ const documentApi = contentManagerApi.injectEndpoints({
387
523
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
388
524
  },
389
525
  "Relations",
390
- { type: "UidAvailability", id: model }
526
+ { type: "UidAvailability", id: model },
527
+ "RecentDocumentList",
528
+ "RecentDocumentList"
391
529
  ];
392
530
  },
393
531
  async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
@@ -417,7 +555,8 @@ const documentApi = contentManagerApi.injectEndpoints({
417
555
  {
418
556
  type: "Document",
419
557
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
420
- }
558
+ },
559
+ "RecentDocumentList"
421
560
  ];
422
561
  }
423
562
  }),
@@ -430,7 +569,10 @@ const documentApi = contentManagerApi.injectEndpoints({
430
569
  params
431
570
  }
432
571
  }),
433
- invalidatesTags: (_res, _error, { model, documentIds }) => documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` }))
572
+ invalidatesTags: (_res, _error, { model, documentIds }) => [
573
+ ...documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` })),
574
+ "RecentDocumentList"
575
+ ]
434
576
  })
435
577
  })
436
578
  });
@@ -453,8 +595,7 @@ const {
453
595
  useUnpublishManyDocumentsMutation
454
596
  } = documentApi;
455
597
  const buildValidParams = (query) => {
456
- if (!query)
457
- return query;
598
+ if (!query) return query;
458
599
  const { plugins: _, ...validQueryParams } = {
459
600
  ...query,
460
601
  ...Object.values(query?.plugins ?? {}).reduce(
@@ -462,9 +603,6 @@ const buildValidParams = (query) => {
462
603
  {}
463
604
  )
464
605
  };
465
- if ("_q" in validQueryParams) {
466
- validQueryParams._q = encodeURIComponent(validQueryParams._q);
467
- }
468
606
  return validQueryParams;
469
607
  };
470
608
  const isBaseQueryError = (error) => {
@@ -1105,6 +1243,7 @@ const convertListLayoutToFieldLayouts = (columns, attributes = {}, metadatas, co
1105
1243
  const useDocument = (args, opts) => {
1106
1244
  const { toggleNotification } = useNotification();
1107
1245
  const { _unstableFormatAPIError: formatAPIError } = useAPIErrorHandler();
1246
+ const { formatMessage } = useIntl();
1108
1247
  const {
1109
1248
  currentData: data,
1110
1249
  isLoading: isLoadingDocument,
@@ -1114,12 +1253,27 @@ const useDocument = (args, opts) => {
1114
1253
  ...opts,
1115
1254
  skip: !args.documentId && args.collectionType !== SINGLE_TYPES || opts?.skip
1116
1255
  });
1256
+ const document = data?.data;
1257
+ const meta = data?.meta;
1117
1258
  const {
1118
1259
  components,
1119
1260
  schema,
1120
1261
  schemas,
1121
1262
  isLoading: isLoadingSchema
1122
1263
  } = useContentTypeSchema(args.model);
1264
+ const isSingleType = schema?.kind === "singleType";
1265
+ const getTitle = (mainField) => {
1266
+ if (mainField !== "id" && document?.[mainField]) {
1267
+ return document[mainField];
1268
+ }
1269
+ if (isSingleType && schema?.info.displayName) {
1270
+ return schema.info.displayName;
1271
+ }
1272
+ return formatMessage({
1273
+ id: "content-manager.containers.untitled",
1274
+ defaultMessage: "Untitled"
1275
+ });
1276
+ };
1123
1277
  React.useEffect(() => {
1124
1278
  if (error) {
1125
1279
  toggleNotification({
@@ -1135,14 +1289,14 @@ const useDocument = (args, opts) => {
1135
1289
  return createYupSchema(schema.attributes, components);
1136
1290
  }, [schema, components]);
1137
1291
  const validate = React.useCallback(
1138
- (document) => {
1292
+ (document2) => {
1139
1293
  if (!validationSchema) {
1140
1294
  throw new Error(
1141
1295
  "There is no validation schema generated, this is likely due to the schema not being loaded yet."
1142
1296
  );
1143
1297
  }
1144
1298
  try {
1145
- validationSchema.validateSync(document, { abortEarly: false, strict: true });
1299
+ validationSchema.validateSync(document2, { abortEarly: false, strict: true });
1146
1300
  return null;
1147
1301
  } catch (error2) {
1148
1302
  if (error2 instanceof ValidationError) {
@@ -1153,17 +1307,29 @@ const useDocument = (args, opts) => {
1153
1307
  },
1154
1308
  [validationSchema]
1155
1309
  );
1310
+ const getInitialFormValues = React.useCallback(
1311
+ (isCreatingDocument = false) => {
1312
+ if (!document && !isCreatingDocument && !isSingleType || !schema) {
1313
+ return void 0;
1314
+ }
1315
+ const form = document?.id ? document : createDefaultForm(schema, components);
1316
+ return transformDocument(schema, components)(form);
1317
+ },
1318
+ [document, isSingleType, schema, components]
1319
+ );
1156
1320
  const isLoading = isLoadingDocument || isFetchingDocument || isLoadingSchema;
1157
1321
  const hasError = !!error;
1158
1322
  return {
1159
1323
  components,
1160
- document: data?.data,
1161
- meta: data?.meta,
1324
+ document,
1325
+ meta,
1162
1326
  isLoading,
1163
1327
  hasError,
1164
1328
  schema,
1165
1329
  schemas,
1166
- validate
1330
+ validate,
1331
+ getTitle,
1332
+ getInitialFormValues
1167
1333
  };
1168
1334
  };
1169
1335
  const useDoc = () => {
@@ -1664,7 +1830,7 @@ const useDocumentActions = () => {
1664
1830
  };
1665
1831
  };
1666
1832
  const ProtectedHistoryPage = React.lazy(
1667
- () => import("./History-Dhy0xF0L.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1833
+ () => import("./History-WOQNVho-.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1668
1834
  );
1669
1835
  const routes$2 = [
1670
1836
  {
@@ -1677,7 +1843,7 @@ const routes$2 = [
1677
1843
  }
1678
1844
  ];
1679
1845
  const ProtectedPreviewPage = React.lazy(
1680
- () => import("./Preview-_gomrUna.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
1846
+ () => import("./Preview-BF81YhRj.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
1681
1847
  );
1682
1848
  const routes$1 = [
1683
1849
  {
@@ -1690,31 +1856,31 @@ const routes$1 = [
1690
1856
  }
1691
1857
  ];
1692
1858
  const ProtectedEditViewPage = lazy(
1693
- () => import("./EditViewPage-BB9VeS-u.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1859
+ () => import("./EditViewPage-DFF7c27p.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1694
1860
  );
1695
1861
  const ProtectedListViewPage = lazy(
1696
- () => import("./ListViewPage-B6Ut2BH0.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1862
+ () => import("./ListViewPage-VK2v44Q1.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1697
1863
  );
1698
1864
  const ProtectedListConfiguration = lazy(
1699
- () => import("./ListConfigurationPage-C_FCilGf.mjs").then((mod) => ({
1865
+ () => import("./ListConfigurationPage-BeXfr6uW.mjs").then((mod) => ({
1700
1866
  default: mod.ProtectedListConfiguration
1701
1867
  }))
1702
1868
  );
1703
1869
  const ProtectedEditConfigurationPage = lazy(
1704
- () => import("./EditConfigurationPage-BUJqRuRq.mjs").then((mod) => ({
1870
+ () => import("./EditConfigurationPage-YR8-4VCS.mjs").then((mod) => ({
1705
1871
  default: mod.ProtectedEditConfigurationPage
1706
1872
  }))
1707
1873
  );
1708
1874
  const ProtectedComponentConfigurationPage = lazy(
1709
- () => import("./ComponentConfigurationPage-FQd019My.mjs").then((mod) => ({
1875
+ () => import("./ComponentConfigurationPage-baEkO-OV.mjs").then((mod) => ({
1710
1876
  default: mod.ProtectedComponentConfigurationPage
1711
1877
  }))
1712
1878
  );
1713
1879
  const NoPermissions = lazy(
1714
- () => import("./NoPermissionsPage-CGUgxmce.mjs").then((mod) => ({ default: mod.NoPermissions }))
1880
+ () => import("./NoPermissionsPage-CokBHhhy.mjs").then((mod) => ({ default: mod.NoPermissions }))
1715
1881
  );
1716
1882
  const NoContentType = lazy(
1717
- () => import("./NoContentTypePage-rR7QwWP5.mjs").then((mod) => ({ default: mod.NoContentType }))
1883
+ () => import("./NoContentTypePage-T8ttty6K.mjs").then((mod) => ({ default: mod.NoContentType }))
1718
1884
  );
1719
1885
  const CollectionTypePages = () => {
1720
1886
  const { collectionType } = useParams();
@@ -1726,7 +1892,7 @@ const CollectionTypePages = () => {
1726
1892
  const CLONE_RELATIVE_PATH = ":collectionType/:slug/clone/:origin";
1727
1893
  const CLONE_PATH = `/content-manager/${CLONE_RELATIVE_PATH}`;
1728
1894
  const LIST_RELATIVE_PATH = ":collectionType/:slug";
1729
- const LIST_PATH = `/content-manager/${LIST_RELATIVE_PATH}`;
1895
+ const LIST_PATH = `/content-manager/collection-types/:slug`;
1730
1896
  const routes = [
1731
1897
  {
1732
1898
  path: LIST_RELATIVE_PATH,
@@ -1859,6 +2025,11 @@ const DocumentActionButton = (action) => {
1859
2025
  ) : null
1860
2026
  ] });
1861
2027
  };
2028
+ const MenuItem = styled(Menu.Item)`
2029
+ &:hover {
2030
+ background: ${({ theme, isVariantDanger, isDisabled }) => isVariantDanger && !isDisabled ? theme.colors.danger100 : "neutral"};
2031
+ }
2032
+ `;
1862
2033
  const DocumentActionsMenu = ({
1863
2034
  actions: actions2,
1864
2035
  children,
@@ -1917,48 +2088,32 @@ const DocumentActionsMenu = ({
1917
2088
  /* @__PURE__ */ jsxs(Menu.Content, { maxHeight: void 0, popoverPlacement: "bottom-end", children: [
1918
2089
  actions2.map((action) => {
1919
2090
  return /* @__PURE__ */ jsx(
1920
- Menu.Item,
2091
+ MenuItem,
1921
2092
  {
1922
2093
  disabled: action.disabled,
1923
2094
  onSelect: handleClick(action),
1924
2095
  display: "block",
1925
- children: /* @__PURE__ */ jsxs(Flex, { justifyContent: "space-between", gap: 4, children: [
1926
- /* @__PURE__ */ jsxs(
1927
- Flex,
1928
- {
1929
- color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1930
- gap: 2,
1931
- tag: "span",
1932
- children: [
1933
- /* @__PURE__ */ jsx(
1934
- Flex,
1935
- {
1936
- tag: "span",
1937
- color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
1938
- children: action.icon
1939
- }
1940
- ),
1941
- action.label
1942
- ]
1943
- }
1944
- ),
1945
- action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsx(
1946
- Flex,
1947
- {
1948
- alignItems: "center",
1949
- background: "alternative100",
1950
- borderStyle: "solid",
1951
- borderColor: "alternative200",
1952
- borderWidth: "1px",
1953
- height: 5,
1954
- paddingLeft: 2,
1955
- paddingRight: 2,
1956
- hasRadius: true,
1957
- color: "alternative600",
1958
- children: /* @__PURE__ */ jsx(Typography, { variant: "sigma", fontWeight: "bold", lineHeight: 1, children: formatMessage({ id: "global.new", defaultMessage: "New" }) })
1959
- }
1960
- )
1961
- ] })
2096
+ isVariantDanger: action.variant === "danger",
2097
+ isDisabled: action.disabled,
2098
+ children: /* @__PURE__ */ jsx(Flex, { justifyContent: "space-between", gap: 4, children: /* @__PURE__ */ jsxs(
2099
+ Flex,
2100
+ {
2101
+ color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
2102
+ gap: 2,
2103
+ tag: "span",
2104
+ children: [
2105
+ /* @__PURE__ */ jsx(
2106
+ Flex,
2107
+ {
2108
+ tag: "span",
2109
+ color: !action.disabled ? convertActionVariantToIconColor(action.variant) : "inherit",
2110
+ children: action.icon
2111
+ }
2112
+ ),
2113
+ action.label
2114
+ ]
2115
+ }
2116
+ ) })
1962
2117
  },
1963
2118
  action.id
1964
2119
  );
@@ -2095,6 +2250,7 @@ const PublishAction$1 = ({
2095
2250
  const { _unstableFormatValidationErrors: formatValidationErrors } = useAPIErrorHandler();
2096
2251
  const isListView = useMatch(LIST_PATH) !== null;
2097
2252
  const isCloning = useMatch(CLONE_PATH) !== null;
2253
+ const { id } = useParams();
2098
2254
  const { formatMessage } = useIntl();
2099
2255
  const canPublish = useDocumentRBAC("PublishAction", ({ canPublish: canPublish2 }) => canPublish2);
2100
2256
  const { publish } = useDocumentActions();
@@ -2197,10 +2353,12 @@ const PublishAction$1 = ({
2197
2353
  transformData(formValues)
2198
2354
  );
2199
2355
  if ("data" in res && collectionType !== SINGLE_TYPES) {
2200
- navigate({
2201
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2202
- search: rawQuery
2203
- });
2356
+ if (id === "create") {
2357
+ navigate({
2358
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
2359
+ search: rawQuery
2360
+ });
2361
+ }
2204
2362
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2205
2363
  setErrors(formatValidationErrors(res.error));
2206
2364
  }
@@ -2253,6 +2411,7 @@ const PublishAction$1 = ({
2253
2411
  };
2254
2412
  };
2255
2413
  PublishAction$1.type = "publish";
2414
+ PublishAction$1.position = "panel";
2256
2415
  const UpdateAction = ({
2257
2416
  activeTab,
2258
2417
  documentId,
@@ -2275,96 +2434,134 @@ const UpdateAction = ({
2275
2434
  const validate = useForm("UpdateAction", (state) => state.validate);
2276
2435
  const setErrors = useForm("UpdateAction", (state) => state.setErrors);
2277
2436
  const resetForm = useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
2278
- return {
2279
- /**
2280
- * Disabled when:
2281
- * - the form is submitting
2282
- * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2283
- * - the active tab is the published tab
2284
- */
2285
- disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2286
- label: formatMessage({
2287
- id: "content-manager.containers.Edit.save",
2288
- defaultMessage: "Save"
2289
- }),
2290
- onClick: async () => {
2291
- setSubmitting(true);
2292
- try {
2293
- const { errors } = await validate(true, {
2294
- status: "draft"
2437
+ const handleUpdate = React.useCallback(async () => {
2438
+ setSubmitting(true);
2439
+ try {
2440
+ if (!modified) {
2441
+ return;
2442
+ }
2443
+ const { errors } = await validate(true, {
2444
+ status: "draft"
2445
+ });
2446
+ if (errors) {
2447
+ toggleNotification({
2448
+ type: "danger",
2449
+ message: formatMessage({
2450
+ id: "content-manager.validation.error",
2451
+ defaultMessage: "There are validation errors in your document. Please fix them before saving."
2452
+ })
2295
2453
  });
2296
- if (errors) {
2297
- toggleNotification({
2298
- type: "danger",
2299
- message: formatMessage({
2300
- id: "content-manager.validation.error",
2301
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
2302
- })
2303
- });
2304
- return;
2305
- }
2306
- if (isCloning) {
2307
- const res = await clone(
2308
- {
2309
- model,
2310
- documentId: cloneMatch.params.origin,
2311
- params
2312
- },
2313
- transformData(document)
2314
- );
2315
- if ("data" in res) {
2316
- navigate(
2317
- {
2318
- pathname: `../${res.data.documentId}`,
2319
- search: rawQuery
2320
- },
2321
- { relative: "path" }
2322
- );
2323
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2324
- setErrors(formatValidationErrors(res.error));
2325
- }
2326
- } else if (documentId || collectionType === SINGLE_TYPES) {
2327
- const res = await update(
2454
+ return;
2455
+ }
2456
+ if (isCloning) {
2457
+ const res = await clone(
2458
+ {
2459
+ model,
2460
+ documentId: cloneMatch.params.origin,
2461
+ params
2462
+ },
2463
+ transformData(document)
2464
+ );
2465
+ if ("data" in res) {
2466
+ navigate(
2328
2467
  {
2329
- collectionType,
2330
- model,
2331
- documentId,
2332
- params
2468
+ pathname: `../${res.data.documentId}`,
2469
+ search: rawQuery
2333
2470
  },
2334
- transformData(document)
2471
+ { relative: "path" }
2335
2472
  );
2336
- if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2337
- setErrors(formatValidationErrors(res.error));
2338
- } else {
2339
- resetForm();
2340
- }
2473
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2474
+ setErrors(formatValidationErrors(res.error));
2475
+ }
2476
+ } else if (documentId || collectionType === SINGLE_TYPES) {
2477
+ const res = await update(
2478
+ {
2479
+ collectionType,
2480
+ model,
2481
+ documentId,
2482
+ params
2483
+ },
2484
+ transformData(document)
2485
+ );
2486
+ if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2487
+ setErrors(formatValidationErrors(res.error));
2341
2488
  } else {
2342
- const res = await create(
2489
+ resetForm();
2490
+ }
2491
+ } else {
2492
+ const res = await create(
2493
+ {
2494
+ model,
2495
+ params
2496
+ },
2497
+ transformData(document)
2498
+ );
2499
+ if ("data" in res && collectionType !== SINGLE_TYPES) {
2500
+ navigate(
2343
2501
  {
2344
- model,
2345
- params
2502
+ pathname: `../${res.data.documentId}`,
2503
+ search: rawQuery
2346
2504
  },
2347
- transformData(document)
2505
+ { replace: true, relative: "path" }
2348
2506
  );
2349
- if ("data" in res && collectionType !== SINGLE_TYPES) {
2350
- navigate(
2351
- {
2352
- pathname: `../${res.data.documentId}`,
2353
- search: rawQuery
2354
- },
2355
- { replace: true, relative: "path" }
2356
- );
2357
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2358
- setErrors(formatValidationErrors(res.error));
2359
- }
2507
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2508
+ setErrors(formatValidationErrors(res.error));
2360
2509
  }
2361
- } finally {
2362
- setSubmitting(false);
2363
2510
  }
2511
+ } finally {
2512
+ setSubmitting(false);
2364
2513
  }
2514
+ }, [
2515
+ clone,
2516
+ cloneMatch?.params.origin,
2517
+ collectionType,
2518
+ create,
2519
+ document,
2520
+ documentId,
2521
+ formatMessage,
2522
+ formatValidationErrors,
2523
+ isCloning,
2524
+ model,
2525
+ modified,
2526
+ navigate,
2527
+ params,
2528
+ rawQuery,
2529
+ resetForm,
2530
+ setErrors,
2531
+ setSubmitting,
2532
+ toggleNotification,
2533
+ update,
2534
+ validate
2535
+ ]);
2536
+ React.useEffect(() => {
2537
+ const handleKeyDown = (e) => {
2538
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
2539
+ e.preventDefault();
2540
+ handleUpdate();
2541
+ }
2542
+ };
2543
+ window.addEventListener("keydown", handleKeyDown);
2544
+ return () => {
2545
+ window.removeEventListener("keydown", handleKeyDown);
2546
+ };
2547
+ }, [handleUpdate]);
2548
+ return {
2549
+ /**
2550
+ * Disabled when:
2551
+ * - the form is submitting
2552
+ * - the document is not modified & we're not cloning (you can save a clone entity straight away)
2553
+ * - the active tab is the published tab
2554
+ */
2555
+ disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
2556
+ label: formatMessage({
2557
+ id: "global.save",
2558
+ defaultMessage: "Save"
2559
+ }),
2560
+ onClick: handleUpdate
2365
2561
  };
2366
2562
  };
2367
2563
  UpdateAction.type = "update";
2564
+ UpdateAction.position = "panel";
2368
2565
  const UNPUBLISH_DRAFT_OPTIONS = {
2369
2566
  KEEP: "keep",
2370
2567
  DISCARD: "discard"
@@ -2487,6 +2684,7 @@ const UnpublishAction$1 = ({
2487
2684
  };
2488
2685
  };
2489
2686
  UnpublishAction$1.type = "unpublish";
2687
+ UnpublishAction$1.position = "panel";
2490
2688
  const DiscardAction = ({
2491
2689
  activeTab,
2492
2690
  documentId,
@@ -2537,6 +2735,7 @@ const DiscardAction = ({
2537
2735
  };
2538
2736
  };
2539
2737
  DiscardAction.type = "discard";
2738
+ DiscardAction.position = "panel";
2540
2739
  const DEFAULT_ACTIONS = [PublishAction$1, UpdateAction, UnpublishAction$1, DiscardAction];
2541
2740
  const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
2542
2741
  const RelativeTime = React.forwardRef(
@@ -2549,7 +2748,7 @@ const RelativeTime = React.forwardRef(
2549
2748
  });
2550
2749
  const unit = intervals.find((intervalUnit) => {
2551
2750
  return interval[intervalUnit] > 0 && Object.keys(interval).includes(intervalUnit);
2552
- });
2751
+ }) ?? "seconds";
2553
2752
  const relativeTime = isPast(timestamp) ? -interval[unit] : interval[unit];
2554
2753
  const customInterval = customIntervals.find(
2555
2754
  (custom) => interval[custom.unit] < custom.threshold
@@ -2583,10 +2782,10 @@ const getDisplayName = ({
2583
2782
  return email ?? "";
2584
2783
  };
2585
2784
  const capitalise = (str) => str.charAt(0).toUpperCase() + str.slice(1);
2586
- const DocumentStatus = ({ status = "draft", ...restProps }) => {
2785
+ const DocumentStatus = ({ status = "draft", size = "S", ...restProps }) => {
2587
2786
  const statusVariant = status === "draft" ? "secondary" : status === "published" ? "success" : "alternative";
2588
2787
  const { formatMessage } = useIntl();
2589
- return /* @__PURE__ */ jsx(Status, { ...restProps, showBullet: false, size: "S", variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
2788
+ return /* @__PURE__ */ jsx(Status, { ...restProps, size, variant: statusVariant, children: /* @__PURE__ */ jsx(Typography, { tag: "span", variant: "omega", fontWeight: "bold", children: formatMessage({
2590
2789
  id: `content-manager.containers.List.${status}`,
2591
2790
  defaultMessage: capitalise(status)
2592
2791
  }) }) });
@@ -2594,12 +2793,18 @@ const DocumentStatus = ({ status = "draft", ...restProps }) => {
2594
2793
  const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2595
2794
  const { formatMessage } = useIntl();
2596
2795
  const isCloning = useMatch(CLONE_PATH) !== null;
2796
+ const params = useParams();
2597
2797
  const title = isCreating ? formatMessage({
2598
2798
  id: "content-manager.containers.edit.title.new",
2599
2799
  defaultMessage: "Create an entry"
2600
2800
  }) : documentTitle;
2601
2801
  return /* @__PURE__ */ jsxs(Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2602
- /* @__PURE__ */ jsx(BackButton, {}),
2802
+ /* @__PURE__ */ jsx(
2803
+ BackButton,
2804
+ {
2805
+ fallback: params.collectionType === SINGLE_TYPES ? void 0 : `../${COLLECTION_TYPES}/${params.slug}`
2806
+ }
2807
+ ),
2603
2808
  /* @__PURE__ */ jsxs(Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2604
2809
  /* @__PURE__ */ jsx(Typography, { variant: "alpha", tag: "h1", children: title }),
2605
2810
  /* @__PURE__ */ jsx(HeaderToolbar, {})
@@ -2650,7 +2855,7 @@ const HeaderToolbar = () => {
2650
2855
  meta: isCloning ? void 0 : meta,
2651
2856
  collectionType
2652
2857
  },
2653
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
2858
+ descriptions: plugins["content-manager"].apis.getDocumentActions("header"),
2654
2859
  children: (actions2) => {
2655
2860
  const headerActions = actions2.filter((action) => {
2656
2861
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -2858,6 +3063,7 @@ const ConfigureTheViewAction = ({ collectionType, model }) => {
2858
3063
  };
2859
3064
  };
2860
3065
  ConfigureTheViewAction.type = "configure-the-view";
3066
+ ConfigureTheViewAction.position = "header";
2861
3067
  const EditTheModelAction = ({ model }) => {
2862
3068
  const navigate = useNavigate();
2863
3069
  const { formatMessage } = useIntl();
@@ -2874,6 +3080,7 @@ const EditTheModelAction = ({ model }) => {
2874
3080
  };
2875
3081
  };
2876
3082
  EditTheModelAction.type = "edit-the-model";
3083
+ EditTheModelAction.position = "header";
2877
3084
  const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2878
3085
  const navigate = useNavigate();
2879
3086
  const { formatMessage } = useIntl();
@@ -2947,6 +3154,7 @@ const DeleteAction$1 = ({ documentId, model, collectionType, document }) => {
2947
3154
  };
2948
3155
  };
2949
3156
  DeleteAction$1.type = "delete";
3157
+ DeleteAction$1.position = ["header", "table-row"];
2950
3158
  const DEFAULT_HEADER_ACTIONS = [EditTheModelAction, ConfigureTheViewAction, DeleteAction$1];
2951
3159
  const Panels = () => {
2952
3160
  const isCloning = useMatch(CLONE_PATH) !== null;
@@ -3009,7 +3217,7 @@ const ActionsPanelContent = () => {
3009
3217
  DescriptionComponentRenderer,
3010
3218
  {
3011
3219
  props,
3012
- descriptions: plugins["content-manager"].apis.getDocumentActions(),
3220
+ descriptions: plugins["content-manager"].apis.getDocumentActions("panel"),
3013
3221
  children: (actions2) => /* @__PURE__ */ jsx(DocumentActions, { actions: actions2 })
3014
3222
  }
3015
3223
  ),
@@ -3286,18 +3494,10 @@ const SelectedEntriesTableContent = ({
3286
3494
  search: row.locale && `?plugins[i18n][locale]=${row.locale}`
3287
3495
  },
3288
3496
  state: { from: pathname },
3289
- label: formatMessage(
3290
- { id: "app.component.HelperPluginTable.edit", defaultMessage: "Edit {target}" },
3291
- {
3292
- target: formatMessage(
3293
- {
3294
- id: "content-manager.components.ListViewHelperPluginTable.row-line",
3295
- defaultMessage: "item line {number}"
3296
- },
3297
- { number: index2 + 1 }
3298
- )
3299
- }
3300
- ),
3497
+ label: formatMessage({
3498
+ id: "content-manager.bulk-publish.edit",
3499
+ defaultMessage: "Edit"
3500
+ }),
3301
3501
  target: "_blank",
3302
3502
  marginLeft: "auto",
3303
3503
  variant: "ghost",
@@ -3471,8 +3671,7 @@ const PublishAction = ({ documents, model }) => {
3471
3671
  const refetchList = () => {
3472
3672
  contentManagerApi.util.invalidateTags([{ type: "Document", id: `${model}_LIST` }]);
3473
3673
  };
3474
- if (!showPublishButton)
3475
- return null;
3674
+ if (!showPublishButton) return null;
3476
3675
  return {
3477
3676
  actionType: "publish",
3478
3677
  variant: "tertiary",
@@ -3540,8 +3739,7 @@ const DeleteAction = ({ documents, model }) => {
3540
3739
  selectRow([]);
3541
3740
  }
3542
3741
  };
3543
- if (!hasDeletePermission)
3544
- return null;
3742
+ if (!hasDeletePermission) return null;
3545
3743
  return {
3546
3744
  variant: "danger-light",
3547
3745
  label: formatMessage({ id: "global.delete", defaultMessage: "Delete" }),
@@ -3590,8 +3788,7 @@ const UnpublishAction = ({ documents, model }) => {
3590
3788
  }
3591
3789
  };
3592
3790
  const showUnpublishButton = hasDraftAndPublishEnabled && hasPublishPermission && documents.some((entry) => entry.status === "published" || entry.status === "modified");
3593
- if (!showUnpublishButton)
3594
- return null;
3791
+ if (!showUnpublishButton) return null;
3595
3792
  return {
3596
3793
  variant: "tertiary",
3597
3794
  label: formatMessage({ id: "app.utils.unpublish", defaultMessage: "Unpublish" }),
@@ -3696,7 +3893,7 @@ const TableActions = ({ document }) => {
3696
3893
  DescriptionComponentRenderer,
3697
3894
  {
3698
3895
  props,
3699
- descriptions: plugins["content-manager"].apis.getDocumentActions().filter((action) => action.name !== "PublishAction"),
3896
+ descriptions: plugins["content-manager"].apis.getDocumentActions("table-row").filter((action) => action.name !== "PublishAction"),
3700
3897
  children: (actions2) => {
3701
3898
  const tableRowActions = actions2.filter((action) => {
3702
3899
  const positions = Array.isArray(action.position) ? action.position : [action.position];
@@ -3755,6 +3952,7 @@ const EditAction = ({ documentId }) => {
3755
3952
  };
3756
3953
  };
3757
3954
  EditAction.type = "edit";
3955
+ EditAction.position = "table-row";
3758
3956
  const StyledPencil = styled(Pencil)`
3759
3957
  path {
3760
3958
  fill: currentColor;
@@ -3831,6 +4029,7 @@ const CloneAction = ({ model, documentId }) => {
3831
4029
  };
3832
4030
  };
3833
4031
  CloneAction.type = "clone";
4032
+ CloneAction.position = "table-row";
3834
4033
  const StyledDuplicate = styled(Duplicate)`
3835
4034
  path {
3836
4035
  fill: currentColor;
@@ -3917,7 +4116,14 @@ class ContentManagerPlugin {
3917
4116
  addDocumentHeaderAction: this.addDocumentHeaderAction.bind(this),
3918
4117
  addEditViewSidePanel: this.addEditViewSidePanel.bind(this),
3919
4118
  getBulkActions: () => this.bulkActions,
3920
- getDocumentActions: () => this.documentActions,
4119
+ getDocumentActions: (position) => {
4120
+ if (position) {
4121
+ return this.documentActions.filter(
4122
+ (action) => action.position == void 0 || [action.position].flat().includes(position)
4123
+ );
4124
+ }
4125
+ return this.documentActions;
4126
+ },
3921
4127
  getEditViewSidePanels: () => this.editViewSidePanels,
3922
4128
  getHeaderActions: () => this.headerActions
3923
4129
  }
@@ -3927,10 +4133,8 @@ class ContentManagerPlugin {
3927
4133
  const getPrintableType = (value) => {
3928
4134
  const nativeType = typeof value;
3929
4135
  if (nativeType === "object") {
3930
- if (value === null)
3931
- return "null";
3932
- if (Array.isArray(value))
3933
- return "array";
4136
+ if (value === null) return "null";
4137
+ if (Array.isArray(value)) return "array";
3934
4138
  if (value instanceof Object && value.constructor.name !== "Object") {
3935
4139
  return value.constructor.name;
3936
4140
  }
@@ -3941,17 +4145,27 @@ const HistoryAction = ({ model, document }) => {
3941
4145
  const { formatMessage } = useIntl();
3942
4146
  const [{ query }] = useQueryParams();
3943
4147
  const navigate = useNavigate();
4148
+ const { trackUsage } = useTracking();
4149
+ const { pathname } = useLocation();
3944
4150
  const pluginsQueryParams = stringify({ plugins: query.plugins }, { encode: false });
3945
4151
  if (!window.strapi.features.isEnabled("cms-content-history")) {
3946
4152
  return null;
3947
4153
  }
4154
+ const handleOnClick = () => {
4155
+ const destination = { pathname: "history", search: pluginsQueryParams };
4156
+ trackUsage("willNavigate", {
4157
+ from: pathname,
4158
+ to: `${pathname}/${destination.pathname}`
4159
+ });
4160
+ navigate(destination);
4161
+ };
3948
4162
  return {
3949
4163
  icon: /* @__PURE__ */ jsx(ClockCounterClockwise, {}),
3950
4164
  label: formatMessage({
3951
4165
  id: "content-manager.history.document-action",
3952
4166
  defaultMessage: "Content History"
3953
4167
  }),
3954
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
4168
+ onClick: handleOnClick,
3955
4169
  disabled: (
3956
4170
  /**
3957
4171
  * The user is creating a new document.
@@ -3973,6 +4187,7 @@ const HistoryAction = ({ model, document }) => {
3973
4187
  };
3974
4188
  };
3975
4189
  HistoryAction.type = "history";
4190
+ HistoryAction.position = "header";
3976
4191
  const historyAdmin = {
3977
4192
  bootstrap(app) {
3978
4193
  const { addDocumentAction } = app.getPlugin("content-manager").apis;
@@ -4035,10 +4250,18 @@ const previewApi = contentManagerApi.injectEndpoints({
4035
4250
  })
4036
4251
  });
4037
4252
  const { useGetPreviewUrlQuery } = previewApi;
4253
+ const ConditionalTooltip = ({ isShown, label, children }) => {
4254
+ if (isShown) {
4255
+ return /* @__PURE__ */ jsx(Tooltip, { label, children });
4256
+ }
4257
+ return children;
4258
+ };
4038
4259
  const PreviewSidePanel = ({ model, documentId, document }) => {
4039
4260
  const { formatMessage } = useIntl();
4040
4261
  const { trackUsage } = useTracking();
4262
+ const { pathname } = useLocation();
4041
4263
  const [{ query }] = useQueryParams();
4264
+ const isModified = useForm("PreviewSidePanel", (state) => state.modified);
4042
4265
  const { data, error } = useGetPreviewUrlQuery({
4043
4266
  params: {
4044
4267
  contentType: model
@@ -4052,33 +4275,43 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
4052
4275
  if (!data?.data?.url || error) {
4053
4276
  return null;
4054
4277
  }
4055
- const handleClick = () => {
4056
- trackUsage("willOpenPreview");
4278
+ const trackNavigation = () => {
4279
+ const destinationPathname = pathname.replace(/\/$/, "") + "/preview";
4280
+ trackUsage("willNavigate", { from: pathname, to: destinationPathname });
4057
4281
  };
4058
4282
  return {
4059
4283
  title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4060
- content: /* @__PURE__ */ jsx(Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsx(
4061
- Button,
4284
+ content: /* @__PURE__ */ jsx(
4285
+ ConditionalTooltip,
4062
4286
  {
4063
- variant: "tertiary",
4064
- tag: Link,
4065
- to: { pathname: "preview", search: stringify(query, { encode: false }) },
4066
- onClick: handleClick,
4067
- flex: "auto",
4068
- children: formatMessage({
4069
- id: "content-manager.preview.panel.button",
4070
- defaultMessage: "Open preview"
4071
- })
4287
+ label: formatMessage({
4288
+ id: "content-manager.preview.panel.button-disabled-tooltip",
4289
+ defaultMessage: "Please save to open the preview"
4290
+ }),
4291
+ isShown: isModified,
4292
+ children: /* @__PURE__ */ jsx(Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsx(
4293
+ Button,
4294
+ {
4295
+ variant: "tertiary",
4296
+ tag: Link,
4297
+ to: { pathname: "preview", search: stringify(query, { encode: false }) },
4298
+ onClick: trackNavigation,
4299
+ width: "100%",
4300
+ disabled: isModified,
4301
+ pointerEvents: isModified ? "none" : void 0,
4302
+ tabIndex: isModified ? -1 : void 0,
4303
+ children: formatMessage({
4304
+ id: "content-manager.preview.panel.button",
4305
+ defaultMessage: "Open preview"
4306
+ })
4307
+ }
4308
+ ) })
4072
4309
  }
4073
- ) })
4310
+ )
4074
4311
  };
4075
4312
  };
4076
- const FEATURE_ID = "preview";
4077
4313
  const previewAdmin = {
4078
4314
  bootstrap(app) {
4079
- if (!window.strapi.future.isEnabled(FEATURE_ID)) {
4080
- return;
4081
- }
4082
4315
  const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4083
4316
  contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4084
4317
  }
@@ -4102,7 +4335,7 @@ const index = {
4102
4335
  app.router.addRoute({
4103
4336
  path: "content-manager/*",
4104
4337
  lazy: async () => {
4105
- const { Layout } = await import("./layout-DKEX3X49.mjs");
4338
+ const { Layout } = await import("./layout-mSwsYzxv.mjs");
4106
4339
  return {
4107
4340
  Component: Layout
4108
4341
  };
@@ -4122,7 +4355,7 @@ const index = {
4122
4355
  async registerTrads({ locales }) {
4123
4356
  const importedTrads = await Promise.all(
4124
4357
  locales.map((locale) => {
4125
- 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-D_BMf0hT.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`).then(({ default: data }) => {
4358
+ 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-BZaUty0m.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 }) => {
4126
4359
  return {
4127
4360
  data: prefixPluginTranslations(data, PLUGIN_ID),
4128
4361
  locale
@@ -4139,24 +4372,27 @@ const index = {
4139
4372
  }
4140
4373
  };
4141
4374
  export {
4142
- ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD as A,
4375
+ useUpdateContentTypeConfigurationMutation as A,
4143
4376
  BulkActionsRenderer as B,
4144
4377
  COLLECTION_TYPES as C,
4145
4378
  DocumentStatus as D,
4146
- extractContentTypeComponents as E,
4147
- DEFAULT_SETTINGS as F,
4148
- convertEditLayoutToFieldLayouts as G,
4379
+ ATTRIBUTE_TYPES_THAT_CANNOT_BE_MAIN_FIELD as E,
4380
+ extractContentTypeComponents as F,
4381
+ DEFAULT_SETTINGS as G,
4149
4382
  HOOKS as H,
4150
4383
  InjectionZone as I,
4151
- useDocument as J,
4152
- useGetPreviewUrlQuery as K,
4153
- index as L,
4154
- useContentManagerContext as M,
4155
- useDocumentActions as N,
4384
+ convertEditLayoutToFieldLayouts as J,
4385
+ removeFieldsThatDontExistOnSchema as K,
4386
+ prepareTempKeys as L,
4387
+ useDocument as M,
4388
+ useGetPreviewUrlQuery as N,
4389
+ index as O,
4156
4390
  Panels as P,
4391
+ useContentManagerContext as Q,
4157
4392
  RelativeTime as R,
4158
4393
  SINGLE_TYPES as S,
4159
4394
  TableActions as T,
4395
+ useDocumentActions as U,
4160
4396
  useGetInitialDataQuery as a,
4161
4397
  useGetAllContentTypeSettingsQuery as b,
4162
4398
  useDoc as c,
@@ -4169,19 +4405,19 @@ export {
4169
4405
  Header as j,
4170
4406
  PERMISSIONS as k,
4171
4407
  DocumentRBAC as l,
4172
- DOCUMENT_META_FIELDS as m,
4173
- CLONE_PATH as n,
4174
- useDocLayout as o,
4408
+ useDocLayout as m,
4409
+ createDefaultForm as n,
4410
+ CLONE_PATH as o,
4175
4411
  useGetContentTypeConfigurationQuery as p,
4176
4412
  CREATOR_FIELDS as q,
4177
4413
  getMainField as r,
4178
4414
  setInitialData as s,
4179
- getDisplayName as t,
4415
+ transformDocument as t,
4180
4416
  useContentTypeSchema as u,
4181
- checkIfAttributeIsDisplayable as v,
4182
- useGetAllDocumentsQuery as w,
4183
- convertListLayoutToFieldLayouts as x,
4184
- capitalise as y,
4185
- useUpdateContentTypeConfigurationMutation as z
4417
+ getDisplayName as v,
4418
+ checkIfAttributeIsDisplayable as w,
4419
+ useGetAllDocumentsQuery as x,
4420
+ convertListLayoutToFieldLayouts as y,
4421
+ capitalise as z
4186
4422
  };
4187
- //# sourceMappingURL=index-BagcPV6I.mjs.map
4423
+ //# sourceMappingURL=index-DiluOUp6.mjs.map