@samva/markup 0.1.1 → 0.2.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 +25 -5
- package/README.md +92 -26
- package/dist/{ast-DAhnAvQN.d.ts → ast-63I-VLQx.d.ts} +15 -2
- package/dist/ast.d.ts +2 -2
- package/dist/ast.js +15 -2
- package/dist/{checks-CW0nFj5n.js → checks-DXuERO4B.js} +37 -3
- package/dist/checks.d.ts +8 -1
- package/dist/checks.js +2 -2
- package/dist/compile-sms.d.ts +2 -2
- package/dist/compile-whatsapp.d.ts +2 -2
- package/dist/compile.d.ts +9 -84
- package/dist/compile.js +11 -920
- package/dist/compiler.d.ts +301 -0
- package/dist/compiler.js +1389 -0
- package/dist/components.d.ts +4 -4
- package/dist/conditionals.js +1 -1
- package/dist/corpus-Dz5irJ9x.d.ts +161 -0
- package/dist/diagnostics-Djd9ckLg.d.ts +90 -0
- package/dist/diagnostics.js +6 -3
- package/dist/elements-DtwKlFVH.d.ts +820 -0
- package/dist/email/components.d.ts +119 -0
- package/dist/email/components.js +207 -0
- package/dist/email/diagnostics.d.ts +2 -0
- package/dist/email/diagnostics.js +56 -0
- package/dist/email/elements.d.ts +2 -0
- package/dist/email/elements.js +299 -0
- package/dist/email/html.d.ts +42 -0
- package/dist/email/html.js +266 -0
- package/dist/email/jsx-dev-runtime.d.ts +26 -0
- package/dist/email/jsx-dev-runtime.js +12 -0
- package/dist/email/jsx-runtime.d.ts +2 -0
- package/dist/email/jsx-runtime.js +60 -0
- package/dist/email/render.d.ts +36 -0
- package/dist/email/render.js +6 -0
- package/dist/email/selection.d.ts +102 -0
- package/dist/email/selection.js +143 -0
- package/dist/email/source-edit.d.ts +67 -0
- package/dist/email/source-edit.js +185 -0
- package/dist/email/stylesheets.d.ts +2 -0
- package/dist/email/stylesheets.js +43 -0
- package/dist/email/text.d.ts +7 -0
- package/dist/email/text.js +92 -0
- package/dist/emit.d.ts +13 -12
- package/dist/emit.js +63 -63
- package/dist/input-schema-BIfzI63B.d.ts +23 -0
- package/dist/input-schema.d.ts +2 -0
- package/dist/input-schema.js +170 -0
- package/dist/jsx-dev-runtime.d.ts +4 -3
- package/dist/jsx-dev-runtime.js +9 -1
- package/dist/{jsx-runtime-fSxcvlx4.d.ts → jsx-runtime-C5k_Zq0A.d.ts} +4 -4
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +20 -1
- package/dist/model.d.ts +1 -1
- package/dist/ops.d.ts +1 -1
- package/dist/ops.js +2 -2
- package/dist/{parser-yzjUOGhc.d.ts → parser-CGBS73Gz.d.ts} +12 -3
- package/dist/parser.d.ts +2 -2
- package/dist/parser.js +48 -9
- package/dist/predicate-CvkzT-a2.js +539 -0
- package/dist/{predicate-DTtVtLK7.d.ts → predicate-G2SeSvoN.d.ts} +9 -2
- package/dist/predicate.d.ts +2 -2
- package/dist/predicate.js +2 -417
- package/dist/presets/corpus.d.ts +2 -0
- package/dist/presets/corpus.js +186 -0
- package/dist/presets/public-gallery.d.ts +241 -459
- package/dist/presets/public-gallery.js +305 -5
- package/dist/presets/public-handoff.d.ts +75 -3
- package/dist/presets/public-handoff.js +220 -37
- package/dist/presets/public-preview-artifacts.js +20 -26
- package/dist/presets/public-preview.d.ts +40 -1152
- package/dist/presets/public-preview.js +388 -1152
- package/dist/presets/sources.d.ts +17 -4
- package/dist/presets/sources.js +1212 -43
- package/dist/presets.d.ts +2 -2
- package/dist/printer.d.ts +1 -1
- package/dist/render-Cddsy_XF.js +585 -0
- package/dist/render-template.d.ts +6 -3
- package/dist/render-template.js +4 -2
- package/dist/source-locations-BCJQnIfU.d.ts +89 -0
- package/dist/source-locations.d.ts +2 -0
- package/dist/source-locations.js +125 -0
- package/dist/stylesheets-oDRAnYA3.d.ts +94 -0
- package/dist/template-Dy5yOPyp.d.ts +60 -0
- package/dist/template.d.ts +2 -0
- package/dist/template.js +37 -0
- package/dist/tsx-source-instrumentation.d.ts +23 -0
- package/dist/tsx-source-instrumentation.js +97 -0
- package/dist/tsx-tracer.d.ts +116 -0
- package/dist/tsx-tracer.js +985 -0
- package/dist/{variables-3NGLpNTB.d.ts → variables-if1VrV34.d.ts} +2 -2
- package/dist/variables.d.ts +1 -1
- package/dist/variables.js +1 -1
- package/generated/sml-agent-contract.json +574 -782
- package/generated/sml-email-agent-contract.json +502 -677
- package/generated/sml-email-language-reference.md +94 -160
- package/generated/sml-language-reference.md +195 -220
- package/package.json +111 -8
|
@@ -0,0 +1,301 @@
|
|
|
1
|
+
import { a as formatEmailDiagnostic, i as EmailDiagnosticSeverity, n as EmailCompileError, o as hasBlockingDiagnostic, r as EmailDiagnostic } from "./diagnostics-Djd9ckLg.js";
|
|
2
|
+
import { a as EmailGlobalProps, c as EmailStyle, d as isUrlAttribute, i as EmailElementSpec, l as EmailTag, m as EmailNode, n as EMAIL_GLOBAL_ATTRIBUTES, o as EmailIntrinsicElements, r as EmailAttributeSpec, s as EmailLayout, t as EMAIL_ELEMENTS, u as emailElement } from "./elements-DtwKlFVH.js";
|
|
3
|
+
import { EmailElementSelection, EmittedPosition, INSTANCE_PATH_ATTRIBUTE, emailAuthoringTarget, emailDefinitionInstances, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections } from "./email/selection.js";
|
|
4
|
+
import { EmailHtmlOutput, SerializeEmailOptions, escapeAttribute, escapeText, serializeEmailHtml } from "./email/html.js";
|
|
5
|
+
import { deriveEmailText } from "./email/text.js";
|
|
6
|
+
import { EMAIL_DOCTYPE, EmailCompileOutput, RenderedEmail, compileEmail, renderEmail } from "./email/render.js";
|
|
7
|
+
import { a as CssDeclaration, c as Stylesheet, d as Ancestry, f as CompiledSelector, h as matchesSelector, i as resetStylesheets, l as compileSelector, m as classListOf, n as hasStylesheets, o as CssRule, p as Compound, r as registerStylesheet, s as Specificity, t as collectStylesheets, u as parseStylesheet } from "./stylesheets-oDRAnYA3.js";
|
|
8
|
+
import { instrumentTsxSourceForPreview } from "./tsx-source-instrumentation.js";
|
|
9
|
+
import { caniemail } from "caniemail";
|
|
10
|
+
//#region src/email/compatibility.d.ts
|
|
11
|
+
type CaniemailClient = Parameters<typeof caniemail>[0]["clients"][number];
|
|
12
|
+
/** One client this compiler makes claims about. */
|
|
13
|
+
interface EmailClientTarget {
|
|
14
|
+
readonly id: CaniemailClient;
|
|
15
|
+
readonly label: string;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The pinned matrix. Every finding is reported per client, and a client absent
|
|
19
|
+
* from this list is a client Samva makes no claim about.
|
|
20
|
+
*/
|
|
21
|
+
declare const EMAIL_CLIENT_MATRIX: readonly EmailClientTarget[];
|
|
22
|
+
interface CompatibilityProvenance {
|
|
23
|
+
/** The exact rules package a finding came from. */
|
|
24
|
+
readonly rules: string;
|
|
25
|
+
readonly apiVersion: string;
|
|
26
|
+
/** The day caniemail last changed the data this build was checked against. */
|
|
27
|
+
readonly lastUpdate: string;
|
|
28
|
+
}
|
|
29
|
+
declare const COMPATIBILITY_PROVENANCE: CompatibilityProvenance;
|
|
30
|
+
/**
|
|
31
|
+
* The constructs whose loss actually breaks a message: the recipient reads
|
|
32
|
+
* something different, in a different order, follows a link that does not work,
|
|
33
|
+
* or sees a layout that has collapsed. A target client dropping one of these
|
|
34
|
+
* blocks publication.
|
|
35
|
+
*
|
|
36
|
+
* The list is deliberately short and enumerated, because the contract is to
|
|
37
|
+
* block *known* failures. Nonessential differences require an assessment of
|
|
38
|
+
* emitted values: a concrete risk warns, expected differences and unverified
|
|
39
|
+
* behavior remain compatibility observations.
|
|
40
|
+
*/
|
|
41
|
+
declare const ESSENTIAL_CONSTRUCTS: ReadonlySet<string>;
|
|
42
|
+
interface CompatibilityInput {
|
|
43
|
+
/** The document the recipient receives. */
|
|
44
|
+
readonly html: string;
|
|
45
|
+
/** The declared fixture checked by this invocation. */
|
|
46
|
+
readonly fixture?: string | undefined;
|
|
47
|
+
/** Retained head rules, when they are not already inside the HTML. */
|
|
48
|
+
readonly css?: string | undefined;
|
|
49
|
+
/** Emitted-offset ranges with the origins of the node that produced them. */
|
|
50
|
+
readonly positions?: readonly EmittedPosition[] | undefined;
|
|
51
|
+
readonly clients?: readonly EmailClientTarget[] | undefined;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Check the emitted document against the pinned matrix.
|
|
55
|
+
*
|
|
56
|
+
* Findings are grouped by construct rather than repeated per client, so one
|
|
57
|
+
* unsupported property is one diagnostic naming every client that drops it.
|
|
58
|
+
*/
|
|
59
|
+
declare const checkEmailCompatibility: (input: CompatibilityInput) => readonly EmailDiagnostic[];
|
|
60
|
+
/**
|
|
61
|
+
* Constructs the pinned data says nothing about for a target client. These are
|
|
62
|
+
* reported so "we did not check that" is never mistaken for "that works".
|
|
63
|
+
*/
|
|
64
|
+
declare const unknownCoverage: (titles: Iterable<string>) => readonly EmailDiagnostic[];
|
|
65
|
+
/** A publication carrying one of these is refused; the message would arrive broken. */
|
|
66
|
+
declare const hasBlockingCompatibility: (findings: readonly EmailDiagnostic[]) => boolean;
|
|
67
|
+
//#endregion
|
|
68
|
+
//#region src/email/assets.d.ts
|
|
69
|
+
/** Files a template may import, and what they are served as. */
|
|
70
|
+
declare const ASSET_CONTENT_TYPES: Readonly<Record<string, string>>;
|
|
71
|
+
interface AssetEntry {
|
|
72
|
+
/** Project-relative path the template imported. */
|
|
73
|
+
readonly path: string;
|
|
74
|
+
/** SHA-256 of the exact bytes, lowercase hex. */
|
|
75
|
+
readonly digest: string;
|
|
76
|
+
readonly bytes: number;
|
|
77
|
+
readonly contentType: string;
|
|
78
|
+
/** `<digest><ext>` — the name the asset has under any base. */
|
|
79
|
+
readonly fileName: string;
|
|
80
|
+
}
|
|
81
|
+
interface AssetManifest {
|
|
82
|
+
/** Where these assets are served from in this build. */
|
|
83
|
+
readonly base: string;
|
|
84
|
+
readonly assets: readonly AssetEntry[];
|
|
85
|
+
}
|
|
86
|
+
/** True when the compiler turns this import into a content-addressed asset. */
|
|
87
|
+
declare const isAssetPath: (path: string) => boolean;
|
|
88
|
+
/** Address one file by its content. */
|
|
89
|
+
declare const assetEntry: (path: string, bytes: Uint8Array) => Promise<AssetEntry>;
|
|
90
|
+
/**
|
|
91
|
+
* The URL an asset has under a base. The base is a build input: publication
|
|
92
|
+
* passes its hosted origin, and a local export passes whatever it will serve
|
|
93
|
+
* the exported files from.
|
|
94
|
+
*/
|
|
95
|
+
declare const assetUrl: (entry: AssetEntry, base: string) => string;
|
|
96
|
+
/** Record, but never fetch, a URL the template points at. */
|
|
97
|
+
declare const isExternalAsset: (reference: string) => boolean;
|
|
98
|
+
/**
|
|
99
|
+
* Reject an asset base that would produce URLs a client will not load. The
|
|
100
|
+
* relative forms are the ones a page on disk resolves against its own
|
|
101
|
+
* directory, which is what a local export writes.
|
|
102
|
+
*/
|
|
103
|
+
declare const checkAssetBase: (base: string) => readonly EmailDiagnostic[];
|
|
104
|
+
//#endregion
|
|
105
|
+
//#region src/email/css-values.d.ts
|
|
106
|
+
/** Expand `var(--x, fallback)` against the collected custom properties. */
|
|
107
|
+
declare const resolveVariables: (value: string, variables: Readonly<Record<string, string>>, depth?: number) => string;
|
|
108
|
+
/**
|
|
109
|
+
* Fold a constant `calc()` to a plain value. Tailwind writes every spacing
|
|
110
|
+
* utility as `calc(var(--spacing) * n)`, and classic Outlook does not implement
|
|
111
|
+
* `calc()` at all, so an unfolded value is a silently missing style. An
|
|
112
|
+
* expression that cannot be reduced to one term is left exactly as authored.
|
|
113
|
+
*/
|
|
114
|
+
declare const foldCalc: (value: string) => string;
|
|
115
|
+
/** Resolve custom properties, then fold what the arithmetic allows. */
|
|
116
|
+
declare const finalizeValue: (value: string, variables: Readonly<Record<string, string>>) => string;
|
|
117
|
+
/** Media Queries Level 4 range syntax down to the `min-`/`max-` prefixes clients support. */
|
|
118
|
+
declare const downlevelMediaQuery: (condition: string) => string;
|
|
119
|
+
/** Render the rules that could not be inlined as one `<style>` body. */
|
|
120
|
+
declare const renderHeadCss: (rules: readonly CssRule[], headAtRules: readonly string[], variables: Readonly<Record<string, string>>) => string;
|
|
121
|
+
//#endregion
|
|
122
|
+
//#region src/email/css-color.d.ts
|
|
123
|
+
/** A color in extended sRGB, alpha included, before clamping and gamma. */
|
|
124
|
+
interface Rgba {
|
|
125
|
+
readonly r: number;
|
|
126
|
+
readonly g: number;
|
|
127
|
+
readonly b: number;
|
|
128
|
+
readonly a: number;
|
|
129
|
+
}
|
|
130
|
+
/** Parse any supported color notation into extended sRGB. `undefined` means "leave it alone". */
|
|
131
|
+
declare const parseColor: (value: string) => Rgba | undefined;
|
|
132
|
+
/** sRGB hex, or `rgba()` when the color is not opaque. */
|
|
133
|
+
declare const formatColor: (color: Rgba) => string;
|
|
134
|
+
/** Rewrite every modern color function in a declaration value; other text is untouched. */
|
|
135
|
+
declare const downlevelColors: (value: string) => string;
|
|
136
|
+
//#endregion
|
|
137
|
+
//#region src/email/cascade.d.ts
|
|
138
|
+
interface AppliedStyles {
|
|
139
|
+
readonly tree: EmailNode;
|
|
140
|
+
/** Rules that could not be inlined, ready for a `<style>` element in `<head>`. */
|
|
141
|
+
readonly headCss: string;
|
|
142
|
+
readonly diagnostics: readonly EmailDiagnostic[];
|
|
143
|
+
}
|
|
144
|
+
/**
|
|
145
|
+
* Resolve every stylesheet against the tree: inline what a client will honor on
|
|
146
|
+
* the element, and keep the rest for `<head>`.
|
|
147
|
+
*/
|
|
148
|
+
declare const applyStylesheet: (root: EmailNode, sheet: Stylesheet, options?: {
|
|
149
|
+
readonly knownClasses?: ReadonlySet<string>;
|
|
150
|
+
}) => AppliedStyles;
|
|
151
|
+
//#endregion
|
|
152
|
+
//#region src/email/tailwind-stylesheets.gen.d.ts
|
|
153
|
+
/** The exact Tailwind release the compiler runs, recorded in every build manifest. */
|
|
154
|
+
declare const TAILWIND_VERSION = "4.3.3";
|
|
155
|
+
//#endregion
|
|
156
|
+
//#region src/email/tailwind.d.ts
|
|
157
|
+
interface TailwindOptions {
|
|
158
|
+
/**
|
|
159
|
+
* Project CSS appended to the compiled entry: `@theme` overrides, `@utility`
|
|
160
|
+
* definitions and ordinary rules. This is the project's pinned configuration.
|
|
161
|
+
*/
|
|
162
|
+
readonly css?: string | undefined;
|
|
163
|
+
/** Classes the compiler cannot discover, declared by the project on purpose. */
|
|
164
|
+
readonly safelist?: readonly string[] | undefined;
|
|
165
|
+
/** Tailwind's browser reset is off by default; email clients do not want it. */
|
|
166
|
+
readonly preflight?: boolean | undefined;
|
|
167
|
+
/**
|
|
168
|
+
* Bounds on what the compiler may generate. Class discovery reads authored
|
|
169
|
+
* source, so a project can hand it an unbounded candidate set and get an
|
|
170
|
+
* unbounded stylesheet back — inside a build that has a wall clock and a
|
|
171
|
+
* bundle a Worker then has to load. A host that publishes supplies these.
|
|
172
|
+
*/
|
|
173
|
+
readonly limits?: TailwindLimits | undefined;
|
|
174
|
+
}
|
|
175
|
+
interface TailwindLimits {
|
|
176
|
+
/** Distinct classes handed to the compiler. */
|
|
177
|
+
readonly candidates: number;
|
|
178
|
+
/** Bytes of generated CSS. */
|
|
179
|
+
readonly cssBytes: number;
|
|
180
|
+
}
|
|
181
|
+
interface TailwindOutput {
|
|
182
|
+
readonly css: string;
|
|
183
|
+
readonly version: string;
|
|
184
|
+
/** Every candidate handed to the compiler, sorted, for the build manifest. */
|
|
185
|
+
readonly candidates: readonly string[];
|
|
186
|
+
}
|
|
187
|
+
/** Compile the discovered class set into CSS with the pinned Tailwind release. */
|
|
188
|
+
declare const compileTailwind: (candidates: Iterable<string>, options?: TailwindOptions) => Promise<TailwindOutput>;
|
|
189
|
+
interface ClassDiscovery {
|
|
190
|
+
readonly candidates: readonly string[];
|
|
191
|
+
readonly diagnostics: readonly EmailDiagnostic[];
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Collect the class names one module states literally, and report the positions
|
|
195
|
+
* where a class is assembled from values the compiler cannot see.
|
|
196
|
+
*/
|
|
197
|
+
declare const discoverClassCandidates: (source: string, fileName: string) => ClassDiscovery;
|
|
198
|
+
//#endregion
|
|
199
|
+
//#region src/email/transform.d.ts
|
|
200
|
+
/** Where this build serves assets from, and how Tailwind is configured. */
|
|
201
|
+
interface TransformOptions {
|
|
202
|
+
readonly assetBase: string;
|
|
203
|
+
/**
|
|
204
|
+
* Specifier the generated stylesheet modules import `registerStylesheet`
|
|
205
|
+
* from. It is the published subpath by default; a host that resolves the
|
|
206
|
+
* package differently states its own.
|
|
207
|
+
*/
|
|
208
|
+
readonly stylesheetModule?: string | undefined;
|
|
209
|
+
/** `false` compiles no Tailwind at all. */
|
|
210
|
+
readonly tailwind?: TailwindOptions | false | undefined;
|
|
211
|
+
}
|
|
212
|
+
interface ModuleTransform {
|
|
213
|
+
/** Always JavaScript, whatever the input file was. */
|
|
214
|
+
readonly code: string;
|
|
215
|
+
readonly asset?: AssetEntry | undefined;
|
|
216
|
+
/** Class names this module states literally, for the Tailwind candidate set. */
|
|
217
|
+
readonly classes?: readonly string[] | undefined;
|
|
218
|
+
readonly diagnostics: readonly EmailDiagnostic[];
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Transform one project file into a JavaScript module.
|
|
222
|
+
*
|
|
223
|
+
* `.tsx`/`.ts` keep their authored semantics and gain source origins. A
|
|
224
|
+
* stylesheet becomes a module that registers its parsed rules. An imported
|
|
225
|
+
* binary becomes a module exporting the content-addressed URL of its bytes.
|
|
226
|
+
*/
|
|
227
|
+
declare const transformModule: (id: string, source: string | Uint8Array, options: TransformOptions) => Promise<ModuleTransform>;
|
|
228
|
+
interface ProjectTransform {
|
|
229
|
+
/** Every input file, transformed; keys are unchanged. */
|
|
230
|
+
readonly files: Readonly<Record<string, string>>;
|
|
231
|
+
readonly assets: readonly AssetEntry[];
|
|
232
|
+
/**
|
|
233
|
+
* The compiled Tailwind sheet as a registering module, when the project used
|
|
234
|
+
* any utility class. A host writes it at `path` and makes the entry import it
|
|
235
|
+
* first, so the generated layers sit below the project's own stylesheets.
|
|
236
|
+
*/
|
|
237
|
+
readonly tailwind: {
|
|
238
|
+
readonly path: string;
|
|
239
|
+
readonly code: string;
|
|
240
|
+
} | undefined;
|
|
241
|
+
readonly diagnostics: readonly EmailDiagnostic[];
|
|
242
|
+
}
|
|
243
|
+
/**
|
|
244
|
+
* The generated Tailwind module is a real file at the project root, not a
|
|
245
|
+
* virtual id. A virtual module has no directory, so its own relative imports
|
|
246
|
+
* resolve differently from the project's and the bundler ends up with a second
|
|
247
|
+
* copy of the stylesheet registry — the sheet registers into a registry the
|
|
248
|
+
* render never reads.
|
|
249
|
+
*/
|
|
250
|
+
declare const TAILWIND_MODULE_PATH = ".samva-tailwind.css";
|
|
251
|
+
/** The specifier an entry at this path uses to reach the generated module. */
|
|
252
|
+
declare const tailwindSpecifierFor: (entryPoint: string) => string;
|
|
253
|
+
/** Run the transform over a whole project, then compile the classes it used. */
|
|
254
|
+
declare const transformProject: (files: Readonly<Record<string, string | Uint8Array>>, options: TransformOptions) => Promise<ProjectTransform>;
|
|
255
|
+
/**
|
|
256
|
+
* Put a side-effect import ahead of an entry's own imports, after any leading
|
|
257
|
+
* comment so a `@jsxImportSource` pragma keeps its position. Import order is
|
|
258
|
+
* cascade order, so the generated sheet has to be first.
|
|
259
|
+
*/
|
|
260
|
+
declare const withLeadingImport: (source: string, specifier: string) => string;
|
|
261
|
+
/** The generated entry every host builds, so both evaluate the same module. */
|
|
262
|
+
declare const EMAIL_ENTRY_WRAPPER = ".samva-email-entry.ts";
|
|
263
|
+
/**
|
|
264
|
+
* The generated module that clears the stylesheet registry. It is imported
|
|
265
|
+
* first, as its own module, because import order is evaluation order: a reset
|
|
266
|
+
* written as a statement in the wrapper would run after the wrapper's imports
|
|
267
|
+
* had already registered.
|
|
268
|
+
*/
|
|
269
|
+
declare const EMAIL_RESET_MODULE = ".samva-email-reset.ts";
|
|
270
|
+
/**
|
|
271
|
+
* The wrapper's source. It re-exports the template beside the renderer so the
|
|
272
|
+
* render runs inside the project's own module graph — the graph its stylesheets
|
|
273
|
+
* registered into. Importing the renderer from outside that graph reaches a
|
|
274
|
+
* second copy of the registry and silently renders unstyled.
|
|
275
|
+
*/
|
|
276
|
+
declare const emailEntryWrapper: (entryPoint: string, imports?: readonly string[]) => string;
|
|
277
|
+
/**
|
|
278
|
+
* A host that renders more than one project in one process shares the registry
|
|
279
|
+
* through its module cache, so every project graph starts by clearing it.
|
|
280
|
+
*/
|
|
281
|
+
declare const emailResetModule: (options: TransformOptions) => string;
|
|
282
|
+
interface CompiledEmailProject {
|
|
283
|
+
/** Every module as JavaScript, keyed by its authored path. */
|
|
284
|
+
readonly files: Readonly<Record<string, string>>;
|
|
285
|
+
/** The generated module a host bundles or evaluates. */
|
|
286
|
+
readonly entryPoint: string;
|
|
287
|
+
/** The project's own entry, which the wrapper re-exports. */
|
|
288
|
+
readonly authoredEntry: string;
|
|
289
|
+
readonly assets: readonly AssetEntry[];
|
|
290
|
+
readonly diagnostics: readonly EmailDiagnostic[];
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* The whole compile step, files in and files out: every module transformed, the
|
|
294
|
+
* generated Tailwind sheet written, the generated imports added and the wrapper
|
|
295
|
+
* built. Both hosts call exactly this, which is what stops their outputs from
|
|
296
|
+
* drifting apart.
|
|
297
|
+
*/
|
|
298
|
+
declare const compileEmailProject: (source: Readonly<Record<string, string | Uint8Array>>, authoredEntry: string, options: TransformOptions) => Promise<CompiledEmailProject>;
|
|
299
|
+
//#endregion
|
|
300
|
+
export { ASSET_CONTENT_TYPES, type Ancestry, type AppliedStyles, type AssetEntry, type AssetManifest, COMPATIBILITY_PROVENANCE, type ClassDiscovery, type CompatibilityInput, type CompatibilityProvenance, type CompiledEmailProject, type CompiledSelector, type Compound, type CssDeclaration, type CssRule, EMAIL_CLIENT_MATRIX, EMAIL_DOCTYPE, EMAIL_ELEMENTS, EMAIL_ENTRY_WRAPPER, EMAIL_GLOBAL_ATTRIBUTES, EMAIL_RESET_MODULE, ESSENTIAL_CONSTRUCTS, type EmailAttributeSpec, type EmailClientTarget, EmailCompileError, type EmailCompileOutput, EmailDiagnostic, EmailDiagnosticSeverity, EmailElementSelection, type EmailElementSpec, type EmailGlobalProps, type EmailHtmlOutput, type EmailIntrinsicElements, type EmailLayout, type EmailStyle, type EmailTag, EmittedPosition, INSTANCE_PATH_ATTRIBUTE, type ModuleTransform, type ProjectTransform, type RenderedEmail, type SerializeEmailOptions, type Specificity, type Stylesheet, TAILWIND_MODULE_PATH, TAILWIND_VERSION, type TailwindLimits, type TailwindOptions, type TailwindOutput, type TransformOptions, applyStylesheet, assetEntry, assetUrl, checkAssetBase, checkEmailCompatibility, classListOf, collectStylesheets, compileEmail, compileEmailProject, compileSelector, compileTailwind, deriveEmailText, discoverClassCandidates, downlevelColors, downlevelMediaQuery, emailAuthoringTarget, emailDefinitionInstances, emailElement, emailEntryWrapper, emailResetModule, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections, escapeAttribute, escapeText, finalizeValue, foldCalc, formatColor, formatEmailDiagnostic, hasBlockingCompatibility, hasBlockingDiagnostic, hasStylesheets, instrumentTsxSourceForPreview, isAssetPath, isExternalAsset, isUrlAttribute, matchesSelector, parseColor, parseStylesheet, registerStylesheet, renderEmail, renderHeadCss, resetStylesheets, resolveVariables, serializeEmailHtml, tailwindSpecifierFor, transformModule, transformProject, unknownCoverage, withLeadingImport };
|
|
301
|
+
//# sourceMappingURL=compiler.d.ts.map
|