@anker-in/headless-ui 1.1.2 → 1.1.5
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/cjs/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/cjs/biz-components/AiuiProvider/index.d.ts +4 -0
- package/dist/cjs/biz-components/AiuiProvider/index.js +1 -1
- package/dist/cjs/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/cjs/biz-components/AplusDesc/index.d.ts +22 -0
- package/dist/cjs/biz-components/AplusDesc/index.js +2 -0
- package/dist/cjs/biz-components/AplusDesc/index.js.map +7 -0
- package/dist/cjs/biz-components/Category/SwiperCategory.js.map +2 -2
- package/dist/cjs/biz-components/Category/index.js +1 -1
- package/dist/cjs/biz-components/Category/index.js.map +2 -2
- package/dist/cjs/biz-components/CreativeModule/index.js +1 -1
- package/dist/cjs/biz-components/CreativeModule/index.js.map +2 -2
- package/dist/cjs/biz-components/DownLoad/index.d.ts +20 -0
- package/dist/cjs/biz-components/DownLoad/index.js +2 -0
- package/dist/cjs/biz-components/DownLoad/index.js.map +7 -0
- package/dist/cjs/biz-components/Evaluate/index.js +1 -1
- package/dist/cjs/biz-components/Evaluate/index.js.map +1 -1
- package/dist/cjs/biz-components/Faq/Faq.js +1 -1
- package/dist/cjs/biz-components/Faq/Faq.js.map +2 -2
- package/dist/cjs/biz-components/Features/index.js +1 -1
- package/dist/cjs/biz-components/Features/index.js.map +2 -2
- package/dist/cjs/biz-components/FootCharger/index.js +1 -1
- package/dist/cjs/biz-components/FootCharger/index.js.map +2 -2
- package/dist/cjs/biz-components/FooterNavigation/index.js +1 -1
- package/dist/cjs/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/GiftBox/index.d.ts +17 -0
- package/dist/cjs/biz-components/GiftBox/index.js +2 -0
- package/dist/cjs/biz-components/GiftBox/index.js.map +7 -0
- package/dist/cjs/biz-components/Graphic/index.js +1 -1
- package/dist/cjs/biz-components/Graphic/index.js.map +2 -2
- package/dist/cjs/biz-components/GraphicMore/index.js +1 -1
- package/dist/cjs/biz-components/GraphicMore/index.js.map +2 -2
- package/dist/cjs/biz-components/GraphicOverlay/GraphicOverlay.js.map +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/NavProvider.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/icons/Polygon.js.map +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/cjs/biz-components/HeaderNavigation/withCategory.js.map +2 -2
- package/dist/cjs/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/cjs/biz-components/HeroBanner/Countdown.js.map +1 -1
- package/dist/cjs/biz-components/Listing/BizProductProvider.d.ts +126 -0
- package/dist/cjs/biz-components/Listing/BizProductProvider.js +2 -0
- package/dist/cjs/biz-components/Listing/BizProductProvider.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.d.ts +15 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +39 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +39 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.d.ts +10 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +8 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +73 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +12 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.d.ts +6 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js +2 -0
- package/dist/cjs/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/components/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/components/index.js +2 -0
- package/dist/cjs/biz-components/Listing/components/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/const.d.ts +29 -0
- package/dist/cjs/biz-components/Listing/const.js +2 -0
- package/dist/cjs/biz-components/Listing/const.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useBenefits.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/cjs/biz-components/Listing/hooks/useDiscountEnable.d.ts +14 -0
- package/dist/cjs/biz-components/Listing/hooks/useDiscountEnable.js +2 -0
- package/dist/cjs/biz-components/Listing/hooks/useDiscountEnable.js.map +7 -0
- package/dist/cjs/biz-components/Listing/index.d.ts +3 -0
- package/dist/cjs/biz-components/Listing/index.js +2 -0
- package/dist/cjs/biz-components/Listing/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/graphql.d.ts +7473 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js +2 -0
- package/dist/cjs/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/product.d.ts +141 -0
- package/dist/cjs/biz-components/Listing/types/product.js +2 -0
- package/dist/cjs/biz-components/Listing/types/product.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/cjs/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.d.ts +5 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js +2 -0
- package/dist/cjs/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/types.d.ts +29 -0
- package/dist/cjs/biz-components/Listing/types.js +2 -0
- package/dist/cjs/biz-components/Listing/types.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/helper.d.ts +36 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/index.d.ts +37 -0
- package/dist/cjs/biz-components/Listing/utils/index.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.d.ts +73 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.js +2 -0
- package/dist/cjs/biz-components/Listing/utils/textFormat.js.map +7 -0
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.d.ts +2 -0
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js +1 -1
- package/dist/cjs/biz-components/MultiLayoutGraphicBlock/types.js.map +1 -1
- package/dist/cjs/biz-components/NavigationSearch/index.js +2 -2
- package/dist/cjs/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/cjs/biz-components/NavigationSearch/types.js.map +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js +1 -1
- package/dist/cjs/biz-components/SearchPage/index.js.map +2 -2
- package/dist/cjs/biz-components/SearchPage/types.js.map +2 -2
- package/dist/cjs/biz-components/SelectStore/index.d.ts +20 -0
- package/dist/cjs/biz-components/SelectStore/index.js +2 -0
- package/dist/cjs/biz-components/SelectStore/index.js.map +7 -0
- package/dist/cjs/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/index.js.map +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplay.js.map +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/cjs/biz-components/ShelfDisplay/shelfDisplayItem.js.map +1 -1
- package/dist/cjs/biz-components/Slogan/index.js.map +2 -2
- package/dist/cjs/biz-components/Specs/dropdown.js +2 -2
- package/dist/cjs/biz-components/Specs/dropdown.js.map +2 -2
- package/dist/cjs/biz-components/Specs/index.js +1 -1
- package/dist/cjs/biz-components/Specs/index.js.map +3 -3
- package/dist/cjs/biz-components/Subscribe/index.js +1 -1
- package/dist/cjs/biz-components/Subscribe/index.js.map +2 -2
- package/dist/cjs/biz-components/SwiperBox/index.js.map +2 -2
- package/dist/cjs/biz-components/Tabs/types.js.map +1 -1
- package/dist/cjs/biz-components/TextModal/index.js +1 -1
- package/dist/cjs/biz-components/TextModal/index.js.map +1 -1
- package/dist/cjs/biz-components/Title/index.js +1 -1
- package/dist/cjs/biz-components/Title/index.js.map +2 -2
- package/dist/cjs/biz-components/VideoModal/index.js +1 -1
- package/dist/cjs/biz-components/VideoModal/index.js.map +2 -2
- package/dist/cjs/biz-components/index.d.ts +57 -1
- package/dist/cjs/biz-components/index.js +1 -1
- package/dist/cjs/biz-components/index.js.map +3 -3
- package/dist/cjs/components/ExposureDetector.d.ts +45 -0
- package/dist/cjs/components/ExposureDetector.js +2 -0
- package/dist/cjs/components/ExposureDetector.js.map +7 -0
- package/dist/cjs/components/board.js +1 -1
- package/dist/cjs/components/board.js.map +3 -3
- package/dist/cjs/components/button.js.map +2 -2
- package/dist/cjs/components/checkbox.d.ts +1 -0
- package/dist/cjs/components/checkbox.js +1 -1
- package/dist/cjs/components/checkbox.js.map +3 -3
- package/dist/cjs/components/dialog.d.ts +1 -1
- package/dist/cjs/components/dialog.js +1 -1
- package/dist/cjs/components/dialog.js.map +2 -2
- package/dist/cjs/components/index.d.ts +1 -0
- package/dist/cjs/components/index.js +1 -1
- package/dist/cjs/components/index.js.map +3 -3
- package/dist/cjs/components/loadingDots.js +1 -1
- package/dist/cjs/components/loadingDots.js.map +2 -2
- package/dist/cjs/components/picture.js +1 -1
- package/dist/cjs/components/picture.js.map +2 -2
- package/dist/cjs/cpn-components/CpnNavigation/index.js +1 -1
- package/dist/cjs/cpn-components/CpnNavigation/index.js.map +3 -3
- package/dist/cjs/cpn-components/CpnNavigation/types.d.ts +1 -0
- package/dist/cjs/cpn-components/CpnNavigation/types.js +1 -1
- package/dist/cjs/cpn-components/CpnNavigation/types.js.map +3 -3
- package/dist/cjs/cpn-components/CpnProductCard/types.d.ts +1 -1
- package/dist/cjs/cpn-components/CpnProductCard/types.js.map +1 -1
- package/dist/cjs/helpers/utils.js.map +1 -1
- package/dist/cjs/hooks/useExposure.js.map +2 -2
- package/dist/cjs/hooks/useExposureDetection.d.ts +69 -0
- package/dist/cjs/hooks/useExposureDetection.js +2 -0
- package/dist/cjs/hooks/useExposureDetection.js.map +7 -0
- package/dist/cjs/hooks/useIntersectionObserver.js.map +2 -2
- package/dist/cjs/hooks/useRollout.js.map +2 -2
- package/dist/cjs/stories/board.stories.d.ts +1 -1
- package/dist/cjs/stories/board.stories.js +1 -1
- package/dist/cjs/stories/board.stories.js.map +2 -2
- package/dist/cjs/stories/carousel.stories.d.ts +3 -57
- package/dist/cjs/stories/carousel.stories.js.map +2 -2
- package/dist/cjs/stories/specs.stories.js.map +2 -2
- package/dist/esm/biz-components/AccordionCards/index.js.map +2 -2
- package/dist/esm/biz-components/AiuiProvider/index.d.ts +4 -0
- package/dist/esm/biz-components/AiuiProvider/index.js +1 -1
- package/dist/esm/biz-components/AiuiProvider/index.js.map +2 -2
- package/dist/esm/biz-components/AplusDesc/index.d.ts +22 -0
- package/dist/esm/biz-components/AplusDesc/index.js +2 -0
- package/dist/esm/biz-components/AplusDesc/index.js.map +7 -0
- package/dist/esm/biz-components/Category/SwiperCategory.js.map +2 -2
- package/dist/esm/biz-components/Category/index.js +1 -1
- package/dist/esm/biz-components/Category/index.js.map +2 -2
- package/dist/esm/biz-components/CreativeModule/index.js +1 -1
- package/dist/esm/biz-components/CreativeModule/index.js.map +2 -2
- package/dist/esm/biz-components/DownLoad/index.d.ts +20 -0
- package/dist/esm/biz-components/DownLoad/index.js +2 -0
- package/dist/esm/biz-components/DownLoad/index.js.map +7 -0
- package/dist/esm/biz-components/Evaluate/index.js +1 -1
- package/dist/esm/biz-components/Evaluate/index.js.map +1 -1
- package/dist/esm/biz-components/Faq/Faq.js +1 -1
- package/dist/esm/biz-components/Faq/Faq.js.map +3 -3
- package/dist/esm/biz-components/Features/index.js +1 -1
- package/dist/esm/biz-components/Features/index.js.map +2 -2
- package/dist/esm/biz-components/FootCharger/index.js +1 -1
- package/dist/esm/biz-components/FootCharger/index.js.map +2 -2
- package/dist/esm/biz-components/FooterNavigation/index.js +1 -1
- package/dist/esm/biz-components/FooterNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/GiftBox/index.d.ts +17 -0
- package/dist/esm/biz-components/GiftBox/index.js +2 -0
- package/dist/esm/biz-components/GiftBox/index.js.map +7 -0
- package/dist/esm/biz-components/Graphic/index.js +1 -1
- package/dist/esm/biz-components/Graphic/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicMore/index.js +1 -1
- package/dist/esm/biz-components/GraphicMore/index.js.map +2 -2
- package/dist/esm/biz-components/GraphicOverlay/GraphicOverlay.js.map +1 -1
- package/dist/esm/biz-components/HeaderNavigation/NavProvider.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/icons/Polygon.js.map +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js +1 -1
- package/dist/esm/biz-components/HeaderNavigation/index.js.map +2 -2
- package/dist/esm/biz-components/HeaderNavigation/withCategory.d.ts +1 -1
- package/dist/esm/biz-components/HeaderNavigation/withCategory.js.map +2 -2
- package/dist/esm/biz-components/HeroBanner/Countdown.js +1 -1
- package/dist/esm/biz-components/HeroBanner/Countdown.js.map +1 -1
- package/dist/esm/biz-components/Listing/BizProductProvider.d.ts +126 -0
- package/dist/esm/biz-components/Listing/BizProductProvider.js +2 -0
- package/dist/esm/biz-components/Listing/BizProductProvider.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/LearnMore.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.d.ts +10 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingMethod.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.d.ts +25 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/ShippingPolicyModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.d.ts +15 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.d.ts +30 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/type.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js +2 -0
- package/dist/esm/biz-components/Listing/components/PaidShipping/utils.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.d.ts +39 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js +39 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/BenefitsTab.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.d.ts +10 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/ModalContainer.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.d.ts +30 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBenefitsTabs/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductBundle/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductExchangePurchase/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductFreeGift/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductHighlight/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/ProductOptions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.d.ts +43 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductDetail/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts +21 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.d.ts +1 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.d.ts +8 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.d.ts +73 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGallery/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.d.ts +6 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductGridBox.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.d.ts +5 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/ProductSummary/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/ProductCard/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.d.ts +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ProductActions/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.d.ts +12 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/ScrollSpyNav/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.d.ts +6 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.d.ts +12 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js +1 -0
- package/dist/esm/biz-components/Listing/components/PurchaseBar/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/components/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/components/index.js +2 -0
- package/dist/esm/biz-components/Listing/components/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/const.d.ts +29 -0
- package/dist/esm/biz-components/Listing/const.js +2 -0
- package/dist/esm/biz-components/Listing/const.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.d.ts +14 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant-media.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.d.ts +5 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/use-variant.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.d.ts +50 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useBenefits.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.d.ts +5 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useCopy.js.map +7 -0
- package/dist/esm/biz-components/Listing/hooks/useDiscountEnable.d.ts +14 -0
- package/dist/esm/biz-components/Listing/hooks/useDiscountEnable.js +2 -0
- package/dist/esm/biz-components/Listing/hooks/useDiscountEnable.js.map +7 -0
- package/dist/esm/biz-components/Listing/index.d.ts +3 -0
- package/dist/esm/biz-components/Listing/index.js +2 -0
- package/dist/esm/biz-components/Listing/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/graphql.d.ts +7473 -0
- package/dist/esm/biz-components/Listing/types/graphql.js +2 -0
- package/dist/esm/biz-components/Listing/types/graphql.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/product.d.ts +141 -0
- package/dist/esm/biz-components/Listing/types/product.js +2 -0
- package/dist/esm/biz-components/Listing/types/product.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js +2 -0
- package/dist/esm/biz-components/Listing/types/productMetafields.d.js.map +7 -0
- package/dist/esm/biz-components/Listing/types/type-helper.d.ts +5 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js +1 -0
- package/dist/esm/biz-components/Listing/types/type-helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/types.d.ts +29 -0
- package/dist/esm/biz-components/Listing/types.js +1 -0
- package/dist/esm/biz-components/Listing/types.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/helper.d.ts +36 -0
- package/dist/esm/biz-components/Listing/utils/helper.js +2 -0
- package/dist/esm/biz-components/Listing/utils/helper.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/index.d.ts +37 -0
- package/dist/esm/biz-components/Listing/utils/index.js +2 -0
- package/dist/esm/biz-components/Listing/utils/index.js.map +7 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.d.ts +73 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.js +2 -0
- package/dist/esm/biz-components/Listing/utils/textFormat.js.map +7 -0
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js +1 -1
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/MultiLayoutGraphicBlock.js.map +3 -3
- package/dist/esm/biz-components/MultiLayoutGraphicBlock/types.d.ts +2 -0
- package/dist/esm/biz-components/NavigationSearch/index.js +2 -2
- package/dist/esm/biz-components/NavigationSearch/index.js.map +2 -2
- package/dist/esm/biz-components/NavigationSearch/types.js.map +1 -1
- package/dist/esm/biz-components/SearchPage/index.js +1 -1
- package/dist/esm/biz-components/SearchPage/index.js.map +2 -2
- package/dist/esm/biz-components/SearchPage/types.js.map +2 -2
- package/dist/esm/biz-components/SelectStore/index.d.ts +20 -0
- package/dist/esm/biz-components/SelectStore/index.js +2 -0
- package/dist/esm/biz-components/SelectStore/index.js.map +7 -0
- package/dist/esm/biz-components/ShelfDisplay/index.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/index.js.map +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplay.js.map +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js +1 -1
- package/dist/esm/biz-components/ShelfDisplay/shelfDisplayItem.js.map +1 -1
- package/dist/esm/biz-components/Slogan/index.js.map +2 -2
- package/dist/esm/biz-components/Specs/dropdown.js +2 -2
- package/dist/esm/biz-components/Specs/dropdown.js.map +2 -2
- package/dist/esm/biz-components/Specs/index.js +1 -1
- package/dist/esm/biz-components/Specs/index.js.map +3 -3
- package/dist/esm/biz-components/Subscribe/index.js +1 -1
- package/dist/esm/biz-components/Subscribe/index.js.map +2 -2
- package/dist/esm/biz-components/SwiperBox/index.js.map +2 -2
- package/dist/esm/biz-components/TextModal/index.js +1 -1
- package/dist/esm/biz-components/TextModal/index.js.map +1 -1
- package/dist/esm/biz-components/Title/index.js +1 -1
- package/dist/esm/biz-components/Title/index.js.map +2 -2
- package/dist/esm/biz-components/VideoModal/index.js +1 -1
- package/dist/esm/biz-components/VideoModal/index.js.map +2 -2
- package/dist/esm/biz-components/index.d.ts +57 -1
- package/dist/esm/biz-components/index.js +1 -1
- package/dist/esm/biz-components/index.js.map +3 -3
- package/dist/esm/components/ExposureDetector.d.ts +45 -0
- package/dist/esm/components/ExposureDetector.js +2 -0
- package/dist/esm/components/ExposureDetector.js.map +7 -0
- package/dist/esm/components/board.js +1 -1
- package/dist/esm/components/board.js.map +2 -2
- package/dist/esm/components/button.js.map +2 -2
- package/dist/esm/components/checkbox.d.ts +1 -0
- package/dist/esm/components/checkbox.js +1 -1
- package/dist/esm/components/checkbox.js.map +3 -3
- package/dist/esm/components/dialog.d.ts +1 -1
- package/dist/esm/components/dialog.js +1 -1
- package/dist/esm/components/dialog.js.map +2 -2
- package/dist/esm/components/index.d.ts +1 -0
- package/dist/esm/components/index.js +1 -1
- package/dist/esm/components/index.js.map +3 -3
- package/dist/esm/components/loadingDots.js +1 -1
- package/dist/esm/components/loadingDots.js.map +2 -2
- package/dist/esm/components/picture.js +1 -1
- package/dist/esm/components/picture.js.map +2 -2
- package/dist/esm/cpn-components/CpnNavigation/index.js +1 -1
- package/dist/esm/cpn-components/CpnNavigation/index.js.map +2 -2
- package/dist/esm/cpn-components/CpnNavigation/types.d.ts +1 -0
- package/dist/esm/cpn-components/CpnNavigation/types.js +1 -0
- package/dist/esm/cpn-components/CpnNavigation/types.js.map +3 -3
- package/dist/esm/cpn-components/CpnProductCard/types.d.ts +1 -1
- package/dist/esm/helpers/utils.js.map +1 -1
- package/dist/esm/hooks/useExposure.js.map +2 -2
- package/dist/esm/hooks/useExposureDetection.d.ts +69 -0
- package/dist/esm/hooks/useExposureDetection.js +2 -0
- package/dist/esm/hooks/useExposureDetection.js.map +7 -0
- package/dist/esm/hooks/useIntersectionObserver.js.map +2 -2
- package/dist/esm/hooks/useRollout.js.map +2 -2
- package/dist/esm/stories/board.stories.d.ts +1 -1
- package/dist/esm/stories/board.stories.js +1 -1
- package/dist/esm/stories/board.stories.js.map +2 -2
- package/dist/esm/stories/carousel.stories.d.ts +3 -57
- package/dist/esm/stories/carousel.stories.js.map +2 -2
- package/dist/esm/stories/specs.stories.js.map +2 -2
- package/dist/tokens/anker.css +1 -0
- package/dist/tokens/base.css +1 -1
- package/dist/tokens/eufy.css +1 -0
- package/dist/tokens/eufyMake.css +1 -0
- package/dist/tokens/solix.css +1 -0
- package/dist/tokens/soundcore.css +1 -0
- package/package.json +9 -2
- package/style.css +0 -8
- package/tailwind.config.js +20 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/CompareModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useEffect, useState } from 'react'\nimport {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\nimport type { CompareItem } from '../../../../types'\nimport Select from './Select.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\nimport { formatPrice } from '../../../../utils/index.js'\nimport { ShopifyColorOption } from './ShopifyColorOption.js'\n\nconst CompareModal = () => {\n const { locale = 'us' } = useAiuiContext()\n const { compareData, product } = useBizProductContext()\n const [selectedProductHandle, setSelectedProductHandle] = useState<string>()\n\n useEffect(() => {\n setSelectedProductHandle(compareData?.availableCompareList[0]?.handle)\n }, [compareData?.availableCompareList])\n\n const products = [\n compareData?.currentProductCompareData!?.product,\n compareData?.availableCompareList.find(product => product.handle === selectedProductHandle)?.product,\n ].filter(Boolean) as CompareItem['product'][]\n\n if (!compareData?.specificationKeys) return null\n\n return (\n <Dialog>\n <DialogTrigger>\n <button className=\"text-base font-bold leading-[1.4]\">Compare</button>\n </DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4\">\n <DialogTitle className=\"text-sm text-[#6D6D6F]\">Compare</DialogTitle>\n </DialogHeader>\n <Grid className=\"laptop:gap-8 laptop:py-8 grid-cols-3 py-6\">\n <GridItem span={1} />\n {products.map((product, productIndex) => {\n return (\n <GridItem key={productIndex} span={1} className=\"flex items-center\">\n <img src={product.images[0].url} alt={product.title} className=\"size-[200px]\" role=\"presentation\" />\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">Product</div>\n </GridItem>\n <GridItem span={1}>\n <Text\n as=\"div\"\n className=\"flex h-[38px] w-full items-center rounded-[2px] border border-[#E8E8E8] px-[12px] text-[16px] font-bold\"\n html={compareData.currentProductCompareData?.shortName || product.title}\n ></Text>\n </GridItem>\n {selectedProductHandle && (\n <GridItem span={1}>\n <Select\n value={selectedProductHandle}\n onChange={value => {\n setSelectedProductHandle(value)\n }}\n list={compareData.options!}\n />\n </GridItem>\n )}\n </Grid>\n <Grid className=\"grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\">\n <GridItem span={1}>\n <div className=\"text-[16px] font-bold text-[#595959]\">Basic Information</div>\n </GridItem>\n {products.map((product, productIndex) => {\n const variant = product.variants[0]\n const colors = product.options\n ?.find(option =>\n ['color', 'colour', 'couleur'].find(predicate => option.name.toLowerCase().includes(predicate))\n )\n ?.values.map(value => value.label)\n return (\n <GridItem span={1} key={productIndex} className=\"flex h-full\">\n {/* Price with original price */}\n <div className=\"flex flex-col gap-[8px]\">\n {variant.price.amount < 9999999 && (\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"text-[16px] font-semibold text-[#595959]\">Price:</div>\n <div className=\"flex items-center gap-[6px]\">\n <span className=\"text-[16px] font-bold\">\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n\n {/* {Number(coupon?.fixed_value) > 0 && (\n <span className='font-semibold text-[#999999] line-through'>\n {formatPrice({\n locale,\n amount: variant.price.amount,\n currencyCode: variant.price.currencyCode,\n })}\n </span>\n )} */}\n </div>\n </div>\n )}\n {colors?.length && (\n <div className=\"flex items-center gap-[8px]\">\n <div className=\"text-[16px] font-semibold text-[#595959]\">Color:</div>\n <div className=\"flex items-center gap-[16px]\">\n {colors.map(label => (\n <ShopifyColorOption key={label} label={label} className=\"size-[16px]\" />\n ))}\n </div>\n </div>\n )}\n </div>\n </GridItem>\n )\n })}\n </Grid>\n <Grid className=\"grid-cols-12 items-center gap-[40px] border-b border-[#E8E8E8]\">\n {compareData.specificationKeys?.map((key: string) => {\n return (\n <GridItem\n span={12}\n className=\"grid grid-cols-3 items-center gap-[40px] border-b border-[#E8E8E8] py-[24px]\"\n key={key}\n >\n {/* Detail value */}\n <div className=\"text-[16px] font-bold text-[#595959]\">{key}</div>\n {/* Product Values */}\n {products.map((product, productIndex) => {\n const value =\n product.metafields?.global?.specifications?.find(\n (specification: { key: string }) => specification?.key === key\n )?.value || ''\n let text = value\n switch (text.trim().toLowerCase()) {\n case 'true':\n text = '\u2714\uFE0F'\n break\n case 'false':\n text = '\u274C'\n break\n default:\n break\n }\n return (\n <div key={productIndex} className=\"flex items-center\">\n {/* Other details */}\n <div className=\"text-[16px] font-semibold text-[#595959]\">{text}</div>\n </div>\n )\n })}\n </GridItem>\n )\n })}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n\nexport default CompareModal\n"],
|
|
5
|
+
"mappings": "0jBAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAqCQ,IAAAI,EAAA,6BArCRC,EAAoC,iBACpCC,EASO,iDACPC,EAAqC,6CAErCC,EAAmB,0BACnBC,EAA+B,gDAC/BC,EAA4B,sCAC5BC,EAAmC,mCAEnC,MAAMC,EAAe,IAAM,CACzB,KAAM,CAAE,OAAAC,EAAS,IAAK,KAAI,kBAAe,EACnC,CAAE,YAAAC,EAAa,QAAAC,CAAQ,KAAI,wBAAqB,EAChD,CAACC,EAAuBC,CAAwB,KAAI,YAAiB,KAE3E,aAAU,IAAM,CACdA,EAAyBH,GAAa,qBAAqB,CAAC,GAAG,MAAM,CACvE,EAAG,CAACA,GAAa,oBAAoB,CAAC,EAEtC,MAAMI,EAAW,CACfJ,GAAa,2BAA4B,QACzCA,GAAa,qBAAqB,KAAKC,GAAWA,EAAQ,SAAWC,CAAqB,GAAG,OAC/F,EAAE,OAAO,OAAO,EAEhB,OAAKF,GAAa,qBAGhB,QAAC,UACC,oBAAC,iBACC,mBAAC,UAAO,UAAU,oCAAoC,mBAAO,EAC/D,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AChE,OAAC,OAAI,UAAU,8BACb,mBAAC,QAAK,UAAU,wBACb,2BAAY,CACX,OAAAT,EACA,OAAQS,EAAQ,MAAM,OACtB,aAAcA,EAAQ,MAAM,YAC9B,CAAC,EACH,EAWF,GACF,EAEDC,GAAQ,WACP,QAAC,OAAI,UAAU,8BACb,oBAAC,OAAI,UAAU,2CAA2C,kBAAM,KAChE,OAAC,OAAI,UAAU,+BACZ,SAAAA,EAAO,IAAIG,MACV,OAAC,sBAA+B,MAAOA,EAAO,UAAU,eAA/BA,CAA6C,CACvE,EACH,GACF,GAEJ,GArCsBP,CAsCxB,CAEJ,CAAC,GACH,KACA,OAAC,QAAK,UAAU,iEACb,SAAAL,EAAY,mBAAmB,IAAKa,MAEjC,QAAC,YACC,KAAM,GACN,UAAU,+EAIV,oBAAC,OAAI,UAAU,uCAAwC,SAAAA,EAAI,EAE1DT,EAAS,IAAI,CAACH,EAASI,IAAiB,CAKvC,IAAIS,EAHFb,EAAQ,YAAY,QAAQ,gBAAgB,KACzCc,GAAmCA,GAAe,MAAQF,CAC7D,GAAG,OAAS,GAEd,OAAQC,EAAK,KAAK,EAAE,YAAY,EAAG,CACjC,IAAK,OACHA,EAAO,eACP,MACF,IAAK,QACHA,EAAO,SACP,MACF,QACE,KACJ,CACA,SACE,OAAC,OAAuB,UAAU,oBAEhC,mBAAC,OAAI,UAAU,2CAA4C,SAAAA,EAAK,GAFxDT,CAGV,CAEJ,CAAC,IA3BIQ,CA4BP,CAEH,EACH,GACF,GACF,EA5I0C,IA8I9C,EAEA,IAAOzB,EAAQU",
|
|
6
|
+
"names": ["CompareModal_exports", "__export", "CompareModal_default", "__toCommonJS", "import_jsx_runtime", "import_react", "import_components", "import_BizProductProvider", "import_Select", "import_AiuiProvider", "import_utils", "import_ShopifyColorOption", "CompareModal", "locale", "compareData", "product", "selectedProductHandle", "setSelectedProductHandle", "products", "productIndex", "Select", "value", "variant", "colors", "option", "predicate", "label", "key", "text", "specification"]
|
|
7
|
+
}
|
package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
interface SelectProps {
|
|
2
|
+
label?: string;
|
|
3
|
+
required?: boolean;
|
|
4
|
+
list?: {
|
|
5
|
+
value: string;
|
|
6
|
+
text: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}[];
|
|
9
|
+
value?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
error?: string;
|
|
12
|
+
errorClassName?: string;
|
|
13
|
+
onChange?: (value: string) => void;
|
|
14
|
+
placeholder?: string;
|
|
15
|
+
className?: string;
|
|
16
|
+
containerClassName?: string;
|
|
17
|
+
selectListClassName?: string;
|
|
18
|
+
truncate?: boolean;
|
|
19
|
+
}
|
|
20
|
+
declare const Select: ({ label, required, list, value, disabled, error, errorClassName, onChange, placeholder, className, containerClassName, selectListClassName, truncate, ...props }: SelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
export default Select;
|
package/dist/cjs/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.js
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var f=Object.defineProperty;var y=Object.getOwnPropertyDescriptor;var k=Object.getOwnPropertyNames;var L=Object.prototype.hasOwnProperty;var D=(s,n)=>{for(var a in n)f(s,a,{get:n[a],enumerable:!0})},S=(s,n,a,o)=>{if(n&&typeof n=="object"||typeof n=="function")for(let i of k(n))!L.call(s,i)&&i!==a&&f(s,i,{get:()=>n[i],enumerable:!(o=y(n,i))||o.enumerable});return s};var M=s=>S(f({},"__esModule",{value:!0}),s);var H={};D(H,{default:()=>_});module.exports=M(H);var t=require("react/jsx-runtime"),l=require("../../../../../../helpers/index.js"),r=require("react");const R=({label:s="",required:n=!1,list:a=[],value:o="",disabled:i=!1,error:d="",errorClassName:b="",onChange:g=m=>{},placeholder:u="",className:w="",containerClassName:h="",selectListClassName:N="",truncate:C=!1,...E})=>{const m=(0,r.useRef)(null),[p,x]=(0,r.useState)(!1),v=(0,r.useRef)(null),F=a.find(e=>e?.value===o)?.text;return(0,r.useEffect)(()=>{const e=c=>{v.current&&!v.current?.contains(c.target)&&x(!1)};return document.addEventListener("mousedown",e),()=>{document.removeEventListener("mousedown",e)}},[]),(0,t.jsxs)("div",{className:(0,l.cn)("relative w-full",h),children:[s&&(0,t.jsxs)("div",{className:"mb-[10px] text-[16px] font-bold",children:[s,n&&(0,t.jsx)("span",{className:"text-[#F84D4F]",children:"*"})]}),(0,t.jsxs)("div",{ref:v,className:"relative block",children:[(0,t.jsxs)("div",{className:(0,l.cn)("flex h-[38px] w-full cursor-pointer items-center justify-between rounded-[2px] border px-[12px] text-[16px] font-bold transition-all x:text-[14px]",u&&!o?"placeholder:text-[#999]":"",i?"pointer-events-none bg-[#F7F8F9]":"bg-white",d?"!border-[#F84D4F]":"border-[#E8E8E8]",a.length<=1&&"cursor-default",w),onClick:()=>{a.length>1&&x(!p)},onChange:e=>{g(e.target.value)},role:"button",tabIndex:0,onKeyDown:e=>{(e.key==="Enter"||e.key===" ")&&e.preventDefault()},...E,children:[!o&&u?(0,t.jsx)("div",{className:"text-[#999]",children:u}):(0,t.jsx)("div",{className:(0,l.cn)("line-clamp-1",C?"min-w-0 flex-1 truncate":"flex-1"),children:F}),a.length>1&&(0,t.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:(0,l.cn)("transition-transform",p&&"rotate-180"),width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",children:(0,t.jsx)("path",{d:"M14.4101 6.91083C14.7355 6.58539 15.263 6.58539 15.5885 6.91083C15.9139 7.23626 15.9139 7.76377 15.5885 8.08921L10.5885 13.0892C10.263 13.4146 9.73553 13.4146 9.41009 13.0892L4.41009 8.08921C4.08466 7.76377 4.08466 7.23626 4.41009 6.91083C4.73553 6.58539 5.26304 6.58539 5.58848 6.91083L9.99929 11.3216L14.4101 6.91083Z",fill:"currentColor"})})]}),(0,t.jsx)("div",{ref:m,className:(0,l.cn)("absolute left-0 right-0 top-full z-[1] mt-[8px] max-h-[318px] overflow-auto rounded-[4px] bg-white py-[6px] shadow-[0_1px_12px_0px_#0000001F] transition-all duration-300",p?"":"pointer-events-none opacity-0",N),children:a.map(e=>(0,t.jsx)("div",{"data-value":e.value,className:(0,l.cn)("flex h-[47px] w-full flex-shrink-0 cursor-pointer items-center whitespace-nowrap bg-white px-[14px] text-[15px] font-bold text-[#333] transition-colors duration-300 hover:bg-[#F7F8F9]",o===e.value?"!bg-[#E8E8E8]":"",e?.disabled?"pointer-events-none text-[#C8C8C8]":""),onClick:()=>{g(e.value),x(!1)},role:"button",tabIndex:0,onKeyDown:c=>{(c.key==="Enter"||c.key===" ")&&c.preventDefault()},children:e.text},e.value))})]}),d&&(0,t.jsx)("div",{className:(0,l.cn)("mt-[8px] text-[14px] text-[#F84D4F]",b),children:typeof d=="string"?`*${d}`:d})]})};var _=R;
|
|
2
|
+
//# sourceMappingURL=Select.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/Select.tsx"],
|
|
4
|
+
"sourcesContent": ["import { cn as classNames, cn } from '../../../../../../helpers/index.js'\nimport React, { useEffect, useRef, useState } from 'react'\n\ninterface SelectProps {\n label?: string\n required?: boolean\n list?: { value: string; text: string; disabled?: boolean }[]\n value?: string\n disabled?: boolean\n error?: string\n errorClassName?: string\n onChange?: (value: string) => void\n placeholder?: string\n className?: string\n containerClassName?: string\n selectListClassName?: string\n truncate?: boolean\n}\n\nconst Select = ({\n label = '',\n required = false,\n list = [],\n value = '',\n disabled = false,\n error = '',\n errorClassName = '',\n onChange = (value: string) => {},\n placeholder = '',\n className = '',\n containerClassName = '',\n selectListClassName = '',\n truncate = false,\n ...props\n}: SelectProps) => {\n const dropdownRef = useRef(null)\n const [selecting, setSelecting] = useState(false)\n const buttonRef = useRef<HTMLDivElement>(null)\n\n const displayValue = list.find(item => item?.value === value)?.text\n useEffect(() => {\n const handleClickOutside = (event: MouseEvent) => {\n if (buttonRef.current && !buttonRef.current?.contains(event.target as Node)) {\n setSelecting(false)\n }\n }\n document.addEventListener('mousedown', handleClickOutside)\n return () => {\n document.removeEventListener('mousedown', handleClickOutside)\n }\n }, [])\n\n // useEffect(() => {\n // // scroll to select item when select is open\n // // start_ai_generated\n // if (selecting && value) {\n // const selectedElement = dropdownRef.current.querySelector(`[data-value=\"${value}\"]`)\n // if (selectedElement) {\n // scrollParentToChild(dropdownRef.current, selectedElement)\n // }\n // }\n // // end_ai_generated\n // }, [selecting, value])\n\n return (\n <div className={classNames('relative w-full', containerClassName)}>\n {label && (\n <div className=\"mb-[10px] text-[16px] font-bold\">\n {label}\n {required && <span className=\"text-[#F84D4F]\">*</span>}\n </div>\n )}\n <div ref={buttonRef} className=\"relative block\">\n <div\n className={classNames(\n 'flex h-[38px] w-full cursor-pointer items-center justify-between rounded-[2px] border px-[12px] text-[16px] font-bold transition-all x:text-[14px]',\n placeholder && !value ? 'placeholder:text-[#999]' : '',\n disabled ? 'pointer-events-none bg-[#F7F8F9]' : 'bg-white',\n error ? '!border-[#F84D4F]' : 'border-[#E8E8E8]',\n list.length <= 1 && 'cursor-default',\n className\n )}\n onClick={() => {\n if (list.length > 1) {\n setSelecting(!selecting)\n }\n }}\n onChange={event => {\n onChange((event.target as HTMLSelectElement).value)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n {...props}\n >\n {!value && placeholder ? (\n <div className=\"text-[#999]\">{placeholder}</div>\n ) : (\n <div className={cn('line-clamp-1', truncate ? 'min-w-0 flex-1 truncate' : 'flex-1')}>{displayValue}</div>\n )}\n {list.length > 1 && (\n <svg\n xmlns=\"http://www.w3.org/2000/svg\"\n className={classNames('transition-transform', selecting && 'rotate-180')}\n width=\"20\"\n height=\"20\"\n viewBox=\"0 0 20 20\"\n fill=\"none\"\n >\n <path\n d=\"M14.4101 6.91083C14.7355 6.58539 15.263 6.58539 15.5885 6.91083C15.9139 7.23626 15.9139 7.76377 15.5885 8.08921L10.5885 13.0892C10.263 13.4146 9.73553 13.4146 9.41009 13.0892L4.41009 8.08921C4.08466 7.76377 4.08466 7.23626 4.41009 6.91083C4.73553 6.58539 5.26304 6.58539 5.58848 6.91083L9.99929 11.3216L14.4101 6.91083Z\"\n fill=\"currentColor\"\n />\n </svg>\n )}\n {/* {list.length > 1 && (\n <ChevronDownIcon\n className={classNames(\n 'ml-[4px] h-[18px] w-[18px] flex-shrink-0 stroke-[#999999] transition-transform',\n selecting && 'rotate-180'\n )}\n />\n )} */}\n </div>\n <div\n ref={dropdownRef}\n className={classNames(\n 'absolute left-0 right-0 top-full z-[1] mt-[8px] max-h-[318px] overflow-auto rounded-[4px] bg-white py-[6px] shadow-[0_1px_12px_0px_#0000001F] transition-all duration-300',\n selecting ? '' : 'pointer-events-none opacity-0',\n selectListClassName\n )}\n >\n {list.map(item => (\n <div\n key={item.value}\n data-value={item.value}\n className={classNames(\n 'flex h-[47px] w-full flex-shrink-0 cursor-pointer items-center whitespace-nowrap bg-white px-[14px] text-[15px] font-bold text-[#333] transition-colors duration-300 hover:bg-[#F7F8F9]',\n value === item.value ? '!bg-[#E8E8E8]' : '',\n item?.disabled ? 'pointer-events-none text-[#C8C8C8]' : ''\n )}\n onClick={() => {\n onChange(item.value)\n setSelecting(false)\n }}\n role=\"button\"\n tabIndex={0}\n onKeyDown={e => {\n if (e.key === 'Enter' || e.key === ' ') {\n e.preventDefault()\n }\n }}\n >\n {item.text}\n </div>\n ))}\n </div>\n </div>\n {error && (\n <div className={classNames('mt-[8px] text-[14px] text-[#F84D4F]', errorClassName)}>\n {typeof error === 'string' ? `*${error}` : error}\n </div>\n )}\n </div>\n )\n}\n\nexport default Select\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,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EACA,SAAUM,GAAS,CACjBd,EAAUc,EAAM,OAA6B,KAAK,CACpD,EACA,KAAK,SACL,SAAU,EACV,UAAW,GAAK,EACV,EAAE,MAAQ,SAAW,EAAE,MAAQ,MACjC,EAAE,eAAe,CAErB,EACC,GAAGR,EAEH,WAACV,GAASK,KACT,OAAC,OAAI,UAAU,cAAe,SAAAA,EAAY,KAE1C,OAAC,OAAI,aAAW,MAAG,eAAgBI,EAAW,0BAA4B,QAAQ,EAAI,SAAAM,EAAa,EAEpGhB,EAAK,OAAS,MACb,OAAC,OACC,MAAM,6BACN,aAAW,EAAAoB,IAAW,uBAAwBP,GAAa,YAAY,EACvE,MAAM,KACN,OAAO,KACP,QAAQ,YACR,KAAK,OAEL,mBAAC,QACC,EAAE,kUACF,KAAK,eACP,EACF,GAUJ,KACA,OAAC,OACC,IAAKD,EACL,aAAW,EAAAQ,IACT,4KACAP,EAAY,GAAK,gCACjBJ,CACF,EAEC,SAAAT,EAAK,IAAIiB,MACR,OAAC,OAEC,aAAYA,EAAK,MACjB,aAAW,EAAAG,IACT,0LACAnB,IAAUgB,EAAK,MAAQ,gBAAkB,GACzCA,GAAM,SAAW,qCAAuC,EAC1D,EACA,QAAS,IAAM,CACbZ,EAASY,EAAK,KAAK,EACnBH,EAAa,EAAK,CACpB,EACA,KAAK,SACL,SAAU,EACV,UAAWO,GAAK,EACVA,EAAE,MAAQ,SAAWA,EAAE,MAAQ,MACjCA,EAAE,eAAe,CAErB,EAEC,SAAAJ,EAAK,MAnBDA,EAAK,KAoBZ,CACD,EACH,GACF,EACCd,MACC,OAAC,OAAI,aAAW,EAAAiB,IAAW,sCAAuChB,CAAc,EAC7E,gBAAOD,GAAU,SAAW,IAAIA,CAAK,GAAKA,EAC7C,GAEJ,CAEJ,EAEA,IAAOX,EAAQK",
|
|
6
|
+
"names": ["Select_exports", "__export", "Select_default", "__toCommonJS", "import_jsx_runtime", "import_helpers", "import_react", "Select", "label", "required", "list", "value", "disabled", "error", "errorClassName", "onChange", "placeholder", "className", "containerClassName", "selectListClassName", "truncate", "props", "dropdownRef", "selecting", "setSelecting", "buttonRef", "displayValue", "item", "handleClickOutside", "event", "classNames", "e"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var a=Object.defineProperty;var h=Object.getOwnPropertyDescriptor;var _=Object.getOwnPropertyNames;var v=Object.prototype.hasOwnProperty;var x=(t,o)=>{for(var s in o)a(t,s,{get:o[s],enumerable:!0})},y=(t,o,s,i)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of _(o))!v.call(t,r)&&r!==s&&a(t,r,{get:()=>o[r],enumerable:!(i=h(o,r))||i.enumerable});return t};var b=t=>y(a({},"__esModule",{value:!0}),t);var w={};x(w,{ShopifyColorOption:()=>N});module.exports=b(w);var e=require("react/jsx-runtime"),n=require("../../../../../../components/index.js"),l=require("../../../../utils/helper.js"),u=require("react"),c=require("../../../../../../helpers/index.js"),m=require("../../../../../AiuiProvider/index.js");const N=({onClick:t,label:o,className:s})=>{const[i,r]=(0,u.useState)({}),{locale:E,storeDomain:f}=(0,m.useAiuiContext)(),d=`https://${f}/cdn/shop/files/${(0,l.handle)(o)}.png`;return(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsx)("button",{className:(0,c.cn)("relative flex h-[36px] w-[36px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white",!t&&"cursor-default",s),"aria-label":`switch to ${o}`,onClick:t||(()=>{}),title:o,style:i[o]?{background:o}:{},children:!i[o]&&(0,e.jsx)(e.Fragment,{children:(0,e.jsx)(n.Picture,{className:"w-full",source:d,onError:({currentTarget:p})=>{p.onerror=null,r(g=>({...g,[o]:!0}))}})})}),(0,e.jsx)("div",{className:"absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]"})]})};
|
|
2
|
+
//# sourceMappingURL=ShopifyColorOption.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/ShopifyColorOption.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Picture } from '../../../../../../components/index.js'\nimport { handle } from '../../../../utils/helper.js'\nimport { useState } from 'react'\nimport { cn as classNames } from '../../../../../../helpers/index.js'\nimport { useAiuiContext } from '../../../../../AiuiProvider/index.js'\n\nexport const ShopifyColorOption = ({\n onClick,\n label,\n className,\n}: {\n onClick?: () => void\n label: string\n className?: string\n}) => {\n const [imgLoadError, setImgLoadError] = useState({})\n\n const { locale, storeDomain } = useAiuiContext()\n const imagePath = `https://${storeDomain}/cdn/shop/files/${handle(label)}.png`\n return (\n <div className=\"relative\">\n <button\n className={classNames(\n `relative flex h-[36px] w-[36px] items-center justify-center rounded-full bg-center bg-no-repeat outline outline-2 outline-offset-4 outline-white`,\n !onClick && 'cursor-default',\n className\n )}\n aria-label={`switch to ${label}`}\n onClick={onClick ? onClick : () => {}}\n title={label}\n // If the image fails to load, set the background color to the color of the label\n style={imgLoadError[label as keyof typeof imgLoadError] ? { background: label } : {}}\n >\n {!imgLoadError[label as keyof typeof imgLoadError] && (\n <>\n <Picture\n className=\"w-full\"\n source={imagePath}\n onError={({ currentTarget }) => {\n currentTarget.onerror = null // prevents looping\n setImgLoadError(prev => ({ ...prev, [label]: true }))\n }}\n />\n </>\n )}\n </button>\n <div className=\"absolute inset-0 rounded-full shadow-[inset_0_0_4px_rgba(0,0,0,0.08),inset_0_2px_2px_rgba(0,0,0,0.12)]\"></div>\n </div>\n )\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,wBAAAE,IAAA,eAAAC,EAAAH,GAoBI,IAAAI,EAAA,6BApBJC,EAAwB,iDACxBC,EAAuB,uCACvBC,EAAyB,iBACzBC,EAAiC,8CACjCC,EAA+B,gDAExB,MAAMP,EAAqB,CAAC,CACjC,QAAAQ,EACA,MAAAC,EACA,UAAAC,CACF,IAIM,CACJ,KAAM,CAACC,EAAcC,CAAe,KAAI,YAAS,CAAC,CAAC,EAE7C,CAAE,OAAAC,EAAQ,YAAAC,CAAY,KAAI,kBAAe,EACzCC,EAAY,WAAWD,CAAW,sBAAmB,UAAOL,CAAK,CAAC,OACxE,SACE,QAAC,OAAI,UAAU,WACb,oBAAC,UACC,aAAW,EAAAO,IACT,mJACA,CAACR,GAAW,iBACZE,CACF,EACA,aAAY,aAAaD,CAAK,GAC9B,QAASD,IAAoB,IAAM,CAAC,GACpC,MAAOC,EAEP,MAAOE,EAAaF,CAAkC,EAAI,CAAE,WAAYA,CAAM,EAAI,CAAC,EAElF,UAACE,EAAaF,CAAkC,MAC/C,mBACE,mBAAC,WACC,UAAU,SACV,OAAQM,EACR,QAAS,CAAC,CAAE,cAAAE,CAAc,IAAM,CAC9BA,EAAc,QAAU,KACxBL,EAAgBM,IAAS,CAAE,GAAGA,EAAM,CAACT,CAAK,EAAG,EAAK,EAAE,CACtD,EACF,EACF,EAEJ,KACA,OAAC,OAAI,UAAU,yGAAyG,GAC1H,CAEJ",
|
|
6
|
+
"names": ["ShopifyColorOption_exports", "__export", "ShopifyColorOption", "__toCommonJS", "import_jsx_runtime", "import_components", "import_helper", "import_react", "import_helpers", "import_AiuiProvider", "onClick", "label", "className", "imgLoadError", "setImgLoadError", "locale", "storeDomain", "imagePath", "classNames", "currentTarget", "prev"]
|
|
7
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const SpecsModal: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var i=Object.defineProperty;var g=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var d=Object.prototype.hasOwnProperty;var n=(a,t)=>{for(var l in t)i(a,l,{get:t[l],enumerable:!0})},m=(a,t,l,p)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of c(t))!d.call(a,s)&&s!==l&&i(a,s,{get:()=>t[s],enumerable:!(p=g(t,s))||p.enumerable});return a};var x=a=>m(i({},"__esModule",{value:!0}),a);var D={};n(D,{SpecsModal:()=>b});module.exports=x(D);var e=require("react/jsx-runtime"),o=require("../../../../../../components/index.js"),r=require("../../../../BizProductProvider.js");const b=()=>{const{product:a}=(0,r.useBizProductContext)();return(0,e.jsxs)(o.Dialog,{children:[(0,e.jsx)(o.DialogTrigger,{children:(0,e.jsx)("button",{className:"text-base font-bold leading-[1.4]",children:"Specs"})}),(0,e.jsxs)(o.DialogContent,{overlayClassName:"z-[100]",className:"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]",children:[(0,e.jsx)(o.DialogHeader,{className:"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4",children:(0,e.jsx)(o.DialogTitle,{className:"text-sm text-[#6D6D6F]",children:"Specs"})}),(0,e.jsx)(o.Grid,{className:"laptop:gap-8 laptop:py-8 py-6",children:a.metafields?.global?.specifications?.map(({key:t,value:l})=>(0,e.jsxs)(o.GridItem,{span:6,className:"flex flex-col gap-1",children:[(0,e.jsx)(o.Text,{className:"text-[16px] font-bold",children:t}),(0,e.jsx)(o.Text,{className:"text-[16px] font-bold text-[#86868C]",html:l?.trim().toLowerCase()==="true"?"\u2714\uFE0F":l?.trim().toLowerCase()==="false"?"\u274C":l})]}))})]})]})};
|
|
2
|
+
//# sourceMappingURL=SpecsModal.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/components/SpecsModal.tsx"],
|
|
4
|
+
"sourcesContent": ["import {\n Dialog,\n DialogTrigger,\n DialogContent,\n DialogHeader,\n DialogTitle,\n Grid,\n GridItem,\n Text,\n} from '../../../../../../components/index.js'\nimport { useBizProductContext } from '../../../../BizProductProvider.js'\n\nexport const SpecsModal = () => {\n const { product } = useBizProductContext()\n\n return (\n <Dialog>\n <DialogTrigger>\n <button className=\"text-base font-bold leading-[1.4]\">Specs</button>\n </DialogTrigger>\n <DialogContent\n overlayClassName=\"z-[100]\"\n className=\"rounded-box [&_.dialog-close-icon]:laptop:size-6 laptop:w-[896px] laptop:px-8 z-[110] max-h-[80vh] max-w-[90vw] gap-0 overflow-hidden overflow-y-auto !py-0 px-4 [&_.dialog-close-button]:focus:!ring-0 [&_.dialog-close-icon]:size-4 [&_.dialog-close-icon]:text-[#6D6D6F]\"\n >\n <DialogHeader className=\"laptop:pt-4 laptop:pb-3 border-b border-[#E8E8E8] pb-2 pt-4\">\n <DialogTitle className=\"text-sm text-[#6D6D6F]\">Specs</DialogTitle>\n </DialogHeader>\n <Grid className=\"laptop:gap-8 laptop:py-8 py-6\">\n {product.metafields?.global?.specifications?.map(({ key, value }: { key: string; value: string }) => (\n <GridItem span={6} className=\"flex flex-col gap-1\">\n <Text className=\"text-[16px] font-bold\">{key}</Text>\n <Text\n className=\"text-[16px] font-bold text-[#86868C]\"\n html={\n value?.trim().toLowerCase() === 'true' ? '\u2714\uFE0F' : value?.trim().toLowerCase() === 'false' ? '\u274C' : value\n }\n />\n </GridItem>\n ))}\n </Grid>\n </DialogContent>\n </Dialog>\n )\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,gBAAAE,IAAA,eAAAC,EAAAH,GAkBQ,IAAAI,EAAA,6BAlBRC,EASO,iDACPC,EAAqC,6CAE9B,MAAMJ,EAAa,IAAM,CAC9B,KAAM,CAAE,QAAAK,CAAQ,KAAI,wBAAqB,EAEzC,SACE,QAAC,UACC,oBAAC,iBACC,mBAAC,UAAO,UAAU,oCAAoC,iBAAK,EAC7D,KACA,QAAC,iBACC,iBAAiB,UACjB,UAAU,8QAEV,oBAAC,gBAAa,UAAU,8DACtB,mBAAC,eAAY,UAAU,yBAAyB,iBAAK,EACvD,KACA,OAAC,QAAK,UAAU,gCACb,SAAAA,EAAQ,YAAY,QAAQ,gBAAgB,IAAI,CAAC,CAAE,IAAAC,EAAK,MAAAC,CAAM,OAC7D,QAAC,YAAS,KAAM,EAAG,UAAU,sBAC3B,oBAAC,QAAK,UAAU,wBAAyB,SAAAD,EAAI,KAC7C,OAAC,QACC,UAAU,uCACV,KACEC,GAAO,KAAK,EAAE,YAAY,IAAM,OAAS,eAAOA,GAAO,KAAK,EAAE,YAAY,IAAM,QAAU,SAAMA,EAEpG,GACF,CACD,EACH,GACF,GACF,CAEJ",
|
|
6
|
+
"names": ["SpecsModal_exports", "__export", "SpecsModal", "__toCommonJS", "import_jsx_runtime", "import_components", "import_BizProductProvider", "product", "key", "value"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface ProductGalleryTabRef {
|
|
2
|
+
scrollToTab: (index: number) => void;
|
|
3
|
+
}
|
|
4
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<object, keyof import("../../../../../shared/Styles.js").StylesProps> & Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & {
|
|
5
|
+
className?: string;
|
|
6
|
+
data?: Record<string, any>;
|
|
7
|
+
} & import("react").RefAttributes<any>>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var ee=Object.create;var V=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ae=Object.getPrototypeOf,ie=Object.prototype.hasOwnProperty;var oe=(t,a)=>{for(var s in a)V(t,s,{get:a[s],enumerable:!0})},W=(t,a,s,y)=>{if(a&&typeof a=="object"||typeof a=="function")for(let n of le(a))!ie.call(t,n)&&n!==s&&V(t,n,{get:()=>a[n],enumerable:!(y=te(a,n))||y.enumerable});return t};var re=(t,a,s)=>(s=t!=null?ee(ae(t)):{},W(a||!t||!t.__esModule?V(s,"default",{value:t,enumerable:!0}):s,t)),se=t=>W(V({},"__esModule",{value:!0}),t);var pe={};oe(pe,{default:()=>ue});module.exports=se(pe);var e=require("react/jsx-runtime"),$=require("../../../../AiuiProvider/index.js"),N=require("../../../../../components/index.js"),l=require("react"),G=require("swiper/react"),g=require("swiper/modules"),T=require("../../../../../helpers/index.js"),k=require("./types.js"),P=require("@radix-ui/react-tabs"),z=require("../../../BizProductProvider.js"),K=require("../../../hooks/use-variant-media.js"),U=require("./components/SpecsModal.js"),Z=re(require("./components/CompareModal.js")),q=require("../../../utils/index.js"),J=require("../../../../../shared/Styles.js"),Q=require("../../../../../shared/track.js"),X=require("../../../../../components/index.js");const Y=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{x:"48",y:"48",width:"48",height:"48",rx:"24",transform:"rotate(-180 48 48)",fill:"white"}),(0,e.jsx)("path",{d:"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z",fill:"currentColor"})]}),O=t=>(0,e.jsxs)("svg",{width:"48",height:"48",viewBox:"0 0 48 48",fill:"none",xmlns:"http://www.w3.org/2000/svg",...t,children:[(0,e.jsx)("rect",{width:"48",height:"48",rx:"24",transform:"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)",fill:"white"}),(0,e.jsx)("path",{d:"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z",fill:"currentColor"})]}),ne=()=>{const{copyWriting:t}=(0,$.useAiuiContext)(),{product:a,variant:s,selectedOptions:y}=(0,z.useBizProductContext)(),n=(0,K.useVariantMedia)({product:a,variant:s}),[p,x]=(0,l.useState)(null),M=(0,l.useRef)(null),b=s?.metafields?.component?.custom_media_list;let h,w,A,S;b&&b?.available?(h=b?.product||[],w=b?.scenarios||[],A=b?.keyFeatures||[],S=b?.video||[]):(h=n?.productList,w=n?.sceneList,A=n?.keyFeaturesList,S=n?.videoList);const o=(0,l.useMemo)(()=>[...h,...w,...S],[h,w,S]),m={productList:h,sceneList:w,keyFeaturesList:A,videoList:S},i=(0,l.useMemo)(()=>(a?.payload?.components?.find(d=>d.componentKey==="ProductGallery")?.data||[])?.map(d=>{let F=m[d?.galleries]||[];if(d?.images&&Array.isArray(d.images)&&d.images.length>0){const j=d.images.map(u=>{const I=[];if(u.image_1920&&u.image_1920.trim()&&I.push(`${u.image_1920} 1920`),u.image_1440&&u.image_1440.trim()&&I.push(`${u.image_1440} 1440`),u.image_1024&&u.image_1024.trim()&&I.push(`${u.image_1024} 1024`),u.image_768&&u.image_768.trim()&&I.push(`${u.image_768} 767`),u.image_390&&u.image_390.trim()&&I.push(`${u.image_390} 390`),I.length>0){const H=I.join(", ");return{image:{url:H,altText:d.comment?.content||""},_fromImages:!0,_responsiveSource:H}}return null}).filter(u=>u!==null);j.length>0&&(F=j)}return{...d,galleries:F}}).filter(d=>d.galleries.length>0),[a?.payload,m]),[E,L]=(0,l.useState)(i?.[0]),[f,_]=(0,l.useState)(0),[C,r]=(0,l.useState)(null),v=(0,l.useCallback)(()=>{const c=(f+1)%i.length;_(c),L(i[c]),r(0)},[f,i]),R=(0,l.useCallback)(()=>{const c=f===0?i.length-1:f-1;_(c),L(i[c]);const d=i[c]?.galleries||[];r(d.length-1)},[f,i]);(0,l.useEffect)(()=>{f!=null&&requestAnimationFrame(()=>{M.current?.scrollToTab(f)})},[f]),(0,l.useEffect)(()=>{L(i[0]),_(0)},[s?.id]);const D=(c,d)=>{switch(c?.galleryTabType){case k.GalleryTabType.GALLERY_IMAGE_MAIN:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_IMAGE_FEATURES:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_IMAGE_SCENE:return(0,e.jsx)(B,{...c,index:d,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});case k.GalleryTabType.GALLERY_VIDEO:return(0,e.jsx)(de,{...c,onNextTab:v,onPrevTab:R,targetSlideIndex:C,onSlideChange:()=>r(null)});default:return null}};return(0,e.jsx)("div",{id:"ipc-product-gallery",children:(0,e.jsxs)(P.Root,{className:"relative",value:E?.tabValue,defaultValue:i?.[0]?.tabValue,children:[(0,e.jsx)("div",{className:"tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] desktop:relative h-[420px] overflow-hidden bg-[#EAEAEC] ",children:i.map((c,d)=>(0,e.jsx)(P.Content,{className:"h-full",value:c.tabValue,children:D(c,d)},c.tabValue))}),(0,e.jsx)(ce,{ref:M,galleryTabs:i,activeGalleryTab:E,setActiveGalleryTab:L,setActiveTabIndex:_,setTargetSlideIndex:r})]})})},ce=(0,l.forwardRef)((t,a)=>{const{galleryTabs:s,activeGalleryTab:y,setActiveGalleryTab:n,setActiveTabIndex:p,setTargetSlideIndex:x}=t,{product:M}=(0,z.useBizProductContext)(),b=(0,l.useRef)(null),h=(0,l.useRef)(new Map),w=(0,l.useCallback)((o,m,i)=>{n(m),p(i),x(0),A(o)},[n,p,x]),A=(0,l.useCallback)(o=>{if(b.current){const m=b.current,i=o.currentTarget,E=i.offsetLeft-m.offsetWidth/2+i.offsetWidth/2;m.scrollTo({left:E,behavior:"smooth"})}},[]),S=(0,l.useCallback)(o=>{if(b.current&&s[o]){const m=b.current,i=s[o],E=h.current.get(i.tabValue);if(E){const L=E.offsetLeft-m.offsetWidth/2+E.offsetWidth/2;m.scrollTo({left:L,behavior:"smooth"})}}},[s]);return(0,l.useImperativeHandle)(a,()=>({scrollToTab:S})),(0,e.jsxs)("div",{className:"laptop:inset-x-16 tablet:mt-3 desktop:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between",children:[(0,e.jsx)(P.List,{ref:b,className:"laptop:p-0 desktop:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1",style:{scrollbarWidth:"none",msOverflowStyle:"none"},children:(0,e.jsx)("div",{className:"whitespace-nowrap",children:s?.map((o,m)=>(0,e.jsx)(P.Trigger,{ref:i=>{i?h.current.set(o.tabValue,i):h.current.delete(o.tabValue)},className:(0,T.cn)("lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight",o.tabValue===y?.tabValue&&"bg-white"),onClick:i=>w(i,o,m),value:o.tabValue,children:o.tabLabel},o.tabValue))})}),(0,e.jsx)("div",{className:"laptop:gap-2 laptop:flex hidden",children:M.metafields?.global?.specifications&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)(U.SpecsModal,{})," | ",(0,e.jsx)(Z.default,{})]})})]})}),B=(0,l.forwardRef)((t,a)=>{const{locale:s="us",copyWriting:y}=(0,$.useAiuiContext)(),{variant:n,totalSavings:p}=(0,z.useBizProductContext)(),x=(0,l.useRef)(null),[M,b]=(0,l.useState)(null),[h,w]=(0,l.useState)(!0),[A,S]=(0,l.useState)(!1),[o,m]=(0,l.useState)(null),i=(0,l.useRef)(null),[E,L]=(0,l.useState)(!1),f=(0,l.useMemo)(()=>{if(t?.galleryTabType===k.GalleryTabType.GALLERY_IMAGE_MAIN)return"size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]";t?.galleryTabType===k.GalleryTabType.GALLERY_IMAGE_FEATURES||(t?.galleryTabType,k.GalleryTabType.GALLERY_IMAGE_SCENE)},[t?.galleryTabType]),_=(0,l.useCallback)(()=>{o?.isBeginning?t.onPrevTab?.():o?.slidePrev()},[o,t]),C=(0,l.useCallback)(()=>{o?.isEnd?t.onNextTab?.():o?.slideNext()},[o,t]);return(0,l.useEffect)(()=>{o&&t.targetSlideIndex&&(o.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[o,t.targetSlideIndex,t]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(G.Swiper,{ref:a,className:"h-full",onSwiper:m,onProgress:r=>{w(r.isBeginning),S(r.isEnd)},onTouchEnd:(r,v)=>{r.isBeginning&&r.swipeDirection==="prev"?_():r.isEnd&&r.swipeDirection==="next"&&C()},pagination:{clickable:!0,el:x.current},thumbs:{swiper:M},modules:[g.Mousewheel,g.Thumbs,g.Navigation,g.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((r,v)=>{const R=`${t.tabValue}-${v}`,D=()=>{(0,Q.gaTrack)({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${n.sku}`,component_type:"image",component_name:t?.tabLabel||"",position:v+1,creative_id:"",component_title:"",component_description:"",navigation:""}})},c=r?._responsiveSource||r?.image?.url||"";return(0,e.jsx)(G.SwiperSlide,{className:"h-full",children:(0,e.jsx)(X.ExposureDetector,{onExposure:D,exposureKey:R,threshold:.5,duration:2e3,className:"h-full",children:(0,e.jsx)(N.Picture,{source:c,alt:r?.image?.altText,className:(0,T.cn)("h-full",f),imgClassName:"object-cover h-full"})})},t?.id+"SwiperSlideItem"+v)})}),n.availableForSale&&!!p&&!t.index&&(0,e.jsx)(N.Badge,{size:"lg",className:"bg-brand laptop:left-16 laptop:top-5 desktop:left-6 desktop:top-6 absolute left-4 top-3 z-[2] text-white",children:`${(0,q.formatPrice)({amount:p,currencyCode:n?.price?.currencyCode,locale:s})} ${y?.off}`}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:_,children:(0,e.jsx)(Y,{className:(0,T.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 desktop:right-6 z-10 hidden -translate-y-1/2 cursor-pointer","swiper-button"),onClick:C,children:(0,e.jsx)(O,{className:(0,T.cn)("tablet:size-10 lg-desktop:size-12")})}),(0,e.jsxs)("div",{className:"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 desktop:bottom-[20px] desktop:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between",children:[(0,e.jsx)("div",{className:"tablet:block hidden",children:(0,e.jsx)(G.Swiper,{className:"flex items-center justify-between",onSwiper:b,spaceBetween:12,slidesPerView:6,freeMode:!0,watchSlidesProgress:!0,modules:[g.Navigation,g.Thumbs],children:t?.galleries?.map((r,v)=>(0,e.jsx)(G.SwiperSlide,{className:"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded",children:(0,e.jsx)(N.Picture,{source:r.image?.url,alt:r.image?.altText,className:"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white",imgClassName:"object-contain h-full"})},t?.id+"SwiperSlideThumbItem"+v))})}),!t?.index&&(0,e.jsxs)("div",{className:"flex items-center gap-2",children:[(0,e.jsx)(N.Picture,{source:t?.comment?.avatar?.url,className:"laptop:size-10 size-8 shrink-0 rounded-full",imgClassName:"object-cover "}),(0,e.jsx)("div",{className:"relative max-w-[528px] overflow-hidden",children:(0,e.jsx)("div",{ref:i,className:(0,T.cn)("line-clamp-2"),style:{},children:(0,e.jsx)(N.Text,{html:t?.comment?.content,className:"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]"})})})]})]}),(0,e.jsx)("div",{ref:x,className:"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100"})]})}),de=t=>{const[a,s]=(0,l.useState)(null),y=(0,l.useCallback)(()=>{a?.isBeginning?t.onPrevTab?.():a?.slidePrev()},[a,t]),n=(0,l.useCallback)(()=>{a?.isEnd?t.onNextTab?.():a?.slideNext()},[a,t]);return(0,l.useEffect)(()=>{a&&t.targetSlideIndex!==null&&t.targetSlideIndex!==void 0&&(a.slideTo(t.targetSlideIndex,0),t.onSlideChange?.())},[a,t.targetSlideIndex,t]),(0,e.jsxs)("div",{className:"h-full [&_.swiper-button]:hover:opacity-100",children:[(0,e.jsx)(G.Swiper,{className:"h-full",onSwiper:s,onTouchEnd:(p,x)=>{p.isBeginning&&p.swipeDirection==="prev"?y():p.isEnd&&p.swipeDirection==="next"&&n()},modules:[g.Mousewheel,g.Thumbs,g.Navigation,g.Pagination],mousewheel:{forceToAxis:!0},breakpoints:{0:{slidesPerView:1,freeMode:!1}},children:t?.galleries?.map((p,x)=>(0,e.jsx)(G.SwiperSlide,{className:"h-full",children:(0,e.jsxs)("video",{controls:!0,className:"size-full object-cover",children:[(0,e.jsx)("track",{kind:"captions"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/mp4"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/webm"}),(0,e.jsx)("source",{src:p?.sources?.[0]?.url,type:"video/ogg"})]})},t?.id+"SwiperSlideItem"+x))}),(0,e.jsx)("div",{className:(0,T.cn)("swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:y,children:(0,e.jsx)(Y,{className:"tablet:size-10 lg-desktop:size-12"})}),(0,e.jsx)("div",{className:(0,T.cn)("tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer"),onClick:n,children:(0,e.jsx)(O,{className:"tablet:size-10 lg-desktop:size-12"})})]})},ge=t=>(0,e.jsx)("div",{children:"3D View"});var ue=(0,J.withLayout)(ne);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport { Text, Picture, Button, Badge } from '../../../../../components/index.js'\nimport {\n useCallback,\n useMemo,\n useState,\n forwardRef,\n useRef,\n type RefObject,\n useEffect,\n type Dispatch,\n type SetStateAction,\n useImperativeHandle,\n} from 'react'\nimport { Swiper, SwiperSlide, type SwiperRef } from 'swiper/react'\nimport { Navigation, Mousewheel, Thumbs, Pagination } from 'swiper/modules'\nimport { cn } from '../../../../../helpers/index.js'\nimport { GalleryTabType } from './types.js'\nimport { Content, List, Root, Trigger } from '@radix-ui/react-tabs'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useVariantMedia } from '../../../hooks/use-variant-media.js'\nimport { SpecsModal } from './components/SpecsModal.js'\nimport CompareModal from './components/CompareModal.js'\nimport { formatPrice } from '../../../utils/index.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\nimport { gaTrack } from '../../../../../shared/track.js'\nimport { ExposureDetector } from '../../../../../components/index.js'\n\nimport type { Swiper as SwiperType } from 'swiper'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\nimport type { ProductGalleryProps, ProductGalleryTabItemProps, GalleryTabItemProps } from './types.js'\n\nconst SwiperLeftButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect x=\"48\" y=\"48\" width=\"48\" height=\"48\" rx=\"24\" transform=\"rotate(-180 48 48)\" fill=\"white\" />\n <path\n d=\"M25.1035 16.8545C25.5372 16.3818 26.246 16.3818 26.6797 16.8545C27.1067 17.3201 27.1067 18.0706 26.6797 18.5361L21.668 24L26.6797 29.4639C27.1067 29.9294 27.1067 30.6799 26.6797 31.1455C26.246 31.6182 25.5372 31.6182 25.1035 31.1455L19.3203 24.8408C18.8933 24.3752 18.8933 23.6248 19.3203 23.1592L25.1035 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst SwiperRightButtonIcon = (props: React.SVGProps<SVGSVGElement>) => {\n return (\n <svg width=\"48\" height=\"48\" viewBox=\"0 0 48 48\" fill=\"none\" xmlns=\"http://www.w3.org/2000/svg\" {...props}>\n <rect width=\"48\" height=\"48\" rx=\"24\" transform=\"matrix(1 -8.74228e-08 -8.74228e-08 -1 0 48)\" fill=\"white\" />\n <path\n d=\"M22.8965 16.8545C22.4628 16.3818 21.754 16.3818 21.3203 16.8545C20.8933 17.3201 20.8933 18.0706 21.3203 18.5361L26.332 24L21.3203 29.4639C20.8933 29.9294 20.8933 30.6799 21.3203 31.1455C21.754 31.6182 22.4628 31.6182 22.8965 31.1455L28.6797 24.8408C29.1067 24.3752 29.1067 23.6248 28.6797 23.1592L22.8965 16.8545Z\"\n fill=\"currentColor\"\n />\n </svg>\n )\n}\n\nconst ProductGallery = () => {\n const { copyWriting } = useAiuiContext()\n const { product, variant, selectedOptions } = useBizProductContext()\n const defaultMediaData = useVariantMedia({ product, variant })\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const productGalleryTabRef = useRef<ProductGalleryTabRef>(null)\n\n const customMediaList = variant?.metafields?.component?.custom_media_list\n let productList: ImageMedia[], sceneList: ImageMedia[], keyFeaturesList: ImageMedia[], videoList: VideoMedia[]\n\n if (customMediaList && customMediaList?.available) {\n productList = customMediaList?.product || []\n sceneList = customMediaList?.scenarios || []\n keyFeaturesList = customMediaList?.keyFeatures || []\n videoList = customMediaList?.video || []\n } else {\n productList = defaultMediaData?.productList\n sceneList = defaultMediaData?.sceneList\n keyFeaturesList = defaultMediaData?.keyFeaturesList\n videoList = defaultMediaData?.videoList\n }\n\n const allMedia = useMemo(() => [...productList, ...sceneList, ...videoList], [productList, sceneList, videoList])\n\n const galleryMap: Record<string, ImageMedia[] | VideoMedia[]> = {\n productList: productList,\n sceneList: sceneList,\n keyFeaturesList: keyFeaturesList,\n videoList: videoList,\n }\n\n const galleryTabs = useMemo(() => {\n const productTab: ProductGalleryProps =\n product?.payload?.components?.find((item: any) => item.componentKey === 'ProductGallery')?.data || []\n\n return productTab\n ?.map((item: any) => {\n // \u5982\u679C\u5B58\u5728 images \u6570\u7EC4\u4E14\u6709\u6709\u6548\u503C\uFF0C\u4F18\u5148\u4F7F\u7528 images \u521B\u5EFA\u54CD\u5E94\u5F0F\u56FE\u7247\u6570\u636E\n let galleries = galleryMap[item?.galleries] || []\n\n if (item?.images && Array.isArray(item.images) && item.images.length > 0) {\n // \u5904\u7406 images \u6570\u7EC4\uFF0C\u4E3A\u6BCF\u5F20\u56FE\u7247\u751F\u6210\u54CD\u5E94\u5F0F source\n const imageGalleries = item.images\n .map((imageItem: any) => {\n // \u4ECE\u5355\u4E2A\u56FE\u7247\u5BF9\u8C61\u751F\u6210\u54CD\u5E94\u5F0F\u56FE\u7247\u7684 source \u5B57\u7B26\u4E32\n const imageSourceParts: string[] = []\n if (imageItem.image_1920 && imageItem.image_1920.trim()) {\n imageSourceParts.push(`${imageItem.image_1920} 1920`)\n }\n if (imageItem.image_1440 && imageItem.image_1440.trim()) {\n imageSourceParts.push(`${imageItem.image_1440} 1440`)\n }\n if (imageItem.image_1024 && imageItem.image_1024.trim()) {\n imageSourceParts.push(`${imageItem.image_1024} 1024`)\n }\n if (imageItem.image_768 && imageItem.image_768.trim()) {\n imageSourceParts.push(`${imageItem.image_768} 767`)\n }\n if (imageItem.image_390 && imageItem.image_390.trim()) {\n imageSourceParts.push(`${imageItem.image_390} 390`)\n }\n\n // \u5982\u679C\u751F\u6210\u4E86\u6709\u6548\u7684\u54CD\u5E94\u5F0F source\uFF0C\u8FD4\u56DE\u56FE\u7247\u5BF9\u8C61\n if (imageSourceParts.length > 0) {\n const responsiveSource = imageSourceParts.join(', ')\n return {\n image: {\n url: responsiveSource,\n altText: item.comment?.content || '',\n },\n // \u6807\u8BB0\u8FD9\u662F\u4ECE images \u751F\u6210\u7684\uFF0C\u7528\u4E8E\u540E\u7EED\u5904\u7406\n _fromImages: true,\n _responsiveSource: responsiveSource,\n } as any\n }\n return null\n })\n .filter((gallery: any) => gallery !== null) // \u8FC7\u6EE4\u6389\u65E0\u6548\u7684\u56FE\u7247\n\n // \u5982\u679C\u4ECE images \u6570\u7EC4\u751F\u6210\u4E86\u6709\u6548\u7684\u56FE\u7247\uFF0C\u4F7F\u7528\u5B83\u4EEC\uFF1B\u5426\u5219\u56DE\u9000\u5230\u539F\u6709\u7684 galleries\n if (imageGalleries.length > 0) {\n galleries = imageGalleries\n }\n // \u5982\u679C images \u5B58\u5728\u4F46\u90FD\u662F\u7A7A\u503C\uFF0C\u5219\u56DE\u9000\u5230\u539F\u6709\u7684 galleries \u903B\u8F91\n }\n\n return {\n ...item,\n galleries,\n }\n })\n .filter((item: any) => item.galleries.length > 0)\n }, [product?.payload, galleryMap])\n\n const [activeGalleryTab, setActiveGalleryTab] = useState<GalleryTabItemProps>(galleryTabs?.[0])\n const [activeTabIndex, setActiveTabIndex] = useState(0)\n const [targetSlideIndex, setTargetSlideIndex] = useState<number | null>(null)\n\n // \u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\uFF08\u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\uFF09\n const handleNextTab = useCallback(() => {\n const nextIndex = (activeTabIndex + 1) % galleryTabs.length\n setActiveTabIndex(nextIndex)\n setActiveGalleryTab(galleryTabs[nextIndex])\n setTargetSlideIndex(0) // \u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\n }, [activeTabIndex, galleryTabs])\n\n // \u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\uFF08\u8DF3\u8F6C\u5230\u6700\u540E\u4E00\u5F20\uFF09\n const handlePrevTab = useCallback(() => {\n const prevIndex = activeTabIndex === 0 ? galleryTabs.length - 1 : activeTabIndex - 1\n setActiveTabIndex(prevIndex)\n setActiveGalleryTab(galleryTabs[prevIndex])\n // \u8DF3\u8F6C\u5230\u4E0A\u4E00\u4E2A tab \u7684\u6700\u540E\u4E00\u5F20\n const prevTabGalleries = galleryTabs[prevIndex]?.galleries || []\n setTargetSlideIndex(prevTabGalleries.length - 1)\n }, [activeTabIndex, galleryTabs])\n\n // \u5F53 activeTabIndex \u53D8\u5316\u65F6\uFF0C\u81EA\u52A8\u6EDA\u52A8\u5230\u5BF9\u5E94\u7684 tab\n useEffect(() => {\n if (activeTabIndex !== null && activeTabIndex !== undefined) {\n // \u4F7F\u7528 requestAnimationFrame \u786E\u4FDD DOM \u5DF2\u66F4\u65B0\n requestAnimationFrame(() => {\n productGalleryTabRef.current?.scrollToTab(activeTabIndex)\n })\n }\n }, [activeTabIndex])\n\n useEffect(() => {\n // \u5F53 variant \u53D8\u5316\u65F6\uFF0C\u5207\u6362\u5230\u7B2C\u4E00\u4E2A tab\n setActiveGalleryTab(galleryTabs[0])\n setActiveTabIndex(0)\n }, [variant?.id])\n\n // \u4E3A\u6BCF\u4E2A tab \u6E32\u67D3\u5BF9\u5E94\u7684\u7EC4\u4EF6\n const renderGalleryForTab = (tab: any, index: number) => {\n switch (tab?.galleryTabType) {\n case GalleryTabType.GALLERY_IMAGE_MAIN:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_IMAGE_FEATURES:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_IMAGE_SCENE:\n return (\n <ProductGalleryTabImage\n {...tab}\n index={index}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n case GalleryTabType.GALLERY_VIDEO:\n return (\n <ProductGalleryTabVideo\n {...tab}\n onNextTab={handleNextTab}\n onPrevTab={handlePrevTab}\n targetSlideIndex={targetSlideIndex}\n onSlideChange={() => setTargetSlideIndex(null)}\n />\n )\n default:\n return null\n }\n }\n\n return (\n <div id=\"ipc-product-gallery\">\n <Root className=\"relative\" value={activeGalleryTab?.tabValue} defaultValue={galleryTabs?.[0]?.tabValue}>\n <div className=\"tablet:h-[620px] desktop:rounded-2xl desktop:h-[560px] lg-desktop:h-[700px] desktop:relative h-[420px] overflow-hidden bg-[#EAEAEC] \">\n {galleryTabs.map((item: any, index: number) => {\n return (\n <Content key={item.tabValue} className=\"h-full\" value={item.tabValue}>\n {renderGalleryForTab(item, index)}\n </Content>\n )\n })}\n </div>\n <ProductGalleryTab\n ref={productGalleryTabRef}\n galleryTabs={galleryTabs}\n activeGalleryTab={activeGalleryTab}\n setActiveGalleryTab={setActiveGalleryTab}\n setActiveTabIndex={setActiveTabIndex}\n setTargetSlideIndex={setTargetSlideIndex}\n />\n </Root>\n </div>\n )\n}\n\nexport interface ProductGalleryTabRef {\n scrollToTab: (index: number) => void\n}\n\nconst ProductGalleryTab = forwardRef<\n ProductGalleryTabRef,\n {\n galleryTabs: GalleryTabItemProps[]\n activeGalleryTab: GalleryTabItemProps\n setActiveGalleryTab: Dispatch<SetStateAction<GalleryTabItemProps>>\n setActiveTabIndex: Dispatch<SetStateAction<number>>\n setTargetSlideIndex: Dispatch<SetStateAction<number | null>>\n }\n>((props, ref) => {\n const { galleryTabs, activeGalleryTab, setActiveGalleryTab, setActiveTabIndex, setTargetSlideIndex } = props\n const { product } = useBizProductContext()\n const scrollContainerRef = useRef<HTMLDivElement>(null)\n const triggerRefs = useRef<Map<string, HTMLButtonElement>>(new Map())\n\n const handleGalleryTabClick = useCallback(\n (el: React.MouseEvent<HTMLButtonElement>, item: GalleryTabItemProps, index: number) => {\n setActiveGalleryTab(item)\n setActiveTabIndex(index)\n setTargetSlideIndex(0) // \u624B\u52A8\u70B9\u51FB tab \u65F6\uFF0C\u8DF3\u8F6C\u5230\u7B2C\u4E00\u5F20\n scrollToEvent(el)\n },\n [setActiveGalleryTab, setActiveTabIndex, setTargetSlideIndex]\n )\n\n const scrollToEvent = useCallback((event: React.MouseEvent<HTMLButtonElement>) => {\n if (scrollContainerRef.current) {\n const container = scrollContainerRef.current\n const button = event.currentTarget\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }, [])\n\n // \u6EDA\u52A8\u5230\u6307\u5B9A\u7D22\u5F15\u7684 tab\n const scrollToTab = useCallback(\n (index: number) => {\n if (scrollContainerRef.current && galleryTabs[index]) {\n const container = scrollContainerRef.current\n const tabItem = galleryTabs[index]\n const button = triggerRefs.current.get(tabItem.tabValue)\n\n if (button) {\n const scrollLeft = button.offsetLeft - container.offsetWidth / 2 + button.offsetWidth / 2\n container.scrollTo({\n left: scrollLeft,\n behavior: 'smooth',\n })\n }\n }\n },\n [galleryTabs]\n )\n\n useImperativeHandle(ref, () => ({\n scrollToTab,\n }))\n\n return (\n <div className=\"laptop:inset-x-16 tablet:mt-3 desktop:static absolute inset-x-4 bottom-4 z-[2] flex items-center justify-between\">\n <List\n ref={scrollContainerRef}\n className=\"laptop:p-0 desktop:p-1 overflow-x-auto rounded-full bg-[#EAEAEC] p-1\"\n style={{\n scrollbarWidth: 'none',\n msOverflowStyle: 'none',\n }}\n >\n <div className=\"whitespace-nowrap\">\n {galleryTabs?.map((item, index) => {\n return (\n <Trigger\n ref={el => {\n if (el) {\n triggerRefs.current.set(item.tabValue, el)\n } else {\n triggerRefs.current.delete(item.tabValue)\n }\n }}\n className={cn(\n 'lg-desktop:px-7 lg-desktop:pb-[14px] lg-desktop:pt-[15px] lg-desktop:text-[16px] rounded-full px-5 pb-[10px] pt-[11px] text-[14px] font-bold leading-tight',\n item.tabValue === activeGalleryTab?.tabValue && 'bg-white'\n )}\n onClick={el => handleGalleryTabClick(el, item, index)}\n key={item.tabValue}\n value={item.tabValue}\n >\n {item.tabLabel}\n </Trigger>\n )\n })}\n </div>\n </List>\n <div className=\"laptop:gap-2 laptop:flex hidden\">\n {product.metafields?.global?.specifications && (\n <>\n <SpecsModal /> | <CompareModal />\n </>\n )}\n </div>\n </div>\n )\n})\n\nconst ProductGalleryTabImage = forwardRef<SwiperRef, ProductGalleryTabItemProps>((props, ref) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, totalSavings } = useBizProductContext()\n const paginationRef = useRef<HTMLDivElement>(null)\n const [thumbsSwiper, setThumbsSwiper] = useState<SwiperType | null>(null)\n const [isStart, setStart] = useState(true)\n const [isEnd, setEnd] = useState(false)\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n const commentRef = useRef<HTMLDivElement>(null)\n const [shouldScroll, setShouldScroll] = useState(false)\n\n const imageClassName = useMemo(() => {\n if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_MAIN) {\n return 'size-[240px] mx-auto mt-[42px] tablet:mt-16 tablet:size-[420px] lg-desktop:size-[560px]'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_FEATURES) {\n // return '420px'\n } else if (props?.galleryTabType === GalleryTabType.GALLERY_IMAGE_SCENE) {\n // return '560px'\n }\n }, [props?.galleryTabType])\n\n // \u5904\u7406\u5DE6\u53F3\u6309\u94AE\u70B9\u51FB\uFF0C\u652F\u6301\u8DE8 tab \u5FAA\u73AF\n const handlePrevClick = useCallback(() => {\n if (swiper?.isBeginning) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u7B2C\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\n props.onPrevTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slidePrev()\n }\n }, [swiper, props])\n\n const handleNextClick = useCallback(() => {\n if (swiper?.isEnd) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\n props.onNextTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slideNext()\n }\n }, [swiper, props])\n\n // \u76D1\u542C targetSlideIndex\uFF0C\u5F53 tab \u5207\u6362\u65F6\u8DF3\u8F6C\u5230\u6307\u5B9A\u7684 slide\n useEffect(() => {\n if (swiper && !!props.targetSlideIndex) {\n swiper.slideTo(props.targetSlideIndex, 0) // 0 \u8868\u793A\u7ACB\u5373\u8DF3\u8F6C\uFF0C\u65E0\u52A8\u753B\n props.onSlideChange?.() // \u6E05\u9664 targetSlideIndex\n }\n }, [swiper, props.targetSlideIndex, props])\n\n // \u68C0\u6D4B\u6587\u672C\u5185\u5BB9\u662F\u5426\u8D85\u8FC7\u5BB9\u5668\u9AD8\u5EA6\uFF0C\u51B3\u5B9A\u662F\u5426\u9700\u8981\u6EDA\u52A8\n // useEffect(() => {\n // if (commentRef.current) {\n // const container = commentRef.current\n // const contentHeight = container.scrollHeight\n // const containerHeight = container.clientHeight\n // const needsScroll = contentHeight > containerHeight\n // setShouldScroll(needsScroll)\n // }\n // }, [])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n ref={ref}\n className=\"h-full\"\n // navigation={{\n // nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n // prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n // }}\n onSwiper={setSwiper}\n onProgress={swiper => {\n setStart(swiper.isBeginning)\n setEnd(swiper.isEnd)\n }}\n onTouchEnd={(swiper, event) => {\n if (swiper.isBeginning && swiper.swipeDirection === 'prev') {\n handlePrevClick()\n } else if (swiper.isEnd && swiper.swipeDirection === 'next') {\n handleNextClick()\n }\n }}\n pagination={{\n clickable: true,\n el: paginationRef.current,\n }}\n thumbs={{ swiper: thumbsSwiper }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n // \u751F\u6210\u552F\u4E00\u7684\u66DD\u5149 key\uFF08tabId + index\uFF09\n const exposureKey = `${props.tabValue}-${jIndex}`\n\n // \u66DD\u5149\u68C0\u6D4B\u56DE\u8C03\n const handleExposure = () => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_impression',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n component_type: 'image',\n component_name: props?.tabLabel || '',\n position: jIndex + 1,\n creative_id: '',\n component_title: '',\n component_description: '',\n navigation: '',\n },\n })\n }\n\n // \u4F18\u5148\u4F7F\u7528\u4ECE images \u751F\u6210\u7684\u54CD\u5E94\u5F0F source\uFF0C\u5426\u5219\u4F7F\u7528\u539F\u6709\u7684 image.url\n const pictureSource = (item as any)?._responsiveSource || item?.image?.url || ''\n\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <ExposureDetector\n onExposure={handleExposure}\n exposureKey={exposureKey}\n threshold={0.5}\n duration={2000}\n className=\"h-full\"\n >\n <Picture\n source={pictureSource}\n alt={item?.image?.altText}\n className={cn('h-full', imageClassName)}\n imgClassName=\"object-cover h-full\"\n />\n </ExposureDetector>\n </SwiperSlide>\n )\n })}\n </Swiper>\n {variant.availableForSale && !!totalSavings && !props.index && (\n <Badge\n size=\"lg\"\n className=\"bg-brand laptop:left-16 laptop:top-5 desktop:left-6 desktop:top-6 absolute left-4 top-3 z-[2] text-white\"\n >\n {`${formatPrice({\n amount: totalSavings,\n currencyCode: variant?.price?.currencyCode,\n locale: locale,\n })} ${copyWriting?.off}`}\n </Badge>\n )}\n <div\n className={cn(\n 'tablet:opacity-0 tablet:block tablet:absolute tablet:top-1/2 laptop:left-16 tablet:left-6 desktop:left-6 z-10 hidden -translate-y-1/2 cursor-pointer',\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n `swiper-button`\n )}\n onClick={handlePrevClick}\n >\n <SwiperLeftButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n <div\n className={cn(\n 'tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 laptop:right-16 tablet:right-6 desktop:right-6 z-10 hidden -translate-y-1/2 cursor-pointer',\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n `swiper-button`\n )}\n onClick={handleNextClick}\n >\n <SwiperRightButtonIcon className={cn('tablet:size-10 lg-desktop:size-12')} />\n </div>\n {/* {props?.galleries?.map((item, jIndex) => {\n return (\n <Picture\n key={props?.id + 'SwiperSlideItem' + jIndex}\n source={item?.image?.url}\n alt={item?.image?.altText}\n className=\"h-full\"\n imgClassName=\"object-cover h-full\"\n />\n )\n })} */}\n <div className=\"tablet:bottom-[70px] tablet:flex laptop:inset-x-16 desktop:bottom-[20px] desktop:inset-x-6 absolute inset-x-4 bottom-[94px] z-10 items-center justify-between\">\n <div className=\"tablet:block hidden\">\n <Swiper\n className=\"flex items-center justify-between\"\n onSwiper={setThumbsSwiper}\n spaceBetween={12}\n slidesPerView={6}\n freeMode={true}\n watchSlidesProgress={true}\n modules={[Navigation, Thumbs]}\n >\n {props?.galleries?.map((item, jIndex) => (\n <SwiperSlide\n key={props?.id + 'SwiperSlideThumbItem' + jIndex}\n className=\"[&.swiper-slide-thumb-active]:border-brand !w-auto cursor-pointer border border-transparent [&.swiper-slide-thumb-active]:rounded\"\n >\n <Picture\n source={item.image?.url}\n alt={item.image?.altText}\n className=\"lg-desktop:size-12 size-10 overflow-hidden rounded bg-white\"\n imgClassName=\"object-contain h-full\"\n />\n </SwiperSlide>\n ))}\n </Swiper>\n </div>\n {!props?.index && (\n <div className=\"flex items-center gap-2\">\n <Picture\n source={props?.comment?.avatar?.url}\n className=\"laptop:size-10 size-8 shrink-0 rounded-full\"\n imgClassName=\"object-cover \"\n />\n <div className=\"relative max-w-[528px] overflow-hidden\">\n <div\n ref={commentRef}\n className={cn('line-clamp-2')}\n style={\n {\n // animationDuration: `3s`,\n }\n }\n >\n <Text\n html={props?.comment?.content}\n className=\"lg-desktop:text-base text-sm font-bold text-[#1D1D1F]\"\n />\n </div>\n </div>\n </div>\n )}\n </div>\n <div\n ref={paginationRef}\n className=\"tablet:hidden absolute inset-x-4 !bottom-[70px] z-10 text-center [&_.swiper-pagination-bullet]:bg-white [&_.swiper-pagination-bullet]:opacity-100\"\n />\n </div>\n )\n})\n\nconst ProductGalleryTabVideo = (props: ProductGalleryTabItemProps) => {\n const [swiper, setSwiper] = useState<SwiperType | null>(null)\n\n // \u5904\u7406\u5DE6\u53F3\u6309\u94AE\u70B9\u51FB\uFF0C\u652F\u6301\u8DE8 tab \u5FAA\u73AF\n const handlePrevClick = useCallback(() => {\n if (swiper?.isBeginning) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u7B2C\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0A\u4E00\u4E2A tab\n props.onPrevTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slidePrev()\n }\n }, [swiper, props])\n\n const handleNextClick = useCallback(() => {\n if (swiper?.isEnd) {\n // \u5F53\u524D tab \u5DF2\u7ECF\u662F\u6700\u540E\u4E00\u5F20\uFF0C\u5207\u6362\u5230\u4E0B\u4E00\u4E2A tab\n props.onNextTab?.()\n } else {\n // \u5426\u5219\u5728\u5F53\u524D tab \u5185\u5207\u6362\n swiper?.slideNext()\n }\n }, [swiper, props])\n\n // \u76D1\u542C targetSlideIndex\uFF0C\u5F53 tab \u5207\u6362\u65F6\u8DF3\u8F6C\u5230\u6307\u5B9A\u7684 slide\n useEffect(() => {\n if (swiper && props.targetSlideIndex !== null && props.targetSlideIndex !== undefined) {\n swiper.slideTo(props.targetSlideIndex, 0) // 0 \u8868\u793A\u7ACB\u5373\u8DF3\u8F6C\uFF0C\u65E0\u52A8\u753B\n props.onSlideChange?.() // \u6E05\u9664 targetSlideIndex\n }\n }, [swiper, props.targetSlideIndex, props])\n\n return (\n <div className=\"h-full [&_.swiper-button]:hover:opacity-100\">\n <Swiper\n className=\"h-full\"\n onSwiper={setSwiper}\n onTouchEnd={(swiper, event) => {\n if (swiper.isBeginning && swiper.swipeDirection === 'prev') {\n handlePrevClick()\n } else if (swiper.isEnd && swiper.swipeDirection === 'next') {\n handleNextClick()\n }\n }}\n // navigation={{\n // nextEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-next`,\n // prevEl: `.ipc-product-gallery-${props?.id}-custom-swiper-button-prev`,\n // }}\n modules={[Mousewheel, Thumbs, Navigation, Pagination]}\n mousewheel={{\n forceToAxis: true,\n }}\n breakpoints={{\n 0: {\n slidesPerView: 1,\n freeMode: false,\n },\n }}\n >\n {props?.galleries?.map((item, jIndex) => {\n return (\n <SwiperSlide className=\"h-full\" key={props?.id + 'SwiperSlideItem' + jIndex}>\n <video controls className=\"size-full object-cover\">\n <track kind=\"captions\" />\n <source src={item?.sources?.[0]?.url} type=\"video/mp4\" />\n <source src={item?.sources?.[0]?.url} type=\"video/webm\" />\n <source src={item?.sources?.[0]?.url} type=\"video/ogg\" />\n </video>\n </SwiperSlide>\n )\n })}\n </Swiper>\n <div\n className={cn(\n 'swiper-button tablet:block tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:left-6 z-10 hidden -translate-y-1/2 cursor-pointer'\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-prev`\n )}\n onClick={handlePrevClick}\n >\n <SwiperLeftButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n <div\n className={cn(\n 'tablet:block swiper-button tablet:opacity-0 tablet:absolute tablet:top-1/2 tablet:right-6 z-10 hidden -translate-y-1/2 cursor-pointer'\n // `ipc-product-gallery-${props?.id}-custom-swiper-button-next`\n )}\n onClick={handleNextClick}\n >\n <SwiperRightButtonIcon className=\"tablet:size-10 lg-desktop:size-12\" />\n </div>\n </div>\n )\n}\n\nconst ProductGalleryTab3DView = (props: ProductGalleryTabItemProps) => {\n return <div>3D View</div>\n}\n\nexport default withLayout(ProductGallery)\n"],
|
|
5
|
+
"mappings": "ukBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAkCI,IAAAI,EAAA,6BAlCJC,EAA+B,6CAC/BC,EAA6C,8CAC7CC,EAWO,iBACPA,EAAoD,wBACpDC,EAA2D,0BAC3DC,EAAmB,2CACnBC,EAA+B,sBAC/BC,EAA6C,gCAC7CC,EAAqC,0CACrCC,EAAgC,+CAChCC,EAA2B,sCAC3BC,EAAyB,4CACzBC,EAA4B,mCAC5BC,EAA2B,2CAC3BC,EAAwB,0CACxBZ,EAAiC,8CAMjC,MAAMa,EAAwBC,MAE1B,QAAC,OAAI,MAAM,KAAK,OAAO,KAAK,QAAQ,YAAY,KAAK,OAAO,MAAM,6BAA8B,GAAGA,EACjG,oBAAC,QAAK,EAAE,KAAK,EAAE,KAAK,MAAM,KAAK,OAAO,KAAK,GAAG,KAAK,UAAU,qBAAqB,KAAK,QAAQ,KAC/F,OAAC,QACC,EAAE,4TACF,KAAK,eACP,GACF,EAIEC,EAA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ACD,EAAQyC,IAAU,CACzBzC,EAAO,aAAeA,EAAO,iBAAmB,OAClD6D,EAAgB,EACP7D,EAAO,OAASA,EAAO,iBAAmB,QACnD8D,EAAgB,CAEpB,EAKA,QAAS,CAAC,aAAY,SAAQ,aAAY,YAAU,EACpD,WAAY,CACV,YAAa,EACf,EACA,YAAa,CACX,EAAG,CACD,cAAe,EACf,SAAU,EACZ,CACF,EAEC,SAAAtE,GAAO,WAAW,IAAI,CAACmB,EAAMoD,OAE1B,OAAC,eAAY,UAAU,SACrB,oBAAC,SAAM,SAAQ,GAAC,UAAU,yBACxB,oBAAC,SAAM,KAAK,WAAW,KACvB,OAAC,UAAO,IAAKpD,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,KACvD,OAAC,UAAO,IAAKA,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,aAAa,KACxD,OAAC,UAAO,IAAKA,GAAM,UAAU,CAAC,GAAG,IAAK,KAAK,YAAY,GACzD,GANmCnB,GAAO,GAAK,kBAAoBuE,CAOrE,CAEH,EACH,KACA,OAAC,OACC,aAAW,MACT,sIAEF,EACA,QAASF,EAET,mBAACtE,EAAA,CAAqB,UAAU,oCAAoC,EACtE,KACA,OAAC,OACC,aAAW,MACT,uIAEF,EACA,QAASuE,EAET,mBAACrE,EAAA,CAAsB,UAAU,oCAAoC,EACvE,GACF,CAEJ,EAEM0E,GAA2B3E,MACxB,OAAC,OAAI,mBAAO,EAGrB,IAAOlB,MAAQ,cAAWoB,EAAc",
|
|
6
|
+
"names": ["ProductGallery_exports", "__export", "ProductGallery_default", "__toCommonJS", "import_jsx_runtime", "import_AiuiProvider", "import_components", "import_react", "import_modules", "import_helpers", "import_types", "import_react_tabs", "import_BizProductProvider", "import_use_variant_media", "import_SpecsModal", "import_CompareModal", "import_utils", "import_Styles", "import_track", "SwiperLeftButtonIcon", "props", "SwiperRightButtonIcon", "ProductGallery", "copyWriting", "product", "variant", "selectedOptions", "defaultMediaData", "swiper", "setSwiper", "productGalleryTabRef", "customMediaList", "productList", "sceneList", "keyFeaturesList", "videoList", "allMedia", "galleryMap", "galleryTabs", "item", "galleries", "imageGalleries", "imageItem", "imageSourceParts", "responsiveSource", "gallery", "activeGalleryTab", "setActiveGalleryTab", "activeTabIndex", "setActiveTabIndex", "targetSlideIndex", "setTargetSlideIndex", "handleNextTab", "nextIndex", "handlePrevTab", "prevIndex", "prevTabGalleries", "renderGalleryForTab", "tab", "index", "ProductGalleryTabImage", "ProductGalleryTabVideo", "ProductGalleryTab", "ref", "scrollContainerRef", "triggerRefs", "handleGalleryTabClick", "el", "scrollToEvent", "event", "container", "button", "scrollLeft", "scrollToTab", "tabItem", "CompareModal", "locale", "totalSavings", "paginationRef", "thumbsSwiper", "setThumbsSwiper", "isStart", "setStart", "isEnd", "setEnd", "commentRef", "shouldScroll", "setShouldScroll", "imageClassName", "handlePrevClick", "handleNextClick", "jIndex", "exposureKey", "handleExposure", "pictureSource", "ProductGalleryTab3DView"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import type { Img } from '../../../../../types/props.js';
|
|
2
|
+
import type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js';
|
|
3
|
+
export declare enum GalleryTabType {
|
|
4
|
+
GALLERY_IMAGE_MAIN = "ipc-gallery-tab-image-main",
|
|
5
|
+
GALLERY_IMAGE_FEATURES = "ipc-gallery-tab-image-features",
|
|
6
|
+
GALLERY_IMAGE_SCENE = "ipc-gallery-tab-image-scene",
|
|
7
|
+
GALLERY_VIDEO = "ipc-gallery-tab-video",
|
|
8
|
+
GALLERY_3D_VIEW = "ipc-gallery-tab-3d-view"
|
|
9
|
+
}
|
|
10
|
+
export interface ProductGalleryTabData {
|
|
11
|
+
tabLabel: string;
|
|
12
|
+
tabValue: string;
|
|
13
|
+
galleries: 'productList' | 'keyFeaturesList' | 'sceneList' | 'videoList';
|
|
14
|
+
galleryTabType: GalleryTabType | string;
|
|
15
|
+
images?: Array<{
|
|
16
|
+
image_390?: string;
|
|
17
|
+
image_768?: string;
|
|
18
|
+
image_1024?: string;
|
|
19
|
+
image_1440?: string;
|
|
20
|
+
image_1920?: string;
|
|
21
|
+
}>;
|
|
22
|
+
comment?: {
|
|
23
|
+
avatar: {
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
content: string;
|
|
27
|
+
};
|
|
28
|
+
id?: string;
|
|
29
|
+
}
|
|
30
|
+
export type ProductGalleryProps = ProductGalleryTabData[];
|
|
31
|
+
export interface ProductGalleryTabItemProps {
|
|
32
|
+
index?: number;
|
|
33
|
+
realIndex?: number;
|
|
34
|
+
galleryTabType: GalleryTabType;
|
|
35
|
+
galleries: ImageMedia[] | VideoMedia[];
|
|
36
|
+
onCurrentTabLoopStart?: (index: number) => void;
|
|
37
|
+
onCurrentTabLoopEnd?: (index: number) => void;
|
|
38
|
+
onNextTab?: () => void;
|
|
39
|
+
onPrevTab?: () => void;
|
|
40
|
+
targetSlideIndex?: number | null;
|
|
41
|
+
onSlideChange?: () => void;
|
|
42
|
+
onImageExposure?: (data: {
|
|
43
|
+
imageUrl: string;
|
|
44
|
+
imageAlt?: string;
|
|
45
|
+
index: number;
|
|
46
|
+
tabId: string;
|
|
47
|
+
}) => void;
|
|
48
|
+
id: string;
|
|
49
|
+
comment?: {
|
|
50
|
+
content: string;
|
|
51
|
+
avatar: Img;
|
|
52
|
+
};
|
|
53
|
+
tabLabel: string;
|
|
54
|
+
tabValue: string;
|
|
55
|
+
}
|
|
56
|
+
export interface GalleryTabItemProps {
|
|
57
|
+
tabLabel: string;
|
|
58
|
+
tabValue: string;
|
|
59
|
+
id: string;
|
|
60
|
+
galleryTabType: GalleryTabType;
|
|
61
|
+
galleries: ImageMedia[] | VideoMedia[];
|
|
62
|
+
images?: {
|
|
63
|
+
image_390?: string;
|
|
64
|
+
image_768?: string;
|
|
65
|
+
image_1024?: string;
|
|
66
|
+
image_1440?: string;
|
|
67
|
+
image_1920?: string;
|
|
68
|
+
};
|
|
69
|
+
comment?: {
|
|
70
|
+
avatar: Img;
|
|
71
|
+
content: string;
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var n=Object.defineProperty;var o=Object.getOwnPropertyDescriptor;var m=Object.getOwnPropertyNames;var l=Object.prototype.hasOwnProperty;var d=(a,e)=>{for(var r in e)n(a,r,{get:e[r],enumerable:!0})},b=(a,e,r,g)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of m(e))!l.call(a,i)&&i!==r&&n(a,i,{get:()=>e[i],enumerable:!(g=o(e,i))||g.enumerable});return a};var p=a=>b(n({},"__esModule",{value:!0}),a);var u={};d(u,{GalleryTabType:()=>s});module.exports=p(u);var s=(t=>(t.GALLERY_IMAGE_MAIN="ipc-gallery-tab-image-main",t.GALLERY_IMAGE_FEATURES="ipc-gallery-tab-image-features",t.GALLERY_IMAGE_SCENE="ipc-gallery-tab-image-scene",t.GALLERY_VIDEO="ipc-gallery-tab-video",t.GALLERY_3D_VIEW="ipc-gallery-tab-3d-view",t))(s||{});
|
|
2
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductGallery/types.ts"],
|
|
4
|
+
"sourcesContent": ["import type { Img, Video } from '../../../../../types/props.js'\nimport type { ImageMedia, VideoMedia } from '../../../hooks/use-variant-media.js'\n\nexport enum GalleryTabType {\n GALLERY_IMAGE_MAIN = 'ipc-gallery-tab-image-main',\n GALLERY_IMAGE_FEATURES = 'ipc-gallery-tab-image-features',\n GALLERY_IMAGE_SCENE = 'ipc-gallery-tab-image-scene',\n GALLERY_VIDEO = 'ipc-gallery-tab-video',\n GALLERY_3D_VIEW = 'ipc-gallery-tab-3d-view',\n}\n\n// \u8F93\u5165\u6570\u636E\u7684\u7C7B\u578B\u5B9A\u4E49\uFF08\u4ECE product.payload.components \u4E2D\u83B7\u53D6\u7684\u539F\u59CB\u6570\u636E\u683C\u5F0F\uFF09\nexport interface ProductGalleryTabData {\n tabLabel: string\n tabValue: string\n galleries: 'productList' | 'keyFeaturesList' | 'sceneList' | 'videoList'\n galleryTabType: GalleryTabType | string\n images?: Array<{\n image_390?: string\n image_768?: string\n image_1024?: string\n image_1440?: string\n image_1920?: string\n }>\n comment?: {\n avatar: {\n url: string\n }\n content: string\n }\n id?: string\n}\n\nexport type ProductGalleryProps = ProductGalleryTabData[]\n\nexport interface ProductGalleryTabItemProps {\n index?: number\n realIndex?: number\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n onCurrentTabLoopStart?: (index: number) => void\n onCurrentTabLoopEnd?: (index: number) => void\n onNextTab?: () => void\n onPrevTab?: () => void\n targetSlideIndex?: number | null\n onSlideChange?: () => void\n onImageExposure?: (data: { imageUrl: string; imageAlt?: string; index: number; tabId: string }) => void\n id: string\n comment?: {\n content: string\n avatar: Img\n }\n tabLabel: string\n tabValue: string\n // galleryImgs?: Img[]\n // galleryVideo?: Video\n // gallery3DView?: Video\n}\n\nexport interface GalleryTabItemProps {\n tabLabel: string\n tabValue: string\n id: string\n galleryTabType: GalleryTabType\n galleries: ImageMedia[] | VideoMedia[]\n images?: {\n image_390?: string\n image_768?: string\n image_1024?: string\n image_1440?: string\n image_1920?: string\n }\n comment?: {\n avatar: Img\n content: string\n }\n}\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,oBAAAE,IAAA,eAAAC,EAAAH,GAGO,IAAKE,OACVA,EAAA,mBAAqB,6BACrBA,EAAA,uBAAyB,iCACzBA,EAAA,oBAAsB,8BACtBA,EAAA,cAAgB,wBAChBA,EAAA,gBAAkB,0BALRA,OAAA",
|
|
6
|
+
"names": ["types_exports", "__export", "GalleryTabType", "__toCommonJS"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
declare const ProductGridBox: ({ BoxLeftGallery, BoxRightDetail, BoxBottomSummary, }: {
|
|
2
|
+
BoxLeftGallery: React.ReactNode;
|
|
3
|
+
BoxRightDetail: React.ReactNode;
|
|
4
|
+
BoxBottomSummary: React.ReactNode;
|
|
5
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export default ProductGridBox;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var s=Object.defineProperty;var l=Object.getOwnPropertyDescriptor;var r=Object.getOwnPropertyNames;var i=Object.prototype.hasOwnProperty;var k=(o,t)=>{for(var e in t)s(o,e,{get:t[e],enumerable:!0})},m=(o,t,e,c)=>{if(t&&typeof t=="object"||typeof t=="function")for(let a of r(t))!i.call(o,a)&&a!==e&&s(o,a,{get:()=>t[a],enumerable:!(c=l(t,a))||c.enumerable});return o};var x=o=>m(s({},"__esModule",{value:!0}),o);var R={};k(R,{default:()=>N});module.exports=x(R);var p=require("react/jsx-runtime"),d=require("../../../../components/index.js");const G=({BoxLeftGallery:o,BoxRightDetail:t,BoxBottomSummary:e})=>(0,p.jsxs)("div",{id:"ipc-product-card",className:"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]",children:[(0,p.jsxs)(d.Grid,{className:"desktop:gap-4 lg-desktop:gap-8 gap-8",children:[(0,p.jsx)(d.GridItem,{className:"laptop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] col-span-12 h-fit",children:o}),(0,p.jsx)(d.GridItem,{className:"desktop:col-start-9 desktop:col-span-4 col-span-12",children:t})]}),e]});var N=G;
|
|
2
|
+
//# sourceMappingURL=ProductGridBox.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../src/biz-components/Listing/components/ProductCard/ProductGridBox.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Grid, GridItem } from '../../../../components/index.js'\n\nconst ProductGridBox = ({\n BoxLeftGallery,\n BoxRightDetail,\n BoxBottomSummary,\n}: {\n BoxLeftGallery: React.ReactNode\n BoxRightDetail: React.ReactNode\n BoxBottomSummary: React.ReactNode\n}) => {\n return (\n <div id=\"ipc-product-card\" className=\"desktop:mt-6 desktop:px-16 lg-desktop:px-[calc(50%-832px)]\">\n <Grid className=\"desktop:gap-4 lg-desktop:gap-8 gap-8\">\n <GridItem className=\"laptop:px-0 desktop:col-start-1 desktop:col-span-8 desktop:sticky desktop:top-[124px] col-span-12 h-fit\">\n {BoxLeftGallery}\n </GridItem>\n <GridItem className=\"desktop:col-start-9 desktop:col-span-4 col-span-12\">{BoxRightDetail}</GridItem>\n </Grid>\n {BoxBottomSummary}\n </div>\n )\n}\n\nexport default ProductGridBox\n"],
|
|
5
|
+
"mappings": "yaAAA,IAAAA,EAAA,GAAAC,EAAAD,EAAA,aAAAE,IAAA,eAAAC,EAAAH,GAaM,IAAAI,EAAA,6BAbNC,EAA+B,2CAE/B,MAAMC,EAAiB,CAAC,CACtB,eAAAC,EACA,eAAAC,EACA,iBAAAC,CACF,OAMI,QAAC,OAAI,GAAG,mBAAmB,UAAU,6DACnC,qBAAC,QAAK,UAAU,uCACd,oBAAC,YAAS,UAAU,0GACjB,SAAAF,EACH,KACA,OAAC,YAAS,UAAU,qDAAsD,SAAAC,EAAe,GAC3F,EACCC,GACH,EAIJ,IAAOP,EAAQI",
|
|
6
|
+
"names": ["ProductGridBox_exports", "__export", "ProductGridBox_default", "__toCommonJS", "import_jsx_runtime", "import_components", "ProductGridBox", "BoxLeftGallery", "BoxRightDetail", "BoxBottomSummary"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
declare const _default: import("react").ForwardRefExoticComponent<Omit<object, keyof import("../../../../../shared/Styles.js").StylesProps> & Partial<import("../../../../../shared/Styles.js").StylesProps & import("../../../../../shared/Styles.js").ContainerProps> & {
|
|
2
|
+
className?: string;
|
|
3
|
+
data?: Record<string, any>;
|
|
4
|
+
} & import("react").RefAttributes<any>>;
|
|
5
|
+
export default _default;
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
"use strict";var Y=Object.create;var z=Object.defineProperty;var Z=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.getPrototypeOf,ae=Object.prototype.hasOwnProperty;var ne=(o,t)=>{for(var l in t)z(o,l,{get:t[l],enumerable:!0})},W=(o,t,l,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ee(t))!ae.call(o,s)&&s!==l&&z(o,s,{get:()=>t[s],enumerable:!(i=Z(t,s))||i.enumerable});return o};var oe=(o,t,l)=>(l=o!=null?Y(te(o)):{},W(t||!o||!o.__esModule?z(l,"default",{value:o,enumerable:!0}):l,o)),le=o=>W(z({},"__esModule",{value:!0}),o);var se={};ne(se,{default:()=>ce});module.exports=le(se);var e=require("react/jsx-runtime"),a=require("../../../../../components/index.js"),O=require("../../../BizProductProvider.js"),k=require("react"),f=require("../../../utils/index.js"),B=require("../../../../AiuiProvider/index.js"),V=oe(require("decimal.js")),q=require("../../../utils/textFormat.js"),H=require("../../../../../shared/Styles.js"),Q=require("../../../../../components/index.js"),U=require("../../../../../shared/track.js");const ie=()=>{const{locale:o="us",copyWriting:t}=(0,B.useAiuiContext)(),{product:l,variant:i,finalPrice:s,comparePrice:u,coupon:v,selectedOptions:x,selectedVariants:g,totalSavings:r,onAddToCart:A,onBuyNow:j,savingDetail:N,checkedBundle:D,joinedRecommendBuyProducts:n,setJoinedRecommendBuyProducts:b,setSavingDetail:F,addToCartLoading:h,buyNowLoading:L,profile:_,addOrder:S,setAddOrder:E}=(0,O.useBizProductContext)(),G=(0,k.useMemo)(()=>l?.payload?.components?.find(d=>d.componentKey==="ProductSummary")?.data||{},[l?.payload]),[w]=g,I=(0,k.useMemo)(()=>{const d=D?.variants.find(C=>C.variant.sku===w?.sku),p=new V.default(w?.price?.amount||0).minus(d?.price||w?.price?.amount).toNumber();let m=new V.default(w?.price?.amount||0);_?.email&&(m=m.minus(N?.member||0));const P=m.minus(N?.coupon).minus(p).toNumber();return Math.floor(P*100)/100},[w,D,_,N?.member,N?.coupon]);if(!i.availableForSale)return null;const{bundleVariant:$,giftVariant:T,exchangeVariant:R}=re()||{},[c,y]=(0,k.useState)();(0,k.useEffect)(()=>{y({bundle:n.bundle?.value?void 0:$,gift:n.gift?.value?void 0:T,exchange:n.exchange?.value?void 0:R})},[$,T,R,n]);const X=(0,k.useMemo)(()=>{const d=[];return S&&S.forEach((p,m)=>{n[p]?.value&&d.push({type:p,key:`${p}-${m}`})}),d},[S,n]);return(0,e.jsx)("div",{className:"ipc-product-summary laptop:px-16 desktop:px-0 desktop:mt-[96px] lg-desktop:mt-[128px] mt-16",children:(0,e.jsx)("div",{className:"laptop:rounded-2xl bg-[#F5F5F7]",children:(0,e.jsxs)(a.Grid,{className:"tablet:p-8 tablet:!pb-0 px-4 pt-6",children:[(0,e.jsxs)(a.GridItem,{className:"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4",children:[(0,e.jsx)(a.Heading,{className:"lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]",html:G?.readyWant?.replace?.("{title}",l?.title)}),(0,e.jsx)("div",{className:"",children:(0,e.jsx)(a.Picture,{source:i.image?.url||l?.images?.[0]?.url,className:"lg-desktop:aspect-[644/368] desktop:aspect-[503/272] laptop:aspect-[331/191] tablet:aspect-[704/380] aspect-[358/192]",imgClassName:"object-cover h-full object-[center_36%]"})})]}),(0,e.jsxs)(a.GridItem,{className:"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6",children:[(0,e.jsxs)("div",{children:[(0,e.jsxs)("div",{className:"flex flex-col gap-4",children:[(0,e.jsx)(Q.ExposureDetector,{exposureKey:"listing_selector",onExposure:()=>{(0,U.gaTrack)({event:"ga4Event",event_name:"component_impression",event_parameters:{page_group:`Product Detail Page${i.sku}`,component_type:"image",component_name:"listing_selector",position:1}})},children:(0,e.jsxs)("div",{className:"flex items-center justify-between gap-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:i.image?.url||l?.images?.[0]?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),(0,e.jsxs)("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[(0,e.jsx)(a.Text,{className:"desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:l.title}),(0,e.jsx)(a.Text,{className:"laptop:text-[14px] desktop:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:`${G?.quantityText} | ${x.color||x.colour||x.couleur}`})]})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"desktop:text-2xl text-base font-bold",html:(0,f.formatPrice)({amount:I,currencyCode:i.price.currencyCode,locale:o})}),I<i?.price?.amount&&(0,e.jsx)(a.Text,{className:"desktop:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through",html:(0,f.formatPrice)({amount:i?.price?.amount,currencyCode:i.price.currencyCode,locale:o})})]})]})}),X.map(({type:d,key:p})=>d==="gift"&&n?.gift?.value?(0,e.jsx)(J,{giftOperation:m=>{b?.({...n,gift:{value:void 0,canOperate:!0}}),y?.({...c,gift:m}),E?.(P=>P.filter(C=>C!=="gift"))},status:!!n?.gift,gift:n?.gift?.value,canOperate:n?.gift?.canOperate},p):d==="bundle"&&n?.bundle?.value?(0,e.jsx)(M,{bundleOperation:m=>{b?.({...n,bundle:{value:void 0,canOperate:!0}}),y?.({...c,bundle:m}),E?.(P=>P.filter(C=>C!=="bundle"))},status:!!n?.bundle,bundleListItem:n?.bundle?.value,canOperate:n?.bundle?.canOperate},p):d==="exchange"&&n?.exchange?.value?(0,e.jsx)(K,{exchangeOperation:m=>{b?.({...n,exchange:{value:void 0,canOperate:!0}}),y?.({...c,exchange:m}),E?.(P=>P.filter(C=>C!=="exchange"))},status:!!n?.exchange,canOperate:n?.exchange?.canOperate,exchange:n?.exchange?.value},p):null)]}),(c?.bundle||c?.gift||c?.exchange)&&(0,e.jsxs)("div",{className:"desktop:mt-8 mt-6",children:[(0,e.jsx)(a.Text,{className:"desktop:text-[18px] text-sm font-bold",html:G?.recommendBuy}),(0,e.jsxs)("div",{className:"desktop:gap-4 mt-4 flex flex-col gap-6",children:[c?.exchange&&(0,e.jsx)(K,{exchangeOperation:d=>{b?.({...n,exchange:{value:d,canOperate:!0}}),y?.({...c,exchange:void 0}),E?.(p=>[...p,"exchange"])},canOperate:n?.exchange?.canOperate,status:!c?.exchange,exchange:c?.exchange}),c?.bundle&&(0,e.jsx)(M,{bundleOperation:d=>{F?.({...N,exchangePurchase:0}),b?.({...n,bundle:{value:d,canOperate:!0}}),y?.({...c,bundle:void 0}),E?.(p=>[...p,"bundle"])},canOperate:n?.bundle?.canOperate,status:!c?.bundle,bundleListItem:c?.bundle}),c?.gift&&(0,e.jsx)(J,{giftOperation:d=>{b?.({...n,gift:{value:d,canOperate:!0}}),y?.({...c,gift:void 0}),E?.(p=>[...p,"gift"])},canOperate:n?.gift?.canOperate,status:!c?.gift,gift:c?.gift})]})]})]}),(0,e.jsxs)("div",{className:"text-right",children:[(0,e.jsx)(a.Text,{className:"laptop:text-xl desktop:text-2xl text-right font-bold",html:`${(0,q.replaceTemplate)(t?.totalPrice||"",{amount:(0,f.formatPrice)({amount:Math.floor(s*100)/100,currencyCode:i.price.currencyCode,locale:o})})}`}),r>0&&(0,e.jsx)(a.Text,{className:"laptop:text-xl desktop:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through",html:(0,f.formatPrice)({amount:u,currencyCode:i.price.currencyCode,locale:o})}),(0,e.jsxs)("div",{className:"mt-4 flex justify-end gap-3",children:[(0,e.jsx)(a.Button,{size:"lg",variant:"secondary",loading:h,className:"tablet:w-auto laptop:w-1/2 desktop:w-auto w-1/2",onClick:()=>A?.(),children:t?.addToCart}),(0,e.jsx)(a.Button,{size:"lg",loading:L,variant:"primary",className:"tablet:w-auto laptop:w-1/2 desktop:w-auto w-1/2",onClick:()=>j?.(),children:t?.shopNow})]})]})]})]})})})},re=()=>{const{bundle:o,variant:t,checkedBundle:l,freeGift:i,checkedGift:s,exchangePurchase:u,checkedExchangePurchase:v}=(0,O.useBizProductContext)();let x,g,r;const{bundleList:A}=o||{},{giftList:j=[]}=i||{},{giftList:N=[]}=u||{},D=A?.filter(h=>h.variants.slice(1,h.variants.length).every(L=>L.variant.availableForSale))||[],[n]=D;x=l||n;const[b]=j?.filter(h=>h.availableForSale)??[];g=s||b;const[F]=N?.filter(h=>h.availableForSale)??[];return r=v||F,{bundleVariant:x,giftVariant:g,exchangeVariant:r}},M=({bundleOperation:o,bundleListItem:t,canOperate:l,status:i})=>{const{locale:s="us",copyWriting:u}=(0,B.useAiuiContext)(),{variant:v,setCheckedBundle:x}=(0,O.useBizProductContext)(),g=t?.variants.filter(r=>r.variant.sku!==v.sku);return(0,e.jsx)("div",{className:"",children:g?.map(r=>(0,e.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:r?.variant?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),(0,e.jsx)("div",{className:"tablet:max-w-none line-clamp-2 flex max-w-[178px] flex-col gap-[6px]",children:(0,e.jsx)(a.Text,{className:"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold",html:r.variant.product.title})})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end justify-center gap-1",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"desktop:text-2xl text-base font-bold",html:(0,f.formatPrice)({amount:r?.price||0,locale:s,currencyCode:r.variant?.price?.currencyCode||""})}),r.price<r.variant.price.amount&&(0,e.jsx)(a.Text,{className:"desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:(0,f.formatPrice)({amount:r.variant.price.amount||0,locale:s,currencyCode:r.variant?.price?.currencyCode||""})})]}),l&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{x?.(i?void 0:t),o?.(t)},className:"size-auto shrink-0 underline",children:i?u?.remove:u?.add})]})]},r.variant.id))})},J=({giftOperation:o,gift:t,status:l,canOperate:i})=>{const{locale:s="us",copyWriting:u}=(0,B.useAiuiContext)(),{freeGift:v,setCheckedGift:x}=(0,O.useBizProductContext)(),{freeLabel:g,count:r}=v||{};return(0,e.jsxs)("div",{className:"flex items-center justify-between gap-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:t?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),(0,e.jsxs)("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[(0,e.jsx)(a.Text,{className:"desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:t?.product?.title}),(0,e.jsx)(a.Text,{className:"laptop:text-[14px] desktop:text-[18px] text-[12px] font-bold text-[#6D6D6F]",html:`x${r} | ${g}`})]})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end justify-center gap-2",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"desktop:text-2xl text-base font-bold",html:g}),(0,e.jsx)(a.Text,{className:"desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:(0,f.formatPrice)({amount:t.price.amount,locale:s,currencyCode:t.price.currencyCode})})]}),i&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{x?.(l?void 0:t),o(t)},className:"size-auto shrink-0 underline",children:l?u?.remove:u?.add})]})]})},K=({exchangeOperation:o,exchange:t,canOperate:l,status:i})=>{const{locale:s="us",copyWriting:u}=(0,B.useAiuiContext)(),{setCheckedExchangePurchase:v}=(0,O.useBizProductContext)();return(0,e.jsxs)("div",{className:"flex items-center justify-between gap-6",children:[(0,e.jsxs)("div",{className:"flex items-center gap-4",children:[(0,e.jsx)(a.Picture,{source:t?.image?.url,className:"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2"}),(0,e.jsxs)("div",{className:"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]",children:[(0,e.jsx)(a.Text,{className:"desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold",html:t?.product?.title}),(0,e.jsx)(a.Text,{className:"laptop:text-[14px] desktop:text-[18px] text-[12px] font-bold text-[#6D6D6F]"})]})]}),(0,e.jsxs)("div",{className:"flex flex-col items-end justify-center gap-2",children:[!!t&&(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)(a.Text,{className:"desktop:text-2xl text-base font-bold",html:(0,f.formatPrice)({amount:t.finalPrice?.amount||0,locale:s,currencyCode:t.price.currencyCode})}),(0,e.jsx)(a.Text,{className:"desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through",html:(0,f.formatPrice)({amount:t.price?.amount||0,locale:s,currencyCode:t.price.currencyCode})})]}),l&&(0,e.jsx)(a.Button,{size:"icon",variant:"link",onClick:()=>{v?.(i?void 0:t),o(t)},className:"size-auto shrink-0 underline",children:i?u?.remove:u?.add})]})]})};var ce=(0,H.withLayout)(ie);
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../../../../src/biz-components/Listing/components/ProductCard/ProductSummary/index.tsx"],
|
|
4
|
+
"sourcesContent": ["import { Text, Button, Container, Grid, GridItem, Picture, Heading } from '../../../../../components/index.js'\nimport { useBizProductContext } from '../../../BizProductProvider.js'\nimport { useEffect, useMemo, useState } from 'react'\nimport { formatPrice } from '../../../utils/index.js'\nimport { useAiuiContext } from '../../../../AiuiProvider/index.js'\nimport type { BundleListItem, ProductVariant, ProductPrice } from '../../../types/product'\nimport Decimal from 'decimal.js'\nimport { replaceTemplate } from '../../../utils/textFormat.js'\nimport { withLayout } from '../../../../../shared/Styles.js'\nimport { ExposureDetector } from '../../../../../components/index.js'\nimport { gaTrack } from '../../../../../shared/track.js'\n\nconst ProductSummary = () => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const {\n product,\n variant,\n finalPrice,\n comparePrice,\n coupon,\n selectedOptions,\n selectedVariants,\n totalSavings,\n onAddToCart,\n onBuyNow,\n savingDetail,\n checkedBundle,\n joinedRecommendBuyProducts,\n setJoinedRecommendBuyProducts,\n setSavingDetail,\n addToCartLoading,\n buyNowLoading,\n profile,\n addOrder,\n setAddOrder,\n } = useBizProductContext()\n\n const productSummaryData = useMemo(() => {\n return product?.payload?.components?.find((item: any) => item.componentKey === 'ProductSummary')?.data || {}\n }, [product?.payload])\n\n const [currentProductVariant] = selectedVariants\n\n const summaryFinalPrice = useMemo(() => {\n const currentBundleVariant = checkedBundle?.variants.find(v => v.variant.sku === currentProductVariant?.sku)\n const currentBundlePrice = new Decimal(currentProductVariant?.price?.amount || 0)\n .minus(currentBundleVariant?.price || currentProductVariant?.price?.amount)\n .toNumber()\n let currentProductPrice = new Decimal(currentProductVariant?.price?.amount || 0)\n if (profile?.email) {\n currentProductPrice = currentProductPrice.minus(savingDetail?.member || 0)\n }\n const finalPrice = currentProductPrice.minus(savingDetail?.coupon).minus(currentBundlePrice).toNumber()\n return Math.floor(finalPrice * 100) / 100\n }, [currentProductVariant, checkedBundle, profile, savingDetail?.member, savingDetail?.coupon])\n\n const isAvailable = variant.availableForSale\n if (!isAvailable) return null\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const { bundleVariant, giftVariant, exchangeVariant } = useRecommendBuyProducts() || {}\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const [initialRecommendBuyProducts, setInitialRecommendBuyProducts] = useState<{\n bundle?: BundleListItem\n gift?: ProductVariant\n exchange?: ProductVariant\n }>()\n\n // eslint-disable-next-line react-hooks/rules-of-hooks\n useEffect(() => {\n setInitialRecommendBuyProducts({\n bundle: joinedRecommendBuyProducts.bundle?.value ? undefined : bundleVariant,\n gift: joinedRecommendBuyProducts.gift?.value ? undefined : giftVariant,\n exchange: joinedRecommendBuyProducts.exchange?.value ? undefined : exchangeVariant,\n })\n }, [bundleVariant, giftVariant, exchangeVariant, joinedRecommendBuyProducts])\n\n // \u6839\u636E\u6DFB\u52A0\u987A\u5E8F\u751F\u6210\u5DF2\u6DFB\u52A0\u4EA7\u54C1\u7684\u5217\u8868\n // eslint-disable-next-line react-hooks/rules-of-hooks\n const orderedJoinedProducts = useMemo(() => {\n const result: Array<{ type: 'bundle' | 'gift' | 'exchange'; key: string }> = []\n\n // \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6DFB\u52A0\n if (addOrder) {\n addOrder.forEach((type, index) => {\n if (joinedRecommendBuyProducts[type]?.value) {\n result.push({ type, key: `${type}-${index}` })\n }\n })\n }\n\n return result\n }, [addOrder, joinedRecommendBuyProducts])\n\n return (\n <div className=\"ipc-product-summary laptop:px-16 desktop:px-0 desktop:mt-[96px] lg-desktop:mt-[128px] mt-16\">\n <div className=\"laptop:rounded-2xl bg-[#F5F5F7]\">\n <Grid className=\"tablet:p-8 tablet:!pb-0 px-4 pt-6\">\n <GridItem className=\"laptop:col-start-1 laptop:col-span-5 col-span-12 flex flex-col justify-between gap-4\">\n <Heading\n className=\"lg-desktop:text-[48px] laptop:text-[32px] desktop:text-[40px] mb-4 text-[24px] font-bold leading-none [&>span]:text-[#D1D1D1]\"\n html={productSummaryData?.readyWant?.replace?.('{title}', product?.title)}\n />\n <div className=\"\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"lg-desktop:aspect-[644/368] desktop:aspect-[503/272] laptop:aspect-[331/191] tablet:aspect-[704/380] aspect-[358/192]\"\n imgClassName=\"object-cover h-full object-[center_36%]\"\n />\n </div>\n </GridItem>\n <GridItem className=\"tablet:pb-8 laptop:col-start-7 laptop:mt-0 laptop:col-span-6 col-span-12 mt-8 flex flex-col justify-between gap-6 pb-6\">\n <div>\n <div className=\"flex flex-col gap-4\">\n <ExposureDetector\n exposureKey=\"listing_selector\"\n onExposure={() => {\n gaTrack({\n event: 'ga4Event',\n event_name: 'component_impression',\n event_parameters: {\n page_group: `Product Detail Page${variant.sku}`,\n component_type: 'image',\n component_name: 'listing_selector',\n position: 1,\n },\n })\n }}\n >\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={variant.image?.url || product?.images?.[0]?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={product.title}\n />\n <Text\n className=\"laptop:text-[14px] desktop:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={`${productSummaryData?.quantityText} | ${selectedOptions.color || selectedOptions.colour || selectedOptions.couleur}`}\n />\n </div>\n </div>\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"desktop:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: summaryFinalPrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n {summaryFinalPrice < variant?.price?.amount && (\n <Text\n className=\"desktop:text-2xl laptop:text-xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: variant?.price?.amount,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n </div>\n </div>\n </ExposureDetector>\n {/* \u6309\u7167\u6DFB\u52A0\u987A\u5E8F\u6E32\u67D3\u5DF2\u6DFB\u52A0\u7684\u4EA7\u54C1 */}\n {orderedJoinedProducts.map(({ type, key }) => {\n if (type === 'gift' && joinedRecommendBuyProducts?.gift?.value) {\n return (\n <ProductGiftSummary\n key={key}\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'gift'))\n }}\n status={!!joinedRecommendBuyProducts?.gift}\n gift={joinedRecommendBuyProducts?.gift?.value}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n />\n )\n }\n if (type === 'bundle' && joinedRecommendBuyProducts?.bundle?.value) {\n return (\n <ProductBundleSummary\n key={key}\n bundleOperation={bundle => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'bundle'))\n }}\n status={!!joinedRecommendBuyProducts?.bundle}\n bundleListItem={joinedRecommendBuyProducts?.bundle?.value}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n />\n )\n }\n if (type === 'exchange' && joinedRecommendBuyProducts?.exchange?.value) {\n return (\n <ProductExchangeSummary\n key={key}\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: undefined,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange })\n // \u4ECE\u6DFB\u52A0\u987A\u5E8F\u4E2D\u79FB\u9664\n setAddOrder?.(prev => prev.filter(t => t !== 'exchange'))\n }}\n status={!!joinedRecommendBuyProducts?.exchange}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n exchange={joinedRecommendBuyProducts?.exchange?.value}\n />\n )\n }\n return null\n })}\n </div>\n {(initialRecommendBuyProducts?.bundle ||\n initialRecommendBuyProducts?.gift ||\n initialRecommendBuyProducts?.exchange) && (\n <div className=\"desktop:mt-8 mt-6\">\n <Text className=\"desktop:text-[18px] text-sm font-bold\" html={productSummaryData?.recommendBuy} />\n <div className=\"desktop:gap-4 mt-4 flex flex-col gap-6\">\n {initialRecommendBuyProducts?.exchange && (\n <ProductExchangeSummary\n exchangeOperation={exchange => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n exchange: {\n value: exchange,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, exchange: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'exchange'])\n }}\n canOperate={joinedRecommendBuyProducts?.exchange?.canOperate}\n status={!initialRecommendBuyProducts?.exchange}\n exchange={initialRecommendBuyProducts?.exchange}\n />\n )}\n {initialRecommendBuyProducts?.bundle && (\n <ProductBundleSummary\n bundleOperation={bundle => {\n setSavingDetail?.({ ...savingDetail, exchangePurchase: 0 })\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n bundle: {\n value: bundle,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, bundle: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'bundle'])\n }}\n canOperate={joinedRecommendBuyProducts?.bundle?.canOperate}\n status={!initialRecommendBuyProducts?.bundle}\n bundleListItem={initialRecommendBuyProducts?.bundle}\n />\n )}\n {initialRecommendBuyProducts?.gift && (\n <ProductGiftSummary\n giftOperation={gift => {\n setJoinedRecommendBuyProducts?.({\n ...joinedRecommendBuyProducts,\n gift: {\n value: gift,\n canOperate: true,\n },\n })\n setInitialRecommendBuyProducts?.({ ...initialRecommendBuyProducts, gift: undefined })\n // \u6DFB\u52A0\u5230\u987A\u5E8F\u6570\u7EC4\u7684\u672B\u5C3E\n setAddOrder?.(prev => [...prev, 'gift'])\n }}\n canOperate={joinedRecommendBuyProducts?.gift?.canOperate}\n status={!initialRecommendBuyProducts?.gift}\n gift={initialRecommendBuyProducts?.gift}\n />\n )}\n </div>\n </div>\n )}\n </div>\n <div className=\"text-right\">\n <Text\n className=\"laptop:text-xl desktop:text-2xl text-right font-bold\"\n html={`${replaceTemplate(copyWriting?.totalPrice || '', { amount: formatPrice({ amount: Math.floor(finalPrice * 100) / 100, currencyCode: variant.price.currencyCode, locale }) })}`}\n />\n\n {totalSavings > 0 && (\n <Text\n className=\"laptop:text-xl desktop:text-2xl ml-1 text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: comparePrice,\n currencyCode: variant.price.currencyCode,\n locale,\n })}\n />\n )}\n <div className=\"mt-4 flex justify-end gap-3\">\n <Button\n size=\"lg\"\n variant=\"secondary\"\n loading={addToCartLoading}\n className=\"tablet:w-auto laptop:w-1/2 desktop:w-auto w-1/2\"\n onClick={() => onAddToCart?.()}\n >\n {copyWriting?.addToCart}\n </Button>\n <Button\n size=\"lg\"\n loading={buyNowLoading}\n variant=\"primary\"\n className=\"tablet:w-auto laptop:w-1/2 desktop:w-auto w-1/2\"\n onClick={() => onBuyNow?.()}\n >\n {copyWriting?.shopNow}\n </Button>\n </div>\n </div>\n </GridItem>\n </Grid>\n </div>\n </div>\n )\n}\n\nconst useRecommendBuyProducts = () => {\n const { bundle, variant, checkedBundle, freeGift, checkedGift, exchangePurchase, checkedExchangePurchase } =\n useBizProductContext()\n let bundleVariant = undefined\n let giftVariant = undefined\n let exchangeVariant = undefined\n const { bundleList } = bundle || {}\n\n const { giftList = [] } = freeGift || {}\n const { giftList: exchangeList = [] } = exchangePurchase || {}\n\n const availableBundleList =\n bundleList?.filter(bundle =>\n bundle.variants.slice(1, bundle.variants.length).every(v => v.variant.availableForSale)\n ) || []\n\n const [firstAvailableBundle] = availableBundleList\n bundleVariant = checkedBundle || firstAvailableBundle\n\n const [firstAvailableGift] = giftList?.filter(gift => gift.availableForSale) ?? []\n giftVariant = checkedGift || firstAvailableGift\n\n const [firstAvailableExchange] = exchangeList?.filter(exchange => exchange.availableForSale) ?? []\n exchangeVariant = checkedExchangePurchase || firstAvailableExchange\n\n return { bundleVariant, giftVariant, exchangeVariant }\n}\n\nconst ProductBundleSummary = ({\n bundleOperation,\n bundleListItem,\n canOperate,\n status,\n}: {\n bundleOperation: (bundle?: BundleListItem) => void\n bundleListItem?: BundleListItem\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { variant, setCheckedBundle } = useBizProductContext()\n const bundleVariants = bundleListItem?.variants.filter(v => v.variant.sku !== variant.sku)\n\n return (\n <div className=\"\">\n {bundleVariants?.map(bundleVariant => {\n return (\n <div className=\"flex items-center justify-between gap-4\" key={bundleVariant.variant.id}>\n <div className=\"flex items-center gap-4\">\n <Picture\n source={bundleVariant?.variant?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none line-clamp-2 flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"desktop:text-[16px] lg-desktop:text-[18px] text-[14px] font-bold\"\n html={bundleVariant.variant.product.title}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-1\">\n {!!bundleListItem && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"desktop:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: bundleVariant?.price || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n {bundleVariant.price < bundleVariant.variant.price.amount && (\n <Text\n className=\"desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: bundleVariant.variant.price.amount || 0,\n locale,\n currencyCode: bundleVariant.variant?.price?.currencyCode || '',\n })}\n />\n )}\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedBundle?.(status ? undefined : bundleListItem)\n bundleOperation?.(bundleListItem)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n })}\n </div>\n )\n}\n\nconst ProductGiftSummary = ({\n giftOperation,\n gift,\n status,\n canOperate,\n}: {\n giftOperation: (gift?: ProductVariant) => void\n gift?: ProductVariant\n status?: boolean\n canOperate?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { freeGift, setCheckedGift } = useBizProductContext()\n const { freeLabel, count } = freeGift || {}\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={gift?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={gift?.product?.title}\n />\n <Text\n className=\"laptop:text-[14px] desktop:text-[18px] text-[12px] font-bold text-[#6D6D6F]\"\n html={`x${count} | ${freeLabel}`}\n />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!gift && (\n <div className=\"flex items-center gap-1\">\n <Text className=\"desktop:text-2xl text-base font-bold\" html={freeLabel} />\n <Text\n className=\"desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: gift.price.amount,\n locale,\n currencyCode: gift.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedGift?.(status ? undefined : gift)\n giftOperation(gift)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nconst ProductExchangeSummary = ({\n exchangeOperation,\n exchange,\n canOperate,\n status,\n}: {\n exchangeOperation: (exchange?: ProductVariant) => void\n exchange?: ProductVariant & { finalPrice?: ProductPrice }\n canOperate?: boolean\n status?: boolean\n}) => {\n const { locale = 'us', copyWriting } = useAiuiContext()\n const { setCheckedExchangePurchase } = useBizProductContext()\n\n return (\n <div className=\"flex items-center justify-between gap-6\">\n <div className=\"flex items-center gap-4\">\n <Picture\n source={exchange?.image?.url}\n className=\"laptop:size-12 lg-desktop:size-16 border-1 size-10 shrink-0 rounded-lg border-[#E4E5E6] bg-[#EAEAEC] object-cover p-2\"\n />\n <div className=\"tablet:max-w-none flex max-w-[178px] flex-col gap-[6px]\">\n <Text\n className=\"desktop:text-[16px] lg-desktop:text-[18px] line-clamp-2 text-[14px] font-bold\"\n html={exchange?.product?.title}\n />\n <Text className=\"laptop:text-[14px] desktop:text-[18px] text-[12px] font-bold text-[#6D6D6F]\" />\n </div>\n </div>\n <div className=\"flex flex-col items-end justify-center gap-2\">\n {!!exchange && (\n <div className=\"flex items-center gap-1\">\n <Text\n className=\"desktop:text-2xl text-base font-bold\"\n html={formatPrice({\n amount: exchange.finalPrice?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n <Text\n className=\"desktop:text-2xl text-base font-bold text-[#6D6D6F] line-through\"\n html={formatPrice({\n amount: exchange.price?.amount || 0,\n locale,\n currencyCode: exchange.price.currencyCode,\n })}\n />\n </div>\n )}\n {canOperate && (\n <Button\n size=\"icon\"\n variant=\"link\"\n onClick={() => {\n setCheckedExchangePurchase?.(status ? undefined : exchange)\n exchangeOperation(exchange)\n }}\n className=\"size-auto shrink-0 underline\"\n >\n {status ? copyWriting?.remove : copyWriting?.add}\n </Button>\n )}\n </div>\n </div>\n )\n}\n\nexport default withLayout(ProductSummary)\n"],
|
|
5
|
+
"mappings": "mkBAAA,IAAAA,GAAA,GAAAC,GAAAD,GAAA,aAAAE,KAAA,eAAAC,GAAAH,IAkGU,IAAAI,EAAA,6BAlGVC,EAA0E,8CAC1EC,EAAqC,0CACrCC,EAA6C,iBAC7CC,EAA4B,mCAC5BC,EAA+B,6CAE/BC,EAAoB,0BACpBC,EAAgC,wCAChCC,EAA2B,2CAC3BP,EAAiC,8CACjCQ,EAAwB,0CAExB,MAAMC,GAAiB,IAAM,CAC3B,KAAM,CAAE,OAAAC,EAAS,KAAM,YAAAC,CAAY,KAAI,kBAAe,EAChD,CACJ,QAAAC,EACA,QAAAC,EACA,WAAAC,EACA,aAAAC,EACA,OAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,aAAAC,EACA,YAAAC,EACA,SAAAC,EACA,aAAAC,EACA,cAAAC,EACA,2BAAAC,EACA,8BAAAC,EACA,gBAAAC,EACA,iBAAAC,EACA,cAAAC,EACA,QAAAC,EACA,SAAAC,EACA,YAAAC,CACF,KAAI,wBAAqB,EAEnBC,KAAqB,WAAQ,IAC1BpB,GAAS,SAAS,YAAY,KAAMqB,GAAcA,EAAK,eAAiB,gBAAgB,GAAG,MAAQ,CAAC,EAC1G,CAACrB,GAAS,OAAO,CAAC,EAEf,CAACsB,CAAqB,EAAIhB,EAE1BiB,KAAoB,WAAQ,IAAM,CACtC,MAAMC,EAAuBb,GAAe,SAAS,KAAKc,GAAKA,EAAE,QAAQ,MAAQH,GAAuB,GAAG,EACrGI,EAAqB,IAAI,EAAAC,QAAQL,GAAuB,OAAO,QAAU,CAAC,EAC7E,MAAME,GAAsB,OAASF,GAAuB,OAAO,MAAM,EACzE,SAAS,EACZ,IAAIM,EAAsB,IAAI,EAAAD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AI,UAAU,0DACb,oBAAC,QACC,UAAU,gFACV,KAAMA,GAAU,SAAS,MAC3B,KACA,OAAC,QAAK,UAAU,8EAA8E,GAChG,GACF,KACA,QAAC,OAAI,UAAU,+CACZ,WAAC,CAACA,MACD,QAAC,OAAI,UAAU,0BACb,oBAAC,QACC,UAAU,uCACV,QAAM,eAAY,CAChB,OAAQA,EAAS,YAAY,QAAU,EACvC,OAAAjD,EACA,aAAciD,EAAS,MAAM,YAC/B,CAAC,EACH,KACA,OAAC,QACC,UAAU,mEACV,QAAM,eAAY,CAChB,OAAQA,EAAS,OAAO,QAAU,EAClC,OAAAjD,EACA,aAAciD,EAAS,MAAM,YAC/B,CAAC,EACH,GACF,EAEDc,MACC,OAAC,UACC,KAAK,OACL,QAAQ,OACR,QAAS,IAAM,CACbS,IAA6BR,EAAS,OAAYf,CAAQ,EAC1DsB,EAAkBtB,CAAQ,CAC5B,EACA,UAAU,+BAET,SAAAe,EAAS/D,GAAa,OAASA,GAAa,IAC/C,GAEJ,GACF,CAEJ,EAEA,IAAOd,MAAQ,cAAWY,EAAc",
|
|
6
|
+
"names": ["ProductSummary_exports", "__export", "ProductSummary_default", "__toCommonJS", "import_jsx_runtime", "import_components", "import_BizProductProvider", "import_react", "import_utils", "import_AiuiProvider", "import_decimal", "import_textFormat", "import_Styles", "import_track", "ProductSummary", "locale", "copyWriting", "product", "variant", "finalPrice", "comparePrice", "coupon", "selectedOptions", "selectedVariants", "totalSavings", "onAddToCart", "onBuyNow", "savingDetail", "checkedBundle", "joinedRecommendBuyProducts", "setJoinedRecommendBuyProducts", "setSavingDetail", "addToCartLoading", "buyNowLoading", "profile", "addOrder", "setAddOrder", "productSummaryData", "item", "currentProductVariant", "summaryFinalPrice", "currentBundleVariant", "v", "currentBundlePrice", "Decimal", "currentProductPrice", "bundleVariant", "giftVariant", "exchangeVariant", "useRecommendBuyProducts", "initialRecommendBuyProducts", "setInitialRecommendBuyProducts", "orderedJoinedProducts", "result", "type", "index", "key", "ProductGiftSummary", "gift", "prev", "t", "ProductBundleSummary", "bundle", "ProductExchangeSummary", "exchange", "freeGift", "checkedGift", "exchangePurchase", "checkedExchangePurchase", "bundleList", "giftList", "exchangeList", "availableBundleList", "firstAvailableBundle", "firstAvailableGift", "firstAvailableExchange", "bundleOperation", "bundleListItem", "canOperate", "status", "setCheckedBundle", "bundleVariants", "giftOperation", "setCheckedGift", "freeLabel", "count", "exchangeOperation", "setCheckedExchangePurchase"]
|
|
7
|
+
}
|