@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
package/dist/css-BVQKICKC.d.ts
DELETED
|
@@ -1,109 +0,0 @@
|
|
|
1
|
-
import { r as EmailDiagnostic } from "./diagnostics-B-Gym34R.js";
|
|
2
|
-
import { m as EmailNode } from "./elements-cqldpaJt.js";
|
|
3
|
-
import "css-tree";
|
|
4
|
-
//#region src/email/font-stacks.d.ts
|
|
5
|
-
/** One `@font-face` rule, its `src` already resolved to served URLs. */
|
|
6
|
-
interface FontFaceRule {
|
|
7
|
-
/** The family the rule declares, unquoted. */
|
|
8
|
-
readonly family: string;
|
|
9
|
-
/** The rule as it goes into the email's `<head>`. */
|
|
10
|
-
readonly css: string;
|
|
11
|
-
}
|
|
12
|
-
//#endregion
|
|
13
|
-
//#region src/email/fonts.d.ts
|
|
14
|
-
/**
|
|
15
|
-
* Maps a relative `src` URL, as authored, to the URL its project file is served
|
|
16
|
-
* from, or `undefined` when the project has no such file. The stylesheet's host
|
|
17
|
-
* owns this: it knows which file the stylesheet came from and the asset base.
|
|
18
|
-
*/
|
|
19
|
-
type FontFileResolver = (reference: string) => string | undefined;
|
|
20
|
-
//#endregion
|
|
21
|
-
//#region src/email/selectors.d.ts
|
|
22
|
-
type EmailElementNode = Extract<EmailNode, {
|
|
23
|
-
type: "Element";
|
|
24
|
-
}>;
|
|
25
|
-
interface AttributeTest {
|
|
26
|
-
readonly name: string;
|
|
27
|
-
readonly operator?: string | undefined;
|
|
28
|
-
readonly value?: string | undefined;
|
|
29
|
-
}
|
|
30
|
-
interface Compound {
|
|
31
|
-
readonly tag?: string | undefined;
|
|
32
|
-
readonly id?: string | undefined;
|
|
33
|
-
readonly classes: readonly string[];
|
|
34
|
-
readonly attributes: readonly AttributeTest[];
|
|
35
|
-
/** A compound the matcher cannot evaluate — a pseudo-class, say — never matches. */
|
|
36
|
-
readonly opaque: boolean;
|
|
37
|
-
}
|
|
38
|
-
type Combinator = "descendant" | "child" | "adjacent" | "sibling";
|
|
39
|
-
interface CompiledSelector {
|
|
40
|
-
/** Document order, left to right; each part names the combinator that follows it. */
|
|
41
|
-
readonly parts: readonly {
|
|
42
|
-
readonly compound: Compound;
|
|
43
|
-
readonly after?: Combinator;
|
|
44
|
-
}[];
|
|
45
|
-
}
|
|
46
|
-
/** An element together with the ancestors and preceding siblings a combinator needs. */
|
|
47
|
-
interface Ancestry {
|
|
48
|
-
readonly element: EmailElementNode;
|
|
49
|
-
readonly parent: Ancestry | undefined;
|
|
50
|
-
readonly previous: readonly EmailElementNode[];
|
|
51
|
-
}
|
|
52
|
-
declare const classListOf: (element: EmailElementNode) => readonly string[];
|
|
53
|
-
/** Match a compiled selector against one element in its tree position. */
|
|
54
|
-
declare const matchesSelector: (selector: CompiledSelector | undefined, ancestry: Ancestry) => boolean;
|
|
55
|
-
//#endregion
|
|
56
|
-
//#region src/email/css.d.ts
|
|
57
|
-
interface CssDeclaration {
|
|
58
|
-
/** Kebab-case property name, as authored. */
|
|
59
|
-
readonly property: string;
|
|
60
|
-
readonly value: string;
|
|
61
|
-
readonly important: boolean;
|
|
62
|
-
}
|
|
63
|
-
/** Specificity as the CSS triple (id, class/attribute/pseudo-class, type). */
|
|
64
|
-
type Specificity = readonly [number, number, number];
|
|
65
|
-
interface CssRule {
|
|
66
|
-
/** Exactly one selector; a selector list is split into one rule each. */
|
|
67
|
-
readonly selector: string;
|
|
68
|
-
/** Decoded class identifiers mentioned by this selector, including nested pseudo selectors. */
|
|
69
|
-
readonly classes: readonly string[];
|
|
70
|
-
readonly specificity: Specificity;
|
|
71
|
-
readonly declarations: readonly CssDeclaration[];
|
|
72
|
-
/** Position across every stylesheet, in the order they were imported. */
|
|
73
|
-
readonly order: number;
|
|
74
|
-
/** Declared `@layer` index; unlayered declarations sort above every layer. */
|
|
75
|
-
readonly layer: number;
|
|
76
|
-
/** Enclosing conditional at-rule preludes, outermost first. */
|
|
77
|
-
readonly conditions: readonly string[];
|
|
78
|
-
/** Unconditional and pseudo-free rules are the only ones that can become an inline style. */
|
|
79
|
-
readonly inlinable: boolean;
|
|
80
|
-
/** Compiled at build time so the render lane needs no CSS parser. */
|
|
81
|
-
readonly matcher: CompiledSelector | undefined;
|
|
82
|
-
}
|
|
83
|
-
interface Stylesheet {
|
|
84
|
-
readonly rules: readonly CssRule[];
|
|
85
|
-
/** `@page`, `@keyframes` and other at-rules kept verbatim in `<head>`. */
|
|
86
|
-
readonly headAtRules: readonly string[];
|
|
87
|
-
/** Validated `@font-face` rules, `src` resolved; the render hides them from classic Outlook. */
|
|
88
|
-
readonly fontFaces: readonly FontFaceRule[];
|
|
89
|
-
/** Unconditional custom properties, for resolving `var()` before inlining. */
|
|
90
|
-
readonly variables: Readonly<Record<string, string>>;
|
|
91
|
-
readonly diagnostics: readonly EmailDiagnostic[];
|
|
92
|
-
}
|
|
93
|
-
/** Compile a selector into the plain-data matcher the render lane uses. */
|
|
94
|
-
declare const compileSelector: (selector: string) => CompiledSelector | undefined;
|
|
95
|
-
/** Parse one stylesheet into rules, keeping layer, order and conditions. */
|
|
96
|
-
declare const parseStylesheet: (source: string, options?: {
|
|
97
|
-
readonly origin?: string;
|
|
98
|
-
readonly startOrder?: number;
|
|
99
|
-
/** Resolves a relative `@font-face` src to the URL its project file is served from. */
|
|
100
|
-
readonly resolveFontFile?: FontFileResolver | undefined;
|
|
101
|
-
/**
|
|
102
|
-
* The sheet belongs to the project theme, whose `@import`s the Tailwind
|
|
103
|
-
* compile resolves; they are layering, not something to report here.
|
|
104
|
-
*/
|
|
105
|
-
readonly themeImports?: boolean | undefined;
|
|
106
|
-
}) => Stylesheet;
|
|
107
|
-
//#endregion
|
|
108
|
-
export { compileSelector as a, CompiledSelector as c, matchesSelector as d, Stylesheet as i, Compound as l, CssRule as n, parseStylesheet as o, Specificity as r, Ancestry as s, CssDeclaration as t, classListOf as u };
|
|
109
|
-
//# sourceMappingURL=css-BVQKICKC.d.ts.map
|
|
@@ -1,403 +0,0 @@
|
|
|
1
|
-
//#region src/diagnostic-codes.d.ts
|
|
2
|
-
interface DiagnosticCodeSpec {
|
|
3
|
-
/** What is wrong, in one sentence an agent can act on. */
|
|
4
|
-
readonly summary: string;
|
|
5
|
-
/** The repair, in one sentence. */
|
|
6
|
-
readonly fix: string;
|
|
7
|
-
/** Agent instructions for upgrading an incompatible template format. */
|
|
8
|
-
readonly upgrade?: string;
|
|
9
|
-
/** Reported only for an SMS or WhatsApp body; surfaces that gate those channels omit it. */
|
|
10
|
-
readonly channelOnly?: true;
|
|
11
|
-
}
|
|
12
|
-
declare const DIAGNOSTIC_CODES: {
|
|
13
|
-
readonly "no-template": {
|
|
14
|
-
readonly summary: "The entry does not default-export a template.";
|
|
15
|
-
readonly fix: "Default-export defineTemplate({ ... }) imported from @samva/markup.";
|
|
16
|
-
};
|
|
17
|
-
readonly "legacy-definition": {
|
|
18
|
-
readonly summary: "The entry default-exports something other than defineTemplate.";
|
|
19
|
-
readonly fix: "Import { defineTemplate } from \"@samva/markup\" and default-export defineTemplate({ ... }).";
|
|
20
|
-
readonly upgrade: string;
|
|
21
|
-
};
|
|
22
|
-
readonly "dynamic-definition": {
|
|
23
|
-
readonly summary: "A definition field is spread or computed instead of written out.";
|
|
24
|
-
readonly fix: "Write each field as name: value.";
|
|
25
|
-
};
|
|
26
|
-
readonly "invalid-template-id": {
|
|
27
|
-
readonly summary: "The template id is not a lowercase kebab-case string literal.";
|
|
28
|
-
readonly fix: "Write id: \"order-shipped\".";
|
|
29
|
-
};
|
|
30
|
-
readonly "missing-schema": {
|
|
31
|
-
readonly summary: "The template declares no input schema.";
|
|
32
|
-
readonly fix: "Add schema: jsonSchema<Input>({ ... }).";
|
|
33
|
-
};
|
|
34
|
-
readonly "schema-not-static": {
|
|
35
|
-
readonly summary: "The schema cannot be read without running code.";
|
|
36
|
-
readonly fix: "Write the schema as a literal jsonSchema<Input>({ type: 'object', ... }).";
|
|
37
|
-
};
|
|
38
|
-
readonly "invalid-schema": {
|
|
39
|
-
readonly summary: "The schema uses JSON Schema keywords the compiler cannot validate against.";
|
|
40
|
-
readonly fix: "Use only the JSON Schema keywords the package README lists.";
|
|
41
|
-
};
|
|
42
|
-
readonly "missing-fixtures": {
|
|
43
|
-
readonly summary: "The template declares no fixtures.";
|
|
44
|
-
readonly fix: "Add fixtures: { default: { ... } } with at least one valid payload.";
|
|
45
|
-
};
|
|
46
|
-
readonly "fixtures-not-static": {
|
|
47
|
-
readonly summary: "A fixture is computed instead of written as data.";
|
|
48
|
-
readonly fix: "Write each fixture as a literal object; an imported asset is allowed.";
|
|
49
|
-
};
|
|
50
|
-
readonly "invalid-fixture-name": {
|
|
51
|
-
readonly summary: "A fixture key is not a single path segment.";
|
|
52
|
-
readonly fix: "Use letters, digits, '.', '_' and '-', starting with a letter or digit.";
|
|
53
|
-
};
|
|
54
|
-
readonly "fixture-invalid": {
|
|
55
|
-
readonly summary: "A fixture does not match the schema.";
|
|
56
|
-
readonly fix: "Change the fixture, or the schema, so every fixture is a payload a send could carry.";
|
|
57
|
-
};
|
|
58
|
-
readonly "invalid-locale": {
|
|
59
|
-
readonly summary: "The template's default locale is not a string literal.";
|
|
60
|
-
readonly fix: "Write locale: \"en-US\".";
|
|
61
|
-
};
|
|
62
|
-
readonly "no-channel": {
|
|
63
|
-
readonly summary: "The template declares no channel body.";
|
|
64
|
-
readonly fix: "Add an email body.";
|
|
65
|
-
};
|
|
66
|
-
readonly "invalid-channel": {
|
|
67
|
-
readonly summary: "A channel field is not shaped as the channel requires.";
|
|
68
|
-
readonly fix: "Write email: { subject, preheader?, body } with each a function of the input.";
|
|
69
|
-
};
|
|
70
|
-
readonly "not-a-function": {
|
|
71
|
-
readonly summary: "A channel field is not a function of the input.";
|
|
72
|
-
readonly fix: "Write (input) => ... in place or declare the function in the project.";
|
|
73
|
-
};
|
|
74
|
-
readonly "missing-subject": {
|
|
75
|
-
readonly summary: "The email channel has no subject.";
|
|
76
|
-
readonly fix: "Add subject: (input) => ....";
|
|
77
|
-
};
|
|
78
|
-
readonly "missing-body": {
|
|
79
|
-
readonly summary: "The email channel has no body.";
|
|
80
|
-
readonly fix: "Add body: (input) => (<Email>...</Email>).";
|
|
81
|
-
};
|
|
82
|
-
readonly "multiple-roots": {
|
|
83
|
-
readonly summary: "The body renders nothing or more than one root.";
|
|
84
|
-
readonly fix: "Wrap the body in a single element such as <Email>.";
|
|
85
|
-
};
|
|
86
|
-
readonly "preheader-without-shell": {
|
|
87
|
-
readonly summary: "A preheader is set but the body has no <Email> shell to hold it.";
|
|
88
|
-
readonly fix: "Wrap the body in <Email>.";
|
|
89
|
-
};
|
|
90
|
-
readonly "wrong-channel": {
|
|
91
|
-
readonly summary: "A channel body does not return its own channel component.";
|
|
92
|
-
readonly fix: "Return one element imported from the channel package.";
|
|
93
|
-
readonly channelOnly: true;
|
|
94
|
-
};
|
|
95
|
-
readonly "syntax-error": {
|
|
96
|
-
readonly summary: "A project file does not parse as TSX.";
|
|
97
|
-
readonly fix: "Fix the syntax at the reported location.";
|
|
98
|
-
};
|
|
99
|
-
readonly "non-project-import": {
|
|
100
|
-
readonly summary: "The file imports something other than @samva/markup or a project file.";
|
|
101
|
-
readonly fix: "Remove the import, or copy the code you need into a project file.";
|
|
102
|
-
};
|
|
103
|
-
readonly "unresolved-import": {
|
|
104
|
-
readonly summary: "An import names no file in the project.";
|
|
105
|
-
readonly fix: "Check the path and the file extension.";
|
|
106
|
-
};
|
|
107
|
-
readonly "recursive-partial": {
|
|
108
|
-
readonly summary: "A partial renders itself; partials are inlined at compile time.";
|
|
109
|
-
readonly fix: "Flatten the recursion, or repeat the structure with .map.";
|
|
110
|
-
};
|
|
111
|
-
readonly "nesting-limit": {
|
|
112
|
-
readonly summary: "The template nests deeper than the compiler reads.";
|
|
113
|
-
readonly fix: "Flatten the structure.";
|
|
114
|
-
};
|
|
115
|
-
readonly "dynamic-expression": {
|
|
116
|
-
readonly summary: "An expression outside the static profile: a call other than fmt.* and .map, a computed value, or a spread.";
|
|
117
|
-
readonly fix: "Compute the value where the message is sent and bind it from the payload.";
|
|
118
|
-
};
|
|
119
|
-
readonly "statement-in-body": {
|
|
120
|
-
readonly summary: "A body contains a statement (const, if, a loop); a body is one expression.";
|
|
121
|
-
readonly fix: "Use cond && <X />, cond ? <A /> : <B /> and .map, or send the computed value in the payload.";
|
|
122
|
-
};
|
|
123
|
-
readonly "unsupported-pattern": {
|
|
124
|
-
readonly summary: "A parameter pattern or default value the profile cannot bind.";
|
|
125
|
-
readonly fix: "Use plain names or destructuring without defaults; declare the field required or guard it.";
|
|
126
|
-
};
|
|
127
|
-
readonly "hook-call": {
|
|
128
|
-
readonly summary: "A hook was called; templates have no state, effects or context.";
|
|
129
|
-
readonly fix: "Read the input through the function's parameter and send anything else in the payload.";
|
|
130
|
-
};
|
|
131
|
-
readonly "unknown-formatter": {
|
|
132
|
-
readonly summary: "fmt.<name> is not a formatter.";
|
|
133
|
-
readonly fix: "Use fmt.money, number, date, time, plural or list.";
|
|
134
|
-
};
|
|
135
|
-
readonly "formatter-arguments": {
|
|
136
|
-
readonly summary: "A formatter got the wrong number of arguments.";
|
|
137
|
-
readonly fix: "Match the formatter's signature in the contract.";
|
|
138
|
-
};
|
|
139
|
-
readonly "reserved-character": {
|
|
140
|
-
readonly summary: "Text contains a private-use character the compiler reserves.";
|
|
141
|
-
readonly fix: "Remove the characters U+E000 to U+E003.";
|
|
142
|
-
};
|
|
143
|
-
readonly "reserved-url": {
|
|
144
|
-
readonly summary: "A URL is the unsubscribe placeholder only BrandFooter can write.";
|
|
145
|
-
readonly fix: "Render <BrandFooter /> instead.";
|
|
146
|
-
};
|
|
147
|
-
readonly "reserved-attribute": {
|
|
148
|
-
readonly summary: "An attribute is written only by a brand component.";
|
|
149
|
-
readonly fix: "Render BrandFooter from samva:brand instead of marking an element as the footer.";
|
|
150
|
-
};
|
|
151
|
-
readonly "dynamic-class": {
|
|
152
|
-
readonly summary: "A class name is built at run time, and Tailwind cannot see it.";
|
|
153
|
-
readonly fix: "Write classes literally, or choose between literal lists: input.vip ? \"bg-amber-100\" : \"bg-white\".";
|
|
154
|
-
};
|
|
155
|
-
readonly "too-many-class-variants": {
|
|
156
|
-
readonly summary: "A class list chooses between more literal lists than the compiler resolves.";
|
|
157
|
-
readonly fix: "Split the choice into fewer conditions, or move part of it to a partial.";
|
|
158
|
-
};
|
|
159
|
-
readonly "invalid-style": {
|
|
160
|
-
readonly summary: "A style prop is not a static property object.";
|
|
161
|
-
readonly fix: "Write style={{ backgroundColor: \"#fff\" }} with literal values, or use classes.";
|
|
162
|
-
};
|
|
163
|
-
readonly "unknown-field": {
|
|
164
|
-
readonly summary: "A binding names a field the schema does not declare.";
|
|
165
|
-
readonly fix: "Add the field to the schema, or bind a field it declares (the message suggests the nearest).";
|
|
166
|
-
};
|
|
167
|
-
readonly "unguarded-optional": {
|
|
168
|
-
readonly summary: "An optional field is read outside a guard, so a send without it would render a blank.";
|
|
169
|
-
readonly fix: "Guard it with {input.field && ...}, or make the field required.";
|
|
170
|
-
};
|
|
171
|
-
readonly "invalid-binding-type": {
|
|
172
|
-
readonly summary: "A binding has the wrong type for where it is used.";
|
|
173
|
-
readonly fix: "Bind a field of the type the position needs, or send it in that type.";
|
|
174
|
-
};
|
|
175
|
-
readonly "unknown-component": {
|
|
176
|
-
readonly summary: "A component the profile cannot read.";
|
|
177
|
-
readonly fix: "Import components from @samva/markup/email/components, samva:brand, or the project.";
|
|
178
|
-
};
|
|
179
|
-
readonly "dynamic-numeric-prop": {
|
|
180
|
-
readonly summary: "A prop that sizes layout at compile time is not a number literal.";
|
|
181
|
-
readonly fix: "Write the number literally, for example height={44}.";
|
|
182
|
-
};
|
|
183
|
-
readonly "button-dynamic-label": {
|
|
184
|
-
readonly summary: "A Button label is read at render time, so classic Outlook cannot size it.";
|
|
185
|
-
readonly fix: "Give the button a width: <Button width={200}>.";
|
|
186
|
-
};
|
|
187
|
-
readonly "invalid-columns-each": {
|
|
188
|
-
readonly summary: "<Columns each> is not a list from the input.";
|
|
189
|
-
readonly fix: "Write each={input.items} with a callback returning <Column>.";
|
|
190
|
-
};
|
|
191
|
-
readonly "invalid-columns-per": {
|
|
192
|
-
readonly summary: "<Columns per> is not a positive integer literal.";
|
|
193
|
-
readonly fix: "Write per={2}.";
|
|
194
|
-
};
|
|
195
|
-
readonly "invalid-button-number": {
|
|
196
|
-
readonly summary: "A Button size prop is not a finite number.";
|
|
197
|
-
readonly fix: "Pass a finite number.";
|
|
198
|
-
};
|
|
199
|
-
readonly "unsupported-element": {
|
|
200
|
-
readonly summary: "An element outside the supported email vocabulary.";
|
|
201
|
-
readonly fix: "Use an element from the contract's element table.";
|
|
202
|
-
};
|
|
203
|
-
readonly "unsupported-attribute": {
|
|
204
|
-
readonly summary: "An attribute the element does not support.";
|
|
205
|
-
readonly fix: "Use a supported attribute, or data-* and aria-*.";
|
|
206
|
-
};
|
|
207
|
-
readonly "missing-attribute": {
|
|
208
|
-
readonly summary: "An element is missing a required attribute.";
|
|
209
|
-
readonly fix: "Add the attribute, for example alt on img.";
|
|
210
|
-
};
|
|
211
|
-
readonly "invalid-attribute-value": {
|
|
212
|
-
readonly summary: "An attribute value is not a string or number, or contains control characters.";
|
|
213
|
-
readonly fix: "Pass plain text.";
|
|
214
|
-
};
|
|
215
|
-
readonly "duplicate-attribute": {
|
|
216
|
-
readonly summary: "An attribute is written twice.";
|
|
217
|
-
readonly fix: "Keep one.";
|
|
218
|
-
};
|
|
219
|
-
readonly "invalid-content": {
|
|
220
|
-
readonly summary: "An element holds content its content model does not allow.";
|
|
221
|
-
readonly fix: "Move the child to a parent that accepts it.";
|
|
222
|
-
};
|
|
223
|
-
readonly "void-element-children": {
|
|
224
|
-
readonly summary: "A void element has children.";
|
|
225
|
-
readonly fix: "Remove the children.";
|
|
226
|
-
};
|
|
227
|
-
readonly "event-handler": {
|
|
228
|
-
readonly summary: "An event handler; email clients strip scripting.";
|
|
229
|
-
readonly fix: "Remove the handler; use a link for interaction.";
|
|
230
|
-
};
|
|
231
|
-
readonly "dangerous-html": {
|
|
232
|
-
readonly summary: "dangerouslySetInnerHTML; there is no raw-HTML escape hatch.";
|
|
233
|
-
readonly fix: "Write the markup as JSX.";
|
|
234
|
-
};
|
|
235
|
-
readonly "unsafe-url": {
|
|
236
|
-
readonly summary: "A URL uses a scheme email cannot send safely.";
|
|
237
|
-
readonly fix: "Use an https URL, a mailto: or tel: link, or a bound URL.";
|
|
238
|
-
};
|
|
239
|
-
readonly "unsafe-raw-text": {
|
|
240
|
-
readonly summary: "Raw text content contains markup that could end its element.";
|
|
241
|
-
readonly fix: "Remove the offending sequence.";
|
|
242
|
-
};
|
|
243
|
-
readonly "unsupported-style-property": {
|
|
244
|
-
readonly summary: "A style property name is not a CSS property.";
|
|
245
|
-
readonly fix: "Write camelCase (backgroundColor) or a custom property (--brand).";
|
|
246
|
-
};
|
|
247
|
-
readonly "invalid-style-value": {
|
|
248
|
-
readonly summary: "A style value is not a string or number.";
|
|
249
|
-
readonly fix: "Pass a string or number.";
|
|
250
|
-
};
|
|
251
|
-
readonly "unsafe-style-value": {
|
|
252
|
-
readonly summary: "A style value contains CSS that could break out of its declaration.";
|
|
253
|
-
readonly fix: "Remove the offending characters.";
|
|
254
|
-
};
|
|
255
|
-
readonly "missing-head": {
|
|
256
|
-
readonly summary: "Styles that cannot be inlined need a <head> to live in.";
|
|
257
|
-
readonly fix: "Wrap the message in <Email>, or write those declarations inline.";
|
|
258
|
-
};
|
|
259
|
-
readonly "invalid-subject": {
|
|
260
|
-
readonly summary: "The subject is not one line of text.";
|
|
261
|
-
readonly fix: "Return a single-line string.";
|
|
262
|
-
};
|
|
263
|
-
readonly "invalid-preheader": {
|
|
264
|
-
readonly summary: "The preheader is not a string.";
|
|
265
|
-
readonly fix: "Return a string.";
|
|
266
|
-
};
|
|
267
|
-
readonly "invalid-text": {
|
|
268
|
-
readonly summary: "The plain-text body is not a string.";
|
|
269
|
-
readonly fix: "Return a string.";
|
|
270
|
-
};
|
|
271
|
-
readonly "button-outlook-fallback": {
|
|
272
|
-
readonly summary: "Classic Outlook needs a height and a plain string label to draw the button.";
|
|
273
|
-
readonly fix: "Give <Button> a height and a string label.";
|
|
274
|
-
};
|
|
275
|
-
readonly "unmatched-class": {
|
|
276
|
-
readonly summary: "A class produced no styles.";
|
|
277
|
-
readonly fix: "Use a class the theme or Tailwind defines, or write the style inline.";
|
|
278
|
-
};
|
|
279
|
-
readonly "tailwind-dynamic-class": {
|
|
280
|
-
readonly summary: "A class list is assembled at run time.";
|
|
281
|
-
readonly fix: "Write the classes literally.";
|
|
282
|
-
};
|
|
283
|
-
readonly "css-parse-error": {
|
|
284
|
-
readonly summary: "A stylesheet does not parse.";
|
|
285
|
-
readonly fix: "Fix the CSS at the reported location.";
|
|
286
|
-
};
|
|
287
|
-
readonly "css-import-unresolved": {
|
|
288
|
-
readonly summary: "A stylesheet @import cannot be resolved.";
|
|
289
|
-
readonly fix: "Import the stylesheet from the template module, or use the theme.css layers.";
|
|
290
|
-
};
|
|
291
|
-
readonly "css-unsupported-at-rule": {
|
|
292
|
-
readonly summary: "An at-rule is not applied to email output.";
|
|
293
|
-
readonly fix: "Remove it or move the declarations into a class rule.";
|
|
294
|
-
};
|
|
295
|
-
readonly "css-conditional-variable": {
|
|
296
|
-
readonly summary: "A custom property is redefined inside a conditional at-rule.";
|
|
297
|
-
readonly fix: "Keep the override on a class rule.";
|
|
298
|
-
};
|
|
299
|
-
readonly "email-font-fallback": {
|
|
300
|
-
readonly summary: "A font stack names a project font without a generic fallback.";
|
|
301
|
-
readonly fix: "End the stack with sans-serif, serif or monospace.";
|
|
302
|
-
};
|
|
303
|
-
readonly "email-font-family": {
|
|
304
|
-
readonly summary: "@font-face declares no font-family.";
|
|
305
|
-
readonly fix: "Add font-family.";
|
|
306
|
-
};
|
|
307
|
-
readonly "email-font-src": {
|
|
308
|
-
readonly summary: "@font-face declares no usable url() src.";
|
|
309
|
-
readonly fix: "Add a url() pointing at a .woff2 file.";
|
|
310
|
-
};
|
|
311
|
-
readonly "email-font-format": {
|
|
312
|
-
readonly summary: "@font-face uses a format other than WOFF2.";
|
|
313
|
-
readonly fix: "Convert the file to .woff2.";
|
|
314
|
-
};
|
|
315
|
-
readonly "email-font-missing": {
|
|
316
|
-
readonly summary: "@font-face names a file the project does not hold.";
|
|
317
|
-
readonly fix: "Add the file; paths resolve from the stylesheet's directory.";
|
|
318
|
-
};
|
|
319
|
-
readonly "invalid-asset-base": {
|
|
320
|
-
readonly summary: "The asset base is not an https URL or a path.";
|
|
321
|
-
readonly fix: "Use an https URL, an absolute path, or a relative path.";
|
|
322
|
-
};
|
|
323
|
-
readonly "brand-unavailable": {
|
|
324
|
-
readonly summary: "The build has no brand to resolve a samva:brand import.";
|
|
325
|
-
readonly fix: "Create or select the brand the import names.";
|
|
326
|
-
};
|
|
327
|
-
readonly "brand-import-conflict": {
|
|
328
|
-
readonly summary: "The project imports two different brands.";
|
|
329
|
-
readonly fix: "Import one brand specifier everywhere.";
|
|
330
|
-
};
|
|
331
|
-
readonly "caniemail/unknown-coverage": {
|
|
332
|
-
readonly summary: "A feature has no client-support data.";
|
|
333
|
-
readonly fix: "Verify it in the target clients.";
|
|
334
|
-
};
|
|
335
|
-
readonly "invalid-attribute": {
|
|
336
|
-
readonly summary: "A channel component attribute has a value the channel does not accept.";
|
|
337
|
-
readonly fix: "Use one of the listed values.";
|
|
338
|
-
readonly channelOnly: true;
|
|
339
|
-
};
|
|
340
|
-
readonly "unknown-attribute": {
|
|
341
|
-
readonly summary: "A channel component attribute the component does not have.";
|
|
342
|
-
readonly fix: "Use one of the listed attributes.";
|
|
343
|
-
readonly channelOnly: true;
|
|
344
|
-
};
|
|
345
|
-
readonly "sms-markup": {
|
|
346
|
-
readonly summary: "An SMS body contains an element; SMS is plain text.";
|
|
347
|
-
readonly fix: "Write text and bindings, with a newline for a line break.";
|
|
348
|
-
readonly channelOnly: true;
|
|
349
|
-
};
|
|
350
|
-
readonly "whatsapp-structure": {
|
|
351
|
-
readonly summary: "WhatsApp content sits outside Header, Body, Footer or Buttons.";
|
|
352
|
-
readonly fix: "Move it into <WhatsApp.Body>.";
|
|
353
|
-
readonly channelOnly: true;
|
|
354
|
-
};
|
|
355
|
-
readonly "whatsapp-body-required": {
|
|
356
|
-
readonly summary: "A WhatsApp template has no body.";
|
|
357
|
-
readonly fix: "Add <WhatsApp.Body>...</WhatsApp.Body>.";
|
|
358
|
-
readonly channelOnly: true;
|
|
359
|
-
};
|
|
360
|
-
readonly "whatsapp-conditional": {
|
|
361
|
-
readonly summary: "A WhatsApp part branches or contains elements; Meta registers its text once.";
|
|
362
|
-
readonly fix: "Choose the wording in the payload, or write separate templates.";
|
|
363
|
-
readonly channelOnly: true;
|
|
364
|
-
};
|
|
365
|
-
readonly "whatsapp-header-media": {
|
|
366
|
-
readonly summary: "A WhatsApp media header is not exactly one URL.";
|
|
367
|
-
readonly fix: "Write the URL as the only child: a literal or one binding.";
|
|
368
|
-
readonly channelOnly: true;
|
|
369
|
-
};
|
|
370
|
-
readonly "whatsapp-header-variables": {
|
|
371
|
-
readonly summary: "A WhatsApp header text takes more than one variable.";
|
|
372
|
-
readonly fix: "Keep one binding in the header and move the rest to the body.";
|
|
373
|
-
readonly channelOnly: true;
|
|
374
|
-
};
|
|
375
|
-
readonly "whatsapp-length": {
|
|
376
|
-
readonly summary: "A WhatsApp part exceeds Meta's length limit.";
|
|
377
|
-
readonly fix: "Shorten the text.";
|
|
378
|
-
readonly channelOnly: true;
|
|
379
|
-
};
|
|
380
|
-
readonly "whatsapp-button-text": {
|
|
381
|
-
readonly summary: "A WhatsApp button has no label or value between its tags.";
|
|
382
|
-
readonly fix: "Write the label or value as text between the tags.";
|
|
383
|
-
readonly channelOnly: true;
|
|
384
|
-
};
|
|
385
|
-
readonly "whatsapp-button-limit": {
|
|
386
|
-
readonly summary: "The conditions can produce more buttons of a kind than Meta allows.";
|
|
387
|
-
readonly fix: "Remove buttons, or split the template.";
|
|
388
|
-
readonly channelOnly: true;
|
|
389
|
-
};
|
|
390
|
-
};
|
|
391
|
-
/** Whether a diagnostic identifier selects an agent-driven format upgrade. */
|
|
392
|
-
declare const hasUpgradeRecipe: (code: string) => boolean;
|
|
393
|
-
type DiagnosticCode = keyof typeof DIAGNOSTIC_CODES;
|
|
394
|
-
/** Families whose code carries a suffix chosen at run time. */
|
|
395
|
-
declare const DIAGNOSTIC_CODE_FAMILIES: {
|
|
396
|
-
readonly "caniemail/": {
|
|
397
|
-
readonly summary: "A CSS property, HTML element or attribute that a target email client ignores or partly supports (from the caniemail.com data), reported as caniemail/<feature>.";
|
|
398
|
-
readonly fix: "Use the alternative the message names, such as an email component instead of display: flex.";
|
|
399
|
-
};
|
|
400
|
-
};
|
|
401
|
-
//#endregion
|
|
402
|
-
export { DIAGNOSTIC_CODES, DIAGNOSTIC_CODE_FAMILIES, DiagnosticCode, DiagnosticCodeSpec, hasUpgradeRecipe };
|
|
403
|
-
//# sourceMappingURL=diagnostic-codes.d.ts.map
|