@octaviaflow/core 3.1.0-beta.89 → 3.1.0-beta.90

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.
@@ -0,0 +1,53 @@
1
+ export declare const EMAIL: {
2
+ readonly accent: "#0F62FE";
3
+ readonly accentHover: "#0353E9";
4
+ readonly accentPress: "#002D9C";
5
+ readonly accentSoft: "#EDF4FF";
6
+ readonly accentBorder: "#C6DBFF";
7
+ readonly ink: "#0A0A0A";
8
+ readonly body: "#404040";
9
+ readonly muted: "#707070";
10
+ readonly borderSubtle: "#EEEEEE";
11
+ readonly border: "#E5E5E5";
12
+ readonly borderStrong: "#D4D4D4";
13
+ readonly canvas: "#F4F4F4";
14
+ readonly surface: "#FFFFFF";
15
+ readonly error: "#DA1E28";
16
+ readonly warning: "#B28600";
17
+ readonly success: "#198038";
18
+ readonly rButton: "2px";
19
+ readonly rCard: "4px";
20
+ };
21
+ export type EmailPalette = typeof EMAIL;
22
+ export declare const EMAIL_BRAND: {
23
+ readonly site: "https://octaviaflow.com";
24
+ readonly app: "https://app.octaviaflow.com";
25
+ readonly supportEmail: "support@octaviaflow.com";
26
+ readonly logoUrl: "https://octaviaflow.com/images/icon.png";
27
+ readonly logoSize: 44;
28
+ readonly logoAlt: "Octaviaflow";
29
+ readonly socials: readonly [{
30
+ readonly label: "X";
31
+ readonly href: "https://x.com/octaviaflow_";
32
+ }, {
33
+ readonly label: "LinkedIn";
34
+ readonly href: "https://linkedin.com/company/octaviaflow";
35
+ }];
36
+ readonly legal: readonly [{
37
+ readonly label: "Privacy Policy";
38
+ readonly href: "https://octaviaflow.com/privacy-policy";
39
+ }, {
40
+ readonly label: "Terms";
41
+ readonly href: "https://octaviaflow.com/terms-and-conditions";
42
+ }, {
43
+ readonly label: "Unsubscribe";
44
+ readonly href: "{{unsubscribe_url}}";
45
+ }];
46
+ };
47
+ /**
48
+ * A tracked link to a marketing-site page. Every outbound link carries UTM so
49
+ * email-driven visits are attributable. `medium` is the email family
50
+ * (transactional / notification / marketing / report); `campaign` the template id.
51
+ */
52
+ export declare function trackedUrl(path: string, medium: string, campaign: string): string;
53
+ //# sourceMappingURL=emailPalette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emailPalette.d.ts","sourceRoot":"","sources":["../../src/email/emailPalette.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;CA2BR,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,KAAK,CAAC;AAKxC,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;CAkBd,CAAC;AAEX;;;;GAIG;AACH,wBAAgB,UAAU,CACxB,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,MAAM,GACf,MAAM,CAMR"}
@@ -0,0 +1,42 @@
1
+ export type EmailMedium = 'transactional' | 'notification' | 'marketing' | 'report';
2
+ export interface EmailStat {
3
+ label: string;
4
+ value: string;
5
+ /** Optional sub-line, e.g. a delta ("+12% vs last week"). */
6
+ sub?: string;
7
+ tone?: 'accent' | 'error' | 'warning' | 'success' | 'muted';
8
+ }
9
+ export interface EmailContent {
10
+ /** Template id → utm_campaign. */
11
+ id: string;
12
+ medium: EmailMedium;
13
+ preheader: string;
14
+ tone?: 'accent' | 'error' | 'warning' | 'success';
15
+ eyebrow?: string;
16
+ heading: string;
17
+ subheading?: string;
18
+ greeting?: string;
19
+ paragraphs: string[];
20
+ /** Big-number tiles (reports). */
21
+ stats?: EmailStat[];
22
+ /** Key/value list (alerts). */
23
+ facts?: {
24
+ label: string;
25
+ value: string;
26
+ }[];
27
+ cta?: {
28
+ label: string;
29
+ href: string;
30
+ };
31
+ /** Raw URL shown under the CTA ("or copy and paste this link"). */
32
+ linkFallback?: string;
33
+ callout?: {
34
+ title: string;
35
+ text: string;
36
+ };
37
+ /** Show the "Need help?" support block. */
38
+ help?: boolean;
39
+ }
40
+ /** Render a complete email from content. This is THE Octaviaflow email. */
41
+ export declare function renderEmail(c: EmailContent): string;
42
+ //# sourceMappingURL=emailSystem.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emailSystem.d.ts","sourceRoot":"","sources":["../../src/email/emailSystem.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,cAAc,GAAG,WAAW,GAAG,QAAQ,CAAC;AAEpF,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,OAAO,CAAC;CAC7D;AAED,MAAM,WAAW,YAAY;IAC3B,kCAAkC;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,CAAC;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,UAAU,EAAE,MAAM,EAAE,CAAC;IACrB,kCAAkC;IAClC,KAAK,CAAC,EAAE,SAAS,EAAE,CAAC;IACpB,+BAA+B;IAC/B,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;IAC3C,GAAG,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACtC,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,OAAO,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IAC1C,2CAA2C;IAC3C,IAAI,CAAC,EAAE,OAAO,CAAC;CAChB;AAwGD,2EAA2E;AAC3E,wBAAgB,WAAW,CAAC,CAAC,EAAE,YAAY,GAAG,MAAM,CAqEnD"}
@@ -0,0 +1,11 @@
1
+ import type { EmailContent } from './emailSystem';
2
+ export interface EmailTemplateGroup {
3
+ category: string;
4
+ templates: {
5
+ id: string;
6
+ title: string;
7
+ content: EmailContent;
8
+ }[];
9
+ }
10
+ export declare const EMAIL_TEMPLATE_GROUPS: EmailTemplateGroup[];
11
+ //# sourceMappingURL=emailTemplates.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"emailTemplates.d.ts","sourceRoot":"","sources":["../../src/email/emailTemplates.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AA8OlD,MAAM,WAAW,kBAAkB;IACjC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,YAAY,CAAA;KAAE,EAAE,CAAC;CACnE;AAED,eAAO,MAAM,qBAAqB,EAAE,kBAAkB,EAgCrD,CAAC"}
package/dist/index.cjs CHANGED
@@ -46470,7 +46470,7 @@ var CHANNEL_TYPE_META = {
46470
46470
  whatsapp: {
46471
46471
  label: "WhatsApp",
46472
46472
  hint: "Template messages to a phone number.",
46473
- connected: true,
46473
+ connected: false,
46474
46474
  icon: /* @__PURE__ */ (0, import_jsx_runtime186.jsx)(import_icons71.ChatLaunchIcon, { size: "sm", "aria-hidden": "true" })
46475
46475
  },
46476
46476
  webhook: {
@@ -47231,9 +47231,12 @@ var import_react210 = require("react");
47231
47231
  var CONNECTED_CHANNEL_TYPES = [
47232
47232
  "slack",
47233
47233
  "teams",
47234
- "google_chat",
47235
- "whatsapp"
47234
+ "google_chat"
47236
47235
  ];
47236
+ function isValidPhoneNumber(value) {
47237
+ const digits = value.replace(/[^\d]/g, "");
47238
+ return /^\+?[\d\s()-]+$/.test(value.trim()) && digits.length >= 8 && digits.length <= 15;
47239
+ }
47237
47240
  var EMAIL_RE = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
47238
47241
  function isValidEmail(value) {
47239
47242
  return EMAIL_RE.test(value.trim());
@@ -47260,6 +47263,10 @@ function validateChannelDraft(draft) {
47260
47263
  if (!draft.url?.trim()) errors.url = "Enter the endpoint URL.";
47261
47264
  else if (!isValidWebhookUrl(draft.url))
47262
47265
  errors.url = "Enter a full URL, starting with https://.";
47266
+ } else if (draft.type === "whatsapp") {
47267
+ if (!draft.target?.trim()) errors.target = "Enter the recipient\u2019s WhatsApp number.";
47268
+ else if (!isValidPhoneNumber(draft.target))
47269
+ errors.target = "Enter a valid number in international format, e.g. +91 98765 43210.";
47263
47270
  }
47264
47271
  return errors;
47265
47272
  }
@@ -47601,6 +47608,23 @@ function NotificationChannelForm({
47601
47608
  disabled: readOnly,
47602
47609
  size
47603
47610
  }
47611
+ ),
47612
+ value.type === "whatsapp" && /* @__PURE__ */ (0, import_jsx_runtime192.jsx)(
47613
+ Input,
47614
+ {
47615
+ id: `${baseId}-target`,
47616
+ type: "tel",
47617
+ label: TARGET_LABEL.whatsapp ?? "Phone number",
47618
+ placeholder: TARGET_PLACEHOLDER.whatsapp,
47619
+ value: value.target ?? "",
47620
+ onChange: (e) => patch({ target: e.target.value }),
47621
+ onBlur: () => touch("target"),
47622
+ error: Boolean(errorFor("target")),
47623
+ errorMessage: errorText("target"),
47624
+ helperText: "Sent from Octaviaflow\u2019s WhatsApp using the approved template. Include the country code.",
47625
+ disabled: readOnly,
47626
+ size
47627
+ }
47604
47628
  )
47605
47629
  ] }),
47606
47630
  /* @__PURE__ */ (0, import_jsx_runtime192.jsxs)("fieldset", { className: "ods-notif-channel-form__section", children: [