@jay-framework/wix-stores 0.15.1 → 0.15.5
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 +157 -96
- package/dist/actions/get-variant-stock.jay-action +7 -0
- package/dist/actions/search-products.jay-action +12 -0
- package/dist/contracts/category-page.jay-contract.d.ts +10 -1
- package/dist/contracts/product-card.jay-contract +8 -2
- package/dist/contracts/product-card.jay-contract.d.ts +17 -4
- package/dist/contracts/product-options.jay-contract +0 -5
- package/dist/contracts/product-options.jay-contract.d.ts +1 -2
- package/dist/contracts/product-search.jay-contract +134 -1
- package/dist/contracts/product-search.jay-contract.d.ts +92 -4
- package/dist/index.client.js +276 -24
- package/dist/index.d.ts +230 -149
- package/dist/index.js +613 -156
- package/package.json +18 -16
- package/plugin.yaml +2 -0
|
@@ -168,6 +168,11 @@ tags:
|
|
|
168
168
|
dataType: boolean
|
|
169
169
|
elementType: HTMLInputElement
|
|
170
170
|
description: Category checkbox
|
|
171
|
+
|
|
172
|
+
- tag: categoryUrl
|
|
173
|
+
type: data
|
|
174
|
+
dataType: string
|
|
175
|
+
description: Deep-link URL to this category's dedicated page
|
|
171
176
|
|
|
172
177
|
# Availability filter (fast+interactive)
|
|
173
178
|
- tag: inStockOnly
|
|
@@ -175,7 +180,69 @@ tags:
|
|
|
175
180
|
dataType: boolean
|
|
176
181
|
elementType: HTMLInputElement
|
|
177
182
|
description: Show only in-stock products checkbox
|
|
178
|
-
|
|
183
|
+
|
|
184
|
+
# Option-based filters (e.g., Color, Size)
|
|
185
|
+
- tag: optionFilters
|
|
186
|
+
type: sub-contract
|
|
187
|
+
repeated: true
|
|
188
|
+
trackBy: optionId
|
|
189
|
+
phase: fast+interactive
|
|
190
|
+
description: Filter by product options (e.g., Color, Size)
|
|
191
|
+
tags:
|
|
192
|
+
- tag: optionId
|
|
193
|
+
type: data
|
|
194
|
+
dataType: string
|
|
195
|
+
description: Customization ID
|
|
196
|
+
|
|
197
|
+
- tag: optionName
|
|
198
|
+
type: data
|
|
199
|
+
dataType: string
|
|
200
|
+
description: Option display name (e.g., Color, Size)
|
|
201
|
+
|
|
202
|
+
- tag: optionRenderType
|
|
203
|
+
type: variant
|
|
204
|
+
dataType: enum (TEXT_CHOICES | SWATCH_CHOICES)
|
|
205
|
+
description: How to render the option choices
|
|
206
|
+
|
|
207
|
+
- tag: choices
|
|
208
|
+
type: sub-contract
|
|
209
|
+
repeated: true
|
|
210
|
+
trackBy: choiceId
|
|
211
|
+
description: Available choices for this option
|
|
212
|
+
tags:
|
|
213
|
+
- tag: choiceId
|
|
214
|
+
type: data
|
|
215
|
+
dataType: string
|
|
216
|
+
description: Choice ID
|
|
217
|
+
|
|
218
|
+
- tag: choiceName
|
|
219
|
+
type: data
|
|
220
|
+
dataType: string
|
|
221
|
+
description: Choice display name (e.g., Red, Large)
|
|
222
|
+
|
|
223
|
+
- tag: colorCode
|
|
224
|
+
type: data
|
|
225
|
+
dataType: string
|
|
226
|
+
description: HEX color code (for swatch rendering)
|
|
227
|
+
|
|
228
|
+
- tag: productCount
|
|
229
|
+
type: data
|
|
230
|
+
dataType: number
|
|
231
|
+
phase: fast+interactive
|
|
232
|
+
description: Number of products with this choice in current results
|
|
233
|
+
|
|
234
|
+
- tag: isSelected
|
|
235
|
+
type: [data, interactive]
|
|
236
|
+
dataType: boolean
|
|
237
|
+
elementType: HTMLInputElement
|
|
238
|
+
description: Checkbox to toggle this choice filter
|
|
239
|
+
|
|
240
|
+
- tag: isDisabled
|
|
241
|
+
type: data
|
|
242
|
+
dataType: boolean
|
|
243
|
+
phase: fast+interactive
|
|
244
|
+
description: Whether this choice has no matching products (count=0)
|
|
245
|
+
|
|
179
246
|
- tag: clearFilters
|
|
180
247
|
type: interactive
|
|
181
248
|
elementType: HTMLButtonElement
|
|
@@ -250,3 +317,69 @@ tags:
|
|
|
250
317
|
elementType: HTMLButtonElement
|
|
251
318
|
description: Button to use this suggestion
|
|
252
319
|
|
|
320
|
+
# Category header — always populated via fallback chain (subcategory → category → defaultCategory)
|
|
321
|
+
- tag: categoryHeader
|
|
322
|
+
type: sub-contract
|
|
323
|
+
description: Active category information for the page header
|
|
324
|
+
tags:
|
|
325
|
+
- {tag: name, type: data, dataType: string, description: Category display name}
|
|
326
|
+
- {tag: description, type: data, dataType: string, description: Category plain text description}
|
|
327
|
+
- {tag: imageUrl, type: data, dataType: string, description: Category main image URL}
|
|
328
|
+
- {tag: hasImage, type: variant, dataType: boolean, description: Whether category has an image}
|
|
329
|
+
- {tag: productCount, type: data, dataType: number, description: Number of products in category}
|
|
330
|
+
|
|
331
|
+
- tag: breadcrumbs
|
|
332
|
+
type: sub-contract
|
|
333
|
+
repeated: true
|
|
334
|
+
trackBy: categoryId
|
|
335
|
+
description: Breadcrumb trail from root to current category
|
|
336
|
+
tags:
|
|
337
|
+
- {tag: categoryId, type: data, dataType: string, description: Category GUID}
|
|
338
|
+
- {tag: name, type: data, dataType: string, description: Category name}
|
|
339
|
+
- {tag: slug, type: data, dataType: string, description: Category slug}
|
|
340
|
+
- {tag: url, type: data, dataType: string, description: Full URL path for breadcrumb navigation}
|
|
341
|
+
|
|
342
|
+
- tag: seoData
|
|
343
|
+
type: sub-contract
|
|
344
|
+
description: Category SEO metadata
|
|
345
|
+
tags:
|
|
346
|
+
- tag: tags
|
|
347
|
+
type: sub-contract
|
|
348
|
+
repeated: true
|
|
349
|
+
trackBy: position
|
|
350
|
+
description: SEO tag information
|
|
351
|
+
tags:
|
|
352
|
+
- {tag: position, type: data, dataType: string, description: Tag position as two digit string}
|
|
353
|
+
- {tag: type, type: data, dataType: string, description: SEO tag type}
|
|
354
|
+
- tag: props
|
|
355
|
+
type: sub-contract
|
|
356
|
+
repeated: true
|
|
357
|
+
trackBy: key
|
|
358
|
+
description: Key-value pair of SEO properties
|
|
359
|
+
tags:
|
|
360
|
+
- {tag: key, type: data, dataType: string}
|
|
361
|
+
- {tag: value, type: data, dataType: string}
|
|
362
|
+
- tag: meta
|
|
363
|
+
type: sub-contract
|
|
364
|
+
repeated: true
|
|
365
|
+
trackBy: key
|
|
366
|
+
description: SEO tag metadata
|
|
367
|
+
tags:
|
|
368
|
+
- {tag: key, type: data, dataType: string}
|
|
369
|
+
- {tag: value, type: data, dataType: string}
|
|
370
|
+
- {tag: children, type: data, dataType: string, description: SEO tag inner content}
|
|
371
|
+
- tag: settings
|
|
372
|
+
type: sub-contract
|
|
373
|
+
description: SEO general settings
|
|
374
|
+
tags:
|
|
375
|
+
- {tag: preventAutoRedirect, type: data, dataType: boolean, description: Whether auto-redirect from old URL is enabled}
|
|
376
|
+
- tag: keywords
|
|
377
|
+
type: sub-contract
|
|
378
|
+
repeated: true
|
|
379
|
+
trackBy: term
|
|
380
|
+
description: User-selected keyword terms
|
|
381
|
+
tags:
|
|
382
|
+
- {tag: term, type: data, dataType: string, description: Keyword value}
|
|
383
|
+
- {tag: isMain, type: data, dataType: boolean, description: Whether this is the main focus keyword}
|
|
384
|
+
- {tag: origin, type: data, dataType: string, description: Source that added the keyword}
|
|
385
|
+
|
|
@@ -22,17 +22,40 @@ export interface CategoryOfCategoryFilterOfFilterOfProductSearchViewState {
|
|
|
22
22
|
categoryId: string,
|
|
23
23
|
categoryName: string,
|
|
24
24
|
categorySlug: string,
|
|
25
|
-
isSelected: boolean
|
|
25
|
+
isSelected: boolean,
|
|
26
|
+
categoryUrl: string
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
export interface CategoryFilterOfFilterOfProductSearchViewState {
|
|
29
30
|
categories: Array<CategoryOfCategoryFilterOfFilterOfProductSearchViewState>
|
|
30
31
|
}
|
|
31
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
|
+
|
|
32
54
|
export interface FilterOfProductSearchViewState {
|
|
33
55
|
priceRange: PriceRangeOfFilterOfProductSearchViewState,
|
|
34
56
|
categoryFilter: CategoryFilterOfFilterOfProductSearchViewState,
|
|
35
|
-
inStockOnly: boolean
|
|
57
|
+
inStockOnly: boolean,
|
|
58
|
+
optionFilters: Array<OptionFilterOfFilterOfProductSearchViewState>
|
|
36
59
|
}
|
|
37
60
|
|
|
38
61
|
export enum CurrentSort {
|
|
@@ -53,6 +76,57 @@ export interface SuggestionOfProductSearchViewState {
|
|
|
53
76
|
suggestionText: string
|
|
54
77
|
}
|
|
55
78
|
|
|
79
|
+
export interface BreadcrumbOfCategoryHeaderOfProductSearchViewState {
|
|
80
|
+
categoryId: string,
|
|
81
|
+
name: string,
|
|
82
|
+
slug: string,
|
|
83
|
+
url: string
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface PropOfTagOfSeoDatumOfCategoryHeaderOfProductSearchViewState {
|
|
87
|
+
key: string,
|
|
88
|
+
value: string
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface MetaOfTagOfSeoDatumOfCategoryHeaderOfProductSearchViewState {
|
|
92
|
+
key: string,
|
|
93
|
+
value: string
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
export interface TagOfSeoDatumOfCategoryHeaderOfProductSearchViewState {
|
|
97
|
+
position: string,
|
|
98
|
+
type: string,
|
|
99
|
+
props: Array<PropOfTagOfSeoDatumOfCategoryHeaderOfProductSearchViewState>,
|
|
100
|
+
meta: Array<MetaOfTagOfSeoDatumOfCategoryHeaderOfProductSearchViewState>,
|
|
101
|
+
children: string
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface KeywordOfSettingOfSeoDatumOfCategoryHeaderOfProductSearchViewState {
|
|
105
|
+
term: string,
|
|
106
|
+
isMain: boolean,
|
|
107
|
+
origin: string
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
export interface SettingOfSeoDatumOfCategoryHeaderOfProductSearchViewState {
|
|
111
|
+
preventAutoRedirect: boolean,
|
|
112
|
+
keywords: Array<KeywordOfSettingOfSeoDatumOfCategoryHeaderOfProductSearchViewState>
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
export interface SeoDatumOfCategoryHeaderOfProductSearchViewState {
|
|
116
|
+
tags: Array<TagOfSeoDatumOfCategoryHeaderOfProductSearchViewState>,
|
|
117
|
+
settings: SettingOfSeoDatumOfCategoryHeaderOfProductSearchViewState
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export interface CategoryHeaderOfProductSearchViewState {
|
|
121
|
+
name: string,
|
|
122
|
+
description: string,
|
|
123
|
+
imageUrl: string,
|
|
124
|
+
hasImage: boolean,
|
|
125
|
+
productCount: number,
|
|
126
|
+
breadcrumbs: Array<BreadcrumbOfCategoryHeaderOfProductSearchViewState>,
|
|
127
|
+
seoData: SeoDatumOfCategoryHeaderOfProductSearchViewState
|
|
128
|
+
}
|
|
129
|
+
|
|
56
130
|
export interface ProductSearchViewState {
|
|
57
131
|
searchExpression: string,
|
|
58
132
|
searchFields: string,
|
|
@@ -69,15 +143,17 @@ export interface ProductSearchViewState {
|
|
|
69
143
|
loadedCount: number,
|
|
70
144
|
totalCount: number,
|
|
71
145
|
hasSuggestions: boolean,
|
|
72
|
-
suggestions: Array<SuggestionOfProductSearchViewState
|
|
146
|
+
suggestions: Array<SuggestionOfProductSearchViewState>,
|
|
147
|
+
categoryHeader: CategoryHeaderOfProductSearchViewState
|
|
73
148
|
}
|
|
74
149
|
|
|
75
150
|
export type ProductSearchSlowViewState = Pick<ProductSearchViewState, 'searchFields' | 'fuzzySearch' | 'emptyStateMessage'> & {
|
|
76
151
|
filters: {
|
|
77
152
|
categoryFilter: {
|
|
78
|
-
categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'categoryName' | 'categorySlug'>>;
|
|
153
|
+
categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'categoryName' | 'categorySlug' | 'categoryUrl'>>;
|
|
79
154
|
};
|
|
80
155
|
};
|
|
156
|
+
categoryHeader: ProductSearchViewState['categoryHeader'];
|
|
81
157
|
};
|
|
82
158
|
|
|
83
159
|
export type ProductSearchFastViewState = Pick<ProductSearchViewState, 'searchExpression' | 'isSearching' | 'hasSearched' | 'resultCount' | 'hasResults' | 'hasMore' | 'loadedCount' | 'totalCount' | 'hasSuggestions'> & {
|
|
@@ -87,6 +163,7 @@ export type ProductSearchFastViewState = Pick<ProductSearchViewState, 'searchExp
|
|
|
87
163
|
categoryFilter: {
|
|
88
164
|
categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'isSelected'>>;
|
|
89
165
|
};
|
|
166
|
+
optionFilters: Array<ProductSearchViewState['filters']['optionFilters'][number]>;
|
|
90
167
|
};
|
|
91
168
|
sortBy: ProductSearchViewState['sortBy'];
|
|
92
169
|
suggestions: Array<ProductSearchViewState['suggestions'][number]>;
|
|
@@ -99,6 +176,7 @@ export type ProductSearchInteractiveViewState = Pick<ProductSearchViewState, 'se
|
|
|
99
176
|
categoryFilter: {
|
|
100
177
|
categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'isSelected'>>;
|
|
101
178
|
};
|
|
179
|
+
optionFilters: Array<ProductSearchViewState['filters']['optionFilters'][number]>;
|
|
102
180
|
};
|
|
103
181
|
sortBy: ProductSearchViewState['sortBy'];
|
|
104
182
|
suggestions: Array<ProductSearchViewState['suggestions'][number]>;
|
|
@@ -125,6 +203,11 @@ export interface ProductSearchRefs {
|
|
|
125
203
|
categories: {
|
|
126
204
|
isSelected: HTMLElementCollectionProxy<CategoryOfCategoryFilterOfFilterOfProductSearchViewState, HTMLInputElement>
|
|
127
205
|
}
|
|
206
|
+
},
|
|
207
|
+
optionFilters: {
|
|
208
|
+
choices: {
|
|
209
|
+
isSelected: HTMLElementCollectionProxy<ChoiceOfOptionFilterOfFilterOfProductSearchViewState, HTMLInputElement>
|
|
210
|
+
}
|
|
128
211
|
}
|
|
129
212
|
},
|
|
130
213
|
sortBy: {
|
|
@@ -156,6 +239,11 @@ export interface ProductSearchRepeatedRefs {
|
|
|
156
239
|
categories: {
|
|
157
240
|
isSelected: HTMLElementCollectionProxy<CategoryOfCategoryFilterOfFilterOfProductSearchViewState, HTMLInputElement>
|
|
158
241
|
}
|
|
242
|
+
},
|
|
243
|
+
optionFilters: {
|
|
244
|
+
choices: {
|
|
245
|
+
isSelected: HTMLElementCollectionProxy<ChoiceOfOptionFilterOfFilterOfProductSearchViewState, HTMLInputElement>
|
|
246
|
+
}
|
|
159
247
|
}
|
|
160
248
|
},
|
|
161
249
|
sortBy: {
|