@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
package/dist/presets.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { d as Channel } from "./ast-
|
|
1
|
+
import { d as Channel } from "./ast-63I-VLQx.js";
|
|
2
2
|
import { o as TokenOverrides } from "./theme-6ApjjiBo.js";
|
|
3
3
|
//#region presets/catalog.d.ts
|
|
4
4
|
type PresetCategory = "transactional" | "digest" | "marketing" | "lifecycle";
|
|
5
5
|
interface PresetMeta {
|
|
6
|
-
/** Stable id and source filename stem (`${id}.
|
|
6
|
+
/** Stable id and source filename stem (`${id}.tsx`). */
|
|
7
7
|
readonly id: string;
|
|
8
8
|
/** The source's root-tag channel; the gallery filters by it. */
|
|
9
9
|
readonly channel: Channel;
|
|
@@ -13,14 +13,41 @@ interface PresetMeta {
|
|
|
13
13
|
/** One-line description of when to reach for this preset. */
|
|
14
14
|
readonly description: string;
|
|
15
15
|
/**
|
|
16
|
-
* Every
|
|
17
|
-
*
|
|
18
|
-
* collectVariableReferences(source) by the preset test suite.
|
|
16
|
+
* Every input property declared by the template schema, sorted.
|
|
17
|
+
* A sender supplies these values when rendering the template.
|
|
19
18
|
*/
|
|
20
19
|
readonly variables: ReadonlyArray<string>;
|
|
21
20
|
}
|
|
22
21
|
declare const RECOMMENDED_THEME: TokenOverrides;
|
|
23
22
|
declare const presetCatalog: readonly [{
|
|
23
|
+
readonly id: "linear-login-code";
|
|
24
|
+
readonly channel: "email";
|
|
25
|
+
readonly category: "transactional";
|
|
26
|
+
readonly name: "Linear login code";
|
|
27
|
+
readonly description: "Recreate Linear's login code email with an editable magic link, code, and bundled logo.";
|
|
28
|
+
readonly variables: readonly ["expiryNotice", "homeUrl", "loginUrl", "productName", "validationCode"];
|
|
29
|
+
}, {
|
|
30
|
+
readonly id: "product-newsletter";
|
|
31
|
+
readonly channel: "email";
|
|
32
|
+
readonly category: "digest";
|
|
33
|
+
readonly name: "Product newsletter";
|
|
34
|
+
readonly description: "A monthly product newsletter with a lead story, mapped secondary stories, a changelog and one action.";
|
|
35
|
+
readonly variables: readonly ["changelog", "issueMonth", "issueNumber", "issueUrl", "leadImage", "leadSummary", "leadTitle", "leadUrl", "preferencesUrl", "stories", "unsubscribeUrl"];
|
|
36
|
+
}, {
|
|
37
|
+
readonly id: "vercel-invitation";
|
|
38
|
+
readonly channel: "email";
|
|
39
|
+
readonly category: "transactional";
|
|
40
|
+
readonly name: "Vercel team invitation";
|
|
41
|
+
readonly description: "Recreate Vercel's team invitation with editable source and bundled assets.";
|
|
42
|
+
readonly variables: readonly ["inviteFromIp", "inviteFromLocation", "inviteLink", "invitedByEmail", "invitedByUsername", "teamImage", "teamName", "userImage", "username"];
|
|
43
|
+
}, {
|
|
44
|
+
readonly id: "order-receipt";
|
|
45
|
+
readonly channel: "email";
|
|
46
|
+
readonly category: "transactional";
|
|
47
|
+
readonly name: "Order receipt";
|
|
48
|
+
readonly description: "Itemized order receipt with product thumbnails, totals, payment summary and shipping address.";
|
|
49
|
+
readonly variables: readonly ["customerName", "discount", "items", "orderDate", "orderNumber", "orderUrl", "paymentBrand", "paymentLast4", "shipping", "shippingAddress", "subtotal", "supportEmail", "tax", "total"];
|
|
50
|
+
}, {
|
|
24
51
|
readonly id: "welcome";
|
|
25
52
|
readonly channel: "email";
|
|
26
53
|
readonly category: "transactional";
|
|
@@ -244,6 +271,13 @@ declare const presetCatalog: readonly [{
|
|
|
244
271
|
readonly name: "Season clearance promotion";
|
|
245
272
|
readonly description: "A last-chance clearance promotion with a hero banner, a deadline phrase, and a single shop action.";
|
|
246
273
|
readonly variables: readonly ["contactEmailUrl", "grabDealsUrl", "heroImageUrl", "offerDeadlinePhrase", "offerEndLong", "offerEndShort", "onlineVersionUrl", "preferencesUrl", "seasonYear", "secondaryBannerImageUrl", "socialFourIconUrl", "socialOneIconUrl", "socialThreeIconUrl", "socialTwoIconUrl", "termsUrl", "unsubscribeUrl"];
|
|
274
|
+
}, {
|
|
275
|
+
readonly id: "product-launch-promo";
|
|
276
|
+
readonly channel: "email";
|
|
277
|
+
readonly category: "marketing";
|
|
278
|
+
readonly name: "Product launch promotion";
|
|
279
|
+
readonly description: "Launch a collection with a hero, a four-product grid, a discount code, and one shop action.";
|
|
280
|
+
readonly variables: readonly ["bestSellersUrl", "discountCode", "firstName", "headline", "newArrivalsUrl", "offerEnds", "preferencesUrl", "products", "saleUrl", "shopUrl", "subhead", "unsubscribeUrl"];
|
|
247
281
|
}, {
|
|
248
282
|
readonly id: "onboarding-step";
|
|
249
283
|
readonly channel: "email";
|
package/dist/presets.js
CHANGED
|
@@ -7,6 +7,81 @@ const RECOMMENDED_THEME = {
|
|
|
7
7
|
radiusPx: { brand: 8 }
|
|
8
8
|
};
|
|
9
9
|
const presetCatalog = [
|
|
10
|
+
{
|
|
11
|
+
id: "linear-login-code",
|
|
12
|
+
channel: "email",
|
|
13
|
+
category: "transactional",
|
|
14
|
+
name: "Linear login code",
|
|
15
|
+
description: "Recreate Linear's login code email with an editable magic link, code, and bundled logo.",
|
|
16
|
+
variables: [
|
|
17
|
+
"expiryNotice",
|
|
18
|
+
"homeUrl",
|
|
19
|
+
"loginUrl",
|
|
20
|
+
"productName",
|
|
21
|
+
"validationCode"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
id: "product-newsletter",
|
|
26
|
+
channel: "email",
|
|
27
|
+
category: "digest",
|
|
28
|
+
name: "Product newsletter",
|
|
29
|
+
description: "A monthly product newsletter with a lead story, mapped secondary stories, a changelog and one action.",
|
|
30
|
+
variables: [
|
|
31
|
+
"changelog",
|
|
32
|
+
"issueMonth",
|
|
33
|
+
"issueNumber",
|
|
34
|
+
"issueUrl",
|
|
35
|
+
"leadImage",
|
|
36
|
+
"leadSummary",
|
|
37
|
+
"leadTitle",
|
|
38
|
+
"leadUrl",
|
|
39
|
+
"preferencesUrl",
|
|
40
|
+
"stories",
|
|
41
|
+
"unsubscribeUrl"
|
|
42
|
+
]
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
id: "vercel-invitation",
|
|
46
|
+
channel: "email",
|
|
47
|
+
category: "transactional",
|
|
48
|
+
name: "Vercel team invitation",
|
|
49
|
+
description: "Recreate Vercel's team invitation with editable source and bundled assets.",
|
|
50
|
+
variables: [
|
|
51
|
+
"inviteFromIp",
|
|
52
|
+
"inviteFromLocation",
|
|
53
|
+
"inviteLink",
|
|
54
|
+
"invitedByEmail",
|
|
55
|
+
"invitedByUsername",
|
|
56
|
+
"teamImage",
|
|
57
|
+
"teamName",
|
|
58
|
+
"userImage",
|
|
59
|
+
"username"
|
|
60
|
+
]
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
id: "order-receipt",
|
|
64
|
+
channel: "email",
|
|
65
|
+
category: "transactional",
|
|
66
|
+
name: "Order receipt",
|
|
67
|
+
description: "Itemized order receipt with product thumbnails, totals, payment summary and shipping address.",
|
|
68
|
+
variables: [
|
|
69
|
+
"customerName",
|
|
70
|
+
"discount",
|
|
71
|
+
"items",
|
|
72
|
+
"orderDate",
|
|
73
|
+
"orderNumber",
|
|
74
|
+
"orderUrl",
|
|
75
|
+
"paymentBrand",
|
|
76
|
+
"paymentLast4",
|
|
77
|
+
"shipping",
|
|
78
|
+
"shippingAddress",
|
|
79
|
+
"subtotal",
|
|
80
|
+
"supportEmail",
|
|
81
|
+
"tax",
|
|
82
|
+
"total"
|
|
83
|
+
]
|
|
84
|
+
},
|
|
10
85
|
{
|
|
11
86
|
id: "welcome",
|
|
12
87
|
channel: "email",
|
|
@@ -1044,6 +1119,27 @@ const presetCatalog = [
|
|
|
1044
1119
|
"unsubscribeUrl"
|
|
1045
1120
|
]
|
|
1046
1121
|
},
|
|
1122
|
+
{
|
|
1123
|
+
id: "product-launch-promo",
|
|
1124
|
+
channel: "email",
|
|
1125
|
+
category: "marketing",
|
|
1126
|
+
name: "Product launch promotion",
|
|
1127
|
+
description: "Launch a collection with a hero, a four-product grid, a discount code, and one shop action.",
|
|
1128
|
+
variables: [
|
|
1129
|
+
"bestSellersUrl",
|
|
1130
|
+
"discountCode",
|
|
1131
|
+
"firstName",
|
|
1132
|
+
"headline",
|
|
1133
|
+
"newArrivalsUrl",
|
|
1134
|
+
"offerEnds",
|
|
1135
|
+
"preferencesUrl",
|
|
1136
|
+
"products",
|
|
1137
|
+
"saleUrl",
|
|
1138
|
+
"shopUrl",
|
|
1139
|
+
"subhead",
|
|
1140
|
+
"unsubscribeUrl"
|
|
1141
|
+
]
|
|
1142
|
+
},
|
|
1047
1143
|
{
|
|
1048
1144
|
id: "onboarding-step",
|
|
1049
1145
|
channel: "email",
|
package/dist/printer.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { o as SmlParseError } from "./diagnostics-oveE-laV.js";
|
|
2
|
-
import {
|
|
2
|
+
import { w as SmlDocument } from "./ast-63I-VLQx.js";
|
|
3
|
+
import { c as UnboundTemplateSourceLocations } from "./source-locations-BCJQnIfU.js";
|
|
3
4
|
import { a as VariableKind, l as Variables } from "./variables-if1VrV34.js";
|
|
4
|
-
import { a as JsxResult } from "./jsx-runtime-
|
|
5
|
+
import { a as JsxResult } from "./jsx-runtime-C5k_Zq0A.js";
|
|
5
6
|
import { Result } from "effect";
|
|
6
7
|
//#region src/render-template.d.ts
|
|
7
8
|
/**
|
|
@@ -27,6 +28,8 @@ interface RenderedTemplate {
|
|
|
27
28
|
readonly document: SmlDocument;
|
|
28
29
|
readonly source: string;
|
|
29
30
|
readonly variables: ReadonlyArray<TemplateVariable>;
|
|
31
|
+
/** Ephemeral parsed-node-id → authored JSX source origins, when available. */
|
|
32
|
+
readonly sourceLocations: UnboundTemplateSourceLocations;
|
|
30
33
|
}
|
|
31
34
|
/**
|
|
32
35
|
* Runs a template function and returns its canonical document, source, and
|
package/dist/render-template.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { mapJsxSourceLocations } from "./source-locations.js";
|
|
1
2
|
import { i as parsePredicate, n as collectPredicateVariables } from "./predicate-CvkzT-a2.js";
|
|
2
3
|
import { isRootTag } from "./ast.js";
|
|
3
4
|
import { createVariablesProxy } from "./variables.js";
|
|
@@ -27,7 +28,8 @@ const renderTemplate = (template) => {
|
|
|
27
28
|
return Result.succeed({
|
|
28
29
|
document,
|
|
29
30
|
source,
|
|
30
|
-
variables: collectVariableSchema(document, recorder)
|
|
31
|
+
variables: collectVariableSchema(document, recorder),
|
|
32
|
+
sourceLocations: mapJsxSourceLocations(root, document.root)
|
|
31
33
|
});
|
|
32
34
|
};
|
|
33
35
|
/**
|