@samva/markup 0.7.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 (176) hide show
  1. package/AGENTS.md +104 -37
  2. package/README.md +188 -52
  3. package/dist/assets-C5duwTya.d.ts +40 -0
  4. package/dist/brand-B-0bN_Ir.d.ts +88 -0
  5. package/dist/{render-aaJBnsXK.js → cascade-t6kxlgEI.js} +130 -160
  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 +19 -249
  12. package/dist/compiler.js +10 -1408
  13. package/dist/{css-COcFOT1y.d.ts → css-BVQKICKC.d.ts} +30 -4
  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 -0
  21. package/dist/email/assets.js +63 -0
  22. package/dist/email/brand-footer.d.ts +34 -0
  23. package/dist/email/brand-footer.js +63 -0
  24. package/dist/email/brand.d.ts +2 -0
  25. package/dist/email/brand.js +148 -0
  26. package/dist/email/components.d.ts +21 -10
  27. package/dist/email/components.js +46 -11
  28. package/dist/email/diagnostics.d.ts +2 -2
  29. package/dist/email/diagnostics.js +2 -1
  30. package/dist/email/elements.d.ts +1 -1
  31. package/dist/email/html.d.ts +2 -42
  32. package/dist/email/html.js +56 -2
  33. package/dist/email/jsx-dev-runtime.d.ts +2 -2
  34. package/dist/email/jsx-runtime.d.ts +1 -1
  35. package/dist/email/render.d.ts +10 -13
  36. package/dist/email/render.js +163 -6
  37. package/dist/email/text.d.ts +1 -1
  38. package/dist/fmt.d.ts +32 -0
  39. package/dist/fmt.js +174 -0
  40. package/dist/html-BJepOwZ4.d.ts +56 -0
  41. package/dist/index.d.ts +2 -0
  42. package/dist/index.js +2 -0
  43. package/dist/ir-aaqNE987.d.ts +252 -0
  44. package/dist/ir.d.ts +2 -0
  45. package/dist/ir.js +7 -0
  46. package/dist/preview-Ekdg1dXG.d.ts +100 -0
  47. package/dist/preview.d.ts +2 -0
  48. package/dist/preview.js +160 -0
  49. package/dist/profile-BH-OtdDA.js +3670 -0
  50. package/dist/render-ir.d.ts +19 -0
  51. package/dist/render-ir.js +826 -0
  52. package/dist/sms-segments.d.ts +13 -2
  53. package/dist/sms.d.ts +16 -0
  54. package/dist/sms.js +12 -0
  55. package/dist/{email/source-edit.d.ts → source-edit.d.ts} +55 -6
  56. package/dist/source-edit.js +343 -0
  57. package/dist/source-locations-C8wCsiAy.d.ts +23 -0
  58. package/dist/source-locations.d.ts +2 -2
  59. package/dist/source-locations.js +3 -89
  60. package/dist/static.d.ts +57 -0
  61. package/dist/static.js +69 -0
  62. package/dist/tailwind-CMYpZf1v.js +614 -0
  63. package/dist/template-_QE_rQND.d.ts +65 -0
  64. package/dist/template.d.ts +2 -2
  65. package/dist/template.js +15 -10
  66. package/dist/theme-css-hFqcPSar.js +587 -0
  67. package/dist/theme-css.d.ts +57 -16
  68. package/dist/theme-css.js +2 -509
  69. package/dist/theme-imports-lvBw3AD1.js +109 -0
  70. package/dist/transform-Ct2OMkFN.d.ts +153 -0
  71. package/dist/unsubscribe-link-CoesnQDU.js +26 -0
  72. package/dist/whatsapp.d.ts +57 -0
  73. package/dist/whatsapp.js +22 -0
  74. package/generated/contract.json +1782 -0
  75. package/generated/reference.md +353 -0
  76. package/package.json +56 -154
  77. package/samva-brand.d.ts +14 -0
  78. package/skills/sml/SKILL.md +123 -0
  79. package/dist/ast-BrDtApwS.d.ts +0 -107
  80. package/dist/ast.d.ts +0 -2
  81. package/dist/ast.js +0 -124
  82. package/dist/candidate.d.ts +0 -29
  83. package/dist/candidate.js +0 -88
  84. package/dist/catalog-60eaYC7b.d.ts +0 -356
  85. package/dist/checks-DBweSIPN.js +0 -58954
  86. package/dist/checks.d.ts +0 -33
  87. package/dist/checks.js +0 -2
  88. package/dist/classes.d.ts +0 -27
  89. package/dist/classes.js +0 -184
  90. package/dist/compile-sms.d.ts +0 -28
  91. package/dist/compile-sms.js +0 -44
  92. package/dist/compile-whatsapp.d.ts +0 -56
  93. package/dist/compile-whatsapp.js +0 -186
  94. package/dist/compile.d.ts +0 -18
  95. package/dist/compile.js +0 -29
  96. package/dist/components.d.ts +0 -289
  97. package/dist/components.js +0 -106
  98. package/dist/conditionals.d.ts +0 -10
  99. package/dist/conditionals.js +0 -74
  100. package/dist/corpus-BjYMqOoY.d.ts +0 -106
  101. package/dist/diagnostics-OcQKQYSY.d.ts +0 -49
  102. package/dist/email/selection.d.ts +0 -91
  103. package/dist/email/selection.js +0 -91
  104. package/dist/email/source-edit.js +0 -185
  105. package/dist/email/stylesheets.d.ts +0 -15
  106. package/dist/email/stylesheets.js +0 -45
  107. package/dist/emit.d.ts +0 -51
  108. package/dist/emit.js +0 -151
  109. package/dist/footer.d.ts +0 -66
  110. package/dist/footer.js +0 -93
  111. package/dist/interpolate.d.ts +0 -24
  112. package/dist/interpolate.js +0 -43
  113. package/dist/jsx-dev-runtime.d.ts +0 -11
  114. package/dist/jsx-dev-runtime.js +0 -15
  115. package/dist/jsx-runtime-I-1nCtl2.d.ts +0 -57
  116. package/dist/jsx-runtime.d.ts +0 -2
  117. package/dist/jsx-runtime.js +0 -121
  118. package/dist/lexer.d.ts +0 -60
  119. package/dist/lexer.js +0 -281
  120. package/dist/model.d.ts +0 -24
  121. package/dist/model.js +0 -77
  122. package/dist/ops-2aiiYO7m.js +0 -630
  123. package/dist/ops.d.ts +0 -114
  124. package/dist/ops.js +0 -2
  125. package/dist/parser-t29cHLVL.d.ts +0 -396
  126. package/dist/parser.d.ts +0 -2
  127. package/dist/parser.js +0 -859
  128. package/dist/predicate-BI6uRRM-.js +0 -549
  129. package/dist/predicate-M-05Nd7R.d.ts +0 -56
  130. package/dist/predicate.d.ts +0 -2
  131. package/dist/predicate.js +0 -2
  132. package/dist/presets/category-mapping.d.ts +0 -13
  133. package/dist/presets/category-mapping.js +0 -49
  134. package/dist/presets/corpus.d.ts +0 -2
  135. package/dist/presets/corpus.js +0 -194
  136. package/dist/presets/public-gallery.d.ts +0 -266
  137. package/dist/presets/public-gallery.js +0 -916
  138. package/dist/presets/public-handoff.d.ts +0 -164
  139. package/dist/presets/public-handoff.js +0 -361
  140. package/dist/presets/public-preview-artifacts.d.ts +0 -43
  141. package/dist/presets/public-preview-artifacts.js +0 -104
  142. package/dist/presets/public-preview.d.ts +0 -61
  143. package/dist/presets/public-preview.js +0 -83
  144. package/dist/presets/showcase.d.ts +0 -2
  145. package/dist/presets/showcase.js +0 -627
  146. package/dist/presets/sources.d.ts +0 -38
  147. package/dist/presets/sources.js +0 -6083
  148. package/dist/presets.d.ts +0 -2
  149. package/dist/presets.js +0 -881
  150. package/dist/printer.d.ts +0 -6
  151. package/dist/printer.js +0 -122
  152. package/dist/registry.d.ts +0 -42
  153. package/dist/registry.js +0 -646
  154. package/dist/render-template.d.ts +0 -45
  155. package/dist/render-template.js +0 -76
  156. package/dist/showcase-DGZAWn4Z.d.ts +0 -456
  157. package/dist/sms-segments-y4FpPilJ.d.ts +0 -13
  158. package/dist/source-locations-DrCM82Ym.d.ts +0 -67
  159. package/dist/template-DWftqh4x.d.ts +0 -60
  160. package/dist/theme-6ApjjiBo.d.ts +0 -116
  161. package/dist/theme.d.ts +0 -2
  162. package/dist/theme.js +0 -118
  163. package/dist/tokens.d.ts +0 -6
  164. package/dist/tokens.js +0 -417
  165. package/dist/tsx-source-instrumentation.d.ts +0 -30
  166. package/dist/tsx-source-instrumentation.js +0 -115
  167. package/dist/tsx-tracer.d.ts +0 -112
  168. package/dist/tsx-tracer.js +0 -985
  169. package/dist/variables-J_L3qxRa.d.ts +0 -77
  170. package/dist/variables.d.ts +0 -2
  171. package/dist/variables.js +0 -141
  172. package/dist/version-BITr58kk.js +0 -96
  173. package/generated/sml-agent-contract.json +0 -709
  174. package/generated/sml-email-agent-contract.json +0 -615
  175. package/generated/sml-email-language-reference.md +0 -94
  176. package/generated/sml-language-reference.md +0 -195
package/dist/tokens.js DELETED
@@ -1,417 +0,0 @@
1
- //#region src/tokens.ts
2
- const baseTokens = {
3
- colors: {
4
- "red-50": "#fef2f2",
5
- "red-100": "#ffe2e2",
6
- "red-200": "#ffc9c9",
7
- "red-300": "#ffa2a2",
8
- "red-400": "#ff6467",
9
- "red-500": "#fb2c36",
10
- "red-600": "#e7000b",
11
- "red-700": "#c10007",
12
- "red-800": "#9f0712",
13
- "red-900": "#82181a",
14
- "red-950": "#460809",
15
- "orange-50": "#fff7ed",
16
- "orange-100": "#ffedd4",
17
- "orange-200": "#ffd6a7",
18
- "orange-300": "#ffb86a",
19
- "orange-400": "#ff8904",
20
- "orange-500": "#ff6900",
21
- "orange-600": "#f54900",
22
- "orange-700": "#ca3500",
23
- "orange-800": "#9f2d00",
24
- "orange-900": "#7e2a0c",
25
- "orange-950": "#441306",
26
- "amber-50": "#fffbeb",
27
- "amber-100": "#fef3c6",
28
- "amber-200": "#fee685",
29
- "amber-300": "#ffd230",
30
- "amber-400": "#ffb900",
31
- "amber-500": "#fe9a00",
32
- "amber-600": "#e17100",
33
- "amber-700": "#bb4d00",
34
- "amber-800": "#973c00",
35
- "amber-900": "#7b3306",
36
- "amber-950": "#461901",
37
- "yellow-50": "#fefce8",
38
- "yellow-100": "#fef9c2",
39
- "yellow-200": "#fff085",
40
- "yellow-300": "#ffdf20",
41
- "yellow-400": "#fdc700",
42
- "yellow-500": "#f0b100",
43
- "yellow-600": "#d08700",
44
- "yellow-700": "#a65f00",
45
- "yellow-800": "#894b00",
46
- "yellow-900": "#733e0a",
47
- "yellow-950": "#432004",
48
- "lime-50": "#f7fee7",
49
- "lime-100": "#ecfcca",
50
- "lime-200": "#d8f999",
51
- "lime-300": "#bbf451",
52
- "lime-400": "#9ae600",
53
- "lime-500": "#7ccf00",
54
- "lime-600": "#5ea500",
55
- "lime-700": "#497d00",
56
- "lime-800": "#3c6300",
57
- "lime-900": "#35530e",
58
- "lime-950": "#192e03",
59
- "green-50": "#f0fdf4",
60
- "green-100": "#dcfce7",
61
- "green-200": "#b9f8cf",
62
- "green-300": "#7bf1a8",
63
- "green-400": "#05df72",
64
- "green-500": "#00c950",
65
- "green-600": "#00a63e",
66
- "green-700": "#008236",
67
- "green-800": "#016630",
68
- "green-900": "#0d542b",
69
- "green-950": "#032e15",
70
- "emerald-50": "#ecfdf5",
71
- "emerald-100": "#d0fae5",
72
- "emerald-200": "#a4f4cf",
73
- "emerald-300": "#5ee9b5",
74
- "emerald-400": "#00d492",
75
- "emerald-500": "#00bc7d",
76
- "emerald-600": "#009966",
77
- "emerald-700": "#007a55",
78
- "emerald-800": "#006045",
79
- "emerald-900": "#004f3b",
80
- "emerald-950": "#002c22",
81
- "teal-50": "#f0fdfa",
82
- "teal-100": "#cbfbf1",
83
- "teal-200": "#96f7e4",
84
- "teal-300": "#46ecd5",
85
- "teal-400": "#00d5be",
86
- "teal-500": "#00bba7",
87
- "teal-600": "#009689",
88
- "teal-700": "#00786f",
89
- "teal-800": "#005f5a",
90
- "teal-900": "#0b4f4a",
91
- "teal-950": "#022f2e",
92
- "cyan-50": "#ecfeff",
93
- "cyan-100": "#cefafe",
94
- "cyan-200": "#a2f4fd",
95
- "cyan-300": "#53eafd",
96
- "cyan-400": "#00d3f2",
97
- "cyan-500": "#00b8db",
98
- "cyan-600": "#0092b8",
99
- "cyan-700": "#007595",
100
- "cyan-800": "#005f78",
101
- "cyan-900": "#104e64",
102
- "cyan-950": "#053345",
103
- "sky-50": "#f0f9ff",
104
- "sky-100": "#dff2fe",
105
- "sky-200": "#b8e6fe",
106
- "sky-300": "#74d4ff",
107
- "sky-400": "#00bcff",
108
- "sky-500": "#00a6f4",
109
- "sky-600": "#0084d1",
110
- "sky-700": "#0069a8",
111
- "sky-800": "#00598a",
112
- "sky-900": "#024a70",
113
- "sky-950": "#052f4a",
114
- "blue-50": "#eff6ff",
115
- "blue-100": "#dbeafe",
116
- "blue-200": "#bedbff",
117
- "blue-300": "#8ec5ff",
118
- "blue-400": "#51a2ff",
119
- "blue-500": "#2b7fff",
120
- "blue-600": "#155dfc",
121
- "blue-700": "#1447e6",
122
- "blue-800": "#193cb8",
123
- "blue-900": "#1c398e",
124
- "blue-950": "#162456",
125
- "indigo-50": "#eef2ff",
126
- "indigo-100": "#e0e7ff",
127
- "indigo-200": "#c6d2ff",
128
- "indigo-300": "#a3b3ff",
129
- "indigo-400": "#7c86ff",
130
- "indigo-500": "#615fff",
131
- "indigo-600": "#4f39f6",
132
- "indigo-700": "#432dd7",
133
- "indigo-800": "#372aac",
134
- "indigo-900": "#312c85",
135
- "indigo-950": "#1e1a4d",
136
- "violet-50": "#f5f3ff",
137
- "violet-100": "#ede9fe",
138
- "violet-200": "#ddd6ff",
139
- "violet-300": "#c4b4ff",
140
- "violet-400": "#a684ff",
141
- "violet-500": "#8e51ff",
142
- "violet-600": "#7f22fe",
143
- "violet-700": "#7008e7",
144
- "violet-800": "#5d0ec0",
145
- "violet-900": "#4d179a",
146
- "violet-950": "#2f0d68",
147
- "purple-50": "#faf5ff",
148
- "purple-100": "#f3e8ff",
149
- "purple-200": "#e9d4ff",
150
- "purple-300": "#dab2ff",
151
- "purple-400": "#c27aff",
152
- "purple-500": "#ad46ff",
153
- "purple-600": "#9810fa",
154
- "purple-700": "#8200db",
155
- "purple-800": "#6e11b0",
156
- "purple-900": "#59168b",
157
- "purple-950": "#3c0366",
158
- "fuchsia-50": "#fdf4ff",
159
- "fuchsia-100": "#fae8ff",
160
- "fuchsia-200": "#f6cfff",
161
- "fuchsia-300": "#f4a8ff",
162
- "fuchsia-400": "#ed6aff",
163
- "fuchsia-500": "#e12afb",
164
- "fuchsia-600": "#c800de",
165
- "fuchsia-700": "#a800b7",
166
- "fuchsia-800": "#8a0194",
167
- "fuchsia-900": "#721378",
168
- "fuchsia-950": "#4b004f",
169
- "pink-50": "#fdf2f8",
170
- "pink-100": "#fce7f3",
171
- "pink-200": "#fccee8",
172
- "pink-300": "#fda5d5",
173
- "pink-400": "#fb64b6",
174
- "pink-500": "#f6339a",
175
- "pink-600": "#e60076",
176
- "pink-700": "#c6005c",
177
- "pink-800": "#a3004c",
178
- "pink-900": "#861043",
179
- "pink-950": "#510424",
180
- "rose-50": "#fff1f2",
181
- "rose-100": "#ffe4e6",
182
- "rose-200": "#ffccd3",
183
- "rose-300": "#ffa1ad",
184
- "rose-400": "#ff637e",
185
- "rose-500": "#ff2056",
186
- "rose-600": "#ec003f",
187
- "rose-700": "#c70036",
188
- "rose-800": "#a50036",
189
- "rose-900": "#8b0836",
190
- "rose-950": "#4d0218",
191
- "slate-50": "#f8fafc",
192
- "slate-100": "#f1f5f9",
193
- "slate-200": "#e2e8f0",
194
- "slate-300": "#cad5e2",
195
- "slate-400": "#90a1b9",
196
- "slate-500": "#62748e",
197
- "slate-600": "#45556c",
198
- "slate-700": "#314158",
199
- "slate-800": "#1d293d",
200
- "slate-900": "#0f172b",
201
- "slate-950": "#020618",
202
- "gray-50": "#f9fafb",
203
- "gray-100": "#f3f4f6",
204
- "gray-200": "#e5e7eb",
205
- "gray-300": "#d1d5dc",
206
- "gray-400": "#99a1af",
207
- "gray-500": "#6a7282",
208
- "gray-600": "#4a5565",
209
- "gray-700": "#364153",
210
- "gray-800": "#1e2939",
211
- "gray-900": "#101828",
212
- "gray-950": "#030712",
213
- "zinc-50": "#fafafa",
214
- "zinc-100": "#f4f4f5",
215
- "zinc-200": "#e4e4e7",
216
- "zinc-300": "#d4d4d8",
217
- "zinc-400": "#9f9fa9",
218
- "zinc-500": "#71717b",
219
- "zinc-600": "#52525c",
220
- "zinc-700": "#3f3f46",
221
- "zinc-800": "#27272a",
222
- "zinc-900": "#18181b",
223
- "zinc-950": "#09090b",
224
- "neutral-50": "#fafafa",
225
- "neutral-100": "#f5f5f5",
226
- "neutral-200": "#e5e5e5",
227
- "neutral-300": "#d4d4d4",
228
- "neutral-400": "#a1a1a1",
229
- "neutral-500": "#737373",
230
- "neutral-600": "#525252",
231
- "neutral-700": "#404040",
232
- "neutral-800": "#262626",
233
- "neutral-900": "#171717",
234
- "neutral-950": "#0a0a0a",
235
- "stone-50": "#fafaf9",
236
- "stone-100": "#f5f5f4",
237
- "stone-200": "#e7e5e4",
238
- "stone-300": "#d6d3d1",
239
- "stone-400": "#a6a09b",
240
- "stone-500": "#79716b",
241
- "stone-600": "#57534d",
242
- "stone-700": "#44403b",
243
- "stone-800": "#292524",
244
- "stone-900": "#1c1917",
245
- "stone-950": "#0c0a09",
246
- "mauve-50": "#fafafa",
247
- "mauve-100": "#f3f1f3",
248
- "mauve-200": "#e7e4e7",
249
- "mauve-300": "#d7d0d7",
250
- "mauve-400": "#a89ea9",
251
- "mauve-500": "#79697b",
252
- "mauve-600": "#594c5b",
253
- "mauve-700": "#463947",
254
- "mauve-800": "#2a212c",
255
- "mauve-900": "#1d161e",
256
- "mauve-950": "#0c090c",
257
- "olive-50": "#fbfbf9",
258
- "olive-100": "#f4f4f0",
259
- "olive-200": "#e8e8e3",
260
- "olive-300": "#d8d8d0",
261
- "olive-400": "#abab9c",
262
- "olive-500": "#7c7c67",
263
- "olive-600": "#5b5b4b",
264
- "olive-700": "#474739",
265
- "olive-800": "#2b2b22",
266
- "olive-900": "#1d1d16",
267
- "olive-950": "#0c0c09",
268
- "mist-50": "#f9fbfb",
269
- "mist-100": "#f1f3f3",
270
- "mist-200": "#e3e7e8",
271
- "mist-300": "#d0d6d8",
272
- "mist-400": "#9ca8ab",
273
- "mist-500": "#67787c",
274
- "mist-600": "#4b585b",
275
- "mist-700": "#394447",
276
- "mist-800": "#22292b",
277
- "mist-900": "#161b1d",
278
- "mist-950": "#090b0c",
279
- "taupe-50": "#fbfaf9",
280
- "taupe-100": "#f3f1f1",
281
- "taupe-200": "#e8e4e3",
282
- "taupe-300": "#d8d2d0",
283
- "taupe-400": "#aba09c",
284
- "taupe-500": "#7c6d67",
285
- "taupe-600": "#5b4f4b",
286
- "taupe-700": "#473c39",
287
- "taupe-800": "#2b2422",
288
- "taupe-900": "#1d1816",
289
- "taupe-950": "#0c0a09",
290
- black: "#000000",
291
- white: "#ffffff",
292
- brand: "#171717",
293
- "brand-foreground": "#fafafa"
294
- },
295
- colorsDark: {
296
- brand: "#fafafa",
297
- "brand-foreground": "#171717"
298
- },
299
- spacingPx: 4,
300
- text: {
301
- xs: {
302
- sizePx: 12,
303
- lineHeightPx: 16
304
- },
305
- sm: {
306
- sizePx: 14,
307
- lineHeightPx: 20
308
- },
309
- base: {
310
- sizePx: 16,
311
- lineHeightPx: 24
312
- },
313
- lg: {
314
- sizePx: 18,
315
- lineHeightPx: 28
316
- },
317
- xl: {
318
- sizePx: 20,
319
- lineHeightPx: 28
320
- },
321
- "2xl": {
322
- sizePx: 24,
323
- lineHeightPx: 32
324
- },
325
- "3xl": {
326
- sizePx: 30,
327
- lineHeightPx: 36
328
- },
329
- "4xl": {
330
- sizePx: 36,
331
- lineHeightPx: 40
332
- },
333
- "5xl": {
334
- sizePx: 48,
335
- lineHeightPx: 48
336
- },
337
- "6xl": {
338
- sizePx: 60,
339
- lineHeightPx: 60
340
- },
341
- "7xl": {
342
- sizePx: 72,
343
- lineHeightPx: 72
344
- },
345
- "8xl": {
346
- sizePx: 96,
347
- lineHeightPx: 96
348
- },
349
- "9xl": {
350
- sizePx: 128,
351
- lineHeightPx: 128
352
- }
353
- },
354
- leading: {
355
- tight: 1.25,
356
- snug: 1.375,
357
- normal: 1.5,
358
- relaxed: 1.625,
359
- loose: 2
360
- },
361
- trackingEm: {
362
- tighter: -.05,
363
- tight: -.025,
364
- normal: 0,
365
- wide: .025,
366
- wider: .05,
367
- widest: .1
368
- },
369
- radiusPx: {
370
- brand: 8,
371
- xs: 2,
372
- sm: 4,
373
- md: 6,
374
- lg: 8,
375
- xl: 12,
376
- "2xl": 16,
377
- "3xl": 24,
378
- "4xl": 32
379
- },
380
- fontWeights: {
381
- thin: 100,
382
- extralight: 200,
383
- light: 300,
384
- normal: 400,
385
- medium: 500,
386
- semibold: 600,
387
- bold: 700,
388
- extrabold: 800,
389
- black: 900
390
- },
391
- fontFamilies: {
392
- body: "ui-sans-serif, system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji'",
393
- sans: "-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', 'Noto Sans', Arial, sans-serif, 'Apple Color Emoji', 'Segoe UI Emoji', 'Segoe UI Symbol', 'Noto Color Emoji'",
394
- serif: "ui-serif, Georgia, Cambria, 'Times New Roman', Times, serif",
395
- mono: "ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', 'Courier New', monospace"
396
- },
397
- fontFaces: {},
398
- containerPx: {
399
- "3xs": 256,
400
- "2xs": 288,
401
- xs: 320,
402
- sm: 384,
403
- md: 448,
404
- lg: 512,
405
- xl: 576,
406
- "2xl": 672,
407
- "3xl": 768,
408
- "4xl": 896,
409
- "5xl": 1024,
410
- "6xl": 1152,
411
- "7xl": 1280
412
- }
413
- };
414
- //#endregion
415
- export { baseTokens };
416
-
417
- //# sourceMappingURL=tokens.js.map
@@ -1,30 +0,0 @@
1
- //#region src/tsx-source-instrumentation.d.ts
2
- declare const TsxSourceInstrumentationError_base: import("better-result").TaggedErrorClass<"TsxSourceInstrumentationError">;
3
- /**
4
- * The authored TSX could not be instrumented. `location` is the 1-based line
5
- * and column the refusal points at, when the parser or the offending attribute
6
- * names one.
7
- */
8
- declare class TsxSourceInstrumentationError extends TsxSourceInstrumentationError_base<{
9
- readonly message: string;
10
- readonly location: {
11
- readonly line: number;
12
- readonly column: number;
13
- } | undefined;
14
- readonly cause?: unknown;
15
- }> {}
16
- /**
17
- * Add ephemeral source-origin props to one known TSX entry before a hosted
18
- * editor preview is bundled. The returned source is a build input only: the
19
- * caller must never persist it or expose it as authored source.
20
- *
21
- * Every JSX element is marked, including custom components. The markup runtime
22
- * strips the marker and keeps an inner element's sidecar when a custom
23
- * component renders JSX of its own. JSX fragments have no element output and
24
- * are therefore intentionally skipped. Pass a null import source to preserve
25
- * authored JSX pragmas in executable email builds.
26
- */
27
- declare const instrumentTsxSourceForPreview: (source: string, fileName: string, token?: string, jsxImportSource?: string | null) => string;
28
- //#endregion
29
- export { TsxSourceInstrumentationError, instrumentTsxSourceForPreview };
30
- //# sourceMappingURL=tsx-source-instrumentation.d.ts.map
@@ -1,115 +0,0 @@
1
- import { n as isObject } from "./guards-eV1qLbf2.js";
2
- import { JSX_SOURCE_LOCATION_PROP } from "./source-locations.js";
3
- import { buildLineMap, lineColumn } from "./diagnostics.js";
4
- import { TaggedError } from "better-result";
5
- import { parse } from "@babel/parser";
6
- //#region src/tsx-source-instrumentation.ts
7
- /**
8
- * The authored TSX could not be instrumented. `location` is the 1-based line
9
- * and column the refusal points at, when the parser or the offending attribute
10
- * names one.
11
- */
12
- var TsxSourceInstrumentationError = class extends TaggedError("TsxSourceInstrumentationError") {};
13
- const isAstNode = (value) => isObject(value) && typeof value.type === "string" && typeof value.start === "number" && typeof value.end === "number";
14
- const walkAst = (value, visit) => {
15
- if (Array.isArray(value)) {
16
- for (const item of value) walkAst(item, visit);
17
- return;
18
- }
19
- if (!isObject(value)) return;
20
- if (isAstNode(value)) visit(value);
21
- for (const [key, child] of Object.entries(value)) {
22
- if (key === "loc" || key === "extra" || key === "comments" || key === "tokens") continue;
23
- walkAst(child, visit);
24
- }
25
- };
26
- const jsxIdentifier = (value) => {
27
- if (!isAstNode(value) || value.type !== "JSXIdentifier") return void 0;
28
- return typeof value.name === "string" ? value.name : void 0;
29
- };
30
- const parseErrorMessage = (error) => isObject(error) && typeof error.message === "string" ? error.message : "The authored TSX could not be parsed for preview instrumentation.";
31
- /** Babel reports a 1-based line and a 0-based column. */
32
- const parseErrorLocation = (error) => {
33
- if (!isObject(error) || !isObject(error.loc)) return void 0;
34
- const { line, column } = error.loc;
35
- return typeof line === "number" && typeof column === "number" ? {
36
- line,
37
- column: column + 1
38
- } : void 0;
39
- };
40
- const marker = (fileName, source, offset, token) => {
41
- const position = lineColumn(buildLineMap(source), offset);
42
- return ` ${JSX_SOURCE_LOCATION_PROP}={${JSON.stringify({
43
- fileName,
44
- lineNumber: position.line,
45
- columnNumber: position.column,
46
- ...token === void 0 ? {} : { token }
47
- })}}`;
48
- };
49
- /**
50
- * Add ephemeral source-origin props to one known TSX entry before a hosted
51
- * editor preview is bundled. The returned source is a build input only: the
52
- * caller must never persist it or expose it as authored source.
53
- *
54
- * Every JSX element is marked, including custom components. The markup runtime
55
- * strips the marker and keeps an inner element's sidecar when a custom
56
- * component renders JSX of its own. JSX fragments have no element output and
57
- * are therefore intentionally skipped. Pass a null import source to preserve
58
- * authored JSX pragmas in executable email builds.
59
- */
60
- const instrumentTsxSourceForPreview = (source, fileName, token, jsxImportSource = "@samva/preview-runtime") => {
61
- let parsed;
62
- try {
63
- parsed = parse(source, {
64
- plugins: ["typescript", "jsx"],
65
- sourceType: "module"
66
- });
67
- } catch (error) {
68
- throw new TsxSourceInstrumentationError({
69
- cause: error,
70
- message: parseErrorMessage(error),
71
- location: parseErrorLocation(error)
72
- });
73
- }
74
- const edits = [];
75
- for (const comment of jsxImportSource === null ? [] : parsed.comments ?? []) {
76
- const commentStart = comment.start;
77
- const commentEnd = comment.end;
78
- if (commentStart === void 0 || commentEnd === void 0) continue;
79
- const commentSource = source.slice(commentStart, commentEnd);
80
- for (const match of commentSource.matchAll(/@jsxImportSource\s+[^\s*]+/gu)) {
81
- if (match.index === void 0) continue;
82
- edits.push({
83
- start: commentStart + match.index,
84
- end: commentStart + match.index + match[0].length,
85
- value: `@jsxImportSource ${jsxImportSource}`
86
- });
87
- }
88
- }
89
- walkAst(parsed.program, (node) => {
90
- if (node.type !== "JSXElement") return;
91
- const openingElement = node.openingElement;
92
- if (!isAstNode(openingElement)) return;
93
- const attributes = openingElement.attributes;
94
- if (Array.isArray(attributes)) for (const attribute of attributes) {
95
- if (!isAstNode(attribute) || attribute.type !== "JSXAttribute") continue;
96
- if (jsxIdentifier(attribute.name) === "__samva_source_location") throw new TsxSourceInstrumentationError({
97
- message: `The reserved JSX prop ${JSX_SOURCE_LOCATION_PROP} cannot be authored directly.`,
98
- location: lineColumn(buildLineMap(source), attribute.start)
99
- });
100
- }
101
- const closingLength = source.slice(openingElement.end - 2, openingElement.end) === "/>" ? 2 : 1;
102
- edits.push({
103
- start: openingElement.end - closingLength,
104
- end: openingElement.end - closingLength,
105
- value: marker(fileName, source, openingElement.start, token)
106
- });
107
- });
108
- let instrumented = source;
109
- for (const edit of edits.toSorted((left, right) => right.start - left.start)) instrumented = instrumented.slice(0, edit.start) + edit.value + instrumented.slice(edit.end);
110
- return instrumented;
111
- };
112
- //#endregion
113
- export { TsxSourceInstrumentationError, instrumentTsxSourceForPreview };
114
-
115
- //# sourceMappingURL=tsx-source-instrumentation.js.map
@@ -1,112 +0,0 @@
1
- import { a as Span } from "./diagnostics-OcQKQYSY.js";
2
- import { SmlOp } from "./ops.js";
3
- import { Result } from "better-result";
4
- //#region src/tsx-tracer.d.ts
5
- /** The closed set of reasons a rendered heading cannot be mapped safely. */
6
- type TsxHeadingDiagnosticCode = "tsx-invalid-authored-source" | "tsx-invalid-emitted-source" | "tsx-target-not-found" | "tsx-unsupported-target" | "tsx-ambiguous-target" | "tsx-dynamic-target";
7
- interface TsxHeadingDiagnostic {
8
- readonly code: TsxHeadingDiagnosticCode;
9
- readonly message: string;
10
- readonly span: Span;
11
- }
12
- declare const TsxHeadingTraceError_base: import("better-result").TaggedErrorClass<"TsxHeadingTraceError">;
13
- declare class TsxHeadingTraceError extends TsxHeadingTraceError_base<{
14
- readonly diagnostics: ReadonlyArray<TsxHeadingDiagnostic>;
15
- }> {}
16
- /**
17
- * Source metadata attached to a rendered JSX node by the development JSX
18
- * transform, or an equivalent exact source span from a host.
19
- *
20
- * `lineNumber`/`columnNumber` use the JSX transform convention: both are
21
- * one-based and identify the opening `<` of the element. A span locator is
22
- * useful to hosts that already have absolute offsets and must match the whole
23
- * JSX element span exactly.
24
- */
25
- type TsxSourceLocator = {
26
- readonly fileName: string;
27
- readonly lineNumber: number;
28
- readonly columnNumber: number;
29
- } | {
30
- readonly fileName: string;
31
- readonly span: Span;
32
- };
33
- /**
34
- * How an authored static text child spells itself. `jsx-text` is bare text
35
- * between tags; `string-literal` is a `{"…"}` expression container holding a
36
- * string literal, or a template literal with no expressions. An edit writes a
37
- * child back in the form it already had.
38
- */
39
- type StaticTextForm = "jsx-text" | "string-literal";
40
- /** A source range containing only the text bytes that an edit is allowed to replace. */
41
- interface TsxHeadingSourceTarget {
42
- readonly nodeId: string;
43
- readonly text: string;
44
- readonly span: Span;
45
- /** The spelling to preserve when the range is rewritten. */
46
- readonly form: StaticTextForm;
47
- }
48
- interface TraceTsxHeadingInput {
49
- /** The canonical TSX entry file path. */
50
- readonly authoredFile: string;
51
- /** The canonical TSX entry file. */
52
- readonly authoredSource: string;
53
- /** The last-good SML preview derived from that entry file. */
54
- readonly emittedSource: string;
55
- /** The selected semantic SML node id. */
56
- readonly nodeId: string;
57
- /** Exact runtime/source-map provenance for the selected JSX node. */
58
- readonly sourceLocator?: TsxSourceLocator | undefined;
59
- }
60
- interface ReplaceTsxHeadingTextInput extends TraceTsxHeadingInput {
61
- readonly text: string;
62
- }
63
- type TsxHeadingTrace = Result<TsxHeadingSourceTarget, TsxHeadingTraceError>;
64
- type TsxHeadingEdit = Result<string, TsxHeadingTraceError>;
65
- /** Resolve one rendered Heading to one direct-literal JSX text range. */
66
- declare const traceTsxHeadingTarget: (input: TraceTsxHeadingInput) => TsxHeadingTrace;
67
- /** Replace only the mapped literal bytes; all other authored TSX stays untouched. */
68
- declare const replaceTsxHeadingText: (input: ReplaceTsxHeadingTextInput) => TsxHeadingEdit;
69
- /**
70
- * The closed set of failures returned by {@link applyTsxSmlOps}. The editor
71
- * deliberately treats these as a typed "not safe to edit" response: it can
72
- * keep showing the preview and offer source editing without guessing at a
73
- * byte range in a user's project.
74
- */
75
- type TsxSmlDiagnosticCode = TsxHeadingDiagnosticCode | "tsx-invalid-snippet" | "tsx-unsupported-operation";
76
- interface TsxSmlDiagnostic {
77
- readonly code: TsxSmlDiagnosticCode;
78
- readonly message: string;
79
- readonly span: Span;
80
- }
81
- declare const TsxSmlOpsError_base: import("better-result").TaggedErrorClass<"TsxSmlOpsError">;
82
- declare class TsxSmlOpsError extends TsxSmlOpsError_base<{
83
- readonly diagnostics: ReadonlyArray<TsxSmlDiagnostic>;
84
- }> {}
85
- interface ApplyTsxSmlOpsInput {
86
- /** The canonical TSX entry file path. */
87
- readonly authoredFile: string;
88
- /** The canonical TSX entry file. */
89
- readonly authoredSource: string;
90
- /** The last-good SML preview derived from that entry file. */
91
- readonly emittedSource: string;
92
- /** Revision-fenced JSX origins for the SML ids in `emittedSource`. */
93
- readonly sourceLocations: {
94
- readonly byNodeId: Readonly<Record<string, TsxSourceLocator>>;
95
- };
96
- /** SML operations evaluated against the emitted-source id snapshot. */
97
- readonly ops: ReadonlyArray<SmlOp>;
98
- }
99
- type TsxSmlOpsResult = Result<string, TsxSmlOpsError>;
100
- /**
101
- * Apply semantic editor operations to the authored TSX entry.
102
- *
103
- * The emitted SML document remains the validation oracle: operations are
104
- * preflighted through the same markup op implementation first, then each
105
- * mapped target is checked against the authored JSX AST and exact source
106
- * provenance. The mutable source tree below only moves original AST nodes or
107
- * inserts validated raw fragments; it never reprints the user's module.
108
- */
109
- declare const applyTsxSmlOps: (input: ApplyTsxSmlOpsInput) => TsxSmlOpsResult;
110
- //#endregion
111
- export { ApplyTsxSmlOpsInput, ReplaceTsxHeadingTextInput, StaticTextForm, TraceTsxHeadingInput, TsxHeadingDiagnostic, TsxHeadingDiagnosticCode, TsxHeadingEdit, TsxHeadingSourceTarget, TsxHeadingTrace, TsxHeadingTraceError, TsxSmlDiagnostic, TsxSmlDiagnosticCode, TsxSmlOpsError, TsxSmlOpsResult, TsxSourceLocator, applyTsxSmlOps, replaceTsxHeadingText, traceTsxHeadingTarget };
112
- //# sourceMappingURL=tsx-tracer.d.ts.map