@anker-in/shopify-react 0.1.1-beta.42 → 0.1.1-beta.43
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/dist/hooks/index.d.mts +57 -150
- package/dist/hooks/index.d.ts +57 -150
- package/dist/hooks/index.js +63 -246
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +64 -245
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +63 -246
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -245
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +1 -1
- package/dist/provider/index.d.ts +1 -1
- package/dist/provider/index.js +35 -46
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +35 -46
- package/dist/provider/index.mjs.map +1 -1
- package/dist/{types-DntkHhf8.d.mts → types-CMMWxyUF.d.mts} +2 -6
- package/dist/{types-DntkHhf8.d.ts → types-CMMWxyUF.d.ts} +2 -6
- package/package.json +5 -5
package/dist/hooks/index.d.mts
CHANGED
|
@@ -2,8 +2,8 @@ import * as swr_mutation from 'swr/mutation';
|
|
|
2
2
|
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
3
3
|
import * as _anker_in_shopify_sdk from '@anker-in/shopify-sdk';
|
|
4
4
|
import { CartLineInput, NormalizedCart, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, UpdateCartLinesOptions, HasMetafieldsIdentifier, NormalizedAttribute, Media, NormalizedCollection, CollectionsConnection, NormalizedBlog, NormalizedArticle } from '@anker-in/shopify-sdk';
|
|
5
|
-
import { U as UseAddToCartOptions, a as AddToCartInput, A as AddToCartLineItem, G as GtmParams, B as BuyNowTrackConfig, d as PlusMemberShippingMethodConfig, e as PlusMemberSettingsMetafields, D as DeliveryPlusType, f as SelectedPlusMemberVariant
|
|
6
|
-
export { g as DeliveryCustomData, P as PLUS_MEMBER_TYPE, b as PlusMemberMode, c as PlusMemberShippingMethodMetafields, S as ShippingMethodMode } from '../types-
|
|
5
|
+
import { U as UseAddToCartOptions, a as AddToCartInput, A as AddToCartLineItem, G as GtmParams, B as BuyNowTrackConfig, d as PlusMemberShippingMethodConfig, e as PlusMemberSettingsMetafields, D as DeliveryPlusType, f as SelectedPlusMemberVariant } from '../types-CMMWxyUF.mjs';
|
|
6
|
+
export { g as DeliveryCustomData, P as PLUS_MEMBER_TYPE, b as PlusMemberMode, c as PlusMemberShippingMethodMetafields, S as ShippingMethodMode } from '../types-CMMWxyUF.mjs';
|
|
7
7
|
import Decimal from 'decimal.js';
|
|
8
8
|
import * as swr from 'swr';
|
|
9
9
|
import swr__default, { SWRConfiguration } from 'swr';
|
|
@@ -694,48 +694,32 @@ interface ShippingMethodsContext {
|
|
|
694
694
|
tddCoupon?: string;
|
|
695
695
|
isLoadingCoupon: boolean;
|
|
696
696
|
}
|
|
697
|
-
interface PlusMemberContextValue<TProduct = any, TVariant = any, TProfile
|
|
697
|
+
interface PlusMemberContextValue<TProduct = any, TVariant = any, TProfile extends {
|
|
698
|
+
isPlus?: boolean;
|
|
699
|
+
} = any> {
|
|
698
700
|
plusMemberMetafields: PlusMemberSettingsMetafields;
|
|
699
|
-
shopCommon?: Record<string, any>;
|
|
700
|
-
zipCode: string;
|
|
701
|
-
setZipCode: (value: string) => void;
|
|
702
|
-
allowNextDayDelivery: boolean;
|
|
703
|
-
setAllowNextDayDelivery: (value: boolean) => void;
|
|
704
|
-
allowThirdDayDelivery: boolean;
|
|
705
|
-
setAllowThirdDayDelivery: (value: boolean) => void;
|
|
706
701
|
selectedPlusMemberMode: DeliveryPlusType;
|
|
707
702
|
setSelectedPlusMemberMode: (value: DeliveryPlusType) => void;
|
|
708
|
-
showAreaCheckModal: boolean;
|
|
709
|
-
setShowAreaCheckModal: (value: boolean) => void;
|
|
710
703
|
selectedShippingMethod?: PlusMemberShippingMethodConfig;
|
|
711
704
|
setSelectedShippingMethod: (value: PlusMemberShippingMethodConfig) => void;
|
|
712
|
-
showTip: boolean;
|
|
713
|
-
setShowTip: (value: boolean) => void;
|
|
714
705
|
showMoreShippingMethod: boolean;
|
|
715
706
|
setShowMoreShippingMethod: (value: boolean) => void;
|
|
716
707
|
variant: TVariant;
|
|
717
708
|
product: TProduct;
|
|
718
709
|
shippingMethodsContext: ShippingMethodsContext;
|
|
719
710
|
selectedPlusMemberVariant: SelectedPlusMemberVariant;
|
|
720
|
-
monthlyVariant?: NormalizedProductVariant & {
|
|
721
|
-
product: NormalizedProduct | undefined;
|
|
722
|
-
};
|
|
723
|
-
annualVariant?: NormalizedProductVariant & {
|
|
724
|
-
product: NormalizedProduct | undefined;
|
|
725
|
-
};
|
|
726
711
|
showPlusMemberBenefit: boolean;
|
|
727
712
|
setShowPlusMemberBenefit: (value: boolean) => void;
|
|
728
|
-
deleteMarginBottom: boolean;
|
|
729
|
-
setDeleteMarginBottom: (value: boolean) => void;
|
|
730
713
|
profile?: TProfile;
|
|
731
|
-
locale?: string;
|
|
732
714
|
}
|
|
733
715
|
declare const PlusMemberContext: React$1.Context<PlusMemberContextValue<any, any, any>>;
|
|
734
716
|
|
|
735
717
|
/**
|
|
736
718
|
* Hook to access Plus Member Context
|
|
737
719
|
*/
|
|
738
|
-
declare function usePlusMemberContext<
|
|
720
|
+
declare function usePlusMemberContext<TProfile extends {
|
|
721
|
+
isPlus?: boolean;
|
|
722
|
+
} = any>(): PlusMemberContextValue<any, any, any>;
|
|
739
723
|
|
|
740
724
|
/**
|
|
741
725
|
* Hook to get Plus Member Product Variants (Monthly and Annual)
|
|
@@ -772,20 +756,16 @@ declare function usePlusMemberVariants({ memberSetting, }: UsePlusMemberVariants
|
|
|
772
756
|
* Hook to calculate available shipping methods based on product weight and member status
|
|
773
757
|
*/
|
|
774
758
|
|
|
775
|
-
interface UseShippingMethodsOptions<TVariant = any
|
|
759
|
+
interface UseShippingMethodsOptions<TVariant = any, TProfile extends {
|
|
760
|
+
isPlus?: boolean;
|
|
761
|
+
} = any> {
|
|
776
762
|
/** Product variant with weight information */
|
|
777
763
|
variant: TVariant;
|
|
778
|
-
/** Whether next day delivery is allowed */
|
|
779
|
-
allowNextDayDelivery: boolean;
|
|
780
|
-
/** Whether third day delivery is allowed */
|
|
781
|
-
allowThirdDayDelivery: boolean;
|
|
782
764
|
/** Plus member metafields configuration */
|
|
783
765
|
plusMemberMetafields: PlusMemberSettingsMetafields;
|
|
784
766
|
/** Selected plus member mode */
|
|
785
767
|
selectedPlusMemberMode: DeliveryPlusType;
|
|
786
|
-
|
|
787
|
-
isPlus?: boolean;
|
|
788
|
-
profile?: any;
|
|
768
|
+
profile?: TProfile;
|
|
789
769
|
}
|
|
790
770
|
interface UseShippingMethodsResult {
|
|
791
771
|
freeShippingMethods: PlusMemberShippingMethodConfig[];
|
|
@@ -806,11 +786,8 @@ interface UseShippingMethodsResult {
|
|
|
806
786
|
* ```tsx
|
|
807
787
|
* const { freeShippingMethods, paymentShippingMethods, nddOverweight, tddOverweight } = useShippingMethods({
|
|
808
788
|
* variant,
|
|
809
|
-
* allowNextDayDelivery,
|
|
810
|
-
* allowThirdDayDelivery,
|
|
811
789
|
* plusMemberMetafields,
|
|
812
790
|
* selectedPlusMemberMode,
|
|
813
|
-
* isPlus: profile?.isPlus,
|
|
814
791
|
* })
|
|
815
792
|
* ```
|
|
816
793
|
*/
|
|
@@ -818,11 +795,6 @@ declare function useShippingMethods<TVariant extends {
|
|
|
818
795
|
weight?: number;
|
|
819
796
|
} = any>(options: UseShippingMethodsOptions<TVariant>): UseShippingMethodsResult;
|
|
820
797
|
|
|
821
|
-
/**
|
|
822
|
-
* Hook to check shipping method availability and automatically adjust selection
|
|
823
|
-
*/
|
|
824
|
-
declare function useShippingMethodAvailableCheck(): void;
|
|
825
|
-
|
|
826
798
|
/**
|
|
827
799
|
* Hook to replace cart plus member product
|
|
828
800
|
*
|
|
@@ -846,116 +818,18 @@ declare const useReplaceCartPlusMember: () => () => Promise<void>;
|
|
|
846
818
|
*
|
|
847
819
|
* Extracts and returns the discount codes from the delivery custom data.
|
|
848
820
|
*
|
|
849
|
-
* @param deliveryData - Delivery data containing custom attributes
|
|
850
821
|
* @returns Array of discount codes or undefined
|
|
851
822
|
*
|
|
852
823
|
* @example
|
|
853
824
|
* ```tsx
|
|
854
|
-
* const deliveryCodes = usePlusMemberDeliveryCodes(
|
|
855
|
-
* ```
|
|
856
|
-
*/
|
|
857
|
-
declare const usePlusMemberDeliveryCodes: ({ deliveryData, }: {
|
|
858
|
-
deliveryData?: DeliveryData;
|
|
859
|
-
}) => string[] | undefined;
|
|
860
|
-
|
|
861
|
-
interface UseUpdatePlusMemberDeliveryOptionsProps {
|
|
862
|
-
/** SWR mutation configuration */
|
|
863
|
-
options?: SWRMutationConfiguration<any, Error, 'update-cart-delivery-options', {
|
|
864
|
-
deliveryData: DeliveryData;
|
|
865
|
-
}>;
|
|
866
|
-
}
|
|
867
|
-
/**
|
|
868
|
-
* Hook to update cart delivery options based on plus member delivery data
|
|
869
|
-
*
|
|
870
|
-
* This hook extracts the selected delivery option from delivery custom data and
|
|
871
|
-
* maps it to the appropriate delivery option handle from the cart's deliveryGroups.
|
|
872
|
-
* It then triggers the update-cart-delivery-options mutation to apply the selection.
|
|
873
|
-
*
|
|
874
|
-
* The hook handles:
|
|
875
|
-
* - Extracting delivery option code from deliveryCustomData.selected_delivery_option
|
|
876
|
-
* - Finding the matching delivery option in cart.deliveryGroups
|
|
877
|
-
* - Triggering the cart update with the correct delivery option handle
|
|
878
|
-
*
|
|
879
|
-
* @param props - Hook properties
|
|
880
|
-
* @returns useSWRMutation result with trigger and loading state
|
|
881
|
-
*
|
|
882
|
-
* @example
|
|
883
|
-
* ```tsx
|
|
884
|
-
* const { trigger, isMutating } = useUpdatePlusMemberDeliveryOptions()
|
|
885
|
-
*
|
|
886
|
-
* // Trigger update with delivery data
|
|
887
|
-
* await trigger({ deliveryData })
|
|
825
|
+
* const deliveryCodes = usePlusMemberDeliveryCodes()
|
|
888
826
|
* ```
|
|
889
827
|
*/
|
|
890
|
-
declare const
|
|
891
|
-
deliveryData: DeliveryData;
|
|
892
|
-
}>;
|
|
828
|
+
declare const usePlusMemberDeliveryCodes: () => (string | undefined)[];
|
|
893
829
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
* Creates custom attributes based on delivery data to be attached to line items.
|
|
898
|
-
*
|
|
899
|
-
* @param deliveryData - Delivery data containing custom attributes
|
|
900
|
-
* @returns Array of custom attributes for line items
|
|
901
|
-
*
|
|
902
|
-
* @example
|
|
903
|
-
* ```tsx
|
|
904
|
-
* const itemAttributes = usePlusMemberItemCustomAttributes({ deliveryData })
|
|
905
|
-
*
|
|
906
|
-
* // Use in addToCart
|
|
907
|
-
* await addToCart({
|
|
908
|
-
* lineItems: lineItems.map(item => ({
|
|
909
|
-
* ...item,
|
|
910
|
-
* customAttributes: [...(item.customAttributes || []), ...itemAttributes]
|
|
911
|
-
* }))
|
|
912
|
-
* })
|
|
913
|
-
* ```
|
|
914
|
-
*/
|
|
915
|
-
declare const usePlusMemberItemCustomAttributes: ({ deliveryData, }: {
|
|
916
|
-
deliveryData?: DeliveryData;
|
|
917
|
-
}) => NormalizedAttribute[];
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* Hook to generate custom attributes for checkout
|
|
921
|
-
*
|
|
922
|
-
* Creates custom attributes based on delivery data, profile, and customer information
|
|
923
|
-
* to be attached to the checkout.
|
|
924
|
-
*
|
|
925
|
-
* Requires profile to be provided via PlusMemberContext.
|
|
926
|
-
*
|
|
927
|
-
* @param deliveryData - Delivery data containing custom attributes
|
|
928
|
-
* @param product - Product information (optional, for hiding shipping benefits check)
|
|
929
|
-
* @param variant - Variant information (optional, for presale and hiding shipping benefits check)
|
|
930
|
-
* @param isShowShippingBenefits - Function to check if shipping benefits should be shown (optional)
|
|
931
|
-
* @returns Array of custom attributes for checkout
|
|
932
|
-
*
|
|
933
|
-
* @example
|
|
934
|
-
* ```tsx
|
|
935
|
-
* const checkoutAttributes = usePlusMemberCheckoutCustomAttributes({
|
|
936
|
-
* deliveryData,
|
|
937
|
-
* product,
|
|
938
|
-
* variant,
|
|
939
|
-
* customer,
|
|
940
|
-
* isShowShippingBenefits
|
|
941
|
-
* })
|
|
942
|
-
*
|
|
943
|
-
* // Use in checkout
|
|
944
|
-
* await createCheckout({
|
|
945
|
-
* lineItems,
|
|
946
|
-
* customAttributes: checkoutAttributes
|
|
947
|
-
* })
|
|
948
|
-
* ```
|
|
949
|
-
*/
|
|
950
|
-
declare const usePlusMemberCheckoutCustomAttributes: <TProduct = any, TVariant = any>({ deliveryData, product, variant, isShowShippingBenefits, }: {
|
|
951
|
-
deliveryData?: DeliveryData;
|
|
952
|
-
product?: TProduct;
|
|
953
|
-
variant?: TVariant;
|
|
954
|
-
isShowShippingBenefits?: (args: {
|
|
955
|
-
variant?: TVariant;
|
|
956
|
-
product?: TProduct;
|
|
957
|
-
setting: any;
|
|
958
|
-
}) => boolean;
|
|
830
|
+
declare const usePlusMemberCheckoutCustomAttributes: ({ disableShipping, isPresaleContains, }: {
|
|
831
|
+
disableShipping?: boolean;
|
|
832
|
+
isPresaleContains?: boolean;
|
|
959
833
|
}) => NormalizedAttribute[];
|
|
960
834
|
|
|
961
835
|
/**
|
|
@@ -990,11 +864,11 @@ interface UseAutoRemovePlusMemberInCartProps {
|
|
|
990
864
|
declare function useAutoRemovePlusMemberInCart({ cart, profile, memberSetting, }: UseAutoRemovePlusMemberInCartProps): void;
|
|
991
865
|
|
|
992
866
|
/**
|
|
993
|
-
*
|
|
867
|
+
* Has Plus Member In Cart
|
|
994
868
|
* 判断购物车中是否包含年费会员或月费会员产品
|
|
995
869
|
*/
|
|
996
870
|
|
|
997
|
-
interface
|
|
871
|
+
interface HasPlusMemberInCartProps {
|
|
998
872
|
/** Plus Member 配置 */
|
|
999
873
|
memberSetting?: PlusMemberSettingsMetafields;
|
|
1000
874
|
/** 购物车数据 */
|
|
@@ -1023,10 +897,40 @@ interface HasPlusMemberInCartResult {
|
|
|
1023
897
|
};
|
|
1024
898
|
}
|
|
1025
899
|
/**
|
|
1026
|
-
*
|
|
900
|
+
* 判断购物车中是否包含年费会员或月费会员产品(纯函数版本)
|
|
901
|
+
*
|
|
902
|
+
* @param props - 函数参数
|
|
903
|
+
* @param props.memberSetting - Plus Member 配置
|
|
904
|
+
* @param props.cart - 购物车数据
|
|
905
|
+
* @returns 会员产品信息
|
|
906
|
+
*
|
|
907
|
+
* @example
|
|
908
|
+
* ```tsx
|
|
909
|
+
* const {
|
|
910
|
+
* hasPlusMember,
|
|
911
|
+
* hasMonthlyPlus,
|
|
912
|
+
* hasAnnualPlus,
|
|
913
|
+
* monthlyPlusItem,
|
|
914
|
+
* annualPlusItem,
|
|
915
|
+
* } = hasPlusMemberInCart({
|
|
916
|
+
* memberSetting: plusMemberSettings,
|
|
917
|
+
* cart: currentCart,
|
|
918
|
+
* })
|
|
919
|
+
*
|
|
920
|
+
* if (hasPlusMember) {
|
|
921
|
+
* console.log('购物车中有会员产品')
|
|
922
|
+
* }
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
925
|
+
declare function hasPlusMemberInCart({ memberSetting, cart, }: HasPlusMemberInCartProps): HasPlusMemberInCartResult;
|
|
926
|
+
/**
|
|
927
|
+
* 判断购物车中是否包含年费会员或月费会员产品(Hook 版本)
|
|
928
|
+
*
|
|
929
|
+
* 内部使用 hasPlusMemberInCart 纯函数,并通过 useMemo 优化性能
|
|
1027
930
|
*
|
|
1028
931
|
* @param props - Hook 参数
|
|
1029
|
-
* @param props.
|
|
932
|
+
* @param props.memberSetting - Plus Member 配置
|
|
933
|
+
* @param props.cart - 购物车数据
|
|
1030
934
|
* @returns 会员产品信息
|
|
1031
935
|
*
|
|
1032
936
|
* @example
|
|
@@ -1039,6 +943,7 @@ interface HasPlusMemberInCartResult {
|
|
|
1039
943
|
* annualPlusItem,
|
|
1040
944
|
* } = useHasPlusMemberInCart({
|
|
1041
945
|
* memberSetting: plusMemberSettings,
|
|
946
|
+
* cart: currentCart,
|
|
1042
947
|
* })
|
|
1043
948
|
*
|
|
1044
949
|
* if (hasPlusMember) {
|
|
@@ -1046,7 +951,7 @@ interface HasPlusMemberInCartResult {
|
|
|
1046
951
|
* }
|
|
1047
952
|
* ```
|
|
1048
953
|
*/
|
|
1049
|
-
declare function useHasPlusMemberInCart({ memberSetting, cart, }:
|
|
954
|
+
declare function useHasPlusMemberInCart({ memberSetting, cart, }: HasPlusMemberInCartProps): HasPlusMemberInCartResult;
|
|
1050
955
|
|
|
1051
956
|
/**
|
|
1052
957
|
* 返回需要添加到购物车的 Plus Member 产品
|
|
@@ -1082,7 +987,9 @@ declare const useAvailableDeliveryCoupon: ({ profile, }: {
|
|
|
1082
987
|
profile?: any;
|
|
1083
988
|
}) => UseAvailableDeliveryCouponResult;
|
|
1084
989
|
|
|
1085
|
-
interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile
|
|
990
|
+
interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile extends {
|
|
991
|
+
isPlus?: boolean;
|
|
992
|
+
} = any> {
|
|
1086
993
|
variant: TVariant;
|
|
1087
994
|
product: TProduct;
|
|
1088
995
|
memberSetting: PlusMemberSettingsMetafields;
|
|
@@ -1987,4 +1894,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
1987
1894
|
*/
|
|
1988
1895
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
1989
1896
|
|
|
1990
|
-
export { type AddCartLinesInput, AddToCartInput, AddToCartLineItem, type ApplyCartCodesInput, type AutoFreeGift, type AutoFreeGiftCartLineInput, type AutoFreeGiftConfig, type AutoFreeGiftItem, type AutoFreeGiftList, type AutoFreeGiftMainProduct, type BuyNowInput, BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, type Config, type CreateCartInput,
|
|
1897
|
+
export { type AddCartLinesInput, AddToCartInput, AddToCartLineItem, type ApplyCartCodesInput, type AutoFreeGift, type AutoFreeGiftCartLineInput, type AutoFreeGiftConfig, type AutoFreeGiftItem, type AutoFreeGiftList, type AutoFreeGiftMainProduct, type BuyNowInput, BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, type Config, type CreateCartInput, DeliveryPlusType, type DiscountLabel, type FormattedGift, type FunctionGiftResult, type GeoLocationData, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type ImageMedia, type LocaleMapping, MAIN_PRODUCT_CODE, MEMBER_PRICE_ATTRIBUTE_KEY, type MainProductInfo, type NormalizedSearchResultItem, type Options, OrderBasePriceType, type OrderDiscountConfig, type OrderDiscountResult, OrderDiscountType, PlusMemberContext, type PlusMemberContextValue, PlusMemberProvider, type PlusMemberProviderProps, PlusMemberSettingsMetafields, PlusMemberShippingMethodConfig, PriceBasePriceType, type PriceDiscountConfig, PriceDiscountType, type RemoveCartCodesInput, type RemoveCartLinesInput, type RewardItem, type RuleCondition, RuleType, SCRIPT_CODE_AMOUNT_KEY, type SearchResult, type SearchResultType, type SelectedOptionsResult, SelectedPlusMemberVariant, type ShippingMethodsContext, type SiteInfo, SpendMoneyType, type TieredDiscount, type UpdateCartAttributesInput, UseAddToCartOptions, type UseAllBlogsOptions, type UseAllCollectionsOptions, type UseAllProductsOptions, type UseArticleOptions, type UseArticlesInBlogOptions, type UseArticlesOptions, type UseAutoRemovePlusMemberInCartProps, type UseAvailableDeliveryCouponResult, type UseBlogOptions, type UseBuyNowOptions, type UseCalcGiftsFromLinesOptions, type UseCalcGiftsFromLinesResult, type UseCollectionOptions, type UseCollectionsOptions, type UseExposureOptions, type UseGeoLocationOptions, type UseIntersectionOptions, type UsePlusMemberVariantsOptions, type UsePlusMemberVariantsResult, type UsePriceOptions, type UsePriceResult, type UseProductOptions, type UseProductsByHandlesOptions, type UseScriptAutoFreeGiftResult, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingMethodsResult, type UseSiteOptions, type UseUpdateCartAttributesOptions, type VariantItem, type VariantMedia, type VideoMedia, checkAttributesUpdateNeeded, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, hasPlusMemberInCart, normalizeAddToCartLines, preCheck, safeParse, useAddCartLines, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useAvailableDeliveryCoupon, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useIntersection, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberDeliveryCodes, usePlusMemberNeedAddToCart, usePlusMemberVariants, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useScriptAutoFreeGift, useSearch, useSelectedOptions, useShippingMethods, useSite, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdateVariantQuery, useVariant, useVariantMedia };
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ import * as swr_mutation from 'swr/mutation';
|
|
|
2
2
|
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
3
3
|
import * as _anker_in_shopify_sdk from '@anker-in/shopify-sdk';
|
|
4
4
|
import { CartLineInput, NormalizedCart, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, UpdateCartLinesOptions, HasMetafieldsIdentifier, NormalizedAttribute, Media, NormalizedCollection, CollectionsConnection, NormalizedBlog, NormalizedArticle } from '@anker-in/shopify-sdk';
|
|
5
|
-
import { U as UseAddToCartOptions, a as AddToCartInput, A as AddToCartLineItem, G as GtmParams, B as BuyNowTrackConfig, d as PlusMemberShippingMethodConfig, e as PlusMemberSettingsMetafields, D as DeliveryPlusType, f as SelectedPlusMemberVariant
|
|
6
|
-
export { g as DeliveryCustomData, P as PLUS_MEMBER_TYPE, b as PlusMemberMode, c as PlusMemberShippingMethodMetafields, S as ShippingMethodMode } from '../types-
|
|
5
|
+
import { U as UseAddToCartOptions, a as AddToCartInput, A as AddToCartLineItem, G as GtmParams, B as BuyNowTrackConfig, d as PlusMemberShippingMethodConfig, e as PlusMemberSettingsMetafields, D as DeliveryPlusType, f as SelectedPlusMemberVariant } from '../types-CMMWxyUF.js';
|
|
6
|
+
export { g as DeliveryCustomData, P as PLUS_MEMBER_TYPE, b as PlusMemberMode, c as PlusMemberShippingMethodMetafields, S as ShippingMethodMode } from '../types-CMMWxyUF.js';
|
|
7
7
|
import Decimal from 'decimal.js';
|
|
8
8
|
import * as swr from 'swr';
|
|
9
9
|
import swr__default, { SWRConfiguration } from 'swr';
|
|
@@ -694,48 +694,32 @@ interface ShippingMethodsContext {
|
|
|
694
694
|
tddCoupon?: string;
|
|
695
695
|
isLoadingCoupon: boolean;
|
|
696
696
|
}
|
|
697
|
-
interface PlusMemberContextValue<TProduct = any, TVariant = any, TProfile
|
|
697
|
+
interface PlusMemberContextValue<TProduct = any, TVariant = any, TProfile extends {
|
|
698
|
+
isPlus?: boolean;
|
|
699
|
+
} = any> {
|
|
698
700
|
plusMemberMetafields: PlusMemberSettingsMetafields;
|
|
699
|
-
shopCommon?: Record<string, any>;
|
|
700
|
-
zipCode: string;
|
|
701
|
-
setZipCode: (value: string) => void;
|
|
702
|
-
allowNextDayDelivery: boolean;
|
|
703
|
-
setAllowNextDayDelivery: (value: boolean) => void;
|
|
704
|
-
allowThirdDayDelivery: boolean;
|
|
705
|
-
setAllowThirdDayDelivery: (value: boolean) => void;
|
|
706
701
|
selectedPlusMemberMode: DeliveryPlusType;
|
|
707
702
|
setSelectedPlusMemberMode: (value: DeliveryPlusType) => void;
|
|
708
|
-
showAreaCheckModal: boolean;
|
|
709
|
-
setShowAreaCheckModal: (value: boolean) => void;
|
|
710
703
|
selectedShippingMethod?: PlusMemberShippingMethodConfig;
|
|
711
704
|
setSelectedShippingMethod: (value: PlusMemberShippingMethodConfig) => void;
|
|
712
|
-
showTip: boolean;
|
|
713
|
-
setShowTip: (value: boolean) => void;
|
|
714
705
|
showMoreShippingMethod: boolean;
|
|
715
706
|
setShowMoreShippingMethod: (value: boolean) => void;
|
|
716
707
|
variant: TVariant;
|
|
717
708
|
product: TProduct;
|
|
718
709
|
shippingMethodsContext: ShippingMethodsContext;
|
|
719
710
|
selectedPlusMemberVariant: SelectedPlusMemberVariant;
|
|
720
|
-
monthlyVariant?: NormalizedProductVariant & {
|
|
721
|
-
product: NormalizedProduct | undefined;
|
|
722
|
-
};
|
|
723
|
-
annualVariant?: NormalizedProductVariant & {
|
|
724
|
-
product: NormalizedProduct | undefined;
|
|
725
|
-
};
|
|
726
711
|
showPlusMemberBenefit: boolean;
|
|
727
712
|
setShowPlusMemberBenefit: (value: boolean) => void;
|
|
728
|
-
deleteMarginBottom: boolean;
|
|
729
|
-
setDeleteMarginBottom: (value: boolean) => void;
|
|
730
713
|
profile?: TProfile;
|
|
731
|
-
locale?: string;
|
|
732
714
|
}
|
|
733
715
|
declare const PlusMemberContext: React$1.Context<PlusMemberContextValue<any, any, any>>;
|
|
734
716
|
|
|
735
717
|
/**
|
|
736
718
|
* Hook to access Plus Member Context
|
|
737
719
|
*/
|
|
738
|
-
declare function usePlusMemberContext<
|
|
720
|
+
declare function usePlusMemberContext<TProfile extends {
|
|
721
|
+
isPlus?: boolean;
|
|
722
|
+
} = any>(): PlusMemberContextValue<any, any, any>;
|
|
739
723
|
|
|
740
724
|
/**
|
|
741
725
|
* Hook to get Plus Member Product Variants (Monthly and Annual)
|
|
@@ -772,20 +756,16 @@ declare function usePlusMemberVariants({ memberSetting, }: UsePlusMemberVariants
|
|
|
772
756
|
* Hook to calculate available shipping methods based on product weight and member status
|
|
773
757
|
*/
|
|
774
758
|
|
|
775
|
-
interface UseShippingMethodsOptions<TVariant = any
|
|
759
|
+
interface UseShippingMethodsOptions<TVariant = any, TProfile extends {
|
|
760
|
+
isPlus?: boolean;
|
|
761
|
+
} = any> {
|
|
776
762
|
/** Product variant with weight information */
|
|
777
763
|
variant: TVariant;
|
|
778
|
-
/** Whether next day delivery is allowed */
|
|
779
|
-
allowNextDayDelivery: boolean;
|
|
780
|
-
/** Whether third day delivery is allowed */
|
|
781
|
-
allowThirdDayDelivery: boolean;
|
|
782
764
|
/** Plus member metafields configuration */
|
|
783
765
|
plusMemberMetafields: PlusMemberSettingsMetafields;
|
|
784
766
|
/** Selected plus member mode */
|
|
785
767
|
selectedPlusMemberMode: DeliveryPlusType;
|
|
786
|
-
|
|
787
|
-
isPlus?: boolean;
|
|
788
|
-
profile?: any;
|
|
768
|
+
profile?: TProfile;
|
|
789
769
|
}
|
|
790
770
|
interface UseShippingMethodsResult {
|
|
791
771
|
freeShippingMethods: PlusMemberShippingMethodConfig[];
|
|
@@ -806,11 +786,8 @@ interface UseShippingMethodsResult {
|
|
|
806
786
|
* ```tsx
|
|
807
787
|
* const { freeShippingMethods, paymentShippingMethods, nddOverweight, tddOverweight } = useShippingMethods({
|
|
808
788
|
* variant,
|
|
809
|
-
* allowNextDayDelivery,
|
|
810
|
-
* allowThirdDayDelivery,
|
|
811
789
|
* plusMemberMetafields,
|
|
812
790
|
* selectedPlusMemberMode,
|
|
813
|
-
* isPlus: profile?.isPlus,
|
|
814
791
|
* })
|
|
815
792
|
* ```
|
|
816
793
|
*/
|
|
@@ -818,11 +795,6 @@ declare function useShippingMethods<TVariant extends {
|
|
|
818
795
|
weight?: number;
|
|
819
796
|
} = any>(options: UseShippingMethodsOptions<TVariant>): UseShippingMethodsResult;
|
|
820
797
|
|
|
821
|
-
/**
|
|
822
|
-
* Hook to check shipping method availability and automatically adjust selection
|
|
823
|
-
*/
|
|
824
|
-
declare function useShippingMethodAvailableCheck(): void;
|
|
825
|
-
|
|
826
798
|
/**
|
|
827
799
|
* Hook to replace cart plus member product
|
|
828
800
|
*
|
|
@@ -846,116 +818,18 @@ declare const useReplaceCartPlusMember: () => () => Promise<void>;
|
|
|
846
818
|
*
|
|
847
819
|
* Extracts and returns the discount codes from the delivery custom data.
|
|
848
820
|
*
|
|
849
|
-
* @param deliveryData - Delivery data containing custom attributes
|
|
850
821
|
* @returns Array of discount codes or undefined
|
|
851
822
|
*
|
|
852
823
|
* @example
|
|
853
824
|
* ```tsx
|
|
854
|
-
* const deliveryCodes = usePlusMemberDeliveryCodes(
|
|
855
|
-
* ```
|
|
856
|
-
*/
|
|
857
|
-
declare const usePlusMemberDeliveryCodes: ({ deliveryData, }: {
|
|
858
|
-
deliveryData?: DeliveryData;
|
|
859
|
-
}) => string[] | undefined;
|
|
860
|
-
|
|
861
|
-
interface UseUpdatePlusMemberDeliveryOptionsProps {
|
|
862
|
-
/** SWR mutation configuration */
|
|
863
|
-
options?: SWRMutationConfiguration<any, Error, 'update-cart-delivery-options', {
|
|
864
|
-
deliveryData: DeliveryData;
|
|
865
|
-
}>;
|
|
866
|
-
}
|
|
867
|
-
/**
|
|
868
|
-
* Hook to update cart delivery options based on plus member delivery data
|
|
869
|
-
*
|
|
870
|
-
* This hook extracts the selected delivery option from delivery custom data and
|
|
871
|
-
* maps it to the appropriate delivery option handle from the cart's deliveryGroups.
|
|
872
|
-
* It then triggers the update-cart-delivery-options mutation to apply the selection.
|
|
873
|
-
*
|
|
874
|
-
* The hook handles:
|
|
875
|
-
* - Extracting delivery option code from deliveryCustomData.selected_delivery_option
|
|
876
|
-
* - Finding the matching delivery option in cart.deliveryGroups
|
|
877
|
-
* - Triggering the cart update with the correct delivery option handle
|
|
878
|
-
*
|
|
879
|
-
* @param props - Hook properties
|
|
880
|
-
* @returns useSWRMutation result with trigger and loading state
|
|
881
|
-
*
|
|
882
|
-
* @example
|
|
883
|
-
* ```tsx
|
|
884
|
-
* const { trigger, isMutating } = useUpdatePlusMemberDeliveryOptions()
|
|
885
|
-
*
|
|
886
|
-
* // Trigger update with delivery data
|
|
887
|
-
* await trigger({ deliveryData })
|
|
825
|
+
* const deliveryCodes = usePlusMemberDeliveryCodes()
|
|
888
826
|
* ```
|
|
889
827
|
*/
|
|
890
|
-
declare const
|
|
891
|
-
deliveryData: DeliveryData;
|
|
892
|
-
}>;
|
|
828
|
+
declare const usePlusMemberDeliveryCodes: () => (string | undefined)[];
|
|
893
829
|
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
* Creates custom attributes based on delivery data to be attached to line items.
|
|
898
|
-
*
|
|
899
|
-
* @param deliveryData - Delivery data containing custom attributes
|
|
900
|
-
* @returns Array of custom attributes for line items
|
|
901
|
-
*
|
|
902
|
-
* @example
|
|
903
|
-
* ```tsx
|
|
904
|
-
* const itemAttributes = usePlusMemberItemCustomAttributes({ deliveryData })
|
|
905
|
-
*
|
|
906
|
-
* // Use in addToCart
|
|
907
|
-
* await addToCart({
|
|
908
|
-
* lineItems: lineItems.map(item => ({
|
|
909
|
-
* ...item,
|
|
910
|
-
* customAttributes: [...(item.customAttributes || []), ...itemAttributes]
|
|
911
|
-
* }))
|
|
912
|
-
* })
|
|
913
|
-
* ```
|
|
914
|
-
*/
|
|
915
|
-
declare const usePlusMemberItemCustomAttributes: ({ deliveryData, }: {
|
|
916
|
-
deliveryData?: DeliveryData;
|
|
917
|
-
}) => NormalizedAttribute[];
|
|
918
|
-
|
|
919
|
-
/**
|
|
920
|
-
* Hook to generate custom attributes for checkout
|
|
921
|
-
*
|
|
922
|
-
* Creates custom attributes based on delivery data, profile, and customer information
|
|
923
|
-
* to be attached to the checkout.
|
|
924
|
-
*
|
|
925
|
-
* Requires profile to be provided via PlusMemberContext.
|
|
926
|
-
*
|
|
927
|
-
* @param deliveryData - Delivery data containing custom attributes
|
|
928
|
-
* @param product - Product information (optional, for hiding shipping benefits check)
|
|
929
|
-
* @param variant - Variant information (optional, for presale and hiding shipping benefits check)
|
|
930
|
-
* @param isShowShippingBenefits - Function to check if shipping benefits should be shown (optional)
|
|
931
|
-
* @returns Array of custom attributes for checkout
|
|
932
|
-
*
|
|
933
|
-
* @example
|
|
934
|
-
* ```tsx
|
|
935
|
-
* const checkoutAttributes = usePlusMemberCheckoutCustomAttributes({
|
|
936
|
-
* deliveryData,
|
|
937
|
-
* product,
|
|
938
|
-
* variant,
|
|
939
|
-
* customer,
|
|
940
|
-
* isShowShippingBenefits
|
|
941
|
-
* })
|
|
942
|
-
*
|
|
943
|
-
* // Use in checkout
|
|
944
|
-
* await createCheckout({
|
|
945
|
-
* lineItems,
|
|
946
|
-
* customAttributes: checkoutAttributes
|
|
947
|
-
* })
|
|
948
|
-
* ```
|
|
949
|
-
*/
|
|
950
|
-
declare const usePlusMemberCheckoutCustomAttributes: <TProduct = any, TVariant = any>({ deliveryData, product, variant, isShowShippingBenefits, }: {
|
|
951
|
-
deliveryData?: DeliveryData;
|
|
952
|
-
product?: TProduct;
|
|
953
|
-
variant?: TVariant;
|
|
954
|
-
isShowShippingBenefits?: (args: {
|
|
955
|
-
variant?: TVariant;
|
|
956
|
-
product?: TProduct;
|
|
957
|
-
setting: any;
|
|
958
|
-
}) => boolean;
|
|
830
|
+
declare const usePlusMemberCheckoutCustomAttributes: ({ disableShipping, isPresaleContains, }: {
|
|
831
|
+
disableShipping?: boolean;
|
|
832
|
+
isPresaleContains?: boolean;
|
|
959
833
|
}) => NormalizedAttribute[];
|
|
960
834
|
|
|
961
835
|
/**
|
|
@@ -990,11 +864,11 @@ interface UseAutoRemovePlusMemberInCartProps {
|
|
|
990
864
|
declare function useAutoRemovePlusMemberInCart({ cart, profile, memberSetting, }: UseAutoRemovePlusMemberInCartProps): void;
|
|
991
865
|
|
|
992
866
|
/**
|
|
993
|
-
*
|
|
867
|
+
* Has Plus Member In Cart
|
|
994
868
|
* 判断购物车中是否包含年费会员或月费会员产品
|
|
995
869
|
*/
|
|
996
870
|
|
|
997
|
-
interface
|
|
871
|
+
interface HasPlusMemberInCartProps {
|
|
998
872
|
/** Plus Member 配置 */
|
|
999
873
|
memberSetting?: PlusMemberSettingsMetafields;
|
|
1000
874
|
/** 购物车数据 */
|
|
@@ -1023,10 +897,40 @@ interface HasPlusMemberInCartResult {
|
|
|
1023
897
|
};
|
|
1024
898
|
}
|
|
1025
899
|
/**
|
|
1026
|
-
*
|
|
900
|
+
* 判断购物车中是否包含年费会员或月费会员产品(纯函数版本)
|
|
901
|
+
*
|
|
902
|
+
* @param props - 函数参数
|
|
903
|
+
* @param props.memberSetting - Plus Member 配置
|
|
904
|
+
* @param props.cart - 购物车数据
|
|
905
|
+
* @returns 会员产品信息
|
|
906
|
+
*
|
|
907
|
+
* @example
|
|
908
|
+
* ```tsx
|
|
909
|
+
* const {
|
|
910
|
+
* hasPlusMember,
|
|
911
|
+
* hasMonthlyPlus,
|
|
912
|
+
* hasAnnualPlus,
|
|
913
|
+
* monthlyPlusItem,
|
|
914
|
+
* annualPlusItem,
|
|
915
|
+
* } = hasPlusMemberInCart({
|
|
916
|
+
* memberSetting: plusMemberSettings,
|
|
917
|
+
* cart: currentCart,
|
|
918
|
+
* })
|
|
919
|
+
*
|
|
920
|
+
* if (hasPlusMember) {
|
|
921
|
+
* console.log('购物车中有会员产品')
|
|
922
|
+
* }
|
|
923
|
+
* ```
|
|
924
|
+
*/
|
|
925
|
+
declare function hasPlusMemberInCart({ memberSetting, cart, }: HasPlusMemberInCartProps): HasPlusMemberInCartResult;
|
|
926
|
+
/**
|
|
927
|
+
* 判断购物车中是否包含年费会员或月费会员产品(Hook 版本)
|
|
928
|
+
*
|
|
929
|
+
* 内部使用 hasPlusMemberInCart 纯函数,并通过 useMemo 优化性能
|
|
1027
930
|
*
|
|
1028
931
|
* @param props - Hook 参数
|
|
1029
|
-
* @param props.
|
|
932
|
+
* @param props.memberSetting - Plus Member 配置
|
|
933
|
+
* @param props.cart - 购物车数据
|
|
1030
934
|
* @returns 会员产品信息
|
|
1031
935
|
*
|
|
1032
936
|
* @example
|
|
@@ -1039,6 +943,7 @@ interface HasPlusMemberInCartResult {
|
|
|
1039
943
|
* annualPlusItem,
|
|
1040
944
|
* } = useHasPlusMemberInCart({
|
|
1041
945
|
* memberSetting: plusMemberSettings,
|
|
946
|
+
* cart: currentCart,
|
|
1042
947
|
* })
|
|
1043
948
|
*
|
|
1044
949
|
* if (hasPlusMember) {
|
|
@@ -1046,7 +951,7 @@ interface HasPlusMemberInCartResult {
|
|
|
1046
951
|
* }
|
|
1047
952
|
* ```
|
|
1048
953
|
*/
|
|
1049
|
-
declare function useHasPlusMemberInCart({ memberSetting, cart, }:
|
|
954
|
+
declare function useHasPlusMemberInCart({ memberSetting, cart, }: HasPlusMemberInCartProps): HasPlusMemberInCartResult;
|
|
1050
955
|
|
|
1051
956
|
/**
|
|
1052
957
|
* 返回需要添加到购物车的 Plus Member 产品
|
|
@@ -1082,7 +987,9 @@ declare const useAvailableDeliveryCoupon: ({ profile, }: {
|
|
|
1082
987
|
profile?: any;
|
|
1083
988
|
}) => UseAvailableDeliveryCouponResult;
|
|
1084
989
|
|
|
1085
|
-
interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile
|
|
990
|
+
interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile extends {
|
|
991
|
+
isPlus?: boolean;
|
|
992
|
+
} = any> {
|
|
1086
993
|
variant: TVariant;
|
|
1087
994
|
product: TProduct;
|
|
1088
995
|
memberSetting: PlusMemberSettingsMetafields;
|
|
@@ -1987,4 +1894,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
1987
1894
|
*/
|
|
1988
1895
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
1989
1896
|
|
|
1990
|
-
export { type AddCartLinesInput, AddToCartInput, AddToCartLineItem, type ApplyCartCodesInput, type AutoFreeGift, type AutoFreeGiftCartLineInput, type AutoFreeGiftConfig, type AutoFreeGiftItem, type AutoFreeGiftList, type AutoFreeGiftMainProduct, type BuyNowInput, BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, type Config, type CreateCartInput,
|
|
1897
|
+
export { type AddCartLinesInput, AddToCartInput, AddToCartLineItem, type ApplyCartCodesInput, type AutoFreeGift, type AutoFreeGiftCartLineInput, type AutoFreeGiftConfig, type AutoFreeGiftItem, type AutoFreeGiftList, type AutoFreeGiftMainProduct, type BuyNowInput, BuyRuleType, CODE_AMOUNT_KEY, CUSTOMER_ATTRIBUTE_KEY, CUSTOMER_SCRIPT_GIFT_KEY, type Config, type CreateCartInput, DeliveryPlusType, type DiscountLabel, type FormattedGift, type FunctionGiftResult, type GeoLocationData, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type ImageMedia, type LocaleMapping, MAIN_PRODUCT_CODE, MEMBER_PRICE_ATTRIBUTE_KEY, type MainProductInfo, type NormalizedSearchResultItem, type Options, OrderBasePriceType, type OrderDiscountConfig, type OrderDiscountResult, OrderDiscountType, PlusMemberContext, type PlusMemberContextValue, PlusMemberProvider, type PlusMemberProviderProps, PlusMemberSettingsMetafields, PlusMemberShippingMethodConfig, PriceBasePriceType, type PriceDiscountConfig, PriceDiscountType, type RemoveCartCodesInput, type RemoveCartLinesInput, type RewardItem, type RuleCondition, RuleType, SCRIPT_CODE_AMOUNT_KEY, type SearchResult, type SearchResultType, type SelectedOptionsResult, SelectedPlusMemberVariant, type ShippingMethodsContext, type SiteInfo, SpendMoneyType, type TieredDiscount, type UpdateCartAttributesInput, UseAddToCartOptions, type UseAllBlogsOptions, type UseAllCollectionsOptions, type UseAllProductsOptions, type UseArticleOptions, type UseArticlesInBlogOptions, type UseArticlesOptions, type UseAutoRemovePlusMemberInCartProps, type UseAvailableDeliveryCouponResult, type UseBlogOptions, type UseBuyNowOptions, type UseCalcGiftsFromLinesOptions, type UseCalcGiftsFromLinesResult, type UseCollectionOptions, type UseCollectionsOptions, type UseExposureOptions, type UseGeoLocationOptions, type UseIntersectionOptions, type UsePlusMemberVariantsOptions, type UsePlusMemberVariantsResult, type UsePriceOptions, type UsePriceResult, type UseProductOptions, type UseProductsByHandlesOptions, type UseScriptAutoFreeGiftResult, type UseSearchOptions, type UseShippingMethodsOptions, type UseShippingMethodsResult, type UseSiteOptions, type UseUpdateCartAttributesOptions, type VariantItem, type VariantMedia, type VideoMedia, checkAttributesUpdateNeeded, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, hasPlusMemberInCart, normalizeAddToCartLines, preCheck, safeParse, useAddCartLines, useAddToCart, useAllBlogs, useAllCollections, useAllProducts, useApplyCartCodes, useArticle, useArticles, useArticlesInBlog, useAutoRemovePlusMemberInCart, useAvailableDeliveryCoupon, useBlog, useBuyNow, useCalcAutoFreeGift, useCalcGiftsFromLines, useCalcOrderDiscount, useCartAttributes, useCartItemQuantityLimit, useCollection, useCollections, useCreateCart, useExposure, useGeoLocation, useHasPlusMemberInCart, useIntersection, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberDeliveryCodes, usePlusMemberNeedAddToCart, usePlusMemberVariants, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useScriptAutoFreeGift, useSearch, useSelectedOptions, useShippingMethods, useSite, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdateVariantQuery, useVariant, useVariantMedia };
|