@strapi/content-releases 5.0.0-beta.6 → 5.0.0-beta.7

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.
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const jsxRuntime = require("react/jsx-runtime");
4
4
  const strapiAdmin = require("@strapi/admin/strapi-admin");
5
5
  const reactRouterDom = require("react-router-dom");
6
- const index = require("./index-Bwn36oqx.js");
6
+ const index = require("./index-B6Y2hJ10.js");
7
7
  const React = require("react");
8
8
  const strapiAdmin$1 = require("@strapi/content-manager/strapi-admin");
9
9
  const designSystem = require("@strapi/design-system");
@@ -12,7 +12,7 @@ const symbols = require("@strapi/icons/symbols");
12
12
  const format = require("date-fns/format");
13
13
  const dateFnsTz = require("date-fns-tz");
14
14
  const reactIntl = require("react-intl");
15
- const styled = require("styled-components");
15
+ const styledComponents = require("styled-components");
16
16
  const dateFns = require("date-fns");
17
17
  const formik = require("formik");
18
18
  const yup = require("yup");
@@ -39,7 +39,6 @@ function _interopNamespace(e) {
39
39
  }
40
40
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
41
41
  const format__default = /* @__PURE__ */ _interopDefault(format);
42
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
43
42
  const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
44
43
  const intervals = ["years", "months", "days", "hours", "minutes", "seconds"];
45
44
  const RelativeTime$1 = React__namespace.forwardRef(
@@ -142,20 +141,14 @@ const ReleaseModal = ({
142
141
  validateOnChange: false,
143
142
  children: ({ values, errors, handleChange, setFieldValue }) => /* @__PURE__ */ jsxRuntime.jsxs(formik.Form, { children: [
144
143
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.ModalBody, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "stretch", gap: 6, children: [
145
- /* @__PURE__ */ jsxRuntime.jsx(
146
- designSystem.TextInput,
147
- {
148
- label: formatMessage({
149
- id: "content-releases.modal.form.input.label.release-name",
150
- defaultMessage: "Name"
151
- }),
152
- name: "name",
153
- value: values.name,
154
- error: errors.name,
155
- onChange: handleChange,
156
- required: true
157
- }
158
- ),
144
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "name", error: errors.name, required: true, children: [
145
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
146
+ id: "content-releases.modal.form.input.label.release-name",
147
+ defaultMessage: "Name"
148
+ }) }),
149
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.TextInput, { value: values.name, onChange: handleChange }),
150
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
151
+ ] }),
159
152
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "max-content", children: /* @__PURE__ */ jsxRuntime.jsx(
160
153
  designSystem.Checkbox,
161
154
  {
@@ -188,54 +181,54 @@ const ReleaseModal = ({
188
181
  ) }),
189
182
  values.isScheduled && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
190
183
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 4, alignItems: "start", children: [
191
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
192
- designSystem.DatePicker,
193
- {
194
- label: formatMessage({
195
- id: "content-releases.modal.form.input.label.date",
196
- defaultMessage: "Date"
197
- }),
198
- name: "date",
199
- error: errors.date,
200
- onChange: (date) => {
201
- const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
202
- setFieldValue("date", isoFormatDate);
203
- },
204
- clearLabel: formatMessage({
205
- id: "content-releases.modal.form.input.clearLabel",
206
- defaultMessage: "Clear"
207
- }),
208
- onClear: () => {
209
- setFieldValue("date", null);
210
- },
211
- selectedDate: values.date || void 0,
212
- required: true,
213
- minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
214
- }
215
- ) }),
216
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsx(
217
- designSystem.TimePicker,
218
- {
219
- label: formatMessage({
220
- id: "content-releases.modal.form.input.label.time",
221
- defaultMessage: "Time"
222
- }),
223
- name: "time",
224
- error: errors.time,
225
- onChange: (time) => {
226
- setFieldValue("time", time);
227
- },
228
- clearLabel: formatMessage({
229
- id: "content-releases.modal.form.input.clearLabel",
230
- defaultMessage: "Clear"
231
- }),
232
- onClear: () => {
233
- setFieldValue("time", "");
234
- },
235
- value: values.time || void 0,
236
- required: true
237
- }
238
- ) })
184
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "date", error: errors.date, required: true, children: [
185
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
186
+ id: "content-releases.modal.form.input.label.date",
187
+ defaultMessage: "Date"
188
+ }) }),
189
+ /* @__PURE__ */ jsxRuntime.jsx(
190
+ designSystem.DatePicker,
191
+ {
192
+ onChange: (date) => {
193
+ const isoFormatDate = date ? dateFns.formatISO(date, { representation: "date" }) : null;
194
+ setFieldValue("date", isoFormatDate);
195
+ },
196
+ clearLabel: formatMessage({
197
+ id: "content-releases.modal.form.input.clearLabel",
198
+ defaultMessage: "Clear"
199
+ }),
200
+ onClear: () => {
201
+ setFieldValue("date", null);
202
+ },
203
+ selectedDate: values.date || void 0,
204
+ minDate: dateFnsTz.utcToZonedTime(/* @__PURE__ */ new Date(), values.timezone.split("&")[1])
205
+ }
206
+ ),
207
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
208
+ ] }) }),
209
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { width: "100%", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "time", error: errors.time, required: true, children: [
210
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
211
+ id: "content-releases.modal.form.input.label.time",
212
+ defaultMessage: "Time"
213
+ }) }),
214
+ /* @__PURE__ */ jsxRuntime.jsx(
215
+ designSystem.TimePicker,
216
+ {
217
+ onChange: (time) => {
218
+ setFieldValue("time", time);
219
+ },
220
+ clearLabel: formatMessage({
221
+ id: "content-releases.modal.form.input.clearLabel",
222
+ defaultMessage: "Clear"
223
+ }),
224
+ onClear: () => {
225
+ setFieldValue("time", "");
226
+ },
227
+ value: values.time || void 0
228
+ }
229
+ ),
230
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
231
+ ] }) })
239
232
  ] }),
240
233
  /* @__PURE__ */ jsxRuntime.jsx(TimezoneComponent, { timezoneOptions: timezoneList })
241
234
  ] })
@@ -282,37 +275,37 @@ const TimezoneComponent = ({ timezoneOptions }) => {
282
275
  }
283
276
  }
284
277
  }, [setFieldValue, values.date, values.timezone]);
285
- return /* @__PURE__ */ jsxRuntime.jsx(
286
- designSystem.Combobox,
287
- {
288
- label: formatMessage({
289
- id: "content-releases.modal.form.input.label.timezone",
290
- defaultMessage: "Timezone"
291
- }),
292
- autocomplete: { type: "list", filter: "contains" },
293
- name: "timezone",
294
- value: values.timezone || void 0,
295
- textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
296
- onChange: (timezone) => {
297
- setFieldValue("timezone", timezone);
298
- },
299
- onTextValueChange: (timezone) => {
300
- setFieldValue("timezone", timezone);
301
- },
302
- onClear: () => {
303
- setFieldValue("timezone", "");
304
- },
305
- error: errors.timezone,
306
- required: true,
307
- children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
308
- }
309
- );
278
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { name: "timezone", error: errors.timezone, required: true, children: [
279
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
280
+ id: "content-releases.modal.form.input.label.timezone",
281
+ defaultMessage: "Timezone"
282
+ }) }),
283
+ /* @__PURE__ */ jsxRuntime.jsx(
284
+ designSystem.Combobox,
285
+ {
286
+ autocomplete: { type: "list", filter: "contains" },
287
+ value: values.timezone || void 0,
288
+ textValue: values.timezone ? values.timezone.replace(/&/, " ") : void 0,
289
+ onChange: (timezone) => {
290
+ setFieldValue("timezone", timezone);
291
+ },
292
+ onTextValueChange: (timezone) => {
293
+ setFieldValue("timezone", timezone);
294
+ },
295
+ onClear: () => {
296
+ setFieldValue("timezone", "");
297
+ },
298
+ children: timezoneList.map((timezone) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.ComboboxOption, { value: timezone.value, children: timezone.value.replace(/&/, " ") }, timezone.value))
299
+ }
300
+ ),
301
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
302
+ ] });
310
303
  };
311
304
  const useTypedDispatch = reactRedux.useDispatch;
312
- const LinkCard = styled__default.default(designSystem.Link)`
305
+ const LinkCard = styledComponents.styled(designSystem.Link)`
313
306
  display: block;
314
307
  `;
315
- const RelativeTime = styled__default.default(RelativeTime$1)`
308
+ const RelativeTime = styledComponents.styled(RelativeTime$1)`
316
309
  display: inline-block;
317
310
  &::first-letter {
318
311
  text-transform: uppercase;
@@ -380,7 +373,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
380
373
  gap: 4,
381
374
  children: [
382
375
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { direction: "column", alignItems: "start", gap: 1, children: [
383
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "h3", variant: "delta", fontWeight: "bold", children: name }),
376
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "h3", variant: "delta", fontWeight: "bold", children: name }),
384
377
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", textColor: "neutral600", children: scheduledAt ? /* @__PURE__ */ jsxRuntime.jsx(RelativeTime, { timestamp: new Date(scheduledAt) }) : formatMessage({
385
378
  id: "content-releases.pages.Releases.not-scheduled",
386
379
  defaultMessage: "Not scheduled"
@@ -391,7 +384,7 @@ const ReleasesGrid = ({ sectionTitle, releases = [], isError = false }) => {
391
384
  }
392
385
  ) }) }, id)) });
393
386
  };
394
- const StyledAlert = styled__default.default(designSystem.Alert)`
387
+ const StyledAlert = styledComponents.styled(designSystem.Alert)`
395
388
  button {
396
389
  display: none;
397
390
  }
@@ -484,7 +477,7 @@ const ReleasesPage = () => {
484
477
  });
485
478
  trackUsage("didCreateRelease");
486
479
  navigate(response2.data.data.id.toString());
487
- } else if (index.isAxiosError(response2.error)) {
480
+ } else if (strapiAdmin.isFetchError(response2.error)) {
488
481
  toggleNotification({
489
482
  type: "danger",
490
483
  message: formatAPIError(response2.error)
@@ -498,7 +491,7 @@ const ReleasesPage = () => {
498
491
  };
499
492
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoading, children: [
500
493
  /* @__PURE__ */ jsxRuntime.jsx(
501
- designSystem.HeaderLayout,
494
+ strapiAdmin.Layouts.Header,
502
495
  {
503
496
  title: formatMessage({
504
497
  id: "content-releases.pages.Releases.title",
@@ -522,7 +515,7 @@ const ReleasesPage = () => {
522
515
  ) : null
523
516
  }
524
517
  ),
525
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
518
+ /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
526
519
  hasReachedMaximumPendingReleases && /* @__PURE__ */ jsxRuntime.jsx(
527
520
  StyledAlert,
528
521
  {
@@ -621,13 +614,13 @@ const ReleasesPage = () => {
621
614
  )
622
615
  ] });
623
616
  };
624
- const ReleaseInfoWrapper = styled__default.default(designSystem.Flex)`
617
+ const ReleaseInfoWrapper = styledComponents.styled(designSystem.Flex)`
625
618
  align-self: stretch;
626
619
  border-bottom-right-radius: ${({ theme }) => theme.borderRadius};
627
620
  border-bottom-left-radius: ${({ theme }) => theme.borderRadius};
628
621
  border-top: 1px solid ${({ theme }) => theme.colors.neutral150};
629
622
  `;
630
- const StyledMenuItem = styled__default.default(designSystem.Menu.Item)`
623
+ const StyledMenuItem = styledComponents.styled(designSystem.Menu.Item)`
631
624
  svg path {
632
625
  fill: ${({ theme, disabled }) => disabled && theme.colors.neutral500};
633
626
  }
@@ -636,24 +629,24 @@ const StyledMenuItem = styled__default.default(designSystem.Menu.Item)`
636
629
  }
637
630
 
638
631
  &:hover {
639
- background: ${({ theme, variant = "neutral" }) => theme.colors[`${variant}100`]};
632
+ background: ${({ theme, $variant = "neutral" }) => theme.colors[`${$variant}100`]};
640
633
  }
641
634
  `;
642
- const PencilIcon = styled__default.default(icons.Pencil)`
635
+ const PencilIcon = styledComponents.styled(icons.Pencil)`
643
636
  width: ${({ theme }) => theme.spaces[3]};
644
637
  height: ${({ theme }) => theme.spaces[3]};
645
638
  path {
646
639
  fill: ${({ theme }) => theme.colors.neutral600};
647
640
  }
648
641
  `;
649
- const TrashIcon = styled__default.default(icons.Trash)`
642
+ const TrashIcon = styledComponents.styled(icons.Trash)`
650
643
  width: ${({ theme }) => theme.spaces[3]};
651
644
  height: ${({ theme }) => theme.spaces[3]};
652
645
  path {
653
646
  fill: ${({ theme }) => theme.colors.danger600};
654
647
  }
655
648
  `;
656
- const TypographyMaxWidth = styled__default.default(designSystem.Typography)`
649
+ const TypographyMaxWidth = styledComponents.styled(designSystem.Typography)`
657
650
  max-width: 300px;
658
651
  `;
659
652
  const EntryValidationText = ({ action, schema, entry }) => {
@@ -745,7 +738,7 @@ const ReleaseDetailsLayout = ({
745
738
  totalPublishedEntries,
746
739
  totalUnpublishedEntries
747
740
  });
748
- } else if (index.isAxiosError(response.error)) {
741
+ } else if (strapiAdmin.isFetchError(response.error)) {
749
742
  toggleNotification({
750
743
  type: "danger",
751
744
  message: formatAPIError(response.error)
@@ -827,7 +820,7 @@ const ReleaseDetailsLayout = ({
827
820
  ) : "";
828
821
  return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Main, { "aria-busy": isLoadingDetails, children: [
829
822
  /* @__PURE__ */ jsxRuntime.jsx(
830
- designSystem.HeaderLayout,
823
+ strapiAdmin.Layouts.Header,
831
824
  {
832
825
  title: release.name,
833
826
  subtitle: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, lineHeight: 6, children: [
@@ -840,7 +833,7 @@ const ReleaseDetailsLayout = ({
840
833
  /* @__PURE__ */ jsxRuntime.jsx(
841
834
  designSystem.Menu.Trigger,
842
835
  {
843
- as: designSystem.IconButton,
836
+ tag: designSystem.IconButton,
844
837
  paddingLeft: 2,
845
838
  paddingRight: 2,
846
839
  "aria-label": formatMessage({
@@ -873,7 +866,7 @@ const ReleaseDetailsLayout = ({
873
866
  {
874
867
  disabled: !canDelete,
875
868
  onSelect: toggleWarningSubmit,
876
- variant: "danger",
869
+ $variant: "danger",
877
870
  children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "center", gap: 2, hasRadius: true, width: "100%", children: [
878
871
  /* @__PURE__ */ jsxRuntime.jsx(TrashIcon, {}),
879
872
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { ellipsis: true, textColor: "danger600", children: formatMessage({
@@ -1014,7 +1007,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
1014
1007
  // We are passing the action path to found the position in the cache of the action for optimistic updates
1015
1008
  });
1016
1009
  if ("error" in response) {
1017
- if (index.isAxiosError(response.error)) {
1010
+ if (strapiAdmin.isFetchError(response.error)) {
1018
1011
  toggleNotification({
1019
1012
  type: "danger",
1020
1013
  message: formatAPIError(response.error)
@@ -1060,13 +1053,13 @@ const ReleaseDetailsBody = ({ releaseId }) => {
1060
1053
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Error, {});
1061
1054
  }
1062
1055
  if (Object.keys(releaseActions).length === 0) {
1063
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsx(
1056
+ return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsx(
1064
1057
  designSystem.EmptyStateLayout,
1065
1058
  {
1066
1059
  action: /* @__PURE__ */ jsxRuntime.jsx(
1067
1060
  designSystem.LinkButton,
1068
1061
  {
1069
- as: reactRouterDom.Link,
1062
+ tag: reactRouterDom.Link,
1070
1063
  to: {
1071
1064
  pathname: "/content-manager"
1072
1065
  },
@@ -1124,7 +1117,7 @@ const ReleaseDetailsBody = ({ releaseId }) => {
1124
1117
  ] : []
1125
1118
  ];
1126
1119
  const options = hasI18nEnabled ? GROUP_BY_OPTIONS : GROUP_BY_OPTIONS_NO_LOCALE;
1127
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.ContentLayout, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
1120
+ return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Layouts.Content, { children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 8, direction: "column", alignItems: "stretch", children: [
1128
1121
  /* @__PURE__ */ jsxRuntime.jsx(designSystem.Flex, { children: /* @__PURE__ */ jsxRuntime.jsx(
1129
1122
  designSystem.SingleSelect,
1130
1123
  {
@@ -1287,7 +1280,7 @@ const ReleaseDetailsPage = () => {
1287
1280
  })
1288
1281
  });
1289
1282
  toggleEditReleaseModal();
1290
- } else if (index.isAxiosError(response.error)) {
1283
+ } else if (strapiAdmin.isFetchError(response.error)) {
1291
1284
  toggleNotification({
1292
1285
  type: "danger",
1293
1286
  message: formatAPIError(response.error)
@@ -1305,7 +1298,7 @@ const ReleaseDetailsPage = () => {
1305
1298
  });
1306
1299
  if ("data" in response) {
1307
1300
  navigate("..");
1308
- } else if (index.isAxiosError(response.error)) {
1301
+ } else if (strapiAdmin.isFetchError(response.error)) {
1309
1302
  toggleNotification({
1310
1303
  type: "danger",
1311
1304
  message: formatAPIError(response.error)
@@ -1363,4 +1356,4 @@ const App = () => {
1363
1356
  ] }) });
1364
1357
  };
1365
1358
  exports.App = App;
1366
- //# sourceMappingURL=App-CbOy9Yd2.js.map
1359
+ //# sourceMappingURL=App-BdcItFff.js.map