@samva/markup 0.1.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +25 -5
- package/README.md +92 -26
- package/dist/{ast-DAhnAvQN.d.ts → ast-63I-VLQx.d.ts} +15 -2
- package/dist/ast.d.ts +2 -2
- package/dist/ast.js +14 -1
- package/dist/{checks-D-zFQt5R.js → checks-DXuERO4B.js} +36 -2
- package/dist/checks.d.ts +8 -1
- package/dist/checks.js +2 -2
- package/dist/compile-sms.d.ts +2 -2
- package/dist/compile-whatsapp.d.ts +2 -2
- package/dist/compile.d.ts +9 -84
- package/dist/compile.js +11 -920
- package/dist/compiler.d.ts +303 -0
- package/dist/compiler.js +1390 -0
- package/dist/components.d.ts +3 -3
- package/dist/corpus-qrUD5O6r.d.ts +254 -0
- package/dist/css-ar2lU3NC.d.ts +84 -0
- package/dist/diagnostics-Djd9ckLg.d.ts +90 -0
- package/dist/diagnostics.js +4 -1
- package/dist/elements-DtwKlFVH.d.ts +820 -0
- package/dist/email/components.d.ts +125 -0
- package/dist/email/components.js +210 -0
- package/dist/email/diagnostics.d.ts +2 -0
- package/dist/email/diagnostics.js +56 -0
- package/dist/email/elements.d.ts +2 -0
- package/dist/email/elements.js +299 -0
- package/dist/email/html.d.ts +42 -0
- package/dist/email/html.js +266 -0
- package/dist/email/jsx-dev-runtime.d.ts +26 -0
- package/dist/email/jsx-dev-runtime.js +12 -0
- package/dist/email/jsx-runtime.d.ts +2 -0
- package/dist/email/jsx-runtime.js +60 -0
- package/dist/email/render.d.ts +43 -0
- package/dist/email/render.js +6 -0
- package/dist/email/selection.d.ts +102 -0
- package/dist/email/selection.js +143 -0
- package/dist/email/source-edit.d.ts +67 -0
- package/dist/email/source-edit.js +185 -0
- package/dist/email/stylesheets.d.ts +15 -0
- package/dist/email/stylesheets.js +45 -0
- package/dist/email/text.d.ts +7 -0
- package/dist/email/text.js +100 -0
- package/dist/emit.d.ts +13 -12
- package/dist/emit.js +63 -63
- package/dist/input-schema-BIfzI63B.d.ts +23 -0
- package/dist/input-schema.d.ts +2 -0
- package/dist/input-schema.js +170 -0
- package/dist/jsx-dev-runtime.d.ts +4 -3
- package/dist/jsx-dev-runtime.js +9 -1
- package/dist/{jsx-runtime-eNIMY87F.d.ts → jsx-runtime-C5k_Zq0A.d.ts} +3 -3
- package/dist/jsx-runtime.d.ts +1 -1
- package/dist/jsx-runtime.js +20 -1
- package/dist/model.d.ts +1 -1
- package/dist/ops.d.ts +1 -1
- package/dist/ops.js +1 -1
- package/dist/{parser-DkQKIjDa.d.ts → parser-CGBS73Gz.d.ts} +2 -2
- package/dist/parser.d.ts +1 -1
- package/dist/presets/category-mapping.d.ts +1 -1
- package/dist/presets/corpus.d.ts +2 -0
- package/dist/presets/corpus.js +247 -0
- package/dist/presets/public-gallery.d.ts +290 -2
- package/dist/presets/public-gallery.js +428 -6
- package/dist/presets/public-handoff.d.ts +164 -2
- package/dist/presets/public-handoff.js +229 -61
- package/dist/presets/public-preview-artifacts.d.ts +2 -2
- package/dist/presets/public-preview-artifacts.js +25 -31
- package/dist/presets/public-preview.d.ts +65 -2
- package/dist/presets/public-preview.js +402 -1152
- package/dist/presets/sources.d.ts +35 -4
- package/dist/presets/sources.js +2328 -43
- package/dist/presets.d.ts +39 -5
- package/dist/presets.js +96 -0
- package/dist/printer.d.ts +1 -1
- package/dist/render-template.d.ts +5 -2
- package/dist/render-template.js +3 -1
- package/dist/render-ykQhtMs_.js +592 -0
- package/dist/source-locations-BCJQnIfU.d.ts +89 -0
- package/dist/source-locations.d.ts +2 -0
- package/dist/source-locations.js +125 -0
- package/dist/template-Dy5yOPyp.d.ts +60 -0
- package/dist/template.d.ts +2 -0
- package/dist/template.js +37 -0
- package/dist/tsx-source-instrumentation.d.ts +23 -0
- package/dist/tsx-source-instrumentation.js +97 -0
- package/dist/tsx-tracer.d.ts +116 -0
- package/dist/tsx-tracer.js +985 -0
- package/generated/sml-agent-contract.json +574 -782
- package/generated/sml-email-agent-contract.json +502 -677
- package/generated/sml-email-language-reference.md +94 -160
- package/generated/sml-language-reference.md +195 -220
- package/package.json +111 -9
- package/dist/public-gallery-D0Zv0pZE.d.ts +0 -611
- package/dist/public-preview-u1Z9aaGq.d.ts +0 -1168
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { brandRecreationProvenance, matchesTemplateFacets, registerPublicCorpusEntry } from "./corpus.js";
|
|
2
|
+
import { Result } from "effect";
|
|
1
3
|
//#region presets/public-gallery.ts
|
|
2
4
|
const templateUseCases = [
|
|
3
5
|
"account-access",
|
|
@@ -12,11 +14,352 @@ const templateCollectionFamilies = [
|
|
|
12
14
|
"stage",
|
|
13
15
|
"style"
|
|
14
16
|
];
|
|
15
|
-
const isMadeWithSamvaTemplate = (template) => template.
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const isMadeWithSamvaTemplate = (template) => template.corpus._tag === "OwnedEditablePreset" || template.corpus._tag === "BrandRecreationPreset";
|
|
18
|
+
/** Explicit evidence for every owned preset reviewed in the 2026-08-31 catalog pass. */
|
|
19
|
+
const ownedPresetReviewManifest = {
|
|
20
|
+
welcome: {
|
|
21
|
+
sourcePath: "packages/markup/presets/welcome.tsx",
|
|
22
|
+
reviewedBy: "Samva catalog review",
|
|
23
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
24
|
+
notes: "Reviewed welcome editable SML, public preview data, and gallery identity."
|
|
25
|
+
},
|
|
26
|
+
"email-verification": {
|
|
27
|
+
sourcePath: "packages/markup/presets/email-verification.tsx",
|
|
28
|
+
reviewedBy: "Samva catalog review",
|
|
29
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
30
|
+
notes: "Reviewed email-verification editable SML, public preview data, and gallery identity."
|
|
31
|
+
},
|
|
32
|
+
otp: {
|
|
33
|
+
sourcePath: "packages/markup/presets/otp.tsx",
|
|
34
|
+
reviewedBy: "Samva catalog review",
|
|
35
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
36
|
+
notes: "Reviewed otp editable SML, public preview data, and gallery identity."
|
|
37
|
+
},
|
|
38
|
+
"password-reset": {
|
|
39
|
+
sourcePath: "packages/markup/presets/password-reset.tsx",
|
|
40
|
+
reviewedBy: "Samva catalog review",
|
|
41
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
42
|
+
notes: "Reviewed password-reset editable SML, public preview data, and gallery identity."
|
|
43
|
+
},
|
|
44
|
+
receipt: {
|
|
45
|
+
sourcePath: "packages/markup/presets/receipt.tsx",
|
|
46
|
+
reviewedBy: "Samva catalog review",
|
|
47
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
48
|
+
notes: "Reviewed receipt editable SML, public preview data, and gallery identity."
|
|
49
|
+
},
|
|
50
|
+
"payment-failed": {
|
|
51
|
+
sourcePath: "packages/markup/presets/payment-failed.tsx",
|
|
52
|
+
reviewedBy: "Samva catalog review",
|
|
53
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
54
|
+
notes: "Reviewed payment-failed editable SML, public preview data, and gallery identity."
|
|
55
|
+
},
|
|
56
|
+
"shipping-update": {
|
|
57
|
+
sourcePath: "packages/markup/presets/shipping-update.tsx",
|
|
58
|
+
reviewedBy: "Samva catalog review",
|
|
59
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
60
|
+
notes: "Reviewed shipping-update editable SML, public preview data, and gallery identity."
|
|
61
|
+
},
|
|
62
|
+
notification: {
|
|
63
|
+
sourcePath: "packages/markup/presets/notification.tsx",
|
|
64
|
+
reviewedBy: "Samva catalog review",
|
|
65
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
66
|
+
notes: "Reviewed notification editable SML, public preview data, and gallery identity."
|
|
67
|
+
},
|
|
68
|
+
"team-invite": {
|
|
69
|
+
sourcePath: "packages/markup/presets/team-invite.tsx",
|
|
70
|
+
reviewedBy: "Samva catalog review",
|
|
71
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
72
|
+
notes: "Reviewed team-invite editable SML, public preview data, and gallery identity."
|
|
73
|
+
},
|
|
74
|
+
"product-newsletter": {
|
|
75
|
+
sourcePath: "examples/email-showcase/emails/product-newsletter.tsx",
|
|
76
|
+
reviewedBy: "Samva catalog review",
|
|
77
|
+
reviewedAt: "2026-09-08T00:00:00.000Z",
|
|
78
|
+
notes: "Reviewed product-newsletter editable SML project, authored assets, public preview data, and gallery identity."
|
|
79
|
+
},
|
|
80
|
+
"product-digest": {
|
|
81
|
+
sourcePath: "packages/markup/presets/product-digest.tsx",
|
|
82
|
+
reviewedBy: "Samva catalog review",
|
|
83
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
84
|
+
notes: "Reviewed product-digest editable SML, public preview data, and gallery identity."
|
|
85
|
+
},
|
|
86
|
+
newsletter: {
|
|
87
|
+
sourcePath: "packages/markup/presets/newsletter.tsx",
|
|
88
|
+
reviewedBy: "Samva catalog review",
|
|
89
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
90
|
+
notes: "Reviewed newsletter editable SML, public preview data, and gallery identity."
|
|
91
|
+
},
|
|
92
|
+
announcement: {
|
|
93
|
+
sourcePath: "packages/markup/presets/announcement.tsx",
|
|
94
|
+
reviewedBy: "Samva catalog review",
|
|
95
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
96
|
+
notes: "Reviewed announcement editable SML, public preview data, and gallery identity."
|
|
97
|
+
},
|
|
98
|
+
promo: {
|
|
99
|
+
sourcePath: "packages/markup/presets/promo.tsx",
|
|
100
|
+
reviewedBy: "Samva catalog review",
|
|
101
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
102
|
+
notes: "Reviewed promo editable SML, public preview data, and gallery identity."
|
|
103
|
+
},
|
|
104
|
+
"event-invite": {
|
|
105
|
+
sourcePath: "packages/markup/presets/event-invite.tsx",
|
|
106
|
+
reviewedBy: "Samva catalog review",
|
|
107
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
108
|
+
notes: "Reviewed event-invite editable SML, public preview data, and gallery identity."
|
|
109
|
+
},
|
|
110
|
+
"membership-promo": {
|
|
111
|
+
sourcePath: "packages/markup/presets/membership-promo.tsx",
|
|
112
|
+
reviewedBy: "Samva catalog review",
|
|
113
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
114
|
+
notes: "Reviewed membership-promo editable SML, public preview data, and gallery identity."
|
|
115
|
+
},
|
|
116
|
+
"onboarding-step": {
|
|
117
|
+
sourcePath: "packages/markup/presets/onboarding-step.tsx",
|
|
118
|
+
reviewedBy: "Samva catalog review",
|
|
119
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
120
|
+
notes: "Reviewed onboarding-step editable SML, public preview data, and gallery identity."
|
|
121
|
+
},
|
|
122
|
+
"trial-ending": {
|
|
123
|
+
sourcePath: "packages/markup/presets/trial-ending.tsx",
|
|
124
|
+
reviewedBy: "Samva catalog review",
|
|
125
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
126
|
+
notes: "Reviewed trial-ending editable SML, public preview data, and gallery identity."
|
|
127
|
+
},
|
|
128
|
+
"win-back": {
|
|
129
|
+
sourcePath: "packages/markup/presets/win-back.tsx",
|
|
130
|
+
reviewedBy: "Samva catalog review",
|
|
131
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
132
|
+
notes: "Reviewed win-back editable SML, public preview data, and gallery identity."
|
|
133
|
+
},
|
|
134
|
+
"feedback-request": {
|
|
135
|
+
sourcePath: "packages/markup/presets/feedback-request.tsx",
|
|
136
|
+
reviewedBy: "Samva catalog review",
|
|
137
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
138
|
+
notes: "Reviewed feedback-request editable SML, public preview data, and gallery identity."
|
|
139
|
+
},
|
|
140
|
+
"editorial-newsletter": {
|
|
141
|
+
sourcePath: "packages/markup/presets/editorial-newsletter.tsx",
|
|
142
|
+
reviewedBy: "Samva catalog review",
|
|
143
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
144
|
+
notes: "Reviewed editorial-newsletter editable SML, public preview data, and gallery identity."
|
|
145
|
+
},
|
|
146
|
+
"member-referral-offer": {
|
|
147
|
+
sourcePath: "packages/markup/presets/member-referral-offer.tsx",
|
|
148
|
+
reviewedBy: "Samva catalog review",
|
|
149
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
150
|
+
notes: "Reviewed member-referral-offer editable SML, public preview data, and gallery identity."
|
|
151
|
+
},
|
|
152
|
+
"catalog-sale-newsletter": {
|
|
153
|
+
sourcePath: "packages/markup/presets/catalog-sale-newsletter.tsx",
|
|
154
|
+
reviewedBy: "Samva catalog review",
|
|
155
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
156
|
+
notes: "Reviewed catalog-sale-newsletter editable SML, public preview data, and gallery identity."
|
|
157
|
+
},
|
|
158
|
+
"limited-time-savings": {
|
|
159
|
+
sourcePath: "packages/markup/presets/limited-time-savings.tsx",
|
|
160
|
+
reviewedBy: "Samva catalog review",
|
|
161
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
162
|
+
notes: "Reviewed limited-time-savings editable SML, public preview data, and gallery identity."
|
|
163
|
+
},
|
|
164
|
+
"rewards-milestone": {
|
|
165
|
+
sourcePath: "packages/markup/presets/rewards-milestone.tsx",
|
|
166
|
+
reviewedBy: "Samva catalog review",
|
|
167
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
168
|
+
notes: "Reviewed rewards-milestone editable SML, public preview data, and gallery identity."
|
|
169
|
+
},
|
|
170
|
+
"order-delivered": {
|
|
171
|
+
sourcePath: "packages/markup/presets/order-delivered.tsx",
|
|
172
|
+
reviewedBy: "Samva catalog review",
|
|
173
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
174
|
+
notes: "Reviewed order-delivered editable SML, public preview data, and gallery identity."
|
|
175
|
+
},
|
|
176
|
+
"order-receipt": {
|
|
177
|
+
sourcePath: "examples/email-showcase/emails/order-receipt.tsx",
|
|
178
|
+
reviewedBy: "Samva catalog review",
|
|
179
|
+
reviewedAt: "2026-09-08T00:00:00.000Z",
|
|
180
|
+
notes: "Reviewed order-receipt editable project with stylesheet and original assets, public preview data, and gallery identity."
|
|
181
|
+
},
|
|
182
|
+
"travel-rewards-promo": {
|
|
183
|
+
sourcePath: "packages/markup/presets/travel-rewards-promo.tsx",
|
|
184
|
+
reviewedBy: "Samva catalog review",
|
|
185
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
186
|
+
notes: "Reviewed travel-rewards-promo editable SML, public preview data, and gallery identity."
|
|
187
|
+
},
|
|
188
|
+
"events-roundup": {
|
|
189
|
+
sourcePath: "packages/markup/presets/events-roundup.tsx",
|
|
190
|
+
reviewedBy: "Samva catalog review",
|
|
191
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
192
|
+
notes: "Reviewed events-roundup editable SML, public preview data, and gallery identity."
|
|
193
|
+
},
|
|
194
|
+
"product-onboarding-tour": {
|
|
195
|
+
sourcePath: "packages/markup/presets/product-onboarding-tour.tsx",
|
|
196
|
+
reviewedBy: "Samva catalog review",
|
|
197
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
198
|
+
notes: "Reviewed product-onboarding-tour editable SML, public preview data, and gallery identity."
|
|
199
|
+
},
|
|
200
|
+
"product-updates-roundup": {
|
|
201
|
+
sourcePath: "packages/markup/presets/product-updates-roundup.tsx",
|
|
202
|
+
reviewedBy: "Samva catalog review",
|
|
203
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
204
|
+
notes: "Reviewed product-updates-roundup editable SML, public preview data, and gallery identity."
|
|
205
|
+
},
|
|
206
|
+
"flash-getaway-offer": {
|
|
207
|
+
sourcePath: "packages/markup/presets/flash-getaway-offer.tsx",
|
|
208
|
+
reviewedBy: "Samva catalog review",
|
|
209
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
210
|
+
notes: "Reviewed flash-getaway-offer editable SML, public preview data, and gallery identity."
|
|
211
|
+
},
|
|
212
|
+
"membership-benefits-promo": {
|
|
213
|
+
sourcePath: "packages/markup/presets/membership-benefits-promo.tsx",
|
|
214
|
+
reviewedBy: "Samva catalog review",
|
|
215
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
216
|
+
notes: "Reviewed membership-benefits-promo editable SML, public preview data, and gallery identity."
|
|
217
|
+
},
|
|
218
|
+
"industry-news-digest": {
|
|
219
|
+
sourcePath: "packages/markup/presets/industry-news-digest.tsx",
|
|
220
|
+
reviewedBy: "Samva catalog review",
|
|
221
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
222
|
+
notes: "Reviewed industry-news-digest editable SML, public preview data, and gallery identity."
|
|
223
|
+
},
|
|
224
|
+
"weekly-deals-circular": {
|
|
225
|
+
sourcePath: "packages/markup/presets/weekly-deals-circular.tsx",
|
|
226
|
+
reviewedBy: "Samva catalog review",
|
|
227
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
228
|
+
notes: "Reviewed weekly-deals-circular editable SML, public preview data, and gallery identity."
|
|
229
|
+
},
|
|
230
|
+
"data-sharing-review": {
|
|
231
|
+
sourcePath: "packages/markup/presets/data-sharing-review.tsx",
|
|
232
|
+
reviewedBy: "Samva catalog review",
|
|
233
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
234
|
+
notes: "Reviewed data-sharing-review editable SML, public preview data, and gallery identity."
|
|
235
|
+
},
|
|
236
|
+
"seasonal-sale-flyer": {
|
|
237
|
+
sourcePath: "packages/markup/presets/seasonal-sale-flyer.tsx",
|
|
238
|
+
reviewedBy: "Samva catalog review",
|
|
239
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
240
|
+
notes: "Reviewed seasonal-sale-flyer editable SML, public preview data, and gallery identity."
|
|
241
|
+
},
|
|
242
|
+
"setup-checklist": {
|
|
243
|
+
sourcePath: "packages/markup/presets/setup-checklist.tsx",
|
|
244
|
+
reviewedBy: "Samva catalog review",
|
|
245
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
246
|
+
notes: "Reviewed setup-checklist editable SML, public preview data, and gallery identity."
|
|
247
|
+
},
|
|
248
|
+
"feature-release-roundup": {
|
|
249
|
+
sourcePath: "packages/markup/presets/feature-release-roundup.tsx",
|
|
250
|
+
reviewedBy: "Samva catalog review",
|
|
251
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
252
|
+
notes: "Reviewed feature-release-roundup editable SML, public preview data, and gallery identity."
|
|
253
|
+
},
|
|
254
|
+
"season-clearance-promo": {
|
|
255
|
+
sourcePath: "packages/markup/presets/season-clearance-promo.tsx",
|
|
256
|
+
reviewedBy: "Samva catalog review",
|
|
257
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
258
|
+
notes: "Reviewed season-clearance-promo editable SML, public preview data, and gallery identity."
|
|
259
|
+
},
|
|
260
|
+
"product-launch-promo": {
|
|
261
|
+
sourcePath: "examples/email-showcase/emails/product-launch-promo.tsx",
|
|
262
|
+
reviewedBy: "Samva catalog review",
|
|
263
|
+
reviewedAt: "2026-09-08T00:00:00.000Z",
|
|
264
|
+
notes: "Reviewed product-launch-promo editable project, original Oakline assets, public preview data, and gallery identity."
|
|
265
|
+
}
|
|
266
|
+
};
|
|
267
|
+
const isBrandRecreationPresetId = (presetId) => Object.hasOwn(brandRecreationProvenance, presetId);
|
|
268
|
+
const audienceFor = (useCase) => {
|
|
269
|
+
switch (useCase) {
|
|
270
|
+
case "account-access": return ["product-users"];
|
|
271
|
+
case "commerce": return ["customers", "shoppers"];
|
|
272
|
+
case "lifecycle": return ["product-users", "customers"];
|
|
273
|
+
case "product-communication": return ["product-users", "teams"];
|
|
274
|
+
case "publishing-campaigns": return [
|
|
275
|
+
"customers",
|
|
276
|
+
"members",
|
|
277
|
+
"readers"
|
|
278
|
+
];
|
|
279
|
+
}
|
|
280
|
+
};
|
|
281
|
+
const facetValues = (collections, prefix) => collections.filter((id) => id.startsWith(`${prefix}:`)).map((id) => id.slice(prefix.length + 1));
|
|
282
|
+
const template = (value) => {
|
|
283
|
+
const corpus = (() => {
|
|
284
|
+
if (isBrandRecreationPresetId(value.presetId)) {
|
|
285
|
+
const provenance = brandRecreationProvenance[value.presetId];
|
|
286
|
+
return {
|
|
287
|
+
_tag: "BrandRecreationPreset",
|
|
288
|
+
corpusKind: "brand-recreation-sml",
|
|
289
|
+
provenance,
|
|
290
|
+
review: {
|
|
291
|
+
state: "approved",
|
|
292
|
+
reviewedBy: "Samva catalog review",
|
|
293
|
+
reviewedAt: provenance.recordedAt,
|
|
294
|
+
notes: provenance.reviewedNote
|
|
295
|
+
},
|
|
296
|
+
display: {
|
|
297
|
+
state: "public",
|
|
298
|
+
attributionLabel: `Recreated with Samva. ${provenance.brand} does not endorse or have an affiliation with this example.`
|
|
299
|
+
},
|
|
300
|
+
retention: {
|
|
301
|
+
policy: "retain-until-withdrawn",
|
|
302
|
+
reviewedAt: provenance.recordedAt
|
|
303
|
+
},
|
|
304
|
+
takedown: {
|
|
305
|
+
state: "active",
|
|
306
|
+
contact: "legal@samva.dev",
|
|
307
|
+
procedureUrl: "https://samva.dev/contact?subject=Template%20takedown"
|
|
308
|
+
}
|
|
309
|
+
};
|
|
310
|
+
}
|
|
311
|
+
const review = ownedPresetReviewManifest[value.presetId];
|
|
312
|
+
return {
|
|
313
|
+
_tag: "OwnedEditablePreset",
|
|
314
|
+
corpusKind: "owned-editable-sml",
|
|
315
|
+
provenance: {
|
|
316
|
+
owner: "Samva",
|
|
317
|
+
sourcePath: review.sourcePath,
|
|
318
|
+
recordedAt: review.reviewedAt
|
|
319
|
+
},
|
|
320
|
+
review: {
|
|
321
|
+
state: "approved",
|
|
322
|
+
reviewedBy: review.reviewedBy,
|
|
323
|
+
reviewedAt: review.reviewedAt,
|
|
324
|
+
notes: review.notes
|
|
325
|
+
},
|
|
326
|
+
display: {
|
|
327
|
+
state: "public",
|
|
328
|
+
attributionLabel: "Made with Samva"
|
|
329
|
+
},
|
|
330
|
+
retention: {
|
|
331
|
+
policy: "retain-until-withdrawn",
|
|
332
|
+
reviewedAt: review.reviewedAt
|
|
333
|
+
},
|
|
334
|
+
takedown: {
|
|
335
|
+
state: "active",
|
|
336
|
+
contact: "legal@samva.dev",
|
|
337
|
+
procedureUrl: "https://samva.dev/contact?subject=Template%20takedown"
|
|
338
|
+
}
|
|
339
|
+
};
|
|
340
|
+
})();
|
|
341
|
+
const facets = {
|
|
342
|
+
jobType: [value.useCase],
|
|
343
|
+
lifecycle: facetValues(value.collections, "stage"),
|
|
344
|
+
industry: facetValues(value.collections, "industry"),
|
|
345
|
+
season: value.presetId === "seasonal-sale-flyer" || value.presetId === "season-clearance-promo" ? ["seasonal"] : ["evergreen"],
|
|
346
|
+
audience: audienceFor(value.useCase),
|
|
347
|
+
design: facetValues(value.collections, "style"),
|
|
348
|
+
brandProvenance: [corpus._tag === "BrandRecreationPreset" ? "third-party-reference" : "samva-original"]
|
|
349
|
+
};
|
|
350
|
+
const registration = registerPublicCorpusEntry({
|
|
351
|
+
id: value.presetId,
|
|
352
|
+
corpus,
|
|
353
|
+
facets
|
|
354
|
+
});
|
|
355
|
+
if (Result.isFailure(registration)) throw new Error(`${registration.failure.id}: ${registration.failure.message}`);
|
|
356
|
+
return {
|
|
357
|
+
...value,
|
|
358
|
+
path: `/templates/${value.slug}`,
|
|
359
|
+
corpus,
|
|
360
|
+
facets: registration.success.facets
|
|
361
|
+
};
|
|
362
|
+
};
|
|
20
363
|
const publicTemplates = [
|
|
21
364
|
template({
|
|
22
365
|
presetId: "welcome",
|
|
@@ -349,6 +692,24 @@ const publicTemplates = [
|
|
|
349
692
|
],
|
|
350
693
|
relatedTemplates: ["shipping-update", "receipt"]
|
|
351
694
|
}),
|
|
695
|
+
template({
|
|
696
|
+
presetId: "order-receipt",
|
|
697
|
+
slug: "order-receipt",
|
|
698
|
+
useCase: "commerce",
|
|
699
|
+
collections: [
|
|
700
|
+
"category:transactional",
|
|
701
|
+
"industry:ecommerce",
|
|
702
|
+
"stage:transaction",
|
|
703
|
+
"style:minimal",
|
|
704
|
+
"style:data-heavy",
|
|
705
|
+
"style:single-cta"
|
|
706
|
+
],
|
|
707
|
+
relatedTemplates: [
|
|
708
|
+
"receipt",
|
|
709
|
+
"order-delivered",
|
|
710
|
+
"shipping-update"
|
|
711
|
+
]
|
|
712
|
+
}),
|
|
352
713
|
template({
|
|
353
714
|
presetId: "travel-rewards-promo",
|
|
354
715
|
slug: "travel-rewards-promo",
|
|
@@ -517,8 +878,69 @@ const publicTemplates = [
|
|
|
517
878
|
"style:single-cta"
|
|
518
879
|
],
|
|
519
880
|
relatedTemplates: ["promo", "announcement"]
|
|
881
|
+
}),
|
|
882
|
+
template({
|
|
883
|
+
presetId: "linear-login-code",
|
|
884
|
+
slug: "linear-login-code",
|
|
885
|
+
useCase: "account-access",
|
|
886
|
+
collections: [
|
|
887
|
+
"category:transactional",
|
|
888
|
+
"industry:saas",
|
|
889
|
+
"industry:developer-tools",
|
|
890
|
+
"stage:activation",
|
|
891
|
+
"style:minimal",
|
|
892
|
+
"style:branded",
|
|
893
|
+
"style:single-cta"
|
|
894
|
+
],
|
|
895
|
+
relatedTemplates: ["otp", "email-verification"]
|
|
896
|
+
}),
|
|
897
|
+
template({
|
|
898
|
+
presetId: "product-newsletter",
|
|
899
|
+
slug: "product-newsletter",
|
|
900
|
+
useCase: "publishing-campaigns",
|
|
901
|
+
collections: [
|
|
902
|
+
"category:digest-editorial",
|
|
903
|
+
"industry:saas",
|
|
904
|
+
"industry:developer-tools",
|
|
905
|
+
"stage:engagement",
|
|
906
|
+
"style:editorial",
|
|
907
|
+
"style:branded"
|
|
908
|
+
],
|
|
909
|
+
relatedTemplates: ["newsletter", "product-digest"]
|
|
910
|
+
}),
|
|
911
|
+
template({
|
|
912
|
+
presetId: "product-launch-promo",
|
|
913
|
+
slug: "product-launch-promotion",
|
|
914
|
+
useCase: "commerce",
|
|
915
|
+
collections: [
|
|
916
|
+
"category:marketing",
|
|
917
|
+
"industry:ecommerce",
|
|
918
|
+
"stage:engagement",
|
|
919
|
+
"style:branded",
|
|
920
|
+
"style:single-cta"
|
|
921
|
+
],
|
|
922
|
+
relatedTemplates: ["promo", "season-clearance-promo"]
|
|
923
|
+
}),
|
|
924
|
+
template({
|
|
925
|
+
presetId: "vercel-invitation",
|
|
926
|
+
slug: "vercel-team-invitation",
|
|
927
|
+
useCase: "product-communication",
|
|
928
|
+
collections: [
|
|
929
|
+
"category:transactional",
|
|
930
|
+
"industry:saas",
|
|
931
|
+
"industry:developer-tools",
|
|
932
|
+
"stage:activation",
|
|
933
|
+
"style:minimal",
|
|
934
|
+
"style:branded",
|
|
935
|
+
"style:single-cta"
|
|
936
|
+
],
|
|
937
|
+
relatedTemplates: ["team-invite", "welcome"]
|
|
520
938
|
})
|
|
521
939
|
];
|
|
940
|
+
const publicTemplateIds = publicTemplates.map((item) => item.presetId);
|
|
941
|
+
if (new Set(publicTemplateIds).size !== publicTemplateIds.length) throw new Error("public template registry ids must be unique");
|
|
942
|
+
/** Deterministic strict-intersection search over the canonical public corpus order. */
|
|
943
|
+
const filterPublicTemplatesByFacets = (query) => publicTemplates.filter((item) => matchesTemplateFacets(item.facets, query));
|
|
522
944
|
const members = (id) => publicTemplates.filter((item) => item.collections.some((collectionId) => collectionId === id)).map((item) => item.presetId);
|
|
523
945
|
const collection = (id, relatedCollections = []) => {
|
|
524
946
|
const [family, slug] = id.split(":");
|
|
@@ -559,6 +981,6 @@ const publicTemplateGallery = {
|
|
|
559
981
|
collections: templateCollections
|
|
560
982
|
};
|
|
561
983
|
//#endregion
|
|
562
|
-
export { isMadeWithSamvaTemplate, publicTemplateGallery, publicTemplates, templateCollectionFamilies, templateCollections, templateUseCases };
|
|
984
|
+
export { filterPublicTemplatesByFacets, isMadeWithSamvaTemplate, ownedPresetReviewManifest, publicTemplateGallery, publicTemplates, templateCollectionFamilies, templateCollections, templateUseCases };
|
|
563
985
|
|
|
564
986
|
//# sourceMappingURL=public-gallery.js.map
|
|
@@ -1,2 +1,164 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import { d as Channel } from "../ast-63I-VLQx.js";
|
|
2
|
+
import { PresetCategory } from "../presets.js";
|
|
3
|
+
import { TemplateCollectionId, TemplateUseCase } from "./public-gallery.js";
|
|
4
|
+
import { PublicTemplatePreview } from "./public-preview.js";
|
|
5
|
+
import { PresetProject } from "./sources.js";
|
|
6
|
+
import { Result } from "effect";
|
|
7
|
+
//#region presets/public-handoff.d.ts
|
|
8
|
+
/** The brand a clean-room recreation names, and what its email does. */
|
|
9
|
+
interface TemplateBrandRecreation {
|
|
10
|
+
readonly brand: string;
|
|
11
|
+
readonly subject: string;
|
|
12
|
+
}
|
|
13
|
+
/** Where an approved public artifact came from. */
|
|
14
|
+
interface TemplateReferenceProvenance {
|
|
15
|
+
readonly source: "samva-owned" | "sanitized-synthetic" | "reviewed-public" | "brand-recreation";
|
|
16
|
+
readonly brandRecreation?: TemplateBrandRecreation;
|
|
17
|
+
/** Stable identifier in the producing system; never a third-party URL. */
|
|
18
|
+
readonly referenceId: string;
|
|
19
|
+
/** Stable ISO-8601 timestamp supplied by the producer. */
|
|
20
|
+
readonly recordedAt: string;
|
|
21
|
+
}
|
|
22
|
+
interface ApprovedPublicTemplateArtifact {
|
|
23
|
+
readonly approval: {
|
|
24
|
+
readonly state: "draft" | "approved" | "rejected";
|
|
25
|
+
readonly approvedBy: string;
|
|
26
|
+
/** Stable ISO-8601 timestamp supplied by the owner. */
|
|
27
|
+
readonly approvedAt: string;
|
|
28
|
+
};
|
|
29
|
+
readonly preset: {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
readonly channel: Channel;
|
|
32
|
+
readonly category: PresetCategory;
|
|
33
|
+
readonly name: string;
|
|
34
|
+
readonly description: string;
|
|
35
|
+
readonly variables: ReadonlyArray<string>;
|
|
36
|
+
readonly source: string;
|
|
37
|
+
readonly project?: PresetProject;
|
|
38
|
+
};
|
|
39
|
+
readonly gallery: {
|
|
40
|
+
readonly slug: string;
|
|
41
|
+
readonly useCase: TemplateUseCase;
|
|
42
|
+
readonly collections: ReadonlyArray<TemplateCollectionId>;
|
|
43
|
+
readonly relatedTemplates: ReadonlyArray<string>;
|
|
44
|
+
};
|
|
45
|
+
readonly preview: PublicTemplatePreview;
|
|
46
|
+
readonly publicMetadata: {
|
|
47
|
+
readonly cardTitle: string;
|
|
48
|
+
readonly cardDescription: string;
|
|
49
|
+
readonly guidance: ReadonlyArray<string>;
|
|
50
|
+
readonly variableDescriptions: Readonly<Record<string, string>>;
|
|
51
|
+
readonly seo: {
|
|
52
|
+
readonly title: string;
|
|
53
|
+
readonly description: string;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
readonly provenance: TemplateReferenceProvenance;
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* A destination-neutral template packet. Gallery and agent callers can use
|
|
60
|
+
* this shape without depending on a Lab corpus or a particular import source.
|
|
61
|
+
*/
|
|
62
|
+
interface TemplateReferencePacket {
|
|
63
|
+
readonly version: 1;
|
|
64
|
+
readonly preset: ApprovedPublicTemplateArtifact["preset"];
|
|
65
|
+
readonly gallery: ApprovedPublicTemplateArtifact["gallery"] & {
|
|
66
|
+
readonly path: `/templates/${string}`;
|
|
67
|
+
};
|
|
68
|
+
readonly preview: ApprovedPublicTemplateArtifact["preview"];
|
|
69
|
+
readonly publicMetadata: ApprovedPublicTemplateArtifact["publicMetadata"];
|
|
70
|
+
readonly provenance: TemplateReferenceProvenance;
|
|
71
|
+
}
|
|
72
|
+
interface ValidatedPublicTemplateArtifact {
|
|
73
|
+
readonly preset: Omit<ApprovedPublicTemplateArtifact["preset"], "source" | "project">;
|
|
74
|
+
readonly source: string;
|
|
75
|
+
readonly project?: PresetProject;
|
|
76
|
+
readonly gallery: ApprovedPublicTemplateArtifact["gallery"] & {
|
|
77
|
+
readonly path: `/templates/${string}`;
|
|
78
|
+
};
|
|
79
|
+
readonly preview: ApprovedPublicTemplateArtifact["preview"];
|
|
80
|
+
readonly publicMetadata: ApprovedPublicTemplateArtifact["publicMetadata"];
|
|
81
|
+
readonly approval: ApprovedPublicTemplateArtifact["approval"] & {
|
|
82
|
+
readonly state: "approved";
|
|
83
|
+
};
|
|
84
|
+
readonly reference: TemplateReferencePacket;
|
|
85
|
+
}
|
|
86
|
+
type PublicHandoffIssueCode = "approval" | "identity" | "duplicate-id" | "duplicate-slug" | "source" | "font-token" | "channel" | "variables" | "sample-data" | "assets" | "public-metadata" | "provenance" | "reference";
|
|
87
|
+
interface PublicHandoffIssue {
|
|
88
|
+
readonly artifactId: string;
|
|
89
|
+
readonly code: PublicHandoffIssueCode;
|
|
90
|
+
readonly message: string;
|
|
91
|
+
}
|
|
92
|
+
/** Bound authored source before parsing or mounting it. */
|
|
93
|
+
declare const PUBLIC_TEMPLATE_SOURCE_MAX_CHARACTERS = 512000;
|
|
94
|
+
/** Bounds apply to decoded bytes, before evaluation or disk emission. */
|
|
95
|
+
declare const PUBLIC_TEMPLATE_PROJECT_MAX_BYTES: number;
|
|
96
|
+
declare const PUBLIC_TEMPLATE_PROJECT_FILE_MAX_BYTES: number;
|
|
97
|
+
declare const PUBLIC_TEMPLATE_PROJECT_MAX_FILES = 64;
|
|
98
|
+
declare const isSafePublicTemplateProjectPath: (path: string) => boolean;
|
|
99
|
+
/** Reject traversal, collisions, malformed base64 and oversized authored projects. */
|
|
100
|
+
declare const isSafePublicTemplateProject: (project: PresetProject) => boolean;
|
|
101
|
+
/** Digest the complete authored graph independently of caller file ordering. */
|
|
102
|
+
declare const publicTemplateProjectDigest: (project: Pick<PresetProject, "entryPath" | "files">) => Promise<string>;
|
|
103
|
+
declare const isValidTemplateBrandRecreation: (brandRecreation: TemplateBrandRecreation | undefined, project: PresetProject | undefined) => boolean;
|
|
104
|
+
/** Static syntax inventory; loops, branches and component expansion are not evaluated. */
|
|
105
|
+
interface PublicTemplateAuthoredStructure {
|
|
106
|
+
readonly basis: "authored-jsx";
|
|
107
|
+
readonly nodes: ReadonlyArray<{
|
|
108
|
+
readonly tag: string;
|
|
109
|
+
readonly depth: number;
|
|
110
|
+
readonly childIndex: number;
|
|
111
|
+
}>;
|
|
112
|
+
readonly components: ReadonlyArray<{
|
|
113
|
+
readonly tag: string;
|
|
114
|
+
readonly count: number;
|
|
115
|
+
}>;
|
|
116
|
+
readonly palette: ReadonlyArray<string>;
|
|
117
|
+
}
|
|
118
|
+
/** Only generic element names and literal class colors survive deidentification. */
|
|
119
|
+
declare const publicTemplateAuthoredStructure: (source: string) => PublicTemplateAuthoredStructure | undefined;
|
|
120
|
+
/**
|
|
121
|
+
* Public imports may only refer to the default email Tailwind font-family tokens. A source may
|
|
122
|
+
* still use the supported `font-*` weight utilities; this check deliberately
|
|
123
|
+
* rejects a new family token instead of creating a corpus font-hosting path.
|
|
124
|
+
*/
|
|
125
|
+
declare const unsupportedPublicTemplateFontTokens: (source: string) => ReadonlyArray<string>;
|
|
126
|
+
/**
|
|
127
|
+
* Accept bounded HTTPS URLs, same-origin gallery files under `/templates/assets/`,
|
|
128
|
+
* or the preview's self-contained image data. Live Unsplash, placehold, and
|
|
129
|
+
* assets.example hosts are never safe for public sample data.
|
|
130
|
+
*/
|
|
131
|
+
declare const isSafePublicTemplateAsset: (value: string) => boolean;
|
|
132
|
+
/** Normalizes one approved handoff for gallery and future agent consumers. */
|
|
133
|
+
declare const toTemplateReferencePacket: (artifact: ApprovedPublicTemplateArtifact) => TemplateReferencePacket;
|
|
134
|
+
type TemplateReferenceProjection = {
|
|
135
|
+
readonly kind: "source";
|
|
136
|
+
readonly relativePath: "preset.tsx";
|
|
137
|
+
readonly contents: string;
|
|
138
|
+
} | {
|
|
139
|
+
readonly kind: "project-file";
|
|
140
|
+
readonly relativePath: `project/${string}`;
|
|
141
|
+
readonly contents: string;
|
|
142
|
+
readonly encoding: "utf8" | "base64";
|
|
143
|
+
} | {
|
|
144
|
+
readonly kind: "catalog" | "gallery" | "preview" | "editorial" | "project";
|
|
145
|
+
readonly relativePath: `${"catalog" | "gallery" | "preview" | "editorial" | "project"}.json`;
|
|
146
|
+
readonly contents: string;
|
|
147
|
+
};
|
|
148
|
+
/**
|
|
149
|
+
* Emits legacy projections plus the complete project as deterministic bytes. The importer
|
|
150
|
+
* owns no checked-in destination files; callers choose an explicit output dir.
|
|
151
|
+
*/
|
|
152
|
+
declare const emitTemplateReferencePacket: (packet: TemplateReferencePacket) => ReadonlyArray<TemplateReferenceProjection>;
|
|
153
|
+
/**
|
|
154
|
+
* Validates metadata and TSX syntax, never executing the template. The Vite importer
|
|
155
|
+
* verifies schema, fixtures and rendered content before writing projections.
|
|
156
|
+
* Validates explicitly supplied, owner-approved artifacts without filesystem,
|
|
157
|
+
* network, persistence, or discovery. Successful output is a projection for
|
|
158
|
+
* the existing preset, public-gallery, preview, and editorial contracts; this
|
|
159
|
+
* function never registers or publishes it.
|
|
160
|
+
*/
|
|
161
|
+
declare const validatePublicTemplateHandoff: (artifacts: ReadonlyArray<ApprovedPublicTemplateArtifact>) => Result.Result<ReadonlyArray<ValidatedPublicTemplateArtifact>, ReadonlyArray<PublicHandoffIssue>>;
|
|
162
|
+
//#endregion
|
|
163
|
+
export { ApprovedPublicTemplateArtifact, PUBLIC_TEMPLATE_PROJECT_FILE_MAX_BYTES, PUBLIC_TEMPLATE_PROJECT_MAX_BYTES, PUBLIC_TEMPLATE_PROJECT_MAX_FILES, PUBLIC_TEMPLATE_SOURCE_MAX_CHARACTERS, PublicHandoffIssue, PublicHandoffIssueCode, PublicTemplateAuthoredStructure, TemplateBrandRecreation, TemplateReferencePacket, TemplateReferenceProjection, TemplateReferenceProvenance, ValidatedPublicTemplateArtifact, emitTemplateReferencePacket, isSafePublicTemplateAsset, isSafePublicTemplateProject, isSafePublicTemplateProjectPath, isValidTemplateBrandRecreation, publicTemplateAuthoredStructure, publicTemplateProjectDigest, toTemplateReferencePacket, unsupportedPublicTemplateFontTokens, validatePublicTemplateHandoff };
|
|
164
|
+
//# sourceMappingURL=public-handoff.d.ts.map
|