yt-uikit 0.8.15 → 0.8.17-drawer-layout.0
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 +94 -94
- package/dist/esm/atoms/bundleBuilderProductDetailsAtom.d.ts +4 -4
- package/dist/esm/atoms/cartDataAtom.d.ts +3 -3
- package/dist/esm/atoms/cartLoadingAtom.d.ts +22 -22
- package/dist/esm/atoms/cartTimer.d.ts +2 -2
- package/dist/esm/atoms/couponSelectionOpenAtom.d.ts +3 -3
- package/dist/esm/atoms/dateAtom.d.ts +1 -1
- package/dist/esm/atoms/freebieClaimModalAtom.d.ts +7 -7
- package/dist/esm/atoms/giftWrap.d.ts +2 -2
- package/dist/esm/atoms/gstCompanyNameAtom.d.ts +1 -1
- package/dist/esm/atoms/gstInputAtom.d.ts +1 -1
- package/dist/esm/atoms/maxQtyErrorAtom.d.ts +3 -3
- package/dist/esm/atoms/multiClaimSelectionAtom.d.ts +19 -19
- package/dist/esm/atoms/noteInputAtom.d.ts +3 -3
- package/dist/esm/atoms/postalCodeAtom.d.ts +1 -1
- package/dist/esm/atoms/shippingAtom.d.ts +8 -8
- package/dist/esm/atoms/showGSTInputAtom.d.ts +1 -1
- package/dist/esm/atoms/variantSelectionModalAtom.d.ts +23 -23
- package/dist/esm/components/BundleBlock/Bundle.d.ts +395 -395
- package/dist/esm/components/BundleBlock/BundleBuilder/BundleBuilder.d.ts +40 -40
- package/dist/esm/components/BundleBlock/BundleBuilder/ResponsiveBgImage.d.ts +9 -9
- package/dist/esm/components/BundleBlock/BundleBuilder/VariantOptionsModal.d.ts +15 -15
- package/dist/esm/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +35 -37
- package/dist/esm/components/BundleBlock/BundleBuilderTracker/BundleBuilderTracker.d.ts +51 -51
- package/dist/esm/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +75 -77
- package/dist/esm/components/BundleBlock/BundleProductDetailsModal/BundleProductDetailsModal.d.ts +26 -26
- package/dist/esm/components/BundleBlock/BundleProductDetailsModal/bundleProductDetailsModal.style.d.ts +10 -10
- package/dist/esm/components/BundleBlock/CollectionBundle/ColllectionBundle.d.ts +116 -116
- package/dist/esm/components/BundleBlock/CollectionBundle/FileUpload.d.ts +15 -15
- package/dist/esm/components/BundleBlock/CollectionBundle/LoadingSpinner.d.ts +2 -2
- package/dist/esm/components/BundleBlock/CollectionBundle/ProductDetailsModal.d.ts +15 -15
- package/dist/esm/components/BundleBlock/ComboBundle.d.ts +16 -16
- package/dist/esm/components/BundleBlock/FixedBundle/FixedBundle.d.ts +4 -4
- package/dist/esm/components/BundleBlock/FixedBundle/SeparateVariantOptions.d.ts +39 -39
- package/dist/esm/components/BundleBlock/FixedBundle/VariantSelectorModal.d.ts +22 -22
- package/dist/esm/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +84 -90
- package/dist/esm/components/BundleBlock/Loader.d.ts +5 -5
- package/dist/esm/components/BundleBlock/MixAndMatchBundle/MixAndMatchBundle.d.ts +8 -8
- package/dist/esm/components/BundleBlock/MixAndMatchBundle/mixAndMatchBundle.style.d.ts +86 -86
- package/dist/esm/components/BundleBlock/VolumeBundle/VolumeBundle.d.ts +3 -3
- package/dist/esm/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +78 -80
- package/dist/esm/components/BundleBlock/index.d.ts +1 -1
- package/dist/esm/components/Cart/ApplyCoupon.d.ts +12 -12
- package/dist/esm/components/Cart/Bundle.d.ts +6 -6
- package/dist/esm/components/Cart/Cart.d.ts +220 -237
- package/dist/esm/components/Cart/CartDrawer.d.ts +30 -21
- package/dist/esm/components/Cart/CartOffersCarousel.d.ts +45 -45
- package/dist/esm/components/Cart/CartProductsList.d.ts +44 -45
- package/dist/esm/components/Cart/CartTimer.d.ts +8 -8
- package/dist/esm/components/Cart/CheckoutSection.d.ts +38 -38
- package/dist/esm/components/Cart/CouponSelection.d.ts +25 -25
- package/dist/esm/components/Cart/DatePicker.d.ts +10 -10
- package/dist/esm/components/Cart/EmptyCart.d.ts +33 -33
- package/dist/esm/components/Cart/FloatingCart.d.ts +23 -23
- package/dist/esm/components/Cart/FooterSections.d.ts +6 -6
- package/dist/esm/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
- package/dist/esm/components/Cart/FreebieClaimManager.d.ts +17 -17
- package/dist/esm/components/Cart/FreebieClaimOverlay.d.ts +17 -17
- package/dist/esm/components/Cart/FreebieClaimOverlayCard.d.ts +9 -9
- package/dist/esm/components/Cart/FreebieClaimSection.d.ts +17 -17
- package/dist/esm/components/Cart/FreebieClaimSectionCard.d.ts +16 -16
- package/dist/esm/components/Cart/GSTSection.d.ts +15 -15
- package/dist/esm/components/Cart/GiftWrap.d.ts +14 -14
- package/dist/esm/components/Cart/GuestDiscountCoupon.d.ts +9 -9
- package/dist/esm/components/Cart/InlineCartOfferInfoText.d.ts +10 -10
- package/dist/esm/components/Cart/LoyaltyAppliedCTA.d.ts +19 -19
- package/dist/esm/components/Cart/LoyaltyApplyCTA.d.ts +18 -18
- package/dist/esm/components/Cart/LoyaltyBadge.d.ts +10 -10
- package/dist/esm/components/Cart/LoyaltyGuestCTA.d.ts +17 -17
- package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointConfetti.d.ts +11 -11
- package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointIcon.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/CheckpointTooltip.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepIcon.d.ts +9 -9
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepProgressBar.d.ts +5 -5
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepProgressBar.styled.d.ts +45 -45
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiStepUtils.d.ts +6 -6
- package/dist/esm/components/Cart/MultiStepProgressBar/MultiTierProgressBar.d.ts +4 -4
- package/dist/esm/components/Cart/MultiStepProgressBar/MutiTierNextRewardMessage.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/NextRewardMessage.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/SingleTierProgressBar.d.ts +4 -4
- package/dist/esm/components/Cart/MultiStepProgressBar/SingleTierProgressBar.styled.d.ts +22 -22
- package/dist/esm/components/Cart/MultiStepProgressBar/SingletTierNextRewardMessage.d.ts +3 -3
- package/dist/esm/components/Cart/MultiStepProgressBar/types.d.ts +55 -55
- package/dist/esm/components/Cart/NextFreebieRow.d.ts +19 -19
- package/dist/esm/components/Cart/NoteSection.d.ts +8 -8
- package/dist/esm/components/Cart/ProductCard.d.ts +29 -30
- package/dist/esm/components/Cart/ProductRecCard.d.ts +20 -20
- package/dist/esm/components/Cart/ProductRecList.d.ts +23 -23
- package/dist/esm/components/Cart/ProgressBar.d.ts +13 -13
- package/dist/esm/components/Cart/ProgressBarCartLoader.d.ts +7 -7
- package/dist/esm/components/Cart/QuantitySelector.d.ts +12 -12
- package/dist/esm/components/Cart/RegionSpecificDelivery.d.ts +17 -17
- package/dist/esm/components/Cart/RewardPointsPreview.d.ts +10 -10
- package/dist/esm/components/Cart/StandardDelivery.d.ts +11 -11
- package/dist/esm/components/Cart/StickyCart.d.ts +52 -52
- package/dist/esm/components/Cart/VariantSelectionPopup/DesktopVariantPopup.d.ts +18 -18
- package/dist/esm/components/Cart/VariantSelectionPopup/DesktopVariantPopup.styled.d.ts +60 -60
- package/dist/esm/components/Cart/VariantSelectionPopup/MobileVariantPopover.d.ts +18 -18
- package/dist/esm/components/Cart/index.d.ts +1 -1
- package/dist/esm/components/CouponFrame/CouponFrame.d.ts +15 -15
- package/dist/esm/components/CouponFrame/index.d.ts +1 -1
- package/dist/esm/components/Nudge/LeadGenerationNudge.d.ts +15 -15
- package/dist/esm/components/Nudge/Nudge.d.ts +40 -40
- package/dist/esm/components/Nudge/index.d.ts +1 -1
- package/dist/esm/components/ProductOffersBlock/ProductOffersCoupon.d.ts +12 -12
- package/dist/esm/components/ProductOffersBlock/ProductOffersList.d.ts +12 -12
- package/dist/esm/components/ProductOffersBlock/ProductOffersTermsMobilePopover.d.ts +10 -10
- package/dist/esm/components/ProductOffersBlock/ProductOffersTermsPopup.d.ts +10 -10
- package/dist/esm/components/ProductOffersBlock/ProductsOffers.d.ts +32 -32
- package/dist/esm/components/SpinnerWheel/SpinnerWheel.d.ts +23 -23
- package/dist/esm/components/SpinnerWheel/WheelSection.d.ts +9 -9
- package/dist/esm/components/SpinnerWheel/index.d.ts +1 -1
- package/dist/esm/components/index.d.ts +6 -7
- package/dist/esm/index.d.ts +1 -1
- package/dist/esm/index.js +452 -452
- package/dist/esm/types/atoms/bundleBuilderProductDetailsAtom.d.ts +4 -4
- package/dist/esm/types/atoms/cartDataAtom.d.ts +3 -3
- package/dist/esm/types/atoms/cartLoadingAtom.d.ts +22 -22
- package/dist/esm/types/atoms/cartTimer.d.ts +2 -2
- package/dist/esm/types/atoms/couponSelectionOpenAtom.d.ts +3 -3
- package/dist/esm/types/atoms/dateAtom.d.ts +1 -1
- package/dist/esm/types/atoms/freebieClaimModalAtom.d.ts +7 -7
- package/dist/esm/types/atoms/giftWrap.d.ts +2 -2
- package/dist/esm/types/atoms/gstCompanyNameAtom.d.ts +1 -1
- package/dist/esm/types/atoms/gstInputAtom.d.ts +1 -1
- package/dist/esm/types/atoms/maxQtyErrorAtom.d.ts +3 -3
- package/dist/esm/types/atoms/multiClaimSelectionAtom.d.ts +19 -19
- package/dist/esm/types/atoms/noteInputAtom.d.ts +3 -3
- package/dist/esm/types/atoms/postalCodeAtom.d.ts +1 -1
- package/dist/esm/types/atoms/shippingAtom.d.ts +8 -8
- package/dist/esm/types/atoms/showGSTInputAtom.d.ts +1 -1
- package/dist/esm/types/atoms/variantSelectionModalAtom.d.ts +23 -23
- package/dist/esm/types/components/BundleBlock/Bundle.d.ts +395 -395
- package/dist/esm/types/components/BundleBlock/BundleBuilder/BundleBuilder.d.ts +40 -40
- package/dist/esm/types/components/BundleBlock/BundleBuilder/ResponsiveBgImage.d.ts +9 -9
- package/dist/esm/types/components/BundleBlock/BundleBuilder/VariantOptionsModal.d.ts +15 -15
- package/dist/esm/types/components/BundleBlock/BundleBuilder/bundleBuilder.style.d.ts +35 -37
- package/dist/esm/types/components/BundleBlock/BundleBuilderTracker/BundleBuilderTracker.d.ts +51 -51
- package/dist/esm/types/components/BundleBlock/BundleBuilderTracker/bundleBuilderTracker.style.d.ts +75 -77
- package/dist/esm/types/components/BundleBlock/BundleProductDetailsModal/BundleProductDetailsModal.d.ts +26 -26
- package/dist/esm/types/components/BundleBlock/BundleProductDetailsModal/bundleProductDetailsModal.style.d.ts +10 -10
- package/dist/esm/types/components/BundleBlock/CollectionBundle/ColllectionBundle.d.ts +116 -116
- package/dist/esm/types/components/BundleBlock/CollectionBundle/FileUpload.d.ts +15 -15
- package/dist/esm/types/components/BundleBlock/CollectionBundle/LoadingSpinner.d.ts +2 -2
- package/dist/esm/types/components/BundleBlock/CollectionBundle/ProductDetailsModal.d.ts +15 -15
- package/dist/esm/types/components/BundleBlock/ComboBundle.d.ts +16 -16
- package/dist/esm/types/components/BundleBlock/FixedBundle/FixedBundle.d.ts +4 -4
- package/dist/esm/types/components/BundleBlock/FixedBundle/SeparateVariantOptions.d.ts +39 -39
- package/dist/esm/types/components/BundleBlock/FixedBundle/VariantSelectorModal.d.ts +22 -22
- package/dist/esm/types/components/BundleBlock/FixedBundle/fixedBundle.style.d.ts +84 -90
- package/dist/esm/types/components/BundleBlock/Loader.d.ts +5 -5
- package/dist/esm/types/components/BundleBlock/MixAndMatchBundle/MixAndMatchBundle.d.ts +8 -8
- package/dist/esm/types/components/BundleBlock/MixAndMatchBundle/mixAndMatchBundle.style.d.ts +86 -86
- package/dist/esm/types/components/BundleBlock/VolumeBundle/VolumeBundle.d.ts +3 -3
- package/dist/esm/types/components/BundleBlock/VolumeBundle/volumeBundle.style.d.ts +78 -80
- package/dist/esm/types/components/BundleBlock/index.d.ts +1 -1
- package/dist/esm/types/components/Cart/ApplyCoupon.d.ts +12 -12
- package/dist/esm/types/components/Cart/Bundle.d.ts +6 -6
- package/dist/esm/types/components/Cart/Cart.d.ts +220 -237
- package/dist/esm/types/components/Cart/CartDrawer.d.ts +30 -21
- package/dist/esm/types/components/Cart/CartOffersCarousel.d.ts +45 -45
- package/dist/esm/types/components/Cart/CartProductsList.d.ts +44 -45
- package/dist/esm/types/components/Cart/CartTimer.d.ts +8 -8
- package/dist/esm/types/components/Cart/CheckoutSection.d.ts +38 -38
- package/dist/esm/types/components/Cart/CouponSelection.d.ts +25 -25
- package/dist/esm/types/components/Cart/DatePicker.d.ts +10 -10
- package/dist/esm/types/components/Cart/EmptyCart.d.ts +33 -33
- package/dist/esm/types/components/Cart/FloatingCart.d.ts +23 -23
- package/dist/esm/types/components/Cart/FooterSections.d.ts +6 -6
- package/dist/esm/types/components/Cart/FreebieClaimErrorBoundary.d.ts +28 -0
- package/dist/esm/types/components/Cart/FreebieClaimManager.d.ts +17 -17
- package/dist/esm/types/components/Cart/FreebieClaimOverlay.d.ts +17 -17
- package/dist/esm/types/components/Cart/FreebieClaimOverlayCard.d.ts +9 -9
- package/dist/esm/types/components/Cart/FreebieClaimSection.d.ts +17 -17
- package/dist/esm/types/components/Cart/FreebieClaimSectionCard.d.ts +16 -16
- package/dist/esm/types/components/Cart/GSTSection.d.ts +15 -15
- package/dist/esm/types/components/Cart/GiftWrap.d.ts +14 -14
- package/dist/esm/types/components/Cart/GuestDiscountCoupon.d.ts +9 -9
- package/dist/esm/types/components/Cart/InlineCartOfferInfoText.d.ts +10 -10
- package/dist/esm/types/components/Cart/LoyaltyAppliedCTA.d.ts +19 -19
- package/dist/esm/types/components/Cart/LoyaltyApplyCTA.d.ts +18 -18
- package/dist/esm/types/components/Cart/LoyaltyBadge.d.ts +10 -10
- package/dist/esm/types/components/Cart/LoyaltyGuestCTA.d.ts +17 -17
- package/dist/esm/types/components/Cart/MultiStepProgressBar/CheckpointConfetti.d.ts +11 -11
- package/dist/esm/types/components/Cart/MultiStepProgressBar/CheckpointIcon.d.ts +3 -3
- package/dist/esm/types/components/Cart/MultiStepProgressBar/CheckpointTooltip.d.ts +3 -3
- package/dist/esm/types/components/Cart/MultiStepProgressBar/MultiStepIcon.d.ts +9 -9
- package/dist/esm/types/components/Cart/MultiStepProgressBar/MultiStepProgressBar.d.ts +5 -5
- package/dist/esm/types/components/Cart/MultiStepProgressBar/MultiStepProgressBar.styled.d.ts +45 -45
- package/dist/esm/types/components/Cart/MultiStepProgressBar/MultiStepUtils.d.ts +6 -6
- package/dist/esm/types/components/Cart/MultiStepProgressBar/MultiTierProgressBar.d.ts +4 -4
- package/dist/esm/types/components/Cart/MultiStepProgressBar/MutiTierNextRewardMessage.d.ts +3 -3
- package/dist/esm/types/components/Cart/MultiStepProgressBar/NextRewardMessage.d.ts +3 -3
- package/dist/esm/types/components/Cart/MultiStepProgressBar/SingleTierProgressBar.d.ts +4 -4
- package/dist/esm/types/components/Cart/MultiStepProgressBar/SingleTierProgressBar.styled.d.ts +22 -22
- package/dist/esm/types/components/Cart/MultiStepProgressBar/SingletTierNextRewardMessage.d.ts +3 -3
- package/dist/esm/types/components/Cart/MultiStepProgressBar/types.d.ts +55 -55
- package/dist/esm/types/components/Cart/NextFreebieRow.d.ts +19 -19
- package/dist/esm/types/components/Cart/NoteSection.d.ts +8 -8
- package/dist/esm/types/components/Cart/ProductCard.d.ts +29 -30
- package/dist/esm/types/components/Cart/ProductRecCard.d.ts +20 -20
- package/dist/esm/types/components/Cart/ProductRecList.d.ts +23 -23
- package/dist/esm/types/components/Cart/ProgressBar.d.ts +13 -13
- package/dist/esm/types/components/Cart/ProgressBarCartLoader.d.ts +7 -7
- package/dist/esm/types/components/Cart/QuantitySelector.d.ts +12 -12
- package/dist/esm/types/components/Cart/RegionSpecificDelivery.d.ts +17 -17
- package/dist/esm/types/components/Cart/RewardPointsPreview.d.ts +10 -10
- package/dist/esm/types/components/Cart/StandardDelivery.d.ts +11 -11
- package/dist/esm/types/components/Cart/StickyCart.d.ts +52 -52
- package/dist/esm/types/components/Cart/VariantSelectionPopup/DesktopVariantPopup.d.ts +18 -18
- package/dist/esm/types/components/Cart/VariantSelectionPopup/DesktopVariantPopup.styled.d.ts +60 -60
- package/dist/esm/types/components/Cart/VariantSelectionPopup/MobileVariantPopover.d.ts +18 -18
- package/dist/esm/types/components/Cart/index.d.ts +1 -1
- package/dist/esm/types/components/CouponFrame/CouponFrame.d.ts +15 -15
- package/dist/esm/types/components/CouponFrame/index.d.ts +1 -1
- package/dist/esm/types/components/Nudge/LeadGenerationNudge.d.ts +15 -15
- package/dist/esm/types/components/Nudge/Nudge.d.ts +40 -40
- package/dist/esm/types/components/Nudge/index.d.ts +1 -1
- package/dist/esm/types/components/ProductOffersBlock/ProductOffersCoupon.d.ts +12 -12
- package/dist/esm/types/components/ProductOffersBlock/ProductOffersList.d.ts +12 -12
- package/dist/esm/types/components/ProductOffersBlock/ProductOffersTermsMobilePopover.d.ts +10 -10
- package/dist/esm/types/components/ProductOffersBlock/ProductOffersTermsPopup.d.ts +10 -10
- package/dist/esm/types/components/ProductOffersBlock/ProductsOffers.d.ts +32 -32
- package/dist/esm/types/components/SpinnerWheel/SpinnerWheel.d.ts +23 -23
- package/dist/esm/types/components/SpinnerWheel/WheelSection.d.ts +9 -9
- package/dist/esm/types/components/SpinnerWheel/index.d.ts +1 -1
- package/dist/esm/types/components/index.d.ts +6 -7
- package/dist/esm/types/index.d.ts +1 -1
- package/dist/esm/types/utils/converter.d.ts +2 -2
- package/dist/esm/types/utils/customVariantOptions.d.ts +20 -20
- package/dist/esm/types/utils/freebieErrorLogger.d.ts +68 -0
- package/dist/esm/types/utils/freebieProductUtils.d.ts +23 -23
- package/dist/esm/types/utils/freebieUtils.d.ts +5 -5
- package/dist/esm/types/utils/freebieValidation.d.ts +45 -0
- package/dist/esm/types/utils/index.d.ts +14 -14
- package/dist/esm/utils/converter.d.ts +2 -2
- package/dist/esm/utils/customVariantOptions.d.ts +20 -20
- package/dist/esm/utils/freebieErrorLogger.d.ts +68 -0
- package/dist/esm/utils/freebieProductUtils.d.ts +23 -23
- package/dist/esm/utils/freebieUtils.d.ts +5 -5
- package/dist/esm/utils/freebieValidation.d.ts +45 -0
- package/dist/esm/utils/index.d.ts +14 -14
- package/dist/index.d.ts +731 -752
- package/package.json +95 -95
- package/src/assets/Frame.svg +4 -4
- package/src/assets/bundlePlus.svg +4 -4
- package/src/assets/copy-icon.svg +3 -3
- package/src/assets/copy-iconBlack.svg +4 -4
- package/src/assets/coupon.svg +4 -4
- package/src/assets/delivery.svg +5 -5
- package/dist/esm/components/LoyaltyPageBlock/LoyaltyPageBlock.d.ts +0 -63
- package/dist/esm/types/components/LoyaltyPageBlock/LoyaltyPageBlock.d.ts +0 -63
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for Freebie Claim components
|
|
3
|
+
* Validates product data, configuration, and required props
|
|
4
|
+
*/
|
|
5
|
+
export interface ValidationResult {
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
errors: string[];
|
|
8
|
+
warnings: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Validate that required props are present
|
|
12
|
+
*/
|
|
13
|
+
export declare const validateRequiredProps: (component: string, props: {
|
|
14
|
+
freebieProductsInCart?: any[];
|
|
15
|
+
addFreebieToCart?: Function;
|
|
16
|
+
freebiesInCart?: string[];
|
|
17
|
+
}) => ValidationResult;
|
|
18
|
+
/**
|
|
19
|
+
* Validate product data structure
|
|
20
|
+
*/
|
|
21
|
+
export declare const validateProductData: (component: string, product: any, index?: number) => ValidationResult;
|
|
22
|
+
/**
|
|
23
|
+
* Validate all products in cart
|
|
24
|
+
*/
|
|
25
|
+
export declare const validateAllProducts: (component: string, products: any[]) => ValidationResult;
|
|
26
|
+
/**
|
|
27
|
+
* Validate variant data
|
|
28
|
+
*/
|
|
29
|
+
export declare const validateVariantData: (component: string, variant: any, productId?: string) => ValidationResult;
|
|
30
|
+
/**
|
|
31
|
+
* Validate checkpoint data
|
|
32
|
+
*/
|
|
33
|
+
export declare const validateCheckpoint: (component: string, checkpoint: any) => ValidationResult;
|
|
34
|
+
/**
|
|
35
|
+
* Validate freebie claim configuration
|
|
36
|
+
*/
|
|
37
|
+
export declare const validateFreebieClaimData: (component: string, freebieClaimData: any) => ValidationResult;
|
|
38
|
+
/**
|
|
39
|
+
* Validate that products match inventory requirements
|
|
40
|
+
*/
|
|
41
|
+
export declare const validateInventoryQuantity: (component: string, product: any, shouldCheckInventoryQuantity: boolean) => ValidationResult;
|
|
42
|
+
/**
|
|
43
|
+
* Log validation summary
|
|
44
|
+
*/
|
|
45
|
+
export declare const logValidationSummary: (component: string, validationResults: ValidationResult[]) => void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const getAdjustedTitle: (title: string, length?: number) => string;
|
|
2
|
-
export declare const getAdjustedTitleByCanvas: (title: string, maxWidthPercentage: number, containerWidth: number, fontFamily?: string, fontSize?: string) => string;
|
|
3
|
-
export declare function getColorWithAlpha(colorHex: string, alpha: number): string;
|
|
4
|
-
export declare function hexToRGBWithOpacity(hex: any, opacity: any): string;
|
|
5
|
-
export declare const getIdFromGid: (gid: string) => string | undefined;
|
|
6
|
-
export declare function getCookieValue(cookieName: string): string;
|
|
7
|
-
export declare const extractShopifyProductOrVariantId: (id: string) => string;
|
|
8
|
-
export declare function setContrastTextColor(element: HTMLElement | null, lightColor?: string, darkColor?: string, threshold?: number): void;
|
|
9
|
-
export declare const formatPriceWithCommas: (price: number | string) => string;
|
|
10
|
-
export declare const shouldRenderCheckoutMessageInCartList: () => boolean;
|
|
11
|
-
export declare const shouldUseBWTheme: () => boolean;
|
|
12
|
-
export declare const optimizeShopifyImage: (imageUrl: string | undefined | null, size?: number, quality?: number, format?: "webp" | "auto" | "jpg" | "png") => string;
|
|
13
|
-
export declare const darkenColor: (color: string | undefined, amount?: number) => string;
|
|
14
|
-
export declare const extractBundleDiscountTitle: (discountTitle: string) => string;
|
|
1
|
+
export declare const getAdjustedTitle: (title: string, length?: number) => string;
|
|
2
|
+
export declare const getAdjustedTitleByCanvas: (title: string, maxWidthPercentage: number, containerWidth: number, fontFamily?: string, fontSize?: string) => string;
|
|
3
|
+
export declare function getColorWithAlpha(colorHex: string, alpha: number): string;
|
|
4
|
+
export declare function hexToRGBWithOpacity(hex: any, opacity: any): string;
|
|
5
|
+
export declare const getIdFromGid: (gid: string) => string | undefined;
|
|
6
|
+
export declare function getCookieValue(cookieName: string): string;
|
|
7
|
+
export declare const extractShopifyProductOrVariantId: (id: string) => string;
|
|
8
|
+
export declare function setContrastTextColor(element: HTMLElement | null, lightColor?: string, darkColor?: string, threshold?: number): void;
|
|
9
|
+
export declare const formatPriceWithCommas: (price: number | string) => string;
|
|
10
|
+
export declare const shouldRenderCheckoutMessageInCartList: () => boolean;
|
|
11
|
+
export declare const shouldUseBWTheme: () => boolean;
|
|
12
|
+
export declare const optimizeShopifyImage: (imageUrl: string | undefined | null, size?: number, quality?: number, format?: "webp" | "auto" | "jpg" | "png") => string;
|
|
13
|
+
export declare const darkenColor: (color: string | undefined, amount?: number) => string;
|
|
14
|
+
export declare const extractBundleDiscountTitle: (discountTitle: string) => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const getCurrencyValueFromShopifyPrice: (price: number, currency: string) => number;
|
|
2
|
-
export declare const getCurrencySymbol: (cartData: any, currency?: string) => string;
|
|
1
|
+
export declare const getCurrencyValueFromShopifyPrice: (price: number, currency: string) => number;
|
|
2
|
+
export declare const getCurrencySymbol: (cartData: any, currency?: string) => string;
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
export interface CustomVariantValue {
|
|
2
|
-
name: string;
|
|
3
|
-
value: string;
|
|
4
|
-
}
|
|
5
|
-
export interface CustomVariantOption {
|
|
6
|
-
id?: string;
|
|
7
|
-
name: string;
|
|
8
|
-
type?: "text" | "image" | "color" | string;
|
|
9
|
-
values: CustomVariantValue[];
|
|
10
|
-
}
|
|
11
|
-
export interface CustomVariantOptions {
|
|
12
|
-
options: CustomVariantOption[];
|
|
13
|
-
}
|
|
14
|
-
export declare const normalizeVariantLabel: (label?: string) => string;
|
|
15
|
-
export declare const extractHexFromLabel: (label?: string) => string | null;
|
|
16
|
-
export declare const loadCustomVariantOptions: () => CustomVariantOptions | null;
|
|
17
|
-
export declare const saveCustomVariantOptions: (input: CustomVariantOptions | CustomVariantOption[]) => void;
|
|
18
|
-
export declare const clearCustomVariantOptions: () => void;
|
|
19
|
-
export declare const findMatchingCustomVariantValue: (customOption: CustomVariantOption | undefined, optionValue?: string) => CustomVariantValue | undefined;
|
|
20
|
-
export declare const useCustomVariantOptions: () => CustomVariantOptions | null;
|
|
1
|
+
export interface CustomVariantValue {
|
|
2
|
+
name: string;
|
|
3
|
+
value: string;
|
|
4
|
+
}
|
|
5
|
+
export interface CustomVariantOption {
|
|
6
|
+
id?: string;
|
|
7
|
+
name: string;
|
|
8
|
+
type?: "text" | "image" | "color" | string;
|
|
9
|
+
values: CustomVariantValue[];
|
|
10
|
+
}
|
|
11
|
+
export interface CustomVariantOptions {
|
|
12
|
+
options: CustomVariantOption[];
|
|
13
|
+
}
|
|
14
|
+
export declare const normalizeVariantLabel: (label?: string) => string;
|
|
15
|
+
export declare const extractHexFromLabel: (label?: string) => string | null;
|
|
16
|
+
export declare const loadCustomVariantOptions: () => CustomVariantOptions | null;
|
|
17
|
+
export declare const saveCustomVariantOptions: (input: CustomVariantOptions | CustomVariantOption[]) => void;
|
|
18
|
+
export declare const clearCustomVariantOptions: () => void;
|
|
19
|
+
export declare const findMatchingCustomVariantValue: (customOption: CustomVariantOption | undefined, optionValue?: string) => CustomVariantValue | undefined;
|
|
20
|
+
export declare const useCustomVariantOptions: () => CustomVariantOptions | null;
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Centralized error logging utility for Freebie Claim components
|
|
3
|
+
* Provides detailed error logging with context to help debug issues across stores
|
|
4
|
+
*/
|
|
5
|
+
export declare enum FreebieErrorSeverity {
|
|
6
|
+
WARNING = "WARNING",
|
|
7
|
+
ERROR = "ERROR",
|
|
8
|
+
CRITICAL = "CRITICAL"
|
|
9
|
+
}
|
|
10
|
+
export interface FreebieErrorContext {
|
|
11
|
+
component?: string;
|
|
12
|
+
productId?: string;
|
|
13
|
+
productTitle?: string;
|
|
14
|
+
variantId?: string;
|
|
15
|
+
checkpointId?: number;
|
|
16
|
+
storeData?: any;
|
|
17
|
+
additionalData?: any;
|
|
18
|
+
}
|
|
19
|
+
export interface FreebieError {
|
|
20
|
+
severity: FreebieErrorSeverity;
|
|
21
|
+
message: string;
|
|
22
|
+
context: FreebieErrorContext;
|
|
23
|
+
timestamp: string;
|
|
24
|
+
}
|
|
25
|
+
declare class FreebieErrorLogger {
|
|
26
|
+
private errors;
|
|
27
|
+
private maxErrors;
|
|
28
|
+
/**
|
|
29
|
+
* Log an error with context
|
|
30
|
+
*/
|
|
31
|
+
log(severity: FreebieErrorSeverity, message: string, context?: FreebieErrorContext): void;
|
|
32
|
+
/**
|
|
33
|
+
* Log a warning
|
|
34
|
+
*/
|
|
35
|
+
warn(message: string, context?: FreebieErrorContext): void;
|
|
36
|
+
/**
|
|
37
|
+
* Log an error
|
|
38
|
+
*/
|
|
39
|
+
error(message: string, context?: FreebieErrorContext): void;
|
|
40
|
+
/**
|
|
41
|
+
* Log a critical error
|
|
42
|
+
*/
|
|
43
|
+
critical(message: string, context?: FreebieErrorContext): void;
|
|
44
|
+
/**
|
|
45
|
+
* Get all logged errors
|
|
46
|
+
*/
|
|
47
|
+
getErrors(): FreebieError[];
|
|
48
|
+
/**
|
|
49
|
+
* Get errors by severity
|
|
50
|
+
*/
|
|
51
|
+
getErrorsBySeverity(severity: FreebieErrorSeverity): FreebieError[];
|
|
52
|
+
/**
|
|
53
|
+
* Clear all errors
|
|
54
|
+
*/
|
|
55
|
+
clearErrors(): void;
|
|
56
|
+
/**
|
|
57
|
+
* Export errors as JSON for debugging
|
|
58
|
+
*/
|
|
59
|
+
exportErrors(): string;
|
|
60
|
+
}
|
|
61
|
+
export declare const freebieErrorLogger: FreebieErrorLogger;
|
|
62
|
+
export declare const logMissingProp: (component: string, propName: string, additionalContext?: any) => void;
|
|
63
|
+
export declare const logInvalidData: (component: string, dataType: string, issue: string, data?: any) => void;
|
|
64
|
+
export declare const logProductError: (component: string, message: string, productId?: string, productTitle?: string, additionalData?: any) => void;
|
|
65
|
+
export declare const logVariantError: (component: string, message: string, productId?: string, variantId?: string, additionalData?: any) => void;
|
|
66
|
+
export declare const logCheckpointError: (component: string, message: string, checkpointId?: number, additionalData?: any) => void;
|
|
67
|
+
export declare const logWarning: (component: string, message: string, context?: FreebieErrorContext) => void;
|
|
68
|
+
export {};
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
export declare const isVariantAvailable: (product: any, variantNode: any) => boolean;
|
|
2
|
-
export interface ProcessedFreebieProduct {
|
|
3
|
-
selectedVariantId?: string;
|
|
4
|
-
selectedVariantGid?: string;
|
|
5
|
-
selectedVariantPrice: number;
|
|
6
|
-
availableVariants: any[];
|
|
7
|
-
displayVariantCount: number;
|
|
8
|
-
effectiveDiscount: number;
|
|
9
|
-
effectivePrice: number;
|
|
10
|
-
dealAmount: number;
|
|
11
|
-
showOptions: boolean;
|
|
12
|
-
isFree: boolean;
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Process freebie product data to extract pricing, variant, and display information
|
|
16
|
-
* Consolidates expensive calculations that were happening in multiple components
|
|
17
|
-
*/
|
|
18
|
-
export declare const processFreebieProduct: (product: any, freebieCouponTemplates?: any[], localVariantId?: string) => ProcessedFreebieProduct;
|
|
19
|
-
/**
|
|
20
|
-
* Get initial variant ID with deal amount preference
|
|
21
|
-
* Used by FreebieClaimSectionCard for smart variant selection
|
|
22
|
-
*/
|
|
23
|
-
export declare const getInitialVariantWithDealAmount: (availableVariants: any[], freebieCouponTemplates?: any[]) => string | undefined;
|
|
1
|
+
export declare const isVariantAvailable: (product: any, variantNode: any) => boolean;
|
|
2
|
+
export interface ProcessedFreebieProduct {
|
|
3
|
+
selectedVariantId?: string;
|
|
4
|
+
selectedVariantGid?: string;
|
|
5
|
+
selectedVariantPrice: number;
|
|
6
|
+
availableVariants: any[];
|
|
7
|
+
displayVariantCount: number;
|
|
8
|
+
effectiveDiscount: number;
|
|
9
|
+
effectivePrice: number;
|
|
10
|
+
dealAmount: number;
|
|
11
|
+
showOptions: boolean;
|
|
12
|
+
isFree: boolean;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Process freebie product data to extract pricing, variant, and display information
|
|
16
|
+
* Consolidates expensive calculations that were happening in multiple components
|
|
17
|
+
*/
|
|
18
|
+
export declare const processFreebieProduct: (product: any, freebieCouponTemplates?: any[], localVariantId?: string) => ProcessedFreebieProduct;
|
|
19
|
+
/**
|
|
20
|
+
* Get initial variant ID with deal amount preference
|
|
21
|
+
* Used by FreebieClaimSectionCard for smart variant selection
|
|
22
|
+
*/
|
|
23
|
+
export declare const getInitialVariantWithDealAmount: (availableVariants: any[], freebieCouponTemplates?: any[]) => string | undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared utility function for adding freebie products to cart
|
|
3
|
-
* Used by both FreebieClaimManager and FreebieClaimSection to avoid code duplication
|
|
4
|
-
*/
|
|
5
|
-
export declare const addFreebieProductsToCart: (selectedProductIds: string[], freebieProductsInCart: any[], addFreebieToCart?: ((variantId: string, originalAllowedVariantIds?: string[]) => Promise<void>) | undefined) => Promise<void>;
|
|
1
|
+
/**
|
|
2
|
+
* Shared utility function for adding freebie products to cart
|
|
3
|
+
* Used by both FreebieClaimManager and FreebieClaimSection to avoid code duplication
|
|
4
|
+
*/
|
|
5
|
+
export declare const addFreebieProductsToCart: (selectedProductIds: string[], freebieProductsInCart: any[], addFreebieToCart?: ((variantId: string, originalAllowedVariantIds?: string[]) => Promise<void>) | undefined) => Promise<void>;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Validation utilities for Freebie Claim components
|
|
3
|
+
* Validates product data, configuration, and required props
|
|
4
|
+
*/
|
|
5
|
+
export interface ValidationResult {
|
|
6
|
+
isValid: boolean;
|
|
7
|
+
errors: string[];
|
|
8
|
+
warnings: string[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Validate that required props are present
|
|
12
|
+
*/
|
|
13
|
+
export declare const validateRequiredProps: (component: string, props: {
|
|
14
|
+
freebieProductsInCart?: any[];
|
|
15
|
+
addFreebieToCart?: Function;
|
|
16
|
+
freebiesInCart?: string[];
|
|
17
|
+
}) => ValidationResult;
|
|
18
|
+
/**
|
|
19
|
+
* Validate product data structure
|
|
20
|
+
*/
|
|
21
|
+
export declare const validateProductData: (component: string, product: any, index?: number) => ValidationResult;
|
|
22
|
+
/**
|
|
23
|
+
* Validate all products in cart
|
|
24
|
+
*/
|
|
25
|
+
export declare const validateAllProducts: (component: string, products: any[]) => ValidationResult;
|
|
26
|
+
/**
|
|
27
|
+
* Validate variant data
|
|
28
|
+
*/
|
|
29
|
+
export declare const validateVariantData: (component: string, variant: any, productId?: string) => ValidationResult;
|
|
30
|
+
/**
|
|
31
|
+
* Validate checkpoint data
|
|
32
|
+
*/
|
|
33
|
+
export declare const validateCheckpoint: (component: string, checkpoint: any) => ValidationResult;
|
|
34
|
+
/**
|
|
35
|
+
* Validate freebie claim configuration
|
|
36
|
+
*/
|
|
37
|
+
export declare const validateFreebieClaimData: (component: string, freebieClaimData: any) => ValidationResult;
|
|
38
|
+
/**
|
|
39
|
+
* Validate that products match inventory requirements
|
|
40
|
+
*/
|
|
41
|
+
export declare const validateInventoryQuantity: (component: string, product: any, shouldCheckInventoryQuantity: boolean) => ValidationResult;
|
|
42
|
+
/**
|
|
43
|
+
* Log validation summary
|
|
44
|
+
*/
|
|
45
|
+
export declare const logValidationSummary: (component: string, validationResults: ValidationResult[]) => void;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
export declare const getAdjustedTitle: (title: string, length?: number) => string;
|
|
2
|
-
export declare const getAdjustedTitleByCanvas: (title: string, maxWidthPercentage: number, containerWidth: number, fontFamily?: string, fontSize?: string) => string;
|
|
3
|
-
export declare function getColorWithAlpha(colorHex: string, alpha: number): string;
|
|
4
|
-
export declare function hexToRGBWithOpacity(hex: any, opacity: any): string;
|
|
5
|
-
export declare const getIdFromGid: (gid: string) => string | undefined;
|
|
6
|
-
export declare function getCookieValue(cookieName: string): string;
|
|
7
|
-
export declare const extractShopifyProductOrVariantId: (id: string) => string;
|
|
8
|
-
export declare function setContrastTextColor(element: HTMLElement | null, lightColor?: string, darkColor?: string, threshold?: number): void;
|
|
9
|
-
export declare const formatPriceWithCommas: (price: number | string) => string;
|
|
10
|
-
export declare const shouldRenderCheckoutMessageInCartList: () => boolean;
|
|
11
|
-
export declare const shouldUseBWTheme: () => boolean;
|
|
12
|
-
export declare const optimizeShopifyImage: (imageUrl: string | undefined | null, size?: number, quality?: number, format?: "webp" | "auto" | "jpg" | "png") => string;
|
|
13
|
-
export declare const darkenColor: (color: string | undefined, amount?: number) => string;
|
|
14
|
-
export declare const extractBundleDiscountTitle: (discountTitle: string) => string;
|
|
1
|
+
export declare const getAdjustedTitle: (title: string, length?: number) => string;
|
|
2
|
+
export declare const getAdjustedTitleByCanvas: (title: string, maxWidthPercentage: number, containerWidth: number, fontFamily?: string, fontSize?: string) => string;
|
|
3
|
+
export declare function getColorWithAlpha(colorHex: string, alpha: number): string;
|
|
4
|
+
export declare function hexToRGBWithOpacity(hex: any, opacity: any): string;
|
|
5
|
+
export declare const getIdFromGid: (gid: string) => string | undefined;
|
|
6
|
+
export declare function getCookieValue(cookieName: string): string;
|
|
7
|
+
export declare const extractShopifyProductOrVariantId: (id: string) => string;
|
|
8
|
+
export declare function setContrastTextColor(element: HTMLElement | null, lightColor?: string, darkColor?: string, threshold?: number): void;
|
|
9
|
+
export declare const formatPriceWithCommas: (price: number | string) => string;
|
|
10
|
+
export declare const shouldRenderCheckoutMessageInCartList: () => boolean;
|
|
11
|
+
export declare const shouldUseBWTheme: () => boolean;
|
|
12
|
+
export declare const optimizeShopifyImage: (imageUrl: string | undefined | null, size?: number, quality?: number, format?: "webp" | "auto" | "jpg" | "png") => string;
|
|
13
|
+
export declare const darkenColor: (color: string | undefined, amount?: number) => string;
|
|
14
|
+
export declare const extractBundleDiscountTitle: (discountTitle: string) => string;
|