@strapi/content-manager 0.0.0-experimental.7bc5339b0393e53f9f568301594621e7fb466e2f → 0.0.0-experimental.7bef52cb5066b2d3918afde3c5a60ded8754fdf9

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 (80) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-BPiQrhZ6.js → ComponentConfigurationPage-BTR_hQow.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-BPiQrhZ6.js.map → ComponentConfigurationPage-BTR_hQow.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-viOAdZM6.mjs → ComponentConfigurationPage-bLQr82ce.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-viOAdZM6.mjs.map → ComponentConfigurationPage-bLQr82ce.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-DKtPyjs_.mjs → EditConfigurationPage-BhRSnUsL.mjs} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-DKtPyjs_.mjs.map → EditConfigurationPage-BhRSnUsL.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-CZRKq8CN.js → EditConfigurationPage-z39Wv3E6.js} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-CZRKq8CN.js.map → EditConfigurationPage-z39Wv3E6.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-D2FPb5Mh.mjs → EditViewPage-BCjNxNlY.mjs} +3 -3
  10. package/dist/_chunks/{EditViewPage-D2FPb5Mh.mjs.map → EditViewPage-BCjNxNlY.mjs.map} +1 -1
  11. package/dist/_chunks/{EditViewPage-C-TZmK5r.js → EditViewPage-wujOq90c.js} +3 -3
  12. package/dist/_chunks/{EditViewPage-C-TZmK5r.js.map → EditViewPage-wujOq90c.js.map} +1 -1
  13. package/dist/_chunks/{Field-IMBnqF-k.js → Field-B5QXnctJ.js} +90 -10
  14. package/dist/_chunks/Field-B5QXnctJ.js.map +1 -0
  15. package/dist/_chunks/{Field-hD0Y00Mt.mjs → Field-Byr3mPTl.mjs} +89 -10
  16. package/dist/_chunks/Field-Byr3mPTl.mjs.map +1 -0
  17. package/dist/_chunks/{Form-ZQ9fzWkd.mjs → Form-BZgvE8C8.mjs} +2 -2
  18. package/dist/_chunks/{Form-ZQ9fzWkd.mjs.map → Form-BZgvE8C8.mjs.map} +1 -1
  19. package/dist/_chunks/{Form-BaURS01O.js → Form-D7mexvm3.js} +2 -2
  20. package/dist/_chunks/{Form-BaURS01O.js.map → Form-D7mexvm3.js.map} +1 -1
  21. package/dist/_chunks/{History-C4X3jiQJ.mjs → History-CqNgxkqK.mjs} +4 -4
  22. package/dist/_chunks/{History-C4X3jiQJ.mjs.map → History-CqNgxkqK.mjs.map} +1 -1
  23. package/dist/_chunks/{History-BqRQm2Lc.js → History-DYl2A8Z_.js} +4 -4
  24. package/dist/_chunks/{History-BqRQm2Lc.js.map → History-DYl2A8Z_.js.map} +1 -1
  25. package/dist/_chunks/{ListConfigurationPage-BT69-TvF.js → ListConfigurationPage-BXnu_OoY.js} +2 -2
  26. package/dist/_chunks/{ListConfigurationPage-BT69-TvF.js.map → ListConfigurationPage-BXnu_OoY.js.map} +1 -1
  27. package/dist/_chunks/{ListConfigurationPage-CwMU6tWQ.mjs → ListConfigurationPage-BbQjzKkQ.mjs} +2 -2
  28. package/dist/_chunks/{ListConfigurationPage-CwMU6tWQ.mjs.map → ListConfigurationPage-BbQjzKkQ.mjs.map} +1 -1
  29. package/dist/_chunks/{ListViewPage-CYkrfWsm.js → ListViewPage-BtSi8C1l.js} +3 -3
  30. package/dist/_chunks/{ListViewPage-CYkrfWsm.js.map → ListViewPage-BtSi8C1l.js.map} +1 -1
  31. package/dist/_chunks/{ListViewPage-CvxfiNTc.mjs → ListViewPage-D4ofkbjR.mjs} +3 -3
  32. package/dist/_chunks/{ListViewPage-CvxfiNTc.mjs.map → ListViewPage-D4ofkbjR.mjs.map} +1 -1
  33. package/dist/_chunks/{NoContentTypePage-BZMfRsrg.js → NoContentTypePage-CitJeOq4.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-BZMfRsrg.js.map → NoContentTypePage-CitJeOq4.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-Dy6sa9LT.mjs → NoContentTypePage-DyUx5mXh.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-Dy6sa9LT.mjs.map → NoContentTypePage-DyUx5mXh.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DiW-TIzq.mjs → NoPermissionsPage-DhIiyWkk.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DiW-TIzq.mjs.map → NoPermissionsPage-DhIiyWkk.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-DjUdvhJ6.js → NoPermissionsPage-DzgWz0M-.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-DjUdvhJ6.js.map → NoPermissionsPage-DzgWz0M-.js.map} +1 -1
  41. package/dist/_chunks/{Preview-DwWET-X7.mjs → Preview-BaYGJ0nb.mjs} +23 -8
  42. package/dist/_chunks/Preview-BaYGJ0nb.mjs.map +1 -0
  43. package/dist/_chunks/{Preview-BqRUSbFU.js → Preview-DfNx8Ke-.js} +22 -7
  44. package/dist/_chunks/Preview-DfNx8Ke-.js.map +1 -0
  45. package/dist/_chunks/{Relations-BOTC_ZqE.mjs → Relations-DM2yUTST.mjs} +3 -3
  46. package/dist/_chunks/{Relations-BOTC_ZqE.mjs.map → Relations-DM2yUTST.mjs.map} +1 -1
  47. package/dist/_chunks/{Relations-DnCdLzq_.js → Relations-DuKCaXrv.js} +3 -3
  48. package/dist/_chunks/{Relations-DnCdLzq_.js.map → Relations-DuKCaXrv.js.map} +1 -1
  49. package/dist/_chunks/{index-CptTdHNy.js → index-BUWEmX8m.js} +123 -90
  50. package/dist/_chunks/index-BUWEmX8m.js.map +1 -0
  51. package/dist/_chunks/{index-BeYsz0Vi.mjs → index-DVAIIsOs.mjs} +123 -90
  52. package/dist/_chunks/index-DVAIIsOs.mjs.map +1 -0
  53. package/dist/_chunks/{layout-CzSSEy9b.mjs → layout-Bxsv5mP7.mjs} +3 -3
  54. package/dist/_chunks/{layout-CzSSEy9b.mjs.map → layout-Bxsv5mP7.mjs.map} +1 -1
  55. package/dist/_chunks/{layout-szfTCeYm.js → layout-C3fN7Ejz.js} +3 -3
  56. package/dist/_chunks/{layout-szfTCeYm.js.map → layout-C3fN7Ejz.js.map} +1 -1
  57. package/dist/_chunks/{relations-qssSbh1V.js → relations-BPZKAoEY.js} +2 -2
  58. package/dist/_chunks/{relations-qssSbh1V.js.map → relations-BPZKAoEY.js.map} +1 -1
  59. package/dist/_chunks/{relations-DvzmDbWc.mjs → relations-o3pPhzY4.mjs} +2 -2
  60. package/dist/_chunks/{relations-DvzmDbWc.mjs.map → relations-o3pPhzY4.mjs.map} +1 -1
  61. package/dist/admin/index.js +1 -1
  62. package/dist/admin/index.mjs +1 -1
  63. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/Code.d.ts +7 -0
  64. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/Blocks/utils/prismLanguages.d.ts +49 -0
  65. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +1 -0
  66. package/dist/server/index.js +0 -4
  67. package/dist/server/index.js.map +1 -1
  68. package/dist/server/index.mjs +0 -4
  69. package/dist/server/index.mjs.map +1 -1
  70. package/dist/server/src/preview/index.d.ts.map +1 -1
  71. package/package.json +8 -6
  72. package/dist/_chunks/Field-IMBnqF-k.js.map +0 -1
  73. package/dist/_chunks/Field-hD0Y00Mt.mjs.map +0 -1
  74. package/dist/_chunks/Preview-BqRUSbFU.js.map +0 -1
  75. package/dist/_chunks/Preview-DwWET-X7.mjs.map +0 -1
  76. package/dist/_chunks/index-BeYsz0Vi.mjs.map +0 -1
  77. package/dist/_chunks/index-CptTdHNy.js.map +0 -1
  78. package/dist/admin/src/preview/constants.d.ts +0 -1
  79. package/dist/server/src/preview/constants.d.ts +0 -2
  80. package/dist/server/src/preview/constants.d.ts.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-CqNgxkqK.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-BaYGJ0nb.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-BCjNxNlY.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-D4ofkbjR.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1700
1700
  );
1701
1701
  const ProtectedListConfiguration = lazy(
1702
- () => import("./ListConfigurationPage-CwMU6tWQ.mjs").then((mod) => ({
1702
+ () => import("./ListConfigurationPage-BbQjzKkQ.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-BhRSnUsL.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-bLQr82ce.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-DhIiyWkk.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-DyUx5mXh.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";
@@ -4110,12 +4147,8 @@ const PreviewSidePanel = ({ model, documentId, document }) => {
4110
4147
  )
4111
4148
  };
4112
4149
  };
4113
- const FEATURE_ID = "preview";
4114
4150
  const previewAdmin = {
4115
4151
  bootstrap(app) {
4116
- if (!window.strapi.future.isEnabled(FEATURE_ID)) {
4117
- return;
4118
- }
4119
4152
  const contentManagerPluginApis = app.getPlugin("content-manager").apis;
4120
4153
  contentManagerPluginApis.addEditViewSidePanel([PreviewSidePanel]);
4121
4154
  }
@@ -4139,7 +4172,7 @@ const index = {
4139
4172
  app.router.addRoute({
4140
4173
  path: "content-manager/*",
4141
4174
  lazy: async () => {
4142
- const { Layout } = await import("./layout-CzSSEy9b.mjs");
4175
+ const { Layout } = await import("./layout-Bxsv5mP7.mjs");
4143
4176
  return {
4144
4177
  Component: Layout
4145
4178
  };
@@ -4221,4 +4254,4 @@ export {
4221
4254
  capitalise as y,
4222
4255
  useUpdateContentTypeConfigurationMutation as z
4223
4256
  };
4224
- //# sourceMappingURL=index-BeYsz0Vi.mjs.map
4257
+ //# sourceMappingURL=index-DVAIIsOs.mjs.map