@strapi/content-manager 0.0.0-experimental.c3e9d4b26f9fd3d9eb530b5c11f9baa1d09b13ad → 0.0.0-experimental.cb311d9fcfbd8e441f790aea232f0a39bdd90e16

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 (104) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-BMajAl1u.mjs → ComponentConfigurationPage-D0dyDTwq.mjs} +3 -3
  3. package/dist/_chunks/{ComponentConfigurationPage-BMajAl1u.mjs.map → ComponentConfigurationPage-D0dyDTwq.mjs.map} +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-y_7iLdmB.js → ComponentConfigurationPage-DL1MHO8i.js} +3 -3
  5. package/dist/_chunks/{ComponentConfigurationPage-y_7iLdmB.js.map → ComponentConfigurationPage-DL1MHO8i.js.map} +1 -1
  6. package/dist/_chunks/{EditConfigurationPage-CcOoD26O.mjs → EditConfigurationPage-13b7S5Cq.mjs} +3 -3
  7. package/dist/_chunks/{EditConfigurationPage-CcOoD26O.mjs.map → EditConfigurationPage-13b7S5Cq.mjs.map} +1 -1
  8. package/dist/_chunks/{EditConfigurationPage-CPVB8Uqc.js → EditConfigurationPage-CMaOf-A-.js} +3 -3
  9. package/dist/_chunks/{EditConfigurationPage-CPVB8Uqc.js.map → EditConfigurationPage-CMaOf-A-.js.map} +1 -1
  10. package/dist/_chunks/{EditViewPage-CTTDHKkQ.js → EditViewPage-BSVmMpRd.js} +45 -45
  11. package/dist/_chunks/EditViewPage-BSVmMpRd.js.map +1 -0
  12. package/dist/_chunks/{EditViewPage-DWb0DE7R.mjs → EditViewPage-C3tIZ8F5.mjs} +46 -46
  13. package/dist/_chunks/EditViewPage-C3tIZ8F5.mjs.map +1 -0
  14. package/dist/_chunks/{Field-DnStdvQw.mjs → Field-BvuT8cGL.mjs} +422 -142
  15. package/dist/_chunks/Field-BvuT8cGL.mjs.map +1 -0
  16. package/dist/_chunks/{Field-C5Z1Ivdv.js → Field-DUCVth4C.js} +421 -141
  17. package/dist/_chunks/Field-DUCVth4C.js.map +1 -0
  18. package/dist/_chunks/{Form-DqGgE55Q.mjs → Form-BZmDNVr9.mjs} +27 -28
  19. package/dist/_chunks/Form-BZmDNVr9.mjs.map +1 -0
  20. package/dist/_chunks/{Form-B81OtW-k.js → Form-Cpl4W1ak.js} +25 -26
  21. package/dist/_chunks/Form-Cpl4W1ak.js.map +1 -0
  22. package/dist/_chunks/{History-DS6-HCYX.mjs → History-Cq_Hrzuu.mjs} +52 -29
  23. package/dist/_chunks/History-Cq_Hrzuu.mjs.map +1 -0
  24. package/dist/_chunks/{History-4NbOq2dX.js → History-D4U2YISB.js} +51 -28
  25. package/dist/_chunks/History-D4U2YISB.js.map +1 -0
  26. package/dist/_chunks/{ListConfigurationPage-CpfstlYY.js → ListConfigurationPage-Bny6CdWe.js} +48 -47
  27. package/dist/_chunks/ListConfigurationPage-Bny6CdWe.js.map +1 -0
  28. package/dist/_chunks/{ListConfigurationPage-DQJJltko.mjs → ListConfigurationPage-W-KQHmBv.mjs} +49 -49
  29. package/dist/_chunks/ListConfigurationPage-W-KQHmBv.mjs.map +1 -0
  30. package/dist/_chunks/{ListViewPage-nQrOQuVo.mjs → ListViewPage-HBBnJa8K.mjs} +67 -70
  31. package/dist/_chunks/ListViewPage-HBBnJa8K.mjs.map +1 -0
  32. package/dist/_chunks/{ListViewPage-CA3I75m5.js → ListViewPage-O8F1pBJo.js} +65 -68
  33. package/dist/_chunks/ListViewPage-O8F1pBJo.js.map +1 -0
  34. package/dist/_chunks/{NoContentTypePage-DbnHE22g.mjs → NoContentTypePage-B-gIhHWM.mjs} +2 -2
  35. package/dist/_chunks/{NoContentTypePage-DbnHE22g.mjs.map → NoContentTypePage-B-gIhHWM.mjs.map} +1 -1
  36. package/dist/_chunks/{NoContentTypePage-Dldu-_Mx.js → NoContentTypePage-CQWChGPw.js} +2 -2
  37. package/dist/_chunks/{NoContentTypePage-Dldu-_Mx.js.map → NoContentTypePage-CQWChGPw.js.map} +1 -1
  38. package/dist/_chunks/{NoPermissionsPage-CO2MK200.js → NoPermissionsPage-CY46zxnM.js} +2 -2
  39. package/dist/_chunks/{NoPermissionsPage-CO2MK200.js.map → NoPermissionsPage-CY46zxnM.js.map} +1 -1
  40. package/dist/_chunks/{NoPermissionsPage-fOIkQM0v.mjs → NoPermissionsPage-XhOPl8wx.mjs} +2 -2
  41. package/dist/_chunks/{NoPermissionsPage-fOIkQM0v.mjs.map → NoPermissionsPage-XhOPl8wx.mjs.map} +1 -1
  42. package/dist/_chunks/{Relations-DG2jnOcr.js → Relations-C4gGfZRv.js} +3 -3
  43. package/dist/_chunks/Relations-C4gGfZRv.js.map +1 -0
  44. package/dist/_chunks/{Relations-BDRl99Ux.mjs → Relations-vFZ6Wasg.mjs} +3 -3
  45. package/dist/_chunks/Relations-vFZ6Wasg.mjs.map +1 -0
  46. package/dist/_chunks/{en-Ux26r5pl.mjs → en-BrCTWlZv.mjs} +5 -4
  47. package/dist/_chunks/{en-Ux26r5pl.mjs.map → en-BrCTWlZv.mjs.map} +1 -1
  48. package/dist/_chunks/{en-fbKQxLGn.js → en-uOUIxfcQ.js} +5 -4
  49. package/dist/_chunks/{en-fbKQxLGn.js.map → en-uOUIxfcQ.js.map} +1 -1
  50. package/dist/_chunks/{index-BZoNZMXL.js → index-5EMXLEM_.js} +384 -388
  51. package/dist/_chunks/index-5EMXLEM_.js.map +1 -0
  52. package/dist/_chunks/{index-Drt2DN7v.mjs → index-Dpxg3ctD.mjs} +399 -403
  53. package/dist/_chunks/index-Dpxg3ctD.mjs.map +1 -0
  54. package/dist/_chunks/{layout-BzAbmoO6.mjs → layout-C0INpKap.mjs} +22 -10
  55. package/dist/_chunks/layout-C0INpKap.mjs.map +1 -0
  56. package/dist/_chunks/{layout-DEYBqgF1.js → layout-P3eKO1Qy.js} +20 -8
  57. package/dist/_chunks/layout-P3eKO1Qy.js.map +1 -0
  58. package/dist/_chunks/{relations-D0eZ4VWw.js → relations-B1y0K6LE.js} +2 -2
  59. package/dist/_chunks/{relations-D0eZ4VWw.js.map → relations-B1y0K6LE.js.map} +1 -1
  60. package/dist/_chunks/{relations-D26zVRdi.mjs → relations-FBRRBWeO.mjs} +2 -2
  61. package/dist/_chunks/{relations-D26zVRdi.mjs.map → relations-FBRRBWeO.mjs.map} +1 -1
  62. package/dist/admin/index.js +1 -1
  63. package/dist/admin/index.mjs +4 -4
  64. package/dist/admin/src/history/index.d.ts +3 -0
  65. package/dist/admin/src/index.d.ts +1 -0
  66. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +8 -3
  67. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  68. package/dist/admin/src/pages/EditView/components/FormInputs/Relations.d.ts +20 -0
  69. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +2 -10
  70. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  71. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  72. package/dist/server/index.js +137 -87
  73. package/dist/server/index.js.map +1 -1
  74. package/dist/server/index.mjs +138 -88
  75. package/dist/server/index.mjs.map +1 -1
  76. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  77. package/dist/server/src/controllers/uid.d.ts.map +1 -1
  78. package/dist/server/src/controllers/validation/dimensions.d.ts +4 -2
  79. package/dist/server/src/controllers/validation/dimensions.d.ts.map +1 -1
  80. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  81. package/dist/server/src/history/services/utils.d.ts +1 -1
  82. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  83. package/dist/server/src/services/document-manager.d.ts.map +1 -1
  84. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  85. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  86. package/package.json +8 -8
  87. package/dist/_chunks/EditViewPage-CTTDHKkQ.js.map +0 -1
  88. package/dist/_chunks/EditViewPage-DWb0DE7R.mjs.map +0 -1
  89. package/dist/_chunks/Field-C5Z1Ivdv.js.map +0 -1
  90. package/dist/_chunks/Field-DnStdvQw.mjs.map +0 -1
  91. package/dist/_chunks/Form-B81OtW-k.js.map +0 -1
  92. package/dist/_chunks/Form-DqGgE55Q.mjs.map +0 -1
  93. package/dist/_chunks/History-4NbOq2dX.js.map +0 -1
  94. package/dist/_chunks/History-DS6-HCYX.mjs.map +0 -1
  95. package/dist/_chunks/ListConfigurationPage-CpfstlYY.js.map +0 -1
  96. package/dist/_chunks/ListConfigurationPage-DQJJltko.mjs.map +0 -1
  97. package/dist/_chunks/ListViewPage-CA3I75m5.js.map +0 -1
  98. package/dist/_chunks/ListViewPage-nQrOQuVo.mjs.map +0 -1
  99. package/dist/_chunks/Relations-BDRl99Ux.mjs.map +0 -1
  100. package/dist/_chunks/Relations-DG2jnOcr.js.map +0 -1
  101. package/dist/_chunks/index-BZoNZMXL.js.map +0 -1
  102. package/dist/_chunks/index-Drt2DN7v.mjs.map +0 -1
  103. package/dist/_chunks/layout-BzAbmoO6.mjs.map +0 -1
  104. package/dist/_chunks/layout-DEYBqgF1.js.map +0 -1
@@ -2,15 +2,15 @@
2
2
  const Icons = require("@strapi/icons");
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const strapiAdmin = require("@strapi/admin/strapi-admin");
5
- const qs = require("qs");
6
- const reactIntl = require("react-intl");
7
- const reactRouterDom = require("react-router-dom");
8
5
  const React = require("react");
9
6
  const designSystem = require("@strapi/design-system");
7
+ const reactIntl = require("react-intl");
8
+ const reactRouterDom = require("react-router-dom");
10
9
  const styledComponents = require("styled-components");
11
10
  const yup = require("yup");
12
11
  const pipe = require("lodash/fp/pipe");
13
12
  const dateFns = require("date-fns");
13
+ const qs = require("qs");
14
14
  const toolkit = require("@reduxjs/toolkit");
15
15
  const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
16
16
  function _interopNamespace(e) {
@@ -70,42 +70,6 @@ const useInjectionZone = (area) => {
70
70
  const [page, position] = area.split(".");
71
71
  return contentManagerPlugin.getInjectedComponents(page, position);
72
72
  };
73
- const HistoryAction = ({ model, document }) => {
74
- const { formatMessage } = reactIntl.useIntl();
75
- const [{ query }] = strapiAdmin.useQueryParams();
76
- const navigate = reactRouterDom.useNavigate();
77
- const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
78
- if (!window.strapi.features.isEnabled("cms-content-history")) {
79
- return null;
80
- }
81
- return {
82
- icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
83
- label: formatMessage({
84
- id: "content-manager.history.document-action",
85
- defaultMessage: "Content History"
86
- }),
87
- onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
88
- disabled: (
89
- /**
90
- * The user is creating a new document.
91
- * It hasn't been saved yet, so there's no history to go to
92
- */
93
- !document || /**
94
- * The document has been created but the current dimension has never been saved.
95
- * For example, the user is creating a new locale in an existing document,
96
- * so there's no history for the document in that locale
97
- */
98
- !document.id || /**
99
- * History is only available for content types created by the user.
100
- * These have the `api::` prefix, as opposed to the ones created by Strapi or plugins,
101
- * which start with `admin::` or `plugin::`
102
- */
103
- !model.startsWith("api::")
104
- ),
105
- position: "header"
106
- };
107
- };
108
- HistoryAction.type = "history";
109
73
  const ID = "id";
110
74
  const CREATED_BY_ATTRIBUTE_NAME = "createdBy";
111
75
  const UPDATED_BY_ATTRIBUTE_NAME = "updatedBy";
@@ -219,6 +183,7 @@ const contentManagerApi = strapiAdmin.adminApi.enhanceEndpoints({
219
183
  ]
220
184
  });
221
185
  const documentApi = contentManagerApi.injectEndpoints({
186
+ overrideExisting: true,
222
187
  endpoints: (builder) => ({
223
188
  autoCloneDocument: builder.mutation({
224
189
  query: ({ model, sourceId, query }) => ({
@@ -228,7 +193,12 @@ const documentApi = contentManagerApi.injectEndpoints({
228
193
  params: query
229
194
  }
230
195
  }),
231
- invalidatesTags: (_result, _error, { model }) => [{ type: "Document", id: `${model}_LIST` }]
196
+ invalidatesTags: (_result, error, { model }) => {
197
+ if (error) {
198
+ return [];
199
+ }
200
+ return [{ type: "Document", id: `${model}_LIST` }];
201
+ }
232
202
  }),
233
203
  cloneDocument: builder.mutation({
234
204
  query: ({ model, sourceId, data, params }) => ({
@@ -315,6 +285,7 @@ const documentApi = contentManagerApi.injectEndpoints({
315
285
  }),
316
286
  providesTags: (result, _error, arg) => {
317
287
  return [
288
+ { type: "Document", id: `ALL_LIST` },
318
289
  { type: "Document", id: `${arg.model}_LIST` },
319
290
  ...result?.results.map(({ documentId }) => ({
320
291
  type: "Document",
@@ -353,6 +324,11 @@ const documentApi = contentManagerApi.injectEndpoints({
353
324
  {
354
325
  type: "Document",
355
326
  id: collectionType !== SINGLE_TYPES ? `${model}_${result && "documentId" in result ? result.documentId : documentId}` : model
327
+ },
328
+ // Make it easy to invalidate all individual documents queries for a model
329
+ {
330
+ type: "Document",
331
+ id: `${model}_ALL_ITEMS`
356
332
  }
357
333
  ];
358
334
  }
@@ -418,6 +394,18 @@ const documentApi = contentManagerApi.injectEndpoints({
418
394
  },
419
395
  "Relations"
420
396
  ];
397
+ },
398
+ async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
399
+ const patchResult = dispatch(
400
+ documentApi.util.updateQueryData("getDocument", patch, (draft) => {
401
+ Object.assign(draft.data, data);
402
+ })
403
+ );
404
+ try {
405
+ await queryFulfilled;
406
+ } catch {
407
+ patchResult.undo();
408
+ }
421
409
  }
422
410
  }),
423
411
  unpublishDocument: builder.mutation({
@@ -601,6 +589,14 @@ const createAttributeSchema = (attribute) => {
601
589
  if (!value || typeof value === "string" && value.length === 0) {
602
590
  return true;
603
591
  }
592
+ if (typeof value === "object") {
593
+ try {
594
+ JSON.stringify(value);
595
+ return true;
596
+ } catch (err) {
597
+ return false;
598
+ }
599
+ }
604
600
  try {
605
601
  JSON.parse(value);
606
602
  return true;
@@ -620,11 +616,11 @@ const createAttributeSchema = (attribute) => {
620
616
  }
621
617
  };
622
618
  const addRequiredValidation = (attribute) => (schema) => {
623
- if (attribute.required) {
624
- return schema.required({
625
- id: strapiAdmin.translatedErrors.required.id,
626
- defaultMessage: "This field is required."
627
- });
619
+ if ((attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") && attribute.required && "min" in schema) {
620
+ return schema.min(1, strapiAdmin.translatedErrors.required);
621
+ }
622
+ if (attribute.required && attribute.type !== "relation") {
623
+ return schema.required(strapiAdmin.translatedErrors.required);
628
624
  }
629
625
  return schema?.nullable ? schema.nullable() : (
630
626
  // In some cases '.nullable' will not be available on the schema.
@@ -658,6 +654,28 @@ const addMaxLengthValidation = (attribute) => (schema) => {
658
654
  const addMinValidation = (attribute) => (schema) => {
659
655
  if ("min" in attribute) {
660
656
  const min = toInteger(attribute.min);
657
+ if (attribute.type === "component" && attribute.repeatable || attribute.type === "dynamiczone") {
658
+ if (!attribute.required && "test" in schema && min) {
659
+ return schema.test(
660
+ "custom-min",
661
+ {
662
+ ...strapiAdmin.translatedErrors.min,
663
+ values: {
664
+ min: attribute.min
665
+ }
666
+ },
667
+ (value) => {
668
+ if (!value) {
669
+ return true;
670
+ }
671
+ if (Array.isArray(value) && value.length === 0) {
672
+ return true;
673
+ }
674
+ return value.length >= min;
675
+ }
676
+ );
677
+ }
678
+ }
661
679
  if ("min" in schema && min) {
662
680
  return schema.min(min, {
663
681
  ...strapiAdmin.translatedErrors.min,
@@ -784,7 +802,10 @@ const useDocument = (args, opts) => {
784
802
  isLoading: isLoadingDocument,
785
803
  isFetching: isFetchingDocument,
786
804
  error
787
- } = useGetDocumentQuery(args, opts);
805
+ } = useGetDocumentQuery(args, {
806
+ ...opts,
807
+ skip: !args.documentId && args.collectionType !== SINGLE_TYPES || opts?.skip
808
+ });
788
809
  const { components, schema, isLoading: isLoadingSchema } = useContentTypeSchema(args.model);
789
810
  React__namespace.useEffect(() => {
790
811
  if (error) {
@@ -1205,7 +1226,6 @@ const useDocumentActions = () => {
1205
1226
  sourceId
1206
1227
  });
1207
1228
  if ("error" in res) {
1208
- toggleNotification({ type: "danger", message: formatAPIError(res.error) });
1209
1229
  return { error: res.error };
1210
1230
  }
1211
1231
  toggleNotification({
@@ -1286,7 +1306,7 @@ const useDocumentActions = () => {
1286
1306
  };
1287
1307
  };
1288
1308
  const ProtectedHistoryPage = React.lazy(
1289
- () => Promise.resolve().then(() => require("./History-4NbOq2dX.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1309
+ () => Promise.resolve().then(() => require("./History-D4U2YISB.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1290
1310
  );
1291
1311
  const routes$1 = [
1292
1312
  {
@@ -1299,31 +1319,31 @@ const routes$1 = [
1299
1319
  }
1300
1320
  ];
1301
1321
  const ProtectedEditViewPage = React.lazy(
1302
- () => Promise.resolve().then(() => require("./EditViewPage-CTTDHKkQ.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1322
+ () => Promise.resolve().then(() => require("./EditViewPage-BSVmMpRd.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1303
1323
  );
1304
1324
  const ProtectedListViewPage = React.lazy(
1305
- () => Promise.resolve().then(() => require("./ListViewPage-CA3I75m5.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1325
+ () => Promise.resolve().then(() => require("./ListViewPage-O8F1pBJo.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1306
1326
  );
1307
1327
  const ProtectedListConfiguration = React.lazy(
1308
- () => Promise.resolve().then(() => require("./ListConfigurationPage-CpfstlYY.js")).then((mod) => ({
1328
+ () => Promise.resolve().then(() => require("./ListConfigurationPage-Bny6CdWe.js")).then((mod) => ({
1309
1329
  default: mod.ProtectedListConfiguration
1310
1330
  }))
1311
1331
  );
1312
1332
  const ProtectedEditConfigurationPage = React.lazy(
1313
- () => Promise.resolve().then(() => require("./EditConfigurationPage-CPVB8Uqc.js")).then((mod) => ({
1333
+ () => Promise.resolve().then(() => require("./EditConfigurationPage-CMaOf-A-.js")).then((mod) => ({
1314
1334
  default: mod.ProtectedEditConfigurationPage
1315
1335
  }))
1316
1336
  );
1317
1337
  const ProtectedComponentConfigurationPage = React.lazy(
1318
- () => Promise.resolve().then(() => require("./ComponentConfigurationPage-y_7iLdmB.js")).then((mod) => ({
1338
+ () => Promise.resolve().then(() => require("./ComponentConfigurationPage-DL1MHO8i.js")).then((mod) => ({
1319
1339
  default: mod.ProtectedComponentConfigurationPage
1320
1340
  }))
1321
1341
  );
1322
1342
  const NoPermissions = React.lazy(
1323
- () => Promise.resolve().then(() => require("./NoPermissionsPage-CO2MK200.js")).then((mod) => ({ default: mod.NoPermissions }))
1343
+ () => Promise.resolve().then(() => require("./NoPermissionsPage-CY46zxnM.js")).then((mod) => ({ default: mod.NoPermissions }))
1324
1344
  );
1325
1345
  const NoContentType = React.lazy(
1326
- () => Promise.resolve().then(() => require("./NoContentTypePage-Dldu-_Mx.js")).then((mod) => ({ default: mod.NoContentType }))
1346
+ () => Promise.resolve().then(() => require("./NoContentTypePage-CQWChGPw.js")).then((mod) => ({ default: mod.NoContentType }))
1327
1347
  );
1328
1348
  const CollectionTypePages = () => {
1329
1349
  const { collectionType } = reactRouterDom.useParams();
@@ -1437,7 +1457,7 @@ const DocumentActionButton = (action) => {
1437
1457
  /* @__PURE__ */ jsxRuntime.jsx(
1438
1458
  designSystem.Button,
1439
1459
  {
1440
- flex: 1,
1460
+ flex: "auto",
1441
1461
  startIcon: action.icon,
1442
1462
  disabled: action.disabled,
1443
1463
  onClick: handleClick(action),
@@ -1450,7 +1470,7 @@ const DocumentActionButton = (action) => {
1450
1470
  DocumentActionConfirmDialog,
1451
1471
  {
1452
1472
  ...action.dialog,
1453
- variant: action.variant,
1473
+ variant: action.dialog?.variant ?? action.variant,
1454
1474
  isOpen: dialogId === action.id,
1455
1475
  onClose: handleClose
1456
1476
  }
@@ -1507,9 +1527,9 @@ const DocumentActionsMenu = ({
1507
1527
  disabled: isDisabled,
1508
1528
  size: "S",
1509
1529
  endIcon: null,
1510
- paddingTop: "7px",
1511
- paddingLeft: "9px",
1512
- paddingRight: "9px",
1530
+ paddingTop: "4px",
1531
+ paddingLeft: "7px",
1532
+ paddingRight: "7px",
1513
1533
  variant,
1514
1534
  children: [
1515
1535
  /* @__PURE__ */ jsxRuntime.jsx(Icons.More, { "aria-hidden": true, focusable: false }),
@@ -1529,10 +1549,18 @@ const DocumentActionsMenu = ({
1529
1549
  onSelect: handleClick(action),
1530
1550
  display: "block",
1531
1551
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: [
1532
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { color: convertActionVariantToColor(action.variant), gap: 2, tag: "span", children: [
1533
- action.icon,
1534
- action.label
1535
- ] }),
1552
+ /* @__PURE__ */ jsxRuntime.jsxs(
1553
+ designSystem.Flex,
1554
+ {
1555
+ color: !action.disabled ? convertActionVariantToColor(action.variant) : "inherit",
1556
+ gap: 2,
1557
+ tag: "span",
1558
+ children: [
1559
+ /* @__PURE__ */ jsxRuntime.jsx("span", { children: action.icon }),
1560
+ action.label
1561
+ ]
1562
+ }
1563
+ ),
1536
1564
  action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsxRuntime.jsx(
1537
1565
  designSystem.Flex,
1538
1566
  {
@@ -1613,22 +1641,20 @@ const DocumentActionConfirmDialog = ({
1613
1641
  }
1614
1642
  onClose();
1615
1643
  };
1616
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog, { isOpen, title, onClose: handleClose, children: [
1617
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.DialogBody, { children: content }),
1618
- /* @__PURE__ */ jsxRuntime.jsx(
1619
- designSystem.DialogFooter,
1620
- {
1621
- startAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClose, variant: "tertiary", children: formatMessage({
1622
- id: "app.components.Button.cancel",
1623
- defaultMessage: "Cancel"
1624
- }) }),
1625
- endAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleConfirm, variant, children: formatMessage({
1626
- id: "app.components.Button.confirm",
1627
- defaultMessage: "Confirm"
1628
- }) })
1629
- }
1630
- )
1631
- ] });
1644
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
1645
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: title }),
1646
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: content }),
1647
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
1648
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { variant: "tertiary", children: formatMessage({
1649
+ id: "app.components.Button.cancel",
1650
+ defaultMessage: "Cancel"
1651
+ }) }) }),
1652
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleConfirm, variant, children: formatMessage({
1653
+ id: "app.components.Button.confirm",
1654
+ defaultMessage: "Confirm"
1655
+ }) })
1656
+ ] })
1657
+ ] }) });
1632
1658
  };
1633
1659
  const DocumentActionModal = ({
1634
1660
  isOpen,
@@ -1638,34 +1664,17 @@ const DocumentActionModal = ({
1638
1664
  content: Content,
1639
1665
  onModalClose
1640
1666
  }) => {
1641
- const id = React__namespace.useId();
1642
- if (!isOpen) {
1643
- return null;
1644
- }
1645
1667
  const handleClose = () => {
1646
1668
  if (onClose) {
1647
1669
  onClose();
1648
1670
  }
1649
1671
  onModalClose();
1650
1672
  };
1651
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { borderRadius: "4px", overflow: "hidden", onClose: handleClose, labelledBy: id, children: [
1652
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id, children: title }) }),
1653
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: typeof Content === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Content, { onClose: handleClose }) : Content }),
1654
- /* @__PURE__ */ jsxRuntime.jsx(
1655
- designSystem.Box,
1656
- {
1657
- paddingTop: 4,
1658
- paddingBottom: 4,
1659
- paddingLeft: 5,
1660
- paddingRight: 5,
1661
- borderWidth: "1px 0 0 0",
1662
- borderStyle: "solid",
1663
- borderColor: "neutral150",
1664
- background: "neutral100",
1665
- children: typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer
1666
- }
1667
- )
1668
- ] });
1673
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
1674
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: title }) }),
1675
+ typeof Content === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Content, { onClose: handleClose }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: Content }),
1676
+ typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer
1677
+ ] }) });
1669
1678
  };
1670
1679
  const PublishAction$1 = ({
1671
1680
  activeTab,
@@ -1686,6 +1695,12 @@ const PublishAction$1 = ({
1686
1695
  ({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 }) => ({ canPublish: canPublish2, canCreate: canCreate2, canUpdate: canUpdate2 })
1687
1696
  );
1688
1697
  const { publish } = useDocumentActions();
1698
+ const [
1699
+ countDraftRelations,
1700
+ { isLoading: isLoadingDraftRelations, isError: isErrorDraftRelations }
1701
+ ] = useLazyGetDraftRelationCountQuery();
1702
+ const [localCountOfDraftRelations, setLocalCountOfDraftRelations] = React__namespace.useState(0);
1703
+ const [serverCountOfDraftRelations, setServerCountOfDraftRelations] = React__namespace.useState(0);
1689
1704
  const [{ query, rawQuery }] = strapiAdmin.useQueryParams();
1690
1705
  const params = React__namespace.useMemo(() => buildValidParams(query), [query]);
1691
1706
  const modified = strapiAdmin.useForm("PublishAction", ({ modified: modified2 }) => modified2);
@@ -1694,10 +1709,101 @@ const PublishAction$1 = ({
1694
1709
  const validate = strapiAdmin.useForm("PublishAction", (state) => state.validate);
1695
1710
  const setErrors = strapiAdmin.useForm("PublishAction", (state) => state.setErrors);
1696
1711
  const formValues = strapiAdmin.useForm("PublishAction", ({ values }) => values);
1712
+ React__namespace.useEffect(() => {
1713
+ if (isErrorDraftRelations) {
1714
+ toggleNotification({
1715
+ type: "danger",
1716
+ message: formatMessage({
1717
+ id: getTranslation("error.records.fetch-draft-relatons"),
1718
+ defaultMessage: "An error occurred while fetching draft relations on this document."
1719
+ })
1720
+ });
1721
+ }
1722
+ }, [isErrorDraftRelations, toggleNotification, formatMessage]);
1723
+ React__namespace.useEffect(() => {
1724
+ const localDraftRelations = /* @__PURE__ */ new Set();
1725
+ const extractDraftRelations = (data) => {
1726
+ const relations = data.connect || [];
1727
+ relations.forEach((relation) => {
1728
+ if (relation.status === "draft") {
1729
+ localDraftRelations.add(relation.id);
1730
+ }
1731
+ });
1732
+ };
1733
+ const traverseAndExtract = (data) => {
1734
+ Object.entries(data).forEach(([key, value]) => {
1735
+ if (key === "connect" && Array.isArray(value)) {
1736
+ extractDraftRelations({ connect: value });
1737
+ } else if (typeof value === "object" && value !== null) {
1738
+ traverseAndExtract(value);
1739
+ }
1740
+ });
1741
+ };
1742
+ if (!documentId || modified) {
1743
+ traverseAndExtract(formValues);
1744
+ setLocalCountOfDraftRelations(localDraftRelations.size);
1745
+ }
1746
+ }, [documentId, modified, formValues, setLocalCountOfDraftRelations]);
1747
+ React__namespace.useEffect(() => {
1748
+ if (documentId) {
1749
+ const fetchDraftRelationsCount = async () => {
1750
+ const { data, error } = await countDraftRelations({
1751
+ collectionType,
1752
+ model,
1753
+ documentId,
1754
+ params
1755
+ });
1756
+ if (error) {
1757
+ throw error;
1758
+ }
1759
+ if (data) {
1760
+ setServerCountOfDraftRelations(data.data);
1761
+ }
1762
+ };
1763
+ fetchDraftRelationsCount();
1764
+ }
1765
+ }, [documentId, countDraftRelations, collectionType, model, params]);
1697
1766
  const isDocumentPublished = (document?.[PUBLISHED_AT_ATTRIBUTE_NAME] || meta?.availableStatus.some((doc) => doc[PUBLISHED_AT_ATTRIBUTE_NAME] !== null)) && document?.status !== "modified";
1698
1767
  if (!schema?.options?.draftAndPublish) {
1699
1768
  return null;
1700
1769
  }
1770
+ const performPublish = async () => {
1771
+ setSubmitting(true);
1772
+ try {
1773
+ const { errors } = await validate();
1774
+ if (errors) {
1775
+ toggleNotification({
1776
+ type: "danger",
1777
+ message: formatMessage({
1778
+ id: "content-manager.validation.error",
1779
+ defaultMessage: "There are validation errors in your document. Please fix them before saving."
1780
+ })
1781
+ });
1782
+ return;
1783
+ }
1784
+ const res = await publish(
1785
+ {
1786
+ collectionType,
1787
+ model,
1788
+ documentId,
1789
+ params
1790
+ },
1791
+ formValues
1792
+ );
1793
+ if ("data" in res && collectionType !== SINGLE_TYPES) {
1794
+ navigate({
1795
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
1796
+ search: rawQuery
1797
+ });
1798
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1799
+ setErrors(formatValidationErrors(res.error));
1800
+ }
1801
+ } finally {
1802
+ setSubmitting(false);
1803
+ }
1804
+ };
1805
+ const totalDraftRelations = localCountOfDraftRelations + serverCountOfDraftRelations;
1806
+ const hasDraftRelations = totalDraftRelations > 0;
1701
1807
  return {
1702
1808
  /**
1703
1809
  * Disabled when:
@@ -1707,49 +1813,39 @@ const PublishAction$1 = ({
1707
1813
  * - the document is already published & not modified
1708
1814
  * - the document is being created & not modified
1709
1815
  * - the user doesn't have the permission to publish
1710
- * - the user doesn't have the permission to create a new document
1711
- * - the user doesn't have the permission to update the document
1712
1816
  */
1713
- disabled: isCloning || isSubmitting || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish || Boolean(!document?.documentId && !canCreate || document?.documentId && !canUpdate),
1817
+ disabled: isCloning || isSubmitting || isLoadingDraftRelations || activeTab === "published" || !modified && isDocumentPublished || !modified && !document?.documentId || !canPublish,
1714
1818
  label: formatMessage({
1715
1819
  id: "app.utils.publish",
1716
1820
  defaultMessage: "Publish"
1717
1821
  }),
1718
1822
  onClick: async () => {
1719
- setSubmitting(true);
1720
- try {
1721
- const { errors } = await validate();
1722
- if (errors) {
1723
- toggleNotification({
1724
- type: "danger",
1725
- message: formatMessage({
1726
- id: "content-manager.validation.error",
1727
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
1728
- })
1729
- });
1730
- return;
1731
- }
1732
- const res = await publish(
1733
- {
1734
- collectionType,
1735
- model,
1736
- documentId,
1737
- params
1738
- },
1739
- formValues
1740
- );
1741
- if ("data" in res && collectionType !== SINGLE_TYPES) {
1742
- navigate({
1743
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
1744
- search: rawQuery
1745
- });
1746
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1747
- setErrors(formatValidationErrors(res.error));
1823
+ if (hasDraftRelations) {
1824
+ return;
1825
+ }
1826
+ await performPublish();
1827
+ },
1828
+ dialog: hasDraftRelations ? {
1829
+ type: "dialog",
1830
+ variant: "danger",
1831
+ footer: null,
1832
+ title: formatMessage({
1833
+ id: getTranslation(`popUpwarning.warning.bulk-has-draft-relations.title`),
1834
+ defaultMessage: "Confirmation"
1835
+ }),
1836
+ content: formatMessage(
1837
+ {
1838
+ id: getTranslation(`popUpwarning.warning.bulk-has-draft-relations.message`),
1839
+ defaultMessage: "This entry is related to {count, plural, one {# draft entry} other {# draft entries}}. Publishing it could leave broken links in your app."
1840
+ },
1841
+ {
1842
+ count: totalDraftRelations
1748
1843
  }
1749
- } finally {
1750
- setSubmitting(false);
1844
+ ),
1845
+ onConfirm: async () => {
1846
+ await performPublish();
1751
1847
  }
1752
- }
1848
+ } : void 0
1753
1849
  };
1754
1850
  };
1755
1851
  PublishAction$1.type = "publish";
@@ -1765,7 +1861,7 @@ const UpdateAction = ({
1765
1861
  const cloneMatch = reactRouterDom.useMatch(CLONE_PATH);
1766
1862
  const isCloning = cloneMatch !== null;
1767
1863
  const { formatMessage } = reactIntl.useIntl();
1768
- const { canCreate, canUpdate } = useDocumentRBAC("UpdateAction", ({ canCreate: canCreate2, canUpdate: canUpdate2 }) => ({
1864
+ useDocumentRBAC("UpdateAction", ({ canCreate: canCreate2, canUpdate: canUpdate2 }) => ({
1769
1865
  canCreate: canCreate2,
1770
1866
  canUpdate: canUpdate2
1771
1867
  }));
@@ -1785,10 +1881,8 @@ const UpdateAction = ({
1785
1881
  * - the form is submitting
1786
1882
  * - the document is not modified & we're not cloning (you can save a clone entity straight away)
1787
1883
  * - the active tab is the published tab
1788
- * - the user doesn't have the permission to create a new document
1789
- * - the user doesn't have the permission to update the document
1790
1884
  */
1791
- disabled: isSubmitting || !modified && !isCloning || activeTab === "published" || Boolean(!documentId && !canCreate || documentId && !canUpdate),
1885
+ disabled: isSubmitting || !modified && !isCloning || activeTab === "published",
1792
1886
  label: formatMessage({
1793
1887
  id: "content-manager.containers.Edit.save",
1794
1888
  defaultMessage: "Save"
@@ -1817,10 +1911,13 @@ const UpdateAction = ({
1817
1911
  document
1818
1912
  );
1819
1913
  if ("data" in res) {
1820
- navigate({
1821
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
1822
- search: rawQuery
1823
- });
1914
+ navigate(
1915
+ {
1916
+ pathname: `../${res.data.documentId}`,
1917
+ search: rawQuery
1918
+ },
1919
+ { relative: "path" }
1920
+ );
1824
1921
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1825
1922
  setErrors(formatValidationErrors(res.error));
1826
1923
  }
@@ -1848,10 +1945,13 @@ const UpdateAction = ({
1848
1945
  document
1849
1946
  );
1850
1947
  if ("data" in res && collectionType !== SINGLE_TYPES) {
1851
- navigate({
1852
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
1853
- search: rawQuery
1854
- });
1948
+ navigate(
1949
+ {
1950
+ pathname: `../${res.data.documentId}`,
1951
+ search: rawQuery
1952
+ },
1953
+ { replace: true, relative: "path" }
1954
+ );
1855
1955
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1856
1956
  setErrors(formatValidationErrors(res.error));
1857
1957
  }
@@ -1883,10 +1983,8 @@ const UnpublishAction$1 = ({
1883
1983
  const { toggleNotification } = strapiAdmin.useNotification();
1884
1984
  const [shouldKeepDraft, setShouldKeepDraft] = React__namespace.useState(true);
1885
1985
  const isDocumentModified = document?.status === "modified";
1886
- const handleChange = (e) => {
1887
- if ("value" in e.target) {
1888
- setShouldKeepDraft(e.target.value === UNPUBLISH_DRAFT_OPTIONS.KEEP);
1889
- }
1986
+ const handleChange = (value) => {
1987
+ setShouldKeepDraft(value === UNPUBLISH_DRAFT_OPTIONS.KEEP);
1890
1988
  };
1891
1989
  if (!schema?.options?.draftAndPublish) {
1892
1990
  return null;
@@ -1936,40 +2034,24 @@ const UnpublishAction$1 = ({
1936
2034
  }) })
1937
2035
  ] }),
1938
2036
  /* @__PURE__ */ jsxRuntime.jsxs(
1939
- designSystem.Flex,
2037
+ designSystem.Radio.Group,
1940
2038
  {
1941
- onChange: handleChange,
1942
- direction: "column",
1943
- alignItems: "flex-start",
1944
- tag: "fieldset",
1945
- borderWidth: 0,
1946
- gap: 3,
2039
+ defaultValue: UNPUBLISH_DRAFT_OPTIONS.KEEP,
2040
+ name: "discard-options",
2041
+ "aria-label": formatMessage({
2042
+ id: "content-manager.actions.unpublish.dialog.radio-label",
2043
+ defaultMessage: "Choose an option to unpublish the document."
2044
+ }),
2045
+ onValueChange: handleChange,
1947
2046
  children: [
1948
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { tag: "legend" }),
1949
- /* @__PURE__ */ jsxRuntime.jsx(
1950
- designSystem.Radio,
1951
- {
1952
- checked: shouldKeepDraft,
1953
- value: UNPUBLISH_DRAFT_OPTIONS.KEEP,
1954
- name: "discard-options",
1955
- children: formatMessage({
1956
- id: "content-manager.actions.unpublish.dialog.option.keep-draft",
1957
- defaultMessage: "Keep draft"
1958
- })
1959
- }
1960
- ),
1961
- /* @__PURE__ */ jsxRuntime.jsx(
1962
- designSystem.Radio,
1963
- {
1964
- checked: !shouldKeepDraft,
1965
- value: UNPUBLISH_DRAFT_OPTIONS.DISCARD,
1966
- name: "discard-options",
1967
- children: formatMessage({
1968
- id: "content-manager.actions.unpublish.dialog.option.replace-draft",
1969
- defaultMessage: "Replace draft"
1970
- })
1971
- }
1972
- )
2047
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Radio.Item, { checked: shouldKeepDraft, value: UNPUBLISH_DRAFT_OPTIONS.KEEP, children: formatMessage({
2048
+ id: "content-manager.actions.unpublish.dialog.option.keep-draft",
2049
+ defaultMessage: "Keep draft"
2050
+ }) }),
2051
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Radio.Item, { checked: !shouldKeepDraft, value: UNPUBLISH_DRAFT_OPTIONS.DISCARD, children: formatMessage({
2052
+ id: "content-manager.actions.unpublish.dialog.option.replace-draft",
2053
+ defaultMessage: "Replace draft"
2054
+ }) })
1973
2055
  ]
1974
2056
  }
1975
2057
  )
@@ -2115,23 +2197,13 @@ const Header = ({ isCreating, status, title: documentTitle = "Untitled" }) => {
2115
2197
  id: "content-manager.containers.edit.title.new",
2116
2198
  defaultMessage: "Create an entry"
2117
2199
  }) : documentTitle;
2118
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingTop: 8, paddingBottom: 4, gap: 3, children: [
2200
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "flex-start", paddingTop: 6, paddingBottom: 4, gap: 2, children: [
2119
2201
  /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.BackButton, {}),
2120
- /* @__PURE__ */ jsxRuntime.jsxs(
2121
- designSystem.Flex,
2122
- {
2123
- width: "100%",
2124
- justifyContent: "space-between",
2125
- paddingTop: 1,
2126
- gap: "80px",
2127
- alignItems: "flex-start",
2128
- children: [
2129
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: title }),
2130
- /* @__PURE__ */ jsxRuntime.jsx(HeaderToolbar, {})
2131
- ]
2132
- }
2133
- ),
2134
- status ? /* @__PURE__ */ jsxRuntime.jsx(DocumentStatus, { status: isCloning ? "draft" : status }) : null
2202
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { width: "100%", justifyContent: "space-between", gap: "80px", alignItems: "flex-start", children: [
2203
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "alpha", tag: "h1", children: title }),
2204
+ /* @__PURE__ */ jsxRuntime.jsx(HeaderToolbar, {})
2205
+ ] }),
2206
+ status ? /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 1, children: /* @__PURE__ */ jsxRuntime.jsx(DocumentStatus, { status: isCloning ? "draft" : status }) }) : null
2135
2207
  ] });
2136
2208
  };
2137
2209
  const HeaderToolbar = () => {
@@ -2822,30 +2894,23 @@ const ConfirmBulkActionDialog = ({
2822
2894
  endAction
2823
2895
  }) => {
2824
2896
  const { formatMessage } = reactIntl.useIntl();
2825
- return /* @__PURE__ */ jsxRuntime.jsxs(
2826
- designSystem.Dialog,
2827
- {
2828
- onClose: onToggleDialog,
2829
- title: formatMessage({
2830
- id: "app.components.ConfirmDialog.title",
2831
- defaultMessage: "Confirmation"
2832
- }),
2833
- isOpen,
2834
- children: [
2835
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.DialogBody, { icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}), children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: dialogBody }) }),
2836
- /* @__PURE__ */ jsxRuntime.jsx(
2837
- designSystem.DialogFooter,
2838
- {
2839
- startAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onToggleDialog, variant: "tertiary", children: formatMessage({
2840
- id: "app.components.Button.cancel",
2841
- defaultMessage: "Cancel"
2842
- }) }),
2843
- endAction
2844
- }
2845
- )
2846
- ]
2847
- }
2848
- );
2897
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Root, { open: isOpen, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Content, { children: [
2898
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Header, { children: formatMessage({
2899
+ id: "app.components.ConfirmDialog.title",
2900
+ defaultMessage: "Confirmation"
2901
+ }) }),
2902
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Body, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
2903
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
2904
+ dialogBody
2905
+ ] }) }),
2906
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog.Footer, { children: [
2907
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Dialog.Cancel, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { fullWidth: true, onClick: onToggleDialog, variant: "tertiary", children: formatMessage({
2908
+ id: "app.components.Button.cancel",
2909
+ defaultMessage: "Cancel"
2910
+ }) }) }),
2911
+ endAction
2912
+ ] })
2913
+ ] }) });
2849
2914
  };
2850
2915
  const BoldChunk$1 = (chunks) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", children: chunks });
2851
2916
  const ConfirmDialogPublishAll = ({
@@ -2950,7 +3015,14 @@ const formatErrorMessages = (errors, parentKey, formatMessage) => {
2950
3015
  )
2951
3016
  );
2952
3017
  } else {
2953
- messages.push(...formatErrorMessages(value, currentKey, formatMessage));
3018
+ messages.push(
3019
+ ...formatErrorMessages(
3020
+ // @ts-expect-error TODO: check why value is not compatible with FormErrors
3021
+ value,
3022
+ currentKey,
3023
+ formatMessage
3024
+ )
3025
+ );
2954
3026
  }
2955
3027
  } else {
2956
3028
  messages.push(
@@ -3187,7 +3259,7 @@ const SelectedEntriesModalContent = ({
3187
3259
  );
3188
3260
  };
3189
3261
  return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3190
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalBody, { children: [
3262
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Body, { children: [
3191
3263
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { children: getFormattedCountMessage() }),
3192
3264
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { marginTop: 5, children: /* @__PURE__ */ jsxRuntime.jsx(
3193
3265
  SelectedEntriesTableContent,
@@ -3199,27 +3271,24 @@ const SelectedEntriesModalContent = ({
3199
3271
  }
3200
3272
  ) })
3201
3273
  ] }),
3202
- /* @__PURE__ */ jsxRuntime.jsx(
3203
- designSystem.ModalFooter,
3204
- {
3205
- startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: toggleModal, variant: "tertiary", children: formatMessage({
3206
- id: "app.components.Button.cancel",
3207
- defaultMessage: "Cancel"
3208
- }) }),
3209
- endActions: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
3210
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: refetch, variant: "tertiary", loading: isFetching, children: formatMessage({ id: "app.utils.refresh", defaultMessage: "Refresh" }) }),
3211
- /* @__PURE__ */ jsxRuntime.jsx(
3212
- designSystem.Button,
3213
- {
3214
- onClick: toggleDialog,
3215
- disabled: selectedEntries.length === 0 || selectedEntries.length === selectedEntriesWithErrorsCount || selectedEntriesPublished === selectedEntries.length || isLoading,
3216
- loading: isSubmittingForm,
3217
- children: formatMessage({ id: "app.utils.publish", defaultMessage: "Publish" })
3218
- }
3219
- )
3220
- ] })
3221
- }
3222
- ),
3274
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Footer, { children: [
3275
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: toggleModal, variant: "tertiary", children: formatMessage({
3276
+ id: "app.components.Button.cancel",
3277
+ defaultMessage: "Cancel"
3278
+ }) }),
3279
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
3280
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: refetch, variant: "tertiary", loading: isFetching, children: formatMessage({ id: "app.utils.refresh", defaultMessage: "Refresh" }) }),
3281
+ /* @__PURE__ */ jsxRuntime.jsx(
3282
+ designSystem.Button,
3283
+ {
3284
+ onClick: toggleDialog,
3285
+ disabled: selectedEntries.length === 0 || selectedEntries.length === selectedEntriesWithErrorsCount || selectedEntriesPublished === selectedEntries.length || isLoading,
3286
+ loading: isSubmittingForm,
3287
+ children: formatMessage({ id: "app.utils.publish", defaultMessage: "Publish" })
3288
+ }
3289
+ )
3290
+ ] })
3291
+ ] }),
3223
3292
  /* @__PURE__ */ jsxRuntime.jsx(
3224
3293
  ConfirmDialogPublishAll,
3225
3294
  {
@@ -3284,143 +3353,10 @@ const BulkActionsRenderer = () => {
3284
3353
  documents: selectedRows
3285
3354
  },
3286
3355
  descriptions: plugins["content-manager"].apis.getBulkActions(),
3287
- children: (actions2) => actions2.map((action) => /* @__PURE__ */ jsxRuntime.jsx(BulkActionAction, { ...action }, action.id))
3356
+ children: (actions2) => actions2.map((action) => /* @__PURE__ */ jsxRuntime.jsx(DocumentActionButton, { ...action }, action.id))
3288
3357
  }
3289
3358
  ) });
3290
3359
  };
3291
- const BulkActionAction = (action) => {
3292
- const [dialogId, setDialogId] = React__namespace.useState(null);
3293
- const { toggleNotification } = strapiAdmin.useNotification();
3294
- const handleClick = (action2) => (e) => {
3295
- const { onClick, dialog, id } = action2;
3296
- if (onClick) {
3297
- onClick(e);
3298
- }
3299
- if (dialog) {
3300
- switch (dialog.type) {
3301
- case "notification":
3302
- toggleNotification({
3303
- title: dialog.title,
3304
- message: dialog.content,
3305
- type: dialog.status,
3306
- timeout: dialog.timeout,
3307
- onClose: dialog.onClose
3308
- });
3309
- break;
3310
- case "dialog":
3311
- case "modal": {
3312
- e.preventDefault();
3313
- setDialogId(id);
3314
- }
3315
- }
3316
- }
3317
- };
3318
- const handleClose = () => {
3319
- setDialogId(null);
3320
- if (action.dialog?.type === "modal" && action.dialog?.onClose) {
3321
- action.dialog.onClose();
3322
- }
3323
- };
3324
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
3325
- /* @__PURE__ */ jsxRuntime.jsx(
3326
- designSystem.Button,
3327
- {
3328
- disabled: action.disabled,
3329
- startIcon: action.icon,
3330
- variant: action.variant,
3331
- onClick: handleClick(action),
3332
- children: action.label
3333
- }
3334
- ),
3335
- action.dialog?.type === "dialog" ? /* @__PURE__ */ jsxRuntime.jsx(
3336
- BulkActionConfirmDialog,
3337
- {
3338
- ...action.dialog,
3339
- variant: action.variant,
3340
- isOpen: dialogId === action.id,
3341
- onClose: handleClose
3342
- }
3343
- ) : null,
3344
- action.dialog?.type === "modal" ? /* @__PURE__ */ jsxRuntime.jsx(
3345
- BulkActionModal,
3346
- {
3347
- ...action.dialog,
3348
- onModalClose: handleClose,
3349
- isOpen: dialogId === action.id
3350
- }
3351
- ) : null
3352
- ] });
3353
- };
3354
- const BulkActionConfirmDialog = ({
3355
- onClose,
3356
- onCancel,
3357
- onConfirm,
3358
- title,
3359
- content,
3360
- confirmButton,
3361
- isOpen,
3362
- variant = "secondary"
3363
- }) => {
3364
- const { formatMessage } = reactIntl.useIntl();
3365
- const handleClose = async () => {
3366
- if (onCancel) {
3367
- await onCancel();
3368
- }
3369
- onClose();
3370
- };
3371
- const handleConfirm = async () => {
3372
- if (onConfirm) {
3373
- await onConfirm();
3374
- }
3375
- onClose();
3376
- };
3377
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Dialog, { isOpen, title, onClose: handleClose, children: [
3378
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.DialogBody, { icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, {}), children: content }),
3379
- /* @__PURE__ */ jsxRuntime.jsx(
3380
- designSystem.DialogFooter,
3381
- {
3382
- startAction: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: handleClose, variant: "tertiary", children: formatMessage({
3383
- id: "app.components.Button.cancel",
3384
- defaultMessage: "Cancel"
3385
- }) }),
3386
- endAction: /* @__PURE__ */ jsxRuntime.jsx(
3387
- designSystem.Button,
3388
- {
3389
- onClick: handleConfirm,
3390
- variant: variant === "danger-light" ? variant : "secondary",
3391
- startIcon: variant === "danger-light" ? /* @__PURE__ */ jsxRuntime.jsx(Icons.Trash, {}) : /* @__PURE__ */ jsxRuntime.jsx(Icons.Check, {}),
3392
- children: confirmButton ? confirmButton : formatMessage({
3393
- id: "app.components.Button.confirm",
3394
- defaultMessage: "Confirm"
3395
- })
3396
- }
3397
- )
3398
- }
3399
- )
3400
- ] });
3401
- };
3402
- const BulkActionModal = ({
3403
- isOpen,
3404
- title,
3405
- onClose,
3406
- content: Content,
3407
- onModalClose
3408
- }) => {
3409
- const id = React__namespace.useId();
3410
- if (!isOpen) {
3411
- return null;
3412
- }
3413
- const handleClose = () => {
3414
- if (onClose) {
3415
- onClose();
3416
- }
3417
- onModalClose();
3418
- };
3419
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { borderRadius: "4px", overflow: "hidden", onClose: handleClose, labelledBy: id, children: [
3420
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontWeight: "bold", textColor: "neutral800", tag: "h2", id, children: title }) }),
3421
- /* @__PURE__ */ jsxRuntime.jsx(Content, { onClose: handleClose })
3422
- ] });
3423
- };
3424
3360
  const DeleteAction = ({ documents, model }) => {
3425
3361
  const { formatMessage } = reactIntl.useIntl();
3426
3362
  const { schema: contentType } = useDoc();
@@ -3453,6 +3389,7 @@ const DeleteAction = ({ documents, model }) => {
3453
3389
  defaultMessage: "Confirmation"
3454
3390
  }),
3455
3391
  content: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
3392
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
3456
3393
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: "confirm-description", textAlign: "center", children: formatMessage({
3457
3394
  id: "popUpWarning.bodyMessage.contentType.delete.all",
3458
3395
  defaultMessage: "Are you sure you want to delete these entries?"
@@ -3502,6 +3439,7 @@ const UnpublishAction = ({ documents, model }) => {
3502
3439
  defaultMessage: "Confirmation"
3503
3440
  }),
3504
3441
  content: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
3442
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { justifyContent: "center", children: /* @__PURE__ */ jsxRuntime.jsx(Icons.WarningCircle, { width: "24px", height: "24px", fill: "danger600" }) }),
3505
3443
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: "confirm-description", textAlign: "center", children: formatMessage({
3506
3444
  id: "popUpWarning.bodyMessage.contentType.unpublish.all",
3507
3445
  defaultMessage: "Are you sure you want to unpublish these entries?"
@@ -3747,8 +3685,7 @@ class ContentManagerPlugin {
3747
3685
  documentActions = [
3748
3686
  ...DEFAULT_ACTIONS,
3749
3687
  ...DEFAULT_TABLE_ROW_ACTIONS,
3750
- ...DEFAULT_HEADER_ACTIONS,
3751
- HistoryAction
3688
+ ...DEFAULT_HEADER_ACTIONS
3752
3689
  ];
3753
3690
  editViewSidePanels = [ActionsPanel];
3754
3691
  headerActions = [];
@@ -3837,6 +3774,52 @@ const getPrintableType = (value) => {
3837
3774
  }
3838
3775
  return nativeType;
3839
3776
  };
3777
+ const HistoryAction = ({ model, document }) => {
3778
+ const { formatMessage } = reactIntl.useIntl();
3779
+ const [{ query }] = strapiAdmin.useQueryParams();
3780
+ const navigate = reactRouterDom.useNavigate();
3781
+ const pluginsQueryParams = qs.stringify({ plugins: query.plugins }, { encode: false });
3782
+ if (!window.strapi.features.isEnabled("cms-content-history")) {
3783
+ return null;
3784
+ }
3785
+ return {
3786
+ icon: /* @__PURE__ */ jsxRuntime.jsx(Icons.ClockCounterClockwise, {}),
3787
+ label: formatMessage({
3788
+ id: "content-manager.history.document-action",
3789
+ defaultMessage: "Content History"
3790
+ }),
3791
+ onClick: () => navigate({ pathname: "history", search: pluginsQueryParams }),
3792
+ disabled: (
3793
+ /**
3794
+ * The user is creating a new document.
3795
+ * It hasn't been saved yet, so there's no history to go to
3796
+ */
3797
+ !document || /**
3798
+ * The document has been created but the current dimension has never been saved.
3799
+ * For example, the user is creating a new locale in an existing document,
3800
+ * so there's no history for the document in that locale
3801
+ */
3802
+ !document.id || /**
3803
+ * History is only available for content types created by the user.
3804
+ * These have the `api::` prefix, as opposed to the ones created by Strapi or plugins,
3805
+ * which start with `admin::` or `plugin::`
3806
+ */
3807
+ !model.startsWith("api::")
3808
+ ),
3809
+ position: "header"
3810
+ };
3811
+ };
3812
+ HistoryAction.type = "history";
3813
+ const historyAdmin = {
3814
+ bootstrap(app) {
3815
+ const { addDocumentAction } = app.getPlugin("content-manager").apis;
3816
+ addDocumentAction((actions2) => {
3817
+ const indexOfDeleteAction = actions2.findIndex((action) => action.type === "delete");
3818
+ actions2.splice(indexOfDeleteAction, 0, HistoryAction);
3819
+ return actions2;
3820
+ });
3821
+ }
3822
+ };
3840
3823
  const initialState = {
3841
3824
  collectionTypeLinks: [],
3842
3825
  components: [],
@@ -3887,15 +3870,29 @@ const index = {
3887
3870
  defaultMessage: "Content Manager"
3888
3871
  },
3889
3872
  permissions: [],
3890
- Component: () => Promise.resolve().then(() => require("./layout-DEYBqgF1.js")).then((mod) => ({ default: mod.Layout })),
3891
3873
  position: 1
3892
3874
  });
3875
+ app.router.addRoute({
3876
+ path: "content-manager/*",
3877
+ lazy: async () => {
3878
+ const { Layout } = await Promise.resolve().then(() => require("./layout-P3eKO1Qy.js"));
3879
+ return {
3880
+ Component: Layout
3881
+ };
3882
+ },
3883
+ children: routes
3884
+ });
3893
3885
  app.registerPlugin(cm.config);
3894
3886
  },
3887
+ bootstrap(app) {
3888
+ if (typeof historyAdmin.bootstrap === "function") {
3889
+ historyAdmin.bootstrap(app);
3890
+ }
3891
+ },
3895
3892
  async registerTrads({ locales }) {
3896
3893
  const importedTrads = await Promise.all(
3897
3894
  locales.map((locale) => {
3898
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-fbKQxLGn.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-EUonQTon.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B7kGGg3E.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-CcFe8diO.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
3895
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-uOUIxfcQ.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-EUonQTon.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B7kGGg3E.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-CcFe8diO.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
3899
3896
  return {
3900
3897
  data: prefixPluginTranslations(data, PLUGIN_ID),
3901
3898
  locale
@@ -3939,7 +3936,6 @@ exports.getDisplayName = getDisplayName;
3939
3936
  exports.getMainField = getMainField;
3940
3937
  exports.getTranslation = getTranslation;
3941
3938
  exports.index = index;
3942
- exports.routes = routes;
3943
3939
  exports.setInitialData = setInitialData;
3944
3940
  exports.useContentTypeSchema = useContentTypeSchema;
3945
3941
  exports.useDoc = useDoc;
@@ -3953,4 +3949,4 @@ exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
3953
3949
  exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
3954
3950
  exports.useGetInitialDataQuery = useGetInitialDataQuery;
3955
3951
  exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
3956
- //# sourceMappingURL=index-BZoNZMXL.js.map
3952
+ //# sourceMappingURL=index-5EMXLEM_.js.map