@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
@@ -1,195 +0,0 @@
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.
95
-
96
- ## Structured channels
97
-
98
- SMS and WhatsApp retain their structured channel grammar and the `@samva/markup` JSX runtime.
99
-
100
- ```json
101
- {
102
- "sms": {
103
- "Sms": {
104
- "attributes": {
105
- "category": {
106
- "type": "string",
107
- "values": ["transactional", "promotional", "service_implicit"]
108
- }
109
- },
110
- "content": "verbatim"
111
- },
112
- "If": {
113
- "attributes": {
114
- "test": {
115
- "type": "string",
116
- "required": true
117
- }
118
- },
119
- "content": "verbatim-if"
120
- },
121
- "Else": {
122
- "attributes": {},
123
- "content": "verbatim"
124
- }
125
- },
126
- "whatsapp": {
127
- "WhatsApp": {
128
- "attributes": {
129
- "name": {
130
- "type": "string"
131
- },
132
- "language": {
133
- "type": "string"
134
- },
135
- "category": {
136
- "type": "string",
137
- "required": true,
138
- "values": ["marketing", "utility", "authentication", "service"]
139
- }
140
- },
141
- "content": "whatsapp"
142
- },
143
- "Header": {
144
- "attributes": {
145
- "type": {
146
- "type": "string",
147
- "values": ["text", "image", "video", "document"]
148
- }
149
- },
150
- "content": "verbatim"
151
- },
152
- "Body": {
153
- "attributes": {},
154
- "content": "verbatim"
155
- },
156
- "Footer": {
157
- "attributes": {},
158
- "content": "verbatim"
159
- },
160
- "Buttons": {
161
- "attributes": {},
162
- "content": "buttons"
163
- },
164
- "Button": {
165
- "attributes": {
166
- "type": {
167
- "type": "string",
168
- "required": true,
169
- "values": ["quick-reply", "url", "phone", "copy-code"]
170
- },
171
- "url": {
172
- "type": "string"
173
- },
174
- "phone": {
175
- "type": "string"
176
- }
177
- },
178
- "content": "verbatim"
179
- },
180
- "If": {
181
- "attributes": {
182
- "test": {
183
- "type": "string",
184
- "required": true
185
- }
186
- },
187
- "content": "verbatim-if"
188
- },
189
- "Else": {
190
- "attributes": {},
191
- "content": "verbatim"
192
- }
193
- }
194
- }
195
- ```