@emailens/cli 0.13.3 → 0.13.5
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/{chunk-FRXG2KHP.js → chunk-N2VVATK3.js} +44 -35
- package/dist/index.js +47 -38
- package/dist/test.js +1 -1
- package/package.json +2 -2
|
@@ -62871,21 +62871,6 @@ function rgbToOklab(rgba) {
|
|
|
62871
62871
|
0.0259040371 * l2 + 0.7827717662 * m2 - 0.808675766 * s2
|
|
62872
62872
|
];
|
|
62873
62873
|
}
|
|
62874
|
-
function oklabToRgb([L3, A3, B2]) {
|
|
62875
|
-
const l2 = (L3 + 0.3963377774 * A3 + 0.2158037573 * B2) ** 3;
|
|
62876
|
-
const m2 = (L3 - 0.1055613458 * A3 - 0.0638541728 * B2) ** 3;
|
|
62877
|
-
const s2 = (L3 - 0.0894841775 * A3 - 1.291485548 * B2) ** 3;
|
|
62878
|
-
const toGamma = (c2) => {
|
|
62879
|
-
const v = c2 <= 31308e-7 ? 12.92 * c2 : 1.055 * Math.pow(c2, 1 / 2.4) - 0.055;
|
|
62880
|
-
return Math.round(Math.min(1, Math.max(0, v)) * 255);
|
|
62881
|
-
};
|
|
62882
|
-
return {
|
|
62883
|
-
r: toGamma(4.0767416621 * l2 - 3.3077115913 * m2 + 0.2309699292 * s2),
|
|
62884
|
-
g: toGamma(-1.2684380046 * l2 + 2.6097574011 * m2 - 0.3413193965 * s2),
|
|
62885
|
-
b: toGamma(-0.0041960863 * l2 - 0.7034186147 * m2 + 1.707662439 * s2),
|
|
62886
|
-
a: 1
|
|
62887
|
-
};
|
|
62888
|
-
}
|
|
62889
62874
|
function colorDistance(a2, b2) {
|
|
62890
62875
|
const [l1, a1, b1] = rgbToOklab(a2);
|
|
62891
62876
|
const [l2, a22, b22] = rgbToOklab(b2);
|
|
@@ -63282,8 +63267,8 @@ function arcsizeToRadius(arcsize, width, height) {
|
|
|
63282
63267
|
const shorter = Math.min(width, height);
|
|
63283
63268
|
return Math.min(shorter / 2, Math.max(0, pct) / 100 * shorter);
|
|
63284
63269
|
}
|
|
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;
|
|
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;
|
|
63287
63272
|
var OFFICE_SETTINGS = /<xml\b[^>]*>[\s\S]*?<\/xml>/gi;
|
|
63288
63273
|
function resolveMsoBranch(html3) {
|
|
63289
63274
|
return html3.replace(DOWNLEVEL_REVEALED, "").replace(DOWNLEVEL_HIDDEN, "$1").replace(OFFICE_SETTINGS, "");
|
|
@@ -63710,7 +63695,7 @@ function overrideStylesheetRules($3, faces) {
|
|
|
63710
63695
|
if ($3(el2).closest("body").length && !/font-family/i.test((_a22 = $3(el2).attr("style")) != null ? _a22 : ""))
|
|
63711
63696
|
override(el2, `font-family:${family}!important`);
|
|
63712
63697
|
$3("style").each((_3, block) => {
|
|
63713
|
-
var _a32, _b
|
|
63698
|
+
var _a32, _b;
|
|
63714
63699
|
for (const { selector, body } of topLevelRules((_a32 = $3(block).html()) != null ? _a32 : "")) {
|
|
63715
63700
|
const props = parseInlineStyle(body.replace(/!important/gi, ""));
|
|
63716
63701
|
const hasPadding = PADDING.some((prop2) => props.has(prop2));
|
|
@@ -63728,9 +63713,6 @@ function overrideStylesheetRules($3, faces) {
|
|
|
63728
63713
|
}
|
|
63729
63714
|
for (const el2 of matched) {
|
|
63730
63715
|
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
63716
|
if (hasPadding && (tag === "div" || tag === "p" || tag === "span" || tag === "a"))
|
|
63735
63717
|
override(el2, "padding:0!important");
|
|
63736
63718
|
if (hasSize && (tag === "div" || tag === "span")) {
|
|
@@ -63747,8 +63729,8 @@ function overrideStylesheetRules($3, faces) {
|
|
|
63747
63729
|
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
63730
|
var dropUnknown = (declarations) => declarations.replace(UNKNOWN_TO_WORD, "");
|
|
63749
63731
|
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) => {
|
|
63732
|
+
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;
|
|
63733
|
+
return html3.replace(/\sbgcolor\s*=\s*(["']?)#[0-9a-f]{3}\1(?=[\s>/])/gi, "").replace(/(\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi, (whole, lead, dq, sq) => {
|
|
63752
63734
|
var _a22;
|
|
63753
63735
|
const style = (_a22 = dq != null ? dq : sq) != null ? _a22 : "";
|
|
63754
63736
|
const kept = dropUnknown(style);
|
|
@@ -63766,7 +63748,7 @@ function dropWordUnknownColors(html3) {
|
|
|
63766
63748
|
function markHiddenCells(html3) {
|
|
63767
63749
|
if (!/display\s*:\s*none/i.test(html3)) return html3;
|
|
63768
63750
|
return html3.replace(
|
|
63769
|
-
/(<(?:td|th|tr|span)\b[^>]*?\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi,
|
|
63751
|
+
/(<(?:td|th|tr|span|div|table)\b[^>]*?\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi,
|
|
63770
63752
|
(whole, lead, dq, sq) => {
|
|
63771
63753
|
var _a22;
|
|
63772
63754
|
const style = (_a22 = dq != null ? dq : sq) != null ? _a22 : "";
|
|
@@ -63904,10 +63886,12 @@ function applyWordBoxModel($3) {
|
|
|
63904
63886
|
var _a22;
|
|
63905
63887
|
const el2 = node;
|
|
63906
63888
|
const props = parseInlineStyle($3(el2).attr("style") || "");
|
|
63889
|
+
const NUMBER = /^\d+(?:\.\d+)?$/;
|
|
63907
63890
|
const numeric = (name) => {
|
|
63908
|
-
|
|
63909
|
-
|
|
63910
|
-
|
|
63891
|
+
var _a32;
|
|
63892
|
+
const value = (_a32 = $3(el2).attr(name)) == null ? void 0 : _a32.trim();
|
|
63893
|
+
if (value !== void 0 && !NUMBER.test(value)) $3(el2).removeAttr(name);
|
|
63894
|
+
return value !== void 0 && NUMBER.test(value) ? String(Math.round(Number(value))) : void 0;
|
|
63911
63895
|
};
|
|
63912
63896
|
const width = numeric("width");
|
|
63913
63897
|
const height = numeric("height");
|
|
@@ -66481,17 +66465,42 @@ var SAMPLED_DARK = {
|
|
|
66481
66465
|
"gmail-ios": { eeeae4: "#4a4438" }
|
|
66482
66466
|
};
|
|
66483
66467
|
var hex = (c2) => "#" + [c2.r, c2.g, c2.b].map((v) => v.toString(16).padStart(2, "0")).join("");
|
|
66468
|
+
var APP_BACKGROUND = /* @__PURE__ */ new Set(["#ffffff", "#fefefe", "#fcfcfc", "#fbfbfb", "#f9f9f9"]);
|
|
66469
|
+
var D50 = [0.96422, 1, 0.82521];
|
|
66470
|
+
var TO_XYZ = [
|
|
66471
|
+
[0.4360747, 0.3850649, 0.1430804],
|
|
66472
|
+
[0.2225045, 0.7168786, 0.0606169],
|
|
66473
|
+
[0.0139322, 0.0971045, 0.7141733]
|
|
66474
|
+
];
|
|
66475
|
+
var FROM_XYZ = [
|
|
66476
|
+
[3.1338561, -1.6168667, -0.4906146],
|
|
66477
|
+
[-0.9787684, 1.9161415, 0.033454],
|
|
66478
|
+
[0.0719453, -0.2289914, 1.4052427]
|
|
66479
|
+
];
|
|
66480
|
+
var dot = (m2, v) => m2[0] * v[0] + m2[1] * v[1] + m2[2] * v[2];
|
|
66481
|
+
var labF = (t2) => t2 > 216 / 24389 ? Math.cbrt(t2) : 841 / 108 * t2 + 4 / 29;
|
|
66482
|
+
var labFInv = (t2) => t2 > 6 / 29 ? t2 ** 3 : 108 / 841 * (t2 - 4 / 29);
|
|
66483
|
+
function flipLabLightness(c2) {
|
|
66484
|
+
const linear = [c2.r, c2.g, c2.b].map((v) => {
|
|
66485
|
+
const s2 = v / 255;
|
|
66486
|
+
return s2 <= 0.04045 ? s2 / 12.92 : ((s2 + 0.055) / 1.055) ** 2.4;
|
|
66487
|
+
});
|
|
66488
|
+
const [fx, fy2, fz] = TO_XYZ.map((row, i2) => labF(dot(row, linear) / D50[i2]));
|
|
66489
|
+
const y3 = (Math.min(110 - (116 * fy2 - 16), 100) + 16) / 116;
|
|
66490
|
+
const xyz = [fx - fy2 + y3, y3, y3 - (fy2 - fz)].map((t2, i2) => labFInv(t2) * D50[i2]);
|
|
66491
|
+
const [r2, g3, b2] = FROM_XYZ.map((row) => {
|
|
66492
|
+
const v = Math.min(1, Math.max(0, dot(row, xyz)));
|
|
66493
|
+
return Math.round(255 * (v <= 31308e-7 ? 12.92 * v : 1.055 * v ** (1 / 2.4) - 0.055));
|
|
66494
|
+
});
|
|
66495
|
+
return hex({ r: r2, g: g3, b: b2 });
|
|
66496
|
+
}
|
|
66484
66497
|
function gmailAndroidColor(value, role) {
|
|
66485
66498
|
const parsed = parseColor(value);
|
|
66486
66499
|
if (!parsed || parsed.a === 0) return null;
|
|
66487
|
-
const
|
|
66488
|
-
if (role === "
|
|
66489
|
-
|
|
66490
|
-
|
|
66491
|
-
}
|
|
66492
|
-
const lifted = Math.min(1, 1.16 - 0.87 * L3);
|
|
66493
|
-
if (lifted <= L3) return null;
|
|
66494
|
-
return hex(oklabToRgb([lifted, A3 * 0.6, B2 * 0.6]));
|
|
66500
|
+
const brightness = (parsed.r * 299 + parsed.g * 587 + parsed.b * 114) / 1e3;
|
|
66501
|
+
if (role === "fg") return brightness < 150 ? flipLabLightness(parsed) : null;
|
|
66502
|
+
if (brightness <= 206) return null;
|
|
66503
|
+
return APP_BACKGROUND.has(hex(parsed)) ? "#121212" : flipLabLightness(parsed);
|
|
66495
66504
|
}
|
|
66496
66505
|
function invertColor(value, mode, clientId, role = "bg") {
|
|
66497
66506
|
var _a22;
|
package/dist/index.js
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
simulateDarkMode,
|
|
33
33
|
toFramework,
|
|
34
34
|
transformForAllClients
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-N2VVATK3.js";
|
|
36
36
|
import "./chunk-ABDTBRVK.js";
|
|
37
37
|
import "./chunk-2AP7CT6R.js";
|
|
38
38
|
import "./chunk-NXBRJX3V.js";
|
|
@@ -32902,21 +32902,6 @@ h1 {
|
|
|
32902
32902
|
0.0259040371 * l + 0.7827717662 * m - 0.808675766 * s
|
|
32903
32903
|
];
|
|
32904
32904
|
}
|
|
32905
|
-
function oklabToRgb([L, A, B]) {
|
|
32906
|
-
const l = (L + 0.3963377774 * A + 0.2158037573 * B) ** 3;
|
|
32907
|
-
const m = (L - 0.1055613458 * A - 0.0638541728 * B) ** 3;
|
|
32908
|
-
const s = (L - 0.0894841775 * A - 1.291485548 * B) ** 3;
|
|
32909
|
-
const toGamma = (c) => {
|
|
32910
|
-
const v = c <= 31308e-7 ? 12.92 * c : 1.055 * Math.pow(c, 1 / 2.4) - 0.055;
|
|
32911
|
-
return Math.round(Math.min(1, Math.max(0, v)) * 255);
|
|
32912
|
-
};
|
|
32913
|
-
return {
|
|
32914
|
-
r: toGamma(4.0767416621 * l - 3.3077115913 * m + 0.2309699292 * s),
|
|
32915
|
-
g: toGamma(-1.2684380046 * l + 2.6097574011 * m - 0.3413193965 * s),
|
|
32916
|
-
b: toGamma(-0.0041960863 * l - 0.7034186147 * m + 1.707662439 * s),
|
|
32917
|
-
a: 1
|
|
32918
|
-
};
|
|
32919
|
-
}
|
|
32920
32905
|
function colorDistance(a, b) {
|
|
32921
32906
|
const [l1, a1, b1] = rgbToOklab(a);
|
|
32922
32907
|
const [l2, a2, b2] = rgbToOklab(b);
|
|
@@ -33316,8 +33301,8 @@ h1 {
|
|
|
33316
33301
|
const shorter = Math.min(width, height);
|
|
33317
33302
|
return Math.min(shorter / 2, Math.max(0, pct) / 100 * shorter);
|
|
33318
33303
|
}
|
|
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;
|
|
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;
|
|
33321
33306
|
var OFFICE_SETTINGS = /<xml\b[^>]*>[\s\S]*?<\/xml>/gi;
|
|
33322
33307
|
function resolveMsoBranch(html) {
|
|
33323
33308
|
return html.replace(DOWNLEVEL_REVEALED, "").replace(DOWNLEVEL_HIDDEN, "$1").replace(OFFICE_SETTINGS, "");
|
|
@@ -33748,7 +33733,7 @@ h1 {
|
|
|
33748
33733
|
if ($(el).closest("body").length && !/font-family/i.test((_a2 = $(el).attr("style")) != null ? _a2 : ""))
|
|
33749
33734
|
override(el, `font-family:${family}!important`);
|
|
33750
33735
|
$("style").each((_, block) => {
|
|
33751
|
-
var _a3, _b
|
|
33736
|
+
var _a3, _b;
|
|
33752
33737
|
for (const { selector, body } of topLevelRules((_a3 = $(block).html()) != null ? _a3 : "")) {
|
|
33753
33738
|
const props = parseInlineStyle(body.replace(/!important/gi, ""));
|
|
33754
33739
|
const hasPadding = PADDING.some((prop) => props.has(prop));
|
|
@@ -33766,9 +33751,6 @@ h1 {
|
|
|
33766
33751
|
}
|
|
33767
33752
|
for (const el of matched) {
|
|
33768
33753
|
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
33754
|
if (hasPadding && (tag === "div" || tag === "p" || tag === "span" || tag === "a"))
|
|
33773
33755
|
override(el, "padding:0!important");
|
|
33774
33756
|
if (hasSize && (tag === "div" || tag === "span")) {
|
|
@@ -33785,8 +33767,8 @@ h1 {
|
|
|
33785
33767
|
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
33768
|
var dropUnknown = (declarations) => declarations.replace(UNKNOWN_TO_WORD, "");
|
|
33787
33769
|
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) => {
|
|
33770
|
+
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;
|
|
33771
|
+
return html.replace(/\sbgcolor\s*=\s*(["']?)#[0-9a-f]{3}\1(?=[\s>/])/gi, "").replace(/(\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi, (whole, lead, dq, sq) => {
|
|
33790
33772
|
var _a2;
|
|
33791
33773
|
const style = (_a2 = dq != null ? dq : sq) != null ? _a2 : "";
|
|
33792
33774
|
const kept = dropUnknown(style);
|
|
@@ -33804,7 +33786,7 @@ h1 {
|
|
|
33804
33786
|
function markHiddenCells(html) {
|
|
33805
33787
|
if (!/display\s*:\s*none/i.test(html)) return html;
|
|
33806
33788
|
return html.replace(
|
|
33807
|
-
/(<(?:td|th|tr|span)\b[^>]*?\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi,
|
|
33789
|
+
/(<(?:td|th|tr|span|div|table)\b[^>]*?\sstyle\s*=\s*)(?:"([^"]*)"|'([^']*)')/gi,
|
|
33808
33790
|
(whole, lead, dq, sq) => {
|
|
33809
33791
|
var _a2;
|
|
33810
33792
|
const style = (_a2 = dq != null ? dq : sq) != null ? _a2 : "";
|
|
@@ -33942,10 +33924,12 @@ h1 {
|
|
|
33942
33924
|
var _a2;
|
|
33943
33925
|
const el = node;
|
|
33944
33926
|
const props = parseInlineStyle($(el).attr("style") || "");
|
|
33927
|
+
const NUMBER = /^\d+(?:\.\d+)?$/;
|
|
33945
33928
|
const numeric = (name) => {
|
|
33946
|
-
|
|
33947
|
-
|
|
33948
|
-
|
|
33929
|
+
var _a3;
|
|
33930
|
+
const value = (_a3 = $(el).attr(name)) == null ? void 0 : _a3.trim();
|
|
33931
|
+
if (value !== void 0 && !NUMBER.test(value)) $(el).removeAttr(name);
|
|
33932
|
+
return value !== void 0 && NUMBER.test(value) ? String(Math.round(Number(value))) : void 0;
|
|
33949
33933
|
};
|
|
33950
33934
|
const width = numeric("width");
|
|
33951
33935
|
const height = numeric("height");
|
|
@@ -36569,17 +36553,42 @@ h1 {
|
|
|
36569
36553
|
"gmail-ios": { eeeae4: "#4a4438" }
|
|
36570
36554
|
};
|
|
36571
36555
|
var hex = (c) => "#" + [c.r, c.g, c.b].map((v) => v.toString(16).padStart(2, "0")).join("");
|
|
36556
|
+
var APP_BACKGROUND = /* @__PURE__ */ new Set(["#ffffff", "#fefefe", "#fcfcfc", "#fbfbfb", "#f9f9f9"]);
|
|
36557
|
+
var D50 = [0.96422, 1, 0.82521];
|
|
36558
|
+
var TO_XYZ = [
|
|
36559
|
+
[0.4360747, 0.3850649, 0.1430804],
|
|
36560
|
+
[0.2225045, 0.7168786, 0.0606169],
|
|
36561
|
+
[0.0139322, 0.0971045, 0.7141733]
|
|
36562
|
+
];
|
|
36563
|
+
var FROM_XYZ = [
|
|
36564
|
+
[3.1338561, -1.6168667, -0.4906146],
|
|
36565
|
+
[-0.9787684, 1.9161415, 0.033454],
|
|
36566
|
+
[0.0719453, -0.2289914, 1.4052427]
|
|
36567
|
+
];
|
|
36568
|
+
var dot = (m, v) => m[0] * v[0] + m[1] * v[1] + m[2] * v[2];
|
|
36569
|
+
var labF = (t) => t > 216 / 24389 ? Math.cbrt(t) : 841 / 108 * t + 4 / 29;
|
|
36570
|
+
var labFInv = (t) => t > 6 / 29 ? t ** 3 : 108 / 841 * (t - 4 / 29);
|
|
36571
|
+
function flipLabLightness(c) {
|
|
36572
|
+
const linear = [c.r, c.g, c.b].map((v) => {
|
|
36573
|
+
const s = v / 255;
|
|
36574
|
+
return s <= 0.04045 ? s / 12.92 : ((s + 0.055) / 1.055) ** 2.4;
|
|
36575
|
+
});
|
|
36576
|
+
const [fx, fy, fz] = TO_XYZ.map((row, i) => labF(dot(row, linear) / D50[i]));
|
|
36577
|
+
const y = (Math.min(110 - (116 * fy - 16), 100) + 16) / 116;
|
|
36578
|
+
const xyz = [fx - fy + y, y, y - (fy - fz)].map((t, i) => labFInv(t) * D50[i]);
|
|
36579
|
+
const [r, g, b] = FROM_XYZ.map((row) => {
|
|
36580
|
+
const v = Math.min(1, Math.max(0, dot(row, xyz)));
|
|
36581
|
+
return Math.round(255 * (v <= 31308e-7 ? 12.92 * v : 1.055 * v ** (1 / 2.4) - 0.055));
|
|
36582
|
+
});
|
|
36583
|
+
return hex({ r, g, b });
|
|
36584
|
+
}
|
|
36572
36585
|
function gmailAndroidColor(value, role) {
|
|
36573
36586
|
const parsed = parseColor(value);
|
|
36574
36587
|
if (!parsed || parsed.a === 0) return null;
|
|
36575
|
-
const
|
|
36576
|
-
if (role === "
|
|
36577
|
-
|
|
36578
|
-
|
|
36579
|
-
}
|
|
36580
|
-
const lifted = Math.min(1, 1.16 - 0.87 * L);
|
|
36581
|
-
if (lifted <= L) return null;
|
|
36582
|
-
return hex(oklabToRgb([lifted, A * 0.6, B * 0.6]));
|
|
36588
|
+
const brightness = (parsed.r * 299 + parsed.g * 587 + parsed.b * 114) / 1e3;
|
|
36589
|
+
if (role === "fg") return brightness < 150 ? flipLabLightness(parsed) : null;
|
|
36590
|
+
if (brightness <= 206) return null;
|
|
36591
|
+
return APP_BACKGROUND.has(hex(parsed)) ? "#121212" : flipLabLightness(parsed);
|
|
36583
36592
|
}
|
|
36584
36593
|
function invertColor(value, mode, clientId, role = "bg") {
|
|
36585
36594
|
var _a2;
|
|
@@ -42778,7 +42787,7 @@ Href: ${href}`
|
|
|
42778
42787
|
// package.json
|
|
42779
42788
|
var package_default = {
|
|
42780
42789
|
name: "@emailens/cli",
|
|
42781
|
-
version: "0.13.
|
|
42790
|
+
version: "0.13.5",
|
|
42782
42791
|
description: "CLI tool for email compatibility analysis: lint, preview and export HTML, MJML, Maizzle and React Email rendering across 21 email clients.",
|
|
42783
42792
|
type: "module",
|
|
42784
42793
|
bin: {
|
|
@@ -42819,7 +42828,7 @@ var package_default = {
|
|
|
42819
42828
|
},
|
|
42820
42829
|
devDependencies: {
|
|
42821
42830
|
"@anthropic-ai/sdk": "^0.52.0",
|
|
42822
|
-
"@emailens/engine": "^0.18.
|
|
42831
|
+
"@emailens/engine": "^0.18.7",
|
|
42823
42832
|
"@types/bun": "^1.4.0",
|
|
42824
42833
|
"@types/mjml": "^4.7.4",
|
|
42825
42834
|
"@types/node": "^25.9.5",
|
package/dist/test.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@emailens/cli",
|
|
3
|
-
"version": "0.13.
|
|
3
|
+
"version": "0.13.5",
|
|
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.
|
|
44
|
+
"@emailens/engine": "^0.18.7",
|
|
45
45
|
"@types/bun": "^1.4.0",
|
|
46
46
|
"@types/mjml": "^4.7.4",
|
|
47
47
|
"@types/node": "^25.9.5",
|