@strapi/review-workflows 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.
Files changed (41) hide show
  1. package/dist/_chunks/{Layout-2ZuobDLm.js → Layout-60gjGInX.js} +6 -8
  2. package/dist/_chunks/Layout-60gjGInX.js.map +1 -0
  3. package/dist/_chunks/{Layout-BlUjTO46.mjs → Layout-CJYuYwXO.mjs} +7 -7
  4. package/dist/_chunks/Layout-CJYuYwXO.mjs.map +1 -0
  5. package/dist/_chunks/{_id-yjWLof5q.js → _id-BO7wNLt1.js} +201 -193
  6. package/dist/_chunks/_id-BO7wNLt1.js.map +1 -0
  7. package/dist/_chunks/{_id-BuJ0Ud8T.mjs → _id-UJ-8gken.mjs} +192 -182
  8. package/dist/_chunks/_id-UJ-8gken.mjs.map +1 -0
  9. package/dist/_chunks/{index-qAnk2xH9.js → index-CfiZnfhM.js} +79 -64
  10. package/dist/_chunks/index-CfiZnfhM.js.map +1 -0
  11. package/dist/_chunks/{index-sU2Cg2WW.mjs → index-DhEhUlv9.mjs} +5 -5
  12. package/dist/_chunks/index-DhEhUlv9.mjs.map +1 -0
  13. package/dist/_chunks/{index-D91cCzpN.mjs → index-DmQNXb0P.mjs} +81 -64
  14. package/dist/_chunks/index-DmQNXb0P.mjs.map +1 -0
  15. package/dist/_chunks/{index-CQGgid_7.js → index-DnXnsrOM.js} +6 -8
  16. package/dist/_chunks/index-DnXnsrOM.js.map +1 -0
  17. package/dist/_chunks/{purchase-review-workflows-DyffLpyz.mjs → purchase-review-workflows-BN-5Ube7.mjs} +5 -4
  18. package/dist/_chunks/purchase-review-workflows-BN-5Ube7.mjs.map +1 -0
  19. package/dist/_chunks/{purchase-review-workflows-BaOk5p_m.js → purchase-review-workflows-DlCDg0fD.js} +4 -3
  20. package/dist/_chunks/purchase-review-workflows-DlCDg0fD.js.map +1 -0
  21. package/dist/_chunks/{router-n4oxCWpr.js → router-BiQI7EcM.js} +3 -3
  22. package/dist/_chunks/{router-n4oxCWpr.js.map → router-BiQI7EcM.js.map} +1 -1
  23. package/dist/_chunks/{router-DkLtLJRZ.mjs → router-DFD0S0ey.mjs} +3 -3
  24. package/dist/_chunks/{router-DkLtLJRZ.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/settings/hooks/useDragAndDrop.d.ts +4 -4
  28. package/dist/admin/src/routes/settings/hooks/useKeyboardDragAndDrop.d.ts +1 -1
  29. package/dist/admin/src/routes/settings/hooks/useReviewWorkflows.d.ts +3 -3
  30. package/dist/admin/src/utils/api.d.ts +8 -9
  31. package/package.json +10 -11
  32. package/dist/_chunks/Layout-2ZuobDLm.js.map +0 -1
  33. package/dist/_chunks/Layout-BlUjTO46.mjs.map +0 -1
  34. package/dist/_chunks/_id-BuJ0Ud8T.mjs.map +0 -1
  35. package/dist/_chunks/_id-yjWLof5q.js.map +0 -1
  36. package/dist/_chunks/index-CQGgid_7.js.map +0 -1
  37. package/dist/_chunks/index-D91cCzpN.mjs.map +0 -1
  38. package/dist/_chunks/index-qAnk2xH9.js.map +0 -1
  39. package/dist/_chunks/index-sU2Cg2WW.mjs.map +0 -1
  40. package/dist/_chunks/purchase-review-workflows-BaOk5p_m.js.map +0 -1
  41. package/dist/_chunks/purchase-review-workflows-DyffLpyz.mjs.map +0 -1
@@ -11,12 +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-qAnk2xH9.js");
15
- const Layout = require("./Layout-2ZuobDLm.js");
14
+ const index = require("./index-CfiZnfhM.js");
15
+ const Layout = require("./Layout-60gjGInX.js");
16
16
  const reactDndHtml5Backend = require("react-dnd-html5-backend");
17
- const styled = require("styled-components");
17
+ const styledComponents = require("styled-components");
18
18
  const reactDnd = require("react-dnd");
19
- const _interopDefault = (e) => e && e.__esModule ? e : { default: e };
20
19
  function _interopNamespace(e) {
21
20
  if (e && e.__esModule)
22
21
  return e;
@@ -37,7 +36,6 @@ function _interopNamespace(e) {
37
36
  }
38
37
  const React__namespace = /* @__PURE__ */ _interopNamespace(React);
39
38
  const yup__namespace = /* @__PURE__ */ _interopNamespace(yup);
40
- const styled__default = /* @__PURE__ */ _interopDefault(styled);
41
39
  const adminApi = index.reviewWorkflowsApi.injectEndpoints({
42
40
  endpoints(builder) {
43
41
  return {
@@ -272,7 +270,7 @@ const AddStage = ({ children, ...props }) => {
272
270
  return /* @__PURE__ */ jsxRuntime.jsx(
273
271
  StyledButton,
274
272
  {
275
- as: "button",
273
+ tag: "button",
276
274
  background: "neutral0",
277
275
  border: "neutral150",
278
276
  paddingBottom: 3,
@@ -281,14 +279,14 @@ const AddStage = ({ children, ...props }) => {
281
279
  paddingTop: 3,
282
280
  shadow: "filterShadow",
283
281
  ...props,
284
- children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", textColor: "inherit", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { as: "span", gap: 2, children: [
282
+ children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { variant: "pi", fontWeight: "bold", children: /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { tag: "span", gap: 2, children: [
285
283
  /* @__PURE__ */ jsxRuntime.jsx(icons.PlusCircle, { width: "2.4rem", height: "2.4rem", "aria-hidden": true }),
286
284
  children
287
285
  ] }) })
288
286
  }
289
287
  );
290
288
  };
291
- const StyledButton = styled__default.default(designSystem.Box)`
289
+ const StyledButton = styledComponents.styled(designSystem.Box)`
292
290
  border-radius: 26px;
293
291
  color: ${({ theme }) => theme.colors.neutral500};
294
292
 
@@ -327,9 +325,9 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
327
325
  gap: 6,
328
326
  zIndex: 2,
329
327
  position: "relative",
330
- as: "ol",
328
+ tag: "ol",
331
329
  children: stages.map((stage, index2) => {
332
- 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(
333
331
  Stage,
334
332
  {
335
333
  index: index2,
@@ -361,7 +359,7 @@ const Stages = ({ canDelete = true, canUpdate = true, isCreating = false }) => {
361
359
  )
362
360
  ] });
363
361
  };
364
- const Background = styled__default.default(designSystem.Box)`
362
+ const Background = styledComponents.styled(designSystem.Box)`
365
363
  transform: translateX(-50%);
366
364
  `;
367
365
  const Stage = ({
@@ -460,7 +458,7 @@ const Stage = ({
460
458
  const handleCloneClick = () => {
461
459
  addFieldRow("stages", { name, color, permissions });
462
460
  };
463
- return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { ref: (ref) => composedRef(ref), children: [
461
+ return /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Box, { ref: composedRef, children: [
464
462
  liveText && /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { "aria-live": "assertive", children: liveText }),
465
463
  isDragging ? /* @__PURE__ */ jsxRuntime.jsx(
466
464
  designSystem.Box,
@@ -499,7 +497,7 @@ const Stage = ({
499
497
  /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Menu.Root, { children: [
500
498
  /* @__PURE__ */ jsxRuntime.jsxs(ContextMenuTrigger, { size: "S", endIcon: null, paddingLeft: 2, paddingRight: 2, children: [
501
499
  /* @__PURE__ */ jsxRuntime.jsx(icons.More, { "aria-hidden": true, focusable: false }),
502
- /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { as: "span", children: formatMessage({
500
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.VisuallyHidden, { tag: "span", children: formatMessage({
503
501
  id: "[tbdb].components.DynamicZone.more-actions",
504
502
  defaultMessage: "More actions"
505
503
  }) })
@@ -519,7 +517,7 @@ const Stage = ({
519
517
  DragIconButton,
520
518
  {
521
519
  background: "transparent",
522
- forwardedAs: "div",
520
+ tag: "div",
523
521
  hasRadius: true,
524
522
  role: "button",
525
523
  noBorder: true,
@@ -582,10 +580,10 @@ const Stage = ({
582
580
  )
583
581
  ] });
584
582
  };
585
- const DeleteMenuItem = styled__default.default(designSystem.MenuItem)`
583
+ const DeleteMenuItem = styledComponents.styled(designSystem.MenuItem)`
586
584
  color: ${({ theme }) => theme.colors.danger600};
587
585
  `;
588
- const ContextMenuTrigger = styled__default.default(designSystem.Menu.Trigger)`
586
+ const ContextMenuTrigger = styledComponents.styled(designSystem.Menu.Trigger)`
589
587
  :hover,
590
588
  :focus {
591
589
  background-color: ${({ theme }) => theme.colors.neutral100};
@@ -595,7 +593,7 @@ const ContextMenuTrigger = styled__default.default(designSystem.Menu.Trigger)`
595
593
  font-size: 0;
596
594
  }
597
595
  `;
598
- const DragIconButton = styled__default.default(designSystem.IconButton)`
596
+ const DragIconButton = styledComponents.styled(designSystem.IconButton)`
599
597
  align-items: center;
600
598
  border-radius: ${({ theme }) => theme.borderRadius};
601
599
  display: flex;
@@ -636,54 +634,55 @@ const ColorSelector = ({ disabled, label, name, required }) => {
636
634
  color: hex
637
635
  }));
638
636
  const { themeColorName } = index.getStageColorByHex(value) ?? {};
639
- return /* @__PURE__ */ jsxRuntime.jsx(
640
- designSystem.SingleSelect,
641
- {
642
- disabled,
643
- error,
644
- required,
645
- label,
646
- onChange: (v) => {
647
- onChange(name, v.toString());
648
- },
649
- value: value?.toUpperCase(),
650
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(
651
- designSystem.Flex,
652
- {
653
- as: "span",
654
- height: 2,
655
- background: value,
656
- borderColor: themeColorName === "neutral0" ? "neutral150" : "transparent",
657
- hasRadius: true,
658
- shrink: 0,
659
- width: 2
660
- }
661
- ),
662
- children: colorOptions.map(({ value: value2, label: label2, color }) => {
663
- const { themeColorName: themeColorName2 } = index.getStageColorByHex(color) || {};
664
- return /* @__PURE__ */ jsxRuntime.jsx(
665
- 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,
666
649
  {
667
- value: value2,
668
- startIcon: /* @__PURE__ */ jsxRuntime.jsx(
669
- designSystem.Flex,
670
- {
671
- as: "span",
672
- height: 2,
673
- background: color,
674
- borderColor: themeColorName2 === "neutral0" ? "neutral150" : "transparent",
675
- hasRadius: true,
676
- shrink: 0,
677
- width: 2
678
- }
679
- ),
680
- children: label2
681
- },
682
- value2
683
- );
684
- })
685
- }
686
- );
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
+ ] });
687
686
  };
688
687
  const PermissionsField = ({ disabled, name, placeholder, required }) => {
689
688
  const { formatMessage } = reactIntl.useIntl();
@@ -707,68 +706,76 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
707
706
  }
708
707
  }, [formatMessage, isLoading, roles, toggleNotification]);
709
708
  if (!isLoading && filteredRoles.length === 0) {
710
- return /* @__PURE__ */ jsxRuntime.jsx(
711
- designSystem.TextInput,
709
+ return /* @__PURE__ */ jsxRuntime.jsxs(
710
+ designSystem.Field.Root,
712
711
  {
713
- disabled: true,
714
712
  name,
715
713
  hint: formatMessage({
716
714
  id: "Settings.review-workflows.stage.permissions.noPermissions.description",
717
715
  defaultMessage: "You don’t have the permission to see roles"
718
716
  }),
719
- label: formatMessage({
720
- id: "Settings.review-workflows.stage.permissions.label",
721
- defaultMessage: "Roles that can change this stage"
722
- }),
723
- placeholder: formatMessage({
724
- id: "components.NotAllowedInput.text",
725
- defaultMessage: "No permissions to see this field"
726
- }),
727
717
  required,
728
- startAction: /* @__PURE__ */ jsxRuntime.jsx(StyledIcon, {}),
729
- type: "text",
730
- value: ""
731
- }
732
- );
733
- }
734
- return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
735
- /* @__PURE__ */ jsxRuntime.jsxs(designSystem.Flex, { alignItems: "flex-end", gap: 3, children: [
736
- /* @__PURE__ */ jsxRuntime.jsx(PermissionWrapper, { grow: 1, children: /* @__PURE__ */ jsxRuntime.jsx(
737
- designSystem.MultiSelect,
738
- {
739
- disabled,
740
- error,
741
- id: name,
742
- label: formatMessage({
718
+ children: [
719
+ /* @__PURE__ */ jsxRuntime.jsx(designSystem.Field.Label, { children: formatMessage({
743
720
  id: "Settings.review-workflows.stage.permissions.label",
744
721
  defaultMessage: "Roles that can change this stage"
745
- }),
746
- onChange: (values) => {
747
- const permissions = values.map((value2) => ({
748
- role: parseInt(value2, 10),
749
- action: "admin::review-workflows.stage.transition"
750
- }));
751
- onChange(name, permissions);
752
- },
753
- placeholder,
754
- required: true,
755
- value: value.map((permission) => `${permission.role}`),
756
- withTags: true,
757
- children: /* @__PURE__ */ jsxRuntime.jsx(
758
- designSystem.MultiSelectGroup,
722
+ }) }),
723
+ /* @__PURE__ */ jsxRuntime.jsx(
724
+ designSystem.TextInput,
759
725
  {
760
- label: formatMessage({
761
- id: "Settings.review-workflows.stage.permissions.allRoles.label",
762
- defaultMessage: "All roles"
726
+ disabled: true,
727
+ placeholder: formatMessage({
728
+ id: "components.NotAllowedInput.text",
729
+ defaultMessage: "No permissions to see this field"
763
730
  }),
764
- values: filteredRoles.map((r) => `${r.id}`),
765
- children: filteredRoles.map((role) => {
766
- return /* @__PURE__ */ jsxRuntime.jsx(NestedOption$1, { value: `${role.id}`, children: role.name }, role.id);
767
- })
731
+ startAction: /* @__PURE__ */ jsxRuntime.jsx(StyledIcon, {}),
732
+ type: "text",
733
+ value: ""
768
734
  }
769
- )
770
- }
771
- ) }),
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
+ ] }) }),
772
779
  /* @__PURE__ */ jsxRuntime.jsx(
773
780
  designSystem.IconButton,
774
781
  {
@@ -815,15 +822,15 @@ const PermissionsField = ({ disabled, name, placeholder, required }) => {
815
822
  )
816
823
  ] });
817
824
  };
818
- const StyledIcon = styled__default.default(icons.EyeStriked)`
825
+ const StyledIcon = styledComponents.styled(icons.EyeStriked)`
819
826
  & > path {
820
827
  fill: ${({ theme }) => theme.colors.neutral600};
821
828
  }
822
829
  `;
823
- const NestedOption$1 = styled__default.default(designSystem.MultiSelectOption)`
830
+ const NestedOption$1 = styledComponents.styled(designSystem.MultiSelectOption)`
824
831
  padding-left: ${({ theme }) => theme.spaces[7]};
825
832
  `;
826
- const PermissionWrapper = styled__default.default(designSystem.Flex)`
833
+ const PermissionWrapper = styledComponents.styled(designSystem.Flex)`
827
834
  > * {
828
835
  flex-grow: 1;
829
836
  }
@@ -865,86 +872,87 @@ const ContentTypesSelector = ({ disabled }) => {
865
872
  label: contentType.info.displayName,
866
873
  value: contentType.uid
867
874
  }));
868
- return /* @__PURE__ */ jsxRuntime.jsx(
869
- designSystem.MultiSelect,
870
- {
871
- customizeContent: (value2) => formatMessage(
872
- {
873
- id: "Settings.review-workflows.workflow.contentTypes.displayValue",
874
- defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
875
- },
876
- { count: value2?.length }
877
- ),
878
- disabled: isDisabled,
879
- error,
880
- label: formatMessage({
881
- id: "Settings.review-workflows.workflow.contentTypes.label",
882
- defaultMessage: "Associated to"
883
- }),
884
- onChange: (values) => {
885
- onChange("contentTypes", values);
886
- },
887
- value,
888
- placeholder: formatMessage({
889
- id: "Settings.review-workflows.workflow.contentTypes.placeholder",
890
- defaultMessage: "Select"
891
- }),
892
- children: [
893
- ...collectionTypes.length > 0 ? [
894
- {
895
- label: formatMessage({
896
- id: "Settings.review-workflows.workflow.contentTypes.collectionTypes.label",
897
- defaultMessage: "Collection Types"
898
- }),
899
- children: collectionTypes
900
- }
901
- ] : [],
902
- ...singleTypes.length > 0 ? [
903
- {
904
- label: formatMessage({
905
- id: "Settings.review-workflows.workflow.contentTypes.singleTypes.label",
906
- defaultMessage: "Single Types"
907
- }),
908
- children: singleTypes
909
- }
910
- ] : []
911
- ].map((opt) => {
912
- return /* @__PURE__ */ jsxRuntime.jsx(
913
- 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(
914
884
  {
915
- label: opt.label,
916
- values: opt.children.map((child) => child.value.toString()),
917
- children: opt.children.map((child) => {
918
- const { name: assignedWorkflowName } = workflows?.find(
919
- (workflow) => (currentWorkflow && workflow.id !== currentWorkflow.id || !currentWorkflow) && workflow.contentTypes.includes(child.value)
920
- ) ?? {};
921
- return /* @__PURE__ */ jsxRuntime.jsx(NestedOption, { value: child.value, children: /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, {
922
- // @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
923
- children: formatMessage(
924
- {
925
- id: "Settings.review-workflows.workflow.contentTypes.assigned.notice",
926
- defaultMessage: "{label} {name, select, undefined {} other {<i>(assigned to <em>{name}</em> workflow)</i>}}"
927
- },
928
- {
929
- label: child.label,
930
- name: assignedWorkflowName,
931
- em: (...children) => /* @__PURE__ */ jsxRuntime.jsx(designSystem.Typography, { as: "em", fontWeight: "bold", children }),
932
- i: (...children) => /* @__PURE__ */ jsxRuntime.jsx(ContentTypeTakeNotice, { children })
933
- }
934
- )
935
- }) }, child.value);
936
- })
885
+ id: "Settings.review-workflows.workflow.contentTypes.displayValue",
886
+ defaultMessage: "{count} {count, plural, one {content type} other {content types}} selected"
937
887
  },
938
- opt.label
939
- );
940
- })
941
- }
942
- );
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
+ ] });
943
951
  };
944
- const NestedOption = styled__default.default(designSystem.MultiSelectOption)`
952
+ const NestedOption = styledComponents.styled(designSystem.MultiSelectOption)`
945
953
  padding-left: ${({ theme }) => theme.spaces[7]};
946
954
  `;
947
- const ContentTypeTakeNotice = styled__default.default(designSystem.Typography)`
955
+ const ContentTypeTakeNotice = styledComponents.styled(designSystem.Typography)`
948
956
  font-style: italic;
949
957
  `;
950
958
  const WORKFLOW_SCHEMA = yup__namespace.object({
@@ -1290,4 +1298,4 @@ const ProtectedEditPage = () => {
1290
1298
  return /* @__PURE__ */ jsxRuntime.jsx(strapiAdmin.Page.Protect, { permissions, children: /* @__PURE__ */ jsxRuntime.jsx(EditPage, {}) });
1291
1299
  };
1292
1300
  exports.ProtectedEditPage = ProtectedEditPage;
1293
- //# sourceMappingURL=_id-yjWLof5q.js.map
1301
+ //# sourceMappingURL=_id-BO7wNLt1.js.map