@emailens/engine 0.8.1 → 0.8.2

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/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: false,
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: false,
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",
@@ -5601,10 +5607,10 @@ var GMAIL_CLIP_WARNING_THRESHOLD = 90 * 1024;
5601
5607
  var CLIENT_DISPLAY_LIMITS = [
5602
5608
  { client: "Gmail (Web)", subjectLimit: 70, preheaderLimit: 90 },
5603
5609
  { client: "Gmail (Mobile)", subjectLimit: 40, preheaderLimit: 90 },
5604
- { client: "Outlook (Web)", subjectLimit: 60, preheaderLimit: 35 },
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: 35, preheaderLimit: 90 },
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,17 +6698,32 @@ function simulateDarkMode(html, clientId) {
6692
6698
  });
6693
6699
  switch (clientId) {
6694
6700
  case "gmail-web":
6695
- case "gmail-android":
6701
+ break;
6696
6702
  case "gmail-ios":
6697
- applyColorInversion($, clientId === "gmail-android" ? "full" : "partial");
6703
+ applyColorInversion($, "full");
6704
+ break;
6705
+ case "gmail-android":
6706
+ applyColorInversion($, "partial");
6698
6707
  break;
6699
6708
  case "outlook-web":
6700
6709
  applyColorInversion($, "partial");
6701
6710
  break;
6711
+ case "outlook-windows":
6712
+ applyColorInversion($, "full");
6713
+ if (!html.includes("prefers-color-scheme")) {
6714
+ warnings.push({
6715
+ severity: "info",
6716
+ client: clientId,
6717
+ property: "dark-mode",
6718
+ message: "Outlook Windows applies full color inversion in dark mode. Colors may shift unexpectedly.",
6719
+ suggestion: "Test with dark mode enabled. Use [data-ogsc] or [data-ogsb] overrides to control Outlook dark mode rendering."
6720
+ });
6721
+ }
6722
+ break;
6702
6723
  case "apple-mail-macos":
6703
6724
  case "apple-mail-ios":
6704
- applyColorInversion($, "partial");
6705
6725
  if (!html.includes("prefers-color-scheme")) {
6726
+ applyColorInversion($, "partial");
6706
6727
  warnings.push({
6707
6728
  severity: "info",
6708
6729
  client: clientId,
@@ -6713,10 +6734,30 @@ function simulateDarkMode(html, clientId) {
6713
6734
  }
6714
6735
  break;
6715
6736
  case "yahoo-mail":
6716
- applyColorInversion($, "partial");
6717
6737
  break;
6718
6738
  case "samsung-mail":
6719
- applyColorInversion($, "full");
6739
+ if (!html.includes("prefers-color-scheme")) {
6740
+ applyColorInversion($, "partial");
6741
+ warnings.push({
6742
+ severity: "info",
6743
+ client: clientId,
6744
+ property: "dark-mode",
6745
+ message: "Samsung Mail supports @media (prefers-color-scheme: dark). Consider adding dark mode styles.",
6746
+ suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
6747
+ });
6748
+ }
6749
+ break;
6750
+ case "thunderbird":
6751
+ if (!html.includes("prefers-color-scheme")) {
6752
+ applyColorInversion($, "full");
6753
+ warnings.push({
6754
+ severity: "info",
6755
+ client: clientId,
6756
+ property: "dark-mode",
6757
+ message: "Thunderbird supports @media (prefers-color-scheme: dark). Consider adding dark mode styles.",
6758
+ suggestion: "Add a @media (prefers-color-scheme: dark) block with inverted colors for the best dark mode experience."
6759
+ });
6760
+ }
6720
6761
  break;
6721
6762
  case "hey-mail":
6722
6763
  applyColorInversion($, "partial");
@@ -6742,9 +6783,6 @@ function simulateDarkMode(html, clientId) {
6742
6783
  });
6743
6784
  }
6744
6785
  break;
6745
- case "outlook-windows":
6746
- case "thunderbird":
6747
- break;
6748
6786
  }
6749
6787
  $("body").css("background-color", "#1a1a1a");
6750
6788
  $("body").css("color", "#e0e0e0");