@anker-in/shopify-react 0.1.1-beta.13 → 0.1.1-beta.14
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 +7 -3
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +7 -3
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/{index-CO_fgrFV.d.mts → index-Bp9gEGUb.d.mts} +1 -9
- package/dist/{index-C77lIEQZ.d.ts → index-D9zCMHzm.d.ts} +1 -9
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +7 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +7 -3
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -3
|
@@ -886,12 +886,6 @@ declare const usePlusMemberItemCustomAttributes: ({ deliveryData, }: {
|
|
|
886
886
|
deliveryData?: DeliveryData;
|
|
887
887
|
}) => Attribute[];
|
|
888
888
|
|
|
889
|
-
interface CustomerOrder {
|
|
890
|
-
edges?: Array<any>;
|
|
891
|
-
}
|
|
892
|
-
interface Customer {
|
|
893
|
-
orders?: CustomerOrder;
|
|
894
|
-
}
|
|
895
889
|
/**
|
|
896
890
|
* Hook to generate custom attributes for checkout
|
|
897
891
|
*
|
|
@@ -903,7 +897,6 @@ interface Customer {
|
|
|
903
897
|
* @param deliveryData - Delivery data containing custom attributes
|
|
904
898
|
* @param product - Product information (optional, for hiding shipping benefits check)
|
|
905
899
|
* @param variant - Variant information (optional, for presale and hiding shipping benefits check)
|
|
906
|
-
* @param customer - Customer information (optional, for user type determination)
|
|
907
900
|
* @param isShowShippingBenefits - Function to check if shipping benefits should be shown (optional)
|
|
908
901
|
* @returns Array of custom attributes for checkout
|
|
909
902
|
*
|
|
@@ -928,7 +921,6 @@ declare const usePlusMemberCheckoutCustomAttributes: <TProduct = any, TVariant =
|
|
|
928
921
|
deliveryData?: DeliveryData;
|
|
929
922
|
product?: TProduct;
|
|
930
923
|
variant?: TVariant;
|
|
931
|
-
customer?: Customer;
|
|
932
924
|
isShowShippingBenefits?: (args: {
|
|
933
925
|
variant?: TVariant;
|
|
934
926
|
product?: TProduct;
|
|
@@ -1979,4 +1971,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
1979
1971
|
*/
|
|
1980
1972
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
1981
1973
|
|
|
1982
|
-
export { PriceBasePriceType as $, type AddCartLinesInput as A, type BuyNowInput as B, type CreateCartInput as C, type DiscountLabel as D, type Config as E, type GiftTier as F, type GiftProduct as G, type RewardItem as H, type GiftProductItem as I, RuleType as J, BuyRuleType as K, type FunctionGiftResult as L, type MainProductInfo as M, type FormattedGift as N, type OrderDiscountResult as O, type CartLineInput as P, type AutoFreeGiftItem as Q, type RemoveCartLinesInput as R, SpendMoneyType as S, type AutoFreeGiftList as T, type UpdateCartAttributesInput as U, type VariantItem as V, OrderDiscountType as W, OrderBasePriceType as X, type TieredDiscount as Y, type OrderDiscountConfig as Z, PriceDiscountType as _, useAddCartLines as a, type ShippingMethodsContext as a$, type PriceDiscountConfig as a0, currencyCodeMapping as a1, defaultSWRMutationConfiguration as a2, CUSTOMER_ATTRIBUTE_KEY as a3, CUSTOMER_SCRIPT_GIFT_KEY as a4, CODE_AMOUNT_KEY as a5, SCRIPT_CODE_AMOUNT_KEY as a6, MAIN_PRODUCT_CODE as a7, getQuery as a8, atobID as a9, type VideoMedia as aA, type VariantMedia as aB, useVariantMedia as aC, type UseCollectionOptions as aD, useCollection as aE, type UseAllCollectionsOptions as aF, useAllCollections as aG, type UseCollectionsOptions as aH, useCollections as aI, type UseBlogOptions as aJ, useBlog as aK, type UseAllBlogsOptions as aL, useAllBlogs as aM, type UseArticleOptions as aN, useArticle as aO, type UseArticlesOptions as aP, useArticles as aQ, type UseArticlesInBlogOptions as aR, useArticlesInBlog as aS, type SearchResultType as aT, type SearchResultItem as aU, type SearchResult as aV, type UseSearchOptions as aW, useSearch as aX, type SiteInfo as aY, type UseSiteOptions as aZ, useSite as a_, btoaID as aa, normalizeAddToCartLines as ab, createMockCartFromLines as ac, getMatchedMainProductSubTotal as ad, safeParse as ae, getDiscountEnvAttributeValue as af, checkAttributesUpdateNeeded as ag, preCheck as ah, formatScriptAutoFreeGift as ai, formatFunctionAutoFreeGift as aj, useSelectedOptions as ak, type SelectedOptionsResult as al, type UseProductOptions as am, useProduct as an, type UseAllProductsOptions as ao, useAllProducts as ap, type UseProductsByHandlesOptions as aq, useProductsByHandles as ar, type Options as as, useVariant as at, type UsePriceOptions as au, type UsePriceResult as av, usePrice as aw, useProductUrl as ax, useUpdateVariantQuery as ay, type ImageMedia as az, useUpdateCartLines as b, type PlusMemberContextValue as b0, PlusMemberContext as b1, usePlusMemberContext as b2, usePlusMonthlyProductVariant as b3, usePlusAnnualProductVariant as b4, type UseShippingMethodsOptions as b5, type UseShippingMethodsResult as b6, useShippingMethods as b7, useShippingMethodAvailableCheck as b8, useReplaceCartPlusMember as b9, type
|
|
1974
|
+
export { PriceBasePriceType as $, type AddCartLinesInput as A, type BuyNowInput as B, type CreateCartInput as C, type DiscountLabel as D, type Config as E, type GiftTier as F, type GiftProduct as G, type RewardItem as H, type GiftProductItem as I, RuleType as J, BuyRuleType as K, type FunctionGiftResult as L, type MainProductInfo as M, type FormattedGift as N, type OrderDiscountResult as O, type CartLineInput as P, type AutoFreeGiftItem as Q, type RemoveCartLinesInput as R, SpendMoneyType as S, type AutoFreeGiftList as T, type UpdateCartAttributesInput as U, type VariantItem as V, OrderDiscountType as W, OrderBasePriceType as X, type TieredDiscount as Y, type OrderDiscountConfig as Z, PriceDiscountType as _, useAddCartLines as a, type ShippingMethodsContext as a$, type PriceDiscountConfig as a0, currencyCodeMapping as a1, defaultSWRMutationConfiguration as a2, CUSTOMER_ATTRIBUTE_KEY as a3, CUSTOMER_SCRIPT_GIFT_KEY as a4, CODE_AMOUNT_KEY as a5, SCRIPT_CODE_AMOUNT_KEY as a6, MAIN_PRODUCT_CODE as a7, getQuery as a8, atobID as a9, type VideoMedia as aA, type VariantMedia as aB, useVariantMedia as aC, type UseCollectionOptions as aD, useCollection as aE, type UseAllCollectionsOptions as aF, useAllCollections as aG, type UseCollectionsOptions as aH, useCollections as aI, type UseBlogOptions as aJ, useBlog as aK, type UseAllBlogsOptions as aL, useAllBlogs as aM, type UseArticleOptions as aN, useArticle as aO, type UseArticlesOptions as aP, useArticles as aQ, type UseArticlesInBlogOptions as aR, useArticlesInBlog as aS, type SearchResultType as aT, type SearchResultItem as aU, type SearchResult as aV, type UseSearchOptions as aW, useSearch as aX, type SiteInfo as aY, type UseSiteOptions as aZ, useSite as a_, btoaID as aa, normalizeAddToCartLines as ab, createMockCartFromLines as ac, getMatchedMainProductSubTotal as ad, safeParse as ae, getDiscountEnvAttributeValue as af, checkAttributesUpdateNeeded as ag, preCheck as ah, formatScriptAutoFreeGift as ai, formatFunctionAutoFreeGift as aj, useSelectedOptions as ak, type SelectedOptionsResult as al, type UseProductOptions as am, useProduct as an, type UseAllProductsOptions as ao, useAllProducts as ap, type UseProductsByHandlesOptions as aq, useProductsByHandles as ar, type Options as as, useVariant as at, type UsePriceOptions as au, type UsePriceResult as av, usePrice as aw, useProductUrl as ax, useUpdateVariantQuery as ay, type ImageMedia as az, useUpdateCartLines as b, type PlusMemberContextValue as b0, PlusMemberContext as b1, usePlusMemberContext as b2, usePlusMonthlyProductVariant as b3, usePlusAnnualProductVariant as b4, type UseShippingMethodsOptions as b5, type UseShippingMethodsResult as b6, useShippingMethods as b7, useShippingMethodAvailableCheck as b8, useReplaceCartPlusMember as b9, type Measurement as bA, type ExportSelectedOption as bB, type ExportProductVariant as bC, type ExportDiscountAllocations as bD, type ExportLineItem as bE, type ExportDiscounts as bF, type ExportCart as bG, usePlusMemberDeliveryCodes as ba, type UseUpdatePlusMemberDeliveryOptionsProps as bb, useUpdatePlusMemberDeliveryOptions as bc, usePlusMemberItemCustomAttributes as bd, usePlusMemberCheckoutCustomAttributes as be, type UseAutoRemovePlusMemberInCartProps as bf, useAutoRemovePlusMemberInCart as bg, type UseHasPlusMemberInCartProps as bh, type HasPlusMemberInCartResult as bi, useHasPlusMemberInCart as bj, useAddPlusMemberProductsToCart as bk, type PlusMemberProviderProps as bl, PlusMemberProvider as bm, type UseIntersectionOptions as bn, useIntersection as bo, type UseExposureOptions as bp, useExposure as bq, type GeoLocationData as br, type LocaleMapping as bs, type UseGeoLocationOptions as bt, useGeoLocation as bu, getCachedGeoLocation as bv, clearGeoLocationCache as bw, type Attribute as bx, type Discount as by, type Image 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, type UseCalcGiftsFromLinesOptions as l, type UseCalcGiftsFromLinesResult as m, useCalcGiftsFromLines as n, useCalcOrderDiscount as o, getReferralAttributes as p, useCartAttributes as q, useCartItemQuantityLimit as r, type UseScriptAutoFreeGiftResult as s, useScriptAutoFreeGift as t, useCreateCart as u, useUpdateLineCodeAmountAttributes as v, type AutoFreeGift as w, type AutoFreeGiftMainProduct as x, type AutoFreeGiftConfig as y, type RuleCondition as z };
|
|
@@ -886,12 +886,6 @@ declare const usePlusMemberItemCustomAttributes: ({ deliveryData, }: {
|
|
|
886
886
|
deliveryData?: DeliveryData;
|
|
887
887
|
}) => Attribute[];
|
|
888
888
|
|
|
889
|
-
interface CustomerOrder {
|
|
890
|
-
edges?: Array<any>;
|
|
891
|
-
}
|
|
892
|
-
interface Customer {
|
|
893
|
-
orders?: CustomerOrder;
|
|
894
|
-
}
|
|
895
889
|
/**
|
|
896
890
|
* Hook to generate custom attributes for checkout
|
|
897
891
|
*
|
|
@@ -903,7 +897,6 @@ interface Customer {
|
|
|
903
897
|
* @param deliveryData - Delivery data containing custom attributes
|
|
904
898
|
* @param product - Product information (optional, for hiding shipping benefits check)
|
|
905
899
|
* @param variant - Variant information (optional, for presale and hiding shipping benefits check)
|
|
906
|
-
* @param customer - Customer information (optional, for user type determination)
|
|
907
900
|
* @param isShowShippingBenefits - Function to check if shipping benefits should be shown (optional)
|
|
908
901
|
* @returns Array of custom attributes for checkout
|
|
909
902
|
*
|
|
@@ -928,7 +921,6 @@ declare const usePlusMemberCheckoutCustomAttributes: <TProduct = any, TVariant =
|
|
|
928
921
|
deliveryData?: DeliveryData;
|
|
929
922
|
product?: TProduct;
|
|
930
923
|
variant?: TVariant;
|
|
931
|
-
customer?: Customer;
|
|
932
924
|
isShowShippingBenefits?: (args: {
|
|
933
925
|
variant?: TVariant;
|
|
934
926
|
product?: TProduct;
|
|
@@ -1979,4 +1971,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
1979
1971
|
*/
|
|
1980
1972
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
1981
1973
|
|
|
1982
|
-
export { PriceBasePriceType as $, type AddCartLinesInput as A, type BuyNowInput as B, type CreateCartInput as C, type DiscountLabel as D, type Config as E, type GiftTier as F, type GiftProduct as G, type RewardItem as H, type GiftProductItem as I, RuleType as J, BuyRuleType as K, type FunctionGiftResult as L, type MainProductInfo as M, type FormattedGift as N, type OrderDiscountResult as O, type CartLineInput as P, type AutoFreeGiftItem as Q, type RemoveCartLinesInput as R, SpendMoneyType as S, type AutoFreeGiftList as T, type UpdateCartAttributesInput as U, type VariantItem as V, OrderDiscountType as W, OrderBasePriceType as X, type TieredDiscount as Y, type OrderDiscountConfig as Z, PriceDiscountType as _, useAddCartLines as a, type ShippingMethodsContext as a$, type PriceDiscountConfig as a0, currencyCodeMapping as a1, defaultSWRMutationConfiguration as a2, CUSTOMER_ATTRIBUTE_KEY as a3, CUSTOMER_SCRIPT_GIFT_KEY as a4, CODE_AMOUNT_KEY as a5, SCRIPT_CODE_AMOUNT_KEY as a6, MAIN_PRODUCT_CODE as a7, getQuery as a8, atobID as a9, type VideoMedia as aA, type VariantMedia as aB, useVariantMedia as aC, type UseCollectionOptions as aD, useCollection as aE, type UseAllCollectionsOptions as aF, useAllCollections as aG, type UseCollectionsOptions as aH, useCollections as aI, type UseBlogOptions as aJ, useBlog as aK, type UseAllBlogsOptions as aL, useAllBlogs as aM, type UseArticleOptions as aN, useArticle as aO, type UseArticlesOptions as aP, useArticles as aQ, type UseArticlesInBlogOptions as aR, useArticlesInBlog as aS, type SearchResultType as aT, type SearchResultItem as aU, type SearchResult as aV, type UseSearchOptions as aW, useSearch as aX, type SiteInfo as aY, type UseSiteOptions as aZ, useSite as a_, btoaID as aa, normalizeAddToCartLines as ab, createMockCartFromLines as ac, getMatchedMainProductSubTotal as ad, safeParse as ae, getDiscountEnvAttributeValue as af, checkAttributesUpdateNeeded as ag, preCheck as ah, formatScriptAutoFreeGift as ai, formatFunctionAutoFreeGift as aj, useSelectedOptions as ak, type SelectedOptionsResult as al, type UseProductOptions as am, useProduct as an, type UseAllProductsOptions as ao, useAllProducts as ap, type UseProductsByHandlesOptions as aq, useProductsByHandles as ar, type Options as as, useVariant as at, type UsePriceOptions as au, type UsePriceResult as av, usePrice as aw, useProductUrl as ax, useUpdateVariantQuery as ay, type ImageMedia as az, useUpdateCartLines as b, type PlusMemberContextValue as b0, PlusMemberContext as b1, usePlusMemberContext as b2, usePlusMonthlyProductVariant as b3, usePlusAnnualProductVariant as b4, type UseShippingMethodsOptions as b5, type UseShippingMethodsResult as b6, useShippingMethods as b7, useShippingMethodAvailableCheck as b8, useReplaceCartPlusMember as b9, type
|
|
1974
|
+
export { PriceBasePriceType as $, type AddCartLinesInput as A, type BuyNowInput as B, type CreateCartInput as C, type DiscountLabel as D, type Config as E, type GiftTier as F, type GiftProduct as G, type RewardItem as H, type GiftProductItem as I, RuleType as J, BuyRuleType as K, type FunctionGiftResult as L, type MainProductInfo as M, type FormattedGift as N, type OrderDiscountResult as O, type CartLineInput as P, type AutoFreeGiftItem as Q, type RemoveCartLinesInput as R, SpendMoneyType as S, type AutoFreeGiftList as T, type UpdateCartAttributesInput as U, type VariantItem as V, OrderDiscountType as W, OrderBasePriceType as X, type TieredDiscount as Y, type OrderDiscountConfig as Z, PriceDiscountType as _, useAddCartLines as a, type ShippingMethodsContext as a$, type PriceDiscountConfig as a0, currencyCodeMapping as a1, defaultSWRMutationConfiguration as a2, CUSTOMER_ATTRIBUTE_KEY as a3, CUSTOMER_SCRIPT_GIFT_KEY as a4, CODE_AMOUNT_KEY as a5, SCRIPT_CODE_AMOUNT_KEY as a6, MAIN_PRODUCT_CODE as a7, getQuery as a8, atobID as a9, type VideoMedia as aA, type VariantMedia as aB, useVariantMedia as aC, type UseCollectionOptions as aD, useCollection as aE, type UseAllCollectionsOptions as aF, useAllCollections as aG, type UseCollectionsOptions as aH, useCollections as aI, type UseBlogOptions as aJ, useBlog as aK, type UseAllBlogsOptions as aL, useAllBlogs as aM, type UseArticleOptions as aN, useArticle as aO, type UseArticlesOptions as aP, useArticles as aQ, type UseArticlesInBlogOptions as aR, useArticlesInBlog as aS, type SearchResultType as aT, type SearchResultItem as aU, type SearchResult as aV, type UseSearchOptions as aW, useSearch as aX, type SiteInfo as aY, type UseSiteOptions as aZ, useSite as a_, btoaID as aa, normalizeAddToCartLines as ab, createMockCartFromLines as ac, getMatchedMainProductSubTotal as ad, safeParse as ae, getDiscountEnvAttributeValue as af, checkAttributesUpdateNeeded as ag, preCheck as ah, formatScriptAutoFreeGift as ai, formatFunctionAutoFreeGift as aj, useSelectedOptions as ak, type SelectedOptionsResult as al, type UseProductOptions as am, useProduct as an, type UseAllProductsOptions as ao, useAllProducts as ap, type UseProductsByHandlesOptions as aq, useProductsByHandles as ar, type Options as as, useVariant as at, type UsePriceOptions as au, type UsePriceResult as av, usePrice as aw, useProductUrl as ax, useUpdateVariantQuery as ay, type ImageMedia as az, useUpdateCartLines as b, type PlusMemberContextValue as b0, PlusMemberContext as b1, usePlusMemberContext as b2, usePlusMonthlyProductVariant as b3, usePlusAnnualProductVariant as b4, type UseShippingMethodsOptions as b5, type UseShippingMethodsResult as b6, useShippingMethods as b7, useShippingMethodAvailableCheck as b8, useReplaceCartPlusMember as b9, type Measurement as bA, type ExportSelectedOption as bB, type ExportProductVariant as bC, type ExportDiscountAllocations as bD, type ExportLineItem as bE, type ExportDiscounts as bF, type ExportCart as bG, usePlusMemberDeliveryCodes as ba, type UseUpdatePlusMemberDeliveryOptionsProps as bb, useUpdatePlusMemberDeliveryOptions as bc, usePlusMemberItemCustomAttributes as bd, usePlusMemberCheckoutCustomAttributes as be, type UseAutoRemovePlusMemberInCartProps as bf, useAutoRemovePlusMemberInCart as bg, type UseHasPlusMemberInCartProps as bh, type HasPlusMemberInCartResult as bi, useHasPlusMemberInCart as bj, useAddPlusMemberProductsToCart as bk, type PlusMemberProviderProps as bl, PlusMemberProvider as bm, type UseIntersectionOptions as bn, useIntersection as bo, type UseExposureOptions as bp, useExposure as bq, type GeoLocationData as br, type LocaleMapping as bs, type UseGeoLocationOptions as bt, useGeoLocation as bu, getCachedGeoLocation as bv, clearGeoLocationCache as bw, type Attribute as bx, type Discount as by, type Image 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, type UseCalcGiftsFromLinesOptions as l, type UseCalcGiftsFromLinesResult as m, useCalcGiftsFromLines as n, useCalcOrderDiscount as o, getReferralAttributes as p, useCartAttributes as q, useCartItemQuantityLimit as r, type UseScriptAutoFreeGiftResult as s, useScriptAutoFreeGift as t, useCreateCart as u, useUpdateLineCodeAmountAttributes as v, type AutoFreeGift as w, type AutoFreeGiftMainProduct as x, type AutoFreeGiftConfig as y, type RuleCondition 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, bx as Attribute, w as AutoFreeGift, y as AutoFreeGiftConfig, Q as AutoFreeGiftItem, T as AutoFreeGiftList, x as AutoFreeGiftMainProduct, B as BuyNowInput, K as BuyRuleType, a5 as CODE_AMOUNT_KEY, a3 as CUSTOMER_ATTRIBUTE_KEY, a4 as CUSTOMER_SCRIPT_GIFT_KEY, P as CartLineInput, E as Config, C as CreateCartInput, by as Discount, D as DiscountLabel, bG as ExportCart, bD as ExportDiscountAllocations, bF as ExportDiscounts, bE as ExportLineItem, bC as ExportProductVariant, bB as ExportSelectedOption, N as FormattedGift, L as FunctionGiftResult, br as GeoLocationData, G as GiftProduct, I as GiftProductItem, F as GiftTier, bi as HasPlusMemberInCartResult, bz as Image, az as ImageMedia, bs as LocaleMapping, a7 as MAIN_PRODUCT_CODE, M as MainProductInfo, bA as Measurement, as as Options, X as OrderBasePriceType, Z as OrderDiscountConfig, O as OrderDiscountResult, W as OrderDiscountType, b1 as PlusMemberContext, b0 as PlusMemberContextValue, bm as PlusMemberProvider, bl as PlusMemberProviderProps, $ as PriceBasePriceType, a0 as PriceDiscountConfig, _ as PriceDiscountType, f as RemoveCartCodesInput, R as RemoveCartLinesInput, H as RewardItem, z as RuleCondition, J as RuleType, a6 as SCRIPT_CODE_AMOUNT_KEY, aV as SearchResult, aU as SearchResultItem, aT as SearchResultType, al as SelectedOptionsResult, a$ as ShippingMethodsContext, aY as SiteInfo, S as SpendMoneyType, Y as TieredDiscount, U as UpdateCartAttributesInput, aL as UseAllBlogsOptions, aF as UseAllCollectionsOptions, ao as UseAllProductsOptions, aN as UseArticleOptions, aR as UseArticlesInBlogOptions, aP as UseArticlesOptions, bf as UseAutoRemovePlusMemberInCartProps, aJ as UseBlogOptions, i as UseBuyNowOptions, l as UseCalcGiftsFromLinesOptions, m as UseCalcGiftsFromLinesResult, aD as UseCollectionOptions, aH as UseCollectionsOptions, bp as UseExposureOptions, bt as UseGeoLocationOptions, bh as UseHasPlusMemberInCartProps, bn as UseIntersectionOptions, au as UsePriceOptions, av as UsePriceResult, am as UseProductOptions, aq as UseProductsByHandlesOptions, s as UseScriptAutoFreeGiftResult, aW as UseSearchOptions, b5 as UseShippingMethodsOptions, b6 as UseShippingMethodsResult, aZ as UseSiteOptions, bb as UseUpdatePlusMemberDeliveryOptionsProps, V as VariantItem, aB as VariantMedia, aA as VideoMedia, a9 as atobID, aa as btoaID, ag as checkAttributesUpdateNeeded, bw as clearGeoLocationCache, ac as createMockCartFromLines, a1 as currencyCodeMapping, a2 as defaultSWRMutationConfiguration, aj as formatFunctionAutoFreeGift, ai as formatScriptAutoFreeGift, bv as getCachedGeoLocation, af as getDiscountEnvAttributeValue, ad as getMatchedMainProductSubTotal, a8 as getQuery, p as getReferralAttributes, ab as normalizeAddToCartLines, ah as preCheck, ae as safeParse, a as useAddCartLines, bk as useAddPlusMemberProductsToCart, aM as useAllBlogs, aG as useAllCollections, ap as useAllProducts, e as useApplyCartCodes, aO as useArticle, aQ as useArticles, aS as useArticlesInBlog, bg as useAutoRemovePlusMemberInCart, aK as useBlog, j as useBuyNow, k as useCalcAutoFreeGift, n as useCalcGiftsFromLines, o as useCalcOrderDiscount, q as useCartAttributes, r as useCartItemQuantityLimit, aE as useCollection, aI as useCollections, u as useCreateCart, bq as useExposure, bu as useGeoLocation, bj as useHasPlusMemberInCart, bo as useIntersection, b4 as usePlusAnnualProductVariant, be as usePlusMemberCheckoutCustomAttributes, b2 as usePlusMemberContext, ba as usePlusMemberDeliveryCodes, bd as usePlusMemberItemCustomAttributes, b3 as usePlusMonthlyProductVariant, aw as usePrice, an as useProduct, ax as useProductUrl, ar as useProductsByHandles, g as useRemoveCartCodes, c as useRemoveCartLines, b9 as useReplaceCartPlusMember, t as useScriptAutoFreeGift, aX as useSearch, ak as useSelectedOptions, b8 as useShippingMethodAvailableCheck, b7 as useShippingMethods, a_ as useSite, h as useUpdateCartAttributes, b as useUpdateCartLines, v as useUpdateLineCodeAmountAttributes, bc as useUpdatePlusMemberDeliveryOptions, ay as useUpdateVariantQuery, at as useVariant, aC as useVariantMedia } from './index-Bp9gEGUb.mjs';
|
|
5
5
|
export { a as AddToCartInput, A as AddToCartLineItem, B as BuyNowTrackConfig, g as DeliveryCustomData, h as DeliveryData, 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, i as gaTrack, l as trackAddToCartFBQ, t as trackAddToCartGA, j as trackBeginCheckoutGA, m as trackBuyNowFBQ, k as trackBuyNowGA, u as useAddToCart } from './types-DpxtE_nv.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, bx as Attribute, w as AutoFreeGift, y as AutoFreeGiftConfig, Q as AutoFreeGiftItem, T as AutoFreeGiftList, x as AutoFreeGiftMainProduct, B as BuyNowInput, K as BuyRuleType, a5 as CODE_AMOUNT_KEY, a3 as CUSTOMER_ATTRIBUTE_KEY, a4 as CUSTOMER_SCRIPT_GIFT_KEY, P as CartLineInput, E as Config, C as CreateCartInput, by as Discount, D as DiscountLabel, bG as ExportCart, bD as ExportDiscountAllocations, bF as ExportDiscounts, bE as ExportLineItem, bC as ExportProductVariant, bB as ExportSelectedOption, N as FormattedGift, L as FunctionGiftResult, br as GeoLocationData, G as GiftProduct, I as GiftProductItem, F as GiftTier, bi as HasPlusMemberInCartResult, bz as Image, az as ImageMedia, bs as LocaleMapping, a7 as MAIN_PRODUCT_CODE, M as MainProductInfo, bA as Measurement, as as Options, X as OrderBasePriceType, Z as OrderDiscountConfig, O as OrderDiscountResult, W as OrderDiscountType, b1 as PlusMemberContext, b0 as PlusMemberContextValue, bm as PlusMemberProvider, bl as PlusMemberProviderProps, $ as PriceBasePriceType, a0 as PriceDiscountConfig, _ as PriceDiscountType, f as RemoveCartCodesInput, R as RemoveCartLinesInput, H as RewardItem, z as RuleCondition, J as RuleType, a6 as SCRIPT_CODE_AMOUNT_KEY, aV as SearchResult, aU as SearchResultItem, aT as SearchResultType, al as SelectedOptionsResult, a$ as ShippingMethodsContext, aY as SiteInfo, S as SpendMoneyType, Y as TieredDiscount, U as UpdateCartAttributesInput, aL as UseAllBlogsOptions, aF as UseAllCollectionsOptions, ao as UseAllProductsOptions, aN as UseArticleOptions, aR as UseArticlesInBlogOptions, aP as UseArticlesOptions, bf as UseAutoRemovePlusMemberInCartProps, aJ as UseBlogOptions, i as UseBuyNowOptions, l as UseCalcGiftsFromLinesOptions, m as UseCalcGiftsFromLinesResult, aD as UseCollectionOptions, aH as UseCollectionsOptions, bp as UseExposureOptions, bt as UseGeoLocationOptions, bh as UseHasPlusMemberInCartProps, bn as UseIntersectionOptions, au as UsePriceOptions, av as UsePriceResult, am as UseProductOptions, aq as UseProductsByHandlesOptions, s as UseScriptAutoFreeGiftResult, aW as UseSearchOptions, b5 as UseShippingMethodsOptions, b6 as UseShippingMethodsResult, aZ as UseSiteOptions, bb as UseUpdatePlusMemberDeliveryOptionsProps, V as VariantItem, aB as VariantMedia, aA as VideoMedia, a9 as atobID, aa as btoaID, ag as checkAttributesUpdateNeeded, bw as clearGeoLocationCache, ac as createMockCartFromLines, a1 as currencyCodeMapping, a2 as defaultSWRMutationConfiguration, aj as formatFunctionAutoFreeGift, ai as formatScriptAutoFreeGift, bv as getCachedGeoLocation, af as getDiscountEnvAttributeValue, ad as getMatchedMainProductSubTotal, a8 as getQuery, p as getReferralAttributes, ab as normalizeAddToCartLines, ah as preCheck, ae as safeParse, a as useAddCartLines, bk as useAddPlusMemberProductsToCart, aM as useAllBlogs, aG as useAllCollections, ap as useAllProducts, e as useApplyCartCodes, aO as useArticle, aQ as useArticles, aS as useArticlesInBlog, bg as useAutoRemovePlusMemberInCart, aK as useBlog, j as useBuyNow, k as useCalcAutoFreeGift, n as useCalcGiftsFromLines, o as useCalcOrderDiscount, q as useCartAttributes, r as useCartItemQuantityLimit, aE as useCollection, aI as useCollections, u as useCreateCart, bq as useExposure, bu as useGeoLocation, bj as useHasPlusMemberInCart, bo as useIntersection, b4 as usePlusAnnualProductVariant, be as usePlusMemberCheckoutCustomAttributes, b2 as usePlusMemberContext, ba as usePlusMemberDeliveryCodes, bd as usePlusMemberItemCustomAttributes, b3 as usePlusMonthlyProductVariant, aw as usePrice, an as useProduct, ax as useProductUrl, ar as useProductsByHandles, g as useRemoveCartCodes, c as useRemoveCartLines, b9 as useReplaceCartPlusMember, t as useScriptAutoFreeGift, aX as useSearch, ak as useSelectedOptions, b8 as useShippingMethodAvailableCheck, b7 as useShippingMethods, a_ as useSite, h as useUpdateCartAttributes, b as useUpdateCartLines, v as useUpdateLineCodeAmountAttributes, bc as useUpdatePlusMemberDeliveryOptions, ay as useUpdateVariantQuery, at as useVariant, aC as useVariantMedia } from './index-D9zCMHzm.js';
|
|
5
5
|
export { a as AddToCartInput, A as AddToCartLineItem, B as BuyNowTrackConfig, g as DeliveryCustomData, h as DeliveryData, 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, i as gaTrack, l as trackAddToCartFBQ, t as trackAddToCartGA, j as trackBeginCheckoutGA, m as trackBuyNowFBQ, k as trackBuyNowGA, u as useAddToCart } from './types-DpxtE_nv.js';
|
|
6
6
|
export { ShopifyConfig, clearLocalStorage, createShopifyClient, getLocalStorage, removeLocalStorage, setLocalStorage } from '@anker-in/shopify-sdk';
|
|
7
7
|
import 'react';
|
package/dist/index.js
CHANGED
|
@@ -985,7 +985,7 @@ function useRemoveCartCodes(options) {
|
|
|
985
985
|
// src/hooks/cart/use-add-to-cart.ts
|
|
986
986
|
function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
987
987
|
const { client, config, locale, cartCookieAdapter, userAdapter } = useShopify();
|
|
988
|
-
const { cart } = useCartContext();
|
|
988
|
+
const { cart, addCustomAttributes } = useCartContext();
|
|
989
989
|
const { trigger: applyCartCodes } = useApplyCartCodes();
|
|
990
990
|
const { trigger: removeInvalidCodes } = useRemoveCartCodes();
|
|
991
991
|
const { trigger: addCartLines2 } = useAddCartLines();
|
|
@@ -999,7 +999,8 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
999
999
|
buyerIdentity,
|
|
1000
1000
|
needCreateCart = false,
|
|
1001
1001
|
onCodesInvalid,
|
|
1002
|
-
replaceExistingCodes
|
|
1002
|
+
replaceExistingCodes,
|
|
1003
|
+
customAttributes
|
|
1003
1004
|
} = arg;
|
|
1004
1005
|
if (!lineItems || lineItems.length === 0) {
|
|
1005
1006
|
return;
|
|
@@ -1044,6 +1045,9 @@ function useAddToCart({ withTrack = true } = {}, swrOptions) {
|
|
|
1044
1045
|
discountCodes
|
|
1045
1046
|
});
|
|
1046
1047
|
}
|
|
1048
|
+
if (customAttributes && customAttributes.length > 0) {
|
|
1049
|
+
addCustomAttributes(customAttributes);
|
|
1050
|
+
}
|
|
1047
1051
|
if (withTrack) {
|
|
1048
1052
|
trackAddToCartGA({
|
|
1049
1053
|
lineItems,
|
|
@@ -2807,7 +2811,7 @@ function useAddPlusMemberProductsToCart({
|
|
|
2807
2811
|
if (profile?.isMonthlyPlus && selectedPlusMemberMode === "monthly" /* MONTHLY */) {
|
|
2808
2812
|
return void 0;
|
|
2809
2813
|
}
|
|
2810
|
-
if (
|
|
2814
|
+
if (profile?.isAnnualPlus && selectedPlusMemberMode === "annual" /* ANNUAL */) {
|
|
2811
2815
|
return void 0;
|
|
2812
2816
|
}
|
|
2813
2817
|
return selectedPlusMemberProduct;
|