@emailens/engine 0.9.6 → 0.10.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 +247 -232
- package/dist/compile/index.d.cts +2 -2
- package/dist/compile/index.d.ts +2 -2
- package/dist/index.cjs +3706 -591
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +29 -10
- package/dist/index.d.ts +29 -10
- package/dist/index.js +3704 -591
- package/dist/index.js.map +1 -1
- package/dist/{react-email-M23kFFxl.d.cts → react-email-B1Rd5itD.d.cts} +1 -1
- package/dist/{react-email-TJF6usIm.d.ts → react-email-D4XyNztP.d.ts} +1 -1
- package/dist/server.d.cts +1 -1
- package/dist/server.d.ts +1 -1
- package/dist/{types-WvVf2OXX.d.cts → types-DEAn3IiX.d.cts} +21 -1
- package/dist/{types-WvVf2OXX.d.ts → types-DEAn3IiX.d.ts} +21 -1
- package/package.json +123 -121
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 SpamAnalysisOptions, e as SpamReport, L as LinkReport, f as AccessibilityReport, I as ImageReport, g as InboxPreview, h as SizeReport, i as TemplateReport, j as DeliverabilityReport } from './types-
|
|
2
|
-
export { k as AccessibilityIssue, B as BaseIssue, l as ClientTruncation, m as DeliverabilityCheck, n as DeliverabilityIssue, o as EstimateOptions, p as ExportScope, q as FixType, r as ImageInfo, s as ImageIssue, t as InboxPreviewIssue, u as InputFormat, v as LinkIssue, P as PreviewResult,
|
|
3
|
-
export { C as CompileError, a as CompileReactEmailOptions, S as SandboxStrategy } from './react-email-
|
|
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 SpamAnalysisOptions, e as SpamReport, L as LinkReport, f as AccessibilityReport, I as ImageReport, g as InboxPreview, h as SizeReport, i as TemplateReport, O as OverflowReport, V as VisualReport, j as DeliverabilityReport } from './types-DEAn3IiX.cjs';
|
|
2
|
+
export { k as AccessibilityIssue, B as BaseIssue, l as ClientTruncation, m as DeliverabilityCheck, n as DeliverabilityIssue, o as EstimateOptions, p as ExportScope, q as FixType, r as ImageInfo, s as ImageIssue, t as InboxPreviewIssue, u as InputFormat, v as LinkIssue, w as OverflowIssue, P as PreviewResult, x as Severity, y as SizeIssue, z as SpamIssue, G as TemplateIssue, H as TokenEstimate, J as TokenEstimateWithWarnings, K as VisualIssue, M as estimateAiFixTokens, N as generateFixPrompt, Q as heuristicTokenCount } from './types-DEAn3IiX.cjs';
|
|
3
|
+
export { C as CompileError, a as CompileReactEmailOptions, S as SandboxStrategy } from './react-email-B1Rd5itD.cjs';
|
|
4
4
|
|
|
5
5
|
declare const EMAIL_CLIENTS: EmailClient[];
|
|
6
6
|
declare function getClient(id: string): EmailClient | undefined;
|
|
@@ -155,14 +155,14 @@ declare function generateAiFix(options: GenerateAiFixOptions): Promise<AiFixResu
|
|
|
155
155
|
* System prompt for the AI fix provider. Consumers should pass this as
|
|
156
156
|
* the `system` parameter to their LLM call for best results.
|
|
157
157
|
*/
|
|
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 \u2014 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- Apply ALL fixes from the issues list \u2014 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.";
|
|
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 \u2014 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 \u2014 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
160
|
/**
|
|
161
161
|
* CSS/HTML feature support matrix — auto-generated from caniemail.com.
|
|
162
|
-
* Last synced: 2026-
|
|
163
|
-
* caniemail last updated: 2026-
|
|
162
|
+
* Last synced: 2026-07-28
|
|
163
|
+
* caniemail last updated: 2026-07-20 09:56:37 +0000
|
|
164
164
|
*
|
|
165
|
-
*
|
|
165
|
+
* 255 features across 21 email clients.
|
|
166
166
|
*
|
|
167
167
|
* Support levels:
|
|
168
168
|
* - "supported": fully supported
|
|
@@ -188,7 +188,7 @@ declare const HTML_ELEMENT_FEATURES: readonly ["<abbr>", "<acronym>", "<address>
|
|
|
188
188
|
/** CSS at-rule features in the support matrix. */
|
|
189
189
|
declare const AT_RULE_FEATURES: readonly ["@font-face", "@import", "@keyframes", "@media", "@supports"];
|
|
190
190
|
/** Compound CSS value features (e.g., "display:flex"). */
|
|
191
|
-
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", ":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"];
|
|
191
|
+
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"];
|
|
192
192
|
/** CSS function features (e.g., "linear-gradient"). */
|
|
193
193
|
declare const CSS_FUNCTION_FEATURES: readonly ["calc", "clamp", "conic-gradient", "fit-content", "linear-gradient", "max", "min", "radial-gradient"];
|
|
194
194
|
|
|
@@ -262,12 +262,25 @@ declare function checkSize(html: string): SizeReport;
|
|
|
262
262
|
*/
|
|
263
263
|
declare function checkTemplateVariables(html: string): TemplateReport;
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Detect content likely to overflow the email frame or mobile viewport:
|
|
267
|
+
* fixed pixel widths wider than the frame, and long unbreakable strings.
|
|
268
|
+
*/
|
|
269
|
+
declare function checkOverflow(html: string): OverflowReport;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Detect probable visual bugs in a stylized email: background images/gradients
|
|
273
|
+
* with no colour fallback, and font stacks with no web-safe fallback. Each
|
|
274
|
+
* issue includes a concrete fix.
|
|
275
|
+
*/
|
|
276
|
+
declare function checkVisual(html: string): VisualReport;
|
|
277
|
+
|
|
265
278
|
interface AuditOptions {
|
|
266
279
|
framework?: Framework;
|
|
267
280
|
/** Options for spam analysis */
|
|
268
281
|
spam?: SpamAnalysisOptions;
|
|
269
282
|
/** Skip specific checks */
|
|
270
|
-
skip?: Array<"spam" | "links" | "accessibility" | "images" | "compatibility" | "inboxPreview" | "size" | "templateVariables">;
|
|
283
|
+
skip?: Array<"spam" | "links" | "accessibility" | "images" | "compatibility" | "inboxPreview" | "size" | "templateVariables" | "overflow" | "visual">;
|
|
271
284
|
}
|
|
272
285
|
interface AuditReport {
|
|
273
286
|
compatibility: {
|
|
@@ -286,6 +299,8 @@ interface AuditReport {
|
|
|
286
299
|
inboxPreview: InboxPreview;
|
|
287
300
|
size: SizeReport;
|
|
288
301
|
templateVariables: TemplateReport;
|
|
302
|
+
overflow: OverflowReport;
|
|
303
|
+
visual: VisualReport;
|
|
289
304
|
}
|
|
290
305
|
/**
|
|
291
306
|
* Run all email analysis checks in a single call.
|
|
@@ -362,6 +377,10 @@ interface EmailSession {
|
|
|
362
377
|
checkSize(): SizeReport;
|
|
363
378
|
/** Scan for unresolved template/merge variables (shares pre-parsed DOM). */
|
|
364
379
|
checkTemplateVariables(): TemplateReport;
|
|
380
|
+
/** Detect content likely to overflow the frame / viewport (shares pre-parsed DOM). */
|
|
381
|
+
checkOverflow(): OverflowReport;
|
|
382
|
+
/** Detect probable visual bugs in stylized emails, with fixes (shares pre-parsed DOM). */
|
|
383
|
+
checkVisual(): VisualReport;
|
|
365
384
|
/**
|
|
366
385
|
* Transform HTML for a specific client.
|
|
367
386
|
*
|
|
@@ -493,4 +512,4 @@ declare function alphaBlend(fg: RGBA, bgR: number, bgG: number, bgB: number): [n
|
|
|
493
512
|
*/
|
|
494
513
|
declare function downlevelCSS(html: string): string;
|
|
495
514
|
|
|
496
|
-
export { AI_FIX_SYSTEM_PROMPT, AT_RULE_FEATURES, AccessibilityReport, AiFixResult, AiProvider, type AuditOptions, type AuditReport, COMPOUND_VALUE_FEATURES, CSSWarning, CSS_FUNCTION_FEATURES, CSS_SUPPORT, CodeFix, type CreateSessionOptions, DeliverabilityReport, DiffResult, EMAIL_CLIENTS, EMPTY_DELIVERABILITY, EmailClient, type EmailSession, ExportPromptOptions, Framework, GENERIC_LINK_TEXT, type GenerateAiFixOptions, HTML_ELEMENT_FEATURES, ImageReport, InboxPreview, LinkReport, MAX_HTML_SIZE, type RGBA, STRUCTURAL_FIX_PROPERTIES, SizeReport, SpamAnalysisOptions, SpamReport, SupportLevel, TemplateReport, TransformResult, type WcagGrade, alphaBlend, analyzeEmail, analyzeImages, analyzeSpam, auditEmail, checkAccessibility, checkSize, checkTemplateVariables, contrastRatio, createSession, diffResults, downlevelCSS, errorWarnings, extractInboxPreview, formatRgb, generateAiFix, generateCompatibilityScore, getClient, getCodeFix, getSuggestion, parseColor, relativeLuminance, simulateDarkMode, structuralWarnings, toPlainText, transformForAllClients, transformForClient, validateLinks, warningsForClient, wcagGrade };
|
|
515
|
+
export { AI_FIX_SYSTEM_PROMPT, AT_RULE_FEATURES, AccessibilityReport, AiFixResult, AiProvider, type AuditOptions, type AuditReport, COMPOUND_VALUE_FEATURES, CSSWarning, CSS_FUNCTION_FEATURES, CSS_SUPPORT, CodeFix, type CreateSessionOptions, DeliverabilityReport, DiffResult, EMAIL_CLIENTS, EMPTY_DELIVERABILITY, EmailClient, type EmailSession, ExportPromptOptions, Framework, GENERIC_LINK_TEXT, type GenerateAiFixOptions, HTML_ELEMENT_FEATURES, ImageReport, InboxPreview, LinkReport, MAX_HTML_SIZE, OverflowReport, type RGBA, STRUCTURAL_FIX_PROPERTIES, SizeReport, SpamAnalysisOptions, SpamReport, SupportLevel, TemplateReport, TransformResult, VisualReport, type WcagGrade, alphaBlend, analyzeEmail, analyzeImages, analyzeSpam, auditEmail, checkAccessibility, checkOverflow, checkSize, checkTemplateVariables, checkVisual, contrastRatio, createSession, diffResults, downlevelCSS, errorWarnings, extractInboxPreview, formatRgb, generateAiFix, generateCompatibilityScore, getClient, getCodeFix, getSuggestion, parseColor, relativeLuminance, simulateDarkMode, structuralWarnings, toPlainText, transformForAllClients, transformForClient, validateLinks, warningsForClient, wcagGrade };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
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 SpamAnalysisOptions, e as SpamReport, L as LinkReport, f as AccessibilityReport, I as ImageReport, g as InboxPreview, h as SizeReport, i as TemplateReport, j as DeliverabilityReport } from './types-
|
|
2
|
-
export { k as AccessibilityIssue, B as BaseIssue, l as ClientTruncation, m as DeliverabilityCheck, n as DeliverabilityIssue, o as EstimateOptions, p as ExportScope, q as FixType, r as ImageInfo, s as ImageIssue, t as InboxPreviewIssue, u as InputFormat, v as LinkIssue, P as PreviewResult,
|
|
3
|
-
export { C as CompileError, a as CompileReactEmailOptions, S as SandboxStrategy } from './react-email-
|
|
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 SpamAnalysisOptions, e as SpamReport, L as LinkReport, f as AccessibilityReport, I as ImageReport, g as InboxPreview, h as SizeReport, i as TemplateReport, O as OverflowReport, V as VisualReport, j as DeliverabilityReport } from './types-DEAn3IiX.js';
|
|
2
|
+
export { k as AccessibilityIssue, B as BaseIssue, l as ClientTruncation, m as DeliverabilityCheck, n as DeliverabilityIssue, o as EstimateOptions, p as ExportScope, q as FixType, r as ImageInfo, s as ImageIssue, t as InboxPreviewIssue, u as InputFormat, v as LinkIssue, w as OverflowIssue, P as PreviewResult, x as Severity, y as SizeIssue, z as SpamIssue, G as TemplateIssue, H as TokenEstimate, J as TokenEstimateWithWarnings, K as VisualIssue, M as estimateAiFixTokens, N as generateFixPrompt, Q as heuristicTokenCount } from './types-DEAn3IiX.js';
|
|
3
|
+
export { C as CompileError, a as CompileReactEmailOptions, S as SandboxStrategy } from './react-email-D4XyNztP.js';
|
|
4
4
|
|
|
5
5
|
declare const EMAIL_CLIENTS: EmailClient[];
|
|
6
6
|
declare function getClient(id: string): EmailClient | undefined;
|
|
@@ -155,14 +155,14 @@ declare function generateAiFix(options: GenerateAiFixOptions): Promise<AiFixResu
|
|
|
155
155
|
* System prompt for the AI fix provider. Consumers should pass this as
|
|
156
156
|
* the `system` parameter to their LLM call for best results.
|
|
157
157
|
*/
|
|
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 \u2014 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- Apply ALL fixes from the issues list \u2014 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.";
|
|
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 \u2014 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 \u2014 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
160
|
/**
|
|
161
161
|
* CSS/HTML feature support matrix — auto-generated from caniemail.com.
|
|
162
|
-
* Last synced: 2026-
|
|
163
|
-
* caniemail last updated: 2026-
|
|
162
|
+
* Last synced: 2026-07-28
|
|
163
|
+
* caniemail last updated: 2026-07-20 09:56:37 +0000
|
|
164
164
|
*
|
|
165
|
-
*
|
|
165
|
+
* 255 features across 21 email clients.
|
|
166
166
|
*
|
|
167
167
|
* Support levels:
|
|
168
168
|
* - "supported": fully supported
|
|
@@ -188,7 +188,7 @@ declare const HTML_ELEMENT_FEATURES: readonly ["<abbr>", "<acronym>", "<address>
|
|
|
188
188
|
/** CSS at-rule features in the support matrix. */
|
|
189
189
|
declare const AT_RULE_FEATURES: readonly ["@font-face", "@import", "@keyframes", "@media", "@supports"];
|
|
190
190
|
/** Compound CSS value features (e.g., "display:flex"). */
|
|
191
|
-
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", ":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"];
|
|
191
|
+
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"];
|
|
192
192
|
/** CSS function features (e.g., "linear-gradient"). */
|
|
193
193
|
declare const CSS_FUNCTION_FEATURES: readonly ["calc", "clamp", "conic-gradient", "fit-content", "linear-gradient", "max", "min", "radial-gradient"];
|
|
194
194
|
|
|
@@ -262,12 +262,25 @@ declare function checkSize(html: string): SizeReport;
|
|
|
262
262
|
*/
|
|
263
263
|
declare function checkTemplateVariables(html: string): TemplateReport;
|
|
264
264
|
|
|
265
|
+
/**
|
|
266
|
+
* Detect content likely to overflow the email frame or mobile viewport:
|
|
267
|
+
* fixed pixel widths wider than the frame, and long unbreakable strings.
|
|
268
|
+
*/
|
|
269
|
+
declare function checkOverflow(html: string): OverflowReport;
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Detect probable visual bugs in a stylized email: background images/gradients
|
|
273
|
+
* with no colour fallback, and font stacks with no web-safe fallback. Each
|
|
274
|
+
* issue includes a concrete fix.
|
|
275
|
+
*/
|
|
276
|
+
declare function checkVisual(html: string): VisualReport;
|
|
277
|
+
|
|
265
278
|
interface AuditOptions {
|
|
266
279
|
framework?: Framework;
|
|
267
280
|
/** Options for spam analysis */
|
|
268
281
|
spam?: SpamAnalysisOptions;
|
|
269
282
|
/** Skip specific checks */
|
|
270
|
-
skip?: Array<"spam" | "links" | "accessibility" | "images" | "compatibility" | "inboxPreview" | "size" | "templateVariables">;
|
|
283
|
+
skip?: Array<"spam" | "links" | "accessibility" | "images" | "compatibility" | "inboxPreview" | "size" | "templateVariables" | "overflow" | "visual">;
|
|
271
284
|
}
|
|
272
285
|
interface AuditReport {
|
|
273
286
|
compatibility: {
|
|
@@ -286,6 +299,8 @@ interface AuditReport {
|
|
|
286
299
|
inboxPreview: InboxPreview;
|
|
287
300
|
size: SizeReport;
|
|
288
301
|
templateVariables: TemplateReport;
|
|
302
|
+
overflow: OverflowReport;
|
|
303
|
+
visual: VisualReport;
|
|
289
304
|
}
|
|
290
305
|
/**
|
|
291
306
|
* Run all email analysis checks in a single call.
|
|
@@ -362,6 +377,10 @@ interface EmailSession {
|
|
|
362
377
|
checkSize(): SizeReport;
|
|
363
378
|
/** Scan for unresolved template/merge variables (shares pre-parsed DOM). */
|
|
364
379
|
checkTemplateVariables(): TemplateReport;
|
|
380
|
+
/** Detect content likely to overflow the frame / viewport (shares pre-parsed DOM). */
|
|
381
|
+
checkOverflow(): OverflowReport;
|
|
382
|
+
/** Detect probable visual bugs in stylized emails, with fixes (shares pre-parsed DOM). */
|
|
383
|
+
checkVisual(): VisualReport;
|
|
365
384
|
/**
|
|
366
385
|
* Transform HTML for a specific client.
|
|
367
386
|
*
|
|
@@ -493,4 +512,4 @@ declare function alphaBlend(fg: RGBA, bgR: number, bgG: number, bgB: number): [n
|
|
|
493
512
|
*/
|
|
494
513
|
declare function downlevelCSS(html: string): string;
|
|
495
514
|
|
|
496
|
-
export { AI_FIX_SYSTEM_PROMPT, AT_RULE_FEATURES, AccessibilityReport, AiFixResult, AiProvider, type AuditOptions, type AuditReport, COMPOUND_VALUE_FEATURES, CSSWarning, CSS_FUNCTION_FEATURES, CSS_SUPPORT, CodeFix, type CreateSessionOptions, DeliverabilityReport, DiffResult, EMAIL_CLIENTS, EMPTY_DELIVERABILITY, EmailClient, type EmailSession, ExportPromptOptions, Framework, GENERIC_LINK_TEXT, type GenerateAiFixOptions, HTML_ELEMENT_FEATURES, ImageReport, InboxPreview, LinkReport, MAX_HTML_SIZE, type RGBA, STRUCTURAL_FIX_PROPERTIES, SizeReport, SpamAnalysisOptions, SpamReport, SupportLevel, TemplateReport, TransformResult, type WcagGrade, alphaBlend, analyzeEmail, analyzeImages, analyzeSpam, auditEmail, checkAccessibility, checkSize, checkTemplateVariables, contrastRatio, createSession, diffResults, downlevelCSS, errorWarnings, extractInboxPreview, formatRgb, generateAiFix, generateCompatibilityScore, getClient, getCodeFix, getSuggestion, parseColor, relativeLuminance, simulateDarkMode, structuralWarnings, toPlainText, transformForAllClients, transformForClient, validateLinks, warningsForClient, wcagGrade };
|
|
515
|
+
export { AI_FIX_SYSTEM_PROMPT, AT_RULE_FEATURES, AccessibilityReport, AiFixResult, AiProvider, type AuditOptions, type AuditReport, COMPOUND_VALUE_FEATURES, CSSWarning, CSS_FUNCTION_FEATURES, CSS_SUPPORT, CodeFix, type CreateSessionOptions, DeliverabilityReport, DiffResult, EMAIL_CLIENTS, EMPTY_DELIVERABILITY, EmailClient, type EmailSession, ExportPromptOptions, Framework, GENERIC_LINK_TEXT, type GenerateAiFixOptions, HTML_ELEMENT_FEATURES, ImageReport, InboxPreview, LinkReport, MAX_HTML_SIZE, OverflowReport, type RGBA, STRUCTURAL_FIX_PROPERTIES, SizeReport, SpamAnalysisOptions, SpamReport, SupportLevel, TemplateReport, TransformResult, VisualReport, type WcagGrade, alphaBlend, analyzeEmail, analyzeImages, analyzeSpam, auditEmail, checkAccessibility, checkOverflow, checkSize, checkTemplateVariables, checkVisual, contrastRatio, createSession, diffResults, downlevelCSS, errorWarnings, extractInboxPreview, formatRgb, generateAiFix, generateCompatibilityScore, getClient, getCodeFix, getSuggestion, parseColor, relativeLuminance, simulateDarkMode, structuralWarnings, toPlainText, transformForAllClients, transformForClient, validateLinks, warningsForClient, wcagGrade };
|