@samva/markup 0.1.1 → 0.2.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 +15 -2
- package/dist/{checks-CW0nFj5n.js → checks-DXuERO4B.js} +37 -3
- 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 +301 -0
- package/dist/compiler.js +1389 -0
- package/dist/components.d.ts +4 -4
- package/dist/conditionals.js +1 -1
- package/dist/corpus-Dz5irJ9x.d.ts +161 -0
- package/dist/diagnostics-Djd9ckLg.d.ts +90 -0
- package/dist/diagnostics.js +6 -3
- package/dist/elements-DtwKlFVH.d.ts +820 -0
- package/dist/email/components.d.ts +119 -0
- package/dist/email/components.js +207 -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 +36 -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 +2 -0
- package/dist/email/stylesheets.js +43 -0
- package/dist/email/text.d.ts +7 -0
- package/dist/email/text.js +92 -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-fSxcvlx4.d.ts → jsx-runtime-C5k_Zq0A.d.ts} +4 -4
- 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 +2 -2
- package/dist/{parser-yzjUOGhc.d.ts → parser-CGBS73Gz.d.ts} +12 -3
- package/dist/parser.d.ts +2 -2
- package/dist/parser.js +48 -9
- package/dist/predicate-CvkzT-a2.js +539 -0
- package/dist/{predicate-DTtVtLK7.d.ts → predicate-G2SeSvoN.d.ts} +9 -2
- package/dist/predicate.d.ts +2 -2
- package/dist/predicate.js +2 -417
- package/dist/presets/corpus.d.ts +2 -0
- package/dist/presets/corpus.js +186 -0
- package/dist/presets/public-gallery.d.ts +241 -459
- package/dist/presets/public-gallery.js +305 -5
- package/dist/presets/public-handoff.d.ts +75 -3
- package/dist/presets/public-handoff.js +220 -37
- package/dist/presets/public-preview-artifacts.js +20 -26
- package/dist/presets/public-preview.d.ts +40 -1152
- package/dist/presets/public-preview.js +388 -1152
- package/dist/presets/sources.d.ts +17 -4
- package/dist/presets/sources.js +1212 -43
- package/dist/presets.d.ts +2 -2
- package/dist/printer.d.ts +1 -1
- package/dist/render-Cddsy_XF.js +585 -0
- package/dist/render-template.d.ts +6 -3
- package/dist/render-template.js +4 -2
- 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/stylesheets-oDRAnYA3.d.ts +94 -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/dist/{variables-3NGLpNTB.d.ts → variables-if1VrV34.d.ts} +2 -2
- package/dist/variables.d.ts +1 -1
- package/dist/variables.js +1 -1
- 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 -8
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { 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,10 +14,304 @@ const templateCollectionFamilies = [
|
|
|
12
14
|
"stage",
|
|
13
15
|
"style"
|
|
14
16
|
];
|
|
15
|
-
const
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
const isMadeWithSamvaTemplate = (template) => template.corpus._tag === "OwnedEditablePreset";
|
|
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-digest": {
|
|
75
|
+
sourcePath: "packages/markup/presets/product-digest.tsx",
|
|
76
|
+
reviewedBy: "Samva catalog review",
|
|
77
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
78
|
+
notes: "Reviewed product-digest editable SML, public preview data, and gallery identity."
|
|
79
|
+
},
|
|
80
|
+
newsletter: {
|
|
81
|
+
sourcePath: "packages/markup/presets/newsletter.tsx",
|
|
82
|
+
reviewedBy: "Samva catalog review",
|
|
83
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
84
|
+
notes: "Reviewed newsletter editable SML, public preview data, and gallery identity."
|
|
85
|
+
},
|
|
86
|
+
announcement: {
|
|
87
|
+
sourcePath: "packages/markup/presets/announcement.tsx",
|
|
88
|
+
reviewedBy: "Samva catalog review",
|
|
89
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
90
|
+
notes: "Reviewed announcement editable SML, public preview data, and gallery identity."
|
|
91
|
+
},
|
|
92
|
+
promo: {
|
|
93
|
+
sourcePath: "packages/markup/presets/promo.tsx",
|
|
94
|
+
reviewedBy: "Samva catalog review",
|
|
95
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
96
|
+
notes: "Reviewed promo editable SML, public preview data, and gallery identity."
|
|
97
|
+
},
|
|
98
|
+
"event-invite": {
|
|
99
|
+
sourcePath: "packages/markup/presets/event-invite.tsx",
|
|
100
|
+
reviewedBy: "Samva catalog review",
|
|
101
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
102
|
+
notes: "Reviewed event-invite editable SML, public preview data, and gallery identity."
|
|
103
|
+
},
|
|
104
|
+
"membership-promo": {
|
|
105
|
+
sourcePath: "packages/markup/presets/membership-promo.tsx",
|
|
106
|
+
reviewedBy: "Samva catalog review",
|
|
107
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
108
|
+
notes: "Reviewed membership-promo editable SML, public preview data, and gallery identity."
|
|
109
|
+
},
|
|
110
|
+
"onboarding-step": {
|
|
111
|
+
sourcePath: "packages/markup/presets/onboarding-step.tsx",
|
|
112
|
+
reviewedBy: "Samva catalog review",
|
|
113
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
114
|
+
notes: "Reviewed onboarding-step editable SML, public preview data, and gallery identity."
|
|
115
|
+
},
|
|
116
|
+
"trial-ending": {
|
|
117
|
+
sourcePath: "packages/markup/presets/trial-ending.tsx",
|
|
118
|
+
reviewedBy: "Samva catalog review",
|
|
119
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
120
|
+
notes: "Reviewed trial-ending editable SML, public preview data, and gallery identity."
|
|
121
|
+
},
|
|
122
|
+
"win-back": {
|
|
123
|
+
sourcePath: "packages/markup/presets/win-back.tsx",
|
|
124
|
+
reviewedBy: "Samva catalog review",
|
|
125
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
126
|
+
notes: "Reviewed win-back editable SML, public preview data, and gallery identity."
|
|
127
|
+
},
|
|
128
|
+
"feedback-request": {
|
|
129
|
+
sourcePath: "packages/markup/presets/feedback-request.tsx",
|
|
130
|
+
reviewedBy: "Samva catalog review",
|
|
131
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
132
|
+
notes: "Reviewed feedback-request editable SML, public preview data, and gallery identity."
|
|
133
|
+
},
|
|
134
|
+
"editorial-newsletter": {
|
|
135
|
+
sourcePath: "packages/markup/presets/editorial-newsletter.tsx",
|
|
136
|
+
reviewedBy: "Samva catalog review",
|
|
137
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
138
|
+
notes: "Reviewed editorial-newsletter editable SML, public preview data, and gallery identity."
|
|
139
|
+
},
|
|
140
|
+
"member-referral-offer": {
|
|
141
|
+
sourcePath: "packages/markup/presets/member-referral-offer.tsx",
|
|
142
|
+
reviewedBy: "Samva catalog review",
|
|
143
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
144
|
+
notes: "Reviewed member-referral-offer editable SML, public preview data, and gallery identity."
|
|
145
|
+
},
|
|
146
|
+
"catalog-sale-newsletter": {
|
|
147
|
+
sourcePath: "packages/markup/presets/catalog-sale-newsletter.tsx",
|
|
148
|
+
reviewedBy: "Samva catalog review",
|
|
149
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
150
|
+
notes: "Reviewed catalog-sale-newsletter editable SML, public preview data, and gallery identity."
|
|
151
|
+
},
|
|
152
|
+
"limited-time-savings": {
|
|
153
|
+
sourcePath: "packages/markup/presets/limited-time-savings.tsx",
|
|
154
|
+
reviewedBy: "Samva catalog review",
|
|
155
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
156
|
+
notes: "Reviewed limited-time-savings editable SML, public preview data, and gallery identity."
|
|
157
|
+
},
|
|
158
|
+
"rewards-milestone": {
|
|
159
|
+
sourcePath: "packages/markup/presets/rewards-milestone.tsx",
|
|
160
|
+
reviewedBy: "Samva catalog review",
|
|
161
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
162
|
+
notes: "Reviewed rewards-milestone editable SML, public preview data, and gallery identity."
|
|
163
|
+
},
|
|
164
|
+
"order-delivered": {
|
|
165
|
+
sourcePath: "packages/markup/presets/order-delivered.tsx",
|
|
166
|
+
reviewedBy: "Samva catalog review",
|
|
167
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
168
|
+
notes: "Reviewed order-delivered editable SML, public preview data, and gallery identity."
|
|
169
|
+
},
|
|
170
|
+
"travel-rewards-promo": {
|
|
171
|
+
sourcePath: "packages/markup/presets/travel-rewards-promo.tsx",
|
|
172
|
+
reviewedBy: "Samva catalog review",
|
|
173
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
174
|
+
notes: "Reviewed travel-rewards-promo editable SML, public preview data, and gallery identity."
|
|
175
|
+
},
|
|
176
|
+
"events-roundup": {
|
|
177
|
+
sourcePath: "packages/markup/presets/events-roundup.tsx",
|
|
178
|
+
reviewedBy: "Samva catalog review",
|
|
179
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
180
|
+
notes: "Reviewed events-roundup editable SML, public preview data, and gallery identity."
|
|
181
|
+
},
|
|
182
|
+
"product-onboarding-tour": {
|
|
183
|
+
sourcePath: "packages/markup/presets/product-onboarding-tour.tsx",
|
|
184
|
+
reviewedBy: "Samva catalog review",
|
|
185
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
186
|
+
notes: "Reviewed product-onboarding-tour editable SML, public preview data, and gallery identity."
|
|
187
|
+
},
|
|
188
|
+
"product-updates-roundup": {
|
|
189
|
+
sourcePath: "packages/markup/presets/product-updates-roundup.tsx",
|
|
190
|
+
reviewedBy: "Samva catalog review",
|
|
191
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
192
|
+
notes: "Reviewed product-updates-roundup editable SML, public preview data, and gallery identity."
|
|
193
|
+
},
|
|
194
|
+
"flash-getaway-offer": {
|
|
195
|
+
sourcePath: "packages/markup/presets/flash-getaway-offer.tsx",
|
|
196
|
+
reviewedBy: "Samva catalog review",
|
|
197
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
198
|
+
notes: "Reviewed flash-getaway-offer editable SML, public preview data, and gallery identity."
|
|
199
|
+
},
|
|
200
|
+
"membership-benefits-promo": {
|
|
201
|
+
sourcePath: "packages/markup/presets/membership-benefits-promo.tsx",
|
|
202
|
+
reviewedBy: "Samva catalog review",
|
|
203
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
204
|
+
notes: "Reviewed membership-benefits-promo editable SML, public preview data, and gallery identity."
|
|
205
|
+
},
|
|
206
|
+
"industry-news-digest": {
|
|
207
|
+
sourcePath: "packages/markup/presets/industry-news-digest.tsx",
|
|
208
|
+
reviewedBy: "Samva catalog review",
|
|
209
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
210
|
+
notes: "Reviewed industry-news-digest editable SML, public preview data, and gallery identity."
|
|
211
|
+
},
|
|
212
|
+
"weekly-deals-circular": {
|
|
213
|
+
sourcePath: "packages/markup/presets/weekly-deals-circular.tsx",
|
|
214
|
+
reviewedBy: "Samva catalog review",
|
|
215
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
216
|
+
notes: "Reviewed weekly-deals-circular editable SML, public preview data, and gallery identity."
|
|
217
|
+
},
|
|
218
|
+
"data-sharing-review": {
|
|
219
|
+
sourcePath: "packages/markup/presets/data-sharing-review.tsx",
|
|
220
|
+
reviewedBy: "Samva catalog review",
|
|
221
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
222
|
+
notes: "Reviewed data-sharing-review editable SML, public preview data, and gallery identity."
|
|
223
|
+
},
|
|
224
|
+
"seasonal-sale-flyer": {
|
|
225
|
+
sourcePath: "packages/markup/presets/seasonal-sale-flyer.tsx",
|
|
226
|
+
reviewedBy: "Samva catalog review",
|
|
227
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
228
|
+
notes: "Reviewed seasonal-sale-flyer editable SML, public preview data, and gallery identity."
|
|
229
|
+
},
|
|
230
|
+
"setup-checklist": {
|
|
231
|
+
sourcePath: "packages/markup/presets/setup-checklist.tsx",
|
|
232
|
+
reviewedBy: "Samva catalog review",
|
|
233
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
234
|
+
notes: "Reviewed setup-checklist editable SML, public preview data, and gallery identity."
|
|
235
|
+
},
|
|
236
|
+
"feature-release-roundup": {
|
|
237
|
+
sourcePath: "packages/markup/presets/feature-release-roundup.tsx",
|
|
238
|
+
reviewedBy: "Samva catalog review",
|
|
239
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
240
|
+
notes: "Reviewed feature-release-roundup editable SML, public preview data, and gallery identity."
|
|
241
|
+
},
|
|
242
|
+
"season-clearance-promo": {
|
|
243
|
+
sourcePath: "packages/markup/presets/season-clearance-promo.tsx",
|
|
244
|
+
reviewedBy: "Samva catalog review",
|
|
245
|
+
reviewedAt: "2026-08-31T00:00:00.000Z",
|
|
246
|
+
notes: "Reviewed season-clearance-promo editable SML, public preview data, and gallery identity."
|
|
247
|
+
}
|
|
248
|
+
};
|
|
249
|
+
const audienceFor = (useCase) => {
|
|
250
|
+
switch (useCase) {
|
|
251
|
+
case "account-access": return ["product-users"];
|
|
252
|
+
case "commerce": return ["customers", "shoppers"];
|
|
253
|
+
case "lifecycle": return ["product-users", "customers"];
|
|
254
|
+
case "product-communication": return ["product-users", "teams"];
|
|
255
|
+
case "publishing-campaigns": return [
|
|
256
|
+
"customers",
|
|
257
|
+
"members",
|
|
258
|
+
"readers"
|
|
259
|
+
];
|
|
260
|
+
}
|
|
261
|
+
};
|
|
262
|
+
const facetValues = (collections, prefix) => collections.filter((id) => id.startsWith(`${prefix}:`)).map((id) => id.slice(prefix.length + 1));
|
|
263
|
+
const template = (value) => {
|
|
264
|
+
const review = ownedPresetReviewManifest[value.presetId];
|
|
265
|
+
const corpus = {
|
|
266
|
+
_tag: "OwnedEditablePreset",
|
|
267
|
+
corpusKind: "owned-editable-sml",
|
|
268
|
+
provenance: {
|
|
269
|
+
owner: "Samva",
|
|
270
|
+
sourcePath: review.sourcePath,
|
|
271
|
+
recordedAt: review.reviewedAt
|
|
272
|
+
},
|
|
273
|
+
review: {
|
|
274
|
+
state: "approved",
|
|
275
|
+
reviewedBy: review.reviewedBy,
|
|
276
|
+
reviewedAt: review.reviewedAt,
|
|
277
|
+
notes: review.notes
|
|
278
|
+
},
|
|
279
|
+
display: {
|
|
280
|
+
state: "public",
|
|
281
|
+
attributionLabel: "Made with Samva"
|
|
282
|
+
},
|
|
283
|
+
retention: {
|
|
284
|
+
policy: "retain-until-withdrawn",
|
|
285
|
+
reviewedAt: review.reviewedAt
|
|
286
|
+
},
|
|
287
|
+
takedown: {
|
|
288
|
+
state: "active",
|
|
289
|
+
contact: "legal@samva.dev",
|
|
290
|
+
procedureUrl: "https://samva.dev/contact?subject=Template%20takedown"
|
|
291
|
+
}
|
|
292
|
+
};
|
|
293
|
+
const facets = {
|
|
294
|
+
jobType: [value.useCase],
|
|
295
|
+
lifecycle: facetValues(value.collections, "stage"),
|
|
296
|
+
industry: facetValues(value.collections, "industry"),
|
|
297
|
+
season: value.presetId === "seasonal-sale-flyer" || value.presetId === "season-clearance-promo" ? ["seasonal"] : ["evergreen"],
|
|
298
|
+
audience: audienceFor(value.useCase),
|
|
299
|
+
design: facetValues(value.collections, "style"),
|
|
300
|
+
brandProvenance: ["samva-original"]
|
|
301
|
+
};
|
|
302
|
+
const registration = registerPublicCorpusEntry({
|
|
303
|
+
id: value.presetId,
|
|
304
|
+
corpus,
|
|
305
|
+
facets
|
|
306
|
+
});
|
|
307
|
+
if (Result.isFailure(registration)) throw new Error(`${registration.failure.id}: ${registration.failure.message}`);
|
|
308
|
+
return {
|
|
309
|
+
...value,
|
|
310
|
+
path: `/templates/${value.slug}`,
|
|
311
|
+
corpus,
|
|
312
|
+
facets: registration.success.facets
|
|
313
|
+
};
|
|
314
|
+
};
|
|
19
315
|
const publicTemplates = [
|
|
20
316
|
template({
|
|
21
317
|
presetId: "welcome",
|
|
@@ -518,6 +814,10 @@ const publicTemplates = [
|
|
|
518
814
|
relatedTemplates: ["promo", "announcement"]
|
|
519
815
|
})
|
|
520
816
|
];
|
|
817
|
+
const publicTemplateIds = publicTemplates.map((item) => item.presetId);
|
|
818
|
+
if (new Set(publicTemplateIds).size !== publicTemplateIds.length) throw new Error("public template registry ids must be unique");
|
|
819
|
+
/** Deterministic strict-intersection search over the canonical public corpus order. */
|
|
820
|
+
const filterPublicTemplatesByFacets = (query) => publicTemplates.filter((item) => matchesTemplateFacets(item.facets, query));
|
|
521
821
|
const members = (id) => publicTemplates.filter((item) => item.collections.some((collectionId) => collectionId === id)).map((item) => item.presetId);
|
|
522
822
|
const collection = (id, relatedCollections = []) => {
|
|
523
823
|
const [family, slug] = id.split(":");
|
|
@@ -558,6 +858,6 @@ const publicTemplateGallery = {
|
|
|
558
858
|
collections: templateCollections
|
|
559
859
|
};
|
|
560
860
|
//#endregion
|
|
561
|
-
export { publicTemplateGallery, publicTemplates, templateCollectionFamilies, templateCollections, templateUseCases };
|
|
861
|
+
export { filterPublicTemplatesByFacets, isMadeWithSamvaTemplate, ownedPresetReviewManifest, publicTemplateGallery, publicTemplates, templateCollectionFamilies, templateCollections, templateUseCases };
|
|
562
862
|
|
|
563
863
|
//# sourceMappingURL=public-gallery.js.map
|
|
@@ -1,9 +1,17 @@
|
|
|
1
|
-
import { d as Channel } from "../ast-
|
|
1
|
+
import { d as Channel } from "../ast-63I-VLQx.js";
|
|
2
2
|
import { PresetCategory } from "../presets.js";
|
|
3
3
|
import { TemplateCollectionId, TemplateUseCase } from "./public-gallery.js";
|
|
4
4
|
import { PublicTemplatePreview } from "./public-preview.js";
|
|
5
5
|
import { Result } from "effect";
|
|
6
6
|
//#region presets/public-handoff.d.ts
|
|
7
|
+
/** Where an approved public artifact came from. */
|
|
8
|
+
interface TemplateReferenceProvenance {
|
|
9
|
+
readonly source: "samva-owned" | "sanitized-synthetic" | "reviewed-public";
|
|
10
|
+
/** Stable identifier in the producing system; never a third-party URL. */
|
|
11
|
+
readonly referenceId: string;
|
|
12
|
+
/** Stable ISO-8601 timestamp supplied by the producer. */
|
|
13
|
+
readonly recordedAt: string;
|
|
14
|
+
}
|
|
7
15
|
interface ApprovedPublicTemplateArtifact {
|
|
8
16
|
readonly approval: {
|
|
9
17
|
readonly state: "draft" | "approved" | "rejected";
|
|
@@ -37,6 +45,21 @@ interface ApprovedPublicTemplateArtifact {
|
|
|
37
45
|
readonly description: string;
|
|
38
46
|
};
|
|
39
47
|
};
|
|
48
|
+
readonly provenance: TemplateReferenceProvenance;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* A destination-neutral template packet. Gallery and agent callers can use
|
|
52
|
+
* this shape without depending on a Lab corpus or a particular import source.
|
|
53
|
+
*/
|
|
54
|
+
interface TemplateReferencePacket {
|
|
55
|
+
readonly version: 1;
|
|
56
|
+
readonly preset: ApprovedPublicTemplateArtifact["preset"];
|
|
57
|
+
readonly gallery: ApprovedPublicTemplateArtifact["gallery"] & {
|
|
58
|
+
readonly path: `/templates/${string}`;
|
|
59
|
+
};
|
|
60
|
+
readonly preview: ApprovedPublicTemplateArtifact["preview"];
|
|
61
|
+
readonly publicMetadata: ApprovedPublicTemplateArtifact["publicMetadata"];
|
|
62
|
+
readonly provenance: TemplateReferenceProvenance;
|
|
40
63
|
}
|
|
41
64
|
interface ValidatedPublicTemplateArtifact {
|
|
42
65
|
readonly preset: Omit<ApprovedPublicTemplateArtifact["preset"], "source">;
|
|
@@ -49,14 +72,63 @@ interface ValidatedPublicTemplateArtifact {
|
|
|
49
72
|
readonly approval: ApprovedPublicTemplateArtifact["approval"] & {
|
|
50
73
|
readonly state: "approved";
|
|
51
74
|
};
|
|
75
|
+
readonly reference: TemplateReferencePacket;
|
|
52
76
|
}
|
|
53
|
-
type PublicHandoffIssueCode = "approval" | "identity" | "duplicate-id" | "duplicate-slug" | "source" | "channel" | "variables" | "sample-data" | "assets" | "public-metadata" | "reference";
|
|
77
|
+
type PublicHandoffIssueCode = "approval" | "identity" | "duplicate-id" | "duplicate-slug" | "source" | "font-token" | "channel" | "variables" | "sample-data" | "assets" | "public-metadata" | "provenance" | "reference";
|
|
54
78
|
interface PublicHandoffIssue {
|
|
55
79
|
readonly artifactId: string;
|
|
56
80
|
readonly code: PublicHandoffIssueCode;
|
|
57
81
|
readonly message: string;
|
|
58
82
|
}
|
|
83
|
+
/** Bound authored source before parsing or mounting it. */
|
|
84
|
+
declare const PUBLIC_TEMPLATE_SOURCE_MAX_CHARACTERS = 512000;
|
|
85
|
+
/** Static syntax inventory; loops, branches and component expansion are not evaluated. */
|
|
86
|
+
interface PublicTemplateAuthoredStructure {
|
|
87
|
+
readonly basis: "authored-jsx";
|
|
88
|
+
readonly nodes: ReadonlyArray<{
|
|
89
|
+
readonly tag: string;
|
|
90
|
+
readonly depth: number;
|
|
91
|
+
readonly childIndex: number;
|
|
92
|
+
}>;
|
|
93
|
+
readonly components: ReadonlyArray<{
|
|
94
|
+
readonly tag: string;
|
|
95
|
+
readonly count: number;
|
|
96
|
+
}>;
|
|
97
|
+
readonly palette: ReadonlyArray<string>;
|
|
98
|
+
}
|
|
99
|
+
/** Only generic element names and literal class colors survive deidentification. */
|
|
100
|
+
declare const publicTemplateAuthoredStructure: (source: string) => PublicTemplateAuthoredStructure | undefined;
|
|
101
|
+
/**
|
|
102
|
+
* Public imports may only refer to the default email Tailwind font-family tokens. A source may
|
|
103
|
+
* still use the supported `font-*` weight utilities; this check deliberately
|
|
104
|
+
* rejects a new family token instead of creating a corpus font-hosting path.
|
|
105
|
+
*/
|
|
106
|
+
declare const unsupportedPublicTemplateFontTokens: (source: string) => ReadonlyArray<string>;
|
|
107
|
+
/**
|
|
108
|
+
* Accept bounded HTTPS URLs, same-origin gallery files under `/templates/assets/`,
|
|
109
|
+
* or the preview's self-contained image data. Live Unsplash, placehold, and
|
|
110
|
+
* assets.example hosts are never safe for public sample data.
|
|
111
|
+
*/
|
|
112
|
+
declare const isSafePublicTemplateAsset: (value: string) => boolean;
|
|
113
|
+
/** Normalizes one approved handoff for gallery and future agent consumers. */
|
|
114
|
+
declare const toTemplateReferencePacket: (artifact: ApprovedPublicTemplateArtifact) => TemplateReferencePacket;
|
|
115
|
+
type TemplateReferenceProjection = {
|
|
116
|
+
readonly kind: "source";
|
|
117
|
+
readonly relativePath: "preset.tsx";
|
|
118
|
+
readonly contents: string;
|
|
119
|
+
} | {
|
|
120
|
+
readonly kind: "catalog" | "gallery" | "preview" | "editorial";
|
|
121
|
+
readonly relativePath: `${"catalog" | "gallery" | "preview" | "editorial"}.json`;
|
|
122
|
+
readonly contents: string;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* Emits the five destination projections as deterministic bytes. The importer
|
|
126
|
+
* owns no checked-in destination files; callers choose an explicit output dir.
|
|
127
|
+
*/
|
|
128
|
+
declare const emitTemplateReferencePacket: (packet: TemplateReferencePacket) => ReadonlyArray<TemplateReferenceProjection>;
|
|
59
129
|
/**
|
|
130
|
+
* Validates metadata and TSX syntax, never executing the template. The Vite importer
|
|
131
|
+
* verifies schema, fixtures and rendered content before writing projections.
|
|
60
132
|
* Validates explicitly supplied, owner-approved artifacts without filesystem,
|
|
61
133
|
* network, persistence, or discovery. Successful output is a projection for
|
|
62
134
|
* the existing preset, public-gallery, preview, and editorial contracts; this
|
|
@@ -64,5 +136,5 @@ interface PublicHandoffIssue {
|
|
|
64
136
|
*/
|
|
65
137
|
declare const validatePublicTemplateHandoff: (artifacts: ReadonlyArray<ApprovedPublicTemplateArtifact>) => Result.Result<ReadonlyArray<ValidatedPublicTemplateArtifact>, ReadonlyArray<PublicHandoffIssue>>;
|
|
66
138
|
//#endregion
|
|
67
|
-
export { ApprovedPublicTemplateArtifact, PublicHandoffIssue, PublicHandoffIssueCode, ValidatedPublicTemplateArtifact, validatePublicTemplateHandoff };
|
|
139
|
+
export { ApprovedPublicTemplateArtifact, PUBLIC_TEMPLATE_SOURCE_MAX_CHARACTERS, PublicHandoffIssue, PublicHandoffIssueCode, PublicTemplateAuthoredStructure, TemplateReferencePacket, TemplateReferenceProjection, TemplateReferenceProvenance, ValidatedPublicTemplateArtifact, emitTemplateReferencePacket, isSafePublicTemplateAsset, publicTemplateAuthoredStructure, toTemplateReferencePacket, unsupportedPublicTemplateFontTokens, validatePublicTemplateHandoff };
|
|
68
140
|
//# sourceMappingURL=public-handoff.d.ts.map
|