@samva/markup 0.8.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.
Files changed (171) hide show
  1. package/AGENTS.md +90 -37
  2. package/README.md +188 -52
  3. package/dist/assets-C5duwTya.d.ts +40 -0
  4. package/dist/{brand-DcoVkh_S.d.ts → brand-B-0bN_Ir.d.ts} +2 -2
  5. package/dist/{render-vAv_4r9v.js → cascade-t6kxlgEI.js} +93 -280
  6. package/dist/channel-edit.d.ts +121 -0
  7. package/dist/channel-edit.js +609 -0
  8. package/dist/channel-specs-B6M_HlaV.js +29 -0
  9. package/dist/channel-specs-C2feJwuP.d.ts +13 -0
  10. package/dist/compatibility-DbISoFIq.js +589 -0
  11. package/dist/compiler.d.ts +10 -257
  12. package/dist/compiler.js +10 -730
  13. package/dist/{css-CS2jLID6.d.ts → css-BVQKICKC.d.ts} +3 -3
  14. package/dist/diagnostic-codes.d.ts +403 -0
  15. package/dist/diagnostic-codes.js +399 -0
  16. package/dist/{diagnostics-BMYtBCQk.d.ts → diagnostics-B-Gym34R.d.ts} +8 -4
  17. package/dist/diagnostics.d.ts +31 -2
  18. package/dist/diagnostics.js +1 -19
  19. package/dist/{elements-BzjjnoCS.d.ts → elements-cqldpaJt.d.ts} +3 -3
  20. package/dist/email/assets.d.ts +2 -40
  21. package/dist/email/brand-footer.d.ts +2 -2
  22. package/dist/email/brand-footer.js +4 -3
  23. package/dist/email/brand.d.ts +1 -1
  24. package/dist/email/brand.js +1 -1
  25. package/dist/email/components.d.ts +21 -10
  26. package/dist/email/components.js +46 -11
  27. package/dist/email/diagnostics.d.ts +2 -2
  28. package/dist/email/diagnostics.js +2 -1
  29. package/dist/email/elements.d.ts +1 -1
  30. package/dist/email/html.d.ts +2 -2
  31. package/dist/email/html.js +45 -2
  32. package/dist/email/jsx-dev-runtime.d.ts +2 -2
  33. package/dist/email/jsx-runtime.d.ts +1 -1
  34. package/dist/email/render.d.ts +8 -18
  35. package/dist/email/render.js +163 -3
  36. package/dist/email/text.d.ts +1 -1
  37. package/dist/fmt.d.ts +32 -0
  38. package/dist/fmt.js +174 -0
  39. package/dist/{html-Bl9BAdqc.d.ts → html-BJepOwZ4.d.ts} +19 -5
  40. package/dist/index.d.ts +2 -0
  41. package/dist/index.js +2 -0
  42. package/dist/ir-aaqNE987.d.ts +252 -0
  43. package/dist/ir.d.ts +2 -0
  44. package/dist/ir.js +7 -0
  45. package/dist/preview-Ekdg1dXG.d.ts +100 -0
  46. package/dist/preview.d.ts +2 -0
  47. package/dist/preview.js +160 -0
  48. package/dist/profile-BH-OtdDA.js +3670 -0
  49. package/dist/render-ir.d.ts +19 -0
  50. package/dist/render-ir.js +826 -0
  51. package/dist/sms-segments.d.ts +13 -2
  52. package/dist/sms.d.ts +16 -0
  53. package/dist/sms.js +12 -0
  54. package/dist/{email/source-edit.d.ts → source-edit.d.ts} +55 -6
  55. package/dist/source-edit.js +343 -0
  56. package/dist/source-locations-C8wCsiAy.d.ts +23 -0
  57. package/dist/source-locations.d.ts +2 -2
  58. package/dist/source-locations.js +3 -89
  59. package/dist/static.d.ts +57 -0
  60. package/dist/static.js +69 -0
  61. package/dist/tailwind-CMYpZf1v.js +614 -0
  62. package/dist/template-_QE_rQND.d.ts +65 -0
  63. package/dist/template.d.ts +2 -2
  64. package/dist/template.js +15 -10
  65. package/dist/theme-css.d.ts +1 -1
  66. package/dist/theme-imports-lvBw3AD1.js +109 -0
  67. package/dist/transform-Ct2OMkFN.d.ts +153 -0
  68. package/dist/whatsapp.d.ts +57 -0
  69. package/dist/whatsapp.js +22 -0
  70. package/generated/contract.json +1782 -0
  71. package/generated/reference.md +353 -0
  72. package/package.json +41 -151
  73. package/skills/sml/SKILL.md +123 -0
  74. package/dist/ast-BrDtApwS.d.ts +0 -107
  75. package/dist/ast.d.ts +0 -2
  76. package/dist/ast.js +0 -124
  77. package/dist/candidate.d.ts +0 -29
  78. package/dist/candidate.js +0 -88
  79. package/dist/catalog-CKuOooB8.d.ts +0 -354
  80. package/dist/checks-D73Xizbw.js +0 -59366
  81. package/dist/checks.d.ts +0 -33
  82. package/dist/checks.js +0 -2
  83. package/dist/classes.d.ts +0 -26
  84. package/dist/classes.js +0 -184
  85. package/dist/compile-sms.d.ts +0 -28
  86. package/dist/compile-sms.js +0 -44
  87. package/dist/compile-whatsapp.d.ts +0 -56
  88. package/dist/compile-whatsapp.js +0 -186
  89. package/dist/compile.d.ts +0 -18
  90. package/dist/compile.js +0 -29
  91. package/dist/components.d.ts +0 -289
  92. package/dist/components.js +0 -106
  93. package/dist/conditionals.d.ts +0 -10
  94. package/dist/conditionals.js +0 -74
  95. package/dist/corpus-CPPfgAHN.d.ts +0 -106
  96. package/dist/diagnostics-OcQKQYSY.d.ts +0 -49
  97. package/dist/email/selection.d.ts +0 -2
  98. package/dist/email/selection.js +0 -91
  99. package/dist/email/source-edit.js +0 -185
  100. package/dist/email/stylesheets.d.ts +0 -15
  101. package/dist/email/stylesheets.js +0 -48
  102. package/dist/emit.d.ts +0 -51
  103. package/dist/emit.js +0 -151
  104. package/dist/interpolate.d.ts +0 -24
  105. package/dist/interpolate.js +0 -43
  106. package/dist/jsx-dev-runtime.d.ts +0 -11
  107. package/dist/jsx-dev-runtime.js +0 -15
  108. package/dist/jsx-runtime-I-1nCtl2.d.ts +0 -57
  109. package/dist/jsx-runtime.d.ts +0 -2
  110. package/dist/jsx-runtime.js +0 -121
  111. package/dist/lexer.d.ts +0 -60
  112. package/dist/lexer.js +0 -281
  113. package/dist/model.d.ts +0 -24
  114. package/dist/model.js +0 -77
  115. package/dist/ops-BvwqHl7V.js +0 -630
  116. package/dist/ops.d.ts +0 -114
  117. package/dist/ops.js +0 -2
  118. package/dist/parser-t29cHLVL.d.ts +0 -396
  119. package/dist/parser.d.ts +0 -2
  120. package/dist/parser.js +0 -859
  121. package/dist/predicate-BI6uRRM-.js +0 -549
  122. package/dist/predicate-M-05Nd7R.d.ts +0 -56
  123. package/dist/predicate.d.ts +0 -2
  124. package/dist/predicate.js +0 -2
  125. package/dist/printer.d.ts +0 -6
  126. package/dist/printer.js +0 -122
  127. package/dist/registry-Dcp6QEK_.d.ts +0 -73
  128. package/dist/registry.d.ts +0 -2
  129. package/dist/registry.js +0 -646
  130. package/dist/render-template.d.ts +0 -45
  131. package/dist/render-template.js +0 -76
  132. package/dist/selection-CCArx9lU.d.ts +0 -91
  133. package/dist/showcase-egkusQBf.d.ts +0 -415
  134. package/dist/sms-segments-y4FpPilJ.d.ts +0 -13
  135. package/dist/source-locations-DrCM82Ym.d.ts +0 -67
  136. package/dist/starters/category-mapping.d.ts +0 -13
  137. package/dist/starters/category-mapping.js +0 -49
  138. package/dist/starters/corpus.d.ts +0 -2
  139. package/dist/starters/corpus.js +0 -194
  140. package/dist/starters/library.d.ts +0 -18
  141. package/dist/starters/library.js +0 -692
  142. package/dist/starters/public-gallery.d.ts +0 -266
  143. package/dist/starters/public-gallery.js +0 -916
  144. package/dist/starters/public-handoff.d.ts +0 -164
  145. package/dist/starters/public-handoff.js +0 -361
  146. package/dist/starters/public-preview-artifacts.d.ts +0 -43
  147. package/dist/starters/public-preview-artifacts.js +0 -104
  148. package/dist/starters/public-preview.d.ts +0 -61
  149. package/dist/starters/public-preview.js +0 -83
  150. package/dist/starters/showcase.d.ts +0 -2
  151. package/dist/starters/showcase.js +0 -335
  152. package/dist/starters/sources.d.ts +0 -45
  153. package/dist/starters/sources.js +0 -7762
  154. package/dist/starters/theme.d.ts +0 -45
  155. package/dist/starters/theme.js +0 -77
  156. package/dist/starters.d.ts +0 -2
  157. package/dist/starters.js +0 -874
  158. package/dist/tailwind-BYq7Lo6u.js +0 -727
  159. package/dist/template-DWftqh4x.d.ts +0 -60
  160. package/dist/tsx-source-instrumentation.d.ts +0 -30
  161. package/dist/tsx-source-instrumentation.js +0 -115
  162. package/dist/tsx-tracer.d.ts +0 -112
  163. package/dist/tsx-tracer.js +0 -985
  164. package/dist/variables-J_L3qxRa.d.ts +0 -77
  165. package/dist/variables.d.ts +0 -2
  166. package/dist/variables.js +0 -141
  167. package/dist/version-BITr58kk.js +0 -96
  168. package/generated/sml-agent-contract.json +0 -709
  169. package/generated/sml-email-agent-contract.json +0 -615
  170. package/generated/sml-email-language-reference.md +0 -94
  171. package/generated/sml-language-reference.md +0 -195
@@ -0,0 +1,353 @@
1
+ # Template authoring reference
2
+
3
+ A template is one TSX file that default-exports `defineTemplate({ id, schema, fixtures, email })`
4
+ from `@samva/markup`, in `templates/` (`emails/` is also recognized). Set
5
+ `jsxImportSource: "@samva/markup/email"`. `email` is `{ subject, preheader?, body }`; each is a
6
+ function of the validated input that the compiler reads without running. The IR it produces is what
7
+ every preview and send renders (IR version 1).
8
+
9
+ ## Static profile
10
+
11
+ | Form | Example | Compiles to |
12
+ | ---------------------- | ------------------------------------------------------------------------------------------------ | --------------------------------------------------- |
13
+ | Text binding | `{input.name}` | bind |
14
+ | Attribute binding | `{input.trackingUrl && <a href={input.trackingUrl}>Track</a>}` | bind on the attribute |
15
+ | Template string | `` `Order ${input.orderId}` `` | concat |
16
+ | Conditional | `{input.trackingUrl && <p>Track it</p>}` | if |
17
+ | Either/or | `{input.vip ? <p>Gold</p> : <p>Standard</p>}` | if / else |
18
+ | Conditions | `{input.items.length > 1 && input.total !== 0 && <p>Many</p>}` | a predicate (===, !==, <, >, !, &&, \|\|, .length) |
19
+ | Loop | `{input.items.map((item, index) => <li key={index}>{item.title}</li>)}` | each |
20
+ | Filtered loop or count | `{input.items.filter((item) => item.qty > 1).length}` | each with a where predicate, or a count |
21
+ | Grid | `<Columns each={input.items} per={2}>{(item) => <Column><p>{item.title}</p></Column>}</Columns>` | each with a chunk size, one row per chunk |
22
+ | Formatter | `{fmt.money(input.total, input.currency)}` | format |
23
+ | Arithmetic | `{fmt.money(input.total * 2, input.currency)}` | an expression node, inside a formatter or condition |
24
+ | Conditional class | `<p className={input.vip ? "bg-amber-100" : "bg-white"}>Hi</p>` | if on the attribute |
25
+
26
+ Refused, each with a diagnostic that names the fix:
27
+
28
+ | Form | Example | Code |
29
+ | -------------------------------- | ------------------------------------------------------------------------- | -------------------- |
30
+ | A call other than fmt.* and .map | `{input.name.toUpperCase()}` | `dynamic-expression` |
31
+ | A statement in a body | `(input) => { const label = input.name; return <Email>{label}</Email>; }` | `statement-in-body` |
32
+ | A hook | `{useState(0)}` | `hook-call` |
33
+ | An event handler | `<a href="/x" onClick={() => 1}>x</a>` | `event-handler` |
34
+ | A class name built at run time | ``<p className={`text-${input.name}`}>x</p>`` | `dynamic-class` |
35
+
36
+ There is no escape hatch: compute the value where the message is sent and add it to the schema.
37
+
38
+ ## Formatters
39
+
40
+ | Formatter | Signature |
41
+ | ------------ | ------------------------------------------------------------------------------------ |
42
+ | `fmt.money` | `money(amount: number, currency: string, locale?: string): string` |
43
+ | `fmt.number` | `number(value: number, options?: Intl.NumberFormatOptions, locale?: string): string` |
44
+ | `fmt.date` | `date(iso: string, style?: DateStyle, locale?: string): string` |
45
+ | `fmt.time` | `time(iso: string, style?: DateStyle, locale?: string): string` |
46
+ | `fmt.plural` | `plural(count: number, forms: PluralForms, locale?: string): string` |
47
+ | `fmt.list` | `list(values: readonly string[], locale?: string): string` |
48
+
49
+ ## Components
50
+
51
+ ### Email
52
+
53
+ Import from `@samva/markup/email/components`.
54
+
55
+ | Prop | Type | Notes |
56
+ | ------------------ | ---------------- | -------------------------------------------------------------------- |
57
+ | `className?` | `string` | CSS classes applied to the primitive's content element. |
58
+ | `lang?` | `string` | |
59
+ | `dir?` | `"ltr" \| "rtl"` | |
60
+ | `title?` | `string` | Document title; several clients use it as the fallback preview line. |
61
+ | `backgroundColor?` | `string` | |
62
+ | `style?` | `EmailStyle` | Applied to the content cell, where Yahoo and AOL keep body styling. |
63
+ | `children?` | `EmailChild` | |
64
+
65
+ ### Section
66
+
67
+ Import from `@samva/markup/email/components`.
68
+
69
+ | Prop | Type | Notes |
70
+ | ------------- | ------------------------------- | -------------------------------------------------------------------- |
71
+ | `className?` | `string` | CSS classes applied to the primitive's content element. |
72
+ | `align?` | `"left" \| "center" \| "right"` | |
73
+ | `width?` | `number \| string` | |
74
+ | `bgcolor?` | `string` | |
75
+ | `style?` | `EmailStyle` | Applied to the content cell so padding survives Outlook and Klaviyo. |
76
+ | `tableStyle?` | `EmailStyle` | |
77
+ | `children?` | `EmailChild` | |
78
+
79
+ ### Columns
80
+
81
+ Import from `@samva/markup/email/components`.
82
+
83
+ | Prop | Type | Notes |
84
+ | ------------ | ----------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
85
+ | `className?` | `string` | CSS classes applied to the primitive's content element. |
86
+ | `align?` | `"left" \| "center" \| "right"` | |
87
+ | `width?` | `number \| string` | |
88
+ | `style?` | `EmailStyle` | |
89
+ | `each?` | `readonly Item[]` | Repeat the cells for each item: `children` is then a function from an item (and its index in the row) to a `Column`. Without `per` all items share one row. |
90
+ | `per?` | `number` | With `each`, the cells in a row; each chunk of items is its own `Columns` table. |
91
+ | `children?` | `EmailChild \| ((item: Item, index: number) => EmailChild)` | `Column` elements, or with `each` a function that returns one. |
92
+
93
+ ### Column
94
+
95
+ Import from `@samva/markup/email/components`.
96
+
97
+ | Prop | Type | Notes |
98
+ | ------------ | ------------------------------- | ------------------------------------------------------- |
99
+ | `className?` | `string` | CSS classes applied to the primitive's content element. |
100
+ | `align?` | `"left" \| "center" \| "right"` | |
101
+ | `valign?` | `"top" \| "middle" \| "bottom"` | |
102
+ | `width?` | `number \| string` | |
103
+ | `style?` | `EmailStyle` | |
104
+ | `children?` | `EmailChild` | |
105
+
106
+ ### Button
107
+
108
+ Import from `@samva/markup/email/components`.
109
+
110
+ | Prop | Type | Notes |
111
+ | ------------------ | ------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
112
+ | `className?` | `string` | CSS classes applied to the primitive's content element. |
113
+ | `href` | `string` | |
114
+ | `width?` | `number` | Pixel width of the box. Classic Outlook draws the VML shape at a fixed width, so without this it is estimated from the label and `paddingX`, and the anchor sizes to its label. |
115
+ | `height?` | `number` | Pixel height; classic Outlook's VML fallback needs it. |
116
+ | `paddingX?` | `number` | Horizontal padding on each side of the label when no `width` fixes the box. |
117
+ | `backgroundColor?` | `string` | |
118
+ | `color?` | `string` | |
119
+ | `borderRadius?` | `number` | |
120
+ | `borderColor?` | `string` | |
121
+ | `borderWidth?` | `number` | |
122
+ | `fontSize?` | `number` | |
123
+ | `fontFamily?` | `string` | |
124
+ | `align?` | `"left" \| "center" \| "right"` | |
125
+ | `style?` | `EmailStyle` | |
126
+ | `children?` | `EmailChild` | The label. A string label is required for the classic Outlook fallback. |
127
+
128
+ ### Spacer
129
+
130
+ Import from `@samva/markup/email/components`.
131
+
132
+ | Prop | Type | Notes |
133
+ | -------- | -------- | ----- |
134
+ | `height` | `number` | |
135
+
136
+ ### Divider
137
+
138
+ Import from `@samva/markup/email/components`.
139
+
140
+ | Prop | Type | Notes |
141
+ | ------------ | ------------ | ------------------------------------------------------- |
142
+ | `className?` | `string` | CSS classes applied to the primitive's content element. |
143
+ | `color?` | `string` | |
144
+ | `thickness?` | `number` | |
145
+ | `style?` | `EmailStyle` | |
146
+
147
+ ### Image
148
+
149
+ Import from `@samva/markup/email/components`.
150
+
151
+ | Prop | Type | Notes |
152
+ | ------------ | ------------------------------- | -------------------------------------------------------------------- |
153
+ | `className?` | `string` | CSS classes applied to the primitive's content element. |
154
+ | `src` | `string` | |
155
+ | `alt` | `string` | Required. Use an empty string only for images that carry no meaning. |
156
+ | `width?` | `number \| string` | |
157
+ | `height?` | `number \| string` | |
158
+ | `align?` | `"left" \| "center" \| "right"` | |
159
+ | `style?` | `EmailStyle` | |
160
+
161
+ ### Link
162
+
163
+ Import from `@samva/markup/email/components`.
164
+
165
+ | Prop | Type | Notes |
166
+ | ------------ | ------------ | ------------------------------------------------------- |
167
+ | `className?` | `string` | CSS classes applied to the primitive's content element. |
168
+ | `href` | `string` | |
169
+ | `target?` | `string` | |
170
+ | `rel?` | `string` | |
171
+ | `style?` | `EmailStyle` | |
172
+ | `children?` | `EmailChild` | |
173
+
174
+ ### BrandLogo
175
+
176
+ Import from `samva:brand`.
177
+
178
+ | Prop | Type | Notes |
179
+ | ------------ | ------------------------------- | ------------------------------------------------------- |
180
+ | `width?` | `number` | Rendered width in pixels; the height follows the image. |
181
+ | `alt?` | `string` | Defaults to the brand footer's company name. |
182
+ | `align?` | `"left" \| "center" \| "right"` | |
183
+ | `className?` | `string` | |
184
+
185
+ ### BrandFooter
186
+
187
+ Import from `samva:brand`.
188
+
189
+ | Prop | Type | Notes |
190
+ | ------------------- | -------- | ----------------------------- |
191
+ | `unsubscribeLabel?` | `string` | Text of the unsubscribe link. |
192
+ | `className?` | `string` | |
193
+
194
+ ## HTML elements
195
+
196
+ - `html`: flow content; attributes: `xmlns`, `xmlns:o`, `xmlns:v`, `xmlns:w`.
197
+ - `head`: flow content; attributes: global attributes only.
198
+ - `title`: text content; attributes: global attributes only.
199
+ - `style`: raw content; attributes: `type`.
200
+ - `meta`: void content; attributes: `name`, `content`, `charset`, `http-equiv`.
201
+ - `body`: flow content; attributes: `bgcolor`.
202
+ - `div`: flow content; attributes: `align`.
203
+ - `section`: flow content; attributes: `align`.
204
+ - `article`: flow content; attributes: `align`.
205
+ - `header`: flow content; attributes: `align`.
206
+ - `footer`: flow content; attributes: `align`.
207
+ - `main`: flow content; attributes: `align`.
208
+ - `center`: flow content; attributes: global attributes only.
209
+ - `p`: flow content; attributes: `align`.
210
+ - `blockquote`: flow content; attributes: `align`.
211
+ - `pre`: flow content; attributes: global attributes only.
212
+ - `h1`: flow content; attributes: `align`.
213
+ - `h2`: flow content; attributes: `align`.
214
+ - `h3`: flow content; attributes: `align`.
215
+ - `h4`: flow content; attributes: `align`.
216
+ - `h5`: flow content; attributes: `align`.
217
+ - `h6`: flow content; attributes: `align`.
218
+ - `span`: flow content; attributes: global attributes only.
219
+ - `strong`: flow content; attributes: global attributes only.
220
+ - `b`: flow content; attributes: global attributes only.
221
+ - `em`: flow content; attributes: global attributes only.
222
+ - `i`: flow content; attributes: global attributes only.
223
+ - `u`: flow content; attributes: global attributes only.
224
+ - `s`: flow content; attributes: global attributes only.
225
+ - `small`: flow content; attributes: global attributes only.
226
+ - `code`: flow content; attributes: global attributes only.
227
+ - `a`: flow content; attributes: `href`, `target`, `rel`, `name`.
228
+ - `img`: void content; attributes: `src`, `alt`, `width`, `height`, `border`, `align`.
229
+ - `table`: flow content; attributes: `width`, `height`, `border`, `cellpadding`, `cellspacing`, `align`, `bgcolor`.
230
+ - `caption`: flow content; attributes: `align`.
231
+ - `colgroup`: flow content; attributes: `span`, `width`.
232
+ - `col`: void content; attributes: `span`, `width`.
233
+ - `thead`: flow content; attributes: `align`, `valign`, `bgcolor`.
234
+ - `tbody`: flow content; attributes: `align`, `valign`, `bgcolor`.
235
+ - `tfoot`: flow content; attributes: `align`, `valign`, `bgcolor`.
236
+ - `tr`: flow content; attributes: `align`, `valign`, `bgcolor`, `height`.
237
+ - `td`: flow content; attributes: `align`, `valign`, `width`, `height`, `bgcolor`, `colspan`, `rowspan`.
238
+ - `th`: flow content; attributes: `align`, `valign`, `width`, `height`, `bgcolor`, `colspan`, `rowspan`.
239
+ - `ul`: flow content; attributes: global attributes only.
240
+ - `ol`: flow content; attributes: `start`, `type`.
241
+ - `li`: flow content; attributes: global attributes only.
242
+ - `br`: void content; attributes: global attributes only.
243
+ - `hr`: void content; attributes: `width`, `size`, `align`.
244
+
245
+ Global attributes: `id`, `title`, `lang`, `dir`, `role`.
246
+
247
+ ## Diagnostics
248
+
249
+ | Code | Meaning | Fix |
250
+ | ---------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------- |
251
+ | `brand-import-conflict` | The project imports two different brands. | Import one brand specifier everywhere. |
252
+ | `brand-unavailable` | The build has no brand to resolve a samva:brand import. | Create or select the brand the import names. |
253
+ | `button-dynamic-label` | A Button label is read at render time, so classic Outlook cannot size it. | Give the button a width: <Button width={200}>. |
254
+ | `button-outlook-fallback` | Classic Outlook needs a height and a plain string label to draw the button. | Give <Button> a height and a string label. |
255
+ | `caniemail/unknown-coverage` | A feature has no client-support data. | Verify it in the target clients. |
256
+ | `css-conditional-variable` | A custom property is redefined inside a conditional at-rule. | Keep the override on a class rule. |
257
+ | `css-import-unresolved` | A stylesheet @import cannot be resolved. | Import the stylesheet from the template module, or use the theme.css layers. |
258
+ | `css-parse-error` | A stylesheet does not parse. | Fix the CSS at the reported location. |
259
+ | `css-unsupported-at-rule` | An at-rule is not applied to email output. | Remove it or move the declarations into a class rule. |
260
+ | `dangerous-html` | dangerouslySetInnerHTML; there is no raw-HTML escape hatch. | Write the markup as JSX. |
261
+ | `duplicate-attribute` | An attribute is written twice. | Keep one. |
262
+ | `dynamic-class` | A class name is built at run time, and Tailwind cannot see it. | Write classes literally, or choose between literal lists: input.vip ? "bg-amber-100" : "bg-white". |
263
+ | `dynamic-definition` | A definition field is spread or computed instead of written out. | Write each field as name: value. |
264
+ | `dynamic-expression` | An expression outside the static profile: a call other than fmt.* and .map, a computed value, or a spread. | Compute the value where the message is sent and bind it from the payload. |
265
+ | `dynamic-numeric-prop` | A prop that sizes layout at compile time is not a number literal. | Write the number literally, for example height={44}. |
266
+ | `email-font-fallback` | A font stack names a project font without a generic fallback. | End the stack with sans-serif, serif or monospace. |
267
+ | `email-font-family` | @font-face declares no font-family. | Add font-family. |
268
+ | `email-font-format` | @font-face uses a format other than WOFF2. | Convert the file to .woff2. |
269
+ | `email-font-missing` | @font-face names a file the project does not hold. | Add the file; paths resolve from the stylesheet's directory. |
270
+ | `email-font-src` | @font-face declares no usable url() src. | Add a url() pointing at a .woff2 file. |
271
+ | `event-handler` | An event handler; email clients strip scripting. | Remove the handler; use a link for interaction. |
272
+ | `fixture-invalid` | A fixture does not match the schema. | Change the fixture, or the schema, so every fixture is a payload a send could carry. |
273
+ | `fixtures-not-static` | A fixture is computed instead of written as data. | Write each fixture as a literal object; an imported asset is allowed. |
274
+ | `formatter-arguments` | A formatter got the wrong number of arguments. | Match the formatter's signature in the contract. |
275
+ | `hook-call` | A hook was called; templates have no state, effects or context. | Read the input through the function's parameter and send anything else in the payload. |
276
+ | `invalid-asset-base` | The asset base is not an https URL or a path. | Use an https URL, an absolute path, or a relative path. |
277
+ | `invalid-attribute-value` | An attribute value is not a string or number, or contains control characters. | Pass plain text. |
278
+ | `invalid-binding-type` | A binding has the wrong type for where it is used. | Bind a field of the type the position needs, or send it in that type. |
279
+ | `invalid-button-number` | A Button size prop is not a finite number. | Pass a finite number. |
280
+ | `invalid-channel` | A channel field is not shaped as the channel requires. | Write email: { subject, preheader?, body } with each a function of the input. |
281
+ | `invalid-columns-each` | <Columns each> is not a list from the input. | Write each={input.items} with a callback returning <Column>. |
282
+ | `invalid-columns-per` | <Columns per> is not a positive integer literal. | Write per={2}. |
283
+ | `invalid-content` | An element holds content its content model does not allow. | Move the child to a parent that accepts it. |
284
+ | `invalid-fixture-name` | A fixture key is not a single path segment. | Use letters, digits, '.', '_' and '-', starting with a letter or digit. |
285
+ | `invalid-locale` | The template's default locale is not a string literal. | Write locale: "en-US". |
286
+ | `invalid-preheader` | The preheader is not a string. | Return a string. |
287
+ | `invalid-schema` | The schema uses JSON Schema keywords the compiler cannot validate against. | Use only the JSON Schema keywords the package README lists. |
288
+ | `invalid-style` | A style prop is not a static property object. | Write style={{ backgroundColor: "#fff" }} with literal values, or use classes. |
289
+ | `invalid-style-value` | A style value is not a string or number. | Pass a string or number. |
290
+ | `invalid-subject` | The subject is not one line of text. | Return a single-line string. |
291
+ | `invalid-template-id` | The template id is not a lowercase kebab-case string literal. | Write id: "order-shipped". |
292
+ | `invalid-text` | The plain-text body is not a string. | Return a string. |
293
+ | `legacy-definition` | The entry default-exports something other than defineTemplate. | Import { defineTemplate } from "@samva/markup" and default-export defineTemplate({ ... }). |
294
+ | `missing-attribute` | An element is missing a required attribute. | Add the attribute, for example alt on img. |
295
+ | `missing-body` | The email channel has no body. | Add body: (input) => (<Email>...</Email>). |
296
+ | `missing-fixtures` | The template declares no fixtures. | Add fixtures: { default: { ... } } with at least one valid payload. |
297
+ | `missing-head` | Styles that cannot be inlined need a <head> to live in. | Wrap the message in <Email>, or write those declarations inline. |
298
+ | `missing-schema` | The template declares no input schema. | Add schema: jsonSchema<Input>({ ... }). |
299
+ | `missing-subject` | The email channel has no subject. | Add subject: (input) => .... |
300
+ | `multiple-roots` | The body renders nothing or more than one root. | Wrap the body in a single element such as <Email>. |
301
+ | `nesting-limit` | The template nests deeper than the compiler reads. | Flatten the structure. |
302
+ | `no-channel` | The template declares no channel body. | Add an email body. |
303
+ | `no-template` | The entry does not default-export a template. | Default-export defineTemplate({ ... }) imported from @samva/markup. |
304
+ | `non-project-import` | The file imports something other than @samva/markup or a project file. | Remove the import, or copy the code you need into a project file. |
305
+ | `not-a-function` | A channel field is not a function of the input. | Write (input) => ... in place or declare the function in the project. |
306
+ | `preheader-without-shell` | A preheader is set but the body has no <Email> shell to hold it. | Wrap the body in <Email>. |
307
+ | `recursive-partial` | A partial renders itself; partials are inlined at compile time. | Flatten the recursion, or repeat the structure with .map. |
308
+ | `reserved-attribute` | An attribute is written only by a brand component. | Render BrandFooter from samva:brand instead of marking an element as the footer. |
309
+ | `reserved-character` | Text contains a private-use character the compiler reserves. | Remove the characters U+E000 to U+E003. |
310
+ | `reserved-url` | A URL is the unsubscribe placeholder only BrandFooter can write. | Render <BrandFooter /> instead. |
311
+ | `schema-not-static` | The schema cannot be read without running code. | Write the schema as a literal jsonSchema<Input>({ type: 'object', ... }). |
312
+ | `statement-in-body` | A body contains a statement (const, if, a loop); a body is one expression. | Use cond && <X />, cond ? <A /> : <B /> and .map, or send the computed value in the payload. |
313
+ | `syntax-error` | A project file does not parse as TSX. | Fix the syntax at the reported location. |
314
+ | `tailwind-dynamic-class` | A class list is assembled at run time. | Write the classes literally. |
315
+ | `too-many-class-variants` | A class list chooses between more literal lists than the compiler resolves. | Split the choice into fewer conditions, or move part of it to a partial. |
316
+ | `unguarded-optional` | An optional field is read outside a guard, so a send without it would render a blank. | Guard it with {input.field && ...}, or make the field required. |
317
+ | `unknown-component` | A component the profile cannot read. | Import components from @samva/markup/email/components, samva:brand, or the project. |
318
+ | `unknown-field` | A binding names a field the schema does not declare. | Add the field to the schema, or bind a field it declares (the message suggests the nearest). |
319
+ | `unknown-formatter` | fmt.<name> is not a formatter. | Use fmt.money, number, date, time, plural or list. |
320
+ | `unmatched-class` | A class produced no styles. | Use a class the theme or Tailwind defines, or write the style inline. |
321
+ | `unresolved-import` | An import names no file in the project. | Check the path and the file extension. |
322
+ | `unsafe-raw-text` | Raw text content contains markup that could end its element. | Remove the offending sequence. |
323
+ | `unsafe-style-value` | A style value contains CSS that could break out of its declaration. | Remove the offending characters. |
324
+ | `unsafe-url` | A URL uses a scheme email cannot send safely. | Use an https URL, a mailto: or tel: link, or a bound URL. |
325
+ | `unsupported-attribute` | An attribute the element does not support. | Use a supported attribute, or data-* and aria-*. |
326
+ | `unsupported-element` | An element outside the supported email vocabulary. | Use an element from the contract's element table. |
327
+ | `unsupported-pattern` | A parameter pattern or default value the profile cannot bind. | Use plain names or destructuring without defaults; declare the field required or guard it. |
328
+ | `unsupported-style-property` | A style property name is not a CSS property. | Write camelCase (backgroundColor) or a custom property (--brand). |
329
+ | `void-element-children` | A void element has children. | Remove the children. |
330
+ | `caniemail/<feature>` | 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>. | Use the alternative the message names, such as an email component instead of display: flex. |
331
+
332
+ ## Upgrades
333
+
334
+ ### `legacy-definition`
335
+
336
+ Read the entry and its imports without executing them. For a default-exported defineEmail definition, import defineTemplate from "@samva/markup" and replace the definition call.
337
+
338
+ Preserve the entry path, template id, schema, named fixtures, content, design, bindings, conditions, project partials, assets, theme and brand imports. Replace render(input) returning { subject, preheader?, body } with email: { subject: (input) => ..., preheader: (input) => ..., body: (input) => ... }, retaining its parameter bindings and each returned expression; omit preheader when absent.
339
+
340
+ Inline module constants only when they are literal strings, numbers or booleans and their bindings are unambiguous; never substitute a fixture value for an input binding. Keep each channel function a single static-profile expression, and keep subject and preheader off <Email>.
341
+
342
+ Helper calls, `Math.*`, general arithmetic, render statements, spreads, computed properties and runtime clock or seed have no direct conversion. Rewrite with static-profile bindings, conditions, .map, .filter, project partials or `fmt.*` where equivalent; arithmetic is allowed only in formatter arguments and conditions. Otherwise compute the value in the sender, declare a payload field in the schema and every fixture, and explain the required sender change. Never guess time, randomness or computed data.
343
+
344
+ Explicit text has no email-channel field: plain text is derived from the body. If deriving it changes intended content, or another construct cannot be preserved, explain the tradeoff and ask rather than silently discard it. Do not drop fixtures, weaken validation or hide diagnostics.
345
+
346
+ Convert every affected entry in the project at its existing path, including emails/ entries. Compile each entry, render every declared fixture and inspect the affected output. Resolve errors before requesting one saved version for the whole project, approved by the user; do not publish.
347
+
348
+ ## Quality bar
349
+
350
+ - Run the check until it reports no errors, then render every fixture.
351
+ - Cover every branch with a fixture: default, missing optional fields, many items.
352
+ - Look at the render at desktop and mobile widths before finishing.
353
+ - Compute anything the profile cannot express where the message is sent and add it to the schema.