@rebuy/rebuy-hydrogen 3.0.0-beta.12 → 3.0.0-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/README.md +677 -111
- package/dist/components/AddToCartBtn/AddToCartBtn.d.ts +1 -1
- package/dist/components/AddToCartBtn/AddToCartBtn.d.ts.map +1 -1
- package/dist/components/AddToCartBtn/HydrogenAddToCartBtn.d.ts +1 -1
- package/dist/components/AddToCartBtn/HydrogenAddToCartBtn.d.ts.map +1 -1
- package/dist/components/AddToCartBtn/HydrogenReactAddToCartBtn.d.ts +1 -1
- package/dist/components/AddToCartBtn/HydrogenReactAddToCartBtn.d.ts.map +1 -1
- package/dist/components/AddToCartBtn/types.d.ts +4 -0
- package/dist/components/AddToCartBtn/types.d.ts.map +1 -1
- package/dist/components/ProductCard/ProductCard.d.ts +1 -1
- package/dist/components/ProductCard/ProductCard.d.ts.map +1 -1
- package/dist/components/ProductCard/types.d.ts +3 -0
- package/dist/components/ProductCard/types.d.ts.map +1 -1
- package/dist/components/ProductCarousel/ProductCarousel.d.ts +2 -1
- package/dist/components/ProductCarousel/ProductCarousel.d.ts.map +1 -1
- package/dist/components/ProductPrice/ProductPrice.d.ts.map +1 -1
- package/dist/components/QuantityInput/QuantityInput.d.ts +1 -1
- package/dist/components/QuantityInput/QuantityInput.d.ts.map +1 -1
- package/dist/components/Timer/Timer.d.ts.map +1 -1
- package/dist/components/Timer/types.d.ts +2 -2
- package/dist/components/Timer/types.d.ts.map +1 -1
- package/dist/components/VariantSelect/VariantSelect.d.ts.map +1 -1
- package/dist/constants/debug.d.ts +27 -0
- package/dist/constants/debug.d.ts.map +1 -0
- package/dist/context/RebuyConfigContext.d.ts +2 -0
- package/dist/context/RebuyConfigContext.d.ts.map +1 -1
- package/dist/hooks/useBreakpoint.d.ts +1 -1
- package/dist/hooks/useBreakpoint.d.ts.map +1 -1
- package/dist/hooks/usePopupTrigger.d.ts +1 -1
- package/dist/hooks/usePopupTrigger.d.ts.map +1 -1
- package/dist/index.css +2513 -518
- package/dist/index.css.map +4 -4
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8947 -2512
- package/dist/index.js.map +4 -4
- package/dist/index.mjs +8963 -2528
- package/dist/index.mjs.map +4 -4
- package/dist/providers/RebuyHydrogenContextProvider.d.ts +1 -1
- package/dist/providers/RebuyHydrogenContextProvider.d.ts.map +1 -1
- package/dist/providers/RebuyHydrogenReactContextProvider.d.ts +1 -1
- package/dist/providers/RebuyHydrogenReactContextProvider.d.ts.map +1 -1
- package/dist/providers/types.d.ts +14 -22
- package/dist/providers/types.d.ts.map +1 -1
- package/dist/queries/cart.queries.d.ts +4 -4
- package/dist/queries/cart.queries.d.ts.map +1 -1
- package/dist/smart-cart/RebuySmartCart.d.ts +10 -0
- package/dist/smart-cart/RebuySmartCart.d.ts.map +1 -0
- package/dist/smart-cart/components/AnnouncementBar/AnnouncementBar.d.ts +10 -0
- package/dist/smart-cart/components/AnnouncementBar/AnnouncementBar.d.ts.map +1 -0
- package/dist/smart-cart/components/CartItem/CartItem.d.ts +7 -0
- package/dist/smart-cart/components/CartItem/CartItem.d.ts.map +1 -0
- package/dist/smart-cart/components/CartItemList/CartItemList.d.ts +10 -0
- package/dist/smart-cart/components/CartItemList/CartItemList.d.ts.map +1 -0
- package/dist/smart-cart/components/CartNoteInput/CartNoteInput.d.ts +10 -0
- package/dist/smart-cart/components/CartNoteInput/CartNoteInput.d.ts.map +1 -0
- package/dist/smart-cart/components/CartSubtotal/CartSubtotal.d.ts +11 -0
- package/dist/smart-cart/components/CartSubtotal/CartSubtotal.d.ts.map +1 -0
- package/dist/smart-cart/components/CartTitleBar/CartTitleBar.d.ts +7 -0
- package/dist/smart-cart/components/CartTitleBar/CartTitleBar.d.ts.map +1 -0
- package/dist/smart-cart/components/CheckoutArea/CheckoutArea.d.ts +10 -0
- package/dist/smart-cart/components/CheckoutArea/CheckoutArea.d.ts.map +1 -0
- package/dist/smart-cart/components/CrossSell/CrossSell.d.ts +10 -0
- package/dist/smart-cart/components/CrossSell/CrossSell.d.ts.map +1 -0
- package/dist/smart-cart/components/CustomCode/CustomCodeBlock.d.ts +21 -0
- package/dist/smart-cart/components/CustomCode/CustomCodeBlock.d.ts.map +1 -0
- package/dist/smart-cart/components/DebugPanel/DebugPanel.d.ts +13 -0
- package/dist/smart-cart/components/DebugPanel/DebugPanel.d.ts.map +1 -0
- package/dist/smart-cart/components/DebugPanel/index.d.ts +11 -0
- package/dist/smart-cart/components/DebugPanel/index.d.ts.map +1 -0
- package/dist/smart-cart/components/DiscountCodeInput/DiscountCodeInput.d.ts +10 -0
- package/dist/smart-cart/components/DiscountCodeInput/DiscountCodeInput.d.ts.map +1 -0
- package/dist/smart-cart/components/EmptyCart/EmptyCart.d.ts +3 -0
- package/dist/smart-cart/components/EmptyCart/EmptyCart.d.ts.map +1 -0
- package/dist/smart-cart/components/LoginButton/LoginButton.d.ts +3 -0
- package/dist/smart-cart/components/LoginButton/LoginButton.d.ts.map +1 -0
- package/dist/smart-cart/components/ScreenReaderText/ScreenReaderText.d.ts +8 -0
- package/dist/smart-cart/components/ScreenReaderText/ScreenReaderText.d.ts.map +1 -0
- package/dist/smart-cart/components/SmartCartApp/SmartCartApp.d.ts +20 -0
- package/dist/smart-cart/components/SmartCartApp/SmartCartApp.d.ts.map +1 -0
- package/dist/smart-cart/components/SmartCartContainer/SmartCartContainer.d.ts +8 -0
- package/dist/smart-cart/components/SmartCartContainer/SmartCartContainer.d.ts.map +1 -0
- package/dist/smart-cart/components/TieredProgressBar/Icons.d.ts +5 -0
- package/dist/smart-cart/components/TieredProgressBar/Icons.d.ts.map +1 -0
- package/dist/smart-cart/components/TieredProgressBar/TPBGiftItem.d.ts +21 -0
- package/dist/smart-cart/components/TieredProgressBar/TPBGiftItem.d.ts.map +1 -0
- package/dist/smart-cart/components/TieredProgressBar/TieredProgressBar.d.ts +11 -0
- package/dist/smart-cart/components/TieredProgressBar/TieredProgressBar.d.ts.map +1 -0
- package/dist/smart-cart/components/TieredProgressBar/progressBarUtils.d.ts +173 -0
- package/dist/smart-cart/components/TieredProgressBar/progressBarUtils.d.ts.map +1 -0
- package/dist/smart-cart/components/TieredProgressBar/types.d.ts +261 -0
- package/dist/smart-cart/components/TieredProgressBar/types.d.ts.map +1 -0
- package/dist/smart-cart/components/_Layouts/AnchorSlot.d.ts +13 -0
- package/dist/smart-cart/components/_Layouts/AnchorSlot.d.ts.map +1 -0
- package/dist/smart-cart/components/_Layouts/DoubleColumnLayout.d.ts +9 -0
- package/dist/smart-cart/components/_Layouts/DoubleColumnLayout.d.ts.map +1 -0
- package/dist/smart-cart/components/_Layouts/SingleColumnLayout.d.ts +8 -0
- package/dist/smart-cart/components/_Layouts/SingleColumnLayout.d.ts.map +1 -0
- package/dist/smart-cart/components/componentRegistry.d.ts +3 -0
- package/dist/smart-cart/components/componentRegistry.d.ts.map +1 -0
- package/dist/smart-cart/constants.d.ts +57 -0
- package/dist/smart-cart/constants.d.ts.map +1 -0
- package/dist/smart-cart/context/SmartCartContext.d.ts +62 -0
- package/dist/smart-cart/context/SmartCartContext.d.ts.map +1 -0
- package/dist/smart-cart/context/StorefrontCartContext.d.ts +32 -0
- package/dist/smart-cart/context/StorefrontCartContext.d.ts.map +1 -0
- package/dist/smart-cart/hooks/useCartItemFeatures.d.ts +84 -0
- package/dist/smart-cart/hooks/useCartItemFeatures.d.ts.map +1 -0
- package/dist/smart-cart/hooks/useDiscountManager.d.ts +28 -0
- package/dist/smart-cart/hooks/useDiscountManager.d.ts.map +1 -0
- package/dist/smart-cart/hooks/useGeolocation.d.ts +12 -0
- package/dist/smart-cart/hooks/useGeolocation.d.ts.map +1 -0
- package/dist/smart-cart/hooks/useIsScrolled.d.ts +14 -0
- package/dist/smart-cart/hooks/useIsScrolled.d.ts.map +1 -0
- package/dist/smart-cart/hooks/useSmartCartApps.d.ts +17 -0
- package/dist/smart-cart/hooks/useSmartCartApps.d.ts.map +1 -0
- package/dist/smart-cart/store/tieredProgressBarStore.d.ts +76 -0
- package/dist/smart-cart/store/tieredProgressBarStore.d.ts.map +1 -0
- package/dist/smart-cart/types/rebuy-storefront-cart.d.ts +142 -0
- package/dist/smart-cart/types/rebuy-storefront-cart.d.ts.map +1 -0
- package/dist/smart-cart/types/rebuy.d.ts +15 -0
- package/dist/smart-cart/types/rebuy.d.ts.map +1 -0
- package/dist/smart-cart/types/shop.d.ts +26 -0
- package/dist/smart-cart/types/shop.d.ts.map +1 -0
- package/dist/smart-cart/types/smart-cart-app.d.ts +103 -0
- package/dist/smart-cart/types/smart-cart-app.d.ts.map +1 -0
- package/dist/smart-cart/types/smart-cart-component.d.ts +1350 -0
- package/dist/smart-cart/types/smart-cart-component.d.ts.map +1 -0
- package/dist/smart-cart/types/smart-cart.d.ts +82 -0
- package/dist/smart-cart/types/smart-cart.d.ts.map +1 -0
- package/dist/smart-cart/utils/cartItemUtils.d.ts +292 -0
- package/dist/smart-cart/utils/cartItemUtils.d.ts.map +1 -0
- package/dist/smart-cart/utils/debugLog.d.ts +77 -0
- package/dist/smart-cart/utils/debugLog.d.ts.map +1 -0
- package/dist/smart-cart/utils/debugStyles.d.ts +3342 -0
- package/dist/smart-cart/utils/debugStyles.d.ts.map +1 -0
- package/dist/smart-cart/utils/executeScriptsInContainer.d.ts +14 -0
- package/dist/smart-cart/utils/executeScriptsInContainer.d.ts.map +1 -0
- package/dist/smart-cart/utils/imageUtils.d.ts +2 -0
- package/dist/smart-cart/utils/imageUtils.d.ts.map +1 -0
- package/dist/smart-cart/utils/mapHydrogenCartToStorefrontCartData.d.ts +14 -0
- package/dist/smart-cart/utils/mapHydrogenCartToStorefrontCartData.d.ts.map +1 -0
- package/dist/smart-cart/utils/moneyUtils.d.ts +24 -0
- package/dist/smart-cart/utils/moneyUtils.d.ts.map +1 -0
- package/dist/smart-cart/utils/safeJsonParse.d.ts +2 -0
- package/dist/smart-cart/utils/safeJsonParse.d.ts.map +1 -0
- package/dist/types/common.d.ts +9 -0
- package/dist/types/common.d.ts.map +1 -1
- package/dist/types/rebuyCustom.d.ts +86 -6
- package/dist/types/rebuyCustom.d.ts.map +1 -1
- package/dist/types/widgets.d.ts +20068 -0
- package/dist/types/widgets.d.ts.map +1 -1
- package/dist/utils/createContextParameters.d.ts.map +1 -1
- package/dist/utils/filterContextUtils.d.ts +3 -0
- package/dist/utils/filterContextUtils.d.ts.map +1 -0
- package/dist/utils/nonceManager.d.ts +10 -0
- package/dist/utils/nonceManager.d.ts.map +1 -0
- package/dist/widgetContainer/RebuyWidgetContainer.d.ts.map +1 -1
- package/dist/widgets/RebuyCompleteTheLook/RebuyCompleteTheLook.d.ts.map +1 -1
- package/dist/widgets/RebuyDynamicBundleProducts/BundleSelection.d.ts.map +1 -1
- package/dist/widgets/RebuyDynamicBundleProducts/RebuyDynamicBundleProducts.d.ts.map +1 -1
- package/dist/widgets/RebuyProductAddOns/RebuyProductAddOns.d.ts.map +1 -1
- package/dist/widgets/RebuyProductRecommendations/RebuyProductRecommendations.d.ts.map +1 -1
- package/dist/widgets/RebuyWidget/RebuyWidget.d.ts.map +1 -1
- package/dist/widgets/RebuyWidget/WidgetContent.d.ts +1 -1
- package/dist/widgets/RebuyWidget/WidgetContent.d.ts.map +1 -1
- package/dist/widgets/RebuyWidget/types.d.ts +3 -314
- package/dist/widgets/RebuyWidget/types.d.ts.map +1 -1
- package/package.json +14 -8
- package/dist/hooks/useRebuyTheme.d.ts +0 -21
- package/dist/hooks/useRebuyTheme.d.ts.map +0 -1
- package/dist/types/rebuySmartCart.d.ts +0 -184
- package/dist/types/rebuySmartCart.d.ts.map +0 -1
- package/dist/utils/csp.d.ts +0 -16
- package/dist/utils/csp.d.ts.map +0 -1
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"smart-cart-component.d.ts","sourceRoot":"","sources":["../../../src/smart-cart/types/smart-cart-component.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAA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wBAAwB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,wBAAwB,CAAC,CAAC;AAGhF,OAAO,EACH,6BAA6B,EAC7B,mBAAmB,EACnB,uBAAuB,EACvB,0BAA0B,EAC1B,sBAAsB,EACtB,qBAAqB,EACrB,6BAA6B,EAC7B,6BAA6B,EAC7B,0BAA0B,EAC1B,4BAA4B,EAC5B,mBAAmB,EACnB,0BAA0B,EAC1B,wBAAwB,EACxB,+BAA+B,EAC/B,sBAAsB,EACtB,sBAAsB,GACzB,CAAC"}
|
@@ -0,0 +1,82 @@
|
|
1
|
+
import type { SmartCartAppMerchantConfig } from '~/smart-cart/types/smart-cart-app';
|
2
|
+
import type { SmartCartComponentConfig } from '~/smart-cart/types/smart-cart-component';
|
3
|
+
export type SmartCartConfig = {
|
4
|
+
apps?: SmartCartAppMerchantConfig[];
|
5
|
+
attribution_tracking_enabled?: boolean;
|
6
|
+
buy_more_save_more?: BuyMoreSaveMore;
|
7
|
+
buy_more_save_more_enabled?: boolean;
|
8
|
+
callbacks?: Callbacks;
|
9
|
+
cart_page_checkout_override?: boolean;
|
10
|
+
cart_page_enabled?: boolean;
|
11
|
+
components?: SmartCartComponentConfig[];
|
12
|
+
created_at?: string;
|
13
|
+
custom_css?: string;
|
14
|
+
custom_template?: string;
|
15
|
+
empty_cart_markup?: string;
|
16
|
+
enabled?: boolean;
|
17
|
+
id?: number;
|
18
|
+
layout?: string;
|
19
|
+
layout_version?: string;
|
20
|
+
locked?: boolean;
|
21
|
+
name?: string;
|
22
|
+
owner?: number;
|
23
|
+
product_form_redirect?: string;
|
24
|
+
product_metafields_enabled?: boolean;
|
25
|
+
selectors?: Selectors;
|
26
|
+
switch_to_subscription?: SwitchToSubscription;
|
27
|
+
switch_to_subscription_enabled?: boolean;
|
28
|
+
template?: string;
|
29
|
+
use_custom_template?: boolean;
|
30
|
+
};
|
31
|
+
export type BuyMoreSaveMore = {
|
32
|
+
discount_products?: any[];
|
33
|
+
discount_type?: string;
|
34
|
+
display_type?: string;
|
35
|
+
language?: BuyMoreSaveMoreLanguage;
|
36
|
+
tiers?: BuyMoreSaveMoreTier[];
|
37
|
+
};
|
38
|
+
export type BuyMoreSaveMoreLanguage = {
|
39
|
+
bmsm_discount_message?: string;
|
40
|
+
bmsm_discount_success?: string;
|
41
|
+
};
|
42
|
+
export type BuyMoreSaveMoreTier = {
|
43
|
+
discount?: number;
|
44
|
+
quantity?: number;
|
45
|
+
};
|
46
|
+
type Callbacks = {
|
47
|
+
hide?: Hide;
|
48
|
+
init?: Hide;
|
49
|
+
line_item_decrease?: Hide;
|
50
|
+
line_item_increase?: Hide;
|
51
|
+
line_item_removed?: Hide;
|
52
|
+
ready?: Hide;
|
53
|
+
show?: Hide;
|
54
|
+
};
|
55
|
+
type Hide = {
|
56
|
+
enabled?: boolean;
|
57
|
+
function?: string;
|
58
|
+
};
|
59
|
+
type Selectors = {
|
60
|
+
cart_subtotal?: string;
|
61
|
+
item_count?: string;
|
62
|
+
};
|
63
|
+
export type SwitchToSubscription = {
|
64
|
+
disable_downgrade?: boolean;
|
65
|
+
language?: SwitchToSubscriptionLanguage;
|
66
|
+
};
|
67
|
+
export type SwitchToSubscriptionLanguage = {
|
68
|
+
downgrading_label?: string;
|
69
|
+
onetime_option_group_label?: string;
|
70
|
+
onetime_option_label?: string;
|
71
|
+
subscription_option_group_label?: string;
|
72
|
+
/**
|
73
|
+
* @deprecated when using the Storefront API, this field will be ignored.
|
74
|
+
*/
|
75
|
+
subscription_option_label?: string;
|
76
|
+
upgrade_to_subscription_default_frequency?: string;
|
77
|
+
upgrade_to_subscription_label?: string;
|
78
|
+
upgrade_to_subscription_without_discount_label?: string;
|
79
|
+
upgrading_label?: string;
|
80
|
+
};
|
81
|
+
export {};
|
82
|
+
//# sourceMappingURL=smart-cart.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"smart-cart.d.ts","sourceRoot":"","sources":["../../../src/smart-cart/types/smart-cart.ts"],"names":[],"mappings":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;IACzC;;OAEG;IACH,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,yCAAyC,CAAC,EAAE,MAAM,CAAC;IACnD,6BAA6B,CAAC,EAAE,MAAM,CAAC;IACvC,8CAA8C,CAAC,EAAE,MAAM,CAAC;IACxD,eAAe,CAAC,EAAE,MAAM,CAAC;CAC5B,CAAC"}
|
@@ -0,0 +1,292 @@
|
|
1
|
+
import type { CartLine } from '@shopify/hydrogen/storefront-api-types';
|
2
|
+
import type { AnyCartLine, StorefrontAttribute, StorefrontCartLine, StorefrontSellingPlanPriceAdjustment } from '~/smart-cart/types/rebuy-storefront-cart';
|
3
|
+
import type { BuyMoreSaveMoreTier, SmartCartConfig, SwitchToSubscriptionLanguage } from '~/smart-cart/types/smart-cart';
|
4
|
+
/**
|
5
|
+
* Checks standard hide conditions (tags, specific attributes like _type=child)
|
6
|
+
* Does NOT check for TPB gifts based on mode - that's handled in CartItemList filter.
|
7
|
+
*
|
8
|
+
* @param {AnyCartLine} line - The line item to check
|
9
|
+
*
|
10
|
+
* @returns {boolean} true if the line item is hidden by standard logic, false otherwise
|
11
|
+
*/
|
12
|
+
export declare const isCartItemHiddenByStandardLogic: (line: AnyCartLine) => boolean;
|
13
|
+
/**
|
14
|
+
* Identifies if a line item is a subscription item based on Storefront API structure
|
15
|
+
*
|
16
|
+
* @param {StorefrontCartLine} line - The line item to check
|
17
|
+
*
|
18
|
+
* @returns {boolean} true if the line item is a subscription item, false otherwise
|
19
|
+
*/
|
20
|
+
export declare const isSubscriptionItem: (line: StorefrontCartLine) => boolean;
|
21
|
+
/**
|
22
|
+
* Merges new/updated attributes into existing, overwriting duplicates.
|
23
|
+
*
|
24
|
+
* @param {StorefrontAttribute[] | undefined | null} existing - The existing attribute list.
|
25
|
+
* @param {StorefrontAttribute[]} newOrUpdated - The new or updated attribute list.
|
26
|
+
*
|
27
|
+
* @returns {StorefrontAttribute[]} - The merged attribute list.
|
28
|
+
*/
|
29
|
+
export declare const mergeAttributes: (existing: StorefrontAttribute[] | undefined | null, newOrUpdated: StorefrontAttribute[]) => StorefrontAttribute[];
|
30
|
+
/**
|
31
|
+
* Removes specified keys from an attribute list.
|
32
|
+
*
|
33
|
+
* @param {StorefrontAttribute[] | undefined | null} existing - The existing attribute list.
|
34
|
+
* @param {string[]} keysToRemove - The keys to remove from the attribute list.
|
35
|
+
*
|
36
|
+
* @returns {StorefrontAttribute[]} - The filtered attribute list.
|
37
|
+
*/
|
38
|
+
export declare const removeAttributes: (existing: StorefrontAttribute[] | undefined | null, keysToRemove: string[]) => StorefrontAttribute[];
|
39
|
+
/**
|
40
|
+
* Generates an alt text for the item image.
|
41
|
+
*
|
42
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
43
|
+
*
|
44
|
+
* @returns {string} The alt text string.
|
45
|
+
*/
|
46
|
+
export declare const getItemImageAlt: (line: StorefrontCartLine) => string;
|
47
|
+
/**
|
48
|
+
* Generates the URL for a product based on its handle.
|
49
|
+
* Assumes standard '/products/' path.
|
50
|
+
*
|
51
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
52
|
+
*
|
53
|
+
* @returns {string} The product URL string.
|
54
|
+
*/
|
55
|
+
export declare const getItemURL: (line: StorefrontCartLine) => string;
|
56
|
+
/**
|
57
|
+
* Generates an ARIA label for the item link.
|
58
|
+
*
|
59
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
60
|
+
*
|
61
|
+
* @returns {string} The ARIA label string.
|
62
|
+
*/
|
63
|
+
export declare const getItemLinkLabel: (line: StorefrontCartLine) => string;
|
64
|
+
/**
|
65
|
+
* Generates CSS class names based on product tags.
|
66
|
+
* Prefixes tags with 'tag-'.
|
67
|
+
*
|
68
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
69
|
+
*
|
70
|
+
* @returns {string} A string of space-separated class names.
|
71
|
+
*/
|
72
|
+
export declare const getItemProductTagsClasses: (line: StorefrontCartLine) => string;
|
73
|
+
/**
|
74
|
+
* Generates CSS class names based on line item attributes (properties).
|
75
|
+
* Creates classes like 'property-key-{key}' and 'property-value-{value}'.
|
76
|
+
* Sanitizes key and value for CSS class usage.
|
77
|
+
*
|
78
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
79
|
+
*
|
80
|
+
* @returns {string} A string of space-separated class names.
|
81
|
+
*/
|
82
|
+
export declare const getItemAttributeClasses: (line: StorefrontCartLine) => string;
|
83
|
+
/**
|
84
|
+
* Generates a specific class name for a property key.
|
85
|
+
* Handles potentially null/undefined values.
|
86
|
+
*
|
87
|
+
* @param {StorefrontAttribute} property - The attribute object.
|
88
|
+
*
|
89
|
+
* @returns {string} A CSS class name string.
|
90
|
+
*/
|
91
|
+
export declare const getItemPropertyKeyClass: (property: StorefrontAttribute) => string;
|
92
|
+
/**
|
93
|
+
* Generates a specific class name for a property value.
|
94
|
+
* Handles potentially null/undefined values.
|
95
|
+
*
|
96
|
+
* @param {StorefrontAttribute} property - The attribute object.
|
97
|
+
*
|
98
|
+
* @returns {string} A CSS class name string.
|
99
|
+
*/
|
100
|
+
export declare const getItemPropertyValueClass: (property: StorefrontAttribute) => string;
|
101
|
+
type CalculatedPricing = {
|
102
|
+
compareAtDisplayPrice: string | null;
|
103
|
+
displayPrice: string;
|
104
|
+
hasDiscount: boolean;
|
105
|
+
};
|
106
|
+
/**
|
107
|
+
* Calculates display price, compare-at price, and discount status for a line item.
|
108
|
+
*
|
109
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
110
|
+
*
|
111
|
+
* @returns {CalculatedPricing} The calculated pricing data.
|
112
|
+
*/
|
113
|
+
export declare const calculatePricingData: (line: StorefrontCartLine) => CalculatedPricing;
|
114
|
+
/**
|
115
|
+
* Filters and returns visible item properties (attributes), excluding internal ones (_*).
|
116
|
+
*
|
117
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
118
|
+
*
|
119
|
+
* @returns {StorefrontAttribute[]} The visible properties.
|
120
|
+
*/
|
121
|
+
export declare const getVisibleItemProperties: (line: StorefrontCartLine) => StorefrontAttribute[];
|
122
|
+
/**
|
123
|
+
* Extracts discount allocation messages as properties.
|
124
|
+
*
|
125
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
126
|
+
*
|
127
|
+
* @returns {StorefrontAttribute[]} The discount properties.
|
128
|
+
*/
|
129
|
+
export declare const getDiscountProperties: (line: StorefrontCartLine) => StorefrontAttribute[];
|
130
|
+
/**
|
131
|
+
* Extracts the delivery frequency string if item is a subscription.
|
132
|
+
*
|
133
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
134
|
+
*
|
135
|
+
* @returns {string | null} The delivery frequency string, or null if not a subscription.
|
136
|
+
*/
|
137
|
+
export declare const getItemDeliveryFrequency: (line: StorefrontCartLine) => string | null;
|
138
|
+
/**
|
139
|
+
* Checks if Buy More Save More is enabled in the configuration.
|
140
|
+
*
|
141
|
+
* @param {SmartCartConfig | null} config The smart cart configuration.
|
142
|
+
*
|
143
|
+
* @returns {boolean} True if BMSM is enabled.
|
144
|
+
*/
|
145
|
+
export declare const isBMSMEnabled: (config: SmartCartConfig | null) => boolean;
|
146
|
+
/**
|
147
|
+
* Checks if a specific item is eligible for the Buy More Save More promotion.
|
148
|
+
* Compares the item's product/variant ID against the configured list.
|
149
|
+
* NOTE: Assumes config.buy_more_save_more.discount_products structure based on legacy code.
|
150
|
+
* You might need to adjust based on the actual structure in your `SmartCartConfig`.
|
151
|
+
*
|
152
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
153
|
+
* @param {SmartCartConfig|null} config - The cart configuration.
|
154
|
+
*
|
155
|
+
* @returns {boolean} True if the item is eligible for BMSM, false otherwise.
|
156
|
+
*/
|
157
|
+
export declare const itemHasBMSM: (line: StorefrontCartLine, config: SmartCartConfig | null) => boolean;
|
158
|
+
/**
|
159
|
+
* Gets the configured BMSM tiers from config, ensuring quantity and discount are numbers.
|
160
|
+
*
|
161
|
+
* @param {SmartCartConfig | null} config - The cart configuration.
|
162
|
+
*
|
163
|
+
* @returns {Array<BuyMoreSaveMoreTier>} Array of tier objects with numeric quantity/discount.
|
164
|
+
*/
|
165
|
+
export declare const getBMSMTiers: (config: SmartCartConfig | null) => BuyMoreSaveMoreTier[];
|
166
|
+
/**
|
167
|
+
* Checks if the final BMSM tier has been reached for this item.
|
168
|
+
*
|
169
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
170
|
+
* @param {SmartCartConfig|null} config - The cart configuration.
|
171
|
+
*
|
172
|
+
* @returns {boolean} True if the final tier has not been reached, false otherwise.
|
173
|
+
*/
|
174
|
+
export declare const bMSMFinalTierNotReached: (line: StorefrontCartLine, config: SmartCartConfig | null) => boolean;
|
175
|
+
/**
|
176
|
+
* Checks if BMSM should be displayed as buttons based on config.
|
177
|
+
*
|
178
|
+
* @param {SmartCartConfig|null} config - The cart configuration.
|
179
|
+
*
|
180
|
+
* @returns {boolean} True if BMSM should be displayed as buttons, false otherwise.
|
181
|
+
*/
|
182
|
+
export declare const hasBMSMButtons: (config: SmartCartConfig | null) => boolean;
|
183
|
+
/**
|
184
|
+
* Generates the text for a BMSM tier button based on language settings.
|
185
|
+
* Handles placeholders for {{quantity}} and {{discount}}.
|
186
|
+
*
|
187
|
+
* @param {BuyMoreSaveMoreTier} tier - The tier object.
|
188
|
+
* @param {SmartCartConfig|null} config - The cart configuration.
|
189
|
+
*
|
190
|
+
* @returns {string} The button text.
|
191
|
+
*/
|
192
|
+
export declare const getBMSMButtonText: (tier: BuyMoreSaveMoreTier, config: SmartCartConfig | null) => string;
|
193
|
+
/**
|
194
|
+
* Generates the dynamic text message for BMSM (when not using buttons).
|
195
|
+
* Finds the next applicable tier and formats the message.
|
196
|
+
* Handles placeholders for {{quantity}}, {{difference}}, and {{discount}}.
|
197
|
+
*
|
198
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
199
|
+
* @param {SmartCartConfig|null} config - The cart configuration.
|
200
|
+
*
|
201
|
+
* @returns {string} The dynamic text message, or empty string if no next tier.
|
202
|
+
*/
|
203
|
+
export declare const buyMoreSaveMoreDynamicText: (line: StorefrontCartLine, config: SmartCartConfig | null) => string;
|
204
|
+
/**
|
205
|
+
* Extracts available selling plans from the cart line's product data.
|
206
|
+
*
|
207
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
208
|
+
*
|
209
|
+
* @returns {Array<{id: string, name: string, adjustments: StorefrontSellingPlanPriceAdjustment[] | null}>} - Array of selling plan details.
|
210
|
+
*/
|
211
|
+
export declare const getAvailableSellingPlans: (line: StorefrontCartLine) => {
|
212
|
+
adjustments: StorefrontSellingPlanPriceAdjustment[] | null;
|
213
|
+
id: string;
|
214
|
+
name: string;
|
215
|
+
}[];
|
216
|
+
/**
|
217
|
+
* Calculates the discount percentage for the first selling plan.
|
218
|
+
*
|
219
|
+
* @param {Array<{adjustments: StorefrontSellingPlanPriceAdjustment[] | null}>} sellingPlans - Array of selling plan details.
|
220
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
221
|
+
*
|
222
|
+
* @returns {number} - The calculated discount percentage.
|
223
|
+
*/
|
224
|
+
export declare const calculateDefaultSellingPlanDiscount: (sellingPlans: {
|
225
|
+
adjustments: StorefrontSellingPlanPriceAdjustment[] | null;
|
226
|
+
}[], line: StorefrontCartLine) => number;
|
227
|
+
/**
|
228
|
+
* Gets STS language string, replacing discount placeholder if applicable.
|
229
|
+
*
|
230
|
+
* @param {keyof SwitchToSubscriptionLanguage} key - The language key.
|
231
|
+
* @param {SmartCartConfig | null} config - The cart configuration.
|
232
|
+
* @param {number} discountPercent - The discount percentage.
|
233
|
+
* @param {string} fallback - The fallback language string.
|
234
|
+
*
|
235
|
+
* @returns {string} - The formatted language string.
|
236
|
+
*/
|
237
|
+
export declare const getSwitchToSubscriptionLabelWithDiscount: (key: keyof SwitchToSubscriptionLanguage, config: SmartCartConfig | null, discountPercent: number, fallback?: string) => string;
|
238
|
+
/**
|
239
|
+
* Placeholder: Checks if an item represents a bundle.
|
240
|
+
* Implement this based on how bundles are identified (e.g., product type, tags, properties).
|
241
|
+
*
|
242
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
243
|
+
*
|
244
|
+
* @returns {boolean} True if the item is a bundle, false otherwise.
|
245
|
+
*/
|
246
|
+
export declare const itemIsBundle: (line: StorefrontCartLine) => boolean;
|
247
|
+
/**
|
248
|
+
* Placeholder: Checks if bundle options should be hidden for this item.
|
249
|
+
*
|
250
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
251
|
+
*
|
252
|
+
* @returns {boolean} True if bundle options should be hidden, false otherwise.
|
253
|
+
*/
|
254
|
+
export declare const hideBundleOptions: (line: StorefrontCartLine) => boolean;
|
255
|
+
/**
|
256
|
+
* Placeholder: Gets the number of items within a bundle.
|
257
|
+
* Requires specific logic based on bundle representation.
|
258
|
+
*
|
259
|
+
* @param {StorefrontCartLine} line - The cart line item.
|
260
|
+
*
|
261
|
+
* @returns {number} The number of items in the bundle.
|
262
|
+
*/
|
263
|
+
export declare const getItemBundleLength: (line: StorefrontCartLine) => number;
|
264
|
+
/**
|
265
|
+
* Placeholder: Gets the image URL for a specific option within a bundle.
|
266
|
+
* Requires specific logic based on bundle representation and product data.
|
267
|
+
*
|
268
|
+
* @param {unknown} product - The product object.
|
269
|
+
* @param {unknown} option - The bundle option object.
|
270
|
+
* @param {number} index - The index of the option.
|
271
|
+
*
|
272
|
+
* @returns {string} The image URL.
|
273
|
+
*/
|
274
|
+
export declare const getBundleOptionImage: (product: unknown, option: unknown, index: number) => string;
|
275
|
+
/**
|
276
|
+
* Placeholder: Gets the title for a child item/option within a bundle.
|
277
|
+
*
|
278
|
+
* @param {any} option - The bundle option object.
|
279
|
+
*
|
280
|
+
* @returns {string} The title of the child bundle item.
|
281
|
+
*/
|
282
|
+
export declare const getChildBundleTitle: (option: any) => string;
|
283
|
+
/**
|
284
|
+
* Identifies if a line item is a gift from the tiered progress bar
|
285
|
+
*
|
286
|
+
* @param {CartLine} line - The line item to check
|
287
|
+
*
|
288
|
+
* @returns {boolean} true if the line item is a gift from the tiered progress bar, false otherwise
|
289
|
+
*/
|
290
|
+
export declare const isTieredProgressBarGiftItem: (line: CartLine) => boolean;
|
291
|
+
export {};
|
292
|
+
//# sourceMappingURL=cartItemUtils.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"cartItemUtils.d.ts","sourceRoot":"","sources":["../../../src/smart-cart/utils/cartItemUtils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,wCAAwC,CAAC;AAOvE,OAAO,KAAK,EACR,WAAW,EACX,mBAAmB,EAEnB,kBAAkB,EAGlB,oCAAoC,EAEvC,MAAM,0CAA0C,CAAC;AAClD,OAAO,KAAK,EAAE,mBAAmB,EAAE,eAAe,EAAE,4BAA4B,EAAE,MAAM,+BAA+B,CAAC;AAKxH;;;;;;;GAOG;AACH,eAAO,MAAM,+BAA+B,GAAI,MAAM,WAAW,KAAG,OAmBnE,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,GAAI,MAAM,kBAAkB,KAAG,OAE7D,CAAC;AAIF;;;;;;;GAOG;AACH,eAAO,MAAM,eAAe,GACxB,UAAU,mBAAmB,EAAE,GAAG,SAAS,GAAG,IAAI,EAClD,cAAc,mBAAmB,EAAE,KACpC,mBAAmB,EAMrB,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,gBAAgB,GACzB,UAAU,mBAAmB,EAAE,GAAG,SAAS,GAAG,IAAI,EAClD,cAAc,MAAM,EAAE,KACvB,mBAAmB,EAIrB,CAAC;AAIF;;;;;;GAMG;AACH,eAAO,MAAM,eAAe,GAAI,MAAM,kBAAkB,KAAG,MAE1D,CAAC;AAEF;;;;;;;GAOG;AACH,eAAO,MAAM,UAAU,GAAI,MAAM,kBAAkB,KAAG,MAErD,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,gBAAgB,GAAI,MAAM,kBAAkB,KAAG,MAE3D,CAAC;AAoBF;;;;;;;GAOG;AACH,eAAO,MAAM,yBAAyB,GAAI,MAAM,kBAAkB,KAAG,MAIpE,C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GAAG,KAAG,MAGjD,CAAC;AAIF;;;;;;GAMG;AACH,eAAO,MAAM,2BAA2B,GAAI,MAAM,QAAQ,KAAG,OAK5D,CAAC"}
|
@@ -0,0 +1,77 @@
|
|
1
|
+
declare global {
|
2
|
+
interface Window {
|
3
|
+
REBUY_DEBUG_MODE?: boolean | string | string[];
|
4
|
+
}
|
5
|
+
}
|
6
|
+
type DebugSettings = {
|
7
|
+
enabledKeys: Set<string>;
|
8
|
+
globalEnable: boolean;
|
9
|
+
};
|
10
|
+
/**
|
11
|
+
* The main Rebuy debug logger object.
|
12
|
+
* Provides familiar console methods, but conditional on Rebuy debug settings and feature keys.
|
13
|
+
*
|
14
|
+
* How to enable debugging:
|
15
|
+
* 1. Global: Set `window.REBUY_DEBUG_MODE = true` or in localStorage `REBUY_DEBUG_MODE` to `'true'`.
|
16
|
+
* This enables all logs from `rebuyDebugLog` regardless of key.
|
17
|
+
* 2. Key-specific: Set `window.REBUY_DEBUG_MODE = ['cart', 'api']` (array of strings) or
|
18
|
+
* in localStorage `REBUY_DEBUG_MODE` to `'cart,api'` (comma-separated string).
|
19
|
+
* This enables logs only for the specified keys (e.g., `rebuyDebugLog.log('cart', ...)`).
|
20
|
+
*
|
21
|
+
* To disable, set the corresponding value to `false` or remove the localStorage item.
|
22
|
+
*/
|
23
|
+
export declare const rebuyDebugLog: {
|
24
|
+
assert: (key: string, assertion: boolean, ...messageArgs: any[]) => void;
|
25
|
+
clear: () => void;
|
26
|
+
count: (key: string, label?: string) => void;
|
27
|
+
countReset: (key: string, label?: string) => void;
|
28
|
+
debug: (key: string, ...args: any[]) => void;
|
29
|
+
dir: (key: string, ...args: any[]) => void;
|
30
|
+
dirxml: (key: string, ...args: any[]) => void;
|
31
|
+
error: (key: string, ...args: any[]) => void;
|
32
|
+
/**
|
33
|
+
* Retrieves the current parsed debug settings.
|
34
|
+
*
|
35
|
+
* @returns {DebugSettings} An object containing `globalEnable` (boolean) and `enabledKeys` (Set<string>).
|
36
|
+
*/
|
37
|
+
getSettings: () => DebugSettings;
|
38
|
+
group: (key: string, groupLabelArg?: any, ...data: any[]) => void;
|
39
|
+
groupCollapsed: (key: string, groupLabelArg?: any, ...data: any[]) => void;
|
40
|
+
groupEnd: () => void;
|
41
|
+
info: (key: string, ...args: any[]) => void;
|
42
|
+
/**
|
43
|
+
* Checks if any Rebuy debugging (global or any key) is active.
|
44
|
+
* Useful for controlling parameter-less debug actions or general checks.
|
45
|
+
*
|
46
|
+
* @returns {boolean} True if any form of Rebuy debugging is active.
|
47
|
+
*/
|
48
|
+
isAnyActive: () => boolean;
|
49
|
+
/**
|
50
|
+
* Checks if debugging is active for a specific feature key.
|
51
|
+
* Considers both global debug mode and key-specific settings.
|
52
|
+
*
|
53
|
+
* @param {string} key - The debug key for the feature.
|
54
|
+
* @returns {boolean} True if debugging is active for this key.
|
55
|
+
*/
|
56
|
+
isKeyActive: (key: string) => boolean;
|
57
|
+
log: (key: string, ...args: any[]) => void;
|
58
|
+
table: (key: string, data: any, properties?: readonly string[]) => void;
|
59
|
+
time: (key: string, label?: string) => void;
|
60
|
+
timeEnd: (key: string, label?: string) => void;
|
61
|
+
timeLog: (key: string, timerName: string, ...data: any[]) => void;
|
62
|
+
trace: (key: string, ...args: any[]) => void;
|
63
|
+
warn: (key: string, ...args: any[]) => void;
|
64
|
+
};
|
65
|
+
/**
|
66
|
+
* Returns true if Rebuy debug mode is active.
|
67
|
+
*
|
68
|
+
* @deprecated Prefer using `rebuyDebugLog.isKeyActive(key)`, `rebuyDebugLog.isAnyActive()`, or `rebuyDebugLog.getSettings().globalEnable`.
|
69
|
+
* Checks if Rebuy debug mode is active.
|
70
|
+
* - If a `key` is provided, checks if that key is enabled OR if global debug is on.
|
71
|
+
* - If no `key` is provided, checks ONLY if global debug mode is on (to maintain some backward compatibility with original intent).
|
72
|
+
* @param {string} [key] - Optional. The debug key for a specific feature.
|
73
|
+
* @returns {boolean} True if debug mode is enabled for the context.
|
74
|
+
*/
|
75
|
+
export declare const isRebuyDebugMode: (key?: string) => boolean;
|
76
|
+
export {};
|
77
|
+
//# sourceMappingURL=debugLog.d.ts.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"debugLog.d.ts","sourceRoot":"","sources":["../../../src/smart-cart/utils/debugLog.ts"],"names":[],"mappings":"AAKA,OAAO,CAAC,MAAM,CAAC;IAEX,UAAU,MAAM;QACZ,gBAAgB,CAAC,EAAE,OAAO,GAAG,MAAM,GAAG,MAAM,EAAE,CAAC;KAClD;CACJ;AAMD,KAAK,aAAa,GAAG;IACjB,WAAW,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzB,YAAY,EAAE,OAAO,CAAC;CACzB,CAAC;AAqKF;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,aAAa;kBAtBT,MAAM,aAAa,OAAO,kBAAkB,GAAG,EAAE,KAAG,IAAI;iBApC1D,IAAI;iBAUF,MAAM,UAAU,MAAM,KAAG,IAAI;sBAA7B,MAAM,UAAU,MAAM,KAAG,IAAI;iBAtD7B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;eAA7B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;kBAA7B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;iBAA7B,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IAiH1C;;;;OAIG;uBAEc,aAAa;iBA7FjB,MAAM,kBAAkB,GAAG,WAAW,GAAG,EAAE,KAAG,IAAI;0BAAlD,MAAM,kBAAkB,GAAG,WAAW,GAAG,EAAE,KAAG,IAAI;oBAkBpD,IAAI;gBA5CF,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;IA+H1C;;;;;OAKG;uBAEc,OAAO;IAExB;;;;;;OAMG;uBACgB,MAAM,KAAG,OAAO;eA/ItB,MAAM,WAAW,GAAG,EAAE,KAAG,IAAI;iBAY7B,MAAM,QAAQ,GAAG,eAAe,SAAS,MAAM,EAAE,KAAG,IAAI;gBA0CxD,MAAM,UAAU,MAAM,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