@wix/stores 1.0.972 → 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.
- package/_sdk-exports/context-category-by-id/runtime.d.ts +33 -4
- package/_sdk-exports/context-category-by-id/runtime.js +2 -2
- package/_sdk-exports/context-category-by-slug/runtime.d.ts +33 -4
- package/_sdk-exports/context-category-by-slug/runtime.js +2 -2
- package/_sdk-exports/context-category-info/runtime.d.ts +6 -1
- package/_sdk-exports/context-category-list/runtime.d.ts +5 -1
- package/_sdk-exports/context-product/runtime.d.ts +13 -13
- package/_sdk-exports/context-product-by-id/runtime.d.ts +19 -11
- package/_sdk-exports/context-product-by-id/runtime.js +2 -2
- package/_sdk-exports/context-product-by-slug/runtime.d.ts +17 -11
- package/_sdk-exports/context-product-by-slug/runtime.js +2 -2
- package/_sdk-exports/context-product-item/runtime.d.ts +35 -2
- package/_sdk-exports/context-product-item/runtime.js +2 -2
- package/_sdk-exports/context-product-list/runtime.d.ts +29 -1
- package/_sdk-exports/context-promotion-item/runtime.d.ts +5 -1
- package/build/cjs/context-category-by-id.d.ts +33 -4
- package/build/cjs/context-category-by-id.js +1187 -822
- package/build/cjs/context-category-by-id.js.map +1 -1
- package/build/cjs/context-category-by-slug.d.ts +33 -4
- package/build/cjs/context-category-by-slug.js +1382 -1017
- package/build/cjs/context-category-by-slug.js.map +1 -1
- package/build/cjs/context-category-info.d.ts +6 -1
- package/build/cjs/context-category-list.d.ts +5 -1
- package/build/cjs/context-product-by-id.d.ts +19 -11
- package/build/cjs/context-product-by-id.js +39 -36
- package/build/cjs/context-product-by-id.js.map +1 -1
- package/build/cjs/context-product-by-slug.d.ts +17 -11
- package/build/cjs/context-product-by-slug.js +37 -34
- package/build/cjs/context-product-by-slug.js.map +1 -1
- package/build/cjs/context-product-item.d.ts +35 -2
- package/build/cjs/context-product-item.js +287 -287
- package/build/cjs/context-product-item.js.map +1 -1
- package/build/cjs/context-product-list.d.ts +29 -1
- package/build/cjs/context-product.d.ts +13 -13
- package/build/cjs/context-promotion-item.d.ts +5 -1
- package/build/es/context-category-by-id.d.mts +33 -4
- package/build/es/context-category-by-id.mjs +1194 -829
- package/build/es/context-category-by-id.mjs.map +1 -1
- package/build/es/context-category-by-slug.d.mts +33 -4
- package/build/es/context-category-by-slug.mjs +1382 -1017
- package/build/es/context-category-by-slug.mjs.map +1 -1
- package/build/es/context-category-info.d.mts +6 -1
- package/build/es/context-category-list.d.mts +5 -1
- package/build/es/context-product-by-id.d.mts +19 -11
- package/build/es/context-product-by-id.mjs +39 -36
- package/build/es/context-product-by-id.mjs.map +1 -1
- package/build/es/context-product-by-slug.d.mts +17 -11
- package/build/es/context-product-by-slug.mjs +37 -34
- package/build/es/context-product-by-slug.mjs.map +1 -1
- package/build/es/context-product-item.d.mts +35 -2
- package/build/es/context-product-item.mjs +287 -287
- package/build/es/context-product-item.mjs.map +1 -1
- package/build/es/context-product-list.d.mts +29 -1
- package/build/es/context-product.d.mts +13 -13
- package/build/es/context-promotion-item.d.mts +5 -1
- package/build/internal/cjs/context-category-by-id.d.ts +33 -4
- package/build/internal/cjs/context-category-by-slug.d.ts +33 -4
- package/build/internal/cjs/context-category-info.d.ts +6 -1
- package/build/internal/cjs/context-category-list.d.ts +5 -1
- package/build/internal/cjs/context-product-by-id.d.ts +19 -11
- package/build/internal/cjs/context-product-by-slug.d.ts +17 -11
- package/build/internal/cjs/context-product-item.d.ts +35 -2
- package/build/internal/cjs/context-product-list.d.ts +29 -1
- package/build/internal/cjs/context-product.d.ts +13 -13
- package/build/internal/cjs/context-promotion-item.d.ts +5 -1
- package/build/internal/es/context-category-by-id.d.mts +33 -4
- package/build/internal/es/context-category-by-slug.d.mts +33 -4
- package/build/internal/es/context-category-info.d.mts +6 -1
- package/build/internal/es/context-category-list.d.mts +5 -1
- package/build/internal/es/context-product-by-id.d.mts +19 -11
- package/build/internal/es/context-product-by-slug.d.mts +17 -11
- package/build/internal/es/context-product-item.d.mts +35 -2
- package/build/internal/es/context-product-list.d.mts +29 -1
- package/build/internal/es/context-product.d.mts +13 -13
- package/build/internal/es/context-promotion-item.d.mts +5 -1
- package/package.json +3 -3
|
@@ -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
|
-
/**
|
|
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
|
-
/**
|
|
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 {
|
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
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
|
|
4440
|
-
* the visitor's selection of options, modifiers, subscription plan, and quantity. Use
|
|
4441
|
-
* product, let visitors choose what to buy, and let them add their selection to the
|
|
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}. */
|
|
@@ -4010,16 +4010,7 @@ interface Price {
|
|
|
4010
4010
|
formattedAmount: string;
|
|
4011
4011
|
}
|
|
4012
4012
|
//#endregion
|
|
4013
|
-
//#region src/
|
|
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
|
-
/**
|
|
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({
|