@embedreach/components 0.2.7 → 0.2.9

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.
@@ -60341,8 +60341,12 @@ const InfoTooltip = ({ title: title2, alertText, Icon: Icon2 = Info, onClick, as
60341
60341
  const [isOpen, setIsOpen] = useState(false);
60342
60342
  const handleClick = (e4) => {
60343
60343
  e4.stopPropagation();
60344
- setIsOpen(!isOpen);
60345
- onClick?.();
60344
+ if (onClick) {
60345
+ onClick();
60346
+ setIsOpen(false);
60347
+ } else {
60348
+ setIsOpen(!isOpen);
60349
+ }
60346
60350
  };
60347
60351
  return /* @__PURE__ */ jsx(TooltipProvider, { children: /* @__PURE__ */ jsxs(Tooltip, { open: isOpen, onOpenChange: setIsOpen, children: [
60348
60352
  /* @__PURE__ */ jsx(TooltipTrigger, { asChild, children: /* @__PURE__ */ jsx(
@@ -66063,7 +66067,8 @@ const AutomationEditorSMSPreview = ({
66063
66067
  const AutomationEditorTabs = ({
66064
66068
  disablePreview = false,
66065
66069
  disableEditContent = false,
66066
- disablePreviewSubtext = false
66070
+ disablePreviewSubtext = false,
66071
+ hideSms = false
66067
66072
  }) => {
66068
66073
  const [activeTab, setActiveTab] = useState("email");
66069
66074
  const [initialLoad, setInitialLoad] = useState(false);
@@ -66094,46 +66099,52 @@ const AutomationEditorTabs = ({
66094
66099
  defaultValue: "email",
66095
66100
  className: "flex flex-col gap-4 pt-4 flex-1 bg-muted rounded-md",
66096
66101
  children: [
66097
- /* @__PURE__ */ jsx("div", { className: "max-w-[640px] mx-auto w-full", children: /* @__PURE__ */ jsxs(TabsList, { className: "grid w-full grid-cols-2", children: [
66098
- /* @__PURE__ */ jsx(TabsTrigger, { value: "email", className: "group", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
66099
- /* @__PURE__ */ jsx(
66100
- "img",
66101
- {
66102
- src: emailActiveIcon,
66103
- alt: "Email",
66104
- className: "w-4 h-4 mr-2 hidden group-data-[state=active]:block"
66105
- }
66106
- ),
66107
- /* @__PURE__ */ jsx(
66108
- "img",
66109
- {
66110
- src: emailInactiveIcon,
66111
- alt: "Email",
66112
- className: "w-4 h-4 mr-2 block group-data-[state=active]:hidden"
66113
- }
66114
- ),
66115
- "Email"
66116
- ] }) }),
66117
- /* @__PURE__ */ jsx(TabsTrigger, { value: "sms", className: "group", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
66118
- /* @__PURE__ */ jsx(
66119
- "img",
66120
- {
66121
- src: smsActiveIcon,
66122
- alt: "SMS",
66123
- className: "w-4 h-4 mr-2 hidden group-data-[state=active]:block"
66124
- }
66125
- ),
66126
- /* @__PURE__ */ jsx(
66127
- "img",
66128
- {
66129
- src: smsInactiveIcon,
66130
- alt: "SMS",
66131
- className: "w-4 h-4 mr-2 block group-data-[state=active]:hidden"
66132
- }
66133
- ),
66134
- "SMS"
66135
- ] }) })
66136
- ] }) }),
66102
+ /* @__PURE__ */ jsx("div", { className: "max-w-[640px] mx-auto w-full", children: /* @__PURE__ */ jsxs(
66103
+ TabsList,
66104
+ {
66105
+ className: `grid w-full ${hideSms ? "grid-cols-1" : "grid-cols-2"}`,
66106
+ children: [
66107
+ /* @__PURE__ */ jsx(TabsTrigger, { value: "email", className: "group", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
66108
+ /* @__PURE__ */ jsx(
66109
+ "img",
66110
+ {
66111
+ src: emailActiveIcon,
66112
+ alt: "Email",
66113
+ className: "w-4 h-4 mr-2 hidden group-data-[state=active]:block"
66114
+ }
66115
+ ),
66116
+ /* @__PURE__ */ jsx(
66117
+ "img",
66118
+ {
66119
+ src: emailInactiveIcon,
66120
+ alt: "Email",
66121
+ className: "w-4 h-4 mr-2 block group-data-[state=active]:hidden"
66122
+ }
66123
+ ),
66124
+ "Email"
66125
+ ] }) }),
66126
+ !hideSms && /* @__PURE__ */ jsx(TabsTrigger, { value: "sms", className: "group", children: /* @__PURE__ */ jsxs("div", { className: "flex items-center", children: [
66127
+ /* @__PURE__ */ jsx(
66128
+ "img",
66129
+ {
66130
+ src: smsActiveIcon,
66131
+ alt: "SMS",
66132
+ className: "w-4 h-4 mr-2 hidden group-data-[state=active]:block"
66133
+ }
66134
+ ),
66135
+ /* @__PURE__ */ jsx(
66136
+ "img",
66137
+ {
66138
+ src: smsInactiveIcon,
66139
+ alt: "SMS",
66140
+ className: "w-4 h-4 mr-2 block group-data-[state=active]:hidden"
66141
+ }
66142
+ ),
66143
+ "SMS"
66144
+ ] }) })
66145
+ ]
66146
+ }
66147
+ ) }),
66137
66148
  /* @__PURE__ */ jsxs("div", { className: "max-w-[1000px] mx-auto w-full flex-1", children: [
66138
66149
  /* @__PURE__ */ jsx(TabsContent, { value: "sms", children: /* @__PURE__ */ jsx(
66139
66150
  AutomationEditorSMSPreview,
@@ -73457,6 +73468,13 @@ const OneTimeWizardMain = ({ onFinish, getExtraMergeFields, onBeforeSchedule })
73457
73468
  renderFooter()
73458
73469
  ] });
73459
73470
  };
73471
+ const OneTimeWizardWrapper = ({ children: children2, actionId }) => {
73472
+ const { setActionId: setActionId2 } = useContext$1(Context);
73473
+ useEffect(() => {
73474
+ setActionId2(actionId);
73475
+ }, [actionId, setActionId2]);
73476
+ return /* @__PURE__ */ jsx("div", { children: children2 });
73477
+ };
73460
73478
  const OneTimeBroadcast = () => {
73461
73479
  return /* @__PURE__ */ jsxs("div", { children: [
73462
73480
  /* @__PURE__ */ jsx("div", { className: styles$4.iconWrapper, children: /* @__PURE__ */ jsx(IconDefinitions.OneTimeBroadcast, {}) }),
@@ -73569,6 +73587,7 @@ const CreateAutomationModal = ({
73569
73587
  const [automationId, setAutomationId] = useState(
73570
73588
  void 0
73571
73589
  );
73590
+ const [communicationActionId, setCommunicationActionId] = useState(void 0);
73572
73591
  const [initalStateSet, setInitalStateSet] = useState(false);
73573
73592
  const [automationState, setAutomationState] = useState(
73574
73593
  /**
@@ -73643,6 +73662,7 @@ const CreateAutomationModal = ({
73643
73662
  });
73644
73663
  if (automationType === AutomationTriggerType.ONE_TIME) {
73645
73664
  setCurrentStep(CreateAutomationModalStep.OneTimeWizard);
73665
+ setCommunicationActionId(actionId);
73646
73666
  setStartedCreating(false);
73647
73667
  } else {
73648
73668
  onClose?.(response.id);
@@ -73709,10 +73729,10 @@ const CreateAutomationModal = ({
73709
73729
  }
73710
73730
  );
73711
73731
  case CreateAutomationModalStep.OneTimeWizard:
73712
- if (!automationId) {
73732
+ if (!automationId || !communicationActionId) {
73713
73733
  return null;
73714
73734
  }
73715
- return /* @__PURE__ */ jsx(ViewAutomationProvider, { automationId, children: /* @__PURE__ */ jsx(
73735
+ return /* @__PURE__ */ jsx(ViewAutomationProvider, { automationId, children: /* @__PURE__ */ jsx(OneTimeWizardWrapper, { actionId: communicationActionId, children: /* @__PURE__ */ jsx(
73716
73736
  OneTimeWizardMain,
73717
73737
  {
73718
73738
  onFinish: () => {
@@ -73721,7 +73741,7 @@ const CreateAutomationModal = ({
73721
73741
  getExtraMergeFields,
73722
73742
  onBeforeSchedule
73723
73743
  }
73724
- ) });
73744
+ ) }) });
73725
73745
  default:
73726
73746
  throw UnreachableCaseStatement$1(currentStep, CreateAutomationModalStep);
73727
73747
  }
@@ -74041,6 +74061,7 @@ const StatsGrid = ({
74041
74061
  const AutomationStatistics = ({
74042
74062
  automationId,
74043
74063
  includeSales = false,
74064
+ includeSms = false,
74044
74065
  automation: automation2
74045
74066
  }) => {
74046
74067
  const [activeTab, setActiveTab] = useState("email");
@@ -74062,11 +74083,13 @@ const AutomationStatistics = ({
74062
74083
  label: `Email ${t$1("engage:insight", { count: 2 })}`,
74063
74084
  content: /* @__PURE__ */ jsx(StatsGrid, { activeTab: "email", statistics })
74064
74085
  },
74065
- {
74066
- id: "sms",
74067
- label: `SMS ${t$1("engage:insight", { count: 2 })}`,
74068
- content: /* @__PURE__ */ jsx(StatsGrid, { activeTab: "sms", statistics })
74069
- },
74086
+ ...includeSms ? [
74087
+ {
74088
+ id: "sms",
74089
+ label: `SMS ${t$1("engage:insight", { count: 2 })}`,
74090
+ content: /* @__PURE__ */ jsx(StatsGrid, { activeTab: "sms", statistics })
74091
+ }
74092
+ ] : [],
74070
74093
  ...includeSales ? [
74071
74094
  {
74072
74095
  id: "sales",
@@ -81724,6 +81747,10 @@ function AutomationEditDialog({
81724
81747
  defaultValues: {
81725
81748
  name: automation2?.name ?? "",
81726
81749
  description: automation2?.description ?? ""
81750
+ },
81751
+ values: {
81752
+ name: automation2?.name ?? "",
81753
+ description: automation2?.description ?? ""
81727
81754
  }
81728
81755
  });
81729
81756
  function onSubmit(values) {
@@ -81738,8 +81765,17 @@ function AutomationEditDialog({
81738
81765
  }
81739
81766
  return /* @__PURE__ */ jsx(Dialog, { open, onOpenChange, children: /* @__PURE__ */ jsxs(DialogContent, { className: "sm:max-w-[425px]", children: [
81740
81767
  /* @__PURE__ */ jsxs(DialogHeader, { children: [
81741
- /* @__PURE__ */ jsx(DialogTitle, { children: "Edit Automation" }),
81742
- /* @__PURE__ */ jsx(DialogDescription, { children: "Update the title and description of your automation." })
81768
+ /* @__PURE__ */ jsxs(DialogTitle, { children: [
81769
+ "Edit",
81770
+ " ",
81771
+ automation2.triggerType === AutomationTriggerType.ONE_TIME ? t$1("engage:one_time") : t$1("engage:automation")
81772
+ ] }),
81773
+ /* @__PURE__ */ jsxs(DialogDescription, { children: [
81774
+ "Update the title and description of your",
81775
+ " ",
81776
+ automation2.triggerType === AutomationTriggerType.ONE_TIME ? t$1("engage:one_time") : t$1("engage:automation"),
81777
+ "."
81778
+ ] })
81743
81779
  ] }),
81744
81780
  /* @__PURE__ */ jsx(Form, { ...form, children: /* @__PURE__ */ jsxs("form", { onSubmit: form.handleSubmit(onSubmit), className: "space-y-4", children: [
81745
81781
  /* @__PURE__ */ jsx(
@@ -82009,36 +82045,24 @@ const AutomationsEditorHeader = ({ showBackButton, onDuplicationCreated, onBefor
82009
82045
  ] }),
82010
82046
  /* @__PURE__ */ jsxs("div", { className: "ml-auto flex gap-4 items-center", children: [
82011
82047
  /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2 text-muted-foreground", children: automation2.triggerType === AutomationTriggerType.ONE_TIME && /* @__PURE__ */ jsxs(Fragment, { children: [
82012
- /* @__PURE__ */ jsx(
82013
- "div",
82048
+ /* @__PURE__ */ jsx("div", { className: "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-10 w-10 cursor-pointer", children: /* @__PURE__ */ jsx(
82049
+ InfoTooltip,
82014
82050
  {
82015
- className: "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-10 w-10 cursor-pointer",
82016
- onClick: () => setIsEditDialogOpen(true),
82017
- children: /* @__PURE__ */ jsx(
82018
- InfoTooltip,
82019
- {
82020
- title: "Edit",
82021
- Icon: IconDefinitions.EditIcon,
82022
- asChild: false
82023
- }
82024
- )
82051
+ title: "Edit",
82052
+ Icon: IconDefinitions.EditIcon,
82053
+ asChild: false,
82054
+ onClick: () => setIsEditDialogOpen(true)
82025
82055
  }
82026
- ),
82027
- /* @__PURE__ */ jsx(
82028
- "div",
82056
+ ) }),
82057
+ /* @__PURE__ */ jsx("div", { className: "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-10 w-10 cursor-pointer", children: /* @__PURE__ */ jsx(
82058
+ InfoTooltip,
82029
82059
  {
82030
- className: "inline-flex items-center justify-center rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 hover:bg-accent hover:text-accent-foreground h-10 w-10 cursor-pointer",
82031
- onClick: () => setIsDuplicateDialogOpen(true),
82032
- children: /* @__PURE__ */ jsx(
82033
- InfoTooltip,
82034
- {
82035
- title: "Duplicate",
82036
- Icon: IconDefinitions.DuplicateIcon,
82037
- asChild: false
82038
- }
82039
- )
82060
+ title: "Duplicate",
82061
+ Icon: IconDefinitions.DuplicateIcon,
82062
+ asChild: false,
82063
+ onClick: () => setIsDuplicateDialogOpen(true)
82040
82064
  }
82041
- )
82065
+ ) })
82042
82066
  ] }) }),
82043
82067
  editingStatus ? /* @__PURE__ */ jsx("div", { className: "flex items-center text-muted-foreground pr-8", children: /* @__PURE__ */ jsx(BasicLoader, {}) }) : renderSwitch()
82044
82068
  ] }),
@@ -82067,7 +82091,7 @@ const AutomationsEditorHeader = ({ showBackButton, onDuplicationCreated, onBefor
82067
82091
  )
82068
82092
  ] });
82069
82093
  };
82070
- const AutomationsEditorStatsTab = () => {
82094
+ const AutomationsEditorStatsTab = ({ hideSms, hideSales }) => {
82071
82095
  const automation2 = useAutomation();
82072
82096
  const { isLoading: isStatisticsLoading } = useGetBusinessAutomationStatistics(
82073
82097
  automation2?.id
@@ -82085,7 +82109,8 @@ const AutomationsEditorStatsTab = () => {
82085
82109
  {
82086
82110
  automationId: automation2.id,
82087
82111
  automation: automation2,
82088
- includeSales: true
82112
+ includeSales: !hideSales,
82113
+ includeSms: !hideSms
82089
82114
  }
82090
82115
  ) });
82091
82116
  };
@@ -84664,11 +84689,16 @@ const AutomationsEditorStep = ({
84664
84689
  const AutomationFlowMain = () => {
84665
84690
  const [isDetailsVisible, setIsDetailsVisible] = useState(false);
84666
84691
  const [actionDataWithMetadata, setActionDataWithMetadata] = useState(void 0);
84692
+ const [isEditingDescription, setIsEditingDescription] = useState(false);
84693
+ const [editedDescription, setEditedDescription] = useState("");
84694
+ const [optimisticDescription, setOptimisticDescription] = useState(null);
84667
84695
  const automation2 = useAutomation();
84668
84696
  const {
84669
84697
  setActionId: setActionId2,
84670
84698
  state: { selectedActionId }
84671
84699
  } = useContext$1(Context);
84700
+ const { updateAutomation: businessUpdateAutomation } = useUpdateBusinessAutomation(automation2?.id || "");
84701
+ const { toast: toast2 } = useToast();
84672
84702
  useEffect(() => {
84673
84703
  if (!automation2) {
84674
84704
  return;
@@ -84716,6 +84746,10 @@ const AutomationFlowMain = () => {
84716
84746
  };
84717
84747
  getData();
84718
84748
  }, [automation2]);
84749
+ useEffect(() => {
84750
+ setOptimisticDescription(null);
84751
+ setEditedDescription(automation2?.description ?? "");
84752
+ }, [automation2?.description]);
84719
84753
  if (!automation2 || !actionDataWithMetadata) {
84720
84754
  return null;
84721
84755
  }
@@ -84737,17 +84771,69 @@ const AutomationFlowMain = () => {
84737
84771
  ] });
84738
84772
  };
84739
84773
  }
84774
+ const handleSaveDescription = async () => {
84775
+ setOptimisticDescription(editedDescription);
84776
+ businessUpdateAutomation(
84777
+ {
84778
+ description: editedDescription
84779
+ },
84780
+ {
84781
+ onSuccess: () => {
84782
+ toast2({
84783
+ title: "Description updated 🚀"
84784
+ });
84785
+ setIsEditingDescription(false);
84786
+ }
84787
+ }
84788
+ );
84789
+ };
84790
+ const handleCancelEdit = () => {
84791
+ setIsEditingDescription(false);
84792
+ };
84740
84793
  const renderAutomationDescription = () => {
84741
- if (!automation2.description) return null;
84794
+ if (!automation2.description && !isEditingDescription) return null;
84742
84795
  return /* @__PURE__ */ jsx(
84743
84796
  "div",
84744
84797
  {
84745
- className: "w-full mx-auto rounded-xl bg-neutral-50 dark:bg-neutral-900 shadow-sm px-4 py-3 my-2 border border-neutral-200 dark:border-neutral-800 text-neutral-800 dark:text-neutral-100 text-[15px] font-medium leading-snug tracking-tight justify-start",
84798
+ className: "w-full mx-auto rounded-xl bg-neutral-50 dark:bg-neutral-900 shadow-sm px-4 py-3 my-2 border border-neutral-200 dark:border-neutral-800 text-neutral-800 dark:text-neutral-100 text-[15px] font-medium leading-snug tracking-tight justify-start group relative transition-colors duration-150",
84746
84799
  style: {
84747
- /* Container queries for mobile optimization */
84748
84800
  containerType: "inline-size"
84749
84801
  },
84750
- children: automation2.description
84802
+ tabIndex: 0,
84803
+ onClick: () => {
84804
+ setIsEditingDescription(true);
84805
+ },
84806
+ role: "button",
84807
+ "aria-label": "Edit automation description",
84808
+ children: isEditingDescription ? /* @__PURE__ */ jsxs("div", { className: "flex flex-col gap-2", children: [
84809
+ /* @__PURE__ */ jsx(
84810
+ "textarea",
84811
+ {
84812
+ className: "w-full bg-transparent outline-none resize-none text-[15px] font-medium leading-snug tracking-tight text-neutral-800 dark:text-neutral-100 rounded-xl border border-primary-500 focus:ring-2 focus:ring-primary-400 transition-all min-h-[48px] p-2",
84813
+ style: { containerType: "inline-size" },
84814
+ value: editedDescription,
84815
+ autoFocus: true,
84816
+ rows: 2,
84817
+ maxLength: 300,
84818
+ onChange: (e4) => setEditedDescription(e4.target.value),
84819
+ onBlur: handleCancelEdit,
84820
+ "aria-label": "Edit automation description textarea"
84821
+ }
84822
+ ),
84823
+ /* @__PURE__ */ jsx(
84824
+ Button$1,
84825
+ {
84826
+ variant: "secondary",
84827
+ onClick: handleSaveDescription,
84828
+ onMouseDown: (e4) => e4.preventDefault(),
84829
+ className: "z-20",
84830
+ children: "Update Description"
84831
+ }
84832
+ )
84833
+ ] }) : /* @__PURE__ */ jsxs(Fragment, { children: [
84834
+ /* @__PURE__ */ jsx("span", { className: "pr-8 select-text cursor-pointer", children: optimisticDescription !== null ? optimisticDescription : automation2.description }),
84835
+ /* @__PURE__ */ jsx("span", { className: "absolute right-3 top-1/2 -translate-y-1/2 opacity-0 group-hover:opacity-100 group-focus:opacity-100 transition-opacity duration-150 pointer-events-none", children: /* @__PURE__ */ jsx(IconDefinitions.EditIcon, { className: "w-4 h-4" }) })
84836
+ ] })
84751
84837
  }
84752
84838
  );
84753
84839
  };
@@ -84804,26 +84890,26 @@ const AutomationsEditorSidebar = () => {
84804
84890
  }
84805
84891
  return /* @__PURE__ */ jsx("div", { className: "h-full pt-4 relative", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-y-auto flex flex-col gap-3", children: /* @__PURE__ */ jsx(AutomationFlowMain, {}) }) });
84806
84892
  };
84807
- const AutomationsEditorMain = () => {
84893
+ const AutomationsEditorMain = ({ hideSms }) => {
84808
84894
  const {
84809
84895
  state: { selectedActionId }
84810
84896
  } = useContext$1(Context);
84811
- return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 h-full w-full", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: selectedActionId === BuiltInActionIds.EditTime ? /* @__PURE__ */ jsx(AutomationSelectTimeMain, {}) : selectedActionId === BuiltInActionIds.EditAudience ? /* @__PURE__ */ jsx(AutomationAudienceSelectorMain, {}) : /* @__PURE__ */ jsx(AutomationEditorTabs, {}) }) });
84897
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 h-full w-full", children: /* @__PURE__ */ jsx(AnimatePresence, { mode: "wait", children: selectedActionId === BuiltInActionIds.EditTime ? /* @__PURE__ */ jsx(AutomationSelectTimeMain, {}) : selectedActionId === BuiltInActionIds.EditAudience ? /* @__PURE__ */ jsx(AutomationAudienceSelectorMain, {}) : /* @__PURE__ */ jsx(AutomationEditorTabs, { hideSms }) }) });
84812
84898
  };
84813
- const AutomationsEditorWorkflowTab = () => {
84899
+ const AutomationsEditorWorkflowTab = ({ hideSms }) => {
84814
84900
  return /* @__PURE__ */ jsxs(ResizablePanelGroup, { direction: "horizontal", className: "flex-1", children: [
84815
84901
  /* @__PURE__ */ jsx(ResizablePanel, { defaultSize: 30, minSize: 16, maxSize: 48, children: /* @__PURE__ */ jsx("aside", { className: "h-full", children: /* @__PURE__ */ jsx(AutomationsEditorSidebar, {}) }) }),
84816
84902
  /* @__PURE__ */ jsx(ResizableHandle, { className: "px-1 opacity-0 hover:opacity-100 transition-opacity duration-200 mx-1" }),
84817
- /* @__PURE__ */ jsx(ResizablePanel, { defaultSize: 70, children: /* @__PURE__ */ jsx("main", { className: "h-full", children: /* @__PURE__ */ jsx(AutomationsEditorMain, {}) }) })
84903
+ /* @__PURE__ */ jsx(ResizablePanel, { defaultSize: 70, children: /* @__PURE__ */ jsx("main", { className: "h-full", children: /* @__PURE__ */ jsx(AutomationsEditorMain, { hideSms }) }) })
84818
84904
  ] });
84819
84905
  };
84820
- const AutomationsEditorTabs = () => {
84906
+ const AutomationsEditorTabs = ({ hideSms, hideSales }) => {
84821
84907
  const [activeTab, setActiveTab] = React__default.useState("workflow");
84822
84908
  const tabs = [
84823
84909
  {
84824
84910
  id: "workflow",
84825
84911
  label: "Workflow",
84826
- content: /* @__PURE__ */ jsx(AutomationsEditorWorkflowTab, {})
84912
+ content: /* @__PURE__ */ jsx(AutomationsEditorWorkflowTab, { hideSms })
84827
84913
  },
84828
84914
  {
84829
84915
  id: "recipients",
@@ -84833,7 +84919,7 @@ const AutomationsEditorTabs = () => {
84833
84919
  {
84834
84920
  id: "insights",
84835
84921
  label: t$1("engage:insight", { count: 2 }),
84836
- content: /* @__PURE__ */ jsx(AutomationsEditorStatsTab, {})
84922
+ content: /* @__PURE__ */ jsx(AutomationsEditorStatsTab, { hideSms, hideSales })
84837
84923
  }
84838
84924
  ];
84839
84925
  return /* @__PURE__ */ jsx("div", { className: "h-full w-full", children: /* @__PURE__ */ jsx(
@@ -84850,7 +84936,9 @@ const ViewAutomationMain = ({
84850
84936
  showBackButton = false,
84851
84937
  onDuplicationCreated,
84852
84938
  onBeforeSchedule,
84853
- getExtraMergeFields
84939
+ getExtraMergeFields,
84940
+ hideSms,
84941
+ hideSales
84854
84942
  }) => {
84855
84943
  const automation2 = useAutomation();
84856
84944
  const communicationGroup = useCommunicationGroup();
@@ -84907,7 +84995,7 @@ const ViewAutomationMain = ({
84907
84995
  onBeforeSchedule
84908
84996
  }
84909
84997
  ),
84910
- /* @__PURE__ */ jsx("div", { className: "flex-1 border-t", children: /* @__PURE__ */ jsx(AutomationsEditorTabs, {}) })
84998
+ /* @__PURE__ */ jsx("div", { className: "flex-1 border-t", children: /* @__PURE__ */ jsx(AutomationsEditorTabs, { hideSms, hideSales }) })
84911
84999
  ] });
84912
85000
  };
84913
85001
  const ViewAutomationContent = ({ ...props2 }) => {
package/dist/index.d.ts CHANGED
@@ -300,6 +300,11 @@ export declare type ViewAutomationProps = {
300
300
  estimatedEmailRecipients: number;
301
301
  estimatedSmsRecipients: number;
302
302
  }) => Promise<true | string>;
303
+ /**
304
+ * Optional boolean to hide features
305
+ */
306
+ hideSms?: boolean;
307
+ hideSales?: boolean;
303
308
  };
304
309
 
305
310
  export { }