@anker-in/shopify-react 0.1.1-beta.48 → 0.1.1-beta.49
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 +2 -5
- package/dist/hooks/index.d.ts +2 -5
- package/dist/hooks/index.js +0 -9
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/index.mjs +1 -9
- package/dist/hooks/index.mjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +32 -39
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +33 -39
- package/dist/index.mjs.map +1 -1
- package/dist/provider/index.d.mts +0 -2
- package/dist/provider/index.d.ts +0 -2
- package/dist/provider/index.js +32 -38
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/index.mjs +32 -38
- package/dist/provider/index.mjs.map +1 -1
- package/package.json +3 -3
package/dist/hooks/index.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { CartLineInput, NormalizedCart, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, UpdateCartLinesOptions, HasMetafieldsIdentifier,
|
|
4
|
+
import { CartLineInput, NormalizedCart, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, UpdateCartLinesOptions, HasMetafieldsIdentifier, Media, NormalizedCollection, CollectionsConnection, NormalizedBlog, NormalizedArticle, NormalizedAttribute } from '@anker-in/shopify-sdk';
|
|
5
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
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';
|
|
@@ -789,9 +789,6 @@ declare const getDiscountEnvAttributeValue: (attributes?: {
|
|
|
789
789
|
key: string;
|
|
790
790
|
value: string;
|
|
791
791
|
}[]) => any;
|
|
792
|
-
declare const checkAttributesUpdateNeeded: (oldAttributes: NormalizedAttribute[], newAttributes: NormalizedAttribute[], customAttributesNeedRemove: {
|
|
793
|
-
key: string;
|
|
794
|
-
}[]) => boolean;
|
|
795
792
|
declare function preCheck(rule_conditions: RuleCondition[], userTags: string[], currentDealsTypes: string[]): boolean;
|
|
796
793
|
declare const formatScriptAutoFreeGift: ({ scriptAutoFreeGiftResult, gradient_gifts, locale, }: {
|
|
797
794
|
scriptAutoFreeGiftResult: UseScriptAutoFreeGiftResult;
|
|
@@ -1984,4 +1981,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
1984
1981
|
*/
|
|
1985
1982
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
1986
1983
|
|
|
1987
|
-
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 GetCartAttributesProps, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type HasPlusMemberInLinesResult, 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 UseHasPlusMemberInLinesProps, 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,
|
|
1984
|
+
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 GetCartAttributesProps, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type HasPlusMemberInLinesResult, 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 UseHasPlusMemberInLinesProps, 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, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getCartAttributes, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, getUserType, hasPlusMemberInCart, hasPlusMemberInLines, 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, useHasPlusMemberInLines, useIntersection, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, 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
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
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
|
-
import { CartLineInput, NormalizedCart, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, UpdateCartLinesOptions, HasMetafieldsIdentifier,
|
|
4
|
+
import { CartLineInput, NormalizedCart, NormalizedProduct, NormalizedProductVariant, NormalizedLineItem, UpdateCartLinesOptions, HasMetafieldsIdentifier, Media, NormalizedCollection, CollectionsConnection, NormalizedBlog, NormalizedArticle, NormalizedAttribute } from '@anker-in/shopify-sdk';
|
|
5
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
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';
|
|
@@ -789,9 +789,6 @@ declare const getDiscountEnvAttributeValue: (attributes?: {
|
|
|
789
789
|
key: string;
|
|
790
790
|
value: string;
|
|
791
791
|
}[]) => any;
|
|
792
|
-
declare const checkAttributesUpdateNeeded: (oldAttributes: NormalizedAttribute[], newAttributes: NormalizedAttribute[], customAttributesNeedRemove: {
|
|
793
|
-
key: string;
|
|
794
|
-
}[]) => boolean;
|
|
795
792
|
declare function preCheck(rule_conditions: RuleCondition[], userTags: string[], currentDealsTypes: string[]): boolean;
|
|
796
793
|
declare const formatScriptAutoFreeGift: ({ scriptAutoFreeGiftResult, gradient_gifts, locale, }: {
|
|
797
794
|
scriptAutoFreeGiftResult: UseScriptAutoFreeGiftResult;
|
|
@@ -1984,4 +1981,4 @@ declare function getCachedGeoLocation(cacheKey?: string): GeoLocationData | unde
|
|
|
1984
1981
|
*/
|
|
1985
1982
|
declare function clearGeoLocationCache(cacheKey?: string): void;
|
|
1986
1983
|
|
|
1987
|
-
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 GetCartAttributesProps, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type HasPlusMemberInLinesResult, 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 UseHasPlusMemberInLinesProps, 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,
|
|
1984
|
+
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 GetCartAttributesProps, type GiftProduct, type GiftProductItem, type GiftTier, type HasPlusMemberInCartProps, type HasPlusMemberInCartResult, type HasPlusMemberInLinesResult, 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 UseHasPlusMemberInLinesProps, 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, clearGeoLocationCache, createMockCartFromLines, currencyCodeMapping, defaultSWRMutationConfiguration, formatFunctionAutoFreeGift, formatScriptAutoFreeGift, getCachedGeoLocation, getCartAttributes, getDiscountEnvAttributeValue, getMatchedMainProductSubTotal, getQuery, getReferralAttributes, getUserType, hasPlusMemberInCart, hasPlusMemberInLines, 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, useHasPlusMemberInLines, useIntersection, usePlusMemberCheckoutCustomAttributes, usePlusMemberContext, usePlusMemberNeedAddToCart, usePlusMemberVariants, usePrice, useProduct, useProductUrl, useProductsByHandles, useRemoveCartCodes, useRemoveCartLines, useReplaceCartPlusMember, useScriptAutoFreeGift, useSearch, useSelectedOptions, useShippingMethods, useSite, useUpdateCartAttributes, useUpdateCartLines, useUpdateLineCodeAmountAttributes, useUpdateVariantQuery, useVariant, useVariantMedia };
|
package/dist/hooks/index.js
CHANGED
|
@@ -190,14 +190,6 @@ var getDiscountEnvAttributeValue = (attributes = []) => {
|
|
|
190
190
|
const attr = attributes.find((attr2) => attr2.key === CUSTOMER_ATTRIBUTE_KEY);
|
|
191
191
|
return safeParse(attr?.value ?? "") ?? {};
|
|
192
192
|
};
|
|
193
|
-
var checkAttributesUpdateNeeded = (oldAttributes, newAttributes, customAttributesNeedRemove) => {
|
|
194
|
-
return oldAttributes.some((attr) => {
|
|
195
|
-
const newAttr = newAttributes.find((newAttr2) => newAttr2.key === attr.key);
|
|
196
|
-
return newAttr ? newAttr.value !== attr.value : true;
|
|
197
|
-
}) || newAttributes.some((attr) => !oldAttributes.some((oldAttr) => oldAttr.key === attr.key)) || customAttributesNeedRemove.some(
|
|
198
|
-
(removeAttr) => oldAttributes.some((oldAttr) => oldAttr.key === removeAttr.key)
|
|
199
|
-
);
|
|
200
|
-
};
|
|
201
193
|
var containsAll = (source, requiredItems = []) => {
|
|
202
194
|
if (!requiredItems?.length) return true;
|
|
203
195
|
const sourceSet = new Set(source);
|
|
@@ -3119,7 +3111,6 @@ exports.RuleType = RuleType;
|
|
|
3119
3111
|
exports.SCRIPT_CODE_AMOUNT_KEY = SCRIPT_CODE_AMOUNT_KEY;
|
|
3120
3112
|
exports.ShippingMethodMode = ShippingMethodMode;
|
|
3121
3113
|
exports.SpendMoneyType = SpendMoneyType;
|
|
3122
|
-
exports.checkAttributesUpdateNeeded = checkAttributesUpdateNeeded;
|
|
3123
3114
|
exports.clearGeoLocationCache = clearGeoLocationCache;
|
|
3124
3115
|
exports.createMockCartFromLines = createMockCartFromLines;
|
|
3125
3116
|
exports.currencyCodeMapping = currencyCodeMapping;
|