@samva/markup 0.1.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 +8 -0
- package/LICENSE +21 -0
- package/README.md +41 -0
- package/dist/ast-DAhnAvQN.d.ts +120 -0
- package/dist/ast.d.ts +2 -0
- package/dist/ast.js +159 -0
- package/dist/ast.js.map +1 -0
- package/dist/candidate.d.ts +29 -0
- package/dist/candidate.js +88 -0
- package/dist/candidate.js.map +1 -0
- package/dist/checks-CW0nFj5n.js +58922 -0
- package/dist/checks-CW0nFj5n.js.map +1 -0
- package/dist/checks.d.ts +26 -0
- package/dist/checks.js +2 -0
- package/dist/classes.d.ts +27 -0
- package/dist/classes.js +184 -0
- package/dist/classes.js.map +1 -0
- package/dist/compile-sms.d.ts +28 -0
- package/dist/compile-sms.js +44 -0
- package/dist/compile-sms.js.map +1 -0
- package/dist/compile-whatsapp.d.ts +56 -0
- package/dist/compile-whatsapp.js +186 -0
- package/dist/compile-whatsapp.js.map +1 -0
- package/dist/compile.d.ts +93 -0
- package/dist/compile.js +938 -0
- package/dist/compile.js.map +1 -0
- package/dist/components.d.ts +289 -0
- package/dist/components.js +106 -0
- package/dist/components.js.map +1 -0
- package/dist/conditionals.d.ts +10 -0
- package/dist/conditionals.js +42 -0
- package/dist/conditionals.js.map +1 -0
- package/dist/diagnostics-oveE-laV.d.ts +79 -0
- package/dist/diagnostics.d.ts +2 -0
- package/dist/diagnostics.js +62 -0
- package/dist/diagnostics.js.map +1 -0
- package/dist/emit.d.ts +50 -0
- package/dist/emit.js +151 -0
- package/dist/emit.js.map +1 -0
- package/dist/footer.d.ts +66 -0
- package/dist/footer.js +90 -0
- package/dist/footer.js.map +1 -0
- package/dist/interpolate.d.ts +27 -0
- package/dist/interpolate.js +61 -0
- package/dist/interpolate.js.map +1 -0
- package/dist/jsx-dev-runtime.d.ts +10 -0
- package/dist/jsx-dev-runtime.js +7 -0
- package/dist/jsx-dev-runtime.js.map +1 -0
- package/dist/jsx-runtime-fSxcvlx4.d.ts +57 -0
- package/dist/jsx-runtime.d.ts +2 -0
- package/dist/jsx-runtime.js +102 -0
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/lexer.d.ts +60 -0
- package/dist/lexer.js +269 -0
- package/dist/lexer.js.map +1 -0
- package/dist/model.d.ts +39 -0
- package/dist/model.js +90 -0
- package/dist/model.js.map +1 -0
- package/dist/ops.d.ts +208 -0
- package/dist/ops.js +546 -0
- package/dist/ops.js.map +1 -0
- package/dist/parser-yzjUOGhc.d.ts +387 -0
- package/dist/parser.d.ts +2 -0
- package/dist/parser.js +821 -0
- package/dist/parser.js.map +1 -0
- package/dist/predicate-DTtVtLK7.d.ts +49 -0
- package/dist/predicate.d.ts +2 -0
- package/dist/predicate.js +417 -0
- package/dist/predicate.js.map +1 -0
- package/dist/presets/category-mapping.d.ts +13 -0
- package/dist/presets/category-mapping.js +49 -0
- package/dist/presets/category-mapping.js.map +1 -0
- package/dist/presets/public-gallery.d.ts +490 -0
- package/dist/presets/public-gallery.js +563 -0
- package/dist/presets/public-gallery.js.map +1 -0
- package/dist/presets/public-handoff.d.ts +68 -0
- package/dist/presets/public-handoff.js +105 -0
- package/dist/presets/public-handoff.js.map +1 -0
- package/dist/presets/public-preview-artifacts.d.ts +41 -0
- package/dist/presets/public-preview-artifacts.js +109 -0
- package/dist/presets/public-preview-artifacts.js.map +1 -0
- package/dist/presets/public-preview.d.ts +1168 -0
- package/dist/presets/public-preview.js +1158 -0
- package/dist/presets/public-preview.js.map +1 -0
- package/dist/presets/sources.d.ts +7 -0
- package/dist/presets/sources.js +54 -0
- package/dist/presets/sources.js.map +1 -0
- package/dist/presets.d.ts +350 -0
- package/dist/presets.js +1251 -0
- package/dist/presets.js.map +1 -0
- package/dist/printer.d.ts +6 -0
- package/dist/printer.js +122 -0
- package/dist/printer.js.map +1 -0
- package/dist/registry.d.ts +42 -0
- package/dist/registry.js +646 -0
- package/dist/registry.js.map +1 -0
- package/dist/render-template.d.ts +42 -0
- package/dist/render-template.js +74 -0
- package/dist/render-template.js.map +1 -0
- package/dist/sms-segments-y4FpPilJ.d.ts +13 -0
- package/dist/sms-segments.d.ts +2 -0
- package/dist/sms-segments.js +46 -0
- package/dist/sms-segments.js.map +1 -0
- package/dist/theme-6ApjjiBo.d.ts +116 -0
- package/dist/theme-css.d.ts +24 -0
- package/dist/theme-css.js +509 -0
- package/dist/theme-css.js.map +1 -0
- package/dist/theme.d.ts +2 -0
- package/dist/theme.js +95 -0
- package/dist/theme.js.map +1 -0
- package/dist/tokens.d.ts +6 -0
- package/dist/tokens.js +417 -0
- package/dist/tokens.js.map +1 -0
- package/dist/variables-3NGLpNTB.d.ts +77 -0
- package/dist/variables.d.ts +2 -0
- package/dist/variables.js +141 -0
- package/dist/variables.js.map +1 -0
- package/dist/version-BITr58kk.js +96 -0
- package/dist/version-BITr58kk.js.map +1 -0
- package/generated/sml-agent-contract.json +917 -0
- package/generated/sml-email-agent-contract.json +790 -0
- package/generated/sml-email-language-reference.md +160 -0
- package/generated/sml-language-reference.md +220 -0
- package/package.json +203 -0
package/dist/registry.js
ADDED
|
@@ -0,0 +1,646 @@
|
|
|
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
|