@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/components.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { m as ElementNode } from "./ast-
|
|
2
|
-
import { i as EMAIL_TAG_SPECS, l as WHATSAPP_TAG_SPECS, o as TagSpec, t as AttributeSpec } from "./parser-
|
|
1
|
+
import { m as ElementNode } from "./ast-63I-VLQx.js";
|
|
2
|
+
import { i as EMAIL_TAG_SPECS, l as WHATSAPP_TAG_SPECS, o as TagSpec, t as AttributeSpec } from "./parser-CGBS73Gz.js";
|
|
3
3
|
import { r as PredicateRef, s as VariableRef } from "./variables-if1VrV34.js";
|
|
4
|
-
import { s as SmlChildren } from "./jsx-runtime-
|
|
4
|
+
import { s as SmlChildren } from "./jsx-runtime-C5k_Zq0A.js";
|
|
5
5
|
//#region src/components.d.ts
|
|
6
6
|
/**
|
|
7
7
|
* The scalar type an attribute spec accepts. `level` narrows to the Heading
|
|
@@ -0,0 +1,254 @@
|
|
|
1
|
+
import { Result, Schema } from "effect";
|
|
2
|
+
//#region presets/corpus.d.ts
|
|
3
|
+
declare const TemplateCorpusKind: Schema.Literals<readonly ["owned-editable-sml", "brand-recreation-sml", "inspiration-reference"]>;
|
|
4
|
+
type TemplateCorpusKind = typeof TemplateCorpusKind.Type;
|
|
5
|
+
declare const templateFacetOptions: {
|
|
6
|
+
readonly jobType: readonly ["account-access", "commerce", "product-communication", "lifecycle", "publishing-campaigns"];
|
|
7
|
+
readonly lifecycle: readonly ["acquisition", "activation", "engagement", "transaction", "retention", "recovery"];
|
|
8
|
+
readonly industry: readonly ["saas", "ecommerce", "developer-tools", "newsletters-media"];
|
|
9
|
+
readonly season: readonly ["evergreen", "seasonal"];
|
|
10
|
+
readonly audience: readonly ["product-users", "customers", "members", "readers", "shoppers", "teams"];
|
|
11
|
+
readonly design: readonly ["minimal", "branded", "editorial", "data-heavy", "single-cta"];
|
|
12
|
+
readonly brandProvenance: readonly ["samva-original", "third-party-reference"];
|
|
13
|
+
};
|
|
14
|
+
declare const TemplateFacetSet: Schema.Struct<{
|
|
15
|
+
readonly jobType: Schema.$Array<Schema.Literals<readonly ["account-access", "commerce", "product-communication", "lifecycle", "publishing-campaigns"]>>;
|
|
16
|
+
readonly lifecycle: Schema.$Array<Schema.Literals<readonly ["acquisition", "activation", "engagement", "transaction", "retention", "recovery"]>>;
|
|
17
|
+
readonly industry: Schema.$Array<Schema.Literals<readonly ["saas", "ecommerce", "developer-tools", "newsletters-media"]>>;
|
|
18
|
+
readonly season: Schema.$Array<Schema.Literals<readonly ["evergreen", "seasonal"]>>;
|
|
19
|
+
readonly audience: Schema.$Array<Schema.Literals<readonly ["product-users", "customers", "members", "readers", "shoppers", "teams"]>>;
|
|
20
|
+
readonly design: Schema.$Array<Schema.Literals<readonly ["minimal", "branded", "editorial", "data-heavy", "single-cta"]>>;
|
|
21
|
+
readonly brandProvenance: Schema.$Array<Schema.Literals<readonly ["samva-original", "third-party-reference"]>>;
|
|
22
|
+
}>;
|
|
23
|
+
interface TemplateFacetSet extends Schema.Schema.Type<typeof TemplateFacetSet> {}
|
|
24
|
+
declare const OwnedEditablePreset: Schema.TaggedStruct<"OwnedEditablePreset", {
|
|
25
|
+
readonly corpusKind: Schema.Literal<"owned-editable-sml">;
|
|
26
|
+
readonly provenance: Schema.Struct<{
|
|
27
|
+
readonly owner: Schema.Literal<"Samva">;
|
|
28
|
+
readonly sourcePath: Schema.String;
|
|
29
|
+
readonly recordedAt: Schema.String;
|
|
30
|
+
}>;
|
|
31
|
+
readonly review: Schema.Struct<{
|
|
32
|
+
readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
|
|
33
|
+
readonly reviewedBy: Schema.String;
|
|
34
|
+
readonly reviewedAt: Schema.String;
|
|
35
|
+
readonly notes: Schema.String;
|
|
36
|
+
}>;
|
|
37
|
+
readonly display: Schema.Struct<{
|
|
38
|
+
readonly state: Schema.Literals<readonly ["hidden", "public"]>;
|
|
39
|
+
readonly attributionLabel: Schema.String;
|
|
40
|
+
}>;
|
|
41
|
+
readonly retention: Schema.Struct<{
|
|
42
|
+
readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
|
|
43
|
+
readonly reviewedAt: Schema.String;
|
|
44
|
+
}>;
|
|
45
|
+
readonly takedown: Schema.Struct<{
|
|
46
|
+
readonly state: Schema.Literals<readonly ["active", "removed"]>;
|
|
47
|
+
readonly contact: Schema.String;
|
|
48
|
+
readonly procedureUrl: Schema.String;
|
|
49
|
+
}>;
|
|
50
|
+
}>;
|
|
51
|
+
interface OwnedEditablePreset extends Schema.Schema.Type<typeof OwnedEditablePreset> {}
|
|
52
|
+
declare const BrandRecreationPreset: Schema.TaggedStruct<"BrandRecreationPreset", {
|
|
53
|
+
readonly corpusKind: Schema.Literal<"brand-recreation-sml">;
|
|
54
|
+
readonly provenance: Schema.Struct<{
|
|
55
|
+
readonly owner: Schema.Literal<"Samva">;
|
|
56
|
+
readonly sourcePath: Schema.String;
|
|
57
|
+
readonly recordedAt: Schema.String;
|
|
58
|
+
/** The brand whose own email is recreated, named on every public surface. */
|
|
59
|
+
readonly brand: Schema.String;
|
|
60
|
+
/** What that brand's email does, in the customer's words. */
|
|
61
|
+
readonly subject: Schema.String;
|
|
62
|
+
readonly reviewedNote: Schema.String;
|
|
63
|
+
}>;
|
|
64
|
+
readonly review: Schema.Struct<{
|
|
65
|
+
readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
|
|
66
|
+
readonly reviewedBy: Schema.String;
|
|
67
|
+
readonly reviewedAt: Schema.String;
|
|
68
|
+
readonly notes: Schema.String;
|
|
69
|
+
}>;
|
|
70
|
+
readonly display: Schema.Struct<{
|
|
71
|
+
readonly state: Schema.Literals<readonly ["hidden", "public"]>;
|
|
72
|
+
readonly attributionLabel: Schema.String;
|
|
73
|
+
}>;
|
|
74
|
+
readonly retention: Schema.Struct<{
|
|
75
|
+
readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
|
|
76
|
+
readonly reviewedAt: Schema.String;
|
|
77
|
+
}>;
|
|
78
|
+
readonly takedown: Schema.Struct<{
|
|
79
|
+
readonly state: Schema.Literals<readonly ["active", "removed"]>;
|
|
80
|
+
readonly contact: Schema.String;
|
|
81
|
+
readonly procedureUrl: Schema.String;
|
|
82
|
+
}>;
|
|
83
|
+
}>;
|
|
84
|
+
interface BrandRecreationPreset extends Schema.Schema.Type<typeof BrandRecreationPreset> {}
|
|
85
|
+
/** Clean-room recreations of a named brand's own email, authored as editable Samva projects. */
|
|
86
|
+
declare const brandRecreationProvenance: {
|
|
87
|
+
readonly "linear-login-code": {
|
|
88
|
+
readonly owner: "Samva";
|
|
89
|
+
readonly sourcePath: "examples/email-showcase/emails/linear-login-code.tsx";
|
|
90
|
+
readonly recordedAt: "2026-09-08T00:00:00.000Z";
|
|
91
|
+
readonly brand: "Linear";
|
|
92
|
+
readonly subject: "login code";
|
|
93
|
+
readonly reviewedNote: "Reviewed recreation of Linear's login code email, its canonical project assets, and its brand attribution.";
|
|
94
|
+
};
|
|
95
|
+
readonly "vercel-invitation": {
|
|
96
|
+
readonly owner: "Samva";
|
|
97
|
+
readonly sourcePath: "examples/email-showcase/emails/vercel-invitation.tsx";
|
|
98
|
+
readonly recordedAt: "2026-09-08T00:00:00.000Z";
|
|
99
|
+
readonly brand: "Vercel";
|
|
100
|
+
readonly subject: "team invitation";
|
|
101
|
+
readonly reviewedNote: "Reviewed recreation of Vercel's team invitation email, its canonical project assets, and its brand attribution.";
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
/**
|
|
105
|
+
* Owned presets authored as complete showcase projects with their own stylesheet and assets.
|
|
106
|
+
* Every other owned preset is the single module `packages/markup/presets/<id>.tsx`.
|
|
107
|
+
*/
|
|
108
|
+
declare const ownedShowcasePresetSources: {
|
|
109
|
+
readonly "order-receipt": "examples/email-showcase/emails/order-receipt.tsx";
|
|
110
|
+
readonly "product-launch-promo": "examples/email-showcase/emails/product-launch-promo.tsx";
|
|
111
|
+
readonly "product-newsletter": "examples/email-showcase/emails/product-newsletter.tsx";
|
|
112
|
+
};
|
|
113
|
+
declare const ownedPresetSourcePath: (id: string) => string;
|
|
114
|
+
declare const InspirationReference: Schema.TaggedStruct<"InspirationReference", {
|
|
115
|
+
readonly corpusKind: Schema.Literal<"inspiration-reference">;
|
|
116
|
+
readonly provenance: Schema.Struct<{
|
|
117
|
+
readonly publisher: Schema.String;
|
|
118
|
+
readonly sourceUrl: Schema.String;
|
|
119
|
+
readonly capturedAt: Schema.String;
|
|
120
|
+
readonly rightsBasis: Schema.Literals<readonly ["display-link-and-commentary", "permission"]>;
|
|
121
|
+
}>;
|
|
122
|
+
readonly review: Schema.Struct<{
|
|
123
|
+
readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
|
|
124
|
+
readonly reviewedBy: Schema.String;
|
|
125
|
+
readonly reviewedAt: Schema.String;
|
|
126
|
+
readonly notes: Schema.String;
|
|
127
|
+
}>;
|
|
128
|
+
readonly display: Schema.Struct<{
|
|
129
|
+
readonly state: Schema.Literals<readonly ["hidden", "public"]>;
|
|
130
|
+
readonly attributionLabel: Schema.String;
|
|
131
|
+
}>;
|
|
132
|
+
readonly retention: Schema.Struct<{
|
|
133
|
+
readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
|
|
134
|
+
readonly reviewedAt: Schema.String;
|
|
135
|
+
}>;
|
|
136
|
+
readonly takedown: Schema.Struct<{
|
|
137
|
+
readonly state: Schema.Literals<readonly ["active", "removed"]>;
|
|
138
|
+
readonly contact: Schema.String;
|
|
139
|
+
readonly procedureUrl: Schema.String;
|
|
140
|
+
}>;
|
|
141
|
+
}>;
|
|
142
|
+
interface InspirationReference extends Schema.Schema.Type<typeof InspirationReference> {}
|
|
143
|
+
declare const TemplateCorpusRecord: Schema.Union<readonly [Schema.TaggedStruct<"OwnedEditablePreset", {
|
|
144
|
+
readonly corpusKind: Schema.Literal<"owned-editable-sml">;
|
|
145
|
+
readonly provenance: Schema.Struct<{
|
|
146
|
+
readonly owner: Schema.Literal<"Samva">;
|
|
147
|
+
readonly sourcePath: Schema.String;
|
|
148
|
+
readonly recordedAt: Schema.String;
|
|
149
|
+
}>;
|
|
150
|
+
readonly review: Schema.Struct<{
|
|
151
|
+
readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
|
|
152
|
+
readonly reviewedBy: Schema.String;
|
|
153
|
+
readonly reviewedAt: Schema.String;
|
|
154
|
+
readonly notes: Schema.String;
|
|
155
|
+
}>;
|
|
156
|
+
readonly display: Schema.Struct<{
|
|
157
|
+
readonly state: Schema.Literals<readonly ["hidden", "public"]>;
|
|
158
|
+
readonly attributionLabel: Schema.String;
|
|
159
|
+
}>;
|
|
160
|
+
readonly retention: Schema.Struct<{
|
|
161
|
+
readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
|
|
162
|
+
readonly reviewedAt: Schema.String;
|
|
163
|
+
}>;
|
|
164
|
+
readonly takedown: Schema.Struct<{
|
|
165
|
+
readonly state: Schema.Literals<readonly ["active", "removed"]>;
|
|
166
|
+
readonly contact: Schema.String;
|
|
167
|
+
readonly procedureUrl: Schema.String;
|
|
168
|
+
}>;
|
|
169
|
+
}>, Schema.TaggedStruct<"BrandRecreationPreset", {
|
|
170
|
+
readonly corpusKind: Schema.Literal<"brand-recreation-sml">;
|
|
171
|
+
readonly provenance: Schema.Struct<{
|
|
172
|
+
readonly owner: Schema.Literal<"Samva">;
|
|
173
|
+
readonly sourcePath: Schema.String;
|
|
174
|
+
readonly recordedAt: Schema.String;
|
|
175
|
+
/** The brand whose own email is recreated, named on every public surface. */
|
|
176
|
+
readonly brand: Schema.String;
|
|
177
|
+
/** What that brand's email does, in the customer's words. */
|
|
178
|
+
readonly subject: Schema.String;
|
|
179
|
+
readonly reviewedNote: Schema.String;
|
|
180
|
+
}>;
|
|
181
|
+
readonly review: Schema.Struct<{
|
|
182
|
+
readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
|
|
183
|
+
readonly reviewedBy: Schema.String;
|
|
184
|
+
readonly reviewedAt: Schema.String;
|
|
185
|
+
readonly notes: Schema.String;
|
|
186
|
+
}>;
|
|
187
|
+
readonly display: Schema.Struct<{
|
|
188
|
+
readonly state: Schema.Literals<readonly ["hidden", "public"]>;
|
|
189
|
+
readonly attributionLabel: Schema.String;
|
|
190
|
+
}>;
|
|
191
|
+
readonly retention: Schema.Struct<{
|
|
192
|
+
readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
|
|
193
|
+
readonly reviewedAt: Schema.String;
|
|
194
|
+
}>;
|
|
195
|
+
readonly takedown: Schema.Struct<{
|
|
196
|
+
readonly state: Schema.Literals<readonly ["active", "removed"]>;
|
|
197
|
+
readonly contact: Schema.String;
|
|
198
|
+
readonly procedureUrl: Schema.String;
|
|
199
|
+
}>;
|
|
200
|
+
}>, Schema.TaggedStruct<"InspirationReference", {
|
|
201
|
+
readonly corpusKind: Schema.Literal<"inspiration-reference">;
|
|
202
|
+
readonly provenance: Schema.Struct<{
|
|
203
|
+
readonly publisher: Schema.String;
|
|
204
|
+
readonly sourceUrl: Schema.String;
|
|
205
|
+
readonly capturedAt: Schema.String;
|
|
206
|
+
readonly rightsBasis: Schema.Literals<readonly ["display-link-and-commentary", "permission"]>;
|
|
207
|
+
}>;
|
|
208
|
+
readonly review: Schema.Struct<{
|
|
209
|
+
readonly state: Schema.Literals<readonly ["draft", "approved", "rejected"]>;
|
|
210
|
+
readonly reviewedBy: Schema.String;
|
|
211
|
+
readonly reviewedAt: Schema.String;
|
|
212
|
+
readonly notes: Schema.String;
|
|
213
|
+
}>;
|
|
214
|
+
readonly display: Schema.Struct<{
|
|
215
|
+
readonly state: Schema.Literals<readonly ["hidden", "public"]>;
|
|
216
|
+
readonly attributionLabel: Schema.String;
|
|
217
|
+
}>;
|
|
218
|
+
readonly retention: Schema.Struct<{
|
|
219
|
+
readonly policy: Schema.Literals<readonly ["retain-until-withdrawn", "retain-while-linked"]>;
|
|
220
|
+
readonly reviewedAt: Schema.String;
|
|
221
|
+
}>;
|
|
222
|
+
readonly takedown: Schema.Struct<{
|
|
223
|
+
readonly state: Schema.Literals<readonly ["active", "removed"]>;
|
|
224
|
+
readonly contact: Schema.String;
|
|
225
|
+
readonly procedureUrl: Schema.String;
|
|
226
|
+
}>;
|
|
227
|
+
}>]>;
|
|
228
|
+
type TemplateCorpusRecord = typeof TemplateCorpusRecord.Type;
|
|
229
|
+
interface PublicCorpusRegistration {
|
|
230
|
+
readonly id: string;
|
|
231
|
+
readonly corpus: TemplateCorpusRecord;
|
|
232
|
+
readonly facets: TemplateFacetSet;
|
|
233
|
+
}
|
|
234
|
+
interface PublicCorpusRegistrationIssue {
|
|
235
|
+
readonly id: string;
|
|
236
|
+
readonly message: string;
|
|
237
|
+
}
|
|
238
|
+
/** Decode and gate a record before it can enter any public projection. */
|
|
239
|
+
declare const registerPublicCorpusEntry: (input: unknown) => Result.Result<PublicCorpusRegistration, PublicCorpusRegistrationIssue>;
|
|
240
|
+
declare const TemplateFacetQuery: Schema.Struct<{
|
|
241
|
+
readonly jobType: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["account-access", "commerce", "product-communication", "lifecycle", "publishing-campaigns"]>>>;
|
|
242
|
+
readonly lifecycle: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["acquisition", "activation", "engagement", "transaction", "retention", "recovery"]>>>;
|
|
243
|
+
readonly industry: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["saas", "ecommerce", "developer-tools", "newsletters-media"]>>>;
|
|
244
|
+
readonly season: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["evergreen", "seasonal"]>>>;
|
|
245
|
+
readonly audience: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["product-users", "customers", "members", "readers", "shoppers", "teams"]>>>;
|
|
246
|
+
readonly design: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["minimal", "branded", "editorial", "data-heavy", "single-cta"]>>>;
|
|
247
|
+
readonly brandProvenance: Schema.optionalKey<Schema.$Array<Schema.Literals<readonly ["samva-original", "third-party-reference"]>>>;
|
|
248
|
+
}>;
|
|
249
|
+
interface TemplateFacetQuery extends Schema.Schema.Type<typeof TemplateFacetQuery> {}
|
|
250
|
+
/** Strict intersection: every selected value in every selected dimension must match. */
|
|
251
|
+
declare const matchesTemplateFacets: (facets: TemplateFacetSet, query: TemplateFacetQuery) => boolean;
|
|
252
|
+
//#endregion
|
|
253
|
+
export { PublicCorpusRegistrationIssue as a, TemplateFacetQuery as c, matchesTemplateFacets as d, ownedPresetSourcePath as f, templateFacetOptions as h, PublicCorpusRegistration as i, TemplateFacetSet as l, registerPublicCorpusEntry as m, InspirationReference as n, TemplateCorpusKind as o, ownedShowcasePresetSources as p, OwnedEditablePreset as r, TemplateCorpusRecord as s, BrandRecreationPreset as t, brandRecreationProvenance as u };
|
|
254
|
+
//# sourceMappingURL=corpus-qrUD5O6r.d.ts.map
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import "./source-locations-BCJQnIfU.js";
|
|
2
|
+
import { r as EmailDiagnostic } from "./diagnostics-Djd9ckLg.js";
|
|
3
|
+
import { m as EmailNode } from "./elements-DtwKlFVH.js";
|
|
4
|
+
import "css-tree";
|
|
5
|
+
//#region src/email/selectors.d.ts
|
|
6
|
+
type EmailElementNode = Extract<EmailNode, {
|
|
7
|
+
_tag: "Element";
|
|
8
|
+
}>;
|
|
9
|
+
interface AttributeTest {
|
|
10
|
+
readonly name: string;
|
|
11
|
+
readonly operator?: string | undefined;
|
|
12
|
+
readonly value?: string | undefined;
|
|
13
|
+
}
|
|
14
|
+
interface Compound {
|
|
15
|
+
readonly tag?: string | undefined;
|
|
16
|
+
readonly id?: string | undefined;
|
|
17
|
+
readonly classes: readonly string[];
|
|
18
|
+
readonly attributes: readonly AttributeTest[];
|
|
19
|
+
/** A compound the matcher cannot evaluate — a pseudo-class, say — never matches. */
|
|
20
|
+
readonly opaque: boolean;
|
|
21
|
+
}
|
|
22
|
+
type Combinator = "descendant" | "child" | "adjacent" | "sibling";
|
|
23
|
+
interface CompiledSelector {
|
|
24
|
+
/** Document order, left to right; each part names the combinator that follows it. */
|
|
25
|
+
readonly parts: readonly {
|
|
26
|
+
readonly compound: Compound;
|
|
27
|
+
readonly after?: Combinator;
|
|
28
|
+
}[];
|
|
29
|
+
}
|
|
30
|
+
/** An element together with the ancestors and preceding siblings a combinator needs. */
|
|
31
|
+
interface Ancestry {
|
|
32
|
+
readonly element: EmailElementNode;
|
|
33
|
+
readonly parent: Ancestry | undefined;
|
|
34
|
+
readonly previous: readonly EmailElementNode[];
|
|
35
|
+
}
|
|
36
|
+
declare const classListOf: (element: EmailElementNode) => readonly string[];
|
|
37
|
+
/** Match a compiled selector against one element in its tree position. */
|
|
38
|
+
declare const matchesSelector: (selector: CompiledSelector | undefined, ancestry: Ancestry) => boolean;
|
|
39
|
+
//#endregion
|
|
40
|
+
//#region src/email/css.d.ts
|
|
41
|
+
interface CssDeclaration {
|
|
42
|
+
/** Kebab-case property name, as authored. */
|
|
43
|
+
readonly property: string;
|
|
44
|
+
readonly value: string;
|
|
45
|
+
readonly important: boolean;
|
|
46
|
+
}
|
|
47
|
+
/** Specificity as the CSS triple (id, class/attribute/pseudo-class, type). */
|
|
48
|
+
type Specificity = readonly [number, number, number];
|
|
49
|
+
interface CssRule {
|
|
50
|
+
/** Exactly one selector; a selector list is split into one rule each. */
|
|
51
|
+
readonly selector: string;
|
|
52
|
+
/** Decoded class identifiers mentioned by this selector, including nested pseudo selectors. */
|
|
53
|
+
readonly classes: readonly string[];
|
|
54
|
+
readonly specificity: Specificity;
|
|
55
|
+
readonly declarations: readonly CssDeclaration[];
|
|
56
|
+
/** Position across every stylesheet, in the order they were imported. */
|
|
57
|
+
readonly order: number;
|
|
58
|
+
/** Declared `@layer` index; unlayered declarations sort above every layer. */
|
|
59
|
+
readonly layer: number;
|
|
60
|
+
/** Enclosing conditional at-rule preludes, outermost first. */
|
|
61
|
+
readonly conditions: readonly string[];
|
|
62
|
+
/** Unconditional and pseudo-free rules are the only ones that can become an inline style. */
|
|
63
|
+
readonly inlinable: boolean;
|
|
64
|
+
/** Compiled at build time so the render lane needs no CSS parser. */
|
|
65
|
+
readonly matcher: CompiledSelector | undefined;
|
|
66
|
+
}
|
|
67
|
+
interface Stylesheet {
|
|
68
|
+
readonly rules: readonly CssRule[];
|
|
69
|
+
/** `@font-face` and other at-rules kept verbatim in `<head>`. */
|
|
70
|
+
readonly headAtRules: readonly string[];
|
|
71
|
+
/** Unconditional custom properties, for resolving `var()` before inlining. */
|
|
72
|
+
readonly variables: Readonly<Record<string, string>>;
|
|
73
|
+
readonly diagnostics: readonly EmailDiagnostic[];
|
|
74
|
+
}
|
|
75
|
+
/** Compile a selector into the plain-data matcher the render lane uses. */
|
|
76
|
+
declare const compileSelector: (selector: string) => CompiledSelector | undefined;
|
|
77
|
+
/** Parse one stylesheet into rules, keeping layer, order and conditions. */
|
|
78
|
+
declare const parseStylesheet: (source: string, options?: {
|
|
79
|
+
readonly origin?: string;
|
|
80
|
+
readonly startOrder?: number;
|
|
81
|
+
}) => Stylesheet;
|
|
82
|
+
//#endregion
|
|
83
|
+
export { compileSelector as a, CompiledSelector as c, matchesSelector as d, Stylesheet as i, Compound as l, CssRule as n, parseStylesheet as o, Specificity as r, Ancestry as s, CssDeclaration as t, classListOf as u };
|
|
84
|
+
//# sourceMappingURL=css-ar2lU3NC.d.ts.map
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { Schema } from "effect";
|
|
2
|
+
//#region src/email/diagnostics.d.ts
|
|
3
|
+
declare const EmailDiagnosticSeverity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
4
|
+
type EmailDiagnosticSeverity = typeof EmailDiagnosticSeverity.Type;
|
|
5
|
+
/** What the emitted document establishes beyond the client feature matrix. */
|
|
6
|
+
declare const EmailCompatibilityAssessment: Schema.Struct<{
|
|
7
|
+
readonly assessment: Schema.Literals<readonly ["risk", "degradation", "unverified", "not-applicable"]>;
|
|
8
|
+
/** A short description of the consequence or the remaining verification. */
|
|
9
|
+
readonly title: Schema.String;
|
|
10
|
+
}>;
|
|
11
|
+
type EmailCompatibilityAssessment = typeof EmailCompatibilityAssessment.Type;
|
|
12
|
+
declare const EmailDiagnostic: Schema.Struct<{
|
|
13
|
+
/** Stable identifier, e.g. `unsupported-element` or `caniemail/css-border-radius`. */
|
|
14
|
+
readonly code: Schema.String;
|
|
15
|
+
readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
16
|
+
/** States what is wrong and what to write instead. */
|
|
17
|
+
readonly message: Schema.String;
|
|
18
|
+
/** Innermost authoring element first, then each enclosing component call site. */
|
|
19
|
+
readonly origins: Schema.$Array<Schema.Struct<{
|
|
20
|
+
readonly fileName: Schema.String;
|
|
21
|
+
readonly lineNumber: Schema.Int;
|
|
22
|
+
readonly columnNumber: Schema.Int;
|
|
23
|
+
}>>;
|
|
24
|
+
/** Target clients a compatibility finding applies to. */
|
|
25
|
+
readonly clients: Schema.optional<Schema.$Array<Schema.String>>;
|
|
26
|
+
/** Partial-support notes and other caveats a client matrix carries. */
|
|
27
|
+
readonly notes: Schema.optional<Schema.String>;
|
|
28
|
+
/** Which pinned rule data produced the finding. */
|
|
29
|
+
readonly provenance: Schema.optional<Schema.String>;
|
|
30
|
+
/** Declared fixtures whose rendered output produced this finding. */
|
|
31
|
+
readonly fixtures: Schema.optional<Schema.$Array<Schema.String>>;
|
|
32
|
+
/** Source chains for every located emitted occurrence; origins identifies the first. */
|
|
33
|
+
readonly occurrences: Schema.optional<Schema.$Array<Schema.$Array<Schema.Struct<{
|
|
34
|
+
readonly fileName: Schema.String;
|
|
35
|
+
readonly lineNumber: Schema.Int;
|
|
36
|
+
readonly columnNumber: Schema.Int;
|
|
37
|
+
}>>>>;
|
|
38
|
+
/** Compatibility observations are not automatically defects or proof of client rendering. */
|
|
39
|
+
readonly compatibility: Schema.optional<Schema.Struct<{
|
|
40
|
+
readonly assessment: Schema.Literals<readonly ["risk", "degradation", "unverified", "not-applicable"]>;
|
|
41
|
+
/** A short description of the consequence or the remaining verification. */
|
|
42
|
+
readonly title: Schema.String;
|
|
43
|
+
}>>;
|
|
44
|
+
}>;
|
|
45
|
+
interface EmailDiagnostic extends Schema.Schema.Type<typeof EmailDiagnostic> {}
|
|
46
|
+
declare const EmailCompileError_base: Schema.Class<EmailCompileError, Schema.TaggedStruct<"EmailCompileError", {
|
|
47
|
+
readonly diagnostics: Schema.$Array<Schema.Struct<{
|
|
48
|
+
/** Stable identifier, e.g. `unsupported-element` or `caniemail/css-border-radius`. */
|
|
49
|
+
readonly code: Schema.String;
|
|
50
|
+
readonly severity: Schema.Literals<readonly ["error", "warning", "info"]>;
|
|
51
|
+
/** States what is wrong and what to write instead. */
|
|
52
|
+
readonly message: Schema.String;
|
|
53
|
+
/** Innermost authoring element first, then each enclosing component call site. */
|
|
54
|
+
readonly origins: Schema.$Array<Schema.Struct<{
|
|
55
|
+
readonly fileName: Schema.String;
|
|
56
|
+
readonly lineNumber: Schema.Int;
|
|
57
|
+
readonly columnNumber: Schema.Int;
|
|
58
|
+
}>>;
|
|
59
|
+
/** Target clients a compatibility finding applies to. */
|
|
60
|
+
readonly clients: Schema.optional<Schema.$Array<Schema.String>>;
|
|
61
|
+
/** Partial-support notes and other caveats a client matrix carries. */
|
|
62
|
+
readonly notes: Schema.optional<Schema.String>;
|
|
63
|
+
/** Which pinned rule data produced the finding. */
|
|
64
|
+
readonly provenance: Schema.optional<Schema.String>;
|
|
65
|
+
/** Declared fixtures whose rendered output produced this finding. */
|
|
66
|
+
readonly fixtures: Schema.optional<Schema.$Array<Schema.String>>;
|
|
67
|
+
/** Source chains for every located emitted occurrence; origins identifies the first. */
|
|
68
|
+
readonly occurrences: Schema.optional<Schema.$Array<Schema.$Array<Schema.Struct<{
|
|
69
|
+
readonly fileName: Schema.String;
|
|
70
|
+
readonly lineNumber: Schema.Int;
|
|
71
|
+
readonly columnNumber: Schema.Int;
|
|
72
|
+
}>>>>;
|
|
73
|
+
/** Compatibility observations are not automatically defects or proof of client rendering. */
|
|
74
|
+
readonly compatibility: Schema.optional<Schema.Struct<{
|
|
75
|
+
readonly assessment: Schema.Literals<readonly ["risk", "degradation", "unverified", "not-applicable"]>;
|
|
76
|
+
/** A short description of the consequence or the remaining verification. */
|
|
77
|
+
readonly title: Schema.String;
|
|
78
|
+
}>>;
|
|
79
|
+
}>>;
|
|
80
|
+
}>, import("effect/Cause").YieldableError>;
|
|
81
|
+
declare class EmailCompileError extends EmailCompileError_base {
|
|
82
|
+
get message(): string;
|
|
83
|
+
}
|
|
84
|
+
/** `emails/welcome.tsx:12:3 unsupported-element: …` — the shape agents iterate on. */
|
|
85
|
+
declare const formatEmailDiagnostic: (diagnostic: EmailDiagnostic) => string;
|
|
86
|
+
/** True when a set of findings must stop the compile or refuse a publication. */
|
|
87
|
+
declare const hasBlockingDiagnostic: (diagnostics: readonly EmailDiagnostic[]) => boolean;
|
|
88
|
+
//#endregion
|
|
89
|
+
export { formatEmailDiagnostic as a, EmailDiagnosticSeverity as i, EmailCompileError as n, hasBlockingDiagnostic as o, EmailDiagnostic as r, EmailCompatibilityAssessment as t };
|
|
90
|
+
//# sourceMappingURL=diagnostics-Djd9ckLg.d.ts.map
|
package/dist/diagnostics.js
CHANGED
|
@@ -34,7 +34,10 @@ var SmlCompileError = class extends Schema.TaggedError()("SmlCompileError", { di
|
|
|
34
34
|
/** Newline-offset line map. Build once per source, query with `lineColumn`. */
|
|
35
35
|
const buildLineMap = (source) => {
|
|
36
36
|
const lineStarts = [0];
|
|
37
|
-
for (let index = 0; index < source.length; index++)
|
|
37
|
+
for (let index = 0; index < source.length; index++) {
|
|
38
|
+
const code = source.charCodeAt(index);
|
|
39
|
+
if (code === 10 || code === 13 && source.charCodeAt(index + 1) !== 10 || code === 8232 || code === 8233) lineStarts.push(index + 1);
|
|
40
|
+
}
|
|
38
41
|
return lineStarts;
|
|
39
42
|
};
|
|
40
43
|
/** 1-based line/column for an absolute offset, via binary search. */
|