@samva/markup 0.8.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.
Files changed (172) hide show
  1. package/AGENTS.md +107 -46
  2. package/CHANGELOG.md +345 -0
  3. package/README.md +188 -52
  4. package/dist/{brand-DcoVkh_S.d.ts → assets-BIsyMQ92.d.ts} +41 -11
  5. package/dist/{email/brand.js → brand-C0MKTwmX.js} +64 -4
  6. package/dist/{theme-css.d.ts → brand.d.ts} +12 -3
  7. package/dist/brand.js +4 -0
  8. package/dist/channel-specs-C2feJwuP.d.ts +13 -0
  9. package/dist/compiler.d.ts +88 -115
  10. package/dist/compiler.js +750 -171
  11. package/dist/components-BZCqegS8.js +1864 -0
  12. package/dist/diagnostic-model-DJtqbETd.js +38 -0
  13. package/dist/{diagnostics-OcQKQYSY.d.ts → diagnostic-model-DxthUZBT.d.ts} +3 -21
  14. package/dist/{diagnostics-BMYtBCQk.d.ts → diagnostics-B-Gym34R.d.ts} +8 -4
  15. package/dist/{email/diagnostics.js → diagnostics-CnKFefKz.js} +4 -3
  16. package/dist/diagnostics.d.ts +410 -2
  17. package/dist/diagnostics.js +402 -52
  18. package/dist/edit.d.ts +234 -0
  19. package/dist/edit.js +947 -0
  20. package/dist/email/jsx-dev-runtime.d.ts +2 -2
  21. package/dist/email/jsx-dev-runtime.js +1 -2
  22. package/dist/email/jsx-runtime.d.ts +1 -1
  23. package/dist/email/jsx-runtime.js +1 -85
  24. package/dist/{email/components.d.ts → email.d.ts} +22 -11
  25. package/dist/email.js +2 -0
  26. package/dist/fmt.d.ts +32 -0
  27. package/dist/fmt.js +174 -0
  28. package/dist/index.d.ts +2 -0
  29. package/dist/index.js +2 -0
  30. package/dist/{render-vAv_4r9v.js → ir-CLhlklKV.js} +96 -279
  31. package/dist/jsx-runtime-CBlexoeR.js +98 -0
  32. package/dist/{elements-BzjjnoCS.d.ts → jsx-runtime-ylIOnaSf.d.ts} +76 -76
  33. package/dist/profile-pWGtWZXF.js +3803 -0
  34. package/dist/render-BPonDpCl.d.ts +539 -0
  35. package/dist/render-BQmfh94k.js +257 -0
  36. package/dist/render.d.ts +35 -0
  37. package/dist/render.js +49 -0
  38. package/dist/sms.d.ts +16 -0
  39. package/dist/sms.js +12 -0
  40. package/dist/source-locations-C8wCsiAy.d.ts +23 -0
  41. package/dist/template-DMPwxMSq.d.ts +65 -0
  42. package/dist/template-zLUjcwfF.js +42 -0
  43. package/dist/{theme-css-hFqcPSar.js → theme-css-JtRCm1fb.js} +2 -2
  44. package/dist/whatsapp.d.ts +57 -0
  45. package/dist/whatsapp.js +22 -0
  46. package/generated/contract.json +1788 -0
  47. package/generated/reference.md +360 -0
  48. package/package.json +46 -239
  49. package/samva-brand.d.ts +4 -4
  50. package/skills/sml/SKILL.md +123 -0
  51. package/dist/ast-BrDtApwS.d.ts +0 -107
  52. package/dist/ast.d.ts +0 -2
  53. package/dist/ast.js +0 -124
  54. package/dist/candidate.d.ts +0 -29
  55. package/dist/candidate.js +0 -88
  56. package/dist/catalog-CKuOooB8.d.ts +0 -354
  57. package/dist/checks-D73Xizbw.js +0 -59366
  58. package/dist/checks.d.ts +0 -33
  59. package/dist/checks.js +0 -2
  60. package/dist/classes.d.ts +0 -26
  61. package/dist/classes.js +0 -184
  62. package/dist/compile-sms.d.ts +0 -28
  63. package/dist/compile-sms.js +0 -44
  64. package/dist/compile-whatsapp.d.ts +0 -56
  65. package/dist/compile-whatsapp.js +0 -186
  66. package/dist/compile.d.ts +0 -18
  67. package/dist/compile.js +0 -29
  68. package/dist/components.d.ts +0 -289
  69. package/dist/components.js +0 -106
  70. package/dist/conditionals.d.ts +0 -10
  71. package/dist/conditionals.js +0 -74
  72. package/dist/corpus-CPPfgAHN.d.ts +0 -106
  73. package/dist/css-CS2jLID6.d.ts +0 -109
  74. package/dist/email/assets.d.ts +0 -40
  75. package/dist/email/assets.js +0 -63
  76. package/dist/email/brand-footer.d.ts +0 -34
  77. package/dist/email/brand-footer.js +0 -62
  78. package/dist/email/brand.d.ts +0 -2
  79. package/dist/email/components.js +0 -240
  80. package/dist/email/diagnostics.d.ts +0 -2
  81. package/dist/email/elements.d.ts +0 -2
  82. package/dist/email/elements.js +0 -299
  83. package/dist/email/html.d.ts +0 -2
  84. package/dist/email/html.js +0 -278
  85. package/dist/email/render.d.ts +0 -50
  86. package/dist/email/render.js +0 -3
  87. package/dist/email/selection.d.ts +0 -2
  88. package/dist/email/selection.js +0 -91
  89. package/dist/email/source-edit.d.ts +0 -67
  90. package/dist/email/source-edit.js +0 -185
  91. package/dist/email/stylesheets.d.ts +0 -15
  92. package/dist/email/stylesheets.js +0 -48
  93. package/dist/email/text.d.ts +0 -7
  94. package/dist/email/text.js +0 -100
  95. package/dist/emit.d.ts +0 -51
  96. package/dist/emit.js +0 -151
  97. package/dist/html-Bl9BAdqc.d.ts +0 -42
  98. package/dist/interpolate.d.ts +0 -24
  99. package/dist/interpolate.js +0 -43
  100. package/dist/jsx-dev-runtime.d.ts +0 -11
  101. package/dist/jsx-dev-runtime.js +0 -15
  102. package/dist/jsx-runtime-I-1nCtl2.d.ts +0 -57
  103. package/dist/jsx-runtime.d.ts +0 -2
  104. package/dist/jsx-runtime.js +0 -121
  105. package/dist/lexer.d.ts +0 -60
  106. package/dist/lexer.js +0 -281
  107. package/dist/model.d.ts +0 -24
  108. package/dist/model.js +0 -77
  109. package/dist/ops-BvwqHl7V.js +0 -630
  110. package/dist/ops.d.ts +0 -114
  111. package/dist/ops.js +0 -2
  112. package/dist/parser-t29cHLVL.d.ts +0 -396
  113. package/dist/parser.d.ts +0 -2
  114. package/dist/parser.js +0 -859
  115. package/dist/predicate-BI6uRRM-.js +0 -549
  116. package/dist/predicate-M-05Nd7R.d.ts +0 -56
  117. package/dist/predicate.d.ts +0 -2
  118. package/dist/predicate.js +0 -2
  119. package/dist/printer.d.ts +0 -6
  120. package/dist/printer.js +0 -122
  121. package/dist/registry-Dcp6QEK_.d.ts +0 -73
  122. package/dist/registry.d.ts +0 -2
  123. package/dist/registry.js +0 -646
  124. package/dist/render-template.d.ts +0 -45
  125. package/dist/render-template.js +0 -76
  126. package/dist/selection-CCArx9lU.d.ts +0 -91
  127. package/dist/showcase-egkusQBf.d.ts +0 -415
  128. package/dist/sms-segments-y4FpPilJ.d.ts +0 -13
  129. package/dist/sms-segments.d.ts +0 -2
  130. package/dist/sms-segments.js +0 -46
  131. package/dist/source-locations-DrCM82Ym.d.ts +0 -67
  132. package/dist/source-locations.d.ts +0 -2
  133. package/dist/source-locations.js +0 -102
  134. package/dist/starters/category-mapping.d.ts +0 -13
  135. package/dist/starters/category-mapping.js +0 -49
  136. package/dist/starters/corpus.d.ts +0 -2
  137. package/dist/starters/corpus.js +0 -194
  138. package/dist/starters/library.d.ts +0 -18
  139. package/dist/starters/library.js +0 -692
  140. package/dist/starters/public-gallery.d.ts +0 -266
  141. package/dist/starters/public-gallery.js +0 -916
  142. package/dist/starters/public-handoff.d.ts +0 -164
  143. package/dist/starters/public-handoff.js +0 -361
  144. package/dist/starters/public-preview-artifacts.d.ts +0 -43
  145. package/dist/starters/public-preview-artifacts.js +0 -104
  146. package/dist/starters/public-preview.d.ts +0 -61
  147. package/dist/starters/public-preview.js +0 -83
  148. package/dist/starters/showcase.d.ts +0 -2
  149. package/dist/starters/showcase.js +0 -335
  150. package/dist/starters/sources.d.ts +0 -45
  151. package/dist/starters/sources.js +0 -7762
  152. package/dist/starters/theme.d.ts +0 -45
  153. package/dist/starters/theme.js +0 -77
  154. package/dist/starters.d.ts +0 -2
  155. package/dist/starters.js +0 -874
  156. package/dist/tailwind-BYq7Lo6u.js +0 -727
  157. package/dist/template-DWftqh4x.d.ts +0 -60
  158. package/dist/template.d.ts +0 -2
  159. package/dist/template.js +0 -37
  160. package/dist/theme-css.js +0 -2
  161. package/dist/tsx-source-instrumentation.d.ts +0 -30
  162. package/dist/tsx-source-instrumentation.js +0 -115
  163. package/dist/tsx-tracer.d.ts +0 -112
  164. package/dist/tsx-tracer.js +0 -985
  165. package/dist/variables-J_L3qxRa.d.ts +0 -77
  166. package/dist/variables.d.ts +0 -2
  167. package/dist/variables.js +0 -141
  168. package/dist/version-BITr58kk.js +0 -96
  169. package/generated/sml-agent-contract.json +0 -709
  170. package/generated/sml-email-agent-contract.json +0 -615
  171. package/generated/sml-email-language-reference.md +0 -94
  172. package/generated/sml-language-reference.md +0 -195
package/dist/registry.js DELETED
@@ -1,646 +0,0 @@
1
- //#region src/registry.ts
2
- const SPACING_PATTERN = /^\d+(\.(25|5|75))?$/;
3
- const ARBITRARY_LENGTH_PATTERN = /^\d+(\.\d+)?(px|%)$/;
4
- const ARBITRARY_PX_PATTERN = /^\d+(\.\d+)?px$/;
5
- const ARBITRARY_HEX_PATTERN = /^#[0-9a-fA-F]{3}([0-9a-fA-F]{3})?$/;
6
- const px = (value) => `${roundPx(value)}px`;
7
- const roundPx = (value) => Math.round(value * 100) / 100;
8
- const spacingValue = (value, theme) => {
9
- if (value === "px") return "1px";
10
- if (!SPACING_PATTERN.test(value)) return null;
11
- return px(Number.parseFloat(value) * theme.spacingPx);
12
- };
13
- const arbitraryLength = (value) => ARBITRARY_LENGTH_PATTERN.test(value) ? [value] : null;
14
- const colorValue = (value, theme) => value === "transparent" ? "transparent" : theme.colors[value] ?? null;
15
- const declarations = (properties, value) => properties.map((property) => ({
16
- property,
17
- value
18
- }));
19
- const textSizeDeclarations = (sizePx) => [{
20
- property: "font-size",
21
- value: px(sizePx)
22
- }, {
23
- property: "line-height",
24
- value: px(sizePx * 1.5)
25
- }];
26
- const arbitraryTextSize = (value) => {
27
- if (!ARBITRARY_PX_PATTERN.test(value)) return null;
28
- const size = Number.parseFloat(value);
29
- return size >= 8 && size <= 72 ? textSizeDeclarations(size) : null;
30
- };
31
- const radiusValue = (value, theme) => {
32
- if (value === "none") return "0px";
33
- if (value === "full") return "9999px";
34
- const radius = theme.radiusPx[value];
35
- return radius === void 0 ? null : px(radius);
36
- };
37
- const radiusFamily = (root, properties, description) => {
38
- const family = {
39
- root,
40
- named: (value, theme) => {
41
- const resolved = radiusValue(value, theme);
42
- return resolved === null ? null : declarations(properties, resolved);
43
- },
44
- arbitrary: (value) => ARBITRARY_PX_PATTERN.test(value) ? declarations(properties, value) : null,
45
- description,
46
- caniemailSlugs: ["css-border-radius"]
47
- };
48
- return root === "rounded" ? {
49
- ...family,
50
- bare: properties.map((property) => ({
51
- property,
52
- value: "4px"
53
- }))
54
- } : family;
55
- };
56
- const spacingFamily = (root, properties, options) => ({
57
- root,
58
- named: (value, theme) => {
59
- if (options.auto === true && value === "auto") return declarations(properties, "auto");
60
- const resolved = spacingValue(value, theme);
61
- return resolved === null ? null : declarations(properties, resolved);
62
- },
63
- arbitrary: (value) => ARBITRARY_PX_PATTERN.test(value) ? declarations(properties, value) : null,
64
- description: options.description,
65
- caniemailSlugs: options.caniemailSlugs,
66
- warn: options.warn
67
- });
68
- const MARGIN_WARNING = "margin is stripped by some clients (Outlook.com dark mode, some webmail); prefer padding or <Spacer>";
69
- const GRADIENT_DIRECTION_PROPERTY = "-sml-gradient-direction";
70
- const GRADIENT_FROM_PROPERTY = "-sml-gradient-from";
71
- const GRADIENT_TO_PROPERTY = "-sml-gradient-to";
72
- const GRADIENT_DIRECTIONS = {
73
- "to-t": "to top",
74
- "to-b": "to bottom",
75
- "to-l": "to left",
76
- "to-r": "to right"
77
- };
78
- const utilityRegistry = [
79
- spacingFamily("p", ["padding"], {
80
- description: "Padding on all sides (p-4 = 16px). Compiles onto table cells for Outlook.",
81
- caniemailSlugs: ["css-padding"]
82
- }),
83
- spacingFamily("px", ["padding-left", "padding-right"], {
84
- description: "Horizontal padding.",
85
- caniemailSlugs: ["css-padding"]
86
- }),
87
- spacingFamily("py", ["padding-top", "padding-bottom"], {
88
- description: "Vertical padding.",
89
- caniemailSlugs: ["css-padding"]
90
- }),
91
- spacingFamily("pt", ["padding-top"], {
92
- description: "Top padding.",
93
- caniemailSlugs: ["css-padding"]
94
- }),
95
- spacingFamily("pr", ["padding-right"], {
96
- description: "Right padding.",
97
- caniemailSlugs: ["css-padding"]
98
- }),
99
- spacingFamily("pb", ["padding-bottom"], {
100
- description: "Bottom padding.",
101
- caniemailSlugs: ["css-padding"]
102
- }),
103
- spacingFamily("pl", ["padding-left"], {
104
- description: "Left padding.",
105
- caniemailSlugs: ["css-padding"]
106
- }),
107
- spacingFamily("m", ["margin"], {
108
- description: "Margin on all sides. Warn tier — some clients strip margins.",
109
- caniemailSlugs: ["css-margin"],
110
- warn: MARGIN_WARNING
111
- }),
112
- spacingFamily("mx", ["margin-left", "margin-right"], {
113
- description: "Horizontal margin; mx-auto centers block elements.",
114
- caniemailSlugs: ["css-margin"],
115
- warn: MARGIN_WARNING,
116
- auto: true
117
- }),
118
- spacingFamily("my", ["margin-top", "margin-bottom"], {
119
- description: "Vertical margin.",
120
- caniemailSlugs: ["css-margin"],
121
- warn: MARGIN_WARNING
122
- }),
123
- spacingFamily("mt", ["margin-top"], {
124
- description: "Top margin.",
125
- caniemailSlugs: ["css-margin"],
126
- warn: MARGIN_WARNING
127
- }),
128
- spacingFamily("mr", ["margin-right"], {
129
- description: "Right margin.",
130
- caniemailSlugs: ["css-margin"],
131
- warn: MARGIN_WARNING,
132
- auto: true
133
- }),
134
- spacingFamily("mb", ["margin-bottom"], {
135
- description: "Bottom margin.",
136
- caniemailSlugs: ["css-margin"],
137
- warn: MARGIN_WARNING
138
- }),
139
- spacingFamily("ml", ["margin-left"], {
140
- description: "Left margin.",
141
- caniemailSlugs: ["css-margin"],
142
- warn: MARGIN_WARNING,
143
- auto: true
144
- }),
145
- {
146
- root: "w",
147
- named: (value, theme) => {
148
- if (value === "full") return [{
149
- property: "width",
150
- value: "100%"
151
- }];
152
- const resolved = spacingValue(value, theme);
153
- return resolved === null ? null : [{
154
- property: "width",
155
- value: resolved
156
- }];
157
- },
158
- arbitrary: (value) => arbitraryLength(value) === null ? null : [{
159
- property: "width",
160
- value
161
- }],
162
- description: "Width from the spacing scale (w-32 = 128px), w-full, or w-[600px]/w-[50%].",
163
- caniemailSlugs: ["css-width"]
164
- },
165
- {
166
- root: "max-w",
167
- named: (value, theme) => {
168
- if (value === "full") return [{
169
- property: "max-width",
170
- value: "100%"
171
- }];
172
- if (value === "none") return [{
173
- property: "max-width",
174
- value: "none"
175
- }];
176
- const container = theme.containerPx[value];
177
- return container === void 0 ? null : [{
178
- property: "max-width",
179
- value: px(container)
180
- }];
181
- },
182
- arbitrary: (value) => arbitraryLength(value) === null ? null : [{
183
- property: "max-width",
184
- value
185
- }],
186
- description: "Max width from the container scale (max-w-lg = 512px) or max-w-[600px].",
187
- caniemailSlugs: ["css-max-width"]
188
- },
189
- {
190
- root: "h",
191
- named: (value, theme) => {
192
- if (value === "full") return [{
193
- property: "height",
194
- value: "100%"
195
- }];
196
- const resolved = spacingValue(value, theme);
197
- return resolved === null ? null : [{
198
- property: "height",
199
- value: resolved
200
- }];
201
- },
202
- arbitrary: (value) => arbitraryLength(value) === null ? null : [{
203
- property: "height",
204
- value
205
- }],
206
- description: "Height from the spacing scale (h-12 = 48px) or h-[80px].",
207
- caniemailSlugs: ["css-height"]
208
- },
209
- {
210
- root: "text",
211
- named: (value, theme) => {
212
- const size = theme.text[value];
213
- if (size === void 0) return null;
214
- return [...declarations(["font-size"], px(size.sizePx)), ...declarations(["line-height"], px(size.lineHeightPx))];
215
- },
216
- arbitrary: arbitraryTextSize,
217
- description: "Font size with paired line-height (text-sm = 14px/20px) or bounded px value (text-[15px] = 15px/22.5px). Put an explicit leading-* after it to override line-height.",
218
- caniemailSlugs: ["css-font-size", "css-line-height"]
219
- },
220
- {
221
- root: "text",
222
- named: (value) => value === "left" || value === "center" || value === "right" || value === "justify" ? [{
223
- property: "text-align",
224
- value
225
- }] : null,
226
- description: "Text alignment: text-left, text-center, text-right, text-justify.",
227
- caniemailSlugs: ["css-text-align"]
228
- },
229
- {
230
- root: "text",
231
- colorFamily: true,
232
- named: (value, theme) => {
233
- const color = colorValue(value, theme);
234
- return color === null ? null : [{
235
- property: "color",
236
- value: color
237
- }];
238
- },
239
- arbitrary: (value) => ARBITRARY_HEX_PATTERN.test(value) ? [{
240
- property: "color",
241
- value: value.toLowerCase()
242
- }] : null,
243
- description: "Text color from the palette (text-gray-700) or text-[#374151].",
244
- caniemailSlugs: ["css-color"]
245
- },
246
- {
247
- root: "leading",
248
- named: (value, theme) => {
249
- if (value === "none") return [{
250
- property: "line-height",
251
- value: "1"
252
- }];
253
- const ratio = theme.leading[value];
254
- if (ratio !== void 0) return [{
255
- property: "line-height",
256
- value: String(ratio)
257
- }];
258
- const resolved = spacingValue(value, theme);
259
- return resolved === null ? null : [{
260
- property: "line-height",
261
- value: resolved
262
- }];
263
- },
264
- arbitrary: (value) => ARBITRARY_PX_PATTERN.test(value) ? [{
265
- property: "line-height",
266
- value
267
- }] : null,
268
- description: "Line height: named ratios (leading-relaxed) or spacing steps (leading-6 = 24px).",
269
- caniemailSlugs: ["css-line-height"]
270
- },
271
- {
272
- root: "font",
273
- named: (value, theme) => {
274
- const weight = theme.fontWeights[value];
275
- return weight === void 0 ? null : [{
276
- property: "font-weight",
277
- value: String(weight)
278
- }];
279
- },
280
- description: "Font weight: font-normal, font-medium, font-semibold, font-bold, ...",
281
- caniemailSlugs: ["css-font-weight"]
282
- },
283
- {
284
- root: "font",
285
- named: (value, theme) => {
286
- const family = theme.fontFamilies[value];
287
- return family === void 0 ? null : [{
288
- property: "font-family",
289
- value: family
290
- }];
291
- },
292
- description: "Font stack: font-sans, font-serif, font-mono.",
293
- caniemailSlugs: ["css-font"]
294
- },
295
- {
296
- root: "tracking",
297
- named: (value, theme) => {
298
- const em = theme.trackingEm[value];
299
- return em === void 0 ? null : [{
300
- property: "letter-spacing",
301
- value: `${em}em`
302
- }];
303
- },
304
- description: "Letter spacing: tracking-tighter … tracking-widest (em-based; inlines fine in Outlook). Pair tracking-wide/wider with uppercase for eyebrows.",
305
- caniemailSlugs: ["css-letter-spacing"]
306
- },
307
- {
308
- root: "uppercase",
309
- bare: [{
310
- property: "text-transform",
311
- value: "uppercase"
312
- }],
313
- description: "Uppercase text transform.",
314
- caniemailSlugs: ["css-text-transform"]
315
- },
316
- {
317
- root: "underline",
318
- bare: [{
319
- property: "text-decoration",
320
- value: "underline"
321
- }],
322
- description: "Underlined text.",
323
- caniemailSlugs: ["css-text-decoration"]
324
- },
325
- {
326
- root: "no-underline",
327
- bare: [{
328
- property: "text-decoration",
329
- value: "none"
330
- }],
331
- description: "Removes the underline (links render underlined by default in most clients).",
332
- caniemailSlugs: ["css-text-decoration"]
333
- },
334
- {
335
- root: "bg",
336
- colorFamily: true,
337
- named: (value, theme) => {
338
- const color = colorValue(value, theme);
339
- return color === null ? null : [{
340
- property: "background-color",
341
- value: color
342
- }];
343
- },
344
- arbitrary: (value) => ARBITRARY_HEX_PATTERN.test(value) ? [{
345
- property: "background-color",
346
- value: value.toLowerCase()
347
- }] : null,
348
- description: "Background color from the palette (bg-white, bg-blue-600) or bg-[#0088cc].",
349
- caniemailSlugs: ["css-background-color"]
350
- },
351
- {
352
- root: "bg-gradient",
353
- baseOnly: true,
354
- named: (value) => {
355
- const direction = GRADIENT_DIRECTIONS[value];
356
- return direction === void 0 ? null : [{
357
- property: GRADIENT_DIRECTION_PROPERTY,
358
- value: direction
359
- }];
360
- },
361
- description: "Linear gradient background for hero sections: bg-gradient-to-b/t/l/r with from-{color} and to-{color}. Modern base compiles a CSS linear-gradient (plus a solid from-color fallback); the outlook-safe base degrades to the solid from-color — Outlook for Windows never renders the gradient.",
362
- caniemailSlugs: ["css-linear-gradient", "css-background-image"]
363
- },
364
- {
365
- root: "from",
366
- baseOnly: true,
367
- named: (value, theme) => {
368
- const color = colorValue(value, theme);
369
- return color === null ? null : [{
370
- property: GRADIENT_FROM_PROPERTY,
371
- value: color
372
- }];
373
- },
374
- arbitrary: (value) => ARBITRARY_HEX_PATTERN.test(value) ? [{
375
- property: GRADIENT_FROM_PROPERTY,
376
- value: value.toLowerCase()
377
- }] : null,
378
- description: "Gradient start color (from-indigo-600). Doubles as the solid fallback color on clients without gradient support (Outlook for Windows).",
379
- caniemailSlugs: ["css-linear-gradient"]
380
- },
381
- {
382
- root: "to",
383
- baseOnly: true,
384
- named: (value, theme) => {
385
- const color = colorValue(value, theme);
386
- return color === null ? null : [{
387
- property: GRADIENT_TO_PROPERTY,
388
- value: color
389
- }];
390
- },
391
- arbitrary: (value) => ARBITRARY_HEX_PATTERN.test(value) ? [{
392
- property: GRADIENT_TO_PROPERTY,
393
- value: value.toLowerCase()
394
- }] : null,
395
- description: "Gradient end color (to-purple-600).",
396
- caniemailSlugs: ["css-linear-gradient"]
397
- },
398
- {
399
- root: "border",
400
- bare: [{
401
- property: "border-width",
402
- value: "1px"
403
- }, {
404
- property: "border-style",
405
- value: "solid"
406
- }],
407
- named: (value) => /^\d+$/.test(value) ? [{
408
- property: "border-width",
409
- value: `${value}px`
410
- }, {
411
- property: "border-style",
412
- value: "solid"
413
- }] : null,
414
- description: "Solid border width: border (1px), border-2, border-0.",
415
- caniemailSlugs: ["css-border"]
416
- },
417
- {
418
- root: "border",
419
- colorFamily: true,
420
- named: (value, theme) => {
421
- const color = colorValue(value, theme);
422
- return color === null ? null : [{
423
- property: "border-color",
424
- value: color
425
- }];
426
- },
427
- arbitrary: (value) => ARBITRARY_HEX_PATTERN.test(value) ? [{
428
- property: "border-color",
429
- value: value.toLowerCase()
430
- }] : null,
431
- description: "Border color from the palette (border-gray-200).",
432
- caniemailSlugs: ["css-border"]
433
- },
434
- radiusFamily("rounded", ["border-radius"], "Border radius (rounded-md = 6px). Ignored by Outlook for Windows — buttons degrade to square corners."),
435
- radiusFamily("rounded-t", ["border-top-left-radius", "border-top-right-radius"], "Top border radius for card/header blocks (rounded-t-lg). Degrades to square corners in Outlook for Windows."),
436
- radiusFamily("rounded-r", ["border-top-right-radius", "border-bottom-right-radius"], "Right-side border radius (rounded-r-lg). Degrades to square corners in Outlook for Windows."),
437
- radiusFamily("rounded-b", ["border-bottom-right-radius", "border-bottom-left-radius"], "Bottom border radius for card/footer blocks (rounded-b-lg). Degrades to square corners in Outlook for Windows."),
438
- radiusFamily("rounded-l", ["border-top-left-radius", "border-bottom-left-radius"], "Left-side border radius (rounded-l-lg). Degrades to square corners in Outlook for Windows."),
439
- {
440
- root: "block",
441
- bare: [{
442
- property: "display",
443
- value: "block"
444
- }],
445
- description: "display: block.",
446
- caniemailSlugs: ["css-display"]
447
- },
448
- {
449
- root: "inline-block",
450
- bare: [{
451
- property: "display",
452
- value: "inline-block"
453
- }],
454
- description: "display: inline-block.",
455
- caniemailSlugs: ["css-display"]
456
- },
457
- {
458
- root: "hidden",
459
- bare: [{
460
- property: "display",
461
- value: "none"
462
- }],
463
- description: "display: none. Pair with sm:block for mobile-only content.",
464
- caniemailSlugs: ["css-display"]
465
- }
466
- ];
467
- const forbiddenUtilities = [
468
- {
469
- match: "flex",
470
- message: "display:flex is unsupported in Outlook for Windows (Word engine) — use <Row>/<Column>"
471
- },
472
- {
473
- match: "inline-flex",
474
- message: "display:inline-flex is unsupported in Outlook for Windows — use <Row>/<Column>"
475
- },
476
- {
477
- match: "grid",
478
- message: "display:grid is unsupported in Outlook for Windows and Gmail — use <Row>/<Column>"
479
- },
480
- {
481
- match: "inline-grid",
482
- message: "display:inline-grid is unsupported in Outlook for Windows — use <Row>/<Column>"
483
- },
484
- {
485
- match: "gap-",
486
- message: "gap requires flex/grid, unsupported in Outlook for Windows — use padding on <Column>"
487
- },
488
- {
489
- match: "space-",
490
- message: "space-* margins require selectors Gmail strips — use padding or <Spacer>"
491
- },
492
- {
493
- match: "items-",
494
- message: "flexbox alignment is unsupported in Outlook for Windows — use <Row>/<Column>"
495
- },
496
- {
497
- match: "justify-",
498
- message: "flexbox alignment is unsupported in Outlook for Windows — use <Row>/<Column> and text-center"
499
- },
500
- {
501
- match: "self-",
502
- message: "flexbox alignment is unsupported in Outlook for Windows — use <Row>/<Column>"
503
- },
504
- {
505
- match: "content-",
506
- message: "flexbox alignment is unsupported in Outlook for Windows — use <Row>/<Column>"
507
- },
508
- {
509
- match: "order-",
510
- message: "flex order is unsupported in Outlook for Windows — reorder the source instead"
511
- },
512
- {
513
- match: "absolute",
514
- message: "CSS position is ignored by Gmail and Outlook — use nested <Section>s"
515
- },
516
- {
517
- match: "relative",
518
- message: "CSS position is ignored by Gmail and Outlook — use nested <Section>s"
519
- },
520
- {
521
- match: "fixed",
522
- message: "CSS position is ignored by Gmail and Outlook — use nested <Section>s"
523
- },
524
- {
525
- match: "sticky",
526
- message: "CSS position is ignored by Gmail and Outlook — use nested <Section>s"
527
- },
528
- {
529
- match: "static",
530
- message: "CSS position is ignored by Gmail and Outlook — remove it"
531
- },
532
- {
533
- match: "inset-",
534
- message: "position offsets are ignored by Gmail and Outlook — use padding"
535
- },
536
- {
537
- match: "top-",
538
- message: "position offsets are ignored by Gmail and Outlook — use padding"
539
- },
540
- {
541
- match: "right-",
542
- message: "position offsets are ignored by Gmail and Outlook — use padding"
543
- },
544
- {
545
- match: "bottom-",
546
- message: "position offsets are ignored by Gmail and Outlook — use padding"
547
- },
548
- {
549
- match: "left-",
550
- message: "position offsets are ignored by Gmail and Outlook — use padding"
551
- },
552
- {
553
- match: "z-",
554
- message: "z-index is ignored by Gmail and Outlook — remove it"
555
- },
556
- {
557
- match: "float-",
558
- message: "float is unreliable across email clients — use <Row>/<Column>"
559
- },
560
- {
561
- match: "shadow",
562
- message: "box-shadow is unsupported in Outlook for Windows and Gmail — use a border instead"
563
- },
564
- {
565
- match: "shadow-",
566
- message: "box-shadow is unsupported in Outlook for Windows and Gmail — use a border instead"
567
- },
568
- {
569
- match: "opacity-",
570
- message: "opacity is unsupported in Outlook for Windows — bake the tint into the color"
571
- },
572
- {
573
- match: "transform",
574
- message: "CSS transforms are unsupported in email clients — remove them"
575
- },
576
- {
577
- match: "rotate-",
578
- message: "CSS transforms are unsupported in email clients — remove them"
579
- },
580
- {
581
- match: "scale-",
582
- message: "CSS transforms are unsupported in email clients — remove them"
583
- },
584
- {
585
- match: "translate-",
586
- message: "CSS transforms are unsupported in email clients — remove them"
587
- },
588
- {
589
- match: "skew-",
590
- message: "CSS transforms are unsupported in email clients — remove them"
591
- },
592
- {
593
- match: "transition",
594
- message: "transitions don't run in email — remove them"
595
- },
596
- {
597
- match: "transition-",
598
- message: "transitions don't run in email — remove them"
599
- },
600
- {
601
- match: "duration-",
602
- message: "transitions don't run in email — remove them"
603
- },
604
- {
605
- match: "animate-",
606
- message: "animations don't run in email — remove them"
607
- },
608
- {
609
- match: "blur-",
610
- message: "CSS filters are unsupported in most email clients — remove them"
611
- },
612
- {
613
- match: "brightness-",
614
- message: "CSS filters are unsupported in most email clients — remove them"
615
- },
616
- {
617
- match: "grayscale",
618
- message: "CSS filters are unsupported in most email clients — remove them"
619
- },
620
- {
621
- match: "grayscale-",
622
- message: "CSS filters are unsupported in most email clients — remove them"
623
- },
624
- {
625
- match: "truncate",
626
- message: "text truncation is unsupported in Outlook for Windows — shorten the copy"
627
- },
628
- {
629
- match: "line-clamp-",
630
- message: "line clamping is unsupported in email clients — shorten the copy"
631
- },
632
- {
633
- match: "aspect-",
634
- message: "aspect-ratio is unsupported in Outlook and Gmail — set width/height on <Image>"
635
- },
636
- {
637
- match: "overflow-",
638
- message: "overflow is unreliable across email clients — restructure the layout"
639
- }
640
- ];
641
- /** Every root the resolver may try to split on, longest-match first (candidate.ts). */
642
- const registryRoots = new Set(utilityRegistry.map((family) => family.root));
643
- //#endregion
644
- export { GRADIENT_DIRECTION_PROPERTY, GRADIENT_FROM_PROPERTY, GRADIENT_TO_PROPERTY, forbiddenUtilities, registryRoots, utilityRegistry };
645
-
646
- //# sourceMappingURL=registry.js.map
@@ -1,45 +0,0 @@
1
- import { i as SmlParseError } from "./diagnostics-OcQKQYSY.js";
2
- import { b as SmlDocument } from "./ast-BrDtApwS.js";
3
- import { s as UnboundTemplateSourceLocations } from "./source-locations-DrCM82Ym.js";
4
- import { a as VariableKind, l as Variables } from "./variables-J_L3qxRa.js";
5
- import { a as JsxResult } from "./jsx-runtime-I-1nCtl2.js";
6
- import { Result } from "better-result";
7
- //#region src/render-template.d.ts
8
- /**
9
- * A template is a named function of the recording proxy returning the draft
10
- * root. The JSX transform types every element expression as `JSX.Element`
11
- * (`JsxResult`); a well-formed template returns an `<Email>` element, and a
12
- * stray Fragment root is caught at render time.
13
- */
14
- type Template<T extends Record<string, unknown>> = (variables: Variables<T>) => JsxResult;
15
- /** One entry of a template's inferred variable schema. */
16
- interface TemplateVariable {
17
- readonly name: string;
18
- /** Kind evidence from usage: numeric comparison ⇒ number, string ⇒ string, else unknown. */
19
- readonly kind: VariableKind;
20
- /**
21
- * `true` when the variable is referenced outside every `<If>`/`<Else>` subtree
22
- * (always needed to render); `false` when it only appears inside conditional
23
- * branches (needed only when that branch is selected).
24
- */
25
- readonly required: boolean;
26
- }
27
- interface RenderedTemplate {
28
- readonly document: SmlDocument;
29
- readonly source: string;
30
- readonly variables: ReadonlyArray<TemplateVariable>;
31
- /** Ephemeral parsed-node-id → authored JSX source origins, when available. */
32
- readonly sourceLocations: UnboundTemplateSourceLocations;
33
- }
34
- /**
35
- * Runs a template function and returns its canonical document, source, and
36
- * inferred variable schema. Grammar violations in the constructed tree surface
37
- * as a parse `SmlParseError` (Result failure) with spans into the printed
38
- * source. The template function itself may throw (e.g. the coercion guard) —
39
- * that is a programmer error in the user's build, so it propagates rather than
40
- * becoming a diagnostic.
41
- */
42
- declare const renderTemplate: <T extends Record<string, unknown>>(template: Template<T>) => Result<RenderedTemplate, SmlParseError>;
43
- //#endregion
44
- export { RenderedTemplate, Template, TemplateVariable, renderTemplate };
45
- //# sourceMappingURL=render-template.d.ts.map