@strapi/content-manager 0.0.0-next.7315bad3dd6542d457c3c837db874e3e6336ae9f → 0.0.0-next.76a9dc5ca66301db734af3bc2111406c17ccb860

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 (118) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-DHV8IFbd.js → ComponentConfigurationPage-BLWQy8ru.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-DHV8IFbd.js.map → ComponentConfigurationPage-BLWQy8ru.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-D4J64ny7.mjs → ComponentConfigurationPage-CtIa3aa2.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-D4J64ny7.mjs.map → ComponentConfigurationPage-CtIa3aa2.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-DMnf8orh.mjs → EditConfigurationPage-DsPR2DVk.mjs} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-DMnf8orh.mjs.map → EditConfigurationPage-DsPR2DVk.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-q76oeVU1.js → EditConfigurationPage-RQkymxCy.js} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-q76oeVU1.js.map → EditConfigurationPage-RQkymxCy.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-BXoY-ITh.js → EditViewPage-B-kExt8C.js} +3 -3
  10. package/dist/_chunks/{EditViewPage-BXoY-ITh.js.map → EditViewPage-B-kExt8C.js.map} +1 -1
  11. package/dist/_chunks/{EditViewPage-COVXj9bh.mjs → EditViewPage-BPyVuPfM.mjs} +3 -3
  12. package/dist/_chunks/{EditViewPage-COVXj9bh.mjs.map → EditViewPage-BPyVuPfM.mjs.map} +1 -1
  13. package/dist/_chunks/{Field-Dj1nOvt8.js → Field-DPIsQRre.js} +117 -61
  14. package/dist/_chunks/Field-DPIsQRre.js.map +1 -0
  15. package/dist/_chunks/{Field-CcppsFQR.mjs → Field-Dltnt1km.mjs} +116 -61
  16. package/dist/_chunks/Field-Dltnt1km.mjs.map +1 -0
  17. package/dist/_chunks/{Form-aTchNxab.js → Form-BFi4MXMT.js} +2 -2
  18. package/dist/_chunks/{Form-aTchNxab.js.map → Form-BFi4MXMT.js.map} +1 -1
  19. package/dist/_chunks/{Form-DbWwH0-A.mjs → Form-C1IcWm1u.mjs} +2 -2
  20. package/dist/_chunks/{Form-DbWwH0-A.mjs.map → Form-C1IcWm1u.mjs.map} +1 -1
  21. package/dist/_chunks/{History-tU567_hc.mjs → History-04ChQ4pl.mjs} +32 -8
  22. package/dist/_chunks/History-04ChQ4pl.mjs.map +1 -0
  23. package/dist/_chunks/{History-Cs6XM6EU.js → History-wjcK4L0C.js} +32 -8
  24. package/dist/_chunks/History-wjcK4L0C.js.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-DQryo_4i.mjs → ListConfigurationPage-BYqPYLSU.mjs} +2 -2
  26. package/dist/_chunks/{ListConfigurationPage-DQryo_4i.mjs.map → ListConfigurationPage-BYqPYLSU.mjs.map} +1 -1
  27. package/dist/_chunks/{ListConfigurationPage-7LeytuFD.js → ListConfigurationPage-CRbxIC3J.js} +2 -2
  28. package/dist/_chunks/{ListConfigurationPage-7LeytuFD.js.map → ListConfigurationPage-CRbxIC3J.js.map} +1 -1
  29. package/dist/_chunks/{ListViewPage-CaGBu5H5.js → ListViewPage-D5NY9183.js} +3 -3
  30. package/dist/_chunks/{ListViewPage-CaGBu5H5.js.map → ListViewPage-D5NY9183.js.map} +1 -1
  31. package/dist/_chunks/{ListViewPage-B50esy_x.mjs → ListViewPage-FU2LBuhl.mjs} +3 -3
  32. package/dist/_chunks/{ListViewPage-B50esy_x.mjs.map → ListViewPage-FU2LBuhl.mjs.map} +1 -1
  33. package/dist/_chunks/{NoContentTypePage-BaBE00IO.js → NoContentTypePage-BgQVE_Qb.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-BaBE00IO.js.map → NoContentTypePage-BgQVE_Qb.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-CiPP8cLx.mjs → NoContentTypePage-DCKUkwb8.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-CiPP8cLx.mjs.map → NoContentTypePage-DCKUkwb8.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DQn5cqZz.js → NoPermissionsPage-C5jwn70o.js} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DQn5cqZz.js.map → NoPermissionsPage-C5jwn70o.js.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-0-CW106p.mjs → NoPermissionsPage-jqve7C8l.mjs} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-0-CW106p.mjs.map → NoPermissionsPage-jqve7C8l.mjs.map} +1 -1
  41. package/dist/_chunks/{Preview-C1dBkhXf.mjs → Preview-BMYN548c.mjs} +33 -11
  42. package/dist/_chunks/Preview-BMYN548c.mjs.map +1 -0
  43. package/dist/_chunks/{Preview-DH1h7kJ6.js → Preview-DaOihysv.js} +32 -10
  44. package/dist/_chunks/Preview-DaOihysv.js.map +1 -0
  45. package/dist/_chunks/{Relations-CkECnBOd.js → Relations-CTGM7Hv5.js} +3 -3
  46. package/dist/_chunks/{Relations-CkECnBOd.js.map → Relations-CTGM7Hv5.js.map} +1 -1
  47. package/dist/_chunks/{Relations-Bvne4TvU.mjs → Relations-gscPkxjF.mjs} +3 -3
  48. package/dist/_chunks/{Relations-Bvne4TvU.mjs.map → Relations-gscPkxjF.mjs.map} +1 -1
  49. package/dist/_chunks/{en-BK8Xyl5I.js → en-BzQmavmK.js} +7 -2
  50. package/dist/_chunks/{en-BK8Xyl5I.js.map → en-BzQmavmK.js.map} +1 -1
  51. package/dist/_chunks/{en-Dtk_ot79.mjs → en-CSxLmrh1.mjs} +7 -2
  52. package/dist/_chunks/{en-Dtk_ot79.mjs.map → en-CSxLmrh1.mjs.map} +1 -1
  53. package/dist/_chunks/{index-BN1pPa5v.js → index-Ca7YWlAA.js} +170 -108
  54. package/dist/_chunks/index-Ca7YWlAA.js.map +1 -0
  55. package/dist/_chunks/{index-ByPZ754U.mjs → index-DqasUQ6Q.mjs} +170 -108
  56. package/dist/_chunks/index-DqasUQ6Q.mjs.map +1 -0
  57. package/dist/_chunks/{layout-nBPDlXjr.js → layout-BW80JSCd.js} +3 -3
  58. package/dist/_chunks/{layout-nBPDlXjr.js.map → layout-BW80JSCd.js.map} +1 -1
  59. package/dist/_chunks/{layout-CUTOYU8I.mjs → layout-W3clJSCy.mjs} +3 -3
  60. package/dist/_chunks/{layout-CUTOYU8I.mjs.map → layout-W3clJSCy.mjs.map} +1 -1
  61. package/dist/_chunks/{relations-CBc5HYHC.mjs → relations-BlDkoeWh.mjs} +2 -2
  62. package/dist/_chunks/{relations-CBc5HYHC.mjs.map → relations-BlDkoeWh.mjs.map} +1 -1
  63. package/dist/_chunks/{relations-B6B-b7lI.js → relations-C9Usz9k5.js} +2 -2
  64. package/dist/_chunks/{relations-B6B-b7lI.js.map → relations-C9Usz9k5.js.map} +1 -1
  65. package/dist/admin/index.js +2 -1
  66. package/dist/admin/index.js.map +1 -1
  67. package/dist/admin/index.mjs +2 -1
  68. package/dist/admin/src/exports.d.ts +1 -0
  69. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  70. package/dist/admin/src/pages/EditView/components/DocumentStatus.d.ts +1 -1
  71. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  72. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  73. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  74. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/DynamicComponent.d.ts +4 -1
  75. package/dist/admin/src/pages/EditView/components/FormInputs/DynamicZone/Field.d.ts +4 -1
  76. package/dist/admin/src/preview/services/preview.d.ts +1 -1
  77. package/dist/admin/src/services/api.d.ts +1 -1
  78. package/dist/admin/src/services/components.d.ts +2 -2
  79. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  80. package/dist/admin/src/services/documents.d.ts +16 -16
  81. package/dist/admin/src/services/init.d.ts +1 -1
  82. package/dist/admin/src/services/relations.d.ts +2 -2
  83. package/dist/admin/src/services/uid.d.ts +3 -3
  84. package/dist/server/index.js +156 -142
  85. package/dist/server/index.js.map +1 -1
  86. package/dist/server/index.mjs +157 -143
  87. package/dist/server/index.mjs.map +1 -1
  88. package/dist/server/src/controllers/utils/metadata.d.ts +1 -0
  89. package/dist/server/src/controllers/utils/metadata.d.ts.map +1 -1
  90. package/dist/server/src/history/controllers/history-version.d.ts +1 -1
  91. package/dist/server/src/history/controllers/history-version.d.ts.map +1 -1
  92. package/dist/server/src/history/services/history.d.ts +3 -3
  93. package/dist/server/src/history/services/history.d.ts.map +1 -1
  94. package/dist/server/src/history/services/utils.d.ts +6 -10
  95. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  96. package/dist/server/src/index.d.ts +3 -2
  97. package/dist/server/src/index.d.ts.map +1 -1
  98. package/dist/server/src/preview/index.d.ts.map +1 -1
  99. package/dist/server/src/services/document-metadata.d.ts +4 -2
  100. package/dist/server/src/services/document-metadata.d.ts.map +1 -1
  101. package/dist/server/src/services/index.d.ts +3 -2
  102. package/dist/server/src/services/index.d.ts.map +1 -1
  103. package/dist/server/src/services/utils/configuration/index.d.ts +2 -2
  104. package/dist/server/src/services/utils/configuration/layouts.d.ts +2 -2
  105. package/dist/server/src/services/utils/populate.d.ts +2 -2
  106. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  107. package/package.json +8 -7
  108. package/dist/_chunks/Field-CcppsFQR.mjs.map +0 -1
  109. package/dist/_chunks/Field-Dj1nOvt8.js.map +0 -1
  110. package/dist/_chunks/History-Cs6XM6EU.js.map +0 -1
  111. package/dist/_chunks/History-tU567_hc.mjs.map +0 -1
  112. package/dist/_chunks/Preview-C1dBkhXf.mjs.map +0 -1
  113. package/dist/_chunks/Preview-DH1h7kJ6.js.map +0 -1
  114. package/dist/_chunks/index-BN1pPa5v.js.map +0 -1
  115. package/dist/_chunks/index-ByPZ754U.mjs.map +0 -1
  116. package/dist/admin/src/preview/constants.d.ts +0 -1
  117. package/dist/server/src/preview/constants.d.ts +0 -2
  118. package/dist/server/src/preview/constants.d.ts.map +0 -1
@@ -196,7 +196,8 @@ const contentManagerApi = strapiAdmin.adminApi.enhanceEndpoints({
196
196
  "InitialData",
197
197
  "HistoryVersion",
198
198
  "Relations",
199
- "UidAvailability"
199
+ "UidAvailability",
200
+ "RecentDocumentList"
200
201
  ]
201
202
  });
202
203
  const documentApi = contentManagerApi.injectEndpoints({
@@ -214,7 +215,7 @@ const documentApi = contentManagerApi.injectEndpoints({
214
215
  if (error) {
215
216
  return [];
216
217
  }
217
- return [{ type: "Document", id: `${model}_LIST` }];
218
+ return [{ type: "Document", id: `${model}_LIST` }, "RecentDocumentList"];
218
219
  }
219
220
  }),
220
221
  cloneDocument: builder.mutation({
@@ -228,7 +229,8 @@ const documentApi = contentManagerApi.injectEndpoints({
228
229
  }),
229
230
  invalidatesTags: (_result, _error, { model }) => [
230
231
  { type: "Document", id: `${model}_LIST` },
231
- { type: "UidAvailability", id: model }
232
+ { type: "UidAvailability", id: model },
233
+ "RecentDocumentList"
232
234
  ]
233
235
  }),
234
236
  /**
@@ -247,8 +249,21 @@ const documentApi = contentManagerApi.injectEndpoints({
247
249
  invalidatesTags: (result, _error, { model }) => [
248
250
  { type: "Document", id: `${model}_LIST` },
249
251
  "Relations",
250
- { type: "UidAvailability", id: model }
251
- ]
252
+ { type: "UidAvailability", id: model },
253
+ "RecentDocumentList"
254
+ ],
255
+ transformResponse: (response, meta, arg) => {
256
+ if (!("data" in response) && arg.model === "plugin::users-permissions.user") {
257
+ return {
258
+ data: response,
259
+ meta: {
260
+ availableStatus: [],
261
+ availableLocales: []
262
+ }
263
+ };
264
+ }
265
+ return response;
266
+ }
252
267
  }),
253
268
  deleteDocument: builder.mutation({
254
269
  query: ({ collectionType, model, documentId, params }) => ({
@@ -259,7 +274,8 @@ const documentApi = contentManagerApi.injectEndpoints({
259
274
  }
260
275
  }),
261
276
  invalidatesTags: (_result, _error, { collectionType, model }) => [
262
- { type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model }
277
+ { type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },
278
+ "RecentDocumentList"
263
279
  ]
264
280
  }),
265
281
  deleteManyDocuments: builder.mutation({
@@ -271,7 +287,10 @@ const documentApi = contentManagerApi.injectEndpoints({
271
287
  params
272
288
  }
273
289
  }),
274
- invalidatesTags: (_res, _error, { model }) => [{ type: "Document", id: `${model}_LIST` }]
290
+ invalidatesTags: (_res, _error, { model }) => [
291
+ { type: "Document", id: `${model}_LIST` },
292
+ "RecentDocumentList"
293
+ ]
275
294
  }),
276
295
  discardDocument: builder.mutation({
277
296
  query: ({ collectionType, model, documentId, params }) => ({
@@ -289,7 +308,8 @@ const documentApi = contentManagerApi.injectEndpoints({
289
308
  },
290
309
  { type: "Document", id: `${model}_LIST` },
291
310
  "Relations",
292
- { type: "UidAvailability", id: model }
311
+ { type: "UidAvailability", id: model },
312
+ "RecentDocumentList"
293
313
  ];
294
314
  }
295
315
  }),
@@ -384,7 +404,8 @@ const documentApi = contentManagerApi.injectEndpoints({
384
404
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
385
405
  },
386
406
  { type: "Document", id: `${model}_LIST` },
387
- "Relations"
407
+ "Relations",
408
+ "RecentDocumentList"
388
409
  ];
389
410
  }
390
411
  }),
@@ -415,7 +436,9 @@ const documentApi = contentManagerApi.injectEndpoints({
415
436
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
416
437
  },
417
438
  "Relations",
418
- { type: "UidAvailability", id: model }
439
+ { type: "UidAvailability", id: model },
440
+ "RecentDocumentList",
441
+ "RecentDocumentList"
419
442
  ];
420
443
  },
421
444
  async onQueryStarted({ data, ...patch }, { dispatch, queryFulfilled }) {
@@ -445,7 +468,8 @@ const documentApi = contentManagerApi.injectEndpoints({
445
468
  {
446
469
  type: "Document",
447
470
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
448
- }
471
+ },
472
+ "RecentDocumentList"
449
473
  ];
450
474
  }
451
475
  }),
@@ -458,7 +482,10 @@ const documentApi = contentManagerApi.injectEndpoints({
458
482
  params
459
483
  }
460
484
  }),
461
- invalidatesTags: (_res, _error, { model, documentIds }) => documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` }))
485
+ invalidatesTags: (_res, _error, { model, documentIds }) => [
486
+ ...documentIds.map((id) => ({ type: "Document", id: `${model}_${id}` })),
487
+ "RecentDocumentList"
488
+ ]
462
489
  })
463
490
  })
464
491
  });
@@ -1688,7 +1715,7 @@ const useDocumentActions = () => {
1688
1715
  };
1689
1716
  };
1690
1717
  const ProtectedHistoryPage = React__namespace.lazy(
1691
- () => Promise.resolve().then(() => require("./History-Cs6XM6EU.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1718
+ () => Promise.resolve().then(() => require("./History-wjcK4L0C.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1692
1719
  );
1693
1720
  const routes$2 = [
1694
1721
  {
@@ -1701,7 +1728,7 @@ const routes$2 = [
1701
1728
  }
1702
1729
  ];
1703
1730
  const ProtectedPreviewPage = React__namespace.lazy(
1704
- () => Promise.resolve().then(() => require("./Preview-DH1h7kJ6.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
1731
+ () => Promise.resolve().then(() => require("./Preview-DaOihysv.js")).then((mod) => ({ default: mod.ProtectedPreviewPage }))
1705
1732
  );
1706
1733
  const routes$1 = [
1707
1734
  {
@@ -1714,31 +1741,31 @@ const routes$1 = [
1714
1741
  }
1715
1742
  ];
1716
1743
  const ProtectedEditViewPage = React.lazy(
1717
- () => Promise.resolve().then(() => require("./EditViewPage-BXoY-ITh.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1744
+ () => Promise.resolve().then(() => require("./EditViewPage-B-kExt8C.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1718
1745
  );
1719
1746
  const ProtectedListViewPage = React.lazy(
1720
- () => Promise.resolve().then(() => require("./ListViewPage-CaGBu5H5.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1747
+ () => Promise.resolve().then(() => require("./ListViewPage-D5NY9183.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1721
1748
  );
1722
1749
  const ProtectedListConfiguration = React.lazy(
1723
- () => Promise.resolve().then(() => require("./ListConfigurationPage-7LeytuFD.js")).then((mod) => ({
1750
+ () => Promise.resolve().then(() => require("./ListConfigurationPage-CRbxIC3J.js")).then((mod) => ({
1724
1751
  default: mod.ProtectedListConfiguration
1725
1752
  }))
1726
1753
  );
1727
1754
  const ProtectedEditConfigurationPage = React.lazy(
1728
- () => Promise.resolve().then(() => require("./EditConfigurationPage-q76oeVU1.js")).then((mod) => ({
1755
+ () => Promise.resolve().then(() => require("./EditConfigurationPage-RQkymxCy.js")).then((mod) => ({
1729
1756
  default: mod.ProtectedEditConfigurationPage
1730
1757
  }))
1731
1758
  );
1732
1759
  const ProtectedComponentConfigurationPage = React.lazy(
1733
- () => Promise.resolve().then(() => require("./ComponentConfigurationPage-DHV8IFbd.js")).then((mod) => ({
1760
+ () => Promise.resolve().then(() => require("./ComponentConfigurationPage-BLWQy8ru.js")).then((mod) => ({
1734
1761
  default: mod.ProtectedComponentConfigurationPage
1735
1762
  }))
1736
1763
  );
1737
1764
  const NoPermissions = React.lazy(
1738
- () => Promise.resolve().then(() => require("./NoPermissionsPage-DQn5cqZz.js")).then((mod) => ({ default: mod.NoPermissions }))
1765
+ () => Promise.resolve().then(() => require("./NoPermissionsPage-C5jwn70o.js")).then((mod) => ({ default: mod.NoPermissions }))
1739
1766
  );
1740
1767
  const NoContentType = React.lazy(
1741
- () => Promise.resolve().then(() => require("./NoContentTypePage-BaBE00IO.js")).then((mod) => ({ default: mod.NoContentType }))
1768
+ () => Promise.resolve().then(() => require("./NoContentTypePage-BgQVE_Qb.js")).then((mod) => ({ default: mod.NoContentType }))
1742
1769
  );
1743
1770
  const CollectionTypePages = () => {
1744
1771
  const { collectionType } = reactRouterDom.useParams();
@@ -2292,6 +2319,117 @@ const UpdateAction = ({
2292
2319
  const validate = strapiAdmin.useForm("UpdateAction", (state) => state.validate);
2293
2320
  const setErrors = strapiAdmin.useForm("UpdateAction", (state) => state.setErrors);
2294
2321
  const resetForm = strapiAdmin.useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
2322
+ const handleUpdate = React__namespace.useCallback(async () => {
2323
+ setSubmitting(true);
2324
+ try {
2325
+ if (!modified) {
2326
+ return;
2327
+ }
2328
+ const { errors } = await validate(true, {
2329
+ status: "draft"
2330
+ });
2331
+ if (errors) {
2332
+ toggleNotification({
2333
+ type: "danger",
2334
+ message: formatMessage({
2335
+ id: "content-manager.validation.error",
2336
+ defaultMessage: "There are validation errors in your document. Please fix them before saving."
2337
+ })
2338
+ });
2339
+ return;
2340
+ }
2341
+ if (isCloning) {
2342
+ const res = await clone(
2343
+ {
2344
+ model,
2345
+ documentId: cloneMatch.params.origin,
2346
+ params
2347
+ },
2348
+ transformData(document)
2349
+ );
2350
+ if ("data" in res) {
2351
+ navigate(
2352
+ {
2353
+ pathname: `../${res.data.documentId}`,
2354
+ search: rawQuery
2355
+ },
2356
+ { relative: "path" }
2357
+ );
2358
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2359
+ setErrors(formatValidationErrors(res.error));
2360
+ }
2361
+ } else if (documentId || collectionType === SINGLE_TYPES) {
2362
+ const res = await update(
2363
+ {
2364
+ collectionType,
2365
+ model,
2366
+ documentId,
2367
+ params
2368
+ },
2369
+ transformData(document)
2370
+ );
2371
+ if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2372
+ setErrors(formatValidationErrors(res.error));
2373
+ } else {
2374
+ resetForm();
2375
+ }
2376
+ } else {
2377
+ const res = await create(
2378
+ {
2379
+ model,
2380
+ params
2381
+ },
2382
+ transformData(document)
2383
+ );
2384
+ if ("data" in res && collectionType !== SINGLE_TYPES) {
2385
+ navigate(
2386
+ {
2387
+ pathname: `../${res.data.documentId}`,
2388
+ search: rawQuery
2389
+ },
2390
+ { replace: true, relative: "path" }
2391
+ );
2392
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2393
+ setErrors(formatValidationErrors(res.error));
2394
+ }
2395
+ }
2396
+ } finally {
2397
+ setSubmitting(false);
2398
+ }
2399
+ }, [
2400
+ clone,
2401
+ cloneMatch?.params.origin,
2402
+ collectionType,
2403
+ create,
2404
+ document,
2405
+ documentId,
2406
+ formatMessage,
2407
+ formatValidationErrors,
2408
+ isCloning,
2409
+ model,
2410
+ modified,
2411
+ navigate,
2412
+ params,
2413
+ rawQuery,
2414
+ resetForm,
2415
+ setErrors,
2416
+ setSubmitting,
2417
+ toggleNotification,
2418
+ update,
2419
+ validate
2420
+ ]);
2421
+ React__namespace.useEffect(() => {
2422
+ const handleKeyDown = (e) => {
2423
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
2424
+ e.preventDefault();
2425
+ handleUpdate();
2426
+ }
2427
+ };
2428
+ window.addEventListener("keydown", handleKeyDown);
2429
+ return () => {
2430
+ window.removeEventListener("keydown", handleKeyDown);
2431
+ };
2432
+ }, [handleUpdate]);
2295
2433
  return {
2296
2434
  /**
2297
2435
  * Disabled when:
@@ -2304,81 +2442,7 @@ const UpdateAction = ({
2304
2442
  id: "global.save",
2305
2443
  defaultMessage: "Save"
2306
2444
  }),
2307
- onClick: async () => {
2308
- setSubmitting(true);
2309
- try {
2310
- const { errors } = await validate(true, {
2311
- status: "draft"
2312
- });
2313
- if (errors) {
2314
- toggleNotification({
2315
- type: "danger",
2316
- message: formatMessage({
2317
- id: "content-manager.validation.error",
2318
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
2319
- })
2320
- });
2321
- return;
2322
- }
2323
- if (isCloning) {
2324
- const res = await clone(
2325
- {
2326
- model,
2327
- documentId: cloneMatch.params.origin,
2328
- params
2329
- },
2330
- transformData(document)
2331
- );
2332
- if ("data" in res) {
2333
- navigate(
2334
- {
2335
- pathname: `../${res.data.documentId}`,
2336
- search: rawQuery
2337
- },
2338
- { relative: "path" }
2339
- );
2340
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2341
- setErrors(formatValidationErrors(res.error));
2342
- }
2343
- } else if (documentId || collectionType === SINGLE_TYPES) {
2344
- const res = await update(
2345
- {
2346
- collectionType,
2347
- model,
2348
- documentId,
2349
- params
2350
- },
2351
- transformData(document)
2352
- );
2353
- if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2354
- setErrors(formatValidationErrors(res.error));
2355
- } else {
2356
- resetForm();
2357
- }
2358
- } else {
2359
- const res = await create(
2360
- {
2361
- model,
2362
- params
2363
- },
2364
- transformData(document)
2365
- );
2366
- if ("data" in res && collectionType !== SINGLE_TYPES) {
2367
- navigate(
2368
- {
2369
- pathname: `../${res.data.documentId}`,
2370
- search: rawQuery
2371
- },
2372
- { replace: true, relative: "path" }
2373
- );
2374
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2375
- setErrors(formatValidationErrors(res.error));
2376
- }
2377
- }
2378
- } finally {
2379
- setSubmitting(false);
2380
- }
2381
- }
2445
+ onClick: handleUpdate
2382
2446
  };
2383
2447
  };
2384
2448
  UpdateAction.type = "update";
@@ -4102,7 +4166,7 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
4102
4166
  };
4103
4167
  return {
4104
4168
  title: formatMessage({ id: "content-manager.preview.panel.title", defaultMessage: "Preview" }),
4105
- content: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { gap: 2, width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
4169
+ content: /* @__PURE__ */ jsxRuntime.jsx(
4106
4170
  ConditionalTooltip,
4107
4171
  {
4108
4172
  label: formatMessage({
@@ -4110,31 +4174,29 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
4110
4174
  defaultMessage: "Please save to open the preview"
4111
4175
  }),
4112
4176
  isShown: isModified,
4113
- children: /* @__PURE__ */ jsxRuntime.jsx(
4177
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { cursor: "not-allowed", width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
4114
4178
  designSystem.Button,
4115
4179
  {
4116
4180
  variant: "tertiary",
4117
4181
  tag: reactRouterDom.Link,
4118
4182
  to: { pathname: "preview", search: qs.stringify(query, { encode: false }) },
4119
4183
  onClick: trackNavigation,
4120
- flex: "auto",
4184
+ width: "100%",
4121
4185
  disabled: isModified,
4186
+ pointerEvents: isModified ? "none" : void 0,
4187
+ tabIndex: isModified ? -1 : void 0,
4122
4188
  children: formatMessage({
4123
4189
  id: "content-manager.preview.panel.button",
4124
4190
  defaultMessage: "Open preview"
4125
4191
  })
4126
4192
  }
4127
- )
4193
+ ) })
4128
4194
  }
4129
- ) })
4195
+ )
4130
4196
  };
4131
4197
  };
4132
- const FEATURE_ID = "preview";
4133
4198
  const previewAdmin = {
4134
4199
  bootstrap(app) {
4135
- if (!window.strapi.future.isEnabled(FEATURE_ID)) {
4136
- return;
4137
- }
4138
4200
  const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4139
4201
  contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4140
4202
  }
@@ -4158,7 +4220,7 @@ const index = {
4158
4220
  app.router.addRoute({
4159
4221
  path: "content-manager/*",
4160
4222
  lazy: async () => {
4161
- const { Layout } = await Promise.resolve().then(() => require("./layout-nBPDlXjr.js"));
4223
+ const { Layout } = await Promise.resolve().then(() => require("./layout-BW80JSCd.js"));
4162
4224
  return {
4163
4225
  Component: Layout
4164
4226
  };
@@ -4178,7 +4240,7 @@ const index = {
4178
4240
  async registerTrads({ locales }) {
4179
4241
  const importedTrads = await Promise.all(
4180
4242
  locales.map((locale) => {
4181
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/ar.json": () => Promise.resolve().then(() => require("./ar-BUUWXIYu.js")), "./translations/ca.json": () => Promise.resolve().then(() => require("./ca-Cmk45QO6.js")), "./translations/cs.json": () => Promise.resolve().then(() => require("./cs-CkJy6B2v.js")), "./translations/de.json": () => Promise.resolve().then(() => require("./de-CCEmbAah.js")), "./translations/en.json": () => Promise.resolve().then(() => require("./en-BK8Xyl5I.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-9K52xZIr.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B2Kyv8Z9.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-7sfIbjxE.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
4243
+ 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-BzQmavmK.js")), "./translations/es.json": () => Promise.resolve().then(() => require("./es-9K52xZIr.js")), "./translations/eu.json": () => Promise.resolve().then(() => require("./eu-VDH-3ovk.js")), "./translations/fr.json": () => Promise.resolve().then(() => require("./fr-B2Kyv8Z9.js")), "./translations/gu.json": () => Promise.resolve().then(() => require("./gu-BRmF601H.js")), "./translations/hi.json": () => Promise.resolve().then(() => require("./hi-CCJBptSq.js")), "./translations/hu.json": () => Promise.resolve().then(() => require("./hu-sNV_yLYy.js")), "./translations/id.json": () => Promise.resolve().then(() => require("./id-B5Ser98A.js")), "./translations/it.json": () => Promise.resolve().then(() => require("./it-DkBIs7vD.js")), "./translations/ja.json": () => Promise.resolve().then(() => require("./ja-7sfIbjxE.js")), "./translations/ko.json": () => Promise.resolve().then(() => require("./ko-woFZPmLk.js")), "./translations/ml.json": () => Promise.resolve().then(() => require("./ml-C2W8N8k1.js")), "./translations/ms.json": () => Promise.resolve().then(() => require("./ms-BuFotyP_.js")), "./translations/nl.json": () => Promise.resolve().then(() => require("./nl-bbEOHChV.js")), "./translations/pl.json": () => Promise.resolve().then(() => require("./pl-uzwG-hk7.js")), "./translations/pt-BR.json": () => Promise.resolve().then(() => require("./pt-BR-BiOz37D9.js")), "./translations/pt.json": () => Promise.resolve().then(() => require("./pt-CeXQuq50.js")), "./translations/ru.json": () => Promise.resolve().then(() => require("./ru-BT3ybNny.js")), "./translations/sa.json": () => Promise.resolve().then(() => require("./sa-CcvkYInH.js")), "./translations/sk.json": () => Promise.resolve().then(() => require("./sk-CvY09Xjv.js")), "./translations/sv.json": () => Promise.resolve().then(() => require("./sv-MYDuzgvT.js")), "./translations/th.json": () => Promise.resolve().then(() => require("./th-D9_GfAjc.js")), "./translations/tr.json": () => Promise.resolve().then(() => require("./tr-D9UH-O_R.js")), "./translations/uk.json": () => Promise.resolve().then(() => require("./uk-C8EiqJY7.js")), "./translations/vi.json": () => Promise.resolve().then(() => require("./vi-CJlYDheJ.js")), "./translations/zh-Hans.json": () => Promise.resolve().then(() => require("./zh-Hans-9kOncHGw.js")), "./translations/zh.json": () => Promise.resolve().then(() => require("./zh-CQQfszqR.js")) }), `./translations/${locale}.json`, 3).then(({ default: data }) => {
4182
4244
  return {
4183
4245
  data: prefixPluginTranslations(data, PLUGIN_ID),
4184
4246
  locale
@@ -4238,4 +4300,4 @@ exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuer
4238
4300
  exports.useGetInitialDataQuery = useGetInitialDataQuery;
4239
4301
  exports.useGetPreviewUrlQuery = useGetPreviewUrlQuery;
4240
4302
  exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
4241
- //# sourceMappingURL=index-BN1pPa5v.js.map
4303
+ //# sourceMappingURL=index-Ca7YWlAA.js.map