@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.cjs
CHANGED
|
@@ -143,7 +143,7 @@ var EMAIL_CLIENTS = [
|
|
|
143
143
|
name: "Outlook Windows",
|
|
144
144
|
category: "desktop",
|
|
145
145
|
engine: "Microsoft Word",
|
|
146
|
-
darkModeSupport:
|
|
146
|
+
darkModeSupport: true,
|
|
147
147
|
icon: "monitor"
|
|
148
148
|
},
|
|
149
149
|
{
|
|
@@ -183,7 +183,7 @@ var EMAIL_CLIENTS = [
|
|
|
183
183
|
name: "Thunderbird",
|
|
184
184
|
category: "desktop",
|
|
185
185
|
engine: "Gecko",
|
|
186
|
-
darkModeSupport:
|
|
186
|
+
darkModeSupport: true,
|
|
187
187
|
icon: "monitor"
|
|
188
188
|
},
|
|
189
189
|
{
|
|
@@ -3730,14 +3730,16 @@ var CSS_SUPPORT = {
|
|
|
3730
3730
|
};
|
|
3731
3731
|
var GMAIL_STRIPPED_PROPERTIES = /* @__PURE__ */ new Set([
|
|
3732
3732
|
"position",
|
|
3733
|
-
"overflow",
|
|
3734
3733
|
"visibility",
|
|
3735
3734
|
"box-shadow",
|
|
3736
3735
|
"text-shadow",
|
|
3737
3736
|
"transform",
|
|
3738
3737
|
"animation",
|
|
3739
3738
|
"transition",
|
|
3740
|
-
"gap"
|
|
3739
|
+
"gap",
|
|
3740
|
+
"filter",
|
|
3741
|
+
"clip-path",
|
|
3742
|
+
"backdrop-filter"
|
|
3741
3743
|
]);
|
|
3742
3744
|
var OUTLOOK_WORD_UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
3743
3745
|
"border-radius",
|
|
@@ -3763,7 +3765,11 @@ var OUTLOOK_WORD_UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
|
3763
3765
|
"word-break",
|
|
3764
3766
|
"overflow-wrap",
|
|
3765
3767
|
"text-overflow",
|
|
3766
|
-
"border-spacing"
|
|
3768
|
+
"border-spacing",
|
|
3769
|
+
"filter",
|
|
3770
|
+
"clip-path",
|
|
3771
|
+
"backdrop-filter",
|
|
3772
|
+
"visibility"
|
|
3767
3773
|
]);
|
|
3768
3774
|
var STRUCTURAL_FIX_PROPERTIES = /* @__PURE__ */ new Set([
|
|
3769
3775
|
"display:flex",
|
|
@@ -5600,11 +5606,11 @@ var GMAIL_CLIP_THRESHOLD = 102 * 1024;
|
|
|
5600
5606
|
var GMAIL_CLIP_WARNING_THRESHOLD = 90 * 1024;
|
|
5601
5607
|
var CLIENT_DISPLAY_LIMITS = [
|
|
5602
5608
|
{ client: "Gmail (Web)", subjectLimit: 70, preheaderLimit: 90 },
|
|
5603
|
-
{ client: "Gmail (Mobile)", subjectLimit: 40, preheaderLimit:
|
|
5604
|
-
{ client: "Outlook (Web)", subjectLimit: 60, preheaderLimit:
|
|
5609
|
+
{ client: "Gmail (Mobile)", subjectLimit: 40, preheaderLimit: 45 },
|
|
5610
|
+
{ client: "Outlook (Web)", subjectLimit: 60, preheaderLimit: 90 },
|
|
5605
5611
|
{ client: "Outlook (Desktop)", subjectLimit: 55, preheaderLimit: 35 },
|
|
5606
5612
|
{ client: "Apple Mail (macOS)", subjectLimit: 78, preheaderLimit: 140 },
|
|
5607
|
-
{ client: "Apple Mail (iOS)", subjectLimit:
|
|
5613
|
+
{ client: "Apple Mail (iOS)", subjectLimit: 41, preheaderLimit: 90 },
|
|
5608
5614
|
{ client: "Yahoo Mail", subjectLimit: 46, preheaderLimit: 100 },
|
|
5609
5615
|
{ client: "Samsung Email", subjectLimit: 40, preheaderLimit: 70 }
|
|
5610
5616
|
];
|
|
@@ -6692,31 +6698,74 @@ function simulateDarkMode(html, clientId) {
|
|
|
6692
6698
|
});
|
|
6693
6699
|
switch (clientId) {
|
|
6694
6700
|
case "gmail-web":
|
|
6695
|
-
|
|
6701
|
+
break;
|
|
6696
6702
|
case "gmail-ios":
|
|
6697
|
-
applyColorInversion($,
|
|
6703
|
+
applyColorInversion($, "full");
|
|
6704
|
+
break;
|
|
6705
|
+
case "gmail-android":
|
|
6706
|
+
applyColorInversion($, "partial");
|
|
6698
6707
|
break;
|
|
6699
6708
|
case "outlook-web":
|
|
6700
6709
|
applyColorInversion($, "partial");
|
|
6710
|
+
if (!html.includes("prefers-color-scheme")) {
|
|
6711
|
+
warnings.push({
|
|
6712
|
+
severity: "info",
|
|
6713
|
+
client: clientId,
|
|
6714
|
+
property: "dark-mode",
|
|
6715
|
+
message: "Outlook.com applies partial color inversion in dark mode.",
|
|
6716
|
+
suggestion: "Use [data-ogsc] or [data-ogsb] CSS attribute selectors to override Outlook.com's dark mode color changes."
|
|
6717
|
+
});
|
|
6718
|
+
}
|
|
6719
|
+
break;
|
|
6720
|
+
case "outlook-windows":
|
|
6721
|
+
applyColorInversion($, "full");
|
|
6722
|
+
if (!html.includes("prefers-color-scheme")) {
|
|
6723
|
+
warnings.push({
|
|
6724
|
+
severity: "info",
|
|
6725
|
+
client: clientId,
|
|
6726
|
+
property: "dark-mode",
|
|
6727
|
+
message: "Outlook Windows applies full color inversion in dark mode. Colors may shift unexpectedly.",
|
|
6728
|
+
suggestion: "Test with dark mode enabled. The Word rendering engine offers limited control over dark mode color shifts."
|
|
6729
|
+
});
|
|
6730
|
+
}
|
|
6701
6731
|
break;
|
|
6702
6732
|
case "apple-mail-macos":
|
|
6703
6733
|
case "apple-mail-ios":
|
|
6704
|
-
applyColorInversion($, "partial");
|
|
6705
6734
|
if (!html.includes("prefers-color-scheme")) {
|
|
6706
6735
|
warnings.push({
|
|
6707
6736
|
severity: "info",
|
|
6708
6737
|
client: clientId,
|
|
6709
6738
|
property: "dark-mode",
|
|
6710
|
-
message: "Apple Mail supports @media (prefers-color-scheme: dark).
|
|
6739
|
+
message: "Apple Mail supports @media (prefers-color-scheme: dark). Without it, email content renders unchanged in dark mode.",
|
|
6711
6740
|
suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
|
|
6712
6741
|
});
|
|
6713
6742
|
}
|
|
6714
6743
|
break;
|
|
6715
6744
|
case "yahoo-mail":
|
|
6716
|
-
applyColorInversion($, "partial");
|
|
6717
6745
|
break;
|
|
6718
6746
|
case "samsung-mail":
|
|
6719
|
-
|
|
6747
|
+
if (!html.includes("prefers-color-scheme")) {
|
|
6748
|
+
applyColorInversion($, "partial");
|
|
6749
|
+
warnings.push({
|
|
6750
|
+
severity: "info",
|
|
6751
|
+
client: clientId,
|
|
6752
|
+
property: "dark-mode",
|
|
6753
|
+
message: "Samsung Mail supports @media (prefers-color-scheme: dark). Consider adding dark mode styles.",
|
|
6754
|
+
suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
|
|
6755
|
+
});
|
|
6756
|
+
}
|
|
6757
|
+
break;
|
|
6758
|
+
case "thunderbird":
|
|
6759
|
+
if (!html.includes("prefers-color-scheme")) {
|
|
6760
|
+
applyColorInversion($, "full");
|
|
6761
|
+
warnings.push({
|
|
6762
|
+
severity: "info",
|
|
6763
|
+
client: clientId,
|
|
6764
|
+
property: "dark-mode",
|
|
6765
|
+
message: "Thunderbird supports @media (prefers-color-scheme: dark). Consider adding dark mode styles.",
|
|
6766
|
+
suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
|
|
6767
|
+
});
|
|
6768
|
+
}
|
|
6720
6769
|
break;
|
|
6721
6770
|
case "hey-mail":
|
|
6722
6771
|
applyColorInversion($, "partial");
|
|
@@ -6742,9 +6791,6 @@ function simulateDarkMode(html, clientId) {
|
|
|
6742
6791
|
});
|
|
6743
6792
|
}
|
|
6744
6793
|
break;
|
|
6745
|
-
case "outlook-windows":
|
|
6746
|
-
case "thunderbird":
|
|
6747
|
-
break;
|
|
6748
6794
|
}
|
|
6749
6795
|
$("body").css("background-color", "#1a1a1a");
|
|
6750
6796
|
$("body").css("color", "#e0e0e0");
|