@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
|
@@ -8,8 +8,11 @@
|
|
|
8
8
|
|
|
9
9
|
import { Breadcrumb as BreadcrumbBlock } from '@thorprovider/blocks/blocks/e-commerce/navigation/breadcrumb'
|
|
10
10
|
import ProductOverviewBlock from '@thorprovider/blocks/blocks/e-commerce/product-overview/product-overview'
|
|
11
|
-
import
|
|
11
|
+
import ReviewComposerBlock from '@thorprovider/blocks/blocks/e-commerce/reviews/review-composer'
|
|
12
|
+
import ReviewListBlock from '@thorprovider/blocks/blocks/e-commerce/reviews/review-list'
|
|
13
|
+
import ReviewSummaryBlock from '@thorprovider/blocks/blocks/e-commerce/reviews/review-summary'
|
|
12
14
|
import { isAvailableMoney } from '@thorprovider/blocks/contracts'
|
|
15
|
+
import type { ReviewDistribution, ReviewItemData } from '@thorprovider/blocks'
|
|
13
16
|
import { useStateStore } from '@json-render/react'
|
|
14
17
|
import { useProductVisitObservation } from '../../section-observation'
|
|
15
18
|
import type { ViewRegistry } from '../types'
|
|
@@ -88,20 +91,115 @@ export const registry: ViewRegistry = {
|
|
|
88
91
|
},
|
|
89
92
|
Reviews: ({ props, emit }) => {
|
|
90
93
|
const parsed = reviewsPropsSchema.parse(props)
|
|
94
|
+
// The review array is real backend data; the aggregate is derived here, at
|
|
95
|
+
// the host boundary, because the block must never invent one and never
|
|
96
|
+
// derive from review content it renders.
|
|
97
|
+
const reviews: ReviewItemData[] = parsed.reviews.map((review) => ({
|
|
98
|
+
id: review.id,
|
|
99
|
+
author: review.author ?? review.userName ?? '',
|
|
100
|
+
...(review.avatar ?? review.userAvatar
|
|
101
|
+
? { avatar: (review.avatar ?? review.userAvatar) as string }
|
|
102
|
+
: {}),
|
|
103
|
+
date: review.date,
|
|
104
|
+
...(review.dateTime === undefined ? {} : { dateTime: review.dateTime }),
|
|
105
|
+
rating: review.rating,
|
|
106
|
+
content: review.content,
|
|
107
|
+
...(review.helpfulCount ?? review.likes
|
|
108
|
+
? { helpfulCount: (review.helpfulCount ?? review.likes) as number }
|
|
109
|
+
: {}),
|
|
110
|
+
...(review.likedByViewer === undefined ? {} : { likedByViewer: review.likedByViewer }),
|
|
111
|
+
}))
|
|
112
|
+
const summary = parsed.summary ?? deriveReviewSummary(reviews)
|
|
113
|
+
const listLabels = {
|
|
114
|
+
...(parsed.labels ?? {}),
|
|
115
|
+
...(parsed.pageTitle === undefined ? {} : { title: parsed.pageTitle }),
|
|
116
|
+
...(parsed.pageDescription === undefined ? {} : { description: parsed.pageDescription }),
|
|
117
|
+
}
|
|
118
|
+
const composerLabels = parsed.composer?.labels ?? legacyComposerLabels(parsed.form)
|
|
119
|
+
|
|
91
120
|
return (
|
|
92
|
-
<
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
121
|
+
<div className='mx-auto flex w-full max-w-7xl flex-col gap-6 px-4 py-8 sm:px-6 lg:px-8'>
|
|
122
|
+
{summary ? (
|
|
123
|
+
<ReviewSummaryBlock
|
|
124
|
+
averageRating={summary.averageRating}
|
|
125
|
+
totalReviews={summary.totalReviews}
|
|
126
|
+
distribution={summary.distribution}
|
|
127
|
+
/>
|
|
128
|
+
) : null}
|
|
129
|
+
<ReviewListBlock
|
|
130
|
+
reviews={reviews}
|
|
131
|
+
{...(parsed.presentation === undefined ? {} : { presentation: parsed.presentation })}
|
|
132
|
+
labels={listLabels}
|
|
133
|
+
onToggleLike={() => {
|
|
134
|
+
emit('toggleReviewLike')
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
{parsed.composer || parsed.form ? (
|
|
138
|
+
<ReviewComposerBlock
|
|
139
|
+
{...(composerLabels === undefined ? {} : { labels: composerLabels })}
|
|
140
|
+
{...(parsed.composer?.isSubmitting === undefined
|
|
141
|
+
? {}
|
|
142
|
+
: { isSubmitting: parsed.composer.isSubmitting })}
|
|
143
|
+
{...(parsed.composer?.error === undefined ? {} : { error: parsed.composer.error })}
|
|
144
|
+
onSubmit={() => {
|
|
145
|
+
emit('submitReview')
|
|
146
|
+
}}
|
|
147
|
+
/>
|
|
148
|
+
) : null}
|
|
149
|
+
</div>
|
|
105
150
|
)
|
|
106
151
|
},
|
|
107
152
|
}
|
|
153
|
+
|
|
154
|
+
/**
|
|
155
|
+
* Derive the required aggregate from the real review array the product view
|
|
156
|
+
* already holds. This is host-side data ownership, not block behaviour: the
|
|
157
|
+
* summary block never receives `reviews` and never computes an average.
|
|
158
|
+
*/
|
|
159
|
+
export function deriveReviewSummary(
|
|
160
|
+
reviews: ReviewItemData[],
|
|
161
|
+
):
|
|
162
|
+
| { averageRating: number; totalReviews: number; distribution: ReviewDistribution }
|
|
163
|
+
| undefined {
|
|
164
|
+
if (reviews.length === 0) return undefined
|
|
165
|
+
const distribution: ReviewDistribution = { 1: 0, 2: 0, 3: 0, 4: 0, 5: 0 }
|
|
166
|
+
let sum = 0
|
|
167
|
+
for (const review of reviews) {
|
|
168
|
+
const bucket = Math.min(5, Math.max(1, Math.round(review.rating))) as 1 | 2 | 3 | 4 | 5
|
|
169
|
+
distribution[bucket] += 1
|
|
170
|
+
sum += review.rating
|
|
171
|
+
}
|
|
172
|
+
return { averageRating: sum / reviews.length, totalReviews: reviews.length, distribution }
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
/** Map the numbered form copy onto the canonical composer labels. */
|
|
176
|
+
function legacyComposerLabels(
|
|
177
|
+
form:
|
|
178
|
+
| {
|
|
179
|
+
title: string
|
|
180
|
+
description?: string
|
|
181
|
+
nameLabel: string
|
|
182
|
+
emailLabel: string
|
|
183
|
+
reviewLabel: string
|
|
184
|
+
namePlaceholder: string
|
|
185
|
+
emailPlaceholder: string
|
|
186
|
+
reviewPlaceholder: string
|
|
187
|
+
submitButtonText: string
|
|
188
|
+
submittingButtonText: string
|
|
189
|
+
}
|
|
190
|
+
| undefined,
|
|
191
|
+
): Record<string, string> | undefined {
|
|
192
|
+
if (!form) return undefined
|
|
193
|
+
return {
|
|
194
|
+
title: form.title,
|
|
195
|
+
...(form.description === undefined ? {} : { description: form.description }),
|
|
196
|
+
nameLabel: form.nameLabel,
|
|
197
|
+
emailLabel: form.emailLabel,
|
|
198
|
+
reviewLabel: form.reviewLabel,
|
|
199
|
+
namePlaceholder: form.namePlaceholder,
|
|
200
|
+
emailPlaceholder: form.emailPlaceholder,
|
|
201
|
+
reviewPlaceholder: form.reviewPlaceholder,
|
|
202
|
+
submitLabel: form.submitButtonText,
|
|
203
|
+
submittingLabel: form.submittingButtonText,
|
|
204
|
+
}
|
|
205
|
+
}
|
|
@@ -103,21 +103,45 @@ export const productOverviewPropsSchema = z.object({
|
|
|
103
103
|
freeDeliveryLabel: z.string().optional(),
|
|
104
104
|
})
|
|
105
105
|
|
|
106
|
-
// Mirrors
|
|
106
|
+
// Mirrors the canonical review item cell (real reviews only; never seeded).
|
|
107
|
+
// The legacy `userName`/`userAvatar`/`likes`/`comments` keys stay accepted so a
|
|
108
|
+
// user-owned content file authored against the numbered block keeps parsing;
|
|
109
|
+
// the registry maps them onto the canonical fields.
|
|
107
110
|
export const reviewSchema = z.object({
|
|
108
|
-
id: z.number(),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
+
id: z.union([z.string(), z.number()]).transform((value) => String(value)),
|
|
112
|
+
author: z.string().optional(),
|
|
113
|
+
avatar: z.string().optional(),
|
|
111
114
|
date: z.string(),
|
|
115
|
+
dateTime: z.string().optional(),
|
|
112
116
|
rating: z.number(),
|
|
113
117
|
content: z.string(),
|
|
118
|
+
helpfulCount: z.number().optional(),
|
|
119
|
+
likedByViewer: z.boolean().optional(),
|
|
120
|
+
userName: z.string().optional(),
|
|
121
|
+
userAvatar: z.string().optional(),
|
|
114
122
|
likes: z.number().optional(),
|
|
115
123
|
comments: z.number().optional(),
|
|
116
124
|
})
|
|
117
125
|
|
|
126
|
+
// Mirrors the canonical aggregate unit: every value is required, so a summary
|
|
127
|
+
// is rendered only when the host can supply all of it.
|
|
128
|
+
export const reviewSummarySchema = z.object({
|
|
129
|
+
averageRating: z.number(),
|
|
130
|
+
totalReviews: z.number(),
|
|
131
|
+
distribution: z.object({
|
|
132
|
+
1: z.number(),
|
|
133
|
+
2: z.number(),
|
|
134
|
+
3: z.number(),
|
|
135
|
+
4: z.number(),
|
|
136
|
+
5: z.number(),
|
|
137
|
+
}),
|
|
138
|
+
})
|
|
139
|
+
|
|
140
|
+
// Legacy composer copy from the numbered form. Accepted and mapped; new content
|
|
141
|
+
// should author `composer.labels` instead.
|
|
118
142
|
export const reviewFormSchema = z.object({
|
|
119
143
|
title: z.string(),
|
|
120
|
-
description: z.string(),
|
|
144
|
+
description: z.string().optional(),
|
|
121
145
|
nameLabel: z.string(),
|
|
122
146
|
emailLabel: z.string(),
|
|
123
147
|
reviewLabel: z.string(),
|
|
@@ -128,10 +152,21 @@ export const reviewFormSchema = z.object({
|
|
|
128
152
|
submittingButtonText: z.string(),
|
|
129
153
|
})
|
|
130
154
|
|
|
155
|
+
export const reviewComposerSchema = z.object({
|
|
156
|
+
labels: z.record(z.string(), z.string()).optional(),
|
|
157
|
+
isSubmitting: z.boolean().optional(),
|
|
158
|
+
error: z.string().optional(),
|
|
159
|
+
})
|
|
160
|
+
|
|
131
161
|
export const reviewsPropsSchema = z.object({
|
|
132
|
-
pageTitle: z.string(),
|
|
133
|
-
pageDescription: z.string().optional(),
|
|
134
162
|
reviews: z.array(reviewSchema),
|
|
163
|
+
summary: reviewSummarySchema.optional(),
|
|
164
|
+
presentation: z.enum(['list', 'carousel']).optional(),
|
|
165
|
+
labels: z.record(z.string(), z.string()).optional(),
|
|
166
|
+
composer: reviewComposerSchema.optional(),
|
|
167
|
+
// Legacy keys kept for user-owned content compatibility.
|
|
168
|
+
pageTitle: z.string().optional(),
|
|
169
|
+
pageDescription: z.string().optional(),
|
|
135
170
|
form: reviewFormSchema.optional(),
|
|
136
171
|
reviewsPerPage: z.number().optional(),
|
|
137
172
|
})
|
package/bin/storefront.js
CHANGED
|
@@ -57,10 +57,12 @@ import { scaffoldComposition } from '../scripts/starter.mjs'
|
|
|
57
57
|
import {
|
|
58
58
|
buildInstallPlan,
|
|
59
59
|
CANDIDATE_TOOLSET,
|
|
60
|
+
DEFAULT_REGISTRY,
|
|
60
61
|
findPack,
|
|
61
62
|
parseRuntimeCommerceImports,
|
|
62
63
|
verifyPackExports,
|
|
63
64
|
verifyPackManifest,
|
|
65
|
+
verifyRegistryToolset,
|
|
64
66
|
} from '../scripts/candidate.mjs'
|
|
65
67
|
import {
|
|
66
68
|
declaredOperativeSkills,
|
|
@@ -999,6 +1001,25 @@ async function create(args) {
|
|
|
999
1001
|
return 1
|
|
1000
1002
|
}
|
|
1001
1003
|
|
|
1004
|
+
// Registry preflight: the default path installs exact versions from npm, so
|
|
1005
|
+
// every pin must exist and expose the surface the templates import. This runs
|
|
1006
|
+
// after composition/contract validation and before the first mkdir, external
|
|
1007
|
+
// scaffold, or write. `--packs` is a local development path with its own
|
|
1008
|
+
// packed-candidate guards, so it does not contact the registry.
|
|
1009
|
+
if (!args.packs) {
|
|
1010
|
+
const registry = await verifyRegistryToolset({
|
|
1011
|
+
toolset: CANDIDATE_TOOLSET,
|
|
1012
|
+
cliVersion,
|
|
1013
|
+
templatesDir: join(PKG_ROOT, 'assets', 'templates'),
|
|
1014
|
+
registry: process.env.STOREFRONT_REGISTRY_URL || DEFAULT_REGISTRY,
|
|
1015
|
+
})
|
|
1016
|
+
if (!registry.ok) {
|
|
1017
|
+
console.error('Refusing to create: the pinned candidate is not installable from the registry.')
|
|
1018
|
+
for (const err of registry.errors) console.error(` ${err.code}: ${err.message}`)
|
|
1019
|
+
return 1
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
|
|
1002
1023
|
console.log('storefront create — deterministic scaffold')
|
|
1003
1024
|
console.log(` name: ${name}`)
|
|
1004
1025
|
console.log(` site name: ${siteName}`)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thorprovider/storefront",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.6.0",
|
|
4
4
|
"description": "Deterministic storefront scaffolder and installable OpenCode skill suite for Thor Commerce (Next.js, @thorprovider/blocks, @thorprovider/adapters, Medusa)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": "bin/storefront.js",
|
|
@@ -23,6 +23,7 @@
|
|
|
23
23
|
"pretest": "node ./scripts/sync-assets.mjs --check",
|
|
24
24
|
"test": "vitest run --config vitest.config.ts",
|
|
25
25
|
"test:integration": "vitest run --config vitest.config.ts tests/scaffold-integration.test.ts tests/starter-integration.test.ts",
|
|
26
|
+
"test:registry": "RUN_SCAFFOLD_INTEGRATION=1 STOREFRONT_ACCEPTANCE_CLI=registry vitest run --config vitest.config.ts tests/scaffold-integration.test.ts tests/starter-integration.test.ts",
|
|
26
27
|
"test:browser": "node ./tests/support/projection-ownership.browser.mjs"
|
|
27
28
|
},
|
|
28
29
|
"publishConfig": {
|
package/recipes/archetypes.json
CHANGED
|
@@ -79,12 +79,12 @@
|
|
|
79
79
|
"default": "list",
|
|
80
80
|
"intents": {
|
|
81
81
|
"list": {
|
|
82
|
-
"variant": "
|
|
83
|
-
"when": "A
|
|
82
|
+
"variant": "Reviews",
|
|
83
|
+
"when": "A review collection with the required aggregate summary above it and the reviews in a responsive grid (canonical `presentation: 'list'`)."
|
|
84
84
|
},
|
|
85
|
-
"
|
|
86
|
-
"variant": "
|
|
87
|
-
"when": "
|
|
85
|
+
"carousel": {
|
|
86
|
+
"variant": "Reviews",
|
|
87
|
+
"when": "A review collection with the required aggregate summary above it and the reviews in a carousel (canonical `presentation: 'carousel'`)."
|
|
88
88
|
}
|
|
89
89
|
}
|
|
90
90
|
},
|
|
@@ -100,34 +100,30 @@
|
|
|
100
100
|
"category.filter": {
|
|
101
101
|
"default": "sidebar",
|
|
102
102
|
"intents": {
|
|
103
|
-
"inline": {
|
|
104
|
-
"variant": "CategoryFilter1",
|
|
105
|
-
"when": "A compact inline filter bar above the product grid."
|
|
106
|
-
},
|
|
107
103
|
"sidebar": {
|
|
108
|
-
"variant": "
|
|
109
|
-
"when": "A left sidebar with
|
|
104
|
+
"variant": "CategoryListing",
|
|
105
|
+
"when": "A persistent left sidebar with filters, price range, and sort controls."
|
|
110
106
|
},
|
|
111
|
-
"
|
|
112
|
-
"variant": "
|
|
113
|
-
"when": "
|
|
107
|
+
"toolbar": {
|
|
108
|
+
"variant": "CategoryListing",
|
|
109
|
+
"when": "A sticky toolbar with a filter drawer, active-filter chips, and a sort sheet."
|
|
114
110
|
}
|
|
115
111
|
}
|
|
116
112
|
},
|
|
117
113
|
"checkout.checkout": {
|
|
118
|
-
"default": "
|
|
114
|
+
"default": "multiStep",
|
|
119
115
|
"intents": {
|
|
120
116
|
"singlePage": {
|
|
121
|
-
"variant": "
|
|
122
|
-
"when": "A single-page checkout
|
|
117
|
+
"variant": "Checkout",
|
|
118
|
+
"when": "A single-page checkout with contact, shipping, and payment sections visible at once (canonical `presentation: 'single-page'`)."
|
|
123
119
|
},
|
|
124
120
|
"multiStep": {
|
|
125
|
-
"variant": "
|
|
126
|
-
"when": "A
|
|
121
|
+
"variant": "Checkout",
|
|
122
|
+
"when": "A step-by-step checkout that shows one step at a time (canonical `presentation: 'stepper'`)."
|
|
127
123
|
},
|
|
128
|
-
"
|
|
129
|
-
"variant": "
|
|
130
|
-
"when": "A
|
|
124
|
+
"reviewStep": {
|
|
125
|
+
"variant": "Checkout",
|
|
126
|
+
"when": "A step-by-step checkout that appends a confirmation review before submission (canonical `presentation: 'stepper'` with `showReviewStep`)."
|
|
131
127
|
}
|
|
132
128
|
}
|
|
133
129
|
},
|
|
@@ -135,7 +131,7 @@
|
|
|
135
131
|
"default": "signIn",
|
|
136
132
|
"intents": {
|
|
137
133
|
"signIn": {
|
|
138
|
-
"variant": "
|
|
134
|
+
"variant": "card",
|
|
139
135
|
"when": "A full sign-in page with email and password and a link to create an account."
|
|
140
136
|
}
|
|
141
137
|
}
|
|
@@ -150,11 +146,15 @@
|
|
|
150
146
|
}
|
|
151
147
|
},
|
|
152
148
|
"account.orders": {
|
|
153
|
-
"default": "
|
|
149
|
+
"default": "cards",
|
|
154
150
|
"intents": {
|
|
155
|
-
"
|
|
156
|
-
"variant": "
|
|
157
|
-
"when": "A signed-in shopper's order history with per
|
|
151
|
+
"cards": {
|
|
152
|
+
"variant": "OrderHistory",
|
|
153
|
+
"when": "A signed-in shopper's order history with one card per order and details on demand (canonical `presentation: 'cards'`)."
|
|
154
|
+
},
|
|
155
|
+
"rows": {
|
|
156
|
+
"variant": "OrderHistory",
|
|
157
|
+
"when": "A compact, list-first order history with one bordered row per order (canonical `presentation: 'rows'`)."
|
|
158
158
|
}
|
|
159
159
|
}
|
|
160
160
|
}
|
package/recipes/catalog.json
CHANGED
|
@@ -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": {
|
package/recipes/features.json
CHANGED
|
@@ -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": [],
|