@thorprovider/storefront 0.4.0-mvp.2 → 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 +13 -13
- package/assets/templates/app/app/[[...slug]]/page.tsx +32 -1
- package/assets/templates/app/app/[[...slug]]/renderer.tsx +43 -12
- package/assets/templates/app/lib/__STOREFRONT__/account-boundary.client.tsx +76 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-lifecycle.client.tsx +461 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-mutation.client.ts +46 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-private.core.ts +103 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-reconcile.client.ts +465 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-session.core.ts +177 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-session.ts +44 -0
- package/assets/templates/app/lib/__STOREFRONT__/account-user.core.ts +65 -0
- package/assets/templates/app/lib/__STOREFRONT__/actions.ts +76 -27
- package/assets/templates/app/lib/__STOREFRONT__/catalog.ts +4 -4
- package/assets/templates/app/lib/__STOREFRONT__/commerce.ts +0 -10
- package/assets/templates/app/lib/__STOREFRONT__/composition.ts +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/handlers.core.ts +3 -3
- package/assets/templates/app/lib/__STOREFRONT__/mappers.ts +17 -18
- package/assets/templates/app/lib/__STOREFRONT__/projection-ownership.client.tsx +209 -0
- package/assets/templates/app/lib/__STOREFRONT__/projection-ownership.ts +247 -0
- package/assets/templates/app/lib/__STOREFRONT__/registry.tsx +60 -29
- package/assets/templates/app/lib/__STOREFRONT__/schema.ts +83 -15
- package/assets/templates/app/lib/__STOREFRONT__/section-sources.ts +3 -5
- package/assets/templates/app/lib/__STOREFRONT__/shell/props.ts +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/spec/index.ts +25 -0
- package/assets/templates/app/lib/__STOREFRONT__/state.core.ts +7 -10
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/cta.client.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/faq.client.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/logoCloud.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/pricing.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/products.client.tsx +16 -16
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/schema.products.ts +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/statistics.tsx +1 -1
- package/assets/templates/app/lib/__STOREFRONT__/views/sections/testimonials.tsx +26 -19
- package/assets/templates/features/checkout/state.ts +0 -5
- package/assets/templates/features/customer-auth/handlers.ts +19 -23
- package/assets/templates/features/customer-auth/state.ts +21 -0
- package/assets/templates/views/account/index.tsx +19 -7
- package/assets/templates/views/account/registry.tsx +263 -155
- package/assets/templates/views/account/schema.ts +1 -1
- package/assets/templates/views/cart/data.ts +7 -7
- package/assets/templates/views/cart/registry.tsx +4 -3
- package/assets/templates/views/category/assembly/assembly.json +2 -2
- package/assets/templates/views/category/assembly/index.skeleton.tsx +11 -7
- package/assets/templates/views/category/assembly/registry.skeleton.tsx +9 -9
- package/assets/templates/views/category/assembly/slots/breadcrumb/Breadcrumb/binding.json +1 -1
- 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 +19 -15
- 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 +12 -10
- package/assets/templates/views/checkout/schema.ts +10 -16
- package/assets/templates/views/home/assembly/assembly.json +4 -4
- package/assets/templates/views/home/assembly/index.skeleton.tsx +2 -3
- package/assets/templates/views/home/assembly/registry.skeleton.tsx +4 -1
- package/assets/templates/views/home/assembly/slots/benefits/cards/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/benefits/cards/registry.part +17 -0
- package/assets/templates/views/home/assembly/slots/benefits/split/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → split}/registry.part +6 -2
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/catalog.part +8 -0
- package/assets/templates/views/home/assembly/slots/categories/{ProductCategory2 → CategoryGrid}/element.part +1 -1
- package/assets/templates/views/home/assembly/slots/categories/CategoryGrid/registry.part +31 -0
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero/binding.json +5 -0
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero/catalog.part +4 -0
- package/assets/templates/views/home/assembly/slots/hero/{StorefrontHero1 → StorefrontHero}/registry.part +3 -1
- package/assets/templates/views/home/content.ts +22 -0
- package/assets/templates/views/home/index.tsx +11 -8
- package/assets/templates/views/home/props.ts +1 -0
- package/assets/templates/views/home/registry.tsx +39 -15
- package/assets/templates/views/home/schema.ts +141 -24
- package/assets/templates/views/product/data.ts +1 -1
- package/assets/templates/views/product/registry.tsx +10 -6
- package/assets/templates/views/product/schema.ts +36 -1
- package/examples/merchandising/category-led.json +1 -1
- package/examples/merchandising/collection-led.json +1 -1
- package/package.json +4 -5
- package/recipes/archetypes.json +39 -43
- package/recipes/catalog.json +212 -202
- package/recipes/catalog.mjs +10 -0
- package/recipes/catalog.schema.json +4 -0
- package/recipes/features.json +5 -5
- package/recipes/recipes.json +137 -43
- package/recipes/sections.json +4 -4
- package/recipes/validate.mjs +21 -4
- package/scripts/candidate.mjs +2 -2
- package/scripts/composers.mjs +2 -2
- package/scripts/file-classes.mjs +10 -0
- package/scripts/logical-controls.mjs +4 -4
- package/scripts/operation-registry.mjs +1 -1
- package/scripts/ownership-conflict.mjs +5 -2
- package/scripts/view-assembly.mjs +12 -4
- package/scripts/view-selection.mjs +1 -1
- package/skills/sf-view-gen/assets/recipes/archetypes.json +39 -43
- package/skills/sf-view-gen/assets/recipes/catalog.json +212 -202
- package/skills/sf-view-gen/assets/recipes/catalog.schema.json +4 -0
- package/skills/sf-view-gen/assets/recipes/features.json +5 -5
- package/skills/sf-view-gen/assets/recipes/recipes.json +137 -43
- package/skills/sf-view-gen/assets/recipes/sections.json +4 -4
- package/skills/sf-view-gen/assets/templates/views/sections/cta.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/faq.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/logoCloud.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/pricing.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/products.client.tsx +16 -16
- package/skills/sf-view-gen/assets/templates/views/sections/schema.products.ts +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/schema.testimonials.ts +21 -11
- package/skills/sf-view-gen/assets/templates/views/sections/statistics.client.tsx +1 -1
- package/skills/sf-view-gen/assets/templates/views/sections/testimonials.client.tsx +2 -8
- package/skills/sf-view-gen/scripts/catalog.mjs +10 -0
- package/skills/sf-view-gen/scripts/validate.mjs +21 -4
- package/assets/templates/views/category/assembly/slots/filter/CategoryFilter2/catalog.part +0 -5
- package/assets/templates/views/home/assembly/slots/benefits/Feature1/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/benefits/Feature2/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/benefits/Feature2/registry.part +0 -10
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/catalog.part +0 -4
- package/assets/templates/views/home/assembly/slots/categories/ProductCategory2/registry.part +0 -16
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/binding.json +0 -5
- package/assets/templates/views/home/assembly/slots/hero/StorefrontHero1/catalog.part +0 -4
- /package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → cards}/catalog.part +0 -0
- /package/assets/templates/views/home/assembly/slots/benefits/{Feature1 → cards}/element.part +0 -0
- /package/assets/templates/views/home/assembly/slots/benefits/{Feature2 → split}/catalog.part +0 -0
- /package/assets/templates/views/home/assembly/slots/benefits/{Feature2 → split}/element.part +0 -0
- /package/assets/templates/views/home/assembly/slots/hero/{StorefrontHero1 → StorefrontHero}/element.part +0 -0
package/recipes/features.json
CHANGED
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
{
|
|
60
60
|
"name": "benefits",
|
|
61
61
|
"mvp": true,
|
|
62
|
-
"description": "Bounded editorial benefits feature that mounts at the home benefits slot; config selects the
|
|
62
|
+
"description": "Bounded editorial benefits feature that mounts at the home benefits slot; config selects the canonical Feature block's presentation (compact -> cards, detailed -> split) while the item content stays user-owned.",
|
|
63
63
|
"views": [],
|
|
64
64
|
"state": [],
|
|
65
65
|
"handlers": [],
|
|
@@ -71,14 +71,14 @@
|
|
|
71
71
|
"presentation": { "type": "string", "enum": ["compact", "detailed"], "default": "compact" }
|
|
72
72
|
}
|
|
73
73
|
},
|
|
74
|
-
"presentations": { "compact": "
|
|
74
|
+
"presentations": { "compact": "cards", "detailed": "split" },
|
|
75
75
|
"mounts": [{ "id": "home-benefits", "host": "home", "slot": "benefits" }],
|
|
76
76
|
"surfaces": []
|
|
77
77
|
},
|
|
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": [],
|
|
@@ -155,7 +155,7 @@
|
|
|
155
155
|
"adapter": { "needs": ["getRelatedProducts"], "fallback": "catalog" },
|
|
156
156
|
"config": { "type": "object", "additionalProperties": false, "properties": {} },
|
|
157
157
|
"surfaces": [
|
|
158
|
-
{ "host": "product", "slot": "product.related", "element": "
|
|
158
|
+
{ "host": "product", "slot": "product.related", "element": "ProductGrid" }
|
|
159
159
|
]
|
|
160
160
|
}
|
|
161
161
|
]
|
package/recipes/recipes.json
CHANGED
|
@@ -8,21 +8,47 @@
|
|
|
8
8
|
"description": "Storefront landing page with hero, benefits, and category highlights",
|
|
9
9
|
"route": "/",
|
|
10
10
|
"loader": "home",
|
|
11
|
-
"requiredDataKeys": [
|
|
11
|
+
"requiredDataKeys": [
|
|
12
|
+
"heroProducts",
|
|
13
|
+
"categories"
|
|
14
|
+
],
|
|
12
15
|
"defaultVariants": {
|
|
13
|
-
"hero": "
|
|
14
|
-
"benefits": "
|
|
15
|
-
"categories": "
|
|
16
|
+
"hero": "StorefrontHero",
|
|
17
|
+
"benefits": "cards",
|
|
18
|
+
"categories": "CategoryGrid"
|
|
16
19
|
},
|
|
17
20
|
"allowedVariants": {
|
|
18
|
-
"hero": [
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
"
|
|
21
|
+
"hero": [
|
|
22
|
+
"StorefrontHero"
|
|
23
|
+
],
|
|
24
|
+
"benefits": [
|
|
25
|
+
"cards",
|
|
26
|
+
"split"
|
|
27
|
+
],
|
|
28
|
+
"categories": [
|
|
29
|
+
"CategoryGrid"
|
|
30
|
+
],
|
|
31
|
+
"productCard": [
|
|
32
|
+
"ProductGrid"
|
|
33
|
+
]
|
|
22
34
|
},
|
|
23
|
-
"optionalSections": [
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
"optionalSections": [
|
|
36
|
+
"testimonials",
|
|
37
|
+
"faq",
|
|
38
|
+
"statistics",
|
|
39
|
+
"logoCloud",
|
|
40
|
+
"pricing"
|
|
41
|
+
],
|
|
42
|
+
"registeredSlots": [
|
|
43
|
+
"hero",
|
|
44
|
+
"benefits",
|
|
45
|
+
"categories"
|
|
46
|
+
],
|
|
47
|
+
"allowedSections": [
|
|
48
|
+
"faq",
|
|
49
|
+
"cta",
|
|
50
|
+
"products"
|
|
51
|
+
],
|
|
26
52
|
"maxSections": 4
|
|
27
53
|
},
|
|
28
54
|
{
|
|
@@ -31,20 +57,39 @@
|
|
|
31
57
|
"description": "Single product detail page with overview, gallery, and reviews",
|
|
32
58
|
"route": "/products/[id]",
|
|
33
59
|
"loader": "product",
|
|
34
|
-
"requiredDataKeys": [
|
|
60
|
+
"requiredDataKeys": [
|
|
61
|
+
"selectedProduct"
|
|
62
|
+
],
|
|
35
63
|
"defaultVariants": {
|
|
36
|
-
"overview": "
|
|
64
|
+
"overview": "ProductOverview",
|
|
37
65
|
"reviews": "ReviewRating1",
|
|
38
66
|
"breadcrumb": "Breadcrumb"
|
|
39
67
|
},
|
|
40
68
|
"allowedVariants": {
|
|
41
|
-
"overview": [
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
"
|
|
69
|
+
"overview": [
|
|
70
|
+
"ProductOverview"
|
|
71
|
+
],
|
|
72
|
+
"reviews": [
|
|
73
|
+
"ReviewRating1",
|
|
74
|
+
"ReviewRating2"
|
|
75
|
+
],
|
|
76
|
+
"breadcrumb": [
|
|
77
|
+
"Breadcrumb"
|
|
78
|
+
],
|
|
79
|
+
"productCard": [
|
|
80
|
+
"ProductGrid"
|
|
81
|
+
]
|
|
45
82
|
},
|
|
46
|
-
"optionalSections": [
|
|
47
|
-
|
|
83
|
+
"optionalSections": [
|
|
84
|
+
"testimonials",
|
|
85
|
+
"faq",
|
|
86
|
+
"statistics"
|
|
87
|
+
],
|
|
88
|
+
"registeredSlots": [
|
|
89
|
+
"overview",
|
|
90
|
+
"reviews",
|
|
91
|
+
"breadcrumb"
|
|
92
|
+
],
|
|
48
93
|
"allowedSections": [],
|
|
49
94
|
"maxSections": 4
|
|
50
95
|
},
|
|
@@ -54,15 +99,21 @@
|
|
|
54
99
|
"description": "Standalone cart review page with authoritative totals and quantity editing",
|
|
55
100
|
"route": "/cart",
|
|
56
101
|
"loader": "cart",
|
|
57
|
-
"requiredDataKeys": [
|
|
102
|
+
"requiredDataKeys": [
|
|
103
|
+
"cart"
|
|
104
|
+
],
|
|
58
105
|
"defaultVariants": {
|
|
59
|
-
"view": "
|
|
106
|
+
"view": "ShoppingCart"
|
|
60
107
|
},
|
|
61
108
|
"allowedVariants": {
|
|
62
|
-
"view": [
|
|
109
|
+
"view": [
|
|
110
|
+
"ShoppingCart"
|
|
111
|
+
]
|
|
63
112
|
},
|
|
64
113
|
"optionalSections": [],
|
|
65
|
-
"registeredSlots": [
|
|
114
|
+
"registeredSlots": [
|
|
115
|
+
"view"
|
|
116
|
+
],
|
|
66
117
|
"allowedSections": [],
|
|
67
118
|
"maxSections": 0
|
|
68
119
|
},
|
|
@@ -72,20 +123,39 @@
|
|
|
72
123
|
"description": "Product listing filtered by category with filters and sorting",
|
|
73
124
|
"route": "/categories/[[...slug]]",
|
|
74
125
|
"loader": "category",
|
|
75
|
-
"requiredDataKeys": [
|
|
126
|
+
"requiredDataKeys": [
|
|
127
|
+
"categoryProducts",
|
|
128
|
+
"storeCategories"
|
|
129
|
+
],
|
|
76
130
|
"defaultVariants": {
|
|
77
|
-
"filter": "
|
|
78
|
-
"productCard": "
|
|
131
|
+
"filter": "CategoryListing",
|
|
132
|
+
"productCard": "ProductGrid",
|
|
79
133
|
"breadcrumb": "Breadcrumb"
|
|
80
134
|
},
|
|
81
135
|
"allowedVariants": {
|
|
82
|
-
"filter": [
|
|
83
|
-
|
|
84
|
-
|
|
136
|
+
"filter": [
|
|
137
|
+
"CategoryListing"
|
|
138
|
+
],
|
|
139
|
+
"productCard": [
|
|
140
|
+
"ProductGrid"
|
|
141
|
+
],
|
|
142
|
+
"breadcrumb": [
|
|
143
|
+
"Breadcrumb"
|
|
144
|
+
]
|
|
85
145
|
},
|
|
86
|
-
"optionalSections": [
|
|
87
|
-
|
|
88
|
-
|
|
146
|
+
"optionalSections": [
|
|
147
|
+
"logoCloud",
|
|
148
|
+
"testimonials"
|
|
149
|
+
],
|
|
150
|
+
"registeredSlots": [
|
|
151
|
+
"breadcrumb",
|
|
152
|
+
"filter",
|
|
153
|
+
"productCard"
|
|
154
|
+
],
|
|
155
|
+
"allowedSections": [
|
|
156
|
+
"faq",
|
|
157
|
+
"cta"
|
|
158
|
+
],
|
|
89
159
|
"maxSections": 4
|
|
90
160
|
},
|
|
91
161
|
{
|
|
@@ -94,17 +164,27 @@
|
|
|
94
164
|
"description": "Multi-step checkout with cart summary, shipping, and payment",
|
|
95
165
|
"route": "/checkout",
|
|
96
166
|
"loader": "checkout",
|
|
97
|
-
"requiredDataKeys": [
|
|
167
|
+
"requiredDataKeys": [
|
|
168
|
+
"checkoutCountries",
|
|
169
|
+
"checkoutPaymentMethods"
|
|
170
|
+
],
|
|
98
171
|
"defaultVariants": {
|
|
99
|
-
"checkout": "
|
|
172
|
+
"checkout": "Checkout",
|
|
100
173
|
"confirmation": "CheckoutConfirmation"
|
|
101
174
|
},
|
|
102
175
|
"allowedVariants": {
|
|
103
|
-
"checkout": [
|
|
104
|
-
|
|
176
|
+
"checkout": [
|
|
177
|
+
"Checkout"
|
|
178
|
+
],
|
|
179
|
+
"confirmation": [
|
|
180
|
+
"CheckoutConfirmation"
|
|
181
|
+
]
|
|
105
182
|
},
|
|
106
183
|
"optionalSections": [],
|
|
107
|
-
"registeredSlots": [
|
|
184
|
+
"registeredSlots": [
|
|
185
|
+
"checkout",
|
|
186
|
+
"confirmation"
|
|
187
|
+
],
|
|
108
188
|
"allowedSections": [],
|
|
109
189
|
"maxSections": 4
|
|
110
190
|
},
|
|
@@ -114,18 +194,32 @@
|
|
|
114
194
|
"description": "Customer account area with sign-in, registration, and a minimal signed-in state",
|
|
115
195
|
"route": "/account",
|
|
116
196
|
"loader": "account",
|
|
117
|
-
"requiredDataKeys": [
|
|
197
|
+
"requiredDataKeys": [
|
|
198
|
+
"accountCustomer"
|
|
199
|
+
],
|
|
118
200
|
"defaultVariants": {
|
|
119
|
-
"login": "
|
|
201
|
+
"login": "card",
|
|
120
202
|
"register": "SignUpPage1"
|
|
121
203
|
},
|
|
122
204
|
"allowedVariants": {
|
|
123
|
-
"login": [
|
|
124
|
-
|
|
125
|
-
|
|
205
|
+
"login": [
|
|
206
|
+
"card",
|
|
207
|
+
"social"
|
|
208
|
+
],
|
|
209
|
+
"register": [
|
|
210
|
+
"SignUpPage1"
|
|
211
|
+
],
|
|
212
|
+
"orders": [
|
|
213
|
+
"OrderHistory1",
|
|
214
|
+
"OrderHistory2"
|
|
215
|
+
]
|
|
126
216
|
},
|
|
127
217
|
"optionalSections": [],
|
|
128
|
-
"registeredSlots": [
|
|
218
|
+
"registeredSlots": [
|
|
219
|
+
"login",
|
|
220
|
+
"register",
|
|
221
|
+
"orders"
|
|
222
|
+
],
|
|
129
223
|
"allowedSections": [],
|
|
130
224
|
"maxSections": 4
|
|
131
225
|
},
|
package/recipes/sections.json
CHANGED
|
@@ -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"
|
|
@@ -35,8 +35,8 @@
|
|
|
35
35
|
"name": "products",
|
|
36
36
|
"description": "Data-bound product presentation (grid or combined grid-and-carousel) whose selection is configured independently per instance",
|
|
37
37
|
"elementType": "Products",
|
|
38
|
-
"variants": ["
|
|
39
|
-
"defaultVariant": "
|
|
38
|
+
"variants": ["ProductGrid", "ProductShowcase1"],
|
|
39
|
+
"defaultVariant": "ProductGrid",
|
|
40
40
|
"dataBound": true,
|
|
41
41
|
"propsHint": "per-instance selection configured in views/<view>/data.ts sectionSources[id] (canonical category/collection/search/ordering query); heading, description, objective, ctaLabel/ctaHref are editorial content",
|
|
42
42
|
"status": "executable"
|
package/recipes/validate.mjs
CHANGED
|
@@ -550,15 +550,30 @@ export function getCatalogSlot(viewName, slot) {
|
|
|
550
550
|
return hasOwn(slots, key) ? slots[key] : null
|
|
551
551
|
}
|
|
552
552
|
|
|
553
|
+
/**
|
|
554
|
+
* The legacy alias target for a slot variant name, or the input unchanged when
|
|
555
|
+
* it is not an alias. The canonical selection surface is the catalog's variant
|
|
556
|
+
* set (the canonical block's presentations); retired numbered names survive
|
|
557
|
+
* only as slot-level `legacyAliases` and resolve here, at the single catalog
|
|
558
|
+
* authority, before any validation or fragment lookup.
|
|
559
|
+
*/
|
|
560
|
+
export function resolveLegacyVariant(viewName, slot, variant) {
|
|
561
|
+
const slotEntry = getCatalogSlot(viewName, slot)
|
|
562
|
+
const aliases = isPlainObject(slotEntry?.legacyAliases) ? slotEntry.legacyAliases : {}
|
|
563
|
+
return hasOwn(aliases, variant) ? aliases[variant] : variant
|
|
564
|
+
}
|
|
565
|
+
|
|
553
566
|
/**
|
|
554
567
|
* The catalog entry for one variant of a slot, or null when the slot or the
|
|
555
568
|
* variant is outside the catalog scope. Used to name a held variant's reason at
|
|
556
|
-
* the point a selection is rejected (E1 task 1.4 / CU-07).
|
|
569
|
+
* the point a selection is rejected (E1 task 1.4 / CU-07). Legacy alias names
|
|
570
|
+
* resolve to their canonical variant's entry.
|
|
557
571
|
*/
|
|
558
572
|
export function getCatalogVariant(viewName, slot, variant) {
|
|
559
573
|
const slotEntry = getCatalogSlot(viewName, slot)
|
|
560
574
|
const variants = isPlainObject(slotEntry?.variants) ? slotEntry.variants : {}
|
|
561
|
-
|
|
575
|
+
const canonical = resolveLegacyVariant(viewName, slot, variant)
|
|
576
|
+
return hasOwn(variants, canonical) ? variants[canonical] : null
|
|
562
577
|
}
|
|
563
578
|
|
|
564
579
|
/**
|
|
@@ -630,7 +645,7 @@ export function supportedVariant(viewName, slot) {
|
|
|
630
645
|
}
|
|
631
646
|
|
|
632
647
|
export function isSupportedVariant(viewName, slot, variant) {
|
|
633
|
-
return executableVariants(viewName, slot).includes(variant)
|
|
648
|
+
return executableVariants(viewName, slot).includes(resolveLegacyVariant(viewName, slot, variant))
|
|
634
649
|
}
|
|
635
650
|
|
|
636
651
|
/**
|
|
@@ -662,7 +677,9 @@ export function isAllowedVariant(viewName, slot, variant) {
|
|
|
662
677
|
const allowedBySlot = isPlainObject(recipe.allowedVariants) ? recipe.allowedVariants : {}
|
|
663
678
|
if (!hasOwn(allowedBySlot, slot)) return false
|
|
664
679
|
const allowed = allowedBySlot[slot]
|
|
665
|
-
return
|
|
680
|
+
return (
|
|
681
|
+
Array.isArray(allowed) && allowed.includes(resolveLegacyVariant(viewName, slot, variant))
|
|
682
|
+
)
|
|
666
683
|
}
|
|
667
684
|
|
|
668
685
|
export function isAllowedSection(viewName, sectionName) {
|
package/scripts/candidate.mjs
CHANGED
|
@@ -42,10 +42,10 @@ export const CANDIDATE_TOOLSET = Object.freeze({
|
|
|
42
42
|
'@json-render/next': '0.21.0',
|
|
43
43
|
}),
|
|
44
44
|
local: Object.freeze({
|
|
45
|
-
'@thorprovider/blocks': '0.1.
|
|
45
|
+
'@thorprovider/blocks': '0.1.4',
|
|
46
46
|
'@thorprovider/adapters': '5.0.12',
|
|
47
47
|
'@thorprovider/runtime': '0.1.4',
|
|
48
|
-
'@thorprovider/types': '5.
|
|
48
|
+
'@thorprovider/types': '5.9.0',
|
|
49
49
|
}),
|
|
50
50
|
})
|
|
51
51
|
|
package/scripts/composers.mjs
CHANGED
|
@@ -78,7 +78,7 @@ function isPlainObject(value) {
|
|
|
78
78
|
* Build the `composition.ts` composer: the installed manifest catalog features
|
|
79
79
|
* in stable order, plus their persisted config. This is the generation seam the
|
|
80
80
|
* catalog URL boundary consumes to reject parameters owned by a feature that is
|
|
81
|
-
* not installed, and the seam the single controlled `
|
|
81
|
+
* not installed, and the seam the single controlled `CategoryListing` reads to
|
|
82
82
|
* select its control visibility/config from the installed manifest only. It is
|
|
83
83
|
* derived from the manifest — never hardcoded as always-mounted.
|
|
84
84
|
*
|
|
@@ -116,7 +116,7 @@ export function buildCompositionComposer(features, views = []) {
|
|
|
116
116
|
`// Installed manifest catalog features, in stable order, with their persisted\n` +
|
|
117
117
|
`// config. This is the generation seam the catalog URL boundary consumes to\n` +
|
|
118
118
|
`// reject parameters owned by a feature that is not installed, and the seam the\n` +
|
|
119
|
-
`// single controlled
|
|
119
|
+
`// single controlled CategoryListing reads to select its control\n` +
|
|
120
120
|
`// visibility/config from the installed manifest only.\n\n` +
|
|
121
121
|
`import type { CatalogFeatureName } from '@thorprovider/runtime/contracts'\n\n` +
|
|
122
122
|
`export const mountedFeatures: readonly CatalogFeatureName[] = [${list}]\n\n` +
|
package/scripts/file-classes.mjs
CHANGED
|
@@ -53,6 +53,16 @@ const RULES = [
|
|
|
53
53
|
'app/lib/*/composition.ts',
|
|
54
54
|
'app/lib/*/session.ts',
|
|
55
55
|
'app/lib/*/session.core.ts',
|
|
56
|
+
'app/lib/*/account-session.ts',
|
|
57
|
+
'app/lib/*/account-session.core.ts',
|
|
58
|
+
'app/lib/*/account-private.core.ts',
|
|
59
|
+
'app/lib/*/account-user.core.ts',
|
|
60
|
+
'app/lib/*/account-lifecycle.client.tsx',
|
|
61
|
+
'app/lib/*/account-boundary.client.tsx',
|
|
62
|
+
'app/lib/*/account-mutation.client.ts',
|
|
63
|
+
'app/lib/*/account-reconcile.client.ts',
|
|
64
|
+
'app/lib/*/projection-ownership.ts',
|
|
65
|
+
'app/lib/*/projection-ownership.client.tsx',
|
|
56
66
|
'app/lib/*/store-context.ts',
|
|
57
67
|
'app/lib/*/commerce.ts',
|
|
58
68
|
'app/lib/*/cart-state.ts',
|
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// those mounts (E2 design Decision 2c / the task 6.3 M2 resolution).
|
|
12
12
|
//
|
|
13
13
|
// This is metadata only: no new operation, no block, no element. The base
|
|
14
|
-
// listing (`category.filter` rendering the one controlled `
|
|
14
|
+
// listing (`category.filter` rendering the one controlled `CategoryListing`)
|
|
15
15
|
// stays the view default; these controls only toggle visibility on it.
|
|
16
16
|
//
|
|
17
17
|
// IMPORT-CYCLE NOTE: this module is a LEAF. It deliberately does not import
|
|
@@ -26,14 +26,14 @@ import {
|
|
|
26
26
|
logicalControlFor,
|
|
27
27
|
} from './operation-registry.mjs'
|
|
28
28
|
|
|
29
|
-
/** The two E2 control contributions to the single `
|
|
29
|
+
/** The two E2 control contributions to the single `CategoryListing` listing. */
|
|
30
30
|
export const CATALOG_LOGICAL_CONTROLS = Object.freeze([
|
|
31
31
|
Object.freeze({
|
|
32
32
|
kind: LOGICAL_CONTROL_KIND,
|
|
33
33
|
feature: 'catalog-search',
|
|
34
34
|
host: 'category',
|
|
35
35
|
slot: 'search',
|
|
36
|
-
presentation: '
|
|
36
|
+
presentation: 'CategoryListing',
|
|
37
37
|
capability: 'category.search.apply',
|
|
38
38
|
}),
|
|
39
39
|
Object.freeze({
|
|
@@ -41,7 +41,7 @@ export const CATALOG_LOGICAL_CONTROLS = Object.freeze([
|
|
|
41
41
|
feature: 'category-filters',
|
|
42
42
|
host: 'category',
|
|
43
43
|
slot: 'filters',
|
|
44
|
-
presentation: '
|
|
44
|
+
presentation: 'CategoryListing',
|
|
45
45
|
capability: 'category.filter.apply',
|
|
46
46
|
}),
|
|
47
47
|
])
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// `slot`, `presentation`, optional `capability`). It carries no render-owned
|
|
23
23
|
// field (`block`, `element`), no behavior (`reducer`), and no operation. This
|
|
24
24
|
// is the distinction E2 relies on when it contributes search/filters to the
|
|
25
|
-
// single `
|
|
25
|
+
// single `CategoryListing` listing with no new operation (E2 design; E1
|
|
26
26
|
// Decision 16). Registering a whole view is the catalog's job, not this
|
|
27
27
|
// seam's, so a contribution that tries to carry a render field is rejected.
|
|
28
28
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
import { existsSync, readFileSync } from 'node:fs'
|
|
29
29
|
import path from 'node:path'
|
|
30
|
-
import { getCatalogVariant } from '../recipes/validate.mjs'
|
|
30
|
+
import { getCatalogVariant, resolveLegacyVariant } from '../recipes/validate.mjs'
|
|
31
31
|
import { DEFAULT_THEME_MODE } from './manifest.mjs'
|
|
32
32
|
import { replacePlaceholders } from './render-templates.mjs'
|
|
33
33
|
import { viewTemplateDir } from './reconcile.mjs'
|
|
@@ -316,7 +316,10 @@ export function detectOwnershipConflicts(projectDir, manifest, options = {}) {
|
|
|
316
316
|
const projectRel = toPosix(path.relative(projectDir, abs))
|
|
317
317
|
|
|
318
318
|
for (const slot of selectedSlots) {
|
|
319
|
-
|
|
319
|
+
// The manifest may still store a retired numbered name; the fragment
|
|
320
|
+
// lookup needs the canonical variant directory (legacy aliases resolve
|
|
321
|
+
// at the catalog authority, the same seam every lookup translates at).
|
|
322
|
+
const variant = resolveLegacyVariant(viewName, slot, resolved.selection[slot])
|
|
320
323
|
const rootIds = [...referencedIdentifiers(templateDir, slot, variant)].filter((id) =>
|
|
321
324
|
kind === 'schema' ? /Schema$/.test(id) : /Props$/.test(id),
|
|
322
325
|
)
|
|
@@ -21,6 +21,7 @@ import { existsSync, readFileSync, readdirSync } from 'node:fs'
|
|
|
21
21
|
import { mkdir, writeFile } from 'node:fs/promises'
|
|
22
22
|
import path from 'node:path'
|
|
23
23
|
import { isSlotSectionEntry } from './section-compat.mjs'
|
|
24
|
+
import { resolveLegacyVariant } from '../recipes/validate.mjs'
|
|
24
25
|
|
|
25
26
|
export const ASSEMBLY_DIRNAME = 'assembly'
|
|
26
27
|
|
|
@@ -60,7 +61,7 @@ export function fragmentVariants(templateDir, slot) {
|
|
|
60
61
|
//
|
|
61
62
|
// A slot marked `nested: true` is a presentation slot that is rendered inside
|
|
62
63
|
// its host element (for example the category `productCard` inside the single
|
|
63
|
-
// `
|
|
64
|
+
// `CategoryListing` listing), so it has no top-level fragment and is skipped
|
|
64
65
|
// here: it stays in the ordered composition (it is a core registered slot) but
|
|
65
66
|
// contributes no top-level element, catalog entry, or route id.
|
|
66
67
|
export function resolveViewSelection(templateDir, selection = {}) {
|
|
@@ -69,7 +70,14 @@ export function resolveViewSelection(templateDir, selection = {}) {
|
|
|
69
70
|
const resolved = {}
|
|
70
71
|
for (const slot of slots) {
|
|
71
72
|
if (slot.nested === true) continue
|
|
72
|
-
|
|
73
|
+
// A stored selection may name a retired numbered variant; the catalog's
|
|
74
|
+
// legacy alias map translates it to the canonical presentation before the
|
|
75
|
+
// fragment lookup, so an old manifest regenerates the same structure.
|
|
76
|
+
const chosen = resolveLegacyVariant(
|
|
77
|
+
meta.view,
|
|
78
|
+
slot.slot,
|
|
79
|
+
selection[slot.slot] ?? slot.default,
|
|
80
|
+
)
|
|
73
81
|
const variants = fragmentVariants(templateDir, slot.slot)
|
|
74
82
|
if (!variants.includes(chosen)) {
|
|
75
83
|
throw new Error(
|
|
@@ -93,7 +101,7 @@ function readPart(fragmentDir, name) {
|
|
|
93
101
|
|
|
94
102
|
// Merge the per-variant block bindings into one import statement per module,
|
|
95
103
|
// sorted by imported name so the output is deterministic. This is what makes
|
|
96
|
-
// swapping a
|
|
104
|
+
// swapping a presentation (cards -> split) changes exactly one binding.
|
|
97
105
|
function renderBlockImports(bindings) {
|
|
98
106
|
const byModule = new Map()
|
|
99
107
|
for (const binding of bindings) {
|
|
@@ -201,7 +209,7 @@ function renderDataBoundElement(entry, def) {
|
|
|
201
209
|
* A slot marked `nested: true` (a presentation slot rendered inside its host
|
|
202
210
|
* element) stays in the ordered composition but is skipped at the top level, so
|
|
203
211
|
* it contributes no element, catalog entry, registry binding, or route id — the
|
|
204
|
-
* category `productCard` nested in `
|
|
212
|
+
* category `productCard` nested in `CategoryListing`. The default category
|
|
205
213
|
* composition therefore renders exactly the single `category.filter` element.
|
|
206
214
|
*
|
|
207
215
|
* Returns the raw source (placeholders intact); callers run
|
|
@@ -85,7 +85,7 @@ export function resolveViewSelection(viewName, entry = {}) {
|
|
|
85
85
|
* mount imposes on its host view (E1 task 3.3). A registry feature declares
|
|
86
86
|
* `mounts: [{ id, host, slot }]` and a `presentations` map; generation owns the
|
|
87
87
|
* block wiring by mapping the feature's `config.presentation` through that map
|
|
88
|
-
* (`compact` -> `
|
|
88
|
+
* (`compact` -> `cards`, `detailed` -> `split`). A mount never carries an
|
|
89
89
|
* element. Returns
|
|
90
90
|
* `{ ok, byView: Map<host, { [slot]: { variant, mountId, featureName } }>, errors }`.
|
|
91
91
|
*
|