@thorprovider/storefront 0.4.0 → 0.6.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/README.md +3 -1
- package/assets/templates/app/app/[[...slug]]/page.tsx +19 -1
- package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +20 -30
- package/assets/templates/app/lib/__STOREFRONT__/composition.ts +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/registry.tsx +15 -13
- package/assets/templates/app/lib/__STOREFRONT__/schema.ts +34 -4
- package/assets/templates/app/lib/__STOREFRONT__/shell/props.ts +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +14 -15
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/testimonials.tsx +26 -19
- package/assets/templates/features/checkout/state.ts +0 -5
- package/assets/templates/views/account/content.ts +14 -3
- package/assets/templates/views/account/index.tsx +1 -1
- package/assets/templates/views/account/registry.tsx +135 -104
- package/assets/templates/views/account/schema.ts +26 -6
- package/assets/templates/views/category/assembly/assembly.json +1 -1
- package/assets/templates/views/category/assembly/index.skeleton.tsx +11 -7
- package/assets/templates/views/category/assembly/registry.skeleton.tsx +8 -8
- package/assets/templates/views/category/assembly/slots/filter/CategoryListing/catalog.part +5 -0
- package/assets/templates/views/category/assembly/slots/filter/{CategoryFilter2 → CategoryListing}/element.part +5 -3
- package/assets/templates/views/category/assembly/slots/filter/{CategoryFilter2 → CategoryListing}/registry.part +9 -5
- package/assets/templates/views/category/content.ts +2 -1
- package/assets/templates/views/category/index.tsx +19 -13
- package/assets/templates/views/category/props.ts +1 -1
- package/assets/templates/views/category/registry.tsx +17 -13
- package/assets/templates/views/category/schema.ts +48 -21
- package/assets/templates/views/checkout/content.ts +60 -0
- package/assets/templates/views/checkout/props.ts +4 -5
- package/assets/templates/views/checkout/registry.tsx +10 -6
- package/assets/templates/views/checkout/schema.ts +10 -16
- package/assets/templates/views/home/assembly/index.skeleton.tsx +0 -2
- package/assets/templates/views/home/index.tsx +0 -2
- package/assets/templates/views/product/registry.tsx +112 -14
- package/assets/templates/views/product/schema.ts +42 -7
- package/bin/storefront.js +21 -0
- package/examples/merchandising/category-led.json +1 -1
- package/examples/merchandising/collection-led.json +1 -1
- package/package.json +2 -1
- package/recipes/archetypes.json +27 -27
- package/recipes/catalog.json +43 -105
- package/recipes/features.json +2 -2
- package/recipes/recipes.json +10 -16
- package/recipes/sections.json +2 -2
- package/scripts/candidate.mjs +263 -6
- package/scripts/composers.mjs +2 -2
- package/scripts/logical-controls.mjs +4 -4
- package/scripts/operation-registry.mjs +1 -1
- package/scripts/view-assembly.mjs +2 -2
- package/skills/sf-view-gen/assets/recipes/archetypes.json +27 -27
- package/skills/sf-view-gen/assets/recipes/catalog.json +43 -105
- package/skills/sf-view-gen/assets/recipes/features.json +2 -2
- package/skills/sf-view-gen/assets/recipes/recipes.json +10 -16
- package/skills/sf-view-gen/assets/recipes/sections.json +2 -2
- package/skills/sf-view-gen/assets/templates/views/sections/schema.testimonials.ts +21 -11
- package/skills/sf-view-gen/assets/templates/views/sections/testimonials.client.tsx +2 -8
- package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/catalog.part +0 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"$schema": "./catalog.schema.json",
|
|
3
3
|
"catalogVersion": 1,
|
|
4
|
-
"description": "Initial semantic executable catalog (E1 tasks 1.2-1.3), classified by source-shape inspection of the @thorprovider/blocks prop contracts and the view templates. Scope: every slot the curated MVP views (home, product, category, checkout, account) render by default, covering both the selectable archetype slots declared by recipes/archetypes.json and the nested default slots that have no archetype (category.productCard, checkout.confirmation) so no legacy default support is dropped. The account view
|
|
4
|
+
"description": "Initial semantic executable catalog (E1 tasks 1.2-1.3), classified by source-shape inspection of the @thorprovider/blocks prop contracts and the view templates. Scope: every slot the curated MVP views (home, product, category, checkout, account) render by default, covering both the selectable archetype slots declared by recipes/archetypes.json and the nested default slots that have no archetype (category.productCard, checkout.confirmation) so no legacy default support is dropped. The account view declares canonical LoginPage card/social presentations and SignUpPage1; legacy LoginPage1/LoginPage2 names resolve to card/social through legacyAliases, with social remaining held pending verified account lifecycle wiring. A variant is `executable` only when the slot's canonical data shape can feed its block props without a prop bridge and without inventing data; every other non-default variant is `held` with the specific reason. The one non-default structural choice is home.benefits, which selects between the two bounded presentations (`cards`, `split`) of the single canonical `Feature` block (identical item contract, no bridge); the retired numbered names `Feature1`/`Feature2` resolve through the slot's `legacyAliases`. E2 task 6.1 declares the base listing slot category.filter CategoryFilter2 as the single controlled listing (dataShape `CatalogQuery & CatalogResults`, state controlled) with the search/filter controls contributed by the logical mounts category.search / category.filters (no second block). Source-shape compatibility is not end-to-end backend behavior proof: the render is executable, but the category.search.apply / category.filter.apply actions remain held under the capability catalog (owner: storefront-catalog-search-filters, E2) until a real runtime proof. The `capabilities` map declares those operational capabilities with their requirements and verification state; E1 declares the held category.filter.apply action, E2 adds the held category.search.apply action and the held category.price.range capability that gates the category-filters showPrice option; no capability is claimed verified. The home.hero variants of the retired numbered family (StorefrontHero1/2/5/6) resolve through the slot's `legacyAliases` to the single canonical `StorefrontHero`, whose bounded presentation options (`compact`, `showcase`, `editorial`, `promotional`) preserve the four structural identities; the extended editorial/promotional sections render only from host-supplied data and are omitted otherwise. The category.productCard slot's retired numbered family (ProductCard1/2/3/5) and the previous `ProductCard` variant resolve through the slot's `legacyAliases` to the single canonical `ProductGrid` listing, which renders `ProductCard` item cells with bounded presentation options (`classic`, `minimal`, `rich`) that preserve the three structural identities; the rich presentation's wishlist and view-similar affordances are host-owned and optional, evidence (rating, badge, compare-at) renders only from host-supplied data, and the comparison-table variant `ProductCard5` was discarded as a listing controller, not a card presentation.",
|
|
5
5
|
"slots": {
|
|
6
6
|
"home.hero": {
|
|
7
7
|
"default": "StorefrontHero",
|
|
@@ -106,35 +106,25 @@
|
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
"product.reviews": {
|
|
109
|
-
"default": "
|
|
109
|
+
"default": "Reviews",
|
|
110
110
|
"variants": {
|
|
111
|
-
"
|
|
111
|
+
"Reviews": {
|
|
112
112
|
"status": "executable",
|
|
113
113
|
"block": "Reviews",
|
|
114
|
-
"dataShape": "Review[]",
|
|
114
|
+
"dataShape": "Review[] & ReviewSummaryInput",
|
|
115
115
|
"events": [
|
|
116
116
|
"toggleReviewLike",
|
|
117
117
|
"submitReview"
|
|
118
118
|
],
|
|
119
|
-
"state": "
|
|
120
|
-
"requirements": [
|
|
121
|
-
"productReviews"
|
|
122
|
-
]
|
|
123
|
-
},
|
|
124
|
-
"ReviewRating2": {
|
|
125
|
-
"status": "held",
|
|
126
|
-
"reason": "block requires an aggregate averageRating/ratingDistribution and carousel controls the canonical Review[] shape does not supply; no verified prop bridge exists",
|
|
127
|
-
"block": "Reviews",
|
|
128
|
-
"dataShape": "Review[] & RatingSummary",
|
|
129
|
-
"events": [
|
|
130
|
-
"like",
|
|
131
|
-
"comment"
|
|
132
|
-
],
|
|
133
|
-
"state": "uncontrolled",
|
|
119
|
+
"state": "controlled",
|
|
134
120
|
"requirements": [
|
|
135
121
|
"productReviews"
|
|
136
122
|
]
|
|
137
123
|
}
|
|
124
|
+
},
|
|
125
|
+
"legacyAliases": {
|
|
126
|
+
"ReviewRating1": "Reviews",
|
|
127
|
+
"ReviewRating2": "Reviews"
|
|
138
128
|
}
|
|
139
129
|
},
|
|
140
130
|
"product.breadcrumb": {
|
|
@@ -181,11 +171,14 @@
|
|
|
181
171
|
}
|
|
182
172
|
},
|
|
183
173
|
"category.filter": {
|
|
184
|
-
"default": "
|
|
174
|
+
"default": "CategoryListing",
|
|
175
|
+
"legacyAliases": {
|
|
176
|
+
"CategoryFilter2": "CategoryListing"
|
|
177
|
+
},
|
|
185
178
|
"variants": {
|
|
186
|
-
"
|
|
179
|
+
"CategoryListing": {
|
|
187
180
|
"status": "executable",
|
|
188
|
-
"block": "
|
|
181
|
+
"block": "CategoryListing",
|
|
189
182
|
"dataShape": "CatalogQuery & CatalogResults",
|
|
190
183
|
"events": [
|
|
191
184
|
"productClick",
|
|
@@ -205,32 +198,6 @@
|
|
|
205
198
|
"categoryQuery",
|
|
206
199
|
"facetSupport"
|
|
207
200
|
]
|
|
208
|
-
},
|
|
209
|
-
"CategoryFilter1": {
|
|
210
|
-
"status": "held",
|
|
211
|
-
"reason": "block requires categories/priceRanges/sortOptions with counts the canonical CardProduct[] listing does not supply; no verified prop bridge exists",
|
|
212
|
-
"block": "CategoryFilter",
|
|
213
|
-
"dataShape": "CategoryFilter1Filters",
|
|
214
|
-
"events": [
|
|
215
|
-
"filterChange"
|
|
216
|
-
],
|
|
217
|
-
"state": "uncontrolled",
|
|
218
|
-
"requirements": [
|
|
219
|
-
"categoryProducts"
|
|
220
|
-
]
|
|
221
|
-
},
|
|
222
|
-
"CategoryFilter4": {
|
|
223
|
-
"status": "held",
|
|
224
|
-
"reason": "block requires an advanced facets contract (modelTypes/rangeBands/frameSizes/colourways/features) the canonical listing does not supply; no verified prop bridge exists",
|
|
225
|
-
"block": "CategoryFilter",
|
|
226
|
-
"dataShape": "CategoryFilter4Facets",
|
|
227
|
-
"events": [
|
|
228
|
-
"filterChange"
|
|
229
|
-
],
|
|
230
|
-
"state": "uncontrolled",
|
|
231
|
-
"requirements": [
|
|
232
|
-
"categoryProducts"
|
|
233
|
-
]
|
|
234
201
|
}
|
|
235
202
|
}
|
|
236
203
|
},
|
|
@@ -262,45 +229,21 @@
|
|
|
262
229
|
}
|
|
263
230
|
},
|
|
264
231
|
"checkout.checkout": {
|
|
265
|
-
"default": "
|
|
232
|
+
"default": "Checkout",
|
|
233
|
+
"legacyAliases": {
|
|
234
|
+
"CheckoutForm1": "Checkout"
|
|
235
|
+
},
|
|
266
236
|
"variants": {
|
|
267
|
-
"
|
|
237
|
+
"Checkout": {
|
|
268
238
|
"status": "executable",
|
|
269
239
|
"block": "Checkout",
|
|
270
|
-
"dataShape": "
|
|
240
|
+
"dataShape": "CheckoutValues & CheckoutOrderSummary & PaymentMethod[]",
|
|
271
241
|
"events": [
|
|
272
242
|
"retryTotals",
|
|
273
243
|
"selectShippingOption",
|
|
274
244
|
"applyPromo",
|
|
275
|
-
"submit"
|
|
276
|
-
|
|
277
|
-
"state": "controlled",
|
|
278
|
-
"requirements": [
|
|
279
|
-
"checkoutCountries",
|
|
280
|
-
"checkoutPaymentMethods"
|
|
281
|
-
]
|
|
282
|
-
},
|
|
283
|
-
"CheckoutForm2": {
|
|
284
|
-
"status": "held",
|
|
285
|
-
"reason": "unproven checkout variant: E1 keeps only the default CheckoutForm1, whose behavior is unchanged; no verified prop bridge exists",
|
|
286
|
-
"block": "Checkout",
|
|
287
|
-
"dataShape": "CheckoutForm2Data",
|
|
288
|
-
"events": [
|
|
289
|
-
"submit"
|
|
290
|
-
],
|
|
291
|
-
"state": "controlled",
|
|
292
|
-
"requirements": [
|
|
293
|
-
"checkoutCountries",
|
|
294
|
-
"checkoutPaymentMethods"
|
|
295
|
-
]
|
|
296
|
-
},
|
|
297
|
-
"CheckoutForm3": {
|
|
298
|
-
"status": "held",
|
|
299
|
-
"reason": "unproven checkout variant: E1 keeps only the default CheckoutForm1, whose behavior is unchanged; no verified prop bridge exists",
|
|
300
|
-
"block": "Checkout",
|
|
301
|
-
"dataShape": "CheckoutForm3FormData",
|
|
302
|
-
"events": [
|
|
303
|
-
"submit"
|
|
245
|
+
"submit",
|
|
246
|
+
"stepChange"
|
|
304
247
|
],
|
|
305
248
|
"state": "controlled",
|
|
306
249
|
"requirements": [
|
|
@@ -328,12 +271,16 @@
|
|
|
328
271
|
}
|
|
329
272
|
},
|
|
330
273
|
"account.login": {
|
|
331
|
-
"default": "
|
|
274
|
+
"default": "card",
|
|
275
|
+
"legacyAliases": {
|
|
276
|
+
"LoginPage1": "card",
|
|
277
|
+
"LoginPage2": "social"
|
|
278
|
+
},
|
|
332
279
|
"variants": {
|
|
333
|
-
"
|
|
280
|
+
"card": {
|
|
334
281
|
"status": "executable",
|
|
335
|
-
"block": "
|
|
336
|
-
"dataShape": "
|
|
282
|
+
"block": "LoginPage",
|
|
283
|
+
"dataShape": "LoginPageFormData & AccountAuthResult",
|
|
337
284
|
"events": [
|
|
338
285
|
"submit",
|
|
339
286
|
"createAccount"
|
|
@@ -344,11 +291,11 @@
|
|
|
344
291
|
"accountAuthenticated"
|
|
345
292
|
]
|
|
346
293
|
},
|
|
347
|
-
"
|
|
294
|
+
"social": {
|
|
348
295
|
"status": "held",
|
|
349
|
-
"reason": "
|
|
350
|
-
"block": "
|
|
351
|
-
"dataShape": "
|
|
296
|
+
"reason": "The social presentation remains held for the Storefront account slot until social-auth lifecycle wiring is verified.",
|
|
297
|
+
"block": "LoginPage",
|
|
298
|
+
"dataShape": "LoginPageFormData & AccountAuthResult",
|
|
352
299
|
"events": [
|
|
353
300
|
"submit",
|
|
354
301
|
"forgotPassword",
|
|
@@ -382,33 +329,24 @@
|
|
|
382
329
|
}
|
|
383
330
|
},
|
|
384
331
|
"account.orders": {
|
|
385
|
-
"default": "
|
|
332
|
+
"default": "OrderHistory",
|
|
386
333
|
"variants": {
|
|
387
|
-
"
|
|
334
|
+
"OrderHistory": {
|
|
388
335
|
"status": "executable",
|
|
389
|
-
"block": "
|
|
390
|
-
"dataShape": "AccountOrderView[] &
|
|
336
|
+
"block": "OrderHistory",
|
|
337
|
+
"dataShape": "AccountOrderView[] & OrderHistoryLabels",
|
|
391
338
|
"events": [
|
|
392
|
-
"
|
|
339
|
+
"viewOrder"
|
|
393
340
|
],
|
|
394
341
|
"state": "controlled",
|
|
395
342
|
"requirements": [
|
|
396
343
|
"accountCustomer",
|
|
397
344
|
"accountAuthenticated"
|
|
398
345
|
]
|
|
399
|
-
},
|
|
400
|
-
"OrderHistory1": {
|
|
401
|
-
"status": "held",
|
|
402
|
-
"reason": "block models one row per order item (an item-row list), the wrong shape for an order-level history; the canonical order list cannot feed it without inventing an aggregate row",
|
|
403
|
-
"block": "OrderHistory1",
|
|
404
|
-
"dataShape": "OrderHistory1Order[]",
|
|
405
|
-
"events": [],
|
|
406
|
-
"state": "controlled",
|
|
407
|
-
"requirements": [
|
|
408
|
-
"accountCustomer",
|
|
409
|
-
"accountAuthenticated"
|
|
410
|
-
]
|
|
411
346
|
}
|
|
347
|
+
},
|
|
348
|
+
"legacyAliases": {
|
|
349
|
+
"OrderHistory2": "OrderHistory"
|
|
412
350
|
}
|
|
413
351
|
},
|
|
414
352
|
"category.breadcrumb": {
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
{
|
|
79
79
|
"name": "catalog-search",
|
|
80
80
|
"mvp": true,
|
|
81
|
-
"description": "Optional category-listing search control (E2). Installation is presence, not an enabled flag; the config only supplies an optional placeholder. The search input contributes to the single controlled
|
|
81
|
+
"description": "Optional category-listing search control (E2). Installation is presence, not an enabled flag; the config only supplies an optional placeholder. The search input contributes to the single controlled CategoryListing at the category.search logical slot and never adds a block.",
|
|
82
82
|
"views": [],
|
|
83
83
|
"state": [],
|
|
84
84
|
"handlers": [],
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
{
|
|
97
97
|
"name": "category-filters",
|
|
98
98
|
"mvp": true,
|
|
99
|
-
"description": "Optional category-listing filter controls (E2). Installation is presence, not an enabled flag; the config selects which demonstrated basic filters show (filterSet) and whether the price control is shown (showPrice). The controls contribute to the single controlled
|
|
99
|
+
"description": "Optional category-listing filter controls (E2). Installation is presence, not an enabled flag; the config selects which demonstrated basic filters show (filterSet) and whether the price control is shown (showPrice). The controls contribute to the single controlled CategoryListing at the category.filters logical slot and never add a block.",
|
|
100
100
|
"views": [],
|
|
101
101
|
"state": [],
|
|
102
102
|
"handlers": [],
|
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
],
|
|
63
63
|
"defaultVariants": {
|
|
64
64
|
"overview": "ProductOverview",
|
|
65
|
-
"reviews": "
|
|
65
|
+
"reviews": "Reviews",
|
|
66
66
|
"breadcrumb": "Breadcrumb"
|
|
67
67
|
},
|
|
68
68
|
"allowedVariants": {
|
|
@@ -70,8 +70,7 @@
|
|
|
70
70
|
"ProductOverview"
|
|
71
71
|
],
|
|
72
72
|
"reviews": [
|
|
73
|
-
"
|
|
74
|
-
"ReviewRating2"
|
|
73
|
+
"Reviews"
|
|
75
74
|
],
|
|
76
75
|
"breadcrumb": [
|
|
77
76
|
"Breadcrumb"
|
|
@@ -128,15 +127,13 @@
|
|
|
128
127
|
"storeCategories"
|
|
129
128
|
],
|
|
130
129
|
"defaultVariants": {
|
|
131
|
-
"filter": "
|
|
130
|
+
"filter": "CategoryListing",
|
|
132
131
|
"productCard": "ProductGrid",
|
|
133
132
|
"breadcrumb": "Breadcrumb"
|
|
134
133
|
},
|
|
135
134
|
"allowedVariants": {
|
|
136
135
|
"filter": [
|
|
137
|
-
"
|
|
138
|
-
"CategoryFilter2",
|
|
139
|
-
"CategoryFilter4"
|
|
136
|
+
"CategoryListing"
|
|
140
137
|
],
|
|
141
138
|
"productCard": [
|
|
142
139
|
"ProductGrid"
|
|
@@ -171,14 +168,12 @@
|
|
|
171
168
|
"checkoutPaymentMethods"
|
|
172
169
|
],
|
|
173
170
|
"defaultVariants": {
|
|
174
|
-
"checkout": "
|
|
171
|
+
"checkout": "Checkout",
|
|
175
172
|
"confirmation": "CheckoutConfirmation"
|
|
176
173
|
},
|
|
177
174
|
"allowedVariants": {
|
|
178
175
|
"checkout": [
|
|
179
|
-
"
|
|
180
|
-
"CheckoutForm2",
|
|
181
|
-
"CheckoutForm3"
|
|
176
|
+
"Checkout"
|
|
182
177
|
],
|
|
183
178
|
"confirmation": [
|
|
184
179
|
"CheckoutConfirmation"
|
|
@@ -202,20 +197,19 @@
|
|
|
202
197
|
"accountCustomer"
|
|
203
198
|
],
|
|
204
199
|
"defaultVariants": {
|
|
205
|
-
"login": "
|
|
200
|
+
"login": "card",
|
|
206
201
|
"register": "SignUpPage1"
|
|
207
202
|
},
|
|
208
203
|
"allowedVariants": {
|
|
209
204
|
"login": [
|
|
210
|
-
"
|
|
211
|
-
"
|
|
205
|
+
"card",
|
|
206
|
+
"social"
|
|
212
207
|
],
|
|
213
208
|
"register": [
|
|
214
209
|
"SignUpPage1"
|
|
215
210
|
],
|
|
216
211
|
"orders": [
|
|
217
|
-
"
|
|
218
|
-
"OrderHistory2"
|
|
212
|
+
"OrderHistory"
|
|
219
213
|
]
|
|
220
214
|
},
|
|
221
215
|
"optionalSections": [],
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
"name": "testimonials",
|
|
8
8
|
"description": "Customer testimonials or social proof",
|
|
9
9
|
"elementType": "Testimonials",
|
|
10
|
-
"variants": ["
|
|
11
|
-
"defaultVariant": "
|
|
10
|
+
"variants": ["carousel", "bento"],
|
|
11
|
+
"defaultVariant": "carousel",
|
|
12
12
|
"propsHint": "title, badge, items[] (quote, author, role, avatar)",
|
|
13
13
|
"status": "held",
|
|
14
14
|
"reason": "bounded curation: no verified presentation bridge/provenance in the current composition and no verified backend/data source for the MVP"
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// Optional section fragment: testimonials (mirrors recipes/sections.json) — shared contract.
|
|
2
|
-
// Zod mirror of the
|
|
2
|
+
// Zod mirror of the canonical TestimonialSection contract, shared
|
|
3
3
|
// by the server catalog (testimonials.tsx) and the client registry
|
|
4
4
|
// (testimonials.client.tsx).
|
|
5
5
|
|
|
@@ -8,16 +8,26 @@ import { z } from 'zod'
|
|
|
8
8
|
export const testimonialItemSchema = z.object({
|
|
9
9
|
id: z.string(),
|
|
10
10
|
name: z.string(),
|
|
11
|
-
role: z.string(),
|
|
12
|
-
avatar: z.string(),
|
|
13
11
|
content: z.string(),
|
|
14
|
-
|
|
12
|
+
role: z.string().optional(),
|
|
13
|
+
avatar: z.string().optional(),
|
|
14
|
+
rating: z.number().optional(),
|
|
15
15
|
})
|
|
16
16
|
|
|
17
|
-
export const testimonialsPropsSchema = z.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
export const testimonialsPropsSchema = z.discriminatedUnion('presentation', [
|
|
18
|
+
z.object({
|
|
19
|
+
presentation: z.literal('carousel'),
|
|
20
|
+
carouselLabels: z.object({ previous: z.string(), next: z.string(), slide: z.string() }),
|
|
21
|
+
items: z.array(testimonialItemSchema),
|
|
22
|
+
title: z.string().optional(),
|
|
23
|
+
description: z.string().optional(),
|
|
24
|
+
className: z.string().optional(),
|
|
25
|
+
}),
|
|
26
|
+
z.object({
|
|
27
|
+
presentation: z.literal('bento'),
|
|
28
|
+
items: z.array(testimonialItemSchema),
|
|
29
|
+
title: z.string().optional(),
|
|
30
|
+
description: z.string().optional(),
|
|
31
|
+
className: z.string().optional(),
|
|
32
|
+
}),
|
|
33
|
+
])
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// Optional section fragment: testimonials (mirrors recipes/sections.json) — client registry.
|
|
4
4
|
// The matching server-side catalog entry lives in testimonials.tsx.
|
|
5
5
|
|
|
6
|
-
import {
|
|
6
|
+
import { TestimonialSection } from '@thorprovider/blocks'
|
|
7
7
|
import { testimonialsPropsSchema } from './schema.testimonials'
|
|
8
8
|
import type { ViewRegistry } from '../types'
|
|
9
9
|
|
|
@@ -11,13 +11,7 @@ export const registry: ViewRegistry = {
|
|
|
11
11
|
Testimonials: ({ props }) => {
|
|
12
12
|
const parsed = testimonialsPropsSchema.parse(props)
|
|
13
13
|
return (
|
|
14
|
-
<
|
|
15
|
-
title={parsed.title ?? 'Lo que dicen nuestros clientes'}
|
|
16
|
-
items={parsed.items}
|
|
17
|
-
prevLabel={parsed.prevLabel ?? 'Anterior'}
|
|
18
|
-
nextLabel={parsed.nextLabel ?? 'Siguiente'}
|
|
19
|
-
slideAriaLabel={parsed.slideAriaLabel ?? 'Testimonio'}
|
|
20
|
-
/>
|
|
14
|
+
<TestimonialSection {...parsed} />
|
|
21
15
|
)
|
|
22
16
|
},
|
|
23
17
|
}
|