@thorprovider/storefront 0.4.0 → 0.5.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__/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 +3 -8
- 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/registry.tsx +72 -43
- package/assets/templates/views/account/schema.ts +1 -1
- 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/examples/merchandising/category-led.json +1 -1
- package/examples/merchandising/collection-led.json +1 -1
- package/package.json +1 -1
- package/recipes/archetypes.json +14 -18
- package/recipes/catalog.json +27 -70
- package/recipes/features.json +2 -2
- package/recipes/recipes.json +7 -11
- package/recipes/sections.json +2 -2
- 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 +14 -18
- package/skills/sf-view-gen/assets/recipes/catalog.json +27 -70
- package/skills/sf-view-gen/assets/recipes/features.json +2 -2
- package/skills/sf-view-gen/assets/recipes/recipes.json +7 -11
- 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
|
@@ -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": [],
|
|
@@ -128,15 +128,13 @@
|
|
|
128
128
|
"storeCategories"
|
|
129
129
|
],
|
|
130
130
|
"defaultVariants": {
|
|
131
|
-
"filter": "
|
|
131
|
+
"filter": "CategoryListing",
|
|
132
132
|
"productCard": "ProductGrid",
|
|
133
133
|
"breadcrumb": "Breadcrumb"
|
|
134
134
|
},
|
|
135
135
|
"allowedVariants": {
|
|
136
136
|
"filter": [
|
|
137
|
-
"
|
|
138
|
-
"CategoryFilter2",
|
|
139
|
-
"CategoryFilter4"
|
|
137
|
+
"CategoryListing"
|
|
140
138
|
],
|
|
141
139
|
"productCard": [
|
|
142
140
|
"ProductGrid"
|
|
@@ -171,14 +169,12 @@
|
|
|
171
169
|
"checkoutPaymentMethods"
|
|
172
170
|
],
|
|
173
171
|
"defaultVariants": {
|
|
174
|
-
"checkout": "
|
|
172
|
+
"checkout": "Checkout",
|
|
175
173
|
"confirmation": "CheckoutConfirmation"
|
|
176
174
|
},
|
|
177
175
|
"allowedVariants": {
|
|
178
176
|
"checkout": [
|
|
179
|
-
"
|
|
180
|
-
"CheckoutForm2",
|
|
181
|
-
"CheckoutForm3"
|
|
177
|
+
"Checkout"
|
|
182
178
|
],
|
|
183
179
|
"confirmation": [
|
|
184
180
|
"CheckoutConfirmation"
|
|
@@ -202,13 +198,13 @@
|
|
|
202
198
|
"accountCustomer"
|
|
203
199
|
],
|
|
204
200
|
"defaultVariants": {
|
|
205
|
-
"login": "
|
|
201
|
+
"login": "card",
|
|
206
202
|
"register": "SignUpPage1"
|
|
207
203
|
},
|
|
208
204
|
"allowedVariants": {
|
|
209
205
|
"login": [
|
|
210
|
-
"
|
|
211
|
-
"
|
|
206
|
+
"card",
|
|
207
|
+
"social"
|
|
212
208
|
],
|
|
213
209
|
"register": [
|
|
214
210
|
"SignUpPage1"
|
|
@@ -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
|
}
|