@strapi/content-manager 0.0.0-experimental.baa6cf22298e591b4d52d8e59c60406d7a9f137f → 0.0.0-experimental.d53e940834bf72ddc725f1d2fd36dac9abec30cb

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 (93) hide show
  1. package/dist/_chunks/{ComponentConfigurationPage-DiigqkCf.js → ComponentConfigurationPage-C-49MccQ.js} +3 -3
  2. package/dist/_chunks/{ComponentConfigurationPage-DiigqkCf.js.map → ComponentConfigurationPage-C-49MccQ.js.map} +1 -1
  3. package/dist/_chunks/{ComponentConfigurationPage-CYqQv0ne.mjs → ComponentConfigurationPage-DmwmiFQy.mjs} +3 -3
  4. package/dist/_chunks/{ComponentConfigurationPage-CYqQv0ne.mjs.map → ComponentConfigurationPage-DmwmiFQy.mjs.map} +1 -1
  5. package/dist/_chunks/{EditConfigurationPage-BeeGw2RI.js → EditConfigurationPage-DjFJw56M.js} +3 -3
  6. package/dist/_chunks/{EditConfigurationPage-BeeGw2RI.js.map → EditConfigurationPage-DjFJw56M.js.map} +1 -1
  7. package/dist/_chunks/{EditConfigurationPage-BArY-b8_.mjs → EditConfigurationPage-JT3E7NZy.mjs} +3 -3
  8. package/dist/_chunks/{EditConfigurationPage-BArY-b8_.mjs.map → EditConfigurationPage-JT3E7NZy.mjs.map} +1 -1
  9. package/dist/_chunks/{EditViewPage-B8ETGsFo.mjs → EditViewPage-CPj61RMh.mjs} +46 -46
  10. package/dist/_chunks/EditViewPage-CPj61RMh.mjs.map +1 -0
  11. package/dist/_chunks/{EditViewPage-DZPDqo_G.js → EditViewPage-zT3fBr4Y.js} +45 -45
  12. package/dist/_chunks/EditViewPage-zT3fBr4Y.js.map +1 -0
  13. package/dist/_chunks/{Field-DnJMS8cB.js → Field-Boxf9Ajp.js} +372 -117
  14. package/dist/_chunks/Field-Boxf9Ajp.js.map +1 -0
  15. package/dist/_chunks/{Field-Dn4ThnFB.mjs → Field-dha5VnIQ.mjs} +373 -118
  16. package/dist/_chunks/Field-dha5VnIQ.mjs.map +1 -0
  17. package/dist/_chunks/{Form-DY721B6y.mjs → Form-DHrru2AV.mjs} +27 -28
  18. package/dist/_chunks/Form-DHrru2AV.mjs.map +1 -0
  19. package/dist/_chunks/{Form-DiTmWq2k.js → Form-y5g1SRsh.js} +25 -26
  20. package/dist/_chunks/Form-y5g1SRsh.js.map +1 -0
  21. package/dist/_chunks/{History-CwWN_uNp.mjs → History-Bru_KoeP.mjs} +101 -22
  22. package/dist/_chunks/History-Bru_KoeP.mjs.map +1 -0
  23. package/dist/_chunks/{History-DShoVAh0.js → History-CqN6K7SX.js} +100 -21
  24. package/dist/_chunks/History-CqN6K7SX.js.map +1 -0
  25. package/dist/_chunks/{ListConfigurationPage-D062TiTL.mjs → ListConfigurationPage-D8wGABj0.mjs} +43 -45
  26. package/dist/_chunks/ListConfigurationPage-D8wGABj0.mjs.map +1 -0
  27. package/dist/_chunks/{ListConfigurationPage-COIRGF5b.js → ListConfigurationPage-R_p-SbHZ.js} +42 -43
  28. package/dist/_chunks/ListConfigurationPage-R_p-SbHZ.js.map +1 -0
  29. package/dist/_chunks/{ListViewPage-BeHTsIr5.mjs → ListViewPage-SID6TRb9.mjs} +62 -67
  30. package/dist/_chunks/ListViewPage-SID6TRb9.mjs.map +1 -0
  31. package/dist/_chunks/{ListViewPage-CFuXPZ_r.js → ListViewPage-pEw_zug9.js} +60 -65
  32. package/dist/_chunks/ListViewPage-pEw_zug9.js.map +1 -0
  33. package/dist/_chunks/{NoContentTypePage-rdH0Zp0A.js → NoContentTypePage-C5dcQojD.js} +2 -2
  34. package/dist/_chunks/{NoContentTypePage-rdH0Zp0A.js.map → NoContentTypePage-C5dcQojD.js.map} +1 -1
  35. package/dist/_chunks/{NoContentTypePage-B_KLijrG.mjs → NoContentTypePage-CJ7UXwrQ.mjs} +2 -2
  36. package/dist/_chunks/{NoContentTypePage-B_KLijrG.mjs.map → NoContentTypePage-CJ7UXwrQ.mjs.map} +1 -1
  37. package/dist/_chunks/{NoPermissionsPage-BPU-v48V.mjs → NoPermissionsPage-B7syEq5E.mjs} +2 -2
  38. package/dist/_chunks/{NoPermissionsPage-BPU-v48V.mjs.map → NoPermissionsPage-B7syEq5E.mjs.map} +1 -1
  39. package/dist/_chunks/{NoPermissionsPage-D8gbX1Y_.js → NoPermissionsPage-BtPrImPP.js} +2 -2
  40. package/dist/_chunks/{NoPermissionsPage-D8gbX1Y_.js.map → NoPermissionsPage-BtPrImPP.js.map} +1 -1
  41. package/dist/_chunks/{Relations-Bbz90ZWv.mjs → Relations-B9Crnhnn.mjs} +3 -3
  42. package/dist/_chunks/{Relations-Bbz90ZWv.mjs.map → Relations-B9Crnhnn.mjs.map} +1 -1
  43. package/dist/_chunks/{Relations-wHyjWWT5.js → Relations-DjTQ5kGB.js} +3 -3
  44. package/dist/_chunks/{Relations-wHyjWWT5.js.map → Relations-DjTQ5kGB.js.map} +1 -1
  45. package/dist/_chunks/{en-Dzv55oQw.mjs → en-Ux26r5pl.mjs} +4 -1
  46. package/dist/_chunks/{en-Dzv55oQw.mjs.map → en-Ux26r5pl.mjs.map} +1 -1
  47. package/dist/_chunks/{en-BN1bvFK7.js → en-fbKQxLGn.js} +4 -1
  48. package/dist/_chunks/{en-BN1bvFK7.js.map → en-fbKQxLGn.js.map} +1 -1
  49. package/dist/_chunks/{index-Dv4oDn11.mjs → index-DJXJw9V5.mjs} +172 -314
  50. package/dist/_chunks/index-DJXJw9V5.mjs.map +1 -0
  51. package/dist/_chunks/{index-BRHpg0az.js → index-DVPWZkbS.js} +143 -285
  52. package/dist/_chunks/index-DVPWZkbS.js.map +1 -0
  53. package/dist/_chunks/{layout-hInnLBbA.mjs → layout-Bau7ZfLV.mjs} +19 -14
  54. package/dist/_chunks/layout-Bau7ZfLV.mjs.map +1 -0
  55. package/dist/_chunks/{layout-pZc2Q3bK.js → layout-Dm6fbiQj.js} +18 -13
  56. package/dist/_chunks/layout-Dm6fbiQj.js.map +1 -0
  57. package/dist/_chunks/{relations-BcPI8XhI.mjs → relations-BH_kBSJ0.mjs} +2 -2
  58. package/dist/_chunks/{relations-BcPI8XhI.mjs.map → relations-BH_kBSJ0.mjs.map} +1 -1
  59. package/dist/_chunks/{relations-CVE30dYt.js → relations-CKnpRgrN.js} +2 -2
  60. package/dist/_chunks/{relations-CVE30dYt.js.map → relations-CKnpRgrN.js.map} +1 -1
  61. package/dist/admin/index.js +1 -1
  62. package/dist/admin/index.mjs +8 -8
  63. package/dist/admin/src/history/components/VersionInputRenderer.d.ts +1 -1
  64. package/dist/admin/src/pages/EditView/components/DocumentActions.d.ts +7 -3
  65. package/dist/admin/src/pages/EditView/components/FormInputs/BlocksInput/utils/constants.d.ts +4 -0
  66. package/dist/admin/src/pages/EditView/components/FormInputs/Wysiwyg/WysiwygStyles.d.ts +2 -10
  67. package/dist/admin/src/pages/ListView/components/BulkActions/Actions.d.ts +3 -30
  68. package/dist/admin/src/pages/ListView/components/BulkActions/ConfirmBulkActionDialog.d.ts +2 -2
  69. package/dist/server/index.js +20 -15
  70. package/dist/server/index.js.map +1 -1
  71. package/dist/server/index.mjs +20 -15
  72. package/dist/server/index.mjs.map +1 -1
  73. package/dist/server/src/controllers/collection-types.d.ts.map +1 -1
  74. package/dist/server/src/controllers/single-types.d.ts.map +1 -1
  75. package/dist/server/src/history/services/lifecycles.d.ts.map +1 -1
  76. package/dist/server/src/services/utils/populate.d.ts.map +1 -1
  77. package/package.json +8 -8
  78. package/dist/_chunks/EditViewPage-B8ETGsFo.mjs.map +0 -1
  79. package/dist/_chunks/EditViewPage-DZPDqo_G.js.map +0 -1
  80. package/dist/_chunks/Field-Dn4ThnFB.mjs.map +0 -1
  81. package/dist/_chunks/Field-DnJMS8cB.js.map +0 -1
  82. package/dist/_chunks/Form-DY721B6y.mjs.map +0 -1
  83. package/dist/_chunks/Form-DiTmWq2k.js.map +0 -1
  84. package/dist/_chunks/History-CwWN_uNp.mjs.map +0 -1
  85. package/dist/_chunks/History-DShoVAh0.js.map +0 -1
  86. package/dist/_chunks/ListConfigurationPage-COIRGF5b.js.map +0 -1
  87. package/dist/_chunks/ListConfigurationPage-D062TiTL.mjs.map +0 -1
  88. package/dist/_chunks/ListViewPage-BeHTsIr5.mjs.map +0 -1
  89. package/dist/_chunks/ListViewPage-CFuXPZ_r.js.map +0 -1
  90. package/dist/_chunks/index-BRHpg0az.js.map +0 -1
  91. package/dist/_chunks/index-Dv4oDn11.mjs.map +0 -1
  92. package/dist/_chunks/layout-hInnLBbA.mjs.map +0 -1
  93. package/dist/_chunks/layout-pZc2Q3bK.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import * as React from 'react';
2
- import { NotificationConfig } from '@strapi/admin/strapi-admin';
2
+ import { ButtonProps } from '@strapi/design-system';
3
+ import { DialogOptions, ModalOptions, NotificationOptions } from '../../../EditView/components/DocumentActions';
3
4
  import type { BulkActionComponent } from '../../../../content-manager';
4
5
  interface BulkActionDescription {
5
6
  dialog?: DialogOptions | NotificationOptions | ModalOptions;
@@ -14,35 +15,7 @@ interface BulkActionDescription {
14
15
  /**
15
16
  * @default 'secondary'
16
17
  */
17
- variant?: 'default' | 'secondary' | 'tertiary' | 'danger-light' | 'success';
18
- }
19
- interface DialogOptions {
20
- type: 'dialog';
21
- title: string;
22
- content?: React.ReactNode;
23
- onConfirm?: () => void | Promise<void>;
24
- onCancel?: () => void | Promise<void>;
25
- }
26
- interface NotificationOptions {
27
- type: 'notification';
28
- title: string;
29
- link?: {
30
- label: string;
31
- url: string;
32
- target?: string;
33
- };
34
- content?: string;
35
- onClose?: () => void;
36
- status?: NotificationConfig['type'];
37
- timeout?: number;
38
- }
39
- interface ModalOptions {
40
- type: 'modal';
41
- title: string;
42
- content: React.ComponentType<{
43
- onClose: () => void;
44
- }>;
45
- onClose?: () => void;
18
+ variant?: ButtonProps['variant'];
46
19
  }
47
20
  declare const BulkActionsRenderer: () => import("react/jsx-runtime").JSX.Element;
48
21
  declare const Emphasis: (chunks: React.ReactNode) => import("react/jsx-runtime").JSX.Element;
@@ -1,6 +1,6 @@
1
1
  import * as React from 'react';
2
- import { DialogFooterProps } from '@strapi/design-system';
3
- interface ConfirmBulkActionDialogProps extends Pick<DialogFooterProps, 'endAction'> {
2
+ interface ConfirmBulkActionDialogProps {
3
+ endAction: React.ReactNode;
4
4
  onToggleDialog: () => void;
5
5
  isOpen?: boolean;
6
6
  dialogBody: React.ReactNode;
@@ -495,8 +495,6 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
495
495
  deleteExpiredJob: null,
496
496
  isInitialized: false
497
497
  };
498
- const query = strapi2.db.query(HISTORY_VERSION_UID);
499
- const historyService = getService(strapi2, "history");
500
498
  const serviceUtils = createServiceUtils({ strapi: strapi2 });
501
499
  return {
502
500
  async bootstrap() {
@@ -507,7 +505,10 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
507
505
  if (!strapi2.requestContext.get()?.request.url.startsWith("/content-manager")) {
508
506
  return next();
509
507
  }
510
- if (context.action !== "create" && context.action !== "update" && context.action !== "publish" && context.action !== "unpublish" && context.action !== "discardDraft") {
508
+ if (context.action !== "create" && context.action !== "update" && context.action !== "clone" && context.action !== "publish" && context.action !== "unpublish" && context.action !== "discardDraft") {
509
+ return next();
510
+ }
511
+ if (context.action === "update" && strapi2.requestContext.get()?.request.url.endsWith("/actions/publish")) {
511
512
  return next();
512
513
  }
513
514
  const contentTypeUid = context.contentType.uid;
@@ -515,7 +516,10 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
515
516
  return next();
516
517
  }
517
518
  const result = await next();
518
- const documentContext = context.action === "create" ? { documentId: result.documentId, locale: context.params?.locale } : { documentId: context.params.documentId, locale: context.params?.locale };
519
+ const documentContext = {
520
+ documentId: context.action === "create" || context.action === "clone" ? result.documentId : context.params.documentId,
521
+ locale: context.params?.locale
522
+ };
519
523
  const defaultLocale = await serviceUtils.getDefaultLocale();
520
524
  const locale = documentContext.locale || defaultLocale;
521
525
  if (Array.isArray(locale)) {
@@ -546,7 +550,7 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
546
550
  }, {});
547
551
  await strapi2.db.transaction(async ({ onCommit }) => {
548
552
  onCommit(() => {
549
- historyService.createVersion({
553
+ getService(strapi2, "history").createVersion({
550
554
  contentType: contentTypeUid,
551
555
  data: fp.omit(FIELDS_TO_IGNORE, document),
552
556
  schema: fp.omit(FIELDS_TO_IGNORE, attributesSchema),
@@ -559,11 +563,10 @@ const createLifecyclesService = ({ strapi: strapi2 }) => {
559
563
  });
560
564
  return result;
561
565
  });
562
- const retentionDays = serviceUtils.getRetentionDays();
563
566
  state.deleteExpiredJob = nodeSchedule.scheduleJob("0 0 * * *", () => {
564
- const retentionDaysInMilliseconds = retentionDays * 24 * 60 * 60 * 1e3;
567
+ const retentionDaysInMilliseconds = serviceUtils.getRetentionDays() * 24 * 60 * 60 * 1e3;
565
568
  const expirationDate = new Date(Date.now() - retentionDaysInMilliseconds);
566
- query.deleteMany({
569
+ strapi2.db.query(HISTORY_VERSION_UID).deleteMany({
567
570
  where: {
568
571
  created_at: {
569
572
  $lt: expirationDate.toISOString()
@@ -3755,22 +3758,24 @@ const getDeepPopulateDraftCount = (uid2) => {
3755
3758
  attribute.component
3756
3759
  );
3757
3760
  if (childHasRelations) {
3758
- populateAcc[attributeName] = { populate: populate2 };
3761
+ populateAcc[attributeName] = {
3762
+ populate: populate2
3763
+ };
3759
3764
  hasRelations = true;
3760
3765
  }
3761
3766
  break;
3762
3767
  }
3763
3768
  case "dynamiczone": {
3764
- const dzPopulate = (attribute.components || []).reduce((acc, componentUID) => {
3765
- const { populate: populate2, hasRelations: childHasRelations } = getDeepPopulateDraftCount(componentUID);
3766
- if (childHasRelations) {
3769
+ const dzPopulateFragment = attribute.components?.reduce((acc, componentUID) => {
3770
+ const { populate: componentPopulate, hasRelations: componentHasRelations } = getDeepPopulateDraftCount(componentUID);
3771
+ if (componentHasRelations) {
3767
3772
  hasRelations = true;
3768
- return fp.merge(acc, populate2);
3773
+ return { ...acc, [componentUID]: { populate: componentPopulate } };
3769
3774
  }
3770
3775
  return acc;
3771
3776
  }, {});
3772
- if (!fp.isEmpty(dzPopulate)) {
3773
- populateAcc[attributeName] = { populate: dzPopulate };
3777
+ if (!fp.isEmpty(dzPopulateFragment)) {
3778
+ populateAcc[attributeName] = { on: dzPopulateFragment };
3774
3779
  }
3775
3780
  break;
3776
3781
  }