@samva/markup 0.7.0 → 0.9.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 +104 -37
- package/README.md +188 -52
- package/dist/assets-C5duwTya.d.ts +40 -0
- package/dist/brand-B-0bN_Ir.d.ts +88 -0
- package/dist/{render-aaJBnsXK.js → cascade-t6kxlgEI.js} +130 -160
- package/dist/channel-edit.d.ts +121 -0
- package/dist/channel-edit.js +609 -0
- package/dist/channel-specs-B6M_HlaV.js +29 -0
- package/dist/channel-specs-C2feJwuP.d.ts +13 -0
- package/dist/compatibility-DbISoFIq.js +589 -0
- package/dist/compiler.d.ts +19 -249
- package/dist/compiler.js +10 -1408
- package/dist/{css-COcFOT1y.d.ts → css-BVQKICKC.d.ts} +30 -4
- package/dist/diagnostic-codes.d.ts +403 -0
- package/dist/diagnostic-codes.js +399 -0
- package/dist/{diagnostics-BMYtBCQk.d.ts → diagnostics-B-Gym34R.d.ts} +8 -4
- package/dist/diagnostics.d.ts +31 -2
- package/dist/diagnostics.js +1 -19
- package/dist/{elements-BzjjnoCS.d.ts → elements-cqldpaJt.d.ts} +3 -3
- package/dist/email/assets.d.ts +2 -0
- package/dist/email/assets.js +63 -0
- package/dist/email/brand-footer.d.ts +34 -0
- package/dist/email/brand-footer.js +63 -0
- package/dist/email/brand.d.ts +2 -0
- package/dist/email/brand.js +148 -0
- package/dist/email/components.d.ts +21 -10
- package/dist/email/components.js +46 -11
- package/dist/email/diagnostics.d.ts +2 -2
- package/dist/email/diagnostics.js +2 -1
- package/dist/email/elements.d.ts +1 -1
- package/dist/email/html.d.ts +2 -42
- package/dist/email/html.js +56 -2
- package/dist/email/jsx-dev-runtime.d.ts +2 -2
- package/dist/email/jsx-runtime.d.ts +1 -1
- package/dist/email/render.d.ts +10 -13
- package/dist/email/render.js +163 -6
- package/dist/email/text.d.ts +1 -1
- package/dist/fmt.d.ts +32 -0
- package/dist/fmt.js +174 -0
- package/dist/html-BJepOwZ4.d.ts +56 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/ir-aaqNE987.d.ts +252 -0
- package/dist/ir.d.ts +2 -0
- package/dist/ir.js +7 -0
- package/dist/preview-Ekdg1dXG.d.ts +100 -0
- package/dist/preview.d.ts +2 -0
- package/dist/preview.js +160 -0
- package/dist/profile-BH-OtdDA.js +3670 -0
- package/dist/render-ir.d.ts +19 -0
- package/dist/render-ir.js +826 -0
- package/dist/sms-segments.d.ts +13 -2
- package/dist/sms.d.ts +16 -0
- package/dist/sms.js +12 -0
- package/dist/{email/source-edit.d.ts → source-edit.d.ts} +55 -6
- package/dist/source-edit.js +343 -0
- package/dist/source-locations-C8wCsiAy.d.ts +23 -0
- package/dist/source-locations.d.ts +2 -2
- package/dist/source-locations.js +3 -89
- package/dist/static.d.ts +57 -0
- package/dist/static.js +69 -0
- package/dist/tailwind-CMYpZf1v.js +614 -0
- package/dist/template-_QE_rQND.d.ts +65 -0
- package/dist/template.d.ts +2 -2
- package/dist/template.js +15 -10
- package/dist/theme-css-hFqcPSar.js +587 -0
- package/dist/theme-css.d.ts +57 -16
- package/dist/theme-css.js +2 -509
- package/dist/theme-imports-lvBw3AD1.js +109 -0
- package/dist/transform-Ct2OMkFN.d.ts +153 -0
- package/dist/unsubscribe-link-CoesnQDU.js +26 -0
- package/dist/whatsapp.d.ts +57 -0
- package/dist/whatsapp.js +22 -0
- package/generated/contract.json +1782 -0
- package/generated/reference.md +353 -0
- package/package.json +56 -154
- package/samva-brand.d.ts +14 -0
- package/skills/sml/SKILL.md +123 -0
- package/dist/ast-BrDtApwS.d.ts +0 -107
- package/dist/ast.d.ts +0 -2
- package/dist/ast.js +0 -124
- package/dist/candidate.d.ts +0 -29
- package/dist/candidate.js +0 -88
- package/dist/catalog-60eaYC7b.d.ts +0 -356
- package/dist/checks-DBweSIPN.js +0 -58954
- package/dist/checks.d.ts +0 -33
- package/dist/checks.js +0 -2
- package/dist/classes.d.ts +0 -27
- package/dist/classes.js +0 -184
- package/dist/compile-sms.d.ts +0 -28
- package/dist/compile-sms.js +0 -44
- package/dist/compile-whatsapp.d.ts +0 -56
- package/dist/compile-whatsapp.js +0 -186
- package/dist/compile.d.ts +0 -18
- package/dist/compile.js +0 -29
- package/dist/components.d.ts +0 -289
- package/dist/components.js +0 -106
- package/dist/conditionals.d.ts +0 -10
- package/dist/conditionals.js +0 -74
- package/dist/corpus-BjYMqOoY.d.ts +0 -106
- package/dist/diagnostics-OcQKQYSY.d.ts +0 -49
- package/dist/email/selection.d.ts +0 -91
- package/dist/email/selection.js +0 -91
- package/dist/email/source-edit.js +0 -185
- package/dist/email/stylesheets.d.ts +0 -15
- package/dist/email/stylesheets.js +0 -45
- package/dist/emit.d.ts +0 -51
- package/dist/emit.js +0 -151
- package/dist/footer.d.ts +0 -66
- package/dist/footer.js +0 -93
- package/dist/interpolate.d.ts +0 -24
- package/dist/interpolate.js +0 -43
- package/dist/jsx-dev-runtime.d.ts +0 -11
- package/dist/jsx-dev-runtime.js +0 -15
- package/dist/jsx-runtime-I-1nCtl2.d.ts +0 -57
- package/dist/jsx-runtime.d.ts +0 -2
- package/dist/jsx-runtime.js +0 -121
- package/dist/lexer.d.ts +0 -60
- package/dist/lexer.js +0 -281
- package/dist/model.d.ts +0 -24
- package/dist/model.js +0 -77
- package/dist/ops-2aiiYO7m.js +0 -630
- package/dist/ops.d.ts +0 -114
- package/dist/ops.js +0 -2
- package/dist/parser-t29cHLVL.d.ts +0 -396
- package/dist/parser.d.ts +0 -2
- package/dist/parser.js +0 -859
- package/dist/predicate-BI6uRRM-.js +0 -549
- package/dist/predicate-M-05Nd7R.d.ts +0 -56
- package/dist/predicate.d.ts +0 -2
- package/dist/predicate.js +0 -2
- package/dist/presets/category-mapping.d.ts +0 -13
- package/dist/presets/category-mapping.js +0 -49
- package/dist/presets/corpus.d.ts +0 -2
- package/dist/presets/corpus.js +0 -194
- package/dist/presets/public-gallery.d.ts +0 -266
- package/dist/presets/public-gallery.js +0 -916
- package/dist/presets/public-handoff.d.ts +0 -164
- package/dist/presets/public-handoff.js +0 -361
- package/dist/presets/public-preview-artifacts.d.ts +0 -43
- package/dist/presets/public-preview-artifacts.js +0 -104
- package/dist/presets/public-preview.d.ts +0 -61
- package/dist/presets/public-preview.js +0 -83
- package/dist/presets/showcase.d.ts +0 -2
- package/dist/presets/showcase.js +0 -627
- package/dist/presets/sources.d.ts +0 -38
- package/dist/presets/sources.js +0 -6083
- package/dist/presets.d.ts +0 -2
- package/dist/presets.js +0 -881
- package/dist/printer.d.ts +0 -6
- package/dist/printer.js +0 -122
- package/dist/registry.d.ts +0 -42
- package/dist/registry.js +0 -646
- package/dist/render-template.d.ts +0 -45
- package/dist/render-template.js +0 -76
- package/dist/showcase-DGZAWn4Z.d.ts +0 -456
- package/dist/sms-segments-y4FpPilJ.d.ts +0 -13
- package/dist/source-locations-DrCM82Ym.d.ts +0 -67
- package/dist/template-DWftqh4x.d.ts +0 -60
- package/dist/theme-6ApjjiBo.d.ts +0 -116
- package/dist/theme.d.ts +0 -2
- package/dist/theme.js +0 -118
- package/dist/tokens.d.ts +0 -6
- package/dist/tokens.js +0 -417
- package/dist/tsx-source-instrumentation.d.ts +0 -30
- package/dist/tsx-source-instrumentation.js +0 -115
- package/dist/tsx-tracer.d.ts +0 -112
- package/dist/tsx-tracer.js +0 -985
- package/dist/variables-J_L3qxRa.d.ts +0 -77
- package/dist/variables.d.ts +0 -2
- package/dist/variables.js +0 -141
- package/dist/version-BITr58kk.js +0 -96
- package/generated/sml-agent-contract.json +0 -709
- package/generated/sml-email-agent-contract.json +0 -615
- package/generated/sml-email-language-reference.md +0 -94
- package/generated/sml-language-reference.md +0 -195
package/dist/compiler.d.ts
CHANGED
|
@@ -1,108 +1,13 @@
|
|
|
1
|
-
import {
|
|
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-
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
1
|
+
import { i as EmailDiagnosticSeverity, n as EmailCompileError, o as formatEmailDiagnostic, r as EmailDiagnostic, s as hasBlockingDiagnostic } from "./diagnostics-B-Gym34R.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-cqldpaJt.js";
|
|
3
|
+
import { a as emailAuthoringTarget, c as emailSelectionIndex, l as emailSelectionSiblings, n as EmittedPosition, o as emailDefinitionInstances, r as INSTANCE_PATH_ATTRIBUTE, s as emailSelectionAncestry, t as EmailElementSelection, u as emailSelections } from "./preview-Ekdg1dXG.js";
|
|
4
|
+
import { a as escapeAttribute, c as serializeEmailHtml, n as SerializeEmailOptions, o as escapeText, t as EmailHtmlOutput } from "./html-BJepOwZ4.js";
|
|
5
|
+
import { _ as checkEmailCompatibility, a as ClassDiscovery, c as TailwindOutput, d as COMPATIBILITY_PROVENANCE, f as CompatibilityInput, g as EmailClientTarget, h as ESSENTIAL_CONSTRUCTS, i as transformProject, l as compileTailwind, m as EMAIL_CLIENT_MATRIX, n as TransformOptions, o as TailwindLimits, p as CompatibilityProvenance, r as projectBrandSpecifier, s as TailwindOptions, t as ProjectTransform, u as discoverClassCandidates, v as hasBlockingCompatibility, y as unknownCoverage } from "./transform-Ct2OMkFN.js";
|
|
5
6
|
import { deriveEmailText } from "./email/text.js";
|
|
6
|
-
import { a as compileSelector, c as CompiledSelector, d as matchesSelector, i as Stylesheet, l as Compound, n as CssRule, o as parseStylesheet, r as Specificity, s as Ancestry, t as CssDeclaration, u as classListOf } from "./css-
|
|
7
|
-
import { EMAIL_DOCTYPE, EmailCompileOutput, RenderedEmail, compileEmail
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { caniemail } from "caniemail";
|
|
11
|
-
//#region src/email/compatibility.d.ts
|
|
12
|
-
type CaniemailClient = Parameters<typeof caniemail>[0]["clients"][number];
|
|
13
|
-
/** One client this compiler makes claims about. */
|
|
14
|
-
interface EmailClientTarget {
|
|
15
|
-
readonly id: CaniemailClient;
|
|
16
|
-
readonly label: string;
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* The pinned matrix. Every finding is reported per client, and a client absent
|
|
20
|
-
* from this list is a client Samva makes no claim about.
|
|
21
|
-
*/
|
|
22
|
-
declare const EMAIL_CLIENT_MATRIX: readonly EmailClientTarget[];
|
|
23
|
-
interface CompatibilityProvenance {
|
|
24
|
-
/** The exact rules package a finding came from. */
|
|
25
|
-
readonly rules: string;
|
|
26
|
-
readonly apiVersion: string;
|
|
27
|
-
/** The day caniemail last changed the data this build was checked against. */
|
|
28
|
-
readonly lastUpdate: string;
|
|
29
|
-
}
|
|
30
|
-
declare const COMPATIBILITY_PROVENANCE: CompatibilityProvenance;
|
|
31
|
-
/**
|
|
32
|
-
* The constructs whose loss actually breaks a message: the recipient reads
|
|
33
|
-
* something different, in a different order, follows a link that does not work,
|
|
34
|
-
* or sees a layout that has collapsed. A target client dropping one of these
|
|
35
|
-
* blocks publication.
|
|
36
|
-
*
|
|
37
|
-
* The list is deliberately short and enumerated, because the contract is to
|
|
38
|
-
* block *known* failures. Nonessential differences require an assessment of
|
|
39
|
-
* emitted values: a concrete risk warns, expected differences and unverified
|
|
40
|
-
* behavior remain compatibility observations.
|
|
41
|
-
*/
|
|
42
|
-
declare const ESSENTIAL_CONSTRUCTS: ReadonlySet<string>;
|
|
43
|
-
interface CompatibilityInput {
|
|
44
|
-
/** The document the recipient receives. */
|
|
45
|
-
readonly html: string;
|
|
46
|
-
/** The declared fixture checked by this invocation. */
|
|
47
|
-
readonly fixture?: string | undefined;
|
|
48
|
-
/** Retained head rules, when they are not already inside the HTML. */
|
|
49
|
-
readonly css?: string | undefined;
|
|
50
|
-
/** Emitted-offset ranges with the origins of the node that produced them. */
|
|
51
|
-
readonly positions?: readonly EmittedPosition[] | undefined;
|
|
52
|
-
readonly clients?: readonly EmailClientTarget[] | undefined;
|
|
53
|
-
}
|
|
54
|
-
/**
|
|
55
|
-
* Check the emitted document against the pinned matrix.
|
|
56
|
-
*
|
|
57
|
-
* Findings are grouped by construct rather than repeated per client, so one
|
|
58
|
-
* unsupported property is one diagnostic naming every client that drops it.
|
|
59
|
-
*/
|
|
60
|
-
declare const checkEmailCompatibility: (input: CompatibilityInput) => readonly EmailDiagnostic[];
|
|
61
|
-
/**
|
|
62
|
-
* Constructs the pinned data says nothing about for a target client. These are
|
|
63
|
-
* reported so "we did not check that" is never mistaken for "that works".
|
|
64
|
-
*/
|
|
65
|
-
declare const unknownCoverage: (titles: Iterable<string>) => readonly EmailDiagnostic[];
|
|
66
|
-
/** A publication carrying one of these is refused; the message would arrive broken. */
|
|
67
|
-
declare const hasBlockingCompatibility: (findings: readonly EmailDiagnostic[]) => boolean;
|
|
68
|
-
//#endregion
|
|
69
|
-
//#region src/email/assets.d.ts
|
|
70
|
-
/** Files a template may import, and what they are served as. */
|
|
71
|
-
declare const ASSET_CONTENT_TYPES: Readonly<Record<string, string>>;
|
|
72
|
-
interface AssetEntry {
|
|
73
|
-
/** Project-relative path the template imported. */
|
|
74
|
-
readonly path: string;
|
|
75
|
-
/** SHA-256 of the exact bytes, lowercase hex. */
|
|
76
|
-
readonly digest: string;
|
|
77
|
-
readonly bytes: number;
|
|
78
|
-
readonly contentType: string;
|
|
79
|
-
/** `<digest><ext>` — the name the asset has under any base. */
|
|
80
|
-
readonly fileName: string;
|
|
81
|
-
}
|
|
82
|
-
interface AssetManifest {
|
|
83
|
-
/** Where these assets are served from in this build. */
|
|
84
|
-
readonly base: string;
|
|
85
|
-
readonly assets: readonly AssetEntry[];
|
|
86
|
-
}
|
|
87
|
-
/** True when the compiler turns this import into a content-addressed asset. */
|
|
88
|
-
declare const isAssetPath: (path: string) => boolean;
|
|
89
|
-
/** Address one file by its content. */
|
|
90
|
-
declare const assetEntry: (path: string, bytes: Uint8Array) => Promise<AssetEntry>;
|
|
91
|
-
/**
|
|
92
|
-
* The URL an asset has under a base. The base is a build input: publication
|
|
93
|
-
* passes its hosted origin, and a local export passes whatever it will serve
|
|
94
|
-
* the exported files from.
|
|
95
|
-
*/
|
|
96
|
-
declare const assetUrl: (entry: AssetEntry, base: string) => string;
|
|
97
|
-
/** Record, but never fetch, a URL the template points at. */
|
|
98
|
-
declare const isExternalAsset: (reference: string) => boolean;
|
|
99
|
-
/**
|
|
100
|
-
* Reject an asset base that would produce URLs a client will not load. The
|
|
101
|
-
* relative forms are the ones a page on disk resolves against its own
|
|
102
|
-
* directory, which is what a local export writes.
|
|
103
|
-
*/
|
|
104
|
-
declare const checkAssetBase: (base: string) => readonly EmailDiagnostic[];
|
|
105
|
-
//#endregion
|
|
7
|
+
import { a as compileSelector, c as CompiledSelector, d as matchesSelector, i as Stylesheet, l as Compound, n as CssRule, o as parseStylesheet, r as Specificity, s as Ancestry, t as CssDeclaration, u as classListOf } from "./css-BVQKICKC.js";
|
|
8
|
+
import { EMAIL_DOCTYPE, EmailCompileOutput, RenderedEmail, compileEmail } from "./email/render.js";
|
|
9
|
+
import { a as assetUrl, c as isExternalAsset, i as assetEntry, n as AssetEntry, o as checkAssetBase, r as AssetManifest, s as isAssetPath, t as ASSET_CONTENT_TYPES } from "./assets-C5duwTya.js";
|
|
10
|
+
import { a as EmailBrand, c as EmailBrandFooter, l as EmailBrandSocialLink, o as EmailBrandAddress, s as EmailBrandAssets } from "./brand-B-0bN_Ir.js";
|
|
106
11
|
//#region src/email/css-values.d.ts
|
|
107
12
|
/**
|
|
108
13
|
* Expand `var(--x, fallback)` against the collected custom properties.
|
|
@@ -143,6 +48,8 @@ interface AppliedStyles {
|
|
|
143
48
|
readonly tree: EmailNode;
|
|
144
49
|
/** Rules that could not be inlined, ready for a `<style>` element in `<head>`. */
|
|
145
50
|
readonly headCss: string;
|
|
51
|
+
/** Project `@font-face` rules, for a `<head>` style classic Outlook cannot see. */
|
|
52
|
+
readonly fontFaceCss: string;
|
|
146
53
|
readonly diagnostics: readonly EmailDiagnostic[];
|
|
147
54
|
}
|
|
148
55
|
/**
|
|
@@ -157,150 +64,13 @@ declare const applyStylesheet: (root: EmailNode, sheet: Stylesheet, options?: {
|
|
|
157
64
|
/** The exact Tailwind release the compiler runs, recorded in every build manifest. */
|
|
158
65
|
declare const TAILWIND_VERSION = "4.3.3";
|
|
159
66
|
//#endregion
|
|
160
|
-
//#region src/email/
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
/** Classes the compiler cannot discover, declared by the project on purpose. */
|
|
168
|
-
readonly safelist?: readonly string[] | undefined;
|
|
169
|
-
/** Tailwind's browser reset is off by default; email clients do not want it. */
|
|
170
|
-
readonly preflight?: boolean | undefined;
|
|
171
|
-
/**
|
|
172
|
-
* Bounds on what the compiler may generate. Class discovery reads authored
|
|
173
|
-
* source, so a project can hand it an unbounded candidate set and get an
|
|
174
|
-
* unbounded stylesheet back — inside a build that has a wall clock and a
|
|
175
|
-
* bundle a Worker then has to load. A host that publishes supplies these.
|
|
176
|
-
*/
|
|
177
|
-
readonly limits?: TailwindLimits | undefined;
|
|
178
|
-
}
|
|
179
|
-
interface TailwindLimits {
|
|
180
|
-
/** Distinct classes handed to the compiler. */
|
|
181
|
-
readonly candidates: number;
|
|
182
|
-
/** Bytes of generated CSS. */
|
|
183
|
-
readonly cssBytes: number;
|
|
184
|
-
}
|
|
185
|
-
interface TailwindOutput {
|
|
186
|
-
readonly css: string;
|
|
187
|
-
readonly version: string;
|
|
188
|
-
/** Every candidate handed to the compiler, sorted, for the build manifest. */
|
|
189
|
-
readonly candidates: readonly string[];
|
|
190
|
-
}
|
|
191
|
-
/** Compile the discovered class set into CSS with the pinned Tailwind release. */
|
|
192
|
-
declare const compileTailwind: (candidates: Iterable<string>, options?: TailwindOptions) => Promise<TailwindOutput>;
|
|
193
|
-
interface ClassDiscovery {
|
|
194
|
-
readonly candidates: readonly string[];
|
|
195
|
-
readonly diagnostics: readonly EmailDiagnostic[];
|
|
196
|
-
}
|
|
197
|
-
/**
|
|
198
|
-
* Collect the class names one module states literally, and report the positions
|
|
199
|
-
* where a class is assembled from values the compiler cannot see.
|
|
200
|
-
*/
|
|
201
|
-
declare const discoverClassCandidates: (source: string, fileName: string) => ClassDiscovery;
|
|
202
|
-
//#endregion
|
|
203
|
-
//#region src/email/transform.d.ts
|
|
204
|
-
/** Where this build serves assets from, and how Tailwind is configured. */
|
|
205
|
-
interface TransformOptions {
|
|
206
|
-
readonly assetBase: string;
|
|
207
|
-
/**
|
|
208
|
-
* Specifier the generated stylesheet modules import `registerStylesheet`
|
|
209
|
-
* from. It is the published subpath by default; a host that resolves the
|
|
210
|
-
* package differently states its own.
|
|
211
|
-
*/
|
|
212
|
-
readonly stylesheetModule?: string | undefined;
|
|
213
|
-
/** `false` compiles no Tailwind at all. */
|
|
214
|
-
readonly tailwind?: TailwindOptions | false | undefined;
|
|
215
|
-
}
|
|
216
|
-
interface ModuleTransform {
|
|
217
|
-
/** Always JavaScript, whatever the input file was. */
|
|
218
|
-
readonly code: string;
|
|
219
|
-
readonly asset?: AssetEntry | undefined;
|
|
220
|
-
/** Class names this module states literally, for the Tailwind candidate set. */
|
|
221
|
-
readonly classes?: readonly string[] | undefined;
|
|
222
|
-
readonly diagnostics: readonly EmailDiagnostic[];
|
|
223
|
-
}
|
|
224
|
-
/**
|
|
225
|
-
* Transform one project file into a JavaScript module.
|
|
226
|
-
*
|
|
227
|
-
* `.tsx`/`.ts` keep their authored semantics and gain source origins. A
|
|
228
|
-
* stylesheet becomes a module that registers its parsed rules. An imported
|
|
229
|
-
* binary becomes a module exporting the content-addressed URL of its bytes.
|
|
230
|
-
*/
|
|
231
|
-
declare const transformModule: (id: string, source: string | Uint8Array, options: TransformOptions) => Promise<ModuleTransform>;
|
|
232
|
-
interface ProjectTransform {
|
|
233
|
-
/** Every input file, transformed; keys are unchanged. */
|
|
234
|
-
readonly files: Readonly<Record<string, string>>;
|
|
235
|
-
readonly assets: readonly AssetEntry[];
|
|
236
|
-
/**
|
|
237
|
-
* The compiled Tailwind sheet as a registering module, when the project used
|
|
238
|
-
* any utility class. A host writes it at `path` and makes the entry import it
|
|
239
|
-
* first, so the generated layers sit below the project's own stylesheets.
|
|
240
|
-
*/
|
|
241
|
-
readonly tailwind: {
|
|
242
|
-
readonly path: string;
|
|
243
|
-
readonly code: string;
|
|
244
|
-
} | undefined;
|
|
245
|
-
readonly diagnostics: readonly EmailDiagnostic[];
|
|
246
|
-
}
|
|
247
|
-
/**
|
|
248
|
-
* The generated Tailwind module is a real file at the project root, not a
|
|
249
|
-
* virtual id. A virtual module has no directory, so its own relative imports
|
|
250
|
-
* resolve differently from the project's and the bundler ends up with a second
|
|
251
|
-
* copy of the stylesheet registry — the sheet registers into a registry the
|
|
252
|
-
* render never reads.
|
|
253
|
-
*/
|
|
254
|
-
declare const TAILWIND_MODULE_PATH = ".samva-tailwind.css";
|
|
255
|
-
/** The specifier an entry at this path uses to reach the generated module. */
|
|
256
|
-
declare const tailwindSpecifierFor: (entryPoint: string) => string;
|
|
257
|
-
/** Run the transform over a whole project, then compile the classes it used. */
|
|
258
|
-
declare const transformProject: (files: Readonly<Record<string, string | Uint8Array>>, options: TransformOptions) => Promise<ProjectTransform>;
|
|
259
|
-
/**
|
|
260
|
-
* Put a side-effect import ahead of an entry's own imports, after any leading
|
|
261
|
-
* comment so a `@jsxImportSource` pragma keeps its position. Import order is
|
|
262
|
-
* cascade order, so the generated sheet has to be first.
|
|
263
|
-
*/
|
|
264
|
-
declare const withLeadingImport: (source: string, specifier: string) => string;
|
|
265
|
-
/** The generated entry every host builds, so both evaluate the same module. */
|
|
266
|
-
declare const EMAIL_ENTRY_WRAPPER = ".samva-email-entry.ts";
|
|
267
|
-
/**
|
|
268
|
-
* The generated module that clears the stylesheet registry. It is imported
|
|
269
|
-
* first, as its own module, because import order is evaluation order: a reset
|
|
270
|
-
* written as a statement in the wrapper would run after the wrapper's imports
|
|
271
|
-
* had already registered.
|
|
272
|
-
*/
|
|
273
|
-
declare const EMAIL_RESET_MODULE = ".samva-email-reset.ts";
|
|
274
|
-
/**
|
|
275
|
-
* The wrapper's source. It exports the template beside a render bound to the
|
|
276
|
-
* sheets the project's own imports registered, so the render runs inside the
|
|
277
|
-
* project's module graph and keeps its styles when a later project loaded into
|
|
278
|
-
* the same process resets the registry. Importing the renderer from outside
|
|
279
|
-
* that graph reaches a second copy of the registry and silently renders unstyled.
|
|
280
|
-
*/
|
|
281
|
-
declare const emailEntryWrapper: (entryPoint: string, imports?: readonly string[]) => string;
|
|
282
|
-
/**
|
|
283
|
-
* A host that renders more than one project in one process shares the registry
|
|
284
|
-
* through its module cache, so every project graph starts by clearing it.
|
|
285
|
-
*/
|
|
286
|
-
declare const emailResetModule: (options: TransformOptions) => string;
|
|
287
|
-
interface CompiledEmailProject {
|
|
288
|
-
/** Every module as JavaScript, keyed by its authored path. */
|
|
289
|
-
readonly files: Readonly<Record<string, string>>;
|
|
290
|
-
/** The generated module a host bundles or evaluates. */
|
|
291
|
-
readonly entryPoint: string;
|
|
292
|
-
/** The project's own entry, which the wrapper re-exports. */
|
|
293
|
-
readonly authoredEntry: string;
|
|
294
|
-
readonly assets: readonly AssetEntry[];
|
|
295
|
-
readonly diagnostics: readonly EmailDiagnostic[];
|
|
296
|
-
}
|
|
297
|
-
/**
|
|
298
|
-
* The whole compile step, files in and files out: every module transformed, the
|
|
299
|
-
* generated Tailwind sheet written, the generated imports added and the wrapper
|
|
300
|
-
* built. Both hosts call exactly this, which is what stops their outputs from
|
|
301
|
-
* drifting apart.
|
|
302
|
-
*/
|
|
303
|
-
declare const compileEmailProject: (source: Readonly<Record<string, string | Uint8Array>>, authoredEntry: string, options: TransformOptions) => Promise<CompiledEmailProject>;
|
|
67
|
+
//#region src/email/theme-imports.d.ts
|
|
68
|
+
/** The CSS and TSX specifier a template uses to reach its organization's brand. */
|
|
69
|
+
declare const BRAND_SPECIFIER = "samva:brand";
|
|
70
|
+
/** The brand a `samva:brand` specifier names: `undefined` slug means the default brand. */
|
|
71
|
+
declare const parseBrandSpecifier: (specifier: string) => {
|
|
72
|
+
readonly slug: string | undefined;
|
|
73
|
+
} | undefined;
|
|
304
74
|
//#endregion
|
|
305
|
-
export { ASSET_CONTENT_TYPES, type Ancestry, type AppliedStyles, type AssetEntry, type AssetManifest, COMPATIBILITY_PROVENANCE, type ClassDiscovery, type CompatibilityInput, type CompatibilityProvenance, type
|
|
75
|
+
export { ASSET_CONTENT_TYPES, type Ancestry, type AppliedStyles, type AssetEntry, type AssetManifest, BRAND_SPECIFIER, COMPATIBILITY_PROVENANCE, type ClassDiscovery, type CompatibilityInput, type CompatibilityProvenance, type CompiledSelector, type Compound, type CssDeclaration, type CssRule, EMAIL_CLIENT_MATRIX, EMAIL_DOCTYPE, EMAIL_ELEMENTS, EMAIL_GLOBAL_ATTRIBUTES, ESSENTIAL_CONSTRUCTS, type EmailAttributeSpec, type EmailBrand, type EmailBrandAddress, type EmailBrandAssets, type EmailBrandFooter, type EmailBrandSocialLink, type EmailClientTarget, EmailCompileError, type EmailCompileOutput, type EmailDiagnostic, type EmailDiagnosticSeverity, type EmailElementSelection, type EmailElementSpec, type EmailGlobalProps, type EmailHtmlOutput, type EmailIntrinsicElements, type EmailLayout, type EmailStyle, type EmailTag, type EmittedPosition, INSTANCE_PATH_ATTRIBUTE, type ProjectTransform, type RenderedEmail, type SerializeEmailOptions, type Specificity, type Stylesheet, TAILWIND_VERSION, type TailwindLimits, type TailwindOptions, type TailwindOutput, type TransformOptions, applyStylesheet, assetEntry, assetUrl, checkAssetBase, checkEmailCompatibility, classListOf, compileEmail, compileSelector, compileTailwind, deriveEmailText, discoverClassCandidates, downlevelColors, downlevelMediaQuery, emailAuthoringTarget, emailDefinitionInstances, emailElement, emailSelectionAncestry, emailSelectionIndex, emailSelectionSiblings, emailSelections, escapeAttribute, escapeText, finalizeValue, foldCalc, formatColor, formatEmailDiagnostic, hasBlockingCompatibility, hasBlockingDiagnostic, isAssetPath, isExternalAsset, isUrlAttribute, matchesSelector, parseBrandSpecifier, parseColor, parseStylesheet, projectBrandSpecifier, renderHeadCss, resolveVariables, serializeEmailHtml, transformProject, unknownCoverage };
|
|
306
76
|
//# sourceMappingURL=compiler.d.ts.map
|