@strapi/content-releases 0.0.0-next.c5f067b5650921187770124e9b6c8186e805e242 → 0.0.0-next.cb00a1799402728de4ecec6d52a815e33fcedaf3

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 (29) hide show
  1. package/dist/_chunks/{App-5PsAyVt2.js → App--3HPsVgM.js} +728 -459
  2. package/dist/_chunks/App--3HPsVgM.js.map +1 -0
  3. package/dist/_chunks/{App-3ycH2d3s.mjs → App-CRNZU_DZ.mjs} +738 -470
  4. package/dist/_chunks/App-CRNZU_DZ.mjs.map +1 -0
  5. package/dist/_chunks/PurchaseContentReleases-3tRbmbY3.mjs +51 -0
  6. package/dist/_chunks/PurchaseContentReleases-3tRbmbY3.mjs.map +1 -0
  7. package/dist/_chunks/PurchaseContentReleases-bpIYXOfu.js +51 -0
  8. package/dist/_chunks/PurchaseContentReleases-bpIYXOfu.js.map +1 -0
  9. package/dist/_chunks/{en-2DuPv5k0.js → en-3SGjiVyR.js} +26 -7
  10. package/dist/_chunks/en-3SGjiVyR.js.map +1 -0
  11. package/dist/_chunks/{en-SOqjCdyh.mjs → en-bpHsnU0n.mjs} +26 -7
  12. package/dist/_chunks/en-bpHsnU0n.mjs.map +1 -0
  13. package/dist/_chunks/{index-4gUWuCQV.mjs → index-_wu9g0yG.mjs} +332 -37
  14. package/dist/_chunks/index-_wu9g0yG.mjs.map +1 -0
  15. package/dist/_chunks/{index-D57Rztnc.js → index-xV3jXcZj.js} +320 -25
  16. package/dist/_chunks/index-xV3jXcZj.js.map +1 -0
  17. package/dist/admin/index.js +1 -1
  18. package/dist/admin/index.mjs +2 -2
  19. package/dist/server/index.js +962 -408
  20. package/dist/server/index.js.map +1 -1
  21. package/dist/server/index.mjs +961 -408
  22. package/dist/server/index.mjs.map +1 -1
  23. package/package.json +15 -12
  24. package/dist/_chunks/App-3ycH2d3s.mjs.map +0 -1
  25. package/dist/_chunks/App-5PsAyVt2.js.map +0 -1
  26. package/dist/_chunks/en-2DuPv5k0.js.map +0 -1
  27. package/dist/_chunks/en-SOqjCdyh.mjs.map +0 -1
  28. package/dist/_chunks/index-4gUWuCQV.mjs.map +0 -1
  29. package/dist/_chunks/index-D57Rztnc.js.map +0 -1
@@ -274,6 +274,19 @@ const releaseApi = react.createApi({
274
274
  { type: "ReleaseAction", id: "LIST" }
275
275
  ]
276
276
  }),
277
+ createManyReleaseActions: build.mutation({
278
+ query({ body, params }) {
279
+ return {
280
+ url: `/content-releases/${params.releaseId}/actions/bulk`,
281
+ method: "POST",
282
+ data: body
283
+ };
284
+ },
285
+ invalidatesTags: [
286
+ { type: "Release", id: "LIST" },
287
+ { type: "ReleaseAction", id: "LIST" }
288
+ ]
289
+ }),
277
290
  updateReleaseAction: build.mutation({
278
291
  query({ body, params }) {
279
292
  return {
@@ -311,8 +324,9 @@ const releaseApi = react.createApi({
311
324
  method: "DELETE"
312
325
  };
313
326
  },
314
- invalidatesTags: [
327
+ invalidatesTags: (result, error, arg) => [
315
328
  { type: "Release", id: "LIST" },
329
+ { type: "Release", id: arg.params.releaseId },
316
330
  { type: "ReleaseAction", id: "LIST" }
317
331
  ]
318
332
  }),
@@ -332,7 +346,7 @@ const releaseApi = react.createApi({
332
346
  method: "DELETE"
333
347
  };
334
348
  },
335
- invalidatesTags: (result, error, arg) => [{ type: "Release", id: arg.id }]
349
+ invalidatesTags: () => [{ type: "Release", id: "LIST" }]
336
350
  })
337
351
  };
338
352
  }
@@ -344,12 +358,29 @@ const {
344
358
  useGetReleaseActionsQuery,
345
359
  useCreateReleaseMutation,
346
360
  useCreateReleaseActionMutation,
361
+ useCreateManyReleaseActionsMutation,
347
362
  useUpdateReleaseMutation,
348
363
  useUpdateReleaseActionMutation,
349
364
  usePublishReleaseMutation,
350
365
  useDeleteReleaseActionMutation,
351
366
  useDeleteReleaseMutation
352
367
  } = releaseApi;
368
+ const getTimezoneOffset = (timezone, date) => {
369
+ try {
370
+ const offsetPart = new Intl.DateTimeFormat("en", {
371
+ timeZone: timezone,
372
+ timeZoneName: "longOffset"
373
+ }).formatToParts(date).find((part) => part.type === "timeZoneName");
374
+ const offset = offsetPart ? offsetPart.value : "";
375
+ let utcOffset = offset.replace("GMT", "UTC");
376
+ if (!utcOffset.includes("+") && !utcOffset.includes("-")) {
377
+ utcOffset = `${utcOffset}+00:00`;
378
+ }
379
+ return utcOffset;
380
+ } catch (error) {
381
+ return "";
382
+ }
383
+ };
353
384
  const useTypedDispatch = reactRedux.useDispatch;
354
385
  const useTypedSelector = reactRedux.useSelector;
355
386
  const StyledMenuItem = styled__default.default(v2.Menu.Item)`
@@ -420,7 +451,7 @@ const DeleteReleaseActionItem = ({ releaseId, actionId }) => {
420
451
  }
421
452
  };
422
453
  return /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: PERMISSIONS.deleteAction, children: /* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { variant: "danger", onSelect: handleDeleteAction, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
423
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { as: icons.Cross, padding: 1 }),
454
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { as: icons.Cross, width: 3, height: 3 }),
424
455
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { textColor: "danger600", variant: "omega", children: formatMessage({
425
456
  id: "content-releases.content-manager-edit-view.remove-from-release",
426
457
  defaultMessage: "Remove from release"
@@ -459,7 +490,7 @@ const ReleaseActionEntryLinkItem = ({
459
490
  pathname: `/content-manager/collection-types/${contentTypeUid}/${entryId}`,
460
491
  search: locale && `?plugins[i18n][locale]=${locale}`
461
492
  },
462
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { as: icons.Pencil, padding: 1 }),
493
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { as: icons.Pencil, width: 3, height: 3 }),
463
494
  children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
464
495
  id: "content-releases.content-manager-edit-view.edit-entry",
465
496
  defaultMessage: "Edit entry"
@@ -469,6 +500,21 @@ const ReleaseActionEntryLinkItem = ({
469
500
  }
470
501
  );
471
502
  };
503
+ const EditReleaseItem = ({ releaseId }) => {
504
+ const { formatMessage } = reactIntl.useIntl();
505
+ return /* @__PURE__ */ jsxRuntime.jsx(StyledMenuItem, { children: /* @__PURE__ */ jsxRuntime.jsx(
506
+ v2.Link,
507
+ {
508
+ href: `/admin/plugins/content-releases/${releaseId}`,
509
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Icon, { as: icons.Pencil, width: 3, height: 3 }),
510
+ isExternal: false,
511
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "omega", children: formatMessage({
512
+ id: "content-releases.content-manager-edit-view.edit-release",
513
+ defaultMessage: "Edit release"
514
+ }) })
515
+ }
516
+ ) });
517
+ };
472
518
  const Root = ({ children, hasTriggerBorder = false }) => {
473
519
  const { formatMessage } = reactIntl.useIntl();
474
520
  return (
@@ -493,6 +539,7 @@ const Root = ({ children, hasTriggerBorder = false }) => {
493
539
  };
494
540
  const ReleaseActionMenu = {
495
541
  Root,
542
+ EditReleaseItem,
496
543
  DeleteReleaseActionItem,
497
544
  ReleaseActionEntryLinkItem
498
545
  };
@@ -516,19 +563,40 @@ const FieldWrapper = styled__default.default(designSystem.Field)`
516
563
  text-transform: capitalize;
517
564
  }
518
565
 
519
- &:active,
520
566
  &[data-checked='true'] {
521
- color: ${({ theme }) => theme.colors.primary700};
522
- background-color: ${({ theme }) => theme.colors.primary100};
523
- border-color: ${({ theme }) => theme.colors.primary700};
567
+ color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
568
+ background-color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary100 : theme.colors.danger100};
569
+ border-color: ${({ theme, actionType }) => actionType === "publish" ? theme.colors.primary700 : theme.colors.danger600};
524
570
  }
525
571
 
526
572
  &[data-checked='false'] {
527
573
  border-left: ${({ actionType }) => actionType === "unpublish" && "none"};
528
574
  border-right: ${({ actionType }) => actionType === "publish" && "none"};
529
575
  }
576
+
577
+ &[data-checked='false'][data-disabled='false']:hover {
578
+ color: ${({ theme }) => theme.colors.neutral700};
579
+ background-color: ${({ theme }) => theme.colors.neutral100};
580
+ border-color: ${({ theme }) => theme.colors.neutral200};
581
+
582
+ & > label {
583
+ cursor: pointer;
584
+ }
585
+ }
586
+
587
+ &[data-disabled='true'] {
588
+ color: ${({ theme }) => theme.colors.neutral600};
589
+ background-color: ${({ theme }) => theme.colors.neutral150};
590
+ border-color: ${({ theme }) => theme.colors.neutral300};
591
+ }
530
592
  `;
531
- const ActionOption = ({ selected, actionType, handleChange, name }) => {
593
+ const ActionOption = ({
594
+ selected,
595
+ actionType,
596
+ handleChange,
597
+ name,
598
+ disabled = false
599
+ }) => {
532
600
  return /* @__PURE__ */ jsxRuntime.jsx(
533
601
  FieldWrapper,
534
602
  {
@@ -539,6 +607,7 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
539
607
  position: "relative",
540
608
  cursor: "pointer",
541
609
  "data-checked": selected === actionType,
610
+ "data-disabled": disabled && selected !== actionType,
542
611
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.FieldLabel, { htmlFor: `${name}-${actionType}`, children: [
543
612
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { children: /* @__PURE__ */ jsxRuntime.jsx(
544
613
  designSystem.FieldInput,
@@ -548,7 +617,8 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
548
617
  name,
549
618
  checked: selected === actionType,
550
619
  onChange: handleChange,
551
- value: actionType
620
+ value: actionType,
621
+ disabled
552
622
  }
553
623
  ) }),
554
624
  actionType
@@ -556,7 +626,12 @@ const ActionOption = ({ selected, actionType, handleChange, name }) => {
556
626
  }
557
627
  );
558
628
  };
559
- const ReleaseActionOptions = ({ selected, handleChange, name }) => {
629
+ const ReleaseActionOptions = ({
630
+ selected,
631
+ handleChange,
632
+ name,
633
+ disabled = false
634
+ }) => {
560
635
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
561
636
  /* @__PURE__ */ jsxRuntime.jsx(
562
637
  ActionOption,
@@ -564,7 +639,8 @@ const ReleaseActionOptions = ({ selected, handleChange, name }) => {
564
639
  actionType: "publish",
565
640
  selected,
566
641
  handleChange,
567
- name
642
+ name,
643
+ disabled
568
644
  }
569
645
  ),
570
646
  /* @__PURE__ */ jsxRuntime.jsx(
@@ -573,7 +649,8 @@ const ReleaseActionOptions = ({ selected, handleChange, name }) => {
573
649
  actionType: "unpublish",
574
650
  selected,
575
651
  handleChange,
576
- name
652
+ name,
653
+ disabled
577
654
  }
578
655
  )
579
656
  ] });
@@ -617,6 +694,7 @@ const AddActionToReleaseModal = ({
617
694
  contentTypeUid,
618
695
  entryId
619
696
  }) => {
697
+ const releaseHeaderId = React__namespace.useId();
620
698
  const { formatMessage } = reactIntl.useIntl();
621
699
  const toggleNotification = helperPlugin.useNotification();
622
700
  const { formatAPIError } = helperPlugin.useAPIErrorHandler();
@@ -664,8 +742,8 @@ const AddActionToReleaseModal = ({
664
742
  }
665
743
  }
666
744
  };
667
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { onClose: handleClose, labelledBy: "title", children: [
668
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: "title", fontWeight: "bold", textColor: "neutral800", children: formatMessage({
745
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.ModalLayout, { onClose: handleClose, labelledBy: releaseHeaderId, children: [
746
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalHeader, { children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { id: releaseHeaderId, fontWeight: "bold", textColor: "neutral800", children: formatMessage({
669
747
  id: "content-releases.content-manager-edit-view.add-to-release",
670
748
  defaultMessage: "Add to release"
671
749
  }) }) }),
@@ -735,7 +813,7 @@ const AddActionToReleaseModal = ({
735
813
  };
736
814
  const CMReleasesContainer = () => {
737
815
  const [isModalOpen, setIsModalOpen] = React__namespace.useState(false);
738
- const { formatMessage } = reactIntl.useIntl();
816
+ const { formatMessage, formatDate, formatTime } = reactIntl.useIntl();
739
817
  const {
740
818
  isCreatingEntry,
741
819
  hasDraftAndPublish,
@@ -821,15 +899,40 @@ const CMReleasesContainer = () => {
821
899
  )
822
900
  }
823
901
  ),
824
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 3, width: "100%", alignItems: "flex-start", children: [
902
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { padding: 4, direction: "column", gap: 2, width: "100%", alignItems: "flex-start", children: [
825
903
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { fontSize: 2, fontWeight: "bold", variant: "omega", textColor: "neutral700", children: release.name }),
826
- /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: PERMISSIONS.deleteAction, children: /* @__PURE__ */ jsxRuntime.jsx(ReleaseActionMenu.Root, { hasTriggerBorder: true, children: /* @__PURE__ */ jsxRuntime.jsx(
827
- ReleaseActionMenu.DeleteReleaseActionItem,
904
+ release.scheduledAt && release.timezone && /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: formatMessage(
905
+ {
906
+ id: "content-releases.content-manager-edit-view.scheduled.date",
907
+ defaultMessage: "{date} at {time} ({offset})"
908
+ },
828
909
  {
829
- releaseId: release.id,
830
- actionId: release.action.id
910
+ date: formatDate(new Date(release.scheduledAt), {
911
+ day: "2-digit",
912
+ month: "2-digit",
913
+ year: "numeric",
914
+ timeZone: release.timezone
915
+ }),
916
+ time: formatTime(new Date(release.scheduledAt), {
917
+ hourCycle: "h23",
918
+ timeZone: release.timezone
919
+ }),
920
+ offset: getTimezoneOffset(
921
+ release.timezone,
922
+ new Date(release.scheduledAt)
923
+ )
831
924
  }
832
- ) }) })
925
+ ) }),
926
+ /* @__PURE__ */ jsxRuntime.jsx(helperPlugin.CheckPermissions, { permissions: PERMISSIONS.deleteAction, children: /* @__PURE__ */ jsxRuntime.jsxs(ReleaseActionMenu.Root, { hasTriggerBorder: true, children: [
927
+ /* @__PURE__ */ jsxRuntime.jsx(ReleaseActionMenu.EditReleaseItem, { releaseId: release.id }),
928
+ /* @__PURE__ */ jsxRuntime.jsx(
929
+ ReleaseActionMenu.DeleteReleaseActionItem,
930
+ {
931
+ releaseId: release.id,
932
+ actionId: release.action.id
933
+ }
934
+ )
935
+ ] }) })
833
936
  ] })
834
937
  ]
835
938
  },
@@ -865,9 +968,181 @@ const CMReleasesContainer = () => {
865
968
  }
866
969
  ) });
867
970
  };
971
+ const getContentPermissions = (subject) => {
972
+ const permissions = {
973
+ publish: [
974
+ {
975
+ action: "plugin::content-manager.explorer.publish",
976
+ subject,
977
+ id: "",
978
+ actionParameters: {},
979
+ properties: {},
980
+ conditions: []
981
+ }
982
+ ]
983
+ };
984
+ return permissions;
985
+ };
986
+ const ReleaseAction = ({ ids, model }) => {
987
+ const { formatMessage } = reactIntl.useIntl();
988
+ const toggleNotification = helperPlugin.useNotification();
989
+ const { formatAPIError } = helperPlugin.useAPIErrorHandler();
990
+ const { modifiedData } = helperPlugin.useCMEditViewDataManager();
991
+ const contentPermissions = getContentPermissions(model);
992
+ const {
993
+ allowedActions: { canPublish }
994
+ } = helperPlugin.useRBAC(contentPermissions);
995
+ const {
996
+ allowedActions: { canCreate }
997
+ } = helperPlugin.useRBAC(PERMISSIONS);
998
+ const response = useGetReleasesQuery();
999
+ const releases = response.data?.data;
1000
+ const [createManyReleaseActions, { isLoading }] = useCreateManyReleaseActionsMutation();
1001
+ const handleSubmit = async (values) => {
1002
+ const locale = modifiedData.locale;
1003
+ const releaseActionEntries = ids.map((id) => ({
1004
+ type: values.type,
1005
+ entry: {
1006
+ contentType: model,
1007
+ id,
1008
+ locale
1009
+ }
1010
+ }));
1011
+ const response2 = await createManyReleaseActions({
1012
+ body: releaseActionEntries,
1013
+ params: { releaseId: values.releaseId }
1014
+ });
1015
+ if ("data" in response2) {
1016
+ const notificationMessage = formatMessage(
1017
+ {
1018
+ id: "content-releases.content-manager-list-view.add-to-release.notification.success.message",
1019
+ defaultMessage: "{entriesAlreadyInRelease} out of {totalEntries} entries were already in the release."
1020
+ },
1021
+ {
1022
+ entriesAlreadyInRelease: response2.data.meta.entriesAlreadyInRelease,
1023
+ totalEntries: response2.data.meta.totalEntries
1024
+ }
1025
+ );
1026
+ const notification = {
1027
+ type: "success",
1028
+ title: formatMessage(
1029
+ {
1030
+ id: "content-releases.content-manager-list-view.add-to-release.notification.success.title",
1031
+ defaultMessage: "Successfully added to release."
1032
+ },
1033
+ {
1034
+ entriesAlreadyInRelease: response2.data.meta.entriesAlreadyInRelease,
1035
+ totalEntries: response2.data.meta.totalEntries
1036
+ }
1037
+ ),
1038
+ message: response2.data.meta.entriesAlreadyInRelease ? notificationMessage : ""
1039
+ };
1040
+ toggleNotification(notification);
1041
+ return true;
1042
+ }
1043
+ if ("error" in response2) {
1044
+ if (axios.isAxiosError(response2.error)) {
1045
+ toggleNotification({
1046
+ type: "warning",
1047
+ message: formatAPIError(response2.error)
1048
+ });
1049
+ } else {
1050
+ toggleNotification({
1051
+ type: "warning",
1052
+ message: formatMessage({ id: "notification.error", defaultMessage: "An error occurred" })
1053
+ });
1054
+ }
1055
+ }
1056
+ };
1057
+ if (!canCreate || !canPublish)
1058
+ return null;
1059
+ return {
1060
+ actionType: "release",
1061
+ variant: "tertiary",
1062
+ label: formatMessage({
1063
+ id: "content-manager-list-view.add-to-release",
1064
+ defaultMessage: "Add to Release"
1065
+ }),
1066
+ dialog: {
1067
+ type: "modal",
1068
+ title: formatMessage({
1069
+ id: "content-manager-list-view.add-to-release",
1070
+ defaultMessage: "Add to Release"
1071
+ }),
1072
+ content: ({ onClose }) => {
1073
+ return /* @__PURE__ */ jsxRuntime.jsx(
1074
+ formik.Formik,
1075
+ {
1076
+ onSubmit: async (values) => {
1077
+ const data = await handleSubmit(values);
1078
+ if (data) {
1079
+ return onClose();
1080
+ }
1081
+ },
1082
+ validationSchema: RELEASE_ACTION_FORM_SCHEMA,
1083
+ initialValues: INITIAL_VALUES,
1084
+ children: ({ values, setFieldValue }) => /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
1085
+ releases?.length === 0 ? /* @__PURE__ */ jsxRuntime.jsx(NoReleases, {}) : /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 2, children: [
1086
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { paddingBottom: 6, children: /* @__PURE__ */ jsxRuntime.jsx(
1087
+ designSystem.SingleSelect,
1088
+ {
1089
+ required: true,
1090
+ label: formatMessage({
1091
+ id: "content-releases.content-manager-list-view.add-to-release.select-label",
1092
+ defaultMessage: "Select a release"
1093
+ }),
1094
+ placeholder: formatMessage({
1095
+ id: "content-releases.content-manager-list-view.add-to-release.select-placeholder",
1096
+ defaultMessage: "Select"
1097
+ }),
1098
+ onChange: (value) => setFieldValue("releaseId", value),
1099
+ value: values.releaseId,
1100
+ children: releases?.map((release) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.SingleSelectOption, { value: release.id, children: release.name }, release.id))
1101
+ }
1102
+ ) }),
1103
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.FieldLabel, { children: formatMessage({
1104
+ id: "content-releases.content-manager-list-view.add-to-release.action-type-label",
1105
+ defaultMessage: "What do you want to do with these entries?"
1106
+ }) }),
1107
+ /* @__PURE__ */ jsxRuntime.jsx(
1108
+ ReleaseActionOptions,
1109
+ {
1110
+ selected: values.type,
1111
+ handleChange: (e) => setFieldValue("type", e.target.value),
1112
+ name: "type"
1113
+ }
1114
+ )
1115
+ ] }) }),
1116
+ /* @__PURE__ */ jsxRuntime.jsx(
1117
+ designSystem.ModalFooter,
1118
+ {
1119
+ startActions: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { onClick: onClose, variant: "tertiary", name: "cancel", children: formatMessage({
1120
+ id: "content-releases.content-manager-list-view.add-to-release.cancel-button",
1121
+ defaultMessage: "Cancel"
1122
+ }) }),
1123
+ endActions: (
1124
+ /**
1125
+ * TODO: Ideally we would use isValid from Formik to disable the button, however currently it always returns true
1126
+ * for yup.string().required(), even when the value is falsy (including empty string)
1127
+ */
1128
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Button, { type: "submit", disabled: !values.releaseId, loading: isLoading, children: formatMessage({
1129
+ id: "content-releases.content-manager-list-view.add-to-release.continue-button",
1130
+ defaultMessage: "Continue"
1131
+ }) })
1132
+ )
1133
+ }
1134
+ )
1135
+ ] })
1136
+ }
1137
+ );
1138
+ }
1139
+ }
1140
+ };
1141
+ };
868
1142
  const admin = {
869
1143
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
870
1144
  register(app) {
1145
+ app.createHook("ContentReleases/pages/ReleaseDetails/add-locale-in-releases");
871
1146
  if (window.strapi.features.isEnabled("cms-content-releases")) {
872
1147
  app.addMenuLink({
873
1148
  to: `/plugins/${pluginId}`,
@@ -877,7 +1152,7 @@ const admin = {
877
1152
  defaultMessage: "Releases"
878
1153
  },
879
1154
  async Component() {
880
- const { App } = await Promise.resolve().then(() => require("./App-5PsAyVt2.js"));
1155
+ const { App } = await Promise.resolve().then(() => require("./App--3HPsVgM.js"));
881
1156
  return App;
882
1157
  },
883
1158
  permissions: PERMISSIONS.main
@@ -890,12 +1165,31 @@ const admin = {
890
1165
  name: `${pluginId}-link`,
891
1166
  Component: CMReleasesContainer
892
1167
  });
1168
+ app.plugins["content-manager"].apis.addBulkAction((actions) => {
1169
+ const deleteActionIndex = actions.findIndex((action) => action.name === "DeleteAction");
1170
+ actions.splice(deleteActionIndex, 0, ReleaseAction);
1171
+ return actions;
1172
+ });
1173
+ } else if (!window.strapi.features.isEnabled("cms-content-releases") && window.strapi?.flags?.promoteEE) {
1174
+ app.addMenuLink({
1175
+ to: `/plugins/purchase-content-releases`,
1176
+ icon: icons.PaperPlane,
1177
+ intlLabel: {
1178
+ id: `${pluginId}.plugin.name`,
1179
+ defaultMessage: "Releases"
1180
+ },
1181
+ async Component() {
1182
+ const { PurchaseContentReleases } = await Promise.resolve().then(() => require("./PurchaseContentReleases-bpIYXOfu.js"));
1183
+ return PurchaseContentReleases;
1184
+ },
1185
+ lockIcon: true
1186
+ });
893
1187
  }
894
1188
  },
895
1189
  async registerTrads({ locales }) {
896
1190
  const importedTrads = await Promise.all(
897
1191
  locales.map((locale) => {
898
- return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-2DuPv5k0.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
1192
+ return __variableDynamicImportRuntimeHelper(/* @__PURE__ */ Object.assign({ "./translations/en.json": () => Promise.resolve().then(() => require("./en-3SGjiVyR.js")) }), `./translations/${locale}.json`).then(({ default: data }) => {
899
1193
  return {
900
1194
  data: helperPlugin.prefixPluginTranslations(data, "content-releases"),
901
1195
  locale
@@ -915,6 +1209,7 @@ exports.PERMISSIONS = PERMISSIONS;
915
1209
  exports.ReleaseActionMenu = ReleaseActionMenu;
916
1210
  exports.ReleaseActionOptions = ReleaseActionOptions;
917
1211
  exports.admin = admin;
1212
+ exports.getTimezoneOffset = getTimezoneOffset;
918
1213
  exports.isAxiosError = isAxiosError;
919
1214
  exports.pluginId = pluginId;
920
1215
  exports.releaseApi = releaseApi;
@@ -927,4 +1222,4 @@ exports.usePublishReleaseMutation = usePublishReleaseMutation;
927
1222
  exports.useTypedDispatch = useTypedDispatch;
928
1223
  exports.useUpdateReleaseActionMutation = useUpdateReleaseActionMutation;
929
1224
  exports.useUpdateReleaseMutation = useUpdateReleaseMutation;
930
- //# sourceMappingURL=index-D57Rztnc.js.map
1225
+ //# sourceMappingURL=index-xV3jXcZj.js.map