@emailens/cli 0.13.17 → 0.13.19
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 +207 -188
- package/dist/{chunk-ICIM22UE.js → chunk-J4YQYM4C.js} +683 -215
- package/dist/{chunk-ABDTBRVK.js → chunk-UN26YQF6.js} +6 -5
- package/dist/index.js +463 -145
- package/dist/{react-email-4EWH2SB4-CUKHMPBB.js → react-email-QQA75STN-LT3O7SQP.js} +1 -1
- package/dist/test.js +2 -2
- package/package.json +88 -84
|
@@ -7228,9 +7228,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
7228
7228
|
}
|
|
7229
7229
|
close(callback) {
|
|
7230
7230
|
if (callback === void 0) {
|
|
7231
|
-
return new Promise((
|
|
7231
|
+
return new Promise((resolve3, reject) => {
|
|
7232
7232
|
this.close((err, data2) => {
|
|
7233
|
-
return err ? reject(err) :
|
|
7233
|
+
return err ? reject(err) : resolve3(data2);
|
|
7234
7234
|
});
|
|
7235
7235
|
});
|
|
7236
7236
|
}
|
|
@@ -7268,9 +7268,9 @@ var require_dispatcher_base = __commonJS({
|
|
|
7268
7268
|
err = null;
|
|
7269
7269
|
}
|
|
7270
7270
|
if (callback === void 0) {
|
|
7271
|
-
return new Promise((
|
|
7271
|
+
return new Promise((resolve3, reject) => {
|
|
7272
7272
|
this.destroy(err, (err2, data2) => {
|
|
7273
|
-
return err2 ? reject(err2) :
|
|
7273
|
+
return err2 ? reject(err2) : resolve3(data2);
|
|
7274
7274
|
});
|
|
7275
7275
|
});
|
|
7276
7276
|
}
|
|
@@ -10776,8 +10776,8 @@ var require_promise = __commonJS({
|
|
|
10776
10776
|
function createDeferredPromise() {
|
|
10777
10777
|
let res;
|
|
10778
10778
|
let rej;
|
|
10779
|
-
const promise = new Promise((
|
|
10780
|
-
res =
|
|
10779
|
+
const promise = new Promise((resolve3, reject) => {
|
|
10780
|
+
res = resolve3;
|
|
10781
10781
|
rej = reject;
|
|
10782
10782
|
});
|
|
10783
10783
|
return { promise, resolve: res, reject: rej };
|
|
@@ -12186,12 +12186,12 @@ upgrade: ${upgrade}\r
|
|
|
12186
12186
|
cb();
|
|
12187
12187
|
}
|
|
12188
12188
|
}
|
|
12189
|
-
const waitForDrain = () => new Promise((
|
|
12189
|
+
const waitForDrain = () => new Promise((resolve3, reject) => {
|
|
12190
12190
|
assert(callback === null);
|
|
12191
12191
|
if (socket[kError]) {
|
|
12192
12192
|
reject(socket[kError]);
|
|
12193
12193
|
} else {
|
|
12194
|
-
callback =
|
|
12194
|
+
callback = resolve3;
|
|
12195
12195
|
}
|
|
12196
12196
|
});
|
|
12197
12197
|
socket.on("close", onDrain).on("drain", onDrain);
|
|
@@ -13075,12 +13075,12 @@ var require_client_h2 = __commonJS({
|
|
|
13075
13075
|
cb();
|
|
13076
13076
|
}
|
|
13077
13077
|
}
|
|
13078
|
-
const waitForDrain = () => new Promise((
|
|
13078
|
+
const waitForDrain = () => new Promise((resolve3, reject) => {
|
|
13079
13079
|
assert(callback === null);
|
|
13080
13080
|
if (socket[kError]) {
|
|
13081
13081
|
reject(socket[kError]);
|
|
13082
13082
|
} else {
|
|
13083
|
-
callback =
|
|
13083
|
+
callback = resolve3;
|
|
13084
13084
|
}
|
|
13085
13085
|
});
|
|
13086
13086
|
h2stream.on("close", onDrain).on("drain", onDrain);
|
|
@@ -13397,16 +13397,16 @@ var require_client = __commonJS({
|
|
|
13397
13397
|
return this[kNeedDrain] < 2;
|
|
13398
13398
|
}
|
|
13399
13399
|
[kClose]() {
|
|
13400
|
-
return new Promise((
|
|
13400
|
+
return new Promise((resolve3) => {
|
|
13401
13401
|
if (this[kSize]) {
|
|
13402
|
-
this[kClosedResolve] =
|
|
13402
|
+
this[kClosedResolve] = resolve3;
|
|
13403
13403
|
} else {
|
|
13404
|
-
|
|
13404
|
+
resolve3(null);
|
|
13405
13405
|
}
|
|
13406
13406
|
});
|
|
13407
13407
|
}
|
|
13408
13408
|
[kDestroy](err) {
|
|
13409
|
-
return new Promise((
|
|
13409
|
+
return new Promise((resolve3) => {
|
|
13410
13410
|
const requests = this[kQueue].splice(this[kPendingIdx]);
|
|
13411
13411
|
for (let i2 = 0; i2 < requests.length; i2++) {
|
|
13412
13412
|
const request = requests[i2];
|
|
@@ -13419,7 +13419,7 @@ var require_client = __commonJS({
|
|
|
13419
13419
|
this[kClosedResolve]();
|
|
13420
13420
|
this[kClosedResolve] = null;
|
|
13421
13421
|
}
|
|
13422
|
-
|
|
13422
|
+
resolve3(null);
|
|
13423
13423
|
};
|
|
13424
13424
|
if (this[kHTTPContext]) {
|
|
13425
13425
|
this[kHTTPContext].destroy(err, callback);
|
|
@@ -13826,8 +13826,8 @@ var require_pool_base = __commonJS({
|
|
|
13826
13826
|
}
|
|
13827
13827
|
return Promise.all(closeAll);
|
|
13828
13828
|
} else {
|
|
13829
|
-
return new Promise((
|
|
13830
|
-
this[kClosedResolve] =
|
|
13829
|
+
return new Promise((resolve3) => {
|
|
13830
|
+
this[kClosedResolve] = resolve3;
|
|
13831
13831
|
});
|
|
13832
13832
|
}
|
|
13833
13833
|
}
|
|
@@ -14949,7 +14949,7 @@ var require_socks5_proxy_agent = __commonJS({
|
|
|
14949
14949
|
const proxyHost = this[kProxyUrl].hostname;
|
|
14950
14950
|
const proxyPort = parseInt(this[kProxyUrl].port) || 1080;
|
|
14951
14951
|
debug("creating SOCKS5 connection to", proxyHost, proxyPort);
|
|
14952
|
-
const socket = await new Promise((
|
|
14952
|
+
const socket = await new Promise((resolve3, reject) => {
|
|
14953
14953
|
this[kConnector]({
|
|
14954
14954
|
hostname: proxyHost,
|
|
14955
14955
|
host: proxyHost,
|
|
@@ -14959,7 +14959,7 @@ var require_socks5_proxy_agent = __commonJS({
|
|
|
14959
14959
|
if (err) {
|
|
14960
14960
|
reject(err);
|
|
14961
14961
|
} else {
|
|
14962
|
-
|
|
14962
|
+
resolve3(socket2);
|
|
14963
14963
|
}
|
|
14964
14964
|
});
|
|
14965
14965
|
});
|
|
@@ -14969,14 +14969,14 @@ var require_socks5_proxy_agent = __commonJS({
|
|
|
14969
14969
|
socket.destroy();
|
|
14970
14970
|
});
|
|
14971
14971
|
await socks5Client.handshake();
|
|
14972
|
-
await new Promise((
|
|
14972
|
+
await new Promise((resolve3, reject) => {
|
|
14973
14973
|
const timeout = setTimeout(() => {
|
|
14974
14974
|
reject(new Error("SOCKS5 authentication timeout"));
|
|
14975
14975
|
}, 5e3);
|
|
14976
14976
|
const onAuthenticated = () => {
|
|
14977
14977
|
clearTimeout(timeout);
|
|
14978
14978
|
socks5Client.removeListener("error", onError);
|
|
14979
|
-
|
|
14979
|
+
resolve3();
|
|
14980
14980
|
};
|
|
14981
14981
|
const onError = (err) => {
|
|
14982
14982
|
clearTimeout(timeout);
|
|
@@ -14985,14 +14985,14 @@ var require_socks5_proxy_agent = __commonJS({
|
|
|
14985
14985
|
};
|
|
14986
14986
|
if (socks5Client.state === STATES.AUTHENTICATED) {
|
|
14987
14987
|
clearTimeout(timeout);
|
|
14988
|
-
|
|
14988
|
+
resolve3();
|
|
14989
14989
|
} else {
|
|
14990
14990
|
socks5Client.once("authenticated", onAuthenticated);
|
|
14991
14991
|
socks5Client.once("error", onError);
|
|
14992
14992
|
}
|
|
14993
14993
|
});
|
|
14994
14994
|
await socks5Client.connect(targetHost, targetPort);
|
|
14995
|
-
await new Promise((
|
|
14995
|
+
await new Promise((resolve3, reject) => {
|
|
14996
14996
|
const timeout = setTimeout(() => {
|
|
14997
14997
|
reject(new Error("SOCKS5 connection timeout"));
|
|
14998
14998
|
}, 5e3);
|
|
@@ -15000,7 +15000,7 @@ var require_socks5_proxy_agent = __commonJS({
|
|
|
15000
15000
|
debug("SOCKS5 tunnel established to", targetHost, targetPort, "via", info);
|
|
15001
15001
|
clearTimeout(timeout);
|
|
15002
15002
|
socks5Client.removeListener("error", onError);
|
|
15003
|
-
|
|
15003
|
+
resolve3();
|
|
15004
15004
|
};
|
|
15005
15005
|
const onError = (err) => {
|
|
15006
15006
|
clearTimeout(timeout);
|
|
@@ -15043,8 +15043,8 @@ var require_socks5_proxy_agent = __commonJS({
|
|
|
15043
15043
|
socket,
|
|
15044
15044
|
servername: this[kRequestTls]?.servername || targetHost
|
|
15045
15045
|
});
|
|
15046
|
-
await new Promise((
|
|
15047
|
-
finalSocket.once("secureConnect",
|
|
15046
|
+
await new Promise((resolve3, reject) => {
|
|
15047
|
+
finalSocket.once("secureConnect", resolve3);
|
|
15048
15048
|
finalSocket.once("error", reject);
|
|
15049
15049
|
});
|
|
15050
15050
|
}
|
|
@@ -16177,7 +16177,7 @@ var require_readable = __commonJS({
|
|
|
16177
16177
|
if (this._readableState.closeEmitted) {
|
|
16178
16178
|
return Promise.resolve(null);
|
|
16179
16179
|
}
|
|
16180
|
-
return new Promise((
|
|
16180
|
+
return new Promise((resolve3, reject) => {
|
|
16181
16181
|
if (this[kContentLength] && this[kContentLength] > limit || this[kBytesRead] > limit) {
|
|
16182
16182
|
this.destroy(new AbortError());
|
|
16183
16183
|
}
|
|
@@ -16191,11 +16191,11 @@ var require_readable = __commonJS({
|
|
|
16191
16191
|
if (signal.aborted) {
|
|
16192
16192
|
reject(signal.reason ?? new AbortError());
|
|
16193
16193
|
} else {
|
|
16194
|
-
|
|
16194
|
+
resolve3(null);
|
|
16195
16195
|
}
|
|
16196
16196
|
});
|
|
16197
16197
|
} else {
|
|
16198
|
-
this.on("close",
|
|
16198
|
+
this.on("close", resolve3);
|
|
16199
16199
|
}
|
|
16200
16200
|
this.on("error", noop).on("data", () => {
|
|
16201
16201
|
if (this[kBytesRead] > limit) {
|
|
@@ -16223,7 +16223,7 @@ var require_readable = __commonJS({
|
|
|
16223
16223
|
}
|
|
16224
16224
|
function consume(stream, type) {
|
|
16225
16225
|
assert(!stream[kConsume]);
|
|
16226
|
-
return new Promise((
|
|
16226
|
+
return new Promise((resolve3, reject) => {
|
|
16227
16227
|
if (isUnusable(stream)) {
|
|
16228
16228
|
const rState = stream._readableState;
|
|
16229
16229
|
if (rState.destroyed && rState.closeEmitted === false) {
|
|
@@ -16238,7 +16238,7 @@ var require_readable = __commonJS({
|
|
|
16238
16238
|
stream[kConsume] = {
|
|
16239
16239
|
type,
|
|
16240
16240
|
stream,
|
|
16241
|
-
resolve:
|
|
16241
|
+
resolve: resolve3,
|
|
16242
16242
|
reject,
|
|
16243
16243
|
length: 0,
|
|
16244
16244
|
body: []
|
|
@@ -16312,18 +16312,18 @@ var require_readable = __commonJS({
|
|
|
16312
16312
|
return buffer;
|
|
16313
16313
|
}
|
|
16314
16314
|
function consumeEnd(consume2, encoding) {
|
|
16315
|
-
const { type, body, resolve:
|
|
16315
|
+
const { type, body, resolve: resolve3, stream, length } = consume2;
|
|
16316
16316
|
try {
|
|
16317
16317
|
if (type === "text") {
|
|
16318
|
-
|
|
16318
|
+
resolve3(chunksDecode(body, length, encoding));
|
|
16319
16319
|
} else if (type === "json") {
|
|
16320
|
-
|
|
16320
|
+
resolve3(JSON.parse(chunksDecode(body, length, encoding)));
|
|
16321
16321
|
} else if (type === "arrayBuffer") {
|
|
16322
|
-
|
|
16322
|
+
resolve3(chunksConcat(body, length).buffer);
|
|
16323
16323
|
} else if (type === "blob") {
|
|
16324
|
-
|
|
16324
|
+
resolve3(new Blob(body, { type: stream[kContentType] }));
|
|
16325
16325
|
} else if (type === "bytes") {
|
|
16326
|
-
|
|
16326
|
+
resolve3(chunksConcat(body, length));
|
|
16327
16327
|
}
|
|
16328
16328
|
consumeFinish(consume2);
|
|
16329
16329
|
} catch (err) {
|
|
@@ -16513,9 +16513,9 @@ var require_api_request = __commonJS({
|
|
|
16513
16513
|
};
|
|
16514
16514
|
function request(opts, callback) {
|
|
16515
16515
|
if (callback === void 0) {
|
|
16516
|
-
return new Promise((
|
|
16516
|
+
return new Promise((resolve3, reject) => {
|
|
16517
16517
|
request.call(this, opts, (err, data2) => {
|
|
16518
|
-
return err ? reject(err) :
|
|
16518
|
+
return err ? reject(err) : resolve3(data2);
|
|
16519
16519
|
});
|
|
16520
16520
|
});
|
|
16521
16521
|
}
|
|
@@ -16727,9 +16727,9 @@ var require_api_stream = __commonJS({
|
|
|
16727
16727
|
};
|
|
16728
16728
|
function stream(opts, factory, callback) {
|
|
16729
16729
|
if (callback === void 0) {
|
|
16730
|
-
return new Promise((
|
|
16730
|
+
return new Promise((resolve3, reject) => {
|
|
16731
16731
|
stream.call(this, opts, factory, (err, data2) => {
|
|
16732
|
-
return err ? reject(err) :
|
|
16732
|
+
return err ? reject(err) : resolve3(data2);
|
|
16733
16733
|
});
|
|
16734
16734
|
});
|
|
16735
16735
|
}
|
|
@@ -17017,9 +17017,9 @@ var require_api_upgrade = __commonJS({
|
|
|
17017
17017
|
};
|
|
17018
17018
|
function upgrade(opts, callback) {
|
|
17019
17019
|
if (callback === void 0) {
|
|
17020
|
-
return new Promise((
|
|
17020
|
+
return new Promise((resolve3, reject) => {
|
|
17021
17021
|
upgrade.call(this, opts, (err, data2) => {
|
|
17022
|
-
return err ? reject(err) :
|
|
17022
|
+
return err ? reject(err) : resolve3(data2);
|
|
17023
17023
|
});
|
|
17024
17024
|
});
|
|
17025
17025
|
}
|
|
@@ -17112,9 +17112,9 @@ var require_api_connect = __commonJS({
|
|
|
17112
17112
|
};
|
|
17113
17113
|
function connect(opts, callback) {
|
|
17114
17114
|
if (callback === void 0) {
|
|
17115
|
-
return new Promise((
|
|
17115
|
+
return new Promise((resolve3, reject) => {
|
|
17116
17116
|
connect.call(this, opts, (err, data2) => {
|
|
17117
|
-
return err ? reject(err) :
|
|
17117
|
+
return err ? reject(err) : resolve3(data2);
|
|
17118
17118
|
});
|
|
17119
17119
|
});
|
|
17120
17120
|
}
|
|
@@ -18388,7 +18388,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
18388
18388
|
"node_modules/undici/lib/mock/snapshot-recorder.js"(exports, module) {
|
|
18389
18389
|
"use strict";
|
|
18390
18390
|
var { writeFile, readFile, mkdir } = __require("fs/promises");
|
|
18391
|
-
var { dirname:
|
|
18391
|
+
var { dirname: dirname3, resolve: resolve3 } = __require("path");
|
|
18392
18392
|
var { setTimeout: setTimeout2, clearTimeout: clearTimeout2 } = __require("timers");
|
|
18393
18393
|
var { InvalidArgumentError, UndiciError } = require_errors();
|
|
18394
18394
|
var { hashId, isUrlExcludedFactory, normalizeHeaders, createHeaderFilters } = require_snapshot_utils();
|
|
@@ -18589,7 +18589,7 @@ var require_snapshot_recorder = __commonJS({
|
|
|
18589
18589
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
18590
18590
|
}
|
|
18591
18591
|
try {
|
|
18592
|
-
const data2 = await readFile(
|
|
18592
|
+
const data2 = await readFile(resolve3(path), "utf8");
|
|
18593
18593
|
const parsed = JSON.parse(data2);
|
|
18594
18594
|
if (Array.isArray(parsed)) {
|
|
18595
18595
|
this.#snapshots.clear();
|
|
@@ -18618,8 +18618,8 @@ var require_snapshot_recorder = __commonJS({
|
|
|
18618
18618
|
if (!path) {
|
|
18619
18619
|
throw new InvalidArgumentError("Snapshot path is required");
|
|
18620
18620
|
}
|
|
18621
|
-
const resolvedPath =
|
|
18622
|
-
await mkdir(
|
|
18621
|
+
const resolvedPath = resolve3(path);
|
|
18622
|
+
await mkdir(dirname3(resolvedPath), { recursive: true });
|
|
18623
18623
|
const data2 = Array.from(this.#snapshots.entries()).map(([hash, snapshot]) => ({
|
|
18624
18624
|
hash,
|
|
18625
18625
|
snapshot
|
|
@@ -25416,7 +25416,7 @@ var require_fetch = __commonJS({
|
|
|
25416
25416
|
function handleFetchDone(response) {
|
|
25417
25417
|
finalizeAndReportTiming(response, "fetch");
|
|
25418
25418
|
}
|
|
25419
|
-
function
|
|
25419
|
+
function fetch3(input, init2 = void 0) {
|
|
25420
25420
|
webidl.argumentLengthCheck(arguments, 1, "globalThis.fetch");
|
|
25421
25421
|
let p = createDeferredPromise();
|
|
25422
25422
|
let requestObject;
|
|
@@ -26268,7 +26268,7 @@ var require_fetch = __commonJS({
|
|
|
26268
26268
|
const agent = fetchParams.controller.dispatcher;
|
|
26269
26269
|
const path = url.pathname + url.search;
|
|
26270
26270
|
const hasTrailingQuestionMark = url.search.length === 0 && url.href[url.href.length - url.hash.length - 1] === "?";
|
|
26271
|
-
return new Promise((
|
|
26271
|
+
return new Promise((resolve3, reject) => agent.dispatch(
|
|
26272
26272
|
{
|
|
26273
26273
|
path: hasTrailingQuestionMark ? `${path}?` : path,
|
|
26274
26274
|
origin: url.origin,
|
|
@@ -26356,7 +26356,7 @@ var require_fetch = __commonJS({
|
|
|
26356
26356
|
}
|
|
26357
26357
|
this.body = new Readable({ read: resume });
|
|
26358
26358
|
const onError = this.onError.bind(this);
|
|
26359
|
-
|
|
26359
|
+
resolve3({
|
|
26360
26360
|
status,
|
|
26361
26361
|
statusText,
|
|
26362
26362
|
headersList,
|
|
@@ -26409,7 +26409,7 @@ var require_fetch = __commonJS({
|
|
|
26409
26409
|
headersList.append(headerName, String(value), true);
|
|
26410
26410
|
}
|
|
26411
26411
|
}
|
|
26412
|
-
|
|
26412
|
+
resolve3({
|
|
26413
26413
|
status,
|
|
26414
26414
|
statusText: STATUS_CODES[status],
|
|
26415
26415
|
headersList,
|
|
@@ -26433,7 +26433,7 @@ var require_fetch = __commonJS({
|
|
|
26433
26433
|
headersList.append(nameStr, value.toString("latin1"), true);
|
|
26434
26434
|
}
|
|
26435
26435
|
}
|
|
26436
|
-
|
|
26436
|
+
resolve3({
|
|
26437
26437
|
status,
|
|
26438
26438
|
statusText: STATUS_CODES[status],
|
|
26439
26439
|
headersList,
|
|
@@ -26446,7 +26446,7 @@ var require_fetch = __commonJS({
|
|
|
26446
26446
|
}
|
|
26447
26447
|
}
|
|
26448
26448
|
module.exports = {
|
|
26449
|
-
fetch:
|
|
26449
|
+
fetch: fetch3,
|
|
26450
26450
|
Fetch,
|
|
26451
26451
|
fetching,
|
|
26452
26452
|
finalizeAndReportTiming
|
|
@@ -30700,7 +30700,7 @@ var require_undici = __commonJS({
|
|
|
30700
30700
|
err.stack = stack ? `${stack}
|
|
30701
30701
|
${captureLines}` : capture.stack;
|
|
30702
30702
|
}
|
|
30703
|
-
module.exports.fetch = function
|
|
30703
|
+
module.exports.fetch = function fetch3(init2, options = void 0) {
|
|
30704
30704
|
return fetchImpl(init2, options).catch((err) => {
|
|
30705
30705
|
if (currentFilename) {
|
|
30706
30706
|
appendFetchStackTrace(err, currentFilename);
|
|
@@ -38682,11 +38682,11 @@ function getAtomFeed(feedRoot) {
|
|
|
38682
38682
|
if (href2) {
|
|
38683
38683
|
entry.link = href2;
|
|
38684
38684
|
}
|
|
38685
|
-
const description =
|
|
38685
|
+
const description = fetch2("summary", children2) || fetch2("content", children2);
|
|
38686
38686
|
if (description) {
|
|
38687
38687
|
entry.description = description;
|
|
38688
38688
|
}
|
|
38689
|
-
const pubDate =
|
|
38689
|
+
const pubDate = fetch2("updated", children2);
|
|
38690
38690
|
if (pubDate) {
|
|
38691
38691
|
entry.pubDate = new Date(pubDate);
|
|
38692
38692
|
}
|
|
@@ -38700,7 +38700,7 @@ function getAtomFeed(feedRoot) {
|
|
|
38700
38700
|
feed.link = href;
|
|
38701
38701
|
}
|
|
38702
38702
|
addConditionally(feed, "description", "subtitle", childs);
|
|
38703
|
-
const updated =
|
|
38703
|
+
const updated = fetch2("updated", childs);
|
|
38704
38704
|
if (updated) {
|
|
38705
38705
|
feed.updated = new Date(updated);
|
|
38706
38706
|
}
|
|
@@ -38720,7 +38720,7 @@ function getRssFeed(feedRoot) {
|
|
|
38720
38720
|
addConditionally(entry, "title", "title", children2);
|
|
38721
38721
|
addConditionally(entry, "link", "link", children2);
|
|
38722
38722
|
addConditionally(entry, "description", "description", children2);
|
|
38723
|
-
const pubDate =
|
|
38723
|
+
const pubDate = fetch2("pubDate", children2) || fetch2("dc:date", children2);
|
|
38724
38724
|
if (pubDate)
|
|
38725
38725
|
entry.pubDate = new Date(pubDate);
|
|
38726
38726
|
return entry;
|
|
@@ -38729,7 +38729,7 @@ function getRssFeed(feedRoot) {
|
|
|
38729
38729
|
addConditionally(feed, "title", "title", childs);
|
|
38730
38730
|
addConditionally(feed, "link", "link", childs);
|
|
38731
38731
|
addConditionally(feed, "description", "description", childs);
|
|
38732
|
-
const updated =
|
|
38732
|
+
const updated = fetch2("lastBuildDate", childs);
|
|
38733
38733
|
if (updated) {
|
|
38734
38734
|
feed.updated = new Date(updated);
|
|
38735
38735
|
}
|
|
@@ -38773,11 +38773,11 @@ function getMediaElements(where) {
|
|
|
38773
38773
|
function getOneElement(tagName2, node) {
|
|
38774
38774
|
return getElementsByTagName(tagName2, node, true, 1)[0];
|
|
38775
38775
|
}
|
|
38776
|
-
function
|
|
38776
|
+
function fetch2(tagName2, where, recurse = false) {
|
|
38777
38777
|
return textContent(getElementsByTagName(tagName2, where, recurse, 1)).trim();
|
|
38778
38778
|
}
|
|
38779
38779
|
function addConditionally(obj, prop2, tagName2, where, recurse = false) {
|
|
38780
|
-
const val2 =
|
|
38780
|
+
const val2 = fetch2(tagName2, where, recurse);
|
|
38781
38781
|
if (val2)
|
|
38782
38782
|
obj[prop2] = val2;
|
|
38783
38783
|
}
|
|
@@ -53845,7 +53845,7 @@ var CSS_SUPPORT_TABLE = {
|
|
|
53845
53845
|
"outlook-macos": "supported",
|
|
53846
53846
|
"apple-mail-macos": "supported",
|
|
53847
53847
|
"apple-mail-ios": "supported",
|
|
53848
|
-
"yahoo-mail": "
|
|
53848
|
+
"yahoo-mail": "partial",
|
|
53849
53849
|
"yahoo-mail-android": "supported",
|
|
53850
53850
|
"yahoo-mail-ios": "supported",
|
|
53851
53851
|
"samsung-mail": "supported",
|
|
@@ -56808,12 +56808,12 @@ var CSS_SUPPORT_TABLE = {
|
|
|
56808
56808
|
"outlook-windows": "unsupported",
|
|
56809
56809
|
"outlook-windows-legacy": "unsupported",
|
|
56810
56810
|
"outlook-ios": "unsupported",
|
|
56811
|
-
"outlook-android": "
|
|
56811
|
+
"outlook-android": "supported",
|
|
56812
56812
|
"outlook-macos": "unsupported",
|
|
56813
56813
|
"apple-mail-macos": "supported",
|
|
56814
56814
|
"apple-mail-ios": "supported",
|
|
56815
|
-
"yahoo-mail": "
|
|
56816
|
-
"yahoo-mail-android": "
|
|
56815
|
+
"yahoo-mail": "unsupported",
|
|
56816
|
+
"yahoo-mail-android": "unsupported",
|
|
56817
56817
|
"yahoo-mail-ios": "supported",
|
|
56818
56818
|
"samsung-mail": "supported",
|
|
56819
56819
|
"thunderbird": "supported",
|
|
@@ -57406,12 +57406,12 @@ var CSS_SUPPORT_TABLE = {
|
|
|
57406
57406
|
"outlook-windows": "supported",
|
|
57407
57407
|
"outlook-windows-legacy": "unsupported",
|
|
57408
57408
|
"outlook-ios": "supported",
|
|
57409
|
-
"outlook-android": "
|
|
57409
|
+
"outlook-android": "unsupported",
|
|
57410
57410
|
"outlook-macos": "supported",
|
|
57411
57411
|
"apple-mail-macos": "supported",
|
|
57412
57412
|
"apple-mail-ios": "supported",
|
|
57413
|
-
"yahoo-mail": "
|
|
57414
|
-
"yahoo-mail-android": "
|
|
57413
|
+
"yahoo-mail": "unsupported",
|
|
57414
|
+
"yahoo-mail-android": "unsupported",
|
|
57415
57415
|
"yahoo-mail-ios": "supported",
|
|
57416
57416
|
"samsung-mail": "supported",
|
|
57417
57417
|
"thunderbird": "supported",
|
|
@@ -58929,7 +58929,7 @@ var CSS_SUPPORT_NOTES = {
|
|
|
58929
58929
|
"gmail-android": ["Partial. Not supported with non Google accounts. But it can be used in the `background` shorthand property instead."],
|
|
58930
58930
|
"gmail-ios": ["Partial. Not supported with non Google accounts. But it can be used in the `background` shorthand property instead."],
|
|
58931
58931
|
"outlook-windows-legacy": ["Background images size can be used in VML with the `size` attribute. See [VML documentation](https://docs.microsoft.com/en-us/windows/win32/vml/size-attribute--fill--vml)."],
|
|
58932
|
-
"yahoo-mail": ["Partial.
|
|
58932
|
+
"yahoo-mail": ["Observed 2026-11-09 (Emailens real-device checks, Yahoo Mail web (Chrome): foodpanda campaign (2026-10-28), AliExpress (2026-11-09)): Partial. Ignored inside the background shorthand (`background: url() 0 0 / cover`): the image draws at its natural size. The background-size property written on its own works."],
|
|
58933
58933
|
"yahoo-mail-android": ["Partial. Does not support multiple values. The comma between two values is removed."],
|
|
58934
58934
|
"yahoo-mail-ios": ["Partial. Does not support multiple values. The comma between two values is removed."],
|
|
58935
58935
|
"aol": ["Partial. Does not support multiple values. The comma between two values is removed."]
|
|
@@ -59411,7 +59411,10 @@ var CSS_SUPPORT_NOTES = {
|
|
|
59411
59411
|
"gmail-ios": ["Partial. Not supported with non Google accounts."]
|
|
59412
59412
|
},
|
|
59413
59413
|
"text-shadow": {
|
|
59414
|
-
"outlook-web": ["Observed 2026-10-14 (Emailens real-device probe, Outlook.com (Chrome)): A red text-shadow rendered behind bold text."]
|
|
59414
|
+
"outlook-web": ["Observed 2026-10-14 (Emailens real-device probe, Outlook.com (Chrome)): A red text-shadow rendered behind bold text."],
|
|
59415
|
+
"outlook-android": ["Observed 2026-11-08 (Emailens probe sheets 20-22, the Outlook Android app, our own seed inbox): A green text-shadow drew behind the text."],
|
|
59416
|
+
"yahoo-mail": ["Observed 2026-11-08 (Emailens probe sheets 20-22, Yahoo Mail web (Chrome), our own seed inbox): A green text-shadow did not draw; the text rendered plain."],
|
|
59417
|
+
"yahoo-mail-android": ["Observed 2026-11-08 (Emailens probe sheets 20-22, the Yahoo Mail Android app, our own seed inbox): A green text-shadow did not draw; the text rendered plain."]
|
|
59415
59418
|
},
|
|
59416
59419
|
"text-transform": {
|
|
59417
59420
|
"outlook-windows-legacy": ["Partial. `lowercase` value is not supported."]
|
|
@@ -59465,9 +59468,12 @@ var CSS_SUPPORT_NOTES = {
|
|
|
59465
59468
|
},
|
|
59466
59469
|
"visibility": {
|
|
59467
59470
|
"outlook-ios": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
|
|
59471
|
+
"outlook-android": ["Observed 2026-11-08 (Emailens probe sheets 20-22, the Outlook Android app, our own seed inbox): An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."],
|
|
59468
59472
|
"outlook-macos": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
|
|
59469
59473
|
"apple-mail-macos": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
|
|
59470
59474
|
"apple-mail-ios": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
|
|
59475
|
+
"yahoo-mail": ["Observed 2026-11-08 (Emailens probe sheets 20-22, Yahoo Mail web (Chrome), our own seed inbox): An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."],
|
|
59476
|
+
"yahoo-mail-android": ["Observed 2026-11-08 (Emailens probe sheets 20-22, the Yahoo Mail Android app, our own seed inbox): An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."],
|
|
59471
59477
|
"yahoo-mail-ios": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.'],
|
|
59472
59478
|
"protonmail": ['Buggy. `visibility:collapse` applied to a `<tr>` only hides content and does not "remove" it from layout.']
|
|
59473
59479
|
},
|
|
@@ -63661,6 +63667,13 @@ var capBorder = (value) => value.replace(
|
|
|
63661
63667
|
(whole, n2) => Number(n2) > MAX_BORDER_PX ? `${MAX_BORDER_PX}px` : whole
|
|
63662
63668
|
);
|
|
63663
63669
|
var flattenMargin = (value) => value.split(/\s+/).map((part) => part === "auto" || /^-/.test(part) ? "0" : part).join(" ");
|
|
63670
|
+
var flattenDivMargin = (prop2, value) => {
|
|
63671
|
+
if (prop2 === "margin-left" || prop2 === "margin-right") return value.trim() === "auto" ? "0" : value;
|
|
63672
|
+
if (prop2 !== "margin") return flattenMargin(value);
|
|
63673
|
+
const parts = value.trim().split(/\s+/);
|
|
63674
|
+
const vertical = (i2) => i2 === 0 || i2 === 2 && parts.length >= 3;
|
|
63675
|
+
return parts.map((part, i2) => part === "auto" || /^-/.test(part) && vertical(i2) ? "0" : part).join(" ");
|
|
63676
|
+
};
|
|
63664
63677
|
function holdsNoText($3, el2) {
|
|
63665
63678
|
const own = $3(el2).clone();
|
|
63666
63679
|
own.find("table").remove();
|
|
@@ -63943,7 +63956,7 @@ function applyWordBoxModel($3) {
|
|
|
63943
63956
|
if (tag === "div" || tag === "table") {
|
|
63944
63957
|
for (const prop2 of MARGIN) {
|
|
63945
63958
|
const value = props.get(prop2);
|
|
63946
|
-
if (value !== void 0) props.set(prop2, flattenMargin(value));
|
|
63959
|
+
if (value !== void 0) props.set(prop2, tag === "div" ? flattenDivMargin(prop2, value) : flattenMargin(value));
|
|
63947
63960
|
}
|
|
63948
63961
|
if (tag === "table" && /center/i.test((_f = $3(el2).attr("align")) != null ? _f : "")) {
|
|
63949
63962
|
props.delete("margin-top");
|
|
@@ -65045,7 +65058,7 @@ var TARGETING_HACKS = [
|
|
|
65045
65058
|
"notes": ""
|
|
65046
65059
|
}
|
|
65047
65060
|
];
|
|
65048
|
-
var GMAIL_WRAPPER_SELECTOR = /(?:^|[\s>~+(])u\s*\+\s*([.#][\w-]+)/i;
|
|
65061
|
+
var GMAIL_WRAPPER_SELECTOR = /(?:^|[\s>~+(,{}])u\s*\+\s*([.#][\w-]+)/i;
|
|
65049
65062
|
var TARGETING_MATCHERS = [
|
|
65050
65063
|
{
|
|
65051
65064
|
id: "gmail-android-div-u-body",
|
|
@@ -65483,6 +65496,160 @@ function applyTargetingSimulation($3, clientId) {
|
|
|
65483
65496
|
body.append($3("<div></div>").append("<u></u>").append(inner));
|
|
65484
65497
|
}
|
|
65485
65498
|
}
|
|
65499
|
+
var RUN = "2026-10-14";
|
|
65500
|
+
var seen = (level, source, note) => ({
|
|
65501
|
+
level,
|
|
65502
|
+
observed: RUN,
|
|
65503
|
+
source,
|
|
65504
|
+
note
|
|
65505
|
+
});
|
|
65506
|
+
var newOutlookMac = (level, note) => ({
|
|
65507
|
+
level,
|
|
65508
|
+
observed: "2026-10-27",
|
|
65509
|
+
source: "Emailens probe sheets 20-22, the new Outlook for Mac",
|
|
65510
|
+
note
|
|
65511
|
+
});
|
|
65512
|
+
var yahooWeb = (level, note) => ({
|
|
65513
|
+
level,
|
|
65514
|
+
observed: "2026-10-27",
|
|
65515
|
+
source: "Emailens probe, Yahoo Mail web (Chrome), real-device run E8fVpFwwLtL8",
|
|
65516
|
+
note
|
|
65517
|
+
});
|
|
65518
|
+
var gmailWeb = (level, note) => ({
|
|
65519
|
+
level,
|
|
65520
|
+
observed: "2026-10-28",
|
|
65521
|
+
source: "Emailens probe, Gmail web (Chrome), real-device run 1isFNBBaOyEo",
|
|
65522
|
+
note
|
|
65523
|
+
});
|
|
65524
|
+
var worker = (level, source, note) => ({
|
|
65525
|
+
level,
|
|
65526
|
+
observed: "2026-11-08",
|
|
65527
|
+
source: `Emailens probe sheets 20-22, ${source}, our own seed inbox`,
|
|
65528
|
+
note
|
|
65529
|
+
});
|
|
65530
|
+
var OBSERVED_OVERRIDES = {
|
|
65531
|
+
// Email Geeks #email-code, 2026-10-29: "Yahoo strips action and formaction".
|
|
65532
|
+
// Six forms sent to our Yahoo seed; the delivered HTML had neither.
|
|
65533
|
+
"<form>": {
|
|
65534
|
+
"yahoo-mail": {
|
|
65535
|
+
level: "unsupported",
|
|
65536
|
+
observed: "2026-10-29",
|
|
65537
|
+
source: "Emailens probe, Yahoo Mail web (Chrome), our own seed inbox",
|
|
65538
|
+
note: 'The form is kept but its `action` is removed (absolute, relative and empty alike), and so is `formaction` on a button; Yahoo adds `target="_blank"`. The form cannot reach your server: link to a landing page instead. `type="email"` is also dropped from inputs; `method`, text, radio and submit inputs are kept.'
|
|
65539
|
+
}
|
|
65540
|
+
},
|
|
65541
|
+
// display:flex holds and so does width; the item sizing does not. A label
|
|
65542
|
+
// column at `flex:0 0 34%` beside a paragraph collapsed to a letter wide.
|
|
65543
|
+
flex: {
|
|
65544
|
+
"yahoo-mail": yahooWeb(
|
|
65545
|
+
"unsupported",
|
|
65546
|
+
"The `flex` shorthand is dropped: an item at `flex:0 0 34%` shrank to its narrowest, breaking words letter by letter. Size flex items with `width` (and `flex-shrink:0`), or use a table."
|
|
65547
|
+
),
|
|
65548
|
+
"gmail-web": gmailWeb(
|
|
65549
|
+
"unsupported",
|
|
65550
|
+
"The `flex` shorthand is dropped: an item at `flex:0 0 34%` lost its 34% and sized to its content. `width:34%` on the same item held, and so did a table."
|
|
65551
|
+
)
|
|
65552
|
+
},
|
|
65553
|
+
"flex-basis": {
|
|
65554
|
+
"yahoo-mail": yahooWeb(
|
|
65555
|
+
"unsupported",
|
|
65556
|
+
"Dropped, with flex-grow and flex-shrink beside it: the item sized to its content instead of 34%. `width:34%` on the same item held."
|
|
65557
|
+
),
|
|
65558
|
+
"gmail-web": gmailWeb(
|
|
65559
|
+
"unsupported",
|
|
65560
|
+
"Dropped, with flex-grow and flex-shrink beside it: the item sized to its content instead of 34%. `width:34%` on the same item held."
|
|
65561
|
+
)
|
|
65562
|
+
},
|
|
65563
|
+
// caniemail 16.80 says not supported; plain track lists are kept and the
|
|
65564
|
+
// functions dropped, twice over two runs.
|
|
65565
|
+
"grid-template-columns": {
|
|
65566
|
+
"outlook-macos": newOutlookMac(
|
|
65567
|
+
"partial",
|
|
65568
|
+
"Plain track sizes work (`300px 300px`, `1fr 1fr`); a value with `repeat()` or `minmax()` is dropped, so the grid falls back to one column."
|
|
65569
|
+
)
|
|
65570
|
+
},
|
|
65571
|
+
// Sheet 20 case 30: an orange block at visibility:hidden over a green cell
|
|
65572
|
+
// stayed orange. Gmail web, on the same sheet, hid it.
|
|
65573
|
+
visibility: {
|
|
65574
|
+
"yahoo-mail": worker(
|
|
65575
|
+
"unsupported",
|
|
65576
|
+
"Yahoo Mail web (Chrome)",
|
|
65577
|
+
"An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."
|
|
65578
|
+
),
|
|
65579
|
+
"yahoo-mail-android": worker(
|
|
65580
|
+
"unsupported",
|
|
65581
|
+
"the Yahoo Mail Android app",
|
|
65582
|
+
"An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."
|
|
65583
|
+
),
|
|
65584
|
+
"outlook-android": worker(
|
|
65585
|
+
"unsupported",
|
|
65586
|
+
"the Outlook Android app",
|
|
65587
|
+
"An element at `visibility:hidden` stayed visible. Use `display:none` (or remove the element) to hide it."
|
|
65588
|
+
)
|
|
65589
|
+
},
|
|
65590
|
+
"box-shadow": {
|
|
65591
|
+
"yahoo-mail": seen(
|
|
65592
|
+
"supported",
|
|
65593
|
+
"Emailens real-device probe, Yahoo Mail (Chrome)",
|
|
65594
|
+
"A box-shadow on a table cell rendered with its offset and colour."
|
|
65595
|
+
)
|
|
65596
|
+
},
|
|
65597
|
+
// Sheet 22 case 13: a green text-shadow drew in Gmail and Outlook Android,
|
|
65598
|
+
// not in either Yahoo.
|
|
65599
|
+
"text-shadow": {
|
|
65600
|
+
"yahoo-mail": worker(
|
|
65601
|
+
"unsupported",
|
|
65602
|
+
"Yahoo Mail web (Chrome)",
|
|
65603
|
+
"A green text-shadow did not draw; the text rendered plain."
|
|
65604
|
+
),
|
|
65605
|
+
"yahoo-mail-android": worker(
|
|
65606
|
+
"unsupported",
|
|
65607
|
+
"the Yahoo Mail Android app",
|
|
65608
|
+
"A green text-shadow did not draw; the text rendered plain."
|
|
65609
|
+
),
|
|
65610
|
+
"outlook-web": seen(
|
|
65611
|
+
"supported",
|
|
65612
|
+
"Emailens real-device probe, Outlook.com (Chrome)",
|
|
65613
|
+
"A red text-shadow rendered behind bold text."
|
|
65614
|
+
),
|
|
65615
|
+
"outlook-android": worker(
|
|
65616
|
+
"supported",
|
|
65617
|
+
"the Outlook Android app",
|
|
65618
|
+
"A green text-shadow drew behind the text."
|
|
65619
|
+
)
|
|
65620
|
+
},
|
|
65621
|
+
// foodpanda's logos and coupon on real Yahoo Mail web (2026-10-28): drawn
|
|
65622
|
+
// at their natural size, the size written inside the `background` shorthand
|
|
65623
|
+
// ignored (yahoo-background-size.test.ts). Written on its own it holds:
|
|
65624
|
+
// AliExpress's 29 product photos drew fitted (fidelity bench, 2026-11-09).
|
|
65625
|
+
"background-size": {
|
|
65626
|
+
"yahoo-mail": {
|
|
65627
|
+
level: "partial",
|
|
65628
|
+
observed: "2026-11-09",
|
|
65629
|
+
source: "Emailens real-device checks, Yahoo Mail web (Chrome): foodpanda campaign (2026-10-28), AliExpress (2026-11-09)",
|
|
65630
|
+
note: "Partial. Ignored inside the background shorthand (`background: url() 0 0 / cover`): the image draws at its natural size. The background-size property written on its own works."
|
|
65631
|
+
}
|
|
65632
|
+
},
|
|
65633
|
+
"text-decoration": {
|
|
65634
|
+
"apple-mail-macos": seen(
|
|
65635
|
+
"partial",
|
|
65636
|
+
"Emailens real-device probe, Apple Mail (macOS)",
|
|
65637
|
+
"The multi-value shorthand `text-decoration: underline wavy #d33` was dropped whole: no line at all. A single line value works; style and colour need -webkit-text-decoration."
|
|
65638
|
+
),
|
|
65639
|
+
"apple-mail-ios": seen(
|
|
65640
|
+
"partial",
|
|
65641
|
+
"Emailens real-device probe, Apple Mail (iPhone 13)",
|
|
65642
|
+
"The multi-value shorthand `text-decoration: underline wavy #d33` was dropped whole: no line at all. A single line value works; style and colour need -webkit-text-decoration."
|
|
65643
|
+
),
|
|
65644
|
+
"outlook-macos": seen(
|
|
65645
|
+
"partial",
|
|
65646
|
+
// The legacy app (Outlook 2019 for Mac). Not yet re-checked on the new
|
|
65647
|
+
// Outlook for Mac, which the outlook-macos column now describes.
|
|
65648
|
+
"Emailens real-device probe, Outlook 2019 for Mac (legacy app)",
|
|
65649
|
+
"The multi-value shorthand `text-decoration: underline wavy #d33` was dropped whole: no line at all. A single line value works; style and colour need -webkit-text-decoration."
|
|
65650
|
+
)
|
|
65651
|
+
}
|
|
65652
|
+
};
|
|
65486
65653
|
function isWordEngineClient(clientId) {
|
|
65487
65654
|
return clientId === "outlook-windows-legacy";
|
|
65488
65655
|
}
|
|
@@ -65525,14 +65692,35 @@ function mergeInline(state, declText) {
|
|
|
65525
65692
|
}
|
|
65526
65693
|
return serializeStyle(out);
|
|
65527
65694
|
}
|
|
65528
|
-
function
|
|
65695
|
+
function sameProperty(a2, b2) {
|
|
65696
|
+
const props = (d) => d.split(";").map((p) => p.split(":")[0].trim().toLowerCase());
|
|
65697
|
+
const mine = new Set(props(b2));
|
|
65698
|
+
return props(a2).some((p) => p && mine.has(p));
|
|
65699
|
+
}
|
|
65700
|
+
function linkRule(color) {
|
|
65701
|
+
return { selector: 'a[href]:not([href="mailto:"])', weight: 100.5, declText: `color: ${color}`, client: true };
|
|
65702
|
+
}
|
|
65703
|
+
function specificity2(selector) {
|
|
65704
|
+
let ids = 0;
|
|
65705
|
+
let classes = 0;
|
|
65706
|
+
let types = 0;
|
|
65707
|
+
fy(selector, (node) => {
|
|
65708
|
+
if (node.type === "IdSelector") ids++;
|
|
65709
|
+
else if (node.type === "ClassSelector" || node.type === "AttributeSelector") classes++;
|
|
65710
|
+
else if (node.type === "TypeSelector" && node.name !== "*") types++;
|
|
65711
|
+
});
|
|
65712
|
+
return ids * 1e4 + classes * 100 + types;
|
|
65713
|
+
}
|
|
65714
|
+
function inlineStyles($3, keepFontFace = true, clientRules = []) {
|
|
65529
65715
|
const styleBlocks = [];
|
|
65530
65716
|
$3("style").each((_3, el2) => {
|
|
65531
65717
|
styleBlocks.push($3(el2).text());
|
|
65532
65718
|
});
|
|
65533
|
-
if (styleBlocks.length === 0) return "";
|
|
65719
|
+
if (styleBlocks.length === 0 && clientRules.length === 0) return "";
|
|
65534
65720
|
const preserved = [];
|
|
65535
65721
|
const inlined = /* @__PURE__ */ new WeakMap();
|
|
65722
|
+
const rules = [...clientRules];
|
|
65723
|
+
const kept = [];
|
|
65536
65724
|
for (const block of styleBlocks) {
|
|
65537
65725
|
let ast;
|
|
65538
65726
|
try {
|
|
@@ -65570,22 +65758,33 @@ function inlineStyles($3, keepFontFace = true) {
|
|
|
65570
65758
|
const isClientTargeting = shouldPreserveSelector(selectorText);
|
|
65571
65759
|
if (hasPseudoSelector(selectorText) || isClientTargeting) {
|
|
65572
65760
|
preserved.push(hy(node));
|
|
65761
|
+
if (!hasPseudoSelector(selectorText))
|
|
65762
|
+
node.prelude.children.forEach((selector) => {
|
|
65763
|
+
kept.push({ selector: hy(selector), weight: specificity2(selector), declText });
|
|
65764
|
+
});
|
|
65573
65765
|
return;
|
|
65574
65766
|
}
|
|
65575
|
-
|
|
65576
|
-
|
|
65577
|
-
|
|
65578
|
-
if (!state) {
|
|
65579
|
-
state = { author: cascade(/* @__PURE__ */ new Map(), $3(el2).attr("style") || ""), sheet: /* @__PURE__ */ new Map() };
|
|
65580
|
-
inlined.set(el2, state);
|
|
65581
|
-
}
|
|
65582
|
-
$3(el2).attr("style", mergeInline(state, declText));
|
|
65583
|
-
});
|
|
65584
|
-
} catch (e2) {
|
|
65585
|
-
}
|
|
65767
|
+
node.prelude.children.forEach((selector) => {
|
|
65768
|
+
rules.push({ selector: hy(selector), weight: specificity2(selector), declText });
|
|
65769
|
+
});
|
|
65586
65770
|
}
|
|
65587
65771
|
});
|
|
65588
65772
|
}
|
|
65773
|
+
for (const { selector, declText, weight, client } of rules.sort((a2, b2) => a2.weight - b2.weight)) {
|
|
65774
|
+
try {
|
|
65775
|
+
$3(selector).each((_3, el2) => {
|
|
65776
|
+
if (client && kept.some((k2) => k2.weight > weight && sameProperty(k2.declText, declText) && $3(el2).is(k2.selector)))
|
|
65777
|
+
return;
|
|
65778
|
+
let state = inlined.get(el2);
|
|
65779
|
+
if (!state) {
|
|
65780
|
+
state = { author: cascade(/* @__PURE__ */ new Map(), $3(el2).attr("style") || ""), sheet: /* @__PURE__ */ new Map() };
|
|
65781
|
+
inlined.set(el2, state);
|
|
65782
|
+
}
|
|
65783
|
+
$3(el2).attr("style", mergeInline(state, declText));
|
|
65784
|
+
});
|
|
65785
|
+
} catch (e2) {
|
|
65786
|
+
}
|
|
65787
|
+
}
|
|
65589
65788
|
return preserved.join("\n");
|
|
65590
65789
|
}
|
|
65591
65790
|
function makeWarning(base, prop2, clientId, framework) {
|
|
@@ -65794,9 +65993,10 @@ function superhumanAdditionalChecks($3, clientId, html3) {
|
|
|
65794
65993
|
}
|
|
65795
65994
|
var EMPTY_SET = /* @__PURE__ */ new Set();
|
|
65796
65995
|
var OUTLOOK_WEB_STRIPPED = /* @__PURE__ */ new Set(["position", "transform", "animation", "transition"]);
|
|
65797
|
-
var YAHOO_STRIPPED = /* @__PURE__ */ new Set(["position", "box-shadow", "transform", "animation", "transition"
|
|
65996
|
+
var YAHOO_STRIPPED = /* @__PURE__ */ new Set(["position", "box-shadow", "transform", "animation", "transition"]);
|
|
65997
|
+
var YAHOO_IOS_STRIPPED = /* @__PURE__ */ new Set([...YAHOO_STRIPPED, "opacity"]);
|
|
65798
65998
|
var YAHOO_WEB_STRIPPED = /* @__PURE__ */ new Set([
|
|
65799
|
-
...
|
|
65999
|
+
...YAHOO_STRIPPED,
|
|
65800
66000
|
"flex",
|
|
65801
66001
|
"flex-basis",
|
|
65802
66002
|
// A width:100% + padding + border-box CTA came out 566px in a 534px column
|
|
@@ -65807,6 +66007,9 @@ var GMAIL_WEB_STRIPPED = /* @__PURE__ */ new Set([...GMAIL_STRIPPED_PROPERTIES,
|
|
|
65807
66007
|
var CLIENT_CONFIGS = {
|
|
65808
66008
|
"gmail-web": {
|
|
65809
66009
|
id: "gmail-web",
|
|
66010
|
+
// 324 of 458 links with no inline colour came out #15c in real Gmail web
|
|
66011
|
+
// (emailens fidelity bench, 2026-11-09); its weight: see linkRule().
|
|
66012
|
+
linkColor: "#15c",
|
|
65810
66013
|
// caniemail's set. A 2026-10-14 render said Gmail web kept box-shadow,
|
|
65811
66014
|
// text-shadow, visibility, animation, gap and grid; caniemail's own tests in
|
|
65812
66015
|
// real Gmail web (Chrome and Firefox, 2026-10-24) did not, and the <style>
|
|
@@ -65864,8 +66067,15 @@ var CLIENT_CONFIGS = {
|
|
|
65864
66067
|
strippedProperties: OUTLOOK_WEB_STRIPPED,
|
|
65865
66068
|
stripMode: "strip",
|
|
65866
66069
|
stripStyleAnimations: true,
|
|
66070
|
+
// No web font, as on Mac: postmark~welcome's @import of Nunito Sans drew
|
|
66071
|
+
// Arial on the worker's new Outlook (bench 2026-11-09); caniemail agrees.
|
|
66072
|
+
dropAtRules: /^@font-face\b|^@import\b/i,
|
|
66073
|
+
// @media reads the window, not the reading pane: of 27 emails with a
|
|
66074
|
+
// max-width query firing at 620, the worker's new Outlook drew none
|
|
66075
|
+
// mobile (bench 2026-11-09). 766 is that read window, 957 px at 125%.
|
|
66076
|
+
mediaWidth: 766,
|
|
65867
66077
|
inlineAndStripStyles: false,
|
|
65868
|
-
stripExternalStylesheets:
|
|
66078
|
+
stripExternalStylesheets: true,
|
|
65869
66079
|
stripForms: false,
|
|
65870
66080
|
stripSvg: false
|
|
65871
66081
|
},
|
|
@@ -66008,7 +66218,9 @@ var CLIENT_CONFIGS = {
|
|
|
66008
66218
|
dropValues: /radial-gradient\(/i,
|
|
66009
66219
|
// Real Yahoo web drew foodpanda's `url(...) center / cover` logos at their
|
|
66010
66220
|
// 236px and its `0% 0% / 100% 100%` coupon at the picture's own size,
|
|
66011
|
-
// cropped to the cell (emailens agreement run, 2026-10-28)
|
|
66221
|
+
// cropped to the cell (emailens agreement run, 2026-10-28): the size inside
|
|
66222
|
+
// the shorthand is ignored. Written on its own it holds (AliExpress,
|
|
66223
|
+
// fidelity bench 2026-11-09).
|
|
66012
66224
|
dropBackgroundSize: true,
|
|
66013
66225
|
// A <style> with a comma-separated media query list is dropped whole: a
|
|
66014
66226
|
// probe on real Yahoo web lost the block for `screen and
|
|
@@ -66040,7 +66252,7 @@ var CLIENT_CONFIGS = {
|
|
|
66040
66252
|
},
|
|
66041
66253
|
"yahoo-mail-ios": {
|
|
66042
66254
|
id: "yahoo-mail-ios",
|
|
66043
|
-
strippedProperties:
|
|
66255
|
+
strippedProperties: YAHOO_IOS_STRIPPED,
|
|
66044
66256
|
stripMode: "strip",
|
|
66045
66257
|
inlineAndStripStyles: false,
|
|
66046
66258
|
stripExternalStylesheets: false,
|
|
@@ -66132,6 +66344,21 @@ var CLIENT_CONFIGS = {
|
|
|
66132
66344
|
additionalChecks: superhumanAdditionalChecks
|
|
66133
66345
|
}
|
|
66134
66346
|
};
|
|
66347
|
+
var PLAIN_PROPERTY = /^[a-z][a-z-]*$/;
|
|
66348
|
+
function applyObservations(observations, configs) {
|
|
66349
|
+
for (const [property, byClient] of Object.entries(observations)) {
|
|
66350
|
+
if (!PLAIN_PROPERTY.test(property)) continue;
|
|
66351
|
+
for (const [clientId, o2] of Object.entries(byClient)) {
|
|
66352
|
+
const config = configs[clientId];
|
|
66353
|
+
if (!config || o2.level === "partial") continue;
|
|
66354
|
+
const strip = new Set(config.strippedProperties);
|
|
66355
|
+
if (o2.level === "unsupported") strip.add(property);
|
|
66356
|
+
else strip.delete(property);
|
|
66357
|
+
config.strippedProperties = strip;
|
|
66358
|
+
}
|
|
66359
|
+
}
|
|
66360
|
+
}
|
|
66361
|
+
applyObservations(OBSERVED_OVERRIDES, CLIENT_CONFIGS);
|
|
66135
66362
|
var TEXT_DECORATION_LINE = /^(?:none|underline|overline|line-through|blink)(?:\s+(?:underline|overline|line-through|blink))*\s*(?:!important)?$/i;
|
|
66136
66363
|
var isLineOnly = (value) => TEXT_DECORATION_LINE.test(value.trim());
|
|
66137
66364
|
function dropWarnings(html3, config, clientId, framework) {
|
|
@@ -66146,9 +66373,25 @@ function dropWarnings(html3, config, clientId, framework) {
|
|
|
66146
66373
|
}
|
|
66147
66374
|
function hasDrops(config) {
|
|
66148
66375
|
return Boolean(
|
|
66149
|
-
config.dropSelectors || config.dropAtRules || config.dropValues || config.dropProperties || config.dropNesting || config.dropElements || config.dropAttributes
|
|
66376
|
+
config.dropSelectors || config.dropAtRules || config.dropValues || config.dropProperties || config.dropNesting || config.dropElements || config.dropAttributes || config.mediaWidth
|
|
66150
66377
|
);
|
|
66151
66378
|
}
|
|
66379
|
+
function mediaAtWidth(prelude, width) {
|
|
66380
|
+
let any = false;
|
|
66381
|
+
for (const query of prelude.toLowerCase().split(",")) {
|
|
66382
|
+
const words = query.replace(/\([^)]*\)/g, " ").trim().split(/\s+/).filter(Boolean);
|
|
66383
|
+
if (words.some((w2) => !["only", "screen", "all", "print", "and"].includes(w2))) return null;
|
|
66384
|
+
let match = !words.includes("print");
|
|
66385
|
+
for (const f3 of query.matchAll(/\(([^)]*)\)/g)) {
|
|
66386
|
+
const m2 = /^\s*(min|max)-width\s*:\s*([\d.]+)px\s*$/.exec(f3[1]);
|
|
66387
|
+
if (!m2) return null;
|
|
66388
|
+
const px2 = Number(m2[2]);
|
|
66389
|
+
if (m2[1] === "min" ? width < px2 : width > px2) match = false;
|
|
66390
|
+
}
|
|
66391
|
+
any || (any = match);
|
|
66392
|
+
}
|
|
66393
|
+
return any;
|
|
66394
|
+
}
|
|
66152
66395
|
function prepareDropSource(html3, config) {
|
|
66153
66396
|
if (!hasDrops(config)) return html3;
|
|
66154
66397
|
const $3 = load(html3);
|
|
@@ -66210,9 +66453,16 @@ function applyStyleDrops($3, config) {
|
|
|
66210
66453
|
enter(node, item, list) {
|
|
66211
66454
|
if (!list || !item) return;
|
|
66212
66455
|
const head = node.type === "Atrule" ? `@${node.name}${node.prelude ? ` ${hy(node.prelude)}` : ""}` : "";
|
|
66456
|
+
const atWidth = config.mediaWidth && node.type === "Atrule" && node.name === "media" && node.prelude ? mediaAtWidth(hy(node.prelude), config.mediaWidth) : null;
|
|
66213
66457
|
if (dropAtRules && node.type === "Atrule" && dropAtRules.test(head)) {
|
|
66214
66458
|
list.remove(item);
|
|
66215
66459
|
dropped.add(`@${node.name}`);
|
|
66460
|
+
} else if (atWidth === false) {
|
|
66461
|
+
list.remove(item);
|
|
66462
|
+
dropped.add("@media (width)");
|
|
66463
|
+
} else if (atWidth === true && node.type === "Atrule" && node.block) {
|
|
66464
|
+
list.insertList(node.block.children, item);
|
|
66465
|
+
list.remove(item);
|
|
66216
66466
|
} else if (dropSelectors && node.type === "Rule") {
|
|
66217
66467
|
const m2 = hy(node.prelude).match(dropSelectors);
|
|
66218
66468
|
if (m2) {
|
|
@@ -66350,8 +66600,13 @@ function applyTransformDom($3, html3, config, framework) {
|
|
|
66350
66600
|
if (config.additionalChecks && config.inlineAndStripStyles) {
|
|
66351
66601
|
warnings.push(...config.additionalChecks($3, clientId, html3, framework));
|
|
66352
66602
|
}
|
|
66603
|
+
applyTargetingSimulation($3, clientId);
|
|
66353
66604
|
if (config.inlineAndStripStyles) {
|
|
66354
|
-
const preserved = inlineStyles(
|
|
66605
|
+
const preserved = inlineStyles(
|
|
66606
|
+
$3,
|
|
66607
|
+
((_a22 = CSS_SUPPORT["@font-face"]) == null ? void 0 : _a22[clientId]) !== "unsupported",
|
|
66608
|
+
config.linkColor ? [linkRule(config.linkColor)] : []
|
|
66609
|
+
);
|
|
66355
66610
|
$3("style").remove();
|
|
66356
66611
|
if (preserved.trim()) {
|
|
66357
66612
|
const head = $3("head");
|
|
@@ -66443,7 +66698,7 @@ function applyTransformDom($3, html3, config, framework) {
|
|
|
66443
66698
|
}
|
|
66444
66699
|
if (config.dropBackgroundSize) {
|
|
66445
66700
|
const SIZE = /url\([^)]*\)|\s*\/\s*(?:cover|contain|auto|[\d.]+(?:px|%|em|rem|vw|vh)?)(?:\s+(?:auto|[\d.]+(?:px|%|em|rem|vw|vh)?))?/gi;
|
|
66446
|
-
const unsize = (css2) => css2.replace(
|
|
66701
|
+
const unsize = (css2) => css2.replace(
|
|
66447
66702
|
/(background\s*:[^;}]*)/gi,
|
|
66448
66703
|
(decl) => decl.replace(SIZE, (m2) => m2.startsWith("url(") ? m2 : "")
|
|
66449
66704
|
);
|
|
@@ -66542,9 +66797,11 @@ function applyTransformDom($3, html3, config, framework) {
|
|
|
66542
66797
|
warnings.push(...config.additionalChecks($3, clientId, html3, framework));
|
|
66543
66798
|
}
|
|
66544
66799
|
if (isWordEngineClient(clientId)) applyWordBoxModel($3);
|
|
66545
|
-
applyTargetingSimulation($3, clientId);
|
|
66546
66800
|
return { clientId, html: $3.html(), warnings };
|
|
66547
66801
|
}
|
|
66802
|
+
function standardsMode(html3) {
|
|
66803
|
+
return /^\s*(?:<!--[\s\S]*?-->\s*)*<!doctype/i.test(html3) ? html3 : `<!DOCTYPE html>${html3}`;
|
|
66804
|
+
}
|
|
66548
66805
|
function transformForAllClients(html3, framework) {
|
|
66549
66806
|
if (!html3 || !html3.trim()) {
|
|
66550
66807
|
return Object.keys(CLIENT_CONFIGS).map((clientId) => ({
|
|
@@ -66587,7 +66844,7 @@ function transformForAllClients(html3, framework) {
|
|
|
66587
66844
|
result = applyTransformDom(clientDom, source, config, framework);
|
|
66588
66845
|
}
|
|
66589
66846
|
if (wordEngine) result.html = vmlToCss(result.html);
|
|
66590
|
-
if (isWordEngineClient(clientId)) result.html = applyMsoHide(result.html);
|
|
66847
|
+
if (isWordEngineClient(clientId)) result.html = standardsMode(applyMsoHide(result.html));
|
|
66591
66848
|
return result;
|
|
66592
66849
|
});
|
|
66593
66850
|
}
|
|
@@ -67793,9 +68050,9 @@ function readSheet(ast) {
|
|
|
67793
68050
|
}
|
|
67794
68051
|
if (parts.length === classes.length && classes.length === 1) {
|
|
67795
68052
|
const name = classes[0].name;
|
|
67796
|
-
const
|
|
67797
|
-
for (const p of props)
|
|
67798
|
-
propsByClass.set(name,
|
|
68053
|
+
const seen2 = (_a22 = propsByClass.get(name)) != null ? _a22 : /* @__PURE__ */ new Set();
|
|
68054
|
+
for (const p of props) seen2.add(p);
|
|
68055
|
+
propsByClass.set(name, seen2);
|
|
67799
68056
|
}
|
|
67800
68057
|
}
|
|
67801
68058
|
}
|
|
@@ -67924,18 +68181,18 @@ function checkStyleSurvivalFromDom($3, source, framework) {
|
|
|
67924
68181
|
const names = ((_a22 = $3(el2).attr("class")) != null ? _a22 : "").split(/\s+/).filter(Boolean);
|
|
67925
68182
|
if (names.length < 2) return;
|
|
67926
68183
|
const loc = locOfElement(el2);
|
|
67927
|
-
const
|
|
68184
|
+
const seen2 = /* @__PURE__ */ new Map();
|
|
67928
68185
|
for (const sheet of sheets) {
|
|
67929
68186
|
for (const name of names) {
|
|
67930
68187
|
for (const prop2 of (_b = sheet.propsByClass.get(name)) != null ? _b : []) {
|
|
67931
|
-
const first2 =
|
|
68188
|
+
const first2 = seen2.get(prop2);
|
|
67932
68189
|
if (first2 && first2 !== name) {
|
|
67933
68190
|
conflictExample || (conflictExample = `.${first2} and .${name} both set ${prop2}`);
|
|
67934
68191
|
conflictCount++;
|
|
67935
68192
|
if (loc) conflicting.push(loc);
|
|
67936
68193
|
return;
|
|
67937
68194
|
}
|
|
67938
|
-
if (!first2)
|
|
68195
|
+
if (!first2) seen2.set(prop2, name);
|
|
67939
68196
|
}
|
|
67940
68197
|
}
|
|
67941
68198
|
if (names.some((n2) => sheet.classesWithDescendants.has(n2))) {
|
|
@@ -67996,7 +68253,7 @@ function gmailWrapperOverrides($3) {
|
|
|
67996
68253
|
const found = { selector: "", props: [], elements: [], inherits: false };
|
|
67997
68254
|
const body = $3("body").first();
|
|
67998
68255
|
if (!body.length) return found;
|
|
67999
|
-
const
|
|
68256
|
+
const seen2 = /* @__PURE__ */ new Set();
|
|
68000
68257
|
const props = /* @__PURE__ */ new Set();
|
|
68001
68258
|
for (const el2 of $3("style").toArray()) {
|
|
68002
68259
|
let ast;
|
|
@@ -68044,8 +68301,8 @@ function gmailWrapperOverrides($3) {
|
|
|
68044
68301
|
if (value === "inherit") found.inherits = true;
|
|
68045
68302
|
hit2 = true;
|
|
68046
68303
|
}
|
|
68047
|
-
if (hit2 && !
|
|
68048
|
-
|
|
68304
|
+
if (hit2 && !seen2.has(target)) {
|
|
68305
|
+
seen2.add(target);
|
|
68049
68306
|
found.elements.push(target);
|
|
68050
68307
|
found.selector || (found.selector = text3.trim());
|
|
68051
68308
|
}
|
|
@@ -68133,8 +68390,8 @@ function attr2(attrs2, name) {
|
|
|
68133
68390
|
);
|
|
68134
68391
|
return m2 ? (_a22 = m2[1]) != null ? _a22 : m2[2] : void 0;
|
|
68135
68392
|
}
|
|
68136
|
-
function add2(issues,
|
|
68137
|
-
const existing =
|
|
68393
|
+
function add2(issues, seen2, key, issue) {
|
|
68394
|
+
const existing = seen2.get(key);
|
|
68138
68395
|
if (existing) {
|
|
68139
68396
|
if (!issue.loc || !existing.locs) return;
|
|
68140
68397
|
if (existing.locs.some((l2) => l2.offset === issue.loc.offset)) return;
|
|
@@ -68145,32 +68402,32 @@ function add2(issues, seen, key, issue) {
|
|
|
68145
68402
|
existing.locs.push(issue.loc);
|
|
68146
68403
|
return;
|
|
68147
68404
|
}
|
|
68148
|
-
|
|
68405
|
+
seen2.set(key, issue);
|
|
68149
68406
|
issues.push(issue);
|
|
68150
68407
|
}
|
|
68151
68408
|
function withLoc(issue, loc) {
|
|
68152
68409
|
return loc ? __spreadProps(__spreadValues({}, issue), { loc, locs: [loc] }) : issue;
|
|
68153
68410
|
}
|
|
68154
68411
|
var TEXT_HOSTS = /<\s*(center|v:textbox|div|p|table|h[1-6]|span|font|a)\b/i;
|
|
68155
|
-
function checkLooseText(issues,
|
|
68412
|
+
function checkLooseText(issues, seen2, open, inner, source) {
|
|
68156
68413
|
if (TEXT_HOSTS.test(inner)) return;
|
|
68157
68414
|
const text3 = inner.replace(/<!--[\s\S]*?-->/g, "").replace(/<[^>]*>/g, "").replace(/ |\s/g, "");
|
|
68158
68415
|
if (text3 === "") return;
|
|
68159
|
-
add2(issues,
|
|
68416
|
+
add2(issues, seen2, `loosetext:${open.name}`, withLoc({
|
|
68160
68417
|
rule: "vml-unrendered-text",
|
|
68161
68418
|
severity: "error",
|
|
68162
68419
|
message: `<v:${open.name}> has label text with no element around it, which Outlook does not draw.`,
|
|
68163
68420
|
detail: `Verified in Outlook Classic: the shape renders its fill and shape correctly and shows no text at all, so the reader gets a blank coloured block where the label should be. Nothing errors and the HTML fallback still reads correctly in every other client, so this ships unnoticed. Wrap the text in <center> (what the bulletproof-button pattern uses) or in <v:textbox>.`
|
|
68164
68421
|
}, locAt(source, open.offset, open.length)));
|
|
68165
68422
|
}
|
|
68166
|
-
function checkFillPicture(issues,
|
|
68423
|
+
function checkFillPicture(issues, seen2, open, inner, source) {
|
|
68167
68424
|
if (/<v:imagedata\b/i.test(inner)) return;
|
|
68168
68425
|
const fill = inner.match(/<v:fill\b([^>]*)>/i);
|
|
68169
68426
|
if (!fill || attr2(fill[1], "src") === void 0) return;
|
|
68170
68427
|
const label = inner.replace(/<!--[\s\S]*?-->/g, "").replace(/<[^>]*>/g, "").replace(/ |\s/g, "");
|
|
68171
68428
|
const picture2 = label === "";
|
|
68172
68429
|
const measured = `Measured on real Outlook: 2007 and 2010 draw the picture, but 2013, 2016 and 2019 show only the fill's colour.`;
|
|
68173
|
-
add2(issues,
|
|
68430
|
+
add2(issues, seen2, `fillpicture:${open.name}`, withLoc(picture2 ? {
|
|
68174
68431
|
rule: "vml-roundrect-fill-picture",
|
|
68175
68432
|
severity: "error",
|
|
68176
68433
|
message: `<v:roundrect> paints its picture with <v:fill src>, which Outlook 2013, 2016 and 2019 leave blank.`,
|
|
@@ -68202,7 +68459,7 @@ function ghostTags(blocks) {
|
|
|
68202
68459
|
}
|
|
68203
68460
|
return tags;
|
|
68204
68461
|
}
|
|
68205
|
-
function checkGhostTables(issues,
|
|
68462
|
+
function checkGhostTables(issues, seen2, blocks, source) {
|
|
68206
68463
|
var _a22;
|
|
68207
68464
|
const tags = ghostTags(blocks);
|
|
68208
68465
|
if (tags.length === 0) return;
|
|
@@ -68220,7 +68477,7 @@ function checkGhostTables(issues, seen, blocks, source) {
|
|
|
68220
68477
|
for (const [name, list] of opens) {
|
|
68221
68478
|
if (!GHOST_TAGS.has(name)) continue;
|
|
68222
68479
|
for (const tag of list.slice(0, 1)) {
|
|
68223
|
-
add2(issues,
|
|
68480
|
+
add2(issues, seen2, `ghost-open:${name}`, withLoc({
|
|
68224
68481
|
rule: "ghost-table-unbalanced",
|
|
68225
68482
|
severity: "error",
|
|
68226
68483
|
message: `<${name}> is opened inside an Outlook conditional comment and never closed.`,
|
|
@@ -68229,7 +68486,7 @@ function checkGhostTables(issues, seen, blocks, source) {
|
|
|
68229
68486
|
}
|
|
68230
68487
|
}
|
|
68231
68488
|
for (const tag of strays.slice(0, 1)) {
|
|
68232
|
-
add2(issues,
|
|
68489
|
+
add2(issues, seen2, `ghost-stray:${tag.name}`, withLoc({
|
|
68233
68490
|
rule: "ghost-table-unbalanced",
|
|
68234
68491
|
severity: "error",
|
|
68235
68492
|
message: `Closing </${tag.name}> inside an Outlook conditional comment has no matching opening tag.`,
|
|
@@ -68243,8 +68500,8 @@ function checkVml(html3, options) {
|
|
|
68243
68500
|
const blocks = msoBlocks(html3);
|
|
68244
68501
|
const tags = vmlTags(blocks);
|
|
68245
68502
|
const issues = [];
|
|
68246
|
-
const
|
|
68247
|
-
checkGhostTables(issues,
|
|
68503
|
+
const seen2 = /* @__PURE__ */ new Map();
|
|
68504
|
+
checkGhostTables(issues, seen2, blocks, source);
|
|
68248
68505
|
if (tags.length === 0) return { hasVml: false, issues };
|
|
68249
68506
|
const openShapes = [];
|
|
68250
68507
|
let groupDepth = 0;
|
|
@@ -68260,11 +68517,11 @@ function checkVml(html3, options) {
|
|
|
68260
68517
|
if (idx !== -1) {
|
|
68261
68518
|
const open = openShapes[idx];
|
|
68262
68519
|
const inner = html3.slice(open.offset + open.length, tag.offset);
|
|
68263
|
-
checkLooseText(issues,
|
|
68264
|
-
if (name === "roundrect") checkFillPicture(issues,
|
|
68520
|
+
checkLooseText(issues, seen2, open, inner, source);
|
|
68521
|
+
if (name === "roundrect") checkFillPicture(issues, seen2, open, inner, source);
|
|
68265
68522
|
}
|
|
68266
68523
|
if (idx === -1) {
|
|
68267
|
-
add2(issues,
|
|
68524
|
+
add2(issues, seen2, `stray:${name}`, withLoc({
|
|
68268
68525
|
rule: "vml-unbalanced-tag",
|
|
68269
68526
|
severity: "error",
|
|
68270
68527
|
message: `Closing </v:${name}> has no matching opening tag.`,
|
|
@@ -68280,7 +68537,7 @@ function checkVml(html3, options) {
|
|
|
68280
68537
|
if (isShape) {
|
|
68281
68538
|
const parent2 = openShapes[openShapes.length - 1];
|
|
68282
68539
|
if (parent2 && groupDepth === 0) {
|
|
68283
|
-
add2(issues,
|
|
68540
|
+
add2(issues, seen2, `nested:${parent2.name}>${name}`, withLoc({
|
|
68284
68541
|
rule: "vml-nested-shape",
|
|
68285
68542
|
severity: "error",
|
|
68286
68543
|
message: `<v:${name}> is nested inside <v:${parent2.name}>. Outlook does not support nesting one VML shape inside another.`,
|
|
@@ -68309,7 +68566,7 @@ function checkVml(html3, options) {
|
|
|
68309
68566
|
if (!m2) continue;
|
|
68310
68567
|
const value = m2[1].trim();
|
|
68311
68568
|
if (value === "" || /^[a-z%]+$/i.test(value)) {
|
|
68312
|
-
add2(issues,
|
|
68569
|
+
add2(issues, seen2, `dim:${name}:${prop2}:${value}`, withLoc({
|
|
68313
68570
|
rule: "vml-invalid-dimension",
|
|
68314
68571
|
severity: "error",
|
|
68315
68572
|
message: `<v:${name}> has an invalid ${prop2}: "${prop2}:${value}" is missing its number.`,
|
|
@@ -68324,7 +68581,7 @@ function checkVml(html3, options) {
|
|
|
68324
68581
|
const raw = arcsize.trim();
|
|
68325
68582
|
const pct = raw.endsWith("%") ? parseFloat(raw) : parseFloat(raw) * 100;
|
|
68326
68583
|
if (Number.isFinite(pct) && (pct < 0 || pct > 100)) {
|
|
68327
|
-
add2(issues,
|
|
68584
|
+
add2(issues, seen2, `arcsize:${raw}`, withLoc({
|
|
68328
68585
|
rule: "vml-arcsize-range",
|
|
68329
68586
|
severity: "warning",
|
|
68330
68587
|
message: `<v:roundrect> has arcsize="${raw}", outside the valid 0%\u2013100% range.`,
|
|
@@ -68335,7 +68592,7 @@ function checkVml(html3, options) {
|
|
|
68335
68592
|
}
|
|
68336
68593
|
}
|
|
68337
68594
|
for (const tag of openShapes) {
|
|
68338
|
-
add2(issues,
|
|
68595
|
+
add2(issues, seen2, `unclosed:${tag.name}`, withLoc({
|
|
68339
68596
|
rule: "vml-unbalanced-tag",
|
|
68340
68597
|
severity: "error",
|
|
68341
68598
|
message: `<v:${tag.name}> is never closed.`,
|
|
@@ -68343,7 +68600,7 @@ function checkVml(html3, options) {
|
|
|
68343
68600
|
}, locAt(source, tag.offset, tag.length)));
|
|
68344
68601
|
}
|
|
68345
68602
|
if (/<head[\s>]/i.test(html3) && !/<o:PixelsPerInch[\s>]/i.test(html3)) {
|
|
68346
|
-
add2(issues,
|
|
68603
|
+
add2(issues, seen2, "ppi", withLoc({
|
|
68347
68604
|
rule: "vml-pixels-per-inch",
|
|
68348
68605
|
severity: "warning",
|
|
68349
68606
|
message: `This email uses VML but does not declare <o:PixelsPerInch>96</o:PixelsPerInch>.`,
|
|
@@ -68367,6 +68624,9 @@ function applyIntent(html3, warnings, framework, parsedLiveDom) {
|
|
|
68367
68624
|
next2 = adjustBody(live$, next2);
|
|
68368
68625
|
return appendKillers(next2, html3, wordHtml, vml, framework);
|
|
68369
68626
|
}
|
|
68627
|
+
var nonZeroPadding = (style) => [...style.matchAll(/(?:^|[^-])padding(?:-(?:top|right|bottom|left))?\s*:\s*([^;]*)/gi)].some(
|
|
68628
|
+
([, value]) => !/^(?:\s*0(?:px|em|rem|%|pt)?)+\s*(?:!important)?\s*$/i.test(value)
|
|
68629
|
+
);
|
|
68370
68630
|
var hit = (re) => (style) => re.test(style);
|
|
68371
68631
|
var LAYER_TOKEN = {
|
|
68372
68632
|
image: null,
|
|
@@ -68423,7 +68683,7 @@ function adjustOutlook(word$, warnings, framework) {
|
|
|
68423
68683
|
apply(word$, wordRules, WORD, "linear-gradient", hit(/linear-gradient\s*\(/i), wordFill, "Outlook Classic drops this linear-gradient, and no v:fill covers it.", true);
|
|
68424
68684
|
apply(word$, wordRules, WORD, "max-width", hit(/max-width\s*:/i), (el2, style) => maxWidthCovered(word$, el2, style), "Outlook Classic only honours max-width on a table. Wrap the element in a table with a fixed width.", true);
|
|
68425
68685
|
apply(word$, wordRules, WORD, "min-width", hit(/min-width\s*:/i), (el2, style) => minWidthCovered(word$, el2, style), "Outlook Classic ignores min-width. Give the box a width, or put it in a cell with one.", true);
|
|
68426
|
-
apply(word$, wordRules, WORD, "padding",
|
|
68686
|
+
apply(word$, wordRules, WORD, "padding", nonZeroPadding, (el2) => paddingCovered(word$, el2, true), "Outlook Classic drops this padding. Put it on a table cell, or set mso-padding-alt on one.", true);
|
|
68427
68687
|
apply(word$, wordRules, WORD, "float", hit(/float\s*:/i), never, "Outlook Classic drops this float. The MSO branch needs a table with align.", true);
|
|
68428
68688
|
apply(word$, wordRules, WORD, "display:flex", hit(/display\s*:\s*(?:inline-)?flex\b/i), never, "Outlook Classic receives this flex box. The MSO branch needs a table.", true);
|
|
68429
68689
|
apply(word$, wordRules, WORD, "display:grid", hit(/display\s*:\s*(?:inline-)?grid\b/i), never, "Outlook Classic receives this grid box. The MSO branch needs a table.", true);
|
|
@@ -68852,12 +69112,12 @@ function normalise(value) {
|
|
|
68852
69112
|
}
|
|
68853
69113
|
function appendKillers(warnings, html3, wordHtml, vml, framework) {
|
|
68854
69114
|
const extra = [];
|
|
68855
|
-
const
|
|
69115
|
+
const seen2 = new Set(warnings.map((w2) => `${w2.client}:${w2.property}`));
|
|
68856
69116
|
const push = (client, property, severity, message) => {
|
|
68857
69117
|
var _a22;
|
|
68858
69118
|
const key = `${client}:${property}`;
|
|
68859
|
-
if (
|
|
68860
|
-
|
|
69119
|
+
if (seen2.has(key)) return;
|
|
69120
|
+
seen2.add(key);
|
|
68861
69121
|
extra.push({
|
|
68862
69122
|
severity,
|
|
68863
69123
|
client,
|
|
@@ -68996,11 +69256,11 @@ function applyLint(matcher, hack, policy, extra) {
|
|
|
68996
69256
|
suggestion: "Avoid client-specific hacks in strict mode, or switch to progressive targeting policy."
|
|
68997
69257
|
};
|
|
68998
69258
|
}
|
|
68999
|
-
function recordMatch(report,
|
|
69000
|
-
if (
|
|
69259
|
+
function recordMatch(report, seen2, matcher, policy, matchedText, selector) {
|
|
69260
|
+
if (seen2.has(matcher.id)) return;
|
|
69001
69261
|
const hack = targetingHackForMatcher(matcher);
|
|
69002
69262
|
if (!hack) return;
|
|
69003
|
-
|
|
69263
|
+
seen2.add(matcher.id);
|
|
69004
69264
|
report.detectedHacks.push({
|
|
69005
69265
|
hack,
|
|
69006
69266
|
foundIn: matcher.foundIn,
|
|
@@ -69010,14 +69270,14 @@ function recordMatch(report, seen, matcher, policy, matchedText, selector) {
|
|
|
69010
69270
|
const warning = applyLint(matcher, hack, policy, { matchedText, selector });
|
|
69011
69271
|
if (warning) report.warnings.push(warning);
|
|
69012
69272
|
}
|
|
69013
|
-
function scanHtmlForTargeting(html3, report,
|
|
69273
|
+
function scanHtmlForTargeting(html3, report, seen2, policy) {
|
|
69014
69274
|
for (const matcher of HTML_MATCHERS) {
|
|
69015
69275
|
const match = html3.match(matcher.pattern);
|
|
69016
69276
|
if (!match) continue;
|
|
69017
|
-
recordMatch(report,
|
|
69277
|
+
recordMatch(report, seen2, matcher, policy, match[0]);
|
|
69018
69278
|
}
|
|
69019
69279
|
}
|
|
69020
|
-
function scanCssAstForTargeting(ast, report,
|
|
69280
|
+
function scanCssAstForTargeting(ast, report, seen2, policy) {
|
|
69021
69281
|
fy(ast, {
|
|
69022
69282
|
visit: "Rule",
|
|
69023
69283
|
enter(node) {
|
|
@@ -69026,7 +69286,7 @@ function scanCssAstForTargeting(ast, report, seen, policy) {
|
|
|
69026
69286
|
const selectorText = hy(child).trim();
|
|
69027
69287
|
for (const matcher of SELECTOR_MATCHERS) {
|
|
69028
69288
|
if (matcher.pattern.test(selectorText)) {
|
|
69029
|
-
recordMatch(report,
|
|
69289
|
+
recordMatch(report, seen2, matcher, policy, selectorText, selectorText);
|
|
69030
69290
|
}
|
|
69031
69291
|
}
|
|
69032
69292
|
});
|
|
@@ -69040,13 +69300,13 @@ function scanCssAstForTargeting(ast, report, seen, policy) {
|
|
|
69040
69300
|
const haystack = `@${node.name} ${atRulePrelude}`;
|
|
69041
69301
|
for (const matcher of ATRULE_MATCHERS) {
|
|
69042
69302
|
if (matcher.pattern.test(atRulePrelude) || matcher.pattern.test(haystack)) {
|
|
69043
|
-
recordMatch(report,
|
|
69303
|
+
recordMatch(report, seen2, matcher, policy, haystack);
|
|
69044
69304
|
}
|
|
69045
69305
|
}
|
|
69046
69306
|
}
|
|
69047
69307
|
});
|
|
69048
69308
|
}
|
|
69049
|
-
function scanStyleBlocks(html3, report,
|
|
69309
|
+
function scanStyleBlocks(html3, report, seen2, policy) {
|
|
69050
69310
|
const styleRegex = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
|
|
69051
69311
|
let styleMatch;
|
|
69052
69312
|
while ((styleMatch = styleRegex.exec(html3)) !== null) {
|
|
@@ -69056,14 +69316,14 @@ function scanStyleBlocks(html3, report, seen, policy) {
|
|
|
69056
69316
|
} catch (e2) {
|
|
69057
69317
|
continue;
|
|
69058
69318
|
}
|
|
69059
|
-
scanCssAstForTargeting(ast, report,
|
|
69319
|
+
scanCssAstForTargeting(ast, report, seen2, policy);
|
|
69060
69320
|
}
|
|
69061
69321
|
}
|
|
69062
69322
|
function checkTargetingHacks(html3, policy = "progressive") {
|
|
69063
69323
|
const report = emptyTargetingReport();
|
|
69064
|
-
const
|
|
69065
|
-
scanHtmlForTargeting(html3, report,
|
|
69066
|
-
scanStyleBlocks(html3, report,
|
|
69324
|
+
const seen2 = /* @__PURE__ */ new Set();
|
|
69325
|
+
scanHtmlForTargeting(html3, report, seen2, policy);
|
|
69326
|
+
scanStyleBlocks(html3, report, seen2, policy);
|
|
69067
69327
|
return report;
|
|
69068
69328
|
}
|
|
69069
69329
|
var WORD_ENGINE_CLIENT = "outlook-windows-legacy";
|
|
@@ -69336,24 +69596,24 @@ function analyzeEmailFromDom($3, framework, source, targetingPolicy = "progressi
|
|
|
69336
69596
|
if (!cssLoc) return;
|
|
69337
69597
|
const loc = locInCssBlock(blockAnchor, cssLoc);
|
|
69338
69598
|
if (!loc) return;
|
|
69339
|
-
const
|
|
69340
|
-
if (!
|
|
69599
|
+
const seen2 = selectorLocs.get(key);
|
|
69600
|
+
if (!seen2) {
|
|
69341
69601
|
selectorLocs.set(key, { locs: [loc], scopes: [scope != null ? scope : null] });
|
|
69342
69602
|
return;
|
|
69343
69603
|
}
|
|
69344
|
-
if (
|
|
69345
|
-
if (
|
|
69346
|
-
|
|
69604
|
+
if (seen2.locs.some((l2) => l2.offset === loc.offset)) return;
|
|
69605
|
+
if (seen2.locs.length >= MAX_WARNING_LOCATIONS) {
|
|
69606
|
+
seen2.truncated = true;
|
|
69347
69607
|
return;
|
|
69348
69608
|
}
|
|
69349
|
-
|
|
69350
|
-
if (
|
|
69609
|
+
seen2.locs.push(loc);
|
|
69610
|
+
if (seen2.scopes) seen2.scopes.push(scope != null ? scope : null);
|
|
69351
69611
|
}
|
|
69352
69612
|
function recordLoc(key, cssLoc, value, scope) {
|
|
69353
69613
|
const loc = locInCssBlock(blockAnchor, cssLoc);
|
|
69354
69614
|
if (!loc) return;
|
|
69355
|
-
const
|
|
69356
|
-
if (!
|
|
69615
|
+
const seen2 = propertyLocs.get(key);
|
|
69616
|
+
if (!seen2) {
|
|
69357
69617
|
propertyLocs.set(key, __spreadProps(__spreadValues({
|
|
69358
69618
|
locs: [loc]
|
|
69359
69619
|
}, value !== void 0 ? { values: [value] } : {}), {
|
|
@@ -69361,14 +69621,14 @@ function analyzeEmailFromDom($3, framework, source, targetingPolicy = "progressi
|
|
|
69361
69621
|
}));
|
|
69362
69622
|
return;
|
|
69363
69623
|
}
|
|
69364
|
-
if (
|
|
69365
|
-
if (
|
|
69366
|
-
|
|
69624
|
+
if (seen2.locs.some((l2) => l2.offset === loc.offset)) return;
|
|
69625
|
+
if (seen2.locs.length >= MAX_WARNING_LOCATIONS) {
|
|
69626
|
+
seen2.truncated = true;
|
|
69367
69627
|
return;
|
|
69368
69628
|
}
|
|
69369
|
-
|
|
69370
|
-
if (
|
|
69371
|
-
if (
|
|
69629
|
+
seen2.locs.push(loc);
|
|
69630
|
+
if (seen2.values && value !== void 0) seen2.values.push(value);
|
|
69631
|
+
if (seen2.scopes) seen2.scopes.push(scope != null ? scope : null);
|
|
69372
69632
|
}
|
|
69373
69633
|
$3("style").each((_3, el2) => {
|
|
69374
69634
|
const cssText = $3(el2).text();
|
|
@@ -70188,11 +70448,11 @@ function truncateWarnings(warnings, html3, maxTokens, scope, selectedClientId) {
|
|
|
70188
70448
|
return { warnings, truncated: false, removed: 0 };
|
|
70189
70449
|
}
|
|
70190
70450
|
let result = [...warnings];
|
|
70191
|
-
const
|
|
70451
|
+
const seen2 = /* @__PURE__ */ new Set();
|
|
70192
70452
|
result = result.filter((w2) => {
|
|
70193
70453
|
const key = `${w2.property}:${w2.severity}`;
|
|
70194
|
-
if (
|
|
70195
|
-
|
|
70454
|
+
if (seen2.has(key)) return false;
|
|
70455
|
+
seen2.add(key);
|
|
70196
70456
|
return true;
|
|
70197
70457
|
});
|
|
70198
70458
|
if (estimateFits(result, html3, maxTokens)) {
|
|
@@ -70555,7 +70815,7 @@ function checkHiddenText($3) {
|
|
|
70555
70815
|
}
|
|
70556
70816
|
function checkUrlShorteners($3) {
|
|
70557
70817
|
const issues = [];
|
|
70558
|
-
const
|
|
70818
|
+
const seen2 = /* @__PURE__ */ new Set();
|
|
70559
70819
|
$3("a[href]").each((_3, el2) => {
|
|
70560
70820
|
const href = $3(el2).attr("href") || "";
|
|
70561
70821
|
let hostname;
|
|
@@ -70565,8 +70825,8 @@ function checkUrlShorteners($3) {
|
|
|
70565
70825
|
return;
|
|
70566
70826
|
}
|
|
70567
70827
|
for (const shortener of URL_SHORTENERS) {
|
|
70568
|
-
if ((hostname === shortener || hostname.endsWith("." + shortener)) && !
|
|
70569
|
-
|
|
70828
|
+
if ((hostname === shortener || hostname.endsWith("." + shortener)) && !seen2.has(shortener)) {
|
|
70829
|
+
seen2.add(shortener);
|
|
70570
70830
|
issues.push({
|
|
70571
70831
|
rule: "url-shortener",
|
|
70572
70832
|
severity: "warning",
|
|
@@ -71246,7 +71506,7 @@ function computeCascade($3, ctx) {
|
|
|
71246
71506
|
});
|
|
71247
71507
|
if (!decls.length) return;
|
|
71248
71508
|
for (const selector of splitTopLevel(selectorList).map((x2) => x2.trim()).filter(Boolean)) {
|
|
71249
|
-
const
|
|
71509
|
+
const specificity3 = specificityOf(selector);
|
|
71250
71510
|
let matched;
|
|
71251
71511
|
try {
|
|
71252
71512
|
matched = $3(selector).toArray();
|
|
@@ -71258,7 +71518,7 @@ function computeCascade($3, ctx) {
|
|
|
71258
71518
|
record(el2, d.prop, __spreadProps(__spreadValues({}, d), {
|
|
71259
71519
|
inline: false,
|
|
71260
71520
|
presentational: false,
|
|
71261
|
-
specificity:
|
|
71521
|
+
specificity: specificity3,
|
|
71262
71522
|
order: order++
|
|
71263
71523
|
}));
|
|
71264
71524
|
}
|
|
@@ -71572,10 +71832,10 @@ function lowContrastOnly(issues) {
|
|
|
71572
71832
|
return issues.filter((i2) => i2.rule === "low-contrast");
|
|
71573
71833
|
}
|
|
71574
71834
|
function contrastDelta(candidates, baseline, rule, prefix, details) {
|
|
71575
|
-
const
|
|
71835
|
+
const seen2 = new Set(lowContrastOnly(baseline).map((i2) => i2.element));
|
|
71576
71836
|
return lowContrastOnly(candidates).filter((issue) => {
|
|
71577
|
-
if (
|
|
71578
|
-
|
|
71837
|
+
if (seen2.has(issue.element)) return false;
|
|
71838
|
+
seen2.add(issue.element);
|
|
71579
71839
|
return true;
|
|
71580
71840
|
}).map((issue) => __spreadProps(__spreadValues(__spreadValues({
|
|
71581
71841
|
severity: issue.severity,
|
|
@@ -72070,15 +72330,15 @@ var ESP_SYSTEM_LINK = /unsub|opt[-_ ]?out|preference|update_profile|manage|archi
|
|
|
72070
72330
|
function checkTemplateVariablesFromDom($3, source) {
|
|
72071
72331
|
var _a22;
|
|
72072
72332
|
const issues = [];
|
|
72073
|
-
const
|
|
72333
|
+
const seen2 = /* @__PURE__ */ new Set();
|
|
72074
72334
|
const textNodes = visibleTextNodes($3);
|
|
72075
72335
|
const positioned = textNodes.some((n2) => n2.sourceCodeLocation);
|
|
72076
72336
|
for (const node of positioned ? textNodes : []) {
|
|
72077
72337
|
const data2 = (_a22 = node.data) != null ? _a22 : "";
|
|
72078
72338
|
for (const { variable, label, index: index2 } of findVariables(data2)) {
|
|
72079
72339
|
const key = `text:${variable}`;
|
|
72080
|
-
if (
|
|
72081
|
-
|
|
72340
|
+
if (seen2.has(key)) continue;
|
|
72341
|
+
seen2.add(key);
|
|
72082
72342
|
const loc = locInTextNode(node, index2, variable.length, source);
|
|
72083
72343
|
issues.push(__spreadValues({
|
|
72084
72344
|
rule: "unresolved-variable",
|
|
@@ -72095,8 +72355,8 @@ function checkTemplateVariablesFromDom($3, source) {
|
|
|
72095
72355
|
}).join("");
|
|
72096
72356
|
for (const { variable, label } of findVariables(textContent2)) {
|
|
72097
72357
|
const key = `text:${variable}`;
|
|
72098
|
-
if (
|
|
72099
|
-
|
|
72358
|
+
if (seen2.has(key)) continue;
|
|
72359
|
+
seen2.add(key);
|
|
72100
72360
|
issues.push({
|
|
72101
72361
|
rule: "unresolved-variable",
|
|
72102
72362
|
severity: "error",
|
|
@@ -72114,8 +72374,8 @@ function checkTemplateVariablesFromDom($3, source) {
|
|
|
72114
72374
|
if (!value) continue;
|
|
72115
72375
|
for (const { variable, label } of findVariables(value)) {
|
|
72116
72376
|
const key = `attr:${attr22}:${variable}`;
|
|
72117
|
-
if (
|
|
72118
|
-
|
|
72377
|
+
if (seen2.has(key)) continue;
|
|
72378
|
+
seen2.add(key);
|
|
72119
72379
|
const loc = locOfAttr(el2, attr22);
|
|
72120
72380
|
const espLink = attr22 === "href" && ESP_SYSTEM_LINK.test(variable);
|
|
72121
72381
|
issues.push(__spreadValues({
|
|
@@ -72146,9 +72406,9 @@ function isFluid(style) {
|
|
|
72146
72406
|
if (maxMatch && parseInt(maxMatch[1], 10) <= EMAIL_MAX_WIDTH) return true;
|
|
72147
72407
|
return false;
|
|
72148
72408
|
}
|
|
72149
|
-
function addWidthIssue(width, label, issues,
|
|
72409
|
+
function addWidthIssue(width, label, issues, seen2, loc) {
|
|
72150
72410
|
const key = `w:${label}:${width}`;
|
|
72151
|
-
const existing =
|
|
72411
|
+
const existing = seen2.get(key);
|
|
72152
72412
|
if (existing) {
|
|
72153
72413
|
addOccurrence(existing, loc);
|
|
72154
72414
|
return;
|
|
@@ -72159,7 +72419,7 @@ function addWidthIssue(width, label, issues, seen, loc) {
|
|
|
72159
72419
|
message: `${label} has a fixed width of ${width}px, wider than the ${EMAIL_MAX_WIDTH}px email frame; it will force horizontal scrolling, especially on mobile.`,
|
|
72160
72420
|
detail: `Use width:100% with max-width:${EMAIL_MAX_WIDTH}px instead of a fixed width beyond the frame.`
|
|
72161
72421
|
}, loc ? { loc, locs: [loc] } : {});
|
|
72162
|
-
|
|
72422
|
+
seen2.set(key, issue);
|
|
72163
72423
|
issues.push(issue);
|
|
72164
72424
|
}
|
|
72165
72425
|
function locateInNodes(nodes, starts, index2, length, source) {
|
|
@@ -72194,7 +72454,7 @@ function addOccurrence(issue, loc) {
|
|
|
72194
72454
|
function checkOverflowFromDom($3, source) {
|
|
72195
72455
|
var _a22;
|
|
72196
72456
|
const issues = [];
|
|
72197
|
-
const
|
|
72457
|
+
const seen2 = /* @__PURE__ */ new Map();
|
|
72198
72458
|
const tokensSeen = /* @__PURE__ */ new Set();
|
|
72199
72459
|
$3("[width], [style*='width']").each((_3, el2) => {
|
|
72200
72460
|
const $el = $3(el2);
|
|
@@ -72203,7 +72463,7 @@ function checkOverflowFromDom($3, source) {
|
|
|
72203
72463
|
if (isFluid($el.attr("style") || "")) return;
|
|
72204
72464
|
const tag = (el2.tagName || "element").toLowerCase();
|
|
72205
72465
|
const fromStyle = /(?:^|[;\s])width\s*:\s*\d+px/i.test($el.attr("style") || "");
|
|
72206
|
-
addWidthIssue(width, `<${tag}>`, issues,
|
|
72466
|
+
addWidthIssue(width, `<${tag}>`, issues, seen2, locOfAttr(el2, fromStyle ? "style" : "width"));
|
|
72207
72467
|
});
|
|
72208
72468
|
$3("style").each((_3, el2) => {
|
|
72209
72469
|
const cssText = $3(el2).text();
|
|
@@ -72238,7 +72498,7 @@ function checkOverflowFromDom($3, source) {
|
|
|
72238
72498
|
});
|
|
72239
72499
|
if (widthPx !== null && widthPx > EMAIL_MAX_WIDTH && !fluid) {
|
|
72240
72500
|
const selector = hy(node.prelude).trim().slice(0, 40);
|
|
72241
|
-
addWidthIssue(widthPx, selector || "rule", issues,
|
|
72501
|
+
addWidthIssue(widthPx, selector || "rule", issues, seen2, widthLoc);
|
|
72242
72502
|
}
|
|
72243
72503
|
}
|
|
72244
72504
|
});
|
|
@@ -72268,7 +72528,7 @@ function checkOverflowFromDom($3, source) {
|
|
|
72268
72528
|
}
|
|
72269
72529
|
if (!rowHasFluid && explicitCellCount >= 2 && rowFixedPx > EMAIL_MAX_WIDTH) {
|
|
72270
72530
|
const key = `row:${rowFixedPx}:${explicitCellCount}`;
|
|
72271
|
-
if (!
|
|
72531
|
+
if (!seen2.has(key)) {
|
|
72272
72532
|
const loc = locOfElement(trEl) || locOfElement(tableEl);
|
|
72273
72533
|
const issue = __spreadValues({
|
|
72274
72534
|
rule: "table-row-overflow",
|
|
@@ -72276,7 +72536,7 @@ function checkOverflowFromDom($3, source) {
|
|
|
72276
72536
|
message: `Table row has ${explicitCellCount} columns totaling ${rowFixedPx}px, wider than the ${EMAIL_MAX_WIDTH}px email frame; it will force horizontal scrolling on mobile.`,
|
|
72277
72537
|
detail: `Make columns fluid with percentage widths (e.g. width:50%) or stack columns vertically on small screens.`
|
|
72278
72538
|
}, loc ? { loc, locs: [loc] } : {});
|
|
72279
|
-
|
|
72539
|
+
seen2.set(key, issue);
|
|
72280
72540
|
issues.push(issue);
|
|
72281
72541
|
}
|
|
72282
72542
|
}
|
|
@@ -72293,7 +72553,7 @@ function checkOverflowFromDom($3, source) {
|
|
|
72293
72553
|
const parentWidth = fixedPxWidth($parent);
|
|
72294
72554
|
if (parentWidth !== null && parentWidth > 0 && imgWidth > parentWidth) {
|
|
72295
72555
|
const key = `img-overflow:${imgWidth}:${parentWidth}`;
|
|
72296
|
-
if (!
|
|
72556
|
+
if (!seen2.has(key)) {
|
|
72297
72557
|
const loc = locOfAttr(imgEl, "width") || locOfElement(imgEl);
|
|
72298
72558
|
const issue = __spreadValues({
|
|
72299
72559
|
rule: "image-container-overflow",
|
|
@@ -72301,7 +72561,7 @@ function checkOverflowFromDom($3, source) {
|
|
|
72301
72561
|
message: `<img> has fixed width ${imgWidth}px exceeding its container's width (${parentWidth}px); it will blow out the layout.`,
|
|
72302
72562
|
detail: `Set width:100% with max-width:${imgWidth}px or reduce the image width to fit within ${parentWidth}px.`
|
|
72303
72563
|
}, loc ? { loc, locs: [loc] } : {});
|
|
72304
|
-
|
|
72564
|
+
seen2.set(key, issue);
|
|
72305
72565
|
issues.push(issue);
|
|
72306
72566
|
}
|
|
72307
72567
|
}
|
|
@@ -72416,7 +72676,7 @@ function addOccurrence2(issue, loc) {
|
|
|
72416
72676
|
}
|
|
72417
72677
|
issue.locs.push(loc);
|
|
72418
72678
|
}
|
|
72419
|
-
function inspectDeclarations(style, issues,
|
|
72679
|
+
function inspectDeclarations(style, issues, seen2, locs) {
|
|
72420
72680
|
var _a22, _b, _c2;
|
|
72421
72681
|
const combined = `${(_a22 = style.get("background-image")) != null ? _a22 : ""} ${(_b = style.get("background")) != null ? _b : ""}`;
|
|
72422
72682
|
const isGradient = GRADIENT_RE.test(combined);
|
|
@@ -72426,7 +72686,7 @@ function inspectDeclarations(style, issues, seen, locs) {
|
|
|
72426
72686
|
const fix = stop ? `background-color: ${stop};` : `background-color: <solid colour matching the image>;`;
|
|
72427
72687
|
const key = `bg:${fix}`;
|
|
72428
72688
|
const loc = (_c2 = locs == null ? void 0 : locs.get("background-image")) != null ? _c2 : locs == null ? void 0 : locs.get("background");
|
|
72429
|
-
const existing =
|
|
72689
|
+
const existing = seen2.get(key);
|
|
72430
72690
|
if (existing) {
|
|
72431
72691
|
addOccurrence2(existing, loc);
|
|
72432
72692
|
} else {
|
|
@@ -72437,7 +72697,7 @@ function inspectDeclarations(style, issues, seen, locs) {
|
|
|
72437
72697
|
detail: isGradient ? `Add a solid fallback beneath the gradient using its first colour stop.` : `Add a solid background-color so the area still has colour when the image is dropped.`,
|
|
72438
72698
|
fix
|
|
72439
72699
|
}, loc ? { loc, locs: [loc] } : {});
|
|
72440
|
-
|
|
72700
|
+
seen2.set(key, issue);
|
|
72441
72701
|
issues.push(issue);
|
|
72442
72702
|
}
|
|
72443
72703
|
}
|
|
@@ -72446,7 +72706,7 @@ function inspectDeclarations(style, issues, seen, locs) {
|
|
|
72446
72706
|
const fix = `font-family: ${font.trim()}, Arial, sans-serif;`;
|
|
72447
72707
|
const key = `font:${font.trim().toLowerCase()}`;
|
|
72448
72708
|
const loc = locs == null ? void 0 : locs.get("font-family");
|
|
72449
|
-
const existing =
|
|
72709
|
+
const existing = seen2.get(key);
|
|
72450
72710
|
if (existing) {
|
|
72451
72711
|
addOccurrence2(existing, loc);
|
|
72452
72712
|
} else {
|
|
@@ -72457,7 +72717,7 @@ function inspectDeclarations(style, issues, seen, locs) {
|
|
|
72457
72717
|
detail: `End the stack with a web-safe font and a generic family.`,
|
|
72458
72718
|
fix
|
|
72459
72719
|
}, loc ? { loc, locs: [loc] } : {});
|
|
72460
|
-
|
|
72720
|
+
seen2.set(key, issue);
|
|
72461
72721
|
issues.push(issue);
|
|
72462
72722
|
}
|
|
72463
72723
|
}
|
|
@@ -72473,12 +72733,12 @@ function ruleToMap(node) {
|
|
|
72473
72733
|
}
|
|
72474
72734
|
function checkVisualFromDom($3, source) {
|
|
72475
72735
|
const issues = [];
|
|
72476
|
-
const
|
|
72736
|
+
const seen2 = /* @__PURE__ */ new Map();
|
|
72477
72737
|
$3("[style]").each((_3, el2) => {
|
|
72478
72738
|
const attrLoc = locOfAttr(el2, "style");
|
|
72479
72739
|
const style = parseInlineStyle($3(el2).attr("style") || "");
|
|
72480
72740
|
const locs = attrLoc ? new Map([...style.keys()].map((prop2) => [prop2, attrLoc])) : void 0;
|
|
72481
|
-
inspectDeclarations(style, issues,
|
|
72741
|
+
inspectDeclarations(style, issues, seen2, locs);
|
|
72482
72742
|
});
|
|
72483
72743
|
$3("style").each((_3, el2) => {
|
|
72484
72744
|
const cssText = $3(el2).text();
|
|
@@ -72499,7 +72759,7 @@ function checkVisualFromDom($3, source) {
|
|
|
72499
72759
|
const loc = locInCssBlock(anchor, child.loc);
|
|
72500
72760
|
if (loc) locs.set(child.property.toLowerCase(), loc);
|
|
72501
72761
|
});
|
|
72502
|
-
inspectDeclarations(ruleToMap(node), issues,
|
|
72762
|
+
inspectDeclarations(ruleToMap(node), issues, seen2, locs);
|
|
72503
72763
|
}
|
|
72504
72764
|
});
|
|
72505
72765
|
});
|
|
@@ -72606,13 +72866,13 @@ function driftClusters(values) {
|
|
|
72606
72866
|
return clusters;
|
|
72607
72867
|
}
|
|
72608
72868
|
function distinctValues(values, normalise2) {
|
|
72609
|
-
const
|
|
72869
|
+
const seen2 = /* @__PURE__ */ new Map();
|
|
72610
72870
|
for (const raw of values) {
|
|
72611
72871
|
const key = normalise2(raw);
|
|
72612
72872
|
if (!key) continue;
|
|
72613
|
-
if (!
|
|
72873
|
+
if (!seen2.has(key)) seen2.set(key, raw.trim());
|
|
72614
72874
|
}
|
|
72615
|
-
return [...
|
|
72875
|
+
return [...seen2.values()];
|
|
72616
72876
|
}
|
|
72617
72877
|
function checkDesignConsistencyFromDom($3) {
|
|
72618
72878
|
const found = collect($3);
|
|
@@ -72690,10 +72950,10 @@ var EMPTY_AUDIT = {
|
|
|
72690
72950
|
design: EMPTY_DESIGN
|
|
72691
72951
|
};
|
|
72692
72952
|
function dedupeByElement(issues) {
|
|
72693
|
-
const
|
|
72953
|
+
const seen2 = /* @__PURE__ */ new Set();
|
|
72694
72954
|
return issues.filter((issue) => {
|
|
72695
|
-
if (
|
|
72696
|
-
|
|
72955
|
+
if (seen2.has(issue.element)) return false;
|
|
72956
|
+
seen2.add(issue.element);
|
|
72697
72957
|
return true;
|
|
72698
72958
|
});
|
|
72699
72959
|
}
|
|
@@ -72771,7 +73031,10 @@ function parseProjectConfig(source, from) {
|
|
|
72771
73031
|
const { rules, invalid } = parseRules(body.rules);
|
|
72772
73032
|
if (Object.keys(rules).length) config.rules = rules;
|
|
72773
73033
|
config.invalid = invalid;
|
|
72774
|
-
|
|
73034
|
+
const emailType = body.emailType;
|
|
73035
|
+
if (emailType === "marketing" || emailType === "transactional") config.emailType = emailType;
|
|
73036
|
+
else if (emailType !== void 0) config.invalid.push(`emailType: ${JSON.stringify(emailType)}`);
|
|
73037
|
+
return config.skip || config.rules || config.emailType || config.invalid.length ? config : void 0;
|
|
72775
73038
|
}
|
|
72776
73039
|
function loadProjectConfig(from = process.cwd()) {
|
|
72777
73040
|
const root2 = parse6(from).root;
|
|
@@ -72818,7 +73081,7 @@ async function compile4(source, format) {
|
|
|
72818
73081
|
case "html":
|
|
72819
73082
|
return source;
|
|
72820
73083
|
case "jsx": {
|
|
72821
|
-
const { compileReactEmail: compileReactEmail2 } = await import("./react-email-
|
|
73084
|
+
const { compileReactEmail: compileReactEmail2 } = await import("./react-email-QQA75STN-LT3O7SQP.js");
|
|
72822
73085
|
return compileReactEmail2(source);
|
|
72823
73086
|
}
|
|
72824
73087
|
case "mjml": {
|
|
@@ -72859,7 +73122,7 @@ async function readInput(pathOrStdin) {
|
|
|
72859
73122
|
return readFileSync2("/dev/stdin", "utf-8");
|
|
72860
73123
|
} catch {
|
|
72861
73124
|
}
|
|
72862
|
-
return new Promise((
|
|
73125
|
+
return new Promise((resolve3, reject) => {
|
|
72863
73126
|
const chunks = [];
|
|
72864
73127
|
process.stdin.resume();
|
|
72865
73128
|
process.stdin.on("data", (chunk) => chunks.push(Buffer.from(chunk)));
|
|
@@ -72868,7 +73131,7 @@ async function readInput(pathOrStdin) {
|
|
|
72868
73131
|
if (!data2.trim()) {
|
|
72869
73132
|
reject(new Error("No input received from stdin. Pipe HTML or provide a file path."));
|
|
72870
73133
|
} else {
|
|
72871
|
-
|
|
73134
|
+
resolve3(data2);
|
|
72872
73135
|
}
|
|
72873
73136
|
});
|
|
72874
73137
|
process.stdin.on("error", () => {
|
|
@@ -72934,8 +73197,164 @@ function parseTargetingPolicy(raw) {
|
|
|
72934
73197
|
}
|
|
72935
73198
|
|
|
72936
73199
|
// src/commands/lint.ts
|
|
72937
|
-
import { readdir } from "fs/promises";
|
|
72938
|
-
|
|
73200
|
+
import { readdir, stat } from "fs/promises";
|
|
73201
|
+
|
|
73202
|
+
// src/react-email.ts
|
|
73203
|
+
import { createRequire } from "module";
|
|
73204
|
+
import { existsSync as existsSync2, mkdtempSync, readdirSync, rmSync, statSync } from "fs";
|
|
73205
|
+
import { tmpdir } from "os";
|
|
73206
|
+
import { dirname as dirname2, join as join2, resolve } from "path";
|
|
73207
|
+
var TEMPLATE = /\.(tsx|jsx)$/;
|
|
73208
|
+
var skipDir = (name) => name.startsWith("_") || name.startsWith(".") || name === "node_modules" || name === "static";
|
|
73209
|
+
function findTemplates(dir) {
|
|
73210
|
+
const out = [];
|
|
73211
|
+
for (const e2 of readdirSync(dir, { withFileTypes: true })) {
|
|
73212
|
+
if (e2.isDirectory()) {
|
|
73213
|
+
if (!skipDir(e2.name)) out.push(...findTemplates(join2(dir, e2.name)));
|
|
73214
|
+
} else if (TEMPLATE.test(e2.name)) {
|
|
73215
|
+
out.push(join2(dir, e2.name));
|
|
73216
|
+
}
|
|
73217
|
+
}
|
|
73218
|
+
return out.sort();
|
|
73219
|
+
}
|
|
73220
|
+
var EMAIL_DIRS = ["emails", "src/emails", "react-email/emails", "src/react-email/emails"];
|
|
73221
|
+
function findEmailsDir(cwd = process.cwd()) {
|
|
73222
|
+
for (const d of EMAIL_DIRS) {
|
|
73223
|
+
const p = resolve(cwd, d);
|
|
73224
|
+
if (existsSync2(p) && statSync(p).isDirectory()) return p;
|
|
73225
|
+
}
|
|
73226
|
+
return null;
|
|
73227
|
+
}
|
|
73228
|
+
function projectEsbuild(file) {
|
|
73229
|
+
const req = createRequire(file);
|
|
73230
|
+
for (const from of [file, "react-email/package.json"]) {
|
|
73231
|
+
try {
|
|
73232
|
+
const base = from === file ? req : createRequire(req.resolve(from));
|
|
73233
|
+
return base("esbuild");
|
|
73234
|
+
} catch {
|
|
73235
|
+
}
|
|
73236
|
+
}
|
|
73237
|
+
return null;
|
|
73238
|
+
}
|
|
73239
|
+
function renderModule(file) {
|
|
73240
|
+
const req = createRequire(file);
|
|
73241
|
+
try {
|
|
73242
|
+
const { version } = req("react-email/package.json");
|
|
73243
|
+
if (Number.parseInt(version, 10) >= 6) return "react-email";
|
|
73244
|
+
} catch {
|
|
73245
|
+
}
|
|
73246
|
+
for (const m2 of ["@react-email/render", "@react-email/components"]) {
|
|
73247
|
+
try {
|
|
73248
|
+
req.resolve(m2);
|
|
73249
|
+
return m2;
|
|
73250
|
+
} catch {
|
|
73251
|
+
}
|
|
73252
|
+
}
|
|
73253
|
+
return null;
|
|
73254
|
+
}
|
|
73255
|
+
function canRenderNatively(file) {
|
|
73256
|
+
return projectEsbuild(file) !== null && renderModule(file) !== null;
|
|
73257
|
+
}
|
|
73258
|
+
var TemplateError = class extends Error {
|
|
73259
|
+
constructor(file, reason) {
|
|
73260
|
+
super(`${file}: ${reason}`);
|
|
73261
|
+
this.file = file;
|
|
73262
|
+
this.reason = reason;
|
|
73263
|
+
}
|
|
73264
|
+
};
|
|
73265
|
+
async function renderTemplate(file) {
|
|
73266
|
+
const esbuild = projectEsbuild(file);
|
|
73267
|
+
const render3 = renderModule(file);
|
|
73268
|
+
if (!esbuild || !render3) throw new TemplateError(file, "esbuild and @react-email/render must be installed in the project");
|
|
73269
|
+
const entry = `
|
|
73270
|
+
import * as mod from ${JSON.stringify(resolve(file))};
|
|
73271
|
+
import { render } from ${JSON.stringify(render3)};
|
|
73272
|
+
import { createElement } from "react";
|
|
73273
|
+
const Email = mod.default;
|
|
73274
|
+
// ponytail: React's server renderer logs a component's error and still
|
|
73275
|
+
// resolves, with fallback HTML. The logged Error is the only trace, so it
|
|
73276
|
+
// is caught here and rethrown; other console.error output passes through.
|
|
73277
|
+
module.exports = typeof Email === "function"
|
|
73278
|
+
? async () => {
|
|
73279
|
+
let caught;
|
|
73280
|
+
const log = console.error;
|
|
73281
|
+
console.error = (...a) => {
|
|
73282
|
+
const e = a.find((x) => x instanceof Error);
|
|
73283
|
+
if (e) caught ??= e;
|
|
73284
|
+
else log(...a);
|
|
73285
|
+
};
|
|
73286
|
+
try {
|
|
73287
|
+
const html = await render(createElement(Email, Email.PreviewProps ?? {}));
|
|
73288
|
+
if (caught) throw caught;
|
|
73289
|
+
return html;
|
|
73290
|
+
} finally {
|
|
73291
|
+
console.error = log;
|
|
73292
|
+
}
|
|
73293
|
+
}
|
|
73294
|
+
: null;
|
|
73295
|
+
`;
|
|
73296
|
+
const tmp = mkdtempSync(join2(tmpdir(), "emailens-re-"));
|
|
73297
|
+
const out = join2(tmp, "email.cjs");
|
|
73298
|
+
try {
|
|
73299
|
+
try {
|
|
73300
|
+
await esbuild.build({
|
|
73301
|
+
stdin: { contents: entry, resolveDir: dirname2(resolve(file)), loader: "tsx", sourcefile: "emailens-entry.tsx" },
|
|
73302
|
+
bundle: true,
|
|
73303
|
+
platform: "node",
|
|
73304
|
+
format: "cjs",
|
|
73305
|
+
outfile: out,
|
|
73306
|
+
// A Next.js tsconfig says "preserve", which would leave JSX untouched.
|
|
73307
|
+
jsx: "automatic",
|
|
73308
|
+
loader: { ".css": "empty", ".png": "dataurl", ".jpg": "dataurl", ".svg": "dataurl", ".gif": "dataurl" },
|
|
73309
|
+
define: { "process.env.NODE_ENV": '"production"' },
|
|
73310
|
+
logLevel: "silent"
|
|
73311
|
+
});
|
|
73312
|
+
} catch (err) {
|
|
73313
|
+
const e2 = err;
|
|
73314
|
+
throw new TemplateError(file, e2.errors?.[0]?.text ?? err.message);
|
|
73315
|
+
}
|
|
73316
|
+
const run = createRequire(out)(out);
|
|
73317
|
+
if (!run) return null;
|
|
73318
|
+
try {
|
|
73319
|
+
return await run();
|
|
73320
|
+
} catch (err) {
|
|
73321
|
+
throw new TemplateError(file, err.message);
|
|
73322
|
+
}
|
|
73323
|
+
} finally {
|
|
73324
|
+
rmSync(tmp, { recursive: true, force: true });
|
|
73325
|
+
}
|
|
73326
|
+
}
|
|
73327
|
+
|
|
73328
|
+
// src/gate.ts
|
|
73329
|
+
var API_URL = () => process.env.EMAILENS_API_URL ?? "https://app.emailens.dev";
|
|
73330
|
+
var describe = (f3) => {
|
|
73331
|
+
if (f3.check === "worse-than-baseline") return "worse than the last version that passed";
|
|
73332
|
+
if (f3.check === "threshold") return `${f3.clientId} scores ${f3.score}, below ${f3.threshold}`;
|
|
73333
|
+
if (f3.check === "client-errors") return `${f3.clientId} has errors`;
|
|
73334
|
+
return `${f3.family}: ${f3.check}`;
|
|
73335
|
+
};
|
|
73336
|
+
async function gateEmail(html3, ref, apiKey, fetchImpl = fetch) {
|
|
73337
|
+
const fail = (summary) => ({ ref, passed: false, summary });
|
|
73338
|
+
let res;
|
|
73339
|
+
try {
|
|
73340
|
+
res = await fetchImpl(`${API_URL()}/api/gate`, {
|
|
73341
|
+
method: "POST",
|
|
73342
|
+
headers: { Authorization: `Bearer ${apiKey}`, "Content-Type": "application/json" },
|
|
73343
|
+
body: JSON.stringify({ html: html3, ref })
|
|
73344
|
+
});
|
|
73345
|
+
} catch (e2) {
|
|
73346
|
+
return fail(`could not reach Emailens: ${e2.message}`);
|
|
73347
|
+
}
|
|
73348
|
+
const body = await res.json().catch(() => ({}));
|
|
73349
|
+
if (res.status === 401) return fail("invalid or revoked API key (EMAILENS_API_KEY)");
|
|
73350
|
+
if (res.status === 403) return fail("the gate needs an API key on the Pro plan");
|
|
73351
|
+
if (!res.ok) return fail(body.error ?? `Emailens answered ${res.status}`);
|
|
73352
|
+
if (body.passed) return { ref, passed: true, summary: "passed" };
|
|
73353
|
+
return fail((body.failures ?? []).map(describe).join("; ") || "failed");
|
|
73354
|
+
}
|
|
73355
|
+
|
|
73356
|
+
// src/commands/lint.ts
|
|
73357
|
+
import { resolve as resolve2, relative } from "path";
|
|
72939
73358
|
var VALID_SKIPS = /* @__PURE__ */ new Set([
|
|
72940
73359
|
"spam",
|
|
72941
73360
|
"links",
|
|
@@ -72995,6 +73414,15 @@ var lint_default = defineCommand({
|
|
|
72995
73414
|
type: "string",
|
|
72996
73415
|
description: "Also print findings as GitHub Actions annotations, on the lines of the pull request: github"
|
|
72997
73416
|
},
|
|
73417
|
+
"email-type": {
|
|
73418
|
+
type: "string",
|
|
73419
|
+
description: "transactional: sign-in, receipts and alerts need no unsubscribe link (default: emailType in .emailensrc)"
|
|
73420
|
+
},
|
|
73421
|
+
gate: {
|
|
73422
|
+
type: "boolean",
|
|
73423
|
+
description: "Also run each email through the pre-send gate (Pro): fails on a regression against the last version that passed. Needs EMAILENS_API_KEY"
|
|
73424
|
+
},
|
|
73425
|
+
"api-key": { type: "string", description: "API key for --gate (default: EMAILENS_API_KEY)" },
|
|
72998
73426
|
quiet: {
|
|
72999
73427
|
type: "boolean",
|
|
73000
73428
|
alias: "q",
|
|
@@ -73048,16 +73476,41 @@ var lint_default = defineCommand({
|
|
|
73048
73476
|
process.exit(1);
|
|
73049
73477
|
}
|
|
73050
73478
|
const results = [];
|
|
73479
|
+
let renderFailures = 0;
|
|
73051
73480
|
let totalErrors = 0;
|
|
73052
73481
|
let totalWarnings = 0;
|
|
73482
|
+
const gateKey = args.gate ? args["api-key"] ?? process.env.EMAILENS_API_KEY : void 0;
|
|
73483
|
+
if (args.gate && !gateKey) {
|
|
73484
|
+
throw new Error("--gate needs an API key on the Pro plan: set EMAILENS_API_KEY (or pass --api-key). Keys are at app.emailens.dev/dashboard/api.");
|
|
73485
|
+
}
|
|
73486
|
+
const gates = [];
|
|
73487
|
+
const emailTypeArg = args["email-type"];
|
|
73488
|
+
if (emailTypeArg !== void 0 && emailTypeArg !== "marketing" && emailTypeArg !== "transactional") {
|
|
73489
|
+
throw new Error(`--email-type must be marketing or transactional, got: ${emailTypeArg}`);
|
|
73490
|
+
}
|
|
73491
|
+
const emailType = emailTypeArg ?? project?.emailType;
|
|
73053
73492
|
for (const file of files) {
|
|
73054
73493
|
const source = await readInput(file);
|
|
73055
73494
|
const format = resolveFormat(args.format, file, source);
|
|
73056
|
-
|
|
73495
|
+
let html3;
|
|
73496
|
+
if (format === "jsx" && !args.format && file !== "-" && canRenderNatively(file)) {
|
|
73497
|
+
try {
|
|
73498
|
+
html3 = await renderTemplate(file);
|
|
73499
|
+
} catch (err) {
|
|
73500
|
+
if (!(err instanceof TemplateError)) throw err;
|
|
73501
|
+
console.error(`${import_picocolors.default.red("error")} ${relative(process.cwd(), err.file)}: ${err.reason}`);
|
|
73502
|
+
renderFailures++;
|
|
73503
|
+
continue;
|
|
73504
|
+
}
|
|
73505
|
+
if (html3 === null) continue;
|
|
73506
|
+
} else {
|
|
73507
|
+
html3 = await compile4(source, format);
|
|
73508
|
+
}
|
|
73057
73509
|
const framework = toFramework(format);
|
|
73058
73510
|
const positions = positionsApply(format);
|
|
73059
73511
|
const targetingPolicy = parseTargetingPolicy(args.targetingPolicy);
|
|
73060
73512
|
const report = auditEmail(html3, {
|
|
73513
|
+
spam: emailType ? { emailType } : void 0,
|
|
73061
73514
|
framework,
|
|
73062
73515
|
skip,
|
|
73063
73516
|
positions,
|
|
@@ -73069,12 +73522,15 @@ var lint_default = defineCommand({
|
|
|
73069
73522
|
results.push({ file: relative(process.cwd(), file), issues, errors: errors2, warnings });
|
|
73070
73523
|
totalErrors += errors2;
|
|
73071
73524
|
totalWarnings += warnings;
|
|
73525
|
+
if (gateKey) gates.push(await gateEmail(html3, relative(process.cwd(), file).split("\\").join("/"), gateKey));
|
|
73072
73526
|
}
|
|
73527
|
+
totalErrors += renderFailures;
|
|
73528
|
+
const gateFailures = gates.filter((g3) => !g3.passed).length;
|
|
73073
73529
|
if (args.reporter === "github") {
|
|
73074
73530
|
for (const line of githubAnnotations(results, { info: args.info })) console.log(line);
|
|
73075
73531
|
}
|
|
73076
73532
|
if (args.json) {
|
|
73077
|
-
console.log(JSON.stringify({ files: results, totalErrors, totalWarnings }));
|
|
73533
|
+
console.log(JSON.stringify({ files: results, totalErrors, totalWarnings, ...gateKey ? { gate: gates } : {} }));
|
|
73078
73534
|
} else {
|
|
73079
73535
|
for (const result of results) {
|
|
73080
73536
|
console.log(import_picocolors.default.underline(result.file));
|
|
@@ -73099,16 +73555,22 @@ var lint_default = defineCommand({
|
|
|
73099
73555
|
console.log();
|
|
73100
73556
|
}
|
|
73101
73557
|
const summary = [
|
|
73102
|
-
`${
|
|
73558
|
+
`${results.length} file${results.length === 1 ? "" : "s"}`,
|
|
73103
73559
|
totalErrors > 0 ? import_picocolors.default.red(`${totalErrors} error${totalErrors === 1 ? "" : "s"}`) : null,
|
|
73104
73560
|
totalWarnings > 0 ? import_picocolors.default.yellow(`${totalWarnings} warning${totalWarnings === 1 ? "" : "s"}`) : null,
|
|
73105
|
-
totalErrors === 0 && totalWarnings === 0 ? import_picocolors.default.green("all clean") : null
|
|
73561
|
+
totalErrors === 0 && totalWarnings === 0 ? import_picocolors.default.green("all clean") : null,
|
|
73562
|
+
gateKey ? gateFailures > 0 ? import_picocolors.default.red(`gate failed on ${gateFailures}`) : import_picocolors.default.green(`gate passed on ${gates.length}`) : null
|
|
73106
73563
|
].filter(Boolean).join(" | ");
|
|
73564
|
+
for (const g3 of gates) if (!g3.passed) console.log(`${import_picocolors.default.red("gate")} ${g3.ref} ${g3.summary}`);
|
|
73107
73565
|
console.log(summary);
|
|
73566
|
+
if (results.some((r2) => r2.issues.some((i2) => i2.message.includes("(/static/")))) console.log(import_picocolors.default.dim(STATIC_HINT));
|
|
73567
|
+
if (!emailType && results.some((r2) => r2.issues.some((i2) => i2.rule === "missing-unsubscribe" && i2.severity !== "info"))) {
|
|
73568
|
+
console.log(import_picocolors.default.dim(TRANSACTIONAL_HINT));
|
|
73569
|
+
}
|
|
73108
73570
|
}
|
|
73109
73571
|
let exitCode = 0;
|
|
73110
73572
|
let reason = null;
|
|
73111
|
-
if (totalErrors > 0) {
|
|
73573
|
+
if (totalErrors > 0 || gateFailures > 0) {
|
|
73112
73574
|
exitCode = 1;
|
|
73113
73575
|
} else if (args.failOnWarning && totalWarnings > 0) {
|
|
73114
73576
|
exitCode = 2;
|
|
@@ -73136,6 +73598,8 @@ Exceeded max warnings: ${totalWarnings} > ${maxWarnings}`);
|
|
|
73136
73598
|
}
|
|
73137
73599
|
});
|
|
73138
73600
|
var HOSTED_HINT = "See it rendered in Gmail, Outlook and Apple Mail, no signup: https://app.emailens.dev/try?utm_source=cli&utm_medium=lint";
|
|
73601
|
+
var STATIC_HINT = "/static/ images load only in React Email's preview server. Set the base URL your templates use for images to a public address before you send.";
|
|
73602
|
+
var TRANSACTIONAL_HINT = 'Sign-in, receipt and alert emails need no unsubscribe link: pass --email-type transactional, or set "emailType": "transactional" in .emailensrc.';
|
|
73139
73603
|
function failureHint(exitCode, options = {}) {
|
|
73140
73604
|
if (exitCode === 0 || options.quiet) return null;
|
|
73141
73605
|
return HOSTED_HINT;
|
|
@@ -73147,7 +73611,7 @@ function githubAnnotations(results, options = {}) {
|
|
|
73147
73611
|
const prop2 = (s2) => data2(s2).replace(/:/g, "%3A").replace(/,/g, "%2C");
|
|
73148
73612
|
const lines = [];
|
|
73149
73613
|
for (const result of results) {
|
|
73150
|
-
const file = relative(root2,
|
|
73614
|
+
const file = relative(root2, resolve2(result.file)).split("\\").join("/");
|
|
73151
73615
|
for (const issue of result.issues) {
|
|
73152
73616
|
if (issue.severity === "info" && !options.info) continue;
|
|
73153
73617
|
const loc = issue.loc ?? issue.locs?.[0];
|
|
@@ -73161,7 +73625,9 @@ function githubAnnotations(results, options = {}) {
|
|
|
73161
73625
|
}
|
|
73162
73626
|
async function resolveGlob(pattern) {
|
|
73163
73627
|
if (!pattern.includes("*")) {
|
|
73164
|
-
|
|
73628
|
+
const path = resolve2(pattern);
|
|
73629
|
+
const isDir = await stat(path).then((s2) => s2.isDirectory(), () => false);
|
|
73630
|
+
return isDir ? findTemplates(path) : [path];
|
|
73165
73631
|
}
|
|
73166
73632
|
if (pattern.includes("**")) {
|
|
73167
73633
|
throw new Error("Recursive glob (**) is not supported. Use a single-level wildcard (e.g., src/*.html) or list files explicitly.");
|
|
@@ -73170,8 +73636,8 @@ async function resolveGlob(pattern) {
|
|
|
73170
73636
|
const dir = lastSep >= 0 ? pattern.slice(0, lastSep) : ".";
|
|
73171
73637
|
const glob = lastSep >= 0 ? pattern.slice(lastSep + 1) : pattern;
|
|
73172
73638
|
const regex2 = new RegExp("^" + glob.replace(/\*/g, ".*") + "$");
|
|
73173
|
-
const entries = await readdir(
|
|
73174
|
-
return entries.filter((e2) => e2.isFile() && regex2.test(e2.name)).map((e2) =>
|
|
73639
|
+
const entries = await readdir(resolve2(dir), { withFileTypes: true });
|
|
73640
|
+
return entries.filter((e2) => e2.isFile() && regex2.test(e2.name)).map((e2) => resolve2(dir, e2.name)).sort();
|
|
73175
73641
|
}
|
|
73176
73642
|
function mergeLocs(into, from) {
|
|
73177
73643
|
if (!from) return false;
|
|
@@ -73440,6 +73906,8 @@ export {
|
|
|
73440
73906
|
require_picocolors,
|
|
73441
73907
|
loadProjectConfig,
|
|
73442
73908
|
applySeverities,
|
|
73909
|
+
EMAIL_DIRS,
|
|
73910
|
+
findEmailsDir,
|
|
73443
73911
|
lint_default,
|
|
73444
73912
|
flattenToLintIssues
|
|
73445
73913
|
};
|