@emailens/cli 0.13.11 → 0.13.12

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.
@@ -63268,12 +63268,27 @@ function arcsizeToRadius(arcsize, width, height) {
63268
63268
  return Math.min(shorter / 2, Math.max(0, pct) / 100 * shorter);
63269
63269
  }
63270
63270
  var DOWNLEVEL_REVEALED = /<!--\[if[^\]]*!\s*\(*\s*(?:mso|vml|true)[^\]]*\]>\s*<(?:!-->|!--\s*-->|!\s*-->)([\s\S]*?)(?:<!--\s*<!\[endif\]-->|<!--\[endif\]-*-->)/gi;
63271
- var DOWNLEVEL_HIDDEN = /<!--\[if(?![^\]]*!)[^\]]*(?:mso|vml|true)[^\]]*\]>([\s\S]*?)<!\[endif\]-->/gi;
63271
+ var DOWNLEVEL_HIDDEN = /<!--\[if(?![^\]]*!)([^\]]*(?:mso|vml|true)[^\]]*)\]>([\s\S]*?)<!\[endif\]-->/gi;
63272
+ var WORD_MSO_VERSION = 16;
63273
+ function wordOpens(condition) {
63274
+ const bits = condition.toLowerCase().replace(/\b(?:(lt|lte|gt|gte)\s+)?mso(?:\s+(\d+(?:\.\d+)?))?/g, (_3, op2, n2) => {
63275
+ if (!n2) return "1";
63276
+ const v = Number.parseFloat(n2);
63277
+ const ok = op2 === "lt" ? WORD_MSO_VERSION < v : op2 === "lte" ? WORD_MSO_VERSION <= v : op2 === "gt" ? WORD_MSO_VERSION > v : op2 === "gte" ? WORD_MSO_VERSION >= v : Math.floor(v) === WORD_MSO_VERSION;
63278
+ return ok ? "1" : "0";
63279
+ }).replace(/\b(?:vml|true)\b/g, "1").replace(/[a-z]\w*(?:\s+\d+(?:\.\d+)?)?/g, "0").replace(/\s+/g, "");
63280
+ let s2 = bits;
63281
+ for (let prev2 = ""; prev2 !== s2; ) {
63282
+ prev2 = s2;
63283
+ s2 = s2.replace(/\(([01])\)/g, "$1").replace(/([01])&([01])/g, (_3, a2, b2) => a2 === "1" && b2 === "1" ? "1" : "0").replace(/([01])\|([01])/g, (_3, a2, b2) => a2 === "1" || b2 === "1" ? "1" : "0");
63284
+ }
63285
+ return s2 === "1";
63286
+ }
63272
63287
  var OFFICE_SETTINGS = /<xml\b[^>]*>[\s\S]*?<\/xml>/gi;
63273
63288
  function resolveMsoBranch(html3) {
63274
63289
  return html3.replace(DOWNLEVEL_REVEALED, "").replace(
63275
63290
  DOWNLEVEL_HIDDEN,
63276
- (_3, inner) => /^\s*<style/i.test(inner) ? inner.replace(/(\.[\w-]+\s*\{[^}]*?)font-size\s*:[^;}]*;?/g, "$1") : inner
63291
+ (_3, condition, inner) => !wordOpens(condition) ? "" : /^\s*<style/i.test(inner) ? inner.replace(/(\.[\w-]+\s*\{[^}]*?)font-size\s*:[^;}]*;?/g, "$1") : inner
63277
63292
  ).replace(OFFICE_SETTINGS, "");
63278
63293
  }
63279
63294
  var MSO_HIDE = /mso-hide\s*:\s*all/i;
package/dist/index.js CHANGED
@@ -32,7 +32,7 @@ import {
32
32
  simulateDarkMode,
33
33
  toFramework,
34
34
  transformForAllClients
35
- } from "./chunk-HJEE6UV2.js";
35
+ } from "./chunk-3TDW4LHR.js";
36
36
  import "./chunk-ABDTBRVK.js";
37
37
  import "./chunk-2AP7CT6R.js";
38
38
  import "./chunk-NXBRJX3V.js";
@@ -33302,12 +33302,27 @@ h1 {
33302
33302
  return Math.min(shorter / 2, Math.max(0, pct) / 100 * shorter);
33303
33303
  }
33304
33304
  var DOWNLEVEL_REVEALED = /<!--\[if[^\]]*!\s*\(*\s*(?:mso|vml|true)[^\]]*\]>\s*<(?:!-->|!--\s*-->|!\s*-->)([\s\S]*?)(?:<!--\s*<!\[endif\]-->|<!--\[endif\]-*-->)/gi;
33305
- var DOWNLEVEL_HIDDEN = /<!--\[if(?![^\]]*!)[^\]]*(?:mso|vml|true)[^\]]*\]>([\s\S]*?)<!\[endif\]-->/gi;
33305
+ var DOWNLEVEL_HIDDEN = /<!--\[if(?![^\]]*!)([^\]]*(?:mso|vml|true)[^\]]*)\]>([\s\S]*?)<!\[endif\]-->/gi;
33306
+ var WORD_MSO_VERSION = 16;
33307
+ function wordOpens(condition) {
33308
+ const bits = condition.toLowerCase().replace(/\b(?:(lt|lte|gt|gte)\s+)?mso(?:\s+(\d+(?:\.\d+)?))?/g, (_, op, n) => {
33309
+ if (!n) return "1";
33310
+ const v = Number.parseFloat(n);
33311
+ const ok = op === "lt" ? WORD_MSO_VERSION < v : op === "lte" ? WORD_MSO_VERSION <= v : op === "gt" ? WORD_MSO_VERSION > v : op === "gte" ? WORD_MSO_VERSION >= v : Math.floor(v) === WORD_MSO_VERSION;
33312
+ return ok ? "1" : "0";
33313
+ }).replace(/\b(?:vml|true)\b/g, "1").replace(/[a-z]\w*(?:\s+\d+(?:\.\d+)?)?/g, "0").replace(/\s+/g, "");
33314
+ let s = bits;
33315
+ for (let prev = ""; prev !== s; ) {
33316
+ prev = s;
33317
+ s = s.replace(/\(([01])\)/g, "$1").replace(/([01])&([01])/g, (_, a, b) => a === "1" && b === "1" ? "1" : "0").replace(/([01])\|([01])/g, (_, a, b) => a === "1" || b === "1" ? "1" : "0");
33318
+ }
33319
+ return s === "1";
33320
+ }
33306
33321
  var OFFICE_SETTINGS = /<xml\b[^>]*>[\s\S]*?<\/xml>/gi;
33307
33322
  function resolveMsoBranch(html) {
33308
33323
  return html.replace(DOWNLEVEL_REVEALED, "").replace(
33309
33324
  DOWNLEVEL_HIDDEN,
33310
- (_, inner) => /^\s*<style/i.test(inner) ? inner.replace(/(\.[\w-]+\s*\{[^}]*?)font-size\s*:[^;}]*;?/g, "$1") : inner
33325
+ (_, condition, inner) => !wordOpens(condition) ? "" : /^\s*<style/i.test(inner) ? inner.replace(/(\.[\w-]+\s*\{[^}]*?)font-size\s*:[^;}]*;?/g, "$1") : inner
33311
33326
  ).replace(OFFICE_SETTINGS, "");
33312
33327
  }
33313
33328
  var MSO_HIDE = /mso-hide\s*:\s*all/i;
@@ -43070,7 +43085,7 @@ Href: ${href}`
43070
43085
  // package.json
43071
43086
  var package_default = {
43072
43087
  name: "@emailens/cli",
43073
- version: "0.13.11",
43088
+ version: "0.13.12",
43074
43089
  description: "CLI tool for email compatibility analysis: lint, preview and export HTML, MJML, Maizzle and React Email rendering across 21 email clients.",
43075
43090
  type: "module",
43076
43091
  bin: {
@@ -43111,7 +43126,7 @@ var package_default = {
43111
43126
  },
43112
43127
  devDependencies: {
43113
43128
  "@anthropic-ai/sdk": "^0.52.0",
43114
- "@emailens/engine": "^0.18.13",
43129
+ "@emailens/engine": "^0.18.14",
43115
43130
  "@types/bun": "^1.4.0",
43116
43131
  "@types/mjml": "^4.7.4",
43117
43132
  "@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-HJEE6UV2.js";
8
+ } from "./chunk-3TDW4LHR.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.11",
3
+ "version": "0.13.12",
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.13",
44
+ "@emailens/engine": "^0.18.14",
45
45
  "@types/bun": "^1.4.0",
46
46
  "@types/mjml": "^4.7.4",
47
47
  "@types/node": "^25.9.5",