@strapi/content-manager 0.0.0-experimental.62ce06180fe9a772eaeb3d43d238b26644f39f7c → 0.0.0-experimental.745741d19e90275ca6f7c928ca19f9bb0fd9d933

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 (82) hide show
  1. package/LICENSE +18 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-Cl7eB3s4.js → ComponentConfigurationPage-BvHtG7uH.js} +3 -3
  3. package/dist/_chunks/{ComponentConfigurationPage-Cl7eB3s4.js.map → ComponentConfigurationPage-BvHtG7uH.js.map} +1 -1
  4. package/dist/_chunks/{ComponentConfigurationPage-DErJQEVW.mjs → ComponentConfigurationPage-DHNM3YBz.mjs} +3 -3
  5. package/dist/_chunks/{ComponentConfigurationPage-DErJQEVW.mjs.map → ComponentConfigurationPage-DHNM3YBz.mjs.map} +1 -1
  6. package/dist/_chunks/{EditConfigurationPage-CBosWqQ7.mjs → EditConfigurationPage-Cp6HAEzN.mjs} +3 -3
  7. package/dist/_chunks/{EditConfigurationPage-CBosWqQ7.mjs.map → EditConfigurationPage-Cp6HAEzN.mjs.map} +1 -1
  8. package/dist/_chunks/{EditConfigurationPage-CyfFvH6-.js → EditConfigurationPage-DOmfCEMo.js} +3 -3
  9. package/dist/_chunks/{EditConfigurationPage-CyfFvH6-.js.map → EditConfigurationPage-DOmfCEMo.js.map} +1 -1
  10. package/dist/_chunks/{EditViewPage-DxyAOItK.js → EditViewPage-BqNpC6hO.js} +3 -3
  11. package/dist/_chunks/{EditViewPage-DxyAOItK.js.map → EditViewPage-BqNpC6hO.js.map} +1 -1
  12. package/dist/_chunks/{EditViewPage-ClIueJnM.mjs → EditViewPage-BtkEx339.mjs} +3 -3
  13. package/dist/_chunks/{EditViewPage-ClIueJnM.mjs.map → EditViewPage-BtkEx339.mjs.map} +1 -1
  14. package/dist/_chunks/{Field-BZBYmvaf.mjs → Field-R5NbffTB.mjs} +273 -6
  15. package/dist/_chunks/Field-R5NbffTB.mjs.map +1 -0
  16. package/dist/_chunks/{Field-C0Y_SR9e.js → Field-lsPFnAmH.js} +272 -5
  17. package/dist/_chunks/Field-lsPFnAmH.js.map +1 -0
  18. package/dist/_chunks/{Form-jwRSC2kV.mjs → Form-BHmXSfyy.mjs} +2 -2
  19. package/dist/_chunks/{Form-jwRSC2kV.mjs.map → Form-BHmXSfyy.mjs.map} +1 -1
  20. package/dist/_chunks/{Form-DwvGnISS.js → Form-CcGboku8.js} +2 -2
  21. package/dist/_chunks/{Form-DwvGnISS.js.map → Form-CcGboku8.js.map} +1 -1
  22. package/dist/_chunks/{History-Cda0Yjzz.js → History-Bsud8jwh.js} +20 -5
  23. package/dist/_chunks/{History-Cda0Yjzz.js.map → History-Bsud8jwh.js.map} +1 -1
  24. package/dist/_chunks/{History-BgzAIj0G.mjs → History-ByUPL3T3.mjs} +20 -5
  25. package/dist/_chunks/{History-BgzAIj0G.mjs.map → History-ByUPL3T3.mjs.map} +1 -1
  26. package/dist/_chunks/{ListConfigurationPage-GH55qfoT.mjs → ListConfigurationPage-Bm5HACXf.mjs} +2 -2
  27. package/dist/_chunks/{ListConfigurationPage-GH55qfoT.mjs.map → ListConfigurationPage-Bm5HACXf.mjs.map} +1 -1
  28. package/dist/_chunks/{ListConfigurationPage-C29EF97r.js → ListConfigurationPage-DiT463qx.js} +2 -2
  29. package/dist/_chunks/{ListConfigurationPage-C29EF97r.js.map → ListConfigurationPage-DiT463qx.js.map} +1 -1
  30. package/dist/_chunks/{ListViewPage-CnRt0UT7.js → ListViewPage-CsrC9L_d.js} +15 -6
  31. package/dist/_chunks/ListViewPage-CsrC9L_d.js.map +1 -0
  32. package/dist/_chunks/{ListViewPage-QU03PFj1.mjs → ListViewPage-JSyNAAYu.mjs} +15 -6
  33. package/dist/_chunks/ListViewPage-JSyNAAYu.mjs.map +1 -0
  34. package/dist/_chunks/{NoContentTypePage-DFDjxByI.js → NoContentTypePage-Bsvng4II.js} +2 -2
  35. package/dist/_chunks/{NoContentTypePage-DFDjxByI.js.map → NoContentTypePage-Bsvng4II.js.map} +1 -1
  36. package/dist/_chunks/{NoContentTypePage-CPs2CnzH.mjs → NoContentTypePage-CsrQUpBE.mjs} +2 -2
  37. package/dist/_chunks/{NoContentTypePage-CPs2CnzH.mjs.map → NoContentTypePage-CsrQUpBE.mjs.map} +1 -1
  38. package/dist/_chunks/{NoPermissionsPage-BVHI-jv5.js → NoPermissionsPage-CdHNJtEf.js} +2 -2
  39. package/dist/_chunks/{NoPermissionsPage-BVHI-jv5.js.map → NoPermissionsPage-CdHNJtEf.js.map} +1 -1
  40. package/dist/_chunks/{NoPermissionsPage-ct58lcY0.mjs → NoPermissionsPage-DNmf_pj0.mjs} +2 -2
  41. package/dist/_chunks/{NoPermissionsPage-ct58lcY0.mjs.map → NoPermissionsPage-DNmf_pj0.mjs.map} +1 -1
  42. package/dist/_chunks/{Relations-BjpPPCKp.js → Relations-CghaPv2D.js} +3 -3
  43. package/dist/_chunks/{Relations-BjpPPCKp.js.map → Relations-CghaPv2D.js.map} +1 -1
  44. package/dist/_chunks/{Relations-KMf5qEN0.mjs → Relations-u8-37jK0.mjs} +3 -3
  45. package/dist/_chunks/{Relations-KMf5qEN0.mjs.map → Relations-u8-37jK0.mjs.map} +1 -1
  46. package/dist/_chunks/{index-D9ZwczCV.js → index-BOZx6IMg.js} +46 -37
  47. package/dist/_chunks/index-BOZx6IMg.js.map +1 -0
  48. package/dist/_chunks/{index-6kKXK7y8.mjs → index-CaE6NG4a.mjs} +58 -49
  49. package/dist/_chunks/index-CaE6NG4a.mjs.map +1 -0
  50. package/dist/_chunks/{layout-B1Z-9koY.mjs → layout-Bx7svTbY.mjs} +7 -7
  51. package/dist/_chunks/layout-Bx7svTbY.mjs.map +1 -0
  52. package/dist/_chunks/{layout-BJfBoBiF.js → layout-Ciz224q5.js} +6 -6
  53. package/dist/_chunks/layout-Ciz224q5.js.map +1 -0
  54. package/dist/_chunks/{relations-CMvjzyU3.js → relations-CP8sB2YZ.js} +2 -2
  55. package/dist/_chunks/{relations-CMvjzyU3.js.map → relations-CP8sB2YZ.js.map} +1 -1
  56. package/dist/_chunks/{relations-CgZg7Pyx.mjs → relations-Cxc1cEv3.mjs} +2 -2
  57. package/dist/_chunks/{relations-CgZg7Pyx.mjs.map → relations-Cxc1cEv3.mjs.map} +1 -1
  58. package/dist/admin/index.js +1 -1
  59. package/dist/admin/index.mjs +4 -4
  60. package/dist/admin/src/history/services/historyVersion.d.ts +1 -1
  61. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  62. package/dist/admin/src/services/api.d.ts +1 -1
  63. package/dist/admin/src/services/components.d.ts +2 -2
  64. package/dist/admin/src/services/contentTypes.d.ts +3 -3
  65. package/dist/admin/src/services/documents.d.ts +16 -16
  66. package/dist/admin/src/services/init.d.ts +1 -1
  67. package/dist/admin/src/services/relations.d.ts +2 -2
  68. package/dist/admin/src/services/uid.d.ts +3 -3
  69. package/dist/server/index.js +4 -0
  70. package/dist/server/index.js.map +1 -1
  71. package/dist/server/index.mjs +4 -0
  72. package/dist/server/index.mjs.map +1 -1
  73. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  74. package/package.json +6 -6
  75. package/dist/_chunks/Field-BZBYmvaf.mjs.map +0 -1
  76. package/dist/_chunks/Field-C0Y_SR9e.js.map +0 -1
  77. package/dist/_chunks/ListViewPage-CnRt0UT7.js.map +0 -1
  78. package/dist/_chunks/ListViewPage-QU03PFj1.mjs.map +0 -1
  79. package/dist/_chunks/index-6kKXK7y8.mjs.map +0 -1
  80. package/dist/_chunks/index-D9ZwczCV.js.map +0 -1
  81. package/dist/_chunks/layout-B1Z-9koY.mjs.map +0 -1
  82. package/dist/_chunks/layout-BJfBoBiF.js.map +0 -1
@@ -194,9 +194,7 @@ const contentManagerApi = adminApi.enhanceEndpoints({
194
194
  "Document",
195
195
  "InitialData",
196
196
  "HistoryVersion",
197
- "Relations",
198
- "Release",
199
- "ReleaseAction"
197
+ "Relations"
200
198
  ]
201
199
  });
202
200
  const documentApi = contentManagerApi.injectEndpoints({
@@ -250,9 +248,7 @@ const documentApi = contentManagerApi.injectEndpoints({
250
248
  }
251
249
  }),
252
250
  invalidatesTags: (_result, _error, { collectionType, model }) => [
253
- { type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model },
254
- { type: "Release", id: "LIST" },
255
- { type: "ReleaseAction", id: "LIST" }
251
+ { type: "Document", id: collectionType !== SINGLE_TYPES ? `${model}_LIST` : model }
256
252
  ]
257
253
  }),
258
254
  deleteManyDocuments: builder.mutation({
@@ -264,11 +260,7 @@ const documentApi = contentManagerApi.injectEndpoints({
264
260
  params
265
261
  }
266
262
  }),
267
- invalidatesTags: (_res, _error, { model }) => [
268
- { type: "Document", id: `${model}_LIST` },
269
- { type: "Release", id: "LIST" },
270
- { type: "ReleaseAction", id: "LIST" }
271
- ]
263
+ invalidatesTags: (_res, _error, { model }) => [{ type: "Document", id: `${model}_LIST` }]
272
264
  }),
273
265
  discardDocument: builder.mutation({
274
266
  query: ({ collectionType, model, documentId, params }) => ({
@@ -285,9 +277,7 @@ const documentApi = contentManagerApi.injectEndpoints({
285
277
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
286
278
  },
287
279
  { type: "Document", id: `${model}_LIST` },
288
- "Relations",
289
- { type: "Release", id: "LIST" },
290
- { type: "ReleaseAction", id: "LIST" }
280
+ "Relations"
291
281
  ];
292
282
  }
293
283
  }),
@@ -406,9 +396,7 @@ const documentApi = contentManagerApi.injectEndpoints({
406
396
  type: "Document",
407
397
  id: collectionType !== SINGLE_TYPES ? `${model}_${documentId}` : model
408
398
  },
409
- "Relations",
410
- { type: "Release", id: "LIST" },
411
- { type: "ReleaseAction", id: "LIST" }
399
+ "Relations"
412
400
  ];
413
401
  }
414
402
  }),
@@ -612,7 +600,7 @@ const createAttributeSchema = (attribute) => {
612
600
  }
613
601
  };
614
602
  const addRequiredValidation = (attribute) => (schema) => {
615
- if (attribute.required) {
603
+ if (attribute.required && attribute.type !== "relation") {
616
604
  return schema.required({
617
605
  id: translatedErrors.required.id,
618
606
  defaultMessage: "This field is required."
@@ -776,7 +764,10 @@ const useDocument = (args, opts) => {
776
764
  isLoading: isLoadingDocument,
777
765
  isFetching: isFetchingDocument,
778
766
  error
779
- } = useGetDocumentQuery(args, opts);
767
+ } = useGetDocumentQuery(args, {
768
+ ...opts,
769
+ skip: !args.documentId && args.collectionType !== SINGLE_TYPES || opts?.skip
770
+ });
780
771
  const { components, schema, isLoading: isLoadingSchema } = useContentTypeSchema(args.model);
781
772
  React.useEffect(() => {
782
773
  if (error) {
@@ -1278,7 +1269,7 @@ const useDocumentActions = () => {
1278
1269
  };
1279
1270
  };
1280
1271
  const ProtectedHistoryPage = lazy(
1281
- () => import("./History-BgzAIj0G.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1272
+ () => import("./History-ByUPL3T3.mjs").then((mod) => ({ default: mod.ProtectedHistoryPage }))
1282
1273
  );
1283
1274
  const routes$1 = [
1284
1275
  {
@@ -1291,31 +1282,31 @@ const routes$1 = [
1291
1282
  }
1292
1283
  ];
1293
1284
  const ProtectedEditViewPage = lazy(
1294
- () => import("./EditViewPage-ClIueJnM.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1285
+ () => import("./EditViewPage-BtkEx339.mjs").then((mod) => ({ default: mod.ProtectedEditViewPage }))
1295
1286
  );
1296
1287
  const ProtectedListViewPage = lazy(
1297
- () => import("./ListViewPage-QU03PFj1.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1288
+ () => import("./ListViewPage-JSyNAAYu.mjs").then((mod) => ({ default: mod.ProtectedListViewPage }))
1298
1289
  );
1299
1290
  const ProtectedListConfiguration = lazy(
1300
- () => import("./ListConfigurationPage-GH55qfoT.mjs").then((mod) => ({
1291
+ () => import("./ListConfigurationPage-Bm5HACXf.mjs").then((mod) => ({
1301
1292
  default: mod.ProtectedListConfiguration
1302
1293
  }))
1303
1294
  );
1304
1295
  const ProtectedEditConfigurationPage = lazy(
1305
- () => import("./EditConfigurationPage-CBosWqQ7.mjs").then((mod) => ({
1296
+ () => import("./EditConfigurationPage-Cp6HAEzN.mjs").then((mod) => ({
1306
1297
  default: mod.ProtectedEditConfigurationPage
1307
1298
  }))
1308
1299
  );
1309
1300
  const ProtectedComponentConfigurationPage = lazy(
1310
- () => import("./ComponentConfigurationPage-DErJQEVW.mjs").then((mod) => ({
1301
+ () => import("./ComponentConfigurationPage-DHNM3YBz.mjs").then((mod) => ({
1311
1302
  default: mod.ProtectedComponentConfigurationPage
1312
1303
  }))
1313
1304
  );
1314
1305
  const NoPermissions = lazy(
1315
- () => import("./NoPermissionsPage-ct58lcY0.mjs").then((mod) => ({ default: mod.NoPermissions }))
1306
+ () => import("./NoPermissionsPage-DNmf_pj0.mjs").then((mod) => ({ default: mod.NoPermissions }))
1316
1307
  );
1317
1308
  const NoContentType = lazy(
1318
- () => import("./NoContentTypePage-CPs2CnzH.mjs").then((mod) => ({ default: mod.NoContentType }))
1309
+ () => import("./NoContentTypePage-CsrQUpBE.mjs").then((mod) => ({ default: mod.NoContentType }))
1319
1310
  );
1320
1311
  const CollectionTypePages = () => {
1321
1312
  const { collectionType } = useParams();
@@ -1648,8 +1639,8 @@ const DocumentActionModal = ({
1648
1639
  };
1649
1640
  return /* @__PURE__ */ jsx(Modal.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxs(Modal.Content, { children: [
1650
1641
  /* @__PURE__ */ jsx(Modal.Header, { children: /* @__PURE__ */ jsx(Modal.Title, { children: title }) }),
1651
- typeof Content === "function" ? /* @__PURE__ */ jsx(Content, { onClose: handleClose }) : /* @__PURE__ */ jsx(Modal.Body, { children: Content }),
1652
- typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer
1642
+ /* @__PURE__ */ jsx(Modal.Body, { children: typeof Content === "function" ? /* @__PURE__ */ jsx(Content, { onClose: handleClose }) : Content }),
1643
+ /* @__PURE__ */ jsx(Modal.Footer, { children: typeof Footer === "function" ? /* @__PURE__ */ jsx(Footer, { onClose: handleClose }) : Footer })
1653
1644
  ] }) });
1654
1645
  };
1655
1646
  const PublishAction$1 = ({
@@ -1833,10 +1824,13 @@ const UpdateAction = ({
1833
1824
  document
1834
1825
  );
1835
1826
  if ("data" in res && collectionType !== SINGLE_TYPES) {
1836
- navigate({
1837
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
1838
- search: rawQuery
1839
- });
1827
+ navigate(
1828
+ {
1829
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
1830
+ search: rawQuery
1831
+ },
1832
+ { replace: true }
1833
+ );
1840
1834
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1841
1835
  setErrors(formatValidationErrors(res.error));
1842
1836
  }
@@ -2910,7 +2904,14 @@ const formatErrorMessages = (errors, parentKey, formatMessage) => {
2910
2904
  )
2911
2905
  );
2912
2906
  } else {
2913
- messages.push(...formatErrorMessages(value, currentKey, formatMessage));
2907
+ messages.push(
2908
+ ...formatErrorMessages(
2909
+ // @ts-expect-error TODO: check why value is not compatible with FormErrors
2910
+ value,
2911
+ currentKey,
2912
+ formatMessage
2913
+ )
2914
+ );
2914
2915
  }
2915
2916
  } else {
2916
2917
  messages.push(
@@ -3713,9 +3714,18 @@ const index = {
3713
3714
  defaultMessage: "Content Manager"
3714
3715
  },
3715
3716
  permissions: [],
3716
- Component: () => import("./layout-B1Z-9koY.mjs").then((mod) => ({ default: mod.Layout })),
3717
3717
  position: 1
3718
3718
  });
3719
+ app.router.addRoute({
3720
+ path: "content-manager/*",
3721
+ lazy: async () => {
3722
+ const { Layout } = await import("./layout-Bx7svTbY.mjs");
3723
+ return {
3724
+ Component: Layout
3725
+ };
3726
+ },
3727
+ children: routes
3728
+ });
3719
3729
  app.registerPlugin(cm.config);
3720
3730
  },
3721
3731
  async registerTrads({ locales }) {
@@ -3742,14 +3752,13 @@ export {
3742
3752
  BulkActionsRenderer as B,
3743
3753
  COLLECTION_TYPES as C,
3744
3754
  DocumentStatus as D,
3745
- extractContentTypeComponents as E,
3746
- DEFAULT_SETTINGS as F,
3747
- convertEditLayoutToFieldLayouts as G,
3755
+ DEFAULT_SETTINGS as E,
3756
+ convertEditLayoutToFieldLayouts as F,
3757
+ useDocument as G,
3748
3758
  HOOKS as H,
3749
3759
  InjectionZone as I,
3750
- useDocument as J,
3751
- index as K,
3752
- useDocumentActions as L,
3760
+ index as J,
3761
+ useDocumentActions as K,
3753
3762
  Panels as P,
3754
3763
  RelativeTime as R,
3755
3764
  SINGLE_TYPES as S,
@@ -3771,14 +3780,14 @@ export {
3771
3780
  useGetContentTypeConfigurationQuery as o,
3772
3781
  CREATOR_FIELDS as p,
3773
3782
  getMainField as q,
3774
- routes as r,
3783
+ getDisplayName as r,
3775
3784
  setInitialData as s,
3776
- getDisplayName as t,
3785
+ checkIfAttributeIsDisplayable as t,
3777
3786
  useContentTypeSchema as u,
3778
- checkIfAttributeIsDisplayable as v,
3779
- useGetAllDocumentsQuery as w,
3780
- convertListLayoutToFieldLayouts as x,
3781
- capitalise as y,
3782
- useUpdateContentTypeConfigurationMutation as z
3787
+ useGetAllDocumentsQuery as v,
3788
+ convertListLayoutToFieldLayouts as w,
3789
+ capitalise as x,
3790
+ useUpdateContentTypeConfigurationMutation as y,
3791
+ extractContentTypeComponents as z
3783
3792
  };
3784
- //# sourceMappingURL=index-6kKXK7y8.mjs.map
3793
+ //# sourceMappingURL=index-CaE6NG4a.mjs.map