@emailens/engine 0.8.1 → 0.8.3
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/README.md +67 -586
- package/dist/index.cjs +63 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +4 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +63 -17
- package/dist/index.js.map +1 -1
- package/package.json +3 -2
package/dist/index.d.cts
CHANGED
|
@@ -41,6 +41,9 @@ declare function structuralWarnings(warnings: CSSWarning[]): CSSWarning[];
|
|
|
41
41
|
* - Some invert colors (Gmail Android)
|
|
42
42
|
* - Some use prefers-color-scheme media query (Apple Mail)
|
|
43
43
|
* - Some do partial inversion (Outlook.com)
|
|
44
|
+
*
|
|
45
|
+
* Last verified: 2026-03-04
|
|
46
|
+
* Sources: Litmus dark mode guide, caniemail.com, Parcel dark mode guide
|
|
44
47
|
*/
|
|
45
48
|
declare function simulateDarkMode(html: string, clientId: string): {
|
|
46
49
|
html: string;
|
|
@@ -156,7 +159,7 @@ declare const AI_FIX_SYSTEM_PROMPT = "You are an expert email developer speciali
|
|
|
156
159
|
|
|
157
160
|
/**
|
|
158
161
|
* CSS/HTML feature support matrix — auto-generated from caniemail.com.
|
|
159
|
-
* Last synced: 2026-03-
|
|
162
|
+
* Last synced: 2026-03-04
|
|
160
163
|
* caniemail last updated: 2026-02-16 15:39:06 +0000
|
|
161
164
|
*
|
|
162
165
|
* 251 features across 12 email clients.
|
package/dist/index.d.ts
CHANGED
|
@@ -41,6 +41,9 @@ declare function structuralWarnings(warnings: CSSWarning[]): CSSWarning[];
|
|
|
41
41
|
* - Some invert colors (Gmail Android)
|
|
42
42
|
* - Some use prefers-color-scheme media query (Apple Mail)
|
|
43
43
|
* - Some do partial inversion (Outlook.com)
|
|
44
|
+
*
|
|
45
|
+
* Last verified: 2026-03-04
|
|
46
|
+
* Sources: Litmus dark mode guide, caniemail.com, Parcel dark mode guide
|
|
44
47
|
*/
|
|
45
48
|
declare function simulateDarkMode(html: string, clientId: string): {
|
|
46
49
|
html: string;
|
|
@@ -156,7 +159,7 @@ declare const AI_FIX_SYSTEM_PROMPT = "You are an expert email developer speciali
|
|
|
156
159
|
|
|
157
160
|
/**
|
|
158
161
|
* CSS/HTML feature support matrix — auto-generated from caniemail.com.
|
|
159
|
-
* Last synced: 2026-03-
|
|
162
|
+
* Last synced: 2026-03-04
|
|
160
163
|
* caniemail last updated: 2026-02-16 15:39:06 +0000
|
|
161
164
|
*
|
|
162
165
|
* 251 features across 12 email clients.
|
package/dist/index.js
CHANGED
|
@@ -46,7 +46,7 @@ var EMAIL_CLIENTS = [
|
|
|
46
46
|
name: "Outlook Windows",
|
|
47
47
|
category: "desktop",
|
|
48
48
|
engine: "Microsoft Word",
|
|
49
|
-
darkModeSupport:
|
|
49
|
+
darkModeSupport: true,
|
|
50
50
|
icon: "monitor"
|
|
51
51
|
},
|
|
52
52
|
{
|
|
@@ -86,7 +86,7 @@ var EMAIL_CLIENTS = [
|
|
|
86
86
|
name: "Thunderbird",
|
|
87
87
|
category: "desktop",
|
|
88
88
|
engine: "Gecko",
|
|
89
|
-
darkModeSupport:
|
|
89
|
+
darkModeSupport: true,
|
|
90
90
|
icon: "monitor"
|
|
91
91
|
},
|
|
92
92
|
{
|
|
@@ -3633,14 +3633,16 @@ var CSS_SUPPORT = {
|
|
|
3633
3633
|
};
|
|
3634
3634
|
var GMAIL_STRIPPED_PROPERTIES = /* @__PURE__ */ new Set([
|
|
3635
3635
|
"position",
|
|
3636
|
-
"overflow",
|
|
3637
3636
|
"visibility",
|
|
3638
3637
|
"box-shadow",
|
|
3639
3638
|
"text-shadow",
|
|
3640
3639
|
"transform",
|
|
3641
3640
|
"animation",
|
|
3642
3641
|
"transition",
|
|
3643
|
-
"gap"
|
|
3642
|
+
"gap",
|
|
3643
|
+
"filter",
|
|
3644
|
+
"clip-path",
|
|
3645
|
+
"backdrop-filter"
|
|
3644
3646
|
]);
|
|
3645
3647
|
var OUTLOOK_WORD_UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
3646
3648
|
"border-radius",
|
|
@@ -3666,7 +3668,11 @@ var OUTLOOK_WORD_UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
|
3666
3668
|
"word-break",
|
|
3667
3669
|
"overflow-wrap",
|
|
3668
3670
|
"text-overflow",
|
|
3669
|
-
"border-spacing"
|
|
3671
|
+
"border-spacing",
|
|
3672
|
+
"filter",
|
|
3673
|
+
"clip-path",
|
|
3674
|
+
"backdrop-filter",
|
|
3675
|
+
"visibility"
|
|
3670
3676
|
]);
|
|
3671
3677
|
var STRUCTURAL_FIX_PROPERTIES = /* @__PURE__ */ new Set([
|
|
3672
3678
|
"display:flex",
|
|
@@ -5503,11 +5509,11 @@ var GMAIL_CLIP_THRESHOLD = 102 * 1024;
|
|
|
5503
5509
|
var GMAIL_CLIP_WARNING_THRESHOLD = 90 * 1024;
|
|
5504
5510
|
var CLIENT_DISPLAY_LIMITS = [
|
|
5505
5511
|
{ client: "Gmail (Web)", subjectLimit: 70, preheaderLimit: 90 },
|
|
5506
|
-
{ client: "Gmail (Mobile)", subjectLimit: 40, preheaderLimit:
|
|
5507
|
-
{ client: "Outlook (Web)", subjectLimit: 60, preheaderLimit:
|
|
5512
|
+
{ client: "Gmail (Mobile)", subjectLimit: 40, preheaderLimit: 45 },
|
|
5513
|
+
{ client: "Outlook (Web)", subjectLimit: 60, preheaderLimit: 90 },
|
|
5508
5514
|
{ client: "Outlook (Desktop)", subjectLimit: 55, preheaderLimit: 35 },
|
|
5509
5515
|
{ client: "Apple Mail (macOS)", subjectLimit: 78, preheaderLimit: 140 },
|
|
5510
|
-
{ client: "Apple Mail (iOS)", subjectLimit:
|
|
5516
|
+
{ client: "Apple Mail (iOS)", subjectLimit: 41, preheaderLimit: 90 },
|
|
5511
5517
|
{ client: "Yahoo Mail", subjectLimit: 46, preheaderLimit: 100 },
|
|
5512
5518
|
{ client: "Samsung Email", subjectLimit: 40, preheaderLimit: 70 }
|
|
5513
5519
|
];
|
|
@@ -6595,31 +6601,74 @@ function simulateDarkMode(html, clientId) {
|
|
|
6595
6601
|
});
|
|
6596
6602
|
switch (clientId) {
|
|
6597
6603
|
case "gmail-web":
|
|
6598
|
-
|
|
6604
|
+
break;
|
|
6599
6605
|
case "gmail-ios":
|
|
6600
|
-
applyColorInversion($,
|
|
6606
|
+
applyColorInversion($, "full");
|
|
6607
|
+
break;
|
|
6608
|
+
case "gmail-android":
|
|
6609
|
+
applyColorInversion($, "partial");
|
|
6601
6610
|
break;
|
|
6602
6611
|
case "outlook-web":
|
|
6603
6612
|
applyColorInversion($, "partial");
|
|
6613
|
+
if (!html.includes("prefers-color-scheme")) {
|
|
6614
|
+
warnings.push({
|
|
6615
|
+
severity: "info",
|
|
6616
|
+
client: clientId,
|
|
6617
|
+
property: "dark-mode",
|
|
6618
|
+
message: "Outlook.com applies partial color inversion in dark mode.",
|
|
6619
|
+
suggestion: "Use [data-ogsc] or [data-ogsb] CSS attribute selectors to override Outlook.com's dark mode color changes."
|
|
6620
|
+
});
|
|
6621
|
+
}
|
|
6622
|
+
break;
|
|
6623
|
+
case "outlook-windows":
|
|
6624
|
+
applyColorInversion($, "full");
|
|
6625
|
+
if (!html.includes("prefers-color-scheme")) {
|
|
6626
|
+
warnings.push({
|
|
6627
|
+
severity: "info",
|
|
6628
|
+
client: clientId,
|
|
6629
|
+
property: "dark-mode",
|
|
6630
|
+
message: "Outlook Windows applies full color inversion in dark mode. Colors may shift unexpectedly.",
|
|
6631
|
+
suggestion: "Test with dark mode enabled. The Word rendering engine offers limited control over dark mode color shifts."
|
|
6632
|
+
});
|
|
6633
|
+
}
|
|
6604
6634
|
break;
|
|
6605
6635
|
case "apple-mail-macos":
|
|
6606
6636
|
case "apple-mail-ios":
|
|
6607
|
-
applyColorInversion($, "partial");
|
|
6608
6637
|
if (!html.includes("prefers-color-scheme")) {
|
|
6609
6638
|
warnings.push({
|
|
6610
6639
|
severity: "info",
|
|
6611
6640
|
client: clientId,
|
|
6612
6641
|
property: "dark-mode",
|
|
6613
|
-
message: "Apple Mail supports @media (prefers-color-scheme: dark).
|
|
6642
|
+
message: "Apple Mail supports @media (prefers-color-scheme: dark). Without it, email content renders unchanged in dark mode.",
|
|
6614
6643
|
suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
|
|
6615
6644
|
});
|
|
6616
6645
|
}
|
|
6617
6646
|
break;
|
|
6618
6647
|
case "yahoo-mail":
|
|
6619
|
-
applyColorInversion($, "partial");
|
|
6620
6648
|
break;
|
|
6621
6649
|
case "samsung-mail":
|
|
6622
|
-
|
|
6650
|
+
if (!html.includes("prefers-color-scheme")) {
|
|
6651
|
+
applyColorInversion($, "partial");
|
|
6652
|
+
warnings.push({
|
|
6653
|
+
severity: "info",
|
|
6654
|
+
client: clientId,
|
|
6655
|
+
property: "dark-mode",
|
|
6656
|
+
message: "Samsung Mail supports @media (prefers-color-scheme: dark). Consider adding dark mode styles.",
|
|
6657
|
+
suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
|
|
6658
|
+
});
|
|
6659
|
+
}
|
|
6660
|
+
break;
|
|
6661
|
+
case "thunderbird":
|
|
6662
|
+
if (!html.includes("prefers-color-scheme")) {
|
|
6663
|
+
applyColorInversion($, "full");
|
|
6664
|
+
warnings.push({
|
|
6665
|
+
severity: "info",
|
|
6666
|
+
client: clientId,
|
|
6667
|
+
property: "dark-mode",
|
|
6668
|
+
message: "Thunderbird supports @media (prefers-color-scheme: dark). Consider adding dark mode styles.",
|
|
6669
|
+
suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
|
|
6670
|
+
});
|
|
6671
|
+
}
|
|
6623
6672
|
break;
|
|
6624
6673
|
case "hey-mail":
|
|
6625
6674
|
applyColorInversion($, "partial");
|
|
@@ -6645,9 +6694,6 @@ function simulateDarkMode(html, clientId) {
|
|
|
6645
6694
|
});
|
|
6646
6695
|
}
|
|
6647
6696
|
break;
|
|
6648
|
-
case "outlook-windows":
|
|
6649
|
-
case "thunderbird":
|
|
6650
|
-
break;
|
|
6651
6697
|
}
|
|
6652
6698
|
$("body").css("background-color", "#1a1a1a");
|
|
6653
6699
|
$("body").css("color", "#e0e0e0");
|