@jay-framework/wix-stores 0.15.4 → 0.15.6

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.
@@ -0,0 +1,7 @@
1
+ name: getVariantStock
2
+ description: Get variant stock availability for a product with color + text options. Returns a map of colorChoiceId -> textChoiceId -> inStock.
3
+
4
+ inputSchema:
5
+ productId: string
6
+
7
+ outputSchema: record(record(boolean))
@@ -11,6 +11,9 @@ inputSchema:
11
11
  minPrice?: number
12
12
  maxPrice?: number
13
13
  categoryIds?: string[]
14
+ optionFilters?:
15
+ - optionName: string
16
+ choiceNames: string[]
14
17
  sortBy?: enum(relevance | price_asc | price_desc | name_asc | name_desc | newest)
15
18
  cursor?: string
16
19
  pageSize?: number
@@ -31,3 +34,12 @@ outputSchema:
31
34
  maxValue?: number
32
35
  productCount: number
33
36
  isSelected: boolean
37
+ optionFilters?:
38
+ - optionId: string
39
+ optionName: string
40
+ optionRenderType: enum(TEXT_CHOICES | SWATCH_CHOICES)
41
+ choices:
42
+ - choiceId: string
43
+ choiceName: string
44
+ colorCode: string
45
+ productCount: number
@@ -1,4 +1,9 @@
1
1
  name: category-list
2
+ description: Displays a list of store categories. Use for category navigation grids and menus.
3
+ props:
4
+ - name: parentCategory
5
+ type: string
6
+ description: Parent category slug. When set, only direct children of this category are shown. Falls back to defaultCategory from config.
2
7
  tags:
3
8
  # List of visible categories
4
9
  - tag: categories
@@ -37,4 +37,8 @@ export interface CategoryListRepeatedRefs {
37
37
  }
38
38
  }
39
39
 
40
- export type CategoryListContract = JayContract<CategoryListViewState, CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState>
40
+ export interface CategoryListProps {
41
+ parentCategory?: string;
42
+ }
43
+
44
+ export type CategoryListContract = JayContract<CategoryListViewState, CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, CategoryListProps>
@@ -1,4 +1,5 @@
1
1
  name: mediaGallery
2
+ description: Image and video gallery with thumbnail navigation. Used as a sub-contract in product pages.
2
3
  tags:
3
4
  - tag: selectedMedia
4
5
  type: sub-contract
@@ -1,4 +1,5 @@
1
1
  name: media
2
+ description: Single media item with URL, type, and thumbnail. Used as a sub-contract in media galleries.
2
3
  tags:
3
4
  - {tag: url, type: data, dataType: string, description: Media Url}
4
5
  - {tag: mediaType, type: variant, dataType: "enum (IMAGE | VIDEO)", description: Media type}
@@ -1,4 +1,5 @@
1
1
  name: product-card
2
+ description: Single product card with image, price, and quick-add options. Used as a sub-contract in product grids and search results.
2
3
  tags:
3
4
  # Product basic info (from Wix Stores Product API)
4
5
  - tag: _id
@@ -1,4 +1,8 @@
1
1
  name: product-page
2
+ description: Full product detail page with variants, options, media gallery, and add-to-cart. Use for individual product pages.
3
+ params:
4
+ slug: string
5
+ category: string?
2
6
  tags:
3
7
  - {tag: _id, type: data, dataType: string, description: Product GUID}
4
8
  - {tag: productName, type: data, dataType: string, required: true, description: Product name}
@@ -31,6 +35,7 @@ tags:
31
35
  - {tag: addToCartButton, type: interactive, elementType: HTMLButtonElement, required: true, description: Add product to cart button}
32
36
  - {tag: buyNowButton, type: interactive, elementType: HTMLButtonElement, required: true, description: Buy now button}
33
37
  - {tag: actionsEnabled, type: variant, dataType: boolean, phase: fast+interactive, description: should the add to cart and buy now buttons be enabled}
38
+ - {tag: isAddingToCart, type: variant, dataType: boolean, phase: fast+interactive, description: Whether an add-to-cart request is currently in progress}
34
39
 
35
40
  - tag: options
36
41
  type: sub-contract
@@ -97,55 +102,4 @@ tags:
97
102
  - {tag: isSelected, type: variant, dataType: boolean, phase: fast+interactive, description: Whether this choice is currently selected (UI state)}
98
103
  - {tag: choiceButton, type: interactive, elementType: HTMLButtonElement, description: Button to select this choice}
99
104
 
100
- - tag: seoData
101
- type: sub-contract
102
- description: Product SEO data.
103
- tags:
104
- - tag: tags
105
- type: sub-contract
106
- repeated: true
107
- trackBy: position
108
- description: SEO tag information.
109
- tags:
110
- - {tag: position, type: data, dataType: string, description: the number of the tag, as two digit string.}
111
- - {tag: type, type: data, dataType: string, description: SEO tag type.}
112
- - tag: props
113
- type: sub-contract
114
- repeated: true
115
- trackBy: key
116
- description: A Key Value pair of SEO properties.
117
- tags:
118
- - tag: key
119
- type: data
120
- dataType: string
121
- - tag: value
122
- type: data
123
- dataType: string
124
- - tag: meta
125
- type: sub-contract
126
- repeated: true
127
- trackBy: key
128
- description: SEO tag metadata
129
- tags:
130
- - tag: key
131
- type: data
132
- dataType: string
133
- - tag: value
134
- type: data
135
- dataType: string
136
- - {tag: children, type: data, dataType: string, description: SEO tag inner content.}
137
-
138
- - tag: settings
139
- type: sub-contract
140
- description: SEO general settings.
141
- tags:
142
- - {tag: preventAutoRedirect, type: data, dataType: boolean, description: Whether the automatical redirect visits from the old URL to the new one is enabled.}
143
- - tag: keywords
144
- type: sub-contract
145
- repeated: true
146
- trackBy: term
147
- description: User-selected keyword terms for a specific page.
148
- tags:
149
- - {tag: term, type: data, dataType: string, description: Keyword value.}
150
- - {tag: isMain, type: data, dataType: boolean, description: Whether the keyword is the main focus keyword.}
151
- - {tag: origin, type: data, dataType: string, description: The source that added the keyword terms to the SEO settings. }
105
+ # SEO data is injected into <head> via headTags (Design Log #127), not part of the contract view state.
@@ -77,40 +77,6 @@ export interface ModifierOfProductPageViewState {
77
77
  choices: Array<ChoiceOfModifierOfProductPageViewState>
78
78
  }
79
79
 
80
- export interface PropOfTagOfSeoDatumOfProductPageViewState {
81
- key: string,
82
- value: string
83
- }
84
-
85
- export interface MetaOfTagOfSeoDatumOfProductPageViewState {
86
- key: string,
87
- value: string
88
- }
89
-
90
- export interface TagOfSeoDatumOfProductPageViewState {
91
- position: string,
92
- type: string,
93
- props: Array<PropOfTagOfSeoDatumOfProductPageViewState>,
94
- meta: Array<MetaOfTagOfSeoDatumOfProductPageViewState>,
95
- children: string
96
- }
97
-
98
- export interface KeywordOfSettingOfSeoDatumOfProductPageViewState {
99
- term: string,
100
- isMain: boolean,
101
- origin: string
102
- }
103
-
104
- export interface SettingOfSeoDatumOfProductPageViewState {
105
- preventAutoRedirect: boolean,
106
- keywords: Array<KeywordOfSettingOfSeoDatumOfProductPageViewState>
107
- }
108
-
109
- export interface SeoDatumOfProductPageViewState {
110
- tags: Array<TagOfSeoDatumOfProductPageViewState>,
111
- settings: SettingOfSeoDatumOfProductPageViewState
112
- }
113
-
114
80
  export interface ProductPageViewState {
115
81
  _id: string,
116
82
  productName: string,
@@ -126,10 +92,10 @@ export interface ProductPageViewState {
126
92
  stockStatus: StockStatus,
127
93
  quantity: QuantityOfProductPageViewState,
128
94
  actionsEnabled: boolean,
95
+ isAddingToCart: boolean,
129
96
  options: Array<OptionOfProductPageViewState>,
130
97
  infoSections: Array<InfoSectionOfProductPageViewState>,
131
- modifiers: Array<ModifierOfProductPageViewState>,
132
- seoData: SeoDatumOfProductPageViewState
98
+ modifiers: Array<ModifierOfProductPageViewState>
133
99
  }
134
100
 
135
101
  export type ProductPageSlowViewState = Pick<ProductPageViewState, '_id' | 'productName' | 'description' | 'brand' | 'ribbon' | 'productType'> & {
@@ -140,10 +106,9 @@ export type ProductPageSlowViewState = Pick<ProductPageViewState, '_id' | 'produ
140
106
  modifiers: Array<Pick<ProductPageViewState['modifiers'][number], '_id' | 'name' | 'modifierType' | 'textInputLength' | 'textInputRequired'> & {
141
107
  choices: Array<Pick<ProductPageViewState['modifiers'][number]['choices'][number], 'choiceId' | 'choiceType' | 'name' | 'colorCode'>>;
142
108
  }>;
143
- seoData: ProductPageViewState['seoData'];
144
109
  };
145
110
 
146
- export type ProductPageFastViewState = Pick<ProductPageViewState, 'sku' | 'price' | 'strikethroughPrice' | 'pricePerUnit' | 'stockStatus' | 'actionsEnabled'> & {
111
+ export type ProductPageFastViewState = Pick<ProductPageViewState, 'sku' | 'price' | 'strikethroughPrice' | 'pricePerUnit' | 'stockStatus' | 'actionsEnabled' | 'isAddingToCart'> & {
147
112
  mediaGallery: ProductPageViewState['mediaGallery'];
148
113
  quantity: ProductPageViewState['quantity'];
149
114
  options: Array<Pick<ProductPageViewState['options'][number], '_id' | 'textChoiceSelection'> & {
@@ -154,7 +119,7 @@ export type ProductPageFastViewState = Pick<ProductPageViewState, 'sku' | 'price
154
119
  }>;
155
120
  };
156
121
 
157
- export type ProductPageInteractiveViewState = Pick<ProductPageViewState, 'sku' | 'price' | 'strikethroughPrice' | 'pricePerUnit' | 'stockStatus' | 'actionsEnabled'> & {
122
+ export type ProductPageInteractiveViewState = Pick<ProductPageViewState, 'sku' | 'price' | 'strikethroughPrice' | 'pricePerUnit' | 'stockStatus' | 'actionsEnabled' | 'isAddingToCart'> & {
158
123
  mediaGallery: ProductPageViewState['mediaGallery'];
159
124
  quantity: ProductPageViewState['quantity'];
160
125
  options: Array<Pick<ProductPageViewState['options'][number], '_id' | 'textChoiceSelection'> & {
@@ -215,4 +180,11 @@ export interface ProductPageRepeatedRefs {
215
180
  }
216
181
  }
217
182
 
183
+ import { UrlParams } from '@jay-framework/fullstack-component';
184
+
185
+ export interface ProductPageParams extends UrlParams {
186
+ slug: string;
187
+ category?: string;
188
+ }
189
+
218
190
  export type ProductPageContract = JayContract<ProductPageViewState, ProductPageRefs, ProductPageSlowViewState, ProductPageFastViewState, ProductPageInteractiveViewState>
@@ -1,4 +1,15 @@
1
1
  name: product-search
2
+ description: Product listing with filters, sorting, and pagination. Use for search results and category pages.
3
+ props:
4
+ - name: category
5
+ type: string
6
+ description: Top-level category slug. Scopes search to this category.
7
+ - name: subcategory
8
+ type: string
9
+ description: Sub-category slug. Further scopes within the category.
10
+ params:
11
+ category: string?
12
+ subcategory: string?
2
13
  tags:
3
14
  # Search input (matches Wix searchProducts search.search parameter)
4
15
  - tag: searchExpression
@@ -180,7 +191,69 @@ tags:
180
191
  dataType: boolean
181
192
  elementType: HTMLInputElement
182
193
  description: Show only in-stock products checkbox
183
-
194
+
195
+ # Option-based filters (e.g., Color, Size)
196
+ - tag: optionFilters
197
+ type: sub-contract
198
+ repeated: true
199
+ trackBy: optionId
200
+ phase: fast+interactive
201
+ description: Filter by product options (e.g., Color, Size)
202
+ tags:
203
+ - tag: optionId
204
+ type: data
205
+ dataType: string
206
+ description: Customization ID
207
+
208
+ - tag: optionName
209
+ type: data
210
+ dataType: string
211
+ description: Option display name (e.g., Color, Size)
212
+
213
+ - tag: optionRenderType
214
+ type: variant
215
+ dataType: enum (TEXT_CHOICES | SWATCH_CHOICES)
216
+ description: How to render the option choices
217
+
218
+ - tag: choices
219
+ type: sub-contract
220
+ repeated: true
221
+ trackBy: choiceId
222
+ description: Available choices for this option
223
+ tags:
224
+ - tag: choiceId
225
+ type: data
226
+ dataType: string
227
+ description: Choice ID
228
+
229
+ - tag: choiceName
230
+ type: data
231
+ dataType: string
232
+ description: Choice display name (e.g., Red, Large)
233
+
234
+ - tag: colorCode
235
+ type: data
236
+ dataType: string
237
+ description: HEX color code (for swatch rendering)
238
+
239
+ - tag: productCount
240
+ type: data
241
+ dataType: number
242
+ phase: fast+interactive
243
+ description: Number of products with this choice in current results
244
+
245
+ - tag: isSelected
246
+ type: [data, interactive]
247
+ dataType: boolean
248
+ elementType: HTMLInputElement
249
+ description: Checkbox to toggle this choice filter
250
+
251
+ - tag: isDisabled
252
+ type: data
253
+ dataType: boolean
254
+ phase: fast+interactive
255
+ description: Whether this choice has no matching products (count=0)
256
+
184
257
  - tag: clearFilters
185
258
  type: interactive
186
259
  elementType: HTMLButtonElement
@@ -30,10 +30,32 @@ export interface CategoryFilterOfFilterOfProductSearchViewState {
30
30
  categories: Array<CategoryOfCategoryFilterOfFilterOfProductSearchViewState>
31
31
  }
32
32
 
33
+ export enum OptionRenderType {
34
+ TEXT_CHOICES,
35
+ SWATCH_CHOICES
36
+ }
37
+
38
+ export interface ChoiceOfOptionFilterOfFilterOfProductSearchViewState {
39
+ choiceId: string,
40
+ choiceName: string,
41
+ colorCode: string,
42
+ productCount: number,
43
+ isSelected: boolean,
44
+ isDisabled: boolean
45
+ }
46
+
47
+ export interface OptionFilterOfFilterOfProductSearchViewState {
48
+ optionId: string,
49
+ optionName: string,
50
+ optionRenderType: OptionRenderType,
51
+ choices: Array<ChoiceOfOptionFilterOfFilterOfProductSearchViewState>
52
+ }
53
+
33
54
  export interface FilterOfProductSearchViewState {
34
55
  priceRange: PriceRangeOfFilterOfProductSearchViewState,
35
56
  categoryFilter: CategoryFilterOfFilterOfProductSearchViewState,
36
- inStockOnly: boolean
57
+ inStockOnly: boolean,
58
+ optionFilters: Array<OptionFilterOfFilterOfProductSearchViewState>
37
59
  }
38
60
 
39
61
  export enum CurrentSort {
@@ -141,6 +163,7 @@ export type ProductSearchFastViewState = Pick<ProductSearchViewState, 'searchExp
141
163
  categoryFilter: {
142
164
  categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'isSelected'>>;
143
165
  };
166
+ optionFilters: Array<ProductSearchViewState['filters']['optionFilters'][number]>;
144
167
  };
145
168
  sortBy: ProductSearchViewState['sortBy'];
146
169
  suggestions: Array<ProductSearchViewState['suggestions'][number]>;
@@ -153,6 +176,7 @@ export type ProductSearchInteractiveViewState = Pick<ProductSearchViewState, 'se
153
176
  categoryFilter: {
154
177
  categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'isSelected'>>;
155
178
  };
179
+ optionFilters: Array<ProductSearchViewState['filters']['optionFilters'][number]>;
156
180
  };
157
181
  sortBy: ProductSearchViewState['sortBy'];
158
182
  suggestions: Array<ProductSearchViewState['suggestions'][number]>;
@@ -179,6 +203,11 @@ export interface ProductSearchRefs {
179
203
  categories: {
180
204
  isSelected: HTMLElementCollectionProxy<CategoryOfCategoryFilterOfFilterOfProductSearchViewState, HTMLInputElement>
181
205
  }
206
+ },
207
+ optionFilters: {
208
+ choices: {
209
+ isSelected: HTMLElementCollectionProxy<ChoiceOfOptionFilterOfFilterOfProductSearchViewState, HTMLInputElement>
210
+ }
182
211
  }
183
212
  },
184
213
  sortBy: {
@@ -210,6 +239,11 @@ export interface ProductSearchRepeatedRefs {
210
239
  categories: {
211
240
  isSelected: HTMLElementCollectionProxy<CategoryOfCategoryFilterOfFilterOfProductSearchViewState, HTMLInputElement>
212
241
  }
242
+ },
243
+ optionFilters: {
244
+ choices: {
245
+ isSelected: HTMLElementCollectionProxy<ChoiceOfOptionFilterOfFilterOfProductSearchViewState, HTMLInputElement>
246
+ }
213
247
  }
214
248
  },
215
249
  sortBy: {
@@ -220,4 +254,16 @@ export interface ProductSearchRepeatedRefs {
220
254
  }
221
255
  }
222
256
 
223
- export type ProductSearchContract = JayContract<ProductSearchViewState, ProductSearchRefs, ProductSearchSlowViewState, ProductSearchFastViewState, ProductSearchInteractiveViewState>
257
+ export interface ProductSearchProps {
258
+ category?: string;
259
+ subcategory?: string;
260
+ }
261
+
262
+ import { UrlParams } from '@jay-framework/fullstack-component';
263
+
264
+ export interface ProductSearchParams extends UrlParams {
265
+ category?: string;
266
+ subcategory?: string;
267
+ }
268
+
269
+ export type ProductSearchContract = JayContract<ProductSearchViewState, ProductSearchRefs, ProductSearchSlowViewState, ProductSearchFastViewState, ProductSearchInteractiveViewState, ProductSearchProps>