@tangle-network/agent-app 0.58.20 → 0.59.0
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.
- package/dist/VaultPane-OH4W5MXW.js +7 -0
- package/dist/app-auth/index.d.ts +6 -3
- package/dist/app-auth/index.js +26 -23
- package/dist/app-auth/index.js.map +1 -1
- package/dist/assistant/index.js +1 -1
- package/dist/chat-routes/index.js +1 -1
- package/dist/chunk-AB63T2LM.js +32 -0
- package/dist/chunk-AB63T2LM.js.map +1 -0
- package/dist/{chunk-QPMEXMH6.js → chunk-FMX3IOJM.js} +1 -1
- package/dist/{chunk-QPMEXMH6.js.map → chunk-FMX3IOJM.js.map} +1 -1
- package/dist/{chunk-CJW24QMJ.js → chunk-SUIHWGQT.js} +8 -1
- package/dist/chunk-SUIHWGQT.js.map +1 -0
- package/dist/chunk-YPPVNQOC.js +413 -0
- package/dist/chunk-YPPVNQOC.js.map +1 -0
- package/dist/email/index.d.ts +25 -0
- package/dist/email/index.js +19 -0
- package/dist/email/index.js.map +1 -0
- package/dist/email/layout.d.ts +77 -0
- package/dist/email/lint.d.ts +12 -0
- package/dist/email/mark.generated.d.ts +2 -0
- package/dist/email/palette.d.ts +40 -0
- package/dist/email/templates.d.ts +69 -0
- package/dist/sandbox/index.d.ts +10 -0
- package/dist/sandbox/index.js +1 -1
- package/dist/teams/index.js +2 -4
- package/dist/teams/invitations-api.d.ts +1 -1
- package/dist/teams/invitations-api.js +4 -4
- package/dist/teams/invitations-api.js.map +1 -1
- package/dist/teams/invitations.d.ts +4 -37
- package/dist/vault/index.js +1 -1
- package/dist/vault/lazy.js +1 -1
- package/dist/vault/recent-files.d.ts +0 -2
- package/dist/web-react/index.js +1 -1
- package/package.json +6 -1
- package/dist/VaultPane-UNX4CWSM.js +0 -7
- package/dist/chunk-2DRYTJHI.js +0 -58
- package/dist/chunk-2DRYTJHI.js.map +0 -1
- package/dist/chunk-CJW24QMJ.js.map +0 -1
- /package/dist/{VaultPane-UNX4CWSM.js.map → VaultPane-OH4W5MXW.js.map} +0 -0
|
@@ -0,0 +1,413 @@
|
|
|
1
|
+
// src/email/mark.generated.ts
|
|
2
|
+
var TANGLE_MARK_PNG_BASE64 = "iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAQAElEQVR4nOxcDZBV1X3//8+9971dVvkwEhR1GuvEatIY09hmOklTCU2bMQYnH3ZMTAmRZRdpqIAYgV3Iy35CgAUEBBGcBNskliSmTZqPjtox6dhJaGY61NFGpfEDSBRBgbjsvnfv+fd/P86959x73+5b9r26mdm/Luede+/5uP/zO//z/zjnCpikupKASaorTTK0zjTJ0DrTJEPrTJMMrTNNMrTOZMM4qWuxewsBXsVDcxEBzSQUBQAJ4VhxilHq/6sPHyY/SU+NIeYriFw6TMMnMC6Rfj5oFVVrOfWh+Wx0zUWiEyTwZeHRrzauL+yFcRDCOVDPYu8LHtICr4Dv8oAK/rsGr+q/PMkgDfPccWJ281sSpxCl4f2QScF1xSztepwnGV0PLxv1CAzrj8qF7afykG3PzMuofyE3+L5nS/FL8OChLb1OF4yRamZoaSlNtctyo2vTpz0LzlcvTVpNlKqZ4pRiJgPo+QhpGD0YvKQql0Ji1FPCpH7Qn9DqBwy5Q1p9RntR9ZTqJwCY7REO2S78gCrunVvXNz8PNVBNDO1tc1vLNm4nC5oyI28gJWFGMvIJ8vKQotejIy9TLrgPoABt1JNCqn59xPaNctFMoFBK6eUECldUaNfWLueOaLTOnaFd7fIx15FzgkeNkU8hSqux2ogbyPCvoyYT09MdakCQfl/dUUhF9STG7ZhMrb3fYV95PD16XkBh7tYS/i9UoRFX+e52+aRryzkYvbSfKmT5QxnmAVC1qkZY6w1FyFW8CkYeomkfCq3kOT0P0TRV9UepWZ8qpzFT5UljYlRvjHQw6437jar9ZPBV3k/Jwrd5WD64rJcursazqgjtaXMZmTgnI6NQz4d3GQBnhMRf8/w5AkIMklrlMfjf4euXCoLZ/PSMoDRCslbnIJe1gaelR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v7s5SFpladaOT/3VGa1hsZ6A05XmuQaCGWMUkiB0suUiBbFw/g/Aqcf0MEqMPuUANp030AF86rh+vEal9AFxelpvkAwNdThvgOL/OqMiPgjpI97PqNA+CyE5Sgz7CGdQayFSkIzV5OfNlR0ImpBCtkKlJ5QipCTKrRDejPiJkZ4Zv9HoFeXC4SAvvKRWfhBqoZoYq2tBKl/rKOGvc77MkzsogFvKRmS8j06tzFsEmwvJmxgjlRpCh2e+NJqdN2FX4mifov8qFyupt3VPGdIR8zAxNU1e7O5879vv88yLu5UzuVSGNIEVSX/2FoQWkngNDQ07LPMi7r2YCqG/hpWQ0pMph/HVGl03fE2DhbzygF8vkPLx9HKecx83QSTJpAp8C+d2kSYbWmSYZWmeaZGidaZKhdaZJhtaZJhlaZ/o/AAAA//8mfCa5AAAABklEQVQDAPyiOFzVbOpbAAAAAElFTkSuQmCC";
|
|
3
|
+
|
|
4
|
+
// src/email/palette.ts
|
|
5
|
+
var EMAIL_PALETTE = {
|
|
6
|
+
light: {
|
|
7
|
+
canvas: "#eceef3",
|
|
8
|
+
card: "#ffffff",
|
|
9
|
+
well: "#f6f7fa",
|
|
10
|
+
hairline: "#c7c6d6",
|
|
11
|
+
ink: "#2d2d2d",
|
|
12
|
+
inkSecondary: "#3f3f3f",
|
|
13
|
+
inkMuted: "#4c4c4c",
|
|
14
|
+
accent: "#4c3fc5",
|
|
15
|
+
onAccent: "#ffffff",
|
|
16
|
+
accentText: "#3c32e9"
|
|
17
|
+
},
|
|
18
|
+
dark: {
|
|
19
|
+
canvas: "#0a0a14",
|
|
20
|
+
card: "#191826",
|
|
21
|
+
well: "#12111f",
|
|
22
|
+
hairline: "#2a293d",
|
|
23
|
+
ink: "#e6e6e6",
|
|
24
|
+
inkSecondary: "#c7c7c7",
|
|
25
|
+
inkMuted: "#b5b5b5",
|
|
26
|
+
accent: "#4c3fc5",
|
|
27
|
+
onAccent: "#ffffff",
|
|
28
|
+
accentText: "#a5b4fc"
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
var EMAIL_FONT_STACK = "Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif";
|
|
32
|
+
var TANGLE_POSTAL_ADDRESS = "Tangle Technologies, Inc., 3740 South Ocean Blvd, #1407, Highland Beach, FL 33487, USA";
|
|
33
|
+
|
|
34
|
+
// src/email/layout.ts
|
|
35
|
+
var MARK_CONTENT_ID = "tangle-mark";
|
|
36
|
+
var MARK_ATTACHMENT = {
|
|
37
|
+
filename: "tangle.png",
|
|
38
|
+
content: TANGLE_MARK_PNG_BASE64,
|
|
39
|
+
contentType: "image/png",
|
|
40
|
+
contentId: MARK_CONTENT_ID
|
|
41
|
+
};
|
|
42
|
+
var L = EMAIL_PALETTE.light;
|
|
43
|
+
var D = EMAIL_PALETTE.dark;
|
|
44
|
+
var FONT = EMAIL_FONT_STACK;
|
|
45
|
+
var STYLE = `
|
|
46
|
+
@media (prefers-color-scheme: dark) {
|
|
47
|
+
.t-bg { background-color: ${D.canvas} !important; }
|
|
48
|
+
.t-card { background-color: ${D.card} !important; border-color: ${D.hairline} !important; }
|
|
49
|
+
.t-well { background-color: ${D.well} !important; }
|
|
50
|
+
.t-rule { border-color: ${D.hairline} !important; }
|
|
51
|
+
.t-ink { color: ${D.ink} !important; }
|
|
52
|
+
.t-ink2 { color: ${D.inkSecondary} !important; }
|
|
53
|
+
.t-muted { color: ${D.inkMuted} !important; }
|
|
54
|
+
.t-link { color: ${D.accentText} !important; }
|
|
55
|
+
.t-btn2 { border-color: ${D.hairline} !important; }
|
|
56
|
+
}
|
|
57
|
+
@media (max-width: 600px) {
|
|
58
|
+
.t-outer { padding: 20px 8px !important; }
|
|
59
|
+
.t-card { padding: 28px 22px 24px !important; }
|
|
60
|
+
}
|
|
61
|
+
[data-ogsb] .t-bg { background-color: ${D.canvas} !important; }
|
|
62
|
+
[data-ogsb] .t-card { background-color: ${D.card} !important; }
|
|
63
|
+
[data-ogsb] .t-well { background-color: ${D.well} !important; }
|
|
64
|
+
[data-ogsc] .t-ink { color: ${D.ink} !important; }
|
|
65
|
+
[data-ogsc] .t-ink2 { color: ${D.inkSecondary} !important; }
|
|
66
|
+
[data-ogsc] .t-muted { color: ${D.inkMuted} !important; }
|
|
67
|
+
[data-ogsc] .t-link { color: ${D.accentText} !important; }
|
|
68
|
+
`.trim();
|
|
69
|
+
function escapeHtml(value) {
|
|
70
|
+
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
71
|
+
}
|
|
72
|
+
function resolveEmailUrl(url, product) {
|
|
73
|
+
const resolved = new URL(url, product.url);
|
|
74
|
+
if (resolved.protocol !== "https:" && resolved.protocol !== "http:") {
|
|
75
|
+
throw new TypeError(`Email links must be http(s): ${resolved.protocol}`);
|
|
76
|
+
}
|
|
77
|
+
return resolved.toString();
|
|
78
|
+
}
|
|
79
|
+
function emailSubject(subject, product) {
|
|
80
|
+
return `${subject} \u2014 ${product.name}`;
|
|
81
|
+
}
|
|
82
|
+
function paragraph(text, margin) {
|
|
83
|
+
return `<p class="t-ink2" style="margin:${margin};font-family:${FONT};font-size:15px;line-height:24px;color:${L.inkSecondary}">${escapeHtml(text)}</p>`;
|
|
84
|
+
}
|
|
85
|
+
function link(label, href, style) {
|
|
86
|
+
return `<a class="t-link" href="${escapeHtml(href)}" style="color:${L.accentText};text-decoration:none;${style}">${escapeHtml(label)}</a>`;
|
|
87
|
+
}
|
|
88
|
+
function header(product) {
|
|
89
|
+
return [
|
|
90
|
+
'<table role="presentation" cellpadding="0" cellspacing="0" border="0">',
|
|
91
|
+
"<tr>",
|
|
92
|
+
`<td style="padding:0 10px 0 0;vertical-align:middle"><img src="cid:${MARK_CONTENT_ID}" width="28" height="28" alt="Tangle" style="display:block;width:28px;height:28px;border:0;outline:none;text-decoration:none"></td>`,
|
|
93
|
+
`<td class="t-ink" style="vertical-align:middle;font-family:${FONT};font-size:16px;line-height:20px;font-weight:600;letter-spacing:-0.01em;color:${L.ink}">${escapeHtml(product.name)}</td>`,
|
|
94
|
+
"</tr>",
|
|
95
|
+
"</table>"
|
|
96
|
+
].join("");
|
|
97
|
+
}
|
|
98
|
+
function items(list, product) {
|
|
99
|
+
const rows = list.map((item, index) => {
|
|
100
|
+
const rule = index === 0 ? "" : `border-top:1px solid ${L.hairline};`;
|
|
101
|
+
const title = item.url ? link(item.title, resolveEmailUrl(item.url, product), "font-weight:600") : escapeHtml(item.title);
|
|
102
|
+
const detail = item.detail ? `<p class="t-muted" style="margin:2px 0 0;font-family:${FONT};font-size:13px;line-height:20px;color:${L.inkMuted}">${escapeHtml(item.detail)}</p>` : "";
|
|
103
|
+
return [
|
|
104
|
+
`<tr><td class="t-rule" style="padding:14px 16px;${rule}">`,
|
|
105
|
+
`<p class="t-ink" style="margin:0;font-family:${FONT};font-size:15px;line-height:22px;font-weight:600;color:${L.ink}">${title}</p>`,
|
|
106
|
+
detail,
|
|
107
|
+
"</td></tr>"
|
|
108
|
+
].join("");
|
|
109
|
+
});
|
|
110
|
+
return [
|
|
111
|
+
`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" class="t-well" bgcolor="${L.well}" style="background-color:${L.well};border-radius:8px;margin:4px 0 8px">`,
|
|
112
|
+
...rows,
|
|
113
|
+
"</table>"
|
|
114
|
+
].join("");
|
|
115
|
+
}
|
|
116
|
+
function primaryButton(action, href) {
|
|
117
|
+
return [
|
|
118
|
+
`<td bgcolor="${L.accent}" style="border-radius:8px;background-color:${L.accent};mso-padding-alt:12px 22px">`,
|
|
119
|
+
`<a href="${escapeHtml(href)}" style="display:inline-block;padding:12px 22px;font-family:${FONT};font-size:15px;line-height:20px;font-weight:600;color:${L.onAccent};text-decoration:none;border-radius:8px">${escapeHtml(action.label)}</a>`,
|
|
120
|
+
"</td>"
|
|
121
|
+
].join("");
|
|
122
|
+
}
|
|
123
|
+
function secondaryButton(action, href) {
|
|
124
|
+
return [
|
|
125
|
+
`<td class="t-btn2" style="border:1px solid ${L.hairline};border-radius:8px;mso-padding-alt:11px 21px">`,
|
|
126
|
+
`<a class="t-ink" href="${escapeHtml(href)}" style="display:inline-block;padding:11px 21px;font-family:${FONT};font-size:15px;line-height:20px;font-weight:600;color:${L.ink};text-decoration:none;border-radius:8px">${escapeHtml(action.label)}</a>`,
|
|
127
|
+
"</td>"
|
|
128
|
+
].join("");
|
|
129
|
+
}
|
|
130
|
+
function buttons(content, product) {
|
|
131
|
+
const cells = [];
|
|
132
|
+
if (content.primary) cells.push(primaryButton(content.primary, resolveEmailUrl(content.primary.url, product)));
|
|
133
|
+
if (content.secondary) {
|
|
134
|
+
if (cells.length > 0) cells.push('<td style="width:10px;font-size:0;line-height:0"> </td>');
|
|
135
|
+
cells.push(secondaryButton(content.secondary, resolveEmailUrl(content.secondary.url, product)));
|
|
136
|
+
}
|
|
137
|
+
if (cells.length === 0) return "";
|
|
138
|
+
return `<table role="presentation" cellpadding="0" cellspacing="0" border="0" style="margin:20px 0 0"><tr>${cells.join("")}</tr></table>`;
|
|
139
|
+
}
|
|
140
|
+
function small(html, margin, size = 13) {
|
|
141
|
+
return `<p class="t-muted" style="margin:${margin};font-family:${FONT};font-size:${size}px;line-height:${size + 7}px;color:${L.inkMuted}">${html}</p>`;
|
|
142
|
+
}
|
|
143
|
+
function footerLines(footer, product) {
|
|
144
|
+
const where = footer.workspaceName ? `${footer.workspaceName} \xB7 ${product.name}` : product.name;
|
|
145
|
+
const manage = footer.manageUrl ? resolveEmailUrl(footer.manageUrl, product) : null;
|
|
146
|
+
const html = [
|
|
147
|
+
escapeHtml(where),
|
|
148
|
+
escapeHtml(footer.reason),
|
|
149
|
+
...manage ? [link("Manage notifications", manage, "text-decoration:underline")] : [],
|
|
150
|
+
escapeHtml(TANGLE_POSTAL_ADDRESS)
|
|
151
|
+
];
|
|
152
|
+
const text = [where, footer.reason, ...manage ? [`Manage notifications: ${manage}`] : [], TANGLE_POSTAL_ADDRESS];
|
|
153
|
+
return { html, text };
|
|
154
|
+
}
|
|
155
|
+
var PREHEADER_SPACER = "͏‌ ".repeat(40);
|
|
156
|
+
function renderHtml(content, product) {
|
|
157
|
+
const primaryHref = content.primary ? resolveEmailUrl(content.primary.url, product) : null;
|
|
158
|
+
const footer = footerLines(content.footer, product);
|
|
159
|
+
const body = [
|
|
160
|
+
`<h1 class="t-ink" style="margin:0 0 12px;font-family:${FONT};font-size:22px;line-height:28px;font-weight:600;letter-spacing:-0.01em;color:${L.ink}">${escapeHtml(content.title)}</h1>`,
|
|
161
|
+
...content.paragraphs.map((text) => paragraph(text, "0 0 12px")),
|
|
162
|
+
content.items && content.items.length > 0 ? items(content.items, product) : "",
|
|
163
|
+
buttons(content, product),
|
|
164
|
+
content.showPrimaryLink && primaryHref ? small(`Or open this link: ${link(primaryHref, primaryHref, "word-break:break-all")}`, "20px 0 0") : "",
|
|
165
|
+
content.note ? small(escapeHtml(content.note), content.showPrimaryLink ? "8px 0 0" : "20px 0 0") : ""
|
|
166
|
+
].join("");
|
|
167
|
+
return [
|
|
168
|
+
"<!DOCTYPE html>",
|
|
169
|
+
'<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office">',
|
|
170
|
+
"<head>",
|
|
171
|
+
'<meta charset="utf-8">',
|
|
172
|
+
'<meta name="viewport" content="width=device-width, initial-scale=1">',
|
|
173
|
+
'<meta http-equiv="X-UA-Compatible" content="IE=edge">',
|
|
174
|
+
'<meta name="x-apple-disable-message-reformatting">',
|
|
175
|
+
'<meta name="format-detection" content="telephone=no, date=no, address=no, email=no, url=no">',
|
|
176
|
+
'<meta name="color-scheme" content="light dark">',
|
|
177
|
+
'<meta name="supported-color-schemes" content="light dark">',
|
|
178
|
+
`<title>${escapeHtml(content.subject)}</title>`,
|
|
179
|
+
"<!--[if mso]><noscript><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml></noscript><![endif]-->",
|
|
180
|
+
`<style>
|
|
181
|
+
${STYLE}
|
|
182
|
+
</style>`,
|
|
183
|
+
"</head>",
|
|
184
|
+
`<body class="t-bg" style="margin:0;padding:0;width:100%;background-color:${L.canvas};-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%">`,
|
|
185
|
+
`<div style="display:none;font-size:1px;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all">${escapeHtml(content.preheader)}${PREHEADER_SPACER}</div>`,
|
|
186
|
+
`<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" class="t-bg" bgcolor="${L.canvas}" style="background-color:${L.canvas}">`,
|
|
187
|
+
'<tr><td class="t-outer" align="center" style="padding:32px 12px">',
|
|
188
|
+
'<!--[if mso]><table role="presentation" width="560" cellpadding="0" cellspacing="0" border="0" align="center"><tr><td><![endif]-->',
|
|
189
|
+
'<table role="presentation" width="100%" cellpadding="0" cellspacing="0" border="0" style="max-width:560px;margin:0 auto">',
|
|
190
|
+
`<tr><td style="padding:0 4px 20px">${header(product)}</td></tr>`,
|
|
191
|
+
`<tr><td class="t-card" bgcolor="${L.card}" style="background-color:${L.card};border:1px solid ${L.hairline};border-radius:12px;padding:36px 36px 32px">${body}</td></tr>`,
|
|
192
|
+
`<tr><td style="padding:24px 4px 0">${footer.html.map((line, index) => small(line, index === 0 ? "0" : "4px 0 0", 12)).join("")}</td></tr>`,
|
|
193
|
+
"</table>",
|
|
194
|
+
"<!--[if mso]></td></tr></table><![endif]-->",
|
|
195
|
+
"</td></tr>",
|
|
196
|
+
"</table>",
|
|
197
|
+
"</body>",
|
|
198
|
+
"</html>"
|
|
199
|
+
].join("\n");
|
|
200
|
+
}
|
|
201
|
+
function renderText(content, product) {
|
|
202
|
+
const blocks = [product.name, content.title, ...content.paragraphs];
|
|
203
|
+
if (content.items && content.items.length > 0) {
|
|
204
|
+
blocks.push(content.items.map((item) => {
|
|
205
|
+
const lines = [`- ${item.title}`];
|
|
206
|
+
if (item.detail) lines.push(` ${item.detail}`);
|
|
207
|
+
if (item.url) lines.push(` ${resolveEmailUrl(item.url, product)}`);
|
|
208
|
+
return lines.join("\n");
|
|
209
|
+
}).join("\n"));
|
|
210
|
+
}
|
|
211
|
+
const actions = [content.primary, content.secondary].filter((action) => Boolean(action)).map((action) => `${action.label}: ${resolveEmailUrl(action.url, product)}`);
|
|
212
|
+
if (actions.length > 0) blocks.push(actions.join("\n"));
|
|
213
|
+
if (content.note) blocks.push(content.note);
|
|
214
|
+
blocks.push(["--", ...footerLines(content.footer, product).text].join("\n"));
|
|
215
|
+
return `${blocks.join("\n\n")}
|
|
216
|
+
`;
|
|
217
|
+
}
|
|
218
|
+
function renderEmail(product, content) {
|
|
219
|
+
return {
|
|
220
|
+
subject: content.subject,
|
|
221
|
+
preheader: content.preheader,
|
|
222
|
+
html: renderHtml(content, product),
|
|
223
|
+
text: renderText(content, product),
|
|
224
|
+
attachments: [MARK_ATTACHMENT]
|
|
225
|
+
};
|
|
226
|
+
}
|
|
227
|
+
function emailPreviewHtml(message) {
|
|
228
|
+
return message.attachments.reduce(
|
|
229
|
+
(html, attachment) => html.split(`cid:${attachment.contentId}`).join(`data:${attachment.contentType};base64,${attachment.content}`),
|
|
230
|
+
message.html
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
function emailSender(productName, address) {
|
|
234
|
+
if (!/^[^\s<>@]+@[^\s<>@]+\.[^\s<>@]+$/.test(address)) throw new TypeError(`Not an email address: ${address}`);
|
|
235
|
+
const name = /\bTangle\b/i.test(productName) ? productName : `${productName} \xB7 Tangle`;
|
|
236
|
+
return `${name} <${address}>`;
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// src/email/templates.ts
|
|
240
|
+
function midSentence(text) {
|
|
241
|
+
const first = text.split(/\s/, 1)[0] ?? "";
|
|
242
|
+
if ((first.match(/[A-Z]/g) ?? []).length > 1) return text;
|
|
243
|
+
return text.charAt(0).toLowerCase() + text.slice(1);
|
|
244
|
+
}
|
|
245
|
+
function plural(count, one, many) {
|
|
246
|
+
return count === 1 ? one : many;
|
|
247
|
+
}
|
|
248
|
+
function day(date) {
|
|
249
|
+
return date.toLocaleDateString("en-US", { month: "short", day: "numeric", year: "numeric", timeZone: "UTC" });
|
|
250
|
+
}
|
|
251
|
+
function approvalEmail(product, input) {
|
|
252
|
+
const [first, ...rest] = input.actions;
|
|
253
|
+
if (!first) throw new TypeError("approvalEmail needs at least one action");
|
|
254
|
+
const what = rest.length === 0 ? midSentence(first.summary) : `${midSentence(first.summary)} and ${rest.length} more`;
|
|
255
|
+
const where = input.conversation ? ` in \u201C${input.conversation}\u201D` : "";
|
|
256
|
+
return renderEmail(product, {
|
|
257
|
+
subject: emailSubject(`Approve: ${what}`, product),
|
|
258
|
+
preheader: `The agent paused${where} until you decide.`,
|
|
259
|
+
title: rest.length === 0 ? "Approval needed" : `${input.actions.length} approvals needed`,
|
|
260
|
+
paragraphs: [`The agent paused${where} until you decide. Nothing runs until you approve.`],
|
|
261
|
+
items: input.actions.map((action) => ({ title: action.summary, ...action.detail ? { detail: action.detail } : {} })),
|
|
262
|
+
primary: { label: "Approve", url: input.approveUrl },
|
|
263
|
+
secondary: { label: "Review", url: input.reviewUrl },
|
|
264
|
+
footer: input.footer
|
|
265
|
+
});
|
|
266
|
+
}
|
|
267
|
+
function inviteEmail(product, input) {
|
|
268
|
+
const role = input.role.toLowerCase();
|
|
269
|
+
const article = /^[aeiou]/.test(role) ? "an" : "a";
|
|
270
|
+
return renderEmail(product, {
|
|
271
|
+
subject: emailSubject(`Join ${input.workspaceName}`, product),
|
|
272
|
+
preheader: `${input.inviter} invited you to ${input.workspaceName}.`,
|
|
273
|
+
title: `Join ${input.workspaceName}`,
|
|
274
|
+
paragraphs: [`${input.inviter} invited you to ${input.workspaceName} on ${product.name} as ${article} ${role}.`],
|
|
275
|
+
primary: { label: "Accept invitation", url: input.acceptUrl },
|
|
276
|
+
showPrimaryLink: true,
|
|
277
|
+
note: `This invitation expires on ${day(input.expiresAt)}.`,
|
|
278
|
+
footer: {
|
|
279
|
+
workspaceName: input.workspaceName,
|
|
280
|
+
reason: `You received this because ${input.inviter} invited this address.`
|
|
281
|
+
}
|
|
282
|
+
});
|
|
283
|
+
}
|
|
284
|
+
function digestEmail(product, input) {
|
|
285
|
+
const count = input.items.length;
|
|
286
|
+
const updates = `${count} ${plural(count, "update", "updates")}`;
|
|
287
|
+
const date = input.date.toLocaleDateString("en-US", { weekday: "long", month: "long", day: "numeric", timeZone: "UTC" });
|
|
288
|
+
return renderEmail(product, {
|
|
289
|
+
subject: emailSubject(`${input.workspaceName}: ${updates}`, product),
|
|
290
|
+
preheader: input.items[0]?.title ?? `Nothing new in ${input.workspaceName}.`,
|
|
291
|
+
title: `What happened in ${input.workspaceName}`,
|
|
292
|
+
paragraphs: [count === 0 ? `Nothing new on ${date}.` : `${updates} on ${date}.`],
|
|
293
|
+
items: input.items,
|
|
294
|
+
primary: { label: `Open ${product.name}`, url: input.openUrl },
|
|
295
|
+
footer: input.footer
|
|
296
|
+
});
|
|
297
|
+
}
|
|
298
|
+
function noticeEmail(product, input) {
|
|
299
|
+
const paragraphs = typeof input.body === "string" ? [input.body] : [...input.body];
|
|
300
|
+
return renderEmail(product, {
|
|
301
|
+
subject: emailSubject(input.subject, product),
|
|
302
|
+
preheader: input.preheader ?? paragraphs[0] ?? input.title,
|
|
303
|
+
title: input.title,
|
|
304
|
+
paragraphs,
|
|
305
|
+
...input.action ? { primary: input.action } : {},
|
|
306
|
+
...input.secondaryAction ? { secondary: input.secondaryAction } : {},
|
|
307
|
+
...input.showLink ? { showPrimaryLink: true } : {},
|
|
308
|
+
...input.note ? { note: input.note } : {},
|
|
309
|
+
footer: input.footer
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
|
|
313
|
+
// src/email/lint.ts
|
|
314
|
+
var GMAIL_CLIP_BYTES = 102e3;
|
|
315
|
+
var tags = (html, name) => html.match(new RegExp(`<${name}\\b[^>]*>`, "gi")) ?? [];
|
|
316
|
+
var attribute = (tag, name) => {
|
|
317
|
+
const match = new RegExp(`\\s${name}="([^"]*)"`, "i").exec(tag);
|
|
318
|
+
return match ? match[1] : null;
|
|
319
|
+
};
|
|
320
|
+
function preludes(css) {
|
|
321
|
+
const out = [];
|
|
322
|
+
let depth = 0;
|
|
323
|
+
let start = 0;
|
|
324
|
+
for (let i = 0; i < css.length; i++) {
|
|
325
|
+
if (css[i] === "{") {
|
|
326
|
+
if (depth === 0) out.push(css.slice(start, i).trim());
|
|
327
|
+
depth++;
|
|
328
|
+
} else if (css[i] === "}") {
|
|
329
|
+
depth--;
|
|
330
|
+
if (depth === 0) start = i + 1;
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
return out;
|
|
334
|
+
}
|
|
335
|
+
function lintEmailHtml(html) {
|
|
336
|
+
const issues = [];
|
|
337
|
+
const issue = (rule, message) => issues.push({ rule, message });
|
|
338
|
+
const visible = html.replace(/<!--[\s\S]*?-->/g, "");
|
|
339
|
+
if (!/^<!DOCTYPE html>/i.test(html)) issue("document", "Missing <!DOCTYPE html>");
|
|
340
|
+
if (!/<html\b[^>]*\slang="[^"]+"/i.test(html)) issue("document", "Missing <html lang>");
|
|
341
|
+
if (!/<meta charset="utf-8">/i.test(html)) issue("document", 'Missing <meta charset="utf-8">');
|
|
342
|
+
if (!/<title>[^<]+<\/title>/i.test(html)) issue("document", "Missing <title>");
|
|
343
|
+
if (/<link\b[^>]*rel="?stylesheet/i.test(visible)) issue("external-css", "Linked stylesheets are stripped");
|
|
344
|
+
if (/@import\b/i.test(visible)) issue("external-css", "@import is stripped");
|
|
345
|
+
for (const block of visible.match(/<style\b[^>]*>([\s\S]*?)<\/style>/gi) ?? []) {
|
|
346
|
+
const css = block.replace(/<\/?style\b[^>]*>/gi, "").replace(/\/\*[\s\S]*?\*\//g, "");
|
|
347
|
+
for (const prelude of preludes(css)) {
|
|
348
|
+
if (!prelude.startsWith("@media") && !prelude.startsWith("[data-og")) {
|
|
349
|
+
issue("style-block", `<style> may only hold overrides; "${prelude}" must be inline`);
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
}
|
|
353
|
+
for (const name of ["script", "form", "input", "button", "svg", "iframe", "video", "audio", "object", "embed"]) {
|
|
354
|
+
if (tags(visible, name).length > 0) issue("unsupported-element", `<${name}> is stripped or unsupported`);
|
|
355
|
+
}
|
|
356
|
+
for (const pattern of [
|
|
357
|
+
/display\s*:\s*(?:flex|grid|inline-flex)/i,
|
|
358
|
+
/position\s*:/i,
|
|
359
|
+
/float\s*:/i,
|
|
360
|
+
/var\(/i,
|
|
361
|
+
/calc\(/i,
|
|
362
|
+
/rgba?\(|hsla?\(/i,
|
|
363
|
+
/background-image\s*:|url\(/i
|
|
364
|
+
]) {
|
|
365
|
+
if (pattern.test(visible)) issue("unsupported-css", `Outlook does not render ${pattern.source}`);
|
|
366
|
+
}
|
|
367
|
+
for (const table of tags(visible, "table")) {
|
|
368
|
+
if (attribute(table, "role") !== "presentation") issue("layout-table", `Layout table without role="presentation": ${table.slice(0, 80)}`);
|
|
369
|
+
for (const name of ["cellpadding", "cellspacing", "border"]) {
|
|
370
|
+
if (attribute(table, name) !== "0") issue("layout-table", `Layout table without ${name}="0": ${table.slice(0, 80)}`);
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
for (const div of tags(visible, "div")) {
|
|
374
|
+
const style = attribute(div, "style") ?? "";
|
|
375
|
+
if (!/display\s*:\s*none/i.test(style) && /(?:^|;)\s*(?:max-)?width\s*:/i.test(style)) {
|
|
376
|
+
issue("layout-table", "Outlook ignores <div> widths; size with a table cell");
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
for (const name of ["p", "h1", "h2", "h3", "a", "span"]) {
|
|
380
|
+
for (const tag of tags(visible, name)) {
|
|
381
|
+
const style = attribute(tag, "style") ?? "";
|
|
382
|
+
if (!/(?:^|;)\s*color\s*:/i.test(style) || !/font-(?:family|size)\s*:/i.test(style) && name !== "a") {
|
|
383
|
+
issue("inline-style", `<${name}> without inline color and font: ${tag.slice(0, 80)}`);
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
for (const img of tags(visible, "img")) {
|
|
388
|
+
if (!attribute(img, "alt")) issue("image", `Image without alt text: ${img.slice(0, 80)}`);
|
|
389
|
+
if (!attribute(img, "width") || !attribute(img, "height")) issue("image", `Image without width and height: ${img.slice(0, 80)}`);
|
|
390
|
+
const src = attribute(img, "src") ?? "";
|
|
391
|
+
if (!/^(?:https:|cid:)/.test(src)) issue("image", `Image source must be https: or cid: (${src.slice(0, 40)})`);
|
|
392
|
+
}
|
|
393
|
+
for (const anchor of tags(visible, "a")) {
|
|
394
|
+
const href = attribute(anchor, "href") ?? "";
|
|
395
|
+
if (!/^(?:https:\/\/|mailto:|http:\/\/(?:localhost|127\.0\.0\.1)[:/])/.test(href)) {
|
|
396
|
+
issue("link", `Links must be absolute https: ${href.slice(0, 60)}`);
|
|
397
|
+
}
|
|
398
|
+
}
|
|
399
|
+
const bytes = new TextEncoder().encode(html).length;
|
|
400
|
+
if (bytes > GMAIL_CLIP_BYTES) issue("size", `${bytes} bytes; Gmail clips above ${GMAIL_CLIP_BYTES}`);
|
|
401
|
+
return issues;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
export {
|
|
405
|
+
emailPreviewHtml,
|
|
406
|
+
emailSender,
|
|
407
|
+
approvalEmail,
|
|
408
|
+
inviteEmail,
|
|
409
|
+
digestEmail,
|
|
410
|
+
noticeEmail,
|
|
411
|
+
lintEmailHtml
|
|
412
|
+
};
|
|
413
|
+
//# sourceMappingURL=chunk-YPPVNQOC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/email/mark.generated.ts","../src/email/palette.ts","../src/email/layout.ts","../src/email/templates.ts","../src/email/lint.ts"],"sourcesContent":["// GENERATED by scripts/email-mark.mjs from @tangle-network/brand TangleKnot; do not edit.\n/** The Tangle knot as a 84px transparent PNG (base64), shown at 28px in email headers. */\nexport const TANGLE_MARK_PNG_BASE64 =\n 'iVBORw0KGgoAAAANSUhEUgAAAFQAAABUCAYAAAAcaxDBAAAQAElEQVR4nOxcDZBV1X3//8+9971dVvkwEhR1GuvEatIY09hmOklTCU2bMQYnH3ZMTAmRZRdpqIAYgV3Iy35CgAUEBBGcBNskliSmTZqPjtox6dhJaGY61NFGpfEDSBRBgbjsvnfv+fd/P86959x73+5b9r26mdm/Luede+/5uP/zO//z/zjnCpikupKASaorTTK0zjTJ0DrTJEPrTJMMrTNNMrTOZMM4qWuxewsBXsVDcxEBzSQUBQAJ4VhxilHq/6sPHyY/SU+NIeYriFw6TMMnMC6Rfj5oFVVrOfWh+Wx0zUWiEyTwZeHRrzauL+yFcRDCOVDPYu8LHtICr4Dv8oAK/rsGr+q/PMkgDfPccWJ281sSpxCl4f2QScF1xSztepwnGV0PLxv1CAzrj8qF7afykG3PzMuofyE3+L5nS/FL8OChLb1OF4yRamZoaSlNtctyo2vTpz0LzlcvTVpNlKqZ4pRiJgPo+QhpGD0YvKQql0Ji1FPCpH7Qn9DqBwy5Q1p9RntR9ZTqJwCY7REO2S78gCrunVvXNz8PNVBNDO1tc1vLNm4nC5oyI28gJWFGMvIJ8vKQotejIy9TLrgPoABt1JNCqn59xPaNctFMoFBK6eUECldUaNfWLueOaLTOnaFd7fIx15FzgkeNkU8hSqux2ogbyPCvoyYT09MdakCQfl/dUUhF9STG7ZhMrb3fYV95PD16XkBh7tYS/i9UoRFX+e52+aRryzkYvbSfKmT5QxnmAVC1qkZY6w1FyFW8CkYeomkfCq3kOT0P0TRV9UepWZ8qpzFT5UljYlRvjHQw6437jar9ZPBV3k/Jwrd5WD64rJcursazqgjtaXMZmTgnI6NQz4d3GQBnhMRf8/w5AkIMklrlMfjf4euXCoLZ/PSMoDRCslbnIJe1gaelRYdVD2Wmd9yCDVMrDrw9KhHM0wRxKi+jKvAsEp4UHpzkvpb1ejkpSEGX8Co/m9ucoa8Jqq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Eal9AFxelpvkAwNdThvgOL/OqMiPgjpI97PqNA+CyE5Sgz7CGdQayFSkIzV5OfNlR0ImpBCtkKlJ5QipCTKrRDejPiJkZ4Zv9HoFeXC4SAvvKRWfhBqoZoYq2tBKl/rKOGvc77MkzsogFvKRmS8j06tzFsEmwvJmxgjlRpCh2e+NJqdN2FX4mifov8qFyupt3VPGdIR8zAxNU1e7O5879vv88yLu5UzuVSGNIEVSX/2FoQWkngNDQ07LPMi7r2YCqG/hpWQ0pMph/HVGl03fE2DhbzygF8vkPLx9HKecx83QSTJpAp8C+d2kSYbWmSYZWmeaZGidaZKhdaZJhtaZJhlaZ/o/AAAA//8mfCa5AAAABklEQVQDAPyiOFzVbOpbAAAAAElFTkSuQmCC'\n","/**\n * The Brand roles the email layout paints with, as literal hex. Email clients\n * cannot read CSS variables, and importing `@tangle-network/brand` at runtime\n * would load React into a server-only renderer, so the values live here and\n * `tests/email/palette.test.ts` fails when they drift from Brand's `palettes`.\n */\nexport const EMAIL_PALETTE = {\n light: {\n canvas: '#eceef3',\n card: '#ffffff',\n well: '#f6f7fa',\n hairline: '#c7c6d6',\n ink: '#2d2d2d',\n inkSecondary: '#3f3f3f',\n inkMuted: '#4c4c4c',\n accent: '#4c3fc5',\n onAccent: '#ffffff',\n accentText: '#3c32e9',\n },\n dark: {\n canvas: '#0a0a14',\n card: '#191826',\n well: '#12111f',\n hairline: '#2a293d',\n ink: '#e6e6e6',\n inkSecondary: '#c7c7c7',\n inkMuted: '#b5b5b5',\n accent: '#4c3fc5',\n onAccent: '#ffffff',\n accentText: '#a5b4fc',\n },\n} as const\n\n/**\n * Brand's `--font-sans` stack with the system faces email clients actually\n * have. No client used for this mail loads web fonts reliably, so Inter shows\n * only where it is installed and the platform UI face carries the rest.\n */\nexport const EMAIL_FONT_STACK =\n \"Inter, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Helvetica, Arial, sans-serif\"\n\n/** The postal line every Tangle email footer carries (Stripe business profile support address). */\nexport const TANGLE_POSTAL_ADDRESS =\n 'Tangle Technologies, Inc., 3740 South Ocean Blvd, #1407, Highland Beach, FL 33487, USA'\n","import { TANGLE_MARK_PNG_BASE64 } from './mark.generated'\nimport { EMAIL_FONT_STACK, EMAIL_PALETTE, TANGLE_POSTAL_ADDRESS } from './palette'\n\n/** The app an email comes from. */\nexport interface EmailProduct {\n /** Shown beside the Tangle mark, after each subject and in the sender name, e.g. `GTM Agent`. */\n name: string\n /** The app's absolute origin; app-relative links resolve against it. */\n url: string\n}\n\n/** Why the recipient got the email and where they control it. */\nexport interface EmailFooter {\n /** The workspace the email concerns. */\n workspaceName?: string\n /** One sentence, e.g. `You own this workspace.` */\n reason: string\n /** Where the recipient changes which emails they get; absolute or app-relative. */\n manageUrl?: string\n}\n\n/** A button. `url` is absolute or app-relative. */\nexport interface EmailAction {\n label: string\n url: string\n}\n\n/** One row in the email's list box: an approval request or a digest entry. */\nexport interface EmailItem {\n title: string\n detail?: string\n /** Makes the title a link; absolute or app-relative. */\n url?: string\n}\n\n/** An inline image the HTML references by `cid:`; the mail client must send it with the message. */\nexport interface EmailAttachment {\n filename: string\n /** Base64 file content, the form Resend and SES accept. */\n content: string\n contentType: string\n contentId: string\n}\n\n/** A rendered email, ready for any transport. */\nexport interface EmailMessage {\n subject: string\n /** The inbox preview line. */\n preheader: string\n html: string\n text: string\n /** Pass these through to the mail client; the header mark is one of them. */\n attachments: EmailAttachment[]\n}\n\n/** What a template places in the shared layout. */\ninterface EmailContent {\n subject: string\n preheader: string\n title: string\n paragraphs: readonly string[]\n items?: readonly EmailItem[]\n primary?: EmailAction\n secondary?: EmailAction\n /** Print the primary link under the buttons for clients that strip them. */\n showPrimaryLink?: boolean\n /** A short line under the buttons, e.g. an expiry. */\n note?: string\n footer: EmailFooter\n}\n\nconst MARK_CONTENT_ID = 'tangle-mark'\nconst MARK_ATTACHMENT: EmailAttachment = {\n filename: 'tangle.png',\n content: TANGLE_MARK_PNG_BASE64,\n contentType: 'image/png',\n contentId: MARK_CONTENT_ID,\n}\n\nconst L = EMAIL_PALETTE.light\nconst D = EMAIL_PALETTE.dark\nconst FONT = EMAIL_FONT_STACK\n\n// Inline styles carry the light design; this block only adapts it for clients\n// that honor dark mode or narrow screens. A client that drops <style> still\n// renders the complete light email.\nconst STYLE = `\n@media (prefers-color-scheme: dark) {\n .t-bg { background-color: ${D.canvas} !important; }\n .t-card { background-color: ${D.card} !important; border-color: ${D.hairline} !important; }\n .t-well { background-color: ${D.well} !important; }\n .t-rule { border-color: ${D.hairline} !important; }\n .t-ink { color: ${D.ink} !important; }\n .t-ink2 { color: ${D.inkSecondary} !important; }\n .t-muted { color: ${D.inkMuted} !important; }\n .t-link { color: ${D.accentText} !important; }\n .t-btn2 { border-color: ${D.hairline} !important; }\n}\n@media (max-width: 600px) {\n .t-outer { padding: 20px 8px !important; }\n .t-card { padding: 28px 22px 24px !important; }\n}\n[data-ogsb] .t-bg { background-color: ${D.canvas} !important; }\n[data-ogsb] .t-card { background-color: ${D.card} !important; }\n[data-ogsb] .t-well { background-color: ${D.well} !important; }\n[data-ogsc] .t-ink { color: ${D.ink} !important; }\n[data-ogsc] .t-ink2 { color: ${D.inkSecondary} !important; }\n[data-ogsc] .t-muted { color: ${D.inkMuted} !important; }\n[data-ogsc] .t-link { color: ${D.accentText} !important; }\n`.trim()\n\n/** Escape text for HTML element content and quoted attribute values. */\nfunction escapeHtml(value: string): string {\n return value\n .replace(/&/g, '&')\n .replace(/</g, '<')\n .replace(/>/g, '>')\n .replace(/\"/g, '"')\n .replace(/'/g, ''')\n}\n\n/** An absolute http(s) URL; app-relative paths resolve against the product origin. */\nfunction resolveEmailUrl(url: string, product: EmailProduct): string {\n const resolved = new URL(url, product.url)\n if (resolved.protocol !== 'https:' && resolved.protocol !== 'http:') {\n throw new TypeError(`Email links must be http(s): ${resolved.protocol}`)\n }\n return resolved.toString()\n}\n\n/** `Title — Product`, the one subject shape every Tangle email uses. */\nexport function emailSubject(subject: string, product: EmailProduct): string {\n return `${subject} — ${product.name}`\n}\n\nfunction paragraph(text: string, margin: string): string {\n return `<p class=\"t-ink2\" style=\"margin:${margin};font-family:${FONT};font-size:15px;line-height:24px;color:${L.inkSecondary}\">${escapeHtml(text)}</p>`\n}\n\nfunction link(label: string, href: string, style: string): string {\n return `<a class=\"t-link\" href=\"${escapeHtml(href)}\" style=\"color:${L.accentText};text-decoration:none;${style}\">${escapeHtml(label)}</a>`\n}\n\nfunction header(product: EmailProduct): string {\n return [\n '<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">',\n '<tr>',\n `<td style=\"padding:0 10px 0 0;vertical-align:middle\"><img src=\"cid:${MARK_CONTENT_ID}\" width=\"28\" height=\"28\" alt=\"Tangle\" style=\"display:block;width:28px;height:28px;border:0;outline:none;text-decoration:none\"></td>`,\n `<td class=\"t-ink\" style=\"vertical-align:middle;font-family:${FONT};font-size:16px;line-height:20px;font-weight:600;letter-spacing:-0.01em;color:${L.ink}\">${escapeHtml(product.name)}</td>`,\n '</tr>',\n '</table>',\n ].join('')\n}\n\nfunction items(list: readonly EmailItem[], product: EmailProduct): string {\n const rows = list.map((item, index) => {\n const rule = index === 0 ? '' : `border-top:1px solid ${L.hairline};`\n const title = item.url\n ? link(item.title, resolveEmailUrl(item.url, product), 'font-weight:600')\n : escapeHtml(item.title)\n const detail = item.detail\n ? `<p class=\"t-muted\" style=\"margin:2px 0 0;font-family:${FONT};font-size:13px;line-height:20px;color:${L.inkMuted}\">${escapeHtml(item.detail)}</p>`\n : ''\n return [\n `<tr><td class=\"t-rule\" style=\"padding:14px 16px;${rule}\">`,\n `<p class=\"t-ink\" style=\"margin:0;font-family:${FONT};font-size:15px;line-height:22px;font-weight:600;color:${L.ink}\">${title}</p>`,\n detail,\n '</td></tr>',\n ].join('')\n })\n return [\n `<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"t-well\" bgcolor=\"${L.well}\" style=\"background-color:${L.well};border-radius:8px;margin:4px 0 8px\">`,\n ...rows,\n '</table>',\n ].join('')\n}\n\nfunction primaryButton(action: EmailAction, href: string): string {\n return [\n `<td bgcolor=\"${L.accent}\" style=\"border-radius:8px;background-color:${L.accent};mso-padding-alt:12px 22px\">`,\n `<a href=\"${escapeHtml(href)}\" style=\"display:inline-block;padding:12px 22px;font-family:${FONT};font-size:15px;line-height:20px;font-weight:600;color:${L.onAccent};text-decoration:none;border-radius:8px\">${escapeHtml(action.label)}</a>`,\n '</td>',\n ].join('')\n}\n\nfunction secondaryButton(action: EmailAction, href: string): string {\n return [\n `<td class=\"t-btn2\" style=\"border:1px solid ${L.hairline};border-radius:8px;mso-padding-alt:11px 21px\">`,\n `<a class=\"t-ink\" href=\"${escapeHtml(href)}\" style=\"display:inline-block;padding:11px 21px;font-family:${FONT};font-size:15px;line-height:20px;font-weight:600;color:${L.ink};text-decoration:none;border-radius:8px\">${escapeHtml(action.label)}</a>`,\n '</td>',\n ].join('')\n}\n\nfunction buttons(content: EmailContent, product: EmailProduct): string {\n const cells: string[] = []\n if (content.primary) cells.push(primaryButton(content.primary, resolveEmailUrl(content.primary.url, product)))\n if (content.secondary) {\n if (cells.length > 0) cells.push('<td style=\"width:10px;font-size:0;line-height:0\"> </td>')\n cells.push(secondaryButton(content.secondary, resolveEmailUrl(content.secondary.url, product)))\n }\n if (cells.length === 0) return ''\n return `<table role=\"presentation\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"margin:20px 0 0\"><tr>${cells.join('')}</tr></table>`\n}\n\nfunction small(html: string, margin: string, size = 13): string {\n return `<p class=\"t-muted\" style=\"margin:${margin};font-family:${FONT};font-size:${size}px;line-height:${size + 7}px;color:${L.inkMuted}\">${html}</p>`\n}\n\nfunction footerLines(footer: EmailFooter, product: EmailProduct): { html: string[]; text: string[] } {\n const where = footer.workspaceName ? `${footer.workspaceName} · ${product.name}` : product.name\n const manage = footer.manageUrl ? resolveEmailUrl(footer.manageUrl, product) : null\n const html = [\n escapeHtml(where),\n escapeHtml(footer.reason),\n ...(manage ? [link('Manage notifications', manage, 'text-decoration:underline')] : []),\n escapeHtml(TANGLE_POSTAL_ADDRESS),\n ]\n const text = [where, footer.reason, ...(manage ? [`Manage notifications: ${manage}`] : []), TANGLE_POSTAL_ADDRESS]\n return { html, text }\n}\n\n// Keeps the body text that follows out of the inbox preview line.\nconst PREHEADER_SPACER = '͏‌ '.repeat(40)\n\nfunction renderHtml(content: EmailContent, product: EmailProduct): string {\n const primaryHref = content.primary ? resolveEmailUrl(content.primary.url, product) : null\n const footer = footerLines(content.footer, product)\n const body = [\n `<h1 class=\"t-ink\" style=\"margin:0 0 12px;font-family:${FONT};font-size:22px;line-height:28px;font-weight:600;letter-spacing:-0.01em;color:${L.ink}\">${escapeHtml(content.title)}</h1>`,\n ...content.paragraphs.map((text) => paragraph(text, '0 0 12px')),\n content.items && content.items.length > 0 ? items(content.items, product) : '',\n buttons(content, product),\n content.showPrimaryLink && primaryHref\n ? small(`Or open this link: ${link(primaryHref, primaryHref, 'word-break:break-all')}`, '20px 0 0')\n : '',\n content.note ? small(escapeHtml(content.note), content.showPrimaryLink ? '8px 0 0' : '20px 0 0') : '',\n ].join('')\n\n return [\n '<!DOCTYPE html>',\n '<html lang=\"en\" xmlns=\"http://www.w3.org/1999/xhtml\" xmlns:v=\"urn:schemas-microsoft-com:vml\" xmlns:o=\"urn:schemas-microsoft-com:office:office\">',\n '<head>',\n '<meta charset=\"utf-8\">',\n '<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">',\n '<meta http-equiv=\"X-UA-Compatible\" content=\"IE=edge\">',\n '<meta name=\"x-apple-disable-message-reformatting\">',\n '<meta name=\"format-detection\" content=\"telephone=no, date=no, address=no, email=no, url=no\">',\n '<meta name=\"color-scheme\" content=\"light dark\">',\n '<meta name=\"supported-color-schemes\" content=\"light dark\">',\n `<title>${escapeHtml(content.subject)}</title>`,\n '<!--[if mso]><noscript><xml><o:OfficeDocumentSettings><o:PixelsPerInch>96</o:PixelsPerInch></o:OfficeDocumentSettings></xml></noscript><![endif]-->',\n `<style>\\n${STYLE}\\n</style>`,\n '</head>',\n `<body class=\"t-bg\" style=\"margin:0;padding:0;width:100%;background-color:${L.canvas};-webkit-text-size-adjust:100%;-ms-text-size-adjust:100%\">`,\n `<div style=\"display:none;font-size:1px;line-height:1px;max-height:0;max-width:0;opacity:0;overflow:hidden;mso-hide:all\">${escapeHtml(content.preheader)}${PREHEADER_SPACER}</div>`,\n `<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" class=\"t-bg\" bgcolor=\"${L.canvas}\" style=\"background-color:${L.canvas}\">`,\n '<tr><td class=\"t-outer\" align=\"center\" style=\"padding:32px 12px\">',\n '<!--[if mso]><table role=\"presentation\" width=\"560\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" align=\"center\"><tr><td><![endif]-->',\n '<table role=\"presentation\" width=\"100%\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\" style=\"max-width:560px;margin:0 auto\">',\n `<tr><td style=\"padding:0 4px 20px\">${header(product)}</td></tr>`,\n `<tr><td class=\"t-card\" bgcolor=\"${L.card}\" style=\"background-color:${L.card};border:1px solid ${L.hairline};border-radius:12px;padding:36px 36px 32px\">${body}</td></tr>`,\n `<tr><td style=\"padding:24px 4px 0\">${footer.html.map((line, index) => small(line, index === 0 ? '0' : '4px 0 0', 12)).join('')}</td></tr>`,\n '</table>',\n '<!--[if mso]></td></tr></table><![endif]-->',\n '</td></tr>',\n '</table>',\n '</body>',\n '</html>',\n ].join('\\n')\n}\n\nfunction renderText(content: EmailContent, product: EmailProduct): string {\n const blocks: string[] = [product.name, content.title, ...content.paragraphs]\n if (content.items && content.items.length > 0) {\n blocks.push(content.items.map((item) => {\n const lines = [`- ${item.title}`]\n if (item.detail) lines.push(` ${item.detail}`)\n if (item.url) lines.push(` ${resolveEmailUrl(item.url, product)}`)\n return lines.join('\\n')\n }).join('\\n'))\n }\n const actions = [content.primary, content.secondary]\n .filter((action): action is EmailAction => Boolean(action))\n .map((action) => `${action.label}: ${resolveEmailUrl(action.url, product)}`)\n if (actions.length > 0) blocks.push(actions.join('\\n'))\n if (content.note) blocks.push(content.note)\n blocks.push(['--', ...footerLines(content.footer, product).text].join('\\n'))\n return `${blocks.join('\\n\\n')}\\n`\n}\n\n/** Place a template's content in the shared Tangle layout. */\nexport function renderEmail(product: EmailProduct, content: EmailContent): EmailMessage {\n return {\n subject: content.subject,\n preheader: content.preheader,\n html: renderHtml(content, product),\n text: renderText(content, product),\n attachments: [MARK_ATTACHMENT],\n }\n}\n\n/**\n * The HTML with inline images embedded as data URIs, for browser previews and\n * screenshots. Mail clients get `cid:` references and the attachments instead.\n */\nexport function emailPreviewHtml(message: Pick<EmailMessage, 'html' | 'attachments'>): string {\n return message.attachments.reduce(\n (html, attachment) => html.split(`cid:${attachment.contentId}`).join(`data:${attachment.contentType};base64,${attachment.content}`),\n message.html,\n )\n}\n\n/**\n * The From header for an app's mail: `GTM Agent · Tangle <noreply@tangle.tools>`.\n * The product leads because inbox sender columns truncate; `· Tangle` ties\n * every app to the company and the sending domain.\n */\nexport function emailSender(productName: string, address: string): string {\n if (!/^[^\\s<>@]+@[^\\s<>@]+\\.[^\\s<>@]+$/.test(address)) throw new TypeError(`Not an email address: ${address}`)\n const name = /\\bTangle\\b/i.test(productName) ? productName : `${productName} · Tangle`\n return `${name} <${address}>`\n}\n","import {\n emailSubject,\n renderEmail,\n type EmailAction,\n type EmailFooter,\n type EmailItem,\n type EmailMessage,\n type EmailProduct,\n} from './layout'\n\n/** Sentence case to mid-sentence: `Create agent` → `create agent`; acronyms such as `API key` keep their case. */\nfunction midSentence(text: string): string {\n const first = text.split(/\\s/, 1)[0] ?? ''\n if ((first.match(/[A-Z]/g) ?? []).length > 1) return text\n return text.charAt(0).toLowerCase() + text.slice(1)\n}\n\nfunction plural(count: number, one: string, many: string): string {\n return count === 1 ? one : many\n}\n\nfunction day(date: Date): string {\n return date.toLocaleDateString('en-US', { month: 'short', day: 'numeric', year: 'numeric', timeZone: 'UTC' })\n}\n\n/** One action an agent is waiting to run. */\nexport interface ApprovalEmailAction {\n /** What runs, in plain language and sentence case: `Create agent “Quinn”`. */\n summary: string\n /** Where it runs and until when, e.g. `ph0ny · open until Oct 9, 3:40 PM UTC`. */\n detail?: string\n}\n\n/** Input for {@link approvalEmail}. */\nexport interface ApprovalEmailInput {\n /** At least one action, in the order the agent asked. */\n actions: readonly ApprovalEmailAction[]\n /** The conversation the agent paused in. */\n conversation?: string\n /** Opens the decision, e.g. the chat with the approval card. */\n approveUrl: string\n /** Opens the context, e.g. every request waiting in the workspace. */\n reviewUrl: string\n footer: EmailFooter\n}\n\n/**\n * An agent paused until someone approves what it wants to do. Neither button\n * decides anything: link scanners open email links, so both lead to the app,\n * where the signed-in owner approves.\n */\nexport function approvalEmail(product: EmailProduct, input: ApprovalEmailInput): EmailMessage {\n const [first, ...rest] = input.actions\n if (!first) throw new TypeError('approvalEmail needs at least one action')\n const what = rest.length === 0\n ? midSentence(first.summary)\n : `${midSentence(first.summary)} and ${rest.length} more`\n const where = input.conversation ? ` in “${input.conversation}”` : ''\n return renderEmail(product, {\n subject: emailSubject(`Approve: ${what}`, product),\n preheader: `The agent paused${where} until you decide.`,\n title: rest.length === 0 ? 'Approval needed' : `${input.actions.length} approvals needed`,\n paragraphs: [`The agent paused${where} until you decide. Nothing runs until you approve.`],\n items: input.actions.map((action): EmailItem => ({ title: action.summary, ...(action.detail ? { detail: action.detail } : {}) })),\n primary: { label: 'Approve', url: input.approveUrl },\n secondary: { label: 'Review', url: input.reviewUrl },\n footer: input.footer,\n })\n}\n\n/** Input for {@link inviteEmail}. */\nexport interface InviteEmailInput {\n workspaceName: string\n /** Who sent the invitation: a name or an email address. */\n inviter: string\n /** The role the invitation grants, e.g. `editor`. */\n role: string\n acceptUrl: string\n expiresAt: Date\n}\n\n/** Someone invited the recipient to a workspace. */\nexport function inviteEmail(product: EmailProduct, input: InviteEmailInput): EmailMessage {\n const role = input.role.toLowerCase()\n const article = /^[aeiou]/.test(role) ? 'an' : 'a'\n return renderEmail(product, {\n subject: emailSubject(`Join ${input.workspaceName}`, product),\n preheader: `${input.inviter} invited you to ${input.workspaceName}.`,\n title: `Join ${input.workspaceName}`,\n paragraphs: [`${input.inviter} invited you to ${input.workspaceName} on ${product.name} as ${article} ${role}.`],\n primary: { label: 'Accept invitation', url: input.acceptUrl },\n showPrimaryLink: true,\n note: `This invitation expires on ${day(input.expiresAt)}.`,\n footer: {\n workspaceName: input.workspaceName,\n reason: `You received this because ${input.inviter} invited this address.`,\n },\n })\n}\n\n/** Input for {@link digestEmail}. */\nexport interface DigestEmailInput {\n workspaceName: string\n /** The day the digest covers. */\n date: Date\n /** What happened, most important first. */\n items: readonly EmailItem[]\n /** Opens the workspace. */\n openUrl: string\n footer: EmailFooter\n}\n\n/** What happened in a workspace that day. */\nexport function digestEmail(product: EmailProduct, input: DigestEmailInput): EmailMessage {\n const count = input.items.length\n const updates = `${count} ${plural(count, 'update', 'updates')}`\n const date = input.date.toLocaleDateString('en-US', { weekday: 'long', month: 'long', day: 'numeric', timeZone: 'UTC' })\n return renderEmail(product, {\n subject: emailSubject(`${input.workspaceName}: ${updates}`, product),\n preheader: input.items[0]?.title ?? `Nothing new in ${input.workspaceName}.`,\n title: `What happened in ${input.workspaceName}`,\n paragraphs: [count === 0 ? `Nothing new on ${date}.` : `${updates} on ${date}.`],\n items: input.items,\n primary: { label: `Open ${product.name}`, url: input.openUrl },\n footer: input.footer,\n })\n}\n\n/** Input for {@link noticeEmail}. */\nexport interface NoticeEmailInput {\n /** Short; the product name is appended. */\n subject: string\n title: string\n /** One or two short paragraphs. */\n body: string | readonly string[]\n action?: EmailAction\n secondaryAction?: EmailAction\n /** Print the action's link too, for one-time links such as sign-in. */\n showLink?: boolean\n note?: string\n /** Inbox preview line. Defaults to the first paragraph. */\n preheader?: string\n footer: EmailFooter\n}\n\n/** Any other transactional message: one title, a short body and at most two buttons. */\nexport function noticeEmail(product: EmailProduct, input: NoticeEmailInput): EmailMessage {\n const paragraphs = typeof input.body === 'string' ? [input.body] : [...input.body]\n return renderEmail(product, {\n subject: emailSubject(input.subject, product),\n preheader: input.preheader ?? paragraphs[0] ?? input.title,\n title: input.title,\n paragraphs,\n ...(input.action ? { primary: input.action } : {}),\n ...(input.secondaryAction ? { secondary: input.secondaryAction } : {}),\n ...(input.showLink ? { showPrimaryLink: true } : {}),\n ...(input.note ? { note: input.note } : {}),\n footer: input.footer,\n })\n}\n","/** One way an email's HTML would break in Gmail or Outlook. */\nexport interface EmailLintIssue {\n rule:\n | 'document'\n | 'external-css'\n | 'style-block'\n | 'unsupported-element'\n | 'unsupported-css'\n | 'layout-table'\n | 'inline-style'\n | 'image'\n | 'link'\n | 'size'\n message: string\n}\n\n// Gmail clips a message body larger than about 102 KB behind \"View entire message\".\nconst GMAIL_CLIP_BYTES = 102_000\n\nconst tags = (html: string, name: string): string[] =>\n html.match(new RegExp(`<${name}\\\\b[^>]*>`, 'gi')) ?? []\n\nconst attribute = (tag: string, name: string): string | null => {\n const match = new RegExp(`\\\\s${name}=\"([^\"]*)\"`, 'i').exec(tag)\n return match ? match[1]! : null\n}\n\n/** Top-level rules of a stylesheet: their selector or at-rule preludes. */\nfunction preludes(css: string): string[] {\n const out: string[] = []\n let depth = 0\n let start = 0\n for (let i = 0; i < css.length; i++) {\n if (css[i] === '{') {\n if (depth === 0) out.push(css.slice(start, i).trim())\n depth++\n } else if (css[i] === '}') {\n depth--\n if (depth === 0) start = i + 1\n }\n }\n return out\n}\n\n/**\n * Check rendered email HTML against what Gmail and Outlook render: a complete\n * document, layout in presentation tables, styles inline (a `<style>` block may\n * only add dark-mode and narrow-screen overrides), images with alt text and\n * fixed size, absolute links, and a body small enough that Gmail does not clip.\n */\nexport function lintEmailHtml(html: string): EmailLintIssue[] {\n const issues: EmailLintIssue[] = []\n const issue = (rule: EmailLintIssue['rule'], message: string) => issues.push({ rule, message })\n const visible = html.replace(/<!--[\\s\\S]*?-->/g, '')\n\n if (!/^<!DOCTYPE html>/i.test(html)) issue('document', 'Missing <!DOCTYPE html>')\n if (!/<html\\b[^>]*\\slang=\"[^\"]+\"/i.test(html)) issue('document', 'Missing <html lang>')\n if (!/<meta charset=\"utf-8\">/i.test(html)) issue('document', 'Missing <meta charset=\"utf-8\">')\n if (!/<title>[^<]+<\\/title>/i.test(html)) issue('document', 'Missing <title>')\n\n if (/<link\\b[^>]*rel=\"?stylesheet/i.test(visible)) issue('external-css', 'Linked stylesheets are stripped')\n if (/@import\\b/i.test(visible)) issue('external-css', '@import is stripped')\n\n for (const block of visible.match(/<style\\b[^>]*>([\\s\\S]*?)<\\/style>/gi) ?? []) {\n const css = block.replace(/<\\/?style\\b[^>]*>/gi, '').replace(/\\/\\*[\\s\\S]*?\\*\\//g, '')\n for (const prelude of preludes(css)) {\n if (!prelude.startsWith('@media') && !prelude.startsWith('[data-og')) {\n issue('style-block', `<style> may only hold overrides; \"${prelude}\" must be inline`)\n }\n }\n }\n\n for (const name of ['script', 'form', 'input', 'button', 'svg', 'iframe', 'video', 'audio', 'object', 'embed']) {\n if (tags(visible, name).length > 0) issue('unsupported-element', `<${name}> is stripped or unsupported`)\n }\n\n for (const pattern of [\n /display\\s*:\\s*(?:flex|grid|inline-flex)/i,\n /position\\s*:/i,\n /float\\s*:/i,\n /var\\(/i,\n /calc\\(/i,\n /rgba?\\(|hsla?\\(/i,\n /background-image\\s*:|url\\(/i,\n ]) {\n if (pattern.test(visible)) issue('unsupported-css', `Outlook does not render ${pattern.source}`)\n }\n\n for (const table of tags(visible, 'table')) {\n if (attribute(table, 'role') !== 'presentation') issue('layout-table', `Layout table without role=\"presentation\": ${table.slice(0, 80)}`)\n for (const name of ['cellpadding', 'cellspacing', 'border']) {\n if (attribute(table, name) !== '0') issue('layout-table', `Layout table without ${name}=\"0\": ${table.slice(0, 80)}`)\n }\n }\n for (const div of tags(visible, 'div')) {\n const style = attribute(div, 'style') ?? ''\n if (!/display\\s*:\\s*none/i.test(style) && /(?:^|;)\\s*(?:max-)?width\\s*:/i.test(style)) {\n issue('layout-table', 'Outlook ignores <div> widths; size with a table cell')\n }\n }\n\n for (const name of ['p', 'h1', 'h2', 'h3', 'a', 'span']) {\n for (const tag of tags(visible, name)) {\n const style = attribute(tag, 'style') ?? ''\n if (!/(?:^|;)\\s*color\\s*:/i.test(style) || !/font-(?:family|size)\\s*:/i.test(style) && name !== 'a') {\n issue('inline-style', `<${name}> without inline color and font: ${tag.slice(0, 80)}`)\n }\n }\n }\n\n for (const img of tags(visible, 'img')) {\n if (!attribute(img, 'alt')) issue('image', `Image without alt text: ${img.slice(0, 80)}`)\n if (!attribute(img, 'width') || !attribute(img, 'height')) issue('image', `Image without width and height: ${img.slice(0, 80)}`)\n const src = attribute(img, 'src') ?? ''\n if (!/^(?:https:|cid:)/.test(src)) issue('image', `Image source must be https: or cid: (${src.slice(0, 40)})`)\n }\n\n for (const anchor of tags(visible, 'a')) {\n const href = attribute(anchor, 'href') ?? ''\n if (!/^(?:https:\\/\\/|mailto:|http:\\/\\/(?:localhost|127\\.0\\.0\\.1)[:/])/.test(href)) {\n issue('link', `Links must be absolute https: ${href.slice(0, 60)}`)\n }\n }\n\n const bytes = new TextEncoder().encode(html).length\n if (bytes > GMAIL_CLIP_BYTES) issue('size', `${bytes} bytes; Gmail clips above ${GMAIL_CLIP_BYTES}`)\n return issues\n}\n"],"mappings":";AAEO,IAAM,yBACX;;;ACGK,IAAM,gBAAgB;AAAA,EAC3B,OAAO;AAAA,IACL,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,KAAK;AAAA,IACL,cAAc;AAAA,IACd,UAAU;AAAA,IACV,QAAQ;AAAA,IACR,UAAU;AAAA,IACV,YAAY;AAAA,EACd;AAAA,EACA,MAAM;AAAA,IACJ,QAAQ;AAAA,IACR,MAAM;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,KAAK;AA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AK;AAC1C,QAAI,CAAC,kEAAkE,KAAK,IAAI,GAAG;AACjF,YAAM,QAAQ,iCAAiC,KAAK,MAAM,GAAG,EAAE,CAAC,EAAE;AAAA,IACpE;AAAA,EACF;AAEA,QAAM,QAAQ,IAAI,YAAY,EAAE,OAAO,IAAI,EAAE;AAC7C,MAAI,QAAQ,iBAAkB,OAAM,QAAQ,GAAG,KAAK,6BAA6B,gBAAgB,EAAE;AACnG,SAAO;AACT;","names":[]}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Transactional email for Tangle agent apps: one branded layout and typed
|
|
3
|
+
* templates that each return `{ subject, preheader, html, text, attachments }`.
|
|
4
|
+
*
|
|
5
|
+
* Transport-free and dependency-free, so it runs in Workers and Node alike:
|
|
6
|
+
* the app hands the message to its own Resend or SES client. The header's
|
|
7
|
+
* Tangle mark is an inline `cid:` image, which renders without the app hosting
|
|
8
|
+
* an asset and while remote images are blocked, so pass `attachments` through.
|
|
9
|
+
*
|
|
10
|
+
* import { approvalEmail, emailSender } from '@tangle-network/agent-app/email'
|
|
11
|
+
*
|
|
12
|
+
* const message = approvalEmail({ name: 'GTM Agent', url: origin }, {
|
|
13
|
+
* actions: [{ summary: 'Create agent “Quinn”', detail: 'ph0ny' }],
|
|
14
|
+
* approveUrl: `/app/${workspaceId}/chat/${threadId}`,
|
|
15
|
+
* reviewUrl: `/app/${workspaceId}/review`,
|
|
16
|
+
* footer: { workspaceName, reason: 'You own this workspace.' },
|
|
17
|
+
* })
|
|
18
|
+
* await resend.emails.send({ from: emailSender('GTM Agent', 'noreply@tangle.tools'), to, ...message })
|
|
19
|
+
*
|
|
20
|
+
* `lintEmailHtml` checks rendered HTML against Gmail and Outlook constraints;
|
|
21
|
+
* `emailPreviewHtml` embeds the inline images for a browser preview.
|
|
22
|
+
*/
|
|
23
|
+
export { emailPreviewHtml, emailSender, type EmailAction, type EmailAttachment, type EmailFooter, type EmailItem, type EmailMessage, type EmailProduct, } from './layout';
|
|
24
|
+
export { approvalEmail, digestEmail, inviteEmail, noticeEmail, type ApprovalEmailAction, type ApprovalEmailInput, type DigestEmailInput, type InviteEmailInput, type NoticeEmailInput, } from './templates';
|
|
25
|
+
export { lintEmailHtml, type EmailLintIssue } from './lint';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
approvalEmail,
|
|
3
|
+
digestEmail,
|
|
4
|
+
emailPreviewHtml,
|
|
5
|
+
emailSender,
|
|
6
|
+
inviteEmail,
|
|
7
|
+
lintEmailHtml,
|
|
8
|
+
noticeEmail
|
|
9
|
+
} from "../chunk-YPPVNQOC.js";
|
|
10
|
+
export {
|
|
11
|
+
approvalEmail,
|
|
12
|
+
digestEmail,
|
|
13
|
+
emailPreviewHtml,
|
|
14
|
+
emailSender,
|
|
15
|
+
inviteEmail,
|
|
16
|
+
lintEmailHtml,
|
|
17
|
+
noticeEmail
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|