@samva/markup 0.1.2 → 0.3.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 +25 -5
- package/README.md +92 -26
- package/dist/{ast-DAhnAvQN.d.ts → ast-63I-VLQx.d.ts} +15 -2
- package/dist/ast.d.ts +2 -2
- package/dist/ast.js +14 -1
- package/dist/{checks-D-zFQt5R.js → checks-DXuERO4B.js} +36 -2
- package/dist/checks.d.ts +8 -1
- package/dist/checks.js +2 -2
- package/dist/compile-sms.d.ts +2 -2
- package/dist/compile-whatsapp.d.ts +2 -2
- package/dist/compile.d.ts +9 -84
- package/dist/compile.js +11 -920
- package/dist/compiler.d.ts +303 -0
- package/dist/compiler.js +1390 -0
- package/dist/components.d.ts +3 -3
- package/dist/corpus-qrUD5O6r.d.ts +254 -0
- package/dist/css-ar2lU3NC.d.ts +84 -0
- package/dist/diagnostics-Djd9ckLg.d.ts +90 -0
- package/dist/diagnostics.js +4 -1
- package/dist/elements-DtwKlFVH.d.ts +820 -0
- package/dist/email/components.d.ts +125 -0
- package/dist/email/components.js +210 -0
- package/dist/email/diagnostics.d.ts +2 -0
- package/dist/email/diagnostics.js +56 -0
- package/dist/email/elements.d.ts +2 -0
- package/dist/email/elements.js +299 -0
- package/dist/email/html.d.ts +42 -0
- package/dist/email/html.js +266 -0
- package/dist/email/jsx-dev-runtime.d.ts +26 -0
- package/dist/email/jsx-dev-runtime.js +12 -0
- package/dist/email/jsx-runtime.d.ts +2 -0
- package/dist/email/jsx-runtime.js +60 -0
- package/dist/email/render.d.ts +43 -0
- package/dist/email/render.js +6 -0
- package/dist/email/selection.d.ts +102 -0
- package/dist/email/selection.js +143 -0
- package/dist/email/source-edit.d.ts +67 -0
- package/dist/email/source-edit.js +185 -0
- package/dist/email/stylesheets.d.ts +15 -0
- package/dist/email/stylesheets.js +45 -0
- package/dist/email/text.d.ts +7 -0
- package/dist/email/text.js +100 -0
- package/dist/emit.d.ts +13 -12
- package/dist/emit.js +63 -63
- package/dist/input-schema-BIfzI63B.d.ts +23 -0
- package/dist/input-schema.d.ts +2 -0
- package/dist/input-schema.js +170 -0
- package/dist/jsx-dev-runtime.d.ts +4 -3
- package/dist/jsx-dev-runtime.js +9 -1
- package/dist/{jsx-runtime-eNIMY87F.d.ts → jsx-runtime-C5k_Zq0A.d.ts} +3 -3
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +20 -1
- package/dist/model.d.ts +1 -1
- package/dist/ops.d.ts +1 -1
- package/dist/ops.js +1 -1
- package/dist/{parser-DkQKIjDa.d.ts → parser-CGBS73Gz.d.ts} +2 -2
- package/dist/parser.d.ts +1 -1
- package/dist/presets/category-mapping.d.ts +1 -1
- package/dist/presets/corpus.d.ts +2 -0
- package/dist/presets/corpus.js +247 -0
- package/dist/presets/public-gallery.d.ts +290 -2
- package/dist/presets/public-gallery.js +428 -6
- package/dist/presets/public-handoff.d.ts +164 -2
- package/dist/presets/public-handoff.js +229 -61
- package/dist/presets/public-preview-artifacts.d.ts +2 -2
- package/dist/presets/public-preview-artifacts.js +25 -31
- package/dist/presets/public-preview.d.ts +65 -2
- package/dist/presets/public-preview.js +402 -1152
- package/dist/presets/sources.d.ts +35 -4
- package/dist/presets/sources.js +2328 -43
- package/dist/presets.d.ts +39 -5
- package/dist/presets.js +96 -0
- package/dist/printer.d.ts +1 -1
- package/dist/render-template.d.ts +5 -2
- package/dist/render-template.js +3 -1
- package/dist/render-ykQhtMs_.js +592 -0
- package/dist/source-locations-BCJQnIfU.d.ts +89 -0
- package/dist/source-locations.d.ts +2 -0
- package/dist/source-locations.js +125 -0
- package/dist/template-Dy5yOPyp.d.ts +60 -0
- package/dist/template.d.ts +2 -0
- package/dist/template.js +37 -0
- package/dist/tsx-source-instrumentation.d.ts +23 -0
- package/dist/tsx-source-instrumentation.js +97 -0
- package/dist/tsx-tracer.d.ts +116 -0
- package/dist/tsx-tracer.js +985 -0
- package/generated/sml-agent-contract.json +574 -782
- package/generated/sml-email-agent-contract.json +502 -677
- package/generated/sml-email-language-reference.md +94 -160
- package/generated/sml-language-reference.md +195 -220
- package/package.json +111 -9
- package/dist/public-gallery-D0Zv0pZE.d.ts +0 -611
- package/dist/public-preview-u1Z9aaGq.d.ts +0 -1168
|
@@ -1,160 +1,94 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
`
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
-
|
|
40
|
-
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
`
|
|
50
|
-
|
|
51
|
-
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
- `
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
| `bg-gradient-*` | 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. |
|
|
96
|
-
| `from-*` | Gradient start color (from-indigo-600). Doubles as the solid fallback color on clients without gradient support (Outlook for Windows). |
|
|
97
|
-
| `to-*` | Gradient end color (to-purple-600). |
|
|
98
|
-
| `border-*` | Solid border width: border (1px), border-2, border-0. Border color from the palette (border-gray-200). |
|
|
99
|
-
| `rounded-*` | Border radius (rounded-md = 6px). Ignored by Outlook for Windows — buttons degrade to square corners. |
|
|
100
|
-
| `rounded-t-*` | Top border radius for card/header blocks (rounded-t-lg). Degrades to square corners in Outlook for Windows. |
|
|
101
|
-
| `rounded-r-*` | Right-side border radius (rounded-r-lg). Degrades to square corners in Outlook for Windows. |
|
|
102
|
-
| `rounded-b-*` | Bottom border radius for card/footer blocks (rounded-b-lg). Degrades to square corners in Outlook for Windows. |
|
|
103
|
-
| `rounded-l-*` | Left-side border radius (rounded-l-lg). Degrades to square corners in Outlook for Windows. |
|
|
104
|
-
| `block` | display: block. |
|
|
105
|
-
| `inline-block` | display: inline-block. |
|
|
106
|
-
| `hidden` | display: none. Pair with sm:block for mobile-only content. |
|
|
107
|
-
|
|
108
|
-
Palette color families (each with the usual `50`-`950` steps, plus `white`,
|
|
109
|
-
`black`, `transparent`): `amber`, `black`, `blue`, `brand`, `brand-foreground`, `cyan`, `emerald`, `fuchsia`, `gray`, `green`, `indigo`, `lime`, `mauve`, `mist`, `neutral`, `olive`, `orange`, `pink`, `purple`, `red`, `rose`, `sky`, `slate`, `stone`, `taupe`, `teal`, `violet`, `white`, `yellow`, `zinc`.
|
|
110
|
-
|
|
111
|
-
## Rejected utilities
|
|
112
|
-
|
|
113
|
-
These compile to hard errors — the message names the failing client and the
|
|
114
|
-
supported alternative. Drop the feature rather than break a client.
|
|
115
|
-
|
|
116
|
-
| Class / prefix | Why it is rejected |
|
|
117
|
-
| -------------- | -------------------------------------------------------------------------------------------- |
|
|
118
|
-
| `flex` | display:flex is unsupported in Outlook for Windows (Word engine) — use <Row>/<Column> |
|
|
119
|
-
| `inline-flex` | display:inline-flex is unsupported in Outlook for Windows — use <Row>/<Column> |
|
|
120
|
-
| `grid` | display:grid is unsupported in Outlook for Windows and Gmail — use <Row>/<Column> |
|
|
121
|
-
| `inline-grid` | display:inline-grid is unsupported in Outlook for Windows — use <Row>/<Column> |
|
|
122
|
-
| `gap-` | gap requires flex/grid, unsupported in Outlook for Windows — use padding on <Column> |
|
|
123
|
-
| `space-` | space-* margins require selectors Gmail strips — use padding or <Spacer> |
|
|
124
|
-
| `items-` | flexbox alignment is unsupported in Outlook for Windows — use <Row>/<Column> |
|
|
125
|
-
| `justify-` | flexbox alignment is unsupported in Outlook for Windows — use <Row>/<Column> and text-center |
|
|
126
|
-
| `self-` | flexbox alignment is unsupported in Outlook for Windows — use <Row>/<Column> |
|
|
127
|
-
| `content-` | flexbox alignment is unsupported in Outlook for Windows — use <Row>/<Column> |
|
|
128
|
-
| `order-` | flex order is unsupported in Outlook for Windows — reorder the source instead |
|
|
129
|
-
| `absolute` | CSS position is ignored by Gmail and Outlook — use nested <Section>s |
|
|
130
|
-
| `relative` | CSS position is ignored by Gmail and Outlook — use nested <Section>s |
|
|
131
|
-
| `fixed` | CSS position is ignored by Gmail and Outlook — use nested <Section>s |
|
|
132
|
-
| `sticky` | CSS position is ignored by Gmail and Outlook — use nested <Section>s |
|
|
133
|
-
| `static` | CSS position is ignored by Gmail and Outlook — remove it |
|
|
134
|
-
| `inset-` | position offsets are ignored by Gmail and Outlook — use padding |
|
|
135
|
-
| `top-` | position offsets are ignored by Gmail and Outlook — use padding |
|
|
136
|
-
| `right-` | position offsets are ignored by Gmail and Outlook — use padding |
|
|
137
|
-
| `bottom-` | position offsets are ignored by Gmail and Outlook — use padding |
|
|
138
|
-
| `left-` | position offsets are ignored by Gmail and Outlook — use padding |
|
|
139
|
-
| `z-` | z-index is ignored by Gmail and Outlook — remove it |
|
|
140
|
-
| `float-` | float is unreliable across email clients — use <Row>/<Column> |
|
|
141
|
-
| `shadow` | box-shadow is unsupported in Outlook for Windows and Gmail — use a border instead |
|
|
142
|
-
| `shadow-` | box-shadow is unsupported in Outlook for Windows and Gmail — use a border instead |
|
|
143
|
-
| `opacity-` | opacity is unsupported in Outlook for Windows — bake the tint into the color |
|
|
144
|
-
| `transform` | CSS transforms are unsupported in email clients — remove them |
|
|
145
|
-
| `rotate-` | CSS transforms are unsupported in email clients — remove them |
|
|
146
|
-
| `scale-` | CSS transforms are unsupported in email clients — remove them |
|
|
147
|
-
| `translate-` | CSS transforms are unsupported in email clients — remove them |
|
|
148
|
-
| `skew-` | CSS transforms are unsupported in email clients — remove them |
|
|
149
|
-
| `transition` | transitions don't run in email — remove them |
|
|
150
|
-
| `transition-` | transitions don't run in email — remove them |
|
|
151
|
-
| `duration-` | transitions don't run in email — remove them |
|
|
152
|
-
| `animate-` | animations don't run in email — remove them |
|
|
153
|
-
| `blur-` | CSS filters are unsupported in most email clients — remove them |
|
|
154
|
-
| `brightness-` | CSS filters are unsupported in most email clients — remove them |
|
|
155
|
-
| `grayscale` | CSS filters are unsupported in most email clients — remove them |
|
|
156
|
-
| `grayscale-` | CSS filters are unsupported in most email clients — remove them |
|
|
157
|
-
| `truncate` | text truncation is unsupported in Outlook for Windows — shorten the copy |
|
|
158
|
-
| `line-clamp-` | line clamping is unsupported in email clients — shorten the copy |
|
|
159
|
-
| `aspect-` | aspect-ratio is unsupported in Outlook and Gmail — set width/height on <Image> |
|
|
160
|
-
| `overflow-` | overflow is unreliable across email clients — restructure the layout |
|
|
1
|
+
# Executable email authoring reference
|
|
2
|
+
|
|
3
|
+
Email entries default-export `defineEmail({ id, schema, fixtures, render })` from
|
|
4
|
+
`@samva/markup/template`. Set `jsxImportSource: "@samva/markup/email"`.
|
|
5
|
+
The schema accepts a Standard JSON Schema v1 converter, such as Effect's
|
|
6
|
+
`Schema.toStandardJSONSchemaV1` or Zod 4. Render receives actual validated JSON.
|
|
7
|
+
Return subject, optional preheader, body and optional text; omitted text is derived.
|
|
8
|
+
|
|
9
|
+
Use ordinary synchronous TypeScript helpers, conditions and mapped arrays. Template identity is
|
|
10
|
+
stable and unique within the project. Helper modules are excluded from the template catalog.
|
|
11
|
+
Declare fixtures for each meaningful input shape; fixtures do not prove every possible branch.
|
|
12
|
+
|
|
13
|
+
## Email components
|
|
14
|
+
|
|
15
|
+
Import from `@samva/markup/email/components`: `Button`, `Column`, `Columns`, `Divider`, `Email`, `Image`, `Link`, `Section`, `Spacer`.
|
|
16
|
+
Use supported ordinary HTML for content. Email primitives generate layout tables and Outlook
|
|
17
|
+
fallbacks while preserving authoring origins. Scripts, event handlers and unsafe URLs fail.
|
|
18
|
+
Strings are escaped content, never interpreted as markup.
|
|
19
|
+
|
|
20
|
+
## HTML elements
|
|
21
|
+
|
|
22
|
+
- `html`: flow content; attributes: `xmlns`, `xmlns:o`, `xmlns:v`, `xmlns:w`.
|
|
23
|
+
- `head`: flow content; attributes: global attributes only.
|
|
24
|
+
- `title`: text content; attributes: global attributes only.
|
|
25
|
+
- `style`: raw content; attributes: `type`.
|
|
26
|
+
- `meta`: void content; attributes: `name`, `content`, `charset`, `http-equiv`.
|
|
27
|
+
- `body`: flow content; attributes: `bgcolor`.
|
|
28
|
+
- `div`: flow content; attributes: `align`.
|
|
29
|
+
- `section`: flow content; attributes: `align`.
|
|
30
|
+
- `article`: flow content; attributes: `align`.
|
|
31
|
+
- `header`: flow content; attributes: `align`.
|
|
32
|
+
- `footer`: flow content; attributes: `align`.
|
|
33
|
+
- `main`: flow content; attributes: `align`.
|
|
34
|
+
- `center`: flow content; attributes: global attributes only.
|
|
35
|
+
- `p`: flow content; attributes: `align`.
|
|
36
|
+
- `blockquote`: flow content; attributes: `align`.
|
|
37
|
+
- `pre`: flow content; attributes: global attributes only.
|
|
38
|
+
- `h1`: flow content; attributes: `align`.
|
|
39
|
+
- `h2`: flow content; attributes: `align`.
|
|
40
|
+
- `h3`: flow content; attributes: `align`.
|
|
41
|
+
- `h4`: flow content; attributes: `align`.
|
|
42
|
+
- `h5`: flow content; attributes: `align`.
|
|
43
|
+
- `h6`: flow content; attributes: `align`.
|
|
44
|
+
- `span`: flow content; attributes: global attributes only.
|
|
45
|
+
- `strong`: flow content; attributes: global attributes only.
|
|
46
|
+
- `b`: flow content; attributes: global attributes only.
|
|
47
|
+
- `em`: flow content; attributes: global attributes only.
|
|
48
|
+
- `i`: flow content; attributes: global attributes only.
|
|
49
|
+
- `u`: flow content; attributes: global attributes only.
|
|
50
|
+
- `s`: flow content; attributes: global attributes only.
|
|
51
|
+
- `small`: flow content; attributes: global attributes only.
|
|
52
|
+
- `code`: flow content; attributes: global attributes only.
|
|
53
|
+
- `a`: flow content; attributes: `href`, `target`, `rel`, `name`.
|
|
54
|
+
- `img`: void content; attributes: `src`, `alt`, `width`, `height`, `border`, `align`.
|
|
55
|
+
- `table`: flow content; attributes: `width`, `height`, `border`, `cellpadding`, `cellspacing`, `align`, `bgcolor`.
|
|
56
|
+
- `caption`: flow content; attributes: `align`.
|
|
57
|
+
- `colgroup`: flow content; attributes: `span`, `width`.
|
|
58
|
+
- `col`: void content; attributes: `span`, `width`.
|
|
59
|
+
- `thead`: flow content; attributes: `align`, `valign`, `bgcolor`.
|
|
60
|
+
- `tbody`: flow content; attributes: `align`, `valign`, `bgcolor`.
|
|
61
|
+
- `tfoot`: flow content; attributes: `align`, `valign`, `bgcolor`.
|
|
62
|
+
- `tr`: flow content; attributes: `align`, `valign`, `bgcolor`, `height`.
|
|
63
|
+
- `td`: flow content; attributes: `align`, `valign`, `width`, `height`, `bgcolor`, `colspan`, `rowspan`.
|
|
64
|
+
- `th`: flow content; attributes: `align`, `valign`, `width`, `height`, `bgcolor`, `colspan`, `rowspan`.
|
|
65
|
+
- `ul`: flow content; attributes: global attributes only.
|
|
66
|
+
- `ol`: flow content; attributes: `start`, `type`.
|
|
67
|
+
- `li`: flow content; attributes: global attributes only.
|
|
68
|
+
- `br`: void content; attributes: global attributes only.
|
|
69
|
+
- `hr`: void content; attributes: `width`, `size`, `align`.
|
|
70
|
+
|
|
71
|
+
Global attributes: `id`, `title`, `lang`, `dir`, `role`.
|
|
72
|
+
|
|
73
|
+
## CSS and assets
|
|
74
|
+
|
|
75
|
+
Imported CSS follows cascade and specificity; applicable declarations inline and supported media/head rules remain.
|
|
76
|
+
Uses the Tailwind compiler and discoverable source classes; dynamic classes may produce diagnostics.
|
|
77
|
+
Use email layout primitives for table and Outlook fallbacks; no general flex/grid conversion.
|
|
78
|
+
Imported assets are content-addressed. Delivery needs their actual HTTPS serving base; local export may use relative URLs. External HTTPS references are not fetched.
|
|
79
|
+
|
|
80
|
+
## Execution and publication
|
|
81
|
+
|
|
82
|
+
Isolated hosted rendering has no I/O. Clock and entropy require declared fixed runtime values; locale is en-US and timezone UTC.
|
|
83
|
+
Hosted builds consume Bun text lockfile v2 or npm lockfile v3. Exact immutable publication is the default send pin; contract-latest is explicit and resolves at acceptance.
|
|
84
|
+
Local preview, build and export do not require Samva credentials. Build executes named fixtures;
|
|
85
|
+
export writes template/fixture HTML and text plus assets and a catalog manifest.
|
|
86
|
+
|
|
87
|
+
## Quality bar
|
|
88
|
+
|
|
89
|
+
- Validate all declared fixtures and inspect structured diagnostics and source origins.
|
|
90
|
+
- Repair fatal compile/render failures before delivery.
|
|
91
|
+
- Check representative empty, nested, repeated and conditional inputs.
|
|
92
|
+
- Inspect HTML and text, light/dark styling and responsive layouts.
|
|
93
|
+
- Distinguish static compatibility findings and browser previews from actual inbox evidence.
|
|
94
|
+
- Keep source canonical; source edits and fixture data edits are separate operations.
|