@wix/stores 1.0.973 → 1.0.974

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.
Files changed (76) hide show
  1. package/_sdk-exports/context-category-by-id/runtime.d.ts +33 -4
  2. package/_sdk-exports/context-category-by-id/runtime.js +2 -2
  3. package/_sdk-exports/context-category-by-slug/runtime.d.ts +33 -4
  4. package/_sdk-exports/context-category-by-slug/runtime.js +2 -2
  5. package/_sdk-exports/context-category-info/runtime.d.ts +6 -1
  6. package/_sdk-exports/context-category-list/runtime.d.ts +5 -1
  7. package/_sdk-exports/context-product/runtime.d.ts +13 -13
  8. package/_sdk-exports/context-product-by-id/runtime.d.ts +19 -11
  9. package/_sdk-exports/context-product-by-id/runtime.js +2 -2
  10. package/_sdk-exports/context-product-by-slug/runtime.d.ts +17 -11
  11. package/_sdk-exports/context-product-by-slug/runtime.js +2 -2
  12. package/_sdk-exports/context-product-item/runtime.d.ts +35 -2
  13. package/_sdk-exports/context-product-item/runtime.js +2 -2
  14. package/_sdk-exports/context-product-list/runtime.d.ts +29 -1
  15. package/_sdk-exports/context-promotion-item/runtime.d.ts +5 -1
  16. package/build/cjs/context-category-by-id.d.ts +33 -4
  17. package/build/cjs/context-category-by-id.js +1187 -822
  18. package/build/cjs/context-category-by-id.js.map +1 -1
  19. package/build/cjs/context-category-by-slug.d.ts +33 -4
  20. package/build/cjs/context-category-by-slug.js +1382 -1017
  21. package/build/cjs/context-category-by-slug.js.map +1 -1
  22. package/build/cjs/context-category-info.d.ts +6 -1
  23. package/build/cjs/context-category-list.d.ts +5 -1
  24. package/build/cjs/context-product-by-id.d.ts +19 -11
  25. package/build/cjs/context-product-by-id.js +39 -36
  26. package/build/cjs/context-product-by-id.js.map +1 -1
  27. package/build/cjs/context-product-by-slug.d.ts +17 -11
  28. package/build/cjs/context-product-by-slug.js +37 -34
  29. package/build/cjs/context-product-by-slug.js.map +1 -1
  30. package/build/cjs/context-product-item.d.ts +35 -2
  31. package/build/cjs/context-product-item.js +287 -287
  32. package/build/cjs/context-product-item.js.map +1 -1
  33. package/build/cjs/context-product-list.d.ts +29 -1
  34. package/build/cjs/context-product.d.ts +13 -13
  35. package/build/cjs/context-promotion-item.d.ts +5 -1
  36. package/build/es/context-category-by-id.d.mts +33 -4
  37. package/build/es/context-category-by-id.mjs +1194 -829
  38. package/build/es/context-category-by-id.mjs.map +1 -1
  39. package/build/es/context-category-by-slug.d.mts +33 -4
  40. package/build/es/context-category-by-slug.mjs +1382 -1017
  41. package/build/es/context-category-by-slug.mjs.map +1 -1
  42. package/build/es/context-category-info.d.mts +6 -1
  43. package/build/es/context-category-list.d.mts +5 -1
  44. package/build/es/context-product-by-id.d.mts +19 -11
  45. package/build/es/context-product-by-id.mjs +39 -36
  46. package/build/es/context-product-by-id.mjs.map +1 -1
  47. package/build/es/context-product-by-slug.d.mts +17 -11
  48. package/build/es/context-product-by-slug.mjs +37 -34
  49. package/build/es/context-product-by-slug.mjs.map +1 -1
  50. package/build/es/context-product-item.d.mts +35 -2
  51. package/build/es/context-product-item.mjs +287 -287
  52. package/build/es/context-product-item.mjs.map +1 -1
  53. package/build/es/context-product-list.d.mts +29 -1
  54. package/build/es/context-product.d.mts +13 -13
  55. package/build/es/context-promotion-item.d.mts +5 -1
  56. package/build/internal/cjs/context-category-by-id.d.ts +33 -4
  57. package/build/internal/cjs/context-category-by-slug.d.ts +33 -4
  58. package/build/internal/cjs/context-category-info.d.ts +6 -1
  59. package/build/internal/cjs/context-category-list.d.ts +5 -1
  60. package/build/internal/cjs/context-product-by-id.d.ts +19 -11
  61. package/build/internal/cjs/context-product-by-slug.d.ts +17 -11
  62. package/build/internal/cjs/context-product-item.d.ts +35 -2
  63. package/build/internal/cjs/context-product-list.d.ts +29 -1
  64. package/build/internal/cjs/context-product.d.ts +13 -13
  65. package/build/internal/cjs/context-promotion-item.d.ts +5 -1
  66. package/build/internal/es/context-category-by-id.d.mts +33 -4
  67. package/build/internal/es/context-category-by-slug.d.mts +33 -4
  68. package/build/internal/es/context-category-info.d.mts +6 -1
  69. package/build/internal/es/context-category-list.d.mts +5 -1
  70. package/build/internal/es/context-product-by-id.d.mts +19 -11
  71. package/build/internal/es/context-product-by-slug.d.mts +17 -11
  72. package/build/internal/es/context-product-item.d.mts +35 -2
  73. package/build/internal/es/context-product-list.d.mts +29 -1
  74. package/build/internal/es/context-product.d.mts +13 -13
  75. package/build/internal/es/context-promotion-item.d.mts +5 -1
  76. package/package.json +2 -2
@@ -3779,12 +3779,35 @@ interface Product {
3779
3779
  productGroupId?: string;
3780
3780
  }
3781
3781
  //#endregion
3782
+ //#region src/api/product-groups/product-groups.d.ts
3783
+ declare enum ProductGroupCustomizationType {
3784
+ PRODUCT_OPTION = "PRODUCT_OPTION",
3785
+ MODIFIER = "MODIFIER"
3786
+ }
3787
+ interface ProductGroup {
3788
+ groupingCustomizationId: string;
3789
+ customizationType: ProductGroupCustomizationType;
3790
+ members: ProductGroupMember[];
3791
+ }
3792
+ interface ProductGroupMember {
3793
+ productId: string;
3794
+ choice: ProductChoice;
3795
+ slug: string;
3796
+ inventoryAvailabilityStatus?: AvailabilityStatus;
3797
+ }
3798
+ interface ProductGroupData {
3799
+ productGroup: ProductGroup;
3800
+ selectProductGroupMember: (productId: string) => void;
3801
+ }
3802
+ //#endregion
3782
3803
  //#region src/extensions/product/providers/product-item-context/product-item-context-provider.d.ts
3783
3804
  interface ProductItem {
3784
3805
  /** The current entry of the `productItems` array. */
3785
3806
  product: Product;
3786
3807
  /** The default location ID for the product. */
3787
3808
  defaultLocationId: string | undefined;
3809
+ /** Group data + sibling-swap handler for this product; absent when the product is not grouped. */
3810
+ productGroupData?: ProductGroupData;
3788
3811
  }
3789
3812
  //#endregion
3790
3813
  //#region src/extensions/gallery/providers/api/promotions/promotions.d.ts
@@ -3955,7 +3978,12 @@ interface ProductListContextValue {
3955
3978
  }
3956
3979
  //#endregion
3957
3980
  //#region src/extensions/gallery/providers/product-list-context/product-list-context-provider.d.ts
3958
- /** Reads the products, filters, sorting, and pagination supplied by a product list implementation. */
3981
+ /**
3982
+ * The `useProductListContext()` hook provides access to a store category's products, the filters
3983
+ * and sort options for them, and the visitor's filter and sort selection. Use it to show how many
3984
+ * products match the visitor's filters, let visitors filter and sort the list, and load more
3985
+ * products.
3986
+ */
3959
3987
  declare function useProductListContext(): ProductListContextValue;
3960
3988
  /** Props accepted by {@link ProductListContextProvider}. */
3961
3989
  interface ProductListContextProviderProps extends React.PropsWithChildren {
@@ -4081,7 +4081,7 @@ interface ProductContextValue {
4081
4081
  * @param choiceId - ID of the choice to select, from the option's `choices`.
4082
4082
  * @example Show each option's choices as buttons
4083
4083
  * ```tsx
4084
- * import { useProductContext } from '@wix/stores/product-context-provider';
4084
+ * import { useProductContext } from '@wix/stores/context/product';
4085
4085
  *
4086
4086
  * function OptionButtons() {
4087
4087
  * const { options, buyerSelections, selectionsAvailability, selectOption } = useProductContext();
@@ -4121,7 +4121,7 @@ interface ProductContextValue {
4121
4121
  * choice to select, from the modifier's `choices`.
4122
4122
  * @example Show each choice modifier as a dropdown
4123
4123
  * ```tsx
4124
- * import { useProductContext } from '@wix/stores/product-context-provider';
4124
+ * import { useProductContext } from '@wix/stores/context/product';
4125
4125
  *
4126
4126
  * function ModifierDropdowns() {
4127
4127
  * const { modifiers, buyerSelections, selectModifier } = useProductContext();
@@ -4158,7 +4158,7 @@ interface ProductContextValue {
4158
4158
  * @param modifierId - ID of the modifier whose value to clear.
4159
4159
  * @example Clear a free-text modifier when the visitor empties its field
4160
4160
  * ```tsx
4161
- * import { useProductContext } from '@wix/stores/product-context-provider';
4161
+ * import { useProductContext } from '@wix/stores/context/product';
4162
4162
  *
4163
4163
  * function TextModifierFields() {
4164
4164
  * const { modifiers, buyerSelections, selectModifier, clearModifierSelection } = useProductContext();
@@ -4198,7 +4198,7 @@ interface ProductContextValue {
4198
4198
  * `selectionValidationErrors.subscriptionPlanId`.
4199
4199
  * @example Let the visitor choose a subscription plan
4200
4200
  * ```tsx
4201
- * import { useProductContext } from '@wix/stores/product-context-provider';
4201
+ * import { useProductContext } from '@wix/stores/context/product';
4202
4202
  *
4203
4203
  * function SubscriptionPlanPicker() {
4204
4204
  * const { subscriptionPlans, buyerSelections, selectSubscriptionPlan } = useProductContext();
@@ -4231,7 +4231,7 @@ interface ProductContextValue {
4231
4231
  * quantity below 1 is kept, and shows as `'below-min'` in `selectionValidationErrors.quantity`.
4232
4232
  * @example Change the quantity with plus and minus buttons
4233
4233
  * ```tsx
4234
- * import { useProductContext } from '@wix/stores/product-context-provider';
4234
+ * import { useProductContext } from '@wix/stores/context/product';
4235
4235
  *
4236
4236
  * function QuantityStepper() {
4237
4237
  * const { buyerSelections, maxPurchasableQuantity, selectQuantity } = useProductContext();
@@ -4274,7 +4274,7 @@ interface ProductContextValue {
4274
4274
  * Must be the index of an item in `media`.
4275
4275
  * @example Switch the gallery item from a row of buttons
4276
4276
  * ```tsx
4277
- * import { useProductContext } from '@wix/stores/product-context-provider';
4277
+ * import { useProductContext } from '@wix/stores/context/product';
4278
4278
  *
4279
4279
  * function MediaThumbnailNav() {
4280
4280
  * const { media, selectedMediaIndex, selectMedia } = useProductContext();
@@ -4318,7 +4318,7 @@ interface ProductContextValue {
4318
4318
  * @example Add the selection to the cart on a product page
4319
4319
  * ```tsx
4320
4320
  * import { useState } from 'react';
4321
- * import { useProductContext } from '@wix/stores/product-context-provider';
4321
+ * import { useProductContext } from '@wix/stores/context/product';
4322
4322
  *
4323
4323
  * function AddToCartButton() {
4324
4324
  * const { isInStock, isPreOrderState, addToCartState, handleAddToCart } = useProductContext();
@@ -4358,7 +4358,7 @@ interface ProductContextValue {
4358
4358
  * @example Start a checkout for the selection on a product page
4359
4359
  * ```tsx
4360
4360
  * import { useState } from 'react';
4361
- * import { useProductContext } from '@wix/stores/product-context-provider';
4361
+ * import { useProductContext } from '@wix/stores/context/product';
4362
4362
  *
4363
4363
  * function BuyNowButton() {
4364
4364
  * const { isInStock, isPreOrderState, buyNowState, handleBuyNow } = useProductContext();
@@ -4403,7 +4403,7 @@ interface ProductContextValue {
4403
4403
  * @example Offer a back-in-stock email for an out-of-stock selection
4404
4404
  * ```tsx
4405
4405
  * import { useState, type FormEvent } from 'react';
4406
- * import { useProductContext } from '@wix/stores/product-context-provider';
4406
+ * import { useProductContext } from '@wix/stores/context/product';
4407
4407
  *
4408
4408
  * function NotifyMeForm() {
4409
4409
  * const { isInStock, isPreOrderState, isBackInStockEnabled, selectedVariantId, handleNotifyMe } = useProductContext();
@@ -4436,10 +4436,10 @@ interface ProductContextValue {
4436
4436
  //#endregion
4437
4437
  //#region src/extensions/product/providers/product-context/product-context-provider.d.ts
4438
4438
  /**
4439
- * The Product context provides access to a store product's details, prices, media, and stock, and to
4440
- * the visitor's selection of options, modifiers, subscription plan, and quantity. Use it to show a
4441
- * product, let visitors choose what to buy, and let them add their selection to the cart, start a
4442
- * checkout, or sign up for a back-in-stock email.
4439
+ * The `useProductContext()` hook provides access to a store product's details, prices, media, and
4440
+ * stock, and to the visitor's selection of options, modifiers, subscription plan, and quantity. Use
4441
+ * it to show a product, let visitors choose what to buy, and let them add their selection to the
4442
+ * cart, start a checkout, or sign up for a back-in-stock email.
4443
4443
  */
4444
4444
  declare function useProductContext(): ProductContextValue;
4445
4445
  /** Props accepted by {@link ProductContextProvider}. */
@@ -66,7 +66,11 @@ interface PromotionItem {
66
66
  /** The current entry of the `promotionItems` array. */
67
67
  promotion: PromotionItemContextValue;
68
68
  }
69
- /** Reads the current promotion, or returns null outside a promotion item provider. */
69
+ /**
70
+ * The `usePromotionItemContext()` hook provides access to a promotion shown among the products in a
71
+ * **Product List**, including its image, alt text, link, and position. Use it to build a promotion
72
+ * card, such as a banner that links to a sale. It returns `null` outside a **Promotion Item**.
73
+ */
70
74
  declare function usePromotionItemContext(): PromotionItemContextValue | null;
71
75
  declare function usePromotionItemContextValue({
72
76
  promotion
@@ -3913,9 +3913,31 @@ interface GetProductsListResponse {
3913
3913
  hasNext: boolean;
3914
3914
  }
3915
3915
  //#endregion
3916
+ //#region src/api/product-groups/product-groups.d.ts
3917
+ declare enum ProductGroupCustomizationType {
3918
+ PRODUCT_OPTION = "PRODUCT_OPTION",
3919
+ MODIFIER = "MODIFIER"
3920
+ }
3921
+ interface ProductGroup {
3922
+ groupingCustomizationId: string;
3923
+ customizationType: ProductGroupCustomizationType;
3924
+ members: ProductGroupMember[];
3925
+ }
3926
+ interface ProductGroupMember {
3927
+ productId: string;
3928
+ choice: ProductChoice;
3929
+ slug: string;
3930
+ inventoryAvailabilityStatus?: AvailabilityStatus;
3931
+ }
3932
+ interface ProductGroupData {
3933
+ productGroup: ProductGroup;
3934
+ selectProductGroupMember: (productId: string) => void;
3935
+ }
3936
+ //#endregion
3916
3937
  //#region src/extensions/gallery/providers/hooks/use-product-list-context-value/use-product-list/use-product-list.d.ts
3917
3938
  interface InitialProductList {
3918
3939
  page: GetProductsListResponse;
3940
+ productGroupByGroupId: Record<string, ProductGroup>;
3919
3941
  filterSelectionKey: string;
3920
3942
  sortType: SortTypes;
3921
3943
  productsPerPage: number;
@@ -3969,6 +3991,16 @@ declare function useCategoryContextValue(data: CategoryPageData): {
3969
3991
  breadcrumbs: CategoryBreadcrumb[];
3970
3992
  };
3971
3993
  //#endregion
3994
+ //#region src/extensions/product/providers/product-item-context/product-item-context-provider.d.ts
3995
+ interface ProductItem {
3996
+ /** The current entry of the `productItems` array. */
3997
+ product: Product;
3998
+ /** The default location ID for the product. */
3999
+ defaultLocationId: string | undefined;
4000
+ /** Group data + sibling-swap handler for this product; absent when the product is not grouped. */
4001
+ productGroupData?: ProductGroupData;
4002
+ }
4003
+ //#endregion
3972
4004
  //#region src/extensions/gallery/providers/hooks/use-product-list-context-value/use-product-list-context-value.d.ts
3973
4005
  declare function useProductListContextValue(data: CategoryPageData, productsPerPage: number): {
3974
4006
  productCount: number;
@@ -3987,10 +4019,7 @@ declare function useProductListContextValue(data: CategoryPageData, productsPerP
3987
4019
  clearAllFilters: () => void;
3988
4020
  filters: Filter[];
3989
4021
  currency: string | undefined;
3990
- productItems: {
3991
- product: Product;
3992
- defaultLocationId: string | undefined;
3993
- }[];
4022
+ productItems: ProductItem[];
3994
4023
  promotionItems: {
3995
4024
  promotion: PromotionItemContextValue;
3996
4025
  }[];
@@ -3914,9 +3914,31 @@ interface GetProductsListResponse {
3914
3914
  hasNext: boolean;
3915
3915
  }
3916
3916
  //#endregion
3917
+ //#region src/api/product-groups/product-groups.d.ts
3918
+ declare enum ProductGroupCustomizationType {
3919
+ PRODUCT_OPTION = "PRODUCT_OPTION",
3920
+ MODIFIER = "MODIFIER"
3921
+ }
3922
+ interface ProductGroup {
3923
+ groupingCustomizationId: string;
3924
+ customizationType: ProductGroupCustomizationType;
3925
+ members: ProductGroupMember[];
3926
+ }
3927
+ interface ProductGroupMember {
3928
+ productId: string;
3929
+ choice: ProductChoice;
3930
+ slug: string;
3931
+ inventoryAvailabilityStatus?: AvailabilityStatus;
3932
+ }
3933
+ interface ProductGroupData {
3934
+ productGroup: ProductGroup;
3935
+ selectProductGroupMember: (productId: string) => void;
3936
+ }
3937
+ //#endregion
3917
3938
  //#region src/extensions/gallery/providers/hooks/use-product-list-context-value/use-product-list/use-product-list.d.ts
3918
3939
  interface InitialProductList {
3919
3940
  page: GetProductsListResponse;
3941
+ productGroupByGroupId: Record<string, ProductGroup>;
3920
3942
  filterSelectionKey: string;
3921
3943
  sortType: SortTypes;
3922
3944
  productsPerPage: number;
@@ -3988,6 +4010,16 @@ declare function useCategoryListContextValue(categories: CategoryNodes, currentC
3988
4010
  currentCategoryId: string | undefined;
3989
4011
  };
3990
4012
  //#endregion
4013
+ //#region src/extensions/product/providers/product-item-context/product-item-context-provider.d.ts
4014
+ interface ProductItem {
4015
+ /** The current entry of the `productItems` array. */
4016
+ product: Product;
4017
+ /** The default location ID for the product. */
4018
+ defaultLocationId: string | undefined;
4019
+ /** Group data + sibling-swap handler for this product; absent when the product is not grouped. */
4020
+ productGroupData?: ProductGroupData;
4021
+ }
4022
+ //#endregion
3991
4023
  //#region src/extensions/gallery/providers/hooks/use-product-list-context-value/use-product-list-context-value.d.ts
3992
4024
  declare function useProductListContextValue(data: CategoryPageData, productsPerPage: number): {
3993
4025
  productCount: number;
@@ -4006,10 +4038,7 @@ declare function useProductListContextValue(data: CategoryPageData, productsPerP
4006
4038
  clearAllFilters: () => void;
4007
4039
  filters: Filter[];
4008
4040
  currency: string | undefined;
4009
- productItems: {
4010
- product: Product;
4011
- defaultLocationId: string | undefined;
4012
- }[];
4041
+ productItems: ProductItem[];
4013
4042
  promotionItems: {
4014
4043
  promotion: PromotionItemContextValue;
4015
4044
  }[];
@@ -3513,7 +3513,12 @@ declare function useCategoryInfo(category: Category): {
3513
3513
  //#endregion
3514
3514
  //#region src/extensions/gallery/providers/category-info-context/category-info-context-provider.d.ts
3515
3515
  type CategoryInfoContextImplementation = ReturnType<typeof useCategoryInfo>;
3516
- /** Reads the category details supplied by a surrounding category info provider. */
3516
+ /**
3517
+ * The `useCategoryInfoContext()` hook provides access to a store category's name, descriptions,
3518
+ * image, page link, and the categories it's nested under. Use it to show a category's details, for
3519
+ * example in the header of a category page, and to link to the category and to the categories it's
3520
+ * nested under.
3521
+ */
3517
3522
  declare function useCategoryInfoContext(): CategoryInfoContextValue;
3518
3523
  /** Props accepted by {@link CategoryInfoContextProvider}. */
3519
3524
  interface CategoryInfoContextProviderProps extends React.PropsWithChildren {
@@ -86,7 +86,11 @@ interface CategoryListContextValue {
86
86
  }
87
87
  //#endregion
88
88
  //#region src/extensions/gallery/providers/category-list-context/category-list-context-provider.d.ts
89
- /** Reads the visible store categories and the current category. */
89
+ /**
90
+ * The `useCategoryListContext()` hook provides access to the store's visible categories and to the
91
+ * ID of the category whose page the component is on. Use it to build category navigation, such as
92
+ * links to the current category's child categories or to its parent category.
93
+ */
90
94
  declare function useCategoryListContext(): CategoryListContextValue;
91
95
  /** Props accepted by {@link CategoryListContextProvider}. */
92
96
  interface CategoryListContextProviderProps extends React.PropsWithChildren {
@@ -4010,16 +4010,7 @@ interface Price {
4010
4010
  formattedAmount: string;
4011
4011
  }
4012
4012
  //#endregion
4013
- //#region src/domain/inventory/inventory.d.ts
4014
- interface InventoryItem {
4015
- variantId: string;
4016
- availabilityStatus?: AvailabilityStatusWithLiterals;
4017
- quantity?: number;
4018
- trackQuantity: boolean;
4019
- preorderInfo?: PreorderInfo;
4020
- }
4021
- //#endregion
4022
- //#region src/extensions/product/providers/api/product-groups/product-groups.d.ts
4013
+ //#region src/api/product-groups/product-groups.d.ts
4023
4014
  declare enum ProductGroupCustomizationType {
4024
4015
  PRODUCT_OPTION = "PRODUCT_OPTION",
4025
4016
  MODIFIER = "MODIFIER"
@@ -4036,6 +4027,15 @@ interface ProductGroupMember {
4036
4027
  inventoryAvailabilityStatus?: AvailabilityStatus;
4037
4028
  }
4038
4029
  //#endregion
4030
+ //#region src/domain/inventory/inventory.d.ts
4031
+ interface InventoryItem {
4032
+ variantId: string;
4033
+ availabilityStatus?: AvailabilityStatusWithLiterals;
4034
+ quantity?: number;
4035
+ trackQuantity: boolean;
4036
+ preorderInfo?: PreorderInfo;
4037
+ }
4038
+ //#endregion
4039
4039
  //#region src/extensions/product/providers/hooks/use-price/use-price.d.ts
4040
4040
  /** Way to buy a subscription product, either one of its subscription plans or a one-time purchase. */
4041
4041
  interface SubscriptionPlan {
@@ -4213,7 +4213,15 @@ interface ProductByIdContextProviderProps extends React.PropsWithChildren {
4213
4213
  productId?: string;
4214
4214
  }
4215
4215
  type ProductByIdContextImplementation = ReturnType<typeof useStandaloneProductContextValue>;
4216
- /** Reads the product context for the configured product. */
4216
+ /**
4217
+ * The `useProductByIdContext()` hook provides access to the store product chosen in the settings of
4218
+ * a **Product**
4219
+ * [Data Source](https://dev.wix.com/docs/studio-two/code-your-site/code-model/data-sources/about-data-sources):
4220
+ * its details, prices, media, and stock, and the visitor's selection of options, modifiers,
4221
+ * subscription plan, and quantity. Use it to feature a product anywhere on a site, let visitors
4222
+ * choose what to buy, and let them add their selection to the cart, start a checkout, or sign up
4223
+ * for a back-in-stock email.
4224
+ */
4217
4225
  declare function useProductByIdContext(): ProductContextValue;
4218
4226
  /** Loads a product by ID and supplies its details and purchase actions to descendants. */
4219
4227
  declare function ProductByIdContextProvider({
@@ -4010,16 +4010,7 @@ interface Price {
4010
4010
  formattedAmount: string;
4011
4011
  }
4012
4012
  //#endregion
4013
- //#region src/domain/inventory/inventory.d.ts
4014
- interface InventoryItem {
4015
- variantId: string;
4016
- availabilityStatus?: AvailabilityStatusWithLiterals;
4017
- quantity?: number;
4018
- trackQuantity: boolean;
4019
- preorderInfo?: PreorderInfo;
4020
- }
4021
- //#endregion
4022
- //#region src/extensions/product/providers/api/product-groups/product-groups.d.ts
4013
+ //#region src/api/product-groups/product-groups.d.ts
4023
4014
  declare enum ProductGroupCustomizationType {
4024
4015
  PRODUCT_OPTION = "PRODUCT_OPTION",
4025
4016
  MODIFIER = "MODIFIER"
@@ -4036,6 +4027,15 @@ interface ProductGroupMember {
4036
4027
  inventoryAvailabilityStatus?: AvailabilityStatus;
4037
4028
  }
4038
4029
  //#endregion
4030
+ //#region src/domain/inventory/inventory.d.ts
4031
+ interface InventoryItem {
4032
+ variantId: string;
4033
+ availabilityStatus?: AvailabilityStatusWithLiterals;
4034
+ quantity?: number;
4035
+ trackQuantity: boolean;
4036
+ preorderInfo?: PreorderInfo;
4037
+ }
4038
+ //#endregion
4039
4039
  //#region src/extensions/product/providers/hooks/use-price/use-price.d.ts
4040
4040
  /** Way to buy a subscription product, either one of its subscription plans or a one-time purchase. */
4041
4041
  interface SubscriptionPlan {
@@ -4210,7 +4210,13 @@ declare function useStandaloneProductContextValue({
4210
4210
  //#region src/extensions/product/providers/product-by-slug-context/product-by-slug-context-provider.d.ts
4211
4211
  declare const NO_PRODUCT_SLUG_ERROR = "No product slug is available for the product context";
4212
4212
  type ProductBySlugContextImplementation = ReturnType<typeof useStandaloneProductContextValue>;
4213
- /** Reads the product context for the product page. */
4213
+ /**
4214
+ * The `useProductBySlugContext()` hook provides access to the store product that a product page
4215
+ * shows: its details, prices, media, and stock, and the visitor's selection of options, modifiers,
4216
+ * subscription plan, and quantity. Use it to build a product page's components: show the product,
4217
+ * let visitors choose what to buy, and let them add their selection to the cart, start a checkout,
4218
+ * or sign up for a back-in-stock email.
4219
+ */
4214
4220
  declare function useProductBySlugContext(): ProductContextValue;
4215
4221
  /** Loads the product identified by the page URL and supplies its product context. */
4216
4222
  declare function ProductBySlugContextProvider({
@@ -3973,6 +3973,27 @@ interface UserInputErrorFields {
3973
3973
  subscriptionPlanId: 'missing' | undefined;
3974
3974
  }
3975
3975
  //#endregion
3976
+ //#region src/api/product-groups/product-groups.d.ts
3977
+ declare enum ProductGroupCustomizationType {
3978
+ PRODUCT_OPTION = "PRODUCT_OPTION",
3979
+ MODIFIER = "MODIFIER"
3980
+ }
3981
+ interface ProductGroup {
3982
+ groupingCustomizationId: string;
3983
+ customizationType: ProductGroupCustomizationType;
3984
+ members: ProductGroupMember[];
3985
+ }
3986
+ interface ProductGroupMember {
3987
+ productId: string;
3988
+ choice: ProductChoice;
3989
+ slug: string;
3990
+ inventoryAvailabilityStatus?: AvailabilityStatus;
3991
+ }
3992
+ interface ProductGroupData {
3993
+ productGroup: ProductGroup;
3994
+ selectProductGroupMember: (productId: string) => void;
3995
+ }
3996
+ //#endregion
3976
3997
  //#region src/extensions/product/providers/product-context/constants.d.ts
3977
3998
  /** Which place supplied the product to the component. */
3978
3999
  declare enum ProductContextSource {
@@ -3993,12 +4014,24 @@ interface ProductItem {
3993
4014
  product: Product;
3994
4015
  /** The default location ID for the product. */
3995
4016
  defaultLocationId: string | undefined;
4017
+ /** Group data + sibling-swap handler for this product; absent when the product is not grouped. */
4018
+ productGroupData?: ProductGroupData;
3996
4019
  }
3997
- /** Reads the product context for the current product list item. */
4020
+ /**
4021
+ * The `useProductItemContext()` hook provides access to the product in an item of a
4022
+ * **Product List**: its details, prices, media, and stock, and the visitor's selection of options,
4023
+ * modifiers, and quantity. Use it to build a product card that shows the product, lets visitors
4024
+ * choose what to buy, and adds their selection to the cart or takes them to the product's page.
4025
+ */
3998
4026
  declare function useProductItemContext(): ProductContextValue;
4027
+ /**
4028
+ * The `useProductItemContextValue()` hook creates the value that `useProductItemContext()` returns
4029
+ * for a product in a **Product List** item.
4030
+ */
3999
4031
  declare function useProductItemContextValue({
4000
4032
  product,
4001
- defaultLocationId
4033
+ defaultLocationId,
4034
+ productGroupData
4002
4035
  }: ProductItem): {
4003
4036
  subscriptionPlans: null;
4004
4037
  description: null;
@@ -3779,12 +3779,35 @@ interface Product {
3779
3779
  productGroupId?: string;
3780
3780
  }
3781
3781
  //#endregion
3782
+ //#region src/api/product-groups/product-groups.d.ts
3783
+ declare enum ProductGroupCustomizationType {
3784
+ PRODUCT_OPTION = "PRODUCT_OPTION",
3785
+ MODIFIER = "MODIFIER"
3786
+ }
3787
+ interface ProductGroup {
3788
+ groupingCustomizationId: string;
3789
+ customizationType: ProductGroupCustomizationType;
3790
+ members: ProductGroupMember[];
3791
+ }
3792
+ interface ProductGroupMember {
3793
+ productId: string;
3794
+ choice: ProductChoice;
3795
+ slug: string;
3796
+ inventoryAvailabilityStatus?: AvailabilityStatus;
3797
+ }
3798
+ interface ProductGroupData {
3799
+ productGroup: ProductGroup;
3800
+ selectProductGroupMember: (productId: string) => void;
3801
+ }
3802
+ //#endregion
3782
3803
  //#region src/extensions/product/providers/product-item-context/product-item-context-provider.d.ts
3783
3804
  interface ProductItem {
3784
3805
  /** The current entry of the `productItems` array. */
3785
3806
  product: Product;
3786
3807
  /** The default location ID for the product. */
3787
3808
  defaultLocationId: string | undefined;
3809
+ /** Group data + sibling-swap handler for this product; absent when the product is not grouped. */
3810
+ productGroupData?: ProductGroupData;
3788
3811
  }
3789
3812
  //#endregion
3790
3813
  //#region src/extensions/gallery/providers/api/promotions/promotions.d.ts
@@ -3955,7 +3978,12 @@ interface ProductListContextValue {
3955
3978
  }
3956
3979
  //#endregion
3957
3980
  //#region src/extensions/gallery/providers/product-list-context/product-list-context-provider.d.ts
3958
- /** Reads the products, filters, sorting, and pagination supplied by a product list implementation. */
3981
+ /**
3982
+ * The `useProductListContext()` hook provides access to a store category's products, the filters
3983
+ * and sort options for them, and the visitor's filter and sort selection. Use it to show how many
3984
+ * products match the visitor's filters, let visitors filter and sort the list, and load more
3985
+ * products.
3986
+ */
3959
3987
  declare function useProductListContext(): ProductListContextValue;
3960
3988
  /** Props accepted by {@link ProductListContextProvider}. */
3961
3989
  interface ProductListContextProviderProps extends React.PropsWithChildren {
@@ -4081,7 +4081,7 @@ interface ProductContextValue {
4081
4081
  * @param choiceId - ID of the choice to select, from the option's `choices`.
4082
4082
  * @example Show each option's choices as buttons
4083
4083
  * ```tsx
4084
- * import { useProductContext } from '@wix/stores/product-context-provider';
4084
+ * import { useProductContext } from '@wix/stores/context/product';
4085
4085
  *
4086
4086
  * function OptionButtons() {
4087
4087
  * const { options, buyerSelections, selectionsAvailability, selectOption } = useProductContext();
@@ -4121,7 +4121,7 @@ interface ProductContextValue {
4121
4121
  * choice to select, from the modifier's `choices`.
4122
4122
  * @example Show each choice modifier as a dropdown
4123
4123
  * ```tsx
4124
- * import { useProductContext } from '@wix/stores/product-context-provider';
4124
+ * import { useProductContext } from '@wix/stores/context/product';
4125
4125
  *
4126
4126
  * function ModifierDropdowns() {
4127
4127
  * const { modifiers, buyerSelections, selectModifier } = useProductContext();
@@ -4158,7 +4158,7 @@ interface ProductContextValue {
4158
4158
  * @param modifierId - ID of the modifier whose value to clear.
4159
4159
  * @example Clear a free-text modifier when the visitor empties its field
4160
4160
  * ```tsx
4161
- * import { useProductContext } from '@wix/stores/product-context-provider';
4161
+ * import { useProductContext } from '@wix/stores/context/product';
4162
4162
  *
4163
4163
  * function TextModifierFields() {
4164
4164
  * const { modifiers, buyerSelections, selectModifier, clearModifierSelection } = useProductContext();
@@ -4198,7 +4198,7 @@ interface ProductContextValue {
4198
4198
  * `selectionValidationErrors.subscriptionPlanId`.
4199
4199
  * @example Let the visitor choose a subscription plan
4200
4200
  * ```tsx
4201
- * import { useProductContext } from '@wix/stores/product-context-provider';
4201
+ * import { useProductContext } from '@wix/stores/context/product';
4202
4202
  *
4203
4203
  * function SubscriptionPlanPicker() {
4204
4204
  * const { subscriptionPlans, buyerSelections, selectSubscriptionPlan } = useProductContext();
@@ -4231,7 +4231,7 @@ interface ProductContextValue {
4231
4231
  * quantity below 1 is kept, and shows as `'below-min'` in `selectionValidationErrors.quantity`.
4232
4232
  * @example Change the quantity with plus and minus buttons
4233
4233
  * ```tsx
4234
- * import { useProductContext } from '@wix/stores/product-context-provider';
4234
+ * import { useProductContext } from '@wix/stores/context/product';
4235
4235
  *
4236
4236
  * function QuantityStepper() {
4237
4237
  * const { buyerSelections, maxPurchasableQuantity, selectQuantity } = useProductContext();
@@ -4274,7 +4274,7 @@ interface ProductContextValue {
4274
4274
  * Must be the index of an item in `media`.
4275
4275
  * @example Switch the gallery item from a row of buttons
4276
4276
  * ```tsx
4277
- * import { useProductContext } from '@wix/stores/product-context-provider';
4277
+ * import { useProductContext } from '@wix/stores/context/product';
4278
4278
  *
4279
4279
  * function MediaThumbnailNav() {
4280
4280
  * const { media, selectedMediaIndex, selectMedia } = useProductContext();
@@ -4318,7 +4318,7 @@ interface ProductContextValue {
4318
4318
  * @example Add the selection to the cart on a product page
4319
4319
  * ```tsx
4320
4320
  * import { useState } from 'react';
4321
- * import { useProductContext } from '@wix/stores/product-context-provider';
4321
+ * import { useProductContext } from '@wix/stores/context/product';
4322
4322
  *
4323
4323
  * function AddToCartButton() {
4324
4324
  * const { isInStock, isPreOrderState, addToCartState, handleAddToCart } = useProductContext();
@@ -4358,7 +4358,7 @@ interface ProductContextValue {
4358
4358
  * @example Start a checkout for the selection on a product page
4359
4359
  * ```tsx
4360
4360
  * import { useState } from 'react';
4361
- * import { useProductContext } from '@wix/stores/product-context-provider';
4361
+ * import { useProductContext } from '@wix/stores/context/product';
4362
4362
  *
4363
4363
  * function BuyNowButton() {
4364
4364
  * const { isInStock, isPreOrderState, buyNowState, handleBuyNow } = useProductContext();
@@ -4403,7 +4403,7 @@ interface ProductContextValue {
4403
4403
  * @example Offer a back-in-stock email for an out-of-stock selection
4404
4404
  * ```tsx
4405
4405
  * import { useState, type FormEvent } from 'react';
4406
- * import { useProductContext } from '@wix/stores/product-context-provider';
4406
+ * import { useProductContext } from '@wix/stores/context/product';
4407
4407
  *
4408
4408
  * function NotifyMeForm() {
4409
4409
  * const { isInStock, isPreOrderState, isBackInStockEnabled, selectedVariantId, handleNotifyMe } = useProductContext();
@@ -4436,10 +4436,10 @@ interface ProductContextValue {
4436
4436
  //#endregion
4437
4437
  //#region src/extensions/product/providers/product-context/product-context-provider.d.ts
4438
4438
  /**
4439
- * The Product context provides access to a store product's details, prices, media, and stock, and to
4440
- * the visitor's selection of options, modifiers, subscription plan, and quantity. Use it to show a
4441
- * product, let visitors choose what to buy, and let them add their selection to the cart, start a
4442
- * checkout, or sign up for a back-in-stock email.
4439
+ * The `useProductContext()` hook provides access to a store product's details, prices, media, and
4440
+ * stock, and to the visitor's selection of options, modifiers, subscription plan, and quantity. Use
4441
+ * it to show a product, let visitors choose what to buy, and let them add their selection to the
4442
+ * cart, start a checkout, or sign up for a back-in-stock email.
4443
4443
  */
4444
4444
  declare function useProductContext(): ProductContextValue;
4445
4445
  /** Props accepted by {@link ProductContextProvider}. */
@@ -66,7 +66,11 @@ interface PromotionItem {
66
66
  /** The current entry of the `promotionItems` array. */
67
67
  promotion: PromotionItemContextValue;
68
68
  }
69
- /** Reads the current promotion, or returns null outside a promotion item provider. */
69
+ /**
70
+ * The `usePromotionItemContext()` hook provides access to a promotion shown among the products in a
71
+ * **Product List**, including its image, alt text, link, and position. Use it to build a promotion
72
+ * card, such as a banner that links to a sale. It returns `null` outside a **Promotion Item**.
73
+ */
70
74
  declare function usePromotionItemContext(): PromotionItemContextValue | null;
71
75
  declare function usePromotionItemContextValue({
72
76
  promotion