@embedreach/components 0.3.10 → 0.3.11

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.
@@ -96972,7 +96972,7 @@ function MultiSelectDialog({
96972
96972
  ] })
96973
96973
  ] }) }),
96974
96974
  /* @__PURE__ */ jsx(Separator, {}),
96975
- /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 max-h-[300px]", children: /* @__PURE__ */ jsx(Command, { className: "rounded-none border-none", children: /* @__PURE__ */ jsxs(CommandGroup, { children: [
96975
+ /* @__PURE__ */ jsx(ScrollArea, { className: "flex-1 max-h-[300px] rounded-md", children: /* @__PURE__ */ jsx(Command, { className: "rounded-none border-none", children: /* @__PURE__ */ jsxs(CommandGroup, { children: [
96976
96976
  extraCommandItems.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
96977
96977
  extraCommandItems.map((renderItem, index2) => /* @__PURE__ */ jsx("div", { className: "px-3 py-2", children: renderItem(setOpen) }, `extra-command-${index2}`)),
96978
96978
  /* @__PURE__ */ jsx(Separator, { className: "my-2" })
@@ -97295,22 +97295,19 @@ const SMSEditor = ({
97295
97295
  singleSelect: true
97296
97296
  }
97297
97297
  ),
97298
- /* @__PURE__ */ jsx(InfoTooltip, { title: "Merge Fields" })
97298
+ /* @__PURE__ */ jsx(
97299
+ InfoTooltip,
97300
+ {
97301
+ size: "large",
97302
+ title: "Merge fields are placeholders for dynamic content. For example you can use the recipients name, or email in the contents of your message."
97303
+ }
97304
+ )
97299
97305
  ] }),
97300
97306
  /* @__PURE__ */ jsxs(
97301
97307
  "div",
97302
97308
  {
97303
- className: `flex items-center gap-2 text-sm transition-colors duration-300 ${characterCountFormatted.colorClass}`,
97309
+ className: `flex items-center gap-2 text-xs transition-colors duration-300 ${characterCountFormatted.colorClass}`,
97304
97310
  children: [
97305
- /* @__PURE__ */ jsx(
97306
- SavingIndicator,
97307
- {
97308
- isSaving: !!(isUpdating || hasUnsavedChanges),
97309
- savingText: isUpdating || hasUnsavedChanges ? "Saving..." : "Autosave enabled",
97310
- size: "xs",
97311
- textSize: "xs"
97312
- }
97313
- ),
97314
97311
  characterCountFormatted.text,
97315
97312
  characterCount > SMS_LIMITS.RECOMMENDED_LIMIT && /* @__PURE__ */ jsx(
97316
97313
  InfoTooltip,
@@ -97331,7 +97328,16 @@ const SMSEditor = ({
97331
97328
  ]
97332
97329
  }
97333
97330
  )
97334
- ] })
97331
+ ] }),
97332
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
97333
+ SavingIndicator,
97334
+ {
97335
+ isSaving: !!(isUpdating || hasUnsavedChanges),
97336
+ savingText: isUpdating || hasUnsavedChanges ? "Saving..." : "Autosave enabled",
97337
+ size: "xs",
97338
+ textSize: "xs"
97339
+ }
97340
+ ) })
97335
97341
  ] });
97336
97342
  };
97337
97343
  const SMSSenderAndCompanyEditor = React__default.memo(
@@ -97566,7 +97572,7 @@ const SMSEditorContent = ({
97566
97572
  if (isInitialMountRef.current) {
97567
97573
  return;
97568
97574
  }
97569
- const rawSMSBody = debouncedMessage || "";
97575
+ const rawSMSBody = editingMessage || "";
97570
97576
  if (rawSMSBody.length > SMS_ABSOLUTE_LIMIT) {
97571
97577
  toast2({
97572
97578
  title: "SMS is too long",
@@ -97603,7 +97609,7 @@ const SMSEditorContent = ({
97603
97609
  });
97604
97610
  }
97605
97611
  }, [
97606
- debouncedMessage,
97612
+ editingMessage,
97607
97613
  communicationGroupId,
97608
97614
  updateCommunicationGroup2,
97609
97615
  toast2,
@@ -97729,20 +97735,14 @@ const SMSEditorContent = ({
97729
97735
  return /* @__PURE__ */ jsx("div", { className: "flex justify-center items-center p-8", children: /* @__PURE__ */ jsx("div", { className: "text-sm text-muted-foreground", children: "Loading editor..." }) });
97730
97736
  }
97731
97737
  return /* @__PURE__ */ jsxs("div", { className: cn$2("w-full @container", className), children: [
97732
- /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between mb-6", children: [
97733
- /* @__PURE__ */ jsxs("div", { children: [
97734
- /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-gray-700 mb-2", children: "Live Preview" }),
97735
- /* @__PURE__ */ jsx("div", { className: "text-xs text-gray-500", children: "See how your message will appear to customers" })
97736
- ] }),
97737
- /* @__PURE__ */ jsx(
97738
- MemoizedSMSSenderAndCompanyEditor$1,
97739
- {
97740
- communicationGroupId,
97741
- initialSenderId: initialSenderId || null,
97742
- companyName: initialCompanyNameRef.current || null
97743
- }
97744
- )
97745
- ] }),
97738
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between mb-6", children: /* @__PURE__ */ jsx(
97739
+ MemoizedSMSSenderAndCompanyEditor$1,
97740
+ {
97741
+ communicationGroupId,
97742
+ initialSenderId: initialSenderId || null,
97743
+ companyName: initialCompanyNameRef.current || null
97744
+ }
97745
+ ) }),
97746
97746
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row gap-6 h-full", children: [
97747
97747
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
97748
97748
  imagePreview && /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ jsx("div", { className: "relative group w-fit", children: /* @__PURE__ */ jsx(
@@ -97785,7 +97785,7 @@ const SMSEditorContent = ({
97785
97785
  }
97786
97786
  )
97787
97787
  ] }),
97788
- /* @__PURE__ */ jsx("div", { className: "hidden @lg:block flex-1 min-w-0", children: /* @__PURE__ */ jsx("div", { className: "sticky top-4", children: /* @__PURE__ */ jsx("div", { className: "bg-gray-50 rounded-xl p-4 border border-gray-200", children: /* @__PURE__ */ jsx(
97788
+ /* @__PURE__ */ jsx("div", { className: "block flex-1 min-w-0", children: /* @__PURE__ */ jsx("div", { className: "sticky top-4", children: /* @__PURE__ */ jsx("div", { className: "bg-gray-50 rounded-xl p-4 border border-gray-200", children: /* @__PURE__ */ jsx(
97789
97789
  SMSPreview,
97790
97790
  {
97791
97791
  body: buildFinalSMSBody({
@@ -97815,7 +97815,7 @@ const EditSMSContent = () => {
97815
97815
  if (isGetMergeFieldsLoading || !getMergeFields2) {
97816
97816
  return /* @__PURE__ */ jsx("div", { className: "flex justify-center items-center flex-1 h-full bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative", children: /* @__PURE__ */ jsx(BasicLoader, { text: ["Fetching Content..."] }) });
97817
97817
  }
97818
- return /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative", children: [
97818
+ return /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-2xl w-full p-6 space-y-4 relative", children: [
97819
97819
  /* @__PURE__ */ jsx(TitleAndResetButton, { title: "SMS Campaign", type: ChannelType.SMS }),
97820
97820
  hasAnySMSsenders === false ? /* @__PURE__ */ jsx("div", { className: "w-full pt-8 mx-auto", children: /* @__PURE__ */ jsx(SMSSetup, {}) }) : /* @__PURE__ */ jsx("div", { className: "space-y-6", children: /* @__PURE__ */ jsx(
97821
97821
  SMSEditorContent,
@@ -99021,7 +99021,8 @@ const useEmailChannelSenders = () => {
99021
99021
  }, [channelSenders?.results, channelAccounts?.results]);
99022
99022
  };
99023
99023
  const EmailDetailsPreview = ({
99024
- mergeFieldsResponse
99024
+ mergeFieldsResponse,
99025
+ disableEditContent
99025
99026
  }) => {
99026
99027
  const automation2 = useAutomation();
99027
99028
  const communicationGroup = useCommunicationGroup();
@@ -99178,7 +99179,7 @@ const EmailDetailsPreview = ({
99178
99179
  )
99179
99180
  ] }),
99180
99181
  /* @__PURE__ */ jsxs(Popover, { open: popoverOpen, onOpenChange: handlePopoverClose, children: [
99181
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
99182
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: !disableEditContent && /* @__PURE__ */ jsxs(
99182
99183
  Button$1,
99183
99184
  {
99184
99185
  size: "sm",
@@ -99727,6 +99728,7 @@ const AutomationEditorEmailPreview = ({
99727
99728
  const showPreview = !disablePreview && hasEmailContent;
99728
99729
  const showChannelDisabledWarning = !communicationGroup.emailChannelSenderId || emailChannelSenders.length === 0;
99729
99730
  const EditButton = () => {
99731
+ if (disableEditContent) return null;
99730
99732
  const button = /* @__PURE__ */ jsxs(
99731
99733
  Button$1,
99732
99734
  {
@@ -99849,8 +99851,14 @@ const AutomationEditorEmailPreview = ({
99849
99851
  }
99850
99852
  ),
99851
99853
  showChannelDisabledWarning && /* @__PURE__ */ jsx(ChannelDisabledWarning, { channelType: "email" }),
99852
- hasEmailContent ? /* @__PURE__ */ jsx("div", { className: "relative flex-1 w-full flex flex-col overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-y-auto flex flex-col", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-4 px-4 pb-20", children: [
99853
- /* @__PURE__ */ jsx("div", { className: "w-full flex-shrink-0 max-w-2xl mx-auto rounded-md", children: /* @__PURE__ */ jsx(EmailDetailsPreview, { mergeFieldsResponse: getMergeFields2 }) }),
99854
+ hasEmailContent ? /* @__PURE__ */ jsx("div", { className: "flex-1 w-full flex flex-col overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col space-y-4 px-4 pt-4 pb-20", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-4 px-4 pb-20", children: [
99855
+ /* @__PURE__ */ jsx("div", { className: "w-full flex-shrink-0 max-w-2xl mx-auto rounded-md", children: /* @__PURE__ */ jsx(
99856
+ EmailDetailsPreview,
99857
+ {
99858
+ mergeFieldsResponse: getMergeFields2,
99859
+ disableEditContent
99860
+ }
99861
+ ) }),
99854
99862
  /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-background flex-1 min-h-0 flex flex-col items-center max-w-2xl mx-auto w-full", children: [
99855
99863
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 w-full justify-end p-3", children: [
99856
99864
  /* @__PURE__ */ jsx(ResetToDefaultButton, { type: ChannelType.EMAIL }),
@@ -99952,7 +99960,7 @@ const MemoizedSMSSenderAndCompanyEditor = React__default.memo(
99952
99960
  );
99953
99961
  }
99954
99962
  );
99955
- const SMSDetailsPreview = () => {
99963
+ const SMSDetailsPreview = ({ disableEditContent }) => {
99956
99964
  const automation2 = useAutomation();
99957
99965
  const communicationGroup = useCommunicationGroup();
99958
99966
  const { channelSenders } = useChannelSender();
@@ -100003,7 +100011,7 @@ const SMSDetailsPreview = () => {
100003
100011
  }
100004
100012
  )
100005
100013
  ] }),
100006
- /* @__PURE__ */ jsx(
100014
+ !disableEditContent && /* @__PURE__ */ jsx(
100007
100015
  MemoizedSMSSenderAndCompanyEditor,
100008
100016
  {
100009
100017
  trigger: /* @__PURE__ */ jsx(MemoizedTriggerButton, {}),
@@ -100099,6 +100107,7 @@ const AutomationEditorSMSPreview = ({
100099
100107
  const showPreview = !disablePreview && hasSendableSmsContent;
100100
100108
  const showChannelDisabledWarning = !communicationGroup?.smsChannelSenderId || smsChannelSenders.length === 0;
100101
100109
  const EditButton = () => {
100110
+ if (disableEditContent) return null;
100102
100111
  const button = /* @__PURE__ */ jsxs(
100103
100112
  Button$1,
100104
100113
  {
@@ -100186,8 +100195,13 @@ const AutomationEditorSMSPreview = ({
100186
100195
  ) })
100187
100196
  ] }) }),
100188
100197
  showChannelDisabledWarning && /* @__PURE__ */ jsx(ChannelDisabledWarning, { channelType: "sms" }),
100189
- hasAnySMSsenders ? /* @__PURE__ */ jsx("div", { className: "relative flex-1 w-full flex flex-col overflow-hidden h-full", children: /* @__PURE__ */ jsx("div", { className: "absolute inset-0 overflow-y-auto flex flex-col", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-4 px-4 pt-4 pb-20", children: [
100190
- /* @__PURE__ */ jsx("div", { className: "w-full flex-shrink-0 max-w-2xl mx-auto rounded-md", children: /* @__PURE__ */ jsx(SMSDetailsPreview, {}) }),
100198
+ hasAnySMSsenders ? /* @__PURE__ */ jsx("div", { className: "flex-1 w-full flex flex-col overflow-y-auto", children: /* @__PURE__ */ jsx("div", { className: "flex flex-col space-y-4 px-4 pt-4 pb-20", children: /* @__PURE__ */ jsxs("div", { className: "flex flex-col space-y-4 px-4 pt-4 pb-20", children: [
100199
+ /* @__PURE__ */ jsx("div", { className: "w-full flex-shrink-0 max-w-2xl mx-auto rounded-md", children: /* @__PURE__ */ jsx(
100200
+ SMSDetailsPreview,
100201
+ {
100202
+ disableEditContent
100203
+ }
100204
+ ) }),
100191
100205
  /* @__PURE__ */ jsxs("div", { className: "rounded-lg bg-background flex-1 min-h-0 flex flex-col items-center max-w-2xl mx-auto w-full", children: [
100192
100206
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 w-full justify-end p-3", children: [
100193
100207
  /* @__PURE__ */ jsx(ResetToDefaultButton, { type: ChannelType.SMS }),
@@ -106548,7 +106562,7 @@ const SelectSenderScreen = () => {
106548
106562
  return /* @__PURE__ */ jsx("div", { className: "flex justify-center items-center flex-1 h-full bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative", children: /* @__PURE__ */ jsx(BasicLoader, { text: ["Fetching Content..."] }) });
106549
106563
  }
106550
106564
  const hasEmailChannelSenders = emailChannelSendersWithChannelAccounts.length > 0;
106551
- return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 flex-shrink-0", children: /* @__PURE__ */ jsx("div", { className: "bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative", children: /* @__PURE__ */ jsx(
106565
+ return /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-4 flex-shrink-0", children: /* @__PURE__ */ jsx("div", { className: "bg-white rounded-2xl w-full p-6 space-y-4 relative", children: /* @__PURE__ */ jsx(
106552
106566
  SelectEmailOrSMS,
106553
106567
  {
106554
106568
  automationType: automation2?.triggerMetadata?.triggerType,
@@ -107250,7 +107264,7 @@ const OneTimeWizardMain = ({ onFinish, getExtraMergeFields, onBeforeSchedule })
107250
107264
  step.step
107251
107265
  )) });
107252
107266
  const renderContent = () => /* @__PURE__ */ jsx("section", { className: "flex-1 mr-6 w-full relative rounded-xl bg-gray-100 ml-6 @[1000px]:ml-0", children: /* @__PURE__ */ jsx("div", { className: " overflow-y-auto top-0 left-0 right-0 bottom-0 flex-1 h-full flex-col flex", children: /* @__PURE__ */ jsx(BlurDiv, { className: "pt-0 h-full", children: STEPS.find((step) => step.step === currentStep)?.content }, currentStep) }) });
107253
- const renderFooter = () => /* @__PURE__ */ jsx("footer", { className: "w-full flex justify-end shadow-md z-10 items-center h-16 px-6", children: /* @__PURE__ */ jsx(
107267
+ const renderFooter = () => /* @__PURE__ */ jsx("footer", { className: "w-full flex justify-end z-10 items-center h-16 px-6", children: /* @__PURE__ */ jsx(
107254
107268
  BackNextButtonGroup,
107255
107269
  {
107256
107270
  handleSkipAndSaveAsDraft,
@@ -107269,7 +107283,7 @@ const OneTimeWizardMain = ({ onFinish, getExtraMergeFields, onBeforeSchedule })
107269
107283
  return /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col @container h-full min-h-0", children: [
107270
107284
  renderHeader(),
107271
107285
  /* @__PURE__ */ jsxs("main", { className: "flex gap-4 flex-1 min-h-0", children: [
107272
- /* @__PURE__ */ jsx("div", { className: "hidden @[1000px]:block", children: renderStepNav() }),
107286
+ /* @__PURE__ */ jsx("div", { className: "block", children: renderStepNav() }),
107273
107287
  renderContent()
107274
107288
  ] }),
107275
107289
  renderFooter()