@strapi/review-workflows 5.0.0-beta.5 → 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.
Files changed (44) hide show
  1. package/dist/_chunks/{Layout-dGg4FA1R.js → Layout-60gjGInX.js} +8 -10
  2. package/dist/_chunks/Layout-60gjGInX.js.map +1 -0
  3. package/dist/_chunks/{Layout-facLKucY.mjs → Layout-CJYuYwXO.mjs} +10 -10
  4. package/dist/_chunks/Layout-CJYuYwXO.mjs.map +1 -0
  5. package/dist/_chunks/{_id-B6DgrtpA.js → _id-BO7wNLt1.js} +210 -242
  6. package/dist/_chunks/_id-BO7wNLt1.js.map +1 -0
  7. package/dist/_chunks/{_id-D4CXKOqG.mjs → _id-UJ-8gken.mjs} +198 -228
  8. package/dist/_chunks/_id-UJ-8gken.mjs.map +1 -0
  9. package/dist/_chunks/{index-DX8AGcIP.js → index-CfiZnfhM.js} +83 -69
  10. package/dist/_chunks/index-CfiZnfhM.js.map +1 -0
  11. package/dist/_chunks/{index-QbWLXdZR.mjs → index-DhEhUlv9.mjs} +15 -21
  12. package/dist/_chunks/index-DhEhUlv9.mjs.map +1 -0
  13. package/dist/_chunks/{index-D7Y0ofdg.mjs → index-DmQNXb0P.mjs} +83 -67
  14. package/dist/_chunks/index-DmQNXb0P.mjs.map +1 -0
  15. package/dist/_chunks/{index-BuKZWpJw.js → index-DnXnsrOM.js} +16 -24
  16. package/dist/_chunks/index-DnXnsrOM.js.map +1 -0
  17. package/dist/_chunks/{purchase-review-workflows-B-V0sA2I.mjs → purchase-review-workflows-BN-5Ube7.mjs} +8 -7
  18. package/dist/_chunks/purchase-review-workflows-BN-5Ube7.mjs.map +1 -0
  19. package/dist/_chunks/{purchase-review-workflows-Ds61D_tk.js → purchase-review-workflows-DlCDg0fD.js} +7 -6
  20. package/dist/_chunks/purchase-review-workflows-DlCDg0fD.js.map +1 -0
  21. package/dist/_chunks/{router-CL62NScV.js → router-BiQI7EcM.js} +3 -3
  22. package/dist/_chunks/{router-CL62NScV.js.map → router-BiQI7EcM.js.map} +1 -1
  23. package/dist/_chunks/{router-ylD0eA48.mjs → router-DFD0S0ey.mjs} +3 -3
  24. package/dist/_chunks/{router-ylD0eA48.mjs.map → router-DFD0S0ey.mjs.map} +1 -1
  25. package/dist/admin/index.js +1 -1
  26. package/dist/admin/index.mjs +1 -1
  27. package/dist/admin/src/routes/content-manager/[model]/[id]/components/Panel.d.ts +1 -1
  28. package/dist/admin/src/routes/settings/hooks/useDragAndDrop.d.ts +4 -4
  29. package/dist/admin/src/routes/settings/hooks/useKeyboardDragAndDrop.d.ts +1 -1
  30. package/dist/admin/src/routes/settings/hooks/useReviewWorkflows.d.ts +3 -3
  31. package/dist/admin/src/services/content-manager.d.ts +1 -1
  32. package/dist/admin/src/utils/api.d.ts +8 -9
  33. package/dist/admin/src/utils/cm-hooks.d.ts +1 -1
  34. package/package.json +11 -12
  35. package/dist/_chunks/Layout-dGg4FA1R.js.map +0 -1
  36. package/dist/_chunks/Layout-facLKucY.mjs.map +0 -1
  37. package/dist/_chunks/_id-B6DgrtpA.js.map +0 -1
  38. package/dist/_chunks/_id-D4CXKOqG.mjs.map +0 -1
  39. package/dist/_chunks/index-BuKZWpJw.js.map +0 -1
  40. package/dist/_chunks/index-D7Y0ofdg.mjs.map +0 -1
  41. package/dist/_chunks/index-DX8AGcIP.js.map +0 -1
  42. package/dist/_chunks/index-QbWLXdZR.mjs.map +0 -1
  43. package/dist/_chunks/purchase-review-workflows-B-V0sA2I.mjs.map +0 -1
  44. package/dist/_chunks/purchase-review-workflows-Ds61D_tk.js.map +0 -1
@@ -11,13 +11,11 @@ const reactIntl = require("react-intl");
11
11
  const reactRedux = require("react-redux");
12
12
  const reactRouterDom = require("react-router-dom");
13
13
  const yup = require("yup");
14
- const index = require("./index-DX8AGcIP.js");
15
- const Layout = require("./Layout-dGg4FA1R.js");
16
- const v2 = require("@strapi/design-system/v2");
14
+ const index = require("./index-CfiZnfhM.js");
15
+ const Layout = require("./Layout-60gjGInX.js");
17
16
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
18
- const styled = require("styled-components");
17
+ const styledComponents = require("styled-components");
19
18
  const reactDnd = require("react-dnd");
20
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
21
19
  function _interopNamespace(e) {
22
20
  if (e && e.__esModule)
23
21
  return e;
@@ -38,7 +36,6 @@ function _interopNamespace(e) {
38
36
  }
39
37
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
40
38
  const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
41
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
42
39
  const adminApi = index.reviewWorkflowsApi.injectEndpoints({
43
40
  endpoints(builder) {
44
41
  return {
@@ -273,7 +270,7 @@ const AddStage = ({ children, ...props }) => {
273
270
  return /* @__PURE__ */ jsxRuntime.jsx(
274
271
  StyledButton,
275
272
  {
276
- as: "button",
273
+ tag: "button",
277
274
  background: "neutral0",
278
275
  border: "neutral150",
279
276
  paddingBottom: 3,
@@ -282,62 +279,23 @@ const AddStage = ({ children, ...props }) => {
282
279
  paddingTop: 3,
283
280
  shadow: "filterShadow",
284
281
  ...props,
285
- children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { gap: 2, children: [
286
- /* @__PURE__ */ jsxRuntime.jsx(StyledAddIcon, { "aria-hidden": true }),
287
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "neutral500", children })
288
- ] })
282
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
283
+ /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircle, { width: "2.4rem", height: "2.4rem", "aria-hidden": true }),
284
+ children
285
+ ] }) })
289
286
  }
290
287
  );
291
288
  };
292
- const StyledAddIcon = styled__default.default(icons.PlusCircle)`
293
- > circle {
294
- fill: ${({ theme }) => theme.colors.neutral150};
295
- }
296
- > path {
297
- fill: ${({ theme }) => theme.colors.neutral600};
298
- }
299
- `;
300
- const StyledButton = styled__default.default(designSystem.Box)`
289
+ const StyledButton = styledComponents.styled(designSystem.Box)`
301
290
  border-radius: 26px;
302
-
303
- svg {
304
- height: ${({ theme }) => theme.spaces[6]};
305
- width: ${({ theme }) => theme.spaces[6]};
306
-
307
- > path {
308
- fill: ${({ theme }) => theme.colors.neutral600};
309
- }
310
- }
291
+ color: ${({ theme }) => theme.colors.neutral500};
311
292
 
312
293
  &:hover {
313
- color: ${({ theme }) => theme.colors.primary600} !important;
314
- ${designSystem.Typography} {
315
- color: ${({ theme }) => theme.colors.primary600} !important;
316
- }
317
-
318
- ${StyledAddIcon} {
319
- > circle {
320
- fill: ${({ theme }) => theme.colors.primary600};
321
- }
322
- > path {
323
- fill: ${({ theme }) => theme.colors.neutral100};
324
- }
325
- }
294
+ color: ${({ theme }) => theme.colors.primary600};
326
295
  }
327
296
 
328
297
  &:active {
329
- ${designSystem.Typography} {
330
- color: ${({ theme }) => theme.colors.primary600};
331
- }
332
-
333
- ${StyledAddIcon} {
334
- > circle {
335
- fill: ${({ theme }) => theme.colors.primary600};
336
- }
337
- > path {
338
- fill: ${({ theme }) => theme.colors.neutral100};
339
- }
340
- }
298
+ color: ${({ theme }) => theme.colors.primary600};
341
299
  }
342
300
  `;
343
301
  const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
@@ -367,9 +325,9 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
367
325
  gap: 6,
368
326
  zIndex: 2,
369
327
  position: "relative",
370
- as: "ol",
328
+ tag: "ol",
371
329
  children: stages.map((stage, index2) => {
372
- return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { as: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
330
+ return /* @__PURE__ */ jsxRuntime.jsx(designSystem.Box, { tag: "li", children: /* @__PURE__ */ jsxRuntime.jsx(
373
331
  Stage,
374
332
  {
375
333
  index: index2,
@@ -401,7 +359,7 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
401
359
  )
402
360
  ] });
403
361
  };
404
- const Background = styled__default.default(designSystem.Box)`
362
+ const Background = styledComponents.styled(designSystem.Box)`
405
363
  transform: translateX(-50%);
406
364
  `;
407
365
  const Stage = ({
@@ -500,7 +458,7 @@ const Stage = ({
500
458
  const handleCloneClick = () => {
501
459
  addFieldRow("stages", { name, color, permissions });
502
460
  };
503
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { ref: (ref) => composedRef(ref), children: [
461
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { ref: composedRef, children: [
504
462
  liveText && /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { "aria-live": "assertive", children: liveText }),
505
463
  isDragging ? /* @__PURE__ */ jsxRuntime.jsx(
506
464
  designSystem.Box,
@@ -536,16 +494,16 @@ const Stage = ({
536
494
  title: name,
537
495
  togglePosition: "left",
538
496
  action: (canDelete || canUpdate) && /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { children: [
539
- /* @__PURE__ */ jsxRuntime.jsxs(v2.Menu.Root, { children: [
497
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
540
498
  /* @__PURE__ */ jsxRuntime.jsxs(ContextMenuTrigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
541
499
  /* @__PURE__ */ jsxRuntime.jsx(icons.More, { "aria-hidden": true, focusable: false }),
542
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { as: "span", children: formatMessage({
500
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { tag: "span", children: formatMessage({
543
501
  id: "[tbdb].components.DynamicZone.more-actions",
544
502
  defaultMessage: "More actions"
545
503
  }) })
546
504
  ] }),
547
- /* @__PURE__ */ jsxRuntime.jsx(v2.Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(v2.Menu.SubRoot, { children: [
548
- canUpdate && /* @__PURE__ */ jsxRuntime.jsx(v2.MenuItem, { onClick: handleCloneClick, children: formatMessage({
505
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Menu.Content, { popoverPlacement: "bottom-end", zIndex: 2, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.SubRoot, { children: [
506
+ canUpdate && /* @__PURE__ */ jsxRuntime.jsx(designSystem.MenuItem, { onClick: handleCloneClick, children: formatMessage({
549
507
  id: "Settings.review-workflows.stage.delete",
550
508
  defaultMessage: "Duplicate stage"
551
509
  }) }),
@@ -559,7 +517,7 @@ const Stage = ({
559
517
  DragIconButton,
560
518
  {
561
519
  background: "transparent",
562
- forwardedAs: "div",
520
+ tag: "div",
563
521
  hasRadius: true,
564
522
  role: "button",
565
523
  noBorder: true,
@@ -622,10 +580,10 @@ const Stage = ({
622
580
  )
623
581
  ] });
624
582
  };
625
- const DeleteMenuItem = styled__default.default(v2.MenuItem)`
583
+ const DeleteMenuItem = styledComponents.styled(designSystem.MenuItem)`
626
584
  color: ${({ theme }) => theme.colors.danger600};
627
585
  `;
628
- const ContextMenuTrigger = styled__default.default(v2.Menu.Trigger)`
586
+ const ContextMenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
629
587
  :hover,
630
588
  :focus {
631
589
  background-color: ${({ theme }) => theme.colors.neutral100};
@@ -635,7 +593,7 @@ const ContextMenuTrigger = styled__default.default(v2.Menu.Trigger)`
635
593
  font-size: 0;
636
594
  }
637
595
  `;
638
- const DragIconButton = styled__default.default(designSystem.IconButton)`
596
+ const DragIconButton = styledComponents.styled(designSystem.IconButton)`
639
597
  align-items: center;
640
598
  border-radius: ${({ theme }) => theme.borderRadius};
641
599
  display: flex;
@@ -676,54 +634,55 @@ const ColorSelector = ({ disabled, label, name, required }) => {
676
634
  color: hex
677
635
  }));
678
636
  const { themeColorName } = index.getStageColorByHex(value) ?? {};
679
- return /* @__PURE__ */ jsxRuntime.jsx(
680
- designSystem.SingleSelect,
681
- {
682
- disabled,
683
- error,
684
- required,
685
- label,
686
- onChange: (v) => {
687
- onChange(name, v.toString());
688
- },
689
- value: value?.toUpperCase(),
690
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(
691
- designSystem.Flex,
692
- {
693
- as: "span",
694
- height: 2,
695
- background: value,
696
- borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
697
- hasRadius: true,
698
- shrink: 0,
699
- width: 2
700
- }
701
- ),
702
- children: colorOptions.map(({ value: value2, label: label2, color }) => {
703
- const { themeColorName: themeColorName2 } = index.getStageColorByHex(color) || {};
704
- return /* @__PURE__ */ jsxRuntime.jsx(
705
- designSystem.SingleSelectOption,
637
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name, required, children: [
638
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: label }),
639
+ /* @__PURE__ */ jsxRuntime.jsx(
640
+ designSystem.SingleSelect,
641
+ {
642
+ disabled,
643
+ onChange: (v) => {
644
+ onChange(name, v.toString());
645
+ },
646
+ value: value?.toUpperCase(),
647
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(
648
+ designSystem.Flex,
706
649
  {
707
- value: value2,
708
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(
709
- designSystem.Flex,
710
- {
711
- as: "span",
712
- height: 2,
713
- background: color,
714
- borderColor: themeColorName2 === "neutral0" ? "neutral150" : "transparent",
715
- hasRadius: true,
716
- shrink: 0,
717
- width: 2
718
- }
719
- ),
720
- children: label2
721
- },
722
- value2
723
- );
724
- })
725
- }
726
- );
650
+ tag: "span",
651
+ height: 2,
652
+ background: value,
653
+ borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
654
+ hasRadius: true,
655
+ shrink: 0,
656
+ width: 2
657
+ }
658
+ ),
659
+ children: colorOptions.map(({ value: value2, label: label2, color }) => {
660
+ const { themeColorName: themeColorName2 } = index.getStageColorByHex(color) || {};
661
+ return /* @__PURE__ */ jsxRuntime.jsx(
662
+ designSystem.SingleSelectOption,
663
+ {
664
+ value: value2,
665
+ startIcon: /* @__PURE__ */ jsxRuntime.jsx(
666
+ designSystem.Flex,
667
+ {
668
+ tag: "span",
669
+ height: 2,
670
+ background: color,
671
+ borderColor: themeColorName2 === "neutral0" ? "neutral150" : "transparent",
672
+ hasRadius: true,
673
+ shrink: 0,
674
+ width: 2
675
+ }
676
+ ),
677
+ children: label2
678
+ },
679
+ value2
680
+ );
681
+ })
682
+ }
683
+ ),
684
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
685
+ ] });
727
686
  };
728
687
  const PermissionsField = ({ disabled, name, placeholder, required }) => {
729
688
  const { formatMessage } = reactIntl.useIntl();
@@ -747,68 +706,76 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
747
706
  }
748
707
  }, [formatMessage, isLoading, roles, toggleNotification]);
749
708
  if (!isLoading && filteredRoles.length === 0) {
750
- return /* @__PURE__ */ jsxRuntime.jsx(
751
- designSystem.TextInput,
709
+ return /* @__PURE__ */ jsxRuntime.jsxs(
710
+ designSystem.Field.Root,
752
711
  {
753
- disabled: true,
754
712
  name,
755
713
  hint: formatMessage({
756
714
  id: "Settings.review-workflows.stage.permissions.noPermissions.description",
757
715
  defaultMessage: "You don’t have the permission to see roles"
758
716
  }),
759
- label: formatMessage({
760
- id: "Settings.review-workflows.stage.permissions.label",
761
- defaultMessage: "Roles that can change this stage"
762
- }),
763
- placeholder: formatMessage({
764
- id: "components.NotAllowedInput.text",
765
- defaultMessage: "No permissions to see this field"
766
- }),
767
717
  required,
768
- startAction: /* @__PURE__ */ jsxRuntime.jsx(StyledIcon, {}),
769
- type: "text",
770
- value: ""
771
- }
772
- );
773
- }
774
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
775
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-end", gap: 3, children: [
776
- /* @__PURE__ */ jsxRuntime.jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
777
- designSystem.MultiSelect,
778
- {
779
- disabled,
780
- error,
781
- id: name,
782
- label: formatMessage({
718
+ children: [
719
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
783
720
  id: "Settings.review-workflows.stage.permissions.label",
784
721
  defaultMessage: "Roles that can change this stage"
785
- }),
786
- onChange: (values) => {
787
- const permissions = values.map((value2) => ({
788
- role: parseInt(value2, 10),
789
- action: "admin::review-workflows.stage.transition"
790
- }));
791
- onChange(name, permissions);
792
- },
793
- placeholder,
794
- required: true,
795
- value: value.map((permission) => `${permission.role}`),
796
- withTags: true,
797
- children: /* @__PURE__ */ jsxRuntime.jsx(
798
- designSystem.MultiSelectGroup,
722
+ }) }),
723
+ /* @__PURE__ */ jsxRuntime.jsx(
724
+ designSystem.TextInput,
799
725
  {
800
- label: formatMessage({
801
- id: "Settings.review-workflows.stage.permissions.allRoles.label",
802
- defaultMessage: "All roles"
726
+ disabled: true,
727
+ placeholder: formatMessage({
728
+ id: "components.NotAllowedInput.text",
729
+ defaultMessage: "No permissions to see this field"
803
730
  }),
804
- values: filteredRoles.map((r) => `${r.id}`),
805
- children: filteredRoles.map((role) => {
806
- return /* @__PURE__ */ jsxRuntime.jsx(NestedOption$1, { value: `${role.id}`, children: role.name }, role.id);
807
- })
731
+ startAction: /* @__PURE__ */ jsxRuntime.jsx(StyledIcon, {}),
732
+ type: "text",
733
+ value: ""
808
734
  }
809
- )
810
- }
811
- ) }),
735
+ ),
736
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Hint, {})
737
+ ]
738
+ }
739
+ );
740
+ }
741
+ return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
742
+ /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-end", gap: 3, children: [
743
+ /* @__PURE__ */ jsxRuntime.jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name, required: true, children: [
744
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
745
+ id: "Settings.review-workflows.stage.permissions.label",
746
+ defaultMessage: "Roles that can change this stage"
747
+ }) }),
748
+ /* @__PURE__ */ jsxRuntime.jsx(
749
+ designSystem.MultiSelect,
750
+ {
751
+ disabled,
752
+ onChange: (values) => {
753
+ const permissions = values.map((value2) => ({
754
+ role: parseInt(value2, 10),
755
+ action: "admin::review-workflows.stage.transition"
756
+ }));
757
+ onChange(name, permissions);
758
+ },
759
+ placeholder,
760
+ value: value.map((permission) => `${permission.role}`),
761
+ withTags: true,
762
+ children: /* @__PURE__ */ jsxRuntime.jsx(
763
+ designSystem.MultiSelectGroup,
764
+ {
765
+ label: formatMessage({
766
+ id: "Settings.review-workflows.stage.permissions.allRoles.label",
767
+ defaultMessage: "All roles"
768
+ }),
769
+ values: filteredRoles.map((r) => `${r.id}`),
770
+ children: filteredRoles.map((role) => {
771
+ return /* @__PURE__ */ jsxRuntime.jsx(NestedOption$1, { value: `${role.id}`, children: role.name }, role.id);
772
+ })
773
+ }
774
+ )
775
+ }
776
+ ),
777
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Error, {})
778
+ ] }) }),
812
779
  /* @__PURE__ */ jsxRuntime.jsx(
813
780
  designSystem.IconButton,
814
781
  {
@@ -855,15 +822,15 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
855
822
  )
856
823
  ] });
857
824
  };
858
- const StyledIcon = styled__default.default(icons.EyeStriked)`
825
+ const StyledIcon = styledComponents.styled(icons.EyeStriked)`
859
826
  & > path {
860
827
  fill: ${({ theme }) => theme.colors.neutral600};
861
828
  }
862
829
  `;
863
- const NestedOption$1 = styled__default.default(designSystem.MultiSelectOption)`
830
+ const NestedOption$1 = styledComponents.styled(designSystem.MultiSelectOption)`
864
831
  padding-left: ${({ theme }) => theme.spaces[7]};
865
832
  `;
866
- const PermissionWrapper = styled__default.default(designSystem.Flex)`
833
+ const PermissionWrapper = styledComponents.styled(designSystem.Flex)`
867
834
  > * {
868
835
  flex-grow: 1;
869
836
  }
@@ -905,86 +872,87 @@ const ContentTypesSelector = ({ disabled }) => {
905
872
  label: contentType.info.displayName,
906
873
  value: contentType.uid
907
874
  }));
908
- return /* @__PURE__ */ jsxRuntime.jsx(
909
- designSystem.MultiSelect,
910
- {
911
- customizeContent: (value2) => formatMessage(
912
- {
913
- id: "Settings.review-workflows.workflow.contentTypes.displayValue",
914
- defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
915
- },
916
- { count: value2?.length }
917
- ),
918
- disabled: isDisabled,
919
- error,
920
- label: formatMessage({
921
- id: "Settings.review-workflows.workflow.contentTypes.label",
922
- defaultMessage: "Associated to"
923
- }),
924
- onChange: (values) => {
925
- onChange("contentTypes", values);
926
- },
927
- value,
928
- placeholder: formatMessage({
929
- id: "Settings.review-workflows.workflow.contentTypes.placeholder",
930
- defaultMessage: "Select"
931
- }),
932
- children: [
933
- ...collectionTypes.length > 0 ? [
934
- {
935
- label: formatMessage({
936
- id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
937
- defaultMessage: "Collection Types"
938
- }),
939
- children: collectionTypes
940
- }
941
- ] : [],
942
- ...singleTypes.length > 0 ? [
943
- {
944
- label: formatMessage({
945
- id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
946
- defaultMessage: "Single Types"
947
- }),
948
- children: singleTypes
949
- }
950
- ] : []
951
- ].map((opt) => {
952
- return /* @__PURE__ */ jsxRuntime.jsx(
953
- designSystem.MultiSelectGroup,
875
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Field.Root, { error, name: "contentTypes", children: [
876
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
877
+ id: "Settings.review-workflows.workflow.contentTypes.label",
878
+ defaultMessage: "Associated to"
879
+ }) }),
880
+ /* @__PURE__ */ jsxRuntime.jsx(
881
+ designSystem.MultiSelect,
882
+ {
883
+ customizeContent: (value2) => formatMessage(
954
884
  {
955
- label: opt.label,
956
- values: opt.children.map((child) => child.value.toString()),
957
- children: opt.children.map((child) => {
958
- const { name: assignedWorkflowName } = workflows?.find(
959
- (workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
960
- ) ?? {};
961
- return /* @__PURE__ */ jsxRuntime.jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
962
- // @ts-expect-error - formatMessage options doesn't expect to be a React component but that's what we need actually for the <i> and <em> components
963
- children: formatMessage(
964
- {
965
- id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
966
- defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
967
- },
968
- {
969
- label: child.label,
970
- name: assignedWorkflowName,
971
- em: (...children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "em", fontWeight: "bold", children }),
972
- i: (...children) => /* @__PURE__ */ jsxRuntime.jsx(ContentTypeTakeNotice, { children })
973
- }
974
- )
975
- }) }, child.value);
976
- })
885
+ id: "Settings.review-workflows.workflow.contentTypes.displayValue",
886
+ defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
977
887
  },
978
- opt.label
979
- );
980
- })
981
- }
982
- );
888
+ { count: value2?.length }
889
+ ),
890
+ disabled: isDisabled,
891
+ onChange: (values) => {
892
+ onChange("contentTypes", values);
893
+ },
894
+ value,
895
+ placeholder: formatMessage({
896
+ id: "Settings.review-workflows.workflow.contentTypes.placeholder",
897
+ defaultMessage: "Select"
898
+ }),
899
+ children: [
900
+ ...collectionTypes.length > 0 ? [
901
+ {
902
+ label: formatMessage({
903
+ id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
904
+ defaultMessage: "Collection Types"
905
+ }),
906
+ children: collectionTypes
907
+ }
908
+ ] : [],
909
+ ...singleTypes.length > 0 ? [
910
+ {
911
+ label: formatMessage({
912
+ id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
913
+ defaultMessage: "Single Types"
914
+ }),
915
+ children: singleTypes
916
+ }
917
+ ] : []
918
+ ].map((opt) => {
919
+ return /* @__PURE__ */ jsxRuntime.jsx(
920
+ designSystem.MultiSelectGroup,
921
+ {
922
+ label: opt.label,
923
+ values: opt.children.map((child) => child.value.toString()),
924
+ children: opt.children.map((child) => {
925
+ const { name: assignedWorkflowName } = workflows?.find(
926
+ (workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
927
+ ) ?? {};
928
+ return /* @__PURE__ */ jsxRuntime.jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
929
+ // @ts-expect-error - formatMessage options doesn't expect to be a React component but that's what we need actually for the <i> and <em> components
930
+ children: formatMessage(
931
+ {
932
+ id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
933
+ defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
934
+ },
935
+ {
936
+ label: child.label,
937
+ name: assignedWorkflowName,
938
+ em: (...children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { tag: "em", fontWeight: "bold", children }),
939
+ i: (...children) => /* @__PURE__ */ jsxRuntime.jsx(ContentTypeTakeNotice, { children })
940
+ }
941
+ )
942
+ }) }, child.value);
943
+ })
944
+ },
945
+ opt.label
946
+ );
947
+ })
948
+ }
949
+ )
950
+ ] });
983
951
  };
984
- const NestedOption = styled__default.default(designSystem.MultiSelectOption)`
952
+ const NestedOption = styledComponents.styled(designSystem.MultiSelectOption)`
985
953
  padding-left: ${({ theme }) => theme.spaces[7]};
986
954
  `;
987
- const ContentTypeTakeNotice = styled__default.default(designSystem.Typography)`
955
+ const ContentTypeTakeNotice = styledComponents.styled(designSystem.Typography)`
988
956
  font-style: italic;
989
957
  `;
990
958
  const WORKFLOW_SCHEMA = yup__namespace.object({
@@ -1330,4 +1298,4 @@ const ProtectedEditPage = () => {
1330
1298
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: /* @__PURE__ */ jsxRuntime.jsx(EditPage, {}) });
1331
1299
  };
1332
1300
  exports.ProtectedEditPage = ProtectedEditPage;
1333
- //# sourceMappingURL=_id-B6DgrtpA.js.map
1301
+ //# sourceMappingURL=_id-BO7wNLt1.js.map