@forumone/throughline-email 0.0.1 → 0.2.1

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 (64) hide show
  1. package/CHANGELOG.md +14 -0
  2. package/LICENSE +21 -0
  3. package/README.md +133 -41
  4. package/dist/client.d.ts +78 -0
  5. package/dist/client.d.ts.map +1 -0
  6. package/dist/client.js +63 -0
  7. package/dist/client.js.map +1 -0
  8. package/dist/functions/_shared.d.ts +17 -0
  9. package/dist/functions/_shared.d.ts.map +1 -0
  10. package/dist/functions/_shared.js +47 -0
  11. package/dist/functions/_shared.js.map +1 -0
  12. package/dist/functions/index.d.ts +7 -0
  13. package/dist/functions/index.d.ts.map +1 -0
  14. package/dist/functions/index.js +4 -0
  15. package/dist/functions/index.js.map +1 -0
  16. package/dist/functions/notify-approval-decision.d.ts +23 -0
  17. package/dist/functions/notify-approval-decision.d.ts.map +1 -0
  18. package/dist/functions/notify-approval-decision.js +80 -0
  19. package/dist/functions/notify-approval-decision.js.map +1 -0
  20. package/dist/functions/notify-approval-expired.d.ts +21 -0
  21. package/dist/functions/notify-approval-expired.d.ts.map +1 -0
  22. package/dist/functions/notify-approval-expired.js +55 -0
  23. package/dist/functions/notify-approval-expired.js.map +1 -0
  24. package/dist/functions/notify-approval-request.d.ts +24 -0
  25. package/dist/functions/notify-approval-request.d.ts.map +1 -0
  26. package/dist/functions/notify-approval-request.js +93 -0
  27. package/dist/functions/notify-approval-request.js.map +1 -0
  28. package/dist/index.d.ts +11 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +7 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/options.d.ts +79 -0
  33. package/dist/options.d.ts.map +1 -0
  34. package/dist/options.js +39 -0
  35. package/dist/options.js.map +1 -0
  36. package/dist/plugin.d.ts +18 -0
  37. package/dist/plugin.d.ts.map +1 -0
  38. package/dist/plugin.js +76 -0
  39. package/dist/plugin.js.map +1 -0
  40. package/dist/templates/ApprovalDecision.d.ts +15 -0
  41. package/dist/templates/ApprovalDecision.d.ts.map +1 -0
  42. package/dist/templates/ApprovalDecision.js +56 -0
  43. package/dist/templates/ApprovalDecision.js.map +1 -0
  44. package/dist/templates/ApprovalExpired.d.ts +10 -0
  45. package/dist/templates/ApprovalExpired.d.ts.map +1 -0
  46. package/dist/templates/ApprovalExpired.js +8 -0
  47. package/dist/templates/ApprovalExpired.js.map +1 -0
  48. package/dist/templates/ApprovalRequest.d.ts +24 -0
  49. package/dist/templates/ApprovalRequest.d.ts.map +1 -0
  50. package/dist/templates/ApprovalRequest.js +58 -0
  51. package/dist/templates/ApprovalRequest.js.map +1 -0
  52. package/dist/templates/_layout.d.ts +17 -0
  53. package/dist/templates/_layout.d.ts.map +1 -0
  54. package/dist/templates/_layout.js +39 -0
  55. package/dist/templates/_layout.js.map +1 -0
  56. package/dist/templates/index.d.ts +9 -0
  57. package/dist/templates/index.d.ts.map +1 -0
  58. package/dist/templates/index.js +5 -0
  59. package/dist/templates/index.js.map +1 -0
  60. package/dist/tokens.d.ts +39 -0
  61. package/dist/tokens.d.ts.map +1 -0
  62. package/dist/tokens.js +17 -0
  63. package/dist/tokens.js.map +1 -0
  64. package/package.json +74 -7
@@ -0,0 +1,58 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Button, Heading, Link, Section, Text } from '@react-email/components';
3
+ import { EmailLayout } from './_layout.js';
4
+ export function ApprovalRequestEmail(props) {
5
+ const { tokens } = props;
6
+ const labelStyle = {
7
+ color: tokens.textSecondary,
8
+ fontSize: 12,
9
+ fontWeight: 600,
10
+ margin: 0,
11
+ textTransform: 'uppercase',
12
+ letterSpacing: '0.05em',
13
+ };
14
+ const boxStyle = {
15
+ backgroundColor: tokens.bgSecondary,
16
+ padding: 16,
17
+ borderRadius: 6,
18
+ marginTop: 16,
19
+ };
20
+ const primaryButtonStyle = {
21
+ backgroundColor: tokens.textPrimary,
22
+ color: '#FFFFFF',
23
+ padding: '12px 20px',
24
+ borderRadius: 4,
25
+ textDecoration: 'none',
26
+ fontSize: 14,
27
+ fontWeight: 600,
28
+ display: 'inline-block',
29
+ };
30
+ const approveButtonStyle = {
31
+ backgroundColor: tokens.brandPrimary,
32
+ color: '#FFFFFF',
33
+ padding: '10px 16px',
34
+ borderRadius: 4,
35
+ textDecoration: 'none',
36
+ fontSize: 14,
37
+ fontWeight: 600,
38
+ display: 'inline-block',
39
+ };
40
+ const outlineButtonStyle = {
41
+ backgroundColor: tokens.bgPrimary,
42
+ color: tokens.textPrimary,
43
+ padding: '10px 16px',
44
+ border: `1px solid ${tokens.border}`,
45
+ borderRadius: 4,
46
+ textDecoration: 'none',
47
+ fontSize: 14,
48
+ fontWeight: 600,
49
+ display: 'inline-block',
50
+ };
51
+ const discussLinkStyle = {
52
+ color: tokens.brandPrimary,
53
+ fontSize: 14,
54
+ textDecoration: 'underline',
55
+ };
56
+ return (_jsxs(EmailLayout, { preview: `Approval needed: ${props.targetTitle}`, tokens: tokens, children: [_jsx(Heading, { style: { color: tokens.textPrimary, fontSize: 22, margin: 0 }, children: "Approval needed" }), _jsxs(Text, { style: { color: tokens.textPrimary, fontSize: 16, marginTop: 8 }, children: ["Hi ", props.approverName, ","] }), _jsxs(Text, { style: { color: tokens.textPrimary, fontSize: 16 }, children: [props.requesterName, " is requesting approval to publish the ", props.targetKind, ' ', _jsx("strong", { children: props.targetTitle }), "."] }), _jsxs(Section, { style: boxStyle, children: [_jsx(Text, { style: labelStyle, children: "What changed" }), _jsx(Text, { style: { color: tokens.textPrimary, fontSize: 14, margin: '8px 0 0' }, children: props.changesSummary })] }), props.requestReason ? (_jsxs(Section, { style: { marginTop: 16 }, children: [_jsx(Text, { style: labelStyle, children: "Why" }), _jsx(Text, { style: { color: tokens.textPrimary, fontSize: 14, margin: '8px 0 0' }, children: props.requestReason })] })) : null, _jsx(Section, { style: { marginTop: 24 }, children: _jsx(Button, { href: props.previewUrl, style: primaryButtonStyle, children: "Preview the changes" }) }), _jsxs(Section, { style: { marginTop: 32 }, children: [_jsx(Text, { style: { color: tokens.textPrimary, fontSize: 14, fontWeight: 600 }, children: "Your decision:" }), _jsx("table", { style: { marginTop: 8 }, children: _jsx("tbody", { children: _jsxs("tr", { children: [_jsx("td", { style: { paddingRight: 8 }, children: _jsx(Button, { href: props.approveUrl, style: approveButtonStyle, children: "Approve" }) }), _jsx("td", { style: { paddingRight: 8 }, children: _jsx(Button, { href: props.changesUrl, style: outlineButtonStyle, children: "Request changes" }) }), _jsx("td", { children: _jsx(Link, { href: props.discussUrl, style: discussLinkStyle, children: "Discuss" }) })] }) }) })] }), _jsxs(Text, { style: { color: tokens.textSecondary, fontSize: 12, marginTop: 24 }, children: ["This request expires ", props.expiresAt, "."] })] }));
57
+ }
58
+ //# sourceMappingURL=ApprovalRequest.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ApprovalRequest.js","sourceRoot":"","sources":["../../src/templates/ApprovalRequest.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAE9E,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AA0B1C,MAAM,UAAU,oBAAoB,CAAC,KAAgC;IACnE,MAAM,EAAE,MAAM,EAAE,GAAG,KAAK,CAAA;IAExB,MAAM,UAAU,GAAkB;QAChC,KAAK,EAAE,MAAM,CAAC,aAAa;QAC3B,QAAQ,EAAE,EAAE;QACZ,UAAU,EAAE,GAAG;QACf,MAAM,EAAE,CAAC;QACT,aAAa,EAAE,WAAW;QAC1B,aAAa,EAAE,QAAQ;KACxB,CAAA;IACD,MAAM,QAAQ,GAAkB;QAC9B,eAAe,EAAE,MAAM,CAAC,WAAW;QACnC,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,CAAC;QACf,SAAS,EAAE,EAAE;KACd,CAAA;IACD,MAAM,kBAAkB,GAAkB;QACxC,eAAe,E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AK,EAAE,EAAE,SAAS,EAAE,CAAC,EAAE,YAC5B,0BACE,yBACE,aAAI,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,YAC5B,KAAC,MAAM,IAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,kBAAkB,wBAEhD,GACN,EACL,aAAI,KAAK,EAAE,EAAE,YAAY,EAAE,CAAC,EAAE,YAC5B,KAAC,MAAM,IAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,kBAAkB,gCAEhD,GACN,EACL,uBACE,KAAC,IAAI,IAAC,IAAI,EAAE,KAAK,CAAC,UAAU,EAAE,KAAK,EAAE,gBAAgB,wBAE9C,GACJ,IACF,GACC,GACF,IACA,EAEV,MAAC,IAAI,IAAC,KAAK,EAAE,EAAE,KAAK,EAAE,MAAM,CAAC,aAAa,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE,sCACjD,KAAK,CAAC,SAAS,SAChC,IACK,CACf,CAAA;AACH,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { EmailBrandTokens } from '../tokens.js';
3
+ export interface EmailLayoutProps {
4
+ /** Inbox preview snippet (the line shown next to the subject in clients). */
5
+ preview: string;
6
+ tokens: EmailBrandTokens;
7
+ children: ReactNode;
8
+ }
9
+ /**
10
+ * Shared chrome for every transactional template: brand-name header,
11
+ * thin rule, body slot, and a footer disclaimer that names the brand
12
+ * again. Sticking to React Email primitives (`Body`, `Container`,
13
+ * `Section`) keeps Outlook / Gmail / Apple Mail rendering consistent;
14
+ * raw `<div>` + CSS is where compatibility nightmares live.
15
+ */
16
+ export declare function EmailLayout({ preview, tokens, children }: EmailLayoutProps): import("react/jsx-runtime").JSX.Element;
17
+ //# sourceMappingURL=_layout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_layout.d.ts","sourceRoot":"","sources":["../../src/templates/_layout.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAiB,SAAS,EAAE,MAAM,OAAO,CAAA;AACrD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,MAAM,WAAW,gBAAgB;IAC/B,6EAA6E;IAC7E,OAAO,EAAE,MAAM,CAAA;IACf,MAAM,EAAE,gBAAgB,CAAA;IACxB,QAAQ,EAAE,SAAS,CAAA;CACpB;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,gBAAgB,2CAgD1E"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { Body, Container, Head, Hr, Html, Preview, Section, Text } from '@react-email/components';
3
+ /**
4
+ * Shared chrome for every transactional template: brand-name header,
5
+ * thin rule, body slot, and a footer disclaimer that names the brand
6
+ * again. Sticking to React Email primitives (`Body`, `Container`,
7
+ * `Section`) keeps Outlook / Gmail / Apple Mail rendering consistent;
8
+ * raw `<div>` + CSS is where compatibility nightmares live.
9
+ */
10
+ export function EmailLayout({ preview, tokens, children }) {
11
+ const bodyStyle = {
12
+ backgroundColor: '#F5F5F5',
13
+ fontFamily: tokens.fontFamilySans,
14
+ margin: 0,
15
+ padding: '24px 0',
16
+ };
17
+ const containerStyle = {
18
+ backgroundColor: tokens.bgPrimary,
19
+ maxWidth: 600,
20
+ margin: '0 auto',
21
+ padding: 32,
22
+ borderRadius: 8,
23
+ };
24
+ const brandStyle = {
25
+ color: tokens.textPrimary,
26
+ fontWeight: 700,
27
+ fontSize: 18,
28
+ margin: 0,
29
+ };
30
+ const dividerStyle = { borderColor: tokens.border, margin: '24px 0' };
31
+ const footerDividerStyle = { borderColor: tokens.border, margin: '32px 0 16px' };
32
+ const footerTextStyle = {
33
+ color: tokens.textSecondary,
34
+ fontSize: 12,
35
+ margin: 0,
36
+ };
37
+ return (_jsxs(Html, { lang: "en", children: [_jsx(Head, {}), _jsx(Preview, { children: preview }), _jsx(Body, { style: bodyStyle, children: _jsxs(Container, { style: containerStyle, children: [_jsx(Section, { children: _jsx(Text, { style: brandStyle, children: tokens.brandName }) }), _jsx(Hr, { style: dividerStyle }), children, _jsx(Hr, { style: footerDividerStyle }), _jsxs(Text, { style: footerTextStyle, children: ["This message is from your ", tokens.brandName, " content system. If you did not expect this, contact your system administrator."] })] }) })] }));
38
+ }
39
+ //# sourceMappingURL=_layout.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"_layout.js","sourceRoot":"","sources":["../../src/templates/_layout.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,yBAAyB,CAAA;AAWjG;;;;;;GAMG;AACH,MAAM,UAAU,WAAW,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAoB;IACzE,MAAM,SAAS,GAAkB;QAC/B,eAAe,EAAE,SAAS;QAC1B,UAAU,EAAE,MAAM,CAAC,cAAc;QACjC,MAAM,EAAE,CAAC;QACT,OAAO,EAAE,QAAQ;KAClB,CAAA;IACD,MAAM,cAAc,GAAkB;QACpC,eAAe,EAAE,MAAM,CAAC,SAAS;QACjC,QAAQ,EAAE,GAAG;QACb,MAAM,EAAE,QAAQ;QAChB,OAAO,EAAE,EAAE;QACX,YAAY,EAAE,CAAC;KAChB,CAAA;IACD,MAAM,UAAU,GAAkB;QAChC,KAAK,EAAE,MAAM,CAAC,WAAW;QACzB,UAAU,EAAE,GAAG;QACf,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC;KACV,CAAA;IACD,MAAM,YAAY,GAAkB,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAA;IACpF,MAAM,kBAAkB,GAAkB,EAAE,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,aAAa,EAAE,CAAA;IAC/F,MAAM,eAAe,GAAkB;QACrC,KAAK,EAAE,MAAM,CAAC,aAAa;QAC3B,QAAQ,EAAE,EAAE;QACZ,MAAM,EAAE,CAAC;KACV,CAAA;IAED,OAAO,CACL,MAAC,IAAI,IAAC,IAAI,EAAC,IAAI,aACb,KAAC,IAAI,KAAG,EACR,KAAC,OAAO,cAAE,OAAO,GAAW,EAC5B,KAAC,IAAI,IAAC,KAAK,EAAE,SAAS,YACpB,MAAC,SAAS,IAAC,KAAK,EAAE,cAAc,aAC9B,KAAC,OAAO,cACN,KAAC,IAAI,IAAC,KAAK,EAAE,UAAU,YAAG,MAAM,CAAC,SAAS,GAAQ,GAC1C,EACV,KAAC,EAAE,IAAC,KAAK,EAAE,YAAY,GAAI,EAC1B,QAAQ,EACT,KAAC,EAAE,IAAC,KAAK,EAAE,kBAAkB,GAAI,EACjC,MAAC,IAAI,IAAC,KAAK,EAAE,eAAe,2CACC,MAAM,CAAC,SAAS,uFAEtC,IACG,GACP,IACF,CACR,CAAA;AACH,CAAC"}
@@ -0,0 +1,9 @@
1
+ export { EmailLayout } from './_layout.js';
2
+ export type { EmailLayoutProps } from './_layout.js';
3
+ export { ApprovalRequestEmail } from './ApprovalRequest.js';
4
+ export type { ApprovalRequestEmailProps, ApprovalTargetKind } from './ApprovalRequest.js';
5
+ export { ApprovalDecisionEmail } from './ApprovalDecision.js';
6
+ export type { ApprovalDecisionEmailProps, ApprovalDecisionKind } from './ApprovalDecision.js';
7
+ export { ApprovalExpiredEmail } from './ApprovalExpired.js';
8
+ export type { ApprovalExpiredEmailProps } from './ApprovalExpired.js';
9
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAC1C,YAAY,EAAE,gBAAgB,EAAE,MAAM,cAAc,CAAA;AAEpD,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,YAAY,EAAE,yBAAyB,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAA;AAEzF,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAC7D,YAAY,EAAE,0BAA0B,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAA;AAE7F,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAC3D,YAAY,EAAE,yBAAyB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,5 @@
1
+ export { EmailLayout } from './_layout.js';
2
+ export { ApprovalRequestEmail } from './ApprovalRequest.js';
3
+ export { ApprovalDecisionEmail } from './ApprovalDecision.js';
4
+ export { ApprovalExpiredEmail } from './ApprovalExpired.js';
5
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/templates/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAG1C,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA;AAG3D,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAA;AAG7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAA"}
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Brand tokens that drive every template's appearance. Core ships neutral
3
+ * defaults (black on white, system sans, "Your Site"); deployments override
4
+ * via `emailPlugin({ tokens })` to swap in their brand identity. Forum One
5
+ * colors do not live here — every consuming agency or product team supplies
6
+ * their own.
7
+ */
8
+ export interface EmailBrandTokens {
9
+ /** Primary brand color used for affirmative buttons (Approve, Preview). */
10
+ brandPrimary: string;
11
+ /** Hover/active state for the primary brand color. Reserved; not used by
12
+ * the layout itself but available for richer templates. */
13
+ brandPrimaryHover: string;
14
+ /** Optional accent color for secondary highlights. */
15
+ brandAccent?: string;
16
+ /** Default body text color. */
17
+ textPrimary: string;
18
+ /** Muted text color (labels, footer, helper copy). */
19
+ textSecondary: string;
20
+ /** Email card background. */
21
+ bgPrimary: string;
22
+ /** Subdued background used for callout sections. */
23
+ bgSecondary: string;
24
+ /** Border color for hairlines and box outlines. */
25
+ border: string;
26
+ /** Font stack passed to the layout's body. */
27
+ fontFamilySans: string;
28
+ /**
29
+ * Display name used in three places: the layout header, the From name
30
+ * (when EMAIL_FROM_NAME is unset), and the layout footer disclaimer.
31
+ * Keeps "this came from <site>" consistent across every email.
32
+ */
33
+ brandName: string;
34
+ /** Optional logo URL shown in the layout header. Reserved for future use. */
35
+ logoUrl?: string;
36
+ }
37
+ export declare const defaultTokens: EmailBrandTokens;
38
+ export declare function mergeTokens(overrides?: Partial<EmailBrandTokens>): EmailBrandTokens;
39
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,2EAA2E;IAC3E,YAAY,EAAE,MAAM,CAAA;IACpB;gEAC4D;IAC5D,iBAAiB,EAAE,MAAM,CAAA;IACzB,sDAAsD;IACtD,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,+BAA+B;IAC/B,WAAW,EAAE,MAAM,CAAA;IACnB,sDAAsD;IACtD,aAAa,EAAE,MAAM,CAAA;IACrB,6BAA6B;IAC7B,SAAS,EAAE,MAAM,CAAA;IACjB,oDAAoD;IACpD,WAAW,EAAE,MAAM,CAAA;IACnB,mDAAmD;IACnD,MAAM,EAAE,MAAM,CAAA;IACd,8CAA8C;IAC9C,cAAc,EAAE,MAAM,CAAA;IACtB;;;;OAIG;IACH,SAAS,EAAE,MAAM,CAAA;IACjB,6EAA6E;IAC7E,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB;AAED,eAAO,MAAM,aAAa,EAAE,gBAU3B,CAAA;AAED,wBAAgB,WAAW,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,GAAG,gBAAgB,CAGnF"}
package/dist/tokens.js ADDED
@@ -0,0 +1,17 @@
1
+ export const defaultTokens = {
2
+ brandPrimary: '#2563EB',
3
+ brandPrimaryHover: '#1D4ED8',
4
+ textPrimary: '#18181B',
5
+ textSecondary: '#52525B',
6
+ bgPrimary: '#FFFFFF',
7
+ bgSecondary: '#FAFAFA',
8
+ border: '#E4E4E7',
9
+ fontFamilySans: 'Inter, system-ui, -apple-system, BlinkMacSystemFont, sans-serif',
10
+ brandName: 'Your Site',
11
+ };
12
+ export function mergeTokens(overrides) {
13
+ if (!overrides)
14
+ return defaultTokens;
15
+ return { ...defaultTokens, ...overrides };
16
+ }
17
+ //# sourceMappingURL=tokens.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.js","sourceRoot":"","sources":["../src/tokens.ts"],"names":[],"mappings":"AAqCA,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC7C,YAAY,EAAE,SAAS;IACvB,iBAAiB,EAAE,SAAS;IAC5B,WAAW,EAAE,SAAS;IACtB,aAAa,EAAE,SAAS;IACxB,SAAS,EAAE,SAAS;IACpB,WAAW,EAAE,SAAS;IACtB,MAAM,EAAE,SAAS;IACjB,cAAc,EAAE,iEAAiE;IACjF,SAAS,EAAE,WAAW;CACvB,CAAA;AAED,MAAM,UAAU,WAAW,CAAC,SAAqC;IAC/D,IAAI,CAAC,SAAS;QAAE,OAAO,aAAa,CAAA;IACpC,OAAO,EAAE,GAAG,aAAa,EAAE,GAAG,SAAS,EAAE,CAAA;AAC3C,CAAC"}
package/package.json CHANGED
@@ -1,10 +1,77 @@
1
1
  {
2
2
  "name": "@forumone/throughline-email",
3
- "version": "0.0.1",
4
- "description": "OIDC trusted publishing setup package for @forumone/throughline-email",
3
+ "version": "0.2.1",
4
+ "description": "Transactional email system for the Throughline framework. Resend wrapper, themeable React Email templates, and Inngest functions that subscribe to the approval-workflow notification events.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": {
10
+ "types": "./dist/index.d.ts",
11
+ "default": "./dist/index.js"
12
+ },
13
+ "./templates": {
14
+ "types": "./dist/templates/index.d.ts",
15
+ "default": "./dist/templates/index.js"
16
+ }
17
+ },
18
+ "files": [
19
+ "dist",
20
+ "README.md",
21
+ "CHANGELOG.md"
22
+ ],
5
23
  "keywords": [
6
- "oidc",
7
- "trusted-publishing",
8
- "setup"
9
- ]
10
- }
24
+ "throughline",
25
+ "payload",
26
+ "email",
27
+ "resend",
28
+ "react-email"
29
+ ],
30
+ "license": "MIT",
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/forumone/throughline.git",
34
+ "directory": "packages/email"
35
+ },
36
+ "homepage": "https://github.com/forumone/throughline/tree/main/packages/email#readme",
37
+ "bugs": {
38
+ "url": "https://github.com/forumone/throughline/issues"
39
+ },
40
+ "publishConfig": {
41
+ "access": "public"
42
+ },
43
+ "peerDependencies": {
44
+ "inngest": "^4.0.0",
45
+ "payload": "^3.0.0",
46
+ "react": "^18.0.0 || ^19.0.0"
47
+ },
48
+ "dependencies": {
49
+ "@react-email/components": "^0.5.4",
50
+ "@react-email/render": "^1.3.2",
51
+ "resend": "^6.1.4",
52
+ "zod": "^3.23.0",
53
+ "@forumone/throughline-core": "0.2.1",
54
+ "@forumone/throughline-plugin-contract": "0.0.0"
55
+ },
56
+ "devDependencies": {
57
+ "@types/node": "^20.17.0",
58
+ "@types/react": "^19.2.0",
59
+ "eslint": "^9.15.0",
60
+ "inngest": "^4.2.0",
61
+ "payload": "^3.83.0",
62
+ "react": "^19.2.0",
63
+ "typescript": "^5.6.0",
64
+ "vitest": "^2.1.0",
65
+ "@forumone/throughline-eslint-config": "0.0.0",
66
+ "@forumone/throughline-tsconfig": "0.0.0"
67
+ },
68
+ "scripts": {
69
+ "build": "tsc -b",
70
+ "dev": "tsc -b -w",
71
+ "clean": "rm -rf dist .turbo *.tsbuildinfo",
72
+ "typecheck": "tsc --noEmit",
73
+ "lint": "eslint src",
74
+ "test": "vitest run",
75
+ "email:preview": "email dev --dir src/templates"
76
+ }
77
+ }