@anker-in/shopify-react 0.1.1-beta.1 → 0.1.1-beta.2
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 +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.js +89 -40
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +87 -39
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/{index-CCMIeIUh.d.ts → index-BZ6WbAdZ.d.ts} +53 -14
- package/dist/{index-RevQokdZ.d.mts → index-Bea95u2X.d.mts} +53 -14
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +110 -50
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +108 -49
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.js +44 -27
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +44 -27
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +5 -5
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as swr_mutation from 'swr/mutation';
|
|
2
2
|
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
3
|
-
import
|
|
3
|
+
import * as _anker_in_shopify_sdk from '@anker-in/shopify-sdk';
|
|
4
|
+
import { CartLineInput as CartLineInput$1, NormalizedCart, UpdateCartLinesOptions, HasMetafieldsIdentifier, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, Attribute as Attribute$1, Media, NormalizedCollection, CollectionsConnection, NormalizedBlog, NormalizedArticle } from '@anker-in/shopify-sdk';
|
|
4
5
|
import { A as AddToCartLineItem, G as GtmParams, B as BuyNowTrackConfig, d as PlusMemberShippingMethodConfig, e as PlusMemberSettingsMetafields, D as DeliveryPlusType, f as SelectedPlusMemberProduct, i as DeliveryData } from './types-CICUnw0v.js';
|
|
5
6
|
import Decimal from 'decimal.js';
|
|
6
7
|
import * as swr from 'swr';
|
|
@@ -896,11 +897,55 @@ interface HasPlusMemberInCartResult {
|
|
|
896
897
|
*/
|
|
897
898
|
declare function useHasPlusMemberInCart({ memberSetting, cart, }: UseHasPlusMemberInCartProps): HasPlusMemberInCartResult;
|
|
898
899
|
|
|
900
|
+
interface UseAddPlusMemberProductsToCartProps {
|
|
901
|
+
/** 购物车数据 */
|
|
902
|
+
cart?: NormalizedCart;
|
|
903
|
+
/** Plus Member 配置 */
|
|
904
|
+
memberSetting?: PlusMemberSettingsMetafields;
|
|
905
|
+
/** 选中的会员模式 */
|
|
906
|
+
selectedPlusMemberMode: DeliveryPlusType;
|
|
907
|
+
/** 选中的会员产品 */
|
|
908
|
+
selectedPlusMemberProduct?: SelectedPlusMemberProduct;
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* 返回需要添加到购物车的 Plus Member 产品
|
|
912
|
+
*
|
|
913
|
+
* 该 hook 会根据用户选择的会员模式和购物车现有状态,
|
|
914
|
+
* 返回需要添加的会员产品。如果不需要添加会员产品,则返回 undefined。
|
|
915
|
+
*
|
|
916
|
+
* @param props - Hook 参数
|
|
917
|
+
* @param props.cart - 购物车数据
|
|
918
|
+
* @param props.memberSetting - Plus Member 配置
|
|
919
|
+
* @param props.selectedPlusMemberMode - 选中的会员模式
|
|
920
|
+
* @param props.selectedPlusMemberProduct - 选中的会员产品
|
|
921
|
+
* @returns Plus Member 产品对象或 undefined
|
|
922
|
+
*
|
|
923
|
+
* @example
|
|
924
|
+
* ```tsx
|
|
925
|
+
* const plusMemberProduct = useAddPlusMemberProductsToCart({
|
|
926
|
+
* cart,
|
|
927
|
+
* memberSetting,
|
|
928
|
+
* selectedPlusMemberMode: DeliveryPlusType.MONTHLY,
|
|
929
|
+
* selectedPlusMemberProduct: { product, variant },
|
|
930
|
+
* })
|
|
931
|
+
*
|
|
932
|
+
* // plusMemberProduct 格式:
|
|
933
|
+
* // {
|
|
934
|
+
* // product: NormalizedProduct,
|
|
935
|
+
* // variant: NormalizedProductVariant
|
|
936
|
+
* // }
|
|
937
|
+
* // 或 undefined (当不需要添加会员产品时)
|
|
938
|
+
* ```
|
|
939
|
+
*/
|
|
940
|
+
declare function useAddPlusMemberProductsToCart({ cart, memberSetting, selectedPlusMemberMode, selectedPlusMemberProduct, }: UseAddPlusMemberProductsToCartProps): {
|
|
941
|
+
product: _anker_in_shopify_sdk.NormalizedProduct;
|
|
942
|
+
variant: _anker_in_shopify_sdk.NormalizedProductVariant;
|
|
943
|
+
} | undefined;
|
|
944
|
+
|
|
899
945
|
interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile = any> {
|
|
900
946
|
variant: TVariant;
|
|
901
947
|
product: TProduct;
|
|
902
|
-
|
|
903
|
-
shopCommon?: Record<string, any>;
|
|
948
|
+
memberSetting: PlusMemberSettingsMetafields;
|
|
904
949
|
initialSelectedPlusMemberMode?: DeliveryPlusType;
|
|
905
950
|
profile?: TProfile;
|
|
906
951
|
locale?: string;
|
|
@@ -913,7 +958,6 @@ interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile = any
|
|
|
913
958
|
* @param variant - Product variant
|
|
914
959
|
* @param product - Product
|
|
915
960
|
* @param metafields - Plus member settings from metafields
|
|
916
|
-
* @param shopCommon - Shop common settings
|
|
917
961
|
* @param initialSelectedPlusMemberMode - Initial selected mode (default: 'free')
|
|
918
962
|
* @param profile - User profile
|
|
919
963
|
* @param locale - Locale code
|
|
@@ -924,8 +968,7 @@ interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile = any
|
|
|
924
968
|
* <PlusMemberProvider
|
|
925
969
|
* variant={variant}
|
|
926
970
|
* product={product}
|
|
927
|
-
*
|
|
928
|
-
* shopCommon={shopCommon}
|
|
971
|
+
* memberSetting={memberSetting}
|
|
929
972
|
* profile={profile}
|
|
930
973
|
* locale={locale}
|
|
931
974
|
* >
|
|
@@ -933,7 +976,7 @@ interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile = any
|
|
|
933
976
|
* </PlusMemberProvider>
|
|
934
977
|
* ```
|
|
935
978
|
*/
|
|
936
|
-
declare const PlusMemberProvider: <TProduct = any, TVariant = any, TProfile = any>({ variant, product,
|
|
979
|
+
declare const PlusMemberProvider: <TProduct = any, TVariant = any, TProfile = any>({ variant, product, memberSetting, initialSelectedPlusMemberMode, profile, locale, children, }: PropsWithChildren<PlusMemberProviderProps<TProduct, TVariant, TProfile>>) => react_jsx_runtime.JSX.Element;
|
|
937
980
|
|
|
938
981
|
declare const getReferralAttributes: () => {
|
|
939
982
|
key: string;
|
|
@@ -1049,18 +1092,14 @@ declare function atobID(id: string): string | undefined;
|
|
|
1049
1092
|
declare function btoaID(id: string, type?: 'ProductVariant' | 'Product'): string;
|
|
1050
1093
|
|
|
1051
1094
|
declare const getMatchedMainProductSubTotal: (cartData: any, variant_list: AutoFreeGiftMainProduct["variant_id_list"], main_product: AutoFreeGiftMainProduct) => any;
|
|
1095
|
+
declare const safeParse: (str: string) => any;
|
|
1052
1096
|
declare const getDiscountEnvAttributeValue: (attributes?: {
|
|
1053
1097
|
key: string;
|
|
1054
1098
|
value: string;
|
|
1055
1099
|
}[]) => any;
|
|
1056
|
-
declare const
|
|
1100
|
+
declare const checkAttributesUpdateNeeded: (oldAttributes: Attribute$1[], newAttributes: Attribute$1[], customAttributesNeedRemove: {
|
|
1057
1101
|
key: string;
|
|
1058
|
-
value: string;
|
|
1059
|
-
}[], attrs2?: {
|
|
1060
|
-
key: string;
|
|
1061
|
-
value: string;
|
|
1062
1102
|
}[]) => boolean;
|
|
1063
|
-
declare const safeParseJson: (str: string) => any;
|
|
1064
1103
|
declare function preCheck(rule_conditions: RuleCondition[], userTags: string[], currentDealsTypes: string[]): boolean;
|
|
1065
1104
|
declare const formatScriptAutoFreeGift: ({ scriptAutoFreeGiftResult, gradient_gifts, locale, }: {
|
|
1066
1105
|
scriptAutoFreeGiftResult: UseScriptAutoFreeGiftResult;
|
|
@@ -1847,4 +1886,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
1847
1886
|
*/
|
|
1848
1887
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
1849
1888
|
|
|
1850
|
-
export { defaultSWRMutationConfiguration as $, type AddCartLinesInput as A, type BuyNowInput as B, type CreateCartInput as C, type DiscountLabel as D, type GiftProductItem as E, RuleType as F, type GiftProduct as G, BuyRuleType as H, type FunctionGiftResult as I, type FormattedGift as J, type CartLineInput as K, type AutoFreeGiftItem as L, type MainProductInfo as M, type AutoFreeGiftList as N, type OrderDiscountResult as O, OrderDiscountType as P, OrderBasePriceType as Q, type RemoveCartLinesInput as R, SpendMoneyType as S, type TieredDiscount as T, type UpdateCartAttributesInput as U, type VariantItem as V, type OrderDiscountConfig as W, PriceDiscountType as X, PriceBasePriceType as Y, type PriceDiscountConfig as Z, currencyCodeMapping as _, useAddCartLines as a, usePlusAnnualProductVariant as a$, CUSTOMER_ATTRIBUTE_KEY as a0, CUSTOMER_SCRIPT_GIFT_KEY as a1, CODE_AMOUNT_KEY as a2, SCRIPT_CODE_AMOUNT_KEY as a3, MAIN_PRODUCT_CODE as a4, getQuery as a5, atobID as a6, btoaID as a7, getMatchedMainProductSubTotal as a8,
|
|
1889
|
+
export { defaultSWRMutationConfiguration as $, type AddCartLinesInput as A, type BuyNowInput as B, type CreateCartInput as C, type DiscountLabel as D, type GiftProductItem as E, RuleType as F, type GiftProduct as G, BuyRuleType as H, type FunctionGiftResult as I, type FormattedGift as J, type CartLineInput as K, type AutoFreeGiftItem as L, type MainProductInfo as M, type AutoFreeGiftList as N, type OrderDiscountResult as O, OrderDiscountType as P, OrderBasePriceType as Q, type RemoveCartLinesInput as R, SpendMoneyType as S, type TieredDiscount as T, type UpdateCartAttributesInput as U, type VariantItem as V, type OrderDiscountConfig as W, PriceDiscountType as X, PriceBasePriceType as Y, type PriceDiscountConfig as Z, currencyCodeMapping as _, useAddCartLines as a, usePlusAnnualProductVariant as a$, CUSTOMER_ATTRIBUTE_KEY as a0, CUSTOMER_SCRIPT_GIFT_KEY as a1, CODE_AMOUNT_KEY as a2, SCRIPT_CODE_AMOUNT_KEY as a3, MAIN_PRODUCT_CODE as a4, getQuery as a5, atobID as a6, btoaID as a7, getMatchedMainProductSubTotal as a8, safeParse as a9, type UseAllCollectionsOptions as aA, useAllCollections as aB, type UseCollectionsOptions as aC, useCollections as aD, type UseBlogOptions as aE, useBlog as aF, type UseAllBlogsOptions as aG, useAllBlogs as aH, type UseArticleOptions as aI, useArticle as aJ, type UseArticlesOptions as aK, useArticles as aL, type UseArticlesInBlogOptions as aM, useArticlesInBlog as aN, type SearchResultType as aO, type SearchResultItem as aP, type SearchResult as aQ, type UseSearchOptions as aR, useSearch as aS, type SiteInfo as aT, type UseSiteOptions as aU, useSite as aV, type ShippingMethodsContext as aW, type PlusMemberContextValue as aX, PlusMemberContext as aY, usePlusMemberContext as aZ, usePlusMonthlyProductVariant as a_, getDiscountEnvAttributeValue as aa, checkAttributesUpdateNeeded as ab, preCheck as ac, formatScriptAutoFreeGift as ad, formatFunctionAutoFreeGift as ae, useSelectedOptions as af, type SelectedOptionsResult as ag, type UseProductOptions as ah, useProduct as ai, type UseAllProductsOptions as aj, useAllProducts as ak, type UseProductsByHandlesOptions as al, useProductsByHandles as am, type Options as an, useVariant as ao, type UsePriceOptions as ap, type UsePriceResult as aq, usePrice as ar, useProductUrl as as, useUpdateVariantQuery as at, type ImageMedia as au, type VideoMedia as av, type VariantMedia as aw, useVariantMedia as ax, type UseCollectionOptions as ay, useCollection as az, useUpdateCartLines as b, type UseShippingMethodsOptions as b0, type UseShippingMethodsResult as b1, useShippingMethods as b2, useShippingMethodAvailableCheck as b3, useReplaceCartPlusMember as b4, usePlusMemberDeliveryCodes as b5, usePlusMemberItemCustomAttributes as b6, type CustomerOrder as b7, type Customer as b8, usePlusMemberCheckoutCustomAttributes as b9, type ExportLineItem as bA, type ExportDiscounts as bB, type ExportCart as bC, type UseAutoRemovePlusMemberInCartProps as ba, useAutoRemovePlusMemberInCart as bb, type UseHasPlusMemberInCartProps as bc, type HasPlusMemberInCartResult as bd, useHasPlusMemberInCart as be, type UseAddPlusMemberProductsToCartProps as bf, useAddPlusMemberProductsToCart as bg, type PlusMemberProviderProps as bh, PlusMemberProvider as bi, type UseIntersectionOptions as bj, useIntersection as bk, type UseExposureOptions as bl, useExposure as bm, type GeoLocationData as bn, type LocaleMapping as bo, type UseGeoLocationOptions as bp, useGeoLocation as bq, getCachedGeoLocation as br, clearGeoLocationCache as bs, type Attribute as bt, type Discount as bu, type Image as bv, type Measurement as bw, type ExportSelectedOption as bx, type ExportProductVariant as by, type ExportDiscountAllocations as bz, useRemoveCartLines as c, type ApplyCartCodesInput as d, useApplyCartCodes as e, type RemoveCartCodesInput as f, useRemoveCartCodes as g, useUpdateCartAttributes as h, type UseBuyNowOptions as i, useBuyNow as j, useCalcAutoFreeGift as k, useCalcOrderDiscount as l, getReferralAttributes as m, useCartAttributes as n, useCartItemQuantityLimit as o, type UseScriptAutoFreeGiftResult as p, useScriptAutoFreeGift as q, useUpdateLineCodeAmountAttributes as r, type AutoFreeGift as s, type AutoFreeGiftMainProduct as t, useCreateCart as u, type AutoFreeGiftConfig as v, type RuleCondition as w, type Config as x, type GiftTier as y, type RewardItem as z };
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import * as swr_mutation from 'swr/mutation';
|
|
2
2
|
import { SWRMutationConfiguration } from 'swr/mutation';
|
|
3
|
-
import
|
|
3
|
+
import * as _anker_in_shopify_sdk from '@anker-in/shopify-sdk';
|
|
4
|
+
import { CartLineInput as CartLineInput$1, NormalizedCart, UpdateCartLinesOptions, HasMetafieldsIdentifier, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, Attribute as Attribute$1, Media, NormalizedCollection, CollectionsConnection, NormalizedBlog, NormalizedArticle } from '@anker-in/shopify-sdk';
|
|
4
5
|
import { A as AddToCartLineItem, G as GtmParams, B as BuyNowTrackConfig, d as PlusMemberShippingMethodConfig, e as PlusMemberSettingsMetafields, D as DeliveryPlusType, f as SelectedPlusMemberProduct, i as DeliveryData } from './types-CICUnw0v.mjs';
|
|
5
6
|
import Decimal from 'decimal.js';
|
|
6
7
|
import * as swr from 'swr';
|
|
@@ -896,11 +897,55 @@ interface HasPlusMemberInCartResult {
|
|
|
896
897
|
*/
|
|
897
898
|
declare function useHasPlusMemberInCart({ memberSetting, cart, }: UseHasPlusMemberInCartProps): HasPlusMemberInCartResult;
|
|
898
899
|
|
|
900
|
+
interface UseAddPlusMemberProductsToCartProps {
|
|
901
|
+
/** 购物车数据 */
|
|
902
|
+
cart?: NormalizedCart;
|
|
903
|
+
/** Plus Member 配置 */
|
|
904
|
+
memberSetting?: PlusMemberSettingsMetafields;
|
|
905
|
+
/** 选中的会员模式 */
|
|
906
|
+
selectedPlusMemberMode: DeliveryPlusType;
|
|
907
|
+
/** 选中的会员产品 */
|
|
908
|
+
selectedPlusMemberProduct?: SelectedPlusMemberProduct;
|
|
909
|
+
}
|
|
910
|
+
/**
|
|
911
|
+
* 返回需要添加到购物车的 Plus Member 产品
|
|
912
|
+
*
|
|
913
|
+
* 该 hook 会根据用户选择的会员模式和购物车现有状态,
|
|
914
|
+
* 返回需要添加的会员产品。如果不需要添加会员产品,则返回 undefined。
|
|
915
|
+
*
|
|
916
|
+
* @param props - Hook 参数
|
|
917
|
+
* @param props.cart - 购物车数据
|
|
918
|
+
* @param props.memberSetting - Plus Member 配置
|
|
919
|
+
* @param props.selectedPlusMemberMode - 选中的会员模式
|
|
920
|
+
* @param props.selectedPlusMemberProduct - 选中的会员产品
|
|
921
|
+
* @returns Plus Member 产品对象或 undefined
|
|
922
|
+
*
|
|
923
|
+
* @example
|
|
924
|
+
* ```tsx
|
|
925
|
+
* const plusMemberProduct = useAddPlusMemberProductsToCart({
|
|
926
|
+
* cart,
|
|
927
|
+
* memberSetting,
|
|
928
|
+
* selectedPlusMemberMode: DeliveryPlusType.MONTHLY,
|
|
929
|
+
* selectedPlusMemberProduct: { product, variant },
|
|
930
|
+
* })
|
|
931
|
+
*
|
|
932
|
+
* // plusMemberProduct 格式:
|
|
933
|
+
* // {
|
|
934
|
+
* // product: NormalizedProduct,
|
|
935
|
+
* // variant: NormalizedProductVariant
|
|
936
|
+
* // }
|
|
937
|
+
* // 或 undefined (当不需要添加会员产品时)
|
|
938
|
+
* ```
|
|
939
|
+
*/
|
|
940
|
+
declare function useAddPlusMemberProductsToCart({ cart, memberSetting, selectedPlusMemberMode, selectedPlusMemberProduct, }: UseAddPlusMemberProductsToCartProps): {
|
|
941
|
+
product: _anker_in_shopify_sdk.NormalizedProduct;
|
|
942
|
+
variant: _anker_in_shopify_sdk.NormalizedProductVariant;
|
|
943
|
+
} | undefined;
|
|
944
|
+
|
|
899
945
|
interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile = any> {
|
|
900
946
|
variant: TVariant;
|
|
901
947
|
product: TProduct;
|
|
902
|
-
|
|
903
|
-
shopCommon?: Record<string, any>;
|
|
948
|
+
memberSetting: PlusMemberSettingsMetafields;
|
|
904
949
|
initialSelectedPlusMemberMode?: DeliveryPlusType;
|
|
905
950
|
profile?: TProfile;
|
|
906
951
|
locale?: string;
|
|
@@ -913,7 +958,6 @@ interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile = any
|
|
|
913
958
|
* @param variant - Product variant
|
|
914
959
|
* @param product - Product
|
|
915
960
|
* @param metafields - Plus member settings from metafields
|
|
916
|
-
* @param shopCommon - Shop common settings
|
|
917
961
|
* @param initialSelectedPlusMemberMode - Initial selected mode (default: 'free')
|
|
918
962
|
* @param profile - User profile
|
|
919
963
|
* @param locale - Locale code
|
|
@@ -924,8 +968,7 @@ interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile = any
|
|
|
924
968
|
* <PlusMemberProvider
|
|
925
969
|
* variant={variant}
|
|
926
970
|
* product={product}
|
|
927
|
-
*
|
|
928
|
-
* shopCommon={shopCommon}
|
|
971
|
+
* memberSetting={memberSetting}
|
|
929
972
|
* profile={profile}
|
|
930
973
|
* locale={locale}
|
|
931
974
|
* >
|
|
@@ -933,7 +976,7 @@ interface PlusMemberProviderProps<TProduct = any, TVariant = any, TProfile = any
|
|
|
933
976
|
* </PlusMemberProvider>
|
|
934
977
|
* ```
|
|
935
978
|
*/
|
|
936
|
-
declare const PlusMemberProvider: <TProduct = any, TVariant = any, TProfile = any>({ variant, product,
|
|
979
|
+
declare const PlusMemberProvider: <TProduct = any, TVariant = any, TProfile = any>({ variant, product, memberSetting, initialSelectedPlusMemberMode, profile, locale, children, }: PropsWithChildren<PlusMemberProviderProps<TProduct, TVariant, TProfile>>) => react_jsx_runtime.JSX.Element;
|
|
937
980
|
|
|
938
981
|
declare const getReferralAttributes: () => {
|
|
939
982
|
key: string;
|
|
@@ -1049,18 +1092,14 @@ declare function atobID(id: string): string | undefined;
|
|
|
1049
1092
|
declare function btoaID(id: string, type?: 'ProductVariant' | 'Product'): string;
|
|
1050
1093
|
|
|
1051
1094
|
declare const getMatchedMainProductSubTotal: (cartData: any, variant_list: AutoFreeGiftMainProduct["variant_id_list"], main_product: AutoFreeGiftMainProduct) => any;
|
|
1095
|
+
declare const safeParse: (str: string) => any;
|
|
1052
1096
|
declare const getDiscountEnvAttributeValue: (attributes?: {
|
|
1053
1097
|
key: string;
|
|
1054
1098
|
value: string;
|
|
1055
1099
|
}[]) => any;
|
|
1056
|
-
declare const
|
|
1100
|
+
declare const checkAttributesUpdateNeeded: (oldAttributes: Attribute$1[], newAttributes: Attribute$1[], customAttributesNeedRemove: {
|
|
1057
1101
|
key: string;
|
|
1058
|
-
value: string;
|
|
1059
|
-
}[], attrs2?: {
|
|
1060
|
-
key: string;
|
|
1061
|
-
value: string;
|
|
1062
1102
|
}[]) => boolean;
|
|
1063
|
-
declare const safeParseJson: (str: string) => any;
|
|
1064
1103
|
declare function preCheck(rule_conditions: RuleCondition[], userTags: string[], currentDealsTypes: string[]): boolean;
|
|
1065
1104
|
declare const formatScriptAutoFreeGift: ({ scriptAutoFreeGiftResult, gradient_gifts, locale, }: {
|
|
1066
1105
|
scriptAutoFreeGiftResult: UseScriptAutoFreeGiftResult;
|
|
@@ -1847,4 +1886,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
1847
1886
|
*/
|
|
1848
1887
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
1849
1888
|
|
|
1850
|
-
export { defaultSWRMutationConfiguration as $, type AddCartLinesInput as A, type BuyNowInput as B, type CreateCartInput as C, type DiscountLabel as D, type GiftProductItem as E, RuleType as F, type GiftProduct as G, BuyRuleType as H, type FunctionGiftResult as I, type FormattedGift as J, type CartLineInput as K, type AutoFreeGiftItem as L, type MainProductInfo as M, type AutoFreeGiftList as N, type OrderDiscountResult as O, OrderDiscountType as P, OrderBasePriceType as Q, type RemoveCartLinesInput as R, SpendMoneyType as S, type TieredDiscount as T, type UpdateCartAttributesInput as U, type VariantItem as V, type OrderDiscountConfig as W, PriceDiscountType as X, PriceBasePriceType as Y, type PriceDiscountConfig as Z, currencyCodeMapping as _, useAddCartLines as a, usePlusAnnualProductVariant as a$, CUSTOMER_ATTRIBUTE_KEY as a0, CUSTOMER_SCRIPT_GIFT_KEY as a1, CODE_AMOUNT_KEY as a2, SCRIPT_CODE_AMOUNT_KEY as a3, MAIN_PRODUCT_CODE as a4, getQuery as a5, atobID as a6, btoaID as a7, getMatchedMainProductSubTotal as a8,
|
|
1889
|
+
export { defaultSWRMutationConfiguration as $, type AddCartLinesInput as A, type BuyNowInput as B, type CreateCartInput as C, type DiscountLabel as D, type GiftProductItem as E, RuleType as F, type GiftProduct as G, BuyRuleType as H, type FunctionGiftResult as I, type FormattedGift as J, type CartLineInput as K, type AutoFreeGiftItem as L, type MainProductInfo as M, type AutoFreeGiftList as N, type OrderDiscountResult as O, OrderDiscountType as P, OrderBasePriceType as Q, type RemoveCartLinesInput as R, SpendMoneyType as S, type TieredDiscount as T, type UpdateCartAttributesInput as U, type VariantItem as V, type OrderDiscountConfig as W, PriceDiscountType as X, PriceBasePriceType as Y, type PriceDiscountConfig as Z, currencyCodeMapping as _, useAddCartLines as a, usePlusAnnualProductVariant as a$, CUSTOMER_ATTRIBUTE_KEY as a0, CUSTOMER_SCRIPT_GIFT_KEY as a1, CODE_AMOUNT_KEY as a2, SCRIPT_CODE_AMOUNT_KEY as a3, MAIN_PRODUCT_CODE as a4, getQuery as a5, atobID as a6, btoaID as a7, getMatchedMainProductSubTotal as a8, safeParse as a9, type UseAllCollectionsOptions as aA, useAllCollections as aB, type UseCollectionsOptions as aC, useCollections as aD, type UseBlogOptions as aE, useBlog as aF, type UseAllBlogsOptions as aG, useAllBlogs as aH, type UseArticleOptions as aI, useArticle as aJ, type UseArticlesOptions as aK, useArticles as aL, type UseArticlesInBlogOptions as aM, useArticlesInBlog as aN, type SearchResultType as aO, type SearchResultItem as aP, type SearchResult as aQ, type UseSearchOptions as aR, useSearch as aS, type SiteInfo as aT, type UseSiteOptions as aU, useSite as aV, type ShippingMethodsContext as aW, type PlusMemberContextValue as aX, PlusMemberContext as aY, usePlusMemberContext as aZ, usePlusMonthlyProductVariant as a_, getDiscountEnvAttributeValue as aa, checkAttributesUpdateNeeded as ab, preCheck as ac, formatScriptAutoFreeGift as ad, formatFunctionAutoFreeGift as ae, useSelectedOptions as af, type SelectedOptionsResult as ag, type UseProductOptions as ah, useProduct as ai, type UseAllProductsOptions as aj, useAllProducts as ak, type UseProductsByHandlesOptions as al, useProductsByHandles as am, type Options as an, useVariant as ao, type UsePriceOptions as ap, type UsePriceResult as aq, usePrice as ar, useProductUrl as as, useUpdateVariantQuery as at, type ImageMedia as au, type VideoMedia as av, type VariantMedia as aw, useVariantMedia as ax, type UseCollectionOptions as ay, useCollection as az, useUpdateCartLines as b, type UseShippingMethodsOptions as b0, type UseShippingMethodsResult as b1, useShippingMethods as b2, useShippingMethodAvailableCheck as b3, useReplaceCartPlusMember as b4, usePlusMemberDeliveryCodes as b5, usePlusMemberItemCustomAttributes as b6, type CustomerOrder as b7, type Customer as b8, usePlusMemberCheckoutCustomAttributes as b9, type ExportLineItem as bA, type ExportDiscounts as bB, type ExportCart as bC, type UseAutoRemovePlusMemberInCartProps as ba, useAutoRemovePlusMemberInCart as bb, type UseHasPlusMemberInCartProps as bc, type HasPlusMemberInCartResult as bd, useHasPlusMemberInCart as be, type UseAddPlusMemberProductsToCartProps as bf, useAddPlusMemberProductsToCart as bg, type PlusMemberProviderProps as bh, PlusMemberProvider as bi, type UseIntersectionOptions as bj, useIntersection as bk, type UseExposureOptions as bl, useExposure as bm, type GeoLocationData as bn, type LocaleMapping as bo, type UseGeoLocationOptions as bp, useGeoLocation as bq, getCachedGeoLocation as br, clearGeoLocationCache as bs, type Attribute as bt, type Discount as bu, type Image as bv, type Measurement as bw, type ExportSelectedOption as bx, type ExportProductVariant as by, type ExportDiscountAllocations as bz, useRemoveCartLines as c, type ApplyCartCodesInput as d, useApplyCartCodes as e, type RemoveCartCodesInput as f, useRemoveCartCodes as g, useUpdateCartAttributes as h, type UseBuyNowOptions as i, useBuyNow as j, useCalcAutoFreeGift as k, useCalcOrderDiscount as l, getReferralAttributes as m, useCartAttributes as n, useCartItemQuantityLimit as o, type UseScriptAutoFreeGiftResult as p, useScriptAutoFreeGift as q, useUpdateLineCodeAmountAttributes as r, type AutoFreeGift as s, type AutoFreeGiftMainProduct as t, useCreateCart as u, type AutoFreeGiftConfig as v, type RuleCondition as w, type Config as x, type GiftTier as y, type RewardItem as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AttributeInput, CartContextValue, CartProvider, CartProviderProps, LoadingState, ShopifyContext, ShopifyContextValue, ShopifyProvider, ShopifyProviderProps, useCartContext, useShopify } from './provider/index.mjs';
|
|
2
2
|
export { b as CartCookieAdapter, C as CookieAdapter, a as CookieOptions, R as RouterAdapter, U as UserContextAdapter } from './types-BLMoxbOk.mjs';
|
|
3
3
|
export { browserCartCookieAdapter, browserCookieAdapter } from './adapters/index.mjs';
|
|
4
|
-
export { A as AddCartLinesInput, d as ApplyCartCodesInput,
|
|
4
|
+
export { A as AddCartLinesInput, d as ApplyCartCodesInput, bt as Attribute, s as AutoFreeGift, v as AutoFreeGiftConfig, L as AutoFreeGiftItem, N as AutoFreeGiftList, t as AutoFreeGiftMainProduct, B as BuyNowInput, H as BuyRuleType, a2 as CODE_AMOUNT_KEY, a0 as CUSTOMER_ATTRIBUTE_KEY, a1 as CUSTOMER_SCRIPT_GIFT_KEY, K as CartLineInput, x as Config, C as CreateCartInput, b8 as Customer, b7 as CustomerOrder, bu as Discount, D as DiscountLabel, bC as ExportCart, bz as ExportDiscountAllocations, bB as ExportDiscounts, bA as ExportLineItem, by as ExportProductVariant, bx as ExportSelectedOption, J as FormattedGift, I as FunctionGiftResult, bn as GeoLocationData, G as GiftProduct, E as GiftProductItem, y as GiftTier, bd as HasPlusMemberInCartResult, bv as Image, au as ImageMedia, bo as LocaleMapping, a4 as MAIN_PRODUCT_CODE, M as MainProductInfo, bw as Measurement, an as Options, Q as OrderBasePriceType, W as OrderDiscountConfig, O as OrderDiscountResult, P as OrderDiscountType, aY as PlusMemberContext, aX as PlusMemberContextValue, bi as PlusMemberProvider, bh as PlusMemberProviderProps, Y as PriceBasePriceType, Z as PriceDiscountConfig, X as PriceDiscountType, f as RemoveCartCodesInput, R as RemoveCartLinesInput, z as RewardItem, w as RuleCondition, F as RuleType, a3 as SCRIPT_CODE_AMOUNT_KEY, aQ as SearchResult, aP as SearchResultItem, aO as SearchResultType, ag as SelectedOptionsResult, aW as ShippingMethodsContext, aT as SiteInfo, S as SpendMoneyType, T as TieredDiscount, U as UpdateCartAttributesInput, bf as UseAddPlusMemberProductsToCartProps, aG as UseAllBlogsOptions, aA as UseAllCollectionsOptions, aj as UseAllProductsOptions, aI as UseArticleOptions, aM as UseArticlesInBlogOptions, aK as UseArticlesOptions, ba as UseAutoRemovePlusMemberInCartProps, aE as UseBlogOptions, i as UseBuyNowOptions, ay as UseCollectionOptions, aC as UseCollectionsOptions, bl as UseExposureOptions, bp as UseGeoLocationOptions, bc as UseHasPlusMemberInCartProps, bj as UseIntersectionOptions, ap as UsePriceOptions, aq as UsePriceResult, ah as UseProductOptions, al as UseProductsByHandlesOptions, p as UseScriptAutoFreeGiftResult, aR as UseSearchOptions, b0 as UseShippingMethodsOptions, b1 as UseShippingMethodsResult, aU as UseSiteOptions, V as VariantItem, aw as VariantMedia, av as VideoMedia, a6 as atobID, a7 as btoaID, ab as checkAttributesUpdateNeeded, bs as clearGeoLocationCache, _ as currencyCodeMapping, $ as defaultSWRMutationConfiguration, ae as formatFunctionAutoFreeGift, ad as formatScriptAutoFreeGift, br as getCachedGeoLocation, aa as getDiscountEnvAttributeValue, a8 as getMatchedMainProductSubTotal, a5 as getQuery, m as getReferralAttributes, ac as preCheck, a9 as safeParse, a as useAddCartLines, bg as useAddPlusMemberProductsToCart, aH as useAllBlogs, aB as useAllCollections, ak as useAllProducts, e as useApplyCartCodes, aJ as useArticle, aL as useArticles, aN as useArticlesInBlog, bb as useAutoRemovePlusMemberInCart, aF as useBlog, j as useBuyNow, k as useCalcAutoFreeGift, l as useCalcOrderDiscount, n as useCartAttributes, o as useCartItemQuantityLimit, az as useCollection, aD as useCollections, u as useCreateCart, bm as useExposure, bq as useGeoLocation, be as useHasPlusMemberInCart, bk as useIntersection, a$ as usePlusAnnualProductVariant, b9 as usePlusMemberCheckoutCustomAttributes, aZ as usePlusMemberContext, b5 as usePlusMemberDeliveryCodes, b6 as usePlusMemberItemCustomAttributes, a_ as usePlusMonthlyProductVariant, ar as usePrice, ai as useProduct, as as useProductUrl, am as useProductsByHandles, g as useRemoveCartCodes, c as useRemoveCartLines, b4 as useReplaceCartPlusMember, q as useScriptAutoFreeGift, aS as useSearch, af as useSelectedOptions, b3 as useShippingMethodAvailableCheck, b2 as useShippingMethods, aV as useSite, h as useUpdateCartAttributes, b as useUpdateCartLines, r as useUpdateLineCodeAmountAttributes, at as useUpdateVariantQuery, ao as useVariant, ax as useVariantMedia } from './index-Bea95u2X.mjs';
|
|
5
5
|
export { a as AddToCartInput, A as AddToCartLineItem, B as BuyNowTrackConfig, h as DeliveryCustomData, i as DeliveryData, g as DeliveryOption, D as DeliveryPlusType, G as GtmParams, M as MailingAddress, P as PLUS_MEMBER_TYPE, b as PlusMemberMode, e as PlusMemberSettingsMetafields, d as PlusMemberShippingMethodConfig, c as PlusMemberShippingMethodMetafields, f as SelectedPlusMemberProduct, S as ShippingMethodMode, U as UseAddToCartOptions, j as gaTrack, m as trackAddToCartFBQ, t as trackAddToCartGA, k as trackBeginCheckoutGA, n as trackBuyNowFBQ, l as trackBuyNowGA, u as useAddToCart } from './types-CICUnw0v.mjs';
|
|
6
6
|
export { ShopifyConfig, clearLocalStorage, createShopifyClient, getLocalStorage, removeLocalStorage, setLocalStorage } from '@anker-in/shopify-sdk';
|
|
7
7
|
import 'react';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { AttributeInput, CartContextValue, CartProvider, CartProviderProps, LoadingState, ShopifyContext, ShopifyContextValue, ShopifyProvider, ShopifyProviderProps, useCartContext, useShopify } from './provider/index.js';
|
|
2
2
|
export { b as CartCookieAdapter, C as CookieAdapter, a as CookieOptions, R as RouterAdapter, U as UserContextAdapter } from './types-BLMoxbOk.js';
|
|
3
3
|
export { browserCartCookieAdapter, browserCookieAdapter } from './adapters/index.js';
|
|
4
|
-
export { A as AddCartLinesInput, d as ApplyCartCodesInput,
|
|
4
|
+
export { A as AddCartLinesInput, d as ApplyCartCodesInput, bt as Attribute, s as AutoFreeGift, v as AutoFreeGiftConfig, L as AutoFreeGiftItem, N as AutoFreeGiftList, t as AutoFreeGiftMainProduct, B as BuyNowInput, H as BuyRuleType, a2 as CODE_AMOUNT_KEY, a0 as CUSTOMER_ATTRIBUTE_KEY, a1 as CUSTOMER_SCRIPT_GIFT_KEY, K as CartLineInput, x as Config, C as CreateCartInput, b8 as Customer, b7 as CustomerOrder, bu as Discount, D as DiscountLabel, bC as ExportCart, bz as ExportDiscountAllocations, bB as ExportDiscounts, bA as ExportLineItem, by as ExportProductVariant, bx as ExportSelectedOption, J as FormattedGift, I as FunctionGiftResult, bn as GeoLocationData, G as GiftProduct, E as GiftProductItem, y as GiftTier, bd as HasPlusMemberInCartResult, bv as Image, au as ImageMedia, bo as LocaleMapping, a4 as MAIN_PRODUCT_CODE, M as MainProductInfo, bw as Measurement, an as Options, Q as OrderBasePriceType, W as OrderDiscountConfig, O as OrderDiscountResult, P as OrderDiscountType, aY as PlusMemberContext, aX as PlusMemberContextValue, bi as PlusMemberProvider, bh as PlusMemberProviderProps, Y as PriceBasePriceType, Z as PriceDiscountConfig, X as PriceDiscountType, f as RemoveCartCodesInput, R as RemoveCartLinesInput, z as RewardItem, w as RuleCondition, F as RuleType, a3 as SCRIPT_CODE_AMOUNT_KEY, aQ as SearchResult, aP as SearchResultItem, aO as SearchResultType, ag as SelectedOptionsResult, aW as ShippingMethodsContext, aT as SiteInfo, S as SpendMoneyType, T as TieredDiscount, U as UpdateCartAttributesInput, bf as UseAddPlusMemberProductsToCartProps, aG as UseAllBlogsOptions, aA as UseAllCollectionsOptions, aj as UseAllProductsOptions, aI as UseArticleOptions, aM as UseArticlesInBlogOptions, aK as UseArticlesOptions, ba as UseAutoRemovePlusMemberInCartProps, aE as UseBlogOptions, i as UseBuyNowOptions, ay as UseCollectionOptions, aC as UseCollectionsOptions, bl as UseExposureOptions, bp as UseGeoLocationOptions, bc as UseHasPlusMemberInCartProps, bj as UseIntersectionOptions, ap as UsePriceOptions, aq as UsePriceResult, ah as UseProductOptions, al as UseProductsByHandlesOptions, p as UseScriptAutoFreeGiftResult, aR as UseSearchOptions, b0 as UseShippingMethodsOptions, b1 as UseShippingMethodsResult, aU as UseSiteOptions, V as VariantItem, aw as VariantMedia, av as VideoMedia, a6 as atobID, a7 as btoaID, ab as checkAttributesUpdateNeeded, bs as clearGeoLocationCache, _ as currencyCodeMapping, $ as defaultSWRMutationConfiguration, ae as formatFunctionAutoFreeGift, ad as formatScriptAutoFreeGift, br as getCachedGeoLocation, aa as getDiscountEnvAttributeValue, a8 as getMatchedMainProductSubTotal, a5 as getQuery, m as getReferralAttributes, ac as preCheck, a9 as safeParse, a as useAddCartLines, bg as useAddPlusMemberProductsToCart, aH as useAllBlogs, aB as useAllCollections, ak as useAllProducts, e as useApplyCartCodes, aJ as useArticle, aL as useArticles, aN as useArticlesInBlog, bb as useAutoRemovePlusMemberInCart, aF as useBlog, j as useBuyNow, k as useCalcAutoFreeGift, l as useCalcOrderDiscount, n as useCartAttributes, o as useCartItemQuantityLimit, az as useCollection, aD as useCollections, u as useCreateCart, bm as useExposure, bq as useGeoLocation, be as useHasPlusMemberInCart, bk as useIntersection, a$ as usePlusAnnualProductVariant, b9 as usePlusMemberCheckoutCustomAttributes, aZ as usePlusMemberContext, b5 as usePlusMemberDeliveryCodes, b6 as usePlusMemberItemCustomAttributes, a_ as usePlusMonthlyProductVariant, ar as usePrice, ai as useProduct, as as useProductUrl, am as useProductsByHandles, g as useRemoveCartCodes, c as useRemoveCartLines, b4 as useReplaceCartPlusMember, q as useScriptAutoFreeGift, aS as useSearch, af as useSelectedOptions, b3 as useShippingMethodAvailableCheck, b2 as useShippingMethods, aV as useSite, h as useUpdateCartAttributes, b as useUpdateCartLines, r as useUpdateLineCodeAmountAttributes, at as useUpdateVariantQuery, ao as useVariant, ax as useVariantMedia } from './index-BZ6WbAdZ.js';
|
|
5
5
|
export { a as AddToCartInput, A as AddToCartLineItem, B as BuyNowTrackConfig, h as DeliveryCustomData, i as DeliveryData, g as DeliveryOption, D as DeliveryPlusType, G as GtmParams, M as MailingAddress, P as PLUS_MEMBER_TYPE, b as PlusMemberMode, e as PlusMemberSettingsMetafields, d as PlusMemberShippingMethodConfig, c as PlusMemberShippingMethodMetafields, f as SelectedPlusMemberProduct, S as ShippingMethodMode, U as UseAddToCartOptions, j as gaTrack, m as trackAddToCartFBQ, t as trackAddToCartGA, k as trackBeginCheckoutGA, n as trackBuyNowFBQ, l as trackBuyNowGA, u as useAddToCart } from './types-CICUnw0v.js';
|
|
6
6
|
export { ShopifyConfig, clearLocalStorage, createShopifyClient, getLocalStorage, removeLocalStorage, setLocalStorage } from '@anker-in/shopify-sdk';
|
|
7
7
|
import 'react';
|