@sharadox/email-web-library 0.6.0-polish.23 → 0.6.0-polish.25

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/CHANGELOG.md CHANGED
@@ -4,4 +4,4 @@ What changed in each version of `@sharadox/email-web-library`, newest first.
4
4
 
5
5
  ## 0.6.0
6
6
 
7
- - **Breaking:** one simple layout for every brand, the same in every mail app. Black on white with every style inline: no `<style>`, no dark-mode rules, no backgrounds but the button's and no gradients, so a mail app in dark mode darkens it as it darkens any email instead of recoloring parts of it (dark designs lost their backgrounds, lines and buttons in Proton Mail on Android). The logo sits at the top left; details stack each label over its value on every screen. `EmailDesign` is now `{ name, logo?, wordmark?, color, onColor?, fonts?, signature? }`: the brand brings its logo, its color (eyebrow, headings, quote bar, button) and its fonts. New exports: `EMAIL_COLORS`, `SYSTEM_FONT`.
7
+ - **Breaking:** one layout for every company, the same in every mail app. No background (the mail app's own shows); the text, the logo and the button are in the theme's foreground color, black, or white in dark mode where the mail app honors the dark theme's rules (`@media (prefers-color-scheme: dark)`, and `[data-ogsc]` for Outlook.com), the only styles not inline. Mail apps that ignore them darken the email their own way, which kept dark designs from showing as designed (Proton Mail on Android). The logo sits at the top left: the inline image "logo" in black with a thin white outline, and "logo-dark" in white for dark themes. Geist where the reader has it, the device's own sans otherwise. Details stack each label over its value, the visitor's message last, alike the others. `EmailDesign` is now `{ name, logo?, wordmark?, signature? }`; `emailLayout`'s third argument takes `{ light, dark }` logos (or `true` for the black one only). New exports: `EMAIL_COLORS`, `EMAIL_FONT`, `EmailLogos`.
package/README.md CHANGED
@@ -63,9 +63,9 @@ await sender.send({
63
63
  });
64
64
  ```
65
65
 
66
- ### In the brand's design
66
+ ### In the company's layout
67
67
 
68
- `emailLayout(content, design, logo)` writes the html of an email that looks the same in every mail app: one simple layout, black on white, with every style inline and nothing for a mail app to drop or recolor its own way (no dark-mode rules, no backgrounds but the button's, no gradients). In dark mode the mail app darkens it as it darkens any email. A brand brings only what makes it its own: the logo at the top left (the real logo, without a background), its color on the eyebrow, the headings, the bar beside a quoted text and the button, and its fonts. Fonts are stacks the reader's device already has: web fonts would tell a font service the email was opened. Everything given is escaped; details stack each label over its value, the same on a phone and a computer.
68
+ `emailLayout(content, design, logos)` writes the html of an email that looks the same in every mail app: no background (the mail app's own shows), and the text, the logo and the button in the foreground color of the reader's theme: black, or white in dark mode. The dark theme is a few rules for the mail apps that honor it (Apple Mail, Outlook on phones and Macs, Outlook.com and others); the others darken the email their own way. Everything else is inline. The font is Geist where the reader has it, the device's own sans otherwise (no web fonts, which would tell a font service the email was opened). A company brings only its logo and name. Details stack each label over its value, a longer text (the visitor's message) last, all alike. Everything given is escaped.
69
69
 
70
70
  ```ts
71
71
  import { emailLayout } from "@sharadox/email-web-library/email-layout";
@@ -73,10 +73,8 @@ import type { EmailDesign } from "@sharadox/email-web-library/email-layout/type"
73
73
 
74
74
  const design: EmailDesign = {
75
75
  name: "Sharadox",
76
- logo: { width: 30, height: 30 }, // shown size of the inline image "logo"
76
+ logo: { width: 30, height: 30 }, // shown size of the inline images "logo" (black) and "logo-dark" (white)
77
77
  wordmark: true, // the name beside the logo
78
- color: "#000000", // the brand's color, dark enough to read on white (black for a white brand)
79
- fonts: { heading: "Geist, Helvetica, Arial, sans-serif" }, // the body's font and the device's own sans otherwise
80
78
  signature: [{ text: "sharadox.com", href: "https://sharadox.com" }],
81
79
  };
82
80
 
@@ -92,11 +90,11 @@ const html = emailLayout(
92
90
  footer: [{ label: "Sent", value: "2026-11-21 14:29 UTC" }],
93
91
  },
94
92
  design,
95
- true, // the email carries the inline image "logo"
93
+ { light: true, dark: true }, // the logos the email carries: "logo" and "logo-dark" (true: "logo" only)
96
94
  );
97
95
  ```
98
96
 
99
- `EMAIL_COLORS` is the shared palette (background, text, muted, quiet, line) and `SYSTEM_FONT` the default font stack.
97
+ The black logo should carry a thin white outline: it stays visible where a mail app darkens the email itself. `EMAIL_COLORS` holds the light and dark palettes and `EMAIL_FONT` the font stack.
100
98
 
101
99
  `sender.verify()` logs in without sending, handy for a health check. `checkEmailMessage` and `checkEmailAddress` are exported for validating input before you get as far as sending.
102
100
 
@@ -1,27 +1,35 @@
1
- import type { EmailContent, EmailDesign } from "@sharadox/email-web-library/email-layout/type";
2
- /** The one palette every email is drawn in: black on white, which every mail app darkens well on its own. */
1
+ import type { EmailContent, EmailDesign, EmailLogos } from "@sharadox/email-web-library/email-layout/type";
2
+ /**
3
+ * The colors every email is drawn in: no background (the mail app's own shows), black text on a light theme and white
4
+ * on a dark one, with grays between them for paragraphs, labels and lines.
5
+ */
3
6
  export declare const EMAIL_COLORS: {
4
- readonly background: "#ffffff";
5
- readonly text: "#000000";
6
- /** Paragraphs. */
7
- readonly muted: "#3f3f46";
8
- /** Labels and small print. */
9
- readonly quiet: "#71717a";
10
- /** Lines between details. */
11
- readonly line: "#e4e4e7";
7
+ readonly light: {
8
+ readonly text: "#000000";
9
+ readonly muted: "#3f3f46";
10
+ readonly quiet: "#71717a";
11
+ readonly line: "#e4e4e7";
12
+ };
13
+ readonly dark: {
14
+ readonly text: "#ffffff";
15
+ readonly muted: "#d4d4d8";
16
+ readonly quiet: "#a1a1aa";
17
+ readonly line: "#3f3f46";
18
+ };
12
19
  };
13
- /** The device's own sans: what every font stack falls back to. */
14
- export declare const SYSTEM_FONT = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";
20
+ /** Geist where the reader has it, the device's own sans otherwise. */
21
+ export declare const EMAIL_FONT = "Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";
15
22
  /**
16
- * An email in a brand's design, the same in every inbox: the logo at the top left, an eyebrow and a heading in the
17
- * brand's color, then paragraphs, details (each label over its value), a quoted text and one button, small print,
18
- * and the company's signature. Black on white with every style inline, no dark-mode rules and no backgrounds but the
19
- * button's: what mail apps change, they change the same way everywhere. `logo` says whether the email carries the
20
- * inline image "logo"; everything given is escaped.
23
+ * An email that looks the same in every inbox: the logo at the top left, an eyebrow and a heading, paragraphs, the
24
+ * details (each label over its value, a longer text last, all alike), one button, small print and the company's
25
+ * signature. No background: the mail app's own shows, with the text, logo and button in the theme's foreground
26
+ * color (black, or white in dark mode where the app honors it). Geist where the reader has it, the device's own sans
27
+ * otherwise. Every style is inline but the dark theme's; everything given is escaped. `logos` says which logo images
28
+ * the email carries (`true`: the black one only).
21
29
  *
22
30
  * @example
23
31
  * emailLayout({ language: "en", preview: "Ana sent a message", eyebrow: "Contact", heading: "Ana",
24
- * rows: [{ label: "Email", value: "ana@example.com" }] }, { name: "Acme", color: "#000000" }, false);
32
+ * rows: [{ label: "Email", value: "ana@example.com" }] }, { name: "Acme" }, false);
25
33
  */
26
- export declare function emailLayout(content: EmailContent, design: EmailDesign, logo: boolean): string;
34
+ export declare function emailLayout(content: EmailContent, design: EmailDesign, logos: EmailLogos | boolean): string;
27
35
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/email-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAE/F,6GAA6G;AAC7G,eAAO,MAAM,YAAY;;;IAGvB,kBAAkB;;IAElB,8BAA8B;;IAE9B,6BAA6B;;CAErB,CAAC;AAEX,kEAAkE;AAClE,eAAO,MAAM,WAAW,wFAAwF,CAAC;AA6BjH;;;;;;;;;;GAUG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,IAAI,EAAE,OAAO,GAAG,MAAM,CAyE7F"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../source/email-layout/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,+CAA+C,CAAC;AAE3G;;;GAGG;AACH,eAAO,MAAM,YAAY;;;;;;;;;;;;;CAGf,CAAC;AAEX,sEAAsE;AACtE,eAAO,MAAM,UAAU,+FAA+F,CAAC;AAqEvH;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,MAAM,EAAE,WAAW,EAAE,KAAK,EAAE,UAAU,GAAG,OAAO,GAAG,MAAM,CAoD3G"}
@@ -1,80 +1,104 @@
1
1
  import { escapeHtml } from "@sharadox/web-library/html/escape";
2
- /** The one palette every email is drawn in: black on white, which every mail app darkens well on its own. */
2
+ /**
3
+ * The colors every email is drawn in: no background (the mail app's own shows), black text on a light theme and white
4
+ * on a dark one, with grays between them for paragraphs, labels and lines.
5
+ */
3
6
  export const EMAIL_COLORS = {
4
- background: "#ffffff",
5
- text: "#000000",
6
- /** Paragraphs. */
7
- muted: "#3f3f46",
8
- /** Labels and small print. */
9
- quiet: "#71717a",
10
- /** Lines between details. */
11
- line: "#e4e4e7",
7
+ light: { text: "#000000", muted: "#3f3f46", quiet: "#71717a", line: "#e4e4e7" },
8
+ dark: { text: "#ffffff", muted: "#d4d4d8", quiet: "#a1a1aa", line: "#3f3f46" },
12
9
  };
13
- /** The device's own sans: what every font stack falls back to. */
14
- export const SYSTEM_FONT = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";
10
+ /** Geist where the reader has it, the device's own sans otherwise. */
11
+ export const EMAIL_FONT = "Geist, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";
12
+ const { light, dark } = EMAIL_COLORS;
13
+ /** The dark theme's rules, one selector per element role. */
14
+ const DARK = `.text{color:${dark.text}!important}.muted{color:${dark.muted}!important}.quiet{color:${dark.quiet}!important}.line{border-color:${dark.line}!important}.button{background-color:${dark.text}!important}.button-text{color:#000000!important}.logo-light{display:none!important}.logo-dark{display:block!important;max-height:none!important;overflow:visible!important}`;
15
+ /**
16
+ * The dark theme, for mail apps that honor it (Apple Mail, Outlook on phones and Macs, and others): white text, light
17
+ * grays, dark lines, a white button with black words, and the white logo instead of the black one. Said again for
18
+ * Outlook.com, which marks its dark theme with a `data-ogsc` attribute. Mail apps that ignore it darken the email
19
+ * their own way, which the black logo's white outline survives.
20
+ */
21
+ const DARK_RULES = `@media (prefers-color-scheme:dark){${DARK}}${DARK.replace(/(^|\})\./g, "$1[data-ogsc] .")}`;
15
22
  /** A table that's only there for layout, as email clients need. */
16
23
  const table = (style, rows, width) => `<table role="presentation" cellpadding="0" cellspacing="0" border="0"${width ? ` width="${width}"` : ""} style="border-collapse:collapse;${style}">${rows}</table>`;
17
- /** Small spaced capitals: eyebrows and labels. */
18
- const capitals = (font, color) => `font-family:${font};font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0.08em;text-transform:uppercase;color:${color}`;
24
+ /** The font, on everything. */
25
+ const FONT = `font-family:${EMAIL_FONT}`;
26
+ /** Small spaced capitals in one of the theme's colors: eyebrows and labels. */
27
+ const capitals = (color) => `class="${color}" style="${FONT};font-size:12px;font-weight:600;line-height:1.5;letter-spacing:0.08em;text-transform:uppercase;color:${light[color]}"`;
19
28
  /** A value, as a link when it has one. */
20
29
  const value = ({ value: text, href }, color) => href
21
- ? `<a href="${escapeHtml(href)}" style="color:${color};text-decoration:underline">${escapeHtml(text)}</a>`
30
+ ? `<a class="${color}" href="${escapeHtml(href)}" style="color:${light[color]};text-decoration:underline">${escapeHtml(text)}</a>`
22
31
  : escapeHtml(text);
23
- /** The logo at the top left, and the company's name beside it with `wordmark` (or alone, without a logo). */
24
- function header(design, logo, font) {
25
- const mark = logo && design.logo
26
- ? `<td style="vertical-align:middle;padding:0${design.wordmark ? " 10px 0 0" : ""}"><img src="cid:logo" width="${design.logo.width}" height="${design.logo.height}" alt="${escapeHtml(design.name)}" style="display:block;width:${design.logo.width}px;height:${design.logo.height}px;border:0"></td>`
32
+ /** The logo: the black one, and the white one for dark themes, hidden unless a dark theme shows it. */
33
+ function mark(design, logos) {
34
+ if (!logos.light || !design.logo)
35
+ return "";
36
+ const { width, height } = design.logo;
37
+ const image = (id) => `<img src="cid:${id}" width="${width}" height="${height}" alt="${escapeHtml(design.name)}" style="display:block;width:${width}px;height:${height}px;border:0">`;
38
+ const darkLogo = logos.dark
39
+ ? `<div class="logo-dark" style="display:none;max-height:0;overflow:hidden;mso-hide:all">${image("logo-dark")}</div>`
27
40
  : "";
28
- const name = design.wordmark || !mark
29
- ? `<td style="vertical-align:middle;font-family:${font};font-size:19px;font-weight:700;letter-spacing:-0.01em;color:${design.color}">${escapeHtml(design.name)}</td>`
41
+ return `<td style="vertical-align:middle;padding:0${design.wordmark ? " 10px 0 0" : ""}"><div class="logo-light">${image("logo")}</div>${darkLogo}</td>`;
42
+ }
43
+ /** The logo at the top left, and the company's name beside it with `wordmark` (or alone, without a logo). */
44
+ function header(design, logos) {
45
+ const logo = mark(design, logos);
46
+ const name = design.wordmark || !logo
47
+ ? `<td class="text" style="vertical-align:middle;${FONT};font-size:19px;font-weight:700;letter-spacing:-0.01em;color:${light.text}">${escapeHtml(design.name)}</td>`
30
48
  : "";
31
- return table("", `<tr>${mark}${name}</tr>`);
49
+ return table("", `<tr>${logo}${name}</tr>`);
50
+ }
51
+ /** The details, each label over its value, lines between them; a longer text keeps its line breaks. */
52
+ function details(entries) {
53
+ const line = `class="line" style="padding:14px 0;border-top:1px solid ${light.line};${FONT};word-break:break-word"`;
54
+ return table("width:100%", entries
55
+ .map((entry) => `<tr><td ${line}><div ${capitals("quiet")}>${escapeHtml(entry.label)}</div><div class="text" style="padding-top:4px;font-size:16px;line-height:1.5;color:${light.text}${entry.keepLines ? ";white-space:pre-wrap" : ""}">${entry.inside}</div></td></tr>`)
56
+ .join("") +
57
+ `<tr><td class="line" style="border-top:1px solid ${light.line};font-size:0;line-height:0">&nbsp;</td></tr>`);
32
58
  }
33
59
  /**
34
- * An email in a brand's design, the same in every inbox: the logo at the top left, an eyebrow and a heading in the
35
- * brand's color, then paragraphs, details (each label over its value), a quoted text and one button, small print,
36
- * and the company's signature. Black on white with every style inline, no dark-mode rules and no backgrounds but the
37
- * button's: what mail apps change, they change the same way everywhere. `logo` says whether the email carries the
38
- * inline image "logo"; everything given is escaped.
60
+ * An email that looks the same in every inbox: the logo at the top left, an eyebrow and a heading, paragraphs, the
61
+ * details (each label over its value, a longer text last, all alike), one button, small print and the company's
62
+ * signature. No background: the mail app's own shows, with the text, logo and button in the theme's foreground
63
+ * color (black, or white in dark mode where the app honors it). Geist where the reader has it, the device's own sans
64
+ * otherwise. Every style is inline but the dark theme's; everything given is escaped. `logos` says which logo images
65
+ * the email carries (`true`: the black one only).
39
66
  *
40
67
  * @example
41
68
  * emailLayout({ language: "en", preview: "Ana sent a message", eyebrow: "Contact", heading: "Ana",
42
- * rows: [{ label: "Email", value: "ana@example.com" }] }, { name: "Acme", color: "#000000" }, false);
69
+ * rows: [{ label: "Email", value: "ana@example.com" }] }, { name: "Acme" }, false);
43
70
  */
44
- export function emailLayout(content, design, logo) {
71
+ export function emailLayout(content, design, logos) {
72
+ const carried = typeof logos === "boolean" ? { light: logos, dark: false } : logos;
45
73
  const { language, preview, eyebrow, heading, paragraphs = [], rows = [], quote, button, footer = [] } = content;
46
- const { background, text, muted, quiet, line } = EMAIL_COLORS;
47
- const body = design.fonts?.body ?? SYSTEM_FONT;
48
- const headings = design.fonts?.heading ?? body;
49
74
  const block = (style, inside) => `<tr><td style="${style}">${inside}</td></tr>`;
75
+ const entries = [
76
+ ...rows.map((row) => ({ label: row.label, inside: value(row, "text") })),
77
+ ...(quote ? [{ label: quote.label, inside: escapeHtml(quote.text), keepLines: true }] : []),
78
+ ];
50
79
  const parts = [
51
- block("padding:0 0 36px", header(design, logo, headings)),
52
- block("padding:0 0 10px", `<div style="${capitals(body, design.color)}">${escapeHtml(eyebrow)}</div>`),
53
- block("padding:0", `<h1 style="margin:0;font-family:${headings};font-size:30px;font-weight:700;line-height:1.2;letter-spacing:-0.01em;color:${design.color}">${escapeHtml(heading)}</h1>`),
54
- ...paragraphs.map((paragraph) => block("padding:16px 0 0", `<p style="margin:0;font-family:${body};font-size:16px;line-height:1.6;color:${muted}">${escapeHtml(paragraph)}</p>`)),
55
- rows.length
56
- ? block("padding:28px 0 0", table("width:100%", rows
57
- .map((row) => `<tr><td style="padding:14px 0;border-top:1px solid ${line};font-family:${body};word-break:break-word"><div style="${capitals(body, quiet)}">${escapeHtml(row.label)}</div><div style="padding-top:4px;font-size:16px;line-height:1.5;color:${text}">${value(row, text)}</div></td></tr>`)
58
- .join("") + `<tr><td style="border-top:1px solid ${line};font-size:0;line-height:0">&nbsp;</td></tr>`))
59
- : "",
60
- quote
61
- ? block("padding:28px 0 0", `<div style="${capitals(body, quiet)}">${escapeHtml(quote.label)}</div>${table("width:100%;margin-top:10px", `<tr><td style="padding:2px 0 2px 16px;border-left:3px solid ${design.color};font-family:${body};font-size:16px;line-height:1.6;color:${text};white-space:pre-wrap;word-break:break-word">${escapeHtml(quote.text)}</td></tr>`)}`)
62
- : "",
80
+ block("padding:0 0 36px", header(design, carried)),
81
+ block("padding:0 0 10px", `<div ${capitals("text")}>${escapeHtml(eyebrow)}</div>`),
82
+ block("padding:0", `<h1 class="text" style="margin:0;${FONT};font-size:30px;font-weight:700;line-height:1.2;letter-spacing:-0.01em;color:${light.text}">${escapeHtml(heading)}</h1>`),
83
+ ...paragraphs.map((paragraph) => block("padding:16px 0 0", `<p class="muted" style="margin:0;${FONT};font-size:16px;line-height:1.6;color:${light.muted}">${escapeHtml(paragraph)}</p>`)),
84
+ entries.length ? block("padding:28px 0 0", details(entries)) : "",
63
85
  button
64
- ? block("padding:32px 0 0", table("", `<tr><td style="background-color:${design.color};border-radius:8px"><a href="${escapeHtml(button.href)}" style="display:inline-block;padding:14px 26px;font-family:${body};font-size:15px;font-weight:600;color:${design.onColor ?? "#ffffff"};text-decoration:none;border-radius:8px">${escapeHtml(button.label)}</a></td></tr>`))
86
+ ? block("padding:32px 0 0", table("", `<tr><td class="button" style="background-color:${light.text};border-radius:8px"><a class="button-text" href="${escapeHtml(button.href)}" style="display:inline-block;padding:14px 26px;${FONT};font-size:15px;font-weight:600;color:#ffffff;text-decoration:none;border-radius:8px">${escapeHtml(button.label)}</a></td></tr>`))
65
87
  : "",
66
88
  footer.length
67
- ? block("padding:36px 0 0", `<div style="padding-top:20px;border-top:1px solid ${line};font-family:${body};font-size:13px;line-height:1.6;color:${quiet}">${footer
68
- .map((row) => `${escapeHtml(row.label)}: ${value(row, quiet)}`)
89
+ ? block("padding:36px 0 0", `<div class="line quiet" style="padding-top:20px;border-top:1px solid ${light.line};${FONT};font-size:13px;line-height:1.6;color:${light.quiet}">${footer
90
+ .map((row) => `${escapeHtml(row.label)}: ${value(row, "quiet")}`)
69
91
  .join("<br>")}</div>`)
70
92
  : "",
71
93
  design.signature?.length
72
- ? block(`padding:${footer.length ? 16 : 36}px 0 0;font-family:${body};font-size:13px;line-height:1.6;color:${quiet}`, design.signature.map((signed) => value({ value: signed.text, href: signed.href }, quiet)).join(" &middot; "))
94
+ ? block(`padding:${footer.length ? 16 : 36}px 0 0`, `<div class="quiet" style="${FONT};font-size:13px;line-height:1.6;color:${light.quiet}">${design.signature
95
+ .map((signed) => value({ value: signed.text, href: signed.href }, "quiet"))
96
+ .join(" &middot; ")}</div>`)
73
97
  : "",
74
98
  ];
75
- return `<!doctype html><html lang="${escapeHtml(language)}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><title>${escapeHtml(heading)}</title></head><body style="margin:0;padding:0;background-color:${background}">
99
+ return `<!doctype html><html lang="${escapeHtml(language)}"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="color-scheme" content="light dark"><meta name="supported-color-schemes" content="light dark"><title>${escapeHtml(heading)}</title><style>:root{color-scheme:light dark;supported-color-schemes:light dark}${DARK_RULES}</style></head><body style="margin:0;padding:0">
76
100
  <div style="display:none;max-height:0;overflow:hidden;opacity:0">${escapeHtml(preview)}</div>
77
- ${table(`width:100%;background-color:${background}`, `<tr><td style="padding:32px 24px 40px">${table("width:100%;max-width:560px", parts.join("\n"), 560)}</td></tr>`)}
101
+ ${table("width:100%", `<tr><td style="padding:32px 24px 40px">${table("width:100%;max-width:560px", parts.join("\n"), 560)}</td></tr>`)}
78
102
  </body></html>`;
79
103
  }
80
104
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/email-layout/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,mCAAmC,CAAC;AAG/D,6GAA6G;AAC7G,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,UAAU,EAAE,SAAS;IACrB,IAAI,EAAE,SAAS;IACf,kBAAkB;IAClB,KAAK,EAAE,SAAS;IAChB,8BAA8B;IAC9B,KAAK,EAAE,SAAS;IAChB,6BAA6B;IAC7B,IAAI,EAAE,SAAS;CACP,CAAC;AAEX,kEAAkE;AAClE,MAAM,CAAC,MAAM,WAAW,GAAG,qFAAqF,CAAC;AAEjH,mEAAmE;AACnE,MAAM,KAAK,GAAG,CAAC,KAAa,EAAE,IAAY,EAAE,KAAc,EAAE,EAAE,CAC5D,wEAAwE,KAAK,CAAC,CAAC,CAAC,WAAW,KAAK,GAAG,CAAC,CAAC,CAAC,EAAE,oCAAoC,KAAK,KAAK,IAAI,UAAU,CAAC;AAEvK,kDAAkD;AAClD,MAAM,QAAQ,GAAG,CAAC,IAAY,EAAE,KAAa,EAAE,EAAE,CAC/C,eAAe,IAAI,wGAAwG,KAAK,EAAE,CAAC;AAErI,0CAA0C;AAC1C,MAAM,KAAK,GAAG,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,EAAgD,EAAE,KAAa,EAAE,EAAE,CACnG,IAAI;IACF,CAAC,CAAC,YAAY,UAAU,CAAC,IAAI,CAAC,kBAAkB,KAAK,+BAA+B,UAAU,CAAC,IAAI,CAAC,MAAM;IAC1G,CAAC,CAAC,UAAU,CAAC,IAAI,CAAC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,UAAU,CAAC,OAAO,CAAC,mFAAmF,UAAU;mEAC5T,UAAU,CAAC,OAAO,CAAC;EACpF,KAAK,CAAC,YAAY,EAAE,0CAA0C,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,YAAY,CAAC;eACxH,CAAC;AAChB,CAAC"}
@@ -5,39 +5,36 @@ export interface EmailRow {
5
5
  href?: string;
6
6
  }
7
7
  /**
8
- * What makes an email a brand's. Every email shares one simple layout, black on white, that every mail app shows the
9
- * same way and darkens on its own in dark mode; a brand only brings its logo, its color and its type. Fonts are font
10
- * stacks the reader's device already has (no web fonts, which would tell a font service the email was opened).
8
+ * What makes an email a company's. Every email shares one layout: no background (the mail app's own shows), text,
9
+ * logo and button in the foreground color of the reader's theme (black, or white in dark mode), Geist where the
10
+ * reader has it; a company only brings its logo and name.
11
11
  */
12
12
  export interface EmailDesign {
13
13
  /** The company: the logo's description, and its name beside the logo with `wordmark`. */
14
14
  name: string;
15
- /** The size the inline image "logo" is shown at, when the email carries one: the real logo, without a background. */
15
+ /**
16
+ * The size the logo is shown at, when the email carries it: the inline image "logo" (the real logo in black, with
17
+ * a thin white outline that keeps it visible where a mail app darkens the email itself), and, for mail apps in
18
+ * dark mode, "logo-dark" (the same in white).
19
+ */
16
20
  logo?: {
17
21
  width: number;
18
22
  height: number;
19
23
  };
20
24
  /** Whether the company's name is written beside the logo. */
21
25
  wordmark?: boolean;
22
- /**
23
- * The brand's color, dark enough to read on white: the eyebrow, the headings, the bar beside a quoted text and the
24
- * button. Black when the brand's own color is white.
25
- */
26
- color: string;
27
- /** The button's words, on the brand's color: white by default. */
28
- onColor?: string;
29
- /** The headings' font stack, and the rest's; the device's own sans by default. */
30
- fonts?: {
31
- heading?: string;
32
- body?: string;
33
- };
34
26
  /** The company's lines at the very bottom of every email (its site). */
35
27
  signature?: readonly {
36
28
  text: string;
37
29
  href?: string;
38
30
  }[];
39
31
  }
40
- /** What one email says, in the brand's design. */
32
+ /** Which logo images an email carries, as inline images "logo" and "logo-dark". */
33
+ export interface EmailLogos {
34
+ light: boolean;
35
+ dark: boolean;
36
+ }
37
+ /** What one email says. */
41
38
  export interface EmailContent {
42
39
  /** The language of the email, for the html's `lang`. */
43
40
  language: string;
@@ -50,7 +47,7 @@ export interface EmailContent {
50
47
  paragraphs?: readonly string[];
51
48
  /** The details, each label over its value. */
52
49
  rows?: readonly EmailRow[];
53
- /** A longer text keeping its line breaks (a visitor's message), with its label. */
50
+ /** A longer text keeping its line breaks (a visitor's message), shown as the last detail, with its label. */
54
51
  quote?: {
55
52
  label: string;
56
53
  text: string;
@@ -1 +1 @@
1
- {"version":3,"file":"type.d.ts","sourceRoot":"","sources":["../../source/email-layout/type.ts"],"names":[],"mappings":"AAAA,oHAAoH;AACpH,MAAM,WAAW,QAAQ;IACvB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED;;;;GAIG;AACH,MAAM,WAAW,WAAW;IAC1B,yFAAyF;IACzF,IAAI,EAAE,MAAM,CAAC;IACb,qHAAqH;IACrH,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,6DAA6D;IAC7D,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB;;;OAGG;IACH,KAAK,EAAE,MAAM,CAAC;IACd,kEAAkE;IAClE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kFAAkF;IAClF,KAAK,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,wEAAwE;IACxE,SAAS,CAAC,EAAE,SAAS;QAAE,IAAI,EAAE,MAAM,CAAC;QAAC,IAAI,CAAC,EAAE,MAAM,CAAA;KAAE,EAAE,CAAC;CACxD;AAED,kDAA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M,WAAW,UAAU;IACzB,KAAK,EAAE,OAAO,CAAC;IACf,IAAI,EAAE,OAAO,CAAC;CACf;AAED,2BAA2B;AAC3B,MAAM,WAAW,YAAY;IAC3B,wDAAwD;IACxD,QAAQ,EAAE,MAAM,CAAC;IACjB,yEAAyE;IACzE,OAAO,EAAE,MAAM,CAAC;IAChB,mEAAmE;IACnE,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,UAAU,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,8CAA8C;IAC9C,IAAI,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;IAC3B,6GAA6G;IAC7G,KAAK,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACxC,iEAAiE;IACjE,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC;IACzC,wDAAwD;IACxD,MAAM,CAAC,EAAE,SAAS,QAAQ,EAAE,CAAC;CAC9B"}
@@ -20,6 +20,6 @@ export { createEmailSender } from "@sharadox/email-web-library/email-sender";
20
20
  export type { EmailReceipt, EmailSender } from "@sharadox/email-web-library/email-sender/type";
21
21
  export { readEmailServerConfiguration } from "@sharadox/email-web-library/email-server-configuration";
22
22
  export type { EmailServerConfiguration, EmailServerSecurity, } from "@sharadox/email-web-library/email-server-configuration/type";
23
- export { EMAIL_COLORS, emailLayout, SYSTEM_FONT } from "@sharadox/email-web-library/email-layout";
24
- export type { EmailContent, EmailDesign, EmailRow } from "@sharadox/email-web-library/email-layout/type";
23
+ export { EMAIL_COLORS, EMAIL_FONT, emailLayout } from "@sharadox/email-web-library/email-layout";
24
+ export type { EmailContent, EmailDesign, EmailLogos, EmailRow } from "@sharadox/email-web-library/email-layout/type";
25
25
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC9G,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,YAAY,EACV,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AAClG,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,YAAY,EAAE,YAAY,EAAE,MAAM,gDAAgD,CAAC;AACnF,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AACrE,YAAY,EAAE,cAAc,EAAE,MAAM,8CAA8C,CAAC;AACnF,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAC9G,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,gDAAgD,CAAC;AAChG,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAC7E,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,+CAA+C,CAAC;AAC/F,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AACtG,YAAY,EACV,wBAAwB,EACxB,mBAAmB,GACpB,MAAM,6DAA6D,CAAC;AACrE,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC;AACjG,YAAY,EAAE,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,+CAA+C,CAAC"}
@@ -15,5 +15,5 @@ export { EmailError } from "@sharadox/email-web-library/email-error";
15
15
  export { checkEmailMessage, RECIPIENT_LIMIT, SUBJECT_LIMIT } from "@sharadox/email-web-library/email-message";
16
16
  export { createEmailSender } from "@sharadox/email-web-library/email-sender";
17
17
  export { readEmailServerConfiguration } from "@sharadox/email-web-library/email-server-configuration";
18
- export { EMAIL_COLORS, emailLayout, SYSTEM_FONT } from "@sharadox/email-web-library/email-layout";
18
+ export { EMAIL_COLORS, EMAIL_FONT, emailLayout } from "@sharadox/email-web-library/email-layout";
19
19
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AAKtG,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../source/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AACH,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAE9E,OAAO,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAErE,OAAO,EAAE,iBAAiB,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,2CAA2C,CAAC;AAE9G,OAAO,EAAE,iBAAiB,EAAE,MAAM,0CAA0C,CAAC;AAE7E,OAAO,EAAE,4BAA4B,EAAE,MAAM,wDAAwD,CAAC;AAKtG,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,0CAA0C,CAAC"}
package/llms.txt CHANGED
@@ -8,6 +8,6 @@
8
8
  - /inline-image: inlineImage(id, { filename, contentType, content (base64) }) → InlineImage with the bytes decoded (a library's logo kept as base64 text)
9
9
  - /email-address: checkEmailAddress(value, field) → the address, or EmailError("invalid-message"); EmailAddress = string | { name, address }
10
10
  - /email-error: EmailError(code: "configuration" | "invalid-message" | "delivery", message, options?)
11
- - /email-layout: emailLayout(content, design, logo) → HTML the same in every mail app: black on white (EMAIL_COLORS), styles inline, no <style>/dark-mode rules/gradients, the app darkens it itself; logo top left; EmailDesign { name, logo? {width,height}, wordmark?, color (brand color on eyebrow, headings, quote bar, button; black for a white brand), onColor? (#ffffff), fonts? { heading?, body? } (SYSTEM_FONT), signature? }, EmailContent (language, preview, eyebrow, heading, paragraphs, rows (label over value), quote, button, footer)
11
+ - /email-layout: emailLayout(content, design, logos: { light, dark } | boolean) → HTML the same in every mail app: no background, text/logo/button in the theme's foreground (black; white in dark mode via @media prefers-color-scheme and [data-ogsc] rules, the only <style>), logo top left (inline "logo" black with a white outline, "logo-dark" white shown in dark themes), Geist else system sans (EMAIL_FONT), EMAIL_COLORS { light, dark }; EmailDesign { name, logo? {width,height}, wordmark?, signature? }; EmailContent (language, preview, eyebrow, heading, paragraphs, rows (label over value), quote (shown as the last row, line breaks kept), button, footer)
12
12
  - Root import (all of the above) kept in 0.5 for compatibility, removed in 0.6.
13
13
  - License: Sharadox Open Source License 0.1.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sharadox/email-web-library",
3
- "version": "0.6.0-polish.23",
3
+ "version": "0.6.0-polish.25",
4
4
  "description": "Send email from web applications through any SMTP server, with message checks and clear errors.",
5
5
  "license": "SEE LICENSE IN LICENCA.md",
6
6
  "author": "Sharadox <contact@sharadox.com>",