@emailens/cli 0.13.3 → 0.13.4

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.
@@ -63282,8 +63282,8 @@ function arcsizeToRadius(arcsize, width, height) {
63282
63282
  const shorter = Math.min(width, height);
63283
63283
  return Math.min(shorter / 2, Math.max(0, pct) / 100 * shorter);
63284
63284
  }
63285
- var DOWNLEVEL_REVEALED = /<!--\[if[^\]]*!\s*(?:mso|vml)[^\]]*\]>\s*<(?:!-->|!--\s*-->|!\s*-->)([\s\S]*?)(?:<!--\s*<!\[endif\]-->|<!--\[endif\]-*-->)/gi;
63286
- var DOWNLEVEL_HIDDEN = /<!--\[if(?![^\]]*!)[^\]]*(?:mso|vml)[^\]]*\]>([\s\S]*?)<!\[endif\]-->/gi;
63285
+ var DOWNLEVEL_REVEALED = /<!--\[if[^\]]*!\s*\(*\s*(?:mso|vml|true)[^\]]*\]>\s*<(?:!-->|!--\s*-->|!\s*-->)([\s\S]*?)(?:<!--\s*<!\[endif\]-->|<!--\[endif\]-*-->)/gi;
63286
+ var DOWNLEVEL_HIDDEN = /<!--\[if(?![^\]]*!)[^\]]*(?:mso|vml|true)[^\]]*\]>([\s\S]*?)<!\[endif\]-->/gi;
63287
63287
  var OFFICE_SETTINGS = /<xml\b[^>]*>[\s\S]*?<\/xml>/gi;
63288
63288
  function resolveMsoBranch(html3) {
63289
63289
  return html3.replace(DOWNLEVEL_REVEALED, "").replace(DOWNLEVEL_HIDDEN, "$1").replace(OFFICE_SETTINGS, "");
@@ -63710,7 +63710,7 @@ function overrideStylesheetRules($3, faces) {
63710
63710
  if ($3(el2).closest("body").length && !/font-family/i.test((_a22 = $3(el2).attr("style")) != null ? _a22 : ""))
63711
63711
  override(el2, `font-family:${family}!important`);
63712
63712
  $3("style").each((_3, block) => {
63713
- var _a32, _b, _c2;
63713
+ var _a32, _b;
63714
63714
  for (const { selector, body } of topLevelRules((_a32 = $3(block).html()) != null ? _a32 : "")) {
63715
63715
  const props = parseInlineStyle(body.replace(/!important/gi, ""));
63716
63716
  const hasPadding = PADDING.some((prop2) => props.has(prop2));
@@ -63728,9 +63728,6 @@ function overrideStylesheetRules($3, faces) {
63728
63728
  }
63729
63729
  for (const el2 of matched) {
63730
63730
  const tag = (_b = el2.tagName) == null ? void 0 : _b.toLowerCase();
63731
- if (hides && (tag === "div" || tag === "table") && !/mso-hide/i.test((_c2 = $3(el2).attr("style")) != null ? _c2 : "")) {
63732
- override(el2, tag === "div" ? "display:block!important" : "display:table!important");
63733
- }
63734
63731
  if (hasPadding && (tag === "div" || tag === "p" || tag === "span" || tag === "a"))
63735
63732
  override(el2, "padding:0!important");
63736
63733
  if (hasSize && (tag === "div" || tag === "span")) {
@@ -63747,8 +63744,8 @@ function overrideStylesheetRules($3, faces) {
63747
63744
  var UNKNOWN_TO_WORD = /(?:^|;)\s*[\w-]+\s*:[^;]*(?:\brgba\(|\bhsla?\(|\bvar\(|#[0-9a-f]{8}(?![0-9a-f])|#[0-9a-f]{4}(?![0-9a-f]))[^;]*/gi;
63748
63745
  var dropUnknown = (declarations) => declarations.replace(UNKNOWN_TO_WORD, "");
63749
63746
  function dropWordUnknownColors(html3) {
63750
- if (!/rgba\(|hsla?\(|var\(|#[0-9a-f]{8}|#[0-9a-f]{4}(?![0-9a-f])/i.test(html3)) return html3;
63751
- return html3.replace(/(\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi, (whole, lead, dq, sq) => {
63747
+ if (!/rgba\(|hsla?\(|var\(|#[0-9a-f]{8}|#[0-9a-f]{4}(?![0-9a-f])|bgcolor\s*=\s*["']?#[0-9a-f]{3}(?![0-9a-f])/i.test(html3)) return html3;
63748
+ return html3.replace(/\sbgcolor\s*=\s*(["']?)#[0-9a-f]{3}\1(?=[\s>/])/gi, "").replace(/(\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi, (whole, lead, dq, sq) => {
63752
63749
  var _a22;
63753
63750
  const style = (_a22 = dq != null ? dq : sq) != null ? _a22 : "";
63754
63751
  const kept = dropUnknown(style);
@@ -63766,7 +63763,7 @@ function dropWordUnknownColors(html3) {
63766
63763
  function markHiddenCells(html3) {
63767
63764
  if (!/display\s*:\s*none/i.test(html3)) return html3;
63768
63765
  return html3.replace(
63769
- /(<(?:td|th|tr|span)\b[^>]*?\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi,
63766
+ /(<(?:td|th|tr|span|div|table)\b[^>]*?\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi,
63770
63767
  (whole, lead, dq, sq) => {
63771
63768
  var _a22;
63772
63769
  const style = (_a22 = dq != null ? dq : sq) != null ? _a22 : "";
@@ -63904,10 +63901,12 @@ function applyWordBoxModel($3) {
63904
63901
  var _a22;
63905
63902
  const el2 = node;
63906
63903
  const props = parseInlineStyle($3(el2).attr("style") || "");
63904
+ const NUMBER = /^\d+(?:\.\d+)?$/;
63907
63905
  const numeric = (name) => {
63908
- const value = $3(el2).attr(name);
63909
- if (value !== void 0 && !/^\d+$/.test(value.trim())) $3(el2).removeAttr(name);
63910
- return value !== void 0 && /^\d+$/.test(value.trim()) ? value.trim() : void 0;
63906
+ var _a32;
63907
+ const value = (_a32 = $3(el2).attr(name)) == null ? void 0 : _a32.trim();
63908
+ if (value !== void 0 && !NUMBER.test(value)) $3(el2).removeAttr(name);
63909
+ return value !== void 0 && NUMBER.test(value) ? String(Math.round(Number(value))) : void 0;
63911
63910
  };
63912
63911
  const width = numeric("width");
63913
63912
  const height = numeric("height");
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  simulateDarkMode,
33
33
  toFramework,
34
34
  transformForAllClients
35
- } from "./chunk-FRXG2KHP.js";
35
+ } from "./chunk-2W2K4VNB.js";
36
36
  import "./chunk-ABDTBRVK.js";
37
37
  import "./chunk-2AP7CT6R.js";
38
38
  import "./chunk-NXBRJX3V.js";
@@ -33316,8 +33316,8 @@ h1 {
33316
33316
  const shorter = Math.min(width, height);
33317
33317
  return Math.min(shorter / 2, Math.max(0, pct) / 100 * shorter);
33318
33318
  }
33319
- var DOWNLEVEL_REVEALED = /<!--\[if[^\]]*!\s*(?:mso|vml)[^\]]*\]>\s*<(?:!-->|!--\s*-->|!\s*-->)([\s\S]*?)(?:<!--\s*<!\[endif\]-->|<!--\[endif\]-*-->)/gi;
33320
- var DOWNLEVEL_HIDDEN = /<!--\[if(?![^\]]*!)[^\]]*(?:mso|vml)[^\]]*\]>([\s\S]*?)<!\[endif\]-->/gi;
33319
+ var DOWNLEVEL_REVEALED = /<!--\[if[^\]]*!\s*\(*\s*(?:mso|vml|true)[^\]]*\]>\s*<(?:!-->|!--\s*-->|!\s*-->)([\s\S]*?)(?:<!--\s*<!\[endif\]-->|<!--\[endif\]-*-->)/gi;
33320
+ var DOWNLEVEL_HIDDEN = /<!--\[if(?![^\]]*!)[^\]]*(?:mso|vml|true)[^\]]*\]>([\s\S]*?)<!\[endif\]-->/gi;
33321
33321
  var OFFICE_SETTINGS = /<xml\b[^>]*>[\s\S]*?<\/xml>/gi;
33322
33322
  function resolveMsoBranch(html) {
33323
33323
  return html.replace(DOWNLEVEL_REVEALED, "").replace(DOWNLEVEL_HIDDEN, "$1").replace(OFFICE_SETTINGS, "");
@@ -33748,7 +33748,7 @@ h1 {
33748
33748
  if ($(el).closest("body").length && !/font-family/i.test((_a2 = $(el).attr("style")) != null ? _a2 : ""))
33749
33749
  override(el, `font-family:${family}!important`);
33750
33750
  $("style").each((_, block) => {
33751
- var _a3, _b, _c;
33751
+ var _a3, _b;
33752
33752
  for (const { selector, body } of topLevelRules((_a3 = $(block).html()) != null ? _a3 : "")) {
33753
33753
  const props = parseInlineStyle(body.replace(/!important/gi, ""));
33754
33754
  const hasPadding = PADDING.some((prop) => props.has(prop));
@@ -33766,9 +33766,6 @@ h1 {
33766
33766
  }
33767
33767
  for (const el of matched) {
33768
33768
  const tag = (_b = el.tagName) == null ? void 0 : _b.toLowerCase();
33769
- if (hides && (tag === "div" || tag === "table") && !/mso-hide/i.test((_c = $(el).attr("style")) != null ? _c : "")) {
33770
- override(el, tag === "div" ? "display:block!important" : "display:table!important");
33771
- }
33772
33769
  if (hasPadding && (tag === "div" || tag === "p" || tag === "span" || tag === "a"))
33773
33770
  override(el, "padding:0!important");
33774
33771
  if (hasSize && (tag === "div" || tag === "span")) {
@@ -33785,8 +33782,8 @@ h1 {
33785
33782
  var UNKNOWN_TO_WORD = /(?:^|;)\s*[\w-]+\s*:[^;]*(?:\brgba\(|\bhsla?\(|\bvar\(|#[0-9a-f]{8}(?![0-9a-f])|#[0-9a-f]{4}(?![0-9a-f]))[^;]*/gi;
33786
33783
  var dropUnknown = (declarations) => declarations.replace(UNKNOWN_TO_WORD, "");
33787
33784
  function dropWordUnknownColors(html) {
33788
- if (!/rgba\(|hsla?\(|var\(|#[0-9a-f]{8}|#[0-9a-f]{4}(?![0-9a-f])/i.test(html)) return html;
33789
- return html.replace(/(\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi, (whole, lead, dq, sq) => {
33785
+ if (!/rgba\(|hsla?\(|var\(|#[0-9a-f]{8}|#[0-9a-f]{4}(?![0-9a-f])|bgcolor\s*=\s*["']?#[0-9a-f]{3}(?![0-9a-f])/i.test(html)) return html;
33786
+ return html.replace(/\sbgcolor\s*=\s*(["']?)#[0-9a-f]{3}\1(?=[\s>/])/gi, "").replace(/(\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi, (whole, lead, dq, sq) => {
33790
33787
  var _a2;
33791
33788
  const style = (_a2 = dq != null ? dq : sq) != null ? _a2 : "";
33792
33789
  const kept = dropUnknown(style);
@@ -33804,7 +33801,7 @@ h1 {
33804
33801
  function markHiddenCells(html) {
33805
33802
  if (!/display\s*:\s*none/i.test(html)) return html;
33806
33803
  return html.replace(
33807
- /(<(?:td|th|tr|span)\b[^>]*?\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi,
33804
+ /(<(?:td|th|tr|span|div|table)\b[^>]*?\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi,
33808
33805
  (whole, lead, dq, sq) => {
33809
33806
  var _a2;
33810
33807
  const style = (_a2 = dq != null ? dq : sq) != null ? _a2 : "";
@@ -33942,10 +33939,12 @@ h1 {
33942
33939
  var _a2;
33943
33940
  const el = node;
33944
33941
  const props = parseInlineStyle($(el).attr("style") || "");
33942
+ const NUMBER = /^\d+(?:\.\d+)?$/;
33945
33943
  const numeric = (name) => {
33946
- const value = $(el).attr(name);
33947
- if (value !== void 0 && !/^\d+$/.test(value.trim())) $(el).removeAttr(name);
33948
- return value !== void 0 && /^\d+$/.test(value.trim()) ? value.trim() : void 0;
33944
+ var _a3;
33945
+ const value = (_a3 = $(el).attr(name)) == null ? void 0 : _a3.trim();
33946
+ if (value !== void 0 && !NUMBER.test(value)) $(el).removeAttr(name);
33947
+ return value !== void 0 && NUMBER.test(value) ? String(Math.round(Number(value))) : void 0;
33949
33948
  };
33950
33949
  const width = numeric("width");
33951
33950
  const height = numeric("height");
@@ -42778,7 +42777,7 @@ Href: ${href}`
42778
42777
  // package.json
42779
42778
  var package_default = {
42780
42779
  name: "@emailens/cli",
42781
- version: "0.13.3",
42780
+ version: "0.13.4",
42782
42781
  description: "CLI tool for email compatibility analysis: lint, preview and export HTML, MJML, Maizzle and React Email rendering across 21 email clients.",
42783
42782
  type: "module",
42784
42783
  bin: {
@@ -42819,7 +42818,7 @@ var package_default = {
42819
42818
  },
42820
42819
  devDependencies: {
42821
42820
  "@anthropic-ai/sdk": "^0.52.0",
42822
- "@emailens/engine": "^0.18.4",
42821
+ "@emailens/engine": "^0.18.6",
42823
42822
  "@types/bun": "^1.4.0",
42824
42823
  "@types/mjml": "^4.7.4",
42825
42824
  "@types/node": "^25.9.5",
package/dist/test.js CHANGED
@@ -5,7 +5,7 @@ import {
5
5
  auditEmail,
6
6
  flattenToLintIssues,
7
7
  loadProjectConfig
8
- } from "./chunk-FRXG2KHP.js";
8
+ } from "./chunk-2W2K4VNB.js";
9
9
  import "./chunk-ABDTBRVK.js";
10
10
  import "./chunk-2AP7CT6R.js";
11
11
  import "./chunk-NXBRJX3V.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@emailens/cli",
3
- "version": "0.13.3",
3
+ "version": "0.13.4",
4
4
  "description": "CLI tool for email compatibility analysis: lint, preview and export HTML, MJML, Maizzle and React Email rendering across 21 email clients.",
5
5
  "type": "module",
6
6
  "bin": {
@@ -41,7 +41,7 @@
41
41
  },
42
42
  "devDependencies": {
43
43
  "@anthropic-ai/sdk": "^0.52.0",
44
- "@emailens/engine": "^0.18.4",
44
+ "@emailens/engine": "^0.18.6",
45
45
  "@types/bun": "^1.4.0",
46
46
  "@types/mjml": "^4.7.4",
47
47
  "@types/node": "^25.9.5",