@sharadox/email-web-library 0.6.0-polish.23 → 0.6.0-polish.24
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,5 @@ 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,
|
|
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, a quoted text's label and bar, button) and its fonts. New exports: `EMAIL_COLORS`, `SYSTEM_FONT`.
|
|
8
|
+
- A quoted text's label ("Your message") is in the brand's color too.
|
|
@@ -14,7 +14,7 @@ export declare const EMAIL_COLORS: {
|
|
|
14
14
|
export declare const SYSTEM_FONT = "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif";
|
|
15
15
|
/**
|
|
16
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
|
|
17
|
+
* brand's color, then paragraphs, details (each label over its value), a quoted text under a label in the brand's color, one button, small print,
|
|
18
18
|
* and the company's signature. Black on white with every style inline, no dark-mode rules and no backgrounds but the
|
|
19
19
|
* button's: what mail apps change, they change the same way everywhere. `logo` says whether the email carries the
|
|
20
20
|
* inline image "logo"; everything given is escaped.
|
|
@@ -32,7 +32,7 @@ function header(design, logo, font) {
|
|
|
32
32
|
}
|
|
33
33
|
/**
|
|
34
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
|
|
35
|
+
* brand's color, then paragraphs, details (each label over its value), a quoted text under a label in the brand's color, one button, small print,
|
|
36
36
|
* and the company's signature. Black on white with every style inline, no dark-mode rules and no backgrounds but the
|
|
37
37
|
* button's: what mail apps change, they change the same way everywhere. `logo` says whether the email carries the
|
|
38
38
|
* inline image "logo"; everything given is escaped.
|
|
@@ -58,7 +58,7 @@ export function emailLayout(content, design, logo) {
|
|
|
58
58
|
.join("") + `<tr><td style="border-top:1px solid ${line};font-size:0;line-height:0"> </td></tr>`))
|
|
59
59
|
: "",
|
|
60
60
|
quote
|
|
61
|
-
? block("padding:28px 0 0", `<div style="${capitals(body,
|
|
61
|
+
? block("padding:28px 0 0", `<div style="${capitals(body, design.color)}">${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
62
|
: "",
|
|
63
63
|
button
|
|
64
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>`))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../source/email-layout/index.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,KAAK,CACH,kBAAkB,EAClB,qDAAqD,IAAI,gBAAgB,IAAI,yCAAyC,KAAK,KAAK,MAAM;iBACnI,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,UAAU,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,KAAK,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,CAAC;iBAC9D,IAAI,CAAC,MAAM,CAAC,QAAQ,CACxB;YACH,CAAC,CAAC,EAAE;QACN,MAAM,CAAC,SAAS,EAAE,MAAM;YACtB,CAAC,CAAC,KAAK,CACH,WAAW,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,sBAAsB,IAAI,yCAAyC,KAAK,EAAE,EAC5G,MAAM,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,MAAM,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,CAAC,IAAI,EAAE,EAAE,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAC7G;YACH,CAAC,CAAC,EAAE;KACP,CAAC;IACF,OAAO,8BAA8B,UAAU,CAAC,QAAQ,CAAC,2GAA2G,UAAU,CAAC,OAAO,CAAC,mEAAmE,UAAU;mEACnM,UAAU,CAAC,OAAO,CAAC;EACpF,KAAK,CACL,+BAA+B,UAAU,EAAE,EAC3C,0CAA0C,KAAK,CAAC,4BAA4B,EAAE,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,YAAY,CACjH;eACc,CAAC;AAChB,CAAC"}
|
|
@@ -20,8 +20,8 @@ export interface EmailDesign {
|
|
|
20
20
|
/** Whether the company's name is written beside the logo. */
|
|
21
21
|
wordmark?: boolean;
|
|
22
22
|
/**
|
|
23
|
-
* The brand's color, dark enough to read on white: the
|
|
24
|
-
* button. Black when the brand's own color is white.
|
|
23
|
+
* The brand's color, dark enough to read on white: the logo, the eyebrow, the headings, a quoted text's label and
|
|
24
|
+
* bar, and the button. Black when the brand's own color is white.
|
|
25
25
|
*/
|
|
26
26
|
color: string;
|
|
27
27
|
/** The button's words, on the brand's color: white by default. */
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sharadox/email-web-library",
|
|
3
|
-
"version": "0.6.0-polish.
|
|
3
|
+
"version": "0.6.0-polish.24",
|
|
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>",
|