@jay-framework/wix-stores-v1 0.15.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 +150 -0
- package/dist/actions/get-collections.jay-action +12 -0
- package/dist/actions/get-product-by-slug.jay-action +10 -0
- package/dist/actions/search-products.jay-action +32 -0
- package/dist/contracts/category-list.jay-contract +55 -0
- package/dist/contracts/category-list.jay-contract.d.ts +41 -0
- package/dist/contracts/category-page.jay-contract +199 -0
- package/dist/contracts/category-page.jay-contract.d.ts +125 -0
- package/dist/contracts/media-gallery.jay-contract +22 -0
- package/dist/contracts/media-gallery.jay-contract.d.ts +53 -0
- package/dist/contracts/media.jay-contract +5 -0
- package/dist/contracts/media.jay-contract.d.ts +25 -0
- package/dist/contracts/product-card.jay-contract +177 -0
- package/dist/contracts/product-card.jay-contract.d.ts +119 -0
- package/dist/contracts/product-options.jay-contract +66 -0
- package/dist/contracts/product-options.jay-contract.d.ts +57 -0
- package/dist/contracts/product-page.jay-contract +151 -0
- package/dist/contracts/product-page.jay-contract.d.ts +218 -0
- package/dist/contracts/product-search.jay-contract +240 -0
- package/dist/contracts/product-search.jay-contract.d.ts +165 -0
- package/dist/index.client.js +799 -0
- package/dist/index.d.ts +1037 -0
- package/dist/index.js +853 -0
- package/package.json +65 -0
- package/plugin.yaml +31 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,1037 @@
|
|
|
1
|
+
import { getCurrentCartClient, CartState } from '@jay-framework/wix-cart';
|
|
2
|
+
export { AddToCartOptions, CartIndicatorState, CartLineItem, CartState, CartSummary, WIX_CART_CONTEXT, WIX_CART_SERVICE, WixCartContext, WixCartService, cartIndicator, cartPage, provideWixCartContext, provideWixCartService } from '@jay-framework/wix-cart';
|
|
3
|
+
import * as _jay_framework_fullstack_component from '@jay-framework/fullstack-component';
|
|
4
|
+
import { Signals, PageProps, UrlParams } from '@jay-framework/fullstack-component';
|
|
5
|
+
import { WixClient } from '@wix/sdk';
|
|
6
|
+
import { products, collections, inventory } from '@wix/stores';
|
|
7
|
+
import { BuildDescriptors } from '@wix/sdk-types';
|
|
8
|
+
import * as _jay_framework_runtime from '@jay-framework/runtime';
|
|
9
|
+
import { HTMLElementCollectionProxy, HTMLElementProxy } from '@jay-framework/runtime';
|
|
10
|
+
import { Getter } from '@jay-framework/reactive';
|
|
11
|
+
import * as _jay_framework_component from '@jay-framework/component';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Wix Store V1 API Client Factories
|
|
15
|
+
*
|
|
16
|
+
* These functions create singleton instances of Wix Catalog V1 API clients.
|
|
17
|
+
* Used by both the server service and client context.
|
|
18
|
+
*
|
|
19
|
+
* Key difference from V3:
|
|
20
|
+
* - Uses `products` module instead of `productsV3`
|
|
21
|
+
* - Uses `collections` module instead of `@wix/categories`
|
|
22
|
+
*
|
|
23
|
+
* Note: Cart client is provided by @jay-framework/wix-cart package.
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get a configured Wix Stores Products client (Catalog V1) (singleton)
|
|
28
|
+
*
|
|
29
|
+
* The Products API (V1) is the original Wix Stores catalog API.
|
|
30
|
+
*
|
|
31
|
+
* @returns Products client instance from @wix/stores
|
|
32
|
+
* @see https://dev.wix.com/docs/sdk/backend-modules/stores/products/introduction
|
|
33
|
+
*/
|
|
34
|
+
declare function getProductsClient(wixClient: WixClient): BuildDescriptors<typeof products, {}>;
|
|
35
|
+
/**
|
|
36
|
+
* Get a configured Wix Stores Collections client (singleton)
|
|
37
|
+
*
|
|
38
|
+
* The Collections API allows you to manage product Collections in your Wix store.
|
|
39
|
+
* Note: V3 uses @wix/categories instead.
|
|
40
|
+
*
|
|
41
|
+
* @returns Collections client instance from @wix/stores
|
|
42
|
+
* @see https://dev.wix.com/docs/sdk/backend-modules/stores/collections/introduction
|
|
43
|
+
*/
|
|
44
|
+
declare function getCollectionsClient(wixClient: WixClient): BuildDescriptors<typeof collections, {}>;
|
|
45
|
+
/**
|
|
46
|
+
* Get a configured Wix Stores Inventory client (singleton)
|
|
47
|
+
*
|
|
48
|
+
* The Inventory API allows you to manage product inventory in your Wix store.
|
|
49
|
+
*
|
|
50
|
+
* @returns Inventory client instance from @wix/stores
|
|
51
|
+
* @see https://dev.wix.com/docs/sdk/backend-modules/stores/inventory/introduction
|
|
52
|
+
*/
|
|
53
|
+
declare function getInventoryClient(wixClient: WixClient): BuildDescriptors<typeof inventory, {}>;
|
|
54
|
+
|
|
55
|
+
interface WixStoresV1Service {
|
|
56
|
+
products: ReturnType<typeof getProductsClient>;
|
|
57
|
+
collections: ReturnType<typeof getCollectionsClient>;
|
|
58
|
+
inventory: ReturnType<typeof getInventoryClient>;
|
|
59
|
+
/** @deprecated Use WIX_CART_SERVICE from @jay-framework/wix-cart instead */
|
|
60
|
+
cart: ReturnType<typeof getCurrentCartClient>;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Server service marker for Wix Stores V1.
|
|
64
|
+
* Use with `.withServices(WIX_STORES_V1_SERVICE_MARKER)` in component definitions.
|
|
65
|
+
*/
|
|
66
|
+
declare const WIX_STORES_V1_SERVICE_MARKER: _jay_framework_fullstack_component.ServiceMarker<WixStoresV1Service>;
|
|
67
|
+
/**
|
|
68
|
+
* Creates, registers, and returns a Wix Stores V1 service instance.
|
|
69
|
+
* Called during server initialization.
|
|
70
|
+
*/
|
|
71
|
+
declare function provideWixStoresV1Service(wixClient: WixClient): WixStoresV1Service;
|
|
72
|
+
|
|
73
|
+
declare enum OptionRenderType$1 {
|
|
74
|
+
TEXT_CHOICES,
|
|
75
|
+
COLOR_SWATCH_CHOICES
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
declare enum ChoiceType$1 {
|
|
79
|
+
CHOICE_TEXT,
|
|
80
|
+
ONE_COLOR
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
interface ChoiceOfProductOptionsViewState {
|
|
84
|
+
choiceId: string,
|
|
85
|
+
name: string,
|
|
86
|
+
choiceType: ChoiceType$1,
|
|
87
|
+
colorCode: string,
|
|
88
|
+
inStock: boolean,
|
|
89
|
+
variantId: string,
|
|
90
|
+
isSelected: boolean
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
interface ProductOptionsViewState {
|
|
94
|
+
_id: string,
|
|
95
|
+
name: string,
|
|
96
|
+
optionRenderType: OptionRenderType$1,
|
|
97
|
+
choices: Array<ChoiceOfProductOptionsViewState>
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
|
|
101
|
+
interface ProductOptionsRepeatedRefs {
|
|
102
|
+
choices: {
|
|
103
|
+
choiceButton: HTMLElementCollectionProxy<ChoiceOfProductOptionsViewState, HTMLButtonElement>
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
declare enum MediaType$2 {
|
|
108
|
+
IMAGE,
|
|
109
|
+
VIDEO
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
interface MainMediaOfProductCardViewState {
|
|
113
|
+
url: string,
|
|
114
|
+
altText: string,
|
|
115
|
+
mediaType: MediaType$2
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
interface ThumbnailOfProductCardViewState {
|
|
119
|
+
url: string,
|
|
120
|
+
altText: string,
|
|
121
|
+
width: number,
|
|
122
|
+
height: number
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
declare enum AvailabilityStatus {
|
|
126
|
+
IN_STOCK,
|
|
127
|
+
OUT_OF_STOCK,
|
|
128
|
+
PARTIALLY_OUT_OF_STOCK
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
declare enum PreorderStatus {
|
|
132
|
+
ENABLED,
|
|
133
|
+
DISABLED,
|
|
134
|
+
PARTIALLY_ENABLED
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
interface InventoryOfProductCardViewState {
|
|
138
|
+
availabilityStatus: AvailabilityStatus,
|
|
139
|
+
preorderStatus: PreorderStatus
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
interface RibbonOfProductCardViewState {
|
|
143
|
+
_id: string,
|
|
144
|
+
name: string
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
interface BrandOfProductCardViewState {
|
|
148
|
+
_id: string,
|
|
149
|
+
name: string
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
declare enum ProductType$1 {
|
|
153
|
+
PHYSICAL,
|
|
154
|
+
DIGITAL
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
declare enum QuickAddType {
|
|
158
|
+
SIMPLE,
|
|
159
|
+
SINGLE_OPTION,
|
|
160
|
+
NEEDS_CONFIGURATION
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
interface ProductCardViewState {
|
|
164
|
+
_id: string,
|
|
165
|
+
name: string,
|
|
166
|
+
slug: string,
|
|
167
|
+
productUrl: string,
|
|
168
|
+
mainMedia: MainMediaOfProductCardViewState,
|
|
169
|
+
thumbnail: ThumbnailOfProductCardViewState,
|
|
170
|
+
price: string,
|
|
171
|
+
strikethroughPrice: string,
|
|
172
|
+
hasDiscount: boolean,
|
|
173
|
+
inventory: InventoryOfProductCardViewState,
|
|
174
|
+
ribbon: RibbonOfProductCardViewState,
|
|
175
|
+
hasRibbon: boolean,
|
|
176
|
+
brand: BrandOfProductCardViewState,
|
|
177
|
+
productType: ProductType$1,
|
|
178
|
+
isAddingToCart: boolean,
|
|
179
|
+
quickAddType: QuickAddType,
|
|
180
|
+
quickOption: ProductOptionsViewState
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
|
|
184
|
+
interface ProductCardRepeatedRefs {
|
|
185
|
+
productLink: HTMLElementCollectionProxy<ProductCardViewState, HTMLAnchorElement>,
|
|
186
|
+
addToCartButton: HTMLElementCollectionProxy<ProductCardViewState, HTMLButtonElement>,
|
|
187
|
+
viewOptionsButton: HTMLElementCollectionProxy<ProductCardViewState, HTMLButtonElement>,
|
|
188
|
+
quickOption: ProductOptionsRepeatedRefs
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Wix Stores Catalog V1 Product Mapping Utilities
|
|
193
|
+
*
|
|
194
|
+
* Maps Wix Stores Catalog V1 product responses to view state contracts.
|
|
195
|
+
*
|
|
196
|
+
* Key V1 vs V3 differences handled here:
|
|
197
|
+
* - V1 prices are numbers (289), V3 are strings ("120")
|
|
198
|
+
* - V1 has price.formatted.price, V3 doesn't include formatted in response
|
|
199
|
+
* - V1 uses stock.inStock/inventoryStatus, V3 uses inventory.availabilityStatus
|
|
200
|
+
* - V1 media URLs are complete, V3 uses wix:image:// URIs
|
|
201
|
+
* - V1 uses productOptions[], V3 uses options[]
|
|
202
|
+
*
|
|
203
|
+
* Reference: wix/exploration/query-products-catalog-v1/output/individual/*.json
|
|
204
|
+
*/
|
|
205
|
+
|
|
206
|
+
interface V1Collection {
|
|
207
|
+
_id?: string;
|
|
208
|
+
name?: string;
|
|
209
|
+
slug?: string;
|
|
210
|
+
description?: string;
|
|
211
|
+
media?: {
|
|
212
|
+
mainMedia?: {
|
|
213
|
+
image?: {
|
|
214
|
+
url: string;
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
};
|
|
218
|
+
numberOfProducts?: number;
|
|
219
|
+
}
|
|
220
|
+
interface CollectionViewState {
|
|
221
|
+
_id: string;
|
|
222
|
+
name: string;
|
|
223
|
+
slug: string;
|
|
224
|
+
description: string;
|
|
225
|
+
imageUrl: string;
|
|
226
|
+
productCount: number;
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Configuration passed from server to client for Wix Stores V1.
|
|
231
|
+
*/
|
|
232
|
+
interface WixStoresV1InitData {
|
|
233
|
+
/** Enable client-side cart operations */
|
|
234
|
+
enableClientCart: boolean;
|
|
235
|
+
/** Enable client-side search */
|
|
236
|
+
enableClientSearch: boolean;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Reactive cart indicator state.
|
|
240
|
+
*/
|
|
241
|
+
interface ReactiveCartIndicator {
|
|
242
|
+
itemCount: Getter<number>;
|
|
243
|
+
hasItems: Getter<boolean>;
|
|
244
|
+
}
|
|
245
|
+
/**
|
|
246
|
+
* Result of a cart operation that modifies items.
|
|
247
|
+
*/
|
|
248
|
+
interface CartOperationResult {
|
|
249
|
+
cartState: CartState;
|
|
250
|
+
}
|
|
251
|
+
/**
|
|
252
|
+
* Client-side Wix Stores V1 context interface.
|
|
253
|
+
*/
|
|
254
|
+
interface WixStoresV1Context {
|
|
255
|
+
cartIndicator: ReactiveCartIndicator;
|
|
256
|
+
refreshCartIndicator(): Promise<void>;
|
|
257
|
+
getEstimatedCart(): Promise<CartState>;
|
|
258
|
+
addToCart(productId: string, quantity?: number, variantId?: string): Promise<CartOperationResult>;
|
|
259
|
+
removeLineItems(lineItemIds: string[]): Promise<CartOperationResult>;
|
|
260
|
+
updateLineItemQuantity(lineItemId: string, quantity: number): Promise<CartOperationResult>;
|
|
261
|
+
clearCart(): Promise<void>;
|
|
262
|
+
applyCoupon(couponCode: string): Promise<CartOperationResult>;
|
|
263
|
+
removeCoupon(): Promise<CartOperationResult>;
|
|
264
|
+
loadMoreCollectionProducts(collectionId: string, page: number, pageSize: number): Promise<{
|
|
265
|
+
products: ProductCardViewState[];
|
|
266
|
+
hasMore: boolean;
|
|
267
|
+
totalProducts: number;
|
|
268
|
+
}>;
|
|
269
|
+
getCollections(): Promise<CollectionViewState[]>;
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Context marker for client-side Wix Stores V1 operations.
|
|
273
|
+
*/
|
|
274
|
+
declare const WIX_STORES_V1_CONTEXT: _jay_framework_runtime.ContextMarker<WixStoresV1Context>;
|
|
275
|
+
|
|
276
|
+
/**
|
|
277
|
+
* Sort options for product search
|
|
278
|
+
*/
|
|
279
|
+
type ProductSortField = 'relevance' | 'price_asc' | 'price_desc' | 'name_asc' | 'name_desc' | 'newest';
|
|
280
|
+
/**
|
|
281
|
+
* Product search filters
|
|
282
|
+
*/
|
|
283
|
+
interface ProductSearchFilters {
|
|
284
|
+
/** Minimum price filter */
|
|
285
|
+
minPrice?: number;
|
|
286
|
+
/** Maximum price filter */
|
|
287
|
+
maxPrice?: number;
|
|
288
|
+
/** Filter by collection IDs (V1 uses collections, not categories) */
|
|
289
|
+
collectionIds?: string[];
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Input for searchProducts action
|
|
293
|
+
*/
|
|
294
|
+
interface SearchProductsInput {
|
|
295
|
+
/** Search query text */
|
|
296
|
+
query: string;
|
|
297
|
+
/** Filters to apply */
|
|
298
|
+
filters?: ProductSearchFilters;
|
|
299
|
+
/** Sort order */
|
|
300
|
+
sortBy?: ProductSortField;
|
|
301
|
+
/** Page number for pagination (1-based) */
|
|
302
|
+
page?: number;
|
|
303
|
+
/** Items per page (default: 12) */
|
|
304
|
+
pageSize?: number;
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Price range bucket for filter UI
|
|
308
|
+
*/
|
|
309
|
+
interface PriceRangeBucket {
|
|
310
|
+
rangeId: string;
|
|
311
|
+
label: string;
|
|
312
|
+
minValue: number | null;
|
|
313
|
+
maxValue: number | null;
|
|
314
|
+
isSelected: boolean;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* Price aggregation data for filter UI
|
|
318
|
+
*/
|
|
319
|
+
interface PriceAggregationData {
|
|
320
|
+
/** Minimum price across all products */
|
|
321
|
+
minBound: number;
|
|
322
|
+
/** Maximum price across all products */
|
|
323
|
+
maxBound: number;
|
|
324
|
+
/** Computed price range buckets */
|
|
325
|
+
ranges: PriceRangeBucket[];
|
|
326
|
+
}
|
|
327
|
+
/**
|
|
328
|
+
* Output for searchProducts action
|
|
329
|
+
*/
|
|
330
|
+
interface SearchProductsOutput {
|
|
331
|
+
/** List of matching products */
|
|
332
|
+
products: ProductCardViewState[];
|
|
333
|
+
/** Total number of matching products */
|
|
334
|
+
totalCount: number;
|
|
335
|
+
/** Current page number */
|
|
336
|
+
currentPage: number;
|
|
337
|
+
/** Total number of pages */
|
|
338
|
+
totalPages: number;
|
|
339
|
+
/** Whether there are more results */
|
|
340
|
+
hasMore: boolean;
|
|
341
|
+
/** Price aggregation data (bounds and computed ranges) */
|
|
342
|
+
priceAggregation: PriceAggregationData;
|
|
343
|
+
}
|
|
344
|
+
/**
|
|
345
|
+
* Input for getProductBySlug action
|
|
346
|
+
*/
|
|
347
|
+
interface GetProductBySlugInput {
|
|
348
|
+
/** Product URL slug */
|
|
349
|
+
slug: string;
|
|
350
|
+
}
|
|
351
|
+
/**
|
|
352
|
+
* Search products using the Wix Stores Catalog V1 queryProducts API.
|
|
353
|
+
*
|
|
354
|
+
* V1 uses skip-based pagination and query builder syntax.
|
|
355
|
+
*
|
|
356
|
+
* Server-side filtering/sorting:
|
|
357
|
+
* - name: startsWith() for text search
|
|
358
|
+
* - collectionIds: hasSome() for collection filtering
|
|
359
|
+
* - priceData.price: ge()/le() for price range filtering
|
|
360
|
+
* - Sorting: ascending()/descending() on price, name, lastUpdated
|
|
361
|
+
*
|
|
362
|
+
* Also fetches min/max prices in parallel for price range filter UI.
|
|
363
|
+
*
|
|
364
|
+
* @see https://dev.wix.com/docs/sdk/backend-modules/stores/products/query-products
|
|
365
|
+
*
|
|
366
|
+
* @example
|
|
367
|
+
* ```typescript
|
|
368
|
+
* const results = await searchProducts({
|
|
369
|
+
* query: 'whisky',
|
|
370
|
+
* filters: { minPrice: 50, maxPrice: 200 },
|
|
371
|
+
* sortBy: 'price_asc',
|
|
372
|
+
* pageSize: 12,
|
|
373
|
+
* page: 1
|
|
374
|
+
* });
|
|
375
|
+
* // results.priceAggregation = {
|
|
376
|
+
* // minBound: 25,
|
|
377
|
+
* // maxBound: 500,
|
|
378
|
+
* // ranges: [
|
|
379
|
+
* // { rangeId: 'all', label: 'Show all', minValue: null, maxValue: null, isSelected: true },
|
|
380
|
+
* // { rangeId: '0-100', label: '$0 - $100', minValue: 0, maxValue: 100, isSelected: false },
|
|
381
|
+
* // { rangeId: '100-200', label: '$100 - $200', ... },
|
|
382
|
+
* // ...
|
|
383
|
+
* // ]
|
|
384
|
+
* // }
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
declare const searchProducts: _jay_framework_fullstack_component.JayAction<SearchProductsInput, SearchProductsOutput> & _jay_framework_fullstack_component.JayActionDefinition<SearchProductsInput, SearchProductsOutput, [WixStoresV1Service]>;
|
|
388
|
+
/**
|
|
389
|
+
* Get a single product by its URL slug.
|
|
390
|
+
*
|
|
391
|
+
* @example
|
|
392
|
+
* ```typescript
|
|
393
|
+
* const product = await getProductBySlug({ slug: 'peat-s-beast-px-finish-54-1' });
|
|
394
|
+
* ```
|
|
395
|
+
*/
|
|
396
|
+
declare const getProductBySlug: _jay_framework_fullstack_component.JayAction<GetProductBySlugInput, ProductCardViewState> & _jay_framework_fullstack_component.JayActionDefinition<GetProductBySlugInput, ProductCardViewState, [WixStoresV1Service]>;
|
|
397
|
+
/**
|
|
398
|
+
* Get available collections for filtering.
|
|
399
|
+
* V1 uses collections instead of categories.
|
|
400
|
+
*
|
|
401
|
+
* @example
|
|
402
|
+
* ```typescript
|
|
403
|
+
* const collections = await getCollections();
|
|
404
|
+
* ```
|
|
405
|
+
*/
|
|
406
|
+
declare const getCollections: _jay_framework_fullstack_component.JayAction<Record<string, never>, CollectionViewState[]> & _jay_framework_fullstack_component.JayActionDefinition<Record<string, never>, CollectionViewState[], [WixStoresV1Service]>;
|
|
407
|
+
|
|
408
|
+
declare enum MediaType$1 {
|
|
409
|
+
IMAGE,
|
|
410
|
+
VIDEO
|
|
411
|
+
}
|
|
412
|
+
|
|
413
|
+
interface MediaViewState {
|
|
414
|
+
url: string,
|
|
415
|
+
mediaType: MediaType$1,
|
|
416
|
+
thumbnail_50x50: string
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
interface MediaRefs {}
|
|
420
|
+
|
|
421
|
+
declare enum Selected {
|
|
422
|
+
selected,
|
|
423
|
+
notSelected
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
interface AvailableMediaOfMediaGalleryViewState {
|
|
427
|
+
mediaId: string,
|
|
428
|
+
media: MediaViewState,
|
|
429
|
+
selected: Selected
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
interface MediaGalleryViewState {
|
|
433
|
+
selectedMedia: MediaViewState,
|
|
434
|
+
availableMedia: Array<AvailableMediaOfMediaGalleryViewState>
|
|
435
|
+
}
|
|
436
|
+
|
|
437
|
+
|
|
438
|
+
interface MediaGalleryRefs {
|
|
439
|
+
selectedMedia: MediaRefs,
|
|
440
|
+
availableMedia: {
|
|
441
|
+
selected: HTMLElementCollectionProxy<AvailableMediaOfMediaGalleryViewState, HTMLImageElement | HTMLDivElement>,
|
|
442
|
+
media: MediaRefs
|
|
443
|
+
}
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
declare enum ProductType {
|
|
447
|
+
PHYSICAL,
|
|
448
|
+
DIGITAL
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
declare enum StockStatus {
|
|
452
|
+
OUT_OF_STOCK,
|
|
453
|
+
IN_STOCK
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
interface QuantityOfProductPageViewState {
|
|
457
|
+
quantity: number
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
declare enum OptionRenderType {
|
|
461
|
+
TEXT_CHOICES,
|
|
462
|
+
COLOR_SWATCH_CHOICES
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
interface ChoiceOfOptionOfProductPageViewState {
|
|
466
|
+
choiceId: string,
|
|
467
|
+
choiceType: ChoiceType,
|
|
468
|
+
name: string,
|
|
469
|
+
colorCode: string,
|
|
470
|
+
inStock: boolean,
|
|
471
|
+
isSelected: boolean
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
interface OptionOfProductPageViewState {
|
|
475
|
+
_id: string,
|
|
476
|
+
name: string,
|
|
477
|
+
optionRenderType: OptionRenderType,
|
|
478
|
+
textChoiceSelection: string,
|
|
479
|
+
choices: Array<ChoiceOfOptionOfProductPageViewState>
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
interface InfoSectionOfProductPageViewState {
|
|
483
|
+
_id: string,
|
|
484
|
+
title: string,
|
|
485
|
+
plainDescription: string
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
declare enum ModifierType {
|
|
489
|
+
TEXT_CHOICES,
|
|
490
|
+
COLOR_SWATCH_CHOICES,
|
|
491
|
+
FREE_TEXT
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
declare enum ChoiceType {
|
|
495
|
+
CHOICE_TEXT,
|
|
496
|
+
ONE_COLOR
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
declare enum ChoiceType {
|
|
500
|
+
CHOICE_TEXT,
|
|
501
|
+
ONE_COLOR
|
|
502
|
+
}
|
|
503
|
+
|
|
504
|
+
interface ChoiceOfModifierOfProductPageViewState {
|
|
505
|
+
choiceId: string,
|
|
506
|
+
choiceType: ChoiceType,
|
|
507
|
+
name: string,
|
|
508
|
+
colorCode: string,
|
|
509
|
+
isSelected: boolean
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
interface ModifierOfProductPageViewState {
|
|
513
|
+
_id: string,
|
|
514
|
+
name: string,
|
|
515
|
+
modifierType: ModifierType,
|
|
516
|
+
textModifierSelection: string,
|
|
517
|
+
textInputLength: number,
|
|
518
|
+
textInputRequired: boolean,
|
|
519
|
+
choices: Array<ChoiceOfModifierOfProductPageViewState>
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
interface PropOfTagOfSeoDatumOfProductPageViewState {
|
|
523
|
+
key: string,
|
|
524
|
+
value: string
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
interface MetaOfTagOfSeoDatumOfProductPageViewState {
|
|
528
|
+
key: string,
|
|
529
|
+
value: string
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
interface TagOfSeoDatumOfProductPageViewState {
|
|
533
|
+
position: string,
|
|
534
|
+
type: string,
|
|
535
|
+
props: Array<PropOfTagOfSeoDatumOfProductPageViewState>,
|
|
536
|
+
meta: Array<MetaOfTagOfSeoDatumOfProductPageViewState>,
|
|
537
|
+
children: string
|
|
538
|
+
}
|
|
539
|
+
|
|
540
|
+
interface KeywordOfSettingOfSeoDatumOfProductPageViewState {
|
|
541
|
+
term: string,
|
|
542
|
+
isMain: boolean,
|
|
543
|
+
origin: string
|
|
544
|
+
}
|
|
545
|
+
|
|
546
|
+
interface SettingOfSeoDatumOfProductPageViewState {
|
|
547
|
+
preventAutoRedirect: boolean,
|
|
548
|
+
keywords: Array<KeywordOfSettingOfSeoDatumOfProductPageViewState>
|
|
549
|
+
}
|
|
550
|
+
|
|
551
|
+
interface SeoDatumOfProductPageViewState {
|
|
552
|
+
tags: Array<TagOfSeoDatumOfProductPageViewState>,
|
|
553
|
+
settings: SettingOfSeoDatumOfProductPageViewState
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
interface ProductPageViewState {
|
|
557
|
+
_id: string,
|
|
558
|
+
productName: string,
|
|
559
|
+
mediaGallery: MediaGalleryViewState,
|
|
560
|
+
description: string,
|
|
561
|
+
brand: string,
|
|
562
|
+
ribbon: string,
|
|
563
|
+
productType: ProductType,
|
|
564
|
+
sku: string,
|
|
565
|
+
price: string,
|
|
566
|
+
strikethroughPrice: string,
|
|
567
|
+
pricePerUnit: string,
|
|
568
|
+
stockStatus: StockStatus,
|
|
569
|
+
quantity: QuantityOfProductPageViewState,
|
|
570
|
+
actionsEnabled: boolean,
|
|
571
|
+
options: Array<OptionOfProductPageViewState>,
|
|
572
|
+
infoSections: Array<InfoSectionOfProductPageViewState>,
|
|
573
|
+
modifiers: Array<ModifierOfProductPageViewState>,
|
|
574
|
+
seoData: SeoDatumOfProductPageViewState
|
|
575
|
+
}
|
|
576
|
+
|
|
577
|
+
type ProductPageSlowViewState = Pick<ProductPageViewState, '_id' | 'productName' | 'description' | 'brand' | 'ribbon' | 'productType'> & {
|
|
578
|
+
options: Array<Pick<ProductPageViewState['options'][number], '_id' | 'name' | 'optionRenderType'> & {
|
|
579
|
+
choices: Array<Pick<ProductPageViewState['options'][number]['choices'][number], 'choiceId' | 'choiceType' | 'name' | 'colorCode' | 'inStock'>>;
|
|
580
|
+
}>;
|
|
581
|
+
infoSections: Array<ProductPageViewState['infoSections'][number]>;
|
|
582
|
+
modifiers: Array<Pick<ProductPageViewState['modifiers'][number], '_id' | 'name' | 'modifierType' | 'textInputLength' | 'textInputRequired'> & {
|
|
583
|
+
choices: Array<Pick<ProductPageViewState['modifiers'][number]['choices'][number], 'choiceId' | 'choiceType' | 'name' | 'colorCode'>>;
|
|
584
|
+
}>;
|
|
585
|
+
seoData: ProductPageViewState['seoData'];
|
|
586
|
+
};
|
|
587
|
+
|
|
588
|
+
type ProductPageFastViewState = Pick<ProductPageViewState, 'sku' | 'price' | 'strikethroughPrice' | 'pricePerUnit' | 'stockStatus' | 'actionsEnabled'> & {
|
|
589
|
+
mediaGallery: ProductPageViewState['mediaGallery'];
|
|
590
|
+
quantity: ProductPageViewState['quantity'];
|
|
591
|
+
options: Array<Pick<ProductPageViewState['options'][number], '_id' | 'textChoiceSelection'> & {
|
|
592
|
+
choices: Array<Pick<ProductPageViewState['options'][number]['choices'][number], 'choiceId' | 'isSelected'>>;
|
|
593
|
+
}>;
|
|
594
|
+
modifiers: Array<Pick<ProductPageViewState['modifiers'][number], '_id' | 'textModifierSelection'> & {
|
|
595
|
+
choices: Array<Pick<ProductPageViewState['modifiers'][number]['choices'][number], 'choiceId' | 'isSelected'>>;
|
|
596
|
+
}>;
|
|
597
|
+
};
|
|
598
|
+
|
|
599
|
+
type ProductPageInteractiveViewState = Pick<ProductPageViewState, 'sku' | 'price' | 'strikethroughPrice' | 'pricePerUnit' | 'stockStatus' | 'actionsEnabled'> & {
|
|
600
|
+
mediaGallery: ProductPageViewState['mediaGallery'];
|
|
601
|
+
quantity: ProductPageViewState['quantity'];
|
|
602
|
+
options: Array<Pick<ProductPageViewState['options'][number], '_id' | 'textChoiceSelection'> & {
|
|
603
|
+
choices: Array<Pick<ProductPageViewState['options'][number]['choices'][number], 'choiceId' | 'isSelected'>>;
|
|
604
|
+
}>;
|
|
605
|
+
modifiers: Array<Pick<ProductPageViewState['modifiers'][number], '_id' | 'textModifierSelection'> & {
|
|
606
|
+
choices: Array<Pick<ProductPageViewState['modifiers'][number]['choices'][number], 'choiceId' | 'isSelected'>>;
|
|
607
|
+
}>;
|
|
608
|
+
};
|
|
609
|
+
|
|
610
|
+
|
|
611
|
+
interface ProductPageRefs {
|
|
612
|
+
addToCartButton: HTMLElementProxy<ProductPageViewState, HTMLButtonElement>,
|
|
613
|
+
buyNowButton: HTMLElementProxy<ProductPageViewState, HTMLButtonElement>,
|
|
614
|
+
mediaGallery: MediaGalleryRefs,
|
|
615
|
+
quantity: {
|
|
616
|
+
decrementButton: HTMLElementProxy<QuantityOfProductPageViewState, HTMLButtonElement>,
|
|
617
|
+
incrementButton: HTMLElementProxy<QuantityOfProductPageViewState, HTMLButtonElement>,
|
|
618
|
+
quantity: HTMLElementProxy<QuantityOfProductPageViewState, HTMLInputElement>
|
|
619
|
+
},
|
|
620
|
+
options: {
|
|
621
|
+
textChoice: HTMLElementCollectionProxy<OptionOfProductPageViewState, HTMLSelectElement>,
|
|
622
|
+
choices: {
|
|
623
|
+
choiceButton: HTMLElementCollectionProxy<ChoiceOfOptionOfProductPageViewState, HTMLButtonElement>
|
|
624
|
+
}
|
|
625
|
+
},
|
|
626
|
+
modifiers: {
|
|
627
|
+
textModifier: HTMLElementCollectionProxy<ModifierOfProductPageViewState, HTMLSelectElement>,
|
|
628
|
+
textInput: HTMLElementCollectionProxy<ModifierOfProductPageViewState, HTMLInputElement | HTMLAreaElement>,
|
|
629
|
+
choices: {
|
|
630
|
+
choiceButton: HTMLElementCollectionProxy<ChoiceOfModifierOfProductPageViewState, HTMLButtonElement>
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
|
|
635
|
+
/**
|
|
636
|
+
* URL parameters for product page routes
|
|
637
|
+
*/
|
|
638
|
+
interface ProductPageParams extends UrlParams {
|
|
639
|
+
slug: string;
|
|
640
|
+
}
|
|
641
|
+
interface InteractiveVariant {
|
|
642
|
+
_id: string;
|
|
643
|
+
sku: string;
|
|
644
|
+
price: string;
|
|
645
|
+
strikethroughPrice: string;
|
|
646
|
+
choices: Record<string, string>;
|
|
647
|
+
inventoryStatus: StockStatus;
|
|
648
|
+
}
|
|
649
|
+
interface ProductSlowCarryForward {
|
|
650
|
+
productId: string;
|
|
651
|
+
mediaGallery: MediaGalleryViewState;
|
|
652
|
+
options: ProductPageFastViewState['options'];
|
|
653
|
+
pricePerUnit: string;
|
|
654
|
+
stockStatus: StockStatus;
|
|
655
|
+
variants: InteractiveVariant[];
|
|
656
|
+
}
|
|
657
|
+
interface ProductFastCarryForward {
|
|
658
|
+
productId: string;
|
|
659
|
+
variants: InteractiveVariant[];
|
|
660
|
+
}
|
|
661
|
+
/**
|
|
662
|
+
* Product Page Component (V1)
|
|
663
|
+
*
|
|
664
|
+
* A complete headless product page using Wix Catalog V1 API.
|
|
665
|
+
*/
|
|
666
|
+
declare const productPage: _jay_framework_fullstack_component.JayStackComponentDefinition<ProductPageRefs, ProductPageSlowViewState, ProductPageFastViewState, ProductPageInteractiveViewState, [ProductSlowCarryForward, WixStoresV1Service], [Signals<ProductPageFastViewState>, ProductFastCarryForward, WixStoresV1Context], PageProps & ProductPageParams, ProductPageParams, _jay_framework_component.JayComponentCore<PageProps & ProductPageParams, ProductPageInteractiveViewState>>;
|
|
667
|
+
|
|
668
|
+
interface RangeOfPriceRangeOfFilterOfProductSearchViewState {
|
|
669
|
+
rangeId: string,
|
|
670
|
+
label: string,
|
|
671
|
+
minValue: number,
|
|
672
|
+
maxValue: number,
|
|
673
|
+
isSelected: boolean
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
interface PriceRangeOfFilterOfProductSearchViewState {
|
|
677
|
+
minPrice: number,
|
|
678
|
+
maxPrice: number,
|
|
679
|
+
minBound: number,
|
|
680
|
+
maxBound: number,
|
|
681
|
+
ranges: Array<RangeOfPriceRangeOfFilterOfProductSearchViewState>
|
|
682
|
+
}
|
|
683
|
+
|
|
684
|
+
interface CategoryOfCategoryFilterOfFilterOfProductSearchViewState {
|
|
685
|
+
categoryId: string,
|
|
686
|
+
categoryName: string,
|
|
687
|
+
categorySlug: string,
|
|
688
|
+
isSelected: boolean
|
|
689
|
+
}
|
|
690
|
+
|
|
691
|
+
interface CategoryFilterOfFilterOfProductSearchViewState {
|
|
692
|
+
categories: Array<CategoryOfCategoryFilterOfFilterOfProductSearchViewState>
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
interface FilterOfProductSearchViewState {
|
|
696
|
+
priceRange: PriceRangeOfFilterOfProductSearchViewState,
|
|
697
|
+
categoryFilter: CategoryFilterOfFilterOfProductSearchViewState
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
declare enum CurrentSort {
|
|
701
|
+
relevance,
|
|
702
|
+
priceAsc,
|
|
703
|
+
priceDesc,
|
|
704
|
+
newest,
|
|
705
|
+
nameAsc,
|
|
706
|
+
nameDesc
|
|
707
|
+
}
|
|
708
|
+
|
|
709
|
+
interface SortByOfProductSearchViewState {
|
|
710
|
+
currentSort: CurrentSort
|
|
711
|
+
}
|
|
712
|
+
|
|
713
|
+
interface SuggestionOfProductSearchViewState {
|
|
714
|
+
suggestionId: string,
|
|
715
|
+
suggestionText: string
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
interface ProductSearchViewState {
|
|
719
|
+
searchExpression: string,
|
|
720
|
+
searchFields: string,
|
|
721
|
+
fuzzySearch: boolean,
|
|
722
|
+
isSearching: boolean,
|
|
723
|
+
hasSearched: boolean,
|
|
724
|
+
searchResults: Array<ProductCardViewState>,
|
|
725
|
+
resultCount: number,
|
|
726
|
+
hasResults: boolean,
|
|
727
|
+
emptyStateMessage: string,
|
|
728
|
+
filters: FilterOfProductSearchViewState,
|
|
729
|
+
sortBy: SortByOfProductSearchViewState,
|
|
730
|
+
hasMore: boolean,
|
|
731
|
+
loadedCount: number,
|
|
732
|
+
totalCount: number,
|
|
733
|
+
hasSuggestions: boolean,
|
|
734
|
+
suggestions: Array<SuggestionOfProductSearchViewState>
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
type ProductSearchSlowViewState = Pick<ProductSearchViewState, 'searchFields' | 'fuzzySearch' | 'emptyStateMessage'> & {
|
|
738
|
+
filters: {
|
|
739
|
+
categoryFilter: {
|
|
740
|
+
categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'categoryName' | 'categorySlug'>>;
|
|
741
|
+
};
|
|
742
|
+
};
|
|
743
|
+
};
|
|
744
|
+
|
|
745
|
+
type ProductSearchFastViewState = Pick<ProductSearchViewState, 'searchExpression' | 'isSearching' | 'hasSearched' | 'resultCount' | 'hasResults' | 'hasMore' | 'loadedCount' | 'totalCount' | 'hasSuggestions'> & {
|
|
746
|
+
searchResults: Array<ProductSearchViewState['searchResults'][number]>;
|
|
747
|
+
filters: {
|
|
748
|
+
priceRange: ProductSearchViewState['filters']['priceRange'];
|
|
749
|
+
categoryFilter: {
|
|
750
|
+
categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'isSelected'>>;
|
|
751
|
+
};
|
|
752
|
+
};
|
|
753
|
+
sortBy: ProductSearchViewState['sortBy'];
|
|
754
|
+
suggestions: Array<ProductSearchViewState['suggestions'][number]>;
|
|
755
|
+
};
|
|
756
|
+
|
|
757
|
+
type ProductSearchInteractiveViewState = Pick<ProductSearchViewState, 'searchExpression' | 'isSearching' | 'hasSearched' | 'resultCount' | 'hasResults' | 'hasMore' | 'loadedCount' | 'totalCount' | 'hasSuggestions'> & {
|
|
758
|
+
searchResults: Array<ProductSearchViewState['searchResults'][number]>;
|
|
759
|
+
filters: {
|
|
760
|
+
priceRange: ProductSearchViewState['filters']['priceRange'];
|
|
761
|
+
categoryFilter: {
|
|
762
|
+
categories: Array<Pick<ProductSearchViewState['filters']['categoryFilter']['categories'][number], 'categoryId' | 'isSelected'>>;
|
|
763
|
+
};
|
|
764
|
+
};
|
|
765
|
+
sortBy: ProductSearchViewState['sortBy'];
|
|
766
|
+
suggestions: Array<ProductSearchViewState['suggestions'][number]>;
|
|
767
|
+
};
|
|
768
|
+
|
|
769
|
+
|
|
770
|
+
interface ProductSearchRefs {
|
|
771
|
+
searchExpression: HTMLElementProxy<ProductSearchViewState, HTMLInputElement>,
|
|
772
|
+
searchButton: HTMLElementProxy<ProductSearchViewState, HTMLButtonElement>,
|
|
773
|
+
clearSearchButton: HTMLElementProxy<ProductSearchViewState, HTMLButtonElement>,
|
|
774
|
+
loadMoreButton: HTMLElementProxy<ProductSearchViewState, HTMLButtonElement>,
|
|
775
|
+
searchResults: ProductCardRepeatedRefs,
|
|
776
|
+
filters: {
|
|
777
|
+
clearFilters: HTMLElementProxy<FilterOfProductSearchViewState, HTMLButtonElement>,
|
|
778
|
+
priceRange: {
|
|
779
|
+
minPrice: HTMLElementProxy<PriceRangeOfFilterOfProductSearchViewState, HTMLInputElement>,
|
|
780
|
+
maxPrice: HTMLElementProxy<PriceRangeOfFilterOfProductSearchViewState, HTMLInputElement>,
|
|
781
|
+
ranges: {
|
|
782
|
+
isSelected: HTMLElementCollectionProxy<RangeOfPriceRangeOfFilterOfProductSearchViewState, HTMLInputElement>
|
|
783
|
+
}
|
|
784
|
+
},
|
|
785
|
+
categoryFilter: {
|
|
786
|
+
categories: {
|
|
787
|
+
isSelected: HTMLElementCollectionProxy<CategoryOfCategoryFilterOfFilterOfProductSearchViewState, HTMLInputElement>
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
sortBy: {
|
|
792
|
+
sortDropdown: HTMLElementProxy<SortByOfProductSearchViewState, HTMLSelectElement>
|
|
793
|
+
},
|
|
794
|
+
suggestions: {
|
|
795
|
+
suggestionButton: HTMLElementCollectionProxy<SuggestionOfProductSearchViewState, HTMLButtonElement>
|
|
796
|
+
}
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* Collection info for filtering (V1 uses collections, not categories)
|
|
801
|
+
*/
|
|
802
|
+
type CollectionInfos = ProductSearchSlowViewState['filters']['categoryFilter']['categories'];
|
|
803
|
+
interface SearchSlowCarryForward {
|
|
804
|
+
searchFields: string;
|
|
805
|
+
fuzzySearch: boolean;
|
|
806
|
+
collections: CollectionInfos;
|
|
807
|
+
}
|
|
808
|
+
interface SearchFastCarryForward {
|
|
809
|
+
searchFields: string;
|
|
810
|
+
fuzzySearch: boolean;
|
|
811
|
+
collections: CollectionInfos;
|
|
812
|
+
}
|
|
813
|
+
/**
|
|
814
|
+
* Product Search Component (V1)
|
|
815
|
+
*
|
|
816
|
+
* A complete headless product search using Wix Catalog V1 API.
|
|
817
|
+
* Uses collections for filtering and page-based pagination.
|
|
818
|
+
*/
|
|
819
|
+
declare const productSearch: _jay_framework_fullstack_component.JayStackComponentDefinition<ProductSearchRefs, ProductSearchSlowViewState, ProductSearchFastViewState, ProductSearchInteractiveViewState, [SearchSlowCarryForward, WixStoresV1Service], [Signals<ProductSearchFastViewState>, SearchFastCarryForward, WixStoresV1Context], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, ProductSearchInteractiveViewState>>;
|
|
820
|
+
|
|
821
|
+
interface CategoryOfCategoryListViewState {
|
|
822
|
+
_id: string,
|
|
823
|
+
name: string,
|
|
824
|
+
slug: string,
|
|
825
|
+
description: string,
|
|
826
|
+
productCount: number,
|
|
827
|
+
imageUrl: string,
|
|
828
|
+
hasImage: boolean
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
interface CategoryListViewState {
|
|
832
|
+
categories: Array<CategoryOfCategoryListViewState>,
|
|
833
|
+
hasCategories: boolean
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
type CategoryListSlowViewState = Pick<CategoryListViewState, 'hasCategories'> & {
|
|
837
|
+
categories: Array<CategoryListViewState['categories'][number]>;
|
|
838
|
+
};
|
|
839
|
+
|
|
840
|
+
type CategoryListFastViewState = {};
|
|
841
|
+
|
|
842
|
+
type CategoryListInteractiveViewState = {};
|
|
843
|
+
|
|
844
|
+
|
|
845
|
+
interface CategoryListRefs {
|
|
846
|
+
categories: {
|
|
847
|
+
categoryLink: HTMLElementCollectionProxy<CategoryOfCategoryListViewState, HTMLAnchorElement>
|
|
848
|
+
}
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* Collection List Component (V1)
|
|
853
|
+
*
|
|
854
|
+
* A headless component that displays a grid of store collections.
|
|
855
|
+
* Uses the same contract as category-list for template compatibility.
|
|
856
|
+
*
|
|
857
|
+
* Usage:
|
|
858
|
+
* ```html
|
|
859
|
+
* <script type="application/jay-headless"
|
|
860
|
+
* plugin="@jay-framework/wix-stores-v1"
|
|
861
|
+
* contract="category-list"
|
|
862
|
+
* key="collectionList"
|
|
863
|
+
* ></script>
|
|
864
|
+
*
|
|
865
|
+
* <div class="collections-grid">
|
|
866
|
+
* <article forEach="collectionList.categories" trackBy="_id">
|
|
867
|
+
* <a href="/collections/{slug}" ref="collectionList.categories.categoryLink">
|
|
868
|
+
* <img src="{imageUrl}" alt="{name}" />
|
|
869
|
+
* <h2>{name}</h2>
|
|
870
|
+
* <span>{productCount} products</span>
|
|
871
|
+
* </a>
|
|
872
|
+
* </article>
|
|
873
|
+
* </div>
|
|
874
|
+
* ```
|
|
875
|
+
*/
|
|
876
|
+
declare const collectionList: _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>> & {
|
|
877
|
+
withFastRender<NewCarryForward extends object>(fastRender: _jay_framework_fullstack_component.RenderFast<[Record<string, never>, WixStoresV1Service], PageProps, CategoryListFastViewState, NewCarryForward>): _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [_jay_framework_fullstack_component.Signals<CategoryListFastViewState>, NewCarryForward], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>> & {
|
|
878
|
+
withClientDefaults(fn: (props: PageProps) => {
|
|
879
|
+
viewState: CategoryListFastViewState;
|
|
880
|
+
carryForward?: any;
|
|
881
|
+
}): _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [_jay_framework_fullstack_component.Signals<CategoryListFastViewState>, NewCarryForward], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>> & /*elided*/ any;
|
|
882
|
+
withInteractive(comp: _jay_framework_component.ComponentConstructor<PageProps, CategoryListRefs, CategoryListInteractiveViewState, [_jay_framework_fullstack_component.Signals<CategoryListFastViewState>, NewCarryForward], _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>>): _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [_jay_framework_fullstack_component.Signals<CategoryListFastViewState>, NewCarryForward], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>>;
|
|
883
|
+
};
|
|
884
|
+
withInteractive(comp: _jay_framework_component.ComponentConstructor<PageProps, CategoryListRefs, CategoryListInteractiveViewState, [], _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>>): _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>>;
|
|
885
|
+
};
|
|
886
|
+
declare const categoryList: _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>> & {
|
|
887
|
+
withFastRender<NewCarryForward extends object>(fastRender: _jay_framework_fullstack_component.RenderFast<[Record<string, never>, WixStoresV1Service], PageProps, CategoryListFastViewState, NewCarryForward>): _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [_jay_framework_fullstack_component.Signals<CategoryListFastViewState>, NewCarryForward], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>> & {
|
|
888
|
+
withClientDefaults(fn: (props: PageProps) => {
|
|
889
|
+
viewState: CategoryListFastViewState;
|
|
890
|
+
carryForward?: any;
|
|
891
|
+
}): _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [_jay_framework_fullstack_component.Signals<CategoryListFastViewState>, NewCarryForward], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>> & /*elided*/ any;
|
|
892
|
+
withInteractive(comp: _jay_framework_component.ComponentConstructor<PageProps, CategoryListRefs, CategoryListInteractiveViewState, [_jay_framework_fullstack_component.Signals<CategoryListFastViewState>, NewCarryForward], _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>>): _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [_jay_framework_fullstack_component.Signals<CategoryListFastViewState>, NewCarryForward], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>>;
|
|
893
|
+
};
|
|
894
|
+
withInteractive(comp: _jay_framework_component.ComponentConstructor<PageProps, CategoryListRefs, CategoryListInteractiveViewState, [], _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>>): _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryListRefs, CategoryListSlowViewState, CategoryListFastViewState, CategoryListInteractiveViewState, [Record<string, never>, WixStoresV1Service], [], PageProps, {}, _jay_framework_component.JayComponentCore<PageProps, CategoryListInteractiveViewState>>;
|
|
895
|
+
};
|
|
896
|
+
|
|
897
|
+
interface MainMediaOfMediaOfCategoryPageViewState {
|
|
898
|
+
_id: string,
|
|
899
|
+
url: string,
|
|
900
|
+
altText: string,
|
|
901
|
+
mediaType: MediaType
|
|
902
|
+
}
|
|
903
|
+
|
|
904
|
+
declare enum MediaType {
|
|
905
|
+
IMAGE,
|
|
906
|
+
VIDEO,
|
|
907
|
+
AUDIO,
|
|
908
|
+
DOCUMENT,
|
|
909
|
+
ZIP
|
|
910
|
+
}
|
|
911
|
+
|
|
912
|
+
declare enum MediaType {
|
|
913
|
+
IMAGE,
|
|
914
|
+
VIDEO,
|
|
915
|
+
AUDIO,
|
|
916
|
+
DOCUMENT,
|
|
917
|
+
ZIP
|
|
918
|
+
}
|
|
919
|
+
|
|
920
|
+
interface ThumbnailOfItemOfMediaOfCategoryPageViewState {
|
|
921
|
+
url: string,
|
|
922
|
+
width: number,
|
|
923
|
+
height: number,
|
|
924
|
+
format: string
|
|
925
|
+
}
|
|
926
|
+
|
|
927
|
+
interface ItemOfMediaOfCategoryPageViewState {
|
|
928
|
+
_id: string,
|
|
929
|
+
url: string,
|
|
930
|
+
altText: string,
|
|
931
|
+
title: string,
|
|
932
|
+
mediaType: MediaType,
|
|
933
|
+
thumbnail: ThumbnailOfItemOfMediaOfCategoryPageViewState
|
|
934
|
+
}
|
|
935
|
+
|
|
936
|
+
interface MediaOfCategoryPageViewState {
|
|
937
|
+
mainMedia: MainMediaOfMediaOfCategoryPageViewState,
|
|
938
|
+
items: Array<ItemOfMediaOfCategoryPageViewState>
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
interface BreadcrumbOfCategoryPageViewState {
|
|
942
|
+
categoryId: string,
|
|
943
|
+
categoryName: string,
|
|
944
|
+
categorySlug: string
|
|
945
|
+
}
|
|
946
|
+
|
|
947
|
+
interface CategoryPageViewState {
|
|
948
|
+
_id: string,
|
|
949
|
+
name: string,
|
|
950
|
+
description: string,
|
|
951
|
+
slug: string,
|
|
952
|
+
visible: boolean,
|
|
953
|
+
numberOfProducts: number,
|
|
954
|
+
hasImage: boolean,
|
|
955
|
+
media: MediaOfCategoryPageViewState,
|
|
956
|
+
breadcrumbs: Array<BreadcrumbOfCategoryPageViewState>,
|
|
957
|
+
products: Array<ProductCardViewState>,
|
|
958
|
+
loadedProducts: Array<ProductCardViewState>,
|
|
959
|
+
hasMore: boolean,
|
|
960
|
+
loadedCount: number,
|
|
961
|
+
isLoading: boolean,
|
|
962
|
+
hasProducts: boolean
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
type CategoryPageSlowViewState = Pick<CategoryPageViewState, '_id' | 'name' | 'description' | 'slug' | 'visible' | 'numberOfProducts' | 'hasImage'> & {
|
|
966
|
+
media: CategoryPageViewState['media'];
|
|
967
|
+
breadcrumbs: Array<CategoryPageViewState['breadcrumbs'][number]>;
|
|
968
|
+
products: Array<Pick<CategoryPageViewState['products'][number], '_id' | 'name' | 'slug' | 'productUrl' | 'hasDiscount' | 'hasRibbon' | 'productType' | 'quickAddType'> & {
|
|
969
|
+
mainMedia: CategoryPageViewState['products'][number]['mainMedia'];
|
|
970
|
+
thumbnail: CategoryPageViewState['products'][number]['thumbnail'];
|
|
971
|
+
inventory: CategoryPageViewState['products'][number]['inventory'];
|
|
972
|
+
ribbon: CategoryPageViewState['products'][number]['ribbon'];
|
|
973
|
+
brand: CategoryPageViewState['products'][number]['brand'];
|
|
974
|
+
quickOption: Pick<CategoryPageViewState['products'][number]['quickOption'], '_id' | 'name' | 'optionRenderType'> & {
|
|
975
|
+
choices: Array<Pick<CategoryPageViewState['products'][number]['quickOption']['choices'][number], 'choiceId' | 'name' | 'choiceType' | 'colorCode' | 'variantId'>>;
|
|
976
|
+
};
|
|
977
|
+
}>;
|
|
978
|
+
};
|
|
979
|
+
|
|
980
|
+
type CategoryPageFastViewState = Pick<CategoryPageViewState, 'hasMore' | 'loadedCount' | 'isLoading' | 'hasProducts'> & {
|
|
981
|
+
products: Array<Pick<CategoryPageViewState['products'][number], '_id' | 'price' | 'strikethroughPrice' | 'isAddingToCart'> & {
|
|
982
|
+
quickOption: {
|
|
983
|
+
choices: Array<Pick<CategoryPageViewState['products'][number]['quickOption']['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
|
|
984
|
+
};
|
|
985
|
+
}>;
|
|
986
|
+
loadedProducts: Array<CategoryPageViewState['loadedProducts'][number]>;
|
|
987
|
+
};
|
|
988
|
+
|
|
989
|
+
type CategoryPageInteractiveViewState = Pick<CategoryPageViewState, 'hasMore' | 'loadedCount' | 'isLoading' | 'hasProducts'> & {
|
|
990
|
+
products: Array<Pick<CategoryPageViewState['products'][number], '_id' | 'price' | 'strikethroughPrice' | 'isAddingToCart'> & {
|
|
991
|
+
quickOption: {
|
|
992
|
+
choices: Array<Pick<CategoryPageViewState['products'][number]['quickOption']['choices'][number], 'choiceId' | 'inStock' | 'isSelected'>>;
|
|
993
|
+
};
|
|
994
|
+
}>;
|
|
995
|
+
loadedProducts: Array<CategoryPageViewState['loadedProducts'][number]>;
|
|
996
|
+
};
|
|
997
|
+
|
|
998
|
+
|
|
999
|
+
interface CategoryPageRefs {
|
|
1000
|
+
loadMoreButton: HTMLElementProxy<CategoryPageViewState, HTMLButtonElement>,
|
|
1001
|
+
breadcrumbs: {
|
|
1002
|
+
categoryLink: HTMLElementCollectionProxy<BreadcrumbOfCategoryPageViewState, HTMLAnchorElement>
|
|
1003
|
+
},
|
|
1004
|
+
products: ProductCardRepeatedRefs,
|
|
1005
|
+
loadedProducts: ProductCardRepeatedRefs
|
|
1006
|
+
}
|
|
1007
|
+
|
|
1008
|
+
/**
|
|
1009
|
+
* URL parameters for collection page routes
|
|
1010
|
+
*/
|
|
1011
|
+
interface CollectionPageParams extends UrlParams {
|
|
1012
|
+
slug: string;
|
|
1013
|
+
}
|
|
1014
|
+
interface CollectionSlowCarryForward {
|
|
1015
|
+
collectionId: string;
|
|
1016
|
+
collectionSlug: string;
|
|
1017
|
+
totalProducts: number;
|
|
1018
|
+
products: ProductCardViewState[];
|
|
1019
|
+
currentOffset: number;
|
|
1020
|
+
}
|
|
1021
|
+
interface CollectionFastCarryForward {
|
|
1022
|
+
collectionId: string;
|
|
1023
|
+
totalProducts: number;
|
|
1024
|
+
currentOffset: number;
|
|
1025
|
+
}
|
|
1026
|
+
/**
|
|
1027
|
+
* Collection Page Component (V1)
|
|
1028
|
+
*
|
|
1029
|
+
* A headless collection page using Wix Catalog V1 API.
|
|
1030
|
+
* Uses the same contract as category-page for template compatibility.
|
|
1031
|
+
*/
|
|
1032
|
+
declare const collectionPage: _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryPageRefs, CategoryPageSlowViewState, CategoryPageFastViewState, CategoryPageInteractiveViewState, [CollectionSlowCarryForward, WixStoresV1Service], [Signals<CategoryPageFastViewState>, CollectionFastCarryForward, WixStoresV1Context], PageProps & CollectionPageParams, CollectionPageParams, _jay_framework_component.JayComponentCore<PageProps & CollectionPageParams, CategoryPageInteractiveViewState>>;
|
|
1033
|
+
declare const categoryPage: _jay_framework_fullstack_component.JayStackComponentDefinition<CategoryPageRefs, CategoryPageSlowViewState, CategoryPageFastViewState, CategoryPageInteractiveViewState, [CollectionSlowCarryForward, WixStoresV1Service], [Signals<CategoryPageFastViewState>, CollectionFastCarryForward, WixStoresV1Context], PageProps & CollectionPageParams, CollectionPageParams, _jay_framework_component.JayComponentCore<PageProps & CollectionPageParams, CategoryPageInteractiveViewState>>;
|
|
1034
|
+
|
|
1035
|
+
declare const init: _jay_framework_fullstack_component.JayInit<WixStoresV1InitData>;
|
|
1036
|
+
|
|
1037
|
+
export { type CollectionPageParams, type CollectionViewState, type GetProductBySlugInput, type PriceAggregationData, type PriceRangeBucket, type ProductPageParams, type ProductSearchFilters, type ProductSortField, type SearchProductsInput, type SearchProductsOutput, type V1Collection, WIX_STORES_V1_CONTEXT, WIX_STORES_V1_SERVICE_MARKER, type WixStoresV1Context, type WixStoresV1InitData, type WixStoresV1Service, categoryList, categoryPage, collectionList, collectionPage, getCollections, getProductBySlug, init, productPage, productSearch, provideWixStoresV1Service, searchProducts };
|