@emailens/engine 0.11.9 → 0.12.1
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 +264 -264
- package/dist/{chunk-PW6EUG2G.js → chunk-OA6VNA5L.js} +16 -4
- package/dist/chunk-OA6VNA5L.js.map +1 -0
- package/dist/compile/index.cjs +16 -4
- package/dist/compile/index.cjs.map +1 -1
- package/dist/compile/index.d.cts +2 -21
- package/dist/compile/index.d.ts +2 -21
- package/dist/compile/index.js +2 -2
- package/dist/index.cjs +5011 -2202
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +16 -56
- package/dist/index.d.ts +16 -56
- package/dist/index.js +5000 -2202
- package/dist/index.js.map +1 -1
- package/dist/maizzle-R5KU3HHZ.js +11 -0
- package/dist/{react-email-B82A1R_K.d.ts → react-email-CDNfg8Ta.d.ts} +1 -1
- package/dist/{react-email-DRkmpgX-.d.cts → react-email-eJhDK8a5.d.cts} +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/{types-DiseE-UH.d.cts → types-hQYXbiqj.d.cts} +109 -2
- package/dist/{types-DiseE-UH.d.ts → types-hQYXbiqj.d.ts} +109 -2
- package/package.json +1 -1
- package/dist/chunk-PW6EUG2G.js.map +0 -1
- package/dist/maizzle-KKJF7XY7.js +0 -9
- /package/dist/{maizzle-KKJF7XY7.js.map → maizzle-R5KU3HHZ.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as EmailClient, F as Framework, T as TransformResult, C as CSSWarning, a as CodeFix, D as DiffResult, b as ExportPromptOptions, A as AiProvider, c as AiFixResult, S as
|
|
2
|
-
export { B as BaseIssue,
|
|
1
|
+
import { E as EmailClient, F as Framework, T as TransformResult, C as CSSWarning, a as CodeFix, D as DiffResult, b as ExportPromptOptions, A as AiProvider, c as AiFixResult, S as StyleSurvivalReport, d as SpamAnalysisOptions, e as SpamReport, L as LinkReport, f as AccessibilityReport, g as AccessibilityIssue, I as ImageReport, h as InboxPreview, i as SizeReport, j as TemplateReport, O as OverflowReport, V as VmlReport, k as VisualReport, l as DesignReport, m as DeliverabilityReport } from './types-hQYXbiqj.cjs';
|
|
2
|
+
export { n as AT_RULE_FEATURES, B as BaseIssue, o as COMPOUND_VALUE_FEATURES, p as CSS_FUNCTION_FEATURES, q as CSS_PROPERTY_FEATURES, r as CSS_SUPPORT, s as CSS_SUPPORT_NOTES, t as ClientId, u as ClientTruncation, v as DeliverabilityCheck, w as DeliverabilityIssue, x as DesignIssue, y as EstimateOptions, z as ExportScope, G as FEATURE_LAST_TESTED, H as FeatureKey, J as FixType, K as GRACEFUL_FEATURES, M as HTML_ATTRIBUTE_FEATURES, N as HTML_ELEMENT_FEATURES, P as HTML_MISC_FEATURES, Q as IMAGE_FORMATS, R as IMAGE_SUPPORT, U as IMAGE_SUPPORT_NOTES, W as ImageFormat, X as ImageInfo, Y as ImageIssue, Z as InboxPreviewIssue, _ as InputFormat, $ as LinkInfo, a0 as LinkIssue, a1 as OverflowIssue, a2 as PreviewResult, a3 as SELECTOR_FEATURES, a4 as STRUCTURAL_FIX_PROPERTIES, a5 as SUPPORT_CLIENTS, a6 as Severity, a7 as SizeIssue, a8 as SourceLocation, a9 as SpamIssue, aa as SupportLevel, ab as TemplateIssue, ac as TokenEstimate, ad as TokenEstimateWithWarnings, ae as VisualIssue, af as VmlIssue, ag as estimateAiFixTokens, ah as generateFixPrompt, ai as heuristicTokenCount } from './types-hQYXbiqj.cjs';
|
|
3
3
|
import * as cheerio from 'cheerio';
|
|
4
|
-
export { C as CompileError, a as CompileReactEmailOptions, S as SandboxStrategy } from './react-email-
|
|
4
|
+
export { C as CompileError, a as CompileReactEmailOptions, S as SandboxStrategy } from './react-email-eJhDK8a5.cjs';
|
|
5
5
|
|
|
6
6
|
declare const EMAIL_CLIENTS: EmailClient[];
|
|
7
7
|
declare function getClient(id: string): EmailClient | undefined;
|
|
@@ -73,18 +73,6 @@ declare function simulateDarkMode(html: string, clientId: string): {
|
|
|
73
73
|
* 4. property (generic fix)
|
|
74
74
|
*/
|
|
75
75
|
declare function getCodeFix(property: string, clientId: string, framework?: Framework): CodeFix | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Look up a suggestion string for a given property, client, and optional framework.
|
|
78
|
-
*
|
|
79
|
-
* Resolution order mirrors `getCodeFix()`:
|
|
80
|
-
* 1. property::clientPrefix::framework
|
|
81
|
-
* 2. property::framework
|
|
82
|
-
* 3. property::clientPrefix
|
|
83
|
-
* 4. property (generic)
|
|
84
|
-
*
|
|
85
|
-
* `isGenericFallback` is true when a framework was specified but no
|
|
86
|
-
* framework-specific entry was found (resolution fell through to tiers 3–4).
|
|
87
|
-
*/
|
|
88
76
|
declare function getSuggestion(property: string, clientId: string, framework?: Framework): {
|
|
89
77
|
text: string;
|
|
90
78
|
isGenericFallback: boolean;
|
|
@@ -170,49 +158,19 @@ declare function generateAiFix(options: GenerateAiFixOptions): Promise<AiFixResu
|
|
|
170
158
|
declare const AI_FIX_SYSTEM_PROMPT = "You are an expert email developer specializing in cross-client HTML email compatibility. You fix emails to render correctly across all email clients.\n\nRules:\n- Return ONLY the fixed code inside a single code fence. No explanations before or after.\n- Preserve all existing content, text, links, and visual design.\n- For structural issues (fixType: \"structural\"), you MUST restructure the HTML; CSS-only changes will not work.\n- Common structural patterns:\n - word-break/overflow-wrap unsupported \u2192 wrap text in <table><tr><td> with constrained width\n - display:flex/grid \u2192 convert to <table> layout (match the original column count and proportions)\n - border-radius in Outlook \u2192 use VML <v:roundrect> with <!--[if mso]> conditionals\n - background-image in Outlook \u2192 use VML <v:rect> with <v:fill>\n - max-width in Outlook \u2192 wrap in <!--[if mso]><table width=\"N\"> conditional\n - position:absolute \u2192 use <table> cells for layout\n - <svg> \u2192 replace with <img> pointing to a hosted PNG\n- For CSS-only issues (fixType: \"css\"), swap properties or add fallbacks.\n- For \"Layout & Visual Issues\", apply the provided Fix directly: add the background-color fallback beneath a gradient/image, append a web-safe font to the stack, and constrain fixed widths wider than the frame to width:100% with max-width.\n- Apply ALL fixes from the issues list: do not skip any.\n- Use the framework syntax specified (JSX/MJML/Maizzle/HTML).\n- For JSX: use camelCase style props, React Email components, and proper TypeScript types.\n- For MJML: use mj-* elements and attributes.\n- For Maizzle: use Tailwind CSS classes.";
|
|
171
159
|
|
|
172
160
|
/**
|
|
173
|
-
*
|
|
174
|
-
* Last synced: 2026-07-28
|
|
175
|
-
* caniemail last updated: 2026-07-20 09:56:37 +0000
|
|
176
|
-
*
|
|
177
|
-
* 255 features across 21 email clients.
|
|
178
|
-
*
|
|
179
|
-
* Support levels:
|
|
180
|
-
* - "supported": fully supported
|
|
181
|
-
* - "partial": partially supported (with caveats)
|
|
182
|
-
* - "unsupported": not supported at all
|
|
183
|
-
* - "unknown": no data available
|
|
161
|
+
* Check whether the target clients will keep this email's CSS.
|
|
184
162
|
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* - hey-mail: caniemail.com (WebKit-based)
|
|
188
|
-
* - superhuman: Manual overrides (Chromium/Blink-based, best-effort estimates)
|
|
189
|
-
*
|
|
190
|
-
* DO NOT EDIT; regenerate with: bun run sync:caniemail
|
|
191
|
-
*/
|
|
192
|
-
declare const CSS_SUPPORT: Record<string, Record<string, SupportLevel>>;
|
|
193
|
-
/**
|
|
194
|
-
* Caveat notes per (feature, client) from caniemail: the "why" behind a
|
|
195
|
-
* partial/buggy/unsupported rating. Sparse: only cells with a note appear.
|
|
163
|
+
* These are not support questions. Each rule is a client discarding CSS it
|
|
164
|
+
* parsed correctly, with no error anywhere the author can see.
|
|
196
165
|
*/
|
|
197
|
-
declare
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
* to fix. These cannot be solved by replacing one CSS value with another.
|
|
201
|
-
*/
|
|
202
|
-
declare const STRUCTURAL_FIX_PROPERTIES: Set<string>;
|
|
203
|
-
/** HTML element features in the support matrix (for data-driven detection). */
|
|
204
|
-
declare const HTML_ELEMENT_FEATURES: readonly ["<abbr>", "<acronym>", "<address>", "<audio>", "<base>", "<bdi>", "<blockquote>", "<body>", "<code>", "<del>", "<dfn>", "<dialog>", "<div>", "<form>", "<h1>", "<hr>", "<img>", "<link>", "<marquee>", "<meter>", "<object>", "<p>", "<picture>", "<pre>", "<progress>", "<rp>", "<rt>", "<ruby>", "<select>", "<small>", "<span>", "<strike>", "<strong>", "<style>", "<svg>", "<table>", "<textarea>", "<ul>", "<video>", "<wbr>"];
|
|
205
|
-
/** CSS at-rule features in the support matrix. */
|
|
206
|
-
declare const AT_RULE_FEATURES: readonly ["@font-face", "@import", "@keyframes", "@media", "@supports"];
|
|
207
|
-
/** Compound CSS value features (e.g., "display:flex"). */
|
|
208
|
-
declare const COMPOUND_VALUE_FEATURES: readonly ["::after", "::before", "::first-letter", "::first-line", "::marker", "::placeholder", ":adjacent-sibling", ":attribute-selector", ":chaining", ":checked", ":child-combinator", ":class-selector", ":descendant-combinator", ":first-child", ":first-of-type", ":focus", ":focus-visible", ":focus-within", ":general-sibling", ":grouping", ":has", ":hover", ":id-selector", ":lang", ":last-child", ":last-of-type", ":link", ":not", ":nth-child", ":nth-last-child", ":nth-of-type", ":only-child", ":only-of-type", ":target", ":type-selector", ":universal-selector", ":visited", "display:flex", "display:grid", "display:none"];
|
|
209
|
-
/** CSS function features (e.g., "linear-gradient"). */
|
|
210
|
-
declare const CSS_FUNCTION_FEATURES: readonly ["calc", "clamp", "conic-gradient", "fit-content", "linear-gradient", "max", "min", "radial-gradient"];
|
|
166
|
+
declare function checkStyleSurvival(html: string, options?: ParseOptions & {
|
|
167
|
+
framework?: Framework;
|
|
168
|
+
}): StyleSurvivalReport;
|
|
211
169
|
|
|
212
170
|
/**
|
|
213
171
|
* caniemail's page for each feature, for a diagnostic's `codeDescription`.
|
|
214
172
|
*
|
|
215
|
-
*
|
|
173
|
+
* 293 of 298 features. The rest have no caniemail entry of
|
|
216
174
|
* their own and get no link, which is the honest outcome: a link to a 404
|
|
217
175
|
* is worse than none.
|
|
218
176
|
*
|
|
@@ -332,8 +290,8 @@ declare function checkDarkModeContrast(html: string, lightIssues?: Accessibility
|
|
|
332
290
|
* Analyze images in an HTML email for best practices.
|
|
333
291
|
*
|
|
334
292
|
* Checks for missing dimensions, oversized data URIs, missing alt
|
|
335
|
-
* attributes,
|
|
336
|
-
* missing display:block, and overall image heaviness.
|
|
293
|
+
* attributes, image formats the target clients cannot render, tracking
|
|
294
|
+
* pixels, missing display:block, and overall image heaviness.
|
|
337
295
|
*/
|
|
338
296
|
declare function analyzeImages(html: string, options?: ParseOptions): ImageReport;
|
|
339
297
|
|
|
@@ -477,7 +435,7 @@ interface AuditOptions extends ParseOptions {
|
|
|
477
435
|
/** Options for spam analysis */
|
|
478
436
|
spam?: SpamAnalysisOptions;
|
|
479
437
|
/** Skip specific checks */
|
|
480
|
-
skip?: Array<"spam" | "links" | "accessibility" | "images" | "compatibility" | "inboxPreview" | "size" | "templateVariables" | "overflow" | "visual" | "darkContrast" | "mobileContrast" | "design" | "vml">;
|
|
438
|
+
skip?: Array<"spam" | "links" | "accessibility" | "images" | "compatibility" | "inboxPreview" | "size" | "templateVariables" | "overflow" | "visual" | "darkContrast" | "mobileContrast" | "design" | "vml" | "styleSurvival">;
|
|
481
439
|
}
|
|
482
440
|
interface AuditReport {
|
|
483
441
|
compatibility: {
|
|
@@ -495,6 +453,8 @@ interface AuditReport {
|
|
|
495
453
|
images: ImageReport;
|
|
496
454
|
inboxPreview: InboxPreview;
|
|
497
455
|
size: SizeReport;
|
|
456
|
+
/** Rules about clients discarding CSS they parsed fine. */
|
|
457
|
+
styleSurvival: StyleSurvivalReport;
|
|
498
458
|
templateVariables: TemplateReport;
|
|
499
459
|
overflow: OverflowReport;
|
|
500
460
|
visual: VisualReport;
|
|
@@ -743,4 +703,4 @@ declare function colorDistance(a: RGBA, b: RGBA): number;
|
|
|
743
703
|
*/
|
|
744
704
|
declare function downlevelCSS(html: string): string;
|
|
745
705
|
|
|
746
|
-
export { AI_FIX_SYSTEM_PROMPT,
|
|
706
|
+
export { AI_FIX_SYSTEM_PROMPT, AccessibilityIssue, AccessibilityReport, AiFixResult, AiProvider, type AuditOptions, type AuditReport, CSSWarning, CodeFix, type CreateSessionOptions, DeliverabilityReport, DesignReport, DiffResult, EMAIL_CLIENTS, EMPTY_DELIVERABILITY, EmailClient, type EmailSession, ExportPromptOptions, FEATURE_URLS, Framework, GENERIC_LINK_TEXT, type GenerateAiFixOptions, ImageReport, InboxPreview, LinkReport, MAX_HTML_SIZE, MAX_WARNING_LOCATIONS, OverflowReport, type ParseOptions, type RGBA, type RenderContext, SizeReport, SpamAnalysisOptions, SpamReport, TemplateReport, TransformResult, VALUE_CAVEAT_PROPS, VisualReport, VmlReport, type WcagGrade, alphaBlend, analyzeEmail, analyzeImages, analyzeSpam, arcsizeToRadius, auditEmail, caveatApplies, checkAccessibility, checkDarkModeContrast, checkDarkStylesContrastFromDom, checkDesignConsistency, checkMobileContrast, checkOverflow, checkSize, checkStyleSurvival, checkTemplateVariables, checkVisual, checkVml, colorDistance, contrastRatio, createSession, diffResults, downlevelCSS, errorWarnings, extractInboxPreview, featureUrl, formatRgb, generateAiFix, generateCompatibilityScore, getClient, getCodeFix, getSuggestion, parseColor, relativeLuminance, renderOutlookBranch, resolveMsoBranch, rgbToOklab, simulateDarkMode, structuralWarnings, toPlainText, transformForAllClients, transformForClient, validateLinks, vmlToCss, warningsForClient, wcagGrade };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { E as EmailClient, F as Framework, T as TransformResult, C as CSSWarning, a as CodeFix, D as DiffResult, b as ExportPromptOptions, A as AiProvider, c as AiFixResult, S as
|
|
2
|
-
export { B as BaseIssue,
|
|
1
|
+
import { E as EmailClient, F as Framework, T as TransformResult, C as CSSWarning, a as CodeFix, D as DiffResult, b as ExportPromptOptions, A as AiProvider, c as AiFixResult, S as StyleSurvivalReport, d as SpamAnalysisOptions, e as SpamReport, L as LinkReport, f as AccessibilityReport, g as AccessibilityIssue, I as ImageReport, h as InboxPreview, i as SizeReport, j as TemplateReport, O as OverflowReport, V as VmlReport, k as VisualReport, l as DesignReport, m as DeliverabilityReport } from './types-hQYXbiqj.js';
|
|
2
|
+
export { n as AT_RULE_FEATURES, B as BaseIssue, o as COMPOUND_VALUE_FEATURES, p as CSS_FUNCTION_FEATURES, q as CSS_PROPERTY_FEATURES, r as CSS_SUPPORT, s as CSS_SUPPORT_NOTES, t as ClientId, u as ClientTruncation, v as DeliverabilityCheck, w as DeliverabilityIssue, x as DesignIssue, y as EstimateOptions, z as ExportScope, G as FEATURE_LAST_TESTED, H as FeatureKey, J as FixType, K as GRACEFUL_FEATURES, M as HTML_ATTRIBUTE_FEATURES, N as HTML_ELEMENT_FEATURES, P as HTML_MISC_FEATURES, Q as IMAGE_FORMATS, R as IMAGE_SUPPORT, U as IMAGE_SUPPORT_NOTES, W as ImageFormat, X as ImageInfo, Y as ImageIssue, Z as InboxPreviewIssue, _ as InputFormat, $ as LinkInfo, a0 as LinkIssue, a1 as OverflowIssue, a2 as PreviewResult, a3 as SELECTOR_FEATURES, a4 as STRUCTURAL_FIX_PROPERTIES, a5 as SUPPORT_CLIENTS, a6 as Severity, a7 as SizeIssue, a8 as SourceLocation, a9 as SpamIssue, aa as SupportLevel, ab as TemplateIssue, ac as TokenEstimate, ad as TokenEstimateWithWarnings, ae as VisualIssue, af as VmlIssue, ag as estimateAiFixTokens, ah as generateFixPrompt, ai as heuristicTokenCount } from './types-hQYXbiqj.js';
|
|
3
3
|
import * as cheerio from 'cheerio';
|
|
4
|
-
export { C as CompileError, a as CompileReactEmailOptions, S as SandboxStrategy } from './react-email-
|
|
4
|
+
export { C as CompileError, a as CompileReactEmailOptions, S as SandboxStrategy } from './react-email-CDNfg8Ta.js';
|
|
5
5
|
|
|
6
6
|
declare const EMAIL_CLIENTS: EmailClient[];
|
|
7
7
|
declare function getClient(id: string): EmailClient | undefined;
|
|
@@ -73,18 +73,6 @@ declare function simulateDarkMode(html: string, clientId: string): {
|
|
|
73
73
|
* 4. property (generic fix)
|
|
74
74
|
*/
|
|
75
75
|
declare function getCodeFix(property: string, clientId: string, framework?: Framework): CodeFix | undefined;
|
|
76
|
-
/**
|
|
77
|
-
* Look up a suggestion string for a given property, client, and optional framework.
|
|
78
|
-
*
|
|
79
|
-
* Resolution order mirrors `getCodeFix()`:
|
|
80
|
-
* 1. property::clientPrefix::framework
|
|
81
|
-
* 2. property::framework
|
|
82
|
-
* 3. property::clientPrefix
|
|
83
|
-
* 4. property (generic)
|
|
84
|
-
*
|
|
85
|
-
* `isGenericFallback` is true when a framework was specified but no
|
|
86
|
-
* framework-specific entry was found (resolution fell through to tiers 3–4).
|
|
87
|
-
*/
|
|
88
76
|
declare function getSuggestion(property: string, clientId: string, framework?: Framework): {
|
|
89
77
|
text: string;
|
|
90
78
|
isGenericFallback: boolean;
|
|
@@ -170,49 +158,19 @@ declare function generateAiFix(options: GenerateAiFixOptions): Promise<AiFixResu
|
|
|
170
158
|
declare const AI_FIX_SYSTEM_PROMPT = "You are an expert email developer specializing in cross-client HTML email compatibility. You fix emails to render correctly across all email clients.\n\nRules:\n- Return ONLY the fixed code inside a single code fence. No explanations before or after.\n- Preserve all existing content, text, links, and visual design.\n- For structural issues (fixType: \"structural\"), you MUST restructure the HTML; CSS-only changes will not work.\n- Common structural patterns:\n - word-break/overflow-wrap unsupported \u2192 wrap text in <table><tr><td> with constrained width\n - display:flex/grid \u2192 convert to <table> layout (match the original column count and proportions)\n - border-radius in Outlook \u2192 use VML <v:roundrect> with <!--[if mso]> conditionals\n - background-image in Outlook \u2192 use VML <v:rect> with <v:fill>\n - max-width in Outlook \u2192 wrap in <!--[if mso]><table width=\"N\"> conditional\n - position:absolute \u2192 use <table> cells for layout\n - <svg> \u2192 replace with <img> pointing to a hosted PNG\n- For CSS-only issues (fixType: \"css\"), swap properties or add fallbacks.\n- For \"Layout & Visual Issues\", apply the provided Fix directly: add the background-color fallback beneath a gradient/image, append a web-safe font to the stack, and constrain fixed widths wider than the frame to width:100% with max-width.\n- Apply ALL fixes from the issues list: do not skip any.\n- Use the framework syntax specified (JSX/MJML/Maizzle/HTML).\n- For JSX: use camelCase style props, React Email components, and proper TypeScript types.\n- For MJML: use mj-* elements and attributes.\n- For Maizzle: use Tailwind CSS classes.";
|
|
171
159
|
|
|
172
160
|
/**
|
|
173
|
-
*
|
|
174
|
-
* Last synced: 2026-07-28
|
|
175
|
-
* caniemail last updated: 2026-07-20 09:56:37 +0000
|
|
176
|
-
*
|
|
177
|
-
* 255 features across 21 email clients.
|
|
178
|
-
*
|
|
179
|
-
* Support levels:
|
|
180
|
-
* - "supported": fully supported
|
|
181
|
-
* - "partial": partially supported (with caveats)
|
|
182
|
-
* - "unsupported": not supported at all
|
|
183
|
-
* - "unknown": no data available
|
|
161
|
+
* Check whether the target clients will keep this email's CSS.
|
|
184
162
|
*
|
|
185
|
-
*
|
|
186
|
-
*
|
|
187
|
-
* - hey-mail: caniemail.com (WebKit-based)
|
|
188
|
-
* - superhuman: Manual overrides (Chromium/Blink-based, best-effort estimates)
|
|
189
|
-
*
|
|
190
|
-
* DO NOT EDIT; regenerate with: bun run sync:caniemail
|
|
191
|
-
*/
|
|
192
|
-
declare const CSS_SUPPORT: Record<string, Record<string, SupportLevel>>;
|
|
193
|
-
/**
|
|
194
|
-
* Caveat notes per (feature, client) from caniemail: the "why" behind a
|
|
195
|
-
* partial/buggy/unsupported rating. Sparse: only cells with a note appear.
|
|
163
|
+
* These are not support questions. Each rule is a client discarding CSS it
|
|
164
|
+
* parsed correctly, with no error anywhere the author can see.
|
|
196
165
|
*/
|
|
197
|
-
declare
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
* to fix. These cannot be solved by replacing one CSS value with another.
|
|
201
|
-
*/
|
|
202
|
-
declare const STRUCTURAL_FIX_PROPERTIES: Set<string>;
|
|
203
|
-
/** HTML element features in the support matrix (for data-driven detection). */
|
|
204
|
-
declare const HTML_ELEMENT_FEATURES: readonly ["<abbr>", "<acronym>", "<address>", "<audio>", "<base>", "<bdi>", "<blockquote>", "<body>", "<code>", "<del>", "<dfn>", "<dialog>", "<div>", "<form>", "<h1>", "<hr>", "<img>", "<link>", "<marquee>", "<meter>", "<object>", "<p>", "<picture>", "<pre>", "<progress>", "<rp>", "<rt>", "<ruby>", "<select>", "<small>", "<span>", "<strike>", "<strong>", "<style>", "<svg>", "<table>", "<textarea>", "<ul>", "<video>", "<wbr>"];
|
|
205
|
-
/** CSS at-rule features in the support matrix. */
|
|
206
|
-
declare const AT_RULE_FEATURES: readonly ["@font-face", "@import", "@keyframes", "@media", "@supports"];
|
|
207
|
-
/** Compound CSS value features (e.g., "display:flex"). */
|
|
208
|
-
declare const COMPOUND_VALUE_FEATURES: readonly ["::after", "::before", "::first-letter", "::first-line", "::marker", "::placeholder", ":adjacent-sibling", ":attribute-selector", ":chaining", ":checked", ":child-combinator", ":class-selector", ":descendant-combinator", ":first-child", ":first-of-type", ":focus", ":focus-visible", ":focus-within", ":general-sibling", ":grouping", ":has", ":hover", ":id-selector", ":lang", ":last-child", ":last-of-type", ":link", ":not", ":nth-child", ":nth-last-child", ":nth-of-type", ":only-child", ":only-of-type", ":target", ":type-selector", ":universal-selector", ":visited", "display:flex", "display:grid", "display:none"];
|
|
209
|
-
/** CSS function features (e.g., "linear-gradient"). */
|
|
210
|
-
declare const CSS_FUNCTION_FEATURES: readonly ["calc", "clamp", "conic-gradient", "fit-content", "linear-gradient", "max", "min", "radial-gradient"];
|
|
166
|
+
declare function checkStyleSurvival(html: string, options?: ParseOptions & {
|
|
167
|
+
framework?: Framework;
|
|
168
|
+
}): StyleSurvivalReport;
|
|
211
169
|
|
|
212
170
|
/**
|
|
213
171
|
* caniemail's page for each feature, for a diagnostic's `codeDescription`.
|
|
214
172
|
*
|
|
215
|
-
*
|
|
173
|
+
* 293 of 298 features. The rest have no caniemail entry of
|
|
216
174
|
* their own and get no link, which is the honest outcome: a link to a 404
|
|
217
175
|
* is worse than none.
|
|
218
176
|
*
|
|
@@ -332,8 +290,8 @@ declare function checkDarkModeContrast(html: string, lightIssues?: Accessibility
|
|
|
332
290
|
* Analyze images in an HTML email for best practices.
|
|
333
291
|
*
|
|
334
292
|
* Checks for missing dimensions, oversized data URIs, missing alt
|
|
335
|
-
* attributes,
|
|
336
|
-
* missing display:block, and overall image heaviness.
|
|
293
|
+
* attributes, image formats the target clients cannot render, tracking
|
|
294
|
+
* pixels, missing display:block, and overall image heaviness.
|
|
337
295
|
*/
|
|
338
296
|
declare function analyzeImages(html: string, options?: ParseOptions): ImageReport;
|
|
339
297
|
|
|
@@ -477,7 +435,7 @@ interface AuditOptions extends ParseOptions {
|
|
|
477
435
|
/** Options for spam analysis */
|
|
478
436
|
spam?: SpamAnalysisOptions;
|
|
479
437
|
/** Skip specific checks */
|
|
480
|
-
skip?: Array<"spam" | "links" | "accessibility" | "images" | "compatibility" | "inboxPreview" | "size" | "templateVariables" | "overflow" | "visual" | "darkContrast" | "mobileContrast" | "design" | "vml">;
|
|
438
|
+
skip?: Array<"spam" | "links" | "accessibility" | "images" | "compatibility" | "inboxPreview" | "size" | "templateVariables" | "overflow" | "visual" | "darkContrast" | "mobileContrast" | "design" | "vml" | "styleSurvival">;
|
|
481
439
|
}
|
|
482
440
|
interface AuditReport {
|
|
483
441
|
compatibility: {
|
|
@@ -495,6 +453,8 @@ interface AuditReport {
|
|
|
495
453
|
images: ImageReport;
|
|
496
454
|
inboxPreview: InboxPreview;
|
|
497
455
|
size: SizeReport;
|
|
456
|
+
/** Rules about clients discarding CSS they parsed fine. */
|
|
457
|
+
styleSurvival: StyleSurvivalReport;
|
|
498
458
|
templateVariables: TemplateReport;
|
|
499
459
|
overflow: OverflowReport;
|
|
500
460
|
visual: VisualReport;
|
|
@@ -743,4 +703,4 @@ declare function colorDistance(a: RGBA, b: RGBA): number;
|
|
|
743
703
|
*/
|
|
744
704
|
declare function downlevelCSS(html: string): string;
|
|
745
705
|
|
|
746
|
-
export { AI_FIX_SYSTEM_PROMPT,
|
|
706
|
+
export { AI_FIX_SYSTEM_PROMPT, AccessibilityIssue, AccessibilityReport, AiFixResult, AiProvider, type AuditOptions, type AuditReport, CSSWarning, CodeFix, type CreateSessionOptions, DeliverabilityReport, DesignReport, DiffResult, EMAIL_CLIENTS, EMPTY_DELIVERABILITY, EmailClient, type EmailSession, ExportPromptOptions, FEATURE_URLS, Framework, GENERIC_LINK_TEXT, type GenerateAiFixOptions, ImageReport, InboxPreview, LinkReport, MAX_HTML_SIZE, MAX_WARNING_LOCATIONS, OverflowReport, type ParseOptions, type RGBA, type RenderContext, SizeReport, SpamAnalysisOptions, SpamReport, TemplateReport, TransformResult, VALUE_CAVEAT_PROPS, VisualReport, VmlReport, type WcagGrade, alphaBlend, analyzeEmail, analyzeImages, analyzeSpam, arcsizeToRadius, auditEmail, caveatApplies, checkAccessibility, checkDarkModeContrast, checkDarkStylesContrastFromDom, checkDesignConsistency, checkMobileContrast, checkOverflow, checkSize, checkStyleSurvival, checkTemplateVariables, checkVisual, checkVml, colorDistance, contrastRatio, createSession, diffResults, downlevelCSS, errorWarnings, extractInboxPreview, featureUrl, formatRgb, generateAiFix, generateCompatibilityScore, getClient, getCodeFix, getSuggestion, parseColor, relativeLuminance, renderOutlookBranch, resolveMsoBranch, rgbToOklab, simulateDarkMode, structuralWarnings, toPlainText, transformForAllClients, transformForClient, validateLinks, vmlToCss, warningsForClient, wcagGrade };
|