@emailens/engine 0.12.1 → 0.12.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{chunk-UFSYNSDP.js → chunk-KKWC2C3R.js} +3 -3
- package/dist/chunk-KKWC2C3R.js.map +1 -0
- package/dist/compile/index.cjs +2 -2
- package/dist/compile/index.cjs.map +1 -1
- package/dist/compile/index.d.cts +2 -2
- package/dist/compile/index.d.ts +2 -2
- package/dist/compile/index.js +2 -2
- package/dist/index.cjs +8 -3
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +85 -4
- package/dist/index.d.ts +85 -4
- package/dist/index.js +8 -3
- package/dist/index.js.map +1 -1
- package/dist/{react-email-CVZZNVZ2.js → react-email-2DGTHWTN.js} +2 -2
- package/dist/{react-email-eJhDK8a5.d.cts → react-email-BTIw8QV8.d.ts} +9 -4
- package/dist/{react-email-CDNfg8Ta.d.ts → react-email-Dmn1QpXz.d.cts} +9 -4
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/{types-hQYXbiqj.d.cts → types-DdFHwMtT.d.cts} +2 -88
- package/dist/{types-hQYXbiqj.d.ts → types-DdFHwMtT.d.ts} +2 -88
- package/package.json +1 -1
- package/dist/chunk-UFSYNSDP.js.map +0 -1
- /package/dist/{react-email-CVZZNVZ2.js.map → react-email-2DGTHWTN.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 {
|
|
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 SupportLevel, d as StyleSurvivalReport, e as SpamAnalysisOptions, f as SpamReport, L as LinkReport, g as AccessibilityReport, h as AccessibilityIssue, I as ImageReport, i as InboxPreview, j as SizeReport, k as TemplateReport, O as OverflowReport, V as VmlReport, l as VisualReport, m as DesignReport, n as DeliverabilityReport } from './types-DdFHwMtT.cjs';
|
|
2
|
+
export { B as BaseIssue, o as ClientTruncation, p as DeliverabilityCheck, q as DeliverabilityIssue, r as DesignIssue, s as EstimateOptions, t as ExportScope, u as FixType, v as ImageInfo, w as ImageIssue, x as InboxPreviewIssue, y as InputFormat, z as LinkInfo, G as LinkIssue, H as OverflowIssue, P as PreviewResult, J as Severity, K as SizeIssue, M as SourceLocation, N as SpamIssue, Q as TemplateIssue, R as TokenEstimate, U as TokenEstimateWithWarnings, W as VisualIssue, X as VmlIssue, Y as estimateAiFixTokens, Z as generateFixPrompt, _ as heuristicTokenCount } from './types-DdFHwMtT.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-Dmn1QpXz.cjs';
|
|
5
5
|
|
|
6
6
|
declare const EMAIL_CLIENTS: EmailClient[];
|
|
7
7
|
declare function getClient(id: string): EmailClient | undefined;
|
|
@@ -157,6 +157,87 @@ declare function generateAiFix(options: GenerateAiFixOptions): Promise<AiFixResu
|
|
|
157
157
|
*/
|
|
158
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.";
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* CSS/HTML feature support matrix, auto-generated from caniemail.com.
|
|
162
|
+
* Last synced: 2026-09-02
|
|
163
|
+
* caniemail last updated: 2026-08-10 15:16:24 +0000
|
|
164
|
+
*
|
|
165
|
+
* 298 features and 14 image formats across 21 email clients.
|
|
166
|
+
*
|
|
167
|
+
* Support levels:
|
|
168
|
+
* - "supported": fully supported
|
|
169
|
+
* - "partial": partially supported (with caveats)
|
|
170
|
+
* - "unsupported": not supported at all
|
|
171
|
+
* - "unknown": no data available
|
|
172
|
+
*
|
|
173
|
+
* Data sources:
|
|
174
|
+
* - Most clients: caniemail.com API (verified data)
|
|
175
|
+
* - hey-mail: caniemail.com (WebKit-based)
|
|
176
|
+
* - superhuman: Manual overrides (Chromium/Blink-based, best-effort estimates)
|
|
177
|
+
*
|
|
178
|
+
* A client we ship as one entry although caniemail tests it on several
|
|
179
|
+
* platforms (Proton Mail, AOL, Thunderbird) is graded on its worst
|
|
180
|
+
* platform. Gmail, Outlook, Yahoo and Apple Mail ship as separate clients
|
|
181
|
+
* per platform instead.
|
|
182
|
+
*
|
|
183
|
+
* DO NOT EDIT; regenerate with: bun run sync:caniemail
|
|
184
|
+
*/
|
|
185
|
+
/** The clients every row answers for, in report order. */
|
|
186
|
+
declare const SUPPORT_CLIENTS: readonly ["gmail-web", "gmail-android", "gmail-ios", "outlook-web", "outlook-windows", "outlook-windows-legacy", "outlook-ios", "outlook-android", "outlook-macos", "apple-mail-macos", "apple-mail-ios", "yahoo-mail", "yahoo-mail-android", "yahoo-mail-ios", "samsung-mail", "thunderbird", "hey-mail", "protonmail", "aol", "fastmail", "superhuman"];
|
|
187
|
+
declare const CSS_SUPPORT: Record<string, Record<string, SupportLevel>>;
|
|
188
|
+
/**
|
|
189
|
+
* Caveat notes per (feature, client) from caniemail: the "why" behind a
|
|
190
|
+
* partial/buggy/unsupported rating. Sparse: only cells with a note appear.
|
|
191
|
+
*/
|
|
192
|
+
declare const CSS_SUPPORT_NOTES: Record<string, Record<string, string[]>>;
|
|
193
|
+
/**
|
|
194
|
+
* Image format support, keyed by format. Kept out of CSS_SUPPORT because an
|
|
195
|
+
* image format is a property of the `src`, not of a stylesheet: the image
|
|
196
|
+
* analyzer looks these up, the CSS analyzer never should.
|
|
197
|
+
*/
|
|
198
|
+
/** The image formats caniemail grades. */
|
|
199
|
+
declare const IMAGE_FORMATS: readonly ["apng", "avif", "base64", "bmp", "gif", "hdr", "heif", "ico", "jpg", "mp4", "png", "svg", "tiff", "webp"];
|
|
200
|
+
declare const IMAGE_SUPPORT: Record<string, Record<string, SupportLevel>>;
|
|
201
|
+
/** Caveat notes per (image format, client), same shape as CSS_SUPPORT_NOTES. */
|
|
202
|
+
declare const IMAGE_SUPPORT_NOTES: Record<string, Record<string, string[]>>;
|
|
203
|
+
/**
|
|
204
|
+
* Features a client merely ignores when it "does not support" them: the
|
|
205
|
+
* email renders the same either way, so these report as info, not warnings.
|
|
206
|
+
*/
|
|
207
|
+
declare const GRACEFUL_FEATURES: ReadonlySet<string>;
|
|
208
|
+
/**
|
|
209
|
+
* Properties that require HTML structural changes (not just CSS swaps)
|
|
210
|
+
* to fix. These cannot be solved by replacing one CSS value with another.
|
|
211
|
+
*/
|
|
212
|
+
declare const STRUCTURAL_FIX_PROPERTIES: Set<string>;
|
|
213
|
+
/** HTML element features in the support matrix (for data-driven detection). */
|
|
214
|
+
declare const HTML_ELEMENT_FEATURES: readonly ["<abbr>", "<acronym>", "<address>", "<audio>", "<base>", "<bdi>", "<blockquote>", "<body>", "<button type=\"reset\">", "<button type=\"submit\">", "<code>", "<del>", "<dfn>", "<dialog>", "<div>", "<form>", "<h1>", "<hr>", "<img>", "<input type=\"checkbox\">", "<input type=\"hidden\">", "<input type=\"radio\">", "<input type=\"reset\">", "<input type=\"submit\">", "<input type=\"text\">", "<link>", "<marquee>", "<meter>", "<object>", "<p>", "<picture>", "<pre>", "<progress>", "<rp>", "<rt>", "<ruby>", "<select>", "<small>", "<span>", "<strike>", "<strong>", "<style>", "<svg>", "<table>", "<textarea>", "<ul>", "<video>", "<wbr>"];
|
|
215
|
+
/** HTML attribute features. Each key is also the cheerio selector that finds it. */
|
|
216
|
+
declare const HTML_ATTRIBUTE_FEATURES: readonly ["[align]", "[aria-describedby]", "[aria-hidden]", "[aria-label]", "[aria-labelledby]", "[aria-live]", "[background]", "[cellpadding]", "[cellspacing]", "[command]", "[dir]", "[height]", "[hidden]", "[lang]", "[loading]", "[popover]", "[required]", "[role]", "[srcset]", "[target]", "[valign]", "[width]"];
|
|
217
|
+
/** Document-level and link-shaped HTML features; each has a bespoke detector. */
|
|
218
|
+
declare const HTML_MISC_FEATURES: readonly ["amp4email", "anchor-links", "doctype", "html-comments", "html5-semantics", "image-maps", "mailto-links", "meta-color-scheme"];
|
|
219
|
+
/** CSS at-rule features, including the media features that qualify `@media`. */
|
|
220
|
+
declare const AT_RULE_FEATURES: readonly ["@font-face", "@import", "@keyframes", "@media", "@media device-pixel-ratio", "@media hover", "@media orientation", "@media prefers-color-scheme", "@media prefers-reduced-motion", "@supports"];
|
|
221
|
+
/** One property paired with one value, e.g. "display:flex". */
|
|
222
|
+
declare const COMPOUND_VALUE_FEATURES: readonly ["display:flex", "display:grid", "display:none"];
|
|
223
|
+
/** Pseudo-classes, pseudo-elements and combinators, e.g. ":hover", "::after". */
|
|
224
|
+
declare const SELECTOR_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"];
|
|
225
|
+
/** CSS function features (e.g., "linear-gradient"). */
|
|
226
|
+
declare const CSS_FUNCTION_FEATURES: readonly ["calc", "clamp", "conic-gradient", "fit-content", "linear-gradient", "max", "min", "radial-gradient"];
|
|
227
|
+
/** Plain CSS property names: what an inline style or declaration can match. */
|
|
228
|
+
declare const CSS_PROPERTY_FEATURES: readonly ["!important", "accent-color", "align-items", "animation", "aspect-ratio", "backdrop-filter", "background", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-repeat", "background-size", "bimi", "block-size", "border", "border-collapse", "border-image", "border-inline", "border-inline-individual", "border-inline-longhand", "border-radius", "border-radius-logical", "border-spacing", "bottom", "box-shadow", "box-sizing", "caption-side", "clear", "clip-path", "color", "color-scheme", "column-count", "columns", "css-comments", "cursor", "custom-properties", "direction", "display", "empty-cells", "filter", "flex-direction", "flex-wrap", "float", "font", "font-family", "font-kerning", "font-size", "font-size-adjust", "font-stretch", "font-weight", "gap", "grid-template-columns", "height", "hyphenate-character", "hyphenate-limit-chars", "hyphens", "inert", "inline-size", "inset", "justify-content", "left", "letter-spacing", "light-dark", "line-height", "list-style", "list-style-image", "list-style-position", "list-style-type", "margin", "margin-block-start-end", "margin-inline-block", "margin-inline-start-end", "mask-image", "max-block-size", "max-height", "max-inline-size", "max-width", "min-block-size", "min-height", "min-inline-size", "min-width", "mix-blend-mode", "modern-color", "nesting", "object-fit", "object-position", "opacity", "orphans", "outline", "outline-offset", "overflow", "overflow-wrap", "padding", "padding-block-start-end", "padding-inline-block", "padding-inline-start-end", "position", "pseudo-class-active", "pseudo-class-default", "pseudo-class-nth-last-of-type", "resize", "rgb", "rgba", "right", "scroll-snap", "shape-margin", "shape-outside", "system-ui", "tab-size", "table-layout", "text-align", "text-align-last", "text-decoration", "text-decoration-color", "text-decoration-line", "text-decoration-skip-ink", "text-decoration-style", "text-decoration-thickness", "text-emphasis", "text-emphasis-position", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-shadow", "text-transform", "text-underline-offset", "text-underline-position", "text-wrap", "top", "transform", "transition", "unit-ch", "unit-cm", "unit-em", "unit-ex", "unit-in", "unit-initial", "unit-mm", "unit-pc", "unit-percent", "unit-pt", "unit-px", "unit-rem", "unit-vh", "unit-vmax", "unit-vmin", "unit-vw", "user-select", "vertical-align", "visibility", "white-space", "white-space-collapse", "widows", "width", "word-break", "word-spacing", "writing-mode", "z-index"];
|
|
229
|
+
/** Every feature key in CSS_SUPPORT, as a type. */
|
|
230
|
+
type FeatureKey = (typeof HTML_ELEMENT_FEATURES)[number] | (typeof HTML_ATTRIBUTE_FEATURES)[number] | (typeof HTML_MISC_FEATURES)[number] | (typeof AT_RULE_FEATURES)[number] | (typeof COMPOUND_VALUE_FEATURES)[number] | (typeof SELECTOR_FEATURES)[number] | (typeof CSS_FUNCTION_FEATURES)[number] | (typeof CSS_PROPERTY_FEATURES)[number];
|
|
231
|
+
/** An image format caniemail grades. */
|
|
232
|
+
type ImageFormat = (typeof IMAGE_FORMATS)[number];
|
|
233
|
+
/** A client the matrix answers for. */
|
|
234
|
+
type ClientId = (typeof SUPPORT_CLIENTS)[number];
|
|
235
|
+
/**
|
|
236
|
+
* When caniemail last re-tested each feature. A feature's row is only as
|
|
237
|
+
* current as its test date, whatever the file's sync date says.
|
|
238
|
+
*/
|
|
239
|
+
declare const FEATURE_LAST_TESTED: Record<string, string>;
|
|
240
|
+
|
|
160
241
|
/**
|
|
161
242
|
* Check whether the target clients will keep this email's CSS.
|
|
162
243
|
*
|
|
@@ -703,4 +784,4 @@ declare function colorDistance(a: RGBA, b: RGBA): number;
|
|
|
703
784
|
*/
|
|
704
785
|
declare function downlevelCSS(html: string): string;
|
|
705
786
|
|
|
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 };
|
|
787
|
+
export { AI_FIX_SYSTEM_PROMPT, AT_RULE_FEATURES, AccessibilityIssue, AccessibilityReport, AiFixResult, AiProvider, type AuditOptions, type AuditReport, COMPOUND_VALUE_FEATURES, CSSWarning, CSS_FUNCTION_FEATURES, CSS_PROPERTY_FEATURES, CSS_SUPPORT, CSS_SUPPORT_NOTES, type ClientId, CodeFix, type CreateSessionOptions, DeliverabilityReport, DesignReport, DiffResult, EMAIL_CLIENTS, EMPTY_DELIVERABILITY, EmailClient, type EmailSession, ExportPromptOptions, FEATURE_LAST_TESTED, FEATURE_URLS, type FeatureKey, Framework, GENERIC_LINK_TEXT, GRACEFUL_FEATURES, type GenerateAiFixOptions, HTML_ATTRIBUTE_FEATURES, HTML_ELEMENT_FEATURES, HTML_MISC_FEATURES, IMAGE_FORMATS, IMAGE_SUPPORT, IMAGE_SUPPORT_NOTES, type ImageFormat, ImageReport, InboxPreview, LinkReport, MAX_HTML_SIZE, MAX_WARNING_LOCATIONS, OverflowReport, type ParseOptions, type RGBA, type RenderContext, SELECTOR_FEATURES, STRUCTURAL_FIX_PROPERTIES, SUPPORT_CLIENTS, SizeReport, SpamAnalysisOptions, SpamReport, SupportLevel, 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 {
|
|
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 SupportLevel, d as StyleSurvivalReport, e as SpamAnalysisOptions, f as SpamReport, L as LinkReport, g as AccessibilityReport, h as AccessibilityIssue, I as ImageReport, i as InboxPreview, j as SizeReport, k as TemplateReport, O as OverflowReport, V as VmlReport, l as VisualReport, m as DesignReport, n as DeliverabilityReport } from './types-DdFHwMtT.js';
|
|
2
|
+
export { B as BaseIssue, o as ClientTruncation, p as DeliverabilityCheck, q as DeliverabilityIssue, r as DesignIssue, s as EstimateOptions, t as ExportScope, u as FixType, v as ImageInfo, w as ImageIssue, x as InboxPreviewIssue, y as InputFormat, z as LinkInfo, G as LinkIssue, H as OverflowIssue, P as PreviewResult, J as Severity, K as SizeIssue, M as SourceLocation, N as SpamIssue, Q as TemplateIssue, R as TokenEstimate, U as TokenEstimateWithWarnings, W as VisualIssue, X as VmlIssue, Y as estimateAiFixTokens, Z as generateFixPrompt, _ as heuristicTokenCount } from './types-DdFHwMtT.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-BTIw8QV8.js';
|
|
5
5
|
|
|
6
6
|
declare const EMAIL_CLIENTS: EmailClient[];
|
|
7
7
|
declare function getClient(id: string): EmailClient | undefined;
|
|
@@ -157,6 +157,87 @@ declare function generateAiFix(options: GenerateAiFixOptions): Promise<AiFixResu
|
|
|
157
157
|
*/
|
|
158
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.";
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* CSS/HTML feature support matrix, auto-generated from caniemail.com.
|
|
162
|
+
* Last synced: 2026-09-02
|
|
163
|
+
* caniemail last updated: 2026-08-10 15:16:24 +0000
|
|
164
|
+
*
|
|
165
|
+
* 298 features and 14 image formats across 21 email clients.
|
|
166
|
+
*
|
|
167
|
+
* Support levels:
|
|
168
|
+
* - "supported": fully supported
|
|
169
|
+
* - "partial": partially supported (with caveats)
|
|
170
|
+
* - "unsupported": not supported at all
|
|
171
|
+
* - "unknown": no data available
|
|
172
|
+
*
|
|
173
|
+
* Data sources:
|
|
174
|
+
* - Most clients: caniemail.com API (verified data)
|
|
175
|
+
* - hey-mail: caniemail.com (WebKit-based)
|
|
176
|
+
* - superhuman: Manual overrides (Chromium/Blink-based, best-effort estimates)
|
|
177
|
+
*
|
|
178
|
+
* A client we ship as one entry although caniemail tests it on several
|
|
179
|
+
* platforms (Proton Mail, AOL, Thunderbird) is graded on its worst
|
|
180
|
+
* platform. Gmail, Outlook, Yahoo and Apple Mail ship as separate clients
|
|
181
|
+
* per platform instead.
|
|
182
|
+
*
|
|
183
|
+
* DO NOT EDIT; regenerate with: bun run sync:caniemail
|
|
184
|
+
*/
|
|
185
|
+
/** The clients every row answers for, in report order. */
|
|
186
|
+
declare const SUPPORT_CLIENTS: readonly ["gmail-web", "gmail-android", "gmail-ios", "outlook-web", "outlook-windows", "outlook-windows-legacy", "outlook-ios", "outlook-android", "outlook-macos", "apple-mail-macos", "apple-mail-ios", "yahoo-mail", "yahoo-mail-android", "yahoo-mail-ios", "samsung-mail", "thunderbird", "hey-mail", "protonmail", "aol", "fastmail", "superhuman"];
|
|
187
|
+
declare const CSS_SUPPORT: Record<string, Record<string, SupportLevel>>;
|
|
188
|
+
/**
|
|
189
|
+
* Caveat notes per (feature, client) from caniemail: the "why" behind a
|
|
190
|
+
* partial/buggy/unsupported rating. Sparse: only cells with a note appear.
|
|
191
|
+
*/
|
|
192
|
+
declare const CSS_SUPPORT_NOTES: Record<string, Record<string, string[]>>;
|
|
193
|
+
/**
|
|
194
|
+
* Image format support, keyed by format. Kept out of CSS_SUPPORT because an
|
|
195
|
+
* image format is a property of the `src`, not of a stylesheet: the image
|
|
196
|
+
* analyzer looks these up, the CSS analyzer never should.
|
|
197
|
+
*/
|
|
198
|
+
/** The image formats caniemail grades. */
|
|
199
|
+
declare const IMAGE_FORMATS: readonly ["apng", "avif", "base64", "bmp", "gif", "hdr", "heif", "ico", "jpg", "mp4", "png", "svg", "tiff", "webp"];
|
|
200
|
+
declare const IMAGE_SUPPORT: Record<string, Record<string, SupportLevel>>;
|
|
201
|
+
/** Caveat notes per (image format, client), same shape as CSS_SUPPORT_NOTES. */
|
|
202
|
+
declare const IMAGE_SUPPORT_NOTES: Record<string, Record<string, string[]>>;
|
|
203
|
+
/**
|
|
204
|
+
* Features a client merely ignores when it "does not support" them: the
|
|
205
|
+
* email renders the same either way, so these report as info, not warnings.
|
|
206
|
+
*/
|
|
207
|
+
declare const GRACEFUL_FEATURES: ReadonlySet<string>;
|
|
208
|
+
/**
|
|
209
|
+
* Properties that require HTML structural changes (not just CSS swaps)
|
|
210
|
+
* to fix. These cannot be solved by replacing one CSS value with another.
|
|
211
|
+
*/
|
|
212
|
+
declare const STRUCTURAL_FIX_PROPERTIES: Set<string>;
|
|
213
|
+
/** HTML element features in the support matrix (for data-driven detection). */
|
|
214
|
+
declare const HTML_ELEMENT_FEATURES: readonly ["<abbr>", "<acronym>", "<address>", "<audio>", "<base>", "<bdi>", "<blockquote>", "<body>", "<button type=\"reset\">", "<button type=\"submit\">", "<code>", "<del>", "<dfn>", "<dialog>", "<div>", "<form>", "<h1>", "<hr>", "<img>", "<input type=\"checkbox\">", "<input type=\"hidden\">", "<input type=\"radio\">", "<input type=\"reset\">", "<input type=\"submit\">", "<input type=\"text\">", "<link>", "<marquee>", "<meter>", "<object>", "<p>", "<picture>", "<pre>", "<progress>", "<rp>", "<rt>", "<ruby>", "<select>", "<small>", "<span>", "<strike>", "<strong>", "<style>", "<svg>", "<table>", "<textarea>", "<ul>", "<video>", "<wbr>"];
|
|
215
|
+
/** HTML attribute features. Each key is also the cheerio selector that finds it. */
|
|
216
|
+
declare const HTML_ATTRIBUTE_FEATURES: readonly ["[align]", "[aria-describedby]", "[aria-hidden]", "[aria-label]", "[aria-labelledby]", "[aria-live]", "[background]", "[cellpadding]", "[cellspacing]", "[command]", "[dir]", "[height]", "[hidden]", "[lang]", "[loading]", "[popover]", "[required]", "[role]", "[srcset]", "[target]", "[valign]", "[width]"];
|
|
217
|
+
/** Document-level and link-shaped HTML features; each has a bespoke detector. */
|
|
218
|
+
declare const HTML_MISC_FEATURES: readonly ["amp4email", "anchor-links", "doctype", "html-comments", "html5-semantics", "image-maps", "mailto-links", "meta-color-scheme"];
|
|
219
|
+
/** CSS at-rule features, including the media features that qualify `@media`. */
|
|
220
|
+
declare const AT_RULE_FEATURES: readonly ["@font-face", "@import", "@keyframes", "@media", "@media device-pixel-ratio", "@media hover", "@media orientation", "@media prefers-color-scheme", "@media prefers-reduced-motion", "@supports"];
|
|
221
|
+
/** One property paired with one value, e.g. "display:flex". */
|
|
222
|
+
declare const COMPOUND_VALUE_FEATURES: readonly ["display:flex", "display:grid", "display:none"];
|
|
223
|
+
/** Pseudo-classes, pseudo-elements and combinators, e.g. ":hover", "::after". */
|
|
224
|
+
declare const SELECTOR_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"];
|
|
225
|
+
/** CSS function features (e.g., "linear-gradient"). */
|
|
226
|
+
declare const CSS_FUNCTION_FEATURES: readonly ["calc", "clamp", "conic-gradient", "fit-content", "linear-gradient", "max", "min", "radial-gradient"];
|
|
227
|
+
/** Plain CSS property names: what an inline style or declaration can match. */
|
|
228
|
+
declare const CSS_PROPERTY_FEATURES: readonly ["!important", "accent-color", "align-items", "animation", "aspect-ratio", "backdrop-filter", "background", "background-blend-mode", "background-clip", "background-color", "background-image", "background-origin", "background-position", "background-repeat", "background-size", "bimi", "block-size", "border", "border-collapse", "border-image", "border-inline", "border-inline-individual", "border-inline-longhand", "border-radius", "border-radius-logical", "border-spacing", "bottom", "box-shadow", "box-sizing", "caption-side", "clear", "clip-path", "color", "color-scheme", "column-count", "columns", "css-comments", "cursor", "custom-properties", "direction", "display", "empty-cells", "filter", "flex-direction", "flex-wrap", "float", "font", "font-family", "font-kerning", "font-size", "font-size-adjust", "font-stretch", "font-weight", "gap", "grid-template-columns", "height", "hyphenate-character", "hyphenate-limit-chars", "hyphens", "inert", "inline-size", "inset", "justify-content", "left", "letter-spacing", "light-dark", "line-height", "list-style", "list-style-image", "list-style-position", "list-style-type", "margin", "margin-block-start-end", "margin-inline-block", "margin-inline-start-end", "mask-image", "max-block-size", "max-height", "max-inline-size", "max-width", "min-block-size", "min-height", "min-inline-size", "min-width", "mix-blend-mode", "modern-color", "nesting", "object-fit", "object-position", "opacity", "orphans", "outline", "outline-offset", "overflow", "overflow-wrap", "padding", "padding-block-start-end", "padding-inline-block", "padding-inline-start-end", "position", "pseudo-class-active", "pseudo-class-default", "pseudo-class-nth-last-of-type", "resize", "rgb", "rgba", "right", "scroll-snap", "shape-margin", "shape-outside", "system-ui", "tab-size", "table-layout", "text-align", "text-align-last", "text-decoration", "text-decoration-color", "text-decoration-line", "text-decoration-skip-ink", "text-decoration-style", "text-decoration-thickness", "text-emphasis", "text-emphasis-position", "text-indent", "text-justify", "text-orientation", "text-overflow", "text-shadow", "text-transform", "text-underline-offset", "text-underline-position", "text-wrap", "top", "transform", "transition", "unit-ch", "unit-cm", "unit-em", "unit-ex", "unit-in", "unit-initial", "unit-mm", "unit-pc", "unit-percent", "unit-pt", "unit-px", "unit-rem", "unit-vh", "unit-vmax", "unit-vmin", "unit-vw", "user-select", "vertical-align", "visibility", "white-space", "white-space-collapse", "widows", "width", "word-break", "word-spacing", "writing-mode", "z-index"];
|
|
229
|
+
/** Every feature key in CSS_SUPPORT, as a type. */
|
|
230
|
+
type FeatureKey = (typeof HTML_ELEMENT_FEATURES)[number] | (typeof HTML_ATTRIBUTE_FEATURES)[number] | (typeof HTML_MISC_FEATURES)[number] | (typeof AT_RULE_FEATURES)[number] | (typeof COMPOUND_VALUE_FEATURES)[number] | (typeof SELECTOR_FEATURES)[number] | (typeof CSS_FUNCTION_FEATURES)[number] | (typeof CSS_PROPERTY_FEATURES)[number];
|
|
231
|
+
/** An image format caniemail grades. */
|
|
232
|
+
type ImageFormat = (typeof IMAGE_FORMATS)[number];
|
|
233
|
+
/** A client the matrix answers for. */
|
|
234
|
+
type ClientId = (typeof SUPPORT_CLIENTS)[number];
|
|
235
|
+
/**
|
|
236
|
+
* When caniemail last re-tested each feature. A feature's row is only as
|
|
237
|
+
* current as its test date, whatever the file's sync date says.
|
|
238
|
+
*/
|
|
239
|
+
declare const FEATURE_LAST_TESTED: Record<string, string>;
|
|
240
|
+
|
|
160
241
|
/**
|
|
161
242
|
* Check whether the target clients will keep this email's CSS.
|
|
162
243
|
*
|
|
@@ -703,4 +784,4 @@ declare function colorDistance(a: RGBA, b: RGBA): number;
|
|
|
703
784
|
*/
|
|
704
785
|
declare function downlevelCSS(html: string): string;
|
|
705
786
|
|
|
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 };
|
|
787
|
+
export { AI_FIX_SYSTEM_PROMPT, AT_RULE_FEATURES, AccessibilityIssue, AccessibilityReport, AiFixResult, AiProvider, type AuditOptions, type AuditReport, COMPOUND_VALUE_FEATURES, CSSWarning, CSS_FUNCTION_FEATURES, CSS_PROPERTY_FEATURES, CSS_SUPPORT, CSS_SUPPORT_NOTES, type ClientId, CodeFix, type CreateSessionOptions, DeliverabilityReport, DesignReport, DiffResult, EMAIL_CLIENTS, EMPTY_DELIVERABILITY, EmailClient, type EmailSession, ExportPromptOptions, FEATURE_LAST_TESTED, FEATURE_URLS, type FeatureKey, Framework, GENERIC_LINK_TEXT, GRACEFUL_FEATURES, type GenerateAiFixOptions, HTML_ATTRIBUTE_FEATURES, HTML_ELEMENT_FEATURES, HTML_MISC_FEATURES, IMAGE_FORMATS, IMAGE_SUPPORT, IMAGE_SUPPORT_NOTES, type ImageFormat, ImageReport, InboxPreview, LinkReport, MAX_HTML_SIZE, MAX_WARNING_LOCATIONS, OverflowReport, type ParseOptions, type RGBA, type RenderContext, SELECTOR_FEATURES, STRUCTURAL_FIX_PROPERTIES, SUPPORT_CLIENTS, SizeReport, SpamAnalysisOptions, SpamReport, SupportLevel, 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.js
CHANGED
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-2NMEKWO5.js";
|
|
9
9
|
|
|
10
10
|
// src/clients.ts
|
|
11
|
-
var
|
|
11
|
+
var CLIENTS = [
|
|
12
12
|
{
|
|
13
13
|
id: "gmail-web",
|
|
14
14
|
name: "Gmail",
|
|
@@ -183,6 +183,7 @@ var EMAIL_CLIENTS = [
|
|
|
183
183
|
icon: "monitor"
|
|
184
184
|
}
|
|
185
185
|
];
|
|
186
|
+
var EMAIL_CLIENTS = [...CLIENTS];
|
|
186
187
|
function getClient(id) {
|
|
187
188
|
return EMAIL_CLIENTS.find((c) => c.id === id);
|
|
188
189
|
}
|
|
@@ -8622,7 +8623,9 @@ var GRACEFUL_FEATURES = /* @__PURE__ */ new Set([
|
|
|
8622
8623
|
"[aria-labelledby]",
|
|
8623
8624
|
"[aria-live]",
|
|
8624
8625
|
"[lang]",
|
|
8625
|
-
"[dir]"
|
|
8626
|
+
"[dir]",
|
|
8627
|
+
"[width]",
|
|
8628
|
+
"[height]"
|
|
8626
8629
|
]);
|
|
8627
8630
|
var OUTLOOK_WORD_UNSUPPORTED = /* @__PURE__ */ new Set([
|
|
8628
8631
|
"border-radius",
|
|
@@ -14701,15 +14704,17 @@ var YAHOO_AOL = [
|
|
|
14701
14704
|
"aol"
|
|
14702
14705
|
];
|
|
14703
14706
|
var MAX_LOCS = 20;
|
|
14707
|
+
var MAX_COLOR_FUNCTION_LENGTH = 256;
|
|
14704
14708
|
function hasSpaceSeparatedColor(css) {
|
|
14705
14709
|
const fn = /\b(?:rgba?|hsla?)\(/gi;
|
|
14706
14710
|
let m;
|
|
14707
14711
|
while (m = fn.exec(css)) {
|
|
14708
14712
|
const start = m.index + m[0].length;
|
|
14713
|
+
const limit = Math.min(css.length, start + MAX_COLOR_FUNCTION_LENGTH);
|
|
14709
14714
|
let depth = 1;
|
|
14710
14715
|
let comma = false;
|
|
14711
14716
|
let i = start;
|
|
14712
|
-
for (; i <
|
|
14717
|
+
for (; i < limit && depth > 0; i++) {
|
|
14713
14718
|
const c = css[i];
|
|
14714
14719
|
if (c === "(") depth++;
|
|
14715
14720
|
else if (c === ")") depth--;
|