@samva/markup 0.9.0 → 0.10.0
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/AGENTS.md +48 -40
- package/CHANGELOG.md +345 -0
- package/README.md +6 -6
- package/dist/{brand-B-0bN_Ir.d.ts → assets-BIsyMQ92.d.ts} +41 -11
- package/dist/{email/brand.js → brand-C0MKTwmX.js} +64 -4
- package/dist/{theme-css.d.ts → brand.d.ts} +12 -3
- package/dist/brand.js +4 -0
- package/dist/compiler.d.ts +231 -11
- package/dist/compiler.js +1312 -13
- package/dist/components-BZCqegS8.js +1864 -0
- package/dist/diagnostic-model-DJtqbETd.js +38 -0
- package/dist/diagnostic-model-DxthUZBT.d.ts +31 -0
- package/dist/{email/diagnostics.js → diagnostics-CnKFefKz.js} +2 -2
- package/dist/diagnostics.d.ts +406 -27
- package/dist/diagnostics.js +402 -34
- package/dist/edit.d.ts +234 -0
- package/dist/{channel-edit.js → edit.js} +341 -3
- package/dist/email/jsx-dev-runtime.d.ts +1 -1
- package/dist/email/jsx-dev-runtime.js +1 -2
- package/dist/email/jsx-runtime.d.ts +1 -1
- package/dist/email/jsx-runtime.js +1 -85
- package/dist/{email/components.d.ts → email.d.ts} +2 -2
- package/dist/email.js +2 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/{cascade-t6kxlgEI.js → ir-CLhlklKV.js} +8 -4
- package/dist/jsx-runtime-CBlexoeR.js +98 -0
- package/dist/{elements-cqldpaJt.d.ts → jsx-runtime-ylIOnaSf.d.ts} +74 -74
- package/dist/{profile-BH-OtdDA.js → profile-pWGtWZXF.js} +153 -20
- package/dist/render-BPonDpCl.d.ts +539 -0
- package/dist/{email/render.js → render-BQmfh94k.js} +102 -8
- package/dist/render.d.ts +35 -0
- package/dist/render.js +49 -0
- package/dist/sms.d.ts +1 -1
- package/dist/sms.js +1 -1
- package/dist/{template-_QE_rQND.d.ts → template-DMPwxMSq.d.ts} +2 -2
- package/dist/{template.js → template-zLUjcwfF.js} +2 -2
- package/dist/{theme-css-hFqcPSar.js → theme-css-JtRCm1fb.js} +2 -2
- package/dist/whatsapp.d.ts +1 -1
- package/dist/whatsapp.js +1 -1
- package/generated/contract.json +16 -10
- package/generated/reference.md +17 -10
- package/package.json +36 -119
- package/samva-brand.d.ts +4 -4
- package/skills/sml/SKILL.md +2 -2
- package/dist/assets-C5duwTya.d.ts +0 -40
- package/dist/channel-edit.d.ts +0 -121
- package/dist/channel-specs-B6M_HlaV.js +0 -29
- package/dist/compatibility-DbISoFIq.js +0 -589
- package/dist/css-BVQKICKC.d.ts +0 -109
- package/dist/diagnostic-codes.d.ts +0 -403
- package/dist/diagnostic-codes.js +0 -399
- package/dist/email/assets.d.ts +0 -2
- package/dist/email/assets.js +0 -63
- package/dist/email/brand-footer.d.ts +0 -34
- package/dist/email/brand-footer.js +0 -63
- package/dist/email/brand.d.ts +0 -2
- package/dist/email/components.js +0 -275
- package/dist/email/diagnostics.d.ts +0 -2
- package/dist/email/elements.d.ts +0 -2
- package/dist/email/elements.js +0 -299
- package/dist/email/html.d.ts +0 -2
- package/dist/email/html.js +0 -321
- package/dist/email/render.d.ts +0 -40
- package/dist/email/text.d.ts +0 -7
- package/dist/email/text.js +0 -100
- package/dist/html-BJepOwZ4.d.ts +0 -56
- package/dist/ir-aaqNE987.d.ts +0 -252
- package/dist/ir.d.ts +0 -2
- package/dist/ir.js +0 -7
- package/dist/preview-Ekdg1dXG.d.ts +0 -100
- package/dist/preview.d.ts +0 -2
- package/dist/preview.js +0 -160
- package/dist/render-ir.d.ts +0 -19
- package/dist/render-ir.js +0 -826
- package/dist/sms-segments.d.ts +0 -13
- package/dist/sms-segments.js +0 -46
- package/dist/source-edit.d.ts +0 -116
- package/dist/source-edit.js +0 -343
- package/dist/source-locations.d.ts +0 -2
- package/dist/source-locations.js +0 -16
- package/dist/static.d.ts +0 -57
- package/dist/static.js +0 -69
- package/dist/tailwind-CMYpZf1v.js +0 -614
- package/dist/template.d.ts +0 -2
- package/dist/theme-css.js +0 -2
- package/dist/theme-imports-lvBw3AD1.js +0 -109
- package/dist/transform-Ct2OMkFN.d.ts +0 -153
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { C as withoutUnsubscribeRow, S as renderedFooterMarkers, _ as EmailBrandSocialLink, a as assetUrl, b as UNSUBSCRIBE_ROW_ATTRIBUTE, c as isExternalAsset, d as BrandFooterProps, f as BrandLogoProps, g as EmailBrandFooter, h as EmailBrandAssets, i as assetEntry, l as BRAND_COMPONENT_CLASSES, m as EmailBrandAddress, n as AssetEntry, o as checkAssetBase, p as EmailBrand, r as AssetManifest, s as isAssetPath, t as ASSET_CONTENT_TYPES, u as BrandComponents, v as FOOTER_ATTRIBUTE, x as brandComponents, y as RenderedFooterMarkers } from "./assets-BIsyMQ92.js";
|
|
2
|
+
import { t as Diagnostic } from "./diagnostic-model-DxthUZBT.js";
|
|
2
3
|
import { Result } from "better-result";
|
|
4
|
+
//#region src/internal/unsubscribe-link.d.ts
|
|
5
|
+
/**
|
|
6
|
+
* The per-recipient unsubscribe URL is not known at render: the send path
|
|
7
|
+
* substitutes each delivery's link for this placeholder, or removes the
|
|
8
|
+
* unsubscribe row when the send resolved no unsubscribe group.
|
|
9
|
+
*/
|
|
10
|
+
declare const UNSUBSCRIBE_URL_PLACEHOLDER = "%samva:unsubscribe-url%";
|
|
11
|
+
//#endregion
|
|
3
12
|
//#region src/theme-css.d.ts
|
|
4
13
|
/** One `@font-face` a brand declares. `src` is the declaration value as authored. */
|
|
5
14
|
interface BrandFontFace {
|
|
@@ -61,5 +70,5 @@ declare const brandThemeVariables: (brand: BrandCss) => Readonly<Record<string,
|
|
|
61
70
|
/** The stylesheet Tailwind compiles for `@import "samva:brand"`: `brandThemeVariables` and the font faces. */
|
|
62
71
|
declare const brandTailwindCss: (brand: BrandCss) => string;
|
|
63
72
|
//#endregion
|
|
64
|
-
export { BRAND_COLOR_VARIABLE, BRAND_FOREGROUND_VARIABLE, BrandCss, BrandFontFace, brandForegroundDefaults, brandTailwindCss, brandThemeVariables, contrastForeground, darkVariableName, parseBrandCss, printBrandCss };
|
|
65
|
-
//# sourceMappingURL=
|
|
73
|
+
export { ASSET_CONTENT_TYPES, AssetEntry, AssetManifest, BRAND_COLOR_VARIABLE, BRAND_COMPONENT_CLASSES, BRAND_FOREGROUND_VARIABLE, BrandComponents, BrandCss, BrandFontFace, BrandFooterProps, BrandLogoProps, EmailBrand, EmailBrandAddress, EmailBrandAssets, EmailBrandFooter, EmailBrandSocialLink, FOOTER_ATTRIBUTE, RenderedFooterMarkers, UNSUBSCRIBE_ROW_ATTRIBUTE, UNSUBSCRIBE_URL_PLACEHOLDER, assetEntry, assetUrl, brandComponents, brandForegroundDefaults, brandTailwindCss, brandThemeVariables, checkAssetBase, contrastForeground, darkVariableName, isAssetPath, isExternalAsset, parseBrandCss, printBrandCss, renderedFooterMarkers, withoutUnsubscribeRow };
|
|
74
|
+
//# sourceMappingURL=brand.d.ts.map
|
package/dist/brand.js
ADDED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { i as UNSUBSCRIBE_URL_PLACEHOLDER } from "./unsubscribe-link-CoesnQDU.js";
|
|
2
|
+
import { a as brandThemeVariables, c as parseBrandCss, i as brandTailwindCss, l as printBrandCss, n as BRAND_FOREGROUND_VARIABLE, o as contrastForeground, r as brandForegroundDefaults, s as darkVariableName, t as BRAND_COLOR_VARIABLE } from "./theme-css-JtRCm1fb.js";
|
|
3
|
+
import { a as renderedFooterMarkers, c as assetEntry, d as isAssetPath, f as isExternalAsset, i as brandComponents, l as assetUrl, n as FOOTER_ATTRIBUTE, o as withoutUnsubscribeRow, r as UNSUBSCRIBE_ROW_ATTRIBUTE, s as ASSET_CONTENT_TYPES, t as BRAND_COMPONENT_CLASSES, u as checkAssetBase } from "./brand-C0MKTwmX.js";
|
|
4
|
+
export { ASSET_CONTENT_TYPES, BRAND_COLOR_VARIABLE, BRAND_COMPONENT_CLASSES, BRAND_FOREGROUND_VARIABLE, FOOTER_ATTRIBUTE, UNSUBSCRIBE_ROW_ATTRIBUTE, UNSUBSCRIBE_URL_PLACEHOLDER, assetEntry, assetUrl, brandComponents, brandForegroundDefaults, brandTailwindCss, brandThemeVariables, checkAssetBase, contrastForeground, darkVariableName, isAssetPath, isExternalAsset, parseBrandCss, printBrandCss, renderedFooterMarkers, withoutUnsubscribeRow };
|
package/dist/compiler.d.ts
CHANGED
|
@@ -1,13 +1,67 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import { a as TemplateDiagnostic, r as EmailDiagnostic } from "./diagnostics-B-Gym34R.js";
|
|
2
|
+
import { r as EmailNode } from "./jsx-runtime-ylIOnaSf.js";
|
|
3
|
+
import { n as AssetEntry, p as EmailBrand, u as BrandComponents } from "./assets-BIsyMQ92.js";
|
|
4
|
+
import { C as Compound, D as EmittedPosition, S as CompiledSelector, T as matchesSelector, _ as Specificity, b as parseStylesheet, ct as TemplateIr, g as CssRule, h as CssDeclaration, r as RenderedEmail, v as Stylesheet, w as classListOf, x as Ancestry, y as compileSelector } from "./render-BPonDpCl.js";
|
|
5
|
+
import { a as TEMPLATE_NAME_PATTERN, n as EmailContent } from "./template-DMPwxMSq.js";
|
|
6
|
+
import { caniemail } from "caniemail";
|
|
7
|
+
//#region src/email/compatibility.d.ts
|
|
8
|
+
type CaniemailClient = Parameters<typeof caniemail>[0]["clients"][number];
|
|
9
|
+
/** One client this compiler makes claims about. */
|
|
10
|
+
interface EmailClientTarget {
|
|
11
|
+
readonly id: CaniemailClient;
|
|
12
|
+
readonly label: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The pinned matrix. Every finding is reported per client, and a client absent
|
|
16
|
+
* from this list is a client Samva makes no claim about.
|
|
17
|
+
*/
|
|
18
|
+
declare const EMAIL_CLIENT_MATRIX: readonly EmailClientTarget[];
|
|
19
|
+
interface CompatibilityProvenance {
|
|
20
|
+
/** The exact rules package a finding came from. */
|
|
21
|
+
readonly rules: string;
|
|
22
|
+
readonly apiVersion: string;
|
|
23
|
+
/** The day caniemail last changed the data this build was checked against. */
|
|
24
|
+
readonly lastUpdate: string;
|
|
25
|
+
}
|
|
26
|
+
declare const COMPATIBILITY_PROVENANCE: CompatibilityProvenance;
|
|
27
|
+
/**
|
|
28
|
+
* The constructs whose loss actually breaks a message: the recipient reads
|
|
29
|
+
* something different, in a different order, follows a link that does not work,
|
|
30
|
+
* or sees a layout that has collapsed. A target client dropping one of these
|
|
31
|
+
* blocks publication.
|
|
32
|
+
*
|
|
33
|
+
* The list is deliberately short and enumerated, because the contract is to
|
|
34
|
+
* block *known* failures. Nonessential differences require an assessment of
|
|
35
|
+
* emitted values: a concrete risk warns, expected differences and unverified
|
|
36
|
+
* behavior remain compatibility observations.
|
|
37
|
+
*/
|
|
38
|
+
declare const ESSENTIAL_CONSTRUCTS: ReadonlySet<string>;
|
|
39
|
+
interface CompatibilityInput {
|
|
40
|
+
/** The document the recipient receives. */
|
|
41
|
+
readonly html: string;
|
|
42
|
+
/** The declared fixture checked by this invocation. */
|
|
43
|
+
readonly fixture?: string | undefined;
|
|
44
|
+
/** Retained head rules, when they are not already inside the HTML. */
|
|
45
|
+
readonly css?: string | undefined;
|
|
46
|
+
/** Emitted-offset ranges with the origins of the node that produced them. */
|
|
47
|
+
readonly positions?: readonly EmittedPosition[] | undefined;
|
|
48
|
+
readonly clients?: readonly EmailClientTarget[] | undefined;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Check the emitted document against the pinned matrix.
|
|
52
|
+
*
|
|
53
|
+
* Findings are grouped by construct rather than repeated per client, so one
|
|
54
|
+
* unsupported property is one diagnostic naming every client that drops it.
|
|
55
|
+
*/
|
|
56
|
+
declare const checkEmailCompatibility: (input: CompatibilityInput) => readonly EmailDiagnostic[];
|
|
57
|
+
/**
|
|
58
|
+
* Constructs the pinned data says nothing about for a target client. These are
|
|
59
|
+
* reported so "we did not check that" is never mistaken for "that works".
|
|
60
|
+
*/
|
|
61
|
+
declare const unknownCoverage: (titles: Iterable<string>) => readonly EmailDiagnostic[];
|
|
62
|
+
/** A publication carrying one of these is refused; the message would arrive broken. */
|
|
63
|
+
declare const hasBlockingCompatibility: (findings: readonly EmailDiagnostic[]) => boolean;
|
|
64
|
+
//#endregion
|
|
11
65
|
//#region src/email/css-values.d.ts
|
|
12
66
|
/**
|
|
13
67
|
* Expand `var(--x, fallback)` against the collected custom properties.
|
|
@@ -64,6 +118,93 @@ declare const applyStylesheet: (root: EmailNode, sheet: Stylesheet, options?: {
|
|
|
64
118
|
/** The exact Tailwind release the compiler runs, recorded in every build manifest. */
|
|
65
119
|
declare const TAILWIND_VERSION = "4.3.3";
|
|
66
120
|
//#endregion
|
|
121
|
+
//#region src/email/tailwind.d.ts
|
|
122
|
+
interface TailwindOptions {
|
|
123
|
+
/**
|
|
124
|
+
* Project CSS appended to the compiled entry: `@theme` overrides, `@utility`
|
|
125
|
+
* definitions and ordinary rules. This is the project's pinned configuration.
|
|
126
|
+
*/
|
|
127
|
+
readonly css?: string | undefined;
|
|
128
|
+
/**
|
|
129
|
+
* The project path `css` was read from (`theme.css` by default). Its
|
|
130
|
+
* relative `@import`s resolve from this file's directory.
|
|
131
|
+
*/
|
|
132
|
+
readonly cssPath?: string | undefined;
|
|
133
|
+
/** Classes the compiler cannot discover, declared by the project on purpose. */
|
|
134
|
+
readonly safelist?: readonly string[] | undefined;
|
|
135
|
+
/** Tailwind's browser reset is off by default; email clients do not want it. */
|
|
136
|
+
readonly preflight?: boolean | undefined;
|
|
137
|
+
/**
|
|
138
|
+
* Bounds on what the compiler may generate. Class discovery reads authored
|
|
139
|
+
* source, so a project can hand it an unbounded candidate set and get an
|
|
140
|
+
* unbounded stylesheet back — inside a build that has a wall clock and a
|
|
141
|
+
* bundle a Worker then has to load. A host that publishes supplies these.
|
|
142
|
+
*/
|
|
143
|
+
readonly limits?: TailwindLimits | undefined;
|
|
144
|
+
}
|
|
145
|
+
interface TailwindLimits {
|
|
146
|
+
/** Distinct classes handed to the compiler. */
|
|
147
|
+
readonly candidates: number;
|
|
148
|
+
/** Bytes of generated CSS. */
|
|
149
|
+
readonly cssBytes: number;
|
|
150
|
+
}
|
|
151
|
+
interface TailwindOutput {
|
|
152
|
+
readonly css: string;
|
|
153
|
+
readonly version: string;
|
|
154
|
+
/** Every candidate handed to the compiler, sorted, for the build manifest. */
|
|
155
|
+
readonly candidates: readonly string[];
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* What the project theme's `@import`s resolve to, already checked by
|
|
159
|
+
* `resolveThemeImports`: project stylesheets by path, and the brand theme
|
|
160
|
+
* `samva:brand` stands for.
|
|
161
|
+
*/
|
|
162
|
+
interface TailwindImports {
|
|
163
|
+
readonly stylesheets: ReadonlyMap<string, string>;
|
|
164
|
+
readonly brandCss?: string | undefined;
|
|
165
|
+
}
|
|
166
|
+
/** Compile the discovered class set into CSS with the pinned Tailwind release. */
|
|
167
|
+
declare const compileTailwind: (candidates: Iterable<string>, options?: TailwindOptions, imports?: TailwindImports) => Promise<TailwindOutput>;
|
|
168
|
+
interface ClassDiscovery {
|
|
169
|
+
readonly candidates: readonly string[];
|
|
170
|
+
readonly diagnostics: readonly EmailDiagnostic[];
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* Collect the class names one module states literally, and report the positions
|
|
174
|
+
* where a class is assembled from values the compiler cannot see.
|
|
175
|
+
*/
|
|
176
|
+
declare const discoverClassCandidates: (source: string, fileName: string) => ClassDiscovery;
|
|
177
|
+
//#endregion
|
|
178
|
+
//#region src/email/transform.d.ts
|
|
179
|
+
/** Where this build serves assets from, and how Tailwind is configured. */
|
|
180
|
+
interface TransformOptions {
|
|
181
|
+
readonly assetBase: string;
|
|
182
|
+
/** `false` compiles no Tailwind at all. */
|
|
183
|
+
readonly tailwind?: TailwindOptions | false | undefined;
|
|
184
|
+
/**
|
|
185
|
+
* The brand `samva:brand` resolves to, supplied by the host. A project that
|
|
186
|
+
* imports `samva:brand` with no brand here fails to compile.
|
|
187
|
+
*/
|
|
188
|
+
readonly brand?: EmailBrand | undefined;
|
|
189
|
+
}
|
|
190
|
+
interface ProjectTransform {
|
|
191
|
+
readonly assets: readonly AssetEntry[];
|
|
192
|
+
/** The compiled Tailwind sheet, when the project used any utility class. */
|
|
193
|
+
readonly tailwindSheet: Stylesheet | undefined;
|
|
194
|
+
/** Every project stylesheet, parsed, by path. */
|
|
195
|
+
readonly stylesheets: ReadonlyMap<string, Stylesheet>;
|
|
196
|
+
readonly diagnostics: readonly EmailDiagnostic[];
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* The `samva:brand` specifier a project imports — from its theme's `@import`s
|
|
200
|
+
* or its TSX — so a host can fetch that brand before it compiles. `undefined`
|
|
201
|
+
* when the project imports no brand. A project that names two brands gets the
|
|
202
|
+
* first here and a refusal from the compile.
|
|
203
|
+
*/
|
|
204
|
+
declare const projectBrandSpecifier: (files: Readonly<Record<string, string | Uint8Array>>, themePath?: string) => string | undefined;
|
|
205
|
+
/** Read a whole project, then compile the classes its scripts used. */
|
|
206
|
+
declare const transformProject: (files: Readonly<Record<string, string | Uint8Array>>, options: TransformOptions) => Promise<ProjectTransform>;
|
|
207
|
+
//#endregion
|
|
67
208
|
//#region src/email/theme-imports.d.ts
|
|
68
209
|
/** The CSS and TSX specifier a template uses to reach its organization's brand. */
|
|
69
210
|
declare const BRAND_SPECIFIER = "samva:brand";
|
|
@@ -72,5 +213,84 @@ declare const parseBrandSpecifier: (specifier: string) => {
|
|
|
72
213
|
readonly slug: string | undefined;
|
|
73
214
|
} | undefined;
|
|
74
215
|
//#endregion
|
|
75
|
-
|
|
216
|
+
//#region src/email/brand-footer.d.ts
|
|
217
|
+
/** A footer block for the send path to append, and its plain-text tail. */
|
|
218
|
+
interface RenderedBrandFooter {
|
|
219
|
+
readonly html: string;
|
|
220
|
+
readonly text: string;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Render `BrandFooter` against a brand on its own, for the send path to
|
|
224
|
+
* append to a message whose template renders no footer of its own. It
|
|
225
|
+
* compiles the same component, styled by the same brand theme, a template
|
|
226
|
+
* would get from `samva:brand`. Without `unsubscribe` the unsubscribe row is
|
|
227
|
+
* left out.
|
|
228
|
+
*/
|
|
229
|
+
declare const renderBrandFooter: (brand: EmailBrand, options: {
|
|
230
|
+
readonly unsubscribe: boolean;
|
|
231
|
+
}) => Promise<RenderedBrandFooter>;
|
|
232
|
+
/**
|
|
233
|
+
* Render content against a brand as a project whose `theme.css` is
|
|
234
|
+
* `@import "samva:brand";` renders it: Tailwind compiles the brand theme for
|
|
235
|
+
* the classes the content names, `BrandLogo` and `BrandFooter` are bound to the
|
|
236
|
+
* brand, and the render inlines the result. A brand preview renders through
|
|
237
|
+
* this, so it shows what a template importing the brand compiles to.
|
|
238
|
+
*/
|
|
239
|
+
declare const renderBrandSample: (brand: EmailBrand, sample: {
|
|
240
|
+
/** Every class the content names; nothing is discovered from source here. */
|
|
241
|
+
readonly classes: readonly string[];
|
|
242
|
+
readonly render: (components: BrandComponents) => EmailContent;
|
|
243
|
+
}) => Promise<RenderedEmail>;
|
|
244
|
+
//#endregion
|
|
245
|
+
//#region src/sml/lower-project.d.ts
|
|
246
|
+
interface CompiledTemplate {
|
|
247
|
+
/** The IR, or `undefined` when a finding blocks it. */
|
|
248
|
+
readonly ir: TemplateIr | undefined;
|
|
249
|
+
/** The fixtures read from the entry, with imported assets resolved to their URLs. */
|
|
250
|
+
readonly fixtures: Readonly<Record<string, unknown>>;
|
|
251
|
+
readonly assets: readonly AssetEntry[];
|
|
252
|
+
/** Errors block the IR; warnings ride along. */
|
|
253
|
+
readonly diagnostics: readonly TemplateDiagnostic[];
|
|
254
|
+
}
|
|
255
|
+
//#endregion
|
|
256
|
+
//#region src/sml/compile.d.ts
|
|
257
|
+
interface CompileTemplateOptions extends TransformOptions {
|
|
258
|
+
/** The project's files by path. Binary files are addressed as assets. */
|
|
259
|
+
readonly files: Readonly<Record<string, string | Uint8Array>>;
|
|
260
|
+
/** The entry: a `.tsx` file that default-exports `defineTemplate({ ... })`. */
|
|
261
|
+
readonly entry: string;
|
|
262
|
+
/**
|
|
263
|
+
* The portable JSON Schema, for an entry whose `schema` is not a literal `jsonSchema(...)`
|
|
264
|
+
* (a Zod or Effect schema needs a library to become JSON Schema). A host that has evaluated the
|
|
265
|
+
* schema passes its conversion here; a literal schema is read from source and this is ignored.
|
|
266
|
+
*/
|
|
267
|
+
readonly schema?: Readonly<Record<string, unknown>> | undefined;
|
|
268
|
+
}
|
|
269
|
+
/** Compile a project's entry template to IR without evaluating any of it. */
|
|
270
|
+
declare const compileTemplate: (options: CompileTemplateOptions) => Promise<CompiledTemplate>;
|
|
271
|
+
//#endregion
|
|
272
|
+
//#region src/sml/compatibility.d.ts
|
|
273
|
+
/**
|
|
274
|
+
* Check what each declared fixture delivers against the pinned client matrix. The rules run on the
|
|
275
|
+
* rendered document, because what a client drops is what the compiler produced, and every finding
|
|
276
|
+
* is located at the source of the element that produced it.
|
|
277
|
+
*/
|
|
278
|
+
declare const checkTemplateCompatibility: (ir: TemplateIr, fixtures: Readonly<Record<string, unknown>>, options?: {
|
|
279
|
+
readonly clients?: readonly EmailClientTarget[] | undefined;
|
|
280
|
+
}) => readonly EmailDiagnostic[];
|
|
281
|
+
//#endregion
|
|
282
|
+
//#region src/sml/profile.d.ts
|
|
283
|
+
/**
|
|
284
|
+
* Check an entry against the static profile. Pass the entry's source alone, or the project's files
|
|
285
|
+
* and the entry's path. Imports of files that are absent are trusted to exist, and the brand,
|
|
286
|
+
* Tailwind and theme are not resolved, so the result holds only findings the source itself owns.
|
|
287
|
+
*/
|
|
288
|
+
declare const checkStaticProfile: (files: string | Readonly<Record<string, string | Uint8Array>>, entry?: string) => readonly TemplateDiagnostic[];
|
|
289
|
+
/**
|
|
290
|
+
* The errors in `after` that `before` did not already have, compared by code and message so a
|
|
291
|
+
* finding that only moved does not count as new.
|
|
292
|
+
*/
|
|
293
|
+
declare const introducedProfileErrors: (before: readonly TemplateDiagnostic[], after: readonly TemplateDiagnostic[]) => readonly TemplateDiagnostic[];
|
|
294
|
+
//#endregion
|
|
295
|
+
export { type Ancestry, type AppliedStyles, BRAND_SPECIFIER, COMPATIBILITY_PROVENANCE, type ClassDiscovery, type CompatibilityInput, type CompatibilityProvenance, type CompileTemplateOptions, type CompiledSelector, type CompiledTemplate, type Compound, type CssDeclaration, type CssRule, EMAIL_CLIENT_MATRIX, ESSENTIAL_CONSTRUCTS, type EmailClientTarget, type EmailContent, type ProjectTransform, type RenderedBrandFooter, type Specificity, type Stylesheet, TAILWIND_VERSION, TEMPLATE_NAME_PATTERN, type TailwindLimits, type TailwindOptions, type TailwindOutput, type TransformOptions, applyStylesheet, checkEmailCompatibility, checkStaticProfile, checkTemplateCompatibility, classListOf, compileSelector, compileTailwind, compileTemplate, discoverClassCandidates, downlevelColors, downlevelMediaQuery, finalizeValue, foldCalc, formatColor, hasBlockingCompatibility, introducedProfileErrors, matchesSelector, parseBrandSpecifier, parseColor, parseStylesheet, projectBrandSpecifier, renderBrandFooter, renderBrandSample, renderHeadCss, resolveVariables, transformProject, unknownCoverage };
|
|
76
296
|
//# sourceMappingURL=compiler.d.ts.map
|