@jay-framework/wix-stores-v1 0.24.0 → 0.24.1

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