@strapi/content-manager 0.0.0-experimental.25e22c6cc9bc6b35392bb55d09f641a0a65e7403 → 0.0.0-experimental.2a7cb5ff33df35e8ccde5ef918f9f9a4a3ee9a08

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 (76) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js → ComponentConfigurationPage-BvHtG7uH.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-WRPUXGd6.js.map → ComponentConfigurationPage-BvHtG7uH.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs → ComponentConfigurationPage-DHNM3YBz.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-gdUj_t-O.mjs.map → ComponentConfigurationPage-DHNM3YBz.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs → EditConfigurationPage-Cp6HAEzN.mjs} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-BwuIPOJG.mjs.map → EditConfigurationPage-Cp6HAEzN.mjs.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js → EditConfigurationPage-DOmfCEMo.js} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-C1vjMBgy.js.map → EditConfigurationPage-DOmfCEMo.js.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-DbcGfyqK.js → EditViewPage-BqNpC6hO.js} +3 -3
  10. package/dist/_chunks/{EditViewPage-DbcGfyqK.js.map → EditViewPage-BqNpC6hO.js.map} +1 -1
  11. package/dist/_chunks/{EditViewPage-0MiFkXa8.mjs → EditViewPage-BtkEx339.mjs} +3 -3
  12. package/dist/_chunks/{EditViewPage-0MiFkXa8.mjs.map → EditViewPage-BtkEx339.mjs.map} +1 -1
  13. package/dist/_chunks/{Field-BDMSCcy5.mjs → Field-R5NbffTB.mjs} +273 -6
  14. package/dist/_chunks/Field-R5NbffTB.mjs.map +1 -0
  15. package/dist/_chunks/{Field-BG1xu38N.js → Field-lsPFnAmH.js} +272 -5
  16. package/dist/_chunks/Field-lsPFnAmH.js.map +1 -0
  17. package/dist/_chunks/{Form-CPVWavB8.mjs → Form-BHmXSfyy.mjs} +6 -3
  18. package/dist/_chunks/Form-BHmXSfyy.mjs.map +1 -0
  19. package/dist/_chunks/{Form-9BnFyUjy.js → Form-CcGboku8.js} +6 -3
  20. package/dist/_chunks/Form-CcGboku8.js.map +1 -0
  21. package/dist/_chunks/{History-BWWxLt2Z.js → History-Bsud8jwh.js} +20 -5
  22. package/dist/_chunks/{History-BWWxLt2Z.js.map → History-Bsud8jwh.js.map} +1 -1
  23. package/dist/_chunks/{History-BVpd8LP3.mjs → History-ByUPL3T3.mjs} +20 -5
  24. package/dist/_chunks/{History-BVpd8LP3.mjs.map → History-ByUPL3T3.mjs.map} +1 -1
  25. package/dist/_chunks/{ListConfigurationPage-DozVMKcR.mjs → ListConfigurationPage-Bm5HACXf.mjs} +2 -2
  26. package/dist/_chunks/{ListConfigurationPage-DozVMKcR.mjs.map → ListConfigurationPage-Bm5HACXf.mjs.map} +1 -1
  27. package/dist/_chunks/{ListConfigurationPage-6swzjdAZ.js → ListConfigurationPage-DiT463qx.js} +2 -2
  28. package/dist/_chunks/{ListConfigurationPage-6swzjdAZ.js.map → ListConfigurationPage-DiT463qx.js.map} +1 -1
  29. package/dist/_chunks/{ListViewPage-BlzfjS2Q.js → ListViewPage-CsrC9L_d.js} +15 -6
  30. package/dist/_chunks/ListViewPage-CsrC9L_d.js.map +1 -0
  31. package/dist/_chunks/{ListViewPage-Ds0ulgfG.mjs → ListViewPage-JSyNAAYu.mjs} +15 -6
  32. package/dist/_chunks/ListViewPage-JSyNAAYu.mjs.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js → NoContentTypePage-Bsvng4II.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-D2nCCWEl.js.map → NoContentTypePage-Bsvng4II.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs → NoContentTypePage-CsrQUpBE.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-BH11kaKt.mjs.map → NoContentTypePage-CsrQUpBE.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js → NoPermissionsPage-CdHNJtEf.js} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-DN_JlsU2.js.map → NoPermissionsPage-CdHNJtEf.js.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs → NoPermissionsPage-DNmf_pj0.mjs} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-BT2Tn0D_.mjs.map → NoPermissionsPage-DNmf_pj0.mjs.map} +1 -1
  41. package/dist/_chunks/{Relations-CcgFTcWo.js → Relations-CghaPv2D.js} +3 -3
  42. package/dist/_chunks/{Relations-CcgFTcWo.js.map → Relations-CghaPv2D.js.map} +1 -1
  43. package/dist/_chunks/{Relations-Dnag3fhV.mjs → Relations-u8-37jK0.mjs} +3 -3
  44. package/dist/_chunks/{Relations-Dnag3fhV.mjs.map → Relations-u8-37jK0.mjs.map} +1 -1
  45. package/dist/_chunks/{index-CWpLBSt0.js → index-BOZx6IMg.js} +55 -21
  46. package/dist/_chunks/index-BOZx6IMg.js.map +1 -0
  47. package/dist/_chunks/{index-JNNNKUHs.mjs → index-CaE6NG4a.mjs} +68 -34
  48. package/dist/_chunks/index-CaE6NG4a.mjs.map +1 -0
  49. package/dist/_chunks/{layout-DC503LnF.mjs → layout-Bx7svTbY.mjs} +7 -7
  50. package/dist/_chunks/layout-Bx7svTbY.mjs.map +1 -0
  51. package/dist/_chunks/{layout--iHdZzRk.js → layout-Ciz224q5.js} +6 -6
  52. package/dist/_chunks/layout-Ciz224q5.js.map +1 -0
  53. package/dist/_chunks/{relations-BbHizA5K.js → relations-CP8sB2YZ.js} +2 -2
  54. package/dist/_chunks/{relations-BbHizA5K.js.map → relations-CP8sB2YZ.js.map} +1 -1
  55. package/dist/_chunks/{relations-CTje5t-a.mjs → relations-Cxc1cEv3.mjs} +2 -2
  56. package/dist/_chunks/{relations-CTje5t-a.mjs.map → relations-Cxc1cEv3.mjs.map} +1 -1
  57. package/dist/admin/index.js +1 -1
  58. package/dist/admin/index.mjs +4 -4
  59. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  60. package/dist/server/index.js +8 -6
  61. package/dist/server/index.js.map +1 -1
  62. package/dist/server/index.mjs +8 -6
  63. package/dist/server/index.mjs.map +1 -1
  64. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  65. package/dist/server/src/history/services/utils.d.ts.map +1 -1
  66. package/package.json +8 -8
  67. package/dist/_chunks/Field-BDMSCcy5.mjs.map +0 -1
  68. package/dist/_chunks/Field-BG1xu38N.js.map +0 -1
  69. package/dist/_chunks/Form-9BnFyUjy.js.map +0 -1
  70. package/dist/_chunks/Form-CPVWavB8.mjs.map +0 -1
  71. package/dist/_chunks/ListViewPage-BlzfjS2Q.js.map +0 -1
  72. package/dist/_chunks/ListViewPage-Ds0ulgfG.mjs.map +0 -1
  73. package/dist/_chunks/index-CWpLBSt0.js.map +0 -1
  74. package/dist/_chunks/index-JNNNKUHs.mjs.map +0 -1
  75. package/dist/_chunks/layout--iHdZzRk.js.map +0 -1
  76. package/dist/_chunks/layout-DC503LnF.mjs.map +0 -1
@@ -219,6 +219,7 @@ const contentManagerApi = strapiAdmin.adminApi.enhanceEndpoints({
219
219
  ]
220
220
  });
221
221
  const documentApi = contentManagerApi.injectEndpoints({
222
+ overrideExisting: true,
222
223
  endpoints: (builder) => ({
223
224
  autoCloneDocument: builder.mutation({
224
225
  query: ({ model, sourceId, query }) => ({
@@ -620,7 +621,7 @@ const createAttributeSchema = (attribute) => {
620
621
  }
621
622
  };
622
623
  const addRequiredValidation = (attribute) => (schema) => {
623
- if (attribute.required) {
624
+ if (attribute.required && attribute.type !== "relation") {
624
625
  return schema.required({
625
626
  id: strapiAdmin.translatedErrors.required.id,
626
627
  defaultMessage: "This field is required."
@@ -784,7 +785,10 @@ const useDocument = (args, opts) => {
784
785
  isLoading: isLoadingDocument,
785
786
  isFetching: isFetchingDocument,
786
787
  error
787
- } = useGetDocumentQuery(args, opts);
788
+ } = useGetDocumentQuery(args, {
789
+ ...opts,
790
+ skip: !args.documentId && args.collectionType !== SINGLE_TYPES || opts?.skip
791
+ });
788
792
  const { components, schema, isLoading: isLoadingSchema } = useContentTypeSchema(args.model);
789
793
  React__namespace.useEffect(() => {
790
794
  if (error) {
@@ -1286,7 +1290,7 @@ const useDocumentActions = () => {
1286
1290
  };
1287
1291
  };
1288
1292
  const ProtectedHistoryPage = React.lazy(
1289
- () => Promise.resolve().then(() => require("./History-BWWxLt2Z.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1293
+ () => Promise.resolve().then(() => require("./History-Bsud8jwh.js")).then((mod) => ({ default: mod.ProtectedHistoryPage }))
1290
1294
  );
1291
1295
  const routes$1 = [
1292
1296
  {
@@ -1299,31 +1303,31 @@ const routes$1 = [
1299
1303
  }
1300
1304
  ];
1301
1305
  const ProtectedEditViewPage = React.lazy(
1302
- () => Promise.resolve().then(() => require("./EditViewPage-DbcGfyqK.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1306
+ () => Promise.resolve().then(() => require("./EditViewPage-BqNpC6hO.js")).then((mod) => ({ default: mod.ProtectedEditViewPage }))
1303
1307
  );
1304
1308
  const ProtectedListViewPage = React.lazy(
1305
- () => Promise.resolve().then(() => require("./ListViewPage-BlzfjS2Q.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1309
+ () => Promise.resolve().then(() => require("./ListViewPage-CsrC9L_d.js")).then((mod) => ({ default: mod.ProtectedListViewPage }))
1306
1310
  );
1307
1311
  const ProtectedListConfiguration = React.lazy(
1308
- () => Promise.resolve().then(() => require("./ListConfigurationPage-6swzjdAZ.js")).then((mod) => ({
1312
+ () => Promise.resolve().then(() => require("./ListConfigurationPage-DiT463qx.js")).then((mod) => ({
1309
1313
  default: mod.ProtectedListConfiguration
1310
1314
  }))
1311
1315
  );
1312
1316
  const ProtectedEditConfigurationPage = React.lazy(
1313
- () => Promise.resolve().then(() => require("./EditConfigurationPage-C1vjMBgy.js")).then((mod) => ({
1317
+ () => Promise.resolve().then(() => require("./EditConfigurationPage-DOmfCEMo.js")).then((mod) => ({
1314
1318
  default: mod.ProtectedEditConfigurationPage
1315
1319
  }))
1316
1320
  );
1317
1321
  const ProtectedComponentConfigurationPage = React.lazy(
1318
- () => Promise.resolve().then(() => require("./ComponentConfigurationPage-WRPUXGd6.js")).then((mod) => ({
1322
+ () => Promise.resolve().then(() => require("./ComponentConfigurationPage-BvHtG7uH.js")).then((mod) => ({
1319
1323
  default: mod.ProtectedComponentConfigurationPage
1320
1324
  }))
1321
1325
  );
1322
1326
  const NoPermissions = React.lazy(
1323
- () => Promise.resolve().then(() => require("./NoPermissionsPage-DN_JlsU2.js")).then((mod) => ({ default: mod.NoPermissions }))
1327
+ () => Promise.resolve().then(() => require("./NoPermissionsPage-CdHNJtEf.js")).then((mod) => ({ default: mod.NoPermissions }))
1324
1328
  );
1325
1329
  const NoContentType = React.lazy(
1326
- () => Promise.resolve().then(() => require("./NoContentTypePage-D2nCCWEl.js")).then((mod) => ({ default: mod.NoContentType }))
1330
+ () => Promise.resolve().then(() => require("./NoContentTypePage-Bsvng4II.js")).then((mod) => ({ default: mod.NoContentType }))
1327
1331
  );
1328
1332
  const CollectionTypePages = () => {
1329
1333
  const { collectionType } = reactRouterDom.useParams();
@@ -1530,7 +1534,7 @@ const DocumentActionsMenu = ({
1530
1534
  display: "block",
1531
1535
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { justifyContent: "space-between", gap: 4, children: [
1532
1536
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { color: convertActionVariantToColor(action.variant), gap: 2, tag: "span", children: [
1533
- action.icon,
1537
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { tag: "span", color: convertActionVariantToIconColor(action.variant), children: action.icon }),
1534
1538
  action.label
1535
1539
  ] }),
1536
1540
  action.id.startsWith("HistoryAction") && /* @__PURE__ */ jsxRuntime.jsx(
@@ -1591,6 +1595,18 @@ const convertActionVariantToColor = (variant = "secondary") => {
1591
1595
  return "primary600";
1592
1596
  }
1593
1597
  };
1598
+ const convertActionVariantToIconColor = (variant = "secondary") => {
1599
+ switch (variant) {
1600
+ case "danger":
1601
+ return "danger600";
1602
+ case "secondary":
1603
+ return "neutral500";
1604
+ case "success":
1605
+ return "success600";
1606
+ default:
1607
+ return "primary600";
1608
+ }
1609
+ };
1594
1610
  const DocumentActionConfirmDialog = ({
1595
1611
  onClose,
1596
1612
  onCancel,
@@ -1644,8 +1660,8 @@ const DocumentActionModal = ({
1644
1660
  };
1645
1661
  return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Root, { open: isOpen, onOpenChange: handleClose, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Modal.Content, { children: [
1646
1662
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Header, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Title, { children: title }) }),
1647
- typeof Content === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Content, { onClose: handleClose }) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: Content }),
1648
- typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer
1663
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Body, { children: typeof Content === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Content, { onClose: handleClose }) : Content }),
1664
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Modal.Footer, { children: typeof Footer === "function" ? /* @__PURE__ */ jsxRuntime.jsx(Footer, { onClose: handleClose }) : Footer })
1649
1665
  ] }) });
1650
1666
  };
1651
1667
  const PublishAction$1 = ({
@@ -1829,10 +1845,13 @@ const UpdateAction = ({
1829
1845
  document
1830
1846
  );
1831
1847
  if ("data" in res && collectionType !== SINGLE_TYPES) {
1832
- navigate({
1833
- pathname: `../${collectionType}/${model}/${res.data.documentId}`,
1834
- search: rawQuery
1835
- });
1848
+ navigate(
1849
+ {
1850
+ pathname: `../${collectionType}/${model}/${res.data.documentId}`,
1851
+ search: rawQuery
1852
+ },
1853
+ { replace: true }
1854
+ );
1836
1855
  } else if ("error" in res && isBaseQueryError(res.error) && res.error.name === "ValidationError") {
1837
1856
  setErrors(formatValidationErrors(res.error));
1838
1857
  }
@@ -2906,7 +2925,14 @@ const formatErrorMessages = (errors, parentKey, formatMessage) => {
2906
2925
  )
2907
2926
  );
2908
2927
  } else {
2909
- messages.push(...formatErrorMessages(value, currentKey, formatMessage));
2928
+ messages.push(
2929
+ ...formatErrorMessages(
2930
+ // @ts-expect-error TODO: check why value is not compatible with FormErrors
2931
+ value,
2932
+ currentKey,
2933
+ formatMessage
2934
+ )
2935
+ );
2910
2936
  }
2911
2937
  } else {
2912
2938
  messages.push(
@@ -3709,9 +3735,18 @@ const index = {
3709
3735
  defaultMessage: "Content Manager"
3710
3736
  },
3711
3737
  permissions: [],
3712
- Component: () => Promise.resolve().then(() => require("./layout--iHdZzRk.js")).then((mod) => ({ default: mod.Layout })),
3713
3738
  position: 1
3714
3739
  });
3740
+ app.router.addRoute({
3741
+ path: "content-manager/*",
3742
+ lazy: async () => {
3743
+ const { Layout } = await Promise.resolve().then(() => require("./layout-Ciz224q5.js"));
3744
+ return {
3745
+ Component: Layout
3746
+ };
3747
+ },
3748
+ children: routes
3749
+ });
3715
3750
  app.registerPlugin(cm.config);
3716
3751
  },
3717
3752
  async registerTrads({ locales }) {
@@ -3761,7 +3796,6 @@ exports.getDisplayName = getDisplayName;
3761
3796
  exports.getMainField = getMainField;
3762
3797
  exports.getTranslation = getTranslation;
3763
3798
  exports.index = index;
3764
- exports.routes = routes;
3765
3799
  exports.setInitialData = setInitialData;
3766
3800
  exports.useContentTypeSchema = useContentTypeSchema;
3767
3801
  exports.useDoc = useDoc;
@@ -3775,4 +3809,4 @@ exports.useGetAllDocumentsQuery = useGetAllDocumentsQuery;
3775
3809
  exports.useGetContentTypeConfigurationQuery = useGetContentTypeConfigurationQuery;
3776
3810
  exports.useGetInitialDataQuery = useGetInitialDataQuery;
3777
3811
  exports.useUpdateContentTypeConfigurationMutation = useUpdateContentTypeConfigurationMutation;
3778
- //# sourceMappingURL=index-CWpLBSt0.js.map
3812
+ //# sourceMappingURL=index-BOZx6IMg.js.map