@embedreach/components 0.3.10 → 0.3.12

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.
@@ -12,6 +12,7 @@ const WEBSITE_BRAND_SETTINGS_PATH = `${WEB_PRESENCE_PATH}/brand-settings`;
12
12
  const CHANNEL_SENDER_PATH = "/channel/senders";
13
13
  const CHANNEL_ACCOUNT_PATH = "/channel/accounts";
14
14
  const COMMUNICATION_GROUP_PATH = "/communication-groups";
15
+ const PARTNER_ME_PATH = "/partners/me";
15
16
  const STRIPO_PATH = "/stripo";
16
17
  const SLACK_NOTIFICATION_PATH = "/slack-notifications";
17
18
  const TELEMETRY_PATH = "/telemetry";
@@ -2553,6 +2554,14 @@ let EventEmitter$2 = class EventEmitter {
2553
2554
  }
2554
2555
  };
2555
2556
  const eventEmitter = new EventEmitter$2();
2557
+ const CACHE_INFINITY = {
2558
+ // Never mark data as stale
2559
+ staleTime: Infinity,
2560
+ // Never remove data from cache
2561
+ gcTime: Infinity,
2562
+ // No need to revalidate on window focus for permanent data
2563
+ refetchOnWindowFocus: false
2564
+ };
2556
2565
  const CACHE_STANDARD = {
2557
2566
  // Consider data stale after 5 minutes
2558
2567
  staleTime: 5 * 60 * 1e3,
@@ -28808,6 +28817,40 @@ const DEFAULT_THEME_STYLES = {
28808
28817
  "font-body": 'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
28809
28818
  "font-heading": '"Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
28810
28819
  };
28820
+ const DEFAULT_DARK_THEME_STYLES = {
28821
+ background: "240 6% 10%",
28822
+ // Very dark gray
28823
+ foreground: "0 0% 98%",
28824
+ // Near white
28825
+ card: "240 6% 12%",
28826
+ "card-foreground": "0 0% 98%",
28827
+ popover: "240 6% 12%",
28828
+ "popover-foreground": "0 0% 98%",
28829
+ primary: "210 30% 88%",
28830
+ // Light slate
28831
+ "primary-foreground": "240 6% 10%",
28832
+ secondary: "240 4% 20%",
28833
+ // Muted dark
28834
+ "secondary-foreground": "0 0% 98%",
28835
+ muted: "240 4% 16%",
28836
+ "muted-foreground": "220 10% 65%",
28837
+ accent: "210 15% 24%",
28838
+ "accent-foreground": "0 0% 98%",
28839
+ destructive: "0 62% 54%",
28840
+ // Softer red for dark
28841
+ "destructive-foreground": "0 0% 98%",
28842
+ border: "240 4% 20%",
28843
+ input: "240 4% 20%",
28844
+ ring: "210 30% 88%",
28845
+ "chart-1": "210 50% 70%",
28846
+ "chart-2": "260 50% 75%",
28847
+ "chart-3": "150 50% 65%",
28848
+ "chart-4": "325 50% 75%",
28849
+ "chart-5": "45 80% 75%",
28850
+ radius: "0.625rem",
28851
+ "font-body": 'Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
28852
+ "font-heading": '"Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif'
28853
+ };
28811
28854
  const normalizeColor = (color2) => {
28812
28855
  const div = document.createElement("div");
28813
28856
  div.style.color = color2;
@@ -29196,14 +29239,14 @@ const tailwindToHsl = (tailwindClass) => {
29196
29239
  const [r2, g2, b3] = colorMap[color2][shade];
29197
29240
  return rgbToShadcnHsl(r2, g2, b3);
29198
29241
  };
29199
- const applyThemeStyles = (styles2) => {
29242
+ const applyThemeStyles = (styles2, darkStyles) => {
29200
29243
  const existingStyles = document.getElementById("reach-theme-styles");
29201
29244
  if (existingStyles) {
29202
29245
  existingStyles.remove();
29203
29246
  }
29204
29247
  const styleElement2 = document.createElement("style");
29205
29248
  styleElement2.id = "reach-theme-styles";
29206
- const cssText = `
29249
+ let cssText = `
29207
29250
  [data-reach-root] {
29208
29251
  ${Object.entries(DEFAULT_THEME_STYLES).map(([key, defaultValue]) => {
29209
29252
  const userValue = styles2[key];
@@ -29245,9 +29288,61 @@ const applyThemeStyles = (styles2) => {
29245
29288
  font-family: var(--reach-font-heading);
29246
29289
  }
29247
29290
  `;
29291
+ if (darkStyles) {
29292
+ cssText += `
29293
+ .dark [data-reach-root] {
29294
+ ${Object.entries(DEFAULT_DARK_THEME_STYLES).map(([key, defaultValue]) => {
29295
+ const userValue = darkStyles[key];
29296
+ let finalValue = defaultValue;
29297
+ if (userValue !== void 0) {
29298
+ if (key === "radius" || key === "font-body" || key === "font-heading") {
29299
+ finalValue = userValue;
29300
+ } else if (isValidColor(userValue)) {
29301
+ const isTailwindClass = /^bg-/.test(userValue.trim()) && userValue.trim() !== "bg-inherit" && userValue.trim() !== "bg-current" && userValue.trim() !== "bg-transparent";
29302
+ if (isTailwindClass) {
29303
+ const className = userValue.replace(/['"]/g, "").trim();
29304
+ finalValue = tailwindToHsl(className);
29305
+ } else {
29306
+ try {
29307
+ finalValue = toShadcnFormat(userValue);
29308
+ } catch (e4) {
29309
+ console.warn(
29310
+ `Failed to convert dark color for ${key}, using default`
29311
+ );
29312
+ }
29313
+ }
29314
+ }
29315
+ }
29316
+ return `--reach-${key}: ${finalValue};`;
29317
+ }).join("\n")}
29318
+ }
29319
+
29320
+ .dark [data-reach-root] {
29321
+ font-family: var(--reach-font-body);
29322
+ }
29323
+ .dark [data-reach-root] h1,
29324
+ .dark [data-reach-root] h2,
29325
+ .dark [data-reach-root] h3,
29326
+ .dark [data-reach-root] h4,
29327
+ .dark [data-reach-root] h5,
29328
+ .dark [data-reach-root] h6 {
29329
+ font-family: var(--reach-font-heading);
29330
+ }
29331
+ `;
29332
+ }
29248
29333
  styleElement2.textContent = cssText;
29249
29334
  document.head.appendChild(styleElement2);
29250
29335
  };
29336
+ const mergeThemeStyles = ({
29337
+ partnerThemeConfig,
29338
+ userOverrides
29339
+ } = {}) => {
29340
+ return {
29341
+ ...DEFAULT_THEME_STYLES,
29342
+ ...partnerThemeConfig?.styles || {},
29343
+ ...userOverrides || {}
29344
+ };
29345
+ };
29251
29346
  const themeReducer = (state, action) => {
29252
29347
  switch (action.type) {
29253
29348
  case "set_theme":
@@ -29288,18 +29383,59 @@ const { Context: Context$3, Provider: BaseProvider } = createDataContext(
29288
29383
  error: null
29289
29384
  }
29290
29385
  );
29386
+ const getPartner = async () => {
29387
+ const response = await baseRequest(PARTNER_ME_PATH);
29388
+ return response.data;
29389
+ };
29390
+ const partnerQueryKey = ["partner"];
29391
+ const usePartner = () => {
29392
+ const query = useQuery({
29393
+ queryKey: partnerQueryKey,
29394
+ queryFn: getPartner,
29395
+ ...CACHE_INFINITY
29396
+ });
29397
+ return query;
29398
+ };
29291
29399
  const ThemeInitializer = ({ initialTheme, children }) => {
29292
29400
  const { setTheme: setTheme2, setLoading: setLoading2 } = React__default.useContext(Context$3);
29401
+ const { data: partnerData, isLoading: isPartnerLoading } = usePartner();
29293
29402
  const themeApplied = useRef(false);
29294
29403
  useEffect(() => {
29295
- if (initialTheme && !themeApplied.current) {
29296
- applyThemeStyles(initialTheme.styles);
29297
- setTheme2(initialTheme);
29404
+ if (isPartnerLoading) {
29405
+ return;
29406
+ }
29407
+ if (!themeApplied.current) {
29408
+ const mergedStyles = mergeThemeStyles({
29409
+ partnerThemeConfig: partnerData?.theme_config,
29410
+ userOverrides: initialTheme?.styles
29411
+ });
29412
+ let mergedDarkStyles = void 0;
29413
+ const darkMode = partnerData?.theme_config?.darkMode || initialTheme?.darkMode;
29414
+ if (darkMode) {
29415
+ mergedDarkStyles = mergeThemeStyles({
29416
+ partnerThemeConfig: {
29417
+ styles: {
29418
+ ...DEFAULT_DARK_THEME_STYLES,
29419
+ ...partnerData?.theme_config?.styles || {}
29420
+ }
29421
+ },
29422
+ userOverrides: initialTheme?.styles
29423
+ });
29424
+ document.documentElement.classList.add("dark");
29425
+ } else {
29426
+ document.documentElement.classList.remove("dark");
29427
+ }
29428
+ applyThemeStyles(mergedStyles, mergedDarkStyles);
29429
+ const finalTheme = {
29430
+ styles: mergedStyles,
29431
+ darkMode
29432
+ };
29433
+ setTheme2(finalTheme);
29298
29434
  themeApplied.current = true;
29299
29435
  } else {
29300
29436
  setLoading2(false);
29301
29437
  }
29302
- }, [initialTheme, setTheme2, setLoading2]);
29438
+ }, [initialTheme, partnerData, isPartnerLoading, setTheme2, setLoading2]);
29303
29439
  return /* @__PURE__ */ jsx(Fragment$1, { children });
29304
29440
  };
29305
29441
  const Provider$4 = ({ initialTheme, children }) => {
@@ -32157,6 +32293,8 @@ const measure$1 = {
32157
32293
  missing_website_tracking_banner_title: "Metrics are being processed",
32158
32294
  missing_website_tracking_banner_description: "We're preparing your dashboard and calculating your metrics. To see accurate campaign performance, please ensure tracking is set up on your website. This could take a few hours to a few days to complete but your data will be available soon.",
32159
32295
  missing_website_tracking_banner_action: "Setup Tracking On My Website",
32296
+ update_meta_ads_tracking_banner_title: "Update Your Meta Ads Tracking Parameters",
32297
+ update_meta_ads_tracking_banner_description: "Some of your Meta ads are missing our required tracking parameters for proper attribution. Please update them as soon as possible to ensure accurate attribution.",
32160
32298
  reach_managed_campaign_banner_title: "Campaign Data Processing",
32161
32299
  reach_managed_campaign_banner_description: "Your latest ad campaign data is currently being processed and will be available soon."
32162
32300
  },
@@ -32703,6 +32841,8 @@ const measure = {
32703
32841
  missing_website_tracking_banner_title: "Métricas están siendo procesadas",
32704
32842
  missing_website_tracking_banner_description: "Estamos preparando tu panel y calculando tus métricas. Para ver el rendimiento de tus campañas de manera precisa, por favor asegúrate de que el seguimiento esté configurado en tu sitio web. Esto puede tomar unas horas o unos días para completarse, pero tus datos estarán disponibles pronto.",
32705
32843
  missing_website_tracking_banner_action: "Configurar seguimiento en mi sitio web",
32844
+ update_meta_ads_tracking_banner_title: "Actualizar parámetros de seguimiento de anuncios de Meta",
32845
+ update_meta_ads_tracking_banner_description: "Algunos de tus anuncios de Meta están faltando nuestros parámetros de seguimiento requeridos para una atribución precisa. Por favor, actualízalos lo antes posible para garantizar una atribución precisa.",
32706
32846
  reach_managed_campaign_banner_title: "Datos de campaña procesando",
32707
32847
  reach_managed_campaign_banner_description: "Tus datos de campaña de anuncios están siendo procesados y estarán disponibles pronto."
32708
32848
  },
@@ -33314,6 +33454,8 @@ const defaultTranslations = {
33314
33454
  missing_website_tracking_banner_title: "Metrics are being processed",
33315
33455
  missing_website_tracking_banner_description: "We're preparing your dashboard and calculating your metrics. To see accurate campaign performance, please ensure tracking is set up on your website. This could take a few hours to a few days to complete but your data will be available soon.",
33316
33456
  missing_website_tracking_banner_action: "Setup Tracking On My Website",
33457
+ update_meta_ads_tracking_banner_title: "Update Your Meta Ads Tracking Parameters",
33458
+ update_meta_ads_tracking_banner_description: "Some of your Meta ads are missing our required tracking parameters for proper attribution. Please update them as soon as possible to ensure accurate attribution.",
33317
33459
  reach_managed_campaign_banner_title: "Campaign Data Processing",
33318
33460
  reach_managed_campaign_banner_description: "Your latest ad campaign data is currently being processed and will be available soon."
33319
33461
  },
@@ -91447,7 +91589,7 @@ const getEmailChannelSendersWithChannelAccounts = (args) => {
91447
91589
  (account) => account.id === sender.channelAccountId
91448
91590
  );
91449
91591
  if (!channelAccount) return [];
91450
- if (channelAccount.channelAccountMetadata.type === ChannelAccountTypeEnum.REACH_MANAGED) {
91592
+ if (channelAccount.channelAccountMetadata.type === ChannelAccountTypeEnum.REACH_MANAGED || channelAccount.channelAccountMetadata.type === ChannelAccountTypeEnum.REACH_MANAGED_SES) {
91451
91593
  return [
91452
91594
  {
91453
91595
  channelSenderId: sender.id,
@@ -96972,7 +97114,7 @@ function MultiSelectDialog({
96972
97114
  ] })
96973
97115
  ] }) }),
96974
97116
  /* @__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: [
97117
+ /* @__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
97118
  extraCommandItems.length > 0 && /* @__PURE__ */ jsxs(Fragment$1, { children: [
96977
97119
  extraCommandItems.map((renderItem, index2) => /* @__PURE__ */ jsx("div", { className: "px-3 py-2", children: renderItem(setOpen) }, `extra-command-${index2}`)),
96978
97120
  /* @__PURE__ */ jsx(Separator, { className: "my-2" })
@@ -97295,22 +97437,19 @@ const SMSEditor = ({
97295
97437
  singleSelect: true
97296
97438
  }
97297
97439
  ),
97298
- /* @__PURE__ */ jsx(InfoTooltip, { title: "Merge Fields" })
97440
+ /* @__PURE__ */ jsx(
97441
+ InfoTooltip,
97442
+ {
97443
+ size: "large",
97444
+ title: "Merge fields are placeholders for dynamic content. For example you can use the recipients name, or email in the contents of your message."
97445
+ }
97446
+ )
97299
97447
  ] }),
97300
97448
  /* @__PURE__ */ jsxs(
97301
97449
  "div",
97302
97450
  {
97303
- className: `flex items-center gap-2 text-sm transition-colors duration-300 ${characterCountFormatted.colorClass}`,
97451
+ className: `flex items-center gap-2 text-xs transition-colors duration-300 ${characterCountFormatted.colorClass}`,
97304
97452
  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
97453
  characterCountFormatted.text,
97315
97454
  characterCount > SMS_LIMITS.RECOMMENDED_LIMIT && /* @__PURE__ */ jsx(
97316
97455
  InfoTooltip,
@@ -97331,7 +97470,16 @@ const SMSEditor = ({
97331
97470
  ]
97332
97471
  }
97333
97472
  )
97334
- ] })
97473
+ ] }),
97474
+ /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: /* @__PURE__ */ jsx(
97475
+ SavingIndicator,
97476
+ {
97477
+ isSaving: !!(isUpdating || hasUnsavedChanges),
97478
+ savingText: isUpdating || hasUnsavedChanges ? "Saving..." : "Autosave enabled",
97479
+ size: "xs",
97480
+ textSize: "xs"
97481
+ }
97482
+ ) })
97335
97483
  ] });
97336
97484
  };
97337
97485
  const SMSSenderAndCompanyEditor = React__default.memo(
@@ -97566,7 +97714,7 @@ const SMSEditorContent = ({
97566
97714
  if (isInitialMountRef.current) {
97567
97715
  return;
97568
97716
  }
97569
- const rawSMSBody = debouncedMessage || "";
97717
+ const rawSMSBody = editingMessage || "";
97570
97718
  if (rawSMSBody.length > SMS_ABSOLUTE_LIMIT) {
97571
97719
  toast2({
97572
97720
  title: "SMS is too long",
@@ -97603,7 +97751,7 @@ const SMSEditorContent = ({
97603
97751
  });
97604
97752
  }
97605
97753
  }, [
97606
- debouncedMessage,
97754
+ editingMessage,
97607
97755
  communicationGroupId,
97608
97756
  updateCommunicationGroup2,
97609
97757
  toast2,
@@ -97729,20 +97877,14 @@ const SMSEditorContent = ({
97729
97877
  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
97878
  }
97731
97879
  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
- ] }),
97880
+ /* @__PURE__ */ jsx("div", { className: "flex items-center justify-between mb-6", children: /* @__PURE__ */ jsx(
97881
+ MemoizedSMSSenderAndCompanyEditor$1,
97882
+ {
97883
+ communicationGroupId,
97884
+ initialSenderId: initialSenderId || null,
97885
+ companyName: initialCompanyNameRef.current || null
97886
+ }
97887
+ ) }),
97746
97888
  /* @__PURE__ */ jsxs("div", { className: "flex flex-col lg:flex-row gap-6 h-full", children: [
97747
97889
  /* @__PURE__ */ jsxs("div", { className: "flex-1 min-w-0", children: [
97748
97890
  imagePreview && /* @__PURE__ */ jsx("div", { className: "flex justify-center mb-6", children: /* @__PURE__ */ jsx("div", { className: "relative group w-fit", children: /* @__PURE__ */ jsx(
@@ -97785,7 +97927,7 @@ const SMSEditorContent = ({
97785
97927
  }
97786
97928
  )
97787
97929
  ] }),
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(
97930
+ /* @__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
97931
  SMSPreview,
97790
97932
  {
97791
97933
  body: buildFinalSMSBody({
@@ -97815,7 +97957,7 @@ const EditSMSContent = () => {
97815
97957
  if (isGetMergeFieldsLoading || !getMergeFields2) {
97816
97958
  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
97959
  }
97818
- return /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative", children: [
97960
+ return /* @__PURE__ */ jsxs("div", { className: "bg-white rounded-2xl w-full p-6 space-y-4 relative", children: [
97819
97961
  /* @__PURE__ */ jsx(TitleAndResetButton, { title: "SMS Campaign", type: ChannelType.SMS }),
97820
97962
  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
97963
  SMSEditorContent,
@@ -99021,7 +99163,8 @@ const useEmailChannelSenders = () => {
99021
99163
  }, [channelSenders?.results, channelAccounts?.results]);
99022
99164
  };
99023
99165
  const EmailDetailsPreview = ({
99024
- mergeFieldsResponse
99166
+ mergeFieldsResponse,
99167
+ disableEditContent
99025
99168
  }) => {
99026
99169
  const automation2 = useAutomation();
99027
99170
  const communicationGroup = useCommunicationGroup();
@@ -99178,7 +99321,7 @@ const EmailDetailsPreview = ({
99178
99321
  )
99179
99322
  ] }),
99180
99323
  /* @__PURE__ */ jsxs(Popover, { open: popoverOpen, onOpenChange: handlePopoverClose, children: [
99181
- /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
99324
+ /* @__PURE__ */ jsx(PopoverTrigger, { asChild: true, children: !disableEditContent && /* @__PURE__ */ jsxs(
99182
99325
  Button$1,
99183
99326
  {
99184
99327
  size: "sm",
@@ -99727,6 +99870,7 @@ const AutomationEditorEmailPreview = ({
99727
99870
  const showPreview = !disablePreview && hasEmailContent;
99728
99871
  const showChannelDisabledWarning = !communicationGroup.emailChannelSenderId || emailChannelSenders.length === 0;
99729
99872
  const EditButton = () => {
99873
+ if (disableEditContent) return null;
99730
99874
  const button = /* @__PURE__ */ jsxs(
99731
99875
  Button$1,
99732
99876
  {
@@ -99849,8 +99993,14 @@ const AutomationEditorEmailPreview = ({
99849
99993
  }
99850
99994
  ),
99851
99995
  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 }) }),
99996
+ 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: [
99997
+ /* @__PURE__ */ jsx("div", { className: "w-full flex-shrink-0 max-w-2xl mx-auto rounded-md", children: /* @__PURE__ */ jsx(
99998
+ EmailDetailsPreview,
99999
+ {
100000
+ mergeFieldsResponse: getMergeFields2,
100001
+ disableEditContent
100002
+ }
100003
+ ) }),
99854
100004
  /* @__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
100005
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 w-full justify-end p-3", children: [
99856
100006
  /* @__PURE__ */ jsx(ResetToDefaultButton, { type: ChannelType.EMAIL }),
@@ -99952,7 +100102,7 @@ const MemoizedSMSSenderAndCompanyEditor = React__default.memo(
99952
100102
  );
99953
100103
  }
99954
100104
  );
99955
- const SMSDetailsPreview = () => {
100105
+ const SMSDetailsPreview = ({ disableEditContent }) => {
99956
100106
  const automation2 = useAutomation();
99957
100107
  const communicationGroup = useCommunicationGroup();
99958
100108
  const { channelSenders } = useChannelSender();
@@ -100003,7 +100153,7 @@ const SMSDetailsPreview = () => {
100003
100153
  }
100004
100154
  )
100005
100155
  ] }),
100006
- /* @__PURE__ */ jsx(
100156
+ !disableEditContent && /* @__PURE__ */ jsx(
100007
100157
  MemoizedSMSSenderAndCompanyEditor,
100008
100158
  {
100009
100159
  trigger: /* @__PURE__ */ jsx(MemoizedTriggerButton, {}),
@@ -100099,6 +100249,7 @@ const AutomationEditorSMSPreview = ({
100099
100249
  const showPreview = !disablePreview && hasSendableSmsContent;
100100
100250
  const showChannelDisabledWarning = !communicationGroup?.smsChannelSenderId || smsChannelSenders.length === 0;
100101
100251
  const EditButton = () => {
100252
+ if (disableEditContent) return null;
100102
100253
  const button = /* @__PURE__ */ jsxs(
100103
100254
  Button$1,
100104
100255
  {
@@ -100186,8 +100337,13 @@ const AutomationEditorSMSPreview = ({
100186
100337
  ) })
100187
100338
  ] }) }),
100188
100339
  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, {}) }),
100340
+ 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: [
100341
+ /* @__PURE__ */ jsx("div", { className: "w-full flex-shrink-0 max-w-2xl mx-auto rounded-md", children: /* @__PURE__ */ jsx(
100342
+ SMSDetailsPreview,
100343
+ {
100344
+ disableEditContent
100345
+ }
100346
+ ) }),
100191
100347
  /* @__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
100348
  /* @__PURE__ */ jsxs("div", { className: "flex items-center space-x-2 w-full justify-end p-3", children: [
100193
100349
  /* @__PURE__ */ jsx(ResetToDefaultButton, { type: ChannelType.SMS }),
@@ -106548,7 +106704,7 @@ const SelectSenderScreen = () => {
106548
106704
  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
106705
  }
106550
106706
  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(
106707
+ 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
106708
  SelectEmailOrSMS,
106553
106709
  {
106554
106710
  automationType: automation2?.triggerMetadata?.triggerType,
@@ -107250,7 +107406,7 @@ const OneTimeWizardMain = ({ onFinish, getExtraMergeFields, onBeforeSchedule })
107250
107406
  step.step
107251
107407
  )) });
107252
107408
  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(
107409
+ const renderFooter = () => /* @__PURE__ */ jsx("footer", { className: "w-full flex justify-end z-10 items-center h-16 px-6", children: /* @__PURE__ */ jsx(
107254
107410
  BackNextButtonGroup,
107255
107411
  {
107256
107412
  handleSkipAndSaveAsDraft,
@@ -107269,7 +107425,7 @@ const OneTimeWizardMain = ({ onFinish, getExtraMergeFields, onBeforeSchedule })
107269
107425
  return /* @__PURE__ */ jsxs("div", { className: "flex-1 flex flex-col @container h-full min-h-0", children: [
107270
107426
  renderHeader(),
107271
107427
  /* @__PURE__ */ jsxs("main", { className: "flex gap-4 flex-1 min-h-0", children: [
107272
- /* @__PURE__ */ jsx("div", { className: "hidden @[1000px]:block", children: renderStepNav() }),
107428
+ /* @__PURE__ */ jsx("div", { className: "block", children: renderStepNav() }),
107273
107429
  renderContent()
107274
107430
  ] }),
107275
107431
  renderFooter()
@@ -107583,7 +107739,8 @@ function CreateAutomationDialog({
107583
107739
  replyToSettingsText,
107584
107740
  replyToSettingsLink,
107585
107741
  fromNameSettingsText,
107586
- fromNameSettingsLink
107742
+ fromNameSettingsLink,
107743
+ onBeforeSchedule
107587
107744
  }) {
107588
107745
  const onCloseInner = (createdAutomation) => {
107589
107746
  onClose?.(createdAutomation);
@@ -107623,7 +107780,8 @@ function CreateAutomationDialog({
107623
107780
  automationType,
107624
107781
  currentStep,
107625
107782
  setCurrentStep,
107626
- getExtraMergeFields
107783
+ getExtraMergeFields,
107784
+ onBeforeSchedule
107627
107785
  }
107628
107786
  )
107629
107787
  ]
@@ -22811,7 +22811,19 @@ const handlers = [
22811
22811
  message: "Success (Sandbox)",
22812
22812
  data: null
22813
22813
  });
22814
- })
22814
+ }),
22815
+ http.get(
22816
+ `${HOSTNAME}/api/ad-platform-tracking/meta/check-for-existing?ad_account_id=sandbox-m-act-789`,
22817
+ async () => {
22818
+ return HttpResponse.json({
22819
+ success: true,
22820
+ message: "Success (Sandbox)",
22821
+ data: {
22822
+ ads_with_tracking: []
22823
+ }
22824
+ });
22825
+ }
22826
+ )
22815
22827
  ];
22816
22828
  const worker = setupWorker(...handlers);
22817
22829
  const MAX_RETRIES = 3;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { default as default_2 } from 'react';
2
2
  import { JSX as JSX_2 } from 'react/jsx-runtime';
3
+ import { ThemeConfig } from '@reach/shared-types/theme';
3
4
 
4
5
  export declare enum AutomationTriggerType {
5
6
  ONE_TIME = "one_time",
@@ -7,7 +8,7 @@ export declare enum AutomationTriggerType {
7
8
  DATE_BASED = "date_based"
8
9
  }
9
10
 
10
- export declare function CreateAutomationDialog({ open, setOpen, onClose, automationType, getExtraMergeFields, replyToSettingsText, replyToSettingsLink, fromNameSettingsText, fromNameSettingsLink, }: CreateAutomationDialogProps): JSX_2.Element;
11
+ export declare function CreateAutomationDialog({ open, setOpen, onClose, automationType, getExtraMergeFields, replyToSettingsText, replyToSettingsLink, fromNameSettingsText, fromNameSettingsLink, onBeforeSchedule, }: CreateAutomationDialogProps): JSX_2.Element;
11
12
 
12
13
  declare interface CreateAutomationDialogProps extends CreateAutomationModalProps {
13
14
  /**
@@ -247,53 +248,7 @@ declare type StaticMergeField = ReachMergeFieldBase & {
247
248
  templateName: string;
248
249
  };
249
250
 
250
- /**
251
- * Theme initialization options that can be passed to ReachProvider
252
- */
253
- export declare interface ThemeConfig {
254
- /** Optional overrides for theme styles */
255
- styles: Partial<ThemeStyles>;
256
- /** Dark mode toggle */
257
- darkMode?: boolean;
258
- }
259
-
260
- /**
261
- * Theme styles incorporating shadcn variables
262
- *
263
- * Matches what we say in our dev docs here:
264
- * https://docs.embedreach.com/sdk/customization
265
- *
266
- * @interface ThemeStyles
267
- */
268
- declare interface ThemeStyles {
269
- background?: string;
270
- foreground?: string;
271
- card?: string;
272
- 'card-foreground'?: string;
273
- popover?: string;
274
- 'popover-foreground'?: string;
275
- primary?: string;
276
- 'primary-foreground'?: string;
277
- secondary?: string;
278
- 'secondary-foreground'?: string;
279
- muted?: string;
280
- 'muted-foreground'?: string;
281
- accent?: string;
282
- 'accent-foreground'?: string;
283
- destructive?: string;
284
- 'destructive-foreground'?: string;
285
- border?: string;
286
- input?: string;
287
- ring?: string;
288
- 'chart-1'?: string;
289
- 'chart-2'?: string;
290
- 'chart-3'?: string;
291
- 'chart-4'?: string;
292
- 'chart-5'?: string;
293
- radius?: string;
294
- 'font-body'?: string;
295
- 'font-heading'?: string;
296
- }
251
+ export { ThemeConfig }
297
252
 
298
253
  export declare const ViewAutomationModal: default_2.FC<ViewAutomationProps & {
299
254
  inRouter?: boolean;