@strapi/content-manager 5.5.0 → 5.5.2

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 (69) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-viOAdZM6.mjs → ComponentConfigurationPage-CzVt9QCC.mjs} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-viOAdZM6.mjs.map → ComponentConfigurationPage-CzVt9QCC.mjs.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-BPiQrhZ6.js → ComponentConfigurationPage-DYq8aqos.js} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-BPiQrhZ6.js.map → ComponentConfigurationPage-DYq8aqos.js.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-CZRKq8CN.js → EditConfigurationPage-C9IATpr0.js} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-CZRKq8CN.js.map → EditConfigurationPage-C9IATpr0.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-DKtPyjs_.mjs → EditConfigurationPage-CLDwrUv5.mjs} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-DKtPyjs_.mjs.map → EditConfigurationPage-CLDwrUv5.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-C-TZmK5r.js → EditViewPage-Ch-uBvbv.js} +3 -3
  10. package/dist/_chunks/{EditViewPage-C-TZmK5r.js.map → EditViewPage-Ch-uBvbv.js.map} +1 -1
  11. package/dist/_chunks/{EditViewPage-D2FPb5Mh.mjs → EditViewPage-DtKM7Jgw.mjs} +3 -3
  12. package/dist/_chunks/{EditViewPage-D2FPb5Mh.mjs.map → EditViewPage-DtKM7Jgw.mjs.map} +1 -1
  13. package/dist/_chunks/{Field-IMBnqF-k.js → Field-B9ADaInZ.js} +5 -5
  14. package/dist/_chunks/Field-B9ADaInZ.js.map +1 -0
  15. package/dist/_chunks/{Field-hD0Y00Mt.mjs → Field-Bn1jgMeF.mjs} +5 -5
  16. package/dist/_chunks/Field-Bn1jgMeF.mjs.map +1 -0
  17. package/dist/_chunks/{Form-ZQ9fzWkd.mjs → Form-BB5i9Pxl.mjs} +2 -2
  18. package/dist/_chunks/{Form-ZQ9fzWkd.mjs.map → Form-BB5i9Pxl.mjs.map} +1 -1
  19. package/dist/_chunks/{Form-BaURS01O.js → Form-C3kjKrPw.js} +2 -2
  20. package/dist/_chunks/{Form-BaURS01O.js.map → Form-C3kjKrPw.js.map} +1 -1
  21. package/dist/_chunks/{History-BqRQm2Lc.js → History-AwrK0-SA.js} +4 -4
  22. package/dist/_chunks/{History-BqRQm2Lc.js.map → History-AwrK0-SA.js.map} +1 -1
  23. package/dist/_chunks/{History-C4X3jiQJ.mjs → History-Cw2Q7OQL.mjs} +4 -4
  24. package/dist/_chunks/{History-C4X3jiQJ.mjs.map → History-Cw2Q7OQL.mjs.map} +1 -1
  25. package/dist/_chunks/{ListConfigurationPage-CwMU6tWQ.mjs → ListConfigurationPage-B47JIu1e.mjs} +2 -2
  26. package/dist/_chunks/{ListConfigurationPage-CwMU6tWQ.mjs.map → ListConfigurationPage-B47JIu1e.mjs.map} +1 -1
  27. package/dist/_chunks/{ListConfigurationPage-BT69-TvF.js → ListConfigurationPage-CNTJ0DBm.js} +2 -2
  28. package/dist/_chunks/{ListConfigurationPage-BT69-TvF.js.map → ListConfigurationPage-CNTJ0DBm.js.map} +1 -1
  29. package/dist/_chunks/{ListViewPage-CYkrfWsm.js → ListViewPage-Be_UEBar.js} +3 -3
  30. package/dist/_chunks/{ListViewPage-CYkrfWsm.js.map → ListViewPage-Be_UEBar.js.map} +1 -1
  31. package/dist/_chunks/{ListViewPage-CvxfiNTc.mjs → ListViewPage-DuvjX6ra.mjs} +3 -3
  32. package/dist/_chunks/{ListViewPage-CvxfiNTc.mjs.map → ListViewPage-DuvjX6ra.mjs.map} +1 -1
  33. package/dist/_chunks/{NoContentTypePage-BZMfRsrg.js → NoContentTypePage-B1J0KUCO.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-BZMfRsrg.js.map → NoContentTypePage-B1J0KUCO.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-Dy6sa9LT.mjs → NoContentTypePage-C6M-Q0Tv.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-Dy6sa9LT.mjs.map → NoContentTypePage-C6M-Q0Tv.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DiW-TIzq.mjs → NoPermissionsPage-CAi3zCAD.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DiW-TIzq.mjs.map → NoPermissionsPage-CAi3zCAD.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-DjUdvhJ6.js → NoPermissionsPage-CN34TlEE.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-DjUdvhJ6.js.map → NoPermissionsPage-CN34TlEE.js.map} +1 -1
  41. package/dist/_chunks/{Preview-DwWET-X7.mjs → Preview-BrBRcL10.mjs} +23 -8
  42. package/dist/_chunks/Preview-BrBRcL10.mjs.map +1 -0
  43. package/dist/_chunks/{Preview-BqRUSbFU.js → Preview-DOqm5jcJ.js} +22 -7
  44. package/dist/_chunks/Preview-DOqm5jcJ.js.map +1 -0
  45. package/dist/_chunks/{Relations-BOTC_ZqE.mjs → Relations-_K-HYOiM.mjs} +3 -3
  46. package/dist/_chunks/{Relations-BOTC_ZqE.mjs.map → Relations-_K-HYOiM.mjs.map} +1 -1
  47. package/dist/_chunks/{Relations-DnCdLzq_.js → Relations-xtKZHtTN.js} +3 -3
  48. package/dist/_chunks/{Relations-DnCdLzq_.js.map → Relations-xtKZHtTN.js.map} +1 -1
  49. package/dist/_chunks/{index-CptTdHNy.js → index-BlX-OdHL.js} +123 -86
  50. package/dist/_chunks/index-BlX-OdHL.js.map +1 -0
  51. package/dist/_chunks/{index-BeYsz0Vi.mjs → index-tETMKK2G.mjs} +123 -86
  52. package/dist/_chunks/index-tETMKK2G.mjs.map +1 -0
  53. package/dist/_chunks/{layout-CzSSEy9b.mjs → layout-BaQBaz56.mjs} +3 -3
  54. package/dist/_chunks/{layout-CzSSEy9b.mjs.map → layout-BaQBaz56.mjs.map} +1 -1
  55. package/dist/_chunks/{layout-szfTCeYm.js → layout-D8Sz3KxF.js} +3 -3
  56. package/dist/_chunks/{layout-szfTCeYm.js.map → layout-D8Sz3KxF.js.map} +1 -1
  57. package/dist/_chunks/{relations-qssSbh1V.js → relations-CAbbX8Sa.js} +2 -2
  58. package/dist/_chunks/{relations-qssSbh1V.js.map → relations-CAbbX8Sa.js.map} +1 -1
  59. package/dist/_chunks/{relations-DvzmDbWc.mjs → relations-CsfmCqOU.mjs} +2 -2
  60. package/dist/_chunks/{relations-DvzmDbWc.mjs.map → relations-CsfmCqOU.mjs.map} +1 -1
  61. package/dist/admin/index.js +1 -1
  62. package/dist/admin/index.mjs +1 -1
  63. package/package.json +6 -7
  64. package/dist/_chunks/Field-IMBnqF-k.js.map +0 -1
  65. package/dist/_chunks/Field-hD0Y00Mt.mjs.map +0 -1
  66. package/dist/_chunks/Preview-BqRUSbFU.js.map +0 -1
  67. package/dist/_chunks/Preview-DwWET-X7.mjs.map +0 -1
  68. package/dist/_chunks/index-BeYsz0Vi.mjs.map +0 -1
  69. package/dist/_chunks/index-CptTdHNy.js.map +0 -1
@@ -1667,7 +1667,7 @@ const useDocumentActions = () => {
1667
1667
  };
1668
1668
  };
1669
1669
  const ProtectedHistoryPage = React.lazy(
1670
- () => import("./History-C4X3jiQJ.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1670
+ () => import("./History-Cw2Q7OQL.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1671
1671
  );
1672
1672
  const routes$2 = [
1673
1673
  {
@@ -1680,7 +1680,7 @@ const routes$2 = [
1680
1680
  }
1681
1681
  ];
1682
1682
  const ProtectedPreviewPage = React.lazy(
1683
- () => import("./Preview-DwWET-X7.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
1683
+ () => import("./Preview-BrBRcL10.mjs").then((mod) => ({ default: mod.ProtectedPreviewPage }))
1684
1684
  );
1685
1685
  const routes$1 = [
1686
1686
  {
@@ -1693,31 +1693,31 @@ const routes$1 = [
1693
1693
  }
1694
1694
  ];
1695
1695
  const ProtectedEditViewPage = lazy(
1696
- () => import("./EditViewPage-D2FPb5Mh.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1696
+ () => import("./EditViewPage-DtKM7Jgw.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1697
1697
  );
1698
1698
  const ProtectedListViewPage = lazy(
1699
- () => import("./ListViewPage-CvxfiNTc.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1699
+ () => import("./ListViewPage-DuvjX6ra.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1700
1700
  );
1701
1701
  const ProtectedListConfiguration = lazy(
1702
- () => import("./ListConfigurationPage-CwMU6tWQ.mjs").then((mod) => ({
1702
+ () => import("./ListConfigurationPage-B47JIu1e.mjs").then((mod) => ({
1703
1703
  default: mod.ProtectedListConfiguration
1704
1704
  }))
1705
1705
  );
1706
1706
  const ProtectedEditConfigurationPage = lazy(
1707
- () => import("./EditConfigurationPage-DKtPyjs_.mjs").then((mod) => ({
1707
+ () => import("./EditConfigurationPage-CLDwrUv5.mjs").then((mod) => ({
1708
1708
  default: mod.ProtectedEditConfigurationPage
1709
1709
  }))
1710
1710
  );
1711
1711
  const ProtectedComponentConfigurationPage = lazy(
1712
- () => import("./ComponentConfigurationPage-viOAdZM6.mjs").then((mod) => ({
1712
+ () => import("./ComponentConfigurationPage-CzVt9QCC.mjs").then((mod) => ({
1713
1713
  default: mod.ProtectedComponentConfigurationPage
1714
1714
  }))
1715
1715
  );
1716
1716
  const NoPermissions = lazy(
1717
- () => import("./NoPermissionsPage-DiW-TIzq.mjs").then((mod) => ({ default: mod.NoPermissions }))
1717
+ () => import("./NoPermissionsPage-CAi3zCAD.mjs").then((mod) => ({ default: mod.NoPermissions }))
1718
1718
  );
1719
1719
  const NoContentType = lazy(
1720
- () => import("./NoContentTypePage-Dy6sa9LT.mjs").then((mod) => ({ default: mod.NoContentType }))
1720
+ () => import("./NoContentTypePage-C6M-Q0Tv.mjs").then((mod) => ({ default: mod.NoContentType }))
1721
1721
  );
1722
1722
  const CollectionTypePages = () => {
1723
1723
  const { collectionType } = useParams();
@@ -2271,6 +2271,117 @@ const UpdateAction = ({
2271
2271
  const validate = useForm("UpdateAction", (state) => state.validate);
2272
2272
  const setErrors = useForm("UpdateAction", (state) => state.setErrors);
2273
2273
  const resetForm = useForm("PublishAction", ({ resetForm: resetForm2 }) => resetForm2);
2274
+ const handleUpdate = React.useCallback(async () => {
2275
+ setSubmitting(true);
2276
+ try {
2277
+ if (!modified) {
2278
+ return;
2279
+ }
2280
+ const { errors } = await validate(true, {
2281
+ status: "draft"
2282
+ });
2283
+ if (errors) {
2284
+ toggleNotification({
2285
+ type: "danger",
2286
+ message: formatMessage({
2287
+ id: "content-manager.validation.error",
2288
+ defaultMessage: "There are validation errors in your document. Please fix them before saving."
2289
+ })
2290
+ });
2291
+ return;
2292
+ }
2293
+ if (isCloning) {
2294
+ const res = await clone(
2295
+ {
2296
+ model,
2297
+ documentId: cloneMatch.params.origin,
2298
+ params
2299
+ },
2300
+ transformData(document)
2301
+ );
2302
+ if ("data" in res) {
2303
+ navigate(
2304
+ {
2305
+ pathname: `../${res.data.documentId}`,
2306
+ search: rawQuery
2307
+ },
2308
+ { relative: "path" }
2309
+ );
2310
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2311
+ setErrors(formatValidationErrors(res.error));
2312
+ }
2313
+ } else if (documentId || collectionType === SINGLE_TYPES) {
2314
+ const res = await update(
2315
+ {
2316
+ collectionType,
2317
+ model,
2318
+ documentId,
2319
+ params
2320
+ },
2321
+ transformData(document)
2322
+ );
2323
+ if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2324
+ setErrors(formatValidationErrors(res.error));
2325
+ } else {
2326
+ resetForm();
2327
+ }
2328
+ } else {
2329
+ const res = await create(
2330
+ {
2331
+ model,
2332
+ params
2333
+ },
2334
+ transformData(document)
2335
+ );
2336
+ if ("data" in res && collectionType !== SINGLE_TYPES) {
2337
+ navigate(
2338
+ {
2339
+ pathname: `../${res.data.documentId}`,
2340
+ search: rawQuery
2341
+ },
2342
+ { replace: true, relative: "path" }
2343
+ );
2344
+ } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2345
+ setErrors(formatValidationErrors(res.error));
2346
+ }
2347
+ }
2348
+ } finally {
2349
+ setSubmitting(false);
2350
+ }
2351
+ }, [
2352
+ clone,
2353
+ cloneMatch?.params.origin,
2354
+ collectionType,
2355
+ create,
2356
+ document,
2357
+ documentId,
2358
+ formatMessage,
2359
+ formatValidationErrors,
2360
+ isCloning,
2361
+ model,
2362
+ modified,
2363
+ navigate,
2364
+ params,
2365
+ rawQuery,
2366
+ resetForm,
2367
+ setErrors,
2368
+ setSubmitting,
2369
+ toggleNotification,
2370
+ update,
2371
+ validate
2372
+ ]);
2373
+ React.useEffect(() => {
2374
+ const handleKeyDown = (e) => {
2375
+ if (e.key === "Enter" && (e.metaKey || e.ctrlKey)) {
2376
+ e.preventDefault();
2377
+ handleUpdate();
2378
+ }
2379
+ };
2380
+ window.addEventListener("keydown", handleKeyDown);
2381
+ return () => {
2382
+ window.removeEventListener("keydown", handleKeyDown);
2383
+ };
2384
+ }, [handleUpdate]);
2274
2385
  return {
2275
2386
  /**
2276
2387
  * Disabled when:
@@ -2283,81 +2394,7 @@ const UpdateAction = ({
2283
2394
  id: "global.save",
2284
2395
  defaultMessage: "Save"
2285
2396
  }),
2286
- onClick: async () => {
2287
- setSubmitting(true);
2288
- try {
2289
- const { errors } = await validate(true, {
2290
- status: "draft"
2291
- });
2292
- if (errors) {
2293
- toggleNotification({
2294
- type: "danger",
2295
- message: formatMessage({
2296
- id: "content-manager.validation.error",
2297
- defaultMessage: "There are validation errors in your document. Please fix them before saving."
2298
- })
2299
- });
2300
- return;
2301
- }
2302
- if (isCloning) {
2303
- const res = await clone(
2304
- {
2305
- model,
2306
- documentId: cloneMatch.params.origin,
2307
- params
2308
- },
2309
- transformData(document)
2310
- );
2311
- if ("data" in res) {
2312
- navigate(
2313
- {
2314
- pathname: `../${res.data.documentId}`,
2315
- search: rawQuery
2316
- },
2317
- { relative: "path" }
2318
- );
2319
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2320
- setErrors(formatValidationErrors(res.error));
2321
- }
2322
- } else if (documentId || collectionType === SINGLE_TYPES) {
2323
- const res = await update(
2324
- {
2325
- collectionType,
2326
- model,
2327
- documentId,
2328
- params
2329
- },
2330
- transformData(document)
2331
- );
2332
- if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2333
- setErrors(formatValidationErrors(res.error));
2334
- } else {
2335
- resetForm();
2336
- }
2337
- } else {
2338
- const res = await create(
2339
- {
2340
- model,
2341
- params
2342
- },
2343
- transformData(document)
2344
- );
2345
- if ("data" in res && collectionType !== SINGLE_TYPES) {
2346
- navigate(
2347
- {
2348
- pathname: `../${res.data.documentId}`,
2349
- search: rawQuery
2350
- },
2351
- { replace: true, relative: "path" }
2352
- );
2353
- } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
2354
- setErrors(formatValidationErrors(res.error));
2355
- }
2356
- }
2357
- } finally {
2358
- setSubmitting(false);
2359
- }
2360
- }
2397
+ onClick: handleUpdate
2361
2398
  };
2362
2399
  };
2363
2400
  UpdateAction.type = "update";
@@ -4139,7 +4176,7 @@ const index = {
4139
4176
  app.router.addRoute({
4140
4177
  path: "content-manager/*",
4141
4178
  lazy: async () => {
4142
- const { Layout } = await import("./layout-CzSSEy9b.mjs");
4179
+ const { Layout } = await import("./layout-BaQBaz56.mjs");
4143
4180
  return {
4144
4181
  Component: Layout
4145
4182
  };
@@ -4221,4 +4258,4 @@ export {
4221
4258
  capitalise as y,
4222
4259
  useUpdateContentTypeConfigurationMutation as z
4223
4260
  };
4224
- //# sourceMappingURL=index-BeYsz0Vi.mjs.map
4261
+ //# sourceMappingURL=index-tETMKK2G.mjs.map